mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-15 10:32:44 -04:00
small planes (#114)
* small planes small planes * Add KasinoPlanesSize setting for Planes board Add KasinoPlanesSize setting for Planes board
This commit is contained in:
@@ -119,7 +119,7 @@ public class Planes : ICommand
|
|||||||
_riggedWin = true;
|
_riggedWin = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var size = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoPlanesSize)).ToType<int>();
|
||||||
var planesBoard = CreatePlanesBoard(gambler,0);
|
var planesBoard = CreatePlanesBoard(gambler,0);
|
||||||
var planesBoard2 = CreatePlanesBoard(gambler);
|
var planesBoard2 = CreatePlanesBoard(gambler);
|
||||||
var planesBoard3 = CreatePlanesBoard(gambler);
|
var planesBoard3 = CreatePlanesBoard(gambler);
|
||||||
@@ -129,7 +129,7 @@ public class Planes : ICommand
|
|||||||
var fullCounter = 0;
|
var fullCounter = 0;
|
||||||
var noseUp = true;
|
var noseUp = true;
|
||||||
var planesDisplay = GetPreGameBoard(-3, planesBoard2, plane, CarrierCount, noseUp);
|
var planesDisplay = GetPreGameBoard(-3, planesBoard2, plane, CarrierCount, noseUp);
|
||||||
var msgId = await botInstance.SendChatMessageAsync(planesDisplay, true);
|
var msgId = await botInstance.SendChatMessageAsync($"[size={size}]" + planesDisplay, true);
|
||||||
var num = 0;
|
var num = 0;
|
||||||
while (msgId.ChatMessageUuid == null)
|
while (msgId.ChatMessageUuid == null)
|
||||||
{
|
{
|
||||||
@@ -160,7 +160,7 @@ public class Planes : ICommand
|
|||||||
}
|
}
|
||||||
var winnings = plane.MultiTracker * wager;
|
var winnings = plane.MultiTracker * wager;
|
||||||
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
|
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
|
||||||
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
|
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, $"[size={size}]" + planesDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
var neutral = false;
|
var neutral = false;
|
||||||
@@ -171,7 +171,7 @@ public class Planes : ICommand
|
|||||||
{
|
{
|
||||||
counter = (fullCounter - 3) % 24;
|
counter = (fullCounter - 3) % 24;
|
||||||
planesDisplay = GetPreGameBoard(fullCounter, planesBoard2, plane, CarrierCount, noseUp);
|
planesDisplay = GetPreGameBoard(fullCounter, planesBoard2, plane, CarrierCount, noseUp);
|
||||||
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
|
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, $"[size={size}]" + planesDisplay);
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
|
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
|
||||||
fullCounter++;
|
fullCounter++;
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,7 @@ public class Planes : ICommand
|
|||||||
logger.Error(e);
|
logger.Error(e);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
planesDisplay += $"[br]Multi: {plane.MultiTracker}x";
|
planesDisplay += $"[/size][br]Multi: {plane.MultiTracker}x";
|
||||||
for (var i = 0; i < 10; i++)
|
for (var i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
planesDisplay += BlankSpace;
|
planesDisplay += BlankSpace;
|
||||||
@@ -248,7 +248,7 @@ public class Planes : ICommand
|
|||||||
|
|
||||||
var winnings = plane.MultiTracker * wager;
|
var winnings = plane.MultiTracker * wager;
|
||||||
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
|
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
|
||||||
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
|
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, $"[size={size}]" + planesDisplay);
|
||||||
if (plane.Height > 5)
|
if (plane.Height > 5)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -276,7 +276,7 @@ public class Planes : ICommand
|
|||||||
var win = plane.MultiTracker * wager;
|
var win = plane.MultiTracker * wager;
|
||||||
newBalance = await Money.NewWagerAsync(gambler.Id, wager, win, WagerGame.Planes, ct: ctx);
|
newBalance = await Money.NewWagerAsync(gambler.Id, wager, win, WagerGame.Planes, ct: ctx);
|
||||||
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
|
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
|
||||||
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
|
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, $"[size={size}]" + planesDisplay);
|
||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
$"{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()}",
|
$"{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);
|
true, autoDeleteAfter: cleanupDelay);
|
||||||
@@ -294,7 +294,7 @@ public class Planes : ICommand
|
|||||||
newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.Planes, ct: ctx);
|
newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.Planes, ct: ctx);
|
||||||
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
|
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
|
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
|
||||||
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
|
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, $"[size={size}]" + planesDisplay);
|
||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
||||||
true, autoDeleteAfter: cleanupDelay);
|
true, autoDeleteAfter: cleanupDelay);
|
||||||
@@ -368,7 +368,7 @@ public class Planes : ICommand
|
|||||||
|
|
||||||
output += "[br]";
|
output += "[br]";
|
||||||
}
|
}
|
||||||
return output;
|
return output.GridToTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetGameBoard(int fullCounter, List<int[,]> planesBoards, Plane plane, int carrierCount, bool noseUp)
|
private string GetGameBoard(int fullCounter, List<int[,]> planesBoards, Plane plane, int carrierCount, bool noseUp)
|
||||||
@@ -445,7 +445,7 @@ public class Planes : ICommand
|
|||||||
}
|
}
|
||||||
output += "[br]";
|
output += "[br]";
|
||||||
}
|
}
|
||||||
return output;
|
return output.GridToTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int[,] CreatePlanesBoard(GamblerDbModel gambler, int forceTiles = -1)
|
private int[,] CreatePlanesBoard(GamblerDbModel gambler, int forceTiles = -1)
|
||||||
|
|||||||
@@ -591,6 +591,8 @@ public static class BuiltIn
|
|||||||
public static string DLiveEnabled = "DLive.Enabled";
|
public static string DLiveEnabled = "DLive.Enabled";
|
||||||
[BuiltInSetting("Size (%) of the Keno board", SettingValueType.Text, "70", WholeNumberRegex)]
|
[BuiltInSetting("Size (%) of the Keno board", SettingValueType.Text, "70", WholeNumberRegex)]
|
||||||
public static string KasinoKenoSize = "Kasino.Keno.Size";
|
public static string KasinoKenoSize = "Kasino.Keno.Size";
|
||||||
|
[BuiltInSetting("Size (%) of the Planes board", SettingValueType.Text, "70", WholeNumberRegex)]
|
||||||
|
public static string KasinoPlanesSize = "Kasino.Planes.Size";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,4 +640,4 @@ public class BuiltInSetting(
|
|||||||
ValueType = ValueType
|
ValueType = ValueType
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user