bothack.player
->Player
(->Player nickname title role race hp maxhp pw maxpw ac xplvl x y inventory hunger encumbrance intrinsics engulfed trapped leg-hurt state & overage)
Positional factory function for class bothack.player.Player.
add-intrinsic
(add-intrinsic game intrinsic)
available-gold
(available-gold game)
Return the amount of gold the player has in main inventory
bagged-items
(bagged-items game-or-player)
blockers
(blockers {:keys [player], :as game} item)
Return a seq of [slot item] of stuff that needs to be removed before item
can be used (in possible order of removal)
burdened?
(burdened? player)
can-eat?
(can-eat? player)
can-engrave?
(can-engrave? {:keys [player], :as game})
Checks if the player is capable of engraving (also for non-engravable planes)
can-remove?
(can-remove? game slot)
capacity
(capacity {:keys [stats], :as player})
confused?
(confused? player)
count-candles
(count-candles game)
cursed-blockers
(cursed-blockers game slot)
edible?
(edible? player {:keys [name], :as food})
Only true for safe food or unknown tins
fainting?
(fainting? player)
free-action?
(free-action? game)
free-finger?
(free-finger? player)
Does the player have a free ring-finger?
gold
(gold game)
Return the amount of gold the player has including bagged gold
has-hands?
(has-hands? player)
have
(have game map-or-name-or-set-or-fn)
(have game name-or-set-or-fn opts)
Returns the [slot item] of matching item in player's inventory or nil.
First arg can be:
String (name of item)
#{String} (set of strings - item name alternatives with no preference)
fn - predicate function to filter items (gets the Item as arg, not the name)
Options map (or set if all map vals would be true) can contain:
:noncursed - return only items not known to be cursed
:nonblessed - return only items not known to be blessed
:blessed - only blessed
:cursed - only cursed
:wished - only wished-for items
:buc <:cursed/:uncursed/:blessed> - return only items known to have given buc
:know-buc - if true items with any (known) buc, if false items with unknown buc
:safe-buc - same as :know-buc + :noncursed
:unsafe-buc - complement of :safe-buc
:in-use - if false only non-used items, if true only used (worn/wielded)
:worn - only worn (not wielded) items
:bagged - return slot of bag containing the item if it is not present in main inventory
:can-remove - returns only items that are unused or not blocked by anything cursed, for {:can-remove false} returns only worn blocked items
:can-use - returns only items that are already in use or not blocked by anything cursed, for {:can-use false} returns only currently unused items blocked by cursed items
:nonempty - items not named empty
have-all
(have-all game name-or-set-or-fn)
(have-all {:keys [player], :as game} name-or-set-or-fn opts)
Returns a lazy seq of all matching [slot item] pairs in inventory, options
same as 'have'
have-candles?
(have-candles? game)
have-intrinsic?
(have-intrinsic? {:keys [player], :as game-or-player} resist)
have-levi
(have-levi game)
have-levi-on
(have-levi-on game)
have-pick
(have-pick game)
have-sum
(have-sum game name-or-set-or-fn)
(have-sum game name-or-set-or-fn opts)
Returns sum of the quantities of matching items
have-unihorn
(have-unihorn game)
have-usable
(have-usable game smth)
hungry?
(hungry? player)
Returns hunger state if it is Hungry or worse, else nil
impaired?
(impaired? player)
initial-intrinsics
(initial-intrinsics race-or-role)
inventory
(inventory game-or-player bagged?)
(inventory game-or-player)
inventory-label
(inventory-label game label)
Returns the [slot item] of something in main inventory that matches the label or nil
inventory-slot
(inventory-slot game slot)
Return item for the inventory slot (letter or slot keyword)
light-radius
(light-radius game)
map->Player
(map->Player m__5869__auto__)
Factory function for class bothack.player.Player, taking a map of keywords to field values.
nutrition-sum
(nutrition-sum game)
Sum of nutrition of carried food
nw-ratio-avg
(nw-ratio-avg game)
Nutrition/weight ratio average for all carried food
overloaded?
(overloaded? player)
overtaxed?
(overtaxed? player)
reflection?
(reflection? game)
remove-intrinsic
(remove-intrinsic game intrinsic)
safe-corpse-type?
(safe-corpse-type? player corpse {:keys [monster], :as corpse-type})
satiated?
(satiated? player)
slot-appearance
(slot-appearance game slot)
strained?
(strained? player)
stressed?
(stressed? player)
thick?
(thick? player)
True if the player can't pass through narrow diagonals.
unihorn-recoverable?
(unihorn-recoverable? {:keys [player], :as game})
update-player
(update-player player status)
update-slot
(update-slot game slot update-fn & args)
Apply update-fn to item at the inventory slot
want-to-eat?
(want-to-eat? player corpse)
weak?
(weak? player)
Returns hunger state if it is Weak or worse, else nil
weight-mod
(weight-mod game item)
weight-sum
(weight-sum game)
weight-to-burden
(weight-to-burden game)
wielded-item
(wielded-item game)
wielding
(wielding game-or-player)
Return the wielded [slot item] or nil