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

32 lines
No EOL
956 B
C#

using System.Collections.Generic;
using System.Linq;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Resources.Loot;
using Godot;
namespace Cirno.Scripts.Components.FSM.Enemy;
public partial class EnemyStorageModule : Node2D, IFSMStorage, IActorStorage
{
[Export]
public EnemyFSMProxy Root { get; private set; }
public Node RootAsNode => Root;
public EnemyResource EnemyData => Root.EnemyResource;
public Vector2 HomePosition { get; set; }
public Vector2 MovementDirection { get; set; }
public Vector2 FacingDirection { get; set; }
public Vector2 AimingDirection { get; set; }
public Vector2 KnockbackVelocity { get; set; } = Vector2.Zero;
public float MovementSpeed => Root.EnemyResource.MovementSpeed;
public IEnumerable<LootDrop> LootDrops => Root.OverrideLoot ? Root.ExtraLoot : Root.EnemyResource.LootDrops.Concat(Root.ExtraLoot);
public AiState AiState { get; set; }
}