feat(draft): server-issued draft pools + weekly cocktail (matchmaking) - #501
Open
ChronoFinale wants to merge 1 commit into
Open
feat(draft): server-issued draft pools + weekly cocktail (matchmaking)#501ChronoFinale wants to merge 1 commit into
ChronoFinale wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
July 23, 2026 19:44
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. |
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.
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 matchmakingpvp_start_gamedraft 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 viapvp_leave_lobby.lib/cocktail_config.lua(pureselect/resolve),objects/decks/ZZ_cocktail.luacomposes from the picked draft recipe in matchmaking (MP._match_cocktail),pvp_api/flow.luaseeds/clears it.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:
BalatroMultiplayerAPI#16— the generic ban-pick draft engine/UI + thefetch_draft_poolseam this consumes. This PR depends on it (MPAPI.matchmaking.fetch_draft_pool), so it merges after Added ready up and implemented some actions #16.BalatroMultiplayerAPI-Server#42— generates the per-queue pools and the weekly cocktail this fetches.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.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.)