Hospital Class
Method Index
- addHandymanTask(object, taskType, priority, x, y, call)
- addInsuranceMoney(company, amount)
- addPatient(patient)
- addStaff(staff)
- afterLoad(old, new)
- assignHandymanToTask(handyman, taskIndex, taskType)
- boilerBreakdown()
- boilerFixed()
- canConcentrateResearch(disease)
- cashLow()
- changeReputation(reason, disease, valueChange)
- checkDiseaseRequirements(disease)
- checkFacilities()
- coldWarning()
- countPatients()
- createEmergency(emergency)
- createVip()
- findHandymanTaskSubtable(taskType)
- getAveragePatientAttribute(attribute)
- getDebugPatient()
- getHeliportPosition()
- getHeliportSpawnPosition()
- getIndexOfTask(x, y, taskType)
- getObjectBuildCost(name)
- getPlayerIndex()
- getTaskObject(taskIndex, taskType)
- getTreatmentPrice(disease)
- hasRoomOfType(type)
- hasStaffOfCategory(category)
- hasStaffedDesk()
- hotWarning()
- humanoidDeath(humanoid)
- initOwnedPlots()
- isInHospital(x, y)
- isPlayerHospital()
- logTransaction(transaction)
- modifyHandymanTaskPriority(taskIndex, newPriority, taskType)
- msgCured()
- msgKilled()
- noStaffroom_msg()
- noToilet_msg()
- onEndDay()
- onEndMonth()
- onEndYear()
- praiseBench()
- purchasePlot(plot_number)
- receiveMoney(amount, reason, changeValue)
- receiveMoneyForProduct(patient, amount, reason)
- receiveMoneyForTreatment(patient)
- removeDebugPatient(patient)
- removeHandymanTask(taskIndex, taskType)
- removePatient(patient)
- removeStaff(staff)
- resolveEmergency()
- roomNotYetResearched(disease)
- searchForHandymanTask(handyman, taskType)
- spawnPatient()
- spendMoney(amount, reason, changeValue)
- tick()
- updatePercentages()
- warningBench()
- warningThirst()
- warningTooCold()
- warningTooHot()
Member Index
- _initResearch
- acc_heating
- acc_loan_interest
- acc_overdraft
- acc_research_cost
- announce_vip
- balance
- bench_msg
- boiler_can_break
- boiler_countdown
- cash_ms
- cash_msg
- curr_setting
- debug_patients
- discover_autopsy_risk
- discovered_diseases
- discovered_rooms
- disease_casebook
- emergency
- emergency_patients
- handymanTasks
- heating_broke
- hospital
- inflation_rate
- initial_grace
- insurance
- insurance_balance
- interest_rate
- is_in_world
- loan
- money_in
- money_out
- msg_counter
- name
- 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_ty
- opened
- ownedPlots
- patientcount
- patients
- percentage_cured
- percentage_killed
- player_salary
- pleased_vips_ty
- policies
- population
- radiator_heat
- reception_desks
- receptionist_count
- receptionist_msg
- reputation
- reputation_above_threshold
- reputation_max
- reputation_min
- research
- research_dep_built
- research_rooms
- sal_min
- salary_incr
- salary_offer
- seating_warning
- show_progress_screen_warnings
- sodas_sold
- staff
- staff_room_msg
- statistics
- thirst_msg
- toilet_msg
- transactions
- undiscovered_rooms
- value
- visitors
- warmth_msg
- win_awards
- world
function Hospital:Hospital(world, name)
Parameters:
Name | Type | Description |
---|---|---|
world | ? | ? |
name | ? | ? |
Declared on: line 23 of Lua/hospital.lua.
function Hospital:addHandymanTask(object, taskType, priority, x, y, call)
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
taskType | ? | ? |
priority | ? | ? |
x | ? | ? |
y | ? | ? |
call | ? | ? |
Declared on: line 1582 of Lua/hospital.lua.
function Hospital:addInsuranceMoney(company, amount)
Parameters:
Name | Type | Description |
---|---|---|
company | ? | ? |
amount | ? | ? |
Declared on: line 1369 of Lua/hospital.lua.
function Hospital:addPatient(patient)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 1399 of Lua/hospital.lua.
function Hospital:addStaff(staff)
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 1393 of Lua/hospital.lua.
function Hospital:afterLoad(old, new)
Parameters:
Name | Type | Description |
---|---|---|
old | ? | ? |
new | ? | ? |
Declared on: line 339 of Lua/hospital.lua.
function Hospital:assignHandymanToTask(handyman, taskIndex, taskType)
Parameters:
Name | Type | Description |
---|---|---|
handyman | ? | ? |
taskIndex | ? | ? |
taskType | ? | ? |
Declared on: line 1623 of Lua/hospital.lua.
function Hospital:boilerBreakdown()
Called when the hospitals's boiler has broken down.
It will remain broken for a certain period of time.
Declared on: line 849 of Lua/hospital.lua.
function Hospital:boilerFixed()
When the boiler has been repaired this function is called.
Declared on: line 870 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 1749 of Lua/hospital.lua.
function Hospital:cashLow()
Remind the player when cash is low that a loan might be available
Declared on: line 319 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 1477 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 1529 of Lua/hospital.lua.
function Hospital:checkFacilities()
A range of checks to help a new player. These are set days apart and will show no more than once a month
Declared on: line 625 of Lua/hospital.lua.
function Hospital:coldWarning()
Declared on: line 833 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 1117 of Lua/hospital.lua.
function Hospital:createVip()
Creates VIP
Declared on: line 1228 of Lua/hospital.lua.
function Hospital:findHandymanTaskSubtable(taskType)
Parameters:
Name | Type | Description |
---|---|---|
taskType | ? | ? |
Declared on: line 1609 of Lua/hospital.lua.
function Hospital:getAveragePatientAttribute(attribute)
Parameters:
Name | Type | Description |
---|---|---|
attribute | ? | ? |
Declared on: line 1516 of Lua/hospital.lua.
function Hospital:getHeliportPosition()
Returns the heliport x and y coordinates or nil if none exist.
Declared on: line 804 of Lua/hospital.lua.
function Hospital:getHeliportSpawnPosition()
Returns the tile on which patients should spawn when getting out of the helicopter.
Declared on: line 816 of Lua/hospital.lua.
function Hospital:getIndexOfTask(x, y, taskType)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
taskType | ? | ? |
Declared on: line 1705 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 1263 of Lua/hospital.lua.
function Hospital:getTaskObject(taskIndex, taskType)
Parameters:
Name | Type | Description |
---|---|---|
taskIndex | ? | ? |
taskType | ? | ? |
Declared on: line 1619 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 1356 of Lua/hospital.lua.
function Hospital:hasRoomOfType(type)
Checks if the hospital has a room of a given type.
Returns false if none, else number of that type found
Parameters:
Name | Type | Description |
---|---|---|
type | string | A room_info.id, e.g. "ward". |
Declared on: line 1436 of Lua/hospital.lua.
function Hospital:hasStaffOfCategory(category)
"Surgeon", "Researcher" or "Consultant"
returns false if none, else number of that type employed
Parameters:
Name | Type | Description |
---|---|---|
category | string | A humanoid_class or one of the specialists, i.e. |
Declared on: line 1414 of Lua/hospital.lua.
function Hospital:hotWarning()
Declared on: line 841 of Lua/hospital.lua.
function Hospital:humanoidDeath(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 1406 of Lua/hospital.lua.
function Hospital:isInHospital(x, y)
Test if a given map tile is part of the hospital.
Parameters:
Name | Type | Description |
---|---|---|
x | integer | The 1-based X co-ordinate of the tile to test. |
y | integer | The 1-based Y co-ordinate of the tile to test. |
Declared on: line 825 of Lua/hospital.lua.
function Hospital:isPlayerHospital()
Returns whether this hospital is controlled by a real person or not.
Declared on: line 1091 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 1379 of Lua/hospital.lua.
function Hospital:modifyHandymanTaskPriority(taskIndex, newPriority, taskType)
Parameters:
Name | Type | Description |
---|---|---|
taskIndex | ? | ? |
newPriority | ? | ? |
taskType | ? | ? |
Declared on: line 1589 of Lua/hospital.lua.
function Hospital:msgCured()
Messages regarding numbers cured and killed
Declared on: line 243 of Lua/hospital.lua.
function Hospital:msgKilled()
So the messages don't show too often there will need to be at least 10 days before one can show again.
Declared on: line 256 of Lua/hospital.lua.
function Hospital:noStaffroom_msg()
Seasoned players will know these things, but it does not harm to be reminded if there is no staff room or toilet
Declared on: line 204 of Lua/hospital.lua.
function Hospital:noToilet_msg()
Declared on: line 218 of Lua/hospital.lua.
function Hospital:onEndDay()
Called at the end of each day.
Declared on: line 879 of Lua/hospital.lua.
function Hospital:onEndMonth()
Called at the end of each month.
Declared on: line 982 of Lua/hospital.lua.
function Hospital:onEndYear()
Called at the end of each year
Declared on: line 1100 of Lua/hospital.lua.
function Hospital:praiseBench()
Give praise where it is due
Declared on: line 230 of Lua/hospital.lua.
function Hospital:purchasePlot(plot_number)
Parameters:
Name | Type | Description |
---|---|---|
plot_number | ? | ? |
Declared on: line 779 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 1301 of Lua/hospital.lua.
function Hospital:receiveMoneyForProduct(patient, amount, reason)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
amount | ? | ? |
reason | ? | ? |
Declared on: line 1374 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 1319 of Lua/hospital.lua.
function Hospital:removeDebugPatient(patient)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 1244 of Lua/hospital.lua.
function Hospital:removeHandymanTask(taskIndex, taskType)
Parameters:
Name | Type | Description |
---|---|---|
taskIndex | ? | ? |
taskType | ? | ? |
Declared on: line 1596 of Lua/hospital.lua.
function Hospital:removePatient(patient)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 1464 of Lua/hospital.lua.
function Hospital:removeStaff(staff)
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 1460 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 1186 of Lua/hospital.lua.
function Hospital:roomNotYetResearched(disease)
has not been researched yet.
param disease (string): the disease to be checked.
Parameters:
Name | Type | Description |
---|---|---|
disease | ? | ? |
Declared on: line 1734 of Lua/hospital.lua.
function Hospital:searchForHandymanTask(handyman, taskType)
Parameters:
Name | Type | Description |
---|---|---|
handyman | ? | ? |
taskType | ? | ? |
Declared on: line 1636 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 1283 of Lua/hospital.lua.
function Hospital:tick()
Called each tick, also called 'hours'. Check hours_per_day in
world.lua to see how many times per day this is.
Declared on: line 756 of Lua/hospital.lua.
function Hospital:warningBench()
Warn if the hospital is lacking some basics
Declared on: line 270 of Lua/hospital.lua.
function Hospital:warningTooCold()
Warn when it is too cold
Declared on: line 295 of Lua/hospital.lua.
function Hospital:warningTooHot()
Warn when it is too hot
Declared on: line 282 of Lua/hospital.lua.