forked from PathOfBuildingCommunity/PathOfBuilding-PoE2
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(martial-artist): implement Way of the Stonefist notable #61
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a2ba265
feat: implement Way of the Stonefist ascendancy mechanics
jay9297 3bce189
fix(stonefist): address review comments — nil guard, Ward restore, Mo…
jay9297 e59335c
ci: auto-regenerate ModCache.lua in check_modcache job
jay9297 d6d12db
chore: auto-regenerate ModCache.lua
github-actions[bot] b4d3e7c
fix(stonefist): split implicit/swap guard, zero Ward on transform, ad…
jay9297 f0bf637
ci(spellcheck): cache pob-dict files, add curl retry, fix cspell word
jay9297 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| describe("TestModParser", function() | ||
| -- Low-level round-trip tests for specialModList entries added for Way of the Stonefist. | ||
| -- These verify that modLib.parseMod correctly maps modifier strings to their flag mods | ||
| -- without going through the full build pipeline. | ||
|
|
||
| it("parses 'ignore attribute requirements to equip gloves' to IgnoreAttributeRequirementsForGloves", function() | ||
| local mods, extra = modLib.parseMod("Ignore attribute requirements to equip gloves") | ||
| assert.is_nil(extra) | ||
| assert.is_not_nil(mods) | ||
| assert.are.equals(1, #mods) | ||
| assert.are.equals("IgnoreAttributeRequirementsForGloves", mods[1].name) | ||
| assert.are.equals("FLAG", mods[1].type) | ||
| end) | ||
|
|
||
| it("parses 'gloves you equip have their base type transformed to fists of stone while equipped' to GloveBaseTypeTransform", function() | ||
| local mods, extra = modLib.parseMod("Gloves you equip have their base type transformed to fists of stone while equipped") | ||
| assert.is_nil(extra) | ||
| assert.is_not_nil(mods) | ||
| assert.are.equals(1, #mods) | ||
| assert.are.equals("GloveBaseTypeTransform", mods[1].name) | ||
| assert.are.equals("FLAG", mods[1].type) | ||
| end) | ||
|
|
||
| it("parses 'their explicit modifiers are transformed into more powerful related modifiers' to GloveExplicitModTransform", function() | ||
| local mods, extra = modLib.parseMod("Their explicit modifiers are transformed into more powerful related modifiers") | ||
| assert.is_nil(extra) | ||
| assert.is_not_nil(mods) | ||
| assert.are.equals(1, #mods) | ||
| assert.are.equals("GloveExplicitModTransform", mods[1].name) | ||
| assert.are.equals("FLAG", mods[1].type) | ||
| end) | ||
|
|
||
| it("does not parse 'ignore attribute requirements' (global) as the gloves-scoped flag", function() | ||
| local mods, extra = modLib.parseMod("Ignore attribute requirements") | ||
| assert.is_nil(extra) | ||
| assert.is_not_nil(mods) | ||
| assert.are.equals(1, #mods) | ||
| assert.are.equals("IgnoreAttributeRequirements", mods[1].name) | ||
| assert.are_not.equals("IgnoreAttributeRequirementsForGloves", mods[1].name) | ||
| end) | ||
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| describe("TestStonefist", function() | ||
| before_each(function() | ||
| newBuild() | ||
| end) | ||
|
|
||
| -- ModParser: flag parsing | ||
|
|
||
| it("GloveBaseTypeTransform flag is set from ascendancy mod string", function() | ||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| assert.is_true(build.calcsTab.mainEnv.modDB:Flag(nil, "GloveBaseTypeTransform")) | ||
| end) | ||
|
|
||
| it("IgnoreAttributeRequirementsForGloves flag is set from ascendancy mod string", function() | ||
| build.configTab.input.customMods = "\z | ||
| Ignore attribute requirements to equip gloves\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| assert.is_true(build.calcsTab.mainEnv.modDB:Flag(nil, "IgnoreAttributeRequirementsForGloves")) | ||
| end) | ||
|
|
||
| it("GloveExplicitModTransform flag is set from ascendancy mod string", function() | ||
| build.configTab.input.customMods = "\z | ||
| their explicit modifiers are transformed into more powerful related modifiers\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| assert.is_true(build.calcsTab.mainEnv.modDB:Flag(nil, "GloveExplicitModTransform")) | ||
| end) | ||
|
|
||
| -- CalcPerform: base type transform overwrites glove armour values | ||
|
|
||
| it("GloveBaseTypeTransform: equipping pure-evasion gloves gains Armour from Fists of Stone base", function() | ||
| -- Suede Bracers: Evasion only, no Armour stat | ||
| build.itemsTab:CreateDisplayItemFromRaw([[ | ||
| New Item | ||
| Suede Bracers | ||
| Evasion: 10 | ||
| ]]) | ||
| build.itemsTab:AddDisplayItem() | ||
| runCallback("OnFrame") | ||
|
|
||
| local baseArmour = build.calcsTab.mainOutput.Armour or 0 | ||
|
|
||
| -- Apply transform flag | ||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| local transformedArmour = build.calcsTab.mainOutput.Armour or 0 | ||
| -- Fists of Stone base armour is 44; should exceed the evasion-only baseline | ||
| assert.is_true(transformedArmour > baseArmour, | ||
| ("expected transformed armour %d > base armour %d"):format(transformedArmour, baseArmour)) | ||
| assert.is_near(44, transformedArmour, 10) | ||
| end) | ||
|
|
||
| it("GloveBaseTypeTransform: armour-only gloves take on Fists of Stone armour value (~44)", function() | ||
| -- Stocky Mitts base armour = 15; Fists of Stone base armour = 44 | ||
| build.itemsTab:CreateDisplayItemFromRaw([[ | ||
| New Item | ||
| Stocky Mitts | ||
| ]]) | ||
| build.itemsTab:AddDisplayItem() | ||
| runCallback("OnFrame") | ||
|
|
||
| local baseArmour = build.calcsTab.mainOutput.Armour or 0 | ||
|
|
||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| local transformedArmour = build.calcsTab.mainOutput.Armour or 0 | ||
| -- Armour should change from Stocky Mitts base (~15) to Fists of Stone base (~44) | ||
| assert.are_not.equals(baseArmour, transformedArmour) | ||
| assert.is_near(44, transformedArmour, 10) | ||
| end) | ||
|
|
||
| it("GloveBaseTypeTransform: Fists of Stone implicit injects Evasion per level into modDB", function() | ||
| build.itemsTab:CreateDisplayItemFromRaw([[ | ||
| New Item | ||
| Stocky Mitts | ||
| Armour: 10 | ||
| ]]) | ||
| build.itemsTab:AddDisplayItem() | ||
| runCallback("OnFrame") | ||
|
|
||
| local baseEvasion = build.calcsTab.mainOutput.Evasion or 0 | ||
|
|
||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| -- Implicit: +2 Evasion per level; at level 1 that is +2, plus Fists of Stone base evasion (40) | ||
| local transformedEvasion = build.calcsTab.mainOutput.Evasion or 0 | ||
| assert.is_true(transformedEvasion > baseEvasion, | ||
| ("expected evasion %d > base evasion %d after Fists of Stone transform"):format(transformedEvasion, baseEvasion)) | ||
| end) | ||
|
|
||
| it("GloveBaseTypeTransform: Ward implicit is injected (Ward > 0 after transform)", function() | ||
| build.itemsTab:CreateDisplayItemFromRaw([[ | ||
| New Item | ||
| Stocky Mitts | ||
| Armour: 10 | ||
| ]]) | ||
| build.itemsTab:AddDisplayItem() | ||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| -- Implicit: +1 Ward per level; should be > 0 at any character level | ||
| local ward = build.calcsTab.calcsOutput.Ward or 0 | ||
| assert.is_true(ward > 0, | ||
| ("expected Ward > 0 from Fists of Stone implicit, got %d"):format(ward)) | ||
| end) | ||
|
|
||
| it("GloveBaseTypeTransform: actual Fists of Stone base still receives per-level Evasion implicit", function() | ||
| -- Equip an actual Fists of Stone item (not a transformed base). | ||
| -- The guard must not skip implicit injection when baseName is already "Fists of Stone". | ||
| build.itemsTab:CreateDisplayItemFromRaw([[ | ||
| New Item | ||
| Fists of Stone | ||
| ]]) | ||
| build.itemsTab:AddDisplayItem() | ||
| runCallback("OnFrame") | ||
|
|
||
| local baseEvasion = build.calcsTab.mainOutput.Evasion or 0 | ||
|
|
||
| build.configTab.input.customMods = "\z | ||
| Gloves you equip have their base type transformed to fists of stone while equipped\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| -- +2 Evasion per level implicit must fire; Evasion should increase above the bare base | ||
| local transformedEvasion = build.calcsTab.mainOutput.Evasion or 0 | ||
| assert.is_true(transformedEvasion > baseEvasion, | ||
| ("expected FoS implicit to increase Evasion from %d to >%d"):format(baseEvasion, baseEvasion)) | ||
| end) | ||
|
|
||
| -- CalcPerform: scoped attribute requirement ignore | ||
|
|
||
| it("IgnoreAttributeRequirementsForGloves does not zero global attribute requirements", function() | ||
| -- The scoped flag should NOT zero requirements from non-glove sources | ||
| build.configTab.input.customMods = "\z | ||
| Ignore attribute requirements to equip gloves\n\z | ||
| " | ||
| build.configTab:BuildModList() | ||
| runCallback("OnFrame") | ||
|
|
||
| -- Global flag should be nil; only the scoped flag should be set | ||
| local globalFlag = build.calcsTab.mainEnv.modDB:Flag(nil, "IgnoreAttributeRequirements") | ||
| assert.is_falsy(globalFlag) | ||
| assert.is_true(build.calcsTab.mainEnv.modDB:Flag(nil, "IgnoreAttributeRequirementsForGloves")) | ||
| end) | ||
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invented tag —
martial_artist_transformis not referenced anywhere.A search of the entire
src/tree finds zero uses ofmartial_artist_transform. It is not a tag present in PoE2 game data and nothing in PoB reads it. This adds noise to the base definition without any effect. The unstaged working-tree version of this file already removes it — that removal is correct and should be included in the next commit.