1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-04-01 00:36:46 +00:00

Implement RestoreHealth/Magicka/Fatigue

This commit is contained in:
scrawl 2013-11-16 05:06:54 +01:00
parent bb43ec9b35
commit 7474e87edc
2 changed files with 4 additions and 3 deletions

View file

@ -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;

View file

@ -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);
} }