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 },