Skip to content

Commit d988189

Browse files
committed
FEAT(mods): add support for "you have no Str/Dex" mods
1 parent 5b3454a commit d988189

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

spec/System/TestDefence_spec.lua

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,4 +807,99 @@ describe("TestDefence", function()
807807
assert.are.equals(0, floor(poolsRemaining.Life))
808808
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
809809
end)
810+
811+
it("Unreakable + Iron Reflexes", function()
812+
build.configTab.input.customMods = [[
813+
you have no dexterity
814+
]]
815+
build.configTab:BuildModList()
816+
runCallback("OnFrame")
817+
818+
-- Get the base to make this test more adaptable to changes
819+
local baseArmour = build.calcsTab.mainOutput.Armour
820+
local baseEvasion = build.calcsTab.mainOutput.Evasion
821+
822+
build.configTab.input.customMods = [[
823+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
824+
you have no dexterity
825+
]]
826+
build.itemsTab:CreateDisplayItemFromRaw([[
827+
New Item
828+
Shabby Jerkin
829+
Quality: 20
830+
]])
831+
build.itemsTab:AddDisplayItem()
832+
build.configTab:BuildModList()
833+
runCallback("OnFrame")
834+
835+
-- Get the base + Shabby Jerkin to make this test more adaptable to changes
836+
local ironReflexesArmour = build.calcsTab.mainOutput.Armour - baseArmour - baseEvasion
837+
838+
print("build.calcsTab.mainOutput.Armour:" .. build.calcsTab.mainOutput.Armour)
839+
840+
build.configTab.input.customMods = [[
841+
Armour from Equipped Body Armour is doubled
842+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
843+
you have no dexterity
844+
]]
845+
build.configTab:BuildModList()
846+
runCallback("OnFrame")
847+
848+
-- Evasion from Body Armour is converted to Armour before being doubled
849+
assert.are.equals(2*ironReflexesArmour + baseArmour + baseEvasion, build.calcsTab.mainOutput.Armour)
850+
851+
build.configTab.input.customMods = [[
852+
Armour from Equipped Body Armour is doubled
853+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
854+
Gain no armour from equipped body armour
855+
you have no dexterity
856+
]]
857+
build.configTab:BuildModList()
858+
runCallback("OnFrame")
859+
860+
-- Only the base armour from the chest is affected.
861+
-- Armour converted with Iron Reflexes still applies
862+
assert.are.equals(2*ironReflexesArmour + baseArmour + baseEvasion, build.calcsTab.mainOutput.Armour)
863+
build.configTab.input.customMods = [[
864+
Armour from Equipped Body Armour is doubled
865+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
866+
Gain no armour from equipped body armour
867+
defences from equipped body armour are doubled if it has no socketed gems
868+
you have no dexterity
869+
]]
870+
build.configTab:BuildModList()
871+
runCallback("OnFrame")
872+
873+
-- Oath Of Maji double defences stack with Unreakable
874+
assert.are.equals(2*2*ironReflexesArmour + baseArmour + baseEvasion, build.calcsTab.mainOutput.Armour)
875+
876+
build.configTab.input.customMods = [[
877+
Armour from Equipped Body Armour is doubled
878+
Armour from Equipped Body Armour is doubled
879+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
880+
Gain no armour from equipped body armour
881+
defences from equipped body armour are doubled if it has no socketed gems
882+
you have no dexterity
883+
]]
884+
build.configTab:BuildModList()
885+
runCallback("OnFrame")
886+
887+
-- Mod form unbreakable should apply only once
888+
assert.are.equals(2*2*ironReflexesArmour + baseArmour + baseEvasion, build.calcsTab.mainOutput.Armour)
889+
890+
build.configTab.input.customMods = [[
891+
Armour from Equipped Body Armour is doubled
892+
Armour from Equipped Body Armour is doubled
893+
Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating
894+
Gain no armour from equipped body armour
895+
defences from equipped body armour are doubled if it has no socketed gems
896+
defences from equipped body armour are doubled if it has no socketed gems
897+
you have no dexterity
898+
]]
899+
build.configTab:BuildModList()
900+
runCallback("OnFrame")
901+
902+
-- Oath Of Maji should apply only once
903+
assert.are.equals(2*2*ironReflexesArmour + baseArmour + baseEvasion, build.calcsTab.mainOutput.Armour)
904+
end)
810905
end)

src/Modules/ModParser.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4252,6 +4252,12 @@ local specialModList = {
42524252
["you have no intelligence"] = {
42534253
mod("Int", "MORE", -100),
42544254
},
4255+
["you have no dexterity"] = {
4256+
mod("Dex", "MORE", -100),
4257+
},
4258+
["you have no strength"] = {
4259+
mod("Str", "MORE", -100),
4260+
},
42554261
["elemental resistances are zero"] = {
42564262
mod("FireResist", "OVERRIDE", 0),
42574263
mod("ColdResist", "OVERRIDE", 0),

0 commit comments

Comments
 (0)