mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03:22:04 -04:00
fix error, add delay to win message (#89)
* Update SlotsCommand.cs adds delay for win message * Update SlotsCommand.cs add delay, fix rigslotboard error, was checking the wrong diagonal
This commit is contained in:
@@ -156,6 +156,7 @@ public class SlotsCommand : ICommand
|
||||
string winstr = netwin ? "" : "-";
|
||||
newBalance = await Money.NewWagerAsync(gambler.Id, wager*spins, winnings, WagerGame.Slots, ct: ctx);
|
||||
winnings = Math.Abs(winnings);
|
||||
await Task.Delay(TimeSpan.FromSeconds(spins * 2));
|
||||
await botInstance.SendChatMessageAsync(
|
||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won[/color] {await rawWinnings.FormatKasinoCurrencyAsync()} from {spins} spins worth {await wager.FormatKasinoCurrencyAsync()}! Net: {winstr}{await winnings.FormatKasinoCurrencyAsync()} Current balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter: TimeSpan.FromSeconds(30));
|
||||
}
|
||||
@@ -669,7 +670,7 @@ public class SlotsCommand : ICommand
|
||||
{
|
||||
//check both diagonals above for 1 space and 2 spaces behind
|
||||
while (_preboard[row - 1, col - 1] == _preboard[row, col] ||
|
||||
_preboard[row + 1, col + 1] == _preboard[row, col] ||
|
||||
_preboard[row - 1, col + 1] == _preboard[row, col] ||
|
||||
_preboard[row, col - 1] == _preboard[row, col] ||
|
||||
_preboard[row, col - 2] == _preboard[row, col])
|
||||
{
|
||||
@@ -680,6 +681,7 @@ public class SlotsCommand : ICommand
|
||||
if (loopCounter > 10000) throw new Exception($"Failed to rig slot board after 10000 attempts. Got stuck on row {row} col {col}.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user