From b008b262bb59f0700a48b23d381e66f72c41da0c Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 7 Jul 2025 21:53:46 +0800 Subject: [PATCH] 1 --- Library/Main.cs | 50 ++++++++++++++++++++++++------------- Library/Tests/FunGameBO5.cs | 14 ++++++----- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/Library/Main.cs b/Library/Main.cs index 09b0486..4d5ff98 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -28,9 +28,9 @@ FunGameService.InitFunGame(); FunGameSimulation.InitFunGameSimulation(); FunGameController controller = new(new Logger(new LoggerFactory())); -await CharacterTest.CharacterTest2(); +//await CharacterTest.CharacterTest2(); -ActivityTest.Test2(); +//ActivityTest.Test2(); //await ActivityTest.Test(); @@ -52,25 +52,31 @@ ActivityTest.Test2(); // FunGameService.AddCharacterSkills(character, 1, 6, 6); // Console.WriteLine(character.GetInfo()); //} -foreach (Skill s in FunGameConstant.Skills) -{ - s.Level = 6; - Console.WriteLine(s.GetInfo()); -} -foreach (Skill m in FunGameConstant.Magics) -{ - m.Level = 8; - Console.WriteLine(m.GetInfo()); -} -Console.ReadKey(); +//foreach (Skill s in FunGameConstant.Skills) +//{ +// s.Level = 6; +// Console.WriteLine(s.GetInfo()); +//} +//foreach (Skill m in FunGameConstant.Magics) +//{ +// m.Level = 8; +// Console.WriteLine(m.GetInfo()); +//} +//Console.ReadKey(); //Dictionary rounds = FunGameSimulation.ReadRoundsFromZip("rounds_archive.zip") ?? []; //Console.WriteLine(rounds.Count); //Console.ReadKey(); //rounds.Clear(); - -//await FunGameBO5.StartBO5(); -//Console.ReadKey(); +while (true) +{ + await FunGameBO5.StartBO5(); + ConsoleKeyInfo key = Console.ReadKey(); + if (key.Key == ConsoleKey.Escape) + { + break; + } +} //await FunGameTesting.StartGame(true, false); //Console.ReadKey(); @@ -78,9 +84,17 @@ Console.ReadKey(); while (true) { await FunGameSimulation.StartSimulationGame(true, true, true, true, useStore: false); - Console.ReadKey(); + ConsoleKeyInfo key = Console.ReadKey(); + if (key.Key == ConsoleKey.Escape) + { + break; + } await FunGameSimulation.StartSimulationGame(true, false, false, true); - Console.ReadKey(); + key = Console.ReadKey(); + if (key.Key == ConsoleKey.Escape) + { + break; + } } //strings.ForEach(Console.WriteLine); diff --git a/Library/Tests/FunGameBO5.cs b/Library/Tests/FunGameBO5.cs index 3389a4b..4271617 100644 --- a/Library/Tests/FunGameBO5.cs +++ b/Library/Tests/FunGameBO5.cs @@ -154,6 +154,8 @@ namespace Milimoe.FunGame.Testing.Tests FunGameTesting.UpdateStatistics(stats[character.User], queue.GamingQueue.CharacterStatistics[character]); } Console.WriteLine(string.Join("\r\n\r\n", msgs[^2..])); + Character subMvp = queue.GamingQueue.CharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key).First(); + Console.WriteLine($"本局 MVP:{subMvp.User},角色 {subMvp.ToStringWithLevelWithOutUser()},技能、配装分享:\r\n{subMvp.GetItemInfo()}\r\n{subMvp.GetSkillInfo()}\r\n"); foreach (Team team in ((TeamGamingQueue)queue.GamingQueue).EliminatedTeams) { if (team.IsWinner && team.Name == userTeams[u1]) teamScore[u1]++; @@ -192,13 +194,13 @@ namespace Milimoe.FunGame.Testing.Tests public static void DropItems(IEnumerable characters) { + Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && (int)i.QualityType == 5)]; + Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == 5)]; + Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == 5)]; + Item[] 饰品1 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == 5)]; + Item[] 饰品2 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == 5)]; foreach (Character character in characters) { - Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && (int)i.QualityType == 4)]; - Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == 1)]; - Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == 1)]; - Item[] 饰品1 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == 3)]; - Item[] 饰品2 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == 3)]; Item? a = null, b = null, c = null, d = null, e = null; if (武器.Length > 0) { @@ -226,7 +228,7 @@ namespace Milimoe.FunGame.Testing.Tests if (c != null) 这次发放的空投.Add(c); if (d != null) 这次发放的空投.Add(d); if (e != null) 这次发放的空投.Add(e); - Item? 魔法卡包 = FunGameService.GenerateMagicCardPack(4, QualityType.Orange); + Item? 魔法卡包 = FunGameService.GenerateMagicCardPack(4, QualityType.Red); if (魔法卡包 != null) { foreach (Skill magic in 魔法卡包.Skills.Magics)