kts.SetBladeTrap

Name

kts.SetBladeTrap – add a blade trap to a door or chest tile

Synopsis

kts.SetBladeTrap(position, trap_item, bolt_item, direction)

Description

This adds a blade trap to a door or chest tile. When the door or chest is opened (or struck with a weapon), the trap will trigger.

position gives the position of the tile to be trapped.

trap_item is an ItemType that represents the trap itself; this item will be put back into the dungeon if a knight safely disarms the trap.

bolt_item is an ItemType that represents the missile fired by the trap. This ItemType is used only for its missile properties (damage, speed etc.); the item itself will not appear in the dungeon.

direction is the map direction ("north", "south", "east" or "west") in which the bolt will be fired.

Return Value

No value is returned.

Errors

Errors will be raised if the inputs are not valid positions, item types or directions.

If there is no trappable door or chest at the given position, then no error is generated; instead, the function just does nothing.

Notes

Door/chest tiles can only contain one trap at a time. If a trap already exists when this function is called, then the existing trap will be triggered, and then the new trap will replace it.

See Also

kts.SetPoisonTrap