mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
kasino shop updated all chat message id to uuid (#95)
* Update KasinoMines.cs * Update SlotsCommand.cs * Update MinesCommand.cs * Update PlinkoCommand.cs * Update PlinkoCommand.cs * Update PlinkoCommand.cs * Update PlanesCommand.cs * Update LimboCommand.cs * Update KenoCommand.cs * Update KasinoUserCommands.cs * Update KasinoRain.cs * Create KasinoShop.cs * Create ShopCommands.cs * Update BotServices.cs * Update MoneyDbModels.cs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using Humanizer;
|
||||
using KfChatDotNetBot.Extensions;
|
||||
using KfChatDotNetBot.Models;
|
||||
@@ -30,6 +30,14 @@ public class GetBalanceCommand : ICommand
|
||||
var gambler = await Money.GetGamblerEntityAsync(user.Id, ct: ctx);
|
||||
await botInstance.SendChatMessageAsync(
|
||||
$"{user.FormatUsername()}, your balance is {await gambler!.Balance.FormatKasinoCurrencyAsync()}", true);
|
||||
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.SendChatMessageAsync(
|
||||
$"{await botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].FormatBalanceAsync()}", true,
|
||||
autoDeleteAfter: TimeSpan.FromSeconds(10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +125,14 @@ public class SendJuiceCommand : ICommand
|
||||
await Money.ModifyBalanceAsync(targetGambler.Id, amount, TransactionSourceEventType.Juicer, $"Juice from {user.KfUsername}",
|
||||
gambler.Id, ctx);
|
||||
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, {await amount.FormatKasinoCurrencyAsync()} has been sent to {targetUser.FormatUsername()}", true);
|
||||
//KasinoShop stuff --------------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, gambler.User, gambler);
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, targetGambler.User, targetGambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessJuicerOrRainTracking(gambler, targetGambler, amount);
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,4 +476,4 @@ public class GetDailyDollarCommand : ICommand
|
||||
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, you redeemed {await amount.FormatKasinoCurrencyAsync()}", true,
|
||||
autoDeleteAfter: TimeSpan.FromSeconds(15));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,13 @@ public class KenoCommand : ICommand
|
||||
RateLimitService.RemoveMostRecentEntry(user, this);
|
||||
return;
|
||||
}
|
||||
|
||||
//KasinoShop stuff -------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
HOUSE_EDGE += botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].HouseEdgeModifier;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
var payoutMultipliersHigh =
|
||||
new[,] //stole the payout multis from stake keno and re added the RTP, except for the 1000x
|
||||
{
|
||||
@@ -193,6 +199,13 @@ public class KenoCommand : ICommand
|
||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]lost {await wager.FormatKasinoCurrencyAsync()}[/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}.",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
botInstance.ScheduleMessageAutoDelete(_kenoTable ?? throw new Exception("Cannot clean up _kenoTable as it's null"), cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Keno, wager, -wager, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,6 +217,13 @@ public class KenoCommand : ICommand
|
||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won {await win.FormatKasinoCurrencyAsync()} with a {payoutMulti}x multi![/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}.",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
botInstance.ScheduleMessageAutoDelete(_kenoTable ?? throw new Exception("Cannot clean up _kenotable as it's null"), cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Keno, wager, win, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
private async Task AnimatedDisplayTable(List<int> playerNumbers, List<int> casinoNumbers, List<int> matches, ChatBot botInstance)
|
||||
|
||||
@@ -83,6 +83,14 @@ public class LimboCommand : ICommand
|
||||
RateLimitService.RemoveMostRecentEntry(user, this);
|
||||
return;
|
||||
}
|
||||
|
||||
//KasinoShop stuff -------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
HOUSE_EDGE += botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].HouseEdgeModifier;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
if (!arguments.TryGetValue("number", out var number))
|
||||
{
|
||||
@@ -110,6 +118,13 @@ public class LimboCommand : ICommand
|
||||
await botInstance.SendChatMessageAsync($"[b][color={colorToUse}] {casinoNumbers[1]:N2}[/color][/b][br]{user.FormatUsername()}, you " +
|
||||
$"[color={settings[BuiltIn.Keys.KiwiFarmsGreenColor].Value}] won {await win.FormatKasinoCurrencyAsync()}![/color] " +
|
||||
$"Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}!", true, autoDeleteAfter: cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Limbo, wager, win, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,6 +138,13 @@ public class LimboCommand : ICommand
|
||||
$"[b][color={colorToUse}] {casinoNumbers[1]:N2}[/color][/b][br]{user.FormatUsername()}, you [color={settings[BuiltIn.Keys.KiwiFarmsRedColor].Value}]" +
|
||||
$"lost {await wager.FormatKasinoCurrencyAsync()}[/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}.",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Limbo, wager, -wager, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -206,11 +206,11 @@ public class MinesCommand : ICommand
|
||||
return;
|
||||
}
|
||||
}
|
||||
await KasinoMines.Bet(gambler.Id, precisePicks, msg, cashout);
|
||||
await KasinoMines.Bet(gambler, precisePicks, msg, cashout);
|
||||
}
|
||||
else //if using picks
|
||||
{
|
||||
await KasinoMines.Bet(gambler.Id, pick, msg, cashout);
|
||||
await KasinoMines.Bet(gambler, pick, msg, cashout);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -291,12 +291,12 @@ public class MinesCommand : ICommand
|
||||
return;
|
||||
}
|
||||
}
|
||||
await KasinoMines.Bet(gambler.Id, precisePicks, msg, cashout);
|
||||
await KasinoMines.Bet(gambler, precisePicks, msg, cashout);
|
||||
|
||||
}
|
||||
else //if using picks
|
||||
{
|
||||
await KasinoMines.Bet(gambler.Id, pick, msg, cashout);
|
||||
await KasinoMines.Bet(gambler, pick, msg, cashout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,6 +92,14 @@ public class Planes : ICommand
|
||||
RateLimitService.RemoveMostRecentEntry(user, this);
|
||||
return;
|
||||
}
|
||||
|
||||
//KasinoShop stuff -------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
HOUSE_EDGE += botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].HouseEdgeModifier;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
if (HOUSE_EDGE < 1)
|
||||
{
|
||||
@@ -269,6 +277,13 @@ public class Planes : ICommand
|
||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]successfully landed with {await win.FormatKasinoCurrencyAsync()} from a total {plane.MultiTracker:N2}x multi![/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
botInstance.ScheduleMessageAutoDelete(msgId, cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Planes, wager, win, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
return;
|
||||
}
|
||||
plane.Crash();
|
||||
@@ -280,6 +295,13 @@ public class Planes : ICommand
|
||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
botInstance.ScheduleMessageAutoDelete(msgId, cleanupDelay);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Planes, wager, -wager, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
private string GetPreGameBoard(int fullCounter, int[,] planesBoard, Plane plane, int carrierCount, bool noseUp)
|
||||
|
||||
@@ -132,6 +132,15 @@ public class PlinkoCommand : ICommand
|
||||
var gambler = await Money.GetGamblerEntityAsync(user.Id, ct: ctx);
|
||||
if (gambler == null)
|
||||
throw new InvalidOperationException($"Caught a null when retrieving gambler for {user.KfUsername}");
|
||||
|
||||
//KasinoShop stuff -------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
HOUSE_EDGE += botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].HouseEdgeModifier;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
int numberOfBalls = 0;
|
||||
if (!arguments.TryGetValue("number", out var number))
|
||||
{
|
||||
@@ -225,7 +234,13 @@ public class PlinkoCommand : ICommand
|
||||
}
|
||||
var newBalance = await Money.NewWagerAsync(gambler.Id, wager*numberOfBalls, payout-(wager*numberOfBalls), WagerGame.Plinko, ct: ctx);
|
||||
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, [u]you won {await payout.FormatKasinoCurrencyAsync()} from {numberOfBalls} plinko balls worth ${wager} KKK. Balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter: cleanupDelay);
|
||||
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Plinko, wager*numberOfBalls, payout-(wager*numberOfBalls), newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
public string PlinkoBoardDisplay(List<PlinkoBall> balls)
|
||||
|
||||
@@ -98,7 +98,13 @@ public class SlotsCommand : ICommand
|
||||
RateLimitService.RemoveMostRecentEntry(user, this);
|
||||
return;
|
||||
}
|
||||
|
||||
//KasinoShop stuff -------------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
HOUSE_EDGE += botInstance.BotServices.KasinoShop.Gambler_Profiles[user.KfId].HouseEdgeModifier;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
char rigged = '0';
|
||||
decimal rigCheck = (decimal)Money.GetRandomDouble(gambler);
|
||||
if (HOUSE_EDGE > 1)
|
||||
@@ -151,6 +157,13 @@ public class SlotsCommand : ICommand
|
||||
await botInstance.SendChatMessageAsync(
|
||||
$"{user.FormatUsername()} you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]lost[/color] {await totalWager.FormatKasinoCurrencyAsync()} with {spins} spins. Current balance: {await newBalance.FormatKasinoCurrencyAsync()}",
|
||||
true, autoDeleteAfter: TimeSpan.FromSeconds(30));
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Slots, wager*spins, -wager*spins, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -161,6 +174,13 @@ public class SlotsCommand : ICommand
|
||||
string winstr = netwin ? "" : "-";
|
||||
newBalance = await Money.NewWagerAsync(gambler.Id, wager*spins, winnings, WagerGame.Slots, ct: ctx);
|
||||
winnings = Math.Abs(winnings);
|
||||
//Kasino Shop stuff----------------------------------------------------------------------
|
||||
if (botInstance.BotServices.KasinoShop != null)
|
||||
{
|
||||
await GlobalShopFunctions.CheckProfile(botInstance, user, gambler);
|
||||
await botInstance.BotServices.KasinoShop.ProcessWagerTracking(gambler, WagerGame.Slots, wager*spins, winnings, newBalance);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user