aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-04 17:44:27 -0400
committerhistoria <[not public]>2026-10-04 17:44:27 -0400
commit93dcb67ffee05ebf1de0c9a78a8b906eaf161007 (patch)
tree88cdd3d732f11eee616698a9ca32f699d2b41d77 /internal/game/casino.go
parent3a39a020e4449bc4d6f728ef837cffb9f7bd0c56 (diff)
downloadthehouseoficarus-93dcb67ffee05ebf1de0c9a78a8b906eaf161007.tar.gz
feat: new casino game: cash hunt, fixed verb issue with pai gow
Diffstat (limited to 'internal/game/casino.go')
-rw-r--r--internal/game/casino.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/internal/game/casino.go b/internal/game/casino.go
index 15e3b6a..710090a 100644
--- a/internal/game/casino.go
+++ b/internal/game/casino.go
@@ -333,6 +333,16 @@ func (g *Game) executePlay(sess *net.Session, args []string, rawInput string) {
input := ""
if len(args) > 0 {
input = args[0]
+ // Multi-word names (Cash Hunt, Pai Gow, Big Six) precede any
+ // optional wager. Resolve the longest matching name first.
+ for n := len(args); n > 1; n-- {
+ name := strings.Join(args[:n], " ")
+ if _, ok := resolveCasinoChoice(choices, name); ok {
+ input = name
+ args = append([]string{name}, args[n:]...)
+ break
+ }
+ }
}
choice, ok := resolveCasinoChoice(choices, input)
if !ok {
@@ -708,14 +718,15 @@ func (g *Game) casinoBoardReminder(sess *net.Session, category string, menu *cas
_, isCraps := snapshot.(*casino.CrapsSnapshot)
_, isPoker := snapshot.(*casino.VideoPokerSnapshot)
_, isPlinko := snapshot.(*casino.PlinkoSnapshot)
+ _, isCashHunt := snapshot.(*casino.CashHuntSnapshot)
_, isPaiGow := snapshot.(*casino.PaiGowSnapshot)
b, isBigSix := snapshot.(*casino.BigSixSnapshot)
isBigSix = isBigSix && b.Phase != "playing" && b.Phase != "result"
s, isRoulette := snapshot.(*casino.RouletteSnapshot)
- if !isPlinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && (!isRoulette || s.Phase == "playing" || s.Phase == "result") {
+ if !isCashHunt && !isPlinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && (!isRoulette || s.Phase == "playing" || s.Phase == "result") {
return "", false
}
- if !isPlinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && sess.Player.OptionString("casino_display") == "compact" && (menu.Repeat || !menu.ShowBalance) {
+ if !isCashHunt && !isPlinko && !isPoker && !isCraps && !isPaiGow && !isBigSix && sess.Player.OptionString("casino_display") == "compact" && (menu.Repeat || !menu.ShowBalance) {
// The compact reminder is already a short block; leave it intact.
return "", false
}
@@ -801,6 +812,8 @@ func (g *Game) renderCasinoSnapshot(sess *net.Session, snapshot casino.Snapshot)
// how verbose the command menus are.
size := sess.Player.OptionInt("card_size")
switch s := snapshot.(type) {
+ case *casino.CashHuntSnapshot:
+ return renderCashHunt(s, mode, unicode)
case *casino.PlinkoSnapshot:
return renderPlinko(s, mode, unicode)
case *casino.PaiGowSnapshot: