CorsixTH Lua Documentation

Staff Class

A Doctor, Nurse, Receptionist, Handyman, or Surgeon

Declared on: line 25 of Lua/entities/humanoids/staff.lua.
Inheritance: Staff » Humanoid » Entity
Subclasses: Doctor, Handyman, Nurse, Receptionist

Method Index

Member Index

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

Parameters:

NameTypeDescription
... ? Arguments to base class constructor.

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

function Staff:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Humanoid:afterLoad.
Declared on: line 651 of Lua/entities/humanoids/staff.lua.

function Staff:checkIfNeedRest()

Check if fatigue is over a certain level (decided by the hospital policy), and go to the StaffRoom if it is.

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

function Staff:despawn()

Despawns the staff member and removes them from the hospital

Overrides: Humanoid:despawn.
Declared on: line 275 of Lua/entities/humanoids/staff.lua.

function Staff:fire()

Immediately terminate the staff member's employment.

Overrides: Humanoid:fire.
Declared on: line 233 of Lua/entities/humanoids/staff.lua.

function Staff: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 ? ?

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

function Staff:getServiceQuality()

Estimate staff service quality based on skills, restfulness (inverse of fatigue) and happiness.

Overrides: Humanoid:getServiceQuality.
Declared on: line 724 of Lua/entities/humanoids/staff.lua.

function Staff:increaseWage(amount)

Increases the wage of the staff member. Also increases happiness and clears any request raise dialogs.

Parameters:

NameTypeDescription
amount integer The amount, in game dollars per month, to increase the salary by.

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

function Staff:isCrackUpTired()

Judge crack up tiredness based on the level config (which has a default of 800)

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

function Staff:isIdle()

Function to decide if staff currently has nothing to do and can be called to a room where they're needed

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

function Staff:isVeryTired()

Judge tiredness based on the level config (which has a default of 700)

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

function Staff:notifyNewRoom(room)

Parameters:

NameTypeDescription
room ? ?

Overrides: Humanoid:notifyNewRoom.
Declared on: line 427 of Lua/entities/humanoids/staff.lua.

function Staff:onClick(ui, button)

Function which is called when the user clicks on the staff member. Responsible for opening a staff information dialog on left click and picking up the staff member on right click.

Parameters:

NameTypeDescription
ui GameUI The UI which the user in question is using.
button string One of: "left", "middle", "right".

Overrides: Humanoid:onClick.
Declared on: line 281 of Lua/entities/humanoids/staff.lua.

function Staff:removeQueuedStaffMessage()

Destroys any raise request window that may be queued

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

function Staff:requestRaise()

Makes the staff member request a raise of 10%, or a wage exactly in the middle of their current and a fair one, whichever is more.

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

function Staff:setDynamicInfoText(text)

Sets dynamic info text before the dynamic info update

Parameters:

NameTypeDescription
text string the string to append

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

function Staff:setHospital(hospital)

Sets the Hospital for a member of staff

Parameters:

NameTypeDescription
hospital Hospital - hospital to assign to member of staff

Overrides: Humanoid:setHospital.
Declared on: line 480 of Lua/entities/humanoids/staff.lua.

function Staff:setPickup(ui, window_to_close)

Function to set pickup action on staff. Pickup action can be deferred.

Parameters:

NameTypeDescription
ui ? ?
window_to_close ? ?

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

function Staff:setProfile(profile)

Parameters:

NameTypeDescription
profile ? ?

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

function Staff:tickDay()

Handle daily adjustments to staff.

Overrides: Humanoid:tickDay.
Declared on: line 40 of Lua/entities/humanoids/staff.lua.

function Staff:tire(amount)

Function for increasing fatigue. Fatigue can be between 0 and 1, so amounts here should be appropriately small comma values.

Parameters:

NameTypeDescription
amount ? ?

Overrides: Humanoid:tire.
Declared on: line 328 of Lua/entities/humanoids/staff.lua.

function Staff:tostring()

Return string representation

Overrides: Humanoid:tostring.
Declared on: line 740 of Lua/entities/humanoids/staff.lua.

function Staff:updateDynamicInfo()

Updates a staff member's dynamic info

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

function Staff:wake(amount)

Function for decreasing fatigue. Fatigue can be between 0 and 1, so amounts here should be appropriately small comma values.

Parameters:

NameTypeDescription
amount ? ?

Overrides: Humanoid:wake.
Declared on: line 338 of Lua/entities/humanoids/staff.lua.