Skip to content

Enable mass-select for mandatory library searches#10703

Merged
tool4ever merged 1 commit into
Card-Forge:masterfrom
MostCromulent:mass-select-mandatory
May 18, 2026
Merged

Enable mass-select for mandatory library searches#10703
tool4ever merged 1 commit into
Card-Forge:masterfrom
MostCromulent:mass-select-mandatory

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

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 in ChangeZoneEffect.allowMultiSelect, and threads the real min through chooseCardsForZoneChangemultiMin = Math.min(changeNum, fetchList.size()).

History

Mass-select was introduced in 2018-03 (a564f49381d), with !Mandatory baked in as a phased-rollout limit: // only handle optional decisions, for now. A week later (b959f61049e) added a companion !ChangeNum guard because mass-select had no bound enforcement — the player could pick "an arbitrarily small or big amount of cards without any limitation". !ChangeNum was lifted in 2018-08 once an upper-bound re-prompt loop landed (eaeb2838e01, 5f6ea460dd7). The lower bound stayed at min=0, which is fine for optional effects but kept !Mandatory in place. This PR completes that work.

Why it's safe

PR #10676 widened setSelectables to carry (min, max) end-to-end, and InputSelectManyBase.hasEnoughTargets gates the OK button on selected.size() >= min. The engine now passing a real min hooks straight into that.

Mobile: useSelectCardsInput excludes the libgdx port from the InputSelect path for library zones, so mobile already routes through getGui().chooseEntitiesForEffectSGuiChoose.orderDualListBox, which gates OK on remainingMin ≤ source.count ≤ remainingMax. Mandatory effects on mobile now route through one batched DualListBox instead of N sequential pickers.

Testing

  • before: Insidious Dreams routes to the single-card picker on a loop
  • after: Insidious Dreams routes to mass-select with the user able to highlight multiple cards and process as a batch

🤖 Generated with Claude Code

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>
@MostCromulent MostCromulent changed the title Mass-select for mandatory library searches Enable mass-select for mandatory library searches May 18, 2026
Copy link
Copy Markdown
Contributor

@tool4ever tool4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might not apply for remote clients yet but that's separate

@tool4ever tool4ever merged commit d73dfc5 into Card-Forge:master May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants