kts.RotateAddPos

Name

kts.RotateAddPos – add a displacement to a dungeon position, taking into account dungeon rotation

Synopsis

result = kts.RotateAddPos(position, x, y)

Description

The dungeon generator can randomly rotate and/or reflect dungeon rooms in order to add variety. This means that what is "north" in the original map segment might be "east" (or another direction) in the actual game, depending on how the map generator decided to lay out the segments.

This function takes a position, and an x and y displacement (expressed in the co-ordinates of the original map segment), and returns the displaced position as it actually appears in the dungeon.

Return Value

The transformed map position is returned.

Errors

Errors will result if the inputs are not a map position followed by two integers.

Examples

This is used to ensure that the "skull" traps in the dungeon fire from the correct positions: see tile_funcs.lua.

See Also

kts.RotateDirection