Uncap attribute and skill damage for drain and absorb effects

C++20
Evil Eye 3 years ago
parent f6ea27281a
commit 79dc600dae

@ -74,6 +74,8 @@ namespace
{
auto& creatureStats = target.getClass().getCreatureStats(target);
auto attr = creatureStats.getAttribute(effect.mArg);
if(effect.mEffectId == ESM::MagicEffect::DamageAttribute)
magnitude = std::min(attr.getModified(), magnitude);
attr.damage(magnitude);
creatureStats.setAttribute(effect.mArg, attr);
}
@ -98,6 +100,8 @@ namespace
{
auto& npcStats = target.getClass().getNpcStats(target);
auto& skill = npcStats.getSkill(effect.mArg);
if(effect.mEffectId == ESM::MagicEffect::DamageSkill)
magnitude = std::min(skill.getModified(), magnitude);
skill.damage(magnitude);
}

@ -269,12 +269,7 @@ namespace MWMechanics
void AttributeValue::damage(float damage)
{
float threshold = mBase + mModifier;
if (mDamage + damage > threshold)
mDamage = threshold;
else
mDamage += damage;
mDamage += damage;
}
void AttributeValue::restore(float amount)
{

Loading…
Cancel
Save