mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 13:06:40 +00:00
Implement RestoreHealth/Magicka/Fatigue
This commit is contained in:
parent
bb43ec9b35
commit
7474e87edc
2 changed files with 4 additions and 3 deletions
|
@ -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…
Reference in a new issue