34 lines
1.0 KiB
C#
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);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} |