ManaPlus
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
BeingInfo Class Reference

#include <beinginfo.h>

Public Member Functions

 BeingInfo ()
 
 ~BeingInfo ()
 
void setName (const std::string &name)
 
const std::string & getName () const
 
void setDisplay (const SpriteDisplay &display)
 
const SpriteDisplaygetDisplay () const
 
void setTargetCursorSize (const std::string &size)
 
void setTargetCursorSize (const TargetCursorSizeT &targetSize)
 
void setHoverCursor (const std::string &name)
 
void setHoverCursor (const CursorT &cursor)
 
CursorT getHoverCursor () const
 
TargetCursorSizeT getTargetCursorSize () const
 
void addSound (const ItemSoundEvent::Type event, const std::string &filename, const int delay)
 
const SoundInfogetSound (const ItemSoundEvent::Type event) const
 
void addAttack (const int id, const std::string &action, const std::string &skyAttack, const std::string &waterAttack, const std::string &rideAttack, const int effectId, const int hitEffectId, const int criticalHitEffectId, const int missEffectId, const std::string &missileParticle, const float missileZ, const float missileSpeed, const float missileDieDistance, const int missileLifeTime)
 
const AttackgetAttack (const int id) const
 
void setBlockWalkMask (const unsigned char mask)
 
unsigned char getBlockWalkMask () const
 
void setBlockType (const BlockTypeT &blockType)
 
BlockTypeT getBlockType () const
 
void setTargetOffsetX (const int n)
 
int getTargetOffsetX () const
 
void setTargetOffsetY (const int n)
 
int getTargetOffsetY () const
 
void setNameOffsetX (const int n)
 
int getNameOffsetX () const
 
void setNameOffsetY (const int n)
 
int getNameOffsetY () const
 
void setHpBarOffsetX (const int n)
 
int getHpBarOffsetX () const
 
void setHpBarOffsetY (const int n)
 
int getHpBarOffsetY () const
 
void setMaxHP (const int n)
 
int getMaxHP () const
 
bool isStaticMaxHP () const
 
void setStaticMaxHP (const bool n)
 
void setTargetSelection (const bool n)
 
bool isTargetSelection () const
 
int getSortOffsetY () const
 
void setSortOffsetY (const int n)
 
int getDeadSortOffsetY () const
 
void setDeadSortOffsetY (const int n)
 
BeingTypeId getAvatarId () const
 
void setAvatarId (const BeingTypeId id)
 
int getWidth () const
 
int getHeight () const
 
void setWidth (const int n)
 
void setHeight (const int n)
 
void setStartFollowDist (const int n)
 
int getStartFollowDist () const
 
void setFollowDist (const int n)
 
int getFollowDist () const
 
void setWalkSpeed (const int n)
 
int getWalkSpeed () const
 
void setWarpDist (const int n)
 
int getWarpDist () const
 
void setSitOffsetX (const int n)
 
int getSitOffsetX () const
 
void setSitOffsetY (const int n)
 
int getSitOffsetY () const
 
void setMoveOffsetX (const int n)
 
int getMoveOffsetX () const
 
void setMoveOffsetY (const int n)
 
int getMoveOffsetY () const
 
void setDeadOffsetX (const int n)
 
int getDeadOffsetX () const
 
void setDeadOffsetY (const int n)
 
int getDeadOffsetY () const
 
void setAttackOffsetX (const int n)
 
int getAttackOffsetX () const
 
void setAttackOffsetY (const int n)
 
int getAttackOffsetY () const
 
void setThinkTime (const int n)
 
int getThinkTime () const
 
void setDirectionType (const int n)
 
int getDirectionType () const
 
void setSitDirectionType (const int n)
 
int getSitDirectionType () const
 
void setDeadDirectionType (const int n)
 
int getDeadDirectionType () const
 
void setAttackDirectionType (const int n)
 
int getAttackDirectionType () const
 
void setAllowDelete (const bool b)
 
int getAllowDelete () const
 
void setAllowEquipment (const bool b)
 
bool getAllowEquipment () const
 
void setQuickActionEffectId (const int n)
 
int getQuickActionEffectId () const
 
void setColorsList (const std::string &name)
 
std::string getColor (const ItemColor idx) const
 
void addMenu (const std::string &name, const std::string &command)
 
const std::vector< BeingMenuItem > & getMenu () const A_CONST
 
void setString (const int idx, const std::string &value)
 
std::string getString (const int idx) const
 
std::string getCurrency () const
 
void setCurrency (const std::string &name)
 

Static Public Member Functions

static void init ()
 
static void clear ()
 

Static Public Attributes

static BeingInfounknown = 0
 
static Attackempty
 

Private Attributes

SpriteDisplay mDisplay
 
std::string mName
 
TargetCursorSizeT mTargetCursorSize
 
CursorT mHoverCursor
 
ItemSoundEvents mSounds
 
Attacks mAttacks
 
std::vector< BeingMenuItemmMenu
 
std::map< int, std::string > mStrings
 
std::string mCurrency
 
unsigned char mBlockWalkMask
 
BlockTypeT mBlockType
 
const std::map< ItemColor, ItemColorData > * mColors
 
int mTargetOffsetX
 
int mTargetOffsetY
 
int mNameOffsetX
 
int mNameOffsetY
 
int mHpBarOffsetX
 
int mHpBarOffsetY
 
int mMaxHP
 
int mSortOffsetY
 
int mDeadSortOffsetY
 
BeingTypeId mAvatarId
 
int mWidth
 
int mHeight
 
int mStartFollowDist
 
int mFollowDist
 
int mWarpDist
 
int mWalkSpeed
 
int mSitOffsetX
 
int mSitOffsetY
 
int mMoveOffsetX
 
int mMoveOffsetY
 
int mDeadOffsetX
 
int mDeadOffsetY
 
int mAttackOffsetX
 
int mAttackOffsetY
 
int mThinkTime
 
int mDirectionType
 
int mSitDirectionType
 
int mDeadDirectionType
 
int mAttackDirectionType
 
int mQuickActionEffectId
 
bool mStaticMaxHP
 
bool mTargetSelection
 
bool mAllowDelete
 
bool mAllowEquipment
 

Detailed Description

Holds information about a certain type of monster. This includes the name of the monster, the sprite to display and the sounds the monster makes.

See also
MonsterDB
NPCDB

Definition at line 53 of file beinginfo.h.

Constructor & Destructor Documentation

◆ BeingInfo()

BeingInfo::BeingInfo ( )

Definition at line 61 of file beinginfo.cpp.

61  :
62  mDisplay(),
63  // TRANSLATORS: being info default name
64  mName(_("unnamed")),
67  mSounds(),
68  mAttacks(),
69  mMenu(),
70  mStrings(),
71  mCurrency(),
77  mColors(nullptr),
78  mTargetOffsetX(0),
79  mTargetOffsetY(0),
80  mNameOffsetX(0),
81  mNameOffsetY(0),
82  mHpBarOffsetX(0),
83  mHpBarOffsetY(0),
84  mMaxHP(0),
85  mSortOffsetY(0),
86  mDeadSortOffsetY(31),
88  mWidth(0),
89  mHeight(0),
91  mFollowDist(1),
92  mWarpDist(11),
93  mWalkSpeed(0),
94  mSitOffsetX(0),
95  mSitOffsetY(0),
96  mMoveOffsetX(0),
97  mMoveOffsetY(0),
98  mDeadOffsetX(0),
99  mDeadOffsetY(0),
100  mAttackOffsetX(0),
101  mAttackOffsetY(0),
102  mThinkTime(50),
103  mDirectionType(1),
108  mStaticMaxHP(false),
109  mTargetSelection(true),
110  mAllowDelete(true),
111  mAllowEquipment(false)
112 {
113  SpriteDisplay display;
114  display.sprites.push_back(SpriteReference::Empty);
115 
116  setDisplay(display);
117 }
const BeingTypeId BeingTypeId_zero
Definition: beingtypeid.h:30
bool mStaticMaxHP
Definition: beinginfo.h:403
int mSitOffsetY
Definition: beinginfo.h:390
int mHpBarOffsetY
Definition: beinginfo.h:378
int mQuickActionEffectId
Definition: beinginfo.h:402
int mFollowDist
Definition: beinginfo.h:386
int mWidth
Definition: beinginfo.h:383
int mMoveOffsetX
Definition: beinginfo.h:391
bool mAllowDelete
Definition: beinginfo.h:405
int mSitOffsetX
Definition: beinginfo.h:389
int mDeadSortOffsetY
Definition: beinginfo.h:381
int mDeadOffsetY
Definition: beinginfo.h:394
int mStartFollowDist
Definition: beinginfo.h:385
SpriteDisplay mDisplay
Definition: beinginfo.h:361
int mSitDirectionType
Definition: beinginfo.h:399
int mWalkSpeed
Definition: beinginfo.h:388
int mNameOffsetY
Definition: beinginfo.h:376
int mHpBarOffsetX
Definition: beinginfo.h:377
std::map< int, std::string > mStrings
Definition: beinginfo.h:368
int mNameOffsetX
Definition: beinginfo.h:375
std::vector< BeingMenuItem > mMenu
Definition: beinginfo.h:367
void setDisplay(const SpriteDisplay &display)
Definition: beinginfo.cpp:127
const std::map< ItemColor, ItemColorData > * mColors
Definition: beinginfo.h:372
unsigned char mBlockWalkMask
Definition: beinginfo.h:370
int mAttackOffsetX
Definition: beinginfo.h:395
int mWarpDist
Definition: beinginfo.h:387
int mMaxHP
Definition: beinginfo.h:379
int mAttackDirectionType
Definition: beinginfo.h:401
std::string mName
Definition: beinginfo.h:362
CursorT mHoverCursor
Definition: beinginfo.h:364
int mSortOffsetY
Definition: beinginfo.h:380
int mDeadOffsetX
Definition: beinginfo.h:393
int mHeight
Definition: beinginfo.h:384
int mMoveOffsetY
Definition: beinginfo.h:392
int mTargetOffsetY
Definition: beinginfo.h:374
int mTargetOffsetX
Definition: beinginfo.h:373
int mAttackOffsetY
Definition: beinginfo.h:396
int mDirectionType
Definition: beinginfo.h:398
std::string mCurrency
Definition: beinginfo.h:369
bool mAllowEquipment
Definition: beinginfo.h:406
BlockTypeT mBlockType
Definition: beinginfo.h:371
int mThinkTime
Definition: beinginfo.h:397
ItemSoundEvents mSounds
Definition: beinginfo.h:365
int mDeadDirectionType
Definition: beinginfo.h:400
bool mTargetSelection
Definition: beinginfo.h:404
BeingTypeId mAvatarId
Definition: beinginfo.h:382
Attacks mAttacks
Definition: beinginfo.h:366
TargetCursorSizeT mTargetCursorSize
Definition: beinginfo.h:363
#define _(s)
Definition: gettext.h:35
@ MONSTERWALL
Definition: blockmask.h:37
@ CURSOR_POINTER
Definition: cursor.h:29
std::vector< SpriteReference * > sprites
Definition: spritedisplay.h:47
static SpriteReference * Empty

References SpriteReference::Empty, setDisplay(), and SpriteDisplay::sprites.

◆ ~BeingInfo()

BeingInfo::~BeingInfo ( )

Definition at line 119 of file beinginfo.cpp.

120 {
123  mSounds.clear();
125 }
void delete_all(Container &c)
Definition: dtor.h:56

References delete_all(), mAttacks, mDisplay, mSounds, and SpriteDisplay::sprites.

Member Function Documentation

◆ addAttack()

void BeingInfo::addAttack ( const int  id,
const std::string &  action,
const std::string &  skyAttack,
const std::string &  waterAttack,
const std::string &  rideAttack,
const int  effectId,
const int  hitEffectId,
const int  criticalHitEffectId,
const int  missEffectId,
const std::string &  missileParticle,
const float  missileZ,
const float  missileSpeed,
const float  missileDieDistance,
const int  missileLifeTime 
)

Definition at line 186 of file beinginfo.cpp.

200 {
201  delete mAttacks[id];
202  mAttacks[id] = new Attack(action,
203  skyAction,
204  waterAction,
205  rideAction,
206  effectId,
207  hitEffectId,
208  criticalHitEffectId,
209  missEffectId,
210  missileParticle,
211  missileZ,
212  missileSpeed,
213  missileDieDistance,
214  missileLifeTime);
215 }

References SkillType::Attack, and mAttacks.

Referenced by BeingCommon::readObjectNodes().

◆ addMenu()

void BeingInfo::addMenu ( const std::string &  name,
const std::string &  command 
)

Definition at line 254 of file beinginfo.cpp.

255 {
256  mMenu.push_back(BeingMenuItem(name, command));
257 }

References mMenu.

Referenced by NPCDB::loadXmlFile().

◆ addSound()

void BeingInfo::addSound ( const ItemSoundEvent::Type  event,
const std::string &  filename,
const int  delay 
)

Definition at line 154 of file beinginfo.cpp.

157 {
158  if (mSounds.find(event) == mSounds.end())
159  mSounds[event] = new SoundInfoVect;
160 
161  if (mSounds[event] != nullptr)
162  mSounds[event]->push_back(SoundInfo(filename, delay));
163 }
std::vector< SoundInfo > SoundInfoVect
Definition: soundinfo.h:49

References mSounds.

Referenced by BeingCommon::readObjectNodes().

◆ clear()

void BeingInfo::clear ( )
static

Definition at line 217 of file beinginfo.cpp.

218 {
220  delete2(empty)
221 }
static Attack * empty
Definition: beinginfo.h:57
static BeingInfo * unknown
Definition: beinginfo.h:56
#define delete2(var)
Definition: delete2.h:25

References delete2, empty, and unknown.

◆ getAllowDelete()

int BeingInfo::getAllowDelete ( ) const
inline

Definition at line 321 of file beinginfo.h.

322  { return static_cast<int>(mAllowDelete); }

References mAllowDelete.

◆ getAllowEquipment()

bool BeingInfo::getAllowEquipment ( ) const
inline

Definition at line 327 of file beinginfo.h.

328  { return mAllowEquipment; }

References mAllowEquipment.

◆ getAttack()

const Attack * BeingInfo::getAttack ( const int  id) const

Definition at line 180 of file beinginfo.cpp.

181 {
182  const Attacks::const_iterator i = mAttacks.find(id);
183  return (i == mAttacks.end()) ? empty : (*i).second;
184 }

References empty, and mAttacks.

◆ getAttackDirectionType()

int BeingInfo::getAttackDirectionType ( ) const
inline

Definition at line 315 of file beinginfo.h.

316  { return mAttackDirectionType; }

References mAttackDirectionType.

Referenced by Being::updateBotDirection().

◆ getAttackOffsetX()

int BeingInfo::getAttackOffsetX ( ) const
inline

Definition at line 279 of file beinginfo.h.

280  { return mAttackOffsetX; }

References mAttackOffsetX.

Referenced by Being::botFixOffset().

◆ getAttackOffsetY()

int BeingInfo::getAttackOffsetY ( ) const
inline

Definition at line 285 of file beinginfo.h.

286  { return mAttackOffsetY; }

References mAttackOffsetY.

Referenced by Being::botFixOffset().

◆ getAvatarId()

BeingTypeId BeingInfo::getAvatarId ( ) const
inline

Definition at line 198 of file beinginfo.h.

199  { return mAvatarId; }

References mAvatarId.

◆ getBlockType()

BlockTypeT BeingInfo::getBlockType ( ) const
inline

Definition at line 129 of file beinginfo.h.

130  { return mBlockType; }

References mBlockType.

Referenced by Being::getBlockType().

◆ getBlockWalkMask()

unsigned char BeingInfo::getBlockWalkMask ( ) const
inline

Gets the way the being is blocked by other objects

Definition at line 123 of file beinginfo.h.

124  { return mBlockWalkMask; }

References mBlockWalkMask.

Referenced by Being::getBlockWalkMask().

◆ getColor()

std::string BeingInfo::getColor ( const ItemColor  idx) const

Definition at line 242 of file beinginfo.cpp.

243 {
244  if (mColors == nullptr)
245  return std::string();
246 
247  const std::map <ItemColor, ItemColorData>::const_iterator
248  it = mColors->find(idx);
249  if (it == mColors->end())
250  return std::string();
251  return it->second.color;
252 }

References mColors.

◆ getCurrency()

std::string BeingInfo::getCurrency ( ) const
inline

Definition at line 350 of file beinginfo.h.

351  { return mCurrency; }

References mCurrency.

◆ getDeadDirectionType()

int BeingInfo::getDeadDirectionType ( ) const
inline

Definition at line 309 of file beinginfo.h.

310  { return mDeadDirectionType; }

References mDeadDirectionType.

Referenced by Being::updateBotDirection().

◆ getDeadOffsetX()

int BeingInfo::getDeadOffsetX ( ) const
inline

Definition at line 267 of file beinginfo.h.

268  { return mDeadOffsetX; }

References mDeadOffsetX.

Referenced by Being::botFixOffset().

◆ getDeadOffsetY()

int BeingInfo::getDeadOffsetY ( ) const
inline

Definition at line 273 of file beinginfo.h.

274  { return mDeadOffsetY; }

References mDeadOffsetY.

Referenced by Being::botFixOffset().

◆ getDeadSortOffsetY()

int BeingInfo::getDeadSortOffsetY ( ) const
inline

Definition at line 192 of file beinginfo.h.

193  { return mDeadSortOffsetY; }

References mDeadSortOffsetY.

◆ getDirectionType()

int BeingInfo::getDirectionType ( ) const
inline

Definition at line 297 of file beinginfo.h.

298  { return mDirectionType; }

References mDirectionType.

Referenced by Being::updateBotDirection().

◆ getDisplay()

const SpriteDisplay& BeingInfo::getDisplay ( ) const
inline

Definition at line 73 of file beinginfo.h.

74  { return mDisplay; }

References mDisplay.

◆ getFollowDist()

int BeingInfo::getFollowDist ( ) const
inline

Definition at line 225 of file beinginfo.h.

226  { return mFollowDist; }

References mFollowDist.

Referenced by Being::updateBotFollow().

◆ getHeight()

int BeingInfo::getHeight ( ) const
inline

Definition at line 207 of file beinginfo.h.

208  { return mHeight; }

References mHeight.

◆ getHoverCursor()

CursorT BeingInfo::getHoverCursor ( ) const
inline

Definition at line 87 of file beinginfo.h.

88  { return mHoverCursor; }

References mHoverCursor.

Referenced by Being::getHoverCursor().

◆ getHpBarOffsetX()

int BeingInfo::getHpBarOffsetX ( ) const
inline

Definition at line 159 of file beinginfo.h.

160  { return mHpBarOffsetX; }

References mHpBarOffsetX.

◆ getHpBarOffsetY()

int BeingInfo::getHpBarOffsetY ( ) const
inline

Definition at line 165 of file beinginfo.h.

166  { return mHpBarOffsetY; }

References mHpBarOffsetY.

◆ getMaxHP()

int BeingInfo::getMaxHP ( ) const
inline

Definition at line 171 of file beinginfo.h.

172  { return mMaxHP; }

References mMaxHP.

Referenced by ElementalDb::loadXmlFile(), HomunculusDB::loadXmlFile(), MercenaryDB::loadXmlFile(), and MonsterDB::loadXmlFile().

◆ getMenu()

const std::vector< BeingMenuItem > & BeingInfo::getMenu ( ) const

Definition at line 259 of file beinginfo.cpp.

260 {
261  return mMenu;
262 }

References mMenu.

Referenced by NPCDB::loadXmlFile().

◆ getMoveOffsetX()

int BeingInfo::getMoveOffsetX ( ) const
inline

Definition at line 255 of file beinginfo.h.

256  { return mMoveOffsetX; }

References mMoveOffsetX.

Referenced by Being::botFixOffset().

◆ getMoveOffsetY()

int BeingInfo::getMoveOffsetY ( ) const
inline

Definition at line 261 of file beinginfo.h.

262  { return mMoveOffsetY; }

References mMoveOffsetY.

Referenced by Being::botFixOffset().

◆ getName()

const std::string& BeingInfo::getName ( ) const
inline

Definition at line 68 of file beinginfo.h.

69  { return mName; }

References mName.

Referenced by BeingCommon::readObjectNodes(), and setTargetCursorSize().

◆ getNameOffsetX()

int BeingInfo::getNameOffsetX ( ) const
inline

Definition at line 147 of file beinginfo.h.

148  { return mNameOffsetX; }

References mNameOffsetX.

Referenced by Being::showName(), and Being::updateCoords().

◆ getNameOffsetY()

int BeingInfo::getNameOffsetY ( ) const
inline

Definition at line 153 of file beinginfo.h.

154  { return mNameOffsetY; }

References mNameOffsetY.

Referenced by Being::showName(), and Being::updateCoords().

◆ getQuickActionEffectId()

int BeingInfo::getQuickActionEffectId ( ) const
inline

Definition at line 333 of file beinginfo.h.

334  { return mQuickActionEffectId; }

References mQuickActionEffectId.

◆ getSitDirectionType()

int BeingInfo::getSitDirectionType ( ) const
inline

Definition at line 303 of file beinginfo.h.

304  { return mSitDirectionType; }

References mSitDirectionType.

Referenced by Being::updateBotDirection().

◆ getSitOffsetX()

int BeingInfo::getSitOffsetX ( ) const
inline

Definition at line 243 of file beinginfo.h.

244  { return mSitOffsetX; }

References mSitOffsetX.

Referenced by Being::botFixOffset().

◆ getSitOffsetY()

int BeingInfo::getSitOffsetY ( ) const
inline

Definition at line 249 of file beinginfo.h.

250  { return mSitOffsetY; }

References mSitOffsetY.

Referenced by Being::botFixOffset().

◆ getSortOffsetY()

int BeingInfo::getSortOffsetY ( ) const
inline

Definition at line 186 of file beinginfo.h.

187  { return mSortOffsetY; }

References mSortOffsetY.

◆ getSound()

const SoundInfo & BeingInfo::getSound ( const ItemSoundEvent::Type  event) const

Definition at line 165 of file beinginfo.cpp.

166 {
167  static SoundInfo emptySound("", 0);
168 
169  const ItemSoundEvents::const_iterator i = mSounds.find(event);
170 
171  if (i == mSounds.end())
172  return emptySound;
173 
174  const SoundInfoVect *const vect = i->second;
175  if (vect == nullptr || vect->empty())
176  return emptySound;
177  return vect->at(CAST_SIZE(rand()) % vect->size());
178 }
#define CAST_SIZE
Definition: cast.h:34

References CAST_SIZE, and mSounds.

◆ getStartFollowDist()

int BeingInfo::getStartFollowDist ( ) const
inline

Definition at line 219 of file beinginfo.h.

220  { return mStartFollowDist; }

References mStartFollowDist.

Referenced by Being::updateBotFollow().

◆ getString()

std::string BeingInfo::getString ( const int  idx) const

Definition at line 264 of file beinginfo.cpp.

265 {
266  const std::map<int, std::string>::const_iterator it = mStrings.find(idx);
267  if (it == mStrings.end())
268  return "";
269  return (*it).second;
270 }

References mStrings.

◆ getTargetCursorSize()

TargetCursorSizeT BeingInfo::getTargetCursorSize ( ) const
inline

Definition at line 90 of file beinginfo.h.

91  { return mTargetCursorSize; }

References mTargetCursorSize.

Referenced by Being::getTargetCursorSize().

◆ getTargetOffsetX()

int BeingInfo::getTargetOffsetX ( ) const
inline

Definition at line 135 of file beinginfo.h.

136  { return mTargetOffsetX; }

References mTargetOffsetX.

Referenced by Being::botFixOffset(), Being::drawBeingCursor(), and Being::getTargetOffsetX().

◆ getTargetOffsetY()

int BeingInfo::getTargetOffsetY ( ) const
inline

Definition at line 141 of file beinginfo.h.

142  { return mTargetOffsetY; }

References mTargetOffsetY.

Referenced by Being::botFixOffset(), Being::drawBeingCursor(), and Being::getTargetOffsetY().

◆ getThinkTime()

int BeingInfo::getThinkTime ( ) const
inline

Definition at line 291 of file beinginfo.h.

292  { return mThinkTime; }

References mThinkTime.

Referenced by Being::botLogic().

◆ getWalkSpeed()

int BeingInfo::getWalkSpeed ( ) const
inline

Definition at line 231 of file beinginfo.h.

232  { return mWalkSpeed; }

References mWalkSpeed.

◆ getWarpDist()

int BeingInfo::getWarpDist ( ) const
inline

Definition at line 237 of file beinginfo.h.

238  { return mWarpDist; }

References mWarpDist.

Referenced by Being::botLogic().

◆ getWidth()

int BeingInfo::getWidth ( ) const
inline

Definition at line 204 of file beinginfo.h.

205  { return mWidth; }

References mWidth.

◆ init()

void BeingInfo::init ( )
static

Definition at line 223 of file beinginfo.cpp.

224 {
225  if (empty != nullptr)
226  {
227  empty->mEffectId = paths.getIntValue("effectId");
228  empty->mHitEffectId = paths.getIntValue("hitEffectId");
229  empty->mCriticalHitEffectId = paths.getIntValue("criticalHitEffectId");
230  empty->mMissEffectId = paths.getIntValue("missEffectId");
231  }
232 }
int getIntValue(const std::string &key) const
Configuration paths
int mMissEffectId
Definition: attack.h:38
int mCriticalHitEffectId
Definition: attack.h:37
int mEffectId
Definition: attack.h:35
int mHitEffectId
Definition: attack.h:36

References empty, Configuration::getIntValue(), Attack::mCriticalHitEffectId, Attack::mEffectId, Attack::mHitEffectId, Attack::mMissEffectId, and paths.

Referenced by initEngines().

◆ isStaticMaxHP()

bool BeingInfo::isStaticMaxHP ( ) const
inline

Definition at line 174 of file beinginfo.h.

175  { return mStaticMaxHP; }

References mStaticMaxHP.

◆ isTargetSelection()

bool BeingInfo::isTargetSelection ( ) const
inline

◆ setAllowDelete()

void BeingInfo::setAllowDelete ( const bool  b)
inline

Definition at line 318 of file beinginfo.h.

319  { mAllowDelete = b; }

References mAllowDelete.

Referenced by NPCDB::loadXmlFile().

◆ setAllowEquipment()

void BeingInfo::setAllowEquipment ( const bool  b)
inline

Definition at line 324 of file beinginfo.h.

325  { mAllowEquipment = b; }

References mAllowEquipment.

Referenced by NPCDB::loadXmlFile().

◆ setAttackDirectionType()

void BeingInfo::setAttackDirectionType ( const int  n)
inline

Definition at line 312 of file beinginfo.h.

313  { mAttackDirectionType = n; }

References mAttackDirectionType.

◆ setAttackOffsetX()

void BeingInfo::setAttackOffsetX ( const int  n)
inline

Definition at line 276 of file beinginfo.h.

277  { mAttackOffsetX = n; }

References mAttackOffsetX.

◆ setAttackOffsetY()

void BeingInfo::setAttackOffsetY ( const int  n)
inline

Definition at line 282 of file beinginfo.h.

283  { mAttackOffsetY = n; }

References mAttackOffsetY.

◆ setAvatarId()

void BeingInfo::setAvatarId ( const BeingTypeId  id)
inline

Definition at line 201 of file beinginfo.h.

202  { mAvatarId = id; }

References mAvatarId.

Referenced by NPCDB::loadXmlFile().

◆ setBlockType()

void BeingInfo::setBlockType ( const BlockTypeT blockType)
inline

Definition at line 126 of file beinginfo.h.

127  { mBlockType = blockType; }

References mBlockType.

Referenced by ElementalDb::loadXmlFile(), HomunculusDB::loadXmlFile(), MercenaryDB::loadXmlFile(), and MonsterDB::loadXmlFile().

◆ setBlockWalkMask()

void BeingInfo::setBlockWalkMask ( const unsigned char  mask)
inline

Definition at line 117 of file beinginfo.h.

118  { mBlockWalkMask = mask; }

References mBlockWalkMask.

◆ setColorsList()

void BeingInfo::setColorsList ( const std::string &  name)

Definition at line 234 of file beinginfo.cpp.

235 {
236  if (name.empty())
237  mColors = nullptr;
238  else
240 }
const std::map< ItemColor, ItemColorData > * getColorsList(const std::string &name)
Definition: colordb.cpp:219

References ColorDB::getColorsList(), and mColors.

Referenced by ElementalDb::loadXmlFile(), HomunculusDB::loadXmlFile(), MercenaryDB::loadXmlFile(), and MonsterDB::loadXmlFile().

◆ setCurrency()

void BeingInfo::setCurrency ( const std::string &  name)
inline

Definition at line 353 of file beinginfo.h.

354  { mCurrency = name; }

References mCurrency.

Referenced by NPCDB::loadXmlFile().

◆ setDeadDirectionType()

void BeingInfo::setDeadDirectionType ( const int  n)
inline

Definition at line 306 of file beinginfo.h.

307  { mDeadDirectionType = n; }

References mDeadDirectionType.

◆ setDeadOffsetX()

void BeingInfo::setDeadOffsetX ( const int  n)
inline

Definition at line 264 of file beinginfo.h.

265  { mDeadOffsetX = n; }

References mDeadOffsetX.

◆ setDeadOffsetY()

void BeingInfo::setDeadOffsetY ( const int  n)
inline

Definition at line 270 of file beinginfo.h.

271  { mDeadOffsetY = n; }

References mDeadOffsetY.

◆ setDeadSortOffsetY()

void BeingInfo::setDeadSortOffsetY ( const int  n)
inline

◆ setDirectionType()

void BeingInfo::setDirectionType ( const int  n)
inline

Definition at line 294 of file beinginfo.h.

295  { mDirectionType = n; }

References mDirectionType.

◆ setDisplay()

void BeingInfo::setDisplay ( const SpriteDisplay display)

◆ setFollowDist()

void BeingInfo::setFollowDist ( const int  n)
inline

Definition at line 222 of file beinginfo.h.

223  { mFollowDist = n; }

References mFollowDist.

◆ setHeight()

void BeingInfo::setHeight ( const int  n)
inline

Definition at line 213 of file beinginfo.h.

214  { mHeight = n; }

References mHeight.

Referenced by AvatarDB::loadXmlFile().

◆ setHoverCursor() [1/2]

void BeingInfo::setHoverCursor ( const CursorT cursor)
inline

Definition at line 84 of file beinginfo.h.

85  { mHoverCursor = cursor; }

References mHoverCursor.

◆ setHoverCursor() [2/2]

void BeingInfo::setHoverCursor ( const std::string &  name)
inline

Definition at line 81 of file beinginfo.h.

82  { return setHoverCursor(Cursors::stringToCursor(name)); }
void setHoverCursor(const std::string &name)
Definition: beinginfo.h:81
CursorT stringToCursor(const std::string &name)
Definition: cursors.cpp:60

References Cursors::stringToCursor().

◆ setHpBarOffsetX()

void BeingInfo::setHpBarOffsetX ( const int  n)
inline

Definition at line 156 of file beinginfo.h.

157  { mHpBarOffsetX = n; }

References mHpBarOffsetX.

◆ setHpBarOffsetY()

void BeingInfo::setHpBarOffsetY ( const int  n)
inline

Definition at line 162 of file beinginfo.h.

163  { mHpBarOffsetY = n; }

References mHpBarOffsetY.

◆ setMaxHP()

void BeingInfo::setMaxHP ( const int  n)
inline

Definition at line 168 of file beinginfo.h.

169  { mMaxHP = n; }

References mMaxHP.

Referenced by ElementalDb::loadXmlFile(), HomunculusDB::loadXmlFile(), MercenaryDB::loadXmlFile(), and MonsterDB::loadXmlFile().

◆ setMoveOffsetX()

void BeingInfo::setMoveOffsetX ( const int  n)
inline

Definition at line 252 of file beinginfo.h.

253  { mMoveOffsetX = n; }

References mMoveOffsetX.

◆ setMoveOffsetY()

void BeingInfo::setMoveOffsetY ( const int  n)
inline

Definition at line 258 of file beinginfo.h.

259  { mMoveOffsetY = n; }

References mMoveOffsetY.

◆ setName()

void BeingInfo::setName ( const std::string &  name)
inline

◆ setNameOffsetX()

void BeingInfo::setNameOffsetX ( const int  n)
inline

Definition at line 144 of file beinginfo.h.

145  { mNameOffsetX = n; }

References mNameOffsetX.

◆ setNameOffsetY()

void BeingInfo::setNameOffsetY ( const int  n)
inline

Definition at line 150 of file beinginfo.h.

151  { mNameOffsetY = n; }

References mNameOffsetY.

◆ setQuickActionEffectId()

void BeingInfo::setQuickActionEffectId ( const int  n)
inline

Definition at line 330 of file beinginfo.h.

331  { mQuickActionEffectId = n; }

References mQuickActionEffectId.

◆ setSitDirectionType()

void BeingInfo::setSitDirectionType ( const int  n)
inline

Definition at line 300 of file beinginfo.h.

301  { mSitDirectionType = n; }

References mSitDirectionType.

◆ setSitOffsetX()

void BeingInfo::setSitOffsetX ( const int  n)
inline

Definition at line 240 of file beinginfo.h.

241  { mSitOffsetX = n; }

References mSitOffsetX.

◆ setSitOffsetY()

void BeingInfo::setSitOffsetY ( const int  n)
inline

Definition at line 246 of file beinginfo.h.

247  { mSitOffsetY = n; }

References mSitOffsetY.

◆ setSortOffsetY()

void BeingInfo::setSortOffsetY ( const int  n)
inline

Definition at line 189 of file beinginfo.h.

190  { mSortOffsetY = n; }

References mSortOffsetY.

◆ setStartFollowDist()

void BeingInfo::setStartFollowDist ( const int  n)
inline

Definition at line 216 of file beinginfo.h.

217  { mStartFollowDist = n; }

References mStartFollowDist.

◆ setStaticMaxHP()

void BeingInfo::setStaticMaxHP ( const bool  n)
inline

◆ setString()

void BeingInfo::setString ( const int  idx,
const std::string &  value 
)
inline

Definition at line 344 of file beinginfo.h.

346  { mStrings[idx] = value; }

References mStrings.

Referenced by PETDB::loadXmlFile().

◆ setTargetCursorSize() [1/2]

void BeingInfo::setTargetCursorSize ( const std::string &  size)

Definition at line 132 of file beinginfo.cpp.

133 {
134  if (size == "small")
135  {
137  }
138  else if (size == "medium")
139  {
141  }
142  else if (size == "large")
143  {
145  }
146  else
147  {
148  logger->log("Unknown target cursor type \"%s\" for %s - using medium "
149  "sized one", size.c_str(), getName().c_str());
151  }
152 }
const std::string & getName() const
Definition: beinginfo.h:68
void setTargetCursorSize(const std::string &size)
Definition: beinginfo.cpp:132
void log(const char *const log_text,...)
Definition: logger.cpp:269
Logger * logger
Definition: logger.cpp:89
int size()
Definition: emotedb.cpp:306

References getName(), TargetCursorSize::LARGE, Logger::log(), logger, TargetCursorSize::MEDIUM, EmoteDB::size(), and TargetCursorSize::SMALL.

◆ setTargetCursorSize() [2/2]

void BeingInfo::setTargetCursorSize ( const TargetCursorSizeT targetSize)
inline

Definition at line 78 of file beinginfo.h.

79  { mTargetCursorSize = targetSize; }

References mTargetCursorSize.

◆ setTargetOffsetX()

void BeingInfo::setTargetOffsetX ( const int  n)
inline

Definition at line 132 of file beinginfo.h.

133  { mTargetOffsetX = n; }

References mTargetOffsetX.

Referenced by AvatarDB::loadXmlFile().

◆ setTargetOffsetY()

void BeingInfo::setTargetOffsetY ( const int  n)
inline

Definition at line 138 of file beinginfo.h.

139  { mTargetOffsetY = n; }

References mTargetOffsetY.

Referenced by AvatarDB::loadXmlFile().

◆ setTargetSelection()

void BeingInfo::setTargetSelection ( const bool  n)
inline

Definition at line 180 of file beinginfo.h.

181  { mTargetSelection = n; }

References mTargetSelection.

Referenced by NPCDB::loadXmlFile(), PETDB::loadXmlFile(), and SkillUnitDb::loadXmlFile().

◆ setThinkTime()

void BeingInfo::setThinkTime ( const int  n)
inline

Definition at line 288 of file beinginfo.h.

289  { mThinkTime = n; }

References mThinkTime.

◆ setWalkSpeed()

void BeingInfo::setWalkSpeed ( const int  n)
inline

Definition at line 228 of file beinginfo.h.

229  { mWalkSpeed = n; }

References mWalkSpeed.

◆ setWarpDist()

void BeingInfo::setWarpDist ( const int  n)
inline

Definition at line 234 of file beinginfo.h.

235  { mWarpDist = n; }

References mWarpDist.

◆ setWidth()

void BeingInfo::setWidth ( const int  n)
inline

Definition at line 210 of file beinginfo.h.

211  { mWidth = n; }

References mWidth.

Referenced by AvatarDB::loadXmlFile().

Field Documentation

◆ empty

Attack * BeingInfo::empty
static
Initial value:
-1,
-1,
-1,
-1,
std::string(),
32.0F,
7.0F,
8.0F,
500)
static const std::string ATTACKWATER("attackwater")
static const std::string ATTACKSKY("attacksky")
static const std::string ATTACKRIDE("attackride")
static const std::string ATTACK("attack")

Definition at line 57 of file beinginfo.h.

Referenced by clear(), getAttack(), and init().

◆ mAllowDelete

bool BeingInfo::mAllowDelete
private

Definition at line 405 of file beinginfo.h.

Referenced by getAllowDelete(), and setAllowDelete().

◆ mAllowEquipment

bool BeingInfo::mAllowEquipment
private

Definition at line 406 of file beinginfo.h.

Referenced by getAllowEquipment(), and setAllowEquipment().

◆ mAttackDirectionType

int BeingInfo::mAttackDirectionType
private

Definition at line 401 of file beinginfo.h.

Referenced by getAttackDirectionType(), and setAttackDirectionType().

◆ mAttackOffsetX

int BeingInfo::mAttackOffsetX
private

Definition at line 395 of file beinginfo.h.

Referenced by getAttackOffsetX(), and setAttackOffsetX().

◆ mAttackOffsetY

int BeingInfo::mAttackOffsetY
private

Definition at line 396 of file beinginfo.h.

Referenced by getAttackOffsetY(), and setAttackOffsetY().

◆ mAttacks

Attacks BeingInfo::mAttacks
private

Definition at line 366 of file beinginfo.h.

Referenced by addAttack(), getAttack(), and ~BeingInfo().

◆ mAvatarId

BeingTypeId BeingInfo::mAvatarId
private

Definition at line 382 of file beinginfo.h.

Referenced by getAvatarId(), and setAvatarId().

◆ mBlockType

BlockTypeT BeingInfo::mBlockType
private

Definition at line 371 of file beinginfo.h.

Referenced by getBlockType(), and setBlockType().

◆ mBlockWalkMask

unsigned char BeingInfo::mBlockWalkMask
private

Definition at line 370 of file beinginfo.h.

Referenced by getBlockWalkMask(), and setBlockWalkMask().

◆ mColors

const std::map<ItemColor, ItemColorData>* BeingInfo::mColors
private

Definition at line 372 of file beinginfo.h.

Referenced by getColor(), and setColorsList().

◆ mCurrency

std::string BeingInfo::mCurrency
private

Definition at line 369 of file beinginfo.h.

Referenced by getCurrency(), and setCurrency().

◆ mDeadDirectionType

int BeingInfo::mDeadDirectionType
private

Definition at line 400 of file beinginfo.h.

Referenced by getDeadDirectionType(), and setDeadDirectionType().

◆ mDeadOffsetX

int BeingInfo::mDeadOffsetX
private

Definition at line 393 of file beinginfo.h.

Referenced by getDeadOffsetX(), and setDeadOffsetX().

◆ mDeadOffsetY

int BeingInfo::mDeadOffsetY
private

Definition at line 394 of file beinginfo.h.

Referenced by getDeadOffsetY(), and setDeadOffsetY().

◆ mDeadSortOffsetY

int BeingInfo::mDeadSortOffsetY
private

Definition at line 381 of file beinginfo.h.

Referenced by getDeadSortOffsetY(), and setDeadSortOffsetY().

◆ mDirectionType

int BeingInfo::mDirectionType
private

Definition at line 398 of file beinginfo.h.

Referenced by getDirectionType(), and setDirectionType().

◆ mDisplay

SpriteDisplay BeingInfo::mDisplay
private

Definition at line 361 of file beinginfo.h.

Referenced by getDisplay(), setDisplay(), and ~BeingInfo().

◆ mFollowDist

int BeingInfo::mFollowDist
private

Definition at line 386 of file beinginfo.h.

Referenced by getFollowDist(), and setFollowDist().

◆ mHeight

int BeingInfo::mHeight
private

Definition at line 384 of file beinginfo.h.

Referenced by getHeight(), and setHeight().

◆ mHoverCursor

CursorT BeingInfo::mHoverCursor
private

Definition at line 364 of file beinginfo.h.

Referenced by getHoverCursor(), and setHoverCursor().

◆ mHpBarOffsetX

int BeingInfo::mHpBarOffsetX
private

Definition at line 377 of file beinginfo.h.

Referenced by getHpBarOffsetX(), and setHpBarOffsetX().

◆ mHpBarOffsetY

int BeingInfo::mHpBarOffsetY
private

Definition at line 378 of file beinginfo.h.

Referenced by getHpBarOffsetY(), and setHpBarOffsetY().

◆ mMaxHP

int BeingInfo::mMaxHP
private

Definition at line 379 of file beinginfo.h.

Referenced by getMaxHP(), and setMaxHP().

◆ mMenu

std::vector<BeingMenuItem> BeingInfo::mMenu
private

Definition at line 367 of file beinginfo.h.

Referenced by addMenu(), and getMenu().

◆ mMoveOffsetX

int BeingInfo::mMoveOffsetX
private

Definition at line 391 of file beinginfo.h.

Referenced by getMoveOffsetX(), and setMoveOffsetX().

◆ mMoveOffsetY

int BeingInfo::mMoveOffsetY
private

Definition at line 392 of file beinginfo.h.

Referenced by getMoveOffsetY(), and setMoveOffsetY().

◆ mName

std::string BeingInfo::mName
private

Definition at line 362 of file beinginfo.h.

Referenced by getName(), and setName().

◆ mNameOffsetX

int BeingInfo::mNameOffsetX
private

Definition at line 375 of file beinginfo.h.

Referenced by getNameOffsetX(), and setNameOffsetX().

◆ mNameOffsetY

int BeingInfo::mNameOffsetY
private

Definition at line 376 of file beinginfo.h.

Referenced by getNameOffsetY(), and setNameOffsetY().

◆ mQuickActionEffectId

int BeingInfo::mQuickActionEffectId
private

Definition at line 402 of file beinginfo.h.

Referenced by getQuickActionEffectId(), and setQuickActionEffectId().

◆ mSitDirectionType

int BeingInfo::mSitDirectionType
private

Definition at line 399 of file beinginfo.h.

Referenced by getSitDirectionType(), and setSitDirectionType().

◆ mSitOffsetX

int BeingInfo::mSitOffsetX
private

Definition at line 389 of file beinginfo.h.

Referenced by getSitOffsetX(), and setSitOffsetX().

◆ mSitOffsetY

int BeingInfo::mSitOffsetY
private

Definition at line 390 of file beinginfo.h.

Referenced by getSitOffsetY(), and setSitOffsetY().

◆ mSortOffsetY

int BeingInfo::mSortOffsetY
private

Definition at line 380 of file beinginfo.h.

Referenced by getSortOffsetY(), and setSortOffsetY().

◆ mSounds

ItemSoundEvents BeingInfo::mSounds
private

Definition at line 365 of file beinginfo.h.

Referenced by addSound(), getSound(), and ~BeingInfo().

◆ mStartFollowDist

int BeingInfo::mStartFollowDist
private

Definition at line 385 of file beinginfo.h.

Referenced by getStartFollowDist(), and setStartFollowDist().

◆ mStaticMaxHP

bool BeingInfo::mStaticMaxHP
private

Definition at line 403 of file beinginfo.h.

Referenced by isStaticMaxHP(), and setStaticMaxHP().

◆ mStrings

std::map<int, std::string> BeingInfo::mStrings
private

Definition at line 368 of file beinginfo.h.

Referenced by getString(), and setString().

◆ mTargetCursorSize

TargetCursorSizeT BeingInfo::mTargetCursorSize
private

Definition at line 363 of file beinginfo.h.

Referenced by getTargetCursorSize(), and setTargetCursorSize().

◆ mTargetOffsetX

int BeingInfo::mTargetOffsetX
private

Definition at line 373 of file beinginfo.h.

Referenced by getTargetOffsetX(), and setTargetOffsetX().

◆ mTargetOffsetY

int BeingInfo::mTargetOffsetY
private

Definition at line 374 of file beinginfo.h.

Referenced by getTargetOffsetY(), and setTargetOffsetY().

◆ mTargetSelection

bool BeingInfo::mTargetSelection
private

Definition at line 404 of file beinginfo.h.

Referenced by isTargetSelection(), and setTargetSelection().

◆ mThinkTime

int BeingInfo::mThinkTime
private

Definition at line 397 of file beinginfo.h.

Referenced by getThinkTime(), and setThinkTime().

◆ mWalkSpeed

int BeingInfo::mWalkSpeed
private

Definition at line 388 of file beinginfo.h.

Referenced by getWalkSpeed(), and setWalkSpeed().

◆ mWarpDist

int BeingInfo::mWarpDist
private

Definition at line 387 of file beinginfo.h.

Referenced by getWarpDist(), and setWarpDist().

◆ mWidth

int BeingInfo::mWidth
private

Definition at line 383 of file beinginfo.h.

Referenced by getWidth(), and setWidth().

◆ unknown

BeingInfo * BeingInfo::unknown = 0
static

The documentation for this class was generated from the following files: