aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/baccarat_rules.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-24 19:31:05 -0400
committerhistoria <[not public]>2026-09-24 19:31:05 -0400
commitd114c747a7672c7e4daab3a5b5f1b2f066ebc912 (patch)
tree81cc03354561f2f631d68f0de28bc742b1f49114 /internal/casino/baccarat_rules.go
parentf606db40c3290fd9ce40b53ef9bbe135b1e6f6e2 (diff)
downloadthehouseoficarus-d114c747a7672c7e4daab3a5b5f1b2f066ebc912.tar.gz
feat: additional baca and bj rules variants
Diffstat (limited to 'internal/casino/baccarat_rules.go')
-rw-r--r--internal/casino/baccarat_rules.go56
1 files changed, 56 insertions, 0 deletions
diff --git a/internal/casino/baccarat_rules.go b/internal/casino/baccarat_rules.go
new file mode 100644
index 0000000..82cc294
--- /dev/null
+++ b/internal/casino/baccarat_rules.go
@@ -0,0 +1,56 @@
+package casino
+
+import (
+ "fmt"
+ "strings"
+)
+
+// BaccaratRulesText travels with the configured table, never with scenery.
+func (c TableConfig) BaccaratRulesText() string {
+ c = c.Normalize()
+ b := c.Baccarat
+ variant := "Commission punto banco"
+ // Avoid floating-point display noise in the commission percentage.
+ banker := fmt.Sprintf("Banker wins pay %s (commission %s%% of winnings)", payoutRatio(b.BankerPayout), strings.TrimRight(strings.TrimRight(fmt.Sprintf("%.6f", (1-b.BankerPayout)*100), "0"), "."))
+ switch b.Variant {
+ case BaccaratSuper6:
+ variant = "Super 6 / no commission"
+ banker = "Banker wins pay 1:1, except a winning 6 pays 1:2 (two or three cards); no commission"
+ case BaccaratEZ:
+ variant = "EZ Baccarat / no commission"
+ banker = "Banker wins pay 1:1, except a winning three-card 7 pushes; no commission (Player bets still lose)"
+ }
+ optional := func(enabled bool, text string) string {
+ if enabled {
+ return "Enabled; " + text
+ }
+ return "Not offered"
+ }
+ return strings.Join([]string{
+ "Baccarat table " + c.ID + " — rules",
+ "Variant: " + variant,
+ fmt.Sprintf("Number of decks: %d", b.Decks),
+ "Player wins pay 1:1",
+ banker,
+ "Tie pays " + payoutRatio(b.TiePayout) + "; Player and Banker bets push on ties",
+ "Player pair (player_pair): " + optional(b.PairBets, "11:1; first two Player cards have identical rank"),
+ "Banker pair (banker_pair): " + optional(b.PairBets, "11:1; first two Banker cards have identical rank"),
+ "Dragon 7 (dragon_7): " + optional(b.Dragon7, "40:1; Banker wins with a three-card 7"),
+ "Panda 8 (panda_8): " + optional(b.Panda8, "25:1; Player wins with a three-card 8"),
+ "Super 6 bet (super_6): " + optional(b.Super6Bet, "12:1; Banker wins with 6 (two or three cards)"),
+ "Optional bets settle independently; pairs can win on ties; Dragon/Panda/Super 6 require an outright hand win",
+ "Scoring: Ace = 1; 2–9 face value; 10/J/Q/K = 0; highest last digit of the sum wins",
+ "Drawing: Automatic punto banco; no player hit/stand decisions",
+ "Naturals: An initial 8 or 9 on either hand stops all drawing",
+ "Player draws on 0–5, stands on 6–7 (unless a natural ends play)",
+ "Banker, if Player stands: Draw on 0–5, stand on 6–7",
+ "Banker, if Player draws: 0–2 draw; 3 draws except against 8; 4 against 2–7; 5 against 4–7; 6 against 6–7; 7 stands",
+ "Fractional credits: Rounded down; any commission rounds up and is collected on each win",
+ "Wagers: One per player per round, including optional bets; no simultaneous main/optional wagers",
+ "Available bets: " + b.betChoices(),
+ "Bet limits (all wagers): " + betRangeText(c.MinBet, c.MaxBet) + " credits",
+ fmt.Sprintf("Seats: %d; betting window: %d ticks", c.MaxPlayers, c.BettingTicks),
+ fmt.Sprintf("Shuffle threshold: %g%% of shoe remaining; reshuffle before a round if fewer than six cards remain", b.ShuffleAt*100),
+ "Dealing style: Automatic; no player squeeze, shoe passing, or burn-card ceremony",
+ }, "\n")
+}