r2mods/ilspy_dump/ror2_csproj/EntityStates.BrotherMonster/SpellChannelExitState.cs

55 lines
1.3 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
using UnityEngine.Networking;
namespace EntityStates.BrotherMonster;
public class SpellChannelExitState : SpellBaseState
{
public static float lendInterval;
public static float duration;
public static GameObject channelFinishEffectPrefab;
private static int SpellChannelExitStateHash = Animator.StringToHash("SpellChannelExit");
private static int SpellChannelExitParamHash = Animator.StringToHash("SpellChannelExit.playbackRate");
protected override bool DisplayWeapon => false;
public override void OnEnter()
{
base.OnEnter();
PlayAnimation("Body", SpellChannelExitStateHash, SpellChannelExitParamHash, duration);
if (NetworkServer.active && (bool)itemStealController)
{
itemStealController.stealInterval = lendInterval;
itemStealController.LendImmediately(base.characterBody.inventory);
}
if ((bool)channelFinishEffectPrefab)
{
EffectManager.SimpleMuzzleFlash(channelFinishEffectPrefab, base.gameObject, "SpellChannel", transmit: false);
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.fixedAge > duration)
{
outer.SetNextStateToMain();
}
}
public override void OnExit()
{
SetStateOnHurt component = GetComponent<SetStateOnHurt>();
if ((bool)component)
{
component.canBeFrozen = true;
}
base.OnExit();
}
}