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

32 lines
956 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;
2025-03-20 18:22:40 +01:00
namespace Cirno.Scripts.Components.FSM.Enemy;
public partial class EnemyStorageModule : Node2D, IFSMStorage, IActorStorage
2025-03-20 18:22:40 +01:00
{
[Export]
public EnemyFSMProxy Root { get; private set; }
2025-03-25 15:15:04 +01:00
public Node RootAsNode => Root;
2025-03-28 19:47:10 +01:00
2025-03-25 15:15:04 +01:00
public EnemyResource EnemyData => Root.EnemyResource;
2025-03-20 18:22:40 +01:00
2025-04-28 18:06:07 +02:00
public Vector2 HomePosition { get; set; }
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-05-06 16:06:00 +02:00
public Vector2 KnockbackVelocity { get; set; } = Vector2.Zero;
2025-03-20 18:22:40 +01:00
public float MovementSpeed => Root.EnemyResource.MovementSpeed;
2025-03-21 16:03:44 +01:00
2025-04-25 18:33:20 +02:00
public IEnumerable<LootDrop> LootDrops => Root.OverrideLoot ? Root.ExtraLoot : 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
}