From 4f40f116ba884111c9a66849e620ff9fbc67530a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 14:43:26 -0400 Subject: feat: compact craps layout, ux cleanup --- internal/casino/craps_clock.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'internal/casino/craps_clock.go') diff --git a/internal/casino/craps_clock.go b/internal/casino/craps_clock.go index bbba19e..ab28329 100644 --- a/internal/casino/craps_clock.go +++ b/internal/casino/craps_clock.go @@ -13,6 +13,10 @@ const ( // Simplified craps has no manual roll: one shared automatic countdown // starts with the first live bet and resolves every wager. crapsSimplifiedDelay = 3 * time.Second + + // A requested manual roll first shows the shake, then the outcome chart, + // then resolves the dice five ticks (three seconds) later. + crapsManualRollDelay = 3 * time.Second ) func crapsSeconds(d time.Duration) int { @@ -118,7 +122,24 @@ func (t *crapsTable) tickElapsed(elapsed time.Duration) []Event { } return events } - if elapsed <= 0 || !t.hasLiveBets() { + if elapsed <= 0 { + return events + } + if t.pendingRoll > 0 { + // A manual roll is in the air: no other deadline may fire first. Only + // the shake is announced now; the result follows when the dice land. + if !t.hasLiveBets() { + t.pendingRoll = 0 + return events + } + t.pendingRoll -= elapsed + if t.pendingRoll <= 0 { + t.pendingRoll = 0 + return append(events, t.roll()...) + } + return events + } + if !t.hasLiveBets() { return events } t.roundElapsed += elapsed -- cgit v1.2.3