CorsixTH Lua Documentation

Doctor Class

A Doctor (Researcher,Surgan,Psychologist)

Declared on: line 27 of Lua/entities/humanoids/staff/doctor.lua.
Inheritance: Doctor » Staff » Humanoid » Entity

Method Index

Member Index

(*) only used in superclass methods
function Doctor:Doctor(...)

Parameters:

NameTypeDescription
... ? Arguments to base class constructor.

Declared on: line 33 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor._calculateTrainingPerformance(doc_atd, con_skill, class_size)

Generate the performance factor of the training room

Parameters:

NameTypeDescription
doc_atd number Attention to detail of student
con_skill number Skill level of consultant
class_size number Total students in the training room

Declared on: line 177 of Lua/entities/humanoids/staff/doctor.lua.
Note: Is a function rather than a method.

function Doctor:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Staff:afterLoad.
Declared on: line 357 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:fulfillsCriterion(criterion)

Helper function to decide if Staff fulfills a criterion (one of "Doctor", "Nurse", "Psychiatrist", "Surgeon", "Researcher" and "Handyman", "Receptionist", "Junior", "Consultant")

Parameters:

NameTypeDescription
criterion ? ?

Overrides: Staff:fulfillsCriterion.
Declared on: line 333 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:hasSpecialism(trait)

Confirm doctor has specialism

Parameters:

NameTypeDescription
trait string what to check (in is_xxx format)

Declared on: line 165 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:isLearning()

Determine if the staff member should increase their skills

Declared on: line 96 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:isResearching()

Determine if the staff member should contribute to research

Declared on: line 87 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:resetSurgeonState()

Function resets "Surgeon" state for Doctor. Useful for case when on picking up Doctor from Operating Theatre we need to switching him back to regular clothes and type.

Declared on: line 316 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:setCrazy(crazy)

Parameters:

NameTypeDescription
crazy ? ?

Declared on: line 292 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:setProfile(profile)

Parameters:

NameTypeDescription
profile ? ?

Overrides: Staff:setProfile.
Declared on: line 116 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:tostring()

Return string representation

Adds Doctor statistics for a "Doctor" object

Overrides: Staff:tostring.
Declared on: line 365 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:trainSkills(consultant, room_factor, student_count)

any amount towards a specialist skill being taught

There are detailed explanations on the logic to these calculations in the Wiki

Parameters:

NameTypeDescription
consultant entity The person teaching the student
room_factor number What score training objects in the room give
student_count number Total number of students present

Declared on: line 208 of Lua/entities/humanoids/staff/doctor.lua.

function Doctor:updateSkill(trait, amount)

Assign skill points

Parameters:

NameTypeDescription
trait string The trait of focus
amount number The amount granted

Declared on: line 121 of Lua/entities/humanoids/staff/doctor.lua.