kts.PitKill

Name

kts.PitKill – kill non-flying actor, without leaving a corpse

Synopsis

kts.PitKill()

Description

If the current actor (as determined by cxt.actor) is a walking (as opposed to flying) creature, it is instantly killed. No corpse is left behind. If the creature was a knight, then any item(s) carried are dropped one square behind the knight's current position. Invulnerability does not prevent the death from occurring.

Calling this when cxt.actor is a flying creature, or nil, does nothing.

Return Value

None.

Notes

As the name suggests, this function is intended to be called when a creature walks into a pit.

Examples

This is used as the on_walk_over function for the "open pit" tile in the standard Knights data files: see tiles.lua.

See Also

The cxt table

kts.Invulnerability