mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
disease tests
This commit is contained in:
parent
0727d943b1
commit
be1334b202
4 changed files with 46 additions and 0 deletions
|
@ -232,4 +232,14 @@ namespace MWMechanics
|
|||
mDead = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CreatureStats::hasCommonDisease() const
|
||||
{
|
||||
return mSpells.hasCommonDisease();
|
||||
}
|
||||
|
||||
bool CreatureStats::hasBlightDisease() const
|
||||
{
|
||||
return mSpells.hasBlightDisease();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,6 +109,10 @@ namespace MWMechanics
|
|||
bool isDead() const;
|
||||
|
||||
void resurrect();
|
||||
|
||||
bool hasCommonDisease() const;
|
||||
|
||||
bool hasBlightDisease() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -75,4 +75,32 @@ namespace MWMechanics
|
|||
{
|
||||
return mSelectedSpell;
|
||||
}
|
||||
|
||||
bool Spells::hasCommonDisease() const
|
||||
{
|
||||
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
|
||||
{
|
||||
const ESM::Spell *spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
|
||||
|
||||
if (spell->mData.mFlags & ESM::Spell::ST_Disease)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Spells::hasBlightDisease() const
|
||||
{
|
||||
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
|
||||
{
|
||||
const ESM::Spell *spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
|
||||
|
||||
if (spell->mData.mFlags & ESM::Spell::ST_Blight)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,6 +55,10 @@ namespace MWMechanics
|
|||
|
||||
const std::string getSelectedSpell() const;
|
||||
///< May return an empty string.
|
||||
|
||||
bool hasCommonDisease() const;
|
||||
|
||||
bool hasBlightDisease() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue