Implement RestoreHealth/Magicka/Fatigue

actorid
scrawl 11 years ago
parent bb43ec9b35
commit 7474e87edc

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

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

Loading…
Cancel
Save