Plant Class
An `Object` which needs watering now and then.
Method Index
- _tick() (inherited from Entity)
- addReservedUser(user) (inherited from Object)
- afterLoad(old, new) (overrides Object:afterLoad)
- callForWatering()
- clearDynamicInfo() (inherited from Entity)
- createHandymanActions(handyman)
- getBestUsageTileXY(from_x, from_y)
- getDrawingLayer() (inherited from Object)
- getDynamicInfo() (inherited from Entity)
- getRenderAttachTile() (inherited from Object)
- getRoom() (inherited from Entity)
- getSecondaryUsageTile() (inherited from Object)
- getWalkableTiles() (inherited from Object)
- getWateringTile()
- initOrientation(direction) (inherited from Object)
- isPleasing()
- isReservedFor(user) (inherited from Object)
- needsWatering()
- notifyNewObject(id) (inherited from Entity)
- onClick(ui, button) (overrides Object:onClick)
- onDestroy() (overrides Object:onDestroy)
- playSound(name) (inherited from Entity)
- processTypeDefinition(object_type) (inherited from Object)
- removeReservedUser(user) (inherited from Object)
- removeUser(user) (inherited from Object)
- resetAnimation() (inherited from Object)
- restoreToFullHealth()
- setAnimation(animation, flags) (inherited from Object)
- setDynamicInfo(type, value) (inherited from Entity)
- setLayer(layer, id) (inherited from Entity)
- setMood(mood_name, activate) (inherited from Entity)
- setMoodInfo(new_mood) (inherited from Entity)
- setNextState(restoring)
- setPosition(x, y) (inherited from Object)
- setSpeed(x, y) (inherited from Entity)
- setTile(x, y) (inherited from Object)
- setTilePositionSpeed(tx, ty, px, py, sx, sy) (inherited from Entity)
- setTimer(tick_count, f) (inherited from Entity)
- setUser(user) (inherited from Object)
- slaveMixinClass(class_method_table) (inherited from Object)
- tick() (overrides Object:tick)
- tickDay() (overrides Entity:tickDay)
- updateDynamicInfo() (inherited from Object)
Member Index
- animation_flags (*)
- animation_idx (*)
- base_frame
- current_frame
- current_state
- cycles
- days_left
- direction
- dynamic_info (*)
- footprint (*)
- hospital
- init_anim_flags (*)
- layers (*)
- mood_info (*)
- num_animation_ticks (*)
- object_type (*)
- orientation_before (*)
- permanent_flags (*)
- phase
- picked_up
- plant_announced
- reserved_for
- reserved_for_list (*)
- set_passable_flags (*)
- skip_next_tick (*)
- slow_animation (*)
- split_anim_positions (*)
- split_anims (*)
- th
- ticks
- tile_x
- tile_y
- timer_function
- timer_time
- times_used (*)
- unreachable
- unreachable_counter
- user (*)
- user_list (*)
- user_of (*)
- world
function Plant:Plant(world, object_type, x, y, direction, etc)
Parameters:
Name | Type | Description |
---|---|---|
world | ? | ? |
object_type | ? | ? |
x | ? | ? |
y | ? | ? |
direction | ? | ? |
etc | ? | ? |
Declared on: line 87 of Lua/objects/plant.lua.
function Plant:afterLoad(old, new)
Parameters:
Name | Type | Description |
---|---|---|
old | ? | ? |
new | ? | ? |
Overrides: Object:afterLoad.
Declared on: line 356 of Lua/objects/plant.lua.
function Plant:callForWatering()
When the plant needs water it preiodically calls for a nearby handyman.
Declared on: line 196 of Lua/objects/plant.lua.
function 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:
Name | Type | Description |
---|---|---|
handyman | Staff | The handyman that is about to get the actions. |
Declared on: line 226 of Lua/objects/plant.lua.
function Plant:getBestUsageTileXY(from_x, from_y)
When a handyman should go to the plant he should approach it from the closest reachable tile.
Parameters:
Name | Type | Description |
---|---|---|
from_x | integer | The x coordinate of tile to calculate from. |
from_y | integer | The y coordinate of tile to calculate from. |
Declared on: line 271 of Lua/objects/plant.lua.
function Plant:isPleasing()
Declared on: line 340 of Lua/objects/plant.lua.
function Plant:needsWatering()
Returns whether the plant is in need of watering right now.
Declared on: line 155 of Lua/objects/plant.lua.
function Plant:onClick(ui, button)
The plant needs to retain its animation and reset its unreachable flag when being moved
Parameters:
Name | Type | Description |
---|---|---|
ui | ? | ? |
button | ? | ? |
Overrides: Object:onClick.
Declared on: line 330 of Lua/objects/plant.lua.
function Plant:onDestroy()
Overrides: Object:onDestroy.
Declared on: line 348 of Lua/objects/plant.lua.
function Plant:restoreToFullHealth()
Restores the plant to its initial state. (i.e. healthy)
Declared on: line 125 of Lua/objects/plant.lua.
function Plant:setNextState(restoring)
Goes one step forward (or backward) in the states of the plant.
Parameters:
Name | Type | Description |
---|---|---|
restoring | boolean | If true the plant improves its health instead of drooping. |
Declared on: line 98 of Lua/objects/plant.lua.
function Plant:tick()
Overridden since the plant animates slowly over time
Overrides: Object:tick.
Declared on: line 139 of Lua/objects/plant.lua.
function Plant:tickDay()
Counts down to eventually let the plant droop.
Overrides: Entity:tickDay.
Declared on: line 309 of Lua/objects/plant.lua.