mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-04-20 19:29:34 +08:00
添加重随的确认和取消
This commit is contained in:
parent
0fbcce452a
commit
985a06a3fd
139
Library/Main.cs
139
Library/Main.cs
@ -29,27 +29,27 @@ FunGameController controller = new(new Logger<FunGameController>(new LoggerFacto
|
|||||||
Console.WriteLine(controller.CreateSaved(1, "test"));
|
Console.WriteLine(controller.CreateSaved(1, "test"));
|
||||||
|
|
||||||
//żâ´ć˛âĘÔ
|
//żâ´ć˛âĘÔ
|
||||||
PluginConfig pc = new("saved", "1");
|
//PluginConfig pc = new("saved", "1");
|
||||||
pc.LoadConfig();
|
//pc.LoadConfig();
|
||||||
User u = FunGameService.GetUser(pc);
|
//User u = FunGameService.GetUser(pc);
|
||||||
if (u.Inventory.Characters.Count == 0)
|
//if (u.Inventory.Characters.Count == 0)
|
||||||
{
|
//{
|
||||||
u.Inventory.Characters.Add(FunGameService.Characters[0].Copy());
|
// u.Inventory.Characters.Add(FunGameService.Characters[0].Copy());
|
||||||
}
|
//}
|
||||||
Character c = u.Inventory.Characters.First();
|
//Character c = u.Inventory.Characters.First();
|
||||||
Item? i = FunGameService.GenerateMagicCardPack(3);
|
//Item? i = FunGameService.GenerateMagicCardPack(3);
|
||||||
if (i != null)
|
//if (i != null)
|
||||||
{
|
//{
|
||||||
u.Inventory.Items.Add(i);
|
// u.Inventory.Items.Add(i);
|
||||||
c.Equip(i);
|
// c.Equip(i);
|
||||||
}
|
//}
|
||||||
Console.WriteLine(u.Inventory.Characters.First().GetInfo());
|
//Console.WriteLine(u.Inventory.Characters.First().GetInfo());
|
||||||
Item? i2 = c.UnEquip(Milimoe.FunGame.Core.Library.Constant.EquipSlotType.MagicCardPack);
|
//Item? i2 = c.UnEquip(Milimoe.FunGame.Core.Library.Constant.EquipSlotType.MagicCardPack);
|
||||||
Console.WriteLine(i2);
|
//Console.WriteLine(i2);
|
||||||
pc.Add("user", u);
|
//pc.Add("user", u);
|
||||||
pc.SaveConfig();
|
//pc.SaveConfig();
|
||||||
pc.LoadConfig();
|
//pc.LoadConfig();
|
||||||
u = FunGameService.GetUser(pc);
|
//u = FunGameService.GetUser(pc);
|
||||||
|
|
||||||
//for (int i = 1; i <= 100; i++)
|
//for (int i = 1; i <= 100; i++)
|
||||||
//{
|
//{
|
||||||
@ -60,51 +60,66 @@ u = FunGameService.GetUser(pc);
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
string msg = Console.ReadLine() ?? "";
|
try
|
||||||
if (msg == "quit") return;
|
|
||||||
if (msg.StartsWith("dhjb"))
|
|
||||||
{
|
{
|
||||||
msg = msg.Replace("dhjb", "");
|
string msg = Console.ReadLine() ?? "";
|
||||||
if (int.TryParse(msg, out int value))
|
if (msg == "quit") return;
|
||||||
|
if (msg.StartsWith("dhjb"))
|
||||||
{
|
{
|
||||||
Console.WriteLine(controller.ExchangeCredits(1, value));
|
msg = msg.Replace("dhjb", "");
|
||||||
|
if (int.TryParse(msg, out int value))
|
||||||
|
{
|
||||||
|
Console.WriteLine(controller.ExchangeCredits(1, value));
|
||||||
|
}
|
||||||
|
else Console.WriteLine(controller.ExchangeCredits(1));
|
||||||
|
}
|
||||||
|
else if (msg == "jscs")
|
||||||
|
{
|
||||||
|
Console.WriteLine(controller.RandomCustomCharacter(1));
|
||||||
|
}
|
||||||
|
else if (msg == "qrjscs")
|
||||||
|
{
|
||||||
|
Console.WriteLine(controller.RandomCustomCharacter(1, true));
|
||||||
|
}
|
||||||
|
else if (msg == "kb")
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Join("\r\n", controller.GenerateMagicCardPack()));
|
||||||
|
}
|
||||||
|
else if (msg == "tck")
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Join("\r\n", controller.DrawCards(1)));
|
||||||
|
}
|
||||||
|
else if (msg == "ck")
|
||||||
|
{
|
||||||
|
Console.WriteLine(controller.DrawCard(1));
|
||||||
|
}
|
||||||
|
else if (msg == "qk")
|
||||||
|
{
|
||||||
|
Console.WriteLine(await FunGameService.AllowSellAndTrade());
|
||||||
|
}
|
||||||
|
else if (msg.StartsWith("sl") && int.TryParse(msg.Replace("sl", ""), out int page1))
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo3(1, page1)));
|
||||||
|
}
|
||||||
|
else if (msg.StartsWith("pzsl") && int.TryParse(msg.Replace("pzsl", ""), out int page3))
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo3(1, page3, 2, 2)));
|
||||||
|
}
|
||||||
|
else if (msg.StartsWith("cjs") && int.TryParse(msg.Replace("cjs", ""), out int cIndex))
|
||||||
|
{
|
||||||
|
Console.WriteLine(NetworkUtility.JsonDeserialize<string>(controller.GetCharacterInfoFromInventory(1, cIndex)));
|
||||||
|
}
|
||||||
|
else if (msg.StartsWith("cwp") && int.TryParse(msg.Replace("cwp", ""), out int itemIndex))
|
||||||
|
{
|
||||||
|
Console.WriteLine(NetworkUtility.JsonDeserialize<string>(controller.GetItemInfoFromInventory(1, itemIndex)));
|
||||||
|
}
|
||||||
|
else if (int.TryParse(msg, out int page2))
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo2(1, page2)));
|
||||||
}
|
}
|
||||||
else Console.WriteLine(controller.ExchangeCredits(1));
|
|
||||||
}
|
}
|
||||||
else if (msg == "kb")
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(string.Join("\r\n", controller.GenerateMagicCardPack()));
|
Console.WriteLine(e);
|
||||||
}
|
|
||||||
else if (msg == "tck")
|
|
||||||
{
|
|
||||||
Console.WriteLine(string.Join("\r\n", controller.DrawCards(1)));
|
|
||||||
}
|
|
||||||
else if (msg == "ck")
|
|
||||||
{
|
|
||||||
Console.WriteLine(controller.DrawCard(1));
|
|
||||||
}
|
|
||||||
else if (msg == "qk")
|
|
||||||
{
|
|
||||||
Console.WriteLine(await FunGameService.AllowSellAndTrade());
|
|
||||||
}
|
|
||||||
else if (msg.StartsWith("sl") && int.TryParse(msg.Replace("sl", ""), out int page1))
|
|
||||||
{
|
|
||||||
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo3(1, page1)));
|
|
||||||
}
|
|
||||||
else if (msg.StartsWith("pzsl") && int.TryParse(msg.Replace("pzsl", ""), out int page3))
|
|
||||||
{
|
|
||||||
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo3(1, page3, 2, 2)));
|
|
||||||
}
|
|
||||||
else if (msg.StartsWith("cjs") && int.TryParse(msg.Replace("cjs", ""), out int cIndex))
|
|
||||||
{
|
|
||||||
Console.WriteLine(NetworkUtility.JsonDeserialize<string>(controller.GetCharacterInfoFromInventory(1, cIndex)));
|
|
||||||
}
|
|
||||||
else if (msg.StartsWith("cwp") && int.TryParse(msg.Replace("cwp", ""), out int itemIndex))
|
|
||||||
{
|
|
||||||
Console.WriteLine(NetworkUtility.JsonDeserialize<string>(controller.GetItemInfoFromInventory(1, itemIndex)));
|
|
||||||
}
|
|
||||||
else if (int.TryParse(msg, out int page2))
|
|
||||||
{
|
|
||||||
Console.WriteLine(string.Join("\r\n", controller.GetInventoryInfo2(1, page2)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user