r2mods/ilspy_dump/ror2_csproj/EntityStates.Loader/PreGroundSlam.cs

41 lines
1.0 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.Loader;
public class PreGroundSlam : BaseCharacterMain
{
public static float baseDuration;
public static string enterSoundString;
public static float upwardVelocity;
private float duration;
private static int PreGroundSlamStateHash = Animator.StringToHash("PreGroundSlam");
private static int GroundSlamParamHash = Animator.StringToHash("GroundSlam.playbackRate");
public override void OnEnter()
{
base.OnEnter();
duration = baseDuration / attackSpeedStat;
PlayAnimation("Body", PreGroundSlamStateHash, GroundSlamParamHash, duration);
Util.PlaySound(enterSoundString, base.gameObject);
base.characterMotor.Motor.ForceUnground();
base.characterMotor.disableAirControlUntilCollision = false;
base.characterMotor.velocity.y = upwardVelocity;
}
public override void FixedUpdate()
{
base.FixedUpdate();
base.characterMotor.moveDirection = base.inputBank.moveVector;
if (base.fixedAge > duration)
{
outer.SetNextState(new GroundSlam());
}
}
}