Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 78 additions & 15 deletions spec/System/TestItemMods_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -675,23 +675,86 @@ describe("TetsItemMods", function()
assert.are.equals(11, smallModList:Sum("BASE", nil, "Dex"))
end)

it("ancestral bond", function()
it("Blistering Bond with Avatar of Fire", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Hoghunt
Felled Greatclub
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 0
Implicits: 0
{variant:1}{range:0.5}(100-150)% increased Physical Damage
{variant:2}{range:0.5}Adds (16-20) to (23-27) Physical Damage
+15% to Critical Hit Chance
10% reduced Attack Speed
+10 to Strength
Maim on Critical Hit
The Blood Thorn
Wrapped Quarterstaff
{variant:1}{range:0.5}Adds (3-5) to (9-11) Physical Damage
{variant:2}{range:0.5}Adds (8-12) to (16-18) Physical Damage
{range:0.5}+(10-15) to Strength
Causes Bleeding on Hit
{range:0.5}(4-5) to (8-10) Physical Thorns damage
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

build.configTab.input.customMods = [[
75% of Damage Converted to Fire Damage
Deal no Non-Fire Damage
]]
build.configTab:BuildModList()
runCallback("OnFrame")

build.skillsTab:PasteSocketGroup("Quarterstaff Strike 20/0 1")
runCallback("OnFrame")

local baseBleedPlusAvatarWithoutBlistering = build.calcsTab.mainOutput.BleedDPS
assert.True(baseBleedPlusAvatarWithoutBlistering == nil) -- fire cannot bleed, deal no physical = no bleed

build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
0.5 Blistering Bond Test
Ruby Ring
LevelReq: 8
Implicits: 1
{tags:fire}{range:0.5}+(20-30)% to Fire Resistance
{tags:life}{range:0.5}+(40-60) to maximum Life
{tags:fire}{range:0.5}+(20-30)% to Fire Resistance
{tags:cold}{range:0.5}-(15-10)% to Cold Resistance
You take Fire Damage instead of Physical Damage from Bleeding
Fire Damage also Contributes to Bleeding Magnitude
Bleeding you Inflict deals Fire damage instead of Physical damage
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
local baseBleed = build.calcsTab.mainOutput.BleedDPS

build.configTab.input.customMods = [[
Adds 100 to 200 fire damage
]]
build.configTab:BuildModList()
runCallback("OnFrame")
local baseBleedPlusFire = build.calcsTab.mainOutput.BleedDPS
assert.True(baseBleedPlusFire > baseBleed) -- fire can bleed, +fire = +bleed

build.configTab.input.customMods = [[
75% of Damage Converted to Fire Damage
Deal no Non-Fire Damage
]]
build.configTab:BuildModList()
runCallback("OnFrame")
local baseBleedPlusAvatar = build.calcsTab.mainOutput.BleedDPS
assert.True(baseBleedPlusAvatar > 0) -- fire can bleed, deal no physical = can bleed
end)

it("ancestral bond", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Hoghunt
Felled Greatclub
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 0
Implicits: 0
{variant:1}{range:0.5}(100-150)% increased Physical Damage
{variant:2}{range:0.5}Adds (16-20) to (23-27) Physical Damage
+15% to Critical Hit Chance
10% reduced Attack Speed
+10 to Strength
Maim on Critical Hit
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
Expand Down
2 changes: 1 addition & 1 deletion spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe("TestSkills", function()
assert.are.equals(70, build.calcsTab.calcsEnv.player.activeSkillList[1].skillModList:GetMultiplier("ConsumedFrenzyChargeEffect", build.calcsTab.calcsEnv.player.activeSkillList[1].skillCfg))
end)

it("Test 'every rage also grants you' for minion mods and minion apply to you mods #run", function()
it("Test 'every rage also grants you' for minion mods and minion apply to you mods", function()
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Fanatic Greathammer
Expand Down
21 changes: 20 additions & 1 deletion src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4880,6 +4880,16 @@ function calcs.offence(env, actor, activeSkill)
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")
globalBreakdown[ailment .. "EffMult"] = breakdown.effMult("Chaos", resist, 0, takenInc, effMult, takenMore, sourceRes, true)
end
elseif skillModList:Flag(cfg, ailment .. "ToFire") then
local resist = calcResistForType("Fire", dotCfg)
local takenInc = enemyDB:Sum("INC", dotCfg, "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime")
local takenMore = enemyDB:More(dotCfg, "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime")
effMult = (1 - resist / 100) * (1 + takenInc / 100) * takenMore
globalOutput[ailment .. "EffMult"] = effMult
if breakdown and effMult ~= 1 then
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")
globalBreakdown[ailment .. "EffMult"] = breakdown.effMult("Fire", resist, 0, takenInc, effMult, takenMore, sourceRes, true)
end
else
local resist = calcResistForType(ailmentDamageType, dotCfg)
local takenInc = enemyDB:Sum("INC", dotCfg, "DamageTaken", "DamageTakenOverTime", ailmentDamageType .. "DamageTaken", ailmentDamageType .. "DamageTakenOverTime", ailmentTypeMod .. "DamageTaken")
Expand Down Expand Up @@ -5154,7 +5164,16 @@ function calcs.offence(env, actor, activeSkill)

-- Calculate damaging ailment values
for _, damagingAilment in ipairs({"Bleed", "Poison", "Ignite"}) do
calcDamagingAilmentOutputs(damagingAilment, data.defaultAilmentDamageTypes[damagingAilment]["DamageType"], data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
local damageType = data.defaultAilmentDamageTypes[damagingAilment]["DamageType"]
if not canDeal[damageType] then
for _, type in ipairs(dmgTypeList) do
if skillModList:Flag(skillCfg, type.."Can"..damagingAilment) then -- e.g. Avatar of Fire + Blistering Bond -> DealNoPhysical + FireCanBleed
calcDamagingAilmentOutputs(damagingAilment, type, data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
end
end
else
calcDamagingAilmentOutputs(damagingAilment, damageType, data.defaultAilmentDamageTypes[damagingAilment]["ScalesFrom"])
end
end

-- Calculate non-damaging ailments effect and duration modifiers
Expand Down
9 changes: 8 additions & 1 deletion src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,14 @@ return {
{ label = "Source Chaos", textSize = 12, notFlag = "attack", haveOutput = "BleedChaosMax", { format = "{0:output:BleedChaosMin} to {0:output:BleedChaosMax}", { breakdown = "BleedChaos" }, }, },
{ 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" }, }, },
{ 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" }, }, },
{ 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" }, }, },
{ label = "Effective DPS Mod", flag = "effective", notSkillData = "BleedToFire", { format = "x {3:output:BleedEffMult}",
{ breakdown = "BleedEffMult" },
{ label = "Enemy modifiers", modName = { "DamageTaken", "DamageTakenOverTime", "PhysicalDamageTaken", "PhysicalDamageTakenOverTime", "PhysicalDamageReduction" }, enemy = true, cfg = "bleed" },
}, },
{ label = "Effective DPS Mod", flag = "effective", skillData = "BleedToFire", { format = "x {3:output:BleedEffMult}",
{ breakdown = "BleedEffMult" },
{ label = "Enemy modifiers", modName = { "FireResist", "ElementalResist", "DamageTaken", "DamageTakenOverTime", "FireDamageTaken", "FireDamageTakenOverTime", "ElementalDamageTaken" }, enemy = true, cfg = "bleed" },
}, },
{ label = "Bleed DPS", { format = "{1:output:BleedDPS}",
{ breakdown = "BleedDPS" },
{ breakdown = "MainHand.BleedDPS" },
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ local modNameList = {
["magnitude of bleeding you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Bleed },
["magnitude of ignite you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Ignite },
["ignite magnitude"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Ignite },
["bleed magnitude"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Bleed },
["magnitude of poison you inflict"] = { "AilmentMagnitude", keywordFlags = KeywordFlag.Poison },
["effect of poison you inflict"] = { "AilmentEffect", keywordFlags = KeywordFlag.Poison },
["magnitude of ailments"] = "AilmentMagnitude",
Expand Down Expand Up @@ -3996,6 +3997,10 @@ local specialModList = {
["attacks always inflict bleeding while you have cat's stealth"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Attack, { type = "Condition", var = "AffectedByCat'sStealth" }) },
["you have crimson dance while you have cat's stealth"] = { mod("Keystone", "LIST", "Crimson Dance", { type = "Condition", var = "AffectedByCat'sStealth" }) },
["you have crimson dance if you have dealt a critical hit recently"] = { mod("Keystone", "LIST", "Crimson Dance", { type = "Condition", var = "CritRecently" }) },
["bleeding you inflict deals fire damage instead of physical damage"] = {
flag("BleedToFire"),
mod("SkillData", "LIST", { key = "BleedToFire", value = true }),
},
["bleeding you inflict deals damage (%d+)%% faster"] = function(num) return { mod("BleedFaster", "INC", num) } end,
["bleeding you inflict on non%-bleeding enemies deals (%d+)%% more damage"] = function(num) return {
mod("Damage", "MORE", num, nil, 0, KeywordFlag.Bleed, { type = "Condition", var = "SingleBleed" }),
Expand All @@ -4015,6 +4020,9 @@ local specialModList = {
flag("ColdCanBleed"),
flag("LightningCanBleed"),
},
["(%a+) damage also contributes to bleeding magnitude"] = function(_, type) return {
flag(firstToUpper(type).."CanBleed")
} end,
-- Impale and Bleed
["(%d+)%% increased effect of impales inflicted by hits that also inflict bleeding"] = function(num) return {
mod("ImpaleEffectOnBleed", "INC", num, nil, 0, KeywordFlag.Hit)
Expand Down
Loading