2025-06-27 17:43:15 +02:00
|
|
|
|
using Cirno.Scripts.Components.Actors._3D;
|
|
|
|
|
|
using Cirno.Scripts.Components.FSM.Player;
|
|
|
|
|
|
using Cirno.Scripts.Utils;
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class Cutscene : BaseState<PlayerState, CharacterBody3D>
|
|
|
|
|
|
{
|
|
|
|
|
|
public override PlayerState StateId => PlayerState.Cutscene;
|
|
|
|
|
|
|
|
|
|
|
|
[Export] public PlayerAnimationProvider3D AnimationProvider { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Export] public IsoPlayerStorageModule PlayerStorage { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Init(machine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void EnterState()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.EnterState();
|
|
|
|
|
|
MainObject.Show();
|
|
|
|
|
|
MainObject.Velocity = Vector3.Zero;
|
2025-06-29 12:35:19 +02:00
|
|
|
|
PlayerStorage.MovementDirection = Vector2.Zero;
|
2025-06-27 17:43:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void ExitState()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.ExitState();
|
|
|
|
|
|
|
|
|
|
|
|
AnimationProvider.SetAnimationSpeed(Vector2.Zero);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void ProcessState(double delta)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.ProcessState(delta);
|
|
|
|
|
|
AnimationProvider.SetAnimationSpeed(MainObject.Velocity.ToVector2());
|
|
|
|
|
|
AnimationProvider.SetAnimation(MainObject.Velocity.ToVector2());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void PhysicsProcessState(double delta)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Reset at start of frame
|
|
|
|
|
|
//MainObject.Velocity = Vector2.Zero;
|
|
|
|
|
|
|
|
|
|
|
|
// Process modules
|
|
|
|
|
|
base.PhysicsProcessState(delta);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|