mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-23 12:11:36 +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
2 changed files with 5 additions and 6 deletions
|
@ -74,6 +74,8 @@ namespace
|
||||||
{
|
{
|
||||||
auto& creatureStats = target.getClass().getCreatureStats(target);
|
auto& creatureStats = target.getClass().getCreatureStats(target);
|
||||||
auto attr = creatureStats.getAttribute(effect.mArg);
|
auto attr = creatureStats.getAttribute(effect.mArg);
|
||||||
|
if(effect.mEffectId == ESM::MagicEffect::DamageAttribute)
|
||||||
|
magnitude = std::min(attr.getModified(), magnitude);
|
||||||
attr.damage(magnitude);
|
attr.damage(magnitude);
|
||||||
creatureStats.setAttribute(effect.mArg, attr);
|
creatureStats.setAttribute(effect.mArg, attr);
|
||||||
}
|
}
|
||||||
|
@ -98,6 +100,8 @@ namespace
|
||||||
{
|
{
|
||||||
auto& npcStats = target.getClass().getNpcStats(target);
|
auto& npcStats = target.getClass().getNpcStats(target);
|
||||||
auto& skill = npcStats.getSkill(effect.mArg);
|
auto& skill = npcStats.getSkill(effect.mArg);
|
||||||
|
if(effect.mEffectId == ESM::MagicEffect::DamageSkill)
|
||||||
|
magnitude = std::min(skill.getModified(), magnitude);
|
||||||
skill.damage(magnitude);
|
skill.damage(magnitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,12 +269,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void AttributeValue::damage(float damage)
|
void AttributeValue::damage(float damage)
|
||||||
{
|
{
|
||||||
float threshold = mBase + mModifier;
|
mDamage += damage;
|
||||||
|
|
||||||
if (mDamage + damage > threshold)
|
|
||||||
mDamage = threshold;
|
|
||||||
else
|
|
||||||
mDamage += damage;
|
|
||||||
}
|
}
|
||||||
void AttributeValue::restore(float amount)
|
void AttributeValue::restore(float amount)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue