diff --git a/Library/Characters/Characters.cs b/Library/Characters/Characters.cs index 3934186..f0eafe2 100644 --- a/Library/Characters/Characters.cs +++ b/Library/Characters/Characters.cs @@ -98,7 +98,7 @@ namespace FunGame.Testing.Characters c.InitialAGI = 7; c.AGIGrowth = 0.7; c.InitialINT = 17; - c.INTGrowth = 0.7; + c.INTGrowth = 1.7; c.InitialSPD = 300; c.InitialHR = 4; c.InitialMR = 2; diff --git a/Library/Effects/眩晕.cs b/Library/Effects/眩晕.cs index 06aeee0..ec0d51c 100644 --- a/Library/Effects/眩晕.cs +++ b/Library/Effects/眩晕.cs @@ -7,7 +7,7 @@ namespace Milimoe.FunGame.Testing.Effects { public override long Id => 4101; public override string Name => "眩晕"; - public override string Description => $"此角色被眩晕了,不能行动。来自:[ " + _sourceCharacter + " ] 的 [ " + Skill.Name + " ]"; + public override string Description => $"此角色被眩晕了,不能行动。来自:[ {Source} ] 的 [ {Skill.Name} ]"; public override EffectControlType ControlType => EffectControlType.Stun; public override bool TargetSelf => true; public override Character Source => _sourceCharacter; @@ -33,7 +33,7 @@ namespace Milimoe.FunGame.Testing.Effects { if (_durative) RemainDuration = Duration; else RemainDurationTurn = DurationTurn; - character.CharacterEffectStates.Add(this, CharacterState.NotActionable); + character.CharacterEffectStates.Add(this, [CharacterState.NotActionable]); character.UpdateCharacterState(); InterruptCasting(character, Source); } @@ -43,10 +43,5 @@ namespace Milimoe.FunGame.Testing.Effects character.CharacterEffectStates.Remove(this); character.UpdateCharacterState(); } - - public override void OnTurnStart(Character character) - { - - } } } diff --git a/Library/Effects/累积之压标记.cs b/Library/Effects/累积之压标记.cs new file mode 100644 index 0000000..216911f --- /dev/null +++ b/Library/Effects/累积之压标记.cs @@ -0,0 +1,24 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Effects +{ + public class 累积之压标记 : Effect + { + public override long Id => 4102; + public override string Name => "累积之压标记"; + public override string Description => $"此角色持有累积之压标记,已累计 {MarkLevel} 层。来自:[ {Source} ]"; + public override EffectControlType ControlType => EffectControlType.Mark; + public override bool TargetSelf => true; + public override Character Source => _sourceCharacter; + public int MarkLevel { get; set; } = 1; + + private readonly Character _sourceCharacter; + + public 累积之压标记(Skill skill, Character sourceCharacter) : base(skill) + { + ActionQueue = skill.ActionQueue; + _sourceCharacter = sourceCharacter; + } + } +} diff --git a/Library/Main.cs b/Library/Main.cs index 93e76d9..2feafc3 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -108,6 +108,12 @@ if (list.Count > 3) }; c.Skills.Add(冰霜攻击); + Skill 疾风步 = new 疾风步(c) + { + Level = slevel + }; + c.Skills.Add(疾风步); + if (c == character1) { Skill META马 = new META马(c) @@ -182,18 +188,85 @@ if (list.Count > 3) }; c.Skills.Add(变幻之心); } - - if (c == character9) + + if (c== character6) { - Skill 疾风步 = new 疾风步(c) + Skill 致命打击 = new 致命打击(c) + { + Level = 1 + }; + c.Skills.Add(致命打击); + + Skill 精准打击 = new 精准打击(c) { Level = slevel }; - c.Skills.Add(疾风步); + c.Skills.Add(精准打击); + } + + if (c== character7) + { + Skill 毁灭之势 = new 毁灭之势(c) + { + Level = 1 + }; + c.Skills.Add(毁灭之势); + + Skill 绝对领域 = new 绝对领域(c) + { + Level = slevel + }; + c.Skills.Add(绝对领域); + } + + if (c== character8) + { + Skill 枯竭打击 = new 枯竭打击(c) + { + Level = 1 + }; + c.Skills.Add(枯竭打击); + + Skill 能量毁灭 = new 能量毁灭(c) + { + Level = slevel + }; + c.Skills.Add(能量毁灭); + } + + if (c == character9) + { + Skill 玻璃大炮 = new 玻璃大炮(c) + { + Level = 1 + }; + c.Skills.Add(玻璃大炮); + + Skill 迅捷之势 = new 迅捷之势(c) + { + Level = slevel + }; + c.Skills.Add(迅捷之势); + } + + if (c == character10) + { + Skill 累积之压 = new 累积之压(c) + { + Level = 1 + }; + c.Skills.Add(累积之压); + + Skill 嗜血标记 = new 嗜血标记(c) + { + Level = slevel + }; + c.Skills.Add(嗜血标记); } if (c != character1 && c != character2 && c != character3 && c != character4 && - c != character5) + c != character5 && c != character6 && c != character7 && c != character8 && + c != character9 && c != character10) //&& c != character11 && c != character12) { Skill 天赐之力 = new 天赐之力(c) { diff --git a/Library/Skills/ColdBlue/嗜血标记.cs b/Library/Skills/ColdBlue/嗜血标记.cs new file mode 100644 index 0000000..59c7f60 --- /dev/null +++ b/Library/Skills/ColdBlue/嗜血标记.cs @@ -0,0 +1,65 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Milimoe.FunGame.Testing.Effects; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 嗜血标记 : Skill + { + public override long Id => 3010; + public override string Name => "嗜血标记"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double EPCost => 100; + public override double CD => 42 - 1 * (Level - 1); + public override double HardnessTime => 12; + + public 嗜血标记(Character character) : base(SkillType.SuperSkill, character) + { + Effects.Add(new 嗜血标记特效(this)); + } + } + + public class 嗜血标记特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"{Duration} 秒内,攻击拥有标记的角色将根据标记层数获得 {吸血 * 100:f2}% 吸血每层。"; + public override bool TargetSelf => true; + public override bool Durative => true; + public override double Duration => 30; + + public HashSet 角色有第四层 { get; } = []; + private double 吸血 => Calculation.Round4Digits(0.03 * Level); + + public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (character == Skill.Character && damageResult != DamageResult.Evaded && character.HP < character.MaxHP) + { + int 层数 = 0; + if (enemy.Effects.Where(e => e is 累积之压标记).FirstOrDefault() is 累积之压标记 e) + { + 层数 = e.MarkLevel; + } + else if (角色有第四层.Remove(enemy)) + { + 层数 = 4; + } + double 实际吸血 = Calculation.Round2Digits(吸血 * damage); + character.HP += 实际吸血; + WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!"); + } + } + + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + { + RemainDuration = Duration; + if (!caster.Effects.Contains(this)) + { + 角色有第四层.Clear(); + caster.Effects.Add(this); + OnEffectGained(caster); + } + } + } +} diff --git a/Library/Skills/ColdBlue/累积之压.cs b/Library/Skills/ColdBlue/累积之压.cs new file mode 100644 index 0000000..c5e1e30 --- /dev/null +++ b/Library/Skills/ColdBlue/累积之压.cs @@ -0,0 +1,90 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Milimoe.FunGame.Testing.Effects; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 累积之压 : Skill + { + public override long Id => 4010; + public override string Name => "累积之压"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 累积之压(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 累积之压特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 累积之压特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"每次造成伤害都可以叠一层标记,累计 4 层时回收该角色所有标记并造成眩晕 1 回合,额外对该角色造成 {系数 * 100:f2}% 最大生命值的物理伤害。"; + public override bool TargetSelf => true; + + private readonly double 系数 = 0.12; + private bool 是否是嵌套伤害 = false; + + public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (character == Skill.Character && damageResult != DamageResult.Evaded && !是否是嵌套伤害) + { + // 叠标记 + IEnumerable effects = enemy.Effects.Where(e => e is 累积之压标记); + if (effects.Any() && effects.First() is 累积之压标记 e) + { + e.MarkLevel++; + IEnumerable effects2 = character.Effects.Where(e => e is 嗜血标记特效); + if (effects2.Any() && effects2.First() is 嗜血标记特效 e2) + { + if (e.MarkLevel >= 4) + { + e2.角色有第四层.Add(enemy); + } + else + { + e2.角色有第四层.Remove(enemy); + } + } + if (e.MarkLevel >= 4) + { + // 移除标记 + enemy.Effects.Remove(e); + double 额外伤害 = Calculation.Round2Digits(enemy.MaxHP * 系数); + WriteLine($"[ {character} ] 发动了累积之压!将对 [ {enemy} ] 造成眩晕和额外伤害!"); + // 眩晕 + IEnumerable effects3 = enemy.Effects.Where(e => e is 眩晕 && e.Skill == Skill); + if (effects3.Any()) + { + effects3.First().RemainDurationTurn++; + } + else + { + 眩晕 e3 = new(Skill, character, false, 0, 1); + enemy.Effects.Add(e3); + e3.OnEffectGained(enemy); + } + 是否是嵌套伤害 = true; + DamageToEnemy(character, enemy, false, magicType, 额外伤害); + } + } + else + { + enemy.Effects.Add(new 累积之压标记(Skill, character)); + } + } + + if (character == Skill.Character && 是否是嵌套伤害) + { + 是否是嵌套伤害 = false; + } + } + } +} diff --git a/Library/Skills/Mayor/精准打击.cs b/Library/Skills/Mayor/精准打击.cs new file mode 100644 index 0000000..7ec3768 --- /dev/null +++ b/Library/Skills/Mayor/精准打击.cs @@ -0,0 +1,64 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 精准打击 : Skill + { + public override long Id => 3006; + public override string Name => "精准打击"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double EPCost => 100; + public override double CD => 40 - 1 * (Level - 1); + public override double HardnessTime => 8; + + public 精准打击(Character character) : base(SkillType.SuperSkill, character) + { + Effects.Add(new 精准打击特效(this)); + } + } + + public class 精准打击特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"30 时间内暴击率提升 {暴击率提升 * 100:f2}%,暴击伤害再提升 {暴击伤害提升 * 100:f2}%。"; + public override bool TargetSelf => true; + public override bool Durative => true; + public override double Duration => 30; + + private double 暴击率提升 => Calculation.Round4Digits(0.2 + 0.03 * (Level - 1)); + private double 暴击伤害提升 => Calculation.Round4Digits(0.8 + 0.04 * (Level - 1)); + private double 实际暴击率提升 = 0; + private double 实际暴击伤害提升 = 0; + + public override void OnEffectGained(Character character) + { + 实际暴击率提升 = 暴击率提升; + 实际暴击伤害提升 = 暴击伤害提升; + character.ExCritRate += 实际暴击率提升; + WriteLine($"[ {character} ] 的暴击率提升了 [ {实际暴击率提升 * 100:f2}% ] !"); + character.ExCritDMG += 实际暴击伤害提升; + WriteLine($"[ {character} ] 的暴击伤害提升了 [ {实际暴击伤害提升 * 100:f2}% ] !"); + } + + public override void OnEffectLost(Character character) + { + character.ExCritRate -= 实际暴击率提升; + character.ExCritDMG -= 实际暴击伤害提升; + } + + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + { + RemainDuration = Duration; + if (!caster.Effects.Contains(this)) + { + 实际暴击率提升 = 0; + 实际暴击伤害提升 = 0; + caster.Effects.Add(this); + OnEffectGained(caster); + } + } + } +} diff --git a/Library/Skills/Mayor/致命打击.cs b/Library/Skills/Mayor/致命打击.cs index 1f5f609..2a2ca7a 100644 --- a/Library/Skills/Mayor/致命打击.cs +++ b/Library/Skills/Mayor/致命打击.cs @@ -31,5 +31,10 @@ namespace Milimoe.FunGame.Testing.Skills { character.ExCritDMG += 0.3; } + + public override void OnEffectLost(Character character) + { + character.ExCritDMG -= 0.3; + } } } diff --git a/Library/Skills/NanGanyu/三重叠加.cs b/Library/Skills/NanGanyu/三重叠加.cs index 151ed09..a3b910f 100644 --- a/Library/Skills/NanGanyu/三重叠加.cs +++ b/Library/Skills/NanGanyu/三重叠加.cs @@ -49,13 +49,13 @@ namespace Milimoe.FunGame.Testing.Skills } } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { 剩余持续次数 = 技能持续次数; - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/NanGanyu/灵能反射.cs b/Library/Skills/NanGanyu/灵能反射.cs index a1a013c..de83737 100644 --- a/Library/Skills/NanGanyu/灵能反射.cs +++ b/Library/Skills/NanGanyu/灵能反射.cs @@ -55,7 +55,7 @@ namespace Milimoe.FunGame.Testing.Skills } } - public override void AlterHardnessTimeAfterCastSkill(Character character, ref double baseHardnessTime) + public override void AlterHardnessTimeAfterCastSkill(Character character, ref double baseHardnessTime, ref bool isCheckProtected) { 释放次数++; if (释放次数 < 触发硬直次数) diff --git a/Library/Skills/NiuNan/变幻之心.cs b/Library/Skills/NiuNan/变幻之心.cs index 1e39b47..c598636 100644 --- a/Library/Skills/NiuNan/变幻之心.cs +++ b/Library/Skills/NiuNan/变幻之心.cs @@ -52,23 +52,23 @@ namespace Milimoe.FunGame.Testing.Skills } } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { - IEnumerable effects = actor.Effects.Where(e => e is 智慧与力量特效); + IEnumerable effects = caster.Effects.Where(e => e is 智慧与力量特效); if (effects.Any()) { - if (actor.PrimaryAttribute == PrimaryAttribute.STR) + if (caster.PrimaryAttribute == PrimaryAttribute.STR) { - double 回复的生命 = Calculation.Round2Digits(生命值回复 * actor.MaxHP); - actor.HP += 回复的生命; - WriteLine("[ " + actor + " ] 发动了变幻之心!回复了 " + 回复的生命 + " 点生命值!"); + double 回复的生命 = Calculation.Round2Digits(生命值回复 * caster.MaxHP); + caster.HP += 回复的生命; + WriteLine("[ " + caster + " ] 回复了 " + 回复的生命 + " 点生命值!"); } - else if (actor.PrimaryAttribute == PrimaryAttribute.INT) + else if (caster.PrimaryAttribute == PrimaryAttribute.INT) { - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/NiuNan/智慧与力量.cs b/Library/Skills/NiuNan/智慧与力量.cs index d44c6ff..b507681 100644 --- a/Library/Skills/NiuNan/智慧与力量.cs +++ b/Library/Skills/NiuNan/智慧与力量.cs @@ -1,5 +1,4 @@ -using Milimoe.FunGame.Core.Api.Utility; -using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Testing.Skills diff --git a/Library/Skills/Oshima/力量爆发.cs b/Library/Skills/Oshima/力量爆发.cs index 9792e71..a9cf8aa 100644 --- a/Library/Skills/Oshima/力量爆发.cs +++ b/Library/Skills/Oshima/力量爆发.cs @@ -44,14 +44,14 @@ namespace Milimoe.FunGame.Testing.Skills character.ExATK2 -= 实际攻击力加成; } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { RemainDuration = Duration; - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { 实际攻击力加成 = 0; - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/QWQAQW/玻璃大炮.cs b/Library/Skills/QWQAQW/玻璃大炮.cs new file mode 100644 index 0000000..2863dbb --- /dev/null +++ b/Library/Skills/QWQAQW/玻璃大炮.cs @@ -0,0 +1,91 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 玻璃大炮 : Skill + { + public override long Id => 4009; + public override string Name => "玻璃大炮"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 玻璃大炮(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 玻璃大炮特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 玻璃大炮特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"生命值高于30%时,受到额外的 [ 20~40% ] 伤害,但是获得 [ 上次所受伤害的 80% ] 伤害加成;生命值低于等于30%时,不会受到额外的伤害,但是仅能获得 [ 上次所受伤害的 30% ] 伤害加成。" + + $"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:f2}% 伤害加成。(当前伤害加成:{伤害加成 * 100:f2}%)"; + public override bool TargetSelf => true; + + private double 上次受到的伤害 = 0; + private double 这次的伤害加成 = 0; + private double 这次受到的额外伤害 = 0; + private readonly double 常规伤害加成 = 0.2; + private readonly double 高于30的加成 = 0.8; + private readonly double 低于30的加成 = 0.3; + + private double 伤害加成 + { + get + { + double 系数 = 常规伤害加成; + Character? character = Skill.Character; + if (character is null) return 系数; + if (上次受到的伤害 != 0) + { + if (character.HP > character.MaxHP * 0.3) + { + 系数 = 高于30的加成; + } + else + { + 系数 = 低于30的加成; + } + } + return 系数; + } + } + + public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType) + { + if (character == Skill.Character) + { + 这次的伤害加成 = Calculation.Round2Digits(damage * 伤害加成); + damage = Calculation.Round2Digits(damage + 这次的伤害加成); + WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成} 点伤害加成!"); + } + + if (enemy == Skill.Character) + { + if (character.HP > character.MaxHP * 0.3) + { + // 额外受到伤害 + double 系数 = Calculation.Round4Digits((new Random().Next(20, 40) + 0.0) / 100); + 这次受到的额外伤害 = Calculation.Round2Digits(damage * 系数); + damage = Calculation.Round2Digits(damage + 这次受到的额外伤害); + WriteLine($"[ {character} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害} 点伤害!"); + } + } + } + + public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (enemy == Skill.Character && damageResult != DamageResult.Evaded) + { + 上次受到的伤害 = damage; + } + } + } +} diff --git a/Library/Skills/QWQAQW/迅捷之势.cs b/Library/Skills/QWQAQW/迅捷之势.cs new file mode 100644 index 0000000..f2248f9 --- /dev/null +++ b/Library/Skills/QWQAQW/迅捷之势.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.Skills +{ + public class 迅捷之势 : Skill + { + public override long Id => 3009; + public override string Name => "迅捷之势"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double EPCost => 100; + public override double CD => 60 - 2 * (Level - 1); + public override double HardnessTime => 15; + + public 迅捷之势(Character character) : base(SkillType.SuperSkill, character) + { + Effects.Add(new 迅捷之势特效(this)); + } + } + + public class 迅捷之势特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"{Duration} 秒内,普通攻击转为魔法伤害,且硬直时间减少50%,并基于 {智力系数 * 100:f2}% 智力 [{智力加成}] 强化普通攻击伤害。"; + public override bool TargetSelf => true; + public override bool Durative => true; + public override double Duration => 40; + + private double 智力系数 => Calculation.Round4Digits(1.4 + 0.4 * (Level - 1)); + private double 智力加成 => Calculation.Round2Digits(智力系数 * Skill.Character?.INT ?? 0); + + public override void OnEffectGained(Character character) + { + character.NormalAttack.SetMagicType(true, character.MagicType); + } + + public override void OnEffectLost(Character character) + { + character.NormalAttack.SetMagicType(false, character.MagicType); + } + + public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType) + { + if (character == Skill.Character && isNormalAttack) + { + damage = Calculation.Round2Digits(damage + 智力加成); + } + } + + public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected) + { + baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.5); + } + + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + { + RemainDuration = Duration; + if (!caster.Effects.Contains(this)) + { + caster.Effects.Add(this); + OnEffectGained(caster); + } + } + } +} diff --git a/Library/Skills/QingXiang/枯竭打击.cs b/Library/Skills/QingXiang/枯竭打击.cs new file mode 100644 index 0000000..b603f2e --- /dev/null +++ b/Library/Skills/QingXiang/枯竭打击.cs @@ -0,0 +1,57 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 枯竭打击 : Skill + { + public override long Id => 4008; + public override string Name => "枯竭打击"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 枯竭打击(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 枯竭打击特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 枯竭打击特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"每次造成伤害都会随机减少对方 [ 10~25 ] 点能量值,对能量值低于一半的角色额外造成 30% 伤害。对于枯竭打击而言,能量值大于100且小于150时,视为低于一半。"; + public override bool TargetSelf => true; + + private bool 是否是嵌套伤害 = false; + + public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (character == Skill.Character && damageResult != DamageResult.Evaded && !是否是嵌套伤害) + { + // 减少能量 + double EP = new Random().Next(10, 25); + enemy.EP -= EP; + WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP} 点!现有能量:{enemy.EP}。"); + // 伤害提升 + if (enemy.EP >= 0 && enemy.EP < 50 || enemy.EP >= 100 && enemy.EP < 150) + { + double 额外伤害 = Calculation.Round2Digits(damage * 0.3); + WriteLine($"[ {character} ] 发动了枯竭打击!将造成额外伤害!"); + 是否是嵌套伤害 = true; + DamageToEnemy(character, enemy, isMagicDamage, magicType, 额外伤害); + } + } + + if (character == Skill.Character && 是否是嵌套伤害) + { + 是否是嵌套伤害 = false; + } + } + } +} diff --git a/Library/Skills/QingXiang/能量毁灭.cs b/Library/Skills/QingXiang/能量毁灭.cs new file mode 100644 index 0000000..45cdd28 --- /dev/null +++ b/Library/Skills/QingXiang/能量毁灭.cs @@ -0,0 +1,44 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 能量毁灭 : Skill + { + public override long Id => 3008; + public override string Name => "能量毁灭"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double EPCost => 100; + public override double CD => 55 - 3 * (Level - 1); + public override double HardnessTime => 15; + + public 能量毁灭(Character character) : base(SkillType.SuperSkill, character) + { + Effects.Add(new 能量毁灭特效(this)); + } + } + + public class 能量毁灭特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"对所有角色造成 " + + $"600% 其现有能量值 + {智力系数 * 100:f2}% 智力 [ {智力伤害} ] 的魔法伤害。"; + public override bool TargetSelf => false; + public override double TargetRange => 999; + + private double 智力系数 => Calculation.Round4Digits(0.55 * Level); + private double 智力伤害 => Calculation.Round2Digits(智力系数 * Skill.Character?.INT ?? 0); + + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + { + foreach (Character c in enemys) + { + WriteLine($"[ {caster} ] 正在毁灭 [ {c} ] 的能量!!"); + double ep = c.EP; + DamageToEnemy(caster, c, true, MagicType, Calculation.Round2Digits(ep * 6.0 + 智力伤害)); + } + } + } +} diff --git a/Library/Skills/QuDuoduo/弱者猎手.cs b/Library/Skills/QuDuoduo/弱者猎手.cs new file mode 100644 index 0000000..7cb13a8 --- /dev/null +++ b/Library/Skills/QuDuoduo/弱者猎手.cs @@ -0,0 +1,30 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 弱者猎手 : Skill + { + public override long Id => 4012; + public override string Name => "弱者猎手"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 弱者猎手(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 弱者猎手特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 弱者猎手特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"优先攻击血量更低的角色,对生命值低于自己的角色造成150%伤害。"; + public override bool TargetSelf => true; + } +} diff --git a/Library/Skills/QuDuoduo/血之狂欢.cs b/Library/Skills/QuDuoduo/血之狂欢.cs new file mode 100644 index 0000000..55b2fa3 --- /dev/null +++ b/Library/Skills/QuDuoduo/血之狂欢.cs @@ -0,0 +1,90 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 血之狂欢 : Skill + { + public override long Id => 4012; + public override string Name => "血之狂欢"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 血之狂欢(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 血之狂欢特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 血之狂欢特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"30秒内,获得50%吸血。"; + public override bool TargetSelf => true; + + private double 交换前的额外智力 = 0; + private double 交换前的额外力量 = 0; + + public override void OnAttributeChanged(Character character) + { + if (Skill.Character != null) + { + if (Skill.Character.PrimaryAttribute == PrimaryAttribute.INT) + { + double diff = character.ExSTR - 交换前的额外力量; + character.ExINT = 交换前的额外力量 + character.BaseSTR + diff; + } + else if (Skill.Character.PrimaryAttribute == PrimaryAttribute.STR) + { + double diff = character.ExINT - 交换前的额外智力; + character.ExSTR = 交换前的额外智力 + character.BaseINT + diff; + } + } + } + + public override void OnTimeElapsed(Character character, double elapsed) + { + if (Skill.Character != null) + { + Character c = Skill.Character; + if (c.HP < c.MaxHP * 0.3) + { + if (c.PrimaryAttribute == PrimaryAttribute.INT) + { + double pastHP = c.HP; + double pastMaxHP = c.MaxHP; + double pastMP = c.MP; + double pastMaxMP = c.MaxMP; + c.PrimaryAttribute = PrimaryAttribute.STR; + 交换前的额外智力 = c.ExINT; + 交换前的额外力量 = c.ExSTR; + c.ExINT = -c.BaseINT; + c.ExSTR = 交换前的额外智力 + c.BaseINT + 交换前的额外力量; + c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); + } + } + else + { + if (c.PrimaryAttribute == PrimaryAttribute.STR) + { + double pastHP = c.HP; + double pastMaxHP = c.MaxHP; + double pastMP = c.MP; + double pastMaxMP = c.MaxMP; + c.PrimaryAttribute = PrimaryAttribute.INT; + 交换前的额外智力 = c.ExINT; + 交换前的额外力量 = c.ExSTR; + c.ExINT = 交换前的额外力量 + c.BaseSTR + 交换前的额外智力; + c.ExSTR = -c.BaseSTR; + c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); + } + } + } + } + } +} diff --git a/Library/Skills/XinYin/天赐之力.cs b/Library/Skills/XinYin/天赐之力.cs index a35f36f..201f666 100644 --- a/Library/Skills/XinYin/天赐之力.cs +++ b/Library/Skills/XinYin/天赐之力.cs @@ -60,18 +60,18 @@ namespace Milimoe.FunGame.Testing.Skills } } - public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime) + public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected) { baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8); } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { RemainDuration = Duration; - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/XinYin/心灵之火.cs b/Library/Skills/XinYin/心灵之火.cs index c57b457..3ddc709 100644 --- a/Library/Skills/XinYin/心灵之火.cs +++ b/Library/Skills/XinYin/心灵之火.cs @@ -28,7 +28,7 @@ namespace Milimoe.FunGame.Testing.Skills public override string Description => $"普通攻击硬直时间减少 20%。"; public override bool TargetSelf => true; - public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime) + public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected) { baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8); } diff --git a/Library/Skills/Yang/魔法涌流.cs b/Library/Skills/Yang/魔法涌流.cs index f1b01e8..65a5e77 100644 --- a/Library/Skills/Yang/魔法涌流.cs +++ b/Library/Skills/Yang/魔法涌流.cs @@ -23,7 +23,7 @@ namespace Milimoe.FunGame.Testing.Skills { public override long Id => Skill.Id; public override string Name => "魔法涌流"; - public override string Description => $"{Duration} 秒内,增加所有伤害的 {减伤比例 * 100}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。"; + public override string Description => $"{Duration} 秒内,增加所有伤害的 {减伤比例 * 100:f2}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。"; public override bool TargetSelf => true; public override bool Durative => true; public override double Duration => 25; @@ -42,22 +42,23 @@ namespace Milimoe.FunGame.Testing.Skills character.NormalAttack.SetMagicType(false, character.MagicType); } - public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { if (enemy == Skill.Character) { damage = Calculation.Round2Digits(damage * (1 - 实际比例)); } + return false; } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { RemainDuration = Duration; - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { 实际比例 = 0; - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/QWQAQW/疾风步.cs b/Library/Skills/战技/疾风步.cs similarity index 70% rename from Library/Skills/QWQAQW/疾风步.cs rename to Library/Skills/战技/疾风步.cs index 0d23c1a..017c46c 100644 --- a/Library/Skills/QWQAQW/疾风步.cs +++ b/Library/Skills/战技/疾风步.cs @@ -23,7 +23,7 @@ namespace Milimoe.FunGame.Testing.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 15% 闪避率和 15% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {Calculation.Round2Digits((1.5 + 1.5 * (Skill.Level - 1)) * 100)}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。"; + public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {Calculation.Round2Digits((1.5 + 1.5 * (Skill.Level - 1)) * 100)}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。"; public override bool TargetSelf => true; public override bool Durative => true; public override double Duration => 15 + (2 * (Level - 1)); @@ -46,10 +46,10 @@ namespace Milimoe.FunGame.Testing.Skills public override void OnEffectGained(Character character) { Skill.IsInEffect = true; - character.IsUnselectable = true; + character.CharacterEffectControlTypes.Add(this, [EffectControlType.Unselectable]); + character.UpdateCharacterState(); character.ExSPD += 100; - character.ExEvadeRate += 0.15; - character.ExCritRate += 0.15; + character.ExCritRate += 0.08; } public override void OnEffectLost(Character character) @@ -58,35 +58,37 @@ namespace Milimoe.FunGame.Testing.Skills if (!破隐一击) { // 在没有打出破隐一击的情况下,恢复角色状态 - character.IsUnselectable = false; + character.CharacterEffectControlTypes.Remove(this); + character.UpdateCharacterState(); } character.ExSPD -= 100; - character.ExEvadeRate -= 0.15; - character.ExCritRate -= 0.15; + character.ExCritRate -= 0.08; } - public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { if (character == Skill.Character && 首次伤害) { 首次伤害 = false; 破隐一击 = true; - character.IsUnselectable = false; + character.CharacterEffectControlTypes.Remove(this); + character.UpdateCharacterState(); double d = 伤害加成; damage = Calculation.Round2Digits(damage + d); WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d} ] 点伤害加成!"); } + return false; } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { - if (!actor.Effects.Contains(this)) + if (!caster.Effects.Contains(this)) { 首次伤害 = true; 破隐一击 = false; RemainDuration = Duration; - actor.Effects.Add(this); - OnEffectGained(actor); + caster.Effects.Add(this); + OnEffectGained(caster); } } } diff --git a/Library/Skills/绿拱门/平衡强化.cs b/Library/Skills/绿拱门/平衡强化.cs new file mode 100644 index 0000000..9415e2e --- /dev/null +++ b/Library/Skills/绿拱门/平衡强化.cs @@ -0,0 +1,90 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 平衡强化 : Skill + { + public override long Id => 4011; + public override string Name => "平衡强化"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 平衡强化(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 平衡强化特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 平衡强化特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"敏捷提高20%,然后将目前的力量补充到与敏捷持平,持续30秒。"; + public override bool TargetSelf => true; + + private double 交换前的额外智力 = 0; + private double 交换前的额外力量 = 0; + + public override void OnAttributeChanged(Character character) + { + if (Skill.Character != null) + { + if (Skill.Character.PrimaryAttribute == PrimaryAttribute.INT) + { + double diff = character.ExSTR - 交换前的额外力量; + character.ExINT = 交换前的额外力量 + character.BaseSTR + diff; + } + else if (Skill.Character.PrimaryAttribute == PrimaryAttribute.STR) + { + double diff = character.ExINT - 交换前的额外智力; + character.ExSTR = 交换前的额外智力 + character.BaseINT + diff; + } + } + } + + public override void OnTimeElapsed(Character character, double elapsed) + { + if (Skill.Character != null) + { + Character c = Skill.Character; + if (c.HP < c.MaxHP * 0.3) + { + if (c.PrimaryAttribute == PrimaryAttribute.INT) + { + double pastHP = c.HP; + double pastMaxHP = c.MaxHP; + double pastMP = c.MP; + double pastMaxMP = c.MaxMP; + c.PrimaryAttribute = PrimaryAttribute.STR; + 交换前的额外智力 = c.ExINT; + 交换前的额外力量 = c.ExSTR; + c.ExINT = -c.BaseINT; + c.ExSTR = 交换前的额外智力 + c.BaseINT + 交换前的额外力量; + c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); + } + } + else + { + if (c.PrimaryAttribute == PrimaryAttribute.STR) + { + double pastHP = c.HP; + double pastMaxHP = c.MaxHP; + double pastMP = c.MP; + double pastMaxMP = c.MaxMP; + c.PrimaryAttribute = PrimaryAttribute.INT; + 交换前的额外智力 = c.ExINT; + 交换前的额外力量 = c.ExSTR; + c.ExINT = 交换前的额外力量 + c.BaseSTR + 交换前的额外智力; + c.ExSTR = -c.BaseSTR; + c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); + } + } + } + } + } +} diff --git a/Library/Skills/绿拱门/敏捷之刃.cs b/Library/Skills/绿拱门/敏捷之刃.cs new file mode 100644 index 0000000..802e8a0 --- /dev/null +++ b/Library/Skills/绿拱门/敏捷之刃.cs @@ -0,0 +1,30 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 敏捷之刃 : Skill + { + public override long Id => 4011; + public override string Name => "敏捷之刃"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 敏捷之刃(Character character) : base(SkillType.Passive, character) + { + Effects.Add(new 敏捷之刃特效(this)); + } + + public override IEnumerable AddInactiveEffectToCharacter() + { + return Effects; + } + } + + public class 敏捷之刃特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"每次普通攻击都将附带基于敏捷的魔法伤害。"; + public override bool TargetSelf => true; + } +} diff --git a/Library/Skills/马猴烧酒/毁灭之势.cs b/Library/Skills/马猴烧酒/毁灭之势.cs index 3418b10..b4a183f 100644 --- a/Library/Skills/马猴烧酒/毁灭之势.cs +++ b/Library/Skills/马猴烧酒/毁灭之势.cs @@ -1,4 +1,5 @@ -using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Testing.Skills @@ -24,7 +25,35 @@ namespace Milimoe.FunGame.Testing.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"每时间提升 2.5% 所有伤害,无上限,但受到伤害时效果清零。"; + public override string Description => $"每时间提升 5.5% 所有伤害,无上限,但受到伤害时效果清零。" + (累计伤害 > 0 ? $"(当前总提升:{累计伤害 * 100:f2}%)" : ""); public override bool TargetSelf => true; + + private readonly double 伤害提升 = 0.055; + private double 累计伤害 = 0; + + public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (damageResult != DamageResult.Evaded) + { + if (enemy == Skill.Character && damage > 0 && !enemy.Effects.Where(e => e is 绝对领域特效).Any()) + { + 累计伤害 = 0; + } + + if (character == Skill.Character) + { + double 实际伤害提升 = Calculation.Round2Digits(damage * 累计伤害); + damage = Calculation.Round2Digits(damage + 实际伤害提升); + if (实际伤害提升 > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升} 点!"); + } + } + return false; + } + + public override void OnTimeElapsed(Character character, double eapsed) + { + 累计伤害 = Calculation.Round4Digits(累计伤害 + 伤害提升 * eapsed); + WriteLine($"[ {character} ] 的 [ {Name} ] 效果增加了,当前总提升:{累计伤害 * 100:f2}%。"); + } } } diff --git a/Library/Skills/马猴烧酒/绝对领域.cs b/Library/Skills/马猴烧酒/绝对领域.cs new file mode 100644 index 0000000..c2bf02a --- /dev/null +++ b/Library/Skills/马猴烧酒/绝对领域.cs @@ -0,0 +1,74 @@ +using Milimoe.FunGame.Core.Api.Utility; +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Testing.Skills +{ + public class 绝对领域 : Skill + { + public override long Id => 3007; + public override string Name => "绝对领域"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double EPCost => Math.Max(100, Character?.EP ?? 100); + public override double CD => 32; + public override double HardnessTime => 12; + + public 绝对领域(Character character) : base(SkillType.SuperSkill, character) + { + Effects.Add(new 绝对领域特效(this)); + } + } + + public class 绝对领域特效(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"{Duration} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:f2}% [ {敏捷提升} ]。此技能会消耗至少 100 点能量。"; + public override bool TargetSelf => true; + public override bool Durative => true; + public override double Duration => Calculation.Round2Digits(20 + 释放时的能量值 * 0.03); + + private double 系数 => Calculation.Round4Digits(0.3 + 0.04 * (Level - 1)); + private double 敏捷提升 => Calculation.Round2Digits(系数 * Skill.Character?.BaseAGI ?? 0); + private double 实际敏捷提升 = 0; + private double 释放时的能量值 = 0; + + public override void OnEffectGained(Character character) + { + 实际敏捷提升 = 敏捷提升; + character.ExAGI += 实际敏捷提升; + WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:f2}% [ {实际敏捷提升} ] !"); + } + + public override void OnEffectLost(Character character) + { + character.ExAGI -= 实际敏捷提升; + } + + public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) + { + if (enemy == Skill.Character && damageResult != DamageResult.Evaded) + { + WriteLine($"[ {enemy} ] 发动了绝对领域,巧妙的化解了此伤害!"); + return true; + } + return false; + } + + public override void OnSkillCasting(Character caster) + { + 释放时的能量值 = caster.EP; + } + + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + { + RemainDuration = Duration; + if (!caster.Effects.Contains(this)) + { + 实际敏捷提升 = 0; + caster.Effects.Add(this); + OnEffectGained(caster); + } + } + } +} diff --git a/Library/Skills/马猴烧酒/冰霜攻击.cs b/Library/Skills/魔法/冰霜攻击.cs similarity index 79% rename from Library/Skills/马猴烧酒/冰霜攻击.cs rename to Library/Skills/魔法/冰霜攻击.cs index 9148a38..66eff5b 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.GetMagicName(MagicType)}。"; public override bool TargetSelf => false; public override int TargetCount => 1; @@ -42,10 +42,13 @@ namespace Milimoe.FunGame.Testing.Skills } } - public override void OnSkillCasted(Character actor, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) { - Character enemy = enemys[new Random().Next(enemys.Count)]; - DamageToEnemy(actor, enemy, true, MagicType, Damage); + if (enemys.Count > 0) + { + Character enemy = enemys[new Random().Next(enemys.Count)]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } } } } diff --git a/Library/Solutions/TestModule.cs b/Library/Solutions/TestModule.cs index 29c51bd..a03a53b 100644 --- a/Library/Solutions/TestModule.cs +++ b/Library/Solutions/TestModule.cs @@ -48,9 +48,6 @@ namespace Addons get { List list = []; - Skill s = Factory.GetSkill(); - s.Name = "Example Skill"; - list.Add(s); return list; } }