Files
Cielonos/Assets/Scripts/MainGame/Items/PassiveEquipments/Deflector.cs

28 lines
907 B
C#
Raw Normal View History

2026-02-13 09:22:11 -05:00
using System;
using System.Collections.Generic;
using Cielonos.MainGame.Characters;
using SLSUtilities.General;
using UnityEngine;
2026-03-20 12:07:44 -04:00
namespace Cielonos.MainGame.Characters.Inventory.Collections
2026-02-13 09:22:11 -05:00
{
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,
2026-04-18 13:57:19 -04:00
area => (area as Projectile)!.Reflect(player));
2026-02-13 09:22:11 -05:00
}
}
}