aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-03 01:38:58 -0400
committerhistoria <[not public]>2026-10-03 01:38:58 -0400
commit0ec8f3692960a064616e630c914058298b22897b (patch)
tree2b51327eb66be7df8fdcd7c12cc306ca6fa84891 /internal/game/casino.go
parent82e571d227feeafd0af4011e701ce26b99c5e3d9 (diff)
downloadthehouseoficarus-0ec8f3692960a064616e630c914058298b22897b.tar.gz
feat: replaced roulette wheel graphic with line-by-line 'spin'
Diffstat (limited to 'internal/game/casino.go')
-rw-r--r--internal/game/casino.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/internal/game/casino.go b/internal/game/casino.go
index 5e09d48..0b16114 100644
--- a/internal/game/casino.go
+++ b/internal/game/casino.go
@@ -539,6 +539,20 @@ func (g *Game) executeTableAction(sess *net.Session, action string) {
g.emitCasinoEvents(g.Casino.Action(table.RoomID, table.Config.ID, p.Name, action))
}
+// Keep the automatic post-command prompt out of a seated player's spin
+// animation. Settlement menus resume prompting once the table leaves playing.
+func (g *Game) rouletteSpinning(sess *net.Session) bool {
+ if g.Casino == nil || sess == nil || sess.Player == nil {
+ return false
+ }
+ table, playing := g.Casino.Participation(sess.Player.Name)
+ if !playing || table == nil || table.Config.Game != casino.GameRoulette {
+ return false
+ }
+ s, ok := table.Board(sess.Player.Name).(*casino.RouletteSnapshot)
+ return ok && s.Phase == "playing"
+}
+
func (g *Game) CasinoTick() {
if g.Casino != nil {
g.emitCasinoEvents(g.Casino.Tick())
@@ -569,7 +583,10 @@ func (g *Game) emitCasinoEvents(events []casino.Event) {
message := g.casinoProse(sess, category, g.casinoTimeText(event.Message))
if details {
if rendered := g.renderCasinoSnapshot(sess, event.Snapshot); rendered != "" {
- message += "\n" + rendered
+ if message != "" {
+ message += "\n"
+ }
+ message += rendered
}
}
if message != "" {