CorsixTH Lua Documentation

Plant Class

An `Object` which needs watering now and then.

Declared on: line 84 of Lua/objects/plant.lua.
Inheritance: Plant » Object » Entity

Method Index

Member Index

(*) only used in superclass methods
function Plant:Plant(world, object_type, x, y, direction, etc)

Parameters:

NameTypeDescription
world ? ?
object_type ? ?
x ? ?
y ? ?
direction ? ?
etc ? ?

Declared on: line 87 of Lua/objects/plant.lua.

function Plant:afterLoad(old, new)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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: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:

NameTypeDescription
ui ? ?
button ? ?

Overrides: Object:onClick.
Declared on: line 330 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:

NameTypeDescription
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.

Page generated on Sat Feb 07, 2015 at 18:38:28 by LDocGen.