Skip to content

feat: respect mana-loss prompt during phase skip and auto-pass#10483

Open
RafaelHGOliveira wants to merge 1 commit intoCard-Forge:masterfrom
RafaelHGOliveira:fix/mana-loss-prompt-bypass
Open

feat: respect mana-loss prompt during phase skip and auto-pass#10483
RafaelHGOliveira wants to merge 1 commit intoCard-Forge:masterfrom
RafaelHGOliveira:fix/mana-loss-prompt-bypass

Conversation

@RafaelHGOliveira
Copy link
Copy Markdown
Contributor

@RafaelHGOliveira RafaelHGOliveira commented Apr 21, 2026

Motivation

If you're the kind of person who casts Jeska's Will with Krark on the stack, generates twelve mana, flips Krark, gets the original spell returned to hand, clicks OK to pass priority, and then watches all that mana silently evaporate without so much as a warning — this PR is for you.

The UI_MANA_LOST_PROMPT preference (Preferences → Gameplay → Prompt Mana Pool Emptying) is supposed to warn you before passing priority causes mana loss. It does — but only if you manually click OK on the priority dialog. Two common code paths in PlayerControllerHuman.chooseSpellAbilityToPlay returned null before ever reaching InputPassPriority.passPriority():

  1. Auto-pass / yield path (mayAutoPass()) — returned null immediately after the delay, skipping the dialog entirely.
  2. Phase-skip path (isUiSetToSkipPhase) — returned null to skip the phase, also bypassing the dialog.

Changes

Both return paths now check ManaPool.willManaBeLostAtEndOfPhase() before returning null. If the pref is enabled, the stack is empty, and mana would be lost, they fall through to InputPassPriority so the existing dialog can fire normally.

Only applies to the local GUI player (GamePlayerUtil.getGuiPlayer()) — no change for AI or remote players.

Also removes a duplicate FServerManager.AfkTimeout import in InputPassPriority.java.

Screenshots

The setting (Preferences → Gameplay):
settings

The dialog that now actually appears:
prompt

Test plan

  • Enable Prompt Mana Pool Emptying in Preferences → Gameplay
  • Tap mana sources, leave mana floating in pool
  • Either set a phase to auto-skip or have auto-pass active
  • Advance to the phase → dialog should appear warning about mana loss
  • Clicking "Yes, lose the mana" passes through; "No" keeps priority

Auto-passing (yield) and phase-skip both returned null from
chooseSpellAbilityToPlay before reaching passPriority(), silently
discarding floating mana without showing the UI_MANA_LOST_PROMPT
dialog. Both paths now check willManaBeLostAtEndOfPhase() and fall
through to InputPassPriority when mana would be lost.

Also removes duplicate AfkTimeout import in InputPassPriority.
@RafaelHGOliveira RafaelHGOliveira force-pushed the fix/mana-loss-prompt-bypass branch from c7a90ca to fe1f993 Compare April 21, 2026 14:14
@RafaelHGOliveira RafaelHGOliveira changed the title fix: mana-loss prompt bypassed by auto-pass and phase-skip paths feat: respect mana-loss prompt during phase skip and auto-pass Apr 21, 2026
@tool4ever
Copy link
Copy Markdown
Contributor

Should this preference really always win against autopass? I'm not sure that's favored behaviour for most users...

probably better if this gets reworked into an interrupt setting on top of #9643 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants