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.
This commit is contained in:
CrackmaticSoftware
2025-12-10 21:37:33 +01:00
committed by GitHub
parent 956bfd9b54
commit 061cbaea9e
2 changed files with 28 additions and 15 deletions

View File

@@ -129,13 +129,18 @@ public class LambchopCommand : ICommand
i++; // increase step counter by 1 i++; // increase step counter by 1
continue; continue;
} }
// boundary check for sheep movement
if (i >= tiles.Count)
{
break; // exit if we've gone past the field
}
// normal "move" state // normal "move" state
// let alien follow player // let alien follow player
if (i > FIELD_LENGTH / 2 - 1) if (i > FIELD_LENGTH / 2 - 1)
{ {
hazards[i] = ALIEN; // alien follows you in later part of the map 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 // update previous hazard tile back to desert
hazards[i - 1] = DESERT_TILE; hazards[i - 1] = DESERT_TILE;
@@ -153,8 +158,9 @@ public class LambchopCommand : ICommand
await UpdateGameAsync(); await UpdateGameAsync();
tiles[i] = SKULL; // skull tiles[i] = SKULL; // skull
await UpdateGameAsync(); await UpdateGameAsync();
i++; break;
continue; // i++;
//continue;
} }
else else
{ {
@@ -166,8 +172,9 @@ public class LambchopCommand : ICommand
await UpdateGameAsync(); await UpdateGameAsync();
tiles[i] = SKULL; // skull tiles[i] = SKULL; // skull
await UpdateGameAsync(); await UpdateGameAsync();
i++; break;
continue; //i++;
//continue;
} }
} }
if (i == (targetTile - 1) && win) // trigger win animation if (i == (targetTile - 1) && win) // trigger win animation
@@ -182,29 +189,35 @@ public class LambchopCommand : ICommand
await UpdateGameAsync(lambChopFieldEndState); await UpdateGameAsync(lambChopFieldEndState);
lambChopFieldEndState += CELEBRATION; lambChopFieldEndState += CELEBRATION;
await UpdateGameAsync(lambChopFieldEndState); await UpdateGameAsync(lambChopFieldEndState);
i++; break;
continue; //i++;
//continue;
} }
if (i > FIELD_LENGTH / 2 - 1) if (i > FIELD_LENGTH / 2 - 1)
{ {
// win in the tundra, moneybags // win in the tundra, moneybags
hazards[i] = MONEYBAG; // add moneybag 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(); await UpdateGameAsync();
i++; break;
continue; //i++;
//continue;
} }
else else
{ {
// win in the forrest, medal // win in the forrest, medal
hazards[i] = MEDAL; // add medal hazards[i] = MEDAL; // add medal
if (deathTile != -1) if (deathTile != -1 && deathTile < tiles.Count)
{ {
tiles[deathTile] = RED_TILE; // add deathTile indicator tiles[deathTile] = RED_TILE; // add deathTile indicator
} }
await UpdateGameAsync(); await UpdateGameAsync();
i++; break;
continue; //i++;
//continue;
} }
} }
if (Money.GetRandomDouble(gambler) <= 0.15) if (Money.GetRandomDouble(gambler) <= 0.15)

View File

@@ -38,8 +38,8 @@ public class WheelCommand : ICommand
private const string HIGH_DIFFICULTY_WHEEL = "⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴"; private const string HIGH_DIFFICULTY_WHEEL = "⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴";
private const string MIDDLE_WHEEL_FILL = "....................⮝...................."; private const string MIDDLE_WHEEL_FILL = "....................⮝....................";
// game settings // game settings
private const int MIN_WHEELSPIN_DELAY = 100; private const int MIN_WHEELSPIN_DELAY = 200;
private const int MAX_WHEELSPIN_DELAY = 600; private const int MAX_WHEELSPIN_DELAY = 1000;
private static readonly Dictionary<string, decimal> LOW_DIFF_MULTIS = new() private static readonly Dictionary<string, decimal> LOW_DIFF_MULTIS = new()
{ {
{ "⚫", 0.00m }, { "⚫", 0.00m },