diff --git a/OshimaModules/Effects/OpenEffects/IgnoreEvade.cs b/OshimaModules/Effects/OpenEffects/IgnoreEvade.cs index 05d69c2..c66e313 100644 --- a/OshimaModules/Effects/OpenEffects/IgnoreEvade.cs +++ b/OshimaModules/Effects/OpenEffects/IgnoreEvade.cs @@ -14,7 +14,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects public override bool BeforeEvadeCheck(Character actor, Character enemy, ref double throwingBonus) { - if (actor == Skill.Character) + if (actor == Skill.Character && Random.Shared.NextDouble() < 概率) { if (GamingQueue != null) WriteLine($"[ {actor} ] 的普通攻击无视了 [ {enemy} ] 的闪避!"); return false; diff --git a/OshimaModules/Effects/PassiveEffects/封技.cs b/OshimaModules/Effects/PassiveEffects/封技.cs index b7bcfe1..a99bbc6 100644 --- a/OshimaModules/Effects/PassiveEffects/封技.cs +++ b/OshimaModules/Effects/PassiveEffects/封技.cs @@ -32,8 +32,14 @@ namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects public override void OnEffectGained(Character character) { - if (_durative) RemainDuration = Duration; - else RemainDurationTurn = DurationTurn; + if (_durative && RemainDuration == 0) + { + RemainDuration = Duration; + } + else if (RemainDurationTurn == 0) + { + RemainDurationTurn = DurationTurn; + } AddEffectStatesToCharacter(character, [CharacterState.SkillRestricted]); InterruptCasting(character, Source); } diff --git a/OshimaModules/Effects/PassiveEffects/持续性弱驱散.cs b/OshimaModules/Effects/PassiveEffects/持续性弱驱散.cs new file mode 100644 index 0000000..443d329 --- /dev/null +++ b/OshimaModules/Effects/PassiveEffects/持续性弱驱散.cs @@ -0,0 +1,51 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects +{ + public class 持续性弱驱散 : Effect + { + public override long Id => 4104; + public override string Name => "持续性弱驱散"; + public override string Description => $"此角色正在被持续性弱驱散。来自:[ {Source} ] 的 [ {Skill.Name} ]"; + public override EffectType EffectType => EffectType.WeakDispelling; + public override DispelType DispelType => DispelType.DurativeWeak; + public override Character Source => _sourceCharacter; + public override bool DurativeWithoutDuration => _durativeWithoutDuration; + public override bool Durative => _durative; + public override double Duration => _duration; + public override int DurationTurn => _durationTurn; + + private readonly Character _sourceCharacter; + private readonly bool _durativeWithoutDuration; + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 持续性弱驱散(Skill skill, Character sourceCharacter, bool durativeWithoutDuration = false, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill) + { + GamingQueue = skill.GamingQueue; + DispelledType = DispelledType.Weak; + _sourceCharacter = sourceCharacter; + _durativeWithoutDuration = durativeWithoutDuration; + if (!_durativeWithoutDuration) + { + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + } + + public override void OnEffectGained(Character character) + { + if (_durative && RemainDuration == 0) + { + RemainDuration = Duration; + } + else if (RemainDurationTurn == 0) + { + RemainDurationTurn = DurationTurn; + } + } + } +} diff --git a/OshimaModules/Effects/PassiveEffects/持续性强驱散.cs b/OshimaModules/Effects/PassiveEffects/持续性强驱散.cs new file mode 100644 index 0000000..c557cdd --- /dev/null +++ b/OshimaModules/Effects/PassiveEffects/持续性强驱散.cs @@ -0,0 +1,51 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects +{ + public class 持续性强驱散 : Effect + { + public override long Id => 4105; + public override string Name => "持续性强驱散"; + public override string Description => $"此角色正在被持续性强驱散。来自:[ {Source} ] 的 [ {Skill.Name} ]"; + public override EffectType EffectType => EffectType.StrongDispelling; + public override DispelType DispelType => DispelType.DurativeStrong; + public override Character Source => _sourceCharacter; + public override bool DurativeWithoutDuration => _durativeWithoutDuration; + public override bool Durative => _durative; + public override double Duration => _duration; + public override int DurationTurn => _durationTurn; + + private readonly Character _sourceCharacter; + private readonly bool _durativeWithoutDuration; + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 持续性强驱散(Skill skill, Character sourceCharacter, bool durativeWithoutDuration = false, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill) + { + GamingQueue = skill.GamingQueue; + DispelledType = DispelledType.Strong; + _sourceCharacter = sourceCharacter; + _durativeWithoutDuration = durativeWithoutDuration; + if (!_durativeWithoutDuration) + { + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + } + + public override void OnEffectGained(Character character) + { + if (_durative && RemainDuration == 0) + { + RemainDuration = Duration; + } + else if (RemainDurationTurn == 0) + { + RemainDurationTurn = DurationTurn; + } + } + } +} diff --git a/OshimaModules/Effects/PassiveEffects/物理护盾.cs b/OshimaModules/Effects/PassiveEffects/物理护盾.cs new file mode 100644 index 0000000..99c5f48 --- /dev/null +++ b/OshimaModules/Effects/PassiveEffects/物理护盾.cs @@ -0,0 +1,58 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects +{ + public class 物理护盾 : Effect + { + public override long Id => 4106; + public override string Name => "物理护盾"; + public override string Description => $"此角色拥有物理护盾。来自:[ {Source} ] 的 [ {Skill.Name} ]"; + public override EffectType EffectType => EffectType.Shield; + public override DispelledType DispelledType => DispelledType.CannotBeDispelled; + public override bool IsDebuff => false; + public override Character Source => _sourceCharacter; + public override bool Durative => _durative; + public override double Duration => _duration; + public override int DurationTurn => _durationTurn; + + private readonly Character _sourceCharacter; + private readonly double _shield; + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 物理护盾(Skill skill, Character sourceCharacter, double shield, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill) + { + GamingQueue = skill.GamingQueue; + _sourceCharacter = sourceCharacter; + _shield = shield; + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + + public override void OnEffectGained(Character character) + { + if (_durative && RemainDuration == 0) + { + RemainDuration = Duration; + } + else if (RemainDurationTurn == 0) + { + RemainDurationTurn = DurationTurn; + } + character.Shield.Physical += _shield; + } + + public override bool OnShieldBroken(Character character, Character attacker, bool isMagic, MagicType magicType, double damage, double shield, double overFlowing) + { + Effect[] effects = [.. character.Effects.Where(e => e is 物理护盾)]; + foreach (Effect effect in effects) + { + character.Effects.Remove(effect); + } + return true; + } + } +} diff --git a/OshimaModules/Effects/PassiveEffects/眩晕.cs b/OshimaModules/Effects/PassiveEffects/眩晕.cs index 41dcb25..a7e3f7c 100644 --- a/OshimaModules/Effects/PassiveEffects/眩晕.cs +++ b/OshimaModules/Effects/PassiveEffects/眩晕.cs @@ -32,8 +32,14 @@ namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects public override void OnEffectGained(Character character) { - if (_durative) RemainDuration = Duration; - else RemainDurationTurn = DurationTurn; + if (_durative && RemainDuration == 0) + { + RemainDuration = Duration; + } + else if (RemainDurationTurn == 0) + { + RemainDurationTurn = DurationTurn; + } AddEffectStatesToCharacter(character, [CharacterState.NotActionable]); InterruptCasting(character, Source); } diff --git a/OshimaModules/Effects/SkillEffects/增加物理护盾.cs b/OshimaModules/Effects/SkillEffects/增加物理护盾.cs new file mode 100644 index 0000000..004aefd --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/增加物理护盾.cs @@ -0,0 +1,44 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.PassiveEffects; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 增加物理护盾 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"为目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}友方角色提供 {护盾值:0.##} 点物理护盾 {持续时间}。"; + + private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾); + private double 基础数值护盾 { get; set; } = 200; + private double 基础护盾等级成长 { get; set; } = 100; + private string 持续时间 => _durative && _duration > 0 ? _duration + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}"); + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 增加物理护盾(Skill skill, double 基础数值护盾, double 基础护盾等级成长, bool durative = true, double duration = 40, int durationTurn = 0) : base(skill) + { + GamingQueue = skill.GamingQueue; + this.基础数值护盾 = 基础数值护盾; + this.基础护盾等级成长 = 基础护盾等级成长; + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + foreach (Character target in targets) + { + WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点物理护盾!持续时间:{持续时间}!"); + 物理护盾 e = new(Skill, caster, 护盾值, _durative, _duration, _durationTurn); + target.Effects.Add(e); + e.OnEffectGained(target); + e.DispelledType = DispelledType; + GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/弱驱散特效.cs b/OshimaModules/Effects/SkillEffects/弱驱散特效.cs new file mode 100644 index 0000000..b522d38 --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/弱驱散特效.cs @@ -0,0 +1,33 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 弱驱散特效 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"弱驱散{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标。"; + public override DispelType DispelType => DispelType.Weak; + + public 弱驱散特效(Skill skill) : base(skill) + { + GamingQueue = skill.GamingQueue; + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + Dictionary isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? []; + foreach (Character target in targets) + { + WriteLine($"[ {caster} ] 弱驱散了 [ {target} ] !"); + bool isEnemy = true; + if (isTeammateDictionary.TryGetValue(target, out bool value)) + { + isEnemy = !value; + } + Dispel(caster, target, isEnemy); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/强驱散特效.cs b/OshimaModules/Effects/SkillEffects/强驱散特效.cs new file mode 100644 index 0000000..342ab87 --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/强驱散特效.cs @@ -0,0 +1,33 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 强驱散特效 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"强驱散{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标。"; + public override DispelType DispelType => DispelType.Strong; + + public 强驱散特效(Skill skill) : base(skill) + { + GamingQueue = skill.GamingQueue; + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + Dictionary isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? []; + foreach (Character target in targets) + { + WriteLine($"[ {caster} ] 强驱散了 [ {target} ] !"); + bool isEnemy = true; + if (isTeammateDictionary.TryGetValue(target, out bool value)) + { + isEnemy = !value; + } + Dispel(caster, target, isEnemy); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/施加持续性弱驱散.cs b/OshimaModules/Effects/SkillEffects/施加持续性弱驱散.cs new file mode 100644 index 0000000..df0eac7 --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/施加持续性弱驱散.cs @@ -0,0 +1,70 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.PassiveEffects; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 施加持续性弱驱散 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"持续弱驱散{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标{(_durativeWithoutDuration ? _durationString : $",持续 {持续时间}")}。\r\n持续性驱散是持续性临时驱散,它会在持续时间结束之后恢复目标尚未结束的特效。"; + public override DispelType DispelType => DispelType.DurativeWeak; + + private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}"); + private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0); + private readonly bool _durativeWithoutDuration; + private readonly string _durationString; + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + private readonly double _levelGrowth; + + public 施加持续性弱驱散(Skill skill, bool durativeWithoutDuration = false, string durationString = "", bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill) + { + GamingQueue = skill.GamingQueue; + _durativeWithoutDuration = durativeWithoutDuration; + _durationString = durationString; + if (!_durativeWithoutDuration) + { + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + _levelGrowth = levelGrowth; + } + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + Dictionary isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? []; + foreach (Character target in targets) + { + WriteLine($"[ {caster} ] 对 [ {target} ] 施加了持续性弱驱散!持续时间:{持续时间}!"); + bool isDebuff = true; + if (isTeammateDictionary.TryGetValue(target, out bool value)) + { + isDebuff = !value; + } + if (target == caster) + { + isDebuff = false; + } + if (target.Effects.FirstOrDefault(e => e is 持续性弱驱散) is 持续性弱驱散 e && e.DurativeWithoutDuration == _durativeWithoutDuration && e.Durative == _durative && e.IsDebuff == isDebuff) + { + if (_duration > e.Duration) e.Duration = _duration; + if (_durationTurn > e.DurationTurn) e.DurationTurn = _durationTurn; + e.DispelledType = DispelledType; + } + else + { + e = new(Skill, caster, _durativeWithoutDuration, _durative, _duration, _durationTurn); + target.Effects.Add(e); + e.OnEffectGained(target); + e.IsDebuff = isDebuff; + e.DispelledType = DispelledType; + } + GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/施加持续性强驱散.cs b/OshimaModules/Effects/SkillEffects/施加持续性强驱散.cs new file mode 100644 index 0000000..bafb5af --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/施加持续性强驱散.cs @@ -0,0 +1,70 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.PassiveEffects; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 施加持续性强驱散 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"持续强驱散{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标{(_durativeWithoutDuration ? _durationString : $",持续 {持续时间}")}。\r\n持续性驱散是持续性临时驱散,它会在持续时间结束之后恢复目标尚未结束的特效。"; + public override DispelType DispelType => DispelType.DurativeStrong; + + private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}"); + private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0); + private readonly bool _durativeWithoutDuration; + private readonly string _durationString; + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + private readonly double _levelGrowth; + + public 施加持续性强驱散(Skill skill, bool durativeWithoutDuration = false, string durationString = "", bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill) + { + GamingQueue = skill.GamingQueue; + _durativeWithoutDuration = durativeWithoutDuration; + _durationString = durationString; + if (!_durativeWithoutDuration) + { + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + _levelGrowth = levelGrowth; + } + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + Dictionary isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? []; + foreach (Character target in targets) + { + WriteLine($"[ {caster} ] 对 [ {target} ] 施加了持续性强驱散!持续时间:{持续时间}!"); + bool isDebuff = true; + if (isTeammateDictionary.TryGetValue(target, out bool value)) + { + isDebuff = !value; + } + if (target == caster) + { + isDebuff = false; + } + if (target.Effects.FirstOrDefault(e => e is 持续性强驱散) is 持续性强驱散 e && e.DurativeWithoutDuration == _durativeWithoutDuration && e.Durative == _durative && e.IsDebuff == isDebuff) + { + if (_duration > e.Duration) e.Duration = _duration; + if (_durationTurn > e.DurationTurn) e.DurationTurn = _durationTurn; + e.DispelledType = DispelledType; + } + else + { + e = new(Skill, caster, _durativeWithoutDuration, _durative, _duration, _durationTurn); + target.Effects.Add(e); + e.OnEffectGained(target); + e.IsDebuff = isDebuff; + e.DispelledType = DispelledType; + } + GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/纯数值回复生命值.cs b/OshimaModules/Effects/SkillEffects/纯数值回复生命值.cs index 2b19bb4..bb78e0f 100644 --- a/OshimaModules/Effects/SkillEffects/纯数值回复生命值.cs +++ b/OshimaModules/Effects/SkillEffects/纯数值回复生命值.cs @@ -6,7 +6,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"为{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标回复 {Heal:0.##} 点生命值。"; + public override string Description => $"为{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标回复 {Heal:0.##} 点生命值。{(CanRespawn ? "如果目标已死亡,将复活目标。" : "")}"; private double Heal => Skill.Level > 0 ? 基础回复 + 回复成长 * (Skill.Level - 1) : 基础回复; private double 基础回复 { get; set; } = 100; diff --git a/OshimaModules/Modules/SkillModule.cs b/OshimaModules/Modules/SkillModule.cs index 1d5d13c..ba7bcc1 100644 --- a/OshimaModules/Modules/SkillModule.cs +++ b/OshimaModules/Modules/SkillModule.cs @@ -45,10 +45,12 @@ namespace Oshima.FunGame.OshimaModules (long)MagicID.暗物质 => new 暗物质(), (long)MagicID.回复术 => new 回复术(), (long)MagicID.治愈术 => new 治愈术(), + (long)MagicID.复苏术 => new 复苏术(), (long)MagicID.时间加速 => new 时间加速(), (long)MagicID.时间减速 => new 时间减速(), (long)MagicID.沉默十字 => new 沉默十字(), (long)MagicID.反魔法领域 => new 反魔法领域(), + (long)MagicID.大地之墙 => new 大地之墙(), (long)SkillID.疾风步 => new 疾风步(), (long)SuperSkillID.力量爆发 => new 力量爆发(), (long)SuperSkillID.天赐之力 => new 天赐之力(), diff --git a/OshimaModules/Skills/ColdBlue/累积之压.cs b/OshimaModules/Skills/ColdBlue/累积之压.cs index f68090e..3067eaa 100644 --- a/OshimaModules/Skills/ColdBlue/累积之压.cs +++ b/OshimaModules/Skills/ColdBlue/累积之压.cs @@ -32,6 +32,11 @@ namespace Oshima.FunGame.OshimaModules.Skills public double 系数 { get; set; } = 0.12; private bool 是否是嵌套伤害 = false; + public override bool BeforeCriticalCheck(Character actor, Character enemy, ref double throwingBonus) + { + return !是否是嵌套伤害; + } + 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 && !是否是嵌套伤害 && enemy.HP > 0) diff --git a/OshimaModules/Skills/魔法/复苏术.cs b/OshimaModules/Skills/魔法/复苏术.cs new file mode 100644 index 0000000..f2ffee9 --- /dev/null +++ b/OshimaModules/Skills/魔法/复苏术.cs @@ -0,0 +1,41 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.SkillEffects; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 复苏术 : Skill + { + public override long Id => (long)MagicID.复苏术; + public override string Name => "复苏术"; + public override string Description => string.Join("", Effects.Select(e => e.Description)); + public override string DispelDescription => Effects.FirstOrDefault(e => e is 弱驱散特效)?.DispelDescription ?? ""; + public override double MPCost => Level > 0 ? 100 + (100 * (Level - 1)) : 100; + public override double CD => 100; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 8; + public override bool CanSelectSelf => true; + public override bool CanSelectEnemy => false; + public override bool CanSelectTeammate => true; + public override int CanSelectTargetCount => 1; + + public 复苏术(Character? character = null) : base(SkillType.Magic, character) + { + SelectTargetPredicates.Add(c => c.HP >= 0 && c.HP < c.MaxHP); + Effects.Add(new 弱驱散特效(this)); + Effects.Add(new 纯数值回复生命(this, 40, 65, true)); + } + + public override List GetSelectableTargets(Character caster, List enemys, List teammates) + { + List targets = base.GetSelectableTargets(caster, enemys, teammates); + if (GamingQueue != null) + { + // 从死亡队列中获取队友,加入目标列表。 + Dictionary deaths = GamingQueue.GetIsTeammateDictionary(caster, GamingQueue.Eliminated); + targets = [.. targets.Union(deaths.Where(kv => kv.Value).Select(kv => kv.Key)).Distinct()]; + } + return targets; + } + } +} diff --git a/OshimaModules/Skills/魔法/大地之墙.cs b/OshimaModules/Skills/魔法/大地之墙.cs new file mode 100644 index 0000000..5be7f25 --- /dev/null +++ b/OshimaModules/Skills/魔法/大地之墙.cs @@ -0,0 +1,118 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.PassiveEffects; +using Oshima.FunGame.OshimaModules.Effects.SkillEffects; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 大地之墙 : Skill + { + public override long Id => (long)MagicID.大地之墙; + public override string Name => "大地之墙"; + public override string Description => string.Join("", Effects.Select(e => e.Description)); + public override string DispelDescription => "驱散性:持续性弱驱散\r\n被驱散性:护盾不可驱散,持续性弱驱散在护盾值用尽前需强驱散,否则可弱驱散"; + public override double MPCost + { + get + { + return Level switch + { + 8 => 魔法消耗基础 + 6 * 魔法消耗等级成长, + 7 => 魔法消耗基础 + 4 * 魔法消耗等级成长, + 6 => 魔法消耗基础 + 4 * 魔法消耗等级成长, + 5 => 魔法消耗基础 + 3 * 魔法消耗等级成长, + 4 => 魔法消耗基础 + 3 * 魔法消耗等级成长, + 3 => 魔法消耗基础 + 2.5 * 魔法消耗等级成长, + _ => 魔法消耗基础 + }; + } + } + public override double CD => Level > 0 ? 100 - (2 * (Level - 1)) : 100; + public override double CastTime + { + get + { + return Level switch + { + 8 => 7, + 7 => 7, + 6 => 8, + 5 => 8, + 4 => 9, + 3 => 10, + 2 => 11, + _ => 12 + }; + } + } + public override double HardnessTime { get; set; } = 8; + private double 魔法消耗基础 { get; set; } = 90; + private double 魔法消耗等级成长 { get; set; } = 90; + public override bool CanSelectSelf => true; + public override bool CanSelectEnemy => false; + public override bool CanSelectTeammate => true; + public override int CanSelectTargetCount + { + get + { + return Level switch + { + 8 => 4, + 7 => 3, + 6 => 3, + 5 => 2, + 4 => 2, + 3 => 2, + _ => 1 + }; + } + } + + public 大地之墙(Character? character = null) : base(SkillType.Magic, character) + { + Effect shield = new 增加物理护盾(this, 120, 160, true, 60) + { + DispelledType = DispelledType.CannotBeDispelled + }; + Effects.Add(shield); + Effect dispel = new 施加持续性弱驱散(this, durative: true, duration: 30) + { + DispelledType = DispelledType.Strong + }; + Effects.Add(dispel); + 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 => $""; + public override bool ForceHideInStatusBar => true; + + public override void OnTimeElapsed(Character character, double elapsed) + { + if (!character.Effects.Any(e => e is 物理护盾) && character.Effects.FirstOrDefault(e => e is 施加持续性弱驱散) is 施加持续性弱驱散 e) + { + e.DispelledType = DispelledType.Weak; + } + else + { + character.Effects.Remove(this); + } + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + foreach (Character target in targets) + { + if (!target.Effects.Any(e => e is 大地之墙特效)) + { + target.Effects.Add(new 大地之墙特效(Skill)); + } + } + } + } +} diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index 206a109..5bb941e 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -39,8 +39,8 @@ namespace Oshima.FunGame.OshimaServers.Service FunGameConstant.PassiveSkills.AddRange([new META马(), new 心灵之火(), new 魔法震荡(), new 灵能反射(), new 智慧与力量(), new 致命打击(), new 毁灭之势(), new 枯竭打击(), new 破釜沉舟(), new 累积之压(), new 敏捷之刃(), new 弱者猎手()]); - FunGameConstant.Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(), - new 时间加速(), new 时间减速(), new 沉默十字(), new 反魔法领域()]); + FunGameConstant.Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(), new 复苏术(), + new 时间加速(), new 时间减速(), new 沉默十字(), new 反魔法领域(), new 大地之墙()]); Dictionary exItems = Factory.GetGameModuleInstances(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item); FunGameConstant.Equipment.AddRange(exItems.Values.Where(i => (int)i.ItemType >= 0 && (int)i.ItemType < 5)); diff --git a/OshimaServers/Service/FunGameSimulation.cs b/OshimaServers/Service/FunGameSimulation.cs index e64e832..c573c20 100644 --- a/OshimaServers/Service/FunGameSimulation.cs +++ b/OshimaServers/Service/FunGameSimulation.cs @@ -606,7 +606,7 @@ namespace Oshima.FunGame.OshimaServers.Service Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == aQuality)]; Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == sQuality)]; Item[] 饰品 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == acQuality)]; - Item? a = null, b = null, c = null, d = null; + Item? a = null, b = null, c = null, d = null, d2 = null; if (武器.Length > 0) { a = 武器[Random.Shared.Next(武器.Length)]; @@ -623,11 +623,16 @@ namespace Oshima.FunGame.OshimaServers.Service { d = 饰品[Random.Shared.Next(饰品.Length)]; } + if (饰品.Length > 0) + { + d2 = 饰品[Random.Shared.Next(饰品.Length)]; + } List 这次发放的空投 = []; if (a != null) 这次发放的空投.Add(a); if (b != null) 这次发放的空投.Add(b); if (c != null) 这次发放的空投.Add(c); if (d != null) 这次发放的空投.Add(d); + if (d2 != null) 这次发放的空投.Add(d2); Item? 魔法卡包 = FunGameService.GenerateMagicCardPack(3, (QualityType)mQuality); if (魔法卡包 != null) {