aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/craps_clock.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 14:43:26 -0400
committerhistoria <[not public]>2026-10-02 14:43:26 -0400
commit4f40f116ba884111c9a66849e620ff9fbc67530a (patch)
treeaf407f199be482f9aac997d2cfaa0d86a806d8ff /internal/casino/craps_clock.go
parent62017c86392b046d746fb4fafef6742840477c5f (diff)
downloadthehouseoficarus-4f40f116ba884111c9a66849e620ff9fbc67530a.tar.gz
feat: compact craps layout, ux cleanup
Diffstat (limited to 'internal/casino/craps_clock.go')
-rw-r--r--internal/casino/craps_clock.go23
1 files changed, 22 insertions, 1 deletions
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