mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-15 02:22:43 -04:00
small plinko (#117)
* Update multi-tracker display format in PlanesCommand * small plinko small plinko * Add Kasino Plinko Size setting
This commit is contained in:
@@ -184,8 +184,9 @@ public class PlinkoCommand : ICommand
|
|||||||
ballsNotInPlay.Add(new PlinkoBall());
|
ballsNotInPlay.Add(new PlinkoBall());
|
||||||
}
|
}
|
||||||
//game starts here
|
//game starts here
|
||||||
|
var size = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoPlinkoSize)).ToType<int>();
|
||||||
int breakCounter = 0;
|
int breakCounter = 0;
|
||||||
var plinkoMessageID = await botInstance.SendChatMessageAsync(PlinkoBoardDisplay(ballsInPlay), true, autoDeleteAfter: cleanupDelay);
|
var plinkoMessageID = await botInstance.SendChatMessageAsync($"[size={size}]" + PlinkoBoardDisplay(ballsInPlay), true, autoDeleteAfter: cleanupDelay);
|
||||||
while (plinkoMessageID.ChatMessageUuid == null && breakCounter < 1000) {
|
while (plinkoMessageID.ChatMessageUuid == null && breakCounter < 1000) {
|
||||||
await Task.Delay(100, ctx);
|
await Task.Delay(100, ctx);
|
||||||
breakCounter++;
|
breakCounter++;
|
||||||
@@ -207,7 +208,7 @@ public class PlinkoCommand : ICommand
|
|||||||
ballsInPlay.Add(ballsNotInPlay[0]);
|
ballsInPlay.Add(ballsNotInPlay[0]);
|
||||||
ballsNotInPlay.RemoveAt(0);
|
ballsNotInPlay.RemoveAt(0);
|
||||||
}
|
}
|
||||||
PlinkoMessage = PlinkoBoardDisplay(ballsInPlay) + "[br]" + lastPayoutMessage;
|
PlinkoMessage = $"[size={size}]" + PlinkoBoardDisplay(ballsInPlay) + "[/size][br]" + lastPayoutMessage;
|
||||||
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageUuid!, PlinkoMessage);
|
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageUuid!, PlinkoMessage);
|
||||||
if (ballsInPlay[0].POSITION.row == DIFFICULTY - 1) //once your ball has reached the bottom calculate the payout
|
if (ballsInPlay[0].POSITION.row == DIFFICULTY - 1) //once your ball has reached the bottom calculate the payout
|
||||||
{
|
{
|
||||||
@@ -293,7 +294,7 @@ public class PlinkoCommand : ICommand
|
|||||||
board += "[br]";
|
board += "[br]";
|
||||||
}
|
}
|
||||||
|
|
||||||
return board;
|
return board.GridToTable();
|
||||||
}
|
}
|
||||||
public class PlinkoBall
|
public class PlinkoBall
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -593,6 +593,8 @@ public static class BuiltIn
|
|||||||
public static string KasinoKenoSize = "Kasino.Keno.Size";
|
public static string KasinoKenoSize = "Kasino.Keno.Size";
|
||||||
[BuiltInSetting("Size (%) of the Planes board", SettingValueType.Text, "70", WholeNumberRegex)]
|
[BuiltInSetting("Size (%) of the Planes board", SettingValueType.Text, "70", WholeNumberRegex)]
|
||||||
public static string KasinoPlanesSize = "Kasino.Planes.Size";
|
public static string KasinoPlanesSize = "Kasino.Planes.Size";
|
||||||
|
[BuiltInSetting("Size (%) of the Plinko board", SettingValueType.Text, "70", WholeNumberRegex)]
|
||||||
|
public static string KasinoPlinkoSize = "Kasino.Plinko.Size";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user