From 9951e2d5afbcabb4bd8016b6d160653c1ec5ed8e Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:45:43 +0100 Subject: v1.3.0: simplify payouts to bet x symbol x shape --- src/client/games/slots.rs | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/client/games') diff --git a/src/client/games/slots.rs b/src/client/games/slots.rs index a417e7d..ad9ef5c 100644 --- a/src/client/games/slots.rs +++ b/src/client/games/slots.rs @@ -1,5 +1,5 @@ use super::traits::{Game, GamePhase, GameState}; -use crate::slots::{paytable_lines, REELS, ROWS}; +use crate::slots::{paytable_lines, LINE_NAMES, REELS, ROWS}; /// Height of the game board. It must never depend on the spin result. pub const SLOT_BOARD_LINES: usize = 10; @@ -81,7 +81,21 @@ impl SlotsGame { } match state.data.get("win_lines").map(String::as_str) { Some(lines) if !lines.is_empty() && lines != "-" => { - format!("Winning lines: {lines}") + let named: Vec = lines + .split(',') + .filter_map(|raw| raw.trim().parse::().ok()) + .map(|line| { + let name = line + .checked_sub(1) + .and_then(|index| LINE_NAMES.get(index)) + .copied(); + match name { + Some(name) => format!("{line} ({name})"), + None => line.to_string(), + } + }) + .collect(); + format!("Winning lines: {}", named.join(", ")) } _ => String::new(), } @@ -126,15 +140,14 @@ impl Game for SlotsGame { "SLOTS GAME\n\ =========\n\ 5 reels x 3 rows, 5 paylines.\n\ - Match 3, 4 or 5 symbols from the left on a payline.\n\ + A win needs 3, 4 or 5 matching symbols from reel 1 on a payline.\n\ \n\ - Payouts (x total bet, 3/4/5 of a kind):\n\ - C: 2 / 5 / 15\n\ - L: 3 / 7 / 20\n\ - O: 3 / 8 / 25\n\ - G: 4 / 12 / 40\n\ - D: 6 / 18 / 70\n\ - S: 9 / 30 / 150\n\ + Payout = total bet x symbol x shape\n\ + Symbols: C=1 L=2 O=3 G=4 D=6 S=10\n\ + Shapes: 3 of a kind=1, 4 of a kind=3, 5 of a kind=14\n\ + \n\ + Lines: 1 top, 2 middle, 3 bottom, 4 V, 5 inverted V\n\ + Multiple winning lines are added together.\n\ \n\ Symbols: C=Cherry, L=Lemon, O=Orange, G=Grapes, D=Diamond, S=Seven\n\ \n\ -- cgit v1.2.3