Skip to content

feat(draft): replace Cogwork Librarian opt-out dialog with opt-in button#10291

Open
billyhewlett wants to merge 1 commit intoCard-Forge:masterfrom
billyhewlett:feature/cogwork-librarian-button
Open

feat(draft): replace Cogwork Librarian opt-out dialog with opt-in button#10291
billyhewlett wants to merge 1 commit intoCard-Forge:masterfrom
billyhewlett:feature/cogwork-librarian-button

Conversation

@billyhewlett
Copy link
Copy Markdown

Problem

When a player holds Cogwork Librarian during a cube draft, the current
implementation prompts "Draft an extra pick with Cogwork Librarian?" (Yes/No)
on every single pick until the player chooses to use it. The player must
actively click "No" on each pack they want to draft normally, which is
disruptive when they are waiting for the right pack to use the ability.

Additionally, there is a pre-existing bug: if a player activates Cogwork
and then drafts a card that has a draft action (e.g., Lore Seeker), the
extra pick is silently dropped. draftCard() ends with a hardcoded
return true when any draft action runs, overriding the passPack = false
set by Cogwork's handler.

Changes

LimitedPlayer.java

  • Add cogworkLibrarianActivatedByUI public flag, consumed by
    handleCogworkLibrarian() instead of showing a dialog. Defaults to
    false, so the ability is not used unless the player explicitly opts in.
  • Add hasCogworkLibrarianAvailable() predicate so the UI can query
    pending state without touching internal flags.
  • Replace handleCogworkLibrarian() dialog prompt with flag-read-and-clear.
  • Fix draftCard() to return passPack instead of hardcoded return true,
    so Cogwork combined with draft-action cards (Lore Seeker, etc.) works
    correctly.

FDeckEditor.java (mobile)

  • Add a persistent btnUseLibrarian button in DraftPackPage, hidden by
    default. Appears above the card list when Cogwork is pending.
  • Override doLayout() to reserve space for the button when visible.
  • Button tap sets cogworkLibrarianActivatedByUI = true and hides itself.
  • Button is hidden at start of moveCard() and re-evaluated in refresh()
    after each pack loads.

Behavior Change

Before After
Dialog on every pick while holding Cogwork; must click "No" to skip Button visible while Cogwork is pending; tap once to use it
Extra pick dropped when combined with draft-action cards Extra pick correctly retained

Testing

Draft with a cube containing Cogwork Librarian. Verify:

  1. Button appears when Cogwork is in hand.
  2. Tapping it grants the extra pick for that pick only.
  3. Not tapping it skips the pick silently — no dialog.
  4. Drafting Lore Seeker while Cogwork is pending correctly grants both effects.

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.

1 participant