31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Cielonos.MainGame.Buffs.Character;
|
||
using Cielonos.MainGame.Characters;
|
||
using SLSUtilities.General;
|
||
|
||
namespace Cielonos.MainGame.Inventory.Collections
|
||
{
|
||
public partial class FutureWand
|
||
{
|
||
/// <summary>
|
||
/// 订阅目标身上 Fusion Buff 的引爆事件,当引爆来源为 FutureWand 时执行专属效果。
|
||
/// 字典 Key 天然去重,无需手动 -= +=。
|
||
/// </summary>
|
||
private void SubscribeFusionExplode(CharacterBase enemy)
|
||
{
|
||
Fusion fusion = enemy.buffSm.GetBuff<Fusion>();
|
||
if (fusion == null) return;
|
||
|
||
fusion.onExploded[nameof(FutureWand)] = new PrioritizedAction<Fusion, AttackAreaBase>(OnFusionExploded);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 当 Fusion Buff 引爆时,如果引爆来源是 FutureWand,则对附着的角色施加一个持续 50 点伤害的 Decay Buff。
|
||
/// </summary>
|
||
private void OnFusionExploded(Fusion fusion, AttackAreaBase triggerArea)
|
||
{
|
||
if (triggerArea == null || triggerArea.itemSource != this) return;
|
||
new Decay(50).Apply(fusion.attachedCharacter);
|
||
}
|
||
}
|
||
}
|