aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino_ux.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 04:26:20 -0400
committerhistoria <[not public]>2026-10-01 04:26:20 -0400
commit0ba388bbe229dd1ccfcb0831d21a5542ae0935f1 (patch)
treec5686cf404e3dc5001d2c9b2792749ae7a3c9801 /internal/game/casino_ux.go
parente3ff06fc79682673194c8913f0feb9e90920e7d0 (diff)
downloadthehouseoficarus-0ba388bbe229dd1ccfcb0831d21a5542ae0935f1.tar.gz
feat: video poker machines added to casino
Diffstat (limited to 'internal/game/casino_ux.go')
-rw-r--r--internal/game/casino_ux.go46
1 files changed, 45 insertions, 1 deletions
diff --git a/internal/game/casino_ux.go b/internal/game/casino_ux.go
index 2881a49..750d05d 100644
--- a/internal/game/casino_ux.go
+++ b/internal/game/casino_ux.go
@@ -68,6 +68,10 @@ func (g *Game) casinoChoices(roomID int) []casinoChoice {
}
var choices []casinoChoice
for _, c := range room.CasinoTables {
+ if c.Game == casino.GameVideoPoker {
+ choices = append(choices, casinoChoice{address: c.ID, names: []string{c.ID, "video_poker", "vp", c.VideoPoker.Normalize().Variant}, table: true})
+ continue
+ }
names := []string{string(c.Game)}
switch c.Game {
case casino.GameBlackjack:
@@ -121,7 +125,11 @@ func (g *Game) executeTableStatus(sess *net.Session, args []string, _ string) {
if len(args) > 0 && args[0] == "rules" {
// The felt and the exact, per-table wording stay under table rules;
// bare rules opens the game's own help page.
- sess.WriteLine(g.renderCasinoRules(sess, t.Config))
+ if t.Config.Game == casino.GameVideoPoker {
+ g.executeTableAction(sess, "paytable")
+ } else {
+ sess.WriteLine(g.renderCasinoRules(sess, t.Config))
+ }
return
}
if len(args) > 0 && args[0] == "help" {
@@ -138,6 +146,9 @@ func (g *Game) executeTableStatus(sess *net.Session, args []string, _ string) {
// Reuse the game's current-state menu instead of advertising actions
// (insurance, split, rebet, etc.) that may not be legal right now.
g.emitCasinoEvents(t.Status(sess.Player.Name))
+ if t.Config.Game == casino.GameVideoPoker {
+ return
+ }
commands := []casino.MenuCommand{
{Command: "rules", Desc: "Help page for this game variant"},
{Command: "list", Desc: "Every bet available right now, with payouts"},
@@ -181,6 +192,10 @@ func (g *Game) executeWatch(sess *net.Session, args []string, _ string) {
if !ok {
return
}
+ if t.Config.Game == casino.GameVideoPoker {
+ sess.WriteLine("Poker hands are private. Use look " + t.Config.ID + " to inspect this cabinet.")
+ return
+ }
sess.CasinoWatchRoom = sess.Player.RoomID
sess.CasinoWatchTable = t.Config.ID
sess.WriteLine(g.colorize(sess, "casino_action", "Watching "+t.Config.Label()+". Detailed public cards are visible; watch off stops watching."))
@@ -347,12 +362,41 @@ func (g *Game) executeList(sess *net.Session, args []string, rawInput string) {
// become a brief table; a single row is one line; an empty list means the
// only bet is the ordinary amount-only wager.
func (g *Game) showCasinoWagerList(sess *net.Session, t *casino.Table) {
+ if t.Config.Game == casino.GameVideoPoker {
+ for _, h := range t.Hints(sess.Player.Name) {
+ if h.Command == "draw" {
+ sess.WriteLine("No wagers are available during this hand; finish with draw.")
+ return
+ }
+ }
+ sess.WriteLine("This cabinet has one wager: load coins with bet [1-4|max], then deal. Use paytable for payouts.")
+ return
+ }
rows := t.Wagers(sess.Player.Name)
+ // Blackjack rows are actions, not targets for a new bet.
+ if t.Config.Game == casino.GameBlackjack && len(rows) > 0 {
+ commands := make([]casino.MenuCommand, 0, len(rows))
+ for _, r := range rows {
+ commands = append(commands, casino.MenuCommand{Command: r.Bet, Desc: strings.Trim(r.Payout+" | "+r.Win, " |")})
+ }
+ sess.WriteLine(g.renderCasinoCommands(sess, g.casinoBalance(sess), "Available actions", commands))
+ return
+ }
switch {
case len(rows) == 1:
r := rows[0]
sess.WriteLine(g.colorize(sess, "casino_action", "Your only wager: bet <amount> on "+r.Bet+" — "+r.Payout+" — "+r.Win+"."))
case len(rows) == 0:
+ canBet := false
+ for _, h := range t.Hints(sess.Player.Name) {
+ if strings.HasPrefix(h.Command, "bet ") {
+ canBet = true
+ }
+ }
+ if !canBet {
+ sess.WriteLine(g.colorize(sess, "casino_action", "No new wagers are available right now."))
+ return
+ }
sess.WriteLine(g.colorize(sess, "casino_action", "The only wager here is bet <amount>") + " (" + betRangeWords(t.Config.MinBet, t.Config.MaxBet) + ").")
default:
commands := make([]casino.MenuCommand, 0, len(rows))