// check if the attack 1)success or not, 2)is cretic or not
        public static AttackChecker AttackCheck(Player p, int attackBouns, int armorClass)
        {
            int d20Result  = 0;
            int d20Result2 = 0;
            int attack     = 0;

            Statue.NAD AttackerNAD = p.nad;

            d20Result  = Dice.RollDice("1D20+0");
            d20Result2 = Dice.RollDice("1D20+0");

            //attack check > armor class   => success
            //attack check == 20           =? critical
            //attack check == 1            => always fail
            bool isCritSuc = false;
            bool isFail    = false;

            switch (AttackerNAD)
            {
            case Statue.NAD.Normal:    //Normal
                attack    = d20Result + attackBouns;
                isFail    = (attack == 1);
                isCritSuc = (attack == 20);
                return(new AttackChecker(
                           (isFail) ? false : (attack > (armorClass - 1)),
                           isCritSuc));

            case Statue.NAD.Advantage:     //Advantage
                attack    = (d20Result > d20Result2) ? d20Result + attackBouns : d20Result2 + attackBouns;
                isCritSuc = (d20Result > d20Result2) ? (d20Result == 20) : (d20Result2 == 20);
                isFail    = (d20Result > d20Result2) ? (d20Result == 1) : (d20Result2 == 1);
                return(new AttackChecker(
                           (isFail) ? false : (attack > (armorClass - 1)),
                           isCritSuc));

            case Statue.NAD.Disadvantage:     //Disadvantage
                attack    = (d20Result < d20Result2) ? d20Result + attackBouns : d20Result2 + attackBouns;
                isCritSuc = (d20Result < d20Result2) ? (d20Result == 20) : (d20Result2 == 20);
                isFail    = (d20Result < d20Result2) ? (d20Result == 1) : (d20Result2 == 1);
                return(new AttackChecker(
                           (isFail) ? false : (attack > (armorClass - 1)),
                           isCritSuc));
            }
            return(new AttackChecker(false, false));
        }
        // check if the attack 1)success or not, 2)is critic or not
        public static AttackChecker AttackCheck(Enemy e, Player p)
        {
            int  armorClass    = p.armorClass;
            bool isEnemyMelee  = (e.ea.meleeAttack.r != 0 || e.ea.meleeAttack.i != 0);
            bool isEnemyRanged = (e.ea.rangedAttack.r != 0 || e.ea.rangedAttack.i != 0);

            int modBouns  = 0;
            int meleeMod  = 0;
            int RangedMod = 0;

            if (isEnemyMelee && isEnemyRanged)
            {
                meleeMod  = e.abm.STR;
                RangedMod = e.abm.DEX;
                modBouns  = (meleeMod > RangedMod) ? meleeMod : RangedMod;
            }
            else if (isEnemyMelee)
            {
                modBouns = e.abm.STR;;
            }
            else if (isEnemyRanged)
            {
                modBouns = e.abm.DEX;
            }


            int d20Result  = 0;
            int d20Result2 = 0;
            int attack     = 0;


            Statue.NAD AttackerNAD = p.nad;

            d20Result  = Dice.RollDice("1D20+0");
            d20Result2 = Dice.RollDice("1D20+0");

            //attack check > armor class   => success
            //attack check == 20           =? critical
            //attack check == 1            => always fail
            bool isCritSuc = false;
            bool isFail    = false;

            switch (AttackerNAD)
            {
            case Statue.NAD.Normal:    //Normal
                attack = d20Result + modBouns;
                isFail = (attack == 1);
                return(new AttackChecker(
                           (isFail) ? false : (attack > (armorClass - 1)),
                           (d20Result == 20)));

            case Statue.NAD.Advantage:     //Advantage
                attack    = (d20Result > d20Result2) ? d20Result + modBouns : d20Result2 + modBouns;
                isCritSuc = (d20Result > d20Result2) ? (d20Result == 20) : (d20Result2 == 20);
                isFail    = (d20Result > d20Result2) ? (d20Result == 1) : (d20Result2 == 1);
                return(new AttackChecker(
                           (isFail)? false: (attack > (armorClass - 1)),
                           isCritSuc));

            case Statue.NAD.Disadvantage:     //Disadvantage
                attack    = (d20Result < d20Result2) ? d20Result + modBouns : d20Result2 + modBouns;
                isCritSuc = (d20Result < d20Result2) ? (d20Result == 20) : (d20Result2 == 20);
                isFail    = (d20Result < d20Result2) ? (d20Result == 1) : (d20Result2 == 1);
                return(new AttackChecker(
                           (isFail) ? false : (attack > (armorClass - 1)),
                           isCritSuc));
            }
            return(new AttackChecker(false, false));
        }