CorsixTH Lua Documentation

PlayerHospital Class

Declared on: line 25 of Lua/hospitals/player_hospital.lua.
Inheritance: PlayerHospital ยป Hospital

Method Index

Member Index

(*) only used in superclass methods
function PlayerHospital:PlayerHospital(world, avail_rooms, name)

Measurement interval in days.

Parameters:

NameTypeDescription
world ? ?
avail_rooms ? ?
name ? ?

Declared on: line 31 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseBenches()

Private function to check if patients have adequate seating

Declared on: line 172 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseDrinksMachines()

Private function to check if patients are getting thirsty

Declared on: line 248 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseHeatingForPatients()

Private function to check warmth of the patients.

Only too hot or cold triggers advice

Declared on: line 208 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseHeatingForStaff()

Private function to check warmth of the staff.

Only too hot or cold triggers advise

Declared on: line 232 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseMoney()

This must occur after monthly maintenance and salary costs

or it may give invalid advice

Declared on: line 128 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseStaffRoom()

Private function to warn about lack of a staff room.

Declared on: line 152 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_adviseToilets()

Private function to warn about a lack of toilets.

Declared on: line 162 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:_warnForLongQueues()

Private function to advise about long queues

Rooms requiring a doctor occasionally trigger the generic message

Declared on: line 265 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:adviseBoilerBreakdown(broken_heat)

Select a relevant message to be displayed to the user

Parameters:

NameTypeDescription
broken_heat 0 or or or 1 Boiler output due to being broken.

Overrides: Hospital:adviseBoilerBreakdown.
Declared on: line 468 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:adviseCannotAffordPlot()

Give visual warning that player doesn't have enough $ to build Let the message remain until cancelled by the player as it is being displayed behind the town map

Overrides: Hospital:adviseCannotAffordPlot.
Declared on: line 563 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:adviseNoGPOffice()

Give advice that a patient is waiting for the player to build a GP's office Called when a patient has passed reception and is waiting for a room to be built. Each piece of advice is only given once per month

Overrides: Hospital:adviseNoGPOffice.
Declared on: line 839 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:advisePlants(placed)

Give advice to the user about maintenance of plants.

Parameters:

NameTypeDescription
placed bool If a plant was placed

Overrides: Hospital:advisePlants.
Declared on: line 284 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:advisePriceLevelImpact(judgment, name)

Tell the player, through the advisor, about the impact of casebook prices

Parameters:

NameTypeDescription
judgment string or under or over or fair The judgment of the price, from Hospital:computePriceLevelImpact
name string The name of the casebook entry of the diagnosis or disease

Overrides: Hospital:advisePriceLevelImpact.
Declared on: line 569 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Hospital:afterLoad.
Declared on: line 856 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:announceRepair(room)

Announces a machine needing repair

Parameters:

NameTypeDescription
room ? The room of the machine

Overrides: Hospital:announceRepair.
Declared on: line 481 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:announceStaffLeave(staff)

Announce to the player that a staff member is leaving the hospital

Parameters:

NameTypeDescription
staff table The staff member

Overrides: Hospital:announceStaffLeave.
Declared on: line 600 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:checkReceptionAdvice(current_month, current_year)

Make players aware of the need for a receptionist and desk.

Parameters:

NameTypeDescription
current_month int Month of the year.
current_year int Current game year.

Declared on: line 307 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:createVip()

Makes the fax which may spawn a VIP

Overrides: Hospital:createVip.
Declared on: line 734 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:dailyAdviceChecks()

Give advice to the player at the end of a day.

Note: For patient/staff warmth checks, advice is only on one or the other per month

Declared on: line 52 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:giveAdvice(msgs, rnd_frac, stay_up)

Advises the player.

Parameters:

NameTypeDescription
msgs array or of or string Messages to select from.
rnd_frac optional or float or in or range or 0 or 1 Fraction of times that the call actually says something.
stay_up bool If true, let the adviser remain visible afterwards.

Overrides: Hospital:giveAdvice.
Declared on: line 395 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:makeEmergencyEndFax(rescued_patients, total, max_bonus, earned)

Makes the fax at the end of an emergency

Parameters:

NameTypeDescription
rescued_patients ? ?
total ? ?
max_bonus ? ?
earned ? ?

Overrides: Hospital:makeEmergencyEndFax.
Declared on: line 721 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:makeNoDiagnosisRoomFax(patient)

Makes the fax requesting player action for the patient who needs a diagnosis room

Parameters:

NameTypeDescription
patient table

Overrides: Hospital:makeNoDiagnosisRoomFax.
Declared on: line 644 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:makeNoTreatmentRoomFax(patient)

Makes the fax requesting player action for the patient who needs a diagnosis room

Parameters:

NameTypeDescription
patient table

Overrides: Hospital:makeNoTreatmentRoomFax.
Declared on: line 606 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:makeRaiseRequest(amount, staff)

Makes the raise request for a staff member

Parameters:

NameTypeDescription
amount num the requested raise increase
staff table the staff member

Overrides: Hospital:makeRaiseRequest.
Declared on: line 586 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:makeVipEndFax(vip_rating, name, cash_reward, vip_message)

Called when the vip is out of the hospital grounds and ready to make their report

Parameters:

NameTypeDescription
vip_rating int
name string
cash_reward int
vip_message int

Overrides: Hospital:makeVipEndFax.
Declared on: line 756 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:monthlyAdviceChecks()

Give advice to the player at the end of a month.

Declared on: line 294 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:msgCured()

Give the user possibly a message about a cured patient.

Overrides: Hospital:msgCured.
Declared on: line 416 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:msgKilled()

Give the user possibly a message about a dead patient.

Overrides: Hospital:msgKilled.
Declared on: line 432 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:msgNeedFirstReceptionDesk()

Give advice to the user about the need to buy the first reception desk.

Overrides: Hospital:msgNeedFirstReceptionDesk.
Declared on: line 336 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:msgReceptionDesk()

Give advice to the user about having bought a reception desk.

Overrides: Hospital:msgReceptionDesk.
Declared on: line 346 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:playSound(sound)

Play a sound file

Parameters:

NameTypeDescription
sound ? ?

Overrides: Hospital:playSound.
Declared on: line 791 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:removeMessage(humanoid)

Remove any message (fax) relating to this humanoid

Parameters:

NameTypeDescription
humanoid table The humanoid

Overrides: Hospital:removeMessage.
Declared on: line 748 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:showGatesToHell(entity)

Show the 'Gates to hell' animation.

Parameters:

NameTypeDescription
entity Entity Gates to hell.

Overrides: Hospital:showGatesToHell.
Declared on: line 381 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:tickEarthquake(stage)

The UI parts of earthquake ticks

Parameters:

NameTypeDescription
stage string Stage of the active earthquake. This must be one of the following, "warning_start", "main_start", "end", "pause", "small_damage", "large damage", "sound"

Overrides: Hospital:tickEarthquake.
Declared on: line 798 of Lua/hospitals/player_hospital.lua.

function PlayerHospital:warnPatientNotPaying(treatment_name)

To avoid spamming the player, the notification is only shown once per month.

param treatment_name (string) The name of the treatment the patient refused to pay for.

Parameters:

NameTypeDescription
treatment_name ? ?

Declared on: line 118 of Lua/hospitals/player_hospital.lua.