Implement RestoreHealth/Magicka/Fatigue

actorid
scrawl 11 years ago
parent bb43ec9b35
commit 7474e87edc

@ -57,7 +57,7 @@ namespace MWMechanics
private:
mutable TContainer mSpells; // spellId, (time of casting, relative magnitude)
mutable TContainer mSpells;
mutable MagicEffects mEffects;
mutable bool mSpellsChanged;
mutable MWWorld::TimeStamp mLastUpdate;

@ -167,8 +167,9 @@ namespace MWMechanics
stat.setModifier(effects.get(EffectKey(ESM::MagicEffect::FortifyHealth+i)).mMagnitude -
effects.get(EffectKey(ESM::MagicEffect::DrainHealth+i)).mMagnitude);
float damage = creatureStats.getMagicEffects().get(EffectKey(ESM::MagicEffect::DamageHealth)).mMagnitude;
stat.setCurrent(stat.getCurrent() - damage * duration);
float currentDiff = creatureStats.getMagicEffects().get(EffectKey(ESM::MagicEffect::RestoreHealth+i)).mMagnitude
- creatureStats.getMagicEffects().get(EffectKey(ESM::MagicEffect::DamageHealth+i)).mMagnitude;
stat.setCurrent(stat.getCurrent() + currentDiff * duration);
creatureStats.setDynamic(i, stat);
}

Loading…
Cancel
Save