mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Now boss FSM Actor movement
This commit is contained in:
parent
4aa7a8322c
commit
c37278075d
19 changed files with 215 additions and 28 deletions
47
Scripts/Components/FSM/Boss/BossScriptHostModule.cs
Normal file
47
Scripts/Components/FSM/Boss/BossScriptHostModule.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using Cirno.Scripts.AttackPatterns;
|
||||
using Cirno.Scripts.Components.FSM.Enemy;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Boss;
|
||||
|
||||
public partial class BossScriptHostModule : ModuleBase<EnemyState, CharacterBody2D>, IScriptHost
|
||||
{
|
||||
[Export]
|
||||
public EnemyStorageModule StorageModule { get; private set; }
|
||||
|
||||
public Node2D ParentObject => _machine.MainObject;
|
||||
public Vector2 HomePosition => StorageModule.HomePosition;
|
||||
|
||||
private IStateMachine<EnemyState, CharacterBody2D> _machine;
|
||||
|
||||
public void ChangeSpriteDirection(Vector2 direction)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void EnterState(EnemyState state)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState(EnemyState state)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Init(IStateMachine<EnemyState, CharacterBody2D> machine)
|
||||
{
|
||||
_machine = machine;
|
||||
}
|
||||
|
||||
public override void Process(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcess(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/Boss/BossScriptHostModule.cs.uid
Normal file
1
Scripts/Components/FSM/Boss/BossScriptHostModule.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c2mngevyoefky
|
||||
|
|
@ -19,6 +19,9 @@ public partial class Idle : EnemyStateBase
|
|||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
|
||||
StorageModule.HomePosition = StateMachine.MainObject.GlobalPosition;
|
||||
|
||||
DamageReceiver.ChangeState(false);
|
||||
GD.Print("Boss idle");
|
||||
_ = DelayStart();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public partial class Shooting : EnemyStateBase
|
|||
|
||||
[Export] public EnemyStorageModule StorageModule { get; private set; }
|
||||
|
||||
[Export] public BossScriptHostModule BossScriptHostModule { get; private set; }
|
||||
|
||||
[Export] public BossScript BossScript { get; set; }
|
||||
|
||||
// private Marker2D _cameraMarker;
|
||||
|
|
@ -101,7 +103,7 @@ public partial class Shooting : EnemyStateBase
|
|||
}
|
||||
else
|
||||
{
|
||||
phase.Start(this);
|
||||
phase.Start(BossScriptHostModule);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue