cirnogodot/Scripts/Components/FSM/Enemy/EnemyStorageModule.cs

30 lines
813 B
C#
Raw Normal View History

2025-03-21 16:03:44 +01:00
using System.Collections.Generic;
using System.Linq;
2025-03-25 15:15:04 +01:00
using Cirno.Scripts.Resources;
2025-03-21 16:03:44 +01:00
using Cirno.Scripts.Resources.Loot;
using Godot;
using Godot.Collections;
2025-03-20 18:22:40 +01:00
namespace Cirno.Scripts.Components.FSM.Enemy;
2025-03-28 19:47:10 +01:00
public partial class EnemyStorageModule : Node2D, IFSMStorage
2025-03-20 18:22:40 +01:00
{
[Export]
public EnemyFSMProxy Root { get; private set; }
2025-03-25 15:15:04 +01:00
2025-03-28 19:47:10 +01:00
public Node2D RootAsNode => Root;
2025-03-25 15:15:04 +01:00
public EnemyResource EnemyData => Root.EnemyResource;
2025-03-20 18:22:40 +01:00
public Vector2 MovementDirection { get; set; }
public Vector2 FacingDirection { get; set; }
2025-03-21 17:52:01 +01:00
public Vector2 AimingDirection { get; set; }
2025-03-20 18:22:40 +01:00
public float MovementSpeed => Root.EnemyResource.MovementSpeed;
2025-03-21 16:03:44 +01:00
public IEnumerable<LootDrop> LootDrops => Root.EnemyResource.LootDrops.Concat(Root.ExtraLoot);
2025-03-20 18:22:40 +01:00
2025-03-21 17:52:01 +01:00
public AiState AiState { get; set; }
2025-03-20 18:22:40 +01:00
}