|
|
|
@ -39,30 +39,30 @@ namespace MWMechanics
|
|
|
|
|
class CreatureStats
|
|
|
|
|
{
|
|
|
|
|
static int sActorId;
|
|
|
|
|
DrawState mDrawState;
|
|
|
|
|
std::map<ESM::RefId, AttributeValue> mAttributes;
|
|
|
|
|
DynamicStat<float> mDynamic[3]; // health, magicka, fatigue
|
|
|
|
|
DrawState mDrawState = DrawState::Nothing;
|
|
|
|
|
Spells mSpells;
|
|
|
|
|
ActiveSpells mActiveSpells;
|
|
|
|
|
MagicEffects mMagicEffects;
|
|
|
|
|
Stat<int> mAiSettings[4];
|
|
|
|
|
AiSequence mAiSequence;
|
|
|
|
|
bool mDead;
|
|
|
|
|
bool mDeathAnimationFinished;
|
|
|
|
|
bool mDied; // flag for OnDeath script function
|
|
|
|
|
bool mMurdered;
|
|
|
|
|
int mFriendlyHits;
|
|
|
|
|
bool mTalkedTo;
|
|
|
|
|
bool mAlarmed;
|
|
|
|
|
bool mAttacked;
|
|
|
|
|
bool mKnockdown;
|
|
|
|
|
bool mKnockdownOneFrame;
|
|
|
|
|
bool mKnockdownOverOneFrame;
|
|
|
|
|
bool mHitRecovery;
|
|
|
|
|
bool mBlock;
|
|
|
|
|
unsigned int mMovementFlags;
|
|
|
|
|
|
|
|
|
|
float mFallHeight;
|
|
|
|
|
bool mDead = false;
|
|
|
|
|
bool mDeathAnimationFinished = false;
|
|
|
|
|
bool mDied = false; // flag for OnDeath script function
|
|
|
|
|
bool mMurdered = false;
|
|
|
|
|
int mFriendlyHits = 0;
|
|
|
|
|
bool mTalkedTo = false;
|
|
|
|
|
bool mAlarmed = false;
|
|
|
|
|
bool mAttacked = false;
|
|
|
|
|
bool mKnockdown = false;
|
|
|
|
|
bool mKnockdownOneFrame = false;
|
|
|
|
|
bool mKnockdownOverOneFrame = false;
|
|
|
|
|
bool mHitRecovery = false;
|
|
|
|
|
bool mBlock = false;
|
|
|
|
|
unsigned int mMovementFlags = 0;
|
|
|
|
|
|
|
|
|
|
float mFallHeight = 0.f;
|
|
|
|
|
|
|
|
|
|
ESM::RefId mLastHitObject; // The last object to hit this actor
|
|
|
|
|
ESM::RefId mLastHitAttemptObject; // The last object to attempt to hit this actor
|
|
|
|
@ -71,21 +71,17 @@ namespace MWMechanics
|
|
|
|
|
MWWorld::TimeStamp mLastRestock;
|
|
|
|
|
|
|
|
|
|
// The pool of merchant gold (not in inventory)
|
|
|
|
|
int mGoldPool;
|
|
|
|
|
int mGoldPool = 0;
|
|
|
|
|
|
|
|
|
|
int mActorId;
|
|
|
|
|
int mHitAttemptActorId; // Stores an actor that attacked this actor. Only one is stored at a time,
|
|
|
|
|
// and it is not changed if a different actor attacks. It is cleared when combat ends.
|
|
|
|
|
|
|
|
|
|
// The index of the death animation that was played, or -1 if none played
|
|
|
|
|
signed char mDeathAnimation;
|
|
|
|
|
|
|
|
|
|
MWWorld::TimeStamp mTimeOfDeath;
|
|
|
|
|
int mActorId = -1;
|
|
|
|
|
// Stores an actor that attacked this actor. Only one is stored at a time, and it is not changed if a different
|
|
|
|
|
// actor attacks. It is cleared when combat ends.
|
|
|
|
|
int mHitAttemptActorId = -1;
|
|
|
|
|
|
|
|
|
|
// The difference between view direction and lower body direction.
|
|
|
|
|
float mSideMovementAngle;
|
|
|
|
|
float mSideMovementAngle = 0;
|
|
|
|
|
|
|
|
|
|
bool mTeleported = false;
|
|
|
|
|
MWWorld::TimeStamp mTimeOfDeath;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::multimap<int, int> mSummonedCreatures; // <Effect, ActorId>
|
|
|
|
@ -95,9 +91,15 @@ namespace MWMechanics
|
|
|
|
|
std::vector<int> mSummonGraveyard;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int mLevel;
|
|
|
|
|
bool mAttackingOrSpell;
|
|
|
|
|
std::string mAttackType;
|
|
|
|
|
int mLevel = 0;
|
|
|
|
|
bool mAttackingOrSpell = false;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// The index of the death animation that was played, or -1 if none played
|
|
|
|
|
signed char mDeathAnimation = -1;
|
|
|
|
|
|
|
|
|
|
bool mTeleported = false;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CreatureStats();
|
|
|
|
|