r2mods/ilspy_dump/ror2_csproj/EntityStates.VagrantNovaItem/RechargeState.cs

30 lines
636 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace EntityStates.VagrantNovaItem;
public class RechargeState : BaseVagrantNovaItemState
{
public static float baseDuration = 30f;
public static AnimationCurve particleEmissionCurve;
private float rechargeDuration;
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.isAuthority)
{
int itemStack = GetItemStack();
float num = baseDuration / (float)(itemStack + 1);
float num2 = base.fixedAge / num;
if (num2 >= 1f)
{
num2 = 1f;
outer.SetNextState(new ReadyState());
}
SetChargeSparkEmissionRateMultiplier(particleEmissionCurve.Evaluate(num2));
}
}
}