keep track of death events

actorid
Marc Zinnschlag 12 years ago
parent 08f6d04960
commit 61cb0f98a6

@ -10,7 +10,8 @@
namespace MWMechanics
{
CreatureStats::CreatureStats()
: mLevel (0), mLevelHealthBonus(0.f), mDead (false), mFriendlyHits (0), mTalkedTo (false), mAlarmed (false),
: mLevel (0), mLevelHealthBonus(0.f), mDead (false), mDied (false), mFriendlyHits (0),
mTalkedTo (false), mAlarmed (false),
mAttacked (false), mHostile (false)
{
for (int i=0; i<4; ++i)
@ -167,7 +168,12 @@ namespace MWMechanics
mDynamic[index] = value;
if (index==0 && mDynamic[index].getCurrent()<1)
{
if (!mDead)
mDied = true;
mDead = true;
}
}
void CreatureStats::setLevel(int level)
@ -196,6 +202,16 @@ namespace MWMechanics
return mDead;
}
bool CreatureStats::hasDied() const
{
return mDied;
}
void CreatureStats::clearHasDied()
{
mDied = false;
}
void CreatureStats::resurrect()
{
if (mDead)

@ -28,6 +28,7 @@ namespace MWMechanics
AiSequence mAiSequence;
float mLevelHealthBonus;
bool mDead;
bool mDied;
int mFriendlyHits;
bool mTalkedTo;
bool mAlarmed;
@ -100,6 +101,10 @@ namespace MWMechanics
bool isDead() const;
bool hasDied() const;
void clearHasDied();
void resurrect();
bool hasCommonDisease() const;

Loading…
Cancel
Save