100 lines
4.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Effects.OpenEffects;
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("\r\n", Effects.Select(e => e.Description));
public override string DispelDescription => Effects.Count > 0 ? Effects.First(e => e is ).DispelDescription : "";
public override double MPCost => Level > 0 ? 95 + (75 * (Level - 1)) : 95;
public override double CD => Level > 0 ? 85 - (1.5 * (Level - 1)) : 85;
public override double CastTime => Level > 0 ? 6 + (0.5 * (Level - 1)) : 6;
public override double HardnessTime { get; set; } = 5;
public override int CanSelectTargetCount
{
get
{
return Level switch
{
3 => 2,
4 => 2,
5 => 3,
6 => 3,
7 => 4,
8 => 4,
_ => 1
};
}
}
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new _带基础伤害(this, 120, 35, 0.25, 0.04));
Effects.Add(new (this, false, 0, 2, 0, 0.03, 0.02));
}
}
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对{Skill.TargetDescription()}造成魔法抗性降低 {ActualMDFReductionPercent * 100:0.##}%,持续 {持续时间}。";
public override DispelledType DispelledType => DispelledType.Weak;
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 _durative;
private readonly double _duration;
private readonly int _durationTurn;
private readonly double _levelGrowth;
private readonly double _MDFReductionPercent;
private readonly double _MDFReductionPercentLevelGrowth;
private double ActualMDFReductionPercent => Level > 0 ? _MDFReductionPercent + _MDFReductionPercentLevelGrowth * (Level - 1) : _MDFReductionPercent;
public (Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0, double MDFReductionPercent = 0, double MDFReductionPercentLevelGrowth = 0) : base(skill)
{
GamingQueue = skill.GamingQueue;
_durative = durative;
_duration = duration;
_durationTurn = durationTurn;
_levelGrowth = levelGrowth;
_MDFReductionPercent = MDFReductionPercent;
_MDFReductionPercentLevelGrowth = MDFReductionPercentLevelGrowth;
}
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
foreach (Character target in targets)
{
WriteLine($"[ {target} ] 的魔法抗性降低了 {ActualMDFReductionPercent * 100:0.##}%!持续时间:{持续时间}");
ExMDF e = new(Skill, new(){
{ "mdftype", 0 },
{ "mdfvalue", -ActualMDFReductionPercent }
}, caster);
target.Effects.Add(e);
if (_durative && _duration > 0)
{
e.Durative = true;
e.Duration = ;
e.RemainDuration = ;
}
else if (!_durative && _durationTurn > 0)
{
e.Durative = false;
e.DurationTurn = (int);
e.RemainDurationTurn = (int);
}
e.EffectType = EffectType.MagicResistBreak;
e.Source = caster;
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
}
}
}
}