diff --git a/spec/System/TestOverwhelmingHate_spec.lua b/spec/System/TestOverwhelmingHate_spec.lua new file mode 100644 index 00000000000..ef930c1b185 --- /dev/null +++ b/spec/System/TestOverwhelmingHate_spec.lua @@ -0,0 +1,31 @@ +describe("TestOverwhelmingHate", function() + before_each(function() + newBuild() + end) + + local function maximumRage(customMods) + build.configTab.input.customMods = customMods + build.configTab:BuildModList() + runCallback("OnFrame") + return build.calcsTab.mainOutput.MaximumRage + end + + it("applies increases and reductions to maximum Life to maximum Rage at 20% of their value", function() + local rage = "Gain 1 Rage on Attack Hit" + local base = maximumRage(rage) + assert.are.equal(30, base) + + -- Without the keystone line increased Life doesn't change maximum Rage + assert.are.equal(base, maximumRage(rage .. "\n200% increased maximum Life")) + + local keystone = rage .. "\nIncreases and reductions to Maximum Life also apply to Maximum Rage at 20% Value" + assert.are.equal(base, maximumRage(keystone)) + -- 200% increased Life gives 40% increased maximum Rage + assert.are.equal(42, maximumRage(keystone .. "\n200% increased maximum Life")) + -- Reductions apply too, and more/less Life doesn't + assert.are.equal(27, maximumRage(keystone .. "\n50% reduced maximum Life")) + assert.are.equal(base, maximumRage(keystone .. "\n20% less maximum Life")) + -- The converted value is rounded down: 279% increased Life gives 55%, and 129 * 1.55 = 199.95 rounds to 199 + assert.are.equal(199, maximumRage(keystone .. "\n+99 to Maximum Rage\n279% increased maximum Life")) + end) +end) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 94ce6007e71..2a072dac1c2 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -17567,7 +17567,7 @@ c["Increases and Reductions to Physical Damage also apply to Effect of Auras fro c["Increases and Reductions to Projectile Speed also apply to Damage with Bows"]={{[1]={flags=0,keywordFlags=0,name="ProjectileSpeedAppliesToBowDamage",type="FLAG",value=true}},nil} c["Increases and Reductions to your Evasion Rating also apply to your Spell Damage"]={{[1]={flags=0,keywordFlags=0,name="EvasionAppliesToSpellDamage",type="FLAG",value=true}},nil} c["Increases and Reductions to your Evasion Rating also apply to your Spell Damage at 50% of their value"]={nil,"Increases and Reductions to your Evasion Rating also apply to your Spell Damage at 50% of their value "} -c["Increases and reductions to Maximum Life also apply to Maximum Rage at 20% Value"]={nil,"Increases and reductions to Maximum Life also apply to Maximum Rage at 20% Value "} +c["Increases and reductions to Maximum Life also apply to Maximum Rage at 20% Value"]={{[1]={flags=0,keywordFlags=0,name="LifeAppliesToMaximumRage",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ImprovedLifeAppliesToMaximumRage",type="MAX",value=20}},nil} c["Increases and reductions to Maximum Mana also apply to Shock Effect at 30% of their value"]={{[1]={flags=0,keywordFlags=0,name="ManaAppliesToShockEffect",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ImprovedManaAppliesToShockEffect",type="MAX",value=30}},nil} c["Increases to Cast Speed from Arcane Surge also applies to Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="ArcaneSurgeCastSpeedToMovementSpeed",type="FLAG",value=true}},nil} c["Infernal Cry has 16% increased Area of Effect"]={{[1]={[1]={includeTransfigured=true,skillName="Infernal Cry",type="SkillName"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=16}},nil} diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 2aaa8459a81..5e53f8dba26 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -928,7 +928,13 @@ local function doActorMisc(env, actor) condList["LeechingEnergyShield"] = true end if modDB:Flag(nil, "Condition:CanGainRage") or modDB:Sum("BASE", nil, "RageRegen") > 0 then - local maxStacks = m_floor(modDB:Sum("BASE", skillCfg, "MaximumRage") * modDB:More(skillCfg, "MaximumRage")) + local incMaxRage = modDB:Sum("INC", skillCfg, "MaximumRage") + if modDB:Flag(nil, "LifeAppliesToMaximumRage") then + -- Overwhelming Hate: increases and reductions to maximum Life also apply to maximum Rage at a percentage of their value + -- The game rounds the converted value down, e.g. 279% increased Life at 20% gives 55%, not 55.8% + incMaxRage = incMaxRage + m_floor(modDB:Sum("INC", nil, "Life") * (modDB:Max(nil, "ImprovedLifeAppliesToMaximumRage") or 100) / 100) + end + local maxStacks = m_floor(modDB:Sum("BASE", skillCfg, "MaximumRage") * m_max(1 + incMaxRage / 100, 0) * modDB:More(skillCfg, "MaximumRage")) local minStacks = m_min(modDB:Sum("BASE", nil, "MinimumRage"), maxStacks) local rageConfig = modDB:Sum("BASE", nil, "Multiplier:RageStack") local stacks = m_max(m_min(rageConfig, maxStacks), (minStacks > 0 and minStacks) or 0) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index a7f29d28835..ffe467cda5f 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2603,6 +2603,7 @@ local specialModList = { flag("Condition:CanGainRage", { type = "ActorCondition", actor = "enemy", var = "PinnacleBoss" }), }, ["maximum rage is halved"] = { mod("MaximumRage", "MORE", -50) }, + ["increases and reductions to maximum life also apply to maximum rage at (%d+)%% value"] = function(num) return { flag("LifeAppliesToMaximumRage"), mod("ImprovedLifeAppliesToMaximumRage", "MAX", num) } end, ["inherent effects from having rage are tripled"] = { mod("RageEffect", "MORE", 200) }, ["inherent effects from having rage are doubled"] = { mod("RageEffect", "MORE", 100) }, ["cannot be stunned while you have at least (%d+) rage"] = function(num) return { flag("StunImmune", { type = "MultiplierThreshold", var = "Rage", threshold = num }) } end,