Skip to content

Commit 7787b72

Browse files
authored
Add support for Shaper of Winter/Call of the Void damage taken mod (#8649)
* add support for 3.26 shaper of winter * add unit tests for enemy damage lessened by chill effect
1 parent b2b3749 commit 7787b72

4 files changed

Lines changed: 59 additions & 1 deletion

File tree

spec/System/TestDefence_spec.lua

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,60 @@ describe("TestDefence", function()
495495

496496
end)
497497

498+
describe("enemy damage lessened by half of chill effect", function ()
499+
it("enemy damage lessened by half of chill effect if the corresponding conditions are fulfilled", function()
500+
build.configTab.input.enemyIsBoss = "None"
501+
build.configTab.input.conditionEnemyChilled = true
502+
-- default max chill effect
503+
build.configTab.input.conditionEnemyChilledEffect = 30
504+
build.configTab.input.customMods = "\z
505+
enemies chilled by your hits lessen their damage dealt by half of chill effect\n\z
506+
"
507+
build.configTab:BuildModList()
508+
runCallback("OnFrame")
509+
510+
-- 15% less since it's half of current chill effect
511+
assert.are.equals(0.85, build.calcsTab.calcsOutput.PhysicalEnemyDamageMult)
512+
assert.are.equals(0.85, build.calcsTab.calcsOutput.LightningEnemyDamageMult)
513+
assert.are.equals(0.85, build.calcsTab.calcsOutput.ColdEnemyDamageMult)
514+
assert.are.equals(0.85, build.calcsTab.calcsOutput.FireEnemyDamageMult)
515+
assert.are.equals(0.85, build.calcsTab.calcsOutput.ChaosEnemyDamageMult)
516+
end)
517+
518+
it("enemy damage is not lessened if the enemy is not chilled", function()
519+
build.configTab.input.enemyIsBoss = "None"
520+
build.configTab.input.customMods = "\z
521+
enemies chilled by your hits lessen their damage dealt by half of chill effect\n\z
522+
"
523+
build.configTab:BuildModList()
524+
runCallback("OnFrame")
525+
526+
assert.are.equals(1, build.calcsTab.calcsOutput.PhysicalEnemyDamageMult)
527+
assert.are.equals(1, build.calcsTab.calcsOutput.LightningEnemyDamageMult)
528+
assert.are.equals(1, build.calcsTab.calcsOutput.ColdEnemyDamageMult)
529+
assert.are.equals(1, build.calcsTab.calcsOutput.FireEnemyDamageMult)
530+
assert.are.equals(1, build.calcsTab.calcsOutput.ChaosEnemyDamageMult)
531+
end)
532+
533+
it("lessened enemy damage respects chill cap", function()
534+
build.configTab.input.enemyIsBoss = "None"
535+
build.configTab.input.conditionEnemyChilled = true
536+
-- default max chill effect is 30%, so this shouldn't affect the resulting enemy damage multiplier beyond the cap
537+
build.configTab.input.conditionEnemyChilledEffect = 100
538+
build.configTab.input.customMods = "\z
539+
enemies chilled by your hits lessen their damage dealt by half of chill effect\n\z
540+
"
541+
build.configTab:BuildModList()
542+
runCallback("OnFrame")
543+
544+
assert.are.equals(0.85, build.calcsTab.calcsOutput.PhysicalEnemyDamageMult)
545+
assert.are.equals(0.85, build.calcsTab.calcsOutput.LightningEnemyDamageMult)
546+
assert.are.equals(0.85, build.calcsTab.calcsOutput.ColdEnemyDamageMult)
547+
assert.are.equals(0.85, build.calcsTab.calcsOutput.FireEnemyDamageMult)
548+
assert.are.equals(0.85, build.calcsTab.calcsOutput.ChaosEnemyDamageMult)
549+
end)
550+
end)
551+
498552
local function withinTenPercent(value, otherValue)
499553
local ratio = otherValue / value
500554
return 0.9 < ratio and ratio < 1.1

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7793,7 +7793,7 @@ c["Enemies Cannot Leech Mana From You 10% of Damage taken Recouped as Mana"]={ni
77937793
c["Enemies Chilled by your Hits can be Shattered as though Frozen"]={nil,"your Hits can be Shattered as though Frozen "}
77947794
c["Enemies Chilled by your Hits can be Shattered as though Frozen Enemies Chilled by your Hits lessen their Damage dealt by half of Chill Effect"]={nil,"your Hits can be Shattered as though Frozen Enemies Chilled by your Hits lessen their Damage dealt by half of Chill Effect "}
77957795
c["Enemies Chilled by your Hits have Damage taken increased by Chill Effect"]={{[1]={flags=0,keywordFlags=0,name="ChillEffectIncDamageTaken",type="FLAG",value=true}},nil}
7796-
c["Enemies Chilled by your Hits lessen their Damage dealt by half of Chill Effect"]={nil,"your Hits lessen their Damage dealt by half of Chill Effect "}
7796+
c["Enemies Chilled by your Hits lessen their Damage dealt by half of Chill Effect"]={{[1]={flags=0,keywordFlags=0,name="ChillEffectLessDamageDealt",type="FLAG",value=true}},nil}
77977797
c["Enemies Cursed by you are Hindered if 25% of Curse Duration expired"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={threshold=25,type="MultiplierThreshold",var="CurseExpired"},[2]={type="ActorCondition",var="Cursed"},flags=0,keywordFlags=0,name="Condition:Hindered",type="FLAG",value=true}}}},nil}
77987798
c["Enemies Cursed by you are Hindered with 25% reduced Movement Speed if 25% of Curse Duration expired"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={type="Condition",var="Cursed"},[2]={actor="enemy",threshold=25,type="MultiplierThreshold",var="CurseExpired"},flags=0,keywordFlags=0,name="Condition:Hindered",type="FLAG",value=true}}}},nil}
77997799
c["Enemies Cursed by you have 50% reduced Life Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={type="Condition",var="Cursed"},flags=0,keywordFlags=0,name="LifeRegen",type="INC",value=-50}}}},nil}

src/Modules/CalcPerform.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,6 +3019,9 @@ function calcs.perform(env, skipEHP)
30193019
if modDB:Flag(nil, "ChillEffectIncDamageTaken") then
30203020
t_insert(mods, modLib.createMod("DamageTaken", "INC", num, "Ahuana's Bite", { type = "Condition", var = "Chilled" }))
30213021
end
3022+
if modDB:Flag(nil, "ChillEffectLessDamageDealt") then
3023+
t_insert(mods, modLib.createMod("Damage", "MORE", -num / 2, "Shaper of Winter", { type = "Condition", var = "Chilled" }))
3024+
end
30223025
return mods
30233026
end
30243027
},

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,7 @@ local specialModList = {
25462546
flag("EnableSkill", { type = "SkillName", skillId = "Primal Aegis" }),
25472547
},
25482548
["primal aegis can take (%d+) elemental damage per allocated notable passive skill"] = function(num) return { mod("ElementalAegisValue", "MAX", num, 0, 0, { type = "Multiplier", var = "AllocatedNotable" }, { type = "GlobalEffect", effectType = "Buff", unscalable = true }) } end,
2549+
["enemies chilled by your hits lessen their damage dealt by half of chill effect"] = { flag("ChillEffectLessDamageDealt") },
25492550
-- Gladiator
25502551
["chance to block spell damage is equal to chance to block attack damage"] = { flag("SpellBlockChanceIsBlockChance") },
25512552
["maximum chance to block spell damage is equal to maximum chance to block attack damage"] = { flag("SpellBlockChanceMaxIsBlockChanceMax") },

0 commit comments

Comments
 (0)