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
28 changes: 28 additions & 0 deletions spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ describe("TestDefence", function()
assert.are.equals(manaWithoutTotalEnergyShield + 100, player.output.Mana)
end)

it("Geofri's Sanctuary mods work", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Geofri's Sanctuary
Revered Vestments
League: Runes of Aldur
Implicits: 1
+1% to all Maximum Elemental Resistances
(150-200)% increased Armour
+(10-20)% to all Elemental Resistances
Your maximum Energy Shield is equal to (200-300)% of your Strength
Maximum Energy Shield cannot be Converted
Regenerate 2 Life per second for every 10 Intelligence
Zealot's Oath]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

local output = build.calcsTab.mainOutput
assert.are.equals(round(output.Str * 2.5), output.EnergyShield)

local manaWithoutEldritchBattery = output.Mana
build.configTab.input.customMods = "Converts all Energy Shield to Mana"
build.configTab:BuildModList()
runCallback("OnFrame")

output = build.calcsTab.mainOutput
assert.are.equals(round(output.Str * 2.5), output.EnergyShield)
assert.are.equals(manaWithoutEldritchBattery, output.Mana)
end)
it("applies energy shield modifiers to runic ward when redirected", function()
build.configTab.input.customMods = [[
+100 to maximum Runic Ward
Expand Down
12 changes: 5 additions & 7 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6993,7 +6993,7 @@ c["Convert 100% of Fire Damage with Mace Skills to Cold Damage"]={nil,"Convert 1
c["Convert 100% of maximum Energy Shield to maximum Divinity"]={nil,"Convert 100% of maximum Energy Shield to maximum Divinity "}
c["Convert 100% of maximum Energy Shield to maximum Divinity 100% increased maximum Divinity"]={nil,"Convert 100% of maximum Energy Shield to maximum Divinity 100% increased maximum Divinity "}
c["Convert 100% of maximum Energy Shield to maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldConvertToMana",type="BASE",value=100}},nil}
c["Convert All Armour to Evasion Rating"]={nil,"Convert All Armour to Evasion Rating "}
c["Convert All Armour to Evasion Rating"]={{[1]={flags=0,keywordFlags=0,name="ArmourConvertToEvasion",type="BASE",value=100}},nil}
c["Converts all Evasion Rating to Armour"]={{[1]={flags=0,keywordFlags=0,name="IronReflexes",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="EvasionConvertToArmour",type="BASE",value=100}},nil}
c["Copy a random Modifier from each enemy in your Presence when"]={nil,"Copy a random Modifier from each enemy in your Presence when "}
c["Copy a random Modifier from each enemy in your Presence when you Shapeshift to an Animal form"]={nil,"Copy a random Modifier from each enemy in your Presence when you Shapeshift to an Animal form "}
Expand Down Expand Up @@ -8558,8 +8558,7 @@ c["Maximum 10 Fragile Regrowth"]={nil,"Maximum 10 Fragile Regrowth "}
c["Maximum 10 Fragile Regrowth 0.5% of maximum Life Regenerated per second per Fragile Regrowth"]={nil,"Maximum 10 Fragile Regrowth 0.5% of maximum Life Regenerated per second per Fragile Regrowth "}
c["Maximum Block chance is 75%"]={{[1]={flags=0,keywordFlags=0,name="BlockChanceMax",type="OVERRIDE",value=75}},nil}
c["Maximum Chance to Evade is 50%"]={{[1]={flags=0,keywordFlags=0,name="EvadeChanceMax",type="MAX",value=50}},nil}
c["Maximum Energy Shield cannot be Converted"]={nil,"Maximum Energy Shield cannot be Converted "}
c["Maximum Energy Shield cannot be Converted Regenerate 2 Life per second for every 10 Intelligence"]={nil,"Maximum Energy Shield cannot be Converted Regenerate 2 Life per second for every 10 Intelligence "}
c["Maximum Energy Shield cannot be Converted"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldCannotBeConverted",type="FLAG",value=true}},nil}
c["Maximum Life is 1"]={{[1]={flags=0,keywordFlags=0,name="Life",type="OVERRIDE",value=1}},nil}
c["Maximum Mana is replaced by twice as much Maximum Infernal Flame"]={nil,"Maximum Mana is replaced by twice as much Maximum Infernal Flame "}
c["Maximum Mana is replaced by twice as much Maximum Infernal Flame Gain Infernal Flame instead of spending Mana for Skill costs"]={nil,"Maximum Mana is replaced by twice as much Maximum Infernal Flame Gain Infernal Flame instead of spending Mana for Skill costs "}
Expand Down Expand Up @@ -9981,9 +9980,8 @@ c["Your Totem Limit is doubled"]={{},"Your Limit "}
c["Your Totem Limit is doubled No Charge requirement for placing Totems"]={{},"Your Limit No Charge requirement for placing Totems "}
c["Your Totem Limit is doubled No Charge requirement for placing Totems Totems reserve 75 Spirit each"]={{[1]={[1]={globalLimit=100,globalLimitKey="SpiritDoubledLimit",type="Multiplier",var="SpiritDoubled"},flags=0,keywordFlags=16384,name="Spirit",type="MORE",value=100},[2]={flags=0,keywordFlags=16384,name="Multiplier:SpiritDoubled",type="OVERRIDE",value=1}},"Your Limit No Charge requirement for placing Totems Totems reserve 75 each "}
c["Your base Energy Shield Recharge Delay is 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldRechargeBase",type="OVERRIDE",value=10}},nil}
c["Your maximum Energy Shield is equal to 250% of your Strength"]={nil,"Your maximum Energy Shield is equal to 250% of your Strength "}
c["Your maximum Energy Shield is equal to 300% of your Strength"]={nil,"Your maximum Energy Shield is equal to 300% of your Strength "}
c["Your maximum Energy Shield is equal to 300% of your Strength Maximum Energy Shield cannot be Converted"]={nil,"Your maximum Energy Shield is equal to 300% of your Strength Maximum Energy Shield cannot be Converted "}
c["Your maximum Energy Shield is equal to 250% of your Strength"]={{[1]={[1]={percent=250,stat="Str",type="PercentStat"},flags=0,keywordFlags=0,name="EnergyShield",type="OVERRIDE",value=1}},nil}
c["Your maximum Energy Shield is equal to 300% of your Strength"]={{[1]={[1]={percent=300,stat="Str",type="PercentStat"},flags=0,keywordFlags=0,name="EnergyShield",type="OVERRIDE",value=1}},nil}
c["Your other Modifiers to Rarity of Items found do not apply"]={nil,"Your other Modifiers to Rarity of Items found do not apply "}
c["Your other Modifiers to Rarity of Items found do not apply +15% to Cold Resistance"]={nil,"Your other Modifiers to Rarity of Items found do not apply +15% to Cold Resistance "}
c["Your speed is Unaffected by Slows while Sprinting"]={nil,"Your speed is Unaffected by Slows while Sprinting "}
Expand All @@ -10003,9 +10001,9 @@ c["for 4 seconds, every 0.25 seconds while raised"]={nil,"for 4 seconds, every 0
c["gain 6 Cold Surges or 6 Fire Surges"]={{}," Cold Surges or 6 Fire Surges "}
c["the enemy's Power for 20 seconds, up to a total of 500"]={nil,"the enemy's Power for 20 seconds, up to a total of 500 "}
c["their Explicit Modifiers are transformed into more powerful related Modifiers"]={nil,"their Explicit Modifiers are transformed into more powerful related Modifiers "}
end)();(function()
c["their Explicit Modifiers are transformed into more powerful related Modifiers Ignore Attribute Requirements to equip Gloves"]={nil,"their Explicit Modifiers are transformed into more powerful related Modifiers Ignore Attribute Requirements to equip Gloves "}
c["until you take no Damage to Life for 3 seconds"]={nil,"until you take no Damage to Life for 3 seconds "}
end)();(function()
c["until you take no Damage to Life for 5 seconds"]={nil,"until you take no Damage to Life for 5 seconds "}
c["until you take no Damage to Life for 5 seconds Life that would be lost by taking Damage is instead Reserved"]={nil,"until you take no Damage to Life for 5 seconds Life that would be lost by taking Damage is instead Reserved "}
c["you Shapeshift to an Animal form"]={nil,"you Shapeshift to an Animal form "}
Expand Down
4 changes: 3 additions & 1 deletion src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ local function calcRecoup(output, breakdown, modDB, recoup, recoupType, damageTy
end
-- Performs all ingame and related defensive calculations
function calcs.defence(env, actor)
---@type ModDB
local modDB = actor.modDB
local enemyDB = actor.enemy.modDB
---@class Output
Expand Down Expand Up @@ -1352,7 +1353,8 @@ function calcs.defence(env, actor)
output[source.name] = (output[source.name] or 0)
local totalConversion = 0
for _, target in ipairs(resourceList) do
source.conversionRate[target.name] = m_min(modDB:Sum("BASE", nil, source.name.."ConvertTo"..target.name), 100)
local conversionRate = modDB:Flag(nil, source.name .. "CannotBeConverted") and 0 or modDB:Sum("BASE", nil, source.name .. "ConvertTo" .. target.name)
source.conversionRate[target.name] = m_min(conversionRate, 100)
totalConversion = totalConversion + source.conversionRate[target.name]
end
if totalConversion > 100 then
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,7 @@ local specialModList = {
["removes all energy shield"] = { mod("EnergyShield", "OVERRIDE", 0 ) },
["converts all energy shield to mana"] = { mod("EnergyShieldConvertToMana", "BASE", 100) },
["convert (%d+)%% of maximum energy shield to maximum mana"] = function(num) return { mod("EnergyShieldConvertToMana", "BASE", num) } end,
["convert all armour to evasion rating"] = { mod("ArmourConvertToEvasion", "BASE", 100) },
["skills cost life instead of mana"] = { flag("CostLifeInsteadOfMana") },
["skills reserve life instead of mana"] = { flag("BloodMagicReserved") },
["non%-aura skills cost no mana or life while focus?sed"] = {
Expand Down Expand Up @@ -5927,6 +5928,8 @@ local specialModList = {
mod("RageRegen", "BASE", num),
flag("Condition:CanGainRage"),
} end,
["your maximum energy shield is equal to (%d+)%% of your strength"] = function(n) return { mod("EnergyShield", "OVERRIDE", 1, { type = "PercentStat", stat = "Str", percent = n }), } end,
["maximum energy shield cannot be converted"] = { flag("EnergyShieldCannotBeConverted") },
["when you lose temporal chains you gain maximum rage"] = { flag("Condition:CanGainRage") },
["with a murderous eye jewel socketed, melee attacks grant (%d+) rage on hit, no more than once every second"] = { flag("Condition:CanGainRage", { type = "Condition", var = "HaveMurderousEyeJewelIn{SlotName}" }) },
["gain %d+ rage after spending a total of %d+ mana"] = { flag("Condition:CanGainRage") },
Expand Down
Loading