Hospital Class
Method Index
- _fixBoiler()
- _getAverageHumanoidsAttribute(humanoids, attribute, default_value, min_count)
- addHandymanTask(object, taskType, priority, x, y, call)
- addInsuranceMoney(company, amount)
- addPatient(patient)
- addRathole(x, y, wall, parcel)
- addStaff(staff)
- addTileObject(object_category)
- addToEpidemic(patient)
- adviseBoilerBreakdown()
- adviseCannotAffordPlot()
- adviseDiscoverDisease(disease)
- adviseNoGPOffice()
- advisePlants()
- advisePriceLevelImpact(judgment, name)
- afterLoad(old, new)
- announceRepair(room)
- announceStaffLeave(staff)
- assignHandymanToTask(handyman, task_index, task_type)
- boilerBreakdown(broken_heat)
- buildReceptionDesksCache()
- canAcceptPatients()
- canConcentrateResearch(disease)
- cancelEpidemics(disease)
- changeReputation(reason, disease, valueChange)
- changeValue(changeValue)
- checkDiseaseRequirements(disease)
- checkEmergencyOver()
- computePriceLevelImpact(patient, casebook)
- countEpidemics()
- countFireExtinguishers()
- countGeneralObjects()
- countNewPatient()
- countPatients(max_count)
- countPlants()
- countRadiators()
- countReceptionDesks()
- countRoomOfType(type, max_count)
- countSittingStanding()
- countStaffOfCategory(category, max_count)
- createEmergency(emergency)
- createVip()
- daysUntilNextDisaster()
- determineIfContagious(patient)
- findAssignedTasksToHandyman(handyman)
- findHandymanTaskSubtable(taskType)
- findRatholeTiles(count, left, top, right, bottom)
- getAveragePatientAttribute(attribute, default_value, min_count)
- getAverageStaffAttribute(attribute, default_value)
- getCampaignData()
- getDebugPatient()
- getDiseaseReputation(disease)
- getDiseaseReputationPriceFactor(disease)
- getHandymanTaskPriority(taskIndex, taskType)
- getHeliportPosition()
- getHeliportSpawnPosition()
- getIndexOfTask(x, y, taskType, obj)
- getObjectBuildCost(name)
- getOwnedTileCount()
- getPlayerIndex()
- getRandomBusyRoom()
- getReceptionDesks(is_staffed)
- getReputationChangeLikelihood()
- getTreatmentPrice(disease)
- getWallsAround(x, y)
- giveAdvice(msgs, rnd_frac, stay_up)
- hadPatients()
- hasReceptionDesk(is_staffed)
- humanoidDeath(patient)
- initOwnedPlots()
- initStaff()
- isInHospital(x, y)
- isPlayerHospital()
- isReputationChangeAllowed(amount)
- isRoomDiscovered(room_id)
- logTransaction(transaction)
- makeDebugRat(left, top, right, bottom)
- makeEmergencyEndFax(rescued_patients, total, max_bonus, earned)
- makeEmergencyStartFax()
- makeNoDiagnosisRoomFax(patient)
- makeNoTreatmentRoomFax(patient)
- makeRaiseRequest(amount, staff)
- makeVipEndFax(vip_rating, name, cash_reward, vip_message)
- manageEpidemics()
- modifyHandymanTaskPriority(taskIndex, newPriority, taskType)
- msgCured()
- msgKilled()
- msgMultiReceptionDesks()
- msgNeedFirstReceptionDesk()
- msgReceptionDesk()
- notifyOfStaffChange(staff)
- objectPlaced(entity, id)
- onEndDay()
- onEndMonth()
- onEndYear()
- onSpawnVIP()
- open()
- paySupplierForDrug(disease_id)
- playSound(sound)
- purchasePlot(plot_number)
- receiveMoney(amount, reason, changeValue)
- receiveMoneyForProduct(patient, amount, reason)
- receiveMoneyForTreatment(patient)
- removeDebugPatient(patient)
- removeHandymanTask(taskIndex, taskType)
- removeMessage(humanoid)
- removePatient(patient)
- removeRathole(hole)
- removeRatholeXY(x, y)
- removeRatholesAroundRoom(room)
- removeStaff(staff)
- removeTileObject(object_category)
- resetDeathCount()
- resolveEmergency()
- roomNotYetResearched(disease)
- searchForHandymanTask(handyman, task_type)
- sellSodaToPatient(patient)
- setCampaignData(campaign_data)
- showGatesToHell(entity)
- spawnContagiousPatient()
- spawnPatient()
- spawnRat(hole)
- spendMoney(amount, reason, changeValue)
- tick()
- tickEarthquake(stage)
- unassignHandymanTasks(handyman)
- unconditionalChangeReputation(valueChange)
- updateCuredCounts(patient)
- updateNotCuredCounts(patient, reason)
- updatePercentages()
Member Index
- acc_heating
- acc_loan_interest
- acc_overdraft
- acc_research_cost
- autopsy_discovered
- balance
- bench_msg
- boiler_can_break
- boiler_countdown
- cash_msg
- concurrent_epidemic_limit
- curr_setting
- current_inflation
- debug_patients
- disasterless_days
- discover_autopsy_risk
- discovered_diseases
- discovered_rooms
- disease_casebook
- emergency
- emergency_patients
- epidemic
- epidemics_disabled
- free_build_mode
- future_epidemics_pool
- handymanTasks
- handyman_popup
- has_impressive_reputation
- has_seen_pay_rise
- heating
- heating_broke
- hosp_cheats
- hospital_littered
- inflation_rate
- initial_grace
- insurance
- insurance_balance
- interest_rate
- is_in_world
- loan
- message_popup
- money_in
- money_out
- msg_counter
- name
- next_month_start
- not_cured
- not_cured_ty
- num_cured
- num_cured_ty
- num_deaths
- num_deaths_this_year
- num_explosions
- num_vips
- num_vips_ty
- num_visitors
- num_visitors_pm
- num_visitors_tm
- num_visitors_ty
- opened
- over_priced_threshold
- overdraft_interest_rate
- ownedPlots
- patientcount
- patients
- percentage_cured
- percentage_killed
- player_salary
- pleased_vips_ty
- policies
- population
- radiator_heat
- ratholes
- reception_desks
- receptionist_count
- receptionist_msg
- reputation
- reputation_above_threshold
- reputation_max
- reputation_min
- research
- research_dep_built
- room_discoveries
- sal_min
- salary_incr
- salary_offer
- seating_warning
- show_progress_screen_warnings
- sodas_sold
- spawn_attempts
- spawn_rate_cheat
- staff
- staff_room_msg
- staffed_reception_desks
- statistics
- thirst_msg
- tile_object_counts
- toilet_msg
- transactions
- under_priced_threshold
- undiscovered_rooms
- value
- vip_declined
- warmth_msg
- world
function Hospital:Hospital(world, avail_rooms, name)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| company | ? | ? |
| amount | ? | ? |
Declared on: line 1471 of Lua/hospital.lua.
function Hospital:addPatient(patient)
Parameters:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
Declared on: line 1589 of Lua/hospital.lua.
function Hospital:addRathole(x, y, wall, parcel)
Add a rathole to the room.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| staff | ? | ? |
Declared on: line 2585 of Lua/hospital.lua.
function Hospital:assignHandymanToTask(handyman, task_index, task_type)
Parameters:
| Name | Type | Description |
|---|---|---|
| handyman | ? | ? |
| task_index | ? | ? |
| task_type | ? | ? |
Declared on: line 2220 of Lua/hospital.lua.
function Hospital:boilerBreakdown(broken_heat)
Boiler should break down.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| disease | ? | ? |
Declared on: line 2387 of Lua/hospital.lua.
function Hospital:cancelEpidemics(disease)
Cancel ongoing and future epidemics.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
Declared on: line 1283 of Lua/hospital.lua.
function Hospital:findAssignedTasksToHandyman(handyman)
Search all tasks assigned to a handyman, if any.
Parameters:
| Name | Type | Description |
|---|---|---|
| handyman | ? | The handyman instance to check for assigned tasks. |
Declared on: line 2205 of Lua/hospital.lua.
function Hospital:findHandymanTaskSubtable(taskType)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| disease | ? | ? |
Declared on: line 1457 of Lua/hospital.lua.
function Hospital:getWallsAround(x, y)
Get the set of walls around a tile position.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
Declared on: line 2589 of Lua/hospital.lua.
function Hospital:makeRaiseRequest(amount, staff)
Makes the raise request for a staff member
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:onSpawnVIP()
Declared on: line 2570 of Lua/hospital.lua.
function Hospital:open()
Open the hospital
Declared on: line 2503 of Lua/hospital.lua.
function Hospital:paySupplierForDrug(disease_id)
Pay drug if drug has been purchased to treat a patient.
Parameters:
| Name | Type | Description |
|---|---|---|
| disease_id | ? | Disease that was treated. |
Declared on: line 1481 of Lua/hospital.lua.
function Hospital:playSound(sound)
Play a sound file
Parameters:
| Name | Type | Description |
|---|---|---|
| sound | ? | ? |
Declared on: line 2617 of Lua/hospital.lua.
function Hospital:purchasePlot(plot_number)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| patient | Patient | Patient to remove |
Declared on: line 1784 of Lua/hospital.lua.
function Hospital:removeHandymanTask(taskIndex, taskType)
Parameters:
| Name | Type | Description |
|---|---|---|
| taskIndex | ? | ? |
| taskType | ? | ? |
Declared on: line 2181 of Lua/hospital.lua.
function Hospital:removeMessage(humanoid)
Remove any message (fax) relating to this humanoid
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| patient | Patient | Patient to remove. |
Declared on: line 1776 of Lua/hospital.lua.
function Hospital:removeRathole(hole)
Remove the provided rathole.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| stage | ? | ? |
Declared on: line 2637 of Lua/hospital.lua.
function Hospital:unassignHandymanTasks(handyman)
Remove all tasks assigned to Handyman
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| patient | ? | Patient that was not cured. |
| reason | string | the reason why the patient is not cured. |
Declared on: line 1908 of Lua/hospital.lua.