using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XmdsCommon.Plugin
{
    public struct NumericalBound
    {
        public int MinValue;
        public int MaxValue;

        public NumericalBound(int min, int max)
        {
            this.MinValue = min;
            this.MaxValue = max;
        }
    }

    public class XmdsStaticLimit
    {
        //攻速基础值
        public static readonly int BaseAttackSpeed = 10000;

        //攻速限制
        public static readonly NumericalBound AttackSpeed = new NumericalBound(-5000, 25000);

        //移速限制
        public static readonly NumericalBound MoveSpeed = new NumericalBound(-5000, 5000);

        //冷却缩减
        public static readonly NumericalBound SkillCoolCut = new NumericalBound(0, 4000);

        //伤害减免
        public static readonly NumericalBound DamageRemit = new NumericalBound(0, 5000);

        //韧性
        public static readonly NumericalBound Toughness = new NumericalBound(0, 3000);

        //技能伤害增幅
        public static readonly NumericalBound SkillDamageDeep = new NumericalBound(0, 5000);

        //治疗增幅
        public static readonly NumericalBound CureDeep = new NumericalBound(0, 5000);

        //控制增幅
        public static readonly NumericalBound ControlDeep = new NumericalBound(0, 5000);

        //

        //

        //

        //

        //

        //

        //

        //

        //

        //
        //
        //
        //
        //
        //
        //
        //
        //
        //

        public static int GetNormalAttackCD(int atkSpeed, int totalCDTime)
        {
            if (atkSpeed < XmdsStaticLimit.BaseAttackSpeed)
            {
                int downCD = totalCDTime * atkSpeed / XmdsStaticLimit.BaseAttackSpeed;
                return totalCDTime * 2 - downCD;
            }
            else if (XmdsStaticLimit.BaseAttackSpeed < atkSpeed)
            {
                int downCD = totalCDTime * XmdsStaticLimit.BaseAttackSpeed / atkSpeed;
                return totalCDTime - downCD;
            }

            return totalCDTime;
        }
    }
}