mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-13 19:15:53 +00:00
Controllable enemies
This commit is contained in:
parent
cf4b11d157
commit
0aad79a0f8
18 changed files with 893 additions and 23 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.Enums;
|
||||
using System;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Resources.Loot;
|
||||
using Godot;
|
||||
|
|
@ -6,7 +7,7 @@ using Godot.Collections;
|
|||
|
||||
namespace Cirno.Scripts.Components.FSM.Enemy;
|
||||
|
||||
public partial class EnemyFSMProxy : CharacterBody2D
|
||||
public partial class EnemyFSMProxy : CharacterBody2D, IActivable
|
||||
{
|
||||
[Export] public EnemyStateMachine EnemyFSM { get; private set; }
|
||||
|
||||
|
|
@ -21,4 +22,31 @@ public partial class EnemyFSMProxy : CharacterBody2D
|
|||
[Export] public Node2D DefeatScript { get; set; }
|
||||
|
||||
[Export] public ActivationType ActivationType { get; private set; } = ActivationType.Toggle;
|
||||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
switch (activationType)
|
||||
{
|
||||
case ActivationType.Toggle:
|
||||
EnemyFSM.SetState(EnemyState.Controlled);
|
||||
break;
|
||||
case ActivationType.Enable:
|
||||
// Enable or disable AI
|
||||
break;
|
||||
case ActivationType.Disable:
|
||||
// Enable or disable AI
|
||||
break;
|
||||
case ActivationType.Use:
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
EnemyFSM.SetState(EnemyState.Dead);
|
||||
break;
|
||||
case ActivationType.Open:
|
||||
break;
|
||||
case ActivationType.Close:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue