From 83a7ee91a7cf5af2fb521955082156fd4a0bb574 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sat, 28 Jun 2025 01:28:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B4=BB=E5=8A=A8=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Main.cs | 65 ++-------- Library/Tests/ActivityTest.cs | 234 ++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+), 54 deletions(-) create mode 100644 Library/Tests/ActivityTest.cs diff --git a/Library/Main.cs b/Library/Main.cs index d7c5b7d..37c5775 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -29,23 +29,19 @@ FunGameSimulation.InitFunGameSimulation(); FunGameController controller = new(new Logger(new LoggerFactory())); //await CharacterTest.CharacterTest1(); -//foreach (Character c in FunGameConstant.Characters) + +await ActivityTest.Test(); + +//foreach (Skill s in FunGameConstant.Skills) //{ -// Character character = c.Copy(); -// character.Recovery(); -// FunGameService.AddCharacterSkills(character, 1, 1, 1); -// Console.WriteLine(character.GetInfo()); +// s.Level = 1; +// Console.WriteLine(s.GetInfo()); +//} +//foreach (Skill m in FunGameConstant.Magics) +//{ +// m.Level = 1; +// Console.WriteLine(m.GetInfo()); //} -foreach (Skill s in FunGameConstant.Skills) -{ - s.Level = 1; - Console.WriteLine(s.GetInfo()); -} -foreach (Skill m in FunGameConstant.Magics) -{ - m.Level = 1; - Console.WriteLine(m.GetInfo()); -} //foreach (Character c in FunGameConstant.Characters) //{ // Character character = c.Copy(); @@ -65,45 +61,6 @@ foreach (Skill m in FunGameConstant.Magics) Console.WriteLine(m.GetInfo()); } Console.ReadKey(); -//Character character = new Oshima.FunGame.OshimaModules.Characters.CustomCharacter(0, ""); -//character.SetLevel(60); -//foreach (Item i in FunGameConstant.Equipment) -//{ -// character.Equip(i); -// if (i.ItemType == ItemType.GiftBox && i.Name != "毕业礼包") continue; -// Console.WriteLine(i.ToString()); -//} -//Console.WriteLine(character.GetInfo()); -//foreach (Item i in FunGameConstant.Equipment) -//{ -// StringBuilder builder = new(); - -// builder.AppendLine($"【{i.Name}】"); - -// string itemquality = ItemSet.GetQualityTypeName(i.QualityType); -// string itemtype = ItemSet.GetItemTypeName(i.ItemType) + (i.ItemType == ItemType.Weapon && i.WeaponType != WeaponType.None ? "-" + ItemSet.GetWeaponTypeName(i.WeaponType) : ""); -// if (itemtype != "") itemtype = $" {itemtype}"; - -// builder.AppendLine($"{itemquality + itemtype}"); - -// if (i.Description != "") -// { -// builder.AppendLine("物品描述:" + i.Description); -// } - -// if (i.BackgroundStory != "") -// { -// builder.AppendLine($"\"{i.BackgroundStory}\""); -// } - -// Console.WriteLine(builder.ToString()); -//} -//Console.ReadKey(); -//foreach (OshimaRegion region in FunGameConstant.Regions.Union(FunGameConstant.PlayerRegions)) -//{ -// Console.WriteLine(region.ToString()); -//} -//Console.ReadKey(); //Dictionary rounds = FunGameSimulation.ReadRoundsFromZip("rounds_archive.zip") ?? []; //Console.WriteLine(rounds.Count); diff --git a/Library/Tests/ActivityTest.cs b/Library/Tests/ActivityTest.cs new file mode 100644 index 0000000..178c135 --- /dev/null +++ b/Library/Tests/ActivityTest.cs @@ -0,0 +1,234 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Items; +using Oshima.FunGame.OshimaServers.Service; + +namespace Milimoe.FunGame.Testing.Tests +{ + public class ActivityTest + { + public static async Task Test() + { + await Task.CompletedTask; + // 创建一个活动实例 + Activity activity1 = new(1, "重构计划特别行动:里程碑Ⅰ") + { + Description = "在筽祀牻大陆的能量节点剧烈波动之际,悖论引擎的失控引发了现实法则的紊乱!" + + "来自铎京的冒险者们需联手作战,探索大陆各区域,收集关键材料,击败区域头目,修复能量节点,阻止现实崩塌!共同推进“重构计划”,解锁丰厚奖励!\r\n" + + "全服玩家需要探索指定区域,收集基础材料,稳定工坊,推进“里程碑Ⅰ”的进度。" + }; + Quest quest1 = new() + { + Id = 1, + Name = "里程碑Ⅰ·永燃坩埚", + Description = "收集 1000 份 [ 活体金属苔藓 ]。", + CreditsAward = 50000, + Awards = [ + new 魔法卡礼包(QualityType.Blue, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 1000, + Status = QuestState.InProgress + }; + Quest quest2 = new() + { + Id = 2, + Name = "里程碑Ⅰ·齿轮坟场", + Description = "收集 800 份 [ 机械核心碎片 ]。", + CreditsAward = 40000, + Awards = [ + new 魔法卡礼包(QualityType.Blue, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 800, + Status = QuestState.InProgress + }; + activity1.Quests.Add(quest1); + activity1.Quests.Add(quest2); + Activity activity2 = new(2, "重构计划特别行动:里程碑Ⅱ") + { + Description = "在筽祀牻大陆的能量节点剧烈波动之际,悖论引擎的失控引发了现实法则的紊乱!" + + "来自铎京的冒险者们需联手作战,探索大陆各区域,收集关键材料,击败区域头目,修复能量节点,阻止现实崩塌!共同推进“重构计划”,解锁丰厚奖励!\r\n" + + "全服玩家需要探索指定区域,收集高级材料,稳定林海和荒漠,推进“里程碑Ⅱ”的进度。", + Predecessor = 1 + }; + Quest quest3 = new() + { + Id = 1, + Name = "里程碑Ⅱ·瑟兰薇歌林海", + Description = "收集 500 份 [ 荧蓝汁液 ]。", + CreditsAward = 50000, + Awards = [ + new 魔法卡礼包(QualityType.Purple, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 500 + }; + Quest quest4 = new() + { + Id = 2, + Name = "里程碑Ⅱ·时之荒漠", + Description = "收集 300 份 [ 时间碎片 ]。", + CreditsAward = 40000, + Awards = [ + new 魔法卡礼包(QualityType.Purple, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 300 + }; + activity2.Quests.Add(quest3); + activity2.Quests.Add(quest4); + Activity activity3 = new(3, "重构计划特别行动:里程碑Ⅲ") + { + Description = "在筽祀牻大陆的能量节点剧烈波动之际,悖论引擎的失控引发了现实法则的紊乱!" + + "来自铎京的冒险者们需联手作战,探索大陆各区域,收集关键材料,击败区域头目,修复能量节点,阻止现实崩塌!共同推进“重构计划”,解锁丰厚奖励!\r\n" + + "全服玩家需要挑战银辉城,获取悖论引擎核心材料,推进“里程碑Ⅲ”的进度。", + Predecessor = 2 + }; + Quest quest5 = new() + { + Id = 1, + Name = "里程碑Ⅲ·星辉凝露", + Description = "收集 200 份 [ 星辉凝露 ]。", + CreditsAward = 50000, + Awards = [ + new 魔法卡礼包(QualityType.Orange, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 200 + }; + Quest quest6 = new() + { + Id = 2, + Name = "里程碑Ⅲ·液态月光", + Description = "收集 100 份 [ 液态月光 ]。", + CreditsAward = 40000, + Awards = [ + new 魔法卡礼包(QualityType.Orange, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 100 + }; + activity3.Quests.Add(quest5); + activity3.Quests.Add(quest6); + Activity activity4 = new(4, "重构计划特别行动:里程碑Ⅳ") + { + Description = "在筽祀牻大陆的能量节点剧烈波动之际,悖论引擎的失控引发了现实法则的紊乱!" + + "来自铎京的冒险者们需联手作战,探索大陆各区域,收集关键材料,击败区域头目,修复能量节点,阻止现实崩塌!共同推进“重构计划”,解锁丰厚奖励!\r\n" + + "全服玩家需要探索永霜裂痕与棱镜骨桥,稳定时空法则,推进“里程碑Ⅳ”的进度。", + Predecessor = 3 + }; + Quest quest7 = new() + { + Id = 1, + Name = "里程碑Ⅳ·永霜裂痕", + Description = "收集 150 份 [ 时霜药剂 ]。", + CreditsAward = 80000, + Awards = [ + new 魔法卡礼包(QualityType.Red, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 150 + }; + Quest quest8 = new() + { + Id = 2, + Name = "里程碑Ⅳ·棱镜骨桥", + Description = "收集 100 份 [ 晶化记忆孢子 ]。", + CreditsAward = 60000, + Awards = [ + new 魔法卡礼包(QualityType.Red, 5) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 100 + }; + activity4.Quests.Add(quest7); + activity4.Quests.Add(quest8); + Activity activity5 = new(5, "重构计划特别行动:终幕") + { + Description = "在筽祀牻大陆的能量节点剧烈波动之际,悖论引擎的失控引发了现实法则的紊乱!" + + "来自铎京的冒险者们需联手作战,探索大陆各区域,收集关键材料,击败区域头目,修复能量节点,阻止现实崩塌!共同推进“重构计划”,解锁丰厚奖励!\r\n" + + "全服玩家需要收集星银合金,修复悖论引擎,彻底稳定现实。", + Predecessor = 4 + }; + Quest quest9 = new() + { + Id = 1, + Name = "终幕·悖论挑战", + Description = "战胜 200 次 [ 失控的悖论引擎 ]。", + CreditsAward = 100000, + Awards = [ + new 魔法卡礼包(QualityType.Gold, 3) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 200, + }; + Quest quest10 = new() + { + Id = 2, + Name = "终幕·星银合金", + Description = "收集 100 份 [ 星银合金 ]。", + CreditsAward = 60000, + Awards = [ + new 魔法卡礼包(QualityType.Red, 6) + ], + AwardsCount = new() { + { "魔法卡礼包", 1 } + }, + QuestType = QuestType.Progressive, + MaxProgress = 100 + }; + activity5.Quests.Add(quest9); + activity5.Quests.Add(quest10); + Activity activity6 = new(6, "毕业季", new DateTime(2025, 6, 1, 10, 0, 0), new DateTime(2025, 8, 1, 3, 59, 59)) + { + Description = "毕业季特别通告:启程既是毕业,大量秘宝馈赠!发送【毕业礼包】指令即可获得毕业礼包一份,礼包包含从零开始拉满一个角色的所有资源,让你的角色直接“毕业”!礼包最多可以领取 2 次。" + }; + //Console.WriteLine(FunGameService.AddEvent(activity1)); + //Console.WriteLine(FunGameService.AddEvent(activity2)); + //Console.WriteLine(FunGameService.AddEvent(activity3)); + //Console.WriteLine(FunGameService.AddEvent(activity4)); + //Console.WriteLine(FunGameService.AddEvent(activity5)); + //Console.WriteLine(FunGameService.AddEvent(activity6)); + Console.WriteLine(); + Console.WriteLine(FunGameService.GetEventCenter()); + Console.WriteLine(); + Console.WriteLine(FunGameService.GetEvents()); + Console.WriteLine(); + Console.WriteLine(FunGameService.GetEvent(1)); + Console.WriteLine(FunGameService.GetEvent(2)); + Console.WriteLine(FunGameService.GetEvent(3)); + Console.WriteLine(FunGameService.GetEvent(4)); + Console.WriteLine(FunGameService.GetEvent(5)); + Console.WriteLine(FunGameService.GetEvent(6)); + Console.ReadKey(); + } + } +}