RynthAi: exclude a listed shield from buffing (noBuff on the Items bridge) #22

Open
AwfulWaffle wants to merge 1 commit from AwfulWaffle/RynthSuite:shield-buff-exclusion into main
First-time contributor

Depends on: nothing to build or run. Pairs with RynthCore PR "Items face: "No buff" toggle on shield rows" (the Items face toggle that writes the noBuff field this PR reads); with an older engine the field is absent and nothing changes.

Companion PR: rynth/RynthCore#11 (rynth/RynthCore#11).

What went wrong in play

A shield that already carries its buffs was still targeted by the buffer: armor spells were aimed at it, and its timers made buffing due. There was no way to say "leave this shield alone".

The fix

  • ItemRule.KeepBuffed off now means "Exclude from buffing", read for a listed SHIELD only. BuffManager.Shield treats an excluded shield as an unlisted one: nothing is aimed at it and it never makes buffing due. An id with any excluded rule is excluded whatever the rule order. An excluded shield in the off hand means no shield is buffed (not a stale stowed one).
  • ShieldToBuff's kept answer is invalidated when an entry's flag flips in place (ExcludedSignature).
  • Items bridge: new wire-only ItemRule.NoBuff (noBuff, never saved, omitted when null). WeaponList.ForDisplay fills it; MergeEdited applies it back for shield entries only, and an absent field leaves KeepBuffed as saved. Weapons and wands are unaffected.
  • A VTank .usd re-import (ReplaceItemRule) no longer turns buffing back on for a shield marked excluded.

How it was tested

Build (from the worktree root):

dotnet build Plugins\RynthCore.Plugin.RynthAi\RynthCore.Plugin.RynthAi.csproj -c Release -r win-x86 -nodeReuse:false

Result: Build succeeded, 0 Error(s).

Host tests (from Tools\RynthCore.RynthAiHostTests):

dotnet run -c Release -- "shield"  ->  31 test(s), 375 check(s): 31 passed, 0 failed
dotnet run -c Release              ->  1504 test(s), 15444 check(s): 1503 passed, 1 failed

The one failure is map bake: 0x6346 from the real dats ..., which needs the game dats and also fails on pristine upstream/main (baseline 1494/1495). The new cases extend Tests/ShieldBuffTests.cs, which upstream already registers.

Scope and risk

5 files: Combat/BuffManager.Shield.cs, Combat/WeaponList.cs, LegacyUi/LegacyUiSettings.cs, MiniRemote/VTankUsdImporter.cs, Tests/ShieldBuffTests.cs. Defaults are unchanged (KeepBuffed true for new entries and old profiles), so nothing is excluded until the player toggles it. Risk is limited to shield selection in the buffer and the Items bridge merge.

🤖 Generated with Claude Code

Depends on: nothing to build or run. Pairs with RynthCore PR "Items face: \"No buff\" toggle on shield rows" (the Items face toggle that writes the `noBuff` field this PR reads); with an older engine the field is absent and nothing changes. Companion PR: rynth/RynthCore#11 (https://aelrynth.com/git/rynth/RynthCore/pulls/11). ## What went wrong in play A shield that already carries its buffs was still targeted by the buffer: armor spells were aimed at it, and its timers made buffing due. There was no way to say "leave this shield alone". ## The fix - `ItemRule.KeepBuffed` off now means "Exclude from buffing", read for a listed SHIELD only. `BuffManager.Shield` treats an excluded shield as an unlisted one: nothing is aimed at it and it never makes buffing due. An id with any excluded rule is excluded whatever the rule order. An excluded shield in the off hand means no shield is buffed (not a stale stowed one). - `ShieldToBuff`'s kept answer is invalidated when an entry's flag flips in place (`ExcludedSignature`). - Items bridge: new wire-only `ItemRule.NoBuff` (`noBuff`, never saved, omitted when null). `WeaponList.ForDisplay` fills it; `MergeEdited` applies it back for shield entries only, and an absent field leaves `KeepBuffed` as saved. Weapons and wands are unaffected. - A VTank .usd re-import (`ReplaceItemRule`) no longer turns buffing back on for a shield marked excluded. ## How it was tested Build (from the worktree root): dotnet build Plugins\RynthCore.Plugin.RynthAi\RynthCore.Plugin.RynthAi.csproj -c Release -r win-x86 -nodeReuse:false Result: Build succeeded, 0 Error(s). Host tests (from `Tools\RynthCore.RynthAiHostTests`): dotnet run -c Release -- "shield" -> 31 test(s), 375 check(s): 31 passed, 0 failed dotnet run -c Release -> 1504 test(s), 15444 check(s): 1503 passed, 1 failed The one failure is `map bake: 0x6346 from the real dats ...`, which needs the game dats and also fails on pristine upstream/main (baseline 1494/1495). The new cases extend `Tests/ShieldBuffTests.cs`, which upstream already registers. ## Scope and risk 5 files: `Combat/BuffManager.Shield.cs`, `Combat/WeaponList.cs`, `LegacyUi/LegacyUiSettings.cs`, `MiniRemote/VTankUsdImporter.cs`, `Tests/ShieldBuffTests.cs`. Defaults are unchanged (`KeepBuffed` true for new entries and old profiles), so nothing is excluded until the player toggles it. Risk is limited to shield selection in the buffer and the Items bridge merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A shield listed in Items can be marked noBuff so the buffer skips it. The exclusion is shield-only and carried as noBuff on the Items bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This pull request has changes conflicting with the target branch.
  • Plugins/RynthCore.Plugin.RynthAi/Combat/BuffManager.Shield.cs
  • Plugins/RynthCore.Plugin.RynthAi/Combat/WeaponList.cs
  • Plugins/RynthCore.Plugin.RynthAi/LegacyUi/LegacyUiSettings.cs
  • Plugins/RynthCore.Plugin.RynthAi/MiniRemote/VTankUsdImporter.cs
  • Tools/RynthCore.RynthAiHostTests/Tests/ShieldBuffTests.cs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u shield-buff-exclusion:AwfulWaffle-shield-buff-exclusion
git switch AwfulWaffle-shield-buff-exclusion

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff AwfulWaffle-shield-buff-exclusion
git switch AwfulWaffle-shield-buff-exclusion
git rebase main
git switch main
git merge --ff-only AwfulWaffle-shield-buff-exclusion
git switch AwfulWaffle-shield-buff-exclusion
git rebase main
git switch main
git merge --no-ff AwfulWaffle-shield-buff-exclusion
git switch main
git merge --squash AwfulWaffle-shield-buff-exclusion
git switch main
git merge --ff-only AwfulWaffle-shield-buff-exclusion
git switch main
git merge AwfulWaffle-shield-buff-exclusion
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rynth/RynthSuite!22
No description provided.