kts.AddMissile – add a missile (dagger, crossbow bolt, etc.) to the dungeon


kts.AddMissile(pos, dir, item_type, drop_after)


Adds a missile to the dungeon at position pos travelling in direction dir. The missile will keep going until it hits something or reaches its maximum range.

The parameters of the missile (speed, range, damage, etc.) are determined by the given item_type.

When the missile hits its target (or runs out of range), if drop_after is true, an item of type item_type will be placed into the dungeon (if there is room for it) at the final square. If drop_after is false, the missile will simply vanish with no item being left behind.

Return Value

No value is returned.


Invalid inputs may raise an error.

If it is impossible to place a missile at position pos (e.g. because it is inside a wall), then no error is generated; the function just does nothing.


The originator value will be read from the cxt table to see which player originally fired the missile (if any). This is used for attributing deaths and kills.

See Also