kts.OpenOrCloseDoor

Name

kts.OpenOrCloseDoor – toggle whether a door/chest is open or closed

Synopsis

kts.OpenOrCloseDoor(pos)

Description

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.

Return Value

No value is returned.

Errors

If pos is not a valid map position then an error is raised.

Notes

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.

See Also

cxt

kts.MISC_CONFIGdoor_closed_damage is set here

kts.CloseDoor

kts.IsDoorOpen

kts.OpenDoor

kts.Tile