summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp58
-rw-r--r--src/being.h67
2 files changed, 60 insertions, 65 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 0c3e1160b..2087b6e0b 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -98,43 +98,50 @@ Being::Being(const int id, const Type type, const uint16_t subtype,
ActorSprite(id),
mNextSound(),
mInfo(BeingInfo::unknown),
- mActionTime(0),
mEmotionSprite(nullptr),
- mEmotionTime(0),
- mSpeechTime(0),
mAnimationEffect(nullptr),
- mAttackSpeed(350),
- mAction(STAND),
- mSubType(0xFFFF),
- mDirection(DOWN),
- mDirectionDelayed(0),
- mSpriteDirection(DIRECTION_DOWN),
mSpriteAction(SpriteAction::STAND),
mName(),
mRaceName(),
mPartyName(),
mGuildName(),
+ mSpeech(),
mDispName(nullptr),
mNameColor(nullptr),
- mShowName(false),
mEquippedWeapon(nullptr),
mPath(),
- mSpeech(),
mText(nullptr),
mTextColor(nullptr),
- mLevel(0),
mDest(),
- mSpriteIDs(),
mSpriteColors(),
+ mSpriteIDs(),
mSpriteColorsIds(),
- mGender(GENDER_UNSPECIFIED),
mGuilds(),
mParty(nullptr),
- mIsGM(false),
+ mActionTime(0),
+ mEmotionTime(0),
+ mSpeechTime(0),
+ mAttackSpeed(350),
+ mLevel(0),
mAttackRange(1),
+ mGender(GENDER_UNSPECIFIED),
+ mAction(STAND),
+ mSubType(0xFFFF),
+ mDirection(DOWN),
+ mDirectionDelayed(0),
+ mSpriteDirection(DIRECTION_DOWN),
+ mShowName(false),
+ mIsGM(false),
mType(type),
mSpeechBubble(new SpeechBubble),
mWalkSpeed(Net::getPlayerHandler()->getDefaultWalkSpeed()),
+ mIp(),
+ mSpriteRemap(new int[20]),
+ mSpriteHide(new int[20]),
+ mComment(),
+ mPet(nullptr),
+ mOwner(nullptr),
+ mSpecialParticle(nullptr),
mX(0),
mY(0),
mDamageTaken(0),
@@ -148,29 +155,22 @@ Being::Being(const int id, const Type type, const uint16_t subtype,
mTalkTime(0),
mOtherTime(0),
mTestTime(cur_time),
- mErased(false),
- mEnemy(false),
- mIp(""),
mAttackDelay(0),
mMinHit(0),
mMaxHit(0),
mCriticalHit(0),
mPvpRank(0),
- mSpriteRemap(new int[20]),
- mSpriteHide(new int[20]),
- mComment(""),
+ mNumber(100),
+ mPetId(0),
+ mLook(0),
+ mHairColor(0),
+ mErased(false),
+ mEnemy(false),
mGotComment(false),
mAdvanced(false),
mShop(false),
mAway(false),
- mInactive(false),
- mNumber(100),
- mHairColor(0),
- mPet(nullptr),
- mPetId(0),
- mLook(0),
- mOwner(nullptr),
- mSpecialParticle(nullptr)
+ mInactive(false)
{
for (int f = 0; f < 20; f ++)
{
diff --git a/src/being.h b/src/being.h
index 68ef97c10..46d82c79d 100644
--- a/src/being.h
+++ b/src/being.h
@@ -916,38 +916,21 @@ class Being : public ActorSprite, public ConfigListener
static int getDefaultEffectId(const int type);
BeingInfo *mInfo;
-
- int mActionTime; /**< Time spent in current action */
-
AnimatedSprite *mEmotionSprite;
- int mEmotionTime; /**< Time until emotion disappears */
-
- /** Time until the last speech sentence disappears */
- int mSpeechTime;
-
AnimatedSprite* mAnimationEffect;
- int mAttackSpeed; /**< Attack speed */
-
- Action mAction; /**< Action the being is performing */
- uint16_t mSubType; /**< Subtype (graphical view, basically) */
-
- uint8_t mDirection; /**< Facing direction */
- uint8_t mDirectionDelayed; /**< Facing direction */
-
- uint8_t mSpriteDirection; /**< Facing direction */
std::string mSpriteAction;
std::string mName; /**< Name of character */
std::string mRaceName;
std::string mPartyName;
std::string mGuildName;
+ std::string mSpeech;
/**
* Holds a text object when the being displays it's name, 0 otherwise
*/
FlashText *mDispName;
const gcn::Color *mNameColor;
- bool mShowName;
/** Engine-related infos about weapon. */
const ItemInfo *mEquippedWeapon;
@@ -956,24 +939,36 @@ class Being : public ActorSprite, public ConfigListener
static int mNumberOfRaces; /** Number of races in use */
Path mPath;
- std::string mSpeech;
Text *mText;
const gcn::Color *mTextColor;
- int mLevel;
Vector mDest; /**< destination coordinates. */
- std::vector<int> mSpriteIDs;
StringVect mSpriteColors;
+ std::vector<int> mSpriteIDs;
std::vector<int> mSpriteColorsIds;
- Gender mGender;
// Character guild information
std::map<int, Guild*> mGuilds;
Party *mParty;
- bool mIsGM;
+ int mActionTime; /**< Time spent in current action */
+ int mEmotionTime; /**< Time until emotion disappears */
+
+ /** Time until the last speech sentence disappears */
+ int mSpeechTime;
+ int mAttackSpeed; /**< Attack speed */
+
+ int mLevel;
int mAttackRange;
+ Gender mGender;
+ Action mAction; /**< Action the being is performing */
+ uint16_t mSubType; /**< Subtype (graphical view, basically) */
+ uint8_t mDirection; /**< Facing direction */
+ uint8_t mDirectionDelayed; /**< Facing direction */
+ uint8_t mSpriteDirection; /**< Facing direction */
+ bool mShowName;
+ bool mIsGM;
private:
/**
@@ -1005,6 +1000,13 @@ class Being : public ActorSprite, public ConfigListener
* @see MILLISECONDS_IN_A_TICK
*/
Vector mWalkSpeed;
+ std::string mIp;
+ int *mSpriteRemap;
+ int *mSpriteHide;
+ std::string mComment;
+ Being *mPet;
+ Being *mOwner;
+ Particle *mSpecialParticle;
int mX, mY; /**< Position in tile */
@@ -1038,29 +1040,22 @@ class Being : public ActorSprite, public ConfigListener
unsigned int mTalkTime;
unsigned int mOtherTime;
unsigned int mTestTime;
- bool mErased;
- bool mEnemy;
- std::string mIp;
int mAttackDelay;
int mMinHit;
int mMaxHit;
int mCriticalHit;
unsigned int mPvpRank;
- int *mSpriteRemap;
- int *mSpriteHide;
- std::string mComment;
+ unsigned int mNumber;
+ int mPetId;
+ int mLook;
+ unsigned char mHairColor;
+ bool mErased;
+ bool mEnemy;
bool mGotComment;
bool mAdvanced;
bool mShop;
bool mAway;
bool mInactive;
- unsigned mNumber;
- unsigned char mHairColor;
- Being *mPet;
- int mPetId;
- int mLook;
- Being *mOwner;
- Particle *mSpecialParticle;
};
extern std::list<BeingCacheEntry*> beingInfoCache;