using UnityEngine;
using UnityEngine.Serialization;

[CreateAssetMenu(fileName = "ActionData", menuName = "Combat/ActionData")]
public class ActionData : ScriptableObject
{
    [FormerlySerializedAs("AttackName")]
    [FormerlySerializedAs("MotionName")]
    public string ActionName;
    public string AnimationState;
    public float AnimationSpeed = 1f;
    public AnimationCurve AnimationSpeedCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f);
    public float Cooldown = 0.3f;
    public float ComboWindow = 0.25f;

    [Header("Motion")]
    public bool HasMotion;
    public Vector2 Velocity = Vector2.zero;
    public AnimationCurve MotionSpeedCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f);
    [FormerlySerializedAs("Duration")]
    public float MotionDuration = 0.3f;
    public bool CanMoveDuringAction;
    public bool CanTurnDuringAction;
    public bool UseInputDirection = true;
    public bool PreserveYVelocity = true;
    public bool StopHorizontalVelocityOnEnd = true;

    [Header("Hit")]
    public bool HasHit = true;
    public Vector2 Offset = new Vector2(0.5f, 0f);
    public float Radius = 0.5f;
    public int Damage = 10;
    public float HitTiming = 0.15f;
    public float HitDuration = 0f;

    [Header("Hit Reaction")]
    public Vector2 HitVelocity = Vector2.zero;
    public bool UseHitPositionCorrection;
    public Vector2 HitTargetOffset = new Vector2(0.8f, 0f);
    public float HitPositionCorrectionDuration = 0.08f;
    public bool CorrectHitTargetY;
    public string HitReactionAnimationState;
}
