28 lines
907 B
C#
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));
|
|
}
|
|
}
|
|
} |