forked from teamnwah/openmw-tes3coop
keep track of death events
This commit is contained in:
parent
08f6d04960
commit
61cb0f98a6
2 changed files with 22 additions and 1 deletions
|
@ -10,7 +10,8 @@
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
CreatureStats::CreatureStats()
|
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)
|
mAttacked (false), mHostile (false)
|
||||||
{
|
{
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
|
@ -167,7 +168,12 @@ namespace MWMechanics
|
||||||
mDynamic[index] = value;
|
mDynamic[index] = value;
|
||||||
|
|
||||||
if (index==0 && mDynamic[index].getCurrent()<1)
|
if (index==0 && mDynamic[index].getCurrent()<1)
|
||||||
|
{
|
||||||
|
if (!mDead)
|
||||||
|
mDied = true;
|
||||||
|
|
||||||
mDead = true;
|
mDead = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureStats::setLevel(int level)
|
void CreatureStats::setLevel(int level)
|
||||||
|
@ -196,6 +202,16 @@ namespace MWMechanics
|
||||||
return mDead;
|
return mDead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CreatureStats::hasDied() const
|
||||||
|
{
|
||||||
|
return mDied;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreatureStats::clearHasDied()
|
||||||
|
{
|
||||||
|
mDied = false;
|
||||||
|
}
|
||||||
|
|
||||||
void CreatureStats::resurrect()
|
void CreatureStats::resurrect()
|
||||||
{
|
{
|
||||||
if (mDead)
|
if (mDead)
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace MWMechanics
|
||||||
AiSequence mAiSequence;
|
AiSequence mAiSequence;
|
||||||
float mLevelHealthBonus;
|
float mLevelHealthBonus;
|
||||||
bool mDead;
|
bool mDead;
|
||||||
|
bool mDied;
|
||||||
int mFriendlyHits;
|
int mFriendlyHits;
|
||||||
bool mTalkedTo;
|
bool mTalkedTo;
|
||||||
bool mAlarmed;
|
bool mAlarmed;
|
||||||
|
@ -100,6 +101,10 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool isDead() const;
|
bool isDead() const;
|
||||||
|
|
||||||
|
bool hasDied() const;
|
||||||
|
|
||||||
|
void clearHasDied();
|
||||||
|
|
||||||
void resurrect();
|
void resurrect();
|
||||||
|
|
||||||
bool hasCommonDisease() const;
|
bool hasCommonDisease() const;
|
||||||
|
|
Loading…
Reference in a new issue