Mana
Loading...
Searching...
No Matches
Classes | Functions
PlayerInfo Namespace Reference

A database like namespace which holds global info about the localplayer. More...

Classes

class  PlayerLogic
 

Functions

void triggerAttr (int id, int old)
 
void triggerStat (int id, const std::string &changed, int old1, int old2=0)
 
int getAttribute (int id)
 Returns the value of the given attribute.
 
void setAttribute (int id, int value, bool notify=true)
 Changes the value of the given attribute.
 
int getStatBase (int id)
 Returns the base value of the given stat.
 
void setStatBase (int id, int value, bool notify=true)
 Changes the base value of the given stat.
 
int getStatMod (int id)
 Returns the modifier for the given stat.
 
void setStatMod (int id, int value, bool notify=true)
 Changes the modifier for the given stat.
 
int getStatEffective (int id)
 Returns the current effective value of the given stat.
 
std::pair< int, int > getStatExperience (int id)
 Returns the experience of the given stat.
 
void setStatExperience (int id, int have, int need, bool notify=true)
 Changes the experience of the given stat.
 
InventorygetInventory ()
 Returns the player's inventory.
 
void clearInventory ()
 Clears the player's inventory and equipment.
 
void setInventoryItem (int index, int id, int amount)
 Changes the inventory item at the given slot.
 
EquipmentgetEquipment ()
 Returns the player's equipment.
 
ItemgetEquipment (unsigned int slot)
 Returns the player's equipment at the given slot.
 
int getStorageCount ()
 Returns the number of currently open storage windows.
 
void setStorageCount (int count)
 Sets the number of currently open storage windows.
 
int getNPCInteractionCount ()
 Returns the number of currently open NPC interaction windows.
 
void setNPCInteractionCount (int count)
 Sets the number of currently open NPC interaction windows.
 
int getNPCPostCount ()
 Returns the number of currently open NPC post windows.
 
void setNPCPostCount (int count)
 Sets the number of currently open NPC post windows.
 
BuySellState getBuySellState ()
 Returns the current buy, sell, or related interaction the player is involved in.
 
void setBuySellState (BuySellState buySellState)
 Sets which buy, sell, or related interaction the player is currently involved in.
 
void clearAbilityStatus (int id)
 Removes the status for the given ability.
 
void setAbilityStatus (int id, int current, int max, int recharge)
 Changes the status of the given ability.
 
const std::map< int, Ability > & getAbilityStatus ()
 Returns the status all abilities.
 
void setBackend (const PlayerInfoBackend &backend)
 Changes the internal PlayerInfoBackend reference;.
 
bool isTalking ()
 Returns true if the player is involved in a NPC interaction, false otherwise.
 
void logic ()
 Does necessary updates every tick.
 
void init ()
 Initializes some internals.
 
void setStatLevel (int id, int value, bool notify=true)
 Changes the level of the given stat.
 

Detailed Description

A database like namespace which holds global info about the localplayer.

NOTE: 'bool notify' is used to determine if a event is to be triggered.

Function Documentation

◆ clearAbilityStatus()

void PlayerInfo::clearAbilityStatus ( int  id)

Removes the status for the given ability.

Definition at line 283 of file playerinfo.cpp.

◆ clearInventory()

void PlayerInfo::clearInventory ( )

Clears the player's inventory and equipment.

Definition at line 180 of file playerinfo.cpp.

◆ getAbilityStatus()

const std::map< int, Ability > & PlayerInfo::getAbilityStatus ( )

Returns the status all abilities.

Definition at line 297 of file playerinfo.cpp.

◆ getAttribute()

int PlayerInfo::getAttribute ( int  id)

Returns the value of the given attribute.

Definition at line 84 of file playerinfo.cpp.

◆ getBuySellState()

BuySellState PlayerInfo::getBuySellState ( )

Returns the current buy, sell, or related interaction the player is involved in.

Definition at line 262 of file playerinfo.cpp.

◆ getEquipment() [1/2]

Equipment * PlayerInfo::getEquipment ( )

Returns the player's equipment.

Definition at line 191 of file playerinfo.cpp.

◆ getEquipment() [2/2]

Item * PlayerInfo::getEquipment ( unsigned int  slot)

Returns the player's equipment at the given slot.

Definition at line 196 of file playerinfo.cpp.

◆ getInventory()

Inventory * PlayerInfo::getInventory ( )

Returns the player's inventory.

Definition at line 175 of file playerinfo.cpp.

◆ getNPCInteractionCount()

int PlayerInfo::getNPCInteractionCount ( )

Returns the number of currently open NPC interaction windows.

Definition at line 222 of file playerinfo.cpp.

◆ getNPCPostCount()

int PlayerInfo::getNPCPostCount ( )

Returns the number of currently open NPC post windows.

Definition at line 241 of file playerinfo.cpp.

◆ getStatBase()

int PlayerInfo::getStatBase ( int  id)

Returns the base value of the given stat.

Definition at line 103 of file playerinfo.cpp.

◆ getStatEffective()

int PlayerInfo::getStatEffective ( int  id)

Returns the current effective value of the given stat.

Effective is base

  • mod

Definition at line 137 of file playerinfo.cpp.

◆ getStatExperience()

std::pair< int, int > PlayerInfo::getStatExperience ( int  id)

Returns the experience of the given stat.

Definition at line 146 of file playerinfo.cpp.

◆ getStatMod()

int PlayerInfo::getStatMod ( int  id)

Returns the modifier for the given stat.

Definition at line 120 of file playerinfo.cpp.

◆ getStorageCount()

int PlayerInfo::getStorageCount ( )

Returns the number of currently open storage windows.

Definition at line 201 of file playerinfo.cpp.

◆ init()

void PlayerInfo::init ( )

Initializes some internals.

Definition at line 373 of file playerinfo.cpp.

◆ isTalking()

bool PlayerInfo::isTalking ( )

Returns true if the player is involved in a NPC interaction, false otherwise.

Definition at line 309 of file playerinfo.cpp.

◆ logic()

void PlayerInfo::logic ( )

Does necessary updates every tick.

Definition at line 315 of file playerinfo.cpp.

◆ setAbilityStatus()

void PlayerInfo::setAbilityStatus ( int  id,
int  current,
int  max,
int  recharge 
)

Changes the status of the given ability.

Definition at line 288 of file playerinfo.cpp.

◆ setAttribute()

void PlayerInfo::setAttribute ( int  id,
int  value,
bool  notify 
)

Changes the value of the given attribute.

Definition at line 93 of file playerinfo.cpp.

◆ setBackend()

void PlayerInfo::setBackend ( const PlayerInfoBackend backend)

Changes the internal PlayerInfoBackend reference;.

Definition at line 304 of file playerinfo.cpp.

◆ setBuySellState()

void PlayerInfo::setBuySellState ( BuySellState  buySellState)

Sets which buy, sell, or related interaction the player is currently involved in.

Definition at line 267 of file playerinfo.cpp.

◆ setInventoryItem()

void PlayerInfo::setInventoryItem ( int  index,
int  id,
int  amount 
)

Changes the inventory item at the given slot.

Definition at line 186 of file playerinfo.cpp.

◆ setNPCInteractionCount()

void PlayerInfo::setNPCInteractionCount ( int  count)

Sets the number of currently open NPC interaction windows.

Definition at line 227 of file playerinfo.cpp.

◆ setNPCPostCount()

void PlayerInfo::setNPCPostCount ( int  count)

Sets the number of currently open NPC post windows.

Definition at line 246 of file playerinfo.cpp.

◆ setStatBase()

void PlayerInfo::setStatBase ( int  id,
int  value,
bool  notify 
)

Changes the base value of the given stat.

Definition at line 112 of file playerinfo.cpp.

◆ setStatExperience()

void PlayerInfo::setStatExperience ( int  id,
int  have,
int  need,
bool  notify 
)

Changes the experience of the given stat.

Definition at line 163 of file playerinfo.cpp.

◆ setStatLevel()

void PlayerInfo::setStatLevel ( int  id,
int  value,
bool  notify = true 
)

Changes the level of the given stat.

◆ setStatMod()

void PlayerInfo::setStatMod ( int  id,
int  value,
bool  notify 
)

Changes the modifier for the given stat.

Definition at line 129 of file playerinfo.cpp.

◆ setStorageCount()

void PlayerInfo::setStorageCount ( int  count)

Sets the number of currently open storage windows.

Definition at line 206 of file playerinfo.cpp.

◆ triggerAttr()

void PlayerInfo::triggerAttr ( int  id,
int  old 
)

Definition at line 58 of file playerinfo.cpp.

◆ triggerStat()

void PlayerInfo::triggerStat ( int  id,
const std::string &  changed,
int  old1,
int  old2 = 0 
)

Definition at line 67 of file playerinfo.cpp.