r2mods/ilspy_dump/ror2_csproj/EntityStates.SiphonItem/ReadyState.cs

27 lines
562 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
namespace EntityStates.SiphonItem;
public class ReadyState : BaseSiphonItemState
{
public static float healthFractionThreshold = 0.5f;
private HealthComponent attachedHealthComponent;
public override void OnEnter()
{
base.OnEnter();
attachedHealthComponent = base.attachedBody?.healthComponent;
TurnOffHealingFX();
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.isAuthority && attachedHealthComponent.combinedHealthFraction <= healthFractionThreshold)
{
outer.SetNextState(new ChargeState());
}
}
}