Skip to content

Commit 4ab39a8

Browse files
author
LocalIdentity
committed
Olroth Bloodline
Add support for Enhanced Starlight Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward and Boon of the Sun 30% faster Restoration of Ward per Enemy Hit taken Recently Added a test for Enhanced Starlight
1 parent 82d20ab commit 4ab39a8

4 files changed

Lines changed: 35 additions & 4 deletions

File tree

spec/System/TestDefence_spec.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,31 @@ describe("TestDefence", function()
400400
assert.are.equals(1200, build.calcsTab.calcsOutput.PhysicalMaximumHitTaken)
401401
end)
402402

403+
it("small hits bypass unbroken ward", function()
404+
build.configTab.input.enemyIsBoss = "None"
405+
build.configTab.input.customMods = "\z
406+
+940 to maximum life\n\z
407+
+200 to Ward\n\z
408+
Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward\n\z
409+
"
410+
build.configTab:BuildModList()
411+
runCallback("OnFrame")
412+
assert.are.equals(350, build.calcsTab.calcsOutput.TotalEHP)
413+
assert.are.equals(1200, build.calcsTab.calcsOutput.PhysicalMaximumHitTaken)
414+
415+
local poolsRemaining = poolsRemainingAfterTypeMaxHit("Physical")
416+
assert.are.equals(0, poolsRemaining.Ward)
417+
assert.are.equals(0, poolsRemaining.Life)
418+
419+
poolsRemaining = build.calcsTab.calcs.reducePoolsByDamage(nil, { Physical = 29 }, build.calcsTab.calcsEnv.player)
420+
assert.are.equals(200, poolsRemaining.Ward)
421+
assert.are.equals(971, poolsRemaining.Life)
422+
423+
poolsRemaining = build.calcsTab.calcs.reducePoolsByDamage(nil, { Physical = 30 }, build.calcsTab.calcsEnv.player)
424+
assert.are.equals(0, poolsRemaining.Ward)
425+
assert.are.equals(1000, poolsRemaining.Life)
426+
end)
427+
403428
-- fun part
404429
it("armoured max hits", function()
405430
build.configTab.input.enemyIsBoss = "None"

src/Data/ModCache.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,7 +4753,7 @@ c["30% chance to take 50% less Area Damage from Hits"]={{[1]={flags=512,keywordF
47534753
c["30% chance when you pay a Skill's Cost to gain that much Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="BASE",value=30}}," when you pay a Skill's Cost to gain that much "}
47544754
c["30% chance when you pay a Skill's Cost to gain that much Mana +35 to maximum Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="BASE",value=30}}," when you pay a Skill's Cost to gain that much +35 to maximum Energy Shield "}
47554755
c["30% faster Restoration of Ward"]={{[1]={flags=0,keywordFlags=0,name="WardRechargeFaster",type="INC",value=30}},nil}
4756-
c["30% faster Restoration of Ward per Enemy Hit taken Recently"]={{[1]={flags=0,keywordFlags=0,name="WardRechargeFaster",type="INC",value=30}}," per Enemy Hit taken Recently "}
4756+
c["30% faster Restoration of Ward per Enemy Hit taken Recently"]={{[1]={[1]={type="Multiplier",var="BeenHitRecently"},flags=0,keywordFlags=0,name="WardRechargeFaster",type="INC",value=30}},nil}
47574757
c["30% increased Accuracy Rating with Wands"]={{[1]={flags=8388612,keywordFlags=0,name="Accuracy",type="INC",value=30}},nil}
47584758
c["30% increased Area Damage"]={{[1]={flags=512,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
47594759
c["30% increased Area of Effect"]={{[1]={flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=30}},nil}
@@ -8207,8 +8207,7 @@ c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped
82078207
c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot"]={nil,"Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot "}
82088208
c["Damage of Hits against you is Lucky"]={nil,"Damage of Hits is Lucky "}
82098209
c["Damage over Time Multiplier for Ailments is equal to Critical Strike Multiplier"]={{[1]={flags=0,keywordFlags=0,name="DotMultiplierIsCritMultiplier",type="FLAG",value=true}},nil}
8210-
c["Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward"]={nil,"Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward "}
8211-
c["Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward 70% increased Ward from Equipped Armour Items"]={nil,"Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward 70% increased Ward from Equipped Armour Items "}
8210+
c["Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward"]={{[1]={flags=0,keywordFlags=0,name="WardBypassBelowPercent",type="BASE",value=15}},nil}
82128211
c["Damage taken from Blocked Hits cannot bypass Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="EVBypass"},flags=0,keywordFlags=0,name="BlockedDamageDoesntBypassES",type="FLAG",value=true}},nil}
82138212
c["Damage taken from Unblocked hits always bypasses Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="EVBypass"},flags=0,keywordFlags=0,name="UnblockedDamageDoesBypassES",type="FLAG",value=true}},nil}
82148213
c["Damage to Surrounding Targets"]={nil,"Damage to Surrounding Targets "}

src/Modules/CalcDefence.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
165165
local modDB = actor.modDB
166166
local poolTbl = poolTable or { }
167167

168+
local damageTotal = 0
168169
for damageType, damage in pairs(damageTable) do
169170
damageTable[damageType] = damage > 0 and m_ceil(damage) or nil
171+
damageTotal = damageTotal + (damageTable[damageType] or 0)
170172
end
171173

172174
local alliesTakenBeforeYou = poolTbl.AlliesTakenBeforeYou
@@ -217,6 +219,7 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
217219
local ward = poolTbl.Ward or output.Ward or 0
218220
local wardActiveChance = poolTbl.WardActiveChance or (ward > 0 and 1 or 0)
219221
local wardAvoidBreakChance = modDB:Flag(nil, "Condition:WardNotBreak") and 1 or m_min(modDB:Sum("BASE", nil, "WardAvoidBreakChance") / 100, 1)
222+
local wardBypassBelow = modDB:Sum("BASE", nil, "WardBypassBelowPercent") / 100
220223

221224
local energyShield = poolTbl.EnergyShield or output.EnergyShieldRecoveryCap
222225
local mana = poolTbl.Mana or output.ManaUnreserved or 0
@@ -227,6 +230,7 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
227230
local overkillDamage = 0
228231

229232
ward = ward >= 0 and ward or 0
233+
local wardBeforeHit = ward
230234
energyShield = energyShield >= 0 and energyShield or 0
231235
mana = mana >= 0 and mana or 0
232236
life = life >= 0 and life or 0
@@ -297,9 +301,10 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
297301
damageRemainder = damageRemainder - tempDamage
298302
resourcesLostToTypeDamage[damageType].sharedGuard = tempDamage >= 1 and tempDamage or nil
299303
end
300-
if ward > 0 then
304+
if ward > 0 and (wardBypassBelow == 0 or damageTotal >= wardBeforeHit * wardBypassBelow) then
301305
local tempDamage = m_min(damageRemainder * (1 - (modDB:Sum("BASE", nil, "WardBypass") or 0) / 100), ward)
302306
ward = ward - tempDamage
307+
tempDamage = tempDamage * wardActiveChance
303308
damageRemainder = damageRemainder - tempDamage
304309
resourcesLostToTypeDamage[damageType].ward = tempDamage >= 1 and tempDamage or nil
305310
end

src/Modules/ModParser.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,7 @@ local modTagList = {
18521852
["branded enemy's"] = { tag = { type = "MultiplierThreshold", var = "BrandsAttachedToEnemy", threshold = 1 } },
18531853
["to enemies they're attached to"] = { tag = { type = "MultiplierThreshold", var = "BrandsAttachedToEnemy", threshold = 1 } },
18541854
["for each hit you've taken recently up to a maximum of (%d+)%%"] = function(num) return { tag = { type = "Multiplier", var = "BeenHitRecently", limit = num, limitTotal = true } } end,
1855+
["per enemy hit taken recently"] = { tag = { type = "Multiplier", var = "BeenHitRecently" } },
18551856
["for each nearby enemy, up to (%d+)%%"] = function(num) return { tag = { type = "Multiplier", var = "NearbyEnemies", limit = num, limitTotal = true } } end,
18561857
["for each nearby enemy, up to a maximum of (%d+)%%"] = function(num) return { tag = { type = "Multiplier", var = "NearbyEnemies", limit = num, limitTotal = true } } end,
18571858
["while you have iron reflexes"] = { tag = { type = "Condition", var = "HaveIronReflexes" } },
@@ -2313,6 +2314,7 @@ local specialModList = {
23132314
["increases and reductions to maximum energy shield instead apply to ward"] = { flag("EnergyShieldToWard") },
23142315
["(%d+)%% of damage taken bypasses ward"] = function(num) return { mod("WardBypass", "BASE", num) } end,
23152316
["ward has a (%d+)%% chance to not break"] = function(num) return { mod("WardAvoidBreakChance", "BASE", num) } end,
2317+
["damage taken bypasses unbroken ward if the hit deals less damage than (%d+)%% of ward"] = function(num) return { mod("WardBypassBelowPercent", "BASE", num) } end,
23162318
["maximum energy shield is (%d+)"] = function(num) return { mod("EnergyShield", "OVERRIDE", num ) } end,
23172319
["while not on full life, sacrifice ([%d%.]+)%% of mana per second to recover that much life"] = function(num) return {
23182320
mod("ManaDegenPercent", "BASE", num, { type = "Condition", var = "FullLife", neg = true }),

0 commit comments

Comments
 (0)