mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 01:35:54 +00:00
Teleporters
This commit is contained in:
parent
7e76edc153
commit
1907a38575
25 changed files with 616 additions and 4 deletions
54
Scripts/Components/FSM/3DPlayer/Cutscene.cs
Normal file
54
Scripts/Components/FSM/3DPlayer/Cutscene.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
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;
|
||||
PlayerStorage.MovementDirection = Vector3.Zero;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
1
Scripts/Components/FSM/3DPlayer/Cutscene.cs.uid
Normal file
1
Scripts/Components/FSM/3DPlayer/Cutscene.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ci87ilsfrj1xh
|
||||
|
|
@ -74,7 +74,6 @@ public partial class IsoMovementModule : ModuleBase<PlayerState, CharacterBody3D
|
|||
|
||||
public override void PhysicsProcess(double delta)
|
||||
{
|
||||
|
||||
var frameVelocity = MainObject.Velocity;
|
||||
|
||||
if (_isStrafing)
|
||||
|
|
|
|||
46
Scripts/Components/FSM/3DPlayer/Teleporting.cs
Normal file
46
Scripts/Components/FSM/3DPlayer/Teleporting.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
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 Teleporting : BaseState<PlayerState, CharacterBody3D>
|
||||
{
|
||||
public override PlayerState StateId => PlayerState.Teleporting;
|
||||
|
||||
[Export] public PlayerAnimationProvider3D AnimationProvider { get; set; }
|
||||
|
||||
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
||||
{
|
||||
base.Init(machine);
|
||||
}
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
AnimationProvider.PlayTeleportAnimation();
|
||||
MainObject.Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
base.ProcessState(delta);
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
// Process modules
|
||||
base.PhysicsProcessState(delta);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
1
Scripts/Components/FSM/3DPlayer/Teleporting.cs.uid
Normal file
1
Scripts/Components/FSM/3DPlayer/Teleporting.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dls68t7f8eoqb
|
||||
45
Scripts/Components/FSM/3DPlayer/UnTeleporting.cs
Normal file
45
Scripts/Components/FSM/3DPlayer/UnTeleporting.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
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 UnTeleporting : BaseState<PlayerState, CharacterBody3D>
|
||||
{
|
||||
public override PlayerState StateId => PlayerState.UnTeleporting;
|
||||
|
||||
[Export] public PlayerAnimationProvider3D AnimationProvider { get; set; }
|
||||
|
||||
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
||||
{
|
||||
base.Init(machine);
|
||||
}
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
AnimationProvider.PlayUnteleportAnimation();
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
base.ProcessState(delta);
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
// Process modules
|
||||
base.PhysicsProcessState(delta);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
1
Scripts/Components/FSM/3DPlayer/UnTeleporting.cs.uid
Normal file
1
Scripts/Components/FSM/3DPlayer/UnTeleporting.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bayjsi428yx83
|
||||
Loading…
Add table
Add a link
Reference in a new issue