kts.PickUp – pick up an item
kts.PickUp()
result = kts.Can_PickUp()
If the current actor (cxt.actor
) is a knight, then kts.PickUp()
will attempt to pick up an item. If the knight is currently approaching a square (such as a table or chest), then the approached square is targetted; otherwise, the knight's current square is targetted. If the targetted square contains an item, it will be picked up (otherwise, nothing happens).
If the new item is a "large" item (such as a hammer or crossbow), and the knight is already carrying another large item, then the currently held item will be dropped first (i.e. the knight will exchange their current item for the new item). If the new item is a "small" item (such as a potion or gem) then the knight will just pick it up without dropping anything.
If the actor is not a knight then nothing happens.
kts.Can_PickUp()
returns true if there is an item available for pickup, and it is possible for the current actor to pick it up (i.e. they are not busy doing something else or otherwise unable to pick up currently). Otherwise it returns false.
kts.PickUp()
returns nothing, and kts.Can_PickUp()
returns a boolean as described above.
kts.PickUp
and kts.Can_PickUp
are usually used as the action
and possible
functions (respectively) of a Control.