using UnityEngine;

namespace IStalk.Data
{
    public enum EyeAbility
    {
        Laser,
        Scan,
        Traps,
        Incarnation
    }

    [CreateAssetMenu(fileName = "EyeType_", menuName = "IStalk/Eye Type")]
    public class EyeType_SO : ScriptableObject
    {
        [Header("Identity")]
        public string typeId;
        public string displayName;
        [TextArea(2, 4)]
        public string description;
        public Sprite icon;

        [Header("Abilities")]
        public EyeAbility[] enabledAbilities;
        public bool hasEyelids;

        [Header("Stat Overrides")]
        [Tooltip("Multiplier for laser cooldown (lower = faster)")]
        public float laserCooldownMultiplier = 1f;
        [Tooltip("Multiplier for laser radius (higher = wider)")]
        public float laserRadiusMultiplier = 1f;
        [Tooltip("Multiplier for scan cooldown (lower = faster)")]
        public float scanCooldownMultiplier = 1f;
        [Tooltip("Multiplier for scan radius (higher = wider)")]
        public float scanRadiusMultiplier = 1f;
        [Tooltip("Multiplier for trap Dread cost (lower = cheaper)")]
        public float trapCostMultiplier = 1f;
        [Tooltip("Bonus to max active traps")]
        public int trapMaxActiveBonus = 0;

        [Header("Dread Overrides")]
        [Tooltip("Override starting Dread (-1 = use default)")]
        public float dreadStartOverride = -1f;
        [Tooltip("Override Dread regen rate (-1 = use default)")]
        public float dreadRegenOverride = -1f;

        public bool HasAbility(EyeAbility ability)
        {
            if (enabledAbilities == null) return false;
            for (int i = 0; i < enabledAbilities.Length; i++)
            {
                if (enabledAbilities[i] == ability) return true;
            }
            return false;
        }
    }
}
