diff options
| author | historia <[not public]> | 2026-10-01 04:26:20 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-01 04:26:20 -0400 |
| commit | 0ba388bbe229dd1ccfcb0831d21a5542ae0935f1 (patch) | |
| tree | c5686cf404e3dc5001d2c9b2792749ae7a3c9801 /internal/game/blackjack_rules.go | |
| parent | e3ff06fc79682673194c8913f0feb9e90920e7d0 (diff) | |
| download | thehouseoficarus-0ba388bbe229dd1ccfcb0831d21a5542ae0935f1.tar.gz | |
feat: video poker machines added to casino
Diffstat (limited to 'internal/game/blackjack_rules.go')
| -rw-r--r-- | internal/game/blackjack_rules.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/game/blackjack_rules.go b/internal/game/blackjack_rules.go index afd8e4a..045626c 100644 --- a/internal/game/blackjack_rules.go +++ b/internal/game/blackjack_rules.go @@ -24,6 +24,39 @@ func (g *Game) lookRouletteTable(sess *net.Session, target string) bool { return g.lookCardTable(sess, target, casino.GameRoulette) } +// A cabinet's published pay table is public; another player's cards are not. +func (g *Game) lookVideoPokerCabinet(sess *net.Session, target string) bool { + if g.Casino == nil || sess.Player == nil { + return false + } + room, err := g.World.LoadRoom(sess.Player.RoomID) + if err != nil { + return false + } + target = strings.TrimSpace(strings.ToLower(target)) + for _, cfg := range room.CasinoTables { + if cfg.Game != casino.GameVideoPoker { + continue + } + id := strings.ToLower(cfg.ID) + if target != id && target != id+" machine" && target != id+" cabinet" { + continue + } + table, ok := g.casinoTable(room.ID, cfg.ID) + if !ok { + return false + } + if seated, playing := g.Casino.Participation(sess.Player.Name); playing && seated == table { + g.emitCasinoEvents(table.Status(sess.Player.Name)) + return true + } + c := table.Config.VideoPoker.Normalize() + sess.WriteLine(table.Config.Label() + g.renderCasinoSnapshot(sess, &casino.VideoPokerSnapshot{Config: c, ShowPayTable: true, Denomination: 1, Hands: casino.CabinetHandCounts(c.Cabinet, c.Variant)[0], FeatureOn: c.Feature != "", Multiplier: 1})) + return true + } + return false +} + func (g *Game) lookCardTable(sess *net.Session, target string, game casino.GameName) bool { room, err := g.World.LoadRoom(sess.Player.RoomID) if err != nil { |
