Mana
|
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. | |
Inventory * | getInventory () |
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. | |
Equipment * | getEquipment () |
Returns the player's equipment. | |
Item * | getEquipment (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. | |
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.
void PlayerInfo::clearAbilityStatus | ( | int | id | ) |
Removes the status for the given ability.
Definition at line 283 of file playerinfo.cpp.
void PlayerInfo::clearInventory | ( | ) |
Clears the player's inventory and equipment.
Definition at line 180 of file playerinfo.cpp.
const std::map< int, Ability > & PlayerInfo::getAbilityStatus | ( | ) |
Returns the status all abilities.
Definition at line 297 of file playerinfo.cpp.
int PlayerInfo::getAttribute | ( | int | id | ) |
Returns the value of the given attribute.
Definition at line 84 of file playerinfo.cpp.
BuySellState PlayerInfo::getBuySellState | ( | ) |
Returns the current buy, sell, or related interaction the player is involved in.
Definition at line 262 of file playerinfo.cpp.
Equipment * PlayerInfo::getEquipment | ( | ) |
Returns the player's equipment.
Definition at line 191 of file playerinfo.cpp.
Item * PlayerInfo::getEquipment | ( | unsigned int | slot | ) |
Returns the player's equipment at the given slot.
Definition at line 196 of file playerinfo.cpp.
Inventory * PlayerInfo::getInventory | ( | ) |
Returns the player's inventory.
Definition at line 175 of file playerinfo.cpp.
int PlayerInfo::getNPCInteractionCount | ( | ) |
Returns the number of currently open NPC interaction windows.
Definition at line 222 of file playerinfo.cpp.
int PlayerInfo::getNPCPostCount | ( | ) |
Returns the number of currently open NPC post windows.
Definition at line 241 of file playerinfo.cpp.
int PlayerInfo::getStatBase | ( | int | id | ) |
Returns the base value of the given stat.
Definition at line 103 of file playerinfo.cpp.
int PlayerInfo::getStatEffective | ( | int | id | ) |
Returns the current effective value of the given stat.
Effective is base
Definition at line 137 of file playerinfo.cpp.
std::pair< int, int > PlayerInfo::getStatExperience | ( | int | id | ) |
Returns the experience of the given stat.
Definition at line 146 of file playerinfo.cpp.
int PlayerInfo::getStatMod | ( | int | id | ) |
Returns the modifier for the given stat.
Definition at line 120 of file playerinfo.cpp.
int PlayerInfo::getStorageCount | ( | ) |
Returns the number of currently open storage windows.
Definition at line 201 of file playerinfo.cpp.
void PlayerInfo::init | ( | ) |
Initializes some internals.
Definition at line 373 of file playerinfo.cpp.
bool PlayerInfo::isTalking | ( | ) |
Returns true if the player is involved in a NPC interaction, false otherwise.
Definition at line 309 of file playerinfo.cpp.
void PlayerInfo::logic | ( | ) |
Does necessary updates every tick.
Definition at line 315 of file playerinfo.cpp.
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.
void PlayerInfo::setAttribute | ( | int | id, |
int | value, | ||
bool | notify | ||
) |
Changes the value of the given attribute.
Definition at line 93 of file playerinfo.cpp.
void PlayerInfo::setBackend | ( | const PlayerInfoBackend & | backend | ) |
Changes the internal PlayerInfoBackend reference;.
Definition at line 304 of file playerinfo.cpp.
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.
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.
void PlayerInfo::setNPCInteractionCount | ( | int | count | ) |
Sets the number of currently open NPC interaction windows.
Definition at line 227 of file playerinfo.cpp.
void PlayerInfo::setNPCPostCount | ( | int | count | ) |
Sets the number of currently open NPC post windows.
Definition at line 246 of file playerinfo.cpp.
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.
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.
void PlayerInfo::setStatLevel | ( | int | id, |
int | value, | ||
bool | notify = true |
||
) |
Changes the level of the given stat.
void PlayerInfo::setStatMod | ( | int | id, |
int | value, | ||
bool | notify | ||
) |
Changes the modifier for the given stat.
Definition at line 129 of file playerinfo.cpp.
void PlayerInfo::setStorageCount | ( | int | count | ) |
Sets the number of currently open storage windows.
Definition at line 206 of file playerinfo.cpp.
void PlayerInfo::triggerAttr | ( | int | id, |
int | old | ||
) |
Definition at line 58 of file playerinfo.cpp.
void PlayerInfo::triggerStat | ( | int | id, |
const std::string & | changed, | ||
int | old1, | ||
int | old2 = 0 |
||
) |
Definition at line 67 of file playerinfo.cpp.