1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
package game
import (
"strings"
"thehouseoficarus/internal/casino"
"thehouseoficarus/internal/net"
)
// Tables are room fixtures in their own right, not authored scenery objects.
// Each game resolves through the shared details view; the felt games append
// their per-table rule card there.
func (g *Game) lookBlackjackTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GameBlackjack)
}
func (g *Game) lookBaccaratTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GameBaccarat)
}
func (g *Game) lookCrapsTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GameCraps)
}
func (g *Game) lookBigSixTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GameBigSix)
}
func (g *Game) lookRouletteTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GameRoulette)
}
func (g *Game) lookPlinkoTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GamePlinko)
}
func (g *Game) lookPaiGowTable(sess *net.Session, target string) bool {
return g.lookCasinoTable(sess, target, casino.GamePaiGow)
}
// 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
}
|