ManaPlus
Namespaces | Macros | Functions | Variables
playerinfo.cpp File Reference

(986a3bf)

#include "being/playerinfo.h"
#include "configuration.h"
#include "itemsoundmanager.h"
#include "settings.h"
#include "being/localplayer.h"
#include "being/homunculusinfo.h"
#include "being/mercenaryinfo.h"
#include "being/petinfo.h"
#include "gui/windows/inventorywindow.h"
#include "gui/windows/npcdialog.h"
#include "listeners/statlistener.h"
#include "net/homunculushandler.h"
#include "net/inventoryhandler.h"
#include "net/mercenaryhandler.h"
#include "net/playerhandler.h"
#include "resources/item/item.h"
#include "utils/delete2.h"
#include "utils/translation/translationmanager.h"
#include "debug.h"

Go to the source code of this file.

Namespaces

 PlayerInfo
 

Macros

#define updateAttackStat(atk, delay, speed)
 

Functions

void PlayerInfo::triggerAttr (const AttributesT id, const int64_t old)
 
void PlayerInfo::triggerStat (const AttributesT id, const int old1, const int old2)
 
int64_t PlayerInfo::getAttribute64 (const AttributesT id)
 
int32_t PlayerInfo::getAttribute (const AttributesT id)
 
void PlayerInfo::setAttribute (const AttributesT id, const int64_t value, const Notify notify)
 
int PlayerInfo::getSkillLevel (const int id)
 
void PlayerInfo::setSkillLevel (const int id, const int value)
 
int PlayerInfo::getStatBase (const AttributesT id)
 
void PlayerInfo::setStatBase (const AttributesT id, const int value, const Notify notify)
 
int PlayerInfo::getStatMod (const AttributesT id)
 
void PlayerInfo::setStatMod (const AttributesT id, const int value, const Notify notify)
 
int PlayerInfo::getStatEffective (const AttributesT id)
 
const std::pair< int, int > PlayerInfo::getStatExperience (const AttributesT id)
 
InventoryPlayerInfo::getInventory ()
 
InventoryPlayerInfo::getStorageInventory ()
 
InventoryPlayerInfo::getCartInventory ()
 
void PlayerInfo::clearInventory ()
 
EquipmentPlayerInfo::getEquipment ()
 
const ItemPlayerInfo::getEquipment (const unsigned int slot)
 
void PlayerInfo::setEquipmentBackend (Equipment::Backend *const backend)
 
void PlayerInfo::equipItem (const Item *const item, const Sfx sfx)
 
void PlayerInfo::unequipItem (const Item *const item, const Sfx sfx)
 
void PlayerInfo::useItem (const Item *const item, const Sfx sfx)
 
void PlayerInfo::useEquipItem (const Item *const item, const int16_t useType, const Sfx sfx)
 
void PlayerInfo::useEquipItem2 (const Item *const item, const int16_t useType, const Sfx sfx)
 
void PlayerInfo::dropItem (const Item *const item, const int amount, const Sfx sfx)
 
void PlayerInfo::pickUpItem (const FloorItem *const item, const Sfx sfx)
 
void PlayerInfo::setBackend (const PlayerInfoBackend &backend)
 
void PlayerInfo::setCharId (const int charId)
 
int PlayerInfo::getCharId ()
 
Trading PlayerInfo::isTrading ()
 
void PlayerInfo::setTrading (const Trading trading)
 
void PlayerInfo::updateAttrs ()
 
void PlayerInfo::init ()
 
void PlayerInfo::deinit ()
 
void PlayerInfo::loadData ()
 
void PlayerInfo::clear ()
 
bool PlayerInfo::isTalking ()
 
void PlayerInfo::gameDestroyed ()
 
void PlayerInfo::stateChange (const StateT state)
 
static void PlayerInfo::saveProtectedItems ()
 
void PlayerInfo::protectItem (const int id)
 
void PlayerInfo::unprotectItem (const int id)
 
bool PlayerInfo::isItemProtected (const int id)
 
void PlayerInfo::setMercenary (MercenaryInfo *const info)
 
void PlayerInfo::setMercenaryBeing (Being *const being)
 
void PlayerInfo::setElemental (const BeingId id)
 
BeingId PlayerInfo::getElementalId ()
 
MercenaryInfoPlayerInfo::getMercenary ()
 
void PlayerInfo::setPet (PetInfo *const info)
 
void PlayerInfo::setPetBeing (Being *const being)
 
PetInfoPlayerInfo::getPet ()
 
BeingId PlayerInfo::getPetBeingId ()
 
void PlayerInfo::setHomunculus (HomunculusInfo *const info)
 
void PlayerInfo::setHomunculusBeing (Being *const being)
 
HomunculusInfoPlayerInfo::getHomunculus ()
 
BeingId PlayerInfo::getHomunculusId ()
 
BeingId PlayerInfo::getMercenaryId ()
 
void PlayerInfo::updateAttackAi (const BeingId targetId, const Keep keep)
 
std::string PlayerInfo::getRoomName ()
 
void PlayerInfo::setRoomName (const std::string &name)
 
bool PlayerInfo::isInRoom ()
 
void PlayerInfo::setGuildPositionFlags (const GuildPositionFlags::Type pos)
 
GuildPositionFlags::Type PlayerInfo::getGuildPositionFlags ()
 
void PlayerInfo::enableVending (const bool b)
 
bool PlayerInfo::isVending ()
 
void PlayerInfo::setServerLanguage (const int lang)
 
int PlayerInfo::getServerLanguage ()
 

Variables

PlayerInfoBackend PlayerInfo::mData
 
int PlayerInfo::mCharId = 0
 
InventoryPlayerInfo::mInventory = 0
 
InventoryPlayerInfo::mCartInventory = 0
 
MercenaryInfoPlayerInfo::mMercenary = 0
 
HomunculusInfoPlayerInfo::mHomunculus = 0
 
PetInfoPlayerInfo::mPet = 0
 
std::string PlayerInfo::mRoomName
 
EquipmentPlayerInfo::mEquipment = 0
 
BeingId PlayerInfo::mPetBeingId = BeingId_zero
 
GuildPositionFlags::Type PlayerInfo::mGuildPositionFlags = GuildPositionFlags::None
 
BeingId PlayerInfo::mElementalId = BeingId_zero
 
Trading PlayerInfo::mTrading = Trading_false
 
bool PlayerInfo::mVending = false
 
int PlayerInfo::mLevelProgress = 0
 
int PlayerInfo::mServerLanguage = -1
 
std::set< int > PlayerInfo::mProtectedItems
 

Macro Definition Documentation

◆ updateAttackStat

#define updateAttackStat (   atk,
  delay,
  speed 
)
Value:
attackDelay = getStatBase(delay); \
if (attackDelay != 0) \
{ \
setStatBase(speed, \
getStatBase(atk) * 1000 / attackDelay, \
setStatMod(speed, \
getStatMod(atk) * 1000 / attackDelay, \
} \
else \
{ \
setStatBase(speed, 0, \
setStatMod(speed, 0, \
}
int getStatBase(const AttributesT id)
Definition: playerinfo.cpp:135
int getStatMod(const AttributesT id)
Definition: playerinfo.cpp:151
const bool Notify_false
Definition: notify.h:30
const bool Notify_true
Definition: notify.h:30

Definition at line 401 of file playerinfo.cpp.