aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_verbs.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-03 02:16:00 -0400
committerhistoria <[not public]>2026-10-03 02:16:00 -0400
commit6232d41e5639f9c38e47b2bb65266e343ca26e8f (patch)
treead0c1676838a6c7e162d3a5c055f914016dac803 /internal/game/cmd_verbs.go
parentefccf58741ae43d9e891c6b743b146982b344ccf (diff)
downloadthehouseoficarus-6232d41e5639f9c38e47b2bb65266e343ca26e8f.tar.gz
feat: add casino_hints option and standardize casino command syntax
Diffstat (limited to 'internal/game/cmd_verbs.go')
-rw-r--r--internal/game/cmd_verbs.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/game/cmd_verbs.go b/internal/game/cmd_verbs.go
index 24957ab..d13b803 100644
--- a/internal/game/cmd_verbs.go
+++ b/internal/game/cmd_verbs.go
@@ -4,6 +4,7 @@ import (
"strings"
"thehouseoficarus/internal/behavior"
+ "thehouseoficarus/internal/casino"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/world"
)
@@ -46,6 +47,19 @@ var alwaysAvailable = []string{
func (g *Game) executeVerbs(sess *net.Session, args []string, rawInput string) {
p := sess.Player
+ // A seated casino player has no room verbs: the only valid commands are
+ // the game's live hints, so what/verbs shows those instead of exits and
+ // objects that cannot be used mid-hand.
+ if g.Casino != nil {
+ if table, playing := g.Casino.Participation(p.Name); playing {
+ if table != nil {
+ g.showCasinoHints(sess, table.Hints(p.Name))
+ } else if machine, ok := g.Casino.MachineFor(p.Name); ok {
+ g.showCasinoHints(sess, machine.Hints())
+ }
+ return
+ }
+ }
showAll := len(args) == 1 && strings.ToLower(args[0]) == "all"
seen := make(map[string]bool)
@@ -208,6 +222,17 @@ func (g *Game) executeVerbs(sess *net.Session, args []string, rawInput string) {
}
}
+// showCasinoHints prints the live command hints for a seated player. It is
+// the casino branch of the what/verbs command, so a casino never lists room
+// exits that are not valid options while seated.
+func (g *Game) showCasinoHints(sess *net.Session, commands []casino.MenuCommand) {
+ if len(commands) == 0 {
+ sess.WriteLine(g.colorize(sess, "casino_action", "No commands are available right now."))
+ return
+ }
+ sess.WriteLine(g.casinoMenuCommands(sess, commands))
+}
+
func addUnique(list *[]string, seen *map[string]bool, cmd string) {
if (*seen)[cmd] {
return