CorsixTH Lua Documentation

Hospital Class

Declared on: line 21 of Lua/hospital.lua.
Subclasses: AIHospital

Method Index

Member Index

function Hospital:Hospital(world, name)

Parameters:

NameTypeDescription
world ? ?
name ? ?

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

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

Parameters:

NameTypeDescription
object ? ?
taskType ? ?
priority ? ?
x ? ?
y ? ?
call ? ?

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

function Hospital:addInsuranceMoney(company, amount)

Parameters:

NameTypeDescription
company ? ?
amount ? ?

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

function Hospital:addPatient(patient)

Parameters:

NameTypeDescription
patient ? ?

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

function Hospital:addStaff(staff)

Parameters:

NameTypeDescription
staff ? ?

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

function Hospital:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

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

function Hospital:assignHandymanToTask(handyman, taskIndex, taskType)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

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 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:

NameTypeDescription
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: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 1117 of Lua/hospital.lua.

function Hospital:findHandymanTaskSubtable(taskType)

Parameters:

NameTypeDescription
taskType ? ?

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

function Hospital:getAveragePatientAttribute(attribute)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

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

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

function Hospital:getTaskObject(taskIndex, taskType)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
category string A humanoid_class or one of the specialists, i.e.

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

function Hospital:humanoidDeath(humanoid)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

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 1379 of Lua/hospital.lua.

function Hospital:modifyHandymanTaskPriority(taskIndex, newPriority, taskType)

Parameters:

NameTypeDescription
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: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:

NameTypeDescription
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:

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 1301 of Lua/hospital.lua.

function Hospital:receiveMoneyForProduct(patient, amount, reason)

Parameters:

NameTypeDescription
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:

NameTypeDescription
patient Patient The patient that just got treated.

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

function Hospital:removeDebugPatient(patient)

Parameters:

NameTypeDescription
patient ? ?

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

function Hospital:removeHandymanTask(taskIndex, taskType)

Parameters:

NameTypeDescription
taskIndex ? ?
taskType ? ?

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

function Hospital:removePatient(patient)

Parameters:

NameTypeDescription
patient ? ?

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

function Hospital:removeStaff(staff)

Parameters:

NameTypeDescription
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:

NameTypeDescription
disease ? ?

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

function Hospital:searchForHandymanTask(handyman, taskType)

Parameters:

NameTypeDescription
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:

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 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.

Page generated on Sat Feb 07, 2015 at 18:38:28 by LDocGen.