diff options
| author | historia <[not public]> | 2026-10-01 22:47:41 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-01 22:47:41 -0400 |
| commit | 8eea0e4e06a4aaa6a18edabd9897d3bea1ea2ca0 (patch) | |
| tree | 63698c0618f382a553d4558a33e3d2087039c378 /internal/casino/video_poker.go | |
| parent | 6d9908b29c8187196d23b126b1165c7e0bd0fc76 (diff) | |
| download | thehouseoficarus-8eea0e4e06a4aaa6a18edabd9897d3bea1ea2ca0.tar.gz | |
feat: consistent wager outcome table across casino games
Diffstat (limited to 'internal/casino/video_poker.go')
| -rw-r--r-- | internal/casino/video_poker.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/internal/casino/video_poker.go b/internal/casino/video_poker.go index cc4ccfa..a22d3c8 100644 --- a/internal/casino/video_poker.go +++ b/internal/casino/video_poker.go @@ -503,8 +503,23 @@ func (t *videoPokerTable) drawLocked(name string, p *pokerPlayer) []Event { } t.banks = banks p.active = false - p.result = fmt.Sprintf("Total return %d coins = %d credits", p.payout/p.denomination, p.payout) + p.result = "" events := t.statusLocked(name, false) + lines := make([]SettlementLine, 0, len(p.lines)) + for i, hand := range p.lines { + stake := p.wager.Total / p.hands + returned := hand.Coins * p.denomination + result := "loss" + if hand.Coins > 0 { + result = "win" + } + odds := "Varies" + if hand.Coins > 0 { + odds = profitOdds(returned-stake, stake) + } + lines = append(lines, SettlementLine{Label: fmt.Sprintf("Hand %d ยท %s", i+1, hand.Category), Odds: odds, Stake: stake, Returned: returned, Result: result}) + } + events[0].Settlement = lines if p.disconnected { delete(t.players, name) } |
