mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-04-22 20:29:34 +08:00
46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using Milimoe.FunGame.Core.Entity;
|
|
using Milimoe.FunGame.Core.Library.Constant;
|
|
|
|
namespace Milimoe.FunGame.Testing.Effects.OpenEffects
|
|
{
|
|
public class ExAGI2 : Effect
|
|
{
|
|
public override long Id => (long)EffectID.ExAGI2;
|
|
public override string Name => "敏捷加成";
|
|
public override string Description => $"增加角色 {加成比例 * 100:0.##}% [ {实际加成:0.##} ] 点敏捷。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
|
|
public override EffectType EffectType => EffectType.Item;
|
|
public override bool TargetSelf => true;
|
|
|
|
public Item? Item { get; }
|
|
private readonly double 加成比例 = 0;
|
|
private double 实际加成 = 0;
|
|
|
|
public override void OnEffectGained(Character character)
|
|
{
|
|
实际加成 = character.BaseAGI * 加成比例;
|
|
character.ExAGI += 实际加成;
|
|
}
|
|
|
|
public override void OnEffectLost(Character character)
|
|
{
|
|
character.ExAGI -= 实际加成;
|
|
实际加成 = 0;
|
|
}
|
|
|
|
public ExAGI2(Skill skill, Dictionary<string, object> args, Character? source = null, Item? item = null) : base(skill, args)
|
|
{
|
|
GamingQueue = skill.GamingQueue;
|
|
Source = source;
|
|
Item = item;
|
|
if (Values.Count > 0)
|
|
{
|
|
string key = Values.Keys.FirstOrDefault(s => s.Equals("exagi", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
|
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exAGI))
|
|
{
|
|
加成比例 = exAGI;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|