using UnityEngine;

public enum NpcEnumState
{
    InCover,
    InDirectPoint,
    InRunning,
}

public enum NpcBodyState
{
    Crouching,
    Standing,
}

public class NpcCrouchingState : INpcBaseBodyState
{
    public NpcBodyState State => NpcBodyState.Crouching;

    public Vector3 GetPointToHit(GameObject go)
    {
        return go.transform.position + new Vector3(0, 1, 0);
    }
}

public class NpcStandingState : INpcBaseBodyState
{
    public NpcBodyState State => NpcBodyState.Standing;

    public Vector3 GetPointToHit(GameObject go)
    {
        return go.transform.position + new Vector3(0, 1.8f, 0);
    }
}

public class NpcDirectPointState : INpcBaseState
{
    public bool InCover => false;
    public bool IsRunning => false;
    public bool InDirectPoint => false;
    public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInDirectPoint;
    public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInDirectPoint;
    public NpcEnumState State => NpcEnumState.InDirectPoint;
}

public class NpcRunningState : INpcBaseState
{
    public bool InCover => false;
    public bool IsRunning => true;
    public bool InDirectPoint => false;
    public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInRunning;
    public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInRunning;
    public NpcEnumState State => NpcEnumState.InRunning;
}

public class NpcInCoverState : INpcBaseState
{
    public bool InCover => true;
    public bool IsRunning => false;
    public bool InDirectPoint => false;
    public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInCover;
    public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInCover;
    public NpcEnumState State => NpcEnumState.InCover;
}
