Enable mass-select for mandatory library searches#10703
Merged
Conversation
Drop the !Mandatory exclusion from allowMultiSelect, so cards like Insidious Dreams route mandatory library searches through one batch chooser instead of looping a single-card picker per requested card. Pass the real min to chooseCardsForZoneChange when Mandatory is set, capped at fetchList.size() per MTG rules (a player can never be forced to find more cards than the zone contains). The GUI enforces "pick at least N" via setSelectables(min, max) and InputSelectManyBase's hasEnoughTargets gate, both of which were already in place. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tool4ever
approved these changes
May 18, 2026
Contributor
tool4ever
left a comment
There was a problem hiding this comment.
I think it might not apply for remote clients yet but that's separate
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.
Summary
Mandatory "search your library for X cards" effects (e.g. Insidious Dreams) currently route through a single-card picker called X times in sequence rather than one batch multi-select. Each iteration re-opens the FloatingZone (desktop) or chooser (mobile).
This PR drops the
!sa.hasParam("Mandatory")guard inChangeZoneEffect.allowMultiSelect, and threads the real min throughchooseCardsForZoneChange—multiMin = Math.min(changeNum, fetchList.size()).History
Mass-select was introduced in 2018-03 (
a564f49381d), with!Mandatorybaked in as a phased-rollout limit:// only handle optional decisions, for now. A week later (b959f61049e) added a companion!ChangeNumguard because mass-select had no bound enforcement — the player could pick "an arbitrarily small or big amount of cards without any limitation".!ChangeNumwas lifted in 2018-08 once an upper-bound re-prompt loop landed (eaeb2838e01,5f6ea460dd7). The lower bound stayed atmin=0, which is fine for optional effects but kept!Mandatoryin place. This PR completes that work.Why it's safe
PR #10676 widened
setSelectablesto carry(min, max)end-to-end, andInputSelectManyBase.hasEnoughTargetsgates the OK button onselected.size() >= min. The engine now passing a real min hooks straight into that.Mobile:
useSelectCardsInputexcludes the libgdx port from the InputSelect path for library zones, so mobile already routes throughgetGui().chooseEntitiesForEffect→SGuiChoose.order→DualListBox, which gates OK onremainingMin ≤ source.count ≤ remainingMax. Mandatory effects on mobile now route through one batchedDualListBoxinstead of N sequential pickers.Testing
🤖 Generated with Claude Code