Files
Cielonos/Assets/Scripts/MainGame/Items/PassiveEquipments/Deflector.cs
SoulliesOfficial 50ee502684 完善
2026-02-13 09:22:11 -05:00

34 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
{
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 =>
{
if (area is Projectile projectile)
{
projectile.Reflect(player);
}
});
}
}
}