mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Merge pull request #1439 from akortunov/resistfix
Take in account elemental shields for GetResist and SetResist script commands
This commit is contained in:
commit
407640322d
@ -1189,6 +1189,14 @@ namespace MWScript
|
|||||||
if (mNegativeEffect != -1)
|
if (mNegativeEffect != -1)
|
||||||
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
||||||
|
|
||||||
|
// GetResist* should take in account elemental shields
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFire)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistShock)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFrost)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude();
|
||||||
|
|
||||||
int ret = static_cast<int>(currentValue);
|
int ret = static_cast<int>(currentValue);
|
||||||
runtime.push(ret);
|
runtime.push(ret);
|
||||||
}
|
}
|
||||||
@ -1215,6 +1223,14 @@ namespace MWScript
|
|||||||
if (mNegativeEffect != -1)
|
if (mNegativeEffect != -1)
|
||||||
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
||||||
|
|
||||||
|
// SetResist* should take in account elemental shields
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFire)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistShock)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFrost)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude();
|
||||||
|
|
||||||
int arg = runtime[0].mInteger;
|
int arg = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
effects.modifyBase(mPositiveEffect, (arg - static_cast<int>(currentValue)));
|
effects.modifyBase(mPositiveEffect, (arg - static_cast<int>(currentValue)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user