mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 13:23:52 +00:00
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
|
||||
{
|
||||
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…
Reference in a new issue