using UnityEngine;

/// <summary>
/// Configurable movement schema for different AI behaviors when teammate has puck.
/// Allows customization of positioning and support patterns.
/// </summary>
[CreateAssetMenu(fileName = "MovementSchema", menuName = "Hockey/AI/Movement Schema")]
public class MovementSchema : ScriptableObject
{
    [Header("General Settings")]
    [Tooltip("Name of this movement schema")]
    public string schemaName = "Default";

    [Header("Defender Behavior When Teammate Has Puck")]
    [Tooltip("How far ahead of the puck carrier should defenders position")]
    [Range(0f, 15f)]
    public float defenderSupportDistance = 5f;

    [Tooltip("How wide should defenders spread (lateral distance)")]
    [Range(0f, 10f)]
    public float defenderLateralSpread = 4f;

    [Tooltip("Should defender stay at blue line or push forward")]
    public bool defenderStayAtBlueLine = false;

    [Header("Forward Behavior When Teammate Has Puck")]
    [Tooltip("How far ahead should forwards position")]
    [Range(0f, 20f)]
    public float forwardPushDistance = 8f;

    [Tooltip("Width of forward spread")]
    [Range(0f, 15f)]
    public float forwardLateralSpread = 6f;

    [Tooltip("How aggressively forwards should push into offensive zone")]
    [Range(0f, 1f)]
    public float forwardAggressiveness = 0.7f;

    [Tooltip("Minimum speed forwards should maintain when attacking")]
    [Range(0f, 10f)]
    public float forwardMinimumSpeed = 3f;

    [Header("Pass Reception")]
    [Tooltip("How far from puck carrier to look for pass reception positions")]
    [Range(5f, 30f)]
    public float passReceptionDistance = 15f;

    [Tooltip("Prefer positions closer to opponent goal")]
    public bool favorOffensivePositions = true;

    [Header("Defensive Coverage")]
    [Tooltip("Formation when opponent has puck: Tight = close together, Wide = spread out")]
    [Range(0f, 1f)]
    public float defensiveFormationWidth = 0.5f;

    [Tooltip("How deep defenders should play (closer to own goal)")]
    [Range(0f, 1f)]
    public float defensiveDepth = 0.6f;

    [Header("Forechecking")]
    [Tooltip("Number of forwards that should aggressively forecheck")]
    [Range(0, 3)]
    public int forecheckersCount = 1;

    [Tooltip("How aggressive the forecheck should be")]
    [Range(0f, 1f)]
    public float forecheckAggression = 0.5f;
}
