Removed some pointless decimal conversion. Subtract wager from winnings.

This commit is contained in:
barelyprofessional
2025-12-25 19:31:09 -06:00
parent 0301a6c2d3
commit fe1ab566d1
2 changed files with 6 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ public class SlotsCommand : ICommand
return; return;
} }
await botInstance.SendChatMessageAsync($"[img]{imageUrl}[/img]", true, autoDeleteAfter:TimeSpan.FromMinutes(3)); //posts image to chat await botInstance.SendChatMessageAsync($"[img]{imageUrl}[/img]", true, autoDeleteAfter:TimeSpan.FromMinutes(3)); //posts image to chat
var winnings = Convert.ToDecimal(board.RunningTotalDisplay); var winnings = board.RunningTotalDisplay;
var colors = var colors =
await SettingsProvider.GetMultipleValuesAsync([ await SettingsProvider.GetMultipleValuesAsync([
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor
@@ -91,14 +91,15 @@ public class SlotsCommand : ICommand
decimal newBalance; decimal newBalance;
if (winnings == 0) //dud spin if (winnings == 0) //dud spin
{ {
newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.Keno, ct: ctx); newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.Slots, ct: ctx);
await botInstance.SendChatMessageAsync( await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()} you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]lost[/color]. Current balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter:TimeSpan.FromSeconds(30)); $"{user.FormatUsername()} you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]lost[/color]. Current balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter:TimeSpan.FromSeconds(30));
return; return;
} }
//if you win //if you win
var featureAddOn = board.GotFeature ? "Congrats on the feature." : ""; var featureAddOn = board.GotFeature ? "Congrats on the feature." : "";
newBalance = await Money.NewWagerAsync(gambler.Id, wager, Convert.ToDecimal(winnings), WagerGame.Keno, ct: ctx); winnings -= wager;
newBalance = await Money.NewWagerAsync(gambler.Id, wager, winnings, WagerGame.Slots, ct: ctx);
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]win[/color]! Current balance: {await newBalance.FormatKasinoCurrencyAsync()}" + await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]win[/color]! Current balance: {await newBalance.FormatKasinoCurrencyAsync()}" +
$"{featureAddOn}", true, autoDeleteAfter:TimeSpan.FromSeconds(30)); $"{featureAddOn}", true, autoDeleteAfter:TimeSpan.FromSeconds(30));
} }

View File

@@ -290,7 +290,8 @@ public enum WagerGame
Event, Event,
[Description("Guess what number I'm thinking of")] [Description("Guess what number I'm thinking of")]
GuessWhatNumber, GuessWhatNumber,
Wheel Wheel,
Slots
} }
public enum GamblerState public enum GamblerState