From 6232d41e5639f9c38e47b2bb65266e343ca26e8f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 3 Oct 2026 02:16:00 -0400 Subject: feat: add casino_hints option and standardize casino command syntax --- internal/game/cmd_verbs.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'internal/game/cmd_verbs.go') 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 -- cgit v1.2.3