Skip to content

Commit 6a5c80f

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Ynda's Stand and Olroth Bloodline not working correctly (#9573)
* Fix Ynda's Stand and Olroth Bloodline not working correctly The Ynda's stand belt is meant to convert the armour and evasion on the body armour to war which can then be scaled by mods like increased Defences / Ward from Body Armour * Fix issue * Better fix Was improperly modifying the armourData instead of just adding to the Body Armour slot --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 3f30f57 commit 6a5c80f

2 files changed

Lines changed: 11 additions & 21 deletions

File tree

src/Modules/CalcDefence.lua

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,18 @@ function calcs.defence(env, actor)
839839
local armourData = actor.itemList[slot] and actor.itemList[slot].armourData
840840
if armourData then
841841
slotCfg.slotName = slot
842+
energyShieldBase = not modDB:Flag(nil, "GainNoEnergyShieldFrom" .. slot) and armourData.EnergyShield or 0
843+
armourBase = not modDB:Flag(nil, "GainNoArmourFrom" .. slot) and armourData.Armour or 0
844+
evasionBase = not modDB:Flag(nil, "GainNoEvasionFrom" .. slot) and armourData.Evasion or 0
842845
wardBase = not modDB:Flag(nil, "GainNoWardFrom" .. slot) and armourData.Ward or 0
846+
if slot == "Body Armour" and modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
847+
local conversion = m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent") / 100, 1)
848+
local convertedArmour = armourBase * conversion
849+
local convertedEvasion = evasionBase * conversion
850+
armourBase = armourBase - convertedArmour
851+
evasionBase = evasionBase - convertedEvasion
852+
wardBase = wardBase + (convertedEvasion + convertedArmour)
853+
end
843854
if wardBase > 0 then
844855
if modDB:Flag(nil, "EnergyShieldToWard") then
845856
local inc = modDB:Sum("INC", slotCfg, "Ward", "Defences", "EnergyShield")
@@ -864,7 +875,6 @@ function calcs.defence(env, actor)
864875
end
865876
end
866877
end
867-
energyShieldBase = not modDB:Flag(nil, "GainNoEnergyShieldFrom" .. slot) and armourData.EnergyShield or 0
868878
if energyShieldBase > 0 then
869879
if modDB:Flag(nil, "EnergyShieldToWard") then
870880
local more = modDB:More(slotCfg, "EnergyShield", "Defences")
@@ -887,22 +897,14 @@ function calcs.defence(env, actor)
887897
end
888898
end
889899
end
890-
armourBase = not modDB:Flag(nil, "GainNoArmourFrom" .. slot) and armourData.Armour or 0
891900
if armourBase > 0 then
892-
if slot == "Body Armour" and modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard")then
893-
armourBase = armourBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
894-
end
895901
armour = armour + armourBase * calcLib.mod(modDB, slotCfg, "Armour", "ArmourAndEvasion", "Defences", slot.."ESAndArmour")
896902
gearArmour = gearArmour + armourBase
897903
if breakdown then
898904
breakdown.slot(slot, nil, slotCfg, armourBase, nil, "Armour", "ArmourAndEvasion", "Defences", slot.."ESAndArmour")
899905
end
900906
end
901-
evasionBase = not modDB:Flag(nil, "GainNoEvasionFrom" .. slot) and armourData.Evasion or 0
902907
if evasionBase > 0 then
903-
if slot == "Body Armour" and modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard")then
904-
evasionBase = evasionBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
905-
end
906908
gearEvasion = gearEvasion + evasionBase
907909
if breakdown then
908910
breakdown.slot(slot, nil, slotCfg, evasionBase, nil, "Evasion", "ArmourAndEvasion", "Defences")

src/Modules/CalcPerform.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,18 +1405,6 @@ function calcs.perform(env, skipEHP)
14051405
end
14061406
end
14071407

1408-
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
1409-
local ward
1410-
local armourData = env.player.itemList["Body Armour"] and env.player.itemList["Body Armour"].armourData
1411-
if armourData then
1412-
ward = armourData.Evasion + armourData.Armour
1413-
if ward > 0 then
1414-
local wardMult = ((modDB:Sum("BASE", nil,"BodyArmourArmourEvasionToWardPercent") or 0) / 100)
1415-
modDB:NewMod("Ward", "BASE", ward * wardMult , "Body Armour Armour And Evasion Rating to Ward Conversion")
1416-
end
1417-
end
1418-
end
1419-
14201408
-- Special handling of Mageblood
14211409
local maxLeftActiveMagicUtilityCount = modDB:Sum("BASE", nil, "LeftActiveMagicUtilityFlasks")
14221410
local maxRightActiveMagicUtilityCount = modDB:Sum("BASE", nil, "RightActiveMagicUtilityFlasks")

0 commit comments

Comments
 (0)