Epidemic Class
Method Index
- _inspectorSpawned()
- _isCoverUpActive()
- _updateVaccinationCursor()
- addContagiousPatient(patient)
- afterLoad(old, new)
- announceEndOfEpidemic()
- announceStartOfEpidemic()
- applyOutcome()
- calculateInfectedFine(infected_count)
- cancelEpidemic()
- checkIfReadyToReveal()
- checkInfectedLeftHospital()
- checkNoInfectedPatients()
- checkPatientsForRemoval()
- clearAllInfectedPatients()
- countInfectedPatients()
- coverUpTimeIsUp()
- createVaccinationActions(patient, nurse)
- determineFaxAndFines(still_infected)
- evacuateHospital()
- finishCoverUp()
- getBestVaccinationTile(nurse, patient)
- handleInspectorArrival()
- hasNoInfectedPatients()
- infectOtherPatients()
- interruptVaccinationActions(nurse)
- markForVaccination(patient)
- markPatientsAsPassedReception()
- markedPatientsCallForVaccination()
- resolveDeclaration()
- revealEpidemic()
- sendInitialFax()
- sendResultFax()
- showAppropriateAdviceMessages()
- spawnInspector()
- startCoverUp()
- tick()
- toggleVaccinationMode()
- tryAnnounceInspector()
- turnOffVaccinationMode()
Member Index
- attempted_infections
- cheat_always_show_mood
- compensation
- countdown_intervals
- cover_up_result_fax
- coverup_fine
- coverup_in_progress
- coverup_selected
- declare_fine
- disease
- evacuation_minimum
- has_said_hurry_up
- has_said_serious
- hospital
- infected_patients
- inspector
- level_config
- ready_to_reveal
- reputation_hit
- reputation_loss_minimum
- revealed
- spread_factor
- timer
- total_infections
- vaccination_mode_active
- will_be_evacuated
- world
function Epidemic:Epidemic(hospital, contagious_patient)
Manages the epidemics that occur in hospitals. Generally, any epidemic
logic that happens outside this class will call functions contained here.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | ? | ? |
| contagious_patient | ? | ? |
Declared on: line 30 of Lua/epidemic.lua.
function Epidemic:_inspectorSpawned()
Private function to check if a inspector already spawned.
@return (boolean) true if spawned already, false if not
Declared on: line 563 of Lua/epidemic.lua.
function Epidemic:_isCoverUpActive()
Private function to check if a cover up is in progress
@return (boolean) true if cover up in progress, false if not
Declared on: line 569 of Lua/epidemic.lua.
function Epidemic:_updateVaccinationCursor()
Update how the cursor interacts with the hospital.
Declared on: line 298 of Lua/epidemic.lua.
function Epidemic:addContagiousPatient(patient)
Adds a new patient to the epidemic who is actively contagious: infected but
not vaccinated or cured
Parameters:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
Declared on: line 111 of Lua/epidemic.lua.
function Epidemic:afterLoad(old, new)
Parameters:
| Name | Type | Description |
|---|---|---|
| old | ? | ? |
| new | ? | ? |
Declared on: line 754 of Lua/epidemic.lua.
function Epidemic:announceEndOfEpidemic()
Plays the announcement for the end of the epidemic
Declared on: line 232 of Lua/epidemic.lua.
function Epidemic:announceStartOfEpidemic()
Plays the announcement for the start of the epidemic
Declared on: line 223 of Lua/epidemic.lua.
function Epidemic:applyOutcome()
Apply the compensation or fines where appropriate to the player as
determined when the cover up was completed (@see finishCoverUp)
Declared on: line 487 of Lua/epidemic.lua.
function Epidemic:calculateInfectedFine(infected_count)
Calculate the fine for having a given number of infected patients
--Used to determine the initial declaration fine as the cover up fine.
--@param infected_count (Integer) number of patients still infected
--@return fine (Integer) the fine amount
Parameters:
| Name | Type | Description |
|---|---|---|
| infected_count | ? | ? |
Declared on: line 348 of Lua/epidemic.lua.
function Epidemic:cancelEpidemic()
For Cheat - Cancel the epidemic.
Declared on: line 735 of Lua/epidemic.lua.
function Epidemic:checkIfReadyToReveal()
The epidemic is ready to be revealed to the player if any infected patient
is fully diagnosed. N.B. because multiple epidemics are queued to become
the "active" one, being ready to reveal does NOT guarantee an epidemic
WILL be revealed to the player and may even terminate before they are even
aware it existed.
Declared on: line 197 of Lua/epidemic.lua.
function Epidemic:checkInfectedLeftHospital()
Check for conditions that one of the infected and not cured
patient leaved the hospital. This discover epidemic to public instantly.
So cover up must end earlier than the length of the timer.
Declared on: line 240 of Lua/epidemic.lua.
function Epidemic:checkNoInfectedPatients()
Check for conditions that no any uncured infected patients
left in hospital. If so then cover up must end earlier than the
length of the timer.
Declared on: line 259 of Lua/epidemic.lua.
function Epidemic:checkPatientsForRemoval()
Remove any patients which were already on their way out or died before the
epidemic was started to be fair on the players so they don't instantly fail.
Additionally if any patients die during an epidemic we also remove them,
otherwise a player may never win the epidemic in such a case.
Declared on: line 270 of Lua/epidemic.lua.
function Epidemic:clearAllInfectedPatients()
Remove all infected patients by vaccinating from the hospital and clear
any epidemic-specific icons from their heads.
Declared on: line 381 of Lua/epidemic.lua.
function Epidemic:countInfectedPatients()
Counts the number of patients that have been infected that are still
-- infected
-- @return infected_count (Integer) the number of patients still infected.
Declared on: line 316 of Lua/epidemic.lua.
function Epidemic:coverUpTimeIsUp()
Epidemic timer time is up
Declared on: line 431 of Lua/epidemic.lua.
function Epidemic:createVaccinationActions(patient, nurse)
In response to a vaccination call by the vaccination candidate
(@see makeVaccinationCandidateCallForNurse) perform the vaccination
actions or deal with call if unable to vaccinate.
@param patient (Patient) the patient who make the original call
@param nurse (Nurse) the nurse attempting to vaccinate the patient
Parameters:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
| nurse | ? | ? |
Declared on: line 596 of Lua/epidemic.lua.
function Epidemic:determineFaxAndFines(still_infected)
Calculates the contents of the fax and the appropriate fines based on the
result of a cover up, results are stored globally to the class to be applied later.
@param still_infected (Integer) the number of patients still infected
Parameters:
| Name | Type | Description |
|---|---|---|
| still_infected | ? | ? |
Declared on: line 436 of Lua/epidemic.lua.
function Epidemic:evacuateHospital()
Forces evacuation of the hospital - it makes ALL patients leave and storm out.
Declared on: line 532 of Lua/epidemic.lua.
function Epidemic:finishCoverUp()
Ends the cover up epidemic stage
Declared on: line 410 of Lua/epidemic.lua.
function Epidemic:getBestVaccinationTile(nurse, patient)
Find the best tile to stand on to vaccinate a patient
@param nurse (Nurse) the nurse performing the vaccination
@param patient (Patient) the patient to be vaccinated
@return best_x,best_y (Integer,nil) the best tiles to vaccinate from.
Parameters:
| Name | Type | Description |
|---|---|---|
| nurse | ? | ? |
| patient | ? | ? |
Declared on: line 624 of Lua/epidemic.lua.
function Epidemic:handleInspectorArrival()
Inspector had arrived at reception desk, or a hospital without a desk.
Check if any infected still in hospital and determine final verdict.
Declared on: line 422 of Lua/epidemic.lua.
function Epidemic:hasNoInfectedPatients()
Are no infected patients, cured or still infected in the hospital?
@returns true if so, false otherwise. (boolean)
Declared on: line 717 of Lua/epidemic.lua.
function Epidemic:infectOtherPatients()
Goes through all infected patients checking if there are any other patients
in adjacent squares that can be infected, and if so infects them turning
them into an infected patient too.
Declared on: line 122 of Lua/epidemic.lua.
function Epidemic:interruptVaccinationActions(nurse)
When the nurse is interrupted unreserve the patient and unassign the call.
@param nurse (Nurse) the nurse whose vaccination actions we are interrupting
Parameters:
| Name | Type | Description |
|---|---|---|
| nurse | ? | ? |
Declared on: line 679 of Lua/epidemic.lua.
function Epidemic:markForVaccination(patient)
Show a patient is able to be vaccinated, this is shown to the player by
changing the icon, once a player has been marked for vaccination they may
possibly become a vaccination candidate. Marking is done by clicking
the player and can only happen during a cover up.
Parameters:
| Name | Type | Description |
|---|---|---|
| patient | ? | ? |
Declared on: line 304 of Lua/epidemic.lua.
function Epidemic:markPatientsAsPassedReception()
For compatibility. Mark all the current patients who are in the hospital
--but not in the reception queues as being "passed reception" used to decide
--who is evacuated @see evacuateHospital. For new patients they are marked
--as they leave the reception desks.
Declared on: line 510 of Lua/epidemic.lua.
function Epidemic:markedPatientsCallForVaccination()
During a cover up every patient marked for vaccination (clicked)
creates a call to be vaccinated by a nurse - patients must also be static
(seated or standing queuing)
Declared on: line 584 of Lua/epidemic.lua.
function Epidemic:resolveDeclaration()
When the player chooses to declare the epidemic instead of trying
to cover up it from the initial faxes - ends the epidemic immediately
after applying fine.
Declared on: line 368 of Lua/epidemic.lua.
function Epidemic:revealEpidemic()
Show the player the have an epidemic - send a fax
This happens when the epidemic is chosen to the be
the "active" epidemic out of all the queued ones.
Declared on: line 213 of Lua/epidemic.lua.
function Epidemic:sendInitialFax()
Sends the initial fax to the player when the epidemic is revealed.
Declared on: line 329 of Lua/epidemic.lua.
function Epidemic:sendResultFax()
Send the results of the cover up to the player - will be a
success/compensation or fail/fines + reputation hit
Declared on: line 543 of Lua/epidemic.lua.
function Epidemic:showAppropriateAdviceMessages()
Make the advisor show appropriate messages under certain
conditions of the epidemic.
Declared on: line 695 of Lua/epidemic.lua.
function Epidemic:spawnInspector()
Spawns the inspector who will walk to the reception desk.
Declared on: line 550 of Lua/epidemic.lua.
function Epidemic:startCoverUp()
When the player chooses to begin the cover up over declaring from the
initial fax (@see sendInitialFax)
Declared on: line 394 of Lua/epidemic.lua.
function Epidemic:tick()
The epidemic tick - currently the same rate as the hospital's tick but
not necessary dependent on it - could potentially be reduced for performance.
Declared on: line 98 of Lua/epidemic.lua.
function Epidemic:toggleVaccinationMode()
Toggle the vaccination mode changes how the cursor interacts with
the hospital. Toggled by pressing the button on the watch
(@see UIWatch:UIWatch)
Declared on: line 284 of Lua/epidemic.lua.
function Epidemic:turnOffVaccinationMode()
Turn off vaccination cursor mode
Declared on: line 292 of Lua/epidemic.lua.