inversion-field modifier is never consumed and applies to both players' spells forever #55
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
bug
feature-request
in-progress
milestone
ops-task
quickfix
security/high
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/chainbound#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The inversion-field modifier (src/engine/modifiers.ts) has window:'next' and its description says "Flips the polarity of the next qualifying spell", but unlike all 7 other modifiers its effect callback is a no-op that never removes itself from pendingModifiers. It therefore inverts every spell for the rest of the game. Compounding this, findApplicableModifiers() does not filter by owner, so a pending inversion-field from player 0 also inverts player 1's spells. The no-op is asserted in modifiers.test.ts as current behavior, but it contradicts the modifier's documented 'next spell' semantics. Fix: consume the modifier after one use (like held-breath does) and filter applicable modifiers by owner.