kts.CloseDoor

Name

kts.CloseDoor – close a door or chest tile

Synopsis

kts.CloseDoor(pos)

Description

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.

Return Value

No value is returned.

Errors

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

Notes

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.

Bugs

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.

See Also

cxt

kts.MISC_CONFIGdoor_closed_damage is set here

kts.IsDoorOpen

kts.OpenDoor

kts.OpenOrCloseDoor

kts.Tile