Module CorsixTH.CorsixTH.Lua.objects.plant
An `Object` which needs watering now and then.
Functions
| Plant:callForWatering () | When the plant needs water it periodically calls for a nearby handyman. |
| Plant:createHandymanActions (handyman) | When a handyman is about to be summoned this function queues the complete set of actions necessary, including entering and leaving any room involved. |
| Plant:getBestUsageTileXY (from_x, from_y) | When a handyman should go to the plant he should approach it from the closest reachable tile within hospital buildings. |
| Plant:isDying () | Check if a plant is dying or about to start dying |
| Plant:isPleasingFactor () | Plant health/state should be used on evaluations of pleasantness returns (integer) score of this plants health, 1 to 5 (best) |
| Plant:needsWatering () | Returns whether the plant is in need of watering right now. |
| Plant:onClick (ui, button) | The plant needs to retain its animation and reset its unreachable flag when being moved |
| Plant:restoreToFullHealth () | Restores the plant to its initial state. |
| Plant:setNextState (restoring) | Goes one step forward (or backward) in the states of the plant. |
| Plant:tick () | Overridden since the plant animates slowly over time |
| Plant:tickDay () | Counts down to eventually let the plant droop. |
Functions
- Plant:callForWatering ()
- When the plant needs water it periodically calls for a nearby handyman.
- Plant:createHandymanActions (handyman)
-
When a handyman is about to be summoned this function queues the complete set of actions necessary,
including entering and leaving any room involved. It also queues a meander action at the end.
Note that if there are more plants that need watering inside the room he will continue to water
those too before leaving.
Parameters:
- handyman (Staff) The handyman that is about to get the actions.
- Plant:getBestUsageTileXY (from_x, from_y)
-
When a handyman should go to the plant he should approach it from the
closest reachable tile within hospital buildings.
Parameters:
- from_x (integer) The x coordinate of tile to calculate from.
- from_y (integer) The y coordinate of tile to calculate from.
- Plant:isDying ()
- Check if a plant is dying or about to start dying
- Plant:isPleasingFactor ()
- Plant health/state should be used on evaluations of pleasantness returns (integer) score of this plants health, 1 to 5 (best)
- Plant:needsWatering ()
- Returns whether the plant is in need of watering right now.
- Plant:onClick (ui, button)
-
The plant needs to retain its animation and reset its unreachable flag when being moved
Parameters:
- ui
- button
- Plant:restoreToFullHealth ()
- Restores the plant to its initial state. (i.e. healthy)
- Plant:setNextState (restoring)
-
Goes one step forward (or backward) in the states of the plant.
Parameters:
- restoring (boolean) If true the plant improves its health instead of drooping.
- Plant:tick ()
- Overridden since the plant animates slowly over time
- Plant:tickDay ()
- Counts down to eventually let the plant droop.