feat: respect mana-loss prompt during phase skip and auto-pass#10483
Open
RafaelHGOliveira wants to merge 1 commit intoCard-Forge:masterfrom
Open
feat: respect mana-loss prompt during phase skip and auto-pass#10483RafaelHGOliveira wants to merge 1 commit intoCard-Forge:masterfrom
RafaelHGOliveira wants to merge 1 commit intoCard-Forge:masterfrom
Conversation
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.
c7a90ca to
fe1f993
Compare
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 🤔 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_PROMPTpreference (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 inPlayerControllerHuman.chooseSpellAbilityToPlayreturnednullbefore ever reachingInputPassPriority.passPriority():mayAutoPass()) — returnednullimmediately after the delay, skipping the dialog entirely.isUiSetToSkipPhase) — returnednullto 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 toInputPassPriorityso 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.AfkTimeoutimport inInputPassPriority.java.Screenshots
The setting (Preferences → Gameplay):

The dialog that now actually appears:

Test plan