diff --git a/spec/System/TestSkills_spec.lua b/spec/System/TestSkills_spec.lua index df3b72084b..f0c02d4f3c 100644 --- a/spec/System/TestSkills_spec.lua +++ b/spec/System/TestSkills_spec.lua @@ -21,4 +21,67 @@ describe("TestSkills", function() assert.True(build.calcsTab.mainOutput.SpiritReservedPercent > oneCurseReservation) end) + + it("Test cost efficiency modifiers", function() + -- Test Mana Cost Efficiency + build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n") + runCallback("OnFrame") + + -- Get base mana cost (Ball Lightning level 1 has 9 mana cost) + local baseCost = build.calcsTab.mainOutput.ManaCost + assert.are.equals(9, baseCost) + + -- Add 50% mana cost efficiency (should reduce cost to 9/1.5 = 6) + build.configTab.input.customMods = "50% increased Mana Cost Efficiency" + build.configTab:BuildModList() + runCallback("OnFrame") + + local reducedCost = build.calcsTab.mainOutput.ManaCost + assert.are.equals(6, reducedCost) + + -- Test generic cost efficiency (should also affect mana) + newBuild() + build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n") + build.configTab.input.customMods = "25% increased Cost Efficiency" + build.configTab:BuildModList() + runCallback("OnFrame") + + local genericEfficiencyCost = build.calcsTab.mainOutput.ManaCost + -- Test actual behavior: 9/1.25 = 7.2 (not rounded) + assert.True(math.abs(genericEfficiencyCost - 7.2) < 0.001) + + -- Test multiple efficiency sources stacking additively + build.configTab.input.customMods = "25% increased Cost Efficiency\n25% increased Mana Cost Efficiency" + build.configTab:BuildModList() + runCallback("OnFrame") + + local stackedCost = build.calcsTab.mainOutput.ManaCost + assert.are.equals(6, stackedCost) -- 9/(1 + 0.25 + 0.25) = 9/1.5 = 6 + end) + + it("Test cost efficiency with cost modifiers", function() + -- Test interaction between cost efficiency and cost multipliers + build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n") + + -- Add cost multiplier and efficiency + build.configTab.input.customMods = "50% increased Mana Cost\n50% increased Mana Cost Efficiency" + build.configTab:BuildModList() + runCallback("OnFrame") + + local finalCost = build.calcsTab.mainOutput.ManaCost + assert.True(math.abs(finalCost - 8.67) < 0.1) -- floor(9 * 1.5) / 1.5 + end) + + it("Test mana cost efficiency with support gems", function() + -- Test interaction between cost efficiency and cost multipliers + build.skillsTab:PasteSocketGroup("Contagion 6/0 1\nMagnified Area I 1/0 1") + + -- Add efficiency + build.configTab.input.customMods = "36% increased Mana Cost Efficiency" + build.configTab:BuildModList() + runCallback("OnFrame") + + local finalCost = build.calcsTab.mainOutput.ManaCost + assert.are.equals(16, round(finalCost)) + end) end) \ No newline at end of file diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index c68a19fa2c..79999b846d 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -1095,8 +1095,7 @@ c["10% increased Magnitude of Chill you inflict"]={{[1]={flags=0,keywordFlags=0, c["10% increased Magnitude of Non-Damaging Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=10},[2]={flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=10},[3]={flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=10}},nil} c["10% increased Magnitude of Poison you inflict"]={{[1]={flags=0,keywordFlags=2097152,name="AilmentMagnitude",type="INC",value=10}},nil} c["10% increased Magnitude of Shock you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=10}},nil} -c["10% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=10}}," Efficiency "} -c["10% increased Mana Cost Efficiency Triggered Spells deal 40% increased Spell Damage"]={{[1]={flags=2,keywordFlags=0,name="ManaCost",type="INC",value=10}}," Efficiency Triggered s deal 40% increased Spell Damage "} +c["10% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=10}},nil} c["10% increased Mana Cost of Skills"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=10}},nil} c["10% increased Mana Recovery Rate during Effect of any Mana Flask"]={{[1]={[1]={type="Condition",var="UsingManaFlask"},flags=0,keywordFlags=0,name="ManaRecoveryRate",type="INC",value=10}},nil} c["10% increased Mana Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name="FlaskManaRecovery",type="INC",value=10}},nil} @@ -1442,9 +1441,9 @@ c["15% increased Charm Charges gained"]={{[1]={flags=0,keywordFlags=0,name="Char c["15% increased Chill Duration on Enemies"]={{[1]={flags=0,keywordFlags=0,name="EnemyChillDuration",type="INC",value=15}},nil} c["15% increased Chill and Freeze Duration on Enemies"]={{[1]={flags=0,keywordFlags=0,name="EnemyFreezeDuration",type="INC",value=15},[2]={flags=0,keywordFlags=0,name="EnemyChillDuration",type="INC",value=15}},nil} c["15% increased Cooldown Recovery Rate for Grenade Skills"]={{[1]={[1]={skillType=158,type="SkillType"},flags=0,keywordFlags=0,name="CooldownRecovery",type="INC",value=15}},nil} -c["15% increased Cost Efficiency"]={{}," Cost Efficiency "} -c["15% increased Cost Efficiency of Attacks"]={{}," Cost Efficiency of Attacks "} -c["15% increased Cost Efficiency of Attacks 18% of Skill Mana Costs Converted to Life Costs"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=15}}," Cost Efficiency of Attacks 18% of Skill s Converted to Life Costs "} +c["15% increased Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="CostEfficiency",type="INC",value=15}},nil} +c["15% increased Cost Efficiency of Attacks"]={{[1]={flags=0,keywordFlags=0,name="CostEfficiency",type="INC",value=15}}," of Attacks "} +c["15% increased Cost Efficiency of Attacks 18% of Skill Mana Costs Converted to Life Costs"]={{[1]={flags=0,keywordFlags=0,name="CostEfficiency",type="INC",value=15}}," of Attacks 18% of Skill Mana Costs Converted to Life Costs "} c["15% increased Critical Damage Bonus"]={{[1]={flags=0,keywordFlags=0,name="CritMultiplier",type="INC",value=15}},nil} c["15% increased Critical Damage Bonus for Attack Damage"]={{[1]={flags=1,keywordFlags=0,name="CritMultiplier",type="INC",value=15}},nil} c["15% increased Critical Hit Chance"]={{[1]={flags=0,keywordFlags=0,name="CritChance",type="INC",value=15}},nil} @@ -1505,7 +1504,7 @@ c["15% increased Magnitude of Daze"]={{}," Magnitude of Daze "} c["15% increased Magnitude of Ignite you inflict with Critical Hits"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=8388608,name="AilmentMagnitude",type="INC",value=15}},nil} c["15% increased Magnitude of Jagged Ground you create"]={{[1]={flags=0,keywordFlags=0,name="EnemyJaggedGroundMagnitude",type="INC",value=15}},nil} c["15% increased Magnitude of Shock you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=15}},nil} -c["15% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=15}}," Efficiency "} +c["15% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=15}},nil} c["15% increased Mana Cost of Skills"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=15}},nil} c["15% increased Mana Flask Charges gained"]={{[1]={flags=0,keywordFlags=0,name="ManaFlaskChargesGained",type="INC",value=15}},nil} c["15% increased Mana Recovery rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRecoveryRate",type="INC",value=15}},nil} @@ -1607,8 +1606,7 @@ c["16% increased Critical Damage Bonus with Bows"]={{[1]={flags=131076,keywordFl c["16% increased Critical Hit Chance for Spells"]={{[1]={flags=2,keywordFlags=0,name="CritChance",type="INC",value=16}},nil} c["16% increased Damage with Warcries"]={{[1]={flags=0,keywordFlags=4,name="Damage",type="INC",value=16}},nil} c["16% increased Hazard Damage"]={{[1]={[1]={skillType=203,type="SkillType"},flags=0,keywordFlags=0,name="Damage",type="INC",value=16}},nil} -c["16% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=16}}," Efficiency "} -c["16% increased Mana Cost Efficiency 30% increased Mana Regeneration Rate while moving"]={{[1]={[1]={type="Condition",var="Moving"},flags=0,keywordFlags=0,name="ManaCost",type="INC",value=16}}," Efficiency 30% increased Mana Regeneration Rate "} +c["16% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=16}},nil} c["16% increased Mana Regeneration Rate while not on Low Mana"]={{[1]={[1]={neg=true,type="Condition",var="LowMana"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=16}},nil} c["16% increased Mana Regeneration Rate while stationary"]={{[1]={[1]={type="Condition",var="Stationary"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=16}},nil} c["16% increased Melee Damage"]={{[1]={flags=256,keywordFlags=0,name="Damage",type="INC",value=16}},nil} @@ -1725,8 +1723,7 @@ c["20% increased Chaos Damage"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamage" c["20% increased Charm Charges used"]={{[1]={flags=0,keywordFlags=0,name="CharmChargesUsed",type="INC",value=20}},nil} c["20% increased Charm Effect Duration"]={{[1]={flags=0,keywordFlags=0,name="CharmDuration",type="INC",value=20}},nil} c["20% increased Chill Duration on Enemies"]={{[1]={flags=0,keywordFlags=0,name="EnemyChillDuration",type="INC",value=20}},nil} -c["20% increased Cost Efficiency of Skills if you've consumed a Power Charge Recently"]={{}," Cost Efficiency of Skills "} -c["20% increased Cost Efficiency of Skills if you've consumed a Power Charge Recently Triggered Spells deal 40% increased Spell Damage"]={{[1]={[1]={limit=1,type="Multiplier",var="RemovablePowerCharge"},flags=2,keywordFlags=0,name="Damage",type="INC",value=20}}," Cost Efficiency of Skills Triggered s deal 40% increased Spell "} +c["20% increased Cost Efficiency of Skills if you've consumed a Power Charge Recently"]={{[1]={[1]={limit=1,type="Multiplier",var="RemovablePowerCharge"},flags=0,keywordFlags=0,name="CostEfficiency",type="INC",value=20}},nil} c["20% increased Critical Damage Bonus"]={{[1]={flags=0,keywordFlags=0,name="CritMultiplier",type="INC",value=20}},nil} c["20% increased Critical Damage Bonus for Attack Damage"]={{[1]={flags=1,keywordFlags=0,name="CritMultiplier",type="INC",value=20}},nil} c["20% increased Critical Damage Bonus if you haven't dealt a Critical Hit Recently"]={{[1]={[1]={neg=true,type="Condition",var="CritRecently"},flags=0,keywordFlags=0,name="CritMultiplier",type="INC",value=20}},nil} @@ -1807,7 +1804,7 @@ c["20% increased Magnitude of Impales inflicted with Spells 20% increased Physic c["20% increased Magnitude of Non-Damaging Ailments you inflict with Critical Hits"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=20},[2]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=20},[3]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=20}},nil} c["20% increased Magnitude of Poison you inflict"]={{[1]={flags=0,keywordFlags=2097152,name="AilmentMagnitude",type="INC",value=20}},nil} c["20% increased Magnitude of Shock you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=20}},nil} -c["20% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=20}}," Efficiency "} +c["20% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=20}},nil} c["20% increased Mana Flask Charges gained"]={{[1]={flags=0,keywordFlags=0,name="ManaFlaskChargesGained",type="INC",value=20}},nil} c["20% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=20}},nil} c["20% increased Melee Critical Hit Chance"]={{[1]={flags=256,keywordFlags=0,name="CritChance",type="INC",value=20}},nil} @@ -2076,7 +2073,7 @@ c["25% increased Magnitude of Bleeding you inflict"]={{[1]={flags=0,keywordFlags c["25% increased Magnitude of Chill you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=25}},nil} c["25% increased Magnitude of Poison you inflict"]={{[1]={flags=0,keywordFlags=2097152,name="AilmentMagnitude",type="INC",value=25}},nil} c["25% increased Magnitude of Shock you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=25}},nil} -c["25% increased Mana Cost Efficiency while on Low Mana"]={{[1]={[1]={type="Condition",var="LowMana"},flags=0,keywordFlags=0,name="ManaCost",type="INC",value=25}}," Efficiency "} +c["25% increased Mana Cost Efficiency while on Low Mana"]={{[1]={[1]={type="Condition",var="LowMana"},flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=25}},nil} c["25% increased Mana Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name="FlaskManaRecovery",type="INC",value=25}},nil} c["25% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=25}},nil} c["25% increased Mana Regeneration Rate if you have Shocked an Enemy Recently"]={{[1]={[1]={type="Condition",var="ShockedEnemyRecently"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=25}},nil} @@ -2310,7 +2307,8 @@ c["30% increased Magnitude of Non-Damaging Ailments you inflict"]={{[1]={flags=0 c["30% increased Magnitude of Non-Damaging Ailments you inflict with Critical Hits"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=30},[2]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=30},[3]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=30}},nil} c["30% increased Magnitude of Poison you inflict"]={{[1]={flags=0,keywordFlags=2097152,name="AilmentMagnitude",type="INC",value=30}},nil} c["30% increased Magnitude of Shock you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=30}},nil} -c["30% increased Mana Cost Efficiency of Attacks during any Mana Flask Effect"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=30}}," Efficiency of Attacks during any Mana Flask Effect "} +c["30% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=30}},nil} +c["30% increased Mana Cost Efficiency of Attacks during any Mana Flask Effect"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=30}}," of Attacks during any Mana Flask Effect "} c["30% increased Mana Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name="FlaskManaRecovery",type="INC",value=30}},nil} c["30% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=30}},nil} c["30% increased Mana Regeneration Rate while moving"]={{[1]={[1]={type="Condition",var="Moving"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=30}},nil} @@ -2574,7 +2572,7 @@ c["40% increased Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="Lightnin c["40% increased Lightning Damage while affected by Herald of Thunder"]={{[1]={[1]={type="Condition",var="AffectedByHeraldofThunder"},flags=0,keywordFlags=0,name="LightningDamage",type="INC",value=40}},nil} c["40% increased Magnitude of Bleeding you inflict against Pinned Enemies"]={{[1]={flags=0,keywordFlags=4194304,name="AilmentMagnitude",type="INC",value=40}}," against Pinned Enemies "} c["40% increased Magnitude of Shock you inflict with Critical Hits"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=40}},nil} -c["40% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=40}}," Efficiency "} +c["40% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=40}},nil} c["40% increased Mana Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name="FlaskManaRecovery",type="INC",value=40}},nil} c["40% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=40}},nil} c["40% increased Mana Regeneration Rate while stationary"]={{[1]={[1]={type="Condition",var="Stationary"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=40}},nil} @@ -2954,8 +2952,8 @@ c["60% increased Freeze Threshold"]={{[1]={flags=0,keywordFlags=0,name="FreezeTh c["60% increased Ice Crystal Life"]={{[1]={flags=0,keywordFlags=0,name="IceCrystalLife",type="INC",value=60}},nil} c["60% increased Magnitude of Abyssal Wasting you inflict"]={{}," Magnitude of Abyssal Wasting you inflict "} c["60% increased Magnitude of Abyssal Wasting you inflict Abyssal Wasting you inflict has Infinite Duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=60}}," Magnitude of Abyssal Wasting you inflict Abyssal Wasting you inflict has Infinite "} -c["60% increased Mana Cost Efficiency of Marks"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=60}}," Efficiency of Marks "} -c["60% increased Mana Cost Efficiency of Marks 4% increased Movement Speed if you've used a Mark Recently"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=60}}," Efficiency of Marks 4% increased Movement Speed if you've used a Mark Recently "} +c["60% increased Mana Cost Efficiency of Marks"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=60}}," of Marks "} +c["60% increased Mana Cost Efficiency of Marks 4% increased Movement Speed if you've used a Mark Recently"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=60}}," of Marks 4% increased Movement Speed if you've used a Mark Recently "} c["60% increased Mana Regeneration Rate while Surrounded"]={{[1]={[1]={type="Condition",var="Surrounded"},flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=60}},nil} c["60% increased Melee Damage if you've dealt a Projectile Attack Hit in the past eight seconds"]={{[1]={[1]={type="Condition",var="HitProjectileRecently"},flags=256,keywordFlags=0,name="Damage",type="INC",value=60}},nil} c["60% increased Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamage",type="INC",value=60}},nil} @@ -3073,7 +3071,7 @@ c["8% increased Ignite Magnitude"]={{[1]={flags=0,keywordFlags=8388608,name="Ail c["8% increased Immobilisation buildup"]={{}," Immobilisation buildup "} c["8% increased Knockback Distance"]={{[1]={flags=0,keywordFlags=0,name="EnemyKnockbackDistance",type="INC",value=8}},nil} c["8% increased Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningDamage",type="INC",value=8}},nil} -c["8% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=8}}," Efficiency "} +c["8% increased Mana Cost Efficiency"]={{[1]={flags=0,keywordFlags=0,name="ManaCostEfficiency",type="INC",value=8}},nil} c["8% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=8}},nil} c["8% increased Melee Attack Speed"]={{[1]={flags=257,keywordFlags=0,name="Speed",type="INC",value=8}},nil} c["8% increased Melee Damage"]={{[1]={flags=256,keywordFlags=0,name="Damage",type="INC",value=8}},nil} diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index d7a745415f..f3fa258802 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -1903,12 +1903,13 @@ function calcs.offence(env, actor, activeSkill) local moreType = 1 local moreCost = 1 local inc = 0 + local costEfficiency = calcLib.mod(skillModList, skillCfg, val.type.."CostEfficiency", "CostEfficiency") if not val.unaffectedByGenericCostMults then output[costName] = val.finalBaseCost moreType = skillModList:More(skillCfg, val.type.."Cost") moreCost = skillModList:More(skillCfg, "Cost") inc = skillModList:Sum("INC", skillCfg, val.type.."Cost", "Cost") - output[costNameRaw] = val.baseCostRaw and m_max(0, m_max(0, (1 + inc / 100) * val.baseCostRaw * moreType * moreCost) + val.totalCost) + output[costNameRaw] = val.baseCostRaw and m_max(0, m_max(0, (1 + inc / 100) * val.baseCostRaw * moreType * moreCost / costEfficiency) + val.totalCost) if inc < 0 then output[costName] = m_max(0, m_ceil((1 + inc / 100) * output[costName])) else @@ -1924,6 +1925,8 @@ function calcs.offence(env, actor, activeSkill) else output[costName] = m_max(0, m_floor(moreCost * output[costName])) end + -- Apply cost efficiency (similar to reservation efficiency) + output[costName] = m_max(0, output[costName] / costEfficiency) output[costName] = m_max(0, output[costName] + val.totalCost) if val.type == "Mana" and hybridLifeCost > 0 then -- Life/Mana Mastery output[costName] = m_max(0, m_floor((1 - hybridLifeCost) * output[costName])) @@ -1935,8 +1938,10 @@ function calcs.offence(env, actor, activeSkill) output[costName] = m_floor(val.baseCost + val.baseCostNoMult) output[costName] = m_max(0, (1 + inc / 100) * output[costName]) output[costName] = m_max(0, moreType * output[costName]) + -- Apply cost efficiency for unaffected costs too + output[costName] = m_max(0, output[costName] / costEfficiency) output[costName] = m_max(0, output[costName] + val.totalCost) - output[costNameRaw] = val.baseCostRaw and m_max(0, m_max(0, (1 + inc / 100) * (val.baseCostRaw + val.baseCostNoMult) * moreType) + val.totalCost) + output[costNameRaw] = val.baseCostRaw and m_max(0, m_max(0, (1 + inc / 100) * (val.baseCostRaw + val.baseCostNoMult) * moreType / costEfficiency) + val.totalCost) end if breakdown and hasCost then breakdown[costName] = { @@ -1963,6 +1968,9 @@ function calcs.offence(env, actor, activeSkill) if moreType ~= 1 then t_insert(breakdown[costName], s_format("x %.2f ^8(more/less "..val.text.." cost)", moreType)) end + if costEfficiency ~= 1 then + t_insert(breakdown[costName], s_format("/ %.2f ^8("..val.text.." cost efficiency)", costEfficiency)) + end if val.totalCost ~= 0 then t_insert(breakdown[costName], s_format("%+d ^8(total "..val.text.." cost)", val.totalCost)) end diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 70353de369..7c5a6ec59a 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -181,6 +181,23 @@ local modNameList = { ["cost of skills"] = "Cost", ["cost of attacks"] = { "Cost", tag = { type = "SkillType", skillType = SkillType.Attack } }, ["cost of retaliation skills"] = { "Cost", tag = { type = "SkillType", skillType = SkillType.Retaliation } }, + -- Cost efficiency + ["cost efficiency"] = "CostEfficiency", + ["cost efficiency of skills"] = "CostEfficiency", + ["mana cost efficiency"] = "ManaCostEfficiency", + ["mana cost efficiency of skills"] = "ManaCostEfficiency", + ["life cost efficiency"] = "LifeCostEfficiency", + ["life cost efficiency of skills"] = "LifeCostEfficiency", + ["spirit cost efficiency"] = "SpiritCostEfficiency", + ["spirit cost efficiency of skills"] = "SpiritCostEfficiency", + ["energy shield cost efficiency"] = "ESCostEfficiency", + ["energy shield cost efficiency of skills"] = "ESCostEfficiency", + ["es cost efficiency"] = "ESCostEfficiency", + ["es cost efficiency of skills"] = "ESCostEfficiency", + ["soul cost efficiency"] = "SoulCostEfficiency", + ["soul cost efficiency of skills"] = "SoulCostEfficiency", + ["rage cost efficiency"] = "RageCostEfficiency", + ["rage cost efficiency of skills"] = "RageCostEfficiency", ["mana reserved"] = "ManaReserved", ["mana reservation"] = "ManaReserved", ["mana reservation of skills"] = { "ManaReserved", tag = { type = "SkillType", skillType = SkillType.Aura } },