kts.SenseItems

Name

kts.SenseItems – show important items on the current actor's map

Synopsis

kts.SenseItems(duration)

Description

If the current actor (cxt.actor) is a knight, then the location of all "quest-critical" items in the dungeon will be displayed on the corresponding player's mini-map, for the next duration milliseconds.

An item is "quest-critical" if the critical field has been set to anything other than false in the corresponding kts.ItemType.

Item locations are only revealed if they are in a room that the player has already mapped. (If we were to reveal the locations of all items, even those in not-yet-visited rooms, then that would give a huge advantage for certain quests, e.g. Quest for Gems, so this is not done.)

If, during the "Sense Items" effect, one of the revealed items is picked up or otherwise moved, then the corresponding marker will instantly disappear from the player's mini-map, but it will not be dynamically updated to show the new location in real time (i.e. the knight "forgets" where it is as soon as it is picked up).

If a "Sense Items" is already in effect for the current actor when kts.SenseItems is called, then the existing effect is cancelled and a new "Sense Items" effect is started. This means that the player's mini-map is updated if necessary (e.g. because new items were dropped into the dungeon, or new rooms were explored, since the previous Sense Items began); and it also means the timer is restarted (starting from the current time and lasting until duration milliseconds from now).

When the timer runs out (or a Dispel Magic occurs) any remaining item markers are immediately removed from the player's mini-map.

If the current actor is not a knight, kts.SenseItem() does nothing.

Return Value

None.

Examples

In the standard Knights data files, this is one of the possible scroll effects: see magic.lua.

See Also

The cxt table

kts.DispelMagic

kts.ItemType

kts.SenseKnight