aboutsummaryrefslogtreecommitdiff
path: root/internal/casino
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 05:05:11 -0400
committerhistoria <[not public]>2026-10-01 05:05:11 -0400
commitd4eae333a8d8a96452bbf3617aa85b50466c11a7 (patch)
tree90d4cf075fe5467b35e5cc53ff3ee30fc4ee1feb /internal/casino
parent299b5b67aa80ba2539d7a91c60943060b0426b45 (diff)
downloadthehouseoficarus-d4eae333a8d8a96452bbf3617aa85b50466c11a7.tar.gz
feat: concise table/machine names, casino command shortcuts, remove payout video poker command
Diffstat (limited to 'internal/casino')
-rw-r--r--internal/casino/video_poker.go21
-rw-r--r--internal/casino/video_poker_config.go18
-rw-r--r--internal/casino/video_poker_lifecycle_test.go14
-rw-r--r--internal/casino/video_poker_regression_test.go16
4 files changed, 34 insertions, 35 deletions
diff --git a/internal/casino/video_poker.go b/internal/casino/video_poker.go
index 36fdc35..8c9f66c 100644
--- a/internal/casino/video_poker.go
+++ b/internal/casino/video_poker.go
@@ -128,7 +128,6 @@ func (t *videoPokerTable) hintsLocked(name string) []MenuCommand {
} else {
commands = append(commands,
MenuCommand{Command: "game <name>", Desc: t.settings.GameChoices()},
- MenuCommand{Command: "payout low|normal|full", Desc: "Set the cabinet-wide pay quality"},
MenuCommand{Command: "denom <1|10|50>", Desc: "Credits per coin"},
MenuCommand{Command: "hands <count>", Desc: "Supported hand counts are announced by hands"},
)
@@ -406,24 +405,6 @@ func (t *videoPokerTable) action(name, action string) []Event {
p.config, p.variant, p.hands = cfg, variant, CabinetHandCounts(cfg.Cabinet, variant)[0]
p.next, p.current, p.lines, p.remaining, p.result = nil, nil, nil, nil, ""
return t.statusLocked(name, true)
- case "payout":
- if len(fields) != 2 {
- break
- }
- tier := strings.ToLower(fields[1])
- if tier != "low" && tier != "normal" && tier != "full" {
- break
- }
- cfg := (VideoPokerConfig{Cabinet: p.config.Cabinet, Payout: tier, Variant: p.variant}).Normalize()
- if err := cfg.Validate(); err != nil {
- return []Event{t.private(name, err.Error())}
- }
- t.settings.Payout = tier
- t.settings.PayTable = ""
- t.settings = t.settings.Normalize()
- p.config = cfg
- p.next, p.current, p.lines, p.remaining, p.result = nil, nil, nil, nil, ""
- return t.statusLocked(name, true)
case "feature":
if len(fields) != 2 || cabinetFeature(t.settings.Cabinet) == "" || fields[1] != "on" && fields[1] != "off" {
break
@@ -431,7 +412,7 @@ func (t *videoPokerTable) action(name, action string) []Event {
p.featureOn = fields[1] == "on"
return t.statusLocked(name, false)
}
- return []Event{t.private(name, "Use bet [1-4|max], deal, game <name>, payout low|normal|full, denom 1|10|50, hands <count>, paytable, or feature on|off on a bonus cabinet.")}
+ return []Event{t.private(name, "Use bet [1-4|max], deal, game <name>, denom 1|10|50, hands <count>, paytable, or feature on|off on a bonus cabinet.")}
}
func (t *videoPokerTable) drawLocked(name string, p *pokerPlayer) []Event {
diff --git a/internal/casino/video_poker_config.go b/internal/casino/video_poker_config.go
index 78a772d..8d67252 100644
--- a/internal/casino/video_poker_config.go
+++ b/internal/casino/video_poker_config.go
@@ -145,6 +145,24 @@ func (c VideoPokerConfig) CabinetName() string {
return "Classic Video Poker"
}
+// CabinetAliases lists the single-token names that address this cabinet type
+// in the play menu, beyond the room's own table id. "video poker" itself means
+// the classic cabinet so a lone lounge stays reachable without a specific
+// machine name.
+func (c VideoPokerConfig) CabinetAliases() []string {
+ switch c.Normalize().Cabinet {
+ case CabinetUXSingle:
+ return []string{"ux", "ultimate_x", "ultimate_x_single"}
+ case CabinetUXMulti:
+ return []string{"uxm", "ultimate_x_multi", "ultimate_x_multi_hand"}
+ case CabinetSuperTimesPay:
+ return []string{"stp", "super_times", "super_times_pay"}
+ case CabinetHotRoll:
+ return []string{"hr", "hot_roll"}
+ }
+ return []string{"vp", "poker", "classic", "video_poker"}
+}
+
func (c VideoPokerConfig) CabinetLabel() string {
c = c.Normalize()
return c.CabinetName() + " / " + c.Payout + " pay"
diff --git a/internal/casino/video_poker_lifecycle_test.go b/internal/casino/video_poker_lifecycle_test.go
index 3107a93..f817225 100644
--- a/internal/casino/video_poker_lifecycle_test.go
+++ b/internal/casino/video_poker_lifecycle_test.go
@@ -199,20 +199,20 @@ func TestPokerHoldToggleAndMultiHand(t *testing.T) {
t.Fatal("seat not released")
}
}
-func TestPokerGameAndPayoutSwitching(t *testing.T) {
- table, w, _ := pokerTestCabinet(t, VideoPokerConfig{Cabinet: CabinetClassic})
+func TestPokerGameSwitching(t *testing.T) {
+ table, w, _ := pokerTestCabinet(t, VideoPokerConfig{Cabinet: CabinetClassic, Payout: "low"})
p := table.players["alice"]
+ // Payout is house-owned: the retired verb no longer changes the schedule.
+ if !table.action("alice", "payout full")[0].MessageStarts("Use bet") || p.config.Payout != "low" {
+ t.Fatal("payout action still changes the schedule")
+ }
if !table.action("alice", "game jacks")[0].Snapshot.(*VideoPokerSnapshot).ShowPayTable {
t.Fatal("explicit switch did not show the pay table")
}
table.action("alice", "game ddb")
- if p.config.Variant != "double_double_bonus" || p.config.PayTable != "10/6" {
+ if p.config.Variant != "double_double_bonus" || p.config.PayTable != "8/5" {
t.Fatalf("alias switch: %+v", p.config)
}
- table.action("alice", "payout low")
- if p.config.PayTable != "8/5" {
- t.Fatalf("tier not applied to the current game: %+v", p.config)
- }
table.action("alice", "game joker")
if p.config.PayTable != "50/15/7/5/3" {
t.Fatalf("tier lost switching to joker: %+v", p.config)
diff --git a/internal/casino/video_poker_regression_test.go b/internal/casino/video_poker_regression_test.go
index 634ebc9..90caf91 100644
--- a/internal/casino/video_poker_regression_test.go
+++ b/internal/casino/video_poker_regression_test.go
@@ -8,9 +8,8 @@ import (
func TestPokerEveryCabinetTierGameAndAward(t *testing.T) {
for cabinet, games := range cabinetGames {
- table, _, _ := pokerTestCabinet(t, VideoPokerConfig{Cabinet: cabinet})
for _, tier := range []string{"low", "normal", "full"} {
- table.action("alice", "payout "+tier)
+ table, _, _ := pokerTestCabinet(t, VideoPokerConfig{Cabinet: cabinet, Payout: tier})
for _, variant := range games {
events := table.action("alice", "game "+variant)
p := table.players["alice"]
@@ -32,12 +31,13 @@ func TestPokerEveryCabinetTierGameAndAward(t *testing.T) {
}
}
}
- }
- table.action("alice", "payout low")
- table.leave("alice")
- table.join("bob")
- if table.players["bob"].config.Payout != "low" {
- t.Fatal("machine tier changed with occupant")
+ // The authored tier is machine state, not a player setting: a new
+ // occupant inherits it unchanged.
+ table.leave("alice")
+ table.join("bob")
+ if table.players["bob"].config.Payout != tier {
+ t.Fatalf("%s/%s: tier changed with occupant", cabinet, tier)
+ }
}
}
}