.slot should now show correct messages if multipliers are changed in the config

This commit is contained in:
Kwoth
2022-07-13 04:01:56 +02:00
parent 251d5a4df4
commit f3ed14de5b
6 changed files with 53 additions and 55 deletions

View File

@@ -8,21 +8,44 @@ public class SlotGame
{
var rolls = new[] { _rng.Next(0, 6), _rng.Next(0, 6), _rng.Next(0, 6) };
var multi = 0;
var winType = SlotWinType.None;
if (rolls.All(x => x == 5))
{
winType = SlotWinType.TrippleJoker;
multi = 30;
}
else if (rolls.All(x => x == rolls[0]))
{
winType = SlotWinType.TrippleNormal;
multi = 10;
}
else if (rolls.Count(x => x == 5) == 2)
{
winType = SlotWinType.DoubleJoker;
multi = 4;
}
else if (rolls.Any(x => x == 5))
{
winType = SlotWinType.SingleJoker;
multi = 1;
}
return new()
{
Won = bet * multi,
WinType = winType,
Multiplier = multi,
Rolls = rolls,
};
}
}
public enum SlotWinType : byte
{
None,
SingleJoker,
DoubleJoker,
TrippleNormal,
TrippleJoker,
}

View File

@@ -5,4 +5,5 @@ public readonly struct SlotResult
public decimal Multiplier { get; init; }
public int[] Rolls { get; init; }
public decimal Won { get; init; }
public SlotWinType WinType { get; init; }
}