From 061cbaea9e922965fc634f5653b65b5b3b6b34b8 Mon Sep 17 00:00:00 2001 From: CrackmaticSoftware <248342529+CrackmaticSoftware@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:37:33 +0100 Subject: [PATCH] lambchop fix maybe (#9) * fix dice lose print * dice can now display rigged results * lambchop * removed GetRandomNext * updated lambchop randomness to use GetRandomNumber() * Change lambchop game timeout to 12 seconds * lambchop quickfix * sync * wheel game * new newBalance calculation * wheel quickfix * experimental lambchop fix. Increased wheel animation time. --- .../Commands/Kasino/LambchopCommand.cs | 39 ++++++++++++------- .../Commands/Kasino/WheelCommand.cs | 4 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/KfChatDotNetBot/Commands/Kasino/LambchopCommand.cs b/KfChatDotNetBot/Commands/Kasino/LambchopCommand.cs index f61d21d..f88a115 100644 --- a/KfChatDotNetBot/Commands/Kasino/LambchopCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/LambchopCommand.cs @@ -129,13 +129,18 @@ public class LambchopCommand : ICommand i++; // increase step counter by 1 continue; } + // boundary check for sheep movement + if (i >= tiles.Count) + { + break; // exit if we've gone past the field + } // normal "move" state // let alien follow player if (i > FIELD_LENGTH / 2 - 1) { hazards[i] = ALIEN; // alien follows you in later part of the map - if (hazards[i - 1] == ALIEN) + if (i > 0 && hazards[i - 1] == ALIEN) { // update previous hazard tile back to desert hazards[i - 1] = DESERT_TILE; @@ -153,8 +158,9 @@ public class LambchopCommand : ICommand await UpdateGameAsync(); tiles[i] = SKULL; // skull await UpdateGameAsync(); - i++; - continue; + break; + // i++; + //continue; } else { @@ -166,8 +172,9 @@ public class LambchopCommand : ICommand await UpdateGameAsync(); tiles[i] = SKULL; // skull await UpdateGameAsync(); - i++; - continue; + break; + //i++; + //continue; } } if (i == (targetTile - 1) && win) // trigger win animation @@ -182,29 +189,35 @@ public class LambchopCommand : ICommand await UpdateGameAsync(lambChopFieldEndState); lambChopFieldEndState += CELEBRATION; await UpdateGameAsync(lambChopFieldEndState); - i++; - continue; + break; + //i++; + //continue; } if (i > FIELD_LENGTH / 2 - 1) { // win in the tundra, moneybags hazards[i] = MONEYBAG; // add moneybag - tiles[deathTile] = RED_TILE; // add deathTile indicator + if (deathTile >= 0 && deathTile < tiles.Count) + { + tiles[deathTile] = RED_TILE; // add deathTile indicator + } await UpdateGameAsync(); - i++; - continue; + break; + //i++; + //continue; } else { // win in the forrest, medal hazards[i] = MEDAL; // add medal - if (deathTile != -1) + if (deathTile != -1 && deathTile < tiles.Count) { tiles[deathTile] = RED_TILE; // add deathTile indicator } await UpdateGameAsync(); - i++; - continue; + break; + //i++; + //continue; } } if (Money.GetRandomDouble(gambler) <= 0.15) diff --git a/KfChatDotNetBot/Commands/Kasino/WheelCommand.cs b/KfChatDotNetBot/Commands/Kasino/WheelCommand.cs index 5dee261..777636e 100644 --- a/KfChatDotNetBot/Commands/Kasino/WheelCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/WheelCommand.cs @@ -38,8 +38,8 @@ public class WheelCommand : ICommand private const string HIGH_DIFFICULTY_WHEEL = "⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴"; private const string MIDDLE_WHEEL_FILL = "....................⮝...................."; // game settings - private const int MIN_WHEELSPIN_DELAY = 100; - private const int MAX_WHEELSPIN_DELAY = 600; + private const int MIN_WHEELSPIN_DELAY = 200; + private const int MAX_WHEELSPIN_DELAY = 1000; private static readonly Dictionary LOW_DIFF_MULTIS = new() { { "⚫", 0.00m },