From 8d9c9d0095c21ae11869b8c57308978aa7b6cabb Mon Sep 17 00:00:00 2001 From: milimoe Date: Sun, 15 Sep 2024 23:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=A9=E5=93=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Testing.sln | 6 +++ Library/Effects/眩晕.cs | 2 +- Library/Effects/累积之压标记.cs | 2 +- Library/Items/攻击之爪.cs | 89 ++++++++++++++++++++++++++++++++ Library/Main.cs | 3 +- Library/Skills/Mayor/致命打击.cs | 6 +-- Library/Skills/战技/疾风步.cs | 6 +-- Library/Skills/魔法/冰霜攻击.cs | 2 +- Library/Tests/FunGame.cs | 21 ++++++-- 9 files changed, 123 insertions(+), 14 deletions(-) create mode 100644 Library/Items/攻击之爪.cs diff --git a/FunGame.Testing.sln b/FunGame.Testing.sln index 74e6c9f..98180eb 100644 --- a/FunGame.Testing.sln +++ b/FunGame.Testing.sln @@ -4,8 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.5.33516.290 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Testing", "Library\FunGame.Testing.csproj", "{6F6B4A21-8F39-4B0D-84E8-98AE3E93F06F}" + ProjectSection(ProjectDependencies) = postProject + {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} = {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Testing.Desktop", "Desktop\FunGame.Testing.Desktop.csproj", "{05FA61CB-22AA-4834-8C45-1161C42DF2C7}" + ProjectSection(ProjectDependencies) = postProject + {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} = {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Core", "..\FunGame.Core\FunGame.Core.csproj", "{94B564CD-7A1E-4B3C-AF78-23EBCD5D627E}" EndProject diff --git a/Library/Effects/眩晕.cs b/Library/Effects/眩晕.cs index ec0d51c..e70ff68 100644 --- a/Library/Effects/眩晕.cs +++ b/Library/Effects/眩晕.cs @@ -8,7 +8,7 @@ namespace Milimoe.FunGame.Testing.Effects public override long Id => 4101; public override string Name => "眩晕"; public override string Description => $"此角色被眩晕了,不能行动。来自:[ {Source} ] 的 [ {Skill.Name} ]"; - public override EffectControlType ControlType => EffectControlType.Stun; + public override EffectType EffectType => EffectType.Stun; public override bool TargetSelf => true; public override Character Source => _sourceCharacter; public override bool Durative => _durative; diff --git a/Library/Effects/累积之压标记.cs b/Library/Effects/累积之压标记.cs index 216911f..28921cb 100644 --- a/Library/Effects/累积之压标记.cs +++ b/Library/Effects/累积之压标记.cs @@ -8,7 +8,7 @@ namespace Milimoe.FunGame.Testing.Effects public override long Id => 4102; public override string Name => "累积之压标记"; public override string Description => $"此角色持有累积之压标记,已累计 {MarkLevel} 层。来自:[ {Source} ]"; - public override EffectControlType ControlType => EffectControlType.Mark; + public override EffectType EffectType => EffectType.Mark; public override bool TargetSelf => true; public override Character Source => _sourceCharacter; public int MarkLevel { get; set; } = 1; diff --git a/Library/Items/攻击之爪.cs b/Library/Items/攻击之爪.cs new file mode 100644 index 0000000..b81c017 --- /dev/null +++ b/Library/Items/攻击之爪.cs @@ -0,0 +1,89 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace FunGame.Testing.Items +{ + public class 攻击之爪10 : Item + { + public override long Id => 14001; + public override string Name => "攻击之爪 +10"; + public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; + + public 攻击之爪10(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory) + { + Skills.Passives.Add(new 攻击之爪技能(character, this, 10)); + } + } + + public class 攻击之爪30 : Item + { + public override string Name => "攻击之爪 +30"; + public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; + + public 攻击之爪30(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory) + { + Skills.Passives.Add(new 攻击之爪技能(character, this, 30)); + } + } + + public class 攻击之爪50 : Item + { + public override string Name => "攻击之爪 +50"; + public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; + + public 攻击之爪50(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory) + { + Skills.Passives.Add(new 攻击之爪技能(character, this, 50)); + } + } + + public class 攻击之爪技能 : Skill + { + public override long Id => 5001; + public override string Name => "攻击之爪"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public Item Item { get; } + + public 攻击之爪技能(Character? character, Item item, double exATK) : base(SkillType.Passive, character) + { + Level = 1; + Item = item; + Effects.Add(new 攻击之爪特效(this, character, item, exATK)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 攻击之爪特效 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"增加角色 {攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item Item { get; } + private readonly double 攻击力加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExATK2 += 攻击力加成; + } + + public override void OnEffectLost(Character character) + { + character.ExATK2 -= 攻击力加成; + } + + public 攻击之爪特效(Skill skill, Character? source, Item item, double exATK) : base(skill) + { + ActionQueue = skill.ActionQueue; + Source = source; + Item = item; + 攻击力加成 = exATK; + } + } +} diff --git a/Library/Main.cs b/Library/Main.cs index 95f2043..f0f5dc5 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -1,6 +1,6 @@ using Milimoe.FunGame.Testing.Tests; -bool printout = false; +bool printout = true; List strs = FunGameSimulation.StartGame(printout); if (printout == false) { @@ -10,5 +10,4 @@ if (printout == false) } } - Console.ReadKey(); diff --git a/Library/Skills/Mayor/致命打击.cs b/Library/Skills/Mayor/致命打击.cs index 2a2ca7a..129d292 100644 --- a/Library/Skills/Mayor/致命打击.cs +++ b/Library/Skills/Mayor/致命打击.cs @@ -24,17 +24,17 @@ namespace Milimoe.FunGame.Testing.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"暴击伤害提升 30%。"; + public override string Description => $"暴击伤害提升 70%。"; public override bool TargetSelf => true; public override void OnEffectGained(Character character) { - character.ExCritDMG += 0.3; + character.ExCritDMG += 0.7; } public override void OnEffectLost(Character character) { - character.ExCritDMG -= 0.3; + character.ExCritDMG -= 0.7; } } } diff --git a/Library/Skills/战技/疾风步.cs b/Library/Skills/战技/疾风步.cs index e40ef58..2f9dbb8 100644 --- a/Library/Skills/战技/疾风步.cs +++ b/Library/Skills/战技/疾风步.cs @@ -36,7 +36,7 @@ namespace Milimoe.FunGame.Testing.Skills public override void OnEffectGained(Character character) { Skill.IsInEffect = true; - character.CharacterEffectControlTypes.Add(this, [EffectControlType.Unselectable]); + character.CharacterEffectTypes.Add(this, [EffectType.Unselectable]); character.UpdateCharacterState(); character.ExSPD += 100; character.ExCritRate += 0.08; @@ -48,7 +48,7 @@ namespace Milimoe.FunGame.Testing.Skills if (!破隐一击) { // 在没有打出破隐一击的情况下,恢复角色状态 - character.CharacterEffectControlTypes.Remove(this); + character.CharacterEffectTypes.Remove(this); character.UpdateCharacterState(); } character.ExSPD -= 100; @@ -61,7 +61,7 @@ namespace Milimoe.FunGame.Testing.Skills { 首次伤害 = false; 破隐一击 = true; - character.CharacterEffectControlTypes.Remove(this); + character.CharacterEffectTypes.Remove(this); character.UpdateCharacterState(); double d = 伤害加成; damage = Calculation.Round2Digits(damage + d); diff --git a/Library/Skills/魔法/冰霜攻击.cs b/Library/Skills/魔法/冰霜攻击.cs index 66eff5b..a235da7 100644 --- a/Library/Skills/魔法/冰霜攻击.cs +++ b/Library/Skills/魔法/冰霜攻击.cs @@ -25,7 +25,7 @@ namespace Milimoe.FunGame.Testing.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"对目标敌人造成 {Calculation.Round2Digits(90 + 60 * (Skill.Level - 1))} + {Calculation.Round2Digits((1.2 + 1.8 * (Skill.Level - 1)) * 100)}% 智力 [ {Damage} ] 点{CharacterSet.GetMagicName(MagicType)}。"; + public override string Description => $"对目标敌人造成 {Calculation.Round2Digits(90 + 60 * (Skill.Level - 1))} + {Calculation.Round2Digits((1.2 + 1.8 * (Skill.Level - 1)) * 100)}% 智力 [ {Damage} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。"; public override bool TargetSelf => false; public override int TargetCount => 1; diff --git a/Library/Tests/FunGame.cs b/Library/Tests/FunGame.cs index 7cad331..cd0ddd5 100644 --- a/Library/Tests/FunGame.cs +++ b/Library/Tests/FunGame.cs @@ -1,4 +1,5 @@ using System.Text; +using FunGame.Testing.Items; using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Common.Addon; @@ -78,7 +79,7 @@ namespace Milimoe.FunGame.Testing.Tests // M = 5, W = 0, P1 = 0, P3 = 2 // M = 5, W = 1, P1 = 0, P3 = 0 - if (list.Count > 3) + if (list.Count > 11) { if (PrintOut) Console.WriteLine(); if (PrintOut) Console.WriteLine("Start!!!"); @@ -99,8 +100,8 @@ namespace Milimoe.FunGame.Testing.Tests List characters = [ character1, character2, character3, character4, - character5, character6, character7, character8, - character9, character10, character11, character12 + character5, character6, character7, character8, + character9, character10, character11, character12 ]; int clevel = 60; @@ -320,6 +321,7 @@ namespace Milimoe.FunGame.Testing.Tests // 总游戏时长 double totalTime = 0; + 送礼(actionQueue, totalTime); // 总回合数 int i = 1; @@ -432,5 +434,18 @@ namespace Milimoe.FunGame.Testing.Tests Msg += str + "\r\n"; if (PrintOut) Console.WriteLine(str); } + + public static void 送礼(ActionQueue queue, double totalTime) + { + if (totalTime == 0) + { + WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +50 ]!!"); + foreach (Character character in queue.Queue) + { + Item 攻击之爪 = new 攻击之爪50(); + queue.Equip(character, EquipItemToSlot.Accessory1, 攻击之爪); + } + } + } } }