kts.OpenOrCloseDoor – toggle whether a door/chest is open or closed
kts.OpenOrCloseDoor(pos)
If there is a door or chest tile at pos
, then it will be opened (if it is currently closed), or closed (if it is currently open).
Otherwise, this function does nothing.
No value is returned.
If pos
is not a valid map position then an error is raised.
Opening a door or chest will trigger any trap that has been set on it.
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 to attribute kills that result from triggered traps or door_closed_damage
.
kts.MISC_CONFIG – door_closed_damage
is set here