124 lines
5.6 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;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)PassiveID.;
public override string Name => "八卦阵";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character? character = null) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddPassiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每次造成伤害或受到伤害时,进行投掷检定,结果为偶数时,造成的伤害提升 {伤害提升 * 100:0.##}%,受到伤害减少 {伤害减少 * 100:0.##}%;结果为奇数时,该回合提升 {奇数平衡性提升 * 100:0.##}% 暴击率和闪避率、{奇数平衡性提升 * 100:0.##}% 魔法抗性,并将下一次伤害提升 {奇数伤害提升 * 100:0.##}% 或减免 {奇数伤害减少 * 100:0.##}% 下一次受到伤害,若下一次投掷结果为偶数,将叠加该效果。";
public bool { get; set; } = false;
public bool { get; set; } = false;
public bool { get; set; } = false;
public double { get; set; } = 0.8;
public double { get; set; } = 0.4;
public double { get; set; } = 0.1;
public double { get; set; } = 0.3;
public double { get; set; } = 0.15;
public override double AlterActualDamageAfterCalculation(Character character, Character enemy, double damage, bool isNormalAttack, DamageType damageType, MagicType magicType, DamageResult damageResult, ref bool isEvaded, Dictionary<Effect, double> totalDamageBonus)
{
double bonus = 0;
if (character != Skill.Character && enemy != Skill.Character)
{
return bonus;
}
if ()
{
= false;
if (character == Skill.Character)
{
bonus = damage * ;
WriteLine($"[ {Skill.Character} ] 发动了八卦阵!伤害提升了 {Math.Abs(bonus):0.##} 点!");
}
else if (enemy == Skill.Character)
{
bonus = -(damage * );
WriteLine($"[ {Skill.Character} ] 发动了八卦阵!伤害减少了 {Math.Abs(bonus):0.##} 点!");
}
}
bool result = || (! && Random.Shared.Next(10) % 2 == 0);
WriteLine($"[ {Skill.Character} ] 的八卦阵投掷结果为:{(result ? "" : "")}。");
if (damage > 0 && result)
{
if (character == Skill.Character)
{
bonus += damage * ;
WriteLine($"[ {Skill.Character} ] 发动了八卦阵!伤害提升了 {Math.Abs(bonus):0.##} 点!");
}
else if (enemy == Skill.Character)
{
bonus += -(damage * );
WriteLine($"[ {Skill.Character} ] 发动了八卦阵!伤害减少了 {Math.Abs(bonus):0.##} 点!");
}
if ()
{
WriteLine($"[ {Skill.Character} ] 发动了归元环!冷却时间减少了 {归元环特效.冷却时间减少 * 100:0.##}%");
foreach (Skill s in Skill.Character.Skills)
{
s.CurrentCD -= s.CD * .;
if (s.CurrentCD < 0)
{
s.CurrentCD = 0;
s.Enable = true;
}
}
}
}
else
{
if (!)
{
= true;
Effect e = new DynamicsEffect(Skill, new()
{
{ "excr", },
{ "exer", },
{ "mdftype", (int)MagicType.None },
{ "mdfvalue", }
}, Skill.Character)
{
Name = "八卦阵·奇数效果",
Durative = false,
DurationTurn = 1,
RemainDurationTurn = 1
};
Skill.Character.Effects.Add(e);
e.OnEffectGained(Skill.Character);
WriteLine($"[ {Skill.Character} ] 发动了八卦阵!该回合提升 {奇数平衡性提升 * 100:0.##}% 暴击率和闪避率、{奇数平衡性提升 * 100:0.##}% 魔法抗性!");
}
if (!)
{
= true;
}
}
return bonus;
}
public override void OnTurnEnd(Character character)
{
= false;
}
}
}