mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Triggerable acid
This commit is contained in:
parent
e85a4afa3f
commit
796f70b69a
16 changed files with 1329 additions and 968 deletions
|
|
@ -40,6 +40,9 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
|
|||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
|
||||
MainObject.Show();
|
||||
|
||||
// enable sprite
|
||||
// enable crosshair
|
||||
//_crosshairProvider.Show();
|
||||
|
|
|
|||
29
Scripts/Components/FSM/3DPlayer/Dead.cs
Normal file
29
Scripts/Components/FSM/3DPlayer/Dead.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
public partial class Dead : BaseState<PlayerState, CharacterBody3D>
|
||||
{
|
||||
public override PlayerState StateId => PlayerState.Dead;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
MainObject.Hide();
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
base.PhysicsProcessState(delta);
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
base.ProcessState(delta);
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/3DPlayer/Dead.cs.uid
Normal file
1
Scripts/Components/FSM/3DPlayer/Dead.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cmafvigtkg2qo
|
||||
43
Scripts/Components/FSM/3DPlayer/PlayerAcidDeathModule.cs
Normal file
43
Scripts/Components/FSM/3DPlayer/PlayerAcidDeathModule.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
public partial class PlayerAcidDeathModule : ModuleBase<PlayerState, CharacterBody3D>
|
||||
{
|
||||
private IStateMachine<PlayerState, CharacterBody3D> _stateMachine;
|
||||
private CharacterBody3D MainObject => _stateMachine.MainObject;
|
||||
|
||||
private bool _enabled = false;
|
||||
|
||||
public override void EnterState(PlayerState state)
|
||||
{
|
||||
_enabled = true;
|
||||
}
|
||||
|
||||
public override void ExitState(PlayerState state)
|
||||
{
|
||||
_enabled = false;
|
||||
}
|
||||
|
||||
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
||||
{
|
||||
_stateMachine = machine;
|
||||
}
|
||||
|
||||
public override void Process(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcess(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnAcidCollision(Area3D area)
|
||||
{
|
||||
if (!_enabled) return;
|
||||
GD.Print("Oh no acid");
|
||||
_stateMachine.SetState(PlayerState.Dead);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://cqyr8mko8oo5
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
public partial class PlayerAcidDetectionProvider : Area2D
|
||||
{
|
||||
// [Signal]
|
||||
// public delegate void AcidCollisionEventHandler();
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://brykay86akqhq
|
||||
Loading…
Add table
Add a link
Reference in a new issue