using UnityEngine;

[CreateAssetMenu(fileName = "New Armor", menuName = "RPG/Items/Armor")]
[System.Serializable]
public class ArmorItem : Item
{
    [Header("Armor Stats")]
    public int armorClass;
    public int strengthModifier;
    public int dexterityModifier;
    public int constitutionModifier;
    public int wisdomModifier;
    public ArmorType armorType;
    public ArmorSlot armorSlot;

    public ArmorItem()
    {
        itemType = ItemType.Armor;
    }

    public override bool MatchesSearch(string searchTerm)
    {
        if (base.MatchesSearch(searchTerm)) return true;

        if (string.IsNullOrEmpty(searchTerm)) return true;

        searchTerm = searchTerm.ToLower();

        // Check armor type and slot
        if (armorType.ToString().ToLower().Contains(searchTerm)) return true;
        if (armorSlot.ToString().ToLower().Contains(searchTerm)) return true;

        return false;
    }
}

[System.Serializable]
public enum ArmorType
{
    Light,
    Medium,
    Heavy,
    Shield
}

[System.Serializable]
public enum ArmorSlot
{
    Head,
    Chest,
    Legs,
    Feet,
    Hands,
    Arms,
    Shield
}
