forked from mirror/openmw-tes3mp
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;
|
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;
|
bool isDead() const;
|
||||||
|
|
||||||
void resurrect();
|
void resurrect();
|
||||||
|
|
||||||
|
bool hasCommonDisease() const;
|
||||||
|
|
||||||
|
bool hasBlightDisease() const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,4 +75,32 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
return mSelectedSpell;
|
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;
|
const std::string getSelectedSpell() const;
|
||||||
///< May return an empty string.
|
///< May return an empty string.
|
||||||
|
|
||||||
|
bool hasCommonDisease() const;
|
||||||
|
|
||||||
|
bool hasBlightDisease() const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue