Skip to content

Weight modifier cards so they're dealt more often#120

Open
turkosaurus wants to merge 2 commits into
mainfrom
turk/wip
Open

Weight modifier cards so they're dealt more often#120
turkosaurus wants to merge 2 commits into
mainfrom
turk/wip

Conversation

@turkosaurus

@turkosaurus turkosaurus commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Makes the modifier cards (flip, shred, clone, transfer) show up more often than other generic cards.

Changes

  • Add a weight column to cards (default 1), and set it to 2 for the four modifier cards.
  • GameCardsInitGeneric expands each card into weight copies via generate_series, orders by weight so the modifiers are always dealt, then fills the rest of the deck at random.
  • Slot numbering happens in an outer query over the already-dealt subset, so cards still spread evenly across the wheel (the "3 deep per slot" invariant) instead of being numbered before the random LIMIT.

The weight column is added both in the CREATE TABLE and via ALTER TABLE ... ADD COLUMN IF NOT EXISTS, so fresh and existing databases both pick it up on startup.

turkosaurus and others added 2 commits June 25, 2026 20:55
GameCardsInitGeneric numbered rows with ROW_NUMBER() before the random
LIMIT, so the dealt subset carried scattered slot numbers and could leave
a slot under-filled (or empty). Select the dealt cards in a CTE first,
then number them in the outer query, restoring the even "3 deep per slot"
spread while keeping the weighted modifiers always dealt.
@turkosaurus turkosaurus changed the title handle exit game Weight modifier cards so they're dealt more often Jun 28, 2026
@turkosaurus
turkosaurus requested a review from katlukens June 28, 2026 05:07
@turkosaurus turkosaurus self-assigned this Jun 28, 2026

@katlukens katlukens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

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.

2 participants