aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/blackjack.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/blackjack.go')
-rw-r--r--internal/casino/blackjack.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/casino/blackjack.go b/internal/casino/blackjack.go
index 3bc70b4..a059bdb 100644
--- a/internal/casino/blackjack.go
+++ b/internal/casino/blackjack.go
@@ -704,11 +704,21 @@ func (t *blackjackTable) settle() []Event {
events = append(events, t.playerAction(p.Name, p.Name+"’s settlement is pending recovery.", payoutFailedMessage()))
continue
}
- label := ""
+ label := "Hand"
+ if result == "blackjack" {
+ label = "Blackjack"
+ }
if len(p.hands) > 1 {
label = fmt.Sprintf("Hand %d/%d", i+1, len(p.hands))
}
- lines = append(lines, settlementLine{Label: label, Result: result, Stake: hand.bet, Returned: payout})
+ odds := "1:1"
+ if result == "blackjack" {
+ odds = payoutRatio(t.Rules.BlackjackPayout)
+ }
+ if result == "surrender" {
+ label += " (surrender)"
+ }
+ lines = append(lines, settlementLine{Label: label, Odds: odds, Result: result, Stake: hand.bet, Returned: payout})
}
if p.insurance > 0 {
insurancePayout := 0
@@ -719,7 +729,7 @@ func (t *blackjackTable) settle() []Event {
if settleStakeOutcome(p.Wallet, insurancePayout, []string{p.insuranceStakeID}, insuranceErr) {
events = append(events, t.private(p.Name, payoutFailedMessage()))
} else {
- lines = append(lines, settlementLine{Label: "Insurance", Result: "insurance", Stake: p.insurance, Returned: insurancePayout})
+ lines = append(lines, settlementLine{Label: "Insurance", Odds: payoutRatio(t.Rules.InsurancePayout), Result: "insurance", Stake: p.insurance, Returned: insurancePayout})
}
}
// One settlement per player reports the round's net once and then
@@ -727,6 +737,7 @@ func (t *blackjackTable) settle() []Event {
// keeps the headline only; splits and insurance get the itemized list.
if len(lines) > 0 {
settlement := t.playerAction(p.Name, blackjackPublicResult(p.Name, lines), settlementText(lines))
+ settlement.Settlement = lines
settlement.ShowBalance = needsBalance
settlement.Color = settlementTag(lines)
events = append(events, settlement)