aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino_ux.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/casino_ux.go')
-rw-r--r--internal/game/casino_ux.go41
1 files changed, 20 insertions, 21 deletions
diff --git a/internal/game/casino_ux.go b/internal/game/casino_ux.go
index 6d666f7..28fc361 100644
--- a/internal/game/casino_ux.go
+++ b/internal/game/casino_ux.go
@@ -365,7 +365,11 @@ func (g *Game) executeList(sess *net.Session, args []string, rawInput string) {
return
}
if machine, ok := g.Casino.MachineFor(p.Name); ok {
- sess.WriteLine(g.colorize(sess, "casino_action", "A "+casinoGameLabel(machine.Config.Game)+" takes one wager: bet <amount> (or bet max), then spin or autospin."))
+ row := casinoListRow{bet: "bet <amount> / max", odds: "paytable", win: "spin / autospin"}
+ if _, enabled := g.casinoEdgePrecision(sess); enabled {
+ row.edge = machine.Config.HouseEdge()
+ }
+ g.showCasinoListTable(sess, "", []casinoListRow{row})
return
}
if table, playing := g.Casino.Participation(p.Name); playing && table != nil {
@@ -375,9 +379,8 @@ func (g *Game) executeList(sess *net.Session, args []string, rawInput string) {
g.executeShopList(sess, args, rawInput)
}
-// showCasinoWagerList renders the game's live wager list. Two or more rows
-// become a brief table; a single row is one line; an empty list means the
-// only bet is the ordinary amount-only wager.
+// showCasinoWagerList renders the live bets/actions as a compact table.
+// An empty wager catalogue can still represent an ordinary amount-only bet.
func (g *Game) showCasinoWagerList(sess *net.Session, t *casino.Table) {
if t.Config.Game == casino.GameVideoPoker {
for _, h := range t.Hints(sess.Player.Name) {
@@ -386,24 +389,18 @@ func (g *Game) showCasinoWagerList(sess *net.Session, t *casino.Table) {
return
}
}
- sess.WriteLine("This cabinet has one wager: load coins with bet [1-4|max], then deal. Use paytable for payouts.")
+ rows := g.casinoListRows(sess, t, []casino.WagerRow{{Bet: "main", Payout: "paytable", Win: "deal"}})
+ rows[0].bet = "bet [1-4|max]"
+ g.showCasinoListTable(sess, "", rows)
return
}
rows := t.Wagers(sess.Player.Name)
// Blackjack rows are actions, not targets for a new bet.
if t.Config.Game == casino.GameBlackjack && len(rows) > 0 {
- commands := make([]casino.MenuCommand, 0, len(rows))
- for _, r := range rows {
- commands = append(commands, casino.MenuCommand{Command: r.Bet, Desc: strings.Trim(r.Payout+" | "+r.Win, " |")})
- }
- sess.WriteLine(g.renderCasinoCommands(sess, g.casinoBalance(sess), "Available actions", commands))
+ g.showCasinoListTable(sess, "", g.casinoListRows(sess, t, rows))
return
}
- switch {
- case len(rows) == 1:
- r := rows[0]
- sess.WriteLine(g.colorize(sess, "casino_action", "Your only wager: bet <amount> on "+r.Bet+" — "+r.Payout+" — "+r.Win+"."))
- case len(rows) == 0:
+ if len(rows) == 0 {
canBet := false
for _, h := range t.Hints(sess.Player.Name) {
if strings.HasPrefix(h.Command, "bet ") {
@@ -414,14 +411,16 @@ func (g *Game) showCasinoWagerList(sess *net.Session, t *casino.Table) {
sess.WriteLine(g.colorize(sess, "casino_action", "No new wagers are available right now."))
return
}
- sess.WriteLine(g.colorize(sess, "casino_action", "The only wager here is bet <amount>") + " (" + betRangeWords(t.Config.MinBet, t.Config.MaxBet) + ").")
- default:
- commands := make([]casino.MenuCommand, 0, len(rows))
- for _, r := range rows {
- commands = append(commands, casino.MenuCommand{Command: "bet <amount> on " + r.Bet, Desc: r.Payout + " | " + r.Win})
+ wager := casino.WagerRow{Bet: "main", Win: betRangeWords(t.Config.MinBet, t.Config.MaxBet)}
+ if t.Config.Game == casino.GameBlackjack {
+ wager.Payout = fmt.Sprintf("1:1; BJ %g:1", t.Config.Blackjack.Normalize().BlackjackPayout)
}
- sess.WriteLine(g.renderCasinoCommands(sess, g.casinoBalance(sess), t.Config.Label()+" — available bets", commands))
+ list := g.casinoListRows(sess, t, []casino.WagerRow{wager})
+ list[0].bet = "bet <amount>"
+ g.showCasinoListTable(sess, "", list)
+ return
}
+ g.showCasinoListTable(sess, "bet <amount> on <bet>", g.casinoListRows(sess, t, rows))
}
// showCasinoGameLook appends the live game state and hint menu for the