Patient Class
A `Humanoid` who is in the hospital for diagnosis and/or treatment.
Inheritance: Patient » Humanoid » Entity
Method Index
- _calculateNausea(num_nearby_vomit)
- _checkIfCureRoom(room)
- _checkPatientIsStillQueueingForARoom()
- _constructGetSodaAction(machine, lx, ly)
- _dailyBowelChecks()
- _dailyHealthChecks()
- _dailyHealthHistoryRefresh()
- _dailyObjectHappinessEffects()
- _dailyWaitChecks()
- _handleEmptyActionQueue() (inherited from Humanoid)
- _handleExcessThirst()
- _tick() (inherited from Entity)
- addToTreatmentHistory(room)
- afterLoad(old, new) (overrides Humanoid:afterLoad)
- agreesToPay(disease_id)
- atFullyEmptyTile(cur_action)
- changeAttribute(attribute, amount) (inherited from Humanoid)
- changeDisease(new_disease)
- checkWatch()
- clearDynamicInfo() (inherited from Entity)
- completeDiagnosticStep(room)
- cure()
- despawn() (overrides Humanoid:despawn)
- die()
- dump() (inherited from Humanoid)
- eraseObject() (inherited from Entity)
- falling(player_init)
- fallingAnnounce()
- findObjectsInSquare(size, object_spec) (inherited from Humanoid)
- finishAction(action) (inherited from Humanoid)
- getAttribute(attribute, default_value) (inherited from Humanoid)
- getCurrentAction() (inherited from Humanoid)
- getCurrentMood() (inherited from Humanoid)
- getDrawingLayer() (inherited from Entity)
- getDynamicInfo() (inherited from Entity)
- getIdleAnimation(humanoid_class) (inherited from Humanoid)
- getPriceDistortion(casebook)
- getRoom() (inherited from Humanoid)
- getTile() (inherited from Entity)
- getTreatmentDiseaseId()
- giveVaccinationCandidateStatus()
- goHome(reason, disease_id) (overrides Humanoid:goHome)
- goingToUseObject(object_type) (inherited from Humanoid)
- handleRemovedObject(object) (inherited from Humanoid)
- handleToiletNeed()
- hasDressingAndLeavingAction() (inherited from Humanoid)
- hasLeavingAction() (inherited from Humanoid)
- hasMoreDiagnosisRoomsAvailable()
- interruptAndRequeueAction(current_action, queue_pos, meander_before_resume)
- isEnteringRoom() (inherited from Humanoid)
- isKnockingDoor() (inherited from Humanoid)
- isLeaving() (inherited from Humanoid)
- isMalePatient()
- isMeandering() (inherited from Humanoid)
- isMoodActive(mood) (inherited from Humanoid)
- isObscuringArea(x1, x2, y1, y2) (inherited from Humanoid)
- isTreatmentEffective()
- isType(humanoid_class) (inherited from Humanoid)
- leaveArea() (inherited from Humanoid)
- modifyDiagnosisProgress(incrementValue)
- notifyNewObject(id) (overrides Entity:notifyNewObject)
- notifyNewRoom(room) (overrides Humanoid:notifyNewRoom)
- notifyOfStaffChange(staff) (inherited from Humanoid)
- onClick(ui, button) (overrides Humanoid:onClick)
- onDestroy() (inherited from Humanoid)
- onPickUp() (inherited from Entity)
- pee()
- playAfterLoadSound() (inherited from Entity)
- playEntitySounds(name_pattern, min_silence_lengths, max_silence_lengths, num_silences) (inherited from Entity)
- playSound(name, played_callback, played_callback_delay) (inherited from Entity)
- queueAction(action, pos) (inherited from Humanoid)
- registerRoomBuildCallback(callback) (inherited from Humanoid)
- registerRoomRemoveCallback(callback) (inherited from Humanoid)
- registerStaffChangeCallback(callback) (inherited from Humanoid)
- removeAnyEpidemicStatus()
- removeVaccinationCandidateStatus()
- resetAnimation() (inherited from Entity)
- setAnimation(animation, flags) (inherited from Entity)
- setCallCompleted() (inherited from Humanoid)
- setDiagnosed()
- setDisease(disease)
- setDynamicInfo(type, value) (inherited from Entity)
- setDynamicInfoText(action_string)
- setHospital(hospital) (overrides Humanoid:setHospital)
- setIfHoverMoodsVisible() (inherited from Humanoid)
- setInfectedStatus()
- setLayer(layer, id) (inherited from Entity)
- setMood(mood_name, activate) (inherited from Humanoid)
- setMoodInfo(new_mood) (inherited from Entity)
- setNextAction(action, high_priority) (inherited from Humanoid)
- setPosition(x, y) (inherited from Entity)
- setSpeed(x, y) (inherited from Entity)
- setTile(x, y) (overrides Entity:setTile)
- setTilePositionSpeed(tx, ty, px, py, sx, sy) (inherited from Entity)
- setTimer(tick_count, f) (inherited from Entity)
- setToDying()
- setToReadyForVaccinationStatus()
- setType(humanoid_class) (inherited from Humanoid)
- setVaccinatedStatus()
- setWaitingForSoundEffectsToBeTurnedOn() (inherited from Entity)
- startAction() (inherited from Humanoid)
- tapFoot()
- tick() (overrides Entity:tick)
- tickDay() (overrides Humanoid:tickDay)
- tire(amount) (inherited from Humanoid)
- tostring() (inherited from Humanoid)
- treatDisease()
- unexpectFromRoom(dest_room) (inherited from Humanoid)
- unregisterCallbacks() (inherited from Humanoid)
- unregisterRoomBuildCallback(callback) (inherited from Humanoid)
- unregisterRoomRemoveCallback(callback) (inherited from Humanoid)
- unregisterStaffChangeCallback(callback) (inherited from Humanoid)
- updateDynamicInfo()
- updateMessage(choice)
- updateSpeed() (inherited from Humanoid)
- vomit()
- wake(amount) (inherited from Humanoid)
- walkTo(tile_x, tile_y, must_happen) (inherited from Humanoid)
- yawn()
Member Index
- action_queue
- action_string
- active_moods (*)
- animation_flags (*)
- animation_idx (*)
- associated_desk (*)
- attempted_to_infect
- attributes
- available_diagnosis_rooms
- build_callback (*)
- build_callbacks (*)
- check_watch_anim
- cure_rooms_visited
- cured
- dead
- diagnosed
- diagnosis_progress
- die_anims
- disease
- door_anims (*)
- dynamic_info (*)
- falling_anim
- fire (*)
- getServiceQuality (*)
- get_up_anim (*)
- going_home
- going_to_die
- going_to_toilet
- has_fallen
- has_passed_reception
- has_vomitted
- health_history
- hospital
- hover_cursor
- hover_moods (*)
- humanoid_class
- in_room (*)
- infected
- insurance_company
- is_debug
- is_emergency
- last_move_direction (*)
- layers (*)
- litter_countdown
- marked_for_vaccination
- message
- message_callback
- mood_info (*)
- mood_marker
- needs_redirecting
- next_room_to_visit (*)
- noqueue_ticks
- num_animation_ticks (*)
- on_call (*)
- on_ground_anim
- pay_amount
- pee_anim
- permanent_flags (*)
- playing_sounds_in_random_sequence (*)
- previous_action (*)
- profile (*)
- random_sound_sequence_parameters (*)
- remove_callbacks (*)
- reserved_for
- set_to_die
- shake_fist_anim
- should_knock_on_doors
- skip_next_tick (*)
- slow_animation (*)
- speed (*)
- staff_change_callbacks (*)
- tap_foot_anim
- th
- ticks (*)
- tile_x
- tile_y
- timeout
- timer_function (*)
- timer_time (*)
- toilet_callback (*)
- treatment_history
- under_infection_attempt
- user_of
- vaccinated
- vaccination_candidate
- vomit_anim
- waiting
- waiting_for_sound_effects_to_be_turned_on (*)
- walk_anims (*)
- world
- yawn_anim
function Patient:Patient(...)
Parameters:
| Name | Type | Description |
|---|---|---|
| ... | ? | ? |
Declared on: line 27 of Lua/entities/humanoids/patient.lua.
function Patient:_calculateNausea(num_nearby_vomit)
Process a patient's exposure to vomit and calculate their level of nausea
Parameters:
| Name | Type | Description |
|---|---|---|
| num_nearby_vomit | ? | ? |
Declared on: line 723 of Lua/entities/humanoids/patient.lua.
function Patient:_checkIfCureRoom(room)
Checks if the room the patient is in is the final treatment room for their disease
NB: Check diagnosed status as some illnesses use Psych for diagnosis and treatment
Parameters:
| Name | Type | Description |
|---|---|---|
| room | ? | ? |
Declared on: line 582 of Lua/entities/humanoids/patient.lua.
function Patient:_checkPatientIsStillQueueingForARoom()
where he/she is not in the queue anymore, but should be. If this is the case for
more than 2 ticks, go to reception.
Declared on: line 898 of Lua/entities/humanoids/patient.lua.
function Patient:_constructGetSodaAction(machine, lx, ly)
Take the necessary steps to let a patient to get a soda.
Parameters:
| Name | Type | Description |
|---|---|---|
| machine | object | The drinks machine to target |
| lx | int | X usage coordinate of the drinks machine |
| ly | int | Y usage coordinate of the drinks machine |
Declared on: line 813 of Lua/entities/humanoids/patient.lua.
function Patient:_dailyBowelChecks()
Process a patient's current state of toilet need, and action accordingly.
Declared on: line 739 of Lua/entities/humanoids/patient.lua.
function Patient:_dailyHealthChecks()
Handle processing of a patient's current health state and perform necessary actions
Declared on: line 650 of Lua/entities/humanoids/patient.lua.
function Patient:_dailyHealthHistoryRefresh()
Generate or refresh the patient's health chart
Declared on: line 706 of Lua/entities/humanoids/patient.lua.
function Patient:_dailyObjectHappinessEffects()
Process specific objects near the patient and their effect on happiness factors.
Declared on: line 778 of Lua/entities/humanoids/patient.lua.
function Patient:_dailyWaitChecks()
Handle processing of a patient waiting for something (like a room or player action)
Declared on: line 616 of Lua/entities/humanoids/patient.lua.
function Patient:_handleExcessThirst()
Handle a pateint who is very thirsty. They'll start getting unhappy and wanting to
look for a drink.
Declared on: line 861 of Lua/entities/humanoids/patient.lua.
function Patient:addToTreatmentHistory(room)
Parameters:
| Name | Type | Description |
|---|---|---|
| room | ? | ? |
Declared on: line 1071 of Lua/entities/humanoids/patient.lua.
function Patient:afterLoad(old, new)
Parameters:
| Name | Type | Description |
|---|---|---|
| old | ? | ? |
| new | ? | ? |
Overrides: Humanoid:afterLoad.
Declared on: line 1240 of Lua/entities/humanoids/patient.lua.
function Patient:agreesToPay(disease_id)
Returns true if patient agrees to pay for the given treatment.
Parameters:
| Name | Type | Description |
|---|---|---|
| disease_id | string | : The id of the disease to test |
Declared on: line 319 of Lua/entities/humanoids/patient.lua.
function Patient:atFullyEmptyTile(cur_action)
Test whether the current tile of the patient is useful for inserting an
action that needs a fully empty tile in the hospital.
Parameters:
| Name | Type | Description |
|---|---|---|
| cur_action | ? | Current action of the patient. |
Declared on: line 397 of Lua/entities/humanoids/patient.lua.
function Patient:changeDisease(new_disease)
Parameters:
| Name | Type | Description |
|---|---|---|
| new_disease | ? | ? |
Declared on: line 138 of Lua/entities/humanoids/patient.lua.
function Patient:completeDiagnosticStep(room)
Updates the patients diagnostic progress based on the doctors skill
called when they are done using a diagnosis room
Parameters:
| Name | Type | Description |
|---|---|---|
| room | ? | ? |
Declared on: line 195 of Lua/entities/humanoids/patient.lua.
function Patient:cure()
Change patient internal state to "cured".
Declared on: line 363 of Lua/entities/humanoids/patient.lua.
function Patient:despawn()
Despawns the patient and removes them from the hospital
Overrides: Humanoid:despawn.
Declared on: line 576 of Lua/entities/humanoids/patient.lua.
function Patient:die()
Patient died, process the event.
Declared on: line 370 of Lua/entities/humanoids/patient.lua.
function Patient:falling(player_init)
Falling animations for when there is an earth quake or the player is being very mean
Parameters:
| Name | Type | Description |
|---|---|---|
| player_init | bool | if true, player triggered the fall |
Declared on: line 413 of Lua/entities/humanoids/patient.lua.
function Patient:getPriceDistortion(casebook)
considers the bill to be under-priced. The bigger the value is, the more
the patient patient considers the bill to be over-priced.
Parameters:
| Name | Type | Description |
|---|---|---|
| casebook | table | : casebook entry for the treatment. |
Declared on: line 261 of Lua/entities/humanoids/patient.lua.
function Patient:getTreatmentDiseaseId()
Decide the ID of the disease or treatment that the patient is paying for.
not be decided.
Declared on: line 243 of Lua/entities/humanoids/patient.lua.
function Patient:giveVaccinationCandidateStatus()
Show patient selected vaccination candidate status
Declared on: line 1208 of Lua/entities/humanoids/patient.lua.
function Patient:goHome(reason, disease_id)
the last treatment is over-priced.
param disease_id (string): When the reason is "over_priced" this is the
id of the disease/diagnosis that the patient considered over_priced
Parameters:
| Name | Type | Description |
|---|---|---|
| reason | string | : the reason why the patient is sent home, which could be: |
| disease_id | ? | ? |
Overrides: Humanoid:goHome.
Declared on: line 498 of Lua/entities/humanoids/patient.lua.
function Patient:handleToiletNeed()
Process a patient's sudden need for the toilet.
We will either do it on the floor (40% chance, daily), or seek out a toilet.
Declared on: line 754 of Lua/entities/humanoids/patient.lua.
function Patient:hasMoreDiagnosisRoomsAvailable()
Declared on: line 359 of Lua/entities/humanoids/patient.lua.
function Patient:interruptAndRequeueAction(current_action, queue_pos, meander_before_resume)
Interrupt a patients current action and resumes it after
Parameters:
| Name | Type | Description |
|---|---|---|
| current_action | string | Action being interrupted |
| queue_pos | int | Position to insert resumed action in queue |
| meander_before_resume | bool | Indicator to insert an additional action before resuming. |
Declared on: line 1328 of Lua/entities/humanoids/patient.lua.
function Patient:isTreatmentEffective()
Either the patient is cured, or he/she dies.
Declared on: line 341 of Lua/entities/humanoids/patient.lua.
function Patient:modifyDiagnosisProgress(incrementValue)
Modifies the diagnosis progress of a patient.
incrementValue can be either positive or negative.
Parameters:
| Name | Type | Description |
|---|---|---|
| incrementValue | ? | ? |
Declared on: line 182 of Lua/entities/humanoids/patient.lua.
function Patient:notifyNewObject(id)
As of now each time a bench is placed the world notifies all patients
in the vicinity through this function.
Parameters:
| Name | Type | Description |
|---|---|---|
| id | ? | ? |
Overrides: Entity:notifyNewObject.
Declared on: line 1050 of Lua/entities/humanoids/patient.lua.
function Patient:notifyNewRoom(room)
Parameters:
| Name | Type | Description |
|---|---|---|
| room | ? | ? |
Overrides: Humanoid:notifyNewRoom.
Declared on: line 1004 of Lua/entities/humanoids/patient.lua.
function Patient:onClick(ui, button)
Parameters:
| Name | Type | Description |
|---|---|---|
| ui | ? | ? |
| button | ? | ? |
Overrides: Humanoid:onClick.
Declared on: line 75 of Lua/entities/humanoids/patient.lua.
function Patient:removeAnyEpidemicStatus()
Clear all epidemic status
Declared on: line 1232 of Lua/entities/humanoids/patient.lua.
function Patient:removeVaccinationCandidateStatus()
Remove the vaccination candidate icon and status from the patient
Declared on: line 1215 of Lua/entities/humanoids/patient.lua.
function Patient:setDiagnosed()
Mark patient as being diagnosed.
Declared on: line 169 of Lua/entities/humanoids/patient.lua.
function Patient:setDisease(disease)
Parameters:
| Name | Type | Description |
|---|---|---|
| disease | ? | ? |
Declared on: line 111 of Lua/entities/humanoids/patient.lua.
function Patient:setDynamicInfoText(action_string)
Sets the dynamic text currently in use by the patient
Parameters:
| Name | Type | Description |
|---|---|---|
| action_string | string | What text to say in dynamic text |
Declared on: line 1085 of Lua/entities/humanoids/patient.lua.
function Patient:setHospital(hospital)
Sets the hospital for the patient - additionally removing them from a
hospital if they already belong to one. For player hospitals, patients who
are not debug or emergency patients are made to seek a reception desk.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | : hospital to assign to patient |
Overrides: Humanoid:setHospital.
Declared on: line 228 of Lua/entities/humanoids/patient.lua.
function Patient:setInfectedStatus()
Show patient infected status
Declared on: line 1194 of Lua/entities/humanoids/patient.lua.
function Patient:setTile(x, y)
Called each time the patient moves to a new tile.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Overrides: Entity:setTile.
Declared on: line 1011 of Lua/entities/humanoids/patient.lua.
function Patient:setToReadyForVaccinationStatus()
Show patient as ready for vaccination status
Declared on: line 1201 of Lua/entities/humanoids/patient.lua.
function Patient:setVaccinatedStatus()
Show vaccinated status for vaccinated patient
Declared on: line 1224 of Lua/entities/humanoids/patient.lua.
function Patient:tick()
Overrides: Entity:tick.
Declared on: line 597 of Lua/entities/humanoids/patient.lua.
function Patient:tickDay()
This function handles changing of the different attributes of the patient.
For example if thirst gets over a certain level (now: 0.7), the patient
tries to find a drinks machine nearby.
Overrides: Humanoid:tickDay.
Declared on: line 928 of Lua/entities/humanoids/patient.lua.
function Patient:treatDisease()
will die. The patient may or may not agree to pay for the treatment
depending on whether they consider the price reasonable.
Declared on: line 290 of Lua/entities/humanoids/patient.lua.
function Patient:updateDynamicInfo()
Updates a patient's dynamic info
Can be called direct to refresh only
Declared on: line 1092 of Lua/entities/humanoids/patient.lua.
function Patient:updateMessage(choice)
Update availability of a choice in message owned by this patient, if any
Parameters:
| Name | Type | Description |
|---|---|---|
| choice | string | The choice that needs updating (currently "research" or "guess_cure"). |
Declared on: line 1138 of Lua/entities/humanoids/patient.lua.