kts.CloseDoor – close a door or chest tile
kts.CloseDoor(pos)
If there is a door or chest tile at position pos
, then this function will close it (if it is not already closed).
Otherwise, this function does nothing.
No value is returned.
If pos
is not a valid map position then an error is raised.
If a creature is in a doorway when the door is closed, then the creature will receive door_closed_damage
damage and (assuming they survive) will be pushed out of the doorway.
This function reads originator
from the cxt table, in order attribute any kills that are done by the door_closed_damage
.
It seems (from my reading of the code – ST, 12-Apr-2024) that if a door/chest tile is closed by kts.CloseDoor
, then the on_open_or_close
function (on the tile) does not get called. This should probably be looked into at some point.
kts.MISC_CONFIG – door_closed_damage
is set here