CorsixTH Lua Documentation

Hospital Class

Declared on: line 23 of Lua/hospital.lua.
Subclasses: AIHospital, PlayerHospital

Method Index

Member Index

function Hospital:Hospital(world, avail_rooms, name)

Parameters:

NameTypeDescription
world ? ?
avail_rooms ? ?
name ? ?

Declared on: line 28 of Lua/hospital.lua.

function Hospital:_fixBoiler()

Boiler broke down and work is done to get it fixed.

Declared on: line 684 of Lua/hospital.lua.

function Hospital:_getAverageHumanoidsAttribute(humanoids, attribute, default_value, min_count)

Compute average of an attribute for all given humanoids.

Parameters:

NameTypeDescription
humanoids ? The collection of humanoids to query.
attribute str Name of the attribute.
default_value any or type Value to return if there are not enough humanoids.
min_count number Minimal number of sampled humanoids required, 4 by default. If less humanoids are available than the minimal count, additional fake humanoids are 'counted' with the default value of the attribute if possible. Use 1 as min_count to avoid compensating.

Declared on: line 1959 of Lua/hospital.lua.

function Hospital:addHandymanTask(object, taskType, priority, x, y, call)

Adds a handyman task

Parameters:

NameTypeDescription
object ? The object needing attention
taskType ? The handyman task type: repairing, watering, cleaning
priority ? Task priority: 1 is low, 2 is high
x ? coordinate
y ? coordinate
call ? The call added to the dispatcher

Declared on: line 2152 of Lua/hospital.lua.

function Hospital:addInsuranceMoney(company, amount)

Parameters:

NameTypeDescription
company ? ?
amount ? ?

Declared on: line 1471 of Lua/hospital.lua.

function Hospital:addPatient(patient)

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 1589 of Lua/hospital.lua.

function Hospital:addRathole(x, y, wall, parcel)

Add a rathole to the room.

Parameters:

NameTypeDescription
x int X position of the tile containing the rathole.
y int Y position of the tile containing the rathole.
wall string Wall containing the hole (north, west, south, east)
parcel int Parcel number of the xy position.

Declared on: line 2106 of Lua/hospital.lua.

function Hospital:addStaff(staff)

Parameters:

NameTypeDescription
staff ? ?

Declared on: line 1581 of Lua/hospital.lua.

function Hospital:addTileObject(object_category)

Update tile object counts for adding an object.

See also 'Hospital:removeTileObject'

Parameters:

NameTypeDescription
object_category ? Category of the tile object.

Declared on: line 1665 of Lua/hospital.lua.

function Hospital:addToEpidemic(patient)

Determines if there is a suitable epidemic the contagious patient can belong to and adds them to it if possible. N.B. a patient isn't actually contagious until they belong to an epidemic. So if it isn't possible to add a patient to an epidemic they are just treated as a normal patient. @param patient (Patient) patient to attempt to add to an epidemic

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 1310 of Lua/hospital.lua.

function Hospital:adviseBoilerBreakdown()

Select a relevant message to be displayed to the user

Declared on: line 2562 of Lua/hospital.lua.

function Hospital:adviseCannotAffordPlot()

Give visual warning that player doesn't have enough $ to build

Declared on: line 2573 of Lua/hospital.lua.

function Hospital:adviseDiscoverDisease(disease)

Parameters:

NameTypeDescription
disease ? ?

Declared on: line 2559 of Lua/hospital.lua.

function Hospital:adviseNoGPOffice()

Give advice that a patient is waiting for the player to build a GP's office

Declared on: line 2641 of Lua/hospital.lua.

function Hospital:advisePlants()

Give advice to the user about maintenance of plants.

Declared on: line 2539 of Lua/hospital.lua.

function Hospital:advisePriceLevelImpact(judgment, name)

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

Parameters:

NameTypeDescription
judgment ? ?
name ? ?

Declared on: line 2577 of Lua/hospital.lua.

function Hospital:afterLoad(old, new)

Update the loaded game with version 'old' to the version 'new'.

Parameters:

NameTypeDescription
old ? Version of the loaded game.
new ? Version of the code being executed.

Declared on: line 285 of Lua/hospital.lua.

function Hospital:announceRepair(room)

Announces a machine needing repair

Parameters:

NameTypeDescription
room ? ?

Declared on: line 2566 of Lua/hospital.lua.

function Hospital:announceStaffLeave(staff)

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

Parameters:

NameTypeDescription
staff ? ?

Declared on: line 2585 of Lua/hospital.lua.

function Hospital:assignHandymanToTask(handyman, task_index, task_type)

Parameters:

NameTypeDescription
handyman ? ?
task_index ? ?
task_type ? ?

Declared on: line 2220 of Lua/hospital.lua.

function Hospital:boilerBreakdown(broken_heat)

Boiler should break down.

Parameters:

NameTypeDescription
broken_heat 0 or or or 1 Amount of heat to output due to being broken.

Declared on: line 661 of Lua/hospital.lua.

function Hospital:buildReceptionDesksCache()

Collect the reception desks in the hospital into a list for the above function

Declared on: line 1061 of Lua/hospital.lua.

function Hospital:canAcceptPatients()

Check if the hospital is ready to accept patients

Declared on: line 2508 of Lua/hospital.lua.

function Hospital:canConcentrateResearch(disease)

Function that returns true if concentrating research on the disease is possible.

@param disease (string): the disease to be checked.

Parameters:

NameTypeDescription
disease ? ?

Declared on: line 2387 of Lua/hospital.lua.

function Hospital:cancelEpidemics(disease)

Cancel ongoing and future epidemics.

Parameters:

NameTypeDescription
disease table Optional, if specified only epidemics of a certain disease will be cancelled.

Declared on: line 1259 of Lua/hospital.lua.

function Hospital:changeReputation(reason, disease, valueChange)

Normally reputation is changed based on a reason, and the affected

disease also has its own reputation meter.

Parameters:

NameTypeDescription
reason string The reason for changing reputation, for example "cured" or "death".
disease ? The disease, if any, that should be affected.
valueChange integer In some cases, for example at year end, the amount varies a lot. Then it is specified here.

Declared on: line 1802 of Lua/hospital.lua.

function Hospital:changeValue(changeValue)

Change the hospital value by an amount independent of a cost being incurred

Parameters:

NameTypeDescription
changeValue int The amount the hospital value should change by

Declared on: line 2455 of Lua/hospital.lua.

function Hospital:checkDiseaseRequirements(disease)

i.e. a list of rooms (ordered the same as disease.treatment_rooms), and a set of humanoid_classes with

the needed amount of that class as the value

Parameters:

NameTypeDescription
disease String The disease to check the requirements for

Declared on: line 2001 of Lua/hospital.lua.

function Hospital:checkEmergencyOver()

Determine if all of the patients in the emergency have been cured or killed.

If they have end the emergency timer.

Declared on: line 1162 of Lua/hospital.lua.

function Hospital:computePriceLevelImpact(patient, casebook)

is adjusted.

localised disease name when Adviser tells the warning message.

Parameters:

NameTypeDescription
patient patient The patient paying the bill. His/her happiness level
casebook object Disease casebook entry. It's used to display the

Declared on: line 2419 of Lua/hospital.lua.

function Hospital:countFireExtinguishers()

Get the number of fire extinguishers in the hospital.

Declared on: line 1703 of Lua/hospital.lua.

function Hospital:countGeneralObjects()

Get the number of general objects in the hospital.

Declared on: line 1709 of Lua/hospital.lua.

function Hospital:countPatients(max_count)

Count the number of patients in the hospital.

Parameters:

NameTypeDescription
max_count optional or integer If provided, non-negative maximum count to return.

Declared on: line 529 of Lua/hospital.lua.

function Hospital:countPlants()

Get the number of plants in the hospital.

Declared on: line 1697 of Lua/hospital.lua.

function Hospital:countRadiators()

Get the number of radiators in the hospital.

Declared on: line 1691 of Lua/hospital.lua.

function Hospital:countReceptionDesks()

Get the number of reception desks in the hospital.

Declared on: line 1685 of Lua/hospital.lua.

function Hospital:countRoomOfType(type, max_count)

Checks if the hospital has a room of a given type.

Returns Number of that type found, at most max_count is returned if provided.

Parameters:

NameTypeDescription
type string A room_info.id, e.g. "ward".
max_count optional or integer If provided, non-negative maximum count to return.

Declared on: line 1649 of Lua/hospital.lua.

function Hospital:countSittingStanding()

Count number of sitting and standing patients in the hospital.

Declared on: line 545 of Lua/hospital.lua.

function Hospital:countStaffOfCategory(category, max_count)

"Surgeon", "Researcher", "Junior" or "Consultant"

returns Number of that type employed, at most max_count is returned if provided.

Parameters:

NameTypeDescription
category string A humanoid_class or one of the specialists, i.e.
max_count optional or integer If provided, non-negative maximum count to return.

Declared on: line 1632 of Lua/hospital.lua.

function Hospital:createEmergency(emergency)

Creates complete emergency with patients, what disease they have, what's needed to cure them and the fax.

Parameters:

NameTypeDescription
emergency ? ?

Declared on: line 1102 of Lua/hospital.lua.

function Hospital:createVip()

Makes the fax which may spawn a VIP

Declared on: line 2605 of Lua/hospital.lua.

function Hospital:daysUntilNextDisaster()

Decide how many days the hospital functions within specification.

Declared on: line 653 of Lua/hospital.lua.

function Hospital:determineIfContagious(patient)

Determines if a patient is contagious and then attempts to add them the appropriate epidemic if so. @param patient (Patient) patient to determine if contagious

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 1283 of Lua/hospital.lua.

function Hospital:findAssignedTasksToHandyman(handyman)

Search all tasks assigned to a handyman, if any.

Parameters:

NameTypeDescription
handyman ? The handyman instance to check for assigned tasks.

Declared on: line 2205 of Lua/hospital.lua.

function Hospital:findHandymanTaskSubtable(taskType)

Parameters:

NameTypeDescription
taskType ? ?

Declared on: line 2195 of Lua/hospital.lua.

function Hospital:findRatholeTiles(count, left, top, right, bottom)

Find visible corridor wall tiles inside the hospital that are suitable for ratholes, nearest to the centre of the current view first.

Parameters:

NameTypeDescription
count integer Maximum number of tiles to return.
left number Left edge of the current view in map screen coordinates.
top number Top edge of the current view in map screen coordinates.
right number Right edge of the current view in map screen coordinates.
bottom number Bottom edge of the current view in map screen coordinates.

Declared on: line 732 of Lua/hospital.lua.

function Hospital:getAveragePatientAttribute(attribute, default_value, min_count)

Compute average of an attribute for all patients in the hospital.

Parameters:

NameTypeDescription
attribute str Name of the attribute.
default_value ? Value to return if there are not enough patients.
min_count number Minimal number of sampled patients, 4 by default.

Declared on: line 1938 of Lua/hospital.lua.

function Hospital:getAverageStaffAttribute(attribute, default_value)

Compute average of an attribute for all staff in the hospital.

Parameters:

NameTypeDescription
attribute str Name of the attribute.
default_value ? Value to return if there is no staff.

Declared on: line 1951 of Lua/hospital.lua.

function Hospital:getCampaignData()

Collect the hospital level settings relevant for the next hospital

Declared on: line 2461 of Lua/hospital.lua.

function Hospital:getDiseaseReputation(disease)

Return reputation value for disease or hospital

Parameters:

NameTypeDescription
disease ? id (string) - name of the disease

Declared on: line 2621 of Lua/hospital.lua.

function Hospital:getDiseaseReputationPriceFactor(disease)

Calculate value to influence spawn chance based on the price relative to reputation

Parameters:

NameTypeDescription
disease string name of the disease

Declared on: line 2628 of Lua/hospital.lua.

function Hospital:getHandymanTaskPriority(taskIndex, taskType)

Queries the priority of an existing handyman task

Parameters:

NameTypeDescription
taskIndex integer Number of task
taskType ? The handyman task type: repairing, watering, cleaning

Declared on: line 2165 of Lua/hospital.lua.

function Hospital:getHeliportPosition()

Returns the heliport x and y coordinates or nil if none exist.

Declared on: line 623 of Lua/hospital.lua.

function Hospital:getHeliportSpawnPosition()

Returns the tile on which patients should spawn when getting out of the helicopter.

Declared on: line 635 of Lua/hospital.lua.

function Hospital:getIndexOfTask(x, y, taskType, obj)

Find a handyman task by task type, position, and possibly the used object.

Since multiple litter objects may exist at the same tile, the object must be given when cleaning.

Parameters:

NameTypeDescription
x int The X coordinate of the position.
y int The Y coordinate of the position.
taskType ? Type of the task.
obj Object If specified, the object used for doing the task.

Declared on: line 2338 of Lua/hospital.lua.

function Hospital:getObjectBuildCost(name)

Returns how much a given object currently costs to purchase. The cost may be affected by research progress.

Parameters:

NameTypeDescription
name string The name (id) of the object to investigate.

Declared on: line 1359 of Lua/hospital.lua.

function Hospital:getOwnedTileCount()

hospital tiles allowed per simultaneous rat

Total number of tiles across the hospital's owned plots, used to scale rat activity with hospital size.

Declared on: line 864 of Lua/hospital.lua.

function Hospital:getRandomBusyRoom()

Finds a random room with significantly long queues

Declared on: line 2483 of Lua/hospital.lua.

function Hospital:getReceptionDesks(is_staffed)

Fetches a list of all reception desks

Parameters:

NameTypeDescription
is_staffed bool Do the desks need to be staffed

Declared on: line 1054 of Lua/hospital.lua.

function Hospital:getReputationChangeLikelihood()

Compute the likelihood for a reputation change to be effective.

Likelihood gets smaller as hospital reputation gets closer to extreme values.

Declared on: line 1864 of Lua/hospital.lua.

function Hospital:getTreatmentPrice(disease)

Function to determine the price for a treatment, modified by reputation and percentage Treatment charge should never be less than the starting price if reputation falls below 500

Parameters:

NameTypeDescription
disease ? ?

Declared on: line 1457 of Lua/hospital.lua.

function Hospital:getWallsAround(x, y)

Get the set of walls around a tile position.

Parameters:

NameTypeDescription
x int X position of the queried tile.
y int Y position of the queried tile.

Declared on: line 2034 of Lua/hospital.lua.

function Hospital:giveAdvice(msgs, rnd_frac, stay_up)

Advises the player.

Parameters:

NameTypeDescription
msgs ? ?
rnd_frac ? ?
stay_up ? ?

Declared on: line 2547 of Lua/hospital.lua.

function Hospital:hadPatients()

Has this hospital received any patients yet?

Declared on: line 2513 of Lua/hospital.lua.

function Hospital:hasReceptionDesk(is_staffed)

Does the hospital have a reception desk

Parameters:

NameTypeDescription
is_staffed bool Does the desk need to be staffed

Declared on: line 1047 of Lua/hospital.lua.

function Hospital:humanoidDeath(patient)

Humanoid has died, record the incident.

Parameters:

NameTypeDescription
patient ? The deceased.

Declared on: line 1603 of Lua/hospital.lua.

function Hospital:initOwnedPlots()

Afterload function to initialize the owned plots.

Declared on: line 2354 of Lua/hospital.lua.

function Hospital:initStaff()

Initialize hospital staff from the level config.

Declared on: line 1505 of Lua/hospital.lua.

function Hospital:isInHospital(x, y)

Test if a given map tile is part of this hospital.

Parameters:

NameTypeDescription
x integer The 1-based X coordinate of the tile to test.
y integer The 1-based Y coordinate of the tile to test.

Declared on: line 644 of Lua/hospital.lua.

function Hospital:isPlayerHospital()

Returns whether this hospital is controlled by a real person or not.

Declared on: line 1042 of Lua/hospital.lua.

function Hospital:isReputationChangeAllowed(amount)

a gain is less likely. As we approach 0, a loss is less likely.

Under 500, a gain is always effective. Over 500, a loss is always effective.

Parameters:

NameTypeDescription
amount int : The amount of reputation change.

Declared on: line 1852 of Lua/hospital.lua.

function Hospital:isRoomDiscovered(room_id)

Checks if a room has been discovered

Parameters:

NameTypeDescription
room_id string The name of the room

Declared on: line 278 of Lua/hospital.lua.

function Hospital:logTransaction(transaction)

Add a transaction to the hospital's transaction log.

Parameters:

NameTypeDescription
transaction table A table containing a string field called `desc`, and at least one of the following integer fields: `spend`, `receive`.

Declared on: line 1491 of Lua/hospital.lua.

function Hospital:makeDebugRat(left, top, right, bottom)

Debug helper: ensure two visible ratholes exist, then spawn a rat from one.

Parameters:

NameTypeDescription
left number Left edge of the current view in map screen coordinates.
top number Top edge of the current view in map screen coordinates.
right number Right edge of the current view in map screen coordinates.
bottom number Bottom edge of the current view in map screen coordinates.

Declared on: line 787 of Lua/hospital.lua.

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

Makes the fax at the end of an emergency

Parameters:

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

Declared on: line 2601 of Lua/hospital.lua.

function Hospital:makeEmergencyStartFax()

Makes the fax at the start of an emergency

Declared on: line 2597 of Lua/hospital.lua.

function Hospital:makeNoDiagnosisRoomFax(patient)

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

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 2593 of Lua/hospital.lua.

function Hospital:makeNoTreatmentRoomFax(patient)

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

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 2589 of Lua/hospital.lua.

function Hospital:makeRaiseRequest(amount, staff)

Makes the raise request for a staff member

Parameters:

NameTypeDescription
amount ? ?
staff ? ?

Declared on: line 2581 of Lua/hospital.lua.

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

Called when the vip is out of the hospital grounds

Parameters:

NameTypeDescription
vip_rating ? ?
name ? ?
cash_reward ? ?
vip_message ? ?

Declared on: line 2613 of Lua/hospital.lua.

function Hospital:manageEpidemics()

Make the active epidemic (if exists) and any future epidemics tick. If there is no current epidemic determines if any epidemic in the pool of future epidemics can become the active one. Also removes any epidemics from the future pool which have no infected patients and thus, will have no effect on the hospital.

Declared on: line 1225 of Lua/hospital.lua.

function Hospital:modifyHandymanTaskPriority(taskIndex, newPriority, taskType)

Parameters:

NameTypeDescription
taskIndex ? ?
newPriority ? ?
taskType ? ?

Declared on: line 2174 of Lua/hospital.lua.

function Hospital:msgCured()

Give the user possibly a message about a cured patient.

Declared on: line 2551 of Lua/hospital.lua.

function Hospital:msgKilled()

Give the user possibly a message about a dead patient.

Declared on: line 2555 of Lua/hospital.lua.

function Hospital:msgMultiReceptionDesks()

Give advice about having more desks.

Declared on: line 2535 of Lua/hospital.lua.

function Hospital:msgNeedFirstReceptionDesk()

-- Stubs section - these functions have nothing to do here, are overridden in a derived class.

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

Declared on: line 2525 of Lua/hospital.lua.

function Hospital:msgReceptionDesk()

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

Declared on: line 2531 of Lua/hospital.lua.

function Hospital:notifyOfStaffChange(staff)

Notify patients of a change to hospital staff members

Parameters:

NameTypeDescription
staff Staff Changed staff member subject of notification

Declared on: line 2447 of Lua/hospital.lua.

function Hospital:objectPlaced(entity, id)

A new object has been placed in the hospital.

Parameters:

NameTypeDescription
entity Entity The entity that was just placed.
id string That entity's id.

Declared on: line 1715 of Lua/hospital.lua.

function Hospital:onEndDay()

Called at the end of each day.

Declared on: line 914 of Lua/hospital.lua.

function Hospital:onEndMonth()

Called at the end of each month.

Declared on: line 964 of Lua/hospital.lua.

function Hospital:onEndYear()

Called at the end of each year

Declared on: line 1079 of Lua/hospital.lua.

function Hospital:paySupplierForDrug(disease_id)

Pay drug if drug has been purchased to treat a patient.

Parameters:

NameTypeDescription
disease_id ? Disease that was treated.

Declared on: line 1481 of Lua/hospital.lua.

function Hospital:playSound(sound)

Play a sound file

Parameters:

NameTypeDescription
sound ? ?

Declared on: line 2617 of Lua/hospital.lua.

function Hospital:purchasePlot(plot_number)

Parameters:

NameTypeDescription
plot_number ? ?

Declared on: line 599 of Lua/hospital.lua.

function Hospital:receiveMoney(amount, reason, changeValue)

Increases the player's money by the given amount and logs the transaction.

Parameters:

NameTypeDescription
amount integer The (positive) amount to receive.
reason string A string that tells what happened. Should be one of the strings in _S.transactions.
changeValue integer The (positive) amount the hospital value should be decreased

Declared on: line 1398 of Lua/hospital.lua.

function Hospital:receiveMoneyForProduct(patient, amount, reason)

Parameters:

NameTypeDescription
patient ? ?
amount ? ?
reason ? ?

Declared on: line 1476 of Lua/hospital.lua.

function Hospital:receiveMoneyForTreatment(patient)

Determines how much the player should receive after a patient is treated in a room.

Parameters:

NameTypeDescription
patient Patient The patient that just got treated.

Declared on: line 1416 of Lua/hospital.lua.

function Hospital:removeDebugPatient(patient)

Remove a debug patient from the debug list.

Parameters:

NameTypeDescription
patient Patient Patient to remove

Declared on: line 1784 of Lua/hospital.lua.

function Hospital:removeHandymanTask(taskIndex, taskType)

Parameters:

NameTypeDescription
taskIndex ? ?
taskType ? ?

Declared on: line 2181 of Lua/hospital.lua.

function Hospital:removeMessage(humanoid)

Remove any message (fax) relating to this humanoid

Parameters:

NameTypeDescription
humanoid ? ?

Declared on: line 2609 of Lua/hospital.lua.

function Hospital:removePatient(patient)

Remove a patient from the hospital. Also if a debug patient, they are also removed from the debug list.

Parameters:

NameTypeDescription
patient Patient Patient to remove.

Declared on: line 1776 of Lua/hospital.lua.

function Hospital:removeRathole(hole)

Remove the provided rathole.

Parameters:

NameTypeDescription
hole table or x or y or wall or optional or object Hole to remove.

Declared on: line 2124 of Lua/hospital.lua.

function Hospital:removeRatholeXY(x, y)

Remove any rathole from the given position.

Parameters:

NameTypeDescription
x ? X position of the tile that should not have ratholes.
y ? Y position of the tile that should not have ratholes.

Declared on: line 2139 of Lua/hospital.lua.

function Hospital:removeRatholesAroundRoom(room)

Remove the ratholes that use the walls of the provided room.

Parameters:

NameTypeDescription
room Room Room being de-activated.

Declared on: line 2092 of Lua/hospital.lua.

function Hospital:removeStaff(staff)

Remove a staff member from the hospital staff.

Parameters:

NameTypeDescription
staff Staff Staff member to remove.

Declared on: line 1768 of Lua/hospital.lua.

function Hospital:removeTileObject(object_category)

Update tile object counts for removing an object.

See also 'Hospital:addTileObject'

Parameters:

NameTypeDescription
object_category ? Category of the tile object.

Declared on: line 1675 of Lua/hospital.lua.

function Hospital:resetDeathCount()

Reset the death counts. This is used by a cheat to reset key lose conditions.

Declared on: line 2518 of Lua/hospital.lua.

function Hospital:resolveEmergency()

Called when the timer runs out during an emergency or when all emergency patients are cured or dead.

Declared on: line 1134 of Lua/hospital.lua.

function Hospital:roomNotYetResearched(disease)

Function that returns true if the room for the given disease

has not been researched yet.

Parameters:

NameTypeDescription
disease string : the disease to be checked.

Declared on: line 2374 of Lua/hospital.lua.

function Hospital:searchForHandymanTask(handyman, task_type)

Function for search a new task for a handyman.

Parameters:

NameTypeDescription
handyman object handyman instance for which we want to find a task.
task_type string handyman task type: repairing, watering, cleaning.

Declared on: line 2235 of Lua/hospital.lua.

function Hospital:sellSodaToPatient(patient)

Sell a soda to a patient for the price in the level config (default $20).

Parameters:

NameTypeDescription
patient patient The patient buying the soda.

Declared on: line 1449 of Lua/hospital.lua.

function Hospital:setCampaignData(campaign_data)

Restore the hospital settings from the previous hospital

Parameters:

NameTypeDescription
campaign_data table Hospital campaign data

Declared on: line 2475 of Lua/hospital.lua.

function Hospital:showGatesToHell(entity)

Show the 'Gates to hell' animation.

Parameters:

NameTypeDescription
entity ? ?

Declared on: line 2543 of Lua/hospital.lua.

function Hospital:spawnContagiousPatient()

Creates a new epidemic by creating a new contagious patient with a random disease - this is NOT typically how epidemics are started (mainly for cheat use) see @Hospital:determineIfContagious() to see how epidemics are typically started

Declared on: line 1175 of Lua/hospital.lua.

function Hospital:spawnRat(hole)

Spawn a rat emerging from a rathole. It runs to another rathole and vanishes.

rathole is used when omitted.

Parameters:

NameTypeDescription
hole table or optional The hole to emerge from; a random existing

Declared on: line 712 of Lua/hospital.lua.

function Hospital:spendMoney(amount, reason, changeValue)

Lowers the player's money by the given amount and logs the transaction.

Parameters:

NameTypeDescription
amount integer The (positive) amount to spend.
reason string A string that shows what happened. Should be one of the strings in _S.transactions.
changeValue integer The (positive) amount the hospital value should be increased

Declared on: line 1380 of Lua/hospital.lua.

function Hospital:tick()

Called each tick, also called 'hours'. Check hours_per_day in

date.lua to see how many times per day this is.

Declared on: line 561 of Lua/hospital.lua.

function Hospital:tickEarthquake(stage)

The UI parts of earthquake ticks

Parameters:

NameTypeDescription
stage ? ?

Declared on: line 2637 of Lua/hospital.lua.

function Hospital:unassignHandymanTasks(handyman)

Remove all tasks assigned to Handyman

Parameters:

NameTypeDescription
handyman object target handyman

Declared on: line 1623 of Lua/hospital.lua.

function Hospital:unconditionalChangeReputation(valueChange)

In most cases, the better entry point for changing reputation

is 'Hospital:changeReputation'.

Parameters:

NameTypeDescription
valueChange integer Amount of change.

Declared on: line 1827 of Lua/hospital.lua.

function Hospital:updateCuredCounts(patient)

Update the 'cured' counts of the hospital.

Parameters:

NameTypeDescription
patient ? Patient that was cured.

Declared on: line 1888 of Lua/hospital.lua.

function Hospital:updateNotCuredCounts(patient, reason)

-"kicked": Patient goes home early (manually sent, no treatment room, etc).

-"over_priced": Patient considers the price too high.

Parameters:

NameTypeDescription
patient ? Patient that was not cured.
reason string the reason why the patient is not cured.

Declared on: line 1908 of Lua/hospital.lua.