using Cirno.Scripts.Resources.ScriptableBullets;
using Godot;

namespace Cirno.Scripts.Actors;

public partial class BossSpawner : ActorSpawner
{
    [Export] public BossScript BossScript { get; private set; }
    
    public override void Spawn()
    {
        base.Spawn();
        if (SpawnedActor is Boss boss)
        {
            boss.BossScript = BossScript;

            CallDeferred(MethodName.ActivateBossDeferred);
            //boss.Activate();
        }
    }

    private void ActivateBossDeferred()
    {
        if (SpawnedActor is IActivable activable)
        {
            activable.Activate();
        }
    }
}