Payout fix and wager limit for Plinko

This commit is contained in:
barelyprofessional
2026-01-09 00:10:09 -06:00
parent e4f8085350
commit d351dc580c

View File

@@ -123,6 +123,13 @@ public class PlinkoCommand : ICommand
return; return;
} }
var wager = Convert.ToDecimal(amount.Value); var wager = Convert.ToDecimal(amount.Value);
if (wager > 1)
{
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, plinko is currently limited to 1 KKK wagers while bugs are ironed out.", true,
autoDeleteAfter: TimeSpan.FromSeconds(15));
return;
}
var gambler = await Money.GetGamblerEntityAsync(user.Id, ct: ctx); var gambler = await Money.GetGamblerEntityAsync(user.Id, ct: ctx);
if (gambler == null) if (gambler == null)
throw new InvalidOperationException($"Caught a null when retrieving gambler for {user.KfUsername}"); throw new InvalidOperationException($"Caught a null when retrieving gambler for {user.KfUsername}");
@@ -203,7 +210,7 @@ public class PlinkoCommand : ICommand
await Task.Delay(500); await Task.Delay(500);
} }
var newBalance = await Money.NewWagerAsync(gambler.Id, wager*numberOfBalls, payout, WagerGame.Plinko, ct: ctx); var newBalance = await Money.NewWagerAsync(gambler.Id, payout-(wager*numberOfBalls), payout, WagerGame.Plinko, ct: ctx);
await botInstance.SendChatMessageAsync($"[u]{user.FormatUsername()}, you won ${payout} KKK from {numberOfBalls} plinko balls worth ${wager} KKK. Balance: ${newBalance} KKK", true, autoDeleteAfter: cleanupDelay); await botInstance.SendChatMessageAsync($"[u]{user.FormatUsername()}, you won ${payout} KKK from {numberOfBalls} plinko balls worth ${wager} KKK. Balance: ${newBalance} KKK", true, autoDeleteAfter: cleanupDelay);
} }