mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Disease check: Reuse corprus check from spells.hpp.
This commit is contained in:
parent
da9d858201
commit
a9a0930b85
1 changed files with 1 additions and 11 deletions
|
@ -33,18 +33,8 @@ namespace MWMechanics
|
||||||
if (actor.getClass().getCreatureStats(actor).getSpells().hasSpell(spell->mId))
|
if (actor.getClass().getCreatureStats(actor).getSpells().hasSpell(spell->mId))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool hasCorprusEffect = false;
|
|
||||||
for (std::vector<ESM::ENAMstruct>::const_iterator effectIt = spell->mEffects.mList.begin(); effectIt != spell->mEffects.mList.end(); ++effectIt)
|
|
||||||
{
|
|
||||||
if (effectIt->mEffectID == ESM::MagicEffect::Corprus)
|
|
||||||
{
|
|
||||||
hasCorprusEffect = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float resist = 0.f;
|
float resist = 0.f;
|
||||||
if (hasCorprusEffect)
|
if (spells.hasCorprusEffect(spell))
|
||||||
resist = 1.f - 0.01 * (actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::ResistCorprusDisease).getMagnitude()
|
resist = 1.f - 0.01 * (actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::ResistCorprusDisease).getMagnitude()
|
||||||
- actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::WeaknessToCorprusDisease).getMagnitude());
|
- actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::WeaknessToCorprusDisease).getMagnitude());
|
||||||
else if (spell->mData.mType == ESM::Spell::ST_Disease)
|
else if (spell->mData.mType == ESM::Spell::ST_Disease)
|
||||||
|
|
Loading…
Reference in a new issue