Skip to content

feat(draft): server-issued draft pools + weekly cocktail (matchmaking) - #501

Open
ChronoFinale wants to merge 1 commit into
Balatro-Multiplayer:mqttfrom
ChronoFinale:pr/draft-server-pool
Open

feat(draft): server-issued draft pools + weekly cocktail (matchmaking)#501
ChronoFinale wants to merge 1 commit into
Balatro-Multiplayer:mqttfrom
ChronoFinale:pr/draft-server-pool

Conversation

@ChronoFinale

@ChronoFinale ChronoFinale commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Server-authoritative draft for matchmaking: the client now fetches the ban-pick pool from the server instead of rolling it locally, and the Cocktail deck composes from the server's weekly recipe. This is the PvP-consumer third of the deck+stake draft feature.

What changes

  • pvp_api/draft_pool.lua (new) — fetch_draft_pool / validate_server_pool (crash-guard against a malformed pool) / decorate_cocktail_items (the consumer owns the "Cocktail" wording) / set_match_cocktail.
  • pvp_api/actions/run_lifecycle.lua — in the matchmaking pvp_start_game draft path, swap the local pool generator for the server flow (fetch_draft_pool → validate_server_pool → decorate_cocktail_items); on a missing/invalid pool it logs the reason, shows a generic error, and aborts cleanly via pvp_leave_lobby.
  • Weekly / match cocktaillib/cocktail_config.lua (pure select/resolve), objects/decks/ZZ_cocktail.lua composes from the picked draft recipe in matchmaking (MP._match_cocktail), pvp_api/flow.lua seeds/clears it.
  • Tests + a few localization keys.

Scope is only the draft feature — no matchmaking reorg, disconnect-grace, departure-classification, or unrelated fixes.

Related PRs — one feature, three repos

This is the client-side third of the deck+stake draft; it pairs with:

Screenshots — the draft in action

The UI is rendered by the framework engine (#16), driven by this consumer + the server pool (#42) — so these show the full feature end-to-end. Rendered by the DevTools shot harness from the draft scenarios.

Your turn — ban a deck


DECK BAN over the menu: "Your turn: ban a deck", 9 deck tiles, Selected: 0/3, greyed Confirm, blue Random.

Weekly cocktail — hover


The picked cocktail's recipe: "Casjb Cocktail: Green + Black + Orange Deck", full effects side by side. Server-driven composition, consumer-owned wording.

Pick phase


Final PICK between the last two survivors — the chosen deck is what you play.

More scenarios — selection, blind Random, off-turn, banned tiles, tuple hover, compact cocktail hover



Two tiles selected; Confirm stays greyed until exactly 3.



Blind Random armed: counter ?/3, Confirm goes green, nothing revealed until commit.



Opponent's turn — everything greyed, layout stable.



Tuple hover: deck effects + the stake column (deck+stake pool).



The cocktail tile's own compact hover.

Test plan

  • luajit tests/test_draft_pool.lua, test_pool_contract.lua, test_weekly_cocktail.lua, test_cocktail_config.lua — all green.
  • In-game matchmaking draft (with Added ready up and implemented some actions #16 loaded + the server issuing pools): draft starts, bans/pick apply, a drafted cocktail composes from the picked recipe.

Draft PR — depends on framework #16 landing first. Opening early for visibility + review of the consumer side.


Closes #492, closes #485, closes #494, closes #491.

(Tile stake/deck info is rendered by the framework engine — BalatroMultiplayerAPI#16; the ranked allowlist + weekly-cocktail composition are server-side — BalatroMultiplayerAPI-Server#42. This consumer PR ties them together on the client.)

Re-express the deck+stake draft as server-authoritative: the host fetches a
curated pool from the server (MPAPI.matchmaking.fetch_draft_pool) instead of
generating one client-side, validates it, and aborts the draft on failure
rather than fabricating a pool. Adds a weekly-cocktail layer whose composition
rides the picked draft item so host and guest provably agree.

Depends on BalatroMultiplayerAPI#16 (matchmaking.fetch_draft_pool).
@ChronoFinale

Copy link
Copy Markdown
Contributor Author

Minor follow-up (non-critical, noticed while testing): if you Continue in Singleplayer and then start a New Run, all three decks in the run-setup deck select render with the Cocktail deck's logo/sprite.

Looks like the match-cocktail deck decoration isn't cleared on the singleplayer → new-run transition. Not blocking — noting it for a later cleanup pass.

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