32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cielonos.MainGame.Characters;
|
|
using SLSUtilities.General;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
/// <summary>
|
|
/// 反射棱镜 / Reflection Prism
|
|
/// 格挡敌人的投射物后会将其反弹回去。
|
|
/// </summary>
|
|
public partial class ReflectionPrism : PassiveEquipmentBase
|
|
{
|
|
public override void OnObtained()
|
|
{
|
|
base.OnObtained();
|
|
Action<AttackAreaBase, BlockSource> onBlockSuccess = OnBlockSuccess;
|
|
player.eventSm.onBlockSuccess.Add("ReflectionPrism", onBlockSuccess.ToPrioritized(-100));
|
|
}
|
|
}
|
|
|
|
public partial class ReflectionPrism
|
|
{
|
|
private void OnBlockSuccess(AttackAreaBase attackArea, BlockSource blockSource)
|
|
{
|
|
player.reactionSc.reflectionSm.ApplyReflection(player, this, "ReflectionPrism_Reflection", 0, 0.01f,
|
|
area => area is Projectile,
|
|
area => (area as Projectile)!.Reflect(player));
|
|
}
|
|
}
|
|
} |