r2mods/ilspy_dump/ror2_csproj/EntityStates.ArtifactShell/StartHurt.cs

30 lines
559 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine.Networking;
namespace EntityStates.ArtifactShell;
public class StartHurt : ArtifactShellBaseState
{
public static float baseDuration = 0.25f;
public static string firstHurtSound;
public override void OnEnter()
{
base.OnEnter();
if (base.healthComponent.combinedHealthFraction >= 1f)
{
Util.PlaySound(firstHurtSound, base.gameObject);
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (NetworkServer.active && base.fixedAge >= baseDuration)
{
outer.SetNextState(new Hurt());
}
}
}