using System;
using UnityEngine;

namespace pdinklag.CPW.Common
{
    /// <summary>
    /// Contains information about a strike.
    /// </summary>
    [Serializable]
    public struct StrikeInfo
    {
        /// <summary>
        /// Enumeration of strike directions relative to the instigator.
        /// </summary>
        public enum RelativeDirection
        {
            Forward,
            Back,
            Left,
            Right,
        }

        /// <summary>
        /// Enumeration of ways that a strike can be caught by a well-timed block.
        /// </summary>
        public enum CatchActionType
        {
            None,          // cannot be caught
            PushRightArm,  // pushes the instigator's right arm away, staggering them momentarily
            HoldRightLeg   // hold the instigator's right leg, allowing for a counter-action
        }

        /// <summary>
        /// The default strike info.
        /// </summary>
        public static StrikeInfo Default
        {
            get
            {
                var info = new StrikeInfo
                {
                    SizeMultiplier = 1,
                    Direction = RelativeDirection.Forward,
                    FieldOfView = 180,
                    BaseDamage = 1,
                    BaseForce = 1,
                };
                return info;
            }
        }

        [Header("General")]
        [Tooltip("The direction of the strike relative to the instigator.")]
        public RelativeDirection Direction;

        [Tooltip("The field of view angle for the strike.")]
        public FieldOfView2D FieldOfView;

        [Tooltip("If checked, the strike ignores ring boundaries, e.g., a wrestler on the outside can hit one on the inside or vice versa.")]
        public bool IgnoreRingBoundaries;

        [Tooltip("When hitting somebody, disable the collision between the instigator and the victim's ragdoll for this many seconds.")]
        public float RagdollCollisionDisableTime;

        [Tooltip("What happens when the strike is caught by a well-timed block.")]
        public CatchActionType CatchAction;

        [Header("Body Parts")]
        [Tooltip("The body parts that the strike is performed with.")]
        public StrikeBodyParts StrikingParts;

        [Tooltip("The size multiplier applied to part colliders for hit detection.")]
        public float SizeMultiplier;

        [Tooltip("The strike's base damage before modifiers.")]
        public float BaseDamage;

        [Tooltip("The strike's damage type.")]
        public AssetAddress DamageType;

        [Tooltip("The amount of momentum the instigator gains when landing at least one hit.")]
        public float InstigatorMomentumGain;

        [Tooltip("The amount of momentum any wrestler that was hit loses.")]
        public float VictimMomentumLoss;

        [Tooltip("The strike's base force applied to a ragdoll before modifiers.")]
        public float BaseForce;

        [Header("Weapon")]
        [Tooltip("Consider the weapon that the wrestler is bearing, if any.")]
        public bool StrikeWithWeapon;
    }
}
