Vitals: no wand swap for a vital spell while a kit or potion heals #28
Loading…
Reference in a new issue
No description provided.
Delete branch "AwfulWaffle/RynthSuite:vital-wand-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacks on kit-used-up (#27): review/apply that first.
What went wrong in play
Kits are the standard heal, and the shield should stay on. Putting the shield away for a wand costs more damage than a small heal spell buys back. Yet a melee character under Heal At put its shield away and pulled a wand for Heal Self, Revitalize or Stamina to Mana with kits in the pack. The wand was skipped only at Emergency Heal At.
The fix
Combat/BuffManager.VitalWandGate.cs(new) addsVitalSpellWouldSwap, called fromCastVital. It covers Heal Self, Stamina to Health, Revitalize, Stamina to Mana and the script hook's heal.When all three of these hold, the cast is refused as not handled:
The chain then falls through to the potion, and to the kit despite Kit Min Success.
Exceptions (the swap is allowed, or nothing is gated):
EnsureMagicModeintoIsBuffWandWielded, so the gate and the swap agree.InCombatNow), potion or not. Out of a fight it may, even with a mana potion carried, because buffing is about to swap anyway.Which kits count. A kit counts only if the kit picks would use it:
KitUsedUp, which is why this stacks on kit-used-up (#27));Stamina sources. The stamina step, the mana step's refill and the buffing mana floor now share one order (
AttemptStaminaRestore). It ends with the stamina kit despite Stamina Kit Min Success % as the last resort, since Revitalize is refused here.AttemptStaminaKitUse()keeps its name and calls the newAttemptStaminaKit(bool ignoreMinSuccess, out bool underMinSuccess).Buffing is unchanged and still swaps.
How it was tested
Run from
Tools\RynthCore.RynthAiHostTestson this branch (kit-used-up (#27) plus this):The one failure is
map bake: 0x6346 ..., the same one pristine main has (1494/1495).New tests:
VitalWandGateTests(17). They cover:Checked against deliberately broken code:
Scope and risk
/ra healgoes throughCastVitaltoo, so it is gated the same way.AttemptStaminaKit. Applying both gives one conflict hunk; the resolution is in heal-hold (#26)'s body. All four branches together build, and the host tests give 1534 tests, 1533 passed, with onlymap bakefailing.🤖 Generated with Claude Code
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.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.