Skip to content

Commit d4949f1

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Overexertion and Echoes of Creation counting non-exerting Warcries (#8027)
* Fix Overexertion and Echoes of Creation including non-exerting Warcries The code was counting the total number of active Warcries instead of the total number of Exerting Warcries This PR also removed some redundant code that was used for old Call to Arms shared Warcry cooldowns Also cleans up some unneeded use of globals * Fix Overexertion variable name --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 31844ad commit d4949f1

File tree

3 files changed

+8
-57
lines changed

3 files changed

+8
-57
lines changed

src/Modules/CalcOffence.lua

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@ function calcs.offence(env, actor, activeSkill)
23182318

23192319
-- Exerted Attack members
23202320
local exertedDoubleDamage = env.modDB:Sum("BASE", cfg, "ExertDoubleDamageChance")
2321+
local exertingWarcryCount = env.modDB:Sum("BASE", nil, "ExertingWarcryCount")
23212322
globalOutput.OffensiveWarcryEffect = 1
23222323
globalOutput.MaxOffensiveWarcryEffect = 1
23232324
globalOutput.TheoreticalOffensiveWarcryEffect = 1
@@ -2333,11 +2334,6 @@ function calcs.offence(env, actor, activeSkill)
23332334
if value.activeEffect.grantedEffect.name == "Ancestral Cry" and activeSkill.skillTypes[SkillType.MeleeSingleTarget] and not globalOutput.AncestralCryCalculated then
23342335
globalOutput.AncestralCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
23352336
globalOutput.AncestralCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2336-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2337-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2338-
if modDB:Flag(nil, "WarcryShareCooldown") then
2339-
globalOutput.AncestralCryCooldown = globalOutput.AncestralCryCooldown + (output.GlobalWarcryCooldown - globalOutput.AncestralCryCooldown) / output.GlobalWarcryCount
2340-
end
23412337
globalOutput.AncestralCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
23422338
globalOutput.AncestralExertsCount = env.modDB:Sum("BASE", nil, "NumAncestralExerts") or 0
23432339
local baseUptimeRatio = m_min((globalOutput.AncestralExertsCount / output.Speed) / (globalOutput.AncestralCryCooldown + globalOutput.AncestralCryCastTime), 1) * 100
@@ -2360,11 +2356,6 @@ function calcs.offence(env, actor, activeSkill)
23602356
elseif value.activeEffect.grantedEffect.name == "Infernal Cry" and not globalOutput.InfernalCryCalculated then
23612357
globalOutput.InfernalCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
23622358
globalOutput.InfernalCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2363-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2364-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2365-
if modDB:Flag(nil, "WarcryShareCooldown") then
2366-
globalOutput.InfernalCryCooldown = globalOutput.InfernalCryCooldown + (output.GlobalWarcryCooldown - globalOutput.InfernalCryCooldown) / output.GlobalWarcryCount
2367-
end
23682359
globalOutput.InfernalCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
23692360
if activeSkill.skillTypes[SkillType.Melee] then
23702361
globalOutput.InfernalExertsCount = env.modDB:Sum("BASE", nil, "NumInfernalExerts") or 0
@@ -2390,11 +2381,6 @@ function calcs.offence(env, actor, activeSkill)
23902381
globalOutput.CreateWarcryOffensiveCalcSection = true
23912382
globalOutput.IntimidatingCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
23922383
globalOutput.IntimidatingCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2393-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2394-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2395-
if modDB:Flag(nil, "WarcryShareCooldown") then
2396-
globalOutput.IntimidatingCryCooldown = globalOutput.IntimidatingCryCooldown + (output.GlobalWarcryCooldown - globalOutput.IntimidatingCryCooldown) / output.GlobalWarcryCount
2397-
end
23982384
globalOutput.IntimidatingCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
23992385
globalOutput.IntimidatingExertsCount = env.modDB:Sum("BASE", nil, "NumIntimidatingExerts") or 0
24002386
local baseUptimeRatio = m_min((globalOutput.IntimidatingExertsCount / output.Speed) / (globalOutput.IntimidatingCryCooldown + globalOutput.IntimidatingCryCastTime), 1) * 100
@@ -2440,11 +2426,6 @@ function calcs.offence(env, actor, activeSkill)
24402426
globalOutput.CreateWarcryOffensiveCalcSection = true
24412427
globalOutput.RallyingCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
24422428
globalOutput.RallyingCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2443-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2444-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2445-
if modDB:Flag(nil, "WarcryShareCooldown") then
2446-
globalOutput.RallyingCryCooldown = globalOutput.RallyingCryCooldown + (output.GlobalWarcryCooldown - globalOutput.RallyingCryCooldown) / output.GlobalWarcryCount
2447-
end
24482429
globalOutput.RallyingCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
24492430
globalOutput.RallyingExertsCount = env.modDB:Sum("BASE", nil, "NumRallyingExerts") or 0
24502431
local baseUptimeRatio = m_min((globalOutput.RallyingExertsCount / output.Speed) / (globalOutput.RallyingCryCooldown + globalOutput.RallyingCryCastTime), 1) * 100
@@ -2491,11 +2472,6 @@ function calcs.offence(env, actor, activeSkill)
24912472
globalOutput.CreateWarcryOffensiveCalcSection = true
24922473
globalOutput.SeismicCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
24932474
globalOutput.SeismicCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2494-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2495-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2496-
if modDB:Flag(nil, "WarcryShareCooldown") then
2497-
globalOutput.SeismicCryCooldown = globalOutput.SeismicCryCooldown + (output.GlobalWarcryCooldown - globalOutput.SeismicCryCooldown) / output.GlobalWarcryCount
2498-
end
24992475
globalOutput.SeismicCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
25002476
globalOutput.SeismicExertsCount = env.modDB:Sum("BASE", nil, "NumSeismicExerts") or 0
25012477
local baseUptimeRatio = m_min((globalOutput.SeismicExertsCount / output.Speed) / (globalOutput.SeismicCryCooldown + globalOutput.SeismicCryCastTime), 1) * 100
@@ -2525,11 +2501,6 @@ function calcs.offence(env, actor, activeSkill)
25252501
elseif value.activeEffect.grantedEffect.name == "Battlemage's Cry" and not globalOutput.BattleMageCryCalculated then
25262502
globalOutput.BattleMageCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
25272503
globalOutput.BattleMageCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
2528-
output.GlobalWarcryCooldown = env.modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
2529-
output.GlobalWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
2530-
if modDB:Flag(nil, "WarcryShareCooldown") then
2531-
globalOutput.BattleMageCryCooldown = globalOutput.BattleMageCryCooldown + (output.GlobalWarcryCooldown - globalOutput.BattleMageCryCooldown) / output.GlobalWarcryCount
2532-
end
25332504
globalOutput.BattleMageCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
25342505
if activeSkill.skillTypes[SkillType.Melee] then
25352506
globalOutput.BattleCryExertsCount = env.modDB:Sum("BASE", nil, "NumBattlemageExerts") or 0
@@ -2570,7 +2541,6 @@ function calcs.offence(env, actor, activeSkill)
25702541
for _, cryTimeRatio in ipairs(warcryList) do
25712542
globalOutput.ExertedAttackUptimeRatio = m_max(globalOutput.ExertedAttackUptimeRatio or 0, globalOutput[cryTimeRatio] or 0)
25722543
end
2573-
local warcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
25742544
if globalBreakdown then
25752545
globalBreakdown.ExertedAttackUptimeRatio = { }
25762546
t_insert(globalBreakdown.ExertedAttackUptimeRatio, s_format("Maximum of:"))
@@ -2585,19 +2555,19 @@ function calcs.offence(env, actor, activeSkill)
25852555
local incExertedAttacks = skillModList:Sum("INC", cfg, "ExertIncrease")
25862556
local moreExertedAttacks = skillModList:Sum("MORE", cfg, "ExertIncrease")
25872557
local moreExertedAttackDamage = skillModList:Sum("MORE", cfg, "ExertAttackIncrease")
2588-
local autoExertionExertedDamage = skillModList:Sum("MORE", cfg, "OverexertionExertAverageIncrease")
2558+
local overexertionExertedDamage = skillModList:Sum("MORE", cfg, "OverexertionExertAverageIncrease")
25892559
local echoesOfCreationExertedDamage = skillModList:Sum("MORE", cfg, "EchoesExertAverageIncrease")
25902560
if activeSkill.skillModList:Flag(nil, "Condition:WarcryMaxHit") then
25912561
skillModList:NewMod("Damage", "INC", incExertedAttacks, "Exerted Attacks")
25922562
skillModList:NewMod("Damage", "MORE", moreExertedAttacks, "Exerted Attacks")
25932563
skillModList:NewMod("Damage", "MORE", moreExertedAttackDamage, "Exerted Attack Damage", ModFlag.Attack)
2594-
skillModList:NewMod("Damage", "MORE", autoExertionExertedDamage * warcryCount, "Max Autoexertion Support")
2595-
skillModList:NewMod("Damage", "MORE", echoesOfCreationExertedDamage * warcryCount, "Max Echoes of Creation")
2564+
skillModList:NewMod("Damage", "MORE", overexertionExertedDamage * exertingWarcryCount, "Max Autoexertion Support")
2565+
skillModList:NewMod("Damage", "MORE", echoesOfCreationExertedDamage * exertingWarcryCount, "Max Echoes of Creation")
25962566
else
25972567
skillModList:NewMod("Damage", "INC", incExertedAttacks * globalOutput.ExertedAttackUptimeRatio / 100, "Uptime Scaled Exerted Attacks")
25982568
skillModList:NewMod("Damage", "MORE", moreExertedAttacks * globalOutput.ExertedAttackUptimeRatio / 100, "Uptime Scaled Exerted Attacks")
25992569
skillModList:NewMod("Damage", "MORE", moreExertedAttackDamage * globalOutput.ExertedAttackUptimeRatio / 100, "Uptime Scaled Exerted Attack Damage", ModFlag.Attack)
2600-
skillModList:NewMod("Damage", "MORE", autoExertionExertedDamage * globalOutput.GlobalWarcryUptimeRatio / 100, "Uptime Scaled Autoexertion Support")
2570+
skillModList:NewMod("Damage", "MORE", overexertionExertedDamage * globalOutput.GlobalWarcryUptimeRatio / 100, "Uptime Scaled Autoexertion Support")
26012571
skillModList:NewMod("Damage", "MORE", echoesOfCreationExertedDamage * globalOutput.GlobalWarcryUptimeRatio / 100, "Uptime Scaled Echoes of Creation")
26022572
end
26032573
globalOutput.ExertedAttackAvgDmg = calcLib.mod(skillModList, skillCfg, "ExertIncrease")
@@ -5358,7 +5328,7 @@ function calcs.offence(env, actor, activeSkill)
53585328
end
53595329
local averageWarcryCount = output.GlobalWarcryUptimeRatio / 100
53605330
if activeSkill.skillModList:Flag(nil, "Condition:WarcryMaxHit") then
5361-
averageWarcryCount = env.modDB:Sum("BASE", nil, "GlobalWarcryCount")
5331+
averageWarcryCount = env.modDB:Sum("BASE", nil, "ExertingWarcryCount")
53625332
end
53635333
if averageWarcryCount and dmgType and dmgMult then
53645334
local dmgBreakdown, totalDmgTaken = calcs.applyDmgTakenConversion(activeSkill, output, breakdown, dmgType, (output.Life or 0) * dmgMult/100 * averageWarcryCount)

src/Modules/CalcPerform.lua

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,23 +1125,6 @@ function calcs.perform(env, skipEHP)
11251125
hasGuaranteedBonechill = true
11261126
end
11271127
end
1128-
if activeSkill.skillFlags.warcry and not modDB:Flag(nil, "AlreadyGlobalWarcryCooldown") then
1129-
local cooldown = calcSkillCooldown(activeSkill.skillModList, activeSkill.skillCfg, activeSkill.skillData)
1130-
local warcryList = { }
1131-
local numWarcries, sumWarcryCooldown = 0
1132-
for _, activeSkill in ipairs(env.player.activeSkillList) do
1133-
if activeSkill.skillTypes[SkillType.Warcry] then
1134-
warcryList[activeSkill.skillCfg.skillName] = true
1135-
end
1136-
end
1137-
for _, warcry in pairs(warcryList) do
1138-
numWarcries = numWarcries + 1
1139-
sumWarcryCooldown = (sumWarcryCooldown or 0) + cooldown
1140-
end
1141-
env.player.modDB:NewMod("GlobalWarcryCooldown", "BASE", sumWarcryCooldown)
1142-
env.player.modDB:NewMod("GlobalWarcryCount", "BASE", numWarcries)
1143-
modDB:NewMod("AlreadyGlobalWarcryCooldown", "FLAG", true, "Config") -- Prevents effect from applying multiple times
1144-
end
11451128
if activeSkill.minion and activeSkill.minion.minionData and activeSkill.minion.minionData.limit then
11461129
local limit = activeSkill.skillModList:Sum("BASE", nil, activeSkill.minion.minionData.limit)
11471130
output[activeSkill.minion.minionData.limit] = m_max(limit, output[activeSkill.minion.minionData.limit] or 0)
@@ -1885,13 +1868,12 @@ function calcs.perform(env, skipEHP)
18851868
local extraExertions = modStore:Sum("BASE", nil, "ExtraExertedAttacks") or 0
18861869
local exertMultiplier = modStore:More(nil, "ExtraExertedAttacks")
18871870
env.player.modDB:NewMod("Num"..warcryName.."Exerts", "BASE", m_floor((baseExerts + extraExertions) * exertMultiplier))
1871+
env.player.modDB:NewMod("ExertingWarcryCount", "BASE", 1)
18881872
end
18891873
local full_duration = calcSkillDuration(modStore, skillCfg, activeSkill.skillData, env, enemyDB)
18901874
local cooldownOverride = modStore:Override(skillCfg, "CooldownRecovery")
18911875
local actual_cooldown = cooldownOverride or (activeSkill.skillData.cooldown + modStore:Sum("BASE", skillCfg, "CooldownRecovery")) / calcLib.mod(modStore, skillCfg, "CooldownRecovery")
1892-
local globalCooldown = modDB:Sum("BASE", nil, "GlobalWarcryCooldown")
1893-
local globalCount = modDB:Sum("BASE", nil, "GlobalWarcryCount")
1894-
local uptime = modDB:Flag(nil, "Condition:WarcryMaxHit") and 1 or modDB:Flag(nil, "WarcryShareCooldown") and m_min(full_duration / (actual_cooldown + (globalCooldown - actual_cooldown) / globalCount), 1) or m_min(full_duration / actual_cooldown, 1)
1876+
local uptime = modDB:Flag(nil, "Condition:WarcryMaxHit") and 1 or m_min(full_duration / actual_cooldown, 1)
18951877
if not activeSkill.skillModList:Flag(nil, "CannotShareWarcryBuffs") then
18961878
if not modDB:Flag(nil, "CannotGainWarcryBuffs") then
18971879
if not buff.applyNotPlayer then

src/Modules/ModParser.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3595,7 +3595,6 @@ local specialModList = {
35953595
mod("Multiplier:WarcryNearbyEnemies", "BASE", num),
35963596
} end,
35973597
["enemies taunted by your warcries take (%d+)%% increased damage"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num, { type = "Condition", var = "Taunted" }) }, { type = "Condition", var = "UsedWarcryRecently" }) } end,
3598-
["warcries share their cooldown"] = { flag("WarcryShareCooldown") },
35993598
["warcries have minimum of (%d+) power"] = { flag("CryWolfMinimumPower") },
36003599
["warcries have infinite power"] = { flag("WarcryInfinitePower") },
36013600
["your warcries do not grant buffs or charges to you"] = { flag("CannotGainWarcryBuffs") },

0 commit comments

Comments
 (0)