inversion-field modifier is never consumed and applies to both players' spells forever #55

Closed
opened 2026-08-11 19:06:11 +00:00 by Mark · 0 comments
Owner

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.

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.
Mark closed this issue 2026-08-14 00:33:08 +00:00
Sign in to join this conversation.
No description provided.