Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Ynda's Stand belt's Armour Evasion to Ward Conversion mod #7742

Merged
merged 1 commit into from
Jul 21, 2024
Merged
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
12 changes: 12 additions & 0 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ function calcs.defence(env, actor)
if modDB:Flag(nil, "Unbreakable") then
armourBase = armourBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
armourBase = armourBase / 2
end
end
output["ArmourOn"..slot] = armourBase
end
Expand All @@ -370,6 +373,9 @@ function calcs.defence(env, actor)
if modDB:Flag(nil, "Unbreakable") and modDB:Flag(nil, "IronReflexes") then
evasionBase = evasionBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
evasionBase = evasionBase / 2
end
end
output["EvasionOn"..slot] = evasionBase
end
Expand Down Expand Up @@ -708,6 +714,9 @@ function calcs.defence(env, actor)
if modDB:Flag(nil, "Unbreakable") then
armourBase = armourBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
armourBase = armourBase / 2
end
end
armour = armour + armourBase * calcLib.mod(modDB, slotCfg, "Armour", "ArmourAndEvasion", "Defences", slot.."ESAndArmour")
gearArmour = gearArmour + armourBase
Expand All @@ -724,6 +733,9 @@ function calcs.defence(env, actor)
if modDB:Flag(nil, "Unbreakable") and ironReflexes then
evasionBase = evasionBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
evasionBase = evasionBase / 2
end
end
gearEvasion = gearEvasion + evasionBase
if breakdown then
Expand Down
11 changes: 11 additions & 0 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,17 @@ function calcs.perform(env, skipEHP)
end
end

if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
local ward
local armourData = env.player.itemList["Body Armour"] and env.player.itemList["Body Armour"].armourData
if armourData then
ward = armourData.Evasion + armourData.Armour
if ward > 0 then
modDB:NewMod("Ward", "BASE", ward * 0.5 , "Body Armour Armour And Evasion Rating to Ward Conversion")
end
end
end

-- Special handling of Mageblood
local maxActiveMagicUtilityCount = modDB:Sum("BASE", nil, "ActiveMagicUtilityFlasks")
if maxActiveMagicUtilityCount > 0 then
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4074,6 +4074,7 @@ local specialModList = {
["reflects (%d+) physical damage to melee attackers"] = { },
["ignore all movement penalties from armour"] = { flag("Condition:IgnoreMovementPenalties") },
["gain armour equal to your reserved mana"] = { mod("Armour", "BASE", 1, { type = "PerStat", stat = "ManaReserved", div = 1 }) },
["gain ward instead of (%d+)%% of armour and evasion rating from equipped body armour"] = {flag("ConvertBodyArmourArmourEvasionToWard")},
["(%d+)%% increased armour per (%d+) reserved mana"] = function(num, _, mana) return { mod("Armour", "INC", num, { type = "PerStat", stat = "ManaReserved", div = tonumber(mana) }) } end,
["cannot be stunned"] = { flag("StunImmune"), },
["cannot be stunned while bleeding"] = { flag("StunImmune", { type = "Condition", var = "Bleeding" }), },
Expand Down
Loading