From bcfac7140cf1a3ca8a5db7e6a6bd2cfcc6347569 Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Sun, 8 Nov 2026 16:07:39 +0100 Subject: [PATCH 1/3] Support reduced Vestigial implicit effects Preserve partial magnitudes through the existing conversion, defence and trigger calculations. Keep normal effects and saved Gamblesprint rolls, and choose the strongest conversion or equal-level trigger source once. Cover nine implicit families through item ingestion and final calculations. --- .../TestVestigialReducedImplicits_spec.lua | 255 ++++++++++++++++++ src/Data/ModCache.lua | 37 ++- src/Modules/CalcDefence.lua | 13 +- src/Modules/CalcOffence.lua | 7 +- src/Modules/CalcPerform.lua | 15 +- src/Modules/CalcSetup.lua | 4 +- src/Modules/CalcTriggers.lua | 3 +- src/Modules/ConfigOptions.lua | 4 +- src/Modules/ModParser.lua | 23 +- 9 files changed, 323 insertions(+), 38 deletions(-) create mode 100644 spec/System/TestVestigialReducedImplicits_spec.lua diff --git a/spec/System/TestVestigialReducedImplicits_spec.lua b/spec/System/TestVestigialReducedImplicits_spec.lua new file mode 100644 index 00000000000..1f04157126a --- /dev/null +++ b/spec/System/TestVestigialReducedImplicits_spec.lua @@ -0,0 +1,255 @@ +describe("TestVestigialReducedImplicits", function() + local function equip(base, lines, explicit) + local raw = "Rarity: RARE\nVestigial Test\n" .. base .. "\nImplicits: " .. #lines .. "\n" + for _, line in ipairs(lines) do + raw = raw .. "{vestigial}" .. line .. "\n" + end + build.itemsTab:CreateDisplayItemFromRaw(raw .. (explicit or "")) + local item = build.itemsTab.displayItem + build.itemsTab:AddDisplayItem() + return item + end + + local function calculate(lines, options) + options = options or { } + newBuild() + build.skillsTab:PasteSocketGroup((options.skill or "Arc") .. " 20/0 1\n") + build.mainSocketGroup = 1 + build.configTab.input.customMods = options.custom or "" + build.configTab.input.multiplierRage = options.rage or 0 + build.configTab:BuildModList() + local item = equip(options.base or "Iron Hat", lines, options.explicit) + if options.configure then + options.configure() + end + for _ = 1, 5 do + runCallback("OnFrame") + end + local env = build.calcsTab.mainEnv + local skill = env.player.mainSkill + assert.are.equal(options.skill or "Arc", skill.activeEffect.grantedEffect.name) + local result = copyTable(build.calcsTab.mainOutput, true) + result.item = item + result.spellIncrease = skill.skillModList:Sum("INC", { flags = ModFlag.Spell }, "Damage") + result.evasionIncrease = skill.skillModList:Sum("INC", { }, "Evasion") + result.damageMore = env.player.modDB:More(skill.skillCfg, "Damage") + result.attackDamageMore = env.player.modDB:More({ flags = ModFlag.Attack }, "Damage") + local armourIncreases = env.player.modDB:Tabulate("INC", nil, "Armour") + result.armourIncreaseSource = armourIncreases[1] and armourIncreases[1].mod.source + for _, value in ipairs(env.player.modDB:Tabulate("MAX", nil, "ArmourIncreasedByOvercappedFireRes")) do + if value.value == 100 then + result.fullArmourSource = value.mod.source + end + end + result.hitTaken = build.calcsTab.calcs.takenHitFromDamage(1000, "Lightning", env.player) + result.pools = build.calcsTab.calcs.reducePoolsByDamage({ Life = 1000, Mana = 1000, EnergyShield = options.poolEnergyShield or 0, Ward = 0 }, { Chaos = 200 }, env.player) + return result + end + + local form = "Armour is increased by Overcapped Fire Resistance" + local formHalf = "Armour is increased by 50% of Overcapped Fire Resistance" + local eye = "Increases and Reductions to your Evasion Rating also apply to your Spell Damage" + local eyeHalf = eye .. " at 50% of their value" + local rage = "Rage grants Spell Damage instead of Attack Damage" + local rageHalf = rage .. " at 50% of the value" + local apostate = "Gain Maximum Life instead of Maximum Energy Shield from Equipped Armour Items" + local apostateHalf = apostate .. " at 50% of the value" + local doryani = "Armour also applies to Lightning Damage taken from Hits" + local doryaniTenth = "10% of " .. doryani + local ivory = "Chaos Damage is taken from Mana before Life" + local ivoryHalf = "50% of " .. ivory + local entropic = "Critical Strikes with Spells inflict Impale" + local entropicHalf = "Critical Strikes with Spells have 50% chance to inflict Impale" + local gamble = "When Hit, gain a random Movement Speed modifier from 40% reduced to 100% increased, until Hit again" + local gambleHalf = "When Hit, gain a random Movement Speed modifier from 20% reduced to 50% increased, until Hit again" + local asenath = "Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown" + local asenathTenth = "10% chance to " .. asenath + + it("ingests reduced Vestigial implicit text as complete item modifiers", function() + for _, line in ipairs({ formHalf, eyeHalf, rageHalf, apostateHalf, doryaniTenth, ivoryHalf, entropicHalf, gambleHalf, asenathTenth }) do + local item = new("Item"):Item("Rarity: UNIQUE\nVestigial Test\nIron Hat\nImplicits: 1\n{vestigial}" .. line .. "\n") + assert.is_true(item.vestigial) + assert.is_nil(item.implicitModLines[1].extra, line) + assert.is_true(#item.implicitModLines[1].modList > 0) + end + end) + + it("scales overcapped fire resistance into armour once using the strongest source", function() + local options = { custom = "+1000 to Armour\n+200% to Fire Resistance" } + local control = calculate({ }, options) + local half = calculate({ formHalf }, options) + local full = calculate({ form }, options) + assert.are.equal(math.floor(control.Armour * (1 + control.FireResistOverCap / 200) + 0.5), half.Armour) + assert.are.equal(math.floor(control.Armour * (1 + control.FireResistOverCap / 100) + 0.5), full.Armour) + assert.are.equal(full.Armour, calculate({ formHalf, form }, options).Armour) + assert.are.equal(half.Armour, calculate({ formHalf, formHalf }, options).Armour) + options.custom = options.custom .. "\n" .. form + local mixedSources = calculate({ formHalf }, options) + assert.are.equal(mixedSources.fullArmourSource, mixedSources.armourIncreaseSource) + options.custom = "+1000 to Armour" + assert.are.equal(calculate({ }, options).Armour, calculate({ formHalf }, options).Armour) + end) + + it("converts evasion increases and reductions into spell damage at the stated value", function() + for _, increase in ipairs({ "100% increased Evasion Rating", "100% reduced Evasion Rating" }) do + local options = { custom = increase .. "\n100% more Evasion Rating" } + local control = calculate({ }, options) + local half = calculate({ eyeHalf }, options) + local full = calculate({ eye }, options) + assert.are.equal(control.spellIncrease + control.evasionIncrease / 2, half.spellIncrease) + assert.are.equal(control.spellIncrease + control.evasionIncrease, full.spellIncrease) + assert.is_true(half.AverageDamage > math.min(control.AverageDamage, full.AverageDamage)) + assert.is_true(half.AverageDamage < math.max(control.AverageDamage, full.AverageDamage)) + assert.are.equal(full.spellIncrease, calculate({ eyeHalf, eye }, options).spellIncrease) + end + end) + + it("scales bounded evasion tags and keeps conversion out of attack damage", function() + local options = { configure = function() + build.configTab.modList:NewMod("Multiplier:TestEvasion", "BASE", 3, "Test") + build.configTab.modList:NewMod("Evasion", "INC", 10, "Test", { type = "Multiplier", var = "TestEvasion", limit = 20, limitTotal = true }) + end } + local control = calculate({ }, options) + local half = calculate({ eyeHalf }, options) + assert.are.equal(control.spellIncrease + control.evasionIncrease / 2, half.spellIncrease) + assert.is_true(half.AverageDamage > control.AverageDamage) + options = { skill = "Split Arrow", custom = "100% increased Evasion Rating", configure = function() + equip("Short Bow", { }) + end } + assert.are.equal(calculate({ }, options).AverageDamage, calculate({ eyeHalf }, options).AverageDamage) + end) + + it("scales post-effect rage spell damage while replacing attack damage", function() + local options = { custom = "Gain 1 Rage on Attack Hit\n50% increased Rage Effect", rage = 20 } + local control = calculate({ }, options) + local half = calculate({ rageHalf }, options) + local full = calculate({ rage }, options) + assert.are.equal(30, half.RageEffect) + assert.are.equal(1.15, half.damageMore) + assert.are.equal(1.3, full.damageMore) + assert.are.equal(1.3, control.attackDamageMore) + assert.are.equal(1, half.attackDamageMore) + assert.are.equal(1, full.attackDamageMore) + assert.is_true(control.AverageDamage < half.AverageDamage and half.AverageDamage < full.AverageDamage) + assert.are.equal(full.damageMore, calculate({ rageHalf, rage }, options).damageMore) + options.rage = 0 + assert.are.equal(1, calculate({ rageHalf }, options).damageMore) + end) + + it("gains half the armour-item energy shield as life without retaining the replaced energy shield", function() + local options = { base = "Vaal Regalia", custom = "100% increased maximum Life\n100% increased maximum Energy Shield" } + local control = calculate({ }, options) + local half = calculate({ apostateHalf }, options) + local full = calculate({ apostate }, options) + assert.is_true(control.EnergyShield > 0) + assert.are.equal(0, full.EnergyShield) + assert.are.equal(0, half.EnergyShield) + assert.are.equal(control.Life + (full.Life - control.Life) / 2, half.Life) + assert.are.equal(full.Life, calculate({ apostateHalf, apostate }, options).Life) + options.configure = function() + equip("Hubris Circlet", { }) + equip("Twig Spirit Shield", { }) + end + control = calculate({ }, options) + half = calculate({ apostateHalf }, options) + full = calculate({ apostate }, options) + assert.are.equal(0, half.EnergyShield) + assert.are.equal(control.Life + (full.Life - control.Life) / 2, half.Life) + end) + + it("applies one tenth of armour to lightning hits through the final mitigation calculation", function() + local options = { base = "Simple Robe", custom = "+10000 to Armour" } + local control = calculate({ }, options) + local tenth = calculate({ doryaniTenth }, options) + local full = calculate({ doryani }, options) + assert.are.equal(1000, tenth.LightningEffectiveAppliedArmour) + assert.are.equal(0, tenth.FireEffectiveAppliedArmour) + assert.is_true(full.hitTaken < tenth.hitTaken and tenth.hitTaken < control.hitTaken) + assert.is_true(control.LightningMaximumHitTaken < tenth.LightningMaximumHitTaken and tenth.LightningMaximumHitTaken < full.LightningMaximumHitTaken) + end) + + it("redirects half of chaos damage to mana and retains the shared redirection cap", function() + local options = { base = "Simple Robe", custom = "+1000 to maximum Life\n+1000 to maximum Mana" } + local half = calculate({ ivoryHalf }, options) + assert.are.equal(50, half.ChaosMindOverMatter) + assert.are.equal(900, half.pools.Life) + assert.are.equal(900, half.pools.Mana) + local full = calculate({ ivory }, options) + assert.are.equal(1000, full.pools.Life) + assert.are.equal(800, full.pools.Mana) + options.custom = options.custom .. "\n60% of Damage is taken from Mana before Life" + assert.are.equal(40, calculate({ ivoryHalf }, options).ChaosMindOverMatter) + options.custom = "+1000 to maximum Life\n+1000 to maximum Mana\n+100 to maximum Energy Shield\nEldritch Battery" + options.poolEnergyShield = 100 + local battery = calculate({ ivoryHalf }, options) + assert.are.equal(900, battery.pools.Life) + assert.are.equal(900, battery.pools.Mana) + assert.are.equal(100, battery.pools.EnergyShield) + end) + + it("halves critical spell impale chance and actual impale damage without affecting non-critical hits", function() + local options = { base = "Wool Gloves", skill = "Blade Vortex" } + local half = calculate({ entropicHalf }, options) + local full = calculate({ entropic }, options) + assert.are.equal(50, half.ImpaleChanceOnCrit) + assert.are.equal(0, half.ImpaleChance) + assert.is_true(half.ImpaleDPS > 0) + -- ImpaleDPS subtracts one from a multiplier, then applies total DPS. + -- Bound binary64 round-off at the pre-subtraction DPS scale. + assert.is_true(math.abs(full.ImpaleDPS / 2 - half.ImpaleDPS) <= full.TotalDPS * 2^-48) + options.skill = "Split Arrow" + options.configure = function() equip("Short Bow", { }) end + local attack = calculate({ entropicHalf }, options) + assert.is_true(attack.TotalDPS > 0) + assert.is_nil(attack.ImpaleDPS) + end) + + it("preserves saved Gamblesprint rolls and applies the reduced range once", function() + for _, value in ipairs({ -40, 0, 30, 100 }) do + newBuild() + build.configTab.input.GamblesprintMovementSpeed = value + build.configTab:BuildModList() + equip("Wool Shoes", { gambleHalf, gambleHalf }) + for _ = 1, 5 do runCallback("OnFrame") end + assert.are.equal(value / 2, build.calcsTab.mainEnv.player.modDB:Sum("INC", nil, "MovementSpeed")) + assert.are.equal(1 + value / 200, build.calcsTab.mainOutput.MovementSpeedMod) + loadBuildFromXML(build:SaveDB("code")) + assert.are.equal(value, build.configTab.input.GamblesprintMovementSpeed) + assert.are.equal(1 + value / 200, build.calcsTab.mainOutput.MovementSpeedMod) + end + newBuild() + build.configTab.input.GamblesprintMovementSpeed = 100 + build.configTab:BuildModList() + local item = equip("Wool Shoes", { gambleHalf, gamble }) + for _ = 1, 5 do runCallback("OnFrame") end + assert.are.equal(2, build.calcsTab.mainOutput.MovementSpeedMod) + build.itemsTab:DeleteItem(item, true) + runCallback("OnFrame") + assert.are.equal(1, build.calcsTab.mainOutput.MovementSpeedMod) + end) + + local function triggerRate(lines, weapon, attack, spellSlot) + newBuild() + equip("Iron Hat", lines, "Sockets: B\n") + equip(weapon or "Short Bow", { }, "Sockets: G\n") + build.skillsTab:PasteSocketGroup("Slot: Weapon 1\n" .. (attack or "Split Arrow") .. " 20/0 1\n") + build.skillsTab:PasteSocketGroup("Slot: " .. (spellSlot or "Helmet") .. "\nArc 20/0 1\n") + build.mainSocketGroup = 2 + for _ = 1, 5 do runCallback("OnFrame") end + local env = build.calcsTab.mainEnv + assert.are.equal("Arc", env.player.mainSkill.activeEffect.grantedEffect.name) + return build.calcsTab.mainOutput.SkillTriggerRate or 0 + end + + it("applies the bow trigger probability at the final rate without leaking between slots", function() + local full = triggerRate({ asenath }) + local tenth = triggerRate({ asenathTenth }) + assert.is_true(full > 0 and full < 1 / 0.3) + assert.is_true(math.abs(full - tenth * 10) <= full * 2^-48) + assert.are.equal(full, triggerRate({ asenathTenth, asenath })) + assert.are.equal(full, triggerRate({ asenath, asenathTenth })) + assert.are.equal(tenth, triggerRate({ asenathTenth, asenathTenth })) + assert.are.equal(0, triggerRate({ asenathTenth }, "Rusted Sword", "Cleave")) + assert.are.equal(0, triggerRate({ asenathTenth }, nil, nil, "Body Armour")) + end) +end) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index e0ede6c2653..2b137bbd40b 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -3740,7 +3740,7 @@ c["10% chance to Trigger Summon Spirit of Maata on Kill"]={{}," to Trigger Summo c["10% chance to Trigger Summon Spirit of Rakiata on Kill"]={{}," to Trigger Summon Spirit of Rakiata "} c["10% chance to Trigger Summon Spirit of Tawhanuku on Kill"]={{}," to Trigger Summon Spirit of Tawhanuku "} c["10% chance to Trigger Summon Spirit of Utula on Kill"]={{}," to Trigger Summon Spirit of Utula "} -c["10% chance to Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown"]={{}," to Trigger a Socketed when you Attack with a Bow, with a 0.3 second Cooldown "} +c["10% chance to Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={level=1,skillId="SupportTriggerSpellOnBowAttack",triggerChance=10}}},nil} c["10% chance to Unnerve Enemies for 4 seconds on Hit"]={{}," to Unnerve Enemies "} c["10% chance to avoid Projectiles"]={{[1]={flags=0,keywordFlags=0,name="AvoidProjectilesChance",type="BASE",value=10}},nil} c["10% chance to cause Bleeding on Hit"]={{[1]={flags=0,keywordFlags=0,name="BleedChance",type="BASE",value=10}},nil} @@ -4100,7 +4100,7 @@ c["10% more Melee Physical Damage during effect"]={{[1]={[1]={type="Condition",v c["10% more Skill Effect Duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="MORE",value=10}},nil} c["10% more chance to Evade Attacks if you have been Hit by an Attack Recently"]={{[1]={[1]={type="Condition",var="BeenHitByAttackRecently"},flags=0,keywordFlags=0,name="EvadeChance",type="MORE",value=10}},nil} c["10% more maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="MORE",value=10}},nil} -c["10% of Armour also applies to Lightning Damage taken from Hits"]={{[1]={flags=0,keywordFlags=0,name="Armour",type="BASE",value=10}}," also applies to Lightning Damage taken from Hits "} +c["10% of Armour also applies to Lightning Damage taken from Hits"]={{[1]={flags=0,keywordFlags=0,name="ArmourAppliesToLightningDamageTaken",type="BASE",value=10}},nil} c["10% of Armour applies to Fire, Cold and Lightning Damage taken from Hits if you have Blocked Recently"]={{[1]={[1]={type="Condition",var="BlockedRecently"},flags=0,keywordFlags=0,name="ArmourAppliesToFireDamageTaken",type="BASE",value=10},[2]={[1]={type="Condition",var="BlockedRecently"},flags=0,keywordFlags=0,name="ArmourAppliesToColdDamageTaken",type="BASE",value=10},[3]={[1]={type="Condition",var="BlockedRecently"},flags=0,keywordFlags=0,name="ArmourAppliesToLightningDamageTaken",type="BASE",value=10}},nil} c["10% of Chaos Damage taken does not bypass Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ChaosEnergyShieldBypass",type="BASE",value=-10}},nil} c["10% of Cold Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="ColdLifeRecoup",type="BASE",value=10}},nil} @@ -7397,8 +7397,7 @@ c["25% chance to Trigger Level 10 Summon Raging Spirit on Kill"]={{[1]={flags=0, c["25% chance to Trigger Level 20 Animate Weapon on Kill"]={{[1]={flags=0,keywordFlags=0,name="ExtraSkill",type="LIST",value={level=20,skillId="AnimateWeapon",triggerChance=25,triggered=true}}},nil} c["25% chance to Trigger Level 20 Summon Elemental Relic when you or Allies within 6 metres Kill an Enemy, or Hit a Rare or Unique Enemy"]={{[1]={flags=0,keywordFlags=0,name="ExtraSkill",type="LIST",value={level=20,skillId="SummonElementalRelic",triggerChance=25,triggered=true}}},nil} c["25% chance to Trigger Socketed Spells when you Spend at least 0 Mana on an Upfront Cost to Use or Trigger a Skill, with a 0.1 second Cooldown"]={{[1]={flags=0,keywordFlags=0,name="KitavaTriggerChance",source="Kitava's Thirst",type="BASE",value=25},[2]={flags=0,keywordFlags=0,name="KitavaRequiredManaCost",source="Kitava's Thirst",type="BASE",value=0},[3]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={level=1,skillId="SupportCastOnManaSpent"}}},nil} -c["25% chance to Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown"]={{}," to Trigger a Socketed when you Attack with a Bow, with a 0.3 second Cooldown "} -c["25% chance to Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown"]={{}," to Trigger a Socketed when you Attack with a Bow, with a 0.3 second Cooldown Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown "} +c["25% chance to Trigger a Socketed Spell when you Attack with a Bow, with a 0.3 second Cooldown"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={level=1,skillId="SupportTriggerSpellOnBowAttack",triggerChance=25}}},nil} c["25% chance to Unnerve Enemies for 4 seconds on Hit"]={{}," to Unnerve Enemies "} c["25% chance to avoid Projectiles"]={{[1]={flags=0,keywordFlags=0,name="AvoidProjectilesChance",type="BASE",value=25}},nil} c["25% chance to cause Bleeding on Hit"]={{[1]={flags=0,keywordFlags=0,name="BleedChance",type="BASE",value=25}},nil} @@ -10003,8 +10002,8 @@ c["5% chance to Ignite"]={{[1]={flags=0,keywordFlags=0,name="EnemyIgniteChance", c["5% chance to Impale Enemies on Hit with Attacks"]={{[1]={flags=0,keywordFlags=65536,name="ImpaleChance",type="BASE",value=5}},nil} c["5% chance to Intimidate Enemies for 4 seconds on Hit"]={{}," to Intimidate Enemies "} c["5% chance to Knock Enemies Back on hit"]={{[1]={flags=0,keywordFlags=0,name="EnemyKnockbackChance",type="BASE",value=5}},nil} -end)();(function() c["5% chance to Poison on Hit"]={{[1]={flags=0,keywordFlags=0,name="PoisonChance",type="BASE",value=5}},nil} +end)();(function() c["5% chance to Recover 10% of Mana when you use a Skill"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="BASE",value=5}}," to Recover 10% of when you use a Skill "} c["5% chance to Restore your Ward on Hit"]={{[1]={flags=4,keywordFlags=0,name="Ward",type="BASE",value=5}}," to Restore your "} c["5% chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="BASE",value=5}},nil} @@ -10494,7 +10493,7 @@ c["50% more Damage with Arrow Hits not at Close Range"]={{[1]={[1]={neg=true,typ c["50% more Effect of Herald Buffs on you"]={{[1]={[1]={skillType=52,type="SkillType"},flags=0,keywordFlags=0,name="BuffEffect",type="MORE",value=50}},nil} c["50% more Global Accuracy Rating"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Accuracy",type="MORE",value=50}},nil} c["50% more Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="MORE",value=50}},nil} -c["50% of Chaos Damage is taken from Mana before Life"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamage",type="BASE",value=50}}," is taken from Mana before Life "} +c["50% of Chaos Damage is taken from Mana before Life"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamageTakenFromManaBeforeLife",type="BASE",value=50}},nil} c["50% of Chaos Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="ChaosLifeRecoup",type="BASE",value=50}},nil} c["50% of Chaos Damage taken as Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamageTakenAsLightning",type="BASE",value=50}},nil} c["50% of Chaos Damage taken does not bypass Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ChaosEnergyShieldBypass",type="BASE",value=-50}},nil} @@ -14268,8 +14267,8 @@ c["Armour also applies to Lightning Damage taken from Hits"]={{[1]={flags=0,keyw c["Armour applies to Fire, Cold and Lightning Damage taken from Hits instead of Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="ArmourAppliesToFireDamageTaken",type="BASE",value=100},[2]={flags=0,keywordFlags=0,name="ArmourAppliesToColdDamageTaken",type="BASE",value=100},[3]={flags=0,keywordFlags=0,name="ArmourAppliesToLightningDamageTaken",type="BASE",value=100},[4]={flags=0,keywordFlags=0,name="ArmourDoesNotApplyToPhysicalDamageTaken",type="FLAG",value=true}},nil} c["Armour from Equipped Body Armour is doubled"]={{[1]={[1]={slotName="Body Armour",type="SlotName"},[2]={globalLimit=100,globalLimitKey="ArmourDoubledLimit",type="Multiplier",var="ArmourDoubled"},flags=0,keywordFlags=0,name="Armour",type="MORE",value=100},[2]={[1]={slotName="Body Armour",type="SlotName"},flags=0,keywordFlags=0,name="Multiplier:ArmourDoubled",type="OVERRIDE",value=1}},nil} c["Armour from Equipped Shield is doubled"]={{[1]={[1]={slotName="Weapon 2",type="SlotName"},[2]={globalLimit=100,globalLimitKey="ArmourDoubledLimit",type="Multiplier",var="ArmourDoubled"},flags=0,keywordFlags=0,name="Armour",type="MORE",value=100},[2]={[1]={slotName="Weapon 2",type="SlotName"},flags=0,keywordFlags=0,name="Multiplier:ArmourDoubled",type="OVERRIDE",value=1}},nil} -c["Armour is increased by 50% of Overcapped Fire Resistance"]={nil,"Armour is increased by 50% of Overcapped Fire Resistance "} -c["Armour is increased by Overcapped Fire Resistance"]={{[1]={flags=0,keywordFlags=0,name="ArmourIncreasedByOvercappedFireRes",type="FLAG",value=true}},nil} +c["Armour is increased by 50% of Overcapped Fire Resistance"]={{[1]={flags=0,keywordFlags=0,name="ArmourIncreasedByOvercappedFireRes",type="MAX",value=50}},nil} +c["Armour is increased by Overcapped Fire Resistance"]={{[1]={flags=0,keywordFlags=0,name="ArmourIncreasedByOvercappedFireRes",type="MAX",value=100}},nil} c["Arrow Dancing"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Arrow Dancing"},[2]={flags=0,keywordFlags=0,name="Condition:HaveArrowDancing",type="FLAG",value=true}},nil} c["Arrows Chain +1 times"]={{[1]={flags=0,keywordFlags=2048,name="ChainCountMax",type="BASE",value=1}},nil} c["Arrows Fork"]={nil,"Arrows Fork "} @@ -15005,8 +15004,8 @@ c["Consecrated Ground you create while affected by Zealotry causes enemies to ta c["Consumes Frenzy Charges on use"]={nil,"Consumes Frenzy Charges on use "} c["Consumes Frenzy Charges on use Gain Onslaught for 1 second per Frenzy Charge consumed on use"]={nil,"Consumes Frenzy Charges on use Gain Onslaught for 1 second per Frenzy Charge consumed on use "} c["Consumes Maximum Charges to use"]={nil,"Consumes Maximum Charges to use "} -end)();(function() c["Consumes Maximum Charges to use Gain Vaal Souls equal to Charges Consumed when used"]={nil,"Consumes Maximum Charges to use Gain Vaal Souls equal to Charges Consumed when used "} +end)();(function() c["Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level"]={nil,"Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level "} c["Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level Can Consume 4 Uncorrupted Support Gems"]={nil,"Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level Can Consume 4 Uncorrupted Support Gems "} c["Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level Can Consume 4 Uncorrupted Support Gems Has not Consumed any Gems"]={nil,"Consumes Socketed Uncorrupted Support Gems when they reach Maximum Level Can Consume 4 Uncorrupted Support Gems Has not Consumed any Gems "} @@ -15071,7 +15070,7 @@ c["Critical Strikes inflict Malignant Madness if The Eater of Worlds is dominant c["Critical Strikes inflict Malignant Madness if The Eater of Worlds is dominant Kill Enemies that have 15% or lower Life on Hit if The Searing Exarch is dominant"]={nil,"Critical Strikes inflict Malignant Madness if The Eater of Worlds is dominant Kill Enemies that have 15% or lower Life on Hit if The Searing Exarch is dominant "} c["Critical Strikes inflict Scorch, Brittle and Sapped"]={{[1]={flags=0,keywordFlags=0,name="CritAlwaysAltAilments",type="FLAG",value=true}},nil} c["Critical Strikes with Daggers Poison the Enemy"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=524288,keywordFlags=0,name="PoisonChance",type="BASE",value=100}},nil} -c["Critical Strikes with Spells have 50% chance to inflict Impale"]={nil,"Critical Strikes with Spells have 50% chance to inflict Impale "} +c["Critical Strikes with Spells have 50% chance to inflict Impale"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=2,keywordFlags=0,name="ImpaleChance",type="BASE",value=50}},nil} c["Critical Strikes with Spells inflict Impale"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=2,keywordFlags=0,name="ImpaleChance",type="BASE",value=100}},nil} c["Critical Strikes with this Weapon do not deal extra Damage"]={{[1]={[1]={type="Condition",var="{Hand}Attack"},flags=0,keywordFlags=0,name="NoCritMultiplier",type="FLAG",value=true}},nil} c["Critical Strikes with this Weapon have Culling Strike"]={nil,"Critical Strikes with this Weapon have Culling Strike "} @@ -16468,8 +16467,8 @@ c["Gain Her Embrace for 3 seconds when you Ignite an Enemy"]={{[1]={flags=0,keyw c["Gain Immunity to Physical Damage for 1.5 seconds on Rampage"]={{[1]={flags=0,keywordFlags=0,name="Condition:Rampage",type="FLAG",value=true}},"Immunity to for 1.5 seconds on "} c["Gain Immunity to Physical Damage for 1.5 seconds on Rampage Rampage"]={{[1]={flags=0,keywordFlags=0,name="Condition:Rampage",type="FLAG",value=true}},"Immunity to for 1.5 seconds on Rampage "} c["Gain Maddening Presence for 10 seconds when you Kill a Rare or Unique Enemy"]={{[1]={[1]={type="Condition",var="KilledUniqueEnemy"},flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="HasMaddeningPresence",type="FLAG",value=true}}}},nil} -c["Gain Maximum Life instead of Maximum Energy Shield from Equipped Armour Items"]={{[1]={flags=0,keywordFlags=0,name="ConvertArmourESToLife",type="FLAG",value=true}},nil} -c["Gain Maximum Life instead of Maximum Energy Shield from Equipped Armour Items at 50% of the value"]={nil,"Maximum Life instead of Maximum Energy Shield from Equipped Armour Items at 50% of the value "} +c["Gain Maximum Life instead of Maximum Energy Shield from Equipped Armour Items"]={{[1]={flags=0,keywordFlags=0,name="ConvertArmourESToLife",type="MAX",value=100}},nil} +c["Gain Maximum Life instead of Maximum Energy Shield from Equipped Armour Items at 50% of the value"]={{[1]={flags=0,keywordFlags=0,name="ConvertArmourESToLife",type="MAX",value=50}},nil} c["Gain Onslaught after Spending a total of 200 Mana"]={{[1]={flags=0,keywordFlags=0,name="Condition:Onslaught",type="FLAG",value=true}}," after Spending a total of 200 "} c["Gain Onslaught for 1 second per Frenzy Charge consumed on use"]={{[1]={[1]={type="Multiplier",var="FrenzyCharge"},flags=0,keywordFlags=0,name="Condition:Onslaught",type="FLAG",value=true}}," for 1 second consumed on use "} c["Gain Onslaught for 1 second per Frenzy Charge consumed on use Gain Onslaught for 2 seconds per Frenzy Charge consumed on use"]={{[1]={[1]={type="Multiplier",var="FrenzyCharge"},[2]={includeTransfigured=true,skillName="Frenzy",type="SkillName"},flags=0,keywordFlags=0,name="Condition:Onslaught",type="FLAG",value=true}}," for 1 second consumed on use Gain perCharge consumed on use "} @@ -17398,8 +17397,8 @@ c["Increases and Reductions to Physical Damage also apply to Effect of"]={nil,"I c["Increases and Reductions to Physical Damage also apply to Effect of Auras from Physical Skills at 13% of their value, up to a maximum of 150%"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamageAppliesToPhysicalAuraEffect",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ImprovedPhysicalDamageAppliesToPhysicalAuraEffect",type="BASE",value=13},[3]={flags=0,keywordFlags=0,name="PhysicalDamageAppliesToPhysicalAuraEffectLimit",type="MAX",value=150}},nil} c["Increases and Reductions to Physical Damage also apply to Effect of Auras from Physical Skills at 15% of their value, up to a maximum of 150%"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamageAppliesToPhysicalAuraEffect",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ImprovedPhysicalDamageAppliesToPhysicalAuraEffect",type="BASE",value=15},[3]={flags=0,keywordFlags=0,name="PhysicalDamageAppliesToPhysicalAuraEffectLimit",type="MAX",value=150}},nil} 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 your Evasion Rating also apply to your Spell Damage"]={{[1]={flags=0,keywordFlags=0,name="EvasionAppliesToSpellDamage",type="MAX",value=100}},nil} +c["Increases and Reductions to your Evasion Rating also apply to your Spell Damage at 50% of their value"]={{[1]={flags=0,keywordFlags=0,name="EvasionAppliesToSpellDamage",type="MAX",value=50}},nil} 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 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} @@ -19056,8 +19055,8 @@ c["Quicksilver Flasks you Use also apply to Allies within 6 metres"]={{[1]={flag c["Radiant Ground created by Skills from this Graft grants Allies on it an additional 4 to 18 added Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningMin",type="BASE",value=4},[2]={flags=0,keywordFlags=0,name="LightningMax",type="BASE",value=18}},"Radiant Ground created by Skills from this Graft grants Allies on it an additional "} c["Radiant Ground created by Skills from this Graft grants Allies on it an additional 5 to 24 added Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningMin",type="BASE",value=5},[2]={flags=0,keywordFlags=0,name="LightningMax",type="BASE",value=24}},"Radiant Ground created by Skills from this Graft grants Allies on it an additional "} c["Radiant Ground created by Skills from this Graft grants Allies on it an additional 6 to 30 added Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningMin",type="BASE",value=6},[2]={flags=0,keywordFlags=0,name="LightningMax",type="BASE",value=30}},"Radiant Ground created by Skills from this Graft grants Allies on it an additional "} -c["Rage grants Spell Damage instead of Attack Damage"]={{[1]={flags=0,keywordFlags=0,name="Condition:RageSpellDamage",type="FLAG",value=true}},nil} -c["Rage grants Spell Damage instead of Attack Damage at 50% of the value"]={nil,"Rage grants Spell Damage instead of Attack Damage at 50% of the value "} +c["Rage grants Spell Damage instead of Attack Damage"]={{[1]={flags=0,keywordFlags=0,name="RageSpellDamage",type="MAX",value=100}},nil} +c["Rage grants Spell Damage instead of Attack Damage at 50% of the value"]={{[1]={flags=0,keywordFlags=0,name="RageSpellDamage",type="MAX",value=50}},nil} c["Raise Zombie does not require a corpse"]={nil,"does not require a corpse "} c["Raise Zombie does not require a corpse Your Raised Zombies count as corpses"]={nil,"does not require a corpse Your Raised Zombies count as corpses "} c["Raised Beast Spectres have 3 additional modifiers randomly chosen in each Area"]={nil,"Raised Beast Spectres have 3 additional modifiers randomly chosen in each Area "} @@ -20007,8 +20006,8 @@ c["Retaliation Skills have 15% increased Cooldown Recovery Rate"]={{[1]={[1]={sk c["Retaliation Skills have 20% increased Speed"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="Speed",type="INC",value=20},[2]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=4,name="WarcrySpeed",type="INC",value=20}},nil} c["Retaliation Skills have 200% Arcane Might"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="SpellDamageAppliesToAttacks",type="FLAG",value=true},[2]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="ImprovedSpellDamageAppliesToAttacks",type="MAX",value=200}},nil} c["Retaliation Skills have 25% increased Stun Duration on Enemies"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="EnemyStunDuration",type="INC",value=25}},nil} -end)();(function() c["Retaliation Skills have 30% increased Area of Effect"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=30}},nil} +end)();(function() c["Retaliation Skills have 30% increased Cooldown Recovery Rate"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="CooldownRecovery",type="INC",value=30}},nil} c["Retaliation Skills have 50% increased Stun Duration on Enemies"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="EnemyStunDuration",type="INC",value=50}},nil} c["Retaliation Skills have 6% increased Speed"]={{[1]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=0,name="Speed",type="INC",value=6},[2]={[1]={skillType=121,type="SkillType"},flags=0,keywordFlags=4,name="WarcrySpeed",type="INC",value=6}},nil} @@ -22282,8 +22281,8 @@ c["Ward has a 60% chance to not Break"]={{[1]={flags=0,keywordFlags=0,name="Ward c["Weapons you Animate create an additional copy"]={nil,"Weapons you Animate create an additional copy "} c["When 90% of your Hex's Duration Expires on an Enemy, Eat 1 Soul per Enemy Power"]={{[1]={flags=0,keywordFlags=0,name="Condition:CanHaveSoulEater",type="FLAG",value=true}},nil} c["When Hit during effect, 25% of Life loss from Damage taken occurs over 4 seconds instead"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="LifeLossPrevented",type="BASE",value=25}},nil} -c["When Hit, gain a random Movement Speed modifier from 20% reduced to 50% increased, until Hit again"]={nil,"a random Movement Speed modifier from 20% reduced to 50% increased, until Hit again "} -c["When Hit, gain a random Movement Speed modifier from 40% reduced to 100% increased, until Hit again"]={{[1]={flags=0,keywordFlags=0,name="Condition:HaveGamblesprint",type="FLAG",value=true}},nil} +c["When Hit, gain a random Movement Speed modifier from 20% reduced to 50% increased, until Hit again"]={{[1]={flags=0,keywordFlags=0,name="Condition:HaveGamblesprint",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="GamblesprintEffect",type="MAX",value=50}},nil} +c["When Hit, gain a random Movement Speed modifier from 40% reduced to 100% increased, until Hit again"]={{[1]={flags=0,keywordFlags=0,name="Condition:HaveGamblesprint",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="GamblesprintEffect",type="MAX",value=100}},nil} c["When Hit, lose a Ghost Shroud to Recover Energy Shield equal to 3% of your Evasion Rating"]={nil,"lose a Ghost Shroud to Recover Energy Shield equal to 3% of your Evasion Rating "} c["When Hit, lose a Ghost Shroud to Recover Energy Shield equal to 3% of your Evasion Rating Limited to 1 Keystone Tattoo"]={nil,"lose a Ghost Shroud to Recover Energy Shield equal to 3% of your Evasion Rating Limited to 1 Keystone Tattoo "} c["When a Minion within 4 metres dies, gain Rotten Bulwark equal to 8% of its maximum Life"]={nil,"When a Minion within 4 metres dies, gain Rotten Bulwark equal to 8% of its maximum Life "} diff --git a/src/Modules/CalcDefence.lua b/src/Modules/CalcDefence.lua index 65da49a4fd3..985ee69f9a4 100644 --- a/src/Modules/CalcDefence.lua +++ b/src/Modules/CalcDefence.lua @@ -822,11 +822,14 @@ function calcs.defence(env, actor) break end end - if modDB:Flag(nil, "ArmourIncreasedByOvercappedFireRes") then - for i, value in ipairs(modDB:Tabulate("FLAG", nil, "ArmourIncreasedByOvercappedFireRes")) do + local armourFromOvercappedFireRes = modDB:Max(nil, "ArmourIncreasedByOvercappedFireRes") + if armourFromOvercappedFireRes then + for _, value in ipairs(modDB:Tabulate("MAX", nil, "ArmourIncreasedByOvercappedFireRes")) do local mod = value.mod - modDB:NewMod("Armour", "INC", output.FireResistOverCap, mod.source) - break + if value.value == armourFromOvercappedFireRes then + modDB:NewMod("Armour", "INC", output.FireResistOverCap * armourFromOvercappedFireRes / 100, mod.source) + break + end end end if modDB:Flag(nil, "EvasionRatingIncreasedByUncappedColdRes") then @@ -930,7 +933,7 @@ function calcs.defence(env, actor) item = actor.itemList[slot], }) end - elseif not modDB:Flag(nil, "ConvertArmourESToLife") then + elseif not modDB:Max(nil, "ConvertArmourESToLife") then energyShield = energyShield + energyShieldBase * calcLib.mod(modDB, slotCfg, "EnergyShield", "Defences", slot.."ESAndArmour") gearEnergyShield = gearEnergyShield + energyShieldBase if breakdown then diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 5baf0c8b6ca..d2565055db3 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -641,11 +641,14 @@ function calcs.offence(env, actor, activeSkill) end end end - if skillModList:Flag(nil, "EvasionAppliesToSpellDamage") then + local evasionAppliesToSpellDamage = skillModList:Max(nil, "EvasionAppliesToSpellDamage") + if evasionAppliesToSpellDamage then -- The Unblinking Eye evasion rating to spell damage conversion + local multiplier = evasionAppliesToSpellDamage / 100 for i, value in ipairs(skillModList:Tabulate("INC", { }, "Evasion")) do local mod = value.mod - skillModList:NewMod("Damage", mod.type, mod.value, mod.source, ModFlag.Spell, mod.keywordFlags, unpack(mod)) + local modifiers = calcLib.getConvertedModTags(mod, multiplier) + skillModList:NewMod("Damage", mod.type, mod.value * multiplier, mod.source, ModFlag.Spell, mod.keywordFlags, unpack(modifiers)) end end if skillModList:Flag(nil, "SpellDamageAppliesToAttacks") or skillModList:Flag(skillCfg, "SpellDamageAppliesToAttacks") then diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index cda09c77378..6c9dc9531eb 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -921,8 +921,9 @@ local function doActorMisc(env, actor) output.Rage = stacks output.MaximumRage = maxStacks modDB:NewMod("Multiplier:Rage", "BASE", output.Rage, "Base") - if modDB:Flag(nil, "Condition:RageSpellDamage") then - modDB:NewMod("Damage", "MORE", output.RageEffect, "Rage", ModFlag.Spell) + local rageSpellDamage = modDB:Max(nil, "RageSpellDamage") + if rageSpellDamage then + modDB:NewMod("Damage", "MORE", output.RageEffect * rageSpellDamage / 100, "Rage", ModFlag.Spell) else modDB:NewMod("Damage", "MORE", output.RageEffect, "Rage", ModFlag.Attack) end @@ -932,6 +933,11 @@ local function doActorMisc(env, actor) output.InherentRageLossDelay = 2 + modDB:Sum("BASE", nil, "InherentRageLossDelay") output.InherentRageLoss = (not modDB:Flag(nil, "InherentRageLossIsPrevented")) and 10 * (1 + modDB:Sum("INC", nil, "InherentRageLoss") / 100) or 0 end + local gamblesprintEffect = modDB:Max(nil, "GamblesprintEffect") + if gamblesprintEffect then + local movementSpeed = modDB:Sum("BASE", nil, "Multiplier:GamblesprintMovementSpeed") * gamblesprintEffect / 100 + modDB:NewMod("MovementSpeed", "INC", movementSpeed, "Config") + end if (env.configInput.multiplierManaBurnStacks or 0) > 0 then local maxManaBurn = modDB:Sum("BASE", nil, "MaxManaBurnStacks") if maxManaBurn == 0 then @@ -1521,7 +1527,8 @@ function calcs.perform(env, skipEHP) end end - if modDB:Flag(nil, "ConvertArmourESToLife") then + local armourESToLife = modDB:Max(nil, "ConvertArmourESToLife") + if armourESToLife then local energyShieldBase local tempTable1 = { } local slotCfg = wipeTable(tempTable1) @@ -1531,7 +1538,7 @@ function calcs.perform(env, skipEHP) slotCfg.slotName = slot energyShieldBase = armourData.EnergyShield or 0 if energyShieldBase > 0 then - modDB:NewMod("Life", "BASE", energyShieldBase, slot.." ES to Life Conversion") + modDB:NewMod("Life", "BASE", energyShieldBase * armourESToLife / 100, slot.." ES to Life Conversion") end end end diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 1754e66313b..9000b482b0c 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -443,7 +443,8 @@ local function addBestSupport(supportEffect, appliedSupportList, mode) -- Check if there's another better support already present if supportEffect.grantedEffect == otherSupport.grantedEffect then add = false - if supportEffect.level > otherSupport.level or (supportEffect.level == otherSupport.level and supportEffect.quality > otherSupport.quality) then + if supportEffect.level > otherSupport.level or (supportEffect.level == otherSupport.level and (supportEffect.quality > otherSupport.quality + or (supportEffect.quality == otherSupport.quality and (supportEffect.triggerChance or 100) > (otherSupport.triggerChance or 100)))) then if mode == "MAIN" then otherSupport.superseded = true end @@ -1706,6 +1707,7 @@ function calcs.initEnv(build, mode, override, specEnv) gemData = env.data.gems[env.data.gemForBaseName[grantedEffect.name:lower()] or env.data.gemForBaseName[(grantedEffect.name .. " Support"):lower()]], level = level or value.level, appliesToGrantedSkills = value and value.appliesToGrantedSkills, + triggerChance = value and value.triggerChance, quality = 0, enabled = true, }, targetList, env.mode) diff --git a/src/Modules/CalcTriggers.lua b/src/Modules/CalcTriggers.lua index b974cf8711d..6b4ee4c3889 100644 --- a/src/Modules/CalcTriggers.lua +++ b/src/Modules/CalcTriggers.lua @@ -1048,8 +1048,9 @@ local configTable = { return skill.skillData.triggeredByUnique and env.player.mainSkill.socketGroup.slot == skill.socketGroup.slot and skill.skillTypes[SkillType.RangedAttack] end} end, - ["asenath's chant"] = function() + ["asenath's chant"] = function(env) return {triggerOnUse = true, + triggerChance = env.player.mainSkill.triggeredBy.triggerChance, triggerSkillCond = function(env, skill) return (skill.skillTypes[SkillType.Damage] or skill.skillTypes[SkillType.Attack]) and band(skill.skillCfg.flags, ModFlag.Bow) > 0 end, diff --git a/src/Modules/ConfigOptions.lua b/src/Modules/ConfigOptions.lua index 29f31f67b7c..50c638a8fc6 100644 --- a/src/Modules/ConfigOptions.lua +++ b/src/Modules/ConfigOptions.lua @@ -1689,8 +1689,8 @@ Huge sets the radius to 11. { var = "conditionHaveManaStorm", type = "check", label = "Do you have Manastorm's Buff?", ifFlag = "Condition:HaveManaStorm", tooltip = "This option enables Manastorm's ^xADAA47Lightning ^7Damage Buff.\n(When you cast a Spell, Sacrifice all ^x7070FFMana ^7to gain Added Maximum ^xADAA47Lightning ^7Damage\nequal to 50% of Sacrificed ^x7070FFMana ^7for 4 seconds)", apply = function(val, modList, enemyModList) modList:NewMod("Condition:SacrificeManaForLightning", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) end }, - { var = "GamblesprintMovementSpeed", type = "list", label = "Gamblesprint Movement Speed", defaultIndex=5, list={{val=-40,label="-40%"},{val=-20,label="-20%"},{val=0,label="0%"},{val=20,label="20%"},{val=30,label="30%"},{val=40,label="40%"},{val=60,label="60%"},{val=80,label="80%"},{val=100,label="100%"}}, ifFlag = "Condition:HaveGamblesprint", tooltip = "This option sets the Movement Speed from Gamblesprint boots.", apply = function(val, modList, enemyModList) - modList:NewMod("MovementSpeed", "INC", val, "Config", { type = "Condition", var = "Combat" }, { type = "Condition", var = "HaveGamblesprint" }) + { var = "GamblesprintMovementSpeed", type = "list", label = "Gamblesprint Movement Speed", defaultIndex=5, list={{val=-40,label="-40% / -20%"},{val=-20,label="-20% / -10%"},{val=0,label="0% / 0%"},{val=20,label="20% / 10%"},{val=30,label="30% / 15%"},{val=40,label="40% / 20%"},{val=60,label="60% / 30%"},{val=80,label="80% / 40%"},{val=100,label="100% / 50%"}}, ifFlag = "Condition:HaveGamblesprint", tooltip = "Movement Speed roll from Gamblesprint.\nValues show the normal modifier / reduced Vestigial modifier.", apply = function(val, modList, enemyModList) + modList:NewMod("Multiplier:GamblesprintMovementSpeed", "BASE", val, "Config", { type = "Condition", var = "Combat" }, { type = "Condition", var = "HaveGamblesprint" }) end }, { var = "EverlastingSacrifice", type = "check", label = "Do you have Everlasting Sacrifice?", ifFlag = "Condition:EverlastingSacrifice", tooltip = "This option enables the Everlasting Sacrifice buff that grants +5% to all maximum resists.", apply = function(val, modList , enemyModList) modList:NewMod("ElementalResistMax", "BASE", 5, "Config", { type = "Condition", var = "Combat" }, { type = "Condition", var = "EverlastingSacrifice"}) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 6355f995fea..838e3dfd6a5 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -3088,7 +3088,8 @@ local specialModList = { mod("PhysicalMin", "BASE", 1, { type = "PercentStat", stat = "LifeCost", percent = num, floor = true }, { type = "StatThreshold", stat = "LifeUnreserved", thresholdStat = "LifeCost" }), mod("PhysicalMax", "BASE", 1, { type = "PercentStat", stat = "LifeCost", percent = num, floor = true }, { type = "StatThreshold", stat = "LifeUnreserved", thresholdStat = "LifeCost" }), } end, - ["gain maximum life instead of maximum energy shield from equipped armour items"] = { flag("ConvertArmourESToLife") }, + ["gain maximum life instead of maximum energy shield from equipped armour items"] = { mod("ConvertArmourESToLife", "MAX", 100) }, + ["gain maximum life instead of maximum energy shield from equipped armour items at (%d+)%% of the value"] = function(num) return { mod("ConvertArmourESToLife", "MAX", num) } end, -- Ritualist Bloodline ["unaffected by bleeding"] = { mod("SelfBleedEffect", "MORE", -100) }, ["unaffected by poison"] = { mod("SelfPoisonEffect", "MORE", -100) }, @@ -3229,6 +3230,9 @@ local specialModList = { ["trigger socketed spells when you focus, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellFromHelmet", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, ["trigger a socketed spell when you attack with a bow"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellOnBowAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, ["trigger a socketed spell when you attack with a bow, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellOnBowAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, + ["(%d+)%% chance to trigger a socketed spell when you attack with a bow, with a ([%d%.]+) second cooldown"] = function(num) return { + mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellOnBowAttack", level = 1, triggerChance = tonumber(num) }, { type = "SocketedIn", slotName = "{SlotName}" }) + } end, ["trigger a socketed bow skill when you attack with a bow"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerBowSkillOnBowAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, ["trigger a socketed bow skill when you attack with a bow, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerBowSkillOnBowAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, ["trigger a socketed bow skill when you cast a spell while wielding a bow"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerBowSkillOnBowAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) }, @@ -3495,7 +3499,8 @@ local specialModList = { ["increases and reductions to cast speed apply to attack speed at (%d+)%% of their value"] = function(num) return { flag("CastSpeedAppliesToAttacks"), mod("ImprovedCastSpeedAppliesToAttacks", "MAX", num) } end, ["increases and reductions to cast speed apply to attack speed"] = function(num) return { flag("CastSpeedAppliesToAttacks") } end, ["increases and reductions to spell damage also apply to attacks"] = { flag("SpellDamageAppliesToAttacks") }, - ["increases and reductions to your evasion rating also apply to your spell damage"] = { flag("EvasionAppliesToSpellDamage") }, + ["increases and reductions to your evasion rating also apply to your spell damage"] = { mod("EvasionAppliesToSpellDamage", "MAX", 100) }, + ["increases and reductions to your evasion rating also apply to your spell damage at (%d+)%% of their value"] = function(num) return { mod("EvasionAppliesToSpellDamage", "MAX", num) } end, ["arcane might"] = { flag("SpellDamageAppliesToAttacks") }, ["(%d+)%% arcane might"] = function(num) return { flag("SpellDamageAppliesToAttacks"), mod("ImprovedSpellDamageAppliesToAttacks", "MAX", num) } end, ["attacks have (%d+)%% arcane might"] = function(num) return { flag("SpellDamageAppliesToAttacks"), mod("ImprovedSpellDamageAppliesToAttacks", "MAX", num) } end, @@ -3951,6 +3956,7 @@ local specialModList = { } end, ["(%d+)%% chance for blade vortex and blade blast to impale enemies on hit"] = function(num) return { mod("ImpaleChance", "BASE", num, { type = "SkillName", skillNameList = { "Blade Vortex", "Blade Blast" }, includeTransfigured = true }) } end, ["critical strikes with spells inflict impale"] = { mod("ImpaleChance", "BASE", 100, nil, ModFlag.Spell, { type = "Condition", var = "CriticalStrike" }) }, + ["critical strikes with spells have (%d+)%% chance to inflict impale"] = function(num) return { mod("ImpaleChance", "BASE", num, nil, ModFlag.Spell, { type = "Condition", var = "CriticalStrike" }) } end, ["(%d+)%% chance on hitting an enemy for all impales on that enemy to last for an additional hit"] = function(num) return { mod("ImpaleAdditionalDurationChance", "BASE", num) } end, @@ -4779,6 +4785,7 @@ local specialModList = { ["chaos damage t?a?k?e?n? ?does not bypass energy shield while not on low life or low mana"] = { flag("ChaosNotBypassEnergyShield", { type = "Condition", varList = { "LowLife", "LowMana" }, neg = true }) }, ["chaos damage t?a?k?e?n? ?does not bypass energy shield while not on low mana"] = { flag("ChaosNotBypassEnergyShield", { type = "Condition", varList = { "LowMana" }, neg = true }) }, ["chaos damage is taken from mana before life"] = { mod("ChaosDamageTakenFromManaBeforeLife", "BASE", 100) }, + ["(%d+)%% of chaos damage is taken from mana before life"] = function(num) return { mod("ChaosDamageTakenFromManaBeforeLife", "BASE", num) } end, ["(%d+)%% of physical damage is taken from mana before life"] = function(num) return { mod("PhysicalDamageTakenFromManaBeforeLife", "BASE", num) } end, ["minions take (%d+)%% increased damage"] = function(num) return { mod("MinionModifier", "LIST", { mod = mod("DamageTaken", "INC", num) }) } end, ["minions take (%d+)%% reduced damage"] = function(num) return { mod("MinionModifier", "LIST", { mod = mod("DamageTaken", "INC", -num) }) } end, @@ -4911,7 +4918,8 @@ local specialModList = { ["maximum energy shield is increased by chance to block spell damage"] = { flag("EnergyShieldIncreasedByChanceToBlockSpellDamage") }, ["maximum energy shield is increased by chaos resistance"] = { flag("EnergyShieldIncreasedByChaosResistance") }, ["armour is increased by uncapped fire resistance"] = { flag( "ArmourIncreasedByUncappedFireRes") }, - ["armour is increased by overcapped fire resistance"] = { flag( "ArmourIncreasedByOvercappedFireRes") }, + ["armour is increased by overcapped fire resistance"] = { mod("ArmourIncreasedByOvercappedFireRes", "MAX", 100) }, + ["armour is increased by (%d+)%% of overcapped fire resistance"] = function(num) return { mod("ArmourIncreasedByOvercappedFireRes", "MAX", num) } end, ["minion life is increased by t?h?e?i?r? ?overcapped fire resistance"] = { mod("MinionModifier", "LIST", { mod = mod("Life", "INC", 1, { type = "PerStat", stat = "FireResistOverCap", div = 1 }) }) }, ["totem life is increased by t?h?e?i?r? ?overcapped fire resistance"] = { mod("TotemLife", "INC", 1, { type = "PerStat", stat = "TotemFireResistOverCap", div = 1 }) }, ["evasion rating is increased by uncapped cold resistance"] = { flag( "EvasionRatingIncreasedByUncappedColdRes") }, @@ -5060,6 +5068,7 @@ local specialModList = { ["action speed cannot be modified to below base value while ignited"] = { mod("MinimumActionSpeed", "MAX", 100, { type = "Condition", var = "Ignited" }) }, ["nearby allies' action speed cannot be modified to below base value"] = { mod("ExtraAura", "LIST", { onlyAllies = true, mod = mod("MinimumActionSpeed", "MAX", 100, { type = "GlobalEffect", effectType = "Global", unscalable = true }) }) }, ["armour also applies to lightning damage taken from hits"] = { mod("ArmourAppliesToLightningDamageTaken", "BASE", 100), }, + ["(%d+)%% of armour also applies to lightning damage taken from hits"] = function(num) return { mod("ArmourAppliesToLightningDamageTaken", "BASE", num) } end, ["lightning resistance does not affect lightning damage taken"] = { flag("SelfIgnoreLightningResistance") }, ["(%d+)%% increased maximum life and reduced fire resistance"] = function(num) return { mod("Life", "INC", num), @@ -5528,6 +5537,11 @@ local specialModList = { }, ["when hit, gain a random movement speed modifier from 40%% reduced to 100%% increased,? until hit again"] = { flag("Condition:HaveGamblesprint"), + mod("GamblesprintEffect", "MAX", 100), + }, + ["when hit, gain a random movement speed modifier from 20%% reduced to 50%% increased,? until hit again"] = { + flag("Condition:HaveGamblesprint"), + mod("GamblesprintEffect", "MAX", 50), }, ["trigger socketed curse spell when you cast a curse spell, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportUniqueCastCurseOnCurse", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }), @@ -5589,7 +5603,8 @@ local specialModList = { ["with a murderous eye jewel socketed, melee attacks grant (%d+) rage on hit, no more than once every second"] = { flag("Condition:CanGainRage", { type = "Condition", var = "HaveMurderousEyeJewelIn{SlotName}" }) }, ["gain %d+ rage after spending a total of %d+ mana"] = { flag("Condition:CanGainRage") }, ["rage grants cast speed instead of attack speed"] = { flag("Condition:RageCastSpeed") }, - ["rage grants spell damage instead of attack damage"] = { flag("Condition:RageSpellDamage") }, + ["rage grants spell damage instead of attack damage"] = { mod("RageSpellDamage", "MAX", 100) }, + ["rage grants spell damage instead of attack damage at (%d+)%% of the value"] = function(num) return { mod("RageSpellDamage", "MAX", num) } end, ["inherent loss of rage is (%d+)%% slower"] = function(num) return { mod("InherentRageLoss", "INC", -num) } end, ["inherent loss of rage is (%d+)%% faster"] = function(num) return { mod("InherentRageLoss", "INC", num) } end, ["inherent rage loss starts (%d+) seconds? later"] = function(num) return { mod("InherentRageLossDelay", "BASE", num) } end, From bb74a3e0eed43c40e31b99d8dfedd3539c32f63b Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Tue, 10 Nov 2026 09:08:34 +0100 Subject: [PATCH 2/3] Parse wrapped reduced Vestigial value clauses Read the reduced-value continuation before accepting the full-strength first line. Keep separately marked export lines from shifting the next explicit modifier into the implicit list, and preserve item round trips. --- .../TestVestigialReducedImplicits_spec.lua | 11 +++++++++++ src/Classes/Item.lua | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/spec/System/TestVestigialReducedImplicits_spec.lua b/spec/System/TestVestigialReducedImplicits_spec.lua index 1f04157126a..33187a291c5 100644 --- a/spec/System/TestVestigialReducedImplicits_spec.lua +++ b/spec/System/TestVestigialReducedImplicits_spec.lua @@ -145,6 +145,17 @@ describe("TestVestigialReducedImplicits", function() assert.are.equal(0, full.EnergyShield) assert.are.equal(0, half.EnergyShield) assert.are.equal(control.Life + (full.Life - control.Life) / 2, half.Life) + -- Website exports can wrap the reduced value onto another Vestigial line. + assert.are.equal(half.Life, calculate({ apostate, "at 50% of the value" }, options).Life) + options.explicit = "100% increased Energy Shield" + local wrapped = calculate({ apostate, "at 50% of the value" }, options) + assert.are.equal(1, #wrapped.item.implicitModLines) + assert.are.equal(1, #wrapped.item.explicitModLines) + local reimported = new("Item"):Item(wrapped.item:BuildRaw()) + assert.are.equal(1, #reimported.implicitModLines) + assert.are.equal(1, #reimported.explicitModLines) + assert.is_nil(reimported.implicitModLines[1].extra) + options.explicit = nil assert.are.equal(full.Life, calculate({ apostateHalf, apostate }, options).Life) options.configure = function() equip("Hubris Circlet", { }) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index 467a13ce1b7..967d098fef2 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -1190,20 +1190,27 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) end local rangedLine = itemLib.applyRange(line, 1, catalystScalar, modLine.corruptedRange) local modList, extra = modLib.parseMod(rangedLine) + local nextLine = self.rawLines[l + 1] + and self.rawLines[l + 1]:gsub("%b{}", ""):gsub(" ?%(%l+%)", "") local nextModGroup = self.rawLines[l + 1] and self.rawLines[l + 1]:match("{modGroup:([^}]+)}") -- Only combine generated lines that came from the same modifier. - if (not modList or extra) and self.rawLines[l + 1] + -- A value continuation can reduce an otherwise complete modifier. + if (not modList or extra or nextLine and nextLine:match("^at %d+%% of the")) and nextLine and modLine.modGroup == nextModGroup then -- Try to combine it with the next line - local nextLine = self.rawLines[l+1]:gsub("%b{}", ""):gsub(" ?%(%l+%)","") local combLine = line.." "..nextLine rangedLine = itemLib.applyRange(combLine, 1, catalystScalar, modLine.corruptedRange) - modList, extra = modLib.parseMod(rangedLine, true) - if modList and not extra then + local combinedModList, combinedExtra = modLib.parseMod(rangedLine, true) + if combinedModList and not combinedExtra then + modList, extra = combinedModList, combinedExtra + -- Website exports count separately marked Vestigial lines as separate implicits. + if modLine.vestigial and self.rawLines[l + 1]:find("{vestigial}", 1, true) then + implicitLines = implicitLines - 1 + end line = line .. "\n" .. nextLine l = l + 1 - else + elseif not modList or extra then modList, extra = modLib.parseMod(rangedLine) end end From 9de9e56af5662ee6eac507ca75b242c490be1cd3 Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Tue, 10 Nov 2026 19:27:28 +0100 Subject: [PATCH 3/3] Localize Vestigial test calculations Keep armour-source, hit-mitigation and pool observations beside their assertions instead of collecting them for every test case. --- .../TestVestigialReducedImplicits_spec.lua | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/spec/System/TestVestigialReducedImplicits_spec.lua b/spec/System/TestVestigialReducedImplicits_spec.lua index 33187a291c5..9eeddc20a2d 100644 --- a/spec/System/TestVestigialReducedImplicits_spec.lua +++ b/spec/System/TestVestigialReducedImplicits_spec.lua @@ -34,16 +34,7 @@ describe("TestVestigialReducedImplicits", function() result.evasionIncrease = skill.skillModList:Sum("INC", { }, "Evasion") result.damageMore = env.player.modDB:More(skill.skillCfg, "Damage") result.attackDamageMore = env.player.modDB:More({ flags = ModFlag.Attack }, "Damage") - local armourIncreases = env.player.modDB:Tabulate("INC", nil, "Armour") - result.armourIncreaseSource = armourIncreases[1] and armourIncreases[1].mod.source - for _, value in ipairs(env.player.modDB:Tabulate("MAX", nil, "ArmourIncreasedByOvercappedFireRes")) do - if value.value == 100 then - result.fullArmourSource = value.mod.source - end - end - result.hitTaken = build.calcsTab.calcs.takenHitFromDamage(1000, "Lightning", env.player) - result.pools = build.calcsTab.calcs.reducePoolsByDamage({ Life = 1000, Mana = 1000, EnergyShield = options.poolEnergyShield or 0, Ward = 0 }, { Chaos = 200 }, env.player) - return result + return result, env end local form = "Armour is increased by Overcapped Fire Resistance" @@ -84,8 +75,15 @@ describe("TestVestigialReducedImplicits", function() assert.are.equal(full.Armour, calculate({ formHalf, form }, options).Armour) assert.are.equal(half.Armour, calculate({ formHalf, formHalf }, options).Armour) options.custom = options.custom .. "\n" .. form - local mixedSources = calculate({ formHalf }, options) - assert.are.equal(mixedSources.fullArmourSource, mixedSources.armourIncreaseSource) + local _, env = calculate({ formHalf }, options) + local armourIncreases = env.player.modDB:Tabulate("INC", nil, "Armour") + local fullArmourSource + for _, value in ipairs(env.player.modDB:Tabulate("MAX", nil, "ArmourIncreasedByOvercappedFireRes")) do + if value.value == 100 then + fullArmourSource = value.mod.source + end + end + assert.are.equal(fullArmourSource, armourIncreases[1] and armourIncreases[1].mod.source) options.custom = "+1000 to Armour" assert.are.equal(calculate({ }, options).Armour, calculate({ formHalf }, options).Armour) end) @@ -170,9 +168,14 @@ describe("TestVestigialReducedImplicits", function() it("applies one tenth of armour to lightning hits through the final mitigation calculation", function() local options = { base = "Simple Robe", custom = "+10000 to Armour" } - local control = calculate({ }, options) - local tenth = calculate({ doryaniTenth }, options) - local full = calculate({ doryani }, options) + local function calculateHit(lines) + local result, env = calculate(lines, options) + result.hitTaken = build.calcsTab.calcs.takenHitFromDamage(1000, "Lightning", env.player) + return result + end + local control = calculateHit({ }) + local tenth = calculateHit({ doryaniTenth }) + local full = calculateHit({ doryani }) assert.are.equal(1000, tenth.LightningEffectiveAppliedArmour) assert.are.equal(0, tenth.FireEffectiveAppliedArmour) assert.is_true(full.hitTaken < tenth.hitTaken and tenth.hitTaken < control.hitTaken) @@ -181,18 +184,23 @@ describe("TestVestigialReducedImplicits", function() it("redirects half of chaos damage to mana and retains the shared redirection cap", function() local options = { base = "Simple Robe", custom = "+1000 to maximum Life\n+1000 to maximum Mana" } - local half = calculate({ ivoryHalf }, options) + local function calculatePools(lines) + local result, env = calculate(lines, options) + result.pools = build.calcsTab.calcs.reducePoolsByDamage({ Life = 1000, Mana = 1000, EnergyShield = options.poolEnergyShield or 0, Ward = 0 }, { Chaos = 200 }, env.player) + return result + end + local half = calculatePools({ ivoryHalf }) assert.are.equal(50, half.ChaosMindOverMatter) assert.are.equal(900, half.pools.Life) assert.are.equal(900, half.pools.Mana) - local full = calculate({ ivory }, options) + local full = calculatePools({ ivory }) assert.are.equal(1000, full.pools.Life) assert.are.equal(800, full.pools.Mana) options.custom = options.custom .. "\n60% of Damage is taken from Mana before Life" assert.are.equal(40, calculate({ ivoryHalf }, options).ChaosMindOverMatter) options.custom = "+1000 to maximum Life\n+1000 to maximum Mana\n+100 to maximum Energy Shield\nEldritch Battery" options.poolEnergyShield = 100 - local battery = calculate({ ivoryHalf }, options) + local battery = calculatePools({ ivoryHalf }) assert.are.equal(900, battery.pools.Life) assert.are.equal(900, battery.pools.Mana) assert.are.equal(100, battery.pools.EnergyShield)