Skip to content

Commit 4e028ed

Browse files
authored
[0.5] Add support for new Blistering Bond mods (PathOfBuildingCommunity#1953)
* Add support for 0.5 mods of Blistering Bond Add test Remove tag from old test * update calcSection * fix merge * indent
1 parent 127aa22 commit 4e028ed

5 files changed

Lines changed: 115 additions & 18 deletions

File tree

spec/System/TestItemMods_spec.lua

Lines changed: 78 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -675,23 +675,86 @@ describe("TetsItemMods", function()
675675
assert.are.equals(11, smallModList:Sum("BASE", nil, "Dex"))
676676
end)
677677

678-
it("ancestral bond", function()
678+
it("Blistering Bond with Avatar of Fire", function()
679679
build.itemsTab:CreateDisplayItemFromRaw([[
680680
Rarity: UNIQUE
681-
Hoghunt
682-
Felled Greatclub
683-
Variant: Pre 0.1.1
684-
Variant: Current
685-
Selected Variant: 2
686-
Quality: 20
687-
LevelReq: 0
688-
Implicits: 0
689-
{variant:1}{range:0.5}(100-150)% increased Physical Damage
690-
{variant:2}{range:0.5}Adds (16-20) to (23-27) Physical Damage
691-
+15% to Critical Hit Chance
692-
10% reduced Attack Speed
693-
+10 to Strength
694-
Maim on Critical Hit
681+
The Blood Thorn
682+
Wrapped Quarterstaff
683+
{variant:1}{range:0.5}Adds (3-5) to (9-11) Physical Damage
684+
{variant:2}{range:0.5}Adds (8-12) to (16-18) Physical Damage
685+
{range:0.5}+(10-15) to Strength
686+
Causes Bleeding on Hit
687+
{range:0.5}(4-5) to (8-10) Physical Thorns damage
688+
]])
689+
build.itemsTab:AddDisplayItem()
690+
runCallback("OnFrame")
691+
692+
build.configTab.input.customMods = [[
693+
75% of Damage Converted to Fire Damage
694+
Deal no Non-Fire Damage
695+
]]
696+
build.configTab:BuildModList()
697+
runCallback("OnFrame")
698+
699+
build.skillsTab:PasteSocketGroup("Quarterstaff Strike 20/0 1")
700+
runCallback("OnFrame")
701+
702+
local baseBleedPlusAvatarWithoutBlistering = build.calcsTab.mainOutput.BleedDPS
703+
assert.True(baseBleedPlusAvatarWithoutBlistering == nil) -- fire cannot bleed, deal no physical = no bleed
704+
705+
build.itemsTab:CreateDisplayItemFromRaw([[
706+
Rarity: UNIQUE
707+
0.5 Blistering Bond Test
708+
Ruby Ring
709+
LevelReq: 8
710+
Implicits: 1
711+
{tags:fire}{range:0.5}+(20-30)% to Fire Resistance
712+
{tags:life}{range:0.5}+(40-60) to maximum Life
713+
{tags:fire}{range:0.5}+(20-30)% to Fire Resistance
714+
{tags:cold}{range:0.5}-(15-10)% to Cold Resistance
715+
You take Fire Damage instead of Physical Damage from Bleeding
716+
Fire Damage also Contributes to Bleeding Magnitude
717+
Bleeding you Inflict deals Fire damage instead of Physical damage
718+
]])
719+
build.itemsTab:AddDisplayItem()
720+
runCallback("OnFrame")
721+
local baseBleed = build.calcsTab.mainOutput.BleedDPS
722+
723+
build.configTab.input.customMods = [[
724+
Adds 100 to 200 fire damage
725+
]]
726+
build.configTab:BuildModList()
727+
runCallback("OnFrame")
728+
local baseBleedPlusFire = build.calcsTab.mainOutput.BleedDPS
729+
assert.True(baseBleedPlusFire > baseBleed) -- fire can bleed, +fire = +bleed
730+
731+
build.configTab.input.customMods = [[
732+
75% of Damage Converted to Fire Damage
733+
Deal no Non-Fire Damage
734+
]]
735+
build.configTab:BuildModList()
736+
runCallback("OnFrame")
737+
local baseBleedPlusAvatar = build.calcsTab.mainOutput.BleedDPS
738+
assert.True(baseBleedPlusAvatar > 0) -- fire can bleed, deal no physical = can bleed
739+
end)
740+
741+
it("ancestral bond", function()
742+
build.itemsTab:CreateDisplayItemFromRaw([[
743+
Rarity: UNIQUE
744+
Hoghunt
745+
Felled Greatclub
746+
Variant: Pre 0.1.1
747+
Variant: Current
748+
Selected Variant: 2
749+
Quality: 20
750+
LevelReq: 0
751+
Implicits: 0
752+
{variant:1}{range:0.5}(100-150)% increased Physical Damage
753+
{variant:2}{range:0.5}Adds (16-20) to (23-27) Physical Damage
754+
+15% to Critical Hit Chance
755+
10% reduced Attack Speed
756+
+10 to Strength
757+
Maim on Critical Hit
695758
]])
696759
build.itemsTab:AddDisplayItem()
697760
runCallback("OnFrame")

spec/System/TestSkills_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ describe("TestSkills", function()
225225
assert.are.equals(70, build.calcsTab.calcsEnv.player.activeSkillList[1].skillModList:GetMultiplier("ConsumedFrenzyChargeEffect", build.calcsTab.calcsEnv.player.activeSkillList[1].skillCfg))
226226
end)
227227

228-
it("Test 'every rage also grants you' for minion mods and minion apply to you mods #run", function()
228+
it("Test 'every rage also grants you' for minion mods and minion apply to you mods", function()
229229
build.itemsTab:CreateDisplayItemFromRaw([[
230230
New Item
231231
Fanatic Greathammer

src/Modules/CalcOffence.lua

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5140,6 +5140,16 @@ function calcs.offence(env, actor, activeSkill)
51405140
local sourceRes = env.modDB:Flag(nil, "EnemyChaosResistEqualToYours") and "Your Chaos Resistance" or (env.partyMembers.modDB:Flag(nil, "EnemyChaosResistEqualToYours") and "Party Member Chaos Resistance" or "Chaos")
51415141
globalBreakdown[ailment .. "EffMult"] = breakdown.effMult("Chaos", resist, 0, takenInc, effMult, takenMore, sourceRes, true)
51425142
end
5143+
elseif skillModList:Flag(cfg, ailment .. "ToFire") then
5144+
local resist = calcResistForType("Fire", dotCfg)
5145+
local takenInc = enemyDB:Sum("INC", dotCfg, "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime")
5146+
local takenMore = enemyDB:More(dotCfg, "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime")
5147+
effMult = (1 - resist / 100) * (1 + takenInc / 100) * takenMore
5148+
globalOutput[ailment .. "EffMult"] = effMult
5149+
if breakdown and effMult ~= 1 then
5150+
local sourceRes = env.modDB:Flag(nil, "EnemyFireResistEqualToYours") and "Your Fire Resistance" or (env.partyMembers.modDB:Flag(nil, "EnemyFireResistEqualToYours") and "Party Member Fire Resistance" or "Fire")
5151+
globalBreakdown[ailment .. "EffMult"] = breakdown.effMult("Fire", resist, 0, takenInc, effMult, takenMore, sourceRes, true)
5152+
end
51435153
else
51445154
local resist = calcResistForType(ailmentDamageType, dotCfg)
51455155
local elementalDamageTaken = isElemental[ailmentDamageType] and "ElementalDamageTaken" or nil
@@ -5415,7 +5425,16 @@ function calcs.offence(env, actor, activeSkill)
54155425

54165426
-- Calculate damaging ailment values
54175427
for _, damagingAilment in ipairs({"Bleed", "Poison", "Ignite"}) do
5418-
calcDamagingAilmentOutputs(damagingAilment, data.defaultAilmentDamageTypes[damagingAilment]["DamageType"], data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
5428+
local damageType = data.defaultAilmentDamageTypes[damagingAilment]["DamageType"]
5429+
if not canDeal[damageType] then
5430+
for _, type in ipairs(dmgTypeList) do
5431+
if skillModList:Flag(skillCfg, type.."Can"..damagingAilment) then -- e.g. Avatar of Fire + Blistering Bond -> DealNoPhysical + FireCanBleed
5432+
calcDamagingAilmentOutputs(damagingAilment, type, data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
5433+
end
5434+
end
5435+
else
5436+
calcDamagingAilmentOutputs(damagingAilment, damageType, data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
5437+
end
54195438
end
54205439

54215440
-- Calculate non-damaging ailments effect and duration modifiers

src/Modules/CalcSections.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,14 @@ return {
992992
{ label = "Source Chaos", textSize = 12, notFlag = "attack", haveOutput = "BleedChaosMax", { format = "{0:output:BleedChaosMin} to {0:output:BleedChaosMax}", { breakdown = "BleedChaos" }, }, },
993993
{ label = "MH Source Chaos", bgCol = colorCodes.MAINHANDBG, textSize = 12, flag = "weapon1Attack", haveOutput = "MainHand.BleedChaosMax", { format = "{0:output:MainHand.BleedChaosMin} to {0:output:MainHand.BleedChaosMax}", { breakdown = "MainHand.BleedChaos" }, }, },
994994
{ label = "OH Source Chaos", bgCol = colorCodes.OFFHANDBG, textSize = 12, flag = "weapon2Attack", haveOutput = "OffHand.BleedChaosMax", { format = "{0:output:OffHand.BleedChaosMin} to {0:output:OffHand.BleedChaosMax}", { breakdown = "OffHand.BleedChaos" }, }, },
995-
{ label = "Effective DPS Mod", flag = "effective", { format = "x {3:output:BleedEffMult}", { breakdown = "BleedEffMult" }, { label = "Enemy modifiers", modName = { "DamageTaken", "DamageTakenOverTime", "PhysicalDamageTaken", "PhysicalDamageTakenOverTime", "PhysicalDamageReduction" }, enemy = true, cfg = "bleed" }, }, },
995+
{ label = "Effective DPS Mod", flag = "effective", notSkillData = "BleedToFire", { format = "x {3:output:BleedEffMult}",
996+
{ breakdown = "BleedEffMult" },
997+
{ label = "Enemy modifiers", modName = { "DamageTaken", "DamageTakenOverTime", "PhysicalDamageTaken", "PhysicalDamageTakenOverTime", "PhysicalDamageReduction" }, enemy = true, cfg = "bleed" },
998+
}, },
999+
{ label = "Effective DPS Mod", flag = "effective", skillData = "BleedToFire", { format = "x {3:output:BleedEffMult}",
1000+
{ breakdown = "BleedEffMult" },
1001+
{ label = "Enemy modifiers", modName = { "FireResist", "ElementalResist", "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime", "ElementalDamageTaken" }, enemy = true, cfg = "bleed" },
1002+
}, },
9961003
{ label = "Bleed DPS", { format = "{1:output:BleedDPS}",
9971004
{ breakdown = "BleedDPS" },
9981005
{ breakdown = "MainHand.BleedDPS" },

src/Modules/ModParser.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ local modNameList = {
777777
["magnitude of bleeding you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Bleed },
778778
["magnitude of ignite you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Ignite },
779779
["ignite magnitude"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Ignite },
780+
["bleed magnitude"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Bleed },
780781
["magnitude of poison you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Poison },
781782
["effect of poison you inflict"] = { "AilmentEffect", keywordFlags = KeywordFlag.Poison },
782783
["magnitude of ailments"] = "AilmentMagnitude",
@@ -4027,6 +4028,10 @@ local specialModList = {
40274028
["attacks always inflict bleeding while you have cat's stealth"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Attack, { type = "Condition", var = "AffectedByCat'sStealth" }) },
40284029
["you have crimson dance while you have cat's stealth"] = { mod("Keystone", "LIST", "Crimson Dance", { type = "Condition", var = "AffectedByCat'sStealth" }) },
40294030
["you have crimson dance if you have dealt a critical hit recently"] = { mod("Keystone", "LIST", "Crimson Dance", { type = "Condition", var = "CritRecently" }) },
4031+
["bleeding you inflict deals fire damage instead of physical damage"] = {
4032+
flag("BleedToFire"),
4033+
mod("SkillData", "LIST", { key = "BleedToFire", value = true }),
4034+
},
40304035
["bleeding you inflict deals damage (%d+)%% faster"] = function(num) return { mod("BleedFaster", "INC", num) } end,
40314036
["bleeding you inflict on non%-bleeding enemies deals (%d+)%% more damage"] = function(num) return {
40324037
mod("Damage", "MORE", num, nil, 0, KeywordFlag.Bleed, { type = "Condition", var = "SingleBleed" }),
@@ -4046,6 +4051,9 @@ local specialModList = {
40464051
flag("ColdCanBleed"),
40474052
flag("LightningCanBleed"),
40484053
},
4054+
["(%a+) damage also contributes to bleeding magnitude"] = function(_, type) return {
4055+
flag(firstToUpper(type).."CanBleed")
4056+
} end,
40494057
-- Impale and Bleed
40504058
["(%d+)%% increased effect of impales inflicted by hits that also inflict bleeding"] = function(num) return {
40514059
mod("ImpaleEffectOnBleed", "INC", num, nil, 0, KeywordFlag.Hit)

0 commit comments

Comments
 (0)