Skip to content

Commit 10c3c5d

Browse files
author
LocalIdentity
committed
Make the gloves be a damage source vs added damage
The gloves are meant to become the damage source instead of granting added damage. It was incorrectly adding the base unarmed damage to attackss Now also correctly interacts with hollow palm
1 parent b1896ce commit 10c3c5d

6 files changed

Lines changed: 62 additions & 22 deletions

File tree

spec/System/TestFacebreaker_spec.lua

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe("TestFacebreaker", function()
2424

2525
it("grants its base Physical damage to Unarmed attacks", function()
2626
equipFacebreaker()
27-
local modDB = build.calcsTab.mainEnv.player.modDB
28-
assert.are.equals(8, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMin"))
29-
assert.are.equals(12, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMax"))
27+
local weaponData1 = build.calcsTab.mainEnv.player.weaponData1
28+
assert.are.equals(8, weaponData1.FacebreakerPhysicalMin)
29+
assert.are.equals(12, weaponData1.FacebreakerPhysicalMax)
3030
end)
3131

3232
it("lets you attack as though using a One Hand Mace while unarmed", function()
@@ -40,10 +40,10 @@ describe("TestFacebreaker", function()
4040
build.configTab.input.configBossFaceBroken = 10
4141
build.configTab:BuildModList()
4242
runCallback("OnFrame")
43-
local modDB = build.calcsTab.mainEnv.player.modDB
43+
local weaponData1 = build.calcsTab.mainEnv.player.weaponData1
4444
-- 8 base + 3 per face broken * 10, 12 base + 4 per face broken * 10
45-
assert.are.equals(8 + 3 * 10, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMin"))
46-
assert.are.equals(12 + 4 * 10, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMax"))
45+
assert.are.equals(8 + 3 * 10, weaponData1.FacebreakerPhysicalMin)
46+
assert.are.equals(12 + 4 * 10, weaponData1.FacebreakerPhysicalMax)
4747
end)
4848

4949
it("matches the in-game resolved damage at 60 Boss's Faces Broken (188-252)", function()
@@ -52,9 +52,13 @@ describe("TestFacebreaker", function()
5252
build.configTab.input.configBossFaceBroken = 60
5353
build.configTab:BuildModList()
5454
runCallback("OnFrame")
55-
local modDB = build.calcsTab.mainEnv.player.modDB
56-
assert.are.equals(188, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMin"))
57-
assert.are.equals(252, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "PhysicalMax"))
55+
build.skillsTab:PasteSocketGroup("Boneshatter 1/0 1")
56+
runCallback("OnFrame")
57+
build.calcsTab:BuildOutput()
58+
runCallback("OnFrame")
59+
local mainHand = build.calcsTab.mainOutput.MainHand
60+
assert.are.equals(188, mainHand.PhysicalMinBase)
61+
assert.are.equals(252, mainHand.PhysicalMaxBase)
5862
end)
5963

6064
it("makes One Hand Mace skills usable unarmed and applies 'more Unarmed Damage per Strength' to them", function()
@@ -105,8 +109,32 @@ describe("TestFacebreaker", function()
105109
]])
106110
build.itemsTab:AddDisplayItem()
107111
runCallback("OnFrame")
108-
local modDB = build.calcsTab.mainEnv.player.modDB
109-
assert.are.equals(9, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "FireMin"))
110-
assert.are.equals(14, modDB:Sum("BASE", { flags = ModFlag.Unarmed }, "FireMax"))
112+
local weaponData1 = build.calcsTab.mainEnv.player.weaponData1
113+
assert.are.equals(9, weaponData1.FacebreakerFireMin)
114+
assert.are.equals(14, weaponData1.FacebreakerFireMax)
115+
end)
116+
117+
it("uses Facebreaker item damage instead of Hollow Palm added Physical damage for mace-compatible staff skills", function()
118+
equipFacebreaker()
119+
build.configTab.input.customMods = "Hollow Palm Technique"
120+
build.configTab:BuildModList()
121+
runCallback("OnFrame")
122+
build.skillsTab:PasteSocketGroup("Rain of Blades 1/0 1")
123+
runCallback("OnFrame")
124+
local skillModList = build.calcsTab.mainEnv.player.mainSkill.skillModList
125+
assert.are.equals(0, skillModList:Sum("BASE", { flags = ModFlag.Attack }, "PhysicalMin"))
126+
assert.are.equals(0, skillModList:Sum("BASE", { flags = ModFlag.Attack }, "PhysicalMax"))
127+
end)
128+
129+
it("keeps Hollow Palm added Physical damage for quarterstaff-only skills", function()
130+
equipFacebreaker()
131+
build.configTab.input.customMods = "Hollow Palm Technique"
132+
build.configTab:BuildModList()
133+
runCallback("OnFrame")
134+
build.skillsTab:PasteSocketGroup("Quarterstaff Strike 1/0 1")
135+
runCallback("OnFrame")
136+
local skillModList = build.calcsTab.mainEnv.player.mainSkill.skillModList
137+
assert.is_true(skillModList:Sum("BASE", { flags = ModFlag.Attack }, "PhysicalMin") > 0)
138+
assert.is_true(skillModList:Sum("BASE", { flags = ModFlag.Attack }, "PhysicalMax") > 0)
111139
end)
112140
end)

src/Data/ModCache.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5579,7 +5579,7 @@ c["Has 2 Charm Slots"]={{[1]={flags=0,keywordFlags=0,name="CharmLimit",type="BAS
55795579
c["Has 3 Charm Slot"]={{[1]={flags=0,keywordFlags=0,name="CharmLimit",type="BASE",value=3}},nil}
55805580
c["Has 3 Charm Slots"]={{[1]={flags=0,keywordFlags=0,name="CharmLimit",type="BASE",value=3}},nil}
55815581
c["Has 4 Augment Sockets"]={nil,"Has 4 Augment Sockets "}
5582-
c["Has 8 to 12 Physical damage, +3 to +4 per Boss's Face Broken"]={{[1]={flags=16777216,keywordFlags=0,name="PhysicalMin",type="BASE",value=8},[2]={flags=16777216,keywordFlags=0,name="PhysicalMax",type="BASE",value=12},[3]={[1]={type="Multiplier",var="BossFaceBroken"},flags=16777216,keywordFlags=0,name="PhysicalMin",type="BASE",value=3},[4]={[1]={type="Multiplier",var="BossFaceBroken"},flags=16777216,keywordFlags=0,name="PhysicalMax",type="BASE",value=4}},nil}
5582+
c["Has 8 to 12 Physical damage, +3 to +4 per Boss's Face Broken"]={{[1]={flags=0,keywordFlags=0,name="FacebreakerPhysicalMin",type="BASE",value=8},[2]={flags=0,keywordFlags=0,name="FacebreakerPhysicalMax",type="BASE",value=12},[3]={[1]={type="Multiplier",var="BossFaceBroken"},flags=0,keywordFlags=0,name="FacebreakerPhysicalMin",type="BASE",value=3},[4]={[1]={type="Multiplier",var="BossFaceBroken"},flags=0,keywordFlags=0,name="FacebreakerPhysicalMax",type="BASE",value=4}},nil}
55835583
c["Has no Attribute Requirements"]={{[1]={flags=0,keywordFlags=0,name="NoAttributeRequirements",type="FLAG",value=true}},nil}
55845584
c["Hazards have 15% chance to rearm after they are triggered"]={{[1]={[1]={skillType=203,type="SkillType"},flags=0,keywordFlags=0,name="HazardRearmChance",type="BASE",value=15}},nil}
55855585
c["Hazards have 5% chance to rearm after they are triggered"]={{[1]={[1]={skillType=203,type="SkillType"},flags=0,keywordFlags=0,name="HazardRearmChance",type="BASE",value=5}},nil}
@@ -6418,7 +6418,7 @@ c["Trusted Kinship"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",v
64186418
c["Unaffected by Chill during Dodge Roll"]={nil,"Unaffected by Chill during Dodge Roll "}
64196419
c["Unaffected by Chill while Leeching Mana"]={{[1]={[1]={type="Condition",var="LeechingMana"},flags=0,keywordFlags=0,name="SelfChillEffect",type="MORE",value=-100}},nil}
64206420
c["Unaffected by Elemental Weakness"]={nil,"Unaffected by Elemental Weakness "}
6421-
c["Unarmed Attacks that would use an Equipped One Hand Mace's damage use this Item's damage"]={{},nil}
6421+
c["Unarmed Attacks that would use an Equipped One Hand Mace's damage use this Item's damage"]={{[1]={flags=0,keywordFlags=0,name="UseFacebreakerItemDamage",type="FLAG",value=true}},nil}
64226422
c["Undead Minions have 25% less maximum Life"]={{[1]={[1]={skillType=127,type="SkillType"},flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="Life",type="MORE",value=-25}}}},nil}
64236423
c["Unique Tamed Beasts are Possessed by random Azmeri Spirits, changing every 20 seconds"]={nil,"Unique Tamed Beasts are Possessed by random Azmeri Spirits, changing every 20 seconds "}
64246424
c["Unique Tamed Beasts have 30% increased movement speed"]={nil,"Unique Tamed Beasts have 30% increased movement speed "}

src/Modules/CalcActiveSkill.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ function calcs.buildActiveSkillModList(env, activeSkill)
826826
end
827827

828828
-- Hollow Palm Technique added phys for skills that would use Quarterstaff
829-
if activeSkill.actor.modDB.conditions.HollowPalm and ((activeEffect.grantedEffect.weaponTypes and activeEffect.grantedEffect.weaponTypes.Staff) or skillModList:Flag(activeSkill.skillCfg, "UseHollowPalmDamage")) then
829+
if activeSkill.actor.modDB.conditions.HollowPalm and not (skillModList:Flag(nil, "UseFacebreakerItemDamage") and activeEffect.grantedEffect.weaponTypes and activeEffect.grantedEffect.weaponTypes["One Hand Mace"]) and ((activeEffect.grantedEffect.weaponTypes and activeEffect.grantedEffect.weaponTypes.Staff) or skillModList:Flag(activeSkill.skillCfg, "UseHollowPalmDamage")) then
830830
local gemLevel = activeEffect.level
831831
local physMin = data.hollowPalmAddedPhys[gemLevel and gemLevel or 1][1]
832832
local physMax = data.hollowPalmAddedPhys[gemLevel and gemLevel or 1][2]

src/Modules/CalcOffence.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,12 @@ function calcs.offence(env, actor, activeSkill)
23852385
source.CritChance = skillData.CritChance
23862386
end
23872387
end
2388+
if source.FacebreakerItemDamage and activeSkill.activeEffect.grantedEffect.weaponTypes and activeSkill.activeEffect.grantedEffect.weaponTypes["One Hand Mace"] then
2389+
for _, damageType in ipairs(dmgTypeList) do
2390+
source[damageType.."Min"] = source["Facebreaker"..damageType.."Min"] or 0
2391+
source[damageType.."Max"] = source["Facebreaker"..damageType.."Max"] or 0
2392+
end
2393+
end
23882394
if critOverride and source.type and source.type ~= "None" then
23892395
source.CritChance = critOverride
23902396
end

src/Modules/CalcSetup.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,13 @@ function calcs.initEnv(build, mode, override, specEnv)
15981598
env.player.weaponData1.asThoughUsing = env.player.weaponData1.asThoughUsing or { }
15991599
env.player.weaponData1.asThoughUsing["One Hand Mace"] = true
16001600
end
1601+
if (not env.player.itemList["Weapon 1"]) and env.modDB:Flag(nil, "UseFacebreakerItemDamage") then
1602+
env.player.weaponData1.FacebreakerItemDamage = true
1603+
for _, damageType in ipairs({ "Physical", "Lightning", "Cold", "Fire", "Chaos" }) do
1604+
env.player.weaponData1["Facebreaker"..damageType.."Min"] = env.modDB:Sum("BASE", nil, "Facebreaker"..damageType.."Min")
1605+
env.player.weaponData1["Facebreaker"..damageType.."Max"] = env.modDB:Sum("BASE", nil, "Facebreaker"..damageType.."Max")
1606+
end
1607+
end
16011608
env.player.weaponData2 = env.player.weaponData2 or { }
16021609
else
16031610
env.player.weaponData2 = env.player.itemList["Weapon 2"].weaponData and env.player.itemList["Weapon 2"].weaponData[2] or { }

src/Modules/ModParser.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5879,20 +5879,19 @@ local specialModList = {
58795879
mod("CritChance", "BASE", tonumber(critNum), nil, ModFlag.Attack, { type = "Condition", var = "HollowPalm" }, { type = "PerStat", stat = "EnergyShieldOnAllArmourItems", div = tonumber(esNum) }),
58805880
} end,
58815881
-- Facebreaker (and its Fire variant): the gloves grant base weapon damage that empty-handed One Hand Mace attacks use.
5882-
-- The base damage is modelled as flat damage on Unarmed attacks; the empty-hand "use a One Hand Mace" part is handled in CalcSetup.
5882+
-- The base damage is stored separately and copied onto the attack source when a compatible skill uses the item damage.
58835883
-- "Boss's Face Broken" is a stacking counter exposed through the Configuration tab (Multiplier:BossFaceBroken).
58845884
["has (%d+) to (%d+) (%a+) damage, %+(%d+) to %+(%d+) per boss's face broken"] = function(min, _, max, dmgType, perMin, perMax)
58855885
local dmg = dmgType:sub(1, 1):upper() .. dmgType:sub(2)
58865886
return {
5887-
mod(dmg.."Min", "BASE", tonumber(min), nil, ModFlag.Unarmed),
5888-
mod(dmg.."Max", "BASE", tonumber(max), nil, ModFlag.Unarmed),
5889-
mod(dmg.."Min", "BASE", tonumber(perMin), nil, ModFlag.Unarmed, { type = "Multiplier", var = "BossFaceBroken" }),
5890-
mod(dmg.."Max", "BASE", tonumber(perMax), nil, ModFlag.Unarmed, { type = "Multiplier", var = "BossFaceBroken" }),
5887+
mod("Facebreaker"..dmg.."Min", "BASE", tonumber(min)),
5888+
mod("Facebreaker"..dmg.."Max", "BASE", tonumber(max)),
5889+
mod("Facebreaker"..dmg.."Min", "BASE", tonumber(perMin), { type = "Multiplier", var = "BossFaceBroken" }),
5890+
mod("Facebreaker"..dmg.."Max", "BASE", tonumber(perMax), { type = "Multiplier", var = "BossFaceBroken" }),
58915891
}
58925892
end,
58935893
["can attack as though using a one handed mace while both of your hand slots are empty"] = { flag("CanAttackAsOneHandMaceUnarmed") },
5894-
-- The item's damage (parsed above) is already applied to Unarmed attacks, so this line just needs to be recognised (no extra effect)
5895-
["unarmed attacks that would use an equipped one hand mace's damage use this item's damage"] = { },
5894+
["unarmed attacks that would use an equipped one hand mace's damage use this item's damage"] = { flag("UseFacebreakerItemDamage") },
58965895
["storm and plant spells: deal (%d+)%% more damage cost (%d+)%% less have (%d+)%% less duration"] = function(damageNum, _, costNum, durationNum) return { -- Wildsurge Incantation
58975896
mod("Damage", "MORE", damageNum, nil, 0, KeywordFlag.Spell, { type = "SkillType", skillTypeList = { SkillType.Storm, SkillType.Plant } } ),
58985897
mod("Cost", "MORE", -tonumber(costNum), nil, 0, KeywordFlag.Spell, { type = "SkillType", skillTypeList = { SkillType.Storm, SkillType.Plant } } ),

0 commit comments

Comments
 (0)