using Cirno.Scripts.Components;
using Godot;

namespace Cirno.Scripts.AttackPatterns;

[GlobalClass]
[Tool]
public partial class LaserPattern : SpiralPattern
{
    [ExportGroup("Laser")][Export] public float SpawnDelay { get; set; } = 0.3f; // Delay before beam appears
    [ExportGroup("Laser")][Export] public float PreFireTime { get; set; } = 0.5f; // Time before laser becomes lethal
    [ExportGroup("Laser")][Export] public float LethalTime { get; set; } = 1.5f; // Time laser remains lethal
    [ExportGroup("Laser")][Export] public Color PreFireColor { get; set; } = new Color(1, 0, 0, 0.5f); // Thin red beam
    [ExportGroup("Laser")][Export] public Color LethalColor { get; set; } = new Color(1, 0, 0, 1.0f); // Thicker beam
    
    protected override BulletInfo MakeBullet(Vector2 position, int count = 1, float spread = 0f, float rotationOffset = 0f)
    {
        var bf = base.MakeBullet(position, count, spread, rotationOffset);
        
        bf.IsLaser = true;
        bf.PreFireTime = PreFireTime;
        bf.LethalTime = LethalTime;
        bf.PreFireColor = PreFireColor;
        bf.LethalColor = LethalColor;
        bf.SpawnDelay = SpawnDelay;

        return bf;
    }
}