mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +00:00
Merge branch 'tasty_sujamma' into 'master'
Uncap attribute and skill damage for drain and absorb effects See merge request OpenMW/openmw!1592
This commit is contained in:
commit
43f64e9f75
@ -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…
x
Reference in New Issue
Block a user