From 195f9497d42a390bf6bcdfc63402153c2f75fbf0 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sun, 8 Sep 2024 02:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E6=B5=8B=E8=AF=95=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Characters/Characters.cs | 309 +++++++++++++++++++++++++++++++ Library/Effects/冰霜攻击特效.cs | 39 ++++ Library/Effects/天赐之力特效.cs | 67 +++++++ Library/Main.cs | 51 ++++- Library/Skills/冰霜攻击.cs | 22 +++ Library/Skills/天赐之力.cs | 20 ++ Library/Solutions/ActionQueue.cs | 157 ---------------- Library/Solutions/TestModule.cs | 2 - Library/Solutions/TestPlugin.cs | 74 ++------ 9 files changed, 516 insertions(+), 225 deletions(-) create mode 100644 Library/Characters/Characters.cs create mode 100644 Library/Effects/冰霜攻击特效.cs create mode 100644 Library/Effects/天赐之力特效.cs create mode 100644 Library/Skills/冰霜攻击.cs create mode 100644 Library/Skills/天赐之力.cs delete mode 100644 Library/Solutions/ActionQueue.cs diff --git a/Library/Characters/Characters.cs b/Library/Characters/Characters.cs new file mode 100644 index 0000000..3934186 --- /dev/null +++ b/Library/Characters/Characters.cs @@ -0,0 +1,309 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace FunGame.Testing.Characters +{ + public class Characters + { + public static Character Oshima + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Oshima"; + c.FirstName = "Shiya"; + c.NickName = "大島シヤ"; + c.PrimaryAttribute = PrimaryAttribute.STR; + c.InitialATK = 25; + c.InitialHP = 160; + c.InitialMP = 10; + c.InitialSTR = 35; + c.STRGrowth = 3.5; + c.InitialAGI = 0; + c.AGIGrowth = 0; + c.InitialINT = 0; + c.INTGrowth = 0; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character Xinyin + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Xiyue"; + c.FirstName = "XinYin"; + c.NickName = "心音"; + c.PrimaryAttribute = PrimaryAttribute.AGI; + c.InitialATK = 22; + c.InitialHP = 80; + c.InitialMP = 60; + c.InitialSTR = 8; + c.STRGrowth = 0.9; + c.InitialAGI = 19; + c.AGIGrowth = 1.7; + c.InitialINT = 3; + c.INTGrowth = 0.4; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character Yang + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Ya"; + c.FirstName = "Yang"; + c.NickName = "吖养"; + c.PrimaryAttribute = PrimaryAttribute.STR; + c.InitialATK = 23; + c.InitialHP = 105; + c.InitialMP = 55; + c.InitialSTR = 11; + c.STRGrowth = 1.8; + c.InitialAGI = 9; + c.AGIGrowth = 0.5; + c.InitialINT = 10; + c.INTGrowth = 0.7; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character NanGanyu + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Nan"; + c.FirstName = "Ganyu"; + c.NickName = "男甘雨"; + c.PrimaryAttribute = PrimaryAttribute.INT; + c.InitialATK = 17; + c.InitialHP = 115; + c.InitialMP = 80; + c.InitialSTR = 6; + c.STRGrowth = 0.6; + c.InitialAGI = 7; + c.AGIGrowth = 0.7; + c.InitialINT = 17; + c.INTGrowth = 0.7; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character NiuNan + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Niu"; + c.FirstName = "Nan"; + c.NickName = "牛腩"; + c.PrimaryAttribute = PrimaryAttribute.INT; + c.InitialATK = 16; + c.InitialHP = 75; + c.InitialMP = 90; + c.InitialSTR = 0; + c.STRGrowth = 0; + c.InitialAGI = 0; + c.AGIGrowth = 0; + c.InitialINT = 30; + c.INTGrowth = 3; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character Mayor + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Dokyo"; + c.FirstName = "Mayor"; + c.NickName = "铎京市长"; + c.PrimaryAttribute = PrimaryAttribute.AGI; + c.InitialATK = 21; + c.InitialHP = 120; + c.InitialMP = 20; + c.InitialSTR = 7; + c.STRGrowth = 1; + c.InitialAGI = 21; + c.AGIGrowth = 1.8; + c.InitialINT = 2; + c.INTGrowth = 0.2; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character 马猴烧酒 + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Magical"; + c.FirstName = "Girl"; + c.NickName = "魔法少女"; + c.PrimaryAttribute = PrimaryAttribute.AGI; + c.InitialATK = 20; + c.InitialHP = 95; + c.InitialMP = 35; + c.InitialSTR = 7; + c.STRGrowth = 0.3; + c.InitialAGI = 15; + c.AGIGrowth = 2.3; + c.InitialINT = 8; + c.INTGrowth = 0.4; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character QingXiang + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Qing"; + c.FirstName = "Xiang"; + c.NickName = "清香"; + c.PrimaryAttribute = PrimaryAttribute.INT; + c.InitialATK = 26; + c.InitialHP = 110; + c.InitialMP = 80; + c.InitialSTR = 6; + c.STRGrowth = 0.5; + c.InitialAGI = 4; + c.AGIGrowth = 0.5; + c.InitialINT = 20; + c.INTGrowth = 2; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character QWQAQW + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "QWQ"; + c.FirstName = "AQW"; + c.NickName = "LUOLI66"; + c.PrimaryAttribute = PrimaryAttribute.INT; + c.InitialATK = 18; + c.InitialHP = 85; + c.InitialMP = 45; + c.InitialSTR = 0; + c.STRGrowth = 0; + c.InitialAGI = 15; + c.AGIGrowth = 1.5; + c.InitialINT = 15; + c.INTGrowth = 1.5; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character ColdBlue + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Cold"; + c.FirstName = "Blue"; + c.NickName = "冷蓝"; + c.PrimaryAttribute = PrimaryAttribute.STR; + c.InitialATK = 28; + c.InitialHP = 135; + c.InitialMP = 25; + c.InitialSTR = 22; + c.STRGrowth = 1.9; + c.InitialAGI = 4; + c.AGIGrowth = 0.6; + c.InitialINT = 4; + c.INTGrowth = 0.6; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character 绿拱门 + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "ddd"; + c.FirstName = "ovo"; + c.NickName = "绿拱门"; + c.PrimaryAttribute = PrimaryAttribute.AGI; + c.InitialATK = 22; + c.InitialHP = 65; + c.InitialMP = 22; + c.InitialSTR = 10; + c.STRGrowth = 1; + c.InitialAGI = 20; + c.AGIGrowth = 2; + c.InitialINT = 0; + c.INTGrowth = 0; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + + public static Character QuDuoduo + { + get + { + Character c = Factory.GetCharacter(); + c.Name = "Qu"; + c.FirstName = "Duoduo"; + c.NickName = "趣多多"; + c.PrimaryAttribute = PrimaryAttribute.STR; + c.InitialATK = 19; + c.InitialHP = 90; + c.InitialMP = 40; + c.InitialSTR = 13; + c.STRGrowth = 1.5; + c.InitialAGI = 13; + c.AGIGrowth = 1.2; + c.InitialINT = 4; + c.INTGrowth = 0.3; + c.InitialSPD = 300; + c.InitialHR = 4; + c.InitialMR = 2; + return c; + } + } + } +} diff --git a/Library/Effects/冰霜攻击特效.cs b/Library/Effects/冰霜攻击特效.cs new file mode 100644 index 0000000..f968ed1 --- /dev/null +++ b/Library/Effects/冰霜攻击特效.cs @@ -0,0 +1,39 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Effects +{ + public class 冰霜攻击特效(Skill skill) : Effect(skill) + { + public override long Id => 1; + public override string Name => "冰霜攻击"; + public override string Description => $"对目标敌人造成 120%(+180%/Lv) + 250%智力 [ {Damage} ] 点元素魔法伤害。"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + public override MagicType MagicType => MagicType.Element; + + private double Damage + { + get + { + double d = 0; + if (Skill.Character != null) + { + d = Calculation.Round2Digits(1.2 * (1 + 1.8 * (Skill.Level - 1)) * Skill.Character.ATK + (Skill.Character.INT * 2.5)); + } + return d; + } + } + + public override void OnSkillCasted(ActionQueue queue, Character actor, List enemys, List teammates, Dictionary others) + { + Character enemy = enemys[new Random().Next(enemys.Count)]; + double damageBase = Damage; + if (queue.CalculateMagicalDamage(actor, enemy, false, MagicType, damageBase, out double damage) != DamageResult.Evaded) + { + queue.DamageToEnemy(actor, enemy, damage, false, true, MagicType); + } + } + } +} diff --git a/Library/Effects/天赐之力特效.cs b/Library/Effects/天赐之力特效.cs new file mode 100644 index 0000000..fcd05f8 --- /dev/null +++ b/Library/Effects/天赐之力特效.cs @@ -0,0 +1,67 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Effects +{ + public class 天赐之力特效(Skill skill) : Effect(skill) + { + public override long Id => 1; + public override string Name => "天赐之力"; + public override string Description => $"{Duration} 时间内,获得 25% 闪避率,普通攻击硬直时间额外减少 20%,基于 120%(+60%/Lv)核心属性 [ {伤害加成} ] 强化普通攻击的伤害。"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + public override bool Durative => true; + public override double Duration => 40; + public override MagicType MagicType => MagicType.Element; + + private double 伤害加成 + { + get + { + double d = 0; + if (Skill.Character != null) + { + d = Calculation.Round2Digits(1.2 * (1 + 0.6 * (Skill.Level - 1)) * Skill.Character.PrimaryAttributeValue); + } + return d; + } + } + + public override void OnEffectGained(Character character) + { + character.ExEvadeRate += 0.25; + } + + public override void OnEffectLost(Character character) + { + character.ExEvadeRate -= 0.25; + } + + public override bool AlterExpectedDamageBeforeCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, out double newDamage) + { + newDamage = damage; + if (isNormalAttack) + { + newDamage = Calculation.Round2Digits(damage + 伤害加成); + } + return true; + } + + public override bool AlterHardnessTimeAfterNormalAttack(Character character, double baseHardnessTime, out double newHardnessTime) + { + newHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8); + return true; + } + + public override void OnSkillCasted(ActionQueue queue, Character actor, List enemys, List teammates, Dictionary others) + { + if (!actor.Effects.ContainsKey(Name)) + { + actor.Effects.Add(Name, this); + RemainDuration = Duration; + OnEffectGained(actor); + } + } + } +} diff --git a/Library/Main.cs b/Library/Main.cs index 2490795..cbf2d15 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -3,7 +3,7 @@ using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Event; using Milimoe.FunGame.Core.Library.Constant; -using Milimoe.FunGame.Testing.Solutions; +using Milimoe.FunGame.Testing.Skills; PluginLoader plugins = PluginLoader.LoadPlugins([]); foreach (string plugin in plugins.Plugins.Keys) @@ -67,34 +67,65 @@ if (list.Count > 3) Character character2 = list[1].Copy(); Character character3 = list[2].Copy(); Character character4 = list[3].Copy(); + Character character5 = list[4].Copy(); + Character character6 = list[5].Copy(); + Character character7 = list[6].Copy(); + Character character8 = list[7].Copy(); + Character character9 = list[8].Copy(); + Character character10 = list[9].Copy(); + Character character11 = list[10].Copy(); + Character character12 = list[11].Copy(); - ActionQueue actionQueue = new(); - List characters = [character1, character2, character3, character4]; + List characters = [ + character1, character2, character3, character4, + character5, character6, character7, character8, + character9, character10, character11, character12 + ]; - // 初始顺序表排序 - actionQueue.CalculateInitialOrder(characters); + // 升级和赋能 + for (int index = 0; index < characters.Count; index++) + { + characters[index].Level = 60; + characters[index].Skills.Add("冰霜攻击", new 冰霜攻击(characters[index])); + characters[index].Skills["冰霜攻击"].Level += 8; + characters[index].Skills.Add("天赐之力", new 天赐之力(characters[index])); + characters[index].Skills["天赐之力"].Level += 6; + } + + // 显示角色信息 + characters.ForEach(c => Console.WriteLine(c.GetInfo())); + + // 创建顺序表并排序 + ActionQueue actionQueue = new(characters, Console.WriteLine); Console.WriteLine(); // 显示初始顺序表 actionQueue.DisplayQueue(); Console.WriteLine(); - // 模拟时间流逝 + // 总回合数 int i = 1; - while (i < 10) + while (i < 999) { // 检查是否有角色可以行动 Character? characterToAct = actionQueue.NextCharacter(); if (characterToAct != null) { Console.WriteLine($"=== Round {i++} ==="); - actionQueue.ProcessTurn(characterToAct); + Console.WriteLine("现在是 [ " + characterToAct + " ] 的回合!"); + + bool isGameEnd = actionQueue.ProcessTurn(characterToAct); + if (isGameEnd) + { + break; + } + actionQueue.DisplayQueue(); Console.WriteLine(); } - //Thread.Sleep(1); // 模拟时间流逝 - actionQueue.ReduceHardnessTimes(); + // 模拟时间流逝 + actionQueue.TimeLapse(); } Console.WriteLine("--- End ---"); diff --git a/Library/Skills/冰霜攻击.cs b/Library/Skills/冰霜攻击.cs new file mode 100644 index 0000000..2966b25 --- /dev/null +++ b/Library/Skills/冰霜攻击.cs @@ -0,0 +1,22 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Testing.Effects; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 冰霜攻击 : Skill + { + public override long Id => 1; + public override string Name => "冰霜攻击"; + public override string Description => Effects.Count > 0 ? Effects.Values.First().Description : ""; + public override double MPCost => BaseMPCost + (50 * (Level - 1)); + public override double CD => 20; + public override double CastTime => 6; + public override double HardnessTime => 3; + protected override double BaseMPCost => 30; + + public 冰霜攻击(Character character) : base(true, true, character) + { + Effects.Add("e1", new 冰霜攻击特效(this)); + } + } +} diff --git a/Library/Skills/天赐之力.cs b/Library/Skills/天赐之力.cs new file mode 100644 index 0000000..7b8702b --- /dev/null +++ b/Library/Skills/天赐之力.cs @@ -0,0 +1,20 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Testing.Effects; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 天赐之力 : Skill + { + public override long Id => 1; + public override string Name => "天赐之力"; + public override string Description => Effects.Count > 0 ? Effects.Values.First().Description : ""; + public override double EPCost => 100; + public override double CD => 60; + public override double HardnessTime => 15; + + public 天赐之力(Character character) : base(true, character) + { + Effects.Add("e1", new 天赐之力特效(this)); + } + } +} diff --git a/Library/Solutions/ActionQueue.cs b/Library/Solutions/ActionQueue.cs deleted file mode 100644 index 9dc3a19..0000000 --- a/Library/Solutions/ActionQueue.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Milimoe.FunGame.Core.Entity; - -namespace Milimoe.FunGame.Testing.Solutions; - -public class ActionQueue -{ - private readonly List _Queue = []; - private readonly Dictionary _HardnessTimes = []; - - public void AddCharacter(Character character, double hardnessTime) - { - // 插队机制:按硬直时间排序 - int insertIndex = _Queue.FindIndex(c => _HardnessTimes[c] > hardnessTime); - if (insertIndex == -1) - { - _Queue.Add(character); - } - else - { - _Queue.Insert(insertIndex, character); - } - _HardnessTimes[character] = hardnessTime; - } - - public void CalculateInitialOrder(List characters) - { - // 排序时,时间会流逝 - int nowTime = 1; - - // 初始排序:按速度排序 - List> groupedBySpeed = [.. characters - .GroupBy(c => c.SPD) - .OrderByDescending(g => g.Key)]; - - Random random = new(); - - foreach (IGrouping group in groupedBySpeed) - { - if (group.Count() == 1) - { - // 如果只有一个角色,直接加入队列 - AddCharacter(group.First(), _Queue.Count + nowTime); - } - else - { - // 如果有多个角色,进行先行决定 - List sortedList = [.. group]; - - while (sortedList.Count > 0) - { - Character? selectedCharacter = null; - bool decided = false; - if (sortedList.Count == 1) - { - selectedCharacter = sortedList[0]; - decided = true; - } - - while (!decided) - { - // 每个角色进行两次随机数抽取 - var randomNumbers = sortedList.Select(c => new - { - Character = c, - FirstRoll = random.Next(1, 21), - SecondRoll = random.Next(1, 21) - }).ToList(); - - randomNumbers.ForEach(a => Console.WriteLine(a.Character.Name + ": " + a.FirstRoll + " / " + a.SecondRoll)); - - nowTime++; - - // 找到两次都大于其他角色的角色 - int maxFirstRoll = randomNumbers.Max(r => r.FirstRoll); - int maxSecondRoll = randomNumbers.Max(r => r.SecondRoll); - - var candidates = randomNumbers - .Where(r => r.FirstRoll == maxFirstRoll && r.SecondRoll == maxSecondRoll) - .ToList(); - - if (candidates.Count == 1) - { - selectedCharacter = candidates.First().Character; - decided = true; - } - } - - // 将决定好的角色加入顺序表 - if (selectedCharacter != null) - { - AddCharacter(selectedCharacter, _Queue.Count + nowTime); - Console.WriteLine("decided: " + selectedCharacter.Name + "\r\n"); - sortedList.Remove(selectedCharacter); - } - } - } - } - } - - public Character? NextCharacter() - { - if (_Queue.Count == 0) return null; - - // 硬直时间为0的角色将执行行动 - Character? character = _Queue.FirstOrDefault(c => _HardnessTimes[c] == 0); - if (character != null) - { - _Queue.Remove(character); - return character; - } - - return null; - } - - public void ProcessTurn(Character character) - { - double baseTime = 15; // 假设基础硬直时间为15 - if (character.Name == "A") - { - baseTime = 10; // A的硬直 - } - double newHardnessTime = Math.Round(baseTime * (1 - character.ActionCoefficient), 2, MidpointRounding.AwayFromZero); - - AddCharacter(character, newHardnessTime); - } - - public void ReduceHardnessTimes() - { - if (_Queue.Count == 0) return; - - // 获取第一个角色的硬直时间 - double timeToReduce = _HardnessTimes[_Queue[0]]; - - Console.WriteLine("Time Lapse: " + timeToReduce); - - // 减少所有角色的硬直时间 - foreach (Character character in _Queue) - { - _HardnessTimes[character] = Math.Round(_HardnessTimes[character] - timeToReduce, 2, MidpointRounding.AwayFromZero); - - // 回血回蓝 - double douHP = Math.Round(character.HR * timeToReduce, 2, MidpointRounding.AwayFromZero); - double douMP = Math.Round(character.MR * timeToReduce, 2, MidpointRounding.AwayFromZero); - Console.WriteLine("角色 " + character.Name + " 回血:" + douHP + " / " + "回蓝:" + douMP); - } - Console.WriteLine(); - } - - public void DisplayQueue() - { - Console.WriteLine("Current ActionQueue:"); - foreach (var character in _Queue) - { - Console.WriteLine($"{character.Name}: Hardness Time {_HardnessTimes[character]}"); - } - } -} \ No newline at end of file diff --git a/Library/Solutions/TestModule.cs b/Library/Solutions/TestModule.cs index 9b20b69..29c51bd 100644 --- a/Library/Solutions/TestModule.cs +++ b/Library/Solutions/TestModule.cs @@ -1,7 +1,6 @@ using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Common.Addon; -using Milimoe.FunGame.Core.Library.Constant; namespace Addons { @@ -51,7 +50,6 @@ namespace Addons List list = []; Skill s = Factory.GetSkill(); s.Name = "Example Skill"; - s.MagicType = MagicType.PurityNatural; list.Add(s); return list; } diff --git a/Library/Solutions/TestPlugin.cs b/Library/Solutions/TestPlugin.cs index 0e830dc..7873b42 100644 --- a/Library/Solutions/TestPlugin.cs +++ b/Library/Solutions/TestPlugin.cs @@ -1,9 +1,9 @@ -using Milimoe.FunGame.Core.Api.Utility; +using FunGame.Testing.Characters; +using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Interface; using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Event; -using Milimoe.FunGame.Core.Library.Constant; namespace Addons { @@ -19,60 +19,22 @@ namespace Addons protected override bool BeforeLoad() { - EntityModuleConfig config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter); - // 构建一个你想要的角色 - Character c = Factory.GetCharacter(); - c.Name = "Oshima"; - c.FirstName = "Shiya"; - c.NickName = "OSM"; - c.MagicType = MagicType.PurityNatural; - c.InitialHP = 30; - c.InitialSTR = 20; - c.InitialAGI = 10; - c.InitialINT = 5; - c.InitialATK = 100; - c.InitialDEF = 10; - c.InitialSPD = 250; - config.Add("OSM", c); - c = Factory.GetCharacter(); - c.Name = "A"; - c.FirstName = "测试1"; - c.NickName = "A"; - c.MagicType = MagicType.Particle; - c.InitialHP = 25; - c.InitialSTR = 15; - c.InitialAGI = 5; - c.InitialINT = 10; - c.InitialATK = 80; - c.InitialDEF = 15; - c.InitialSPD = 290; - config.Add("A", c); - c = Factory.GetCharacter(); - c.Name = "B"; - c.FirstName = "测试2"; - c.NickName = "B"; - c.MagicType = MagicType.Fleabane; - c.InitialHP = 355; - c.InitialSTR = 5; - c.InitialAGI = 5; - c.InitialINT = 25; - c.InitialATK = 75; - c.InitialDEF = 20; - c.InitialSPD = 320; - config.Add("B", c); - c = Factory.GetCharacter(); - c.Name = "C"; - c.FirstName = "测试3"; - c.NickName = "B的复制人"; - c.MagicType = MagicType.Fleabane; - c.InitialHP = 355; - c.InitialSTR = 5; - c.InitialAGI = 5; - c.InitialINT = 25; - c.InitialATK = 75; - c.InitialDEF = 20; - c.InitialSPD = 320; - config.Add("C", c); + EntityModuleConfig config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter) + { + { "Oshima", Characters.Oshima }, + { "Xinyin", Characters.Xinyin }, + { "Yang", Characters.Yang }, + { "NanGanyu", Characters.NanGanyu }, + { "NiuNan", Characters.NiuNan }, + { "Mayor", Characters.Mayor }, + { "马猴烧酒", Characters.马猴烧酒 }, + { "QingXiang", Characters.QingXiang }, + { "QWQAQW", Characters.QWQAQW }, + { "ColdBlue", Characters.ColdBlue }, + { "绿拱门", Characters.绿拱门 }, + { "QuDuoduo", Characters.QuDuoduo } + }; + config.SaveConfig(); PluginConfig config2 = new(Name, "config") {