Esempio n. 1
0
        public void CheckCMB()
        {
            string CheckName = "CMB";
            int    CMB       = 0;

            AbilityScores.AbilityScores.AbilityName abilityName = AbilityScores.AbilityScores.AbilityName.Strength;


            if (SizeCat <= StatBlockInfo.SizeCategories.Tiny)
            {
                abilityName = AbilityScores.AbilityScores.AbilityName.Dexterity;
            }
            else if (_monSBSearch.HasFeat("Agile Maneuvers"))
            {
                abilityName = AbilityScores.AbilityScores.AbilityName.Dexterity;
            }
            else if (_monSBSearch.HasDefensiveAbility("incorporeal"))
            {
                abilityName = AbilityScores.AbilityScores.AbilityName.Dexterity;
            }

            int AbilityMod = StatBlockInfo.GetAbilityModifier(_monSBSearch.GetAbilityScoreValue(abilityName));
            // int BAB = Convert.ToInt32(Utility.GetNonParenValue(BaseAtk));
            int BAB = CharacterClasses.GetBABValue() + (CharacterClasses.HasClass("animal companion") ? 0 : Race_Base.RaceBAB());

            //was taken out before, added back in 11/8/2014
            if (HasMonk)
            {
                int MonkLevel = CharacterClasses.FindClassLevel("Monk");
                if (MonkLevel >= 3)
                {
                    BAB = MonkLevel + CharacterClasses.GetNonMonkBABValue() + Race_Base.RaceBAB();
                }
            }

            CMB = BAB + (SizeMod * -1) + AbilityMod + OnGoing;
            string formula = BAB.ToString() + " BAB " + Utility.GetPlusSign(SizeMod * -1) + (SizeMod * -1).ToString() + " SizeMod +" + AbilityMod.ToString() + " " + abilityName.ToString() + " AbilityMod";

            if (OnGoing != 0)
            {
                formula += "+" + OnGoing.ToString() + " (" + formulaOnGoing + ") OnGoingAttackMod";
            }

            _messageXML.AddInfo("Base BAB: " + (BAB + (SizeMod) + AbilityMod).ToString());

            if (_monSBSearch.HasSubType("swarm"))
            {
                CMB     = 0;
                formula = "0 swarm";
            }


            string holdCMB = Utility.GetNonParenValue(CMBString);

            if (holdCMB == "-")
            {
                holdCMB = "0";
            }
            if (CMB == Convert.ToInt32(holdCMB))
            {
                _messageXML.AddPass(CheckName, formula);
            }
            else
            {
                _messageXML.AddFail(CheckName, CMB.ToString(), holdCMB, formula);
            }
        }