Skip to content

Commit dd4f884

Browse files
PeecheyLocalIdentity
andauthored
Add support for additional Warcry Empowers (#2071)
* add support for extra empowers add breakdown for # of empowered attacks * Fix flooring average empowers Also removes the condition check as it meant that infernal cry damage would only apply if you ticked the config box --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 4262cee commit dd4f884

7 files changed

Lines changed: 36 additions & 10 deletions

File tree

spec/System/TestSkills_spec.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,25 @@ describe("TestSkills", function()
989989
assert.are.equal(3, build.calcsTab.calcsOutput.StrikeTargets)
990990
end)
991991

992+
it("Test chance to empower additional attacks contributes to average count", function()
993+
build.itemsTab:CreateDisplayItemFromRaw([[
994+
New Item
995+
Wrapped Quarterstaff
996+
Quality: 0
997+
]])
998+
build.itemsTab:AddDisplayItem()
999+
runCallback("OnFrame")
1000+
1001+
build.skillsTab:PasteSocketGroup("Quarterstaff Strike 20/0 1")
1002+
build.skillsTab:PasteSocketGroup("Infernal Cry 20/0 1")
1003+
build.configTab.input.multiplierWarcryPower = 20
1004+
build.configTab.input.customMods = "Warcries have 15% chance to Empower 3 additional Attacks"
1005+
build.configTab:BuildModList()
1006+
runCallback("OnFrame")
1007+
1008+
assert.are.equals(2.45, round(build.calcsTab.calcsOutput.InfernalEmpoweredCount, 2))
1009+
end)
1010+
9921011
it("Test Combined Ancestral Boosts - Ancestral Empowerment and Fist of War", function()
9931012
build.itemsTab:CreateDisplayItemFromRaw([[
9941013
New Item

src/Data/ModCache.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6458,10 +6458,10 @@ c["Vivid Stags leap towards enemies Central Projectile of Owl Feather-Empowered
64586458
c["Volatile Power also grants 1% increased Critical Hit chance per Volatility exploded"]={nil,"Volatile Power also grants 1% increased Critical Hit chance per Volatility exploded "}
64596459
c["Walk the Paths Not Taken"]={{},nil}
64606460
c["Warcries Debilitate Enemies"]={{[1]={flags=0,keywordFlags=0,name="DebilitateChance",type="BASE",value=100}},nil}
6461-
c["Warcries Empower an additional Attack"]={nil,"Warcries Empower an additional Attack "}
6461+
c["Warcries Empower an additional Attack"]={{[1]={flags=0,keywordFlags=0,name="ExtraEmpoweredAttacks",type="BASE",value=1}},nil}
64626462
c["Warcries Explode Corpses dealing 10% of their Life as Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="ExplodeMod",type="LIST",value={amount=10,keyOfScaledMod="value",type="Physical",value=100}},[2]={flags=0,keywordFlags=0,name="CanExplode",type="FLAG",value=true}},nil}
64636463
c["Warcries Explode Corpses dealing 25% of their Life as Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="ExplodeMod",type="LIST",value={amount=25,keyOfScaledMod="value",type="Physical",value=100}},[2]={flags=0,keywordFlags=0,name="CanExplode",type="FLAG",value=true}},nil}
6464-
c["Warcries have 15% chance to Empower 3 additional Attacks"]={nil,"Warcries have 15% chance to Empower 3 additional Attacks "}
6464+
c["Warcries have 15% chance to Empower 3 additional Attacks"]={{[1]={flags=0,keywordFlags=0,name="ExtraEmpoweredAttacks",type="BASE",value=0.45}},nil}
64656465
c["Warcries have a minimum of 10 Power"]={{[1]={flags=0,keywordFlags=0,name="MinimumWarcryPower",type="BASE",value=10}},nil}
64666466
c["Warcries inflict 3 Critical Weakness on Enemies"]={nil,"Warcries inflict 3 Critical Weakness on Enemies "}
64676467
c["Warcry Skills have 25% increased Area of Effect"]={{[1]={[1]={skillType=63,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=25}},nil}

src/Data/SkillStatMap.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@ return {
28642864
flag("Condition:CanGainRage", { type = "GlobalEffect", effectType = "Buff", effectName = "Rage" } ),
28652865
},
28662866
["warcry_count_power_from_enemies"] = {
2867-
flag("UsesWarcryPower", { type = "GlobalEffect", effectType = "Buff" })
2867+
flag("UsesWarcryPower", { type = "GlobalEffect", effectType = "Warcry" })
28682868
},
28692869
["chance_to_gain_1_more_charge_%"] = {
28702870
mod("AdditionalChargeChance", "BASE", nil)

src/Modules/CalcOffence.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,9 +3203,7 @@ function calcs.offence(env, actor, activeSkill)
32033203
globalOutput.InfernalCryDuration = calcSkillDuration(value.skillModList, value.skillCfg, value.skillData, env, enemyDB)
32043204
globalOutput.InfernalCryCooldown = calcSkillCooldown(value.skillModList, value.skillCfg, value.skillData)
32053205
globalOutput.InfernalCryCastTime = calcWarcryCastTime(value.skillModList, value.skillCfg, value.skillData, actor)
3206-
local powerCap = value.skillModList:Sum("BASE", nil, "WarcryPowerCap")
3207-
local powerPer = value.skillModList:Sum("BASE", nil, "WarcryPowerPer")
3208-
globalOutput.InfernalEmpoweredCount = powerPer > 0 and m_floor(m_min(warcryPower, powerCap) / powerPer) or 0
3206+
globalOutput.InfernalEmpoweredCount = env.modDB:Sum("BASE", nil, "NumInfernalEmpowers") or 0
32093207
local baseUptimeRatio = m_min((globalOutput.InfernalEmpoweredCount / globalOutput.Speed) / (globalOutput.InfernalCryCooldown + globalOutput.InfernalCryCastTime), 1) * 100
32103208
local storedUses = value.skillData.storedUses or 0 + value.skillModList:Sum("BASE", value.skillCfg, "AdditionalCooldownUses")
32113209
globalOutput.InfernalCryUptimeRatio = m_min(100, baseUptimeRatio * storedUses)

src/Modules/CalcPerform.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,11 +2003,19 @@ function calcs.perform(env, skipEHP)
20032003
if baseEmpowers > 0 then
20042004
local extraEmpowers = modStore:Sum("BASE", nil, "ExtraEmpoweredAttacks") or 0
20052005
local EmpowerMultiplier = modStore:More(nil, "ExtraEmpoweredAttacks")
2006-
env.player.modDB:NewMod("Num"..warcryName.."Empowers", "BASE", m_floor((baseEmpowers + extraEmpowers) * EmpowerMultiplier))
2006+
local totalEmpowers = (baseEmpowers + extraEmpowers) * EmpowerMultiplier
2007+
env.player.modDB:NewMod("Num"..warcryName.."Empowers", "BASE", totalEmpowers)
20072008
if not warcryList[buff.name] then
20082009
env.player.modDB:NewMod("Multiplier:EmpoweringWarcryCount", "BASE", 1, buff.name)
20092010
warcryList[buff.name] = true
20102011
end
2012+
if breakdown then
2013+
breakdown[warcryName.."EmpoweringWarcryCount"] = {
2014+
s_format("(%d / %d) ^8(Power / per = base)", m_min(warcryPower, powerCap), powerPer),
2015+
s_format("= ((%.2f + %.2f) x %.2f) ^8((base + extra) x more)", baseEmpowers, extraEmpowers, EmpowerMultiplier),
2016+
s_format("= %.2f", totalEmpowers),
2017+
}
2018+
end
20112019
end
20122020
if not activeSkill.skillModList:Flag(nil, "CannotShareWarcryBuffs") then
20132021
for _, warcryBuff in ipairs(buff.modList) do

src/Modules/CalcSections.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ return {
391391
{ format = "" },
392392
{ format = "" },
393393
{ format = "{0:output:InfernalCryUptimeRatio}%", { breakdown = "InfernalCryUptimeRatio" }, },
394-
{ format = "{0:output:InfernalEmpoweredCount}" },
394+
{ format = "{2:output:InfernalEmpoweredCount}" , { breakdown = "InfernalEmpoweringWarcryCount" },},
395395
{ format = "" },
396396
},
397397
{ label = "Battlemage's Cry", haveOutput = "BattlemageUpTimeRatio",

src/Modules/ModParser.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5537,8 +5537,9 @@ local specialModList = {
55375537
["%+(%d+) to accuracy against bleeding enemies"] = function(num) return { mod("AccuracyVsEnemy", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Bleeding" } ) } end,
55385538
["cannot recover energy shield to above armour"] = { flag("ArmourESRecoveryCap") },
55395539
["cannot recover energy shield to above evasion rating"] = { flag("EvasionESRecoveryCap") },
5540-
["warcries exert (%d+) additional attacks?"] = function(num) return { mod("ExtraExertedAttacks", "BASE", num) } end,
5541-
["warcries have (%d+)%% chance to exert (%d+) additional attacks?"] = function(num, _, var) return { mod("ExtraExertedAttacks", "BASE", (num*var/100)) } end,
5540+
["warcries empower (%d+) additional attacks?"] = function(num) return { mod("ExtraEmpoweredAttacks", "BASE", num) } end,
5541+
["warcries empower an additional attack"] = function(num) return { mod("ExtraEmpoweredAttacks", "BASE", 1) } end,
5542+
["warcries have (%d+)%% chance to empower (%d+) additional attacks?"] = function(num, _, var) return { mod("ExtraEmpoweredAttacks", "BASE", (num*var/100)) } end,
55425543
["skills deal (%d+)%% more damage for each warcry exerting them"] = function(num) return { mod("EchoesExertAverageIncrease", "MORE", num, nil) } end,
55435544
["iron reflexes while stationary"] = { mod("Keystone", "LIST", "Iron Reflexes", { type = "Condition", var = "Stationary" }) },
55445545
["you have iron reflexes while at maximum frenzy charges"] = { mod("Keystone", "LIST", "Iron Reflexes", { type = "StatThreshold", stat = "FrenzyCharges", thresholdStat = "FrenzyChargesMax" }) },

0 commit comments

Comments
 (0)