Skip to main content

Player Interface

These functions and properties are members of the Player instance. You can get the player object using the Player global variable.

Note that the Player object is a Creature and therefore a GameObject, so you can use both the Creature interface and the GameObject interface as well.

Player
  • Creature - read-only
Global variable that references the player character. You can use any properties or functions that are available on Creatures, in addition to the extra features below.
Player.
Species
  • string - read/write
The lowercase singular species name of the player character, e.g. 'dragon'.
Player.
SpeciesPlural
  • string - read/write
The lowercase plural species name of the player character, e.g. 'dragons'.
Player.
CoatNoun
  • string - read/write
The lowercase noun describing the player character's species coat, e.g. 'fur'.
Player.
CoatAdjective
  • string - read/write
The lowercase adjective describing the player character's species coat, e.g. 'furry'.
Player.
IsExplicitDisposalEnabled
  • boolean - read-only
Whether the player has explicit disposal content enabled in the game settings.
Player.
IsPreySenseEnabled
  • boolean - read-only
Whether the player has the Preysense feature enabled in the game settings.
Player.
IsExplorerModeEnabled
  • boolean - read-only
Whether the player has the Explorer Mode feature enabled in the game settings.
Player.
XP
  • number - read-only
The number of XP acquired so far. If you wish to change this, call AwardXP().
Player.
RequiredXP
  • number - read-only
The number of XP required to level up.
Player.
AbilityPoints
  • number - read/write
The number of unspent ability points available for the player.
Player.
Money
  • number - read/write
The amount of money the player owns. You can modify this directly if you wish, but consider using Player:ModifyMoney instead (see below).
Player.
TotalPreySwallowed
  • number - read/write
Tally of prey successfully swallowed during combat.
Player.
TotalPreyDigested
  • number - read/write
Tally of prey killed through digestion damage during combat.
Player:
HasItem
name
  • name (string) - asset name of the item to check
  • (boolean) - true if owned, false otherwise
Returns true if the player has an item in their inventory (*not* equipment!) with the specified asset name.
Player:
GiveItem
name
quiet
  • name (string) - asset name of the item to give
  • quiet (boolean) - optional - if true, hide 'obtained' message - defaults to false
Adds an item to the player's inventory.
Player:
TakeItem
name
  • name (string) - asset name of the item to remove
  • (boolean) - true if removed, false otherwise
Looks for the first item in the player's inventory with the specified asset name. If found, the item is deleted and true is returned. Otherwise, returns false.
Player:
AwardXP
amount
  • amount (number) - the amount of XP to add
Grants the specified number of XP to the player, levelling them up if the requirements are met.
Player:
ApplyBuff
buff
  • buff (PendingBuff) - the new buff to apply
Applies a temporary effect to the player in combat. If the player is in combat, the effect is applied immediately. If not, the effect is queued and will be applied on the next combat the player enters. Refer to the 'Constructors' > 'Buffs' section for functions that create PendingBuffs.
Player:
ModifyMoney
delta
  • delta (number) - the change, positive or negative, to apply
Adds the specified delta to the player's money total, and prints a message notifying the player of the change. This function prevents money from dropping below zero; it will be capped at zero in that case.