aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-10 04:08:09 -0400
committerhistoria <[not public]>2026-10-10 04:08:09 -0400
commit9fb1f9010526100e12dd1ab1b0ca98401bb6ed75 (patch)
tree4a128211bfb0dd429bbb559a591d6c4be25c7757 /internal/game/casino.go
parentced77d7c89129da6ba4001ab8e3dad265aa41396 (diff)
downloadthehouseoficarus-9fb1f9010526100e12dd1ab1b0ca98401bb6ed75.tar.gz
feat: add casino game: crazy timeHEADmain
Diffstat (limited to 'internal/game/casino.go')
-rw-r--r--internal/game/casino.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/internal/game/casino.go b/internal/game/casino.go
index 2d8024c..fee8936 100644
--- a/internal/game/casino.go
+++ b/internal/game/casino.go
@@ -192,7 +192,7 @@ func (g *Game) startCasinoGame(sess *net.Session, p *player.Player, gameName str
// Keep slots' spin-as-bet behavior, while Big 6 spins already committed wagers.
func (g *Game) executeSpin(sess *net.Session, args []string, rawInput string) {
if sess.Player != nil {
- if table, playing := g.Casino.Participation(sess.Player.Name); playing && table != nil && table.Config.Game == casino.GameBigSix {
+ if table, playing := g.Casino.Participation(sess.Player.Name); playing && table != nil && (table.Config.Game == casino.GameBigSix || table.Config.Game == casino.GameCrazyTime) {
if len(args) != 0 {
sess.WriteLine("Use spin after placing your bets.")
return
@@ -242,11 +242,14 @@ func (g *Game) executeBet(sess *net.Session, args []string, rawInput string) {
g.emitCasinoEvents(g.Casino.Action(table.RoomID, table.Config.ID, p.Name, strings.TrimSpace("coins "+strings.Join(args, " "))))
return
}
- // Baccarat repeats every remembered side bet and the main bet on a bare
- // "bet"; games with one wager keep the generic single-rebet path below.
- if table.Config.Game == casino.GameBaccarat && len(args) == 0 {
- g.emitCasinoEvents(g.Casino.RebetAll(table.RoomID, table.Config.ID, p.Name, casinoWallet{g: g, p: p}))
- return
+ // A bare bet/rebet repeats every remembered wager for games that keep
+ // more than one (roulette, Big 6, Crazy Time, baccarat); games with a single
+ // wager keep the generic single-rebet path below.
+ if len(args) == 0 {
+ if events := g.Casino.RebetAll(table.RoomID, table.Config.ID, p.Name, casinoWallet{g: g, p: p}); events != nil {
+ g.emitCasinoEvents(events)
+ return
+ }
}
// Table bet syntax: bet | bet N [on BET] | bet min|max [on BET].
// BEFORE an "on" keyword, a token that parses as an amount (or min/max)
@@ -257,7 +260,7 @@ func (g *Game) executeBet(sess *net.Session, args []string, rawInput string) {
// an amount and target keyword exist, subsequent numbers belong to the
// target even without "on" (bet 10 split 1 2 / bet 10 buy 4).
// Other games keep the stricter one-token target.
- joinTarget := table.Config.Game == casino.GameRoulette || table.Config.Game == casino.GameCraps
+ joinTarget := table.Config.Game == casino.GameRoulette || table.Config.Game == casino.GameCraps || table.Config.Game == casino.GameCrazyTime
amount, spot, hasAmount, sawOn := 0, "", false, false
for i, arg := range args {
if strings.EqualFold(arg, "on") {
@@ -523,8 +526,9 @@ func (g *Game) casinoBoardReminder(sess *net.Session, category string, menu *cas
_, isPaiGow := snapshot.(*casino.PaiGowSnapshot)
b, isBigSix := snapshot.(*casino.BigSixSnapshot)
isBigSix = isBigSix && b.Phase != "playing" && b.Phase != "result"
+ _, isCrazyTime := snapshot.(*casino.CrazyTimeSnapshot)
s, isRoulette := snapshot.(*casino.RouletteSnapshot)
- if !isCashHunt && !isCoinFlip && !isPlinko && !isPachinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && (!isRoulette || s.Phase == "playing" || s.Phase == "result") {
+ if !isCashHunt && !isCoinFlip && !isPlinko && !isPachinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && !isCrazyTime && (!isRoulette || s.Phase == "playing" || s.Phase == "result") {
return "", false
}
if isRoulette && sess.Player.OptionString("casino_display") == "compact" && (menu.Repeat || !menu.ShowBalance) {
@@ -634,6 +638,9 @@ func (g *Game) renderCasinoSnapshot(sess *net.Session, snapshot casino.Snapshot)
return renderCrapsSnapshot(s, mode, unicode, sess.Player.OptionString("card_style"))
case *casino.BigSixSnapshot:
return renderBigSixSnapshot(s, mode, unicode)
+ case *casino.CrazyTimeSnapshot:
+ precision, showOdds := g.casinoEdgePrecision(sess)
+ return renderCrazyTime(s, mode, unicode, showOdds, precision)
case *casino.RouletteSnapshot:
return renderRouletteSnapshot(s, mode, unicode, size)
case *casino.SlotSnapshot: