using UnityEngine;

/// <summary>
/// GAME 1303 Tier 4 — One level's identity and unlock rule. Create -> GAME1303 -> Level.
/// Zap Attack (4 sectors × 10 levels), MythoClash (Drachma-gated worlds).
///
/// Make one asset per level and list them in a LevelSet (one LevelSet per sector/world).
/// Progress (cleared, best time) is stored by Level Id in PlayerPrefs by LevelProgress —
/// so DON'T rename Level Id after students have playtested, or their saves reset.
/// </summary>
[CreateAssetMenu(menuName = "GAME1303/Level", fileName = "NewLevel")]
public class LevelData : ScriptableObject
{
    [Header("Identity")]
    [Tooltip("Unique save key. Keep it stable — progress is stored under this name.")]
    public string levelId = "sector1_level1";
    public string displayName = "Level 1";
    public Sprite thumbnail;
    [Tooltip("Scene name — must be added to File > Build Settings.")]
    public string sceneName = "";

    [Header("Unlocking")]
    [Tooltip("Always playable (the first level of a sector).")]
    public bool unlockedFromStart = false;
    [Tooltip("Level Ids that must be cleared first. Leave empty for 'the previous one in the set'.")]
    public string[] requiresCleared;
    [Tooltip("Currency needed to unlock (Zap Attack's green electricity, MythoClash's Drachma). 0 = free.")]
    public int unlockCost = 0;
    public ItemType unlockCurrency;

    [Header("Goals (optional)")]
    public float targetTime = 0f;
    public int collectiblesInLevel = 0;
    public bool isBossLevel = false;
}