Module CorsixTH.CorsixTH.Lua.entities.humanoids.patient

A `Humanoid` who is in the hospital for diagnosis and/or treatment.

Functions

Patient:agreesToPay (disease_id) Returns true if patient agrees to pay for the given treatment.
Patient:cure () Change patient internal state to "cured".
Patient:die () Patient died, process the event.
Patient:falling () Animations for when there is an earth quake
Patient:getPriceDistortion (casebook) Estimate the subjective perceived distortion between the price level the patient might expect considering the reputation and the cure effectiveness of a given treatment and the staff internal state.
Patient:getTreatmentDiseaseId () Decide the ID of the disease or treatment that the patient is paying for.
Patient:goHome (reason, disease_id) Make the patient leave the hospital.
Patient:isTreatmentEffective () Either the patient is cured, or he/she dies.
Patient:setDiagnosed () Mark patient as being diagnosed.
Patient:setDynamicInfoText (action_string) Sets the dynamic text currently in use by the patient
Patient:shakeFist () Perform 'shake fist' action.
Patient:treatDisease () Handle attempting to treat this patient

If the treatment is effective the patient will be sent home, otherwise they will die.

Patient:updateDynamicInfo () Updates a patient's dynamic info Can be called direct to refresh only


Functions

Patient:agreesToPay (disease_id)
Returns true if patient agrees to pay for the given treatment.

Parameters:

  • disease_id (string): The id of the disease to test
Patient:cure ()
Change patient internal state to "cured".
Patient:die ()
Patient died, process the event.
Patient:falling ()
Animations for when there is an earth quake
Patient:getPriceDistortion (casebook)
Estimate the subjective perceived distortion between the price level the patient might expect considering the reputation and the cure effectiveness of a given treatment and the staff internal state.

Parameters:

  • casebook (table): casebook entry for the treatment.

Returns:

    (float) [-1, 1]. The smaller the value is, the more the patient considers the bill to be under-priced. The bigger the value is, the more the patient patient considers the bill to be over-priced.
Patient:getTreatmentDiseaseId ()
Decide the ID of the disease or treatment that the patient is paying for.

Returns:

    (string or nil) Id of the disease or treatment, or nil if the Id could not be decided.
Patient:goHome (reason, disease_id)
Make the patient leave the hospital. This function also handles some statistics (number of cured/kicked out patients, etc.) The mood icon is updated accordingly. Reputation is impacted accordingly.

Parameters:

  • reason (string): the reason why the patient is sent home, which could be: -"cured": When the patient is cured. -"kicked": When the patient is kicked anyway, either manually, either when no treatment can be found for her/him, etc. -"over_priced": When the patient decided to leave because he/she believes the last treatment is over-priced.
  • disease_id (string): When the reason is "over_priced" this is the id of the disease/diagnosis that the patient considered over_priced
Patient:isTreatmentEffective ()
Either the patient is cured, or he/she dies.

Returns:

    (boolean) True if cured, false if died.
Patient:setDiagnosed ()
Mark patient as being diagnosed.
Patient:setDynamicInfoText (action_string)
Sets the dynamic text currently in use by the patient

Parameters:

  • action_string (string) What text to say in dynamic text
Patient:shakeFist ()
Perform 'shake fist' action.
Patient:treatDisease ()
Handle attempting to treat this patient

If the treatment is effective the patient will be sent home, otherwise they will die. The patient may or may not agree to pay for the treatment depending on whether they consider the price reasonable.

Patient:updateDynamicInfo ()
Updates a patient's dynamic info Can be called direct to refresh only
generated by LDoc TESTING Last updated 2015-01-01 12:00:00