kts.OpenWays – implements the Wand of Open Ways effect
kts.OpenWays()
This is intended to be called from the melee_action
function of the Wand of Open Ways ItemType (or an ItemType representing a similar item).
The function looks at cxt.tile
and, if it is a door/chest tile, opens it (even if locked), disarming any traps. If it is another type of tile, then no damage is dealt, unless the actor has Strength, in which case the tile will receive a large amount of damage (most likely destroying it).
No meaningful value is returned.
Errors may result if the cxt
table is invalid or undefined. Otherwise there should be no errors from this function.
The definition of the Wand of Open Ways can be found in items.lua. If you are trying to define a similar item, then that may be useful as a reference.