Files
Cielonos/Assets/Scripts/MainGame/Items/PassiveEquipments/Deflector.cs
2026-05-10 11:47:55 -04:00

28 lines
907 B
C#

using System;
using System.Collections.Generic;
using Cielonos.MainGame.Characters;
using SLSUtilities.General;
using UnityEngine;
namespace Cielonos.MainGame.Characters.Inventory.Collections
{
public partial class Deflector : PassiveEquipmentBase
{
public override void OnObtained()
{
base.OnObtained();
Action<AttackAreaBase, BlockSource> onBlockSuccess = OnBlockSuccess;
player.eventSm.onBlockSuccess.Add("Deflector", onBlockSuccess.ToPrioritized(-100));
}
}
public partial class Deflector
{
private void OnBlockSuccess(AttackAreaBase attackArea, BlockSource blockSource)
{
player.reactionSc.reflectionSm.ApplyReflection(player, this, "Deflector_Reflection", 0, 0.01f,
area => area is Projectile,
area => (area as Projectile)!.Reflect(player));
}
}
}