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
44 changes: 44 additions & 0 deletions spec/System/TestGrimFate_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
describe("TestGrimFate", function()
before_each(function()
newBuild()
end)

local function enemyDamage(preset, arkhon)
build.configTab.input.presetBossSkills = preset
build.configTab.input.grimFateArkhon = arkhon
build.configTab:BuildModList()
runCallback("OnFrame")
local output = build.calcsTab.mainOutput
return {
Physical = output.PhysicalEnemyDamage,
Fire = output.FireEnemyDamage,
Cold = output.ColdEnemyDamage,
Lightning = output.LightningEnemyDamage,
}
end

it("adds The Arkhon's 80% Physical as extra elemental damage to Shaper Slam", function()
local base = enemyDamage("Shaper Slam", "NONE")
assert.is_true(base.Physical > 0)
assert.are.equal(0, base.Fire)

local average = enemyDamage("Shaper Slam", "AVERAGE")
assert.are.equal(base.Physical, average.Physical)
for _, element in ipairs({ "Fire", "Cold", "Lightning" }) do
assert.is_true(average[element] > 0, element)
end

local fire = enemyDamage("Shaper Slam", "FIRE")
assert.near(average.Fire * 3, fire.Fire, 0.01)
assert.are.equal(0, fire.Cold)
assert.are.equal(0, fire.Lightning)
end)

it("doesn't change other boss skills", function()
local base = enemyDamage("Sirus Meteor", "NONE")
local withFate = enemyDamage("Sirus Meteor", "FIRE")
for _, damageType in ipairs({ "Physical", "Fire", "Cold", "Lightning" }) do
assert.are.equal(base[damageType], withFate[damageType], damageType)
end
end)
end)
17 changes: 17 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,9 @@ Huge sets the radius to 11.
end

modList:NewMod("BossSkillActive", "FLAG", true, "Config")
if val:match("^Shaper ") then
modList:NewMod("ShaperBossSkillActive", "FLAG", true, "Config")
end

-- boss specific mods
if val == "Atziri Flameblast" and isUber then
Expand All @@ -2379,6 +2382,20 @@ Huge sets the radius to 11.
build.configTab.varControls['enemyDamageType'].enabled = true
end
end },
{ var = "grimFateArkhon", type = "list", label = "Grim Fate: The Arkhon", ifFlag = "ShaperBossSkillActive", tooltip = "The Arkhon Grim Fate makes The Shaper gain 80% of Physical Damage as extra Damage of a random Element.\n\tAverage: one third of the value as ^xB97123Fire^7, ^x3F6DB3Cold^7 and ^xADAA47Lightning ^7each, the expected damage over many hits\n\t^xB97123Fire ^7/ ^x3F6DB3Cold ^7/ ^xADAA47Lightning^7: the full value as that element, for a single hit of that element", list = {{val="NONE",label="None"},{val="AVERAGE",label="Average"},{val="FIRE",label="^xB97123Fire"},{val="COLD",label="^x3F6DB3Cold"},{val="LIGHTNING",label="^xADAA47Lightning"}}, apply = function(val, modList, enemyModList, build)
local preset = build.configTab.input.presetBossSkills
if val == "NONE" or not (preset and preset:match("^Shaper ")) then
return
end
local gain = data.misc.GrimFateArkhonPhysicalGainAsRandom
if val == "AVERAGE" then
for _, element in ipairs({ "Fire", "Cold", "Lightning" }) do
enemyModList:NewMod("PhysicalDamageGainAs"..element, "BASE", gain / 3, "Grim Fate: The Arkhon")
end
else
enemyModList:NewMod("PhysicalDamageGainAs"..val:sub(1, 1)..val:sub(2):lower(), "BASE", gain, "Grim Fate: The Arkhon")
end
end },
{ var = "enemyDamageRollRange", type = "integer", label = "Enemy Skill Roll Range %:", ifFlag = "BossSkillActive", tooltip = "The percentage of the roll range the enemy hits for \n eg at 100% the enemy deals its maximum damage", defaultPlaceholderState = 70, hideIfInvalid = true },
{ var = "enemyDamageType", type = "list", label = "Enemy Damage Type:", tooltip = "Controls which types of damage the EHP calculation uses:\n\tAverage: uses the Average of all typed damage types (except Damage Over Time and Untyped)\n\nIf a specific damage type is selected, that will be the only type used.", list = {
{val="Average",label="Average"},
Expand Down
1 change: 1 addition & 0 deletions src/Modules/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ data.misc = { -- magic numbers
pinnacleBossPen = 15 / 5,
uberBossDPSMult = 10 / 4.25,
uberBossPen = 40 / 5,
GrimFateArkhonPhysicalGainAsRandom = 80, -- The Arkhon Grim Fate, poedb Grim_Fates
-- ehp helper function magic numbers
ehpCalcSpeedUp = 8,
-- max damage can be increased for more accuracy
Expand Down