2026-01-10 21:57:46 +08:00

198 lines
11 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.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Model;
using Oshima.FunGame.OshimaModules.Effects.PassiveEffects;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class 宿 : Skill
{
public override long Id => (long)SuperSkillID.宿;
public override string Name => "宿命之潮";
public override string Description => Effects.Count > 0 ? ((宿)Effects.First()). : "";
public override string DispelDescription => Effects.Count > 0 ? Effects.First().DispelDescription : "";
public override string ExemptionDescription => Effects.Count > 0 ? Effects.First().ExemptionDescription : "";
public override double EPCost => 100;
public override double CD => 60;
public override double HardnessTime { get; set; } = 2;
public override bool CanSelectSelf => true;
public override bool CanSelectEnemy => false;
public 宿(Character? character = null) : base(SkillType.SuperSkill, character)
{
Effects.Add(new 宿(this));
}
}
public class 宿 : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description { get; set; } = "";
public override bool Durative => true;
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
public override string DispelDescription => $"被驱散性:所有回复/禁止回复不可驱散,攻击力加成不可驱散,嘲讽需强驱散";
public override PrimaryAttribute ExemptionType => PrimaryAttribute.AGI;
public override bool ExemptDuration => false;
public string => $"{Skill.SkillOwner()}可以选择获得哪一种力量:\r\n{熵核描述}\r\n{守护描述}";
private string => $"【熵核】加速生命回复,每{GameplayEquilibriumConstant.InGameTime}额外回复 {熵核额外回复 * 100:0.##}% 当前生命值 [ {Skill.Character?.HP * 熵核额外回复:0.##} ],攻击力提升 {熵核攻击力提升 * 100:0.##}% [ {Skill.Character?.BaseATK * 熵核攻击力提升:0.##} ],但是受到的伤害提升 {熵核受到伤害提升 * 100:0.##}%。" +
$"对敌人造成伤害会使其在 {熵核影响敌人时间:0.##} {GameplayEquilibriumConstant.InGameTime}内无法获得自然的生命和魔法回复的禁止治疗效果,施加该状态时,只有目标的敏捷高于{Skill.SkillOwner()}的角色才能进行豁免检定。持续 {熵核持续时间:0.##} {GameplayEquilibriumConstant.InGameTime}。";
private static double => 0.04;
private double => 0.2 + 0.1 * (Skill.Level - 1);
private double => 0.15 + 0.05 * (Skill.Level - 1);
private static double => 10;
private double => 15 + 2 * (Skill.Level - 1);
private string => $"【守护】极致地加速生命回复,每{GameplayEquilibriumConstant.InGameTime}额外回复 {守护额外回复 * 100:0.##}% 当前生命值 [ {Skill.Character?.HP * 守护额外回复:0.##} ],为全体友方角色提供每{GameplayEquilibriumConstant.InGameTime}额外 {守护友方回复 * 100:0.##}% 当前生命值的生命回复,并嘲讽全体敌方角色,被嘲讽的角色仅能将{Skill.SkillOwner()}作为攻击目标。" +
$"施加嘲讽状态时,只有目标的敏捷高于{Skill.SkillOwner()}的角色才能进行豁免检定。持续 {守护持续时间:0.##} {GameplayEquilibriumConstant.InGameTime}。";
private double => 0.06 + 0.005 * (Skill.Level - 1);
private double => 0.01 + 0.01 * (Skill.Level - 1);
private double => 15 + 1 * (Skill.Level - 1);
private bool { get; set; } = false;
private double = 0;
private bool = false;
public 宿(Skill skill) : base(skill)
{
Description = ;
}
public override void OnEffectGained(Character character)
{
if ()
{
= ;
character.ExATKPercentage += ;
WriteLine($"[ {character} ] 的攻击力提升了 {实际攻击力提升 * 100:0.##}% [ {character.BaseATK * 实际攻击力提升:0.##} ] ");
}
}
public override void OnEffectLost(Character character)
{
if ()
{
character.ExATKPercentage -= ;
}
}
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)
{
if ( && enemy == Skill.Character && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical))
{
double bouns = -(damage * );
WriteLine($"[ {enemy} ] 触发了宿命之潮,额外受到 {Math.Abs(bouns):0.##} 伤害!");
return bouns;
}
return 0;
}
public override void AfterDamageCalculation(Character character, Character enemy, double damage, double actualDamage, bool isNormalAttack, DamageType damageType, MagicType magicType, DamageResult damageResult)
{
if ( && character == Skill.Character && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && !CheckSkilledImmune(character, enemy, Skill))
{
Effect e = new (Skill, character, true, , 0)
{
ExemptionType = PrimaryAttribute.AGI,
ExemptDuration = false,
DispelledType = DispelledType
};
if (enemy.AGI <= character.AGI || (enemy.AGI > character.AGI && !CheckExemption(character, enemy, e)))
{
WriteLine($"[ {character} ] 对 [ {enemy} ] 施加了禁止治疗!!持续时间:{熵核影响敌人时间:0.##} {GameplayEquilibriumConstant.InGameTime}");
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
}
public override void OnSkillCasted(Character caster, List<Character> targets, List<Grid> grids, Dictionary<string, object> others)
{
if (caster.Effects.Contains(this))
{
OnEffectLost(caster);
caster.Effects.Remove(this);
}
caster.Effects.Add(this);
= 0;
InquiryResponse response = Inquiry(caster, new(InquiryType.Choice, nameof(宿))
{
Description = "作出抉择",
Choices = new()
{
{ "熵核", },
{ "守护", }
},
DefaultChoice = Random.Shared.Next() % 2 == 0 ? "熵核" : "守护"
});
if (response.Choices.Count > 0)
{
= response.Choices[0] == "熵核";
}
= ;
Duration = ? : ;
RemainDuration = Duration;
OnEffectGained(caster);
if ()
{
Description = $"作出抉择:{熵核描述}";
Effect effect = new (Skill, caster, caster, true, Duration, 0, true, 0, )
{
DispelledType = DispelledType
};
WriteLine($"[ {caster} ] 获得了持续生命回复!持续时间:{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}");
caster.Effects.Add(effect);
effect.OnEffectGained(caster);
GamingQueue?.LastRound.AddApplyEffects(caster, effect.EffectType);
}
else
{
Description = $"作出抉择:{守护描述}";
Effect effect = new (Skill, caster, caster, true, Duration, 0, true, 0, )
{
DispelledType = DispelledType
};
WriteLine($"[ {caster} ] 获得了持续生命回复!持续时间:{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}");
caster.Effects.Add(effect);
effect.OnEffectGained(caster);
GamingQueue?.LastRound.AddApplyEffects(caster, effect.EffectType);
List<Character> allEnemys = [];
List<Character> allTeammates = [];
if (GamingQueue != null)
{
allEnemys = [.. GamingQueue.GetEnemies(caster).Where(c => c != caster && c.HP > 0)];
allTeammates = [.. GamingQueue.GetTeammates(caster).Where(c => c != caster && c.HP > 0)];
}
foreach (Character enemy in allEnemys)
{
Effect e = new (Skill, caster, caster, true, Duration, 0)
{
DispelledType = DispelledType.CannotBeDispelled
};
if (enemy.AGI <= caster.AGI || (enemy.AGI > caster.AGI && !CheckExemption(caster, enemy, e)))
{
WriteLine($"[ {caster} ] 嘲讽了 [ {enemy} ][ {enemy} ] 愤怒了!!持续时间:{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}");
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
foreach (Character teammate in allTeammates)
{
Effect e = new (Skill, caster, caster, true, Duration, 0, true, 0, )
{
DispelledType = DispelledType
};
WriteLine($"[ {caster} ] 对 [ {teammate} ] 施加了持续生命回复!持续时间:{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}");
teammate.Effects.Add(e);
e.OnEffectGained(teammate);
GamingQueue?.LastRound.AddApplyEffects(teammate, e.EffectType);
}
}
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.Focusing, EffectType.HealOverTime);
}
}
}