private int NonNaturalWeaponCount(List <string> weaponsList)
        {
            int           count          = 0;
            Weapon        weapon         = null;
            NaturalWeapon natural_weapon = null;

            foreach (string MW in weaponsList)
            {
                weapon         = null;
                natural_weapon = null;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    if (weapon != null && weapon.name != "bite")
                    {
                        count++;
                    }
                    if (natural_weapon != null)
                    {
                    }
                }
            }
            return(count);
        }
Ejemplo n.º 2
0
        private int NonNaturalWeaponCount(List <string> WeaponsList)
        {
            int           count          = 0;
            Weapon        weapon         = null;
            NaturalWeapon natural_weapon = null;

            foreach (string MW in WeaponsList)
            {
                weapon         = null;
                natural_weapon = null;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    if (weapon != null && weapon.name != "bite")
                    {
                        count++;
                    }
                    if (natural_weapon != null)
                    {
                    }
                }
            }
            return(count);
        }
        private void CheckOneRangedOrBlock(string rangedWeapon)
        {
            List <string> Found  = new List <string>();
            List <string> Ranged = new List <string>();

            string[] temp2 = new string[] { " and" };
            if (rangedWeapon.Contains(" and "))
            {
                Ranged = rangedWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            else if (rangedWeapon.Contains(", "))
            {
                temp2  = new string[] { ", " };
                Ranged = rangedWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            else
            {
                Ranged.Add(rangedWeapon);
            }

            bool SimpleOne = false;

            foreach (string ranged in Ranged)
            {
                Weapon        weapon         = null;
                NaturalWeapon natural_weapon = null;
                WeaponCommon  weaponCommon   = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
                bool          MagicWeapon;
                bool          GreaterMagicWeapon;

                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, ranged.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    Found.Add(ranged.Trim());
                    CheckOneRangedWeaponFound(weapon, ranged.Trim(), MagicWeapon, GreaterMagicWeapon, ref SimpleOne, _raceWeapons);
                }
                else
                {
                    _sbCheckerBaseInput.MessageXML.AddFail("Ranged Attack", "Missing Weapon-" + rangedWeapon.Trim());
                }
            }
        }
        private void CheckOneRangedOrBlock(string rangedWeapon)
        {
            List <string> Found  = new List <string>();
            List <string> Ranged = new List <string>();

            string[] temp2 = new string[] { " and" };
            if (rangedWeapon.Contains(" and "))
            {
                Ranged = rangedWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList <string>();
            }
            else if (rangedWeapon.Contains(", "))
            {
                temp2  = new string[] { ", " };
                Ranged = rangedWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList <string>();
            }
            else
            {
                Ranged.Add(rangedWeapon);
            }

            bool SimpleOne = false;

            foreach (string ranged in Ranged)
            {
                Weapon        weapon         = null;
                NaturalWeapon natural_weapon = null;
                WeaponCommon  weaponCommon   = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                bool          MagicWeapon;
                bool          GreaterMagicWeapon;

                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, ranged.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    Found.Add(ranged.Trim());
                    CheckOneRangedWeaponFound(weapon, ranged.Trim(), MagicWeapon, GreaterMagicWeapon, ref SimpleOne, RaceWeapons);
                }
                else
                {
                    _messageXML.AddFail("Ranged Attack", "Missing Weapon-" + rangedWeapon.Trim());
                }
            }
        }
Ejemplo n.º 5
0
        private bool HasNonNaturalWeapon(List <string> WeaponsList)
        {
            Weapon        weapon         = null;
            NaturalWeapon natural_weapon = null;

            foreach (string MW in WeaponsList)
            {
                weapon         = null;
                natural_weapon = null;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    if (weapon != null)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        private bool HasNonNaturalWeapon(List <string> weaponsList)
        {
            Weapon        weapon         = null;
            NaturalWeapon natural_weapon = null;

            foreach (string MW in weaponsList)
            {
                weapon         = null;
                natural_weapon = null;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    if (weapon != null)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        private void CheckOneRangedWeaponFound(Weapon weapon, string rangedWeapon, bool MagicWeapon, bool GreaterMagicWeapon,
                                               ref bool SimpleOne, string _raceWeapons)
        {
            string        holdRangedWeapon;
            List <string> Bonuses = null;
            string        weaponsDamage = string.Empty;
            string        weaponBonus = string.Empty;
            int           weaponBonusComputed, AbilityBonus;
            int           weaponBonusSB = 0;
            string        formula       = string.Empty;
            int           RangeMod      = 0;

            holdRangedWeapon = rangedWeapon;

            holdRangedWeapon = holdRangedWeapon.Replace("ranged touch", string.Empty);
            if (holdRangedWeapon.Contains("Rapid Shot"))
            {
                holdRangedWeapon = holdRangedWeapon.Replace("Rapid Shot", string.Empty).Trim();
                RangeMod        -= 2;
            }

            _weaponChecker.ParseSingleWeapon(weapon, ref weaponBonus, ref weaponsDamage, ref holdRangedWeapon, ref Bonuses);
            _weaponChecker.CheckRangedWeaponDamage(weapon, weaponsDamage, _size, _sbCheckerBaseInput.AbilityScores, _sbCheckerBaseInput.MonsterSBSearch, _sbCheckerBaseInput.MessageXML, MagicWeapon, GreaterMagicWeapon, _sbCheckerBaseInput.IndvSB);

            AbilityBonus = _sbCheckerBaseInput.AbilityScores.DexMod;
            string AbilityUsed = " Dex Mod ";

            if (rangedWeapon.Contains("hand of the acolyte"))
            {
                AbilityBonus = _sbCheckerBaseInput.AbilityScores.WisMod;
                AbilityUsed  = " Wis Mod (hand of the acolyte) ";
            }

            if (holdRangedWeapon.Contains("/+"))
            {
                if (!_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Quick Draw") && Utility.IsThrownWeapon(weapon.search_name.ToLower()))
                {
                    _sbCheckerBaseInput.MessageXML.AddFail("Ranged Iterative Attacks", "No Quick Draw, so can't have Iterative Attacks for " + weapon.name);
                }
            }

            int BAB = Convert.ToInt32(Utility.GetNonParenValue(_baseAtk));

            if (holdRangedWeapon.Contains("flurry of blows"))
            {
                holdRangedWeapon = holdRangedWeapon.Replace("flurry of blows", string.Empty).Trim();
                BAB = _racialHDValue + _sbCheckerBaseInput.CharacterClasses.GetNonMonkBABValue() + _sbCheckerBaseInput.CharacterClasses.FindClassLevel("Monk") - 2;
            }

            weaponBonusComputed = BAB + AbilityBonus + _sizeMod + RangeMod;
            formula            += BAB + " _baseAtk +" + AbilityBonus.ToString() + AbilityUsed
                                  + CommonMethods.GetStringValue(_sizeMod) + " _sizeMod +" + RangeMod.ToString() + " RangeMod";

            if (weapon.name == "Sling" && _sbCheckerBaseInput.MonsterSBSearch.HasGear("stones"))
            {
                weaponBonusComputed--;
                formula += " -1 sling with stones";
            }

            if (weapon.name == "rock" && _sbCheckerBaseInput.MonsterSBSearch.HasSpecialAttackGeneral("rock throwing"))
            {
                weaponBonusComputed++;
                formula += " +1 rock throwing";
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("crossbowman"))
            {
                int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter");
                if (fighterLevel >= 5)
                {
                    int tempBonus = 1;
                    if (fighterLevel >= 9)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 13)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 17)
                    {
                        tempBonus++;
                    }
                    weaponBonusComputed += tempBonus;
                    formula             += " +" + tempBonus.ToString() + " crossbowman crossbow expert";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("archer"))
            {
                int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter");
                if (fighterLevel >= 5)
                {
                    int tempBonus = 1;
                    if (fighterLevel >= 9)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 13)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 17)
                    {
                        tempBonus++;
                    }
                    weaponBonusComputed += tempBonus;
                    formula             += " +" + tempBonus.ToString() + " Expert Archer";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("spirit (champion)"))
            {
                int mediumLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("medium");
                int bonus       = 1;
                if (mediumLevel >= 4)
                {
                    bonus++;
                }
                if (mediumLevel >= 8)
                {
                    bonus++;
                }
                if (mediumLevel >= 12)
                {
                    bonus++;
                }
                if (mediumLevel >= 15)
                {
                    bonus++;
                }
                if (mediumLevel >= 19)
                {
                    bonus++;
                }

                weaponBonusComputed += bonus;
                formula             += " +" + bonus.ToString() + " spirit (champion)";
            }

            string hold = null;

            if (weapon.NamedWeapon)
            {
                hold = weapon.BaseWeaponName.ToLower();
            }
            else
            {
                hold = weapon.search_name.ToLower();
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Weapon Focus (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                weaponBonusComputed++;
                formula += " +1 Weapon Focus";
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Greater Weapon Focus (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                weaponBonusComputed++;
                formula += " +1 Greater Weapon Focus";
            }

            if (weapon.Masterwork && weapon.EnhancementBonus == 0)
            {
                weaponBonusComputed++;
                formula += " +1 Masterwork";
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSpecialAttackGeneral("weapon training"))
            {
                weaponBonusComputed += _sbCheckerBaseInput.MonsterSBSearch.GetWeaponsTrainingModifier(weapon.search_name, ref formula);
            }

            try
            {
                weaponBonusSB = Convert.ToInt32(Bonuses.FirstOrDefault());
            }
            catch
            {
                _sbCheckerBaseInput.MessageXML.AddFail("CheckOneRangedWeaponFound", "Failure to convert Bonus to Int from value of " + Bonuses.FirstOrDefault());
            }

            WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
            bool         ignore       = false;

            if (_sbCheckerBaseInput.IndvSB != null)
            {
                weaponCommon.GetOnGoingAttackMods(ref weaponBonusComputed, ref formula, MagicWeapon, GreaterMagicWeapon, out ignore);
            }

            if (weapon.EnhancementBonus > 0 && !ignore)
            {
                weaponBonusComputed += weapon.EnhancementBonus;
                formula             += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus";
            }

            if (Bonuses.Count > 1)
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Rapid Shot") && weaponBonusComputed - 2 == weaponBonusSB & weapon.name.Contains("bow"))
                {
                    weaponBonusComputed -= 2;
                }
            }

            if (weapon.name == "bomb" && _sbCheckerBaseInput.MonsterSBSearch.HasFeat("Throw Anything"))
            {
                weaponBonusComputed++;
                formula += " +1 Throw Anything";
            }

            weaponCommon.CheckWeaponProficiency(weapon, ref weaponBonusComputed, ref formula, ref SimpleOne, _raceWeapons);

            if (weaponBonusComputed == weaponBonusSB)
            {
                _sbCheckerBaseInput.MessageXML.AddPass("Ranged Attack Bonus " + weapon.Weapon_FullName(), formula);
            }
            else
            {
                _sbCheckerBaseInput.MessageXML.AddFail("Ranged Attack Bonus " + weapon.Weapon_FullName(), weaponBonusComputed.ToString(), weaponBonusSB.ToString(), formula);
            }
        }
Ejemplo n.º 8
0
        private void CheckOneMeleeOrBlock(List <string> Found, string meleeWeapon)
        {
            NaturalWeapon natural_weapon        = null;
            Weapon        weapon                = null;
            bool          TwoWeaponFighting     = false;
            bool          MultipleWepons        = false;
            bool          NaturalMultipleWepons = false;
            bool          LightWeapon           = false;
            bool          BiteAttack            = false;
            List <string> Melee2                = new List <string>();

            string[] temp2 = new string[] { " and" };
            Utility.ParenCommaFix(ref meleeWeapon);

            if (FindNonParenAnd(meleeWeapon))
            {
                Melee2 = meleeWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList <string>();
            }
            else if (meleeWeapon.IndexOf(", ") >= 0)
            {
                temp2  = new string[] { ", " };
                Melee2 = meleeWeapon.Split(temp2, StringSplitOptions.RemoveEmptyEntries).ToList <string>();
            }
            else
            {
                Melee2.Add(meleeWeapon);
            }

            LightWeapon = false;
            BiteAttack  = false;
            if (Melee2.Count > 1)
            {
                MultipleWepons = true;
                foreach (string weap in Melee2)
                {
                    if (weap.IndexOf("bite") >= 0)
                    {
                        BiteAttack = true;
                    }
                    if (FindLightWeapon(weap))
                    {
                        LightWeapon = true;
                    }
                }
                if (NonNaturalWeaponCount(Melee2) != 1)
                {
                    TwoWeaponFighting = true;
                }
            }

            Found.Add(meleeWeapon);
            if (HasNonNaturalWeapon(Melee2))
            {
                NaturalMultipleWepons = true;
            }
            int  weaponIndex = 0;
            bool SimpleOne   = false;

            foreach (string MW in Melee2) // loop on "and" blocks
            {
                weapon         = null;
                natural_weapon = null;
                weaponIndex++;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    Found.Add(MW);
                    CheckOneMeleeWeaponFound(natural_weapon, weapon, TwoWeaponFighting, MultipleWepons, LightWeapon,
                                             BiteAttack, Melee2.Count, weaponIndex, MW, MagicWeapon, GreaterMagicWeapon, ref SimpleOne, RaceWeapons, NaturalMultipleWepons);
                }
                else
                {
                    _messageXML.AddFail("Melee Attack", "Missing Weapon-" + MW.Trim());
                }
            }
        }
Ejemplo n.º 9
0
        private void CheckOneWeaponMeleeNonNatural(Weapon weapon, ref int weaponBonusComputed, bool TwoWeaponFighting, bool LightWeapon,
                                                   bool BiteAttack, ref List <string> Bonuses, string MW, int weaponCount, int weaponIndex, ref string formula, bool MagicWeapon, bool GreaterMagicWeapon)
        {
            string weaponBonus     = string.Empty;
            string weaponsDamage   = string.Empty;
            string holdMeleeWeapon = string.Empty;

            int SizeDifference = 0;

            StatBlockInfo.SizeCategories MonSize    = StatBlockInfo.GetSizeEnum(Size);
            StatBlockInfo.SizeCategories WeaponSize = weapon.WeaponSize;
            if (WeaponSize == StatBlockInfo.SizeCategories.Medium && MonSize != WeaponSize)
            {
                WeaponSize = MonSize;
            }
            if (MonSize != WeaponSize)
            {
                SizeDifference = Math.Abs(StatBlockInfo.GetSizeDifference(MonSize, WeaponSize));
            }

            holdMeleeWeapon = MW.Trim();
            int Pos = holdMeleeWeapon.IndexOf(" ");

            if (Pos == 1)
            {
                holdMeleeWeapon = holdMeleeWeapon.Substring(Pos).Trim();
            }

            int BAB = Convert.ToInt32(Utility.GetNonParenValue(BaseAtk));

            if (holdMeleeWeapon.Contains("flurry of blows"))
            {
                holdMeleeWeapon = holdMeleeWeapon.Replace("flurry of blows", string.Empty).Trim();
                BAB             = RacialHDValue + CharacterClasses.GetNonMonkBABValue() + CharacterClasses.FindClassLevel("Monk") - 2;
            }


            _weaponChecker.ParseSingleWeapon(weapon, ref weaponBonus, ref weaponsDamage, ref holdMeleeWeapon, ref Bonuses);

            try
            {
                _weaponChecker.CheckMeleeWeaponDamage(weapon, weaponsDamage, TwoWeaponFighting, BiteAttack, weaponCount, weaponIndex,
                                                      Size, _abilityScores, _monSBSearch, _messageXML, CharacterClasses.FindClassLevel("fighter"), _acDefendingMod, MagicWeapon, GreaterMagicWeapon, _indvSB);
            }
            catch (Exception ex)
            {
                _messageXML.AddFail("CheckOneWeaponMeleeNonNatural - CheckMeleeWeaponDamage", ex.Message);
            }
            int AbilityBonus = _abilityScores.StrMod;

            if (_monSBSearch.HasFeat("Weapon Finesse"))
            {
                if (IsWeaponFinesseCategory(weapon))
                {
                    AbilityBonus = _abilityScores.DexMod;
                }
            }

            if (MW.Contains("dueling sword") && _monSBSearch.HasFeat("Weapon Finesse") && _monSBSearch.HasFeat("Exotic Weapon Proficiency (Aldori dueling sword)"))
            {
                AbilityBonus = _abilityScores.DexMod;
            }

            if (_monSBSearch.HasDefensiveAbility("incorporeal"))
            {
                AbilityBonus = _abilityScores.DexMod;
            }

            weaponBonusComputed = BAB + AbilityBonus + SizeMod;
            formula            += BAB.ToString() + " BAB +" + AbilityBonus.ToString() + " AbilityBonus +" + SizeMod.ToString() + " SizeMod";

            if (weapon.Broken)
            {
                weaponBonusComputed -= 2;
                formula             += " -2 Broken";
            }
            if (BiteAttack && weapon.name == "bite")
            {
                if (_monSBSearch.HasFeat("Multiattack"))
                {
                    weaponBonusComputed -= 2;
                    formula             += " -2 bite Multiattack ";
                }
                else
                {
                    weaponBonusComputed -= 5;
                    formula             += " -5 bite";
                }
            }

            if (weapon.name.ToLower() == "unarmed strike")
            {
                weaponBonusComputed += _monSBSearch.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.NaturalAttack,
                                                                                OnGoingStatBlockModifier.StatBlockModifierSubTypes.None, ref formula);
            }

            if ((weapon.WeaponSpecialAbilities.WeaponSpecialAbilitiesValue & WeaponSpecialAbilitiesEnum.Furious) == WeaponSpecialAbilitiesEnum.Furious)
            {
                weaponBonusComputed += 2;
                formula             += " +2 furious";
            }

            if (_monSBSearch.HasSQ("spirit (champion)"))
            {
                int mediumLevel = CharacterClasses.FindClassLevel("medium");
                int bonus       = 1;
                if (mediumLevel >= 4)
                {
                    bonus++;
                }
                if (mediumLevel >= 8)
                {
                    bonus++;
                }
                if (mediumLevel >= 12)
                {
                    bonus++;
                }
                if (mediumLevel >= 15)
                {
                    bonus++;
                }
                if (mediumLevel >= 19)
                {
                    bonus++;
                }

                weaponBonusComputed += bonus;
                formula             += " +" + bonus.ToString() + " spirit (champion)";
            }

            if (SizeDifference > 0)
            {
                //assume small CreatureTypeFoundation has small weapon
                if (!(MonSize == StatBlockInfo.SizeCategories.Small && WeaponSize == StatBlockInfo.SizeCategories.Medium))
                {
                    weaponBonusComputed -= SizeDifference * 2;
                    formula             += "-" + (SizeDifference * 2).ToString() + " weapon size difference";
                }
            }

            weaponBonusComputed += _weaponChecker.PoleArmTraingMods(weapon, _monSBSearch, CharacterClasses.FindClassLevel("fighter"), ref formula);

            string hold = null;

            if (weapon.NamedWeapon)
            {
                hold = weapon.BaseWeaponName.ToLower();
            }
            else
            {
                hold = weapon.search_name.ToLower();
            }


            if (hold.Contains("aldori"))
            {
                hold = hold.Replace("aldori", "Aldori");
            }

            if (hold == "flurry of blows")
            {
                hold = "unarmed strike"; //flurry of blows is a bunch of unarmed strikes
            }

            if (_monSBSearch.HasDefensiveAbility("weapon training"))
            {
                int fighterLevel = CharacterClasses.FindClassLevel("fighter");
                int harshMod     = 0;
                if (fighterLevel >= 5)
                {
                    harshMod++;
                }
                if (fighterLevel >= 9)
                {
                    harshMod++;
                }
                if (fighterLevel >= 13)
                {
                    harshMod++;
                }
                if (fighterLevel >= 17)
                {
                    harshMod++;
                }
                if (harshMod > 0)
                {
                    weaponBonusComputed += harshMod;
                    formula             += " +" + harshMod.ToString() + " weapon training";
                }
            }

            if (_monSBSearch.HasSQ("classic duelist") && (weapon.name.ToLower() == "rapier" || weapon.search_name.ToLower() == "short sword" || weapon.name.ToLower() == "cutlass"))
            {
                weaponBonusComputed++;
                formula += " +1 classic duelist";
            }

            string holdFocus = hold.Replace("scorpion", string.Empty).Trim();

            if (_monSBSearch.HasFeat("Weapon Focus (" + holdFocus + ")"))
            {
                weaponBonusComputed++;
                formula += " +1 Weapon Focus";
            }

            if (_monSBSearch.HasFeat("Greater Weapon Focus (" + holdFocus + ")"))
            {
                weaponBonusComputed++;
                formula += " +1 Greater Weapon Focus";
            }

            if (!BiteAttack)
            {
                if (TwoWeaponFighting && !_monSBSearch.HasSQ("multiweapon mastery"))
                {
                    if (_monSBSearch.HasFeat("Two-Weapon Fighting"))
                    {
                        if (LightWeapon)
                        {
                            weaponBonusComputed += -2;
                            formula             += " -2 Two-Weapon Fighting Feat-light";
                        }
                        else
                        {
                            weaponBonusComputed += -4;
                            formula             += " -4 Two-Weapon Fighting Feat-not light";
                        }
                    }
                    else
                    {
                        if (LightWeapon)
                        {
                            weaponBonusComputed += -4;
                            formula             += " -4 Two-Weapon Fighting-light";
                        }
                        else
                        {
                            weaponBonusComputed += -6;
                            formula             += " -6 Two-Weapon Fighting-not light";
                        }
                    }
                }
            }


            string hold2 = null;

            if (weapon.NamedWeapon)
            {
                hold2 = weapon.BaseWeaponName;
            }
            else
            {
                hold2 = weapon.search_name;
            }

            if (_monSBSearch.HasSpecialAttackGeneral("weapon training"))
            {
                weaponBonusComputed += _monSBSearch.GetWeaponsTrainingModifier(hold2, ref formula);
            }

            if (weapon.Masterwork && weapon.EnhancementBonus == 0)
            {
                weaponBonusComputed++;
                formula += " +1 masterwork";
            }

            if (_monSBSearch.HasFeat("Shield Master") && weapon.name.Contains("shield"))
            {
                formula             += " +" + weapon.EnhancementBonus.ToString() + " Shield Master";
                weaponBonusComputed += weapon.EnhancementBonus;
            }

            if (_monSBSearch.HasClassArchetype("weapon master"))
            {
                int level = CharacterClasses.FindClassLevel("Fighter");
                int count = 0;
                if (level >= 3)
                {
                    weaponBonusComputed++;
                    count++;
                }
                if (level >= 7)
                {
                    weaponBonusComputed++;
                    count++;
                }
                if (level >= 11)
                {
                    weaponBonusComputed++;
                    count++;
                }
                if (level >= 15)
                {
                    weaponBonusComputed++;
                    count++;
                }
                if (level >= 19)
                {
                    weaponBonusComputed++;
                    count++;
                }
                formula += " +" + count.ToString() + " weapon master";
            }

            if (_monSBSearch.HasTemplate("graveknight"))
            {
                weaponBonusComputed += 2;
                formula             += " +2 Sacrilegious Aura";
            }

            bool ignore = false;

            if (_indvSB != null)
            {
                WeaponCommon weaponCommon = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                weaponCommon.GetOnGoingAttackMods(ref weaponBonusComputed, ref formula, MagicWeapon, GreaterMagicWeapon, out ignore);
            }
            bool amuletOfMightFists = formula.Contains("Amulet of Mighty Fists");

            //shield bash get no Enchantment Bonus
            if (weapon.EnhancementBonus > 0 && _acDefendingMod == 0 && !weapon.name.Contains("shield") && !amuletOfMightFists && !ignore)
            {
                weaponBonusComputed += weapon.EnhancementBonus;
                formula             += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus";
            }
        }
Ejemplo n.º 10
0
        private void CheckOneMeleeWeaponFound(NaturalWeapon natural_weapon, Weapon weapon, bool TwoWeaponFighting, bool MultipleWepons,
                                              bool LightWeapon, bool BiteAttack, int Melee2Count, int weaponIndex, string MW, bool MagicWeapon,
                                              bool GreaterMagicWeapon, ref bool SimpleOne, string RaceWeapons, bool NaturalMultipleWepons)
        {
            List <string> Bonuses             = new List <string>();
            int           weaponBonusComputed = 0;
            int           weaponBonusSB       = 0;
            string        formula             = string.Empty;

            if (weapon != null)
            {
                CheckOneWeaponMeleeNonNatural(weapon, ref weaponBonusComputed, TwoWeaponFighting, LightWeapon, BiteAttack, ref Bonuses, MW, Melee2Count, weaponIndex, ref formula, MagicWeapon, GreaterMagicWeapon);
            }
            if (natural_weapon != null)
            {
                CheckOneWeaponMeleeNatural(natural_weapon, ref weaponBonusComputed, ref Bonuses, MW, NaturalMultipleWepons, ref formula, Melee2Count);
            }

            weaponBonusSB = Convert.ToInt32(Bonuses.First());

            if (Bonuses.Count > 1)
            {
                bool containsHaste = magicInEffect.Exists(y => y.Contains("Haste")) || magicInEffect.Exists(y => y.Contains("haste"));
                for (int w = 0; w < Bonuses.Count - 1; w++)
                {
                    if (Convert.ToInt32(Bonuses[w]) != Convert.ToInt32(Bonuses[w + 1]) + 5 && !weapon.name.Contains("flurry of blows") && !weapon.name.Contains("unarmed strike") && !containsHaste)
                    {
                        _messageXML.AddFail("Melee Multiple Attack Bonus-", "not 5 difference");
                        break;
                    }
                }
            }

            if (weapon != null)
            {
                WeaponCommon weaponCommon = new WeaponCommon(magicInEffect, Weapons, _indvSB, _messageXML, _monSBSearch, CharacterClasses, RaceName, DontUseRacialHD, RaceBaseType, HasRaceBase, RacialHDValue);
                weaponCommon.CheckWeaponProficiency(weapon, ref weaponBonusComputed, ref formula, ref SimpleOne, RaceWeapons);
            }


            if (weaponBonusComputed == weaponBonusSB)
            {
                if (weapon != null)
                {
                    _messageXML.AddPass("Melee Attack Bonus-" + weapon.Weapon_FullName(), formula);
                }
                else
                {
                    _messageXML.AddPass("Melee Attack Bonus-" + natural_weapon.name, formula);
                }
            }
            else
            {
                if (weapon != null)
                {
                    _messageXML.AddFail("Melee Attack Bonus-" + weapon.Weapon_FullName(), weaponBonusComputed.ToString(), weaponBonusSB.ToString(), formula);
                }
                else
                {
                    _messageXML.AddFail("Melee Attack Bonus-" + natural_weapon.name, weaponBonusComputed.ToString(), weaponBonusSB.ToString(), formula);
                }
            }
        }
Ejemplo n.º 11
0
        public void CheckMeleeWeaponDamage(Weapon weapon, string weaponsDamage, bool TwoWeaponFighting, bool BiteAttack, int weaponCount, int weaponIndex,
                                           string Size, AbilityScores.AbilityScores _abilityScores, MonSBSearch _monSBSearch, StatBlockMessageWrapper _messageXML, int FighterLevel, int ACDefendingMod, bool MagicWeapon, bool GreaterMagicWeapon, IndividualStatBlock_Combat _indvSB)
        {
            string formula           = string.Empty;
            bool   hasSizeDifference = false;


            StatBlockInfo.SizeCategories MonSize    = StatBlockInfo.GetSizeEnum(Size);
            StatBlockInfo.SizeCategories WeaponSize = weapon.WeaponSize;
            if (MonSize != WeaponSize)
            {
                hasSizeDifference = true;
            }

            if (_monSBSearch.HasSQ("undersized weapons"))
            {
                MonSize = StatBlockInfo.ReduceSize(MonSize);
            }

            StatBlockInfo.HDBlockInfo  damageComputed = new StatBlockInfo.HDBlockInfo();
            ShieldSpecialAbilitiesEnum shieldSA       = weapon.ShieldSpecialAbilities.ShieldSpecialAbilityValues;

            bool ShieldBashBoost = false;

            if ((shieldSA & ShieldSpecialAbilitiesEnum.Bashing) == ShieldSpecialAbilitiesEnum.Bashing)
            {
                ShieldBashBoost = true;
                MonSize         = StatBlockInfo.IncreaseSize(MonSize);
                MonSize         = StatBlockInfo.IncreaseSize(MonSize);
            }

            bool   HasNewWeaponDamge = false;
            Weapon weaponDamage      = null;

            if (weapon.search_name.ToLower() == "halfling sling staff")
            {
                weaponDamage      = _weaponBusiness.GetWeaponByName("club");
                HasNewWeaponDamge = true;
            }


            weaponsDamage = weaponsDamage.Replace(PathfinderConstants.PAREN_LEFT, string.Empty).Replace(PathfinderConstants.PAREN_RIGHT, string.Empty)
                            .Replace("nonlethal", string.Empty);
            int    Pos = weaponsDamage.IndexOf("/");
            string weaponCrit;

            if (Pos >= 0)
            {
                weaponCrit    = weaponsDamage.Substring(Pos + 1);
                weaponsDamage = weaponsDamage.Substring(0, Pos);
            }
            StatBlockInfo.HDBlockInfo damageSB = new StatBlockInfo.HDBlockInfo();
            if (weaponsDamage.Contains("|"))
            {
                Pos           = weaponsDamage.IndexOf("|");
                weaponsDamage = weaponsDamage.Substring(0, Pos);
            }
            damageSB.ParseHDBlock(weaponsDamage.Trim());

            if (weapon.@double)
            {
                //for double weapons assume the damage in the string is one of the ends
                if (weapon.damage_medium.Contains(damageSB.HDType.ToString()))
                {
                    weapon.damage_medium = damageSB.Multiplier.ToString() + damageSB.HDType.ToString();
                }

                if (weapon.damage_small.Contains(damageSB.HDType.ToString()))
                {
                    weapon.damage_small = damageSB.Multiplier.ToString() + damageSB.HDType.ToString();
                }
            }

            if (MonSize == StatBlockInfo.SizeCategories.Medium && !ShieldBashBoost && !hasSizeDifference)
            {
                if (HasNewWeaponDamge)
                {
                    damageComputed.ParseHDBlock(weapon.damage_medium);
                }
                else
                {
                    damageComputed.ParseHDBlock(weapon.damage_medium);
                }
            }
            else if (MonSize == StatBlockInfo.SizeCategories.Small && !ShieldBashBoost && !hasSizeDifference)
            {
                if (HasNewWeaponDamge)
                {
                    damageComputed.ParseHDBlock(weapon.damage_small);
                }
                else
                {
                    damageComputed.ParseHDBlock(weapon.damage_small);
                }
            }
            else if (!hasSizeDifference)
            {
                if (HasNewWeaponDamge)
                {
                    damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weaponDamage.damage_medium, MonSize));
                }
                else
                {
                    damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, MonSize));
                }
            }
            else
            {
                //hasSizeDifference = true
                if (MonSize == StatBlockInfo.SizeCategories.Small)
                {
                    damageComputed.ParseHDBlock(weapon.damage_small);
                }
                else
                {
                    StatBlockInfo.SizeCategories tempSize = StatBlockInfo.SizeCategories.Medium;
                    if (WeaponSize == tempSize)
                    {
                        tempSize = MonSize;
                    }
                    damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, tempSize));
                }
            }

            double StrBonus;
            bool   OneHandedAsTwo;
            string ModUsed = ComputeStrBonus(weapon, TwoWeaponFighting, BiteAttack, weaponCount, weaponIndex, _monSBSearch, _abilityScores, out StrBonus, out OneHandedAsTwo);

            formula += " +" + StrBonus.ToString() + PathfinderConstants.SPACE + ModUsed + " Bonus Used";
            damageComputed.Modifier += Convert.ToInt32(StrBonus);

            if (weapon.WeaponSpecialMaterial == WeaponSpecialMaterials.AlchemicalSilver && (weapon.slashing || weapon.piercing))
            {
                damageComputed.Modifier--;
                formula += " -1 Alchemical Silver";
            }

            if (_monSBSearch.HasSQ("hulking changeling"))
            {
                damageComputed.Modifier++;
                formula += " +1 hulking changeling";
            }

            string hold2 = weapon.NamedWeapon ?  weapon.BaseWeaponName :  weapon.search_name;

            if (_monSBSearch.HasSpecialAttackGeneral("weapon training"))
            {
                damageComputed.Modifier += _monSBSearch.GetWeaponsTrainingModifier(hold2, ref formula);
            }

            damageComputed.Modifier += PoleArmTraingMods(weapon, _monSBSearch, FighterLevel, ref formula);

            bool ignoreEnhancement = false;

            if (weapon.name.ToLower() == "unarmed strike")
            {
                damageComputed.Modifier += _monSBSearch.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.NaturalDamage,
                                                                                    OnGoingStatBlockModifier.StatBlockModifierSubTypes.None, ref formula);
            }
            else
            {
                WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
                weaponCommon.GetOnGoingDamageMods(MagicWeapon, GreaterMagicWeapon, _indvSB, ref formula, ref damageComputed, ref ignoreEnhancement);
            }

            if ((weapon.WeaponSpecialAbilities.WeaponSpecialAbilitiesValue & WeaponSpecialAbilitiesEnum.Furious) == WeaponSpecialAbilitiesEnum.Furious)
            {
                damageComputed.Modifier += 2;
                formula += " +1 furious";
            }

            string hold = weapon.NamedWeapon ?  weapon.BaseWeaponName.ToLower() :  weapon.search_name.ToLower();

            if (hold.Contains("aldori"))
            {
                hold = hold.Replace("aldori", "Aldori");
            }

            if (_sbCheckerBaseInput.CharacterClasses.HasClass("aldori swordlord"))
            {
                if (hold.Contains("dueling sword"))
                {
                    int tenpMod = _monSBSearch.GetAbilityMod(AbilityScores.AbilityScores.AbilityName.Dexterity);
                    formula += " +" + tenpMod.ToString() + " Deft Strike";
                    damageComputed.Modifier += tenpMod;
                }
            }

            if (_monSBSearch.HasFeat("Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                formula += " +2 Weapon Specialization";
                damageComputed.Modifier += 2;
            }

            if (_monSBSearch.HasFeat("Greater Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                formula += " +2 Greater Weapon Specialization";
                damageComputed.Modifier += 2;
            }

            if (_monSBSearch.HasTemplate("graveknight"))
            {
                damageComputed.Modifier += 2;
                formula += " +2 Sacrilegious Aura";
            }

            if (_monSBSearch.HasFeat("Shield Master") && weapon.name.Contains("shield"))
            {
                formula += " +" + weapon.EnhancementBonus + " Shield Master";
                damageComputed.Modifier += weapon.EnhancementBonus;
            }

            //no enchantment bonus for shield bash
            if (weapon.EnhancementBonus > 0 && ACDefendingMod == 0 && !weapon.name.Contains("shield") && !ignoreEnhancement)
            {
                formula += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus";
                damageComputed.Modifier += weapon.EnhancementBonus;
            }

            if (weapon.Broken)
            {
                formula += " -2 Broken";
                damageComputed.Modifier -= 2;
            }

            if (damageSB.Equals(damageComputed))
            {
                _messageXML.AddPass("Melee Attack Damage-" + weapon.Weapon_FullName(), formula);
            }
            else
            {
                int temp5 = damageComputed.Modifier - 1;

                if (OneHandedAsTwo && damageSB.Modifier == temp5 && !_monSBSearch.HasShield()) // not all SB use two handed weapons; not error, their choice
                {
                    _messageXML.AddInfo(weapon.Weapon_FullName() + " could be used two-handed for extra damage");
                    _messageXML.AddPass("Melee Attack Damage-" + weapon.Weapon_FullName());
                }
                else
                {
                    _messageXML.AddFail("Melee Attack Damage-" + weapon.Weapon_FullName(), damageComputed.ToString(), damageSB.ToString(), formula);
                    if (OneHandedAsTwo)
                    {
                        _messageXML.AddFail("Melee Attack Damage-", "Weapon could be used As Two-Handed?");
                    }
                }
            }
            string tempWeaponCrit = weapon.critical.Replace("/×2", string.Empty);

            tempWeaponCrit = tempWeaponCrit.Replace((char)(8211), char.Parse("-"));
            //if (tempWeaponCrit == weaponCrit)
            //{
            //    _messageXML.AddPass("Melee Attack Critical- " + weapon.Weapon_FullName());
            //}
            //else
            //{
            //    _messageXML.AddFail("Melee Attack Critical- " + weapon.Weapon_FullName(), weapon.critical, weaponCrit);

            //}
        }
Ejemplo n.º 12
0
        public void CheckRangedWeaponDamage(Weapon weapon, string weaponsDamage, string size, AbilityScores.AbilityScores _abilityScores,
                                            MonSBSearch _monSBSearch, StatBlockMessageWrapper _messageXML, bool MagicWeapon, bool GreaterMagicWeapon, IndividualStatBlock_Combat _indvSB)
        {
            string formula = string.Empty;

            StatBlockInfo.SizeCategories MonSize = StatBlockInfo.GetSizeEnum(size);

            if (_monSBSearch.HasSQ("undersized weapons"))
            {
                MonSize = StatBlockInfo.ReduceSize(MonSize);
            }

            StatBlockInfo.HDBlockInfo damageComputed = new StatBlockInfo.HDBlockInfo();
            if (weapon.name == "Sling" && _monSBSearch.HasGear("stones"))
            {
                damageComputed.ParseHDBlock(weapon.damage_small);
            }
            else if (MonSize == StatBlockInfo.SizeCategories.Medium)
            {
                damageComputed.ParseHDBlock(weapon.damage_medium);
            }
            else if (MonSize == StatBlockInfo.SizeCategories.Small)
            {
                damageComputed.ParseHDBlock(weapon.damage_small);
            }
            else
            {
                damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, MonSize));
            }

            if (!weaponsDamage.Contains("entangle"))
            {
                ComputeRangeMod(weapon, _abilityScores, _monSBSearch, _messageXML, ref formula, ref damageComputed);
            }

            if (_monSBSearch.HasSpecialAttackGeneral("weapon training"))
            {
                damageComputed.Modifier += _monSBSearch.GetWeaponsTrainingModifier(weapon.search_name, ref formula);
            }

            if (_monSBSearch.HasClassArchetype("crossbowman"))
            {
                int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter");
                if (fighterLevel >= 3)
                {
                    int dexBonus = _abilityScores.DexMod / 2;
                    if (dexBonus <= 0)
                    {
                        dexBonus = 1;
                    }
                    damageComputed.Modifier += dexBonus;
                    formula += " +" + dexBonus.ToString() + " crossbowman deadshot";
                }

                if (fighterLevel >= 5)
                {
                    int tempBonus = 1;
                    if (fighterLevel >= 9)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 13)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 17)
                    {
                        tempBonus++;
                    }
                    damageComputed.Modifier += tempBonus;
                    formula += " +" + tempBonus.ToString() + " crossbowman crossbow expert";
                }
            }

            if (_monSBSearch.HasClassArchetype("archer"))
            {
                int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter");

                if (fighterLevel >= 5)
                {
                    int tempBonus = 1;
                    if (fighterLevel >= 9)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 13)
                    {
                        tempBonus++;
                    }
                    if (fighterLevel >= 17)
                    {
                        tempBonus++;
                    }
                    damageComputed.Modifier += tempBonus;
                    formula += " +" + tempBonus.ToString() + " Expert Archer";
                }
            }

            string hold = weapon.NamedWeapon ? weapon.BaseWeaponName.ToLower() : weapon.search_name.ToLower();

            if (_monSBSearch.HasFeat("Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                formula += " +2 Weapon Specialization";
                damageComputed.Modifier += 2;
            }

            if (_monSBSearch.HasFeat("Greater Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT))
            {
                formula += " +2 Greater Weapon Specialization";
                damageComputed.Modifier += 2;
            }

            if (weapon.WeaponSpecialMaterial == WeaponSpecialMaterials.AlchemicalSilver && (weapon.slashing || weapon.piercing))
            {
                damageComputed.Modifier--;
                formula += " -1 Alchemical Silver";
            }

            if (weapon.EnhancementBonus > 0)
            {
                damageComputed.Modifier += weapon.EnhancementBonus;
                formula += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus";
            }

            if (_abilityScores.StrMod != 0 && Utility.IsThrownWeapon(weapon.search_name.ToLower()))
            {
                int MeleeModUsed = _abilityScores.StrMod;

                if (_monSBSearch.HasDefensiveAbility("incorporeal"))
                {
                    MeleeModUsed = _abilityScores.DexMod;
                }
                formula += " +" + MeleeModUsed.ToString() + " Str Bonus Used- Thrown";
                damageComputed.Modifier += Convert.ToInt32(MeleeModUsed);
            }

            if (weapon.name.Contains("bow") && !weapon.name.ToLower().Contains("composite") && !weapon.name.ToLower().Contains("cross") && _abilityScores.StrMod < 0)
            {
                damageComputed.Modifier += _abilityScores.StrMod;
            }

            bool         ignoreEnhancement = false;
            WeaponCommon weaponCommon      = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);

            weaponCommon.GetOnGoingDamageMods(MagicWeapon, GreaterMagicWeapon, _indvSB, ref formula, ref damageComputed, ref ignoreEnhancement);

            weaponsDamage = weaponsDamage.Replace(PathfinderConstants.PAREN_LEFT, string.Empty).Replace(PathfinderConstants.PAREN_RIGHT, string.Empty)
                            .Replace("nonlethal", string.Empty);
            int    Pos = weaponsDamage.IndexOf("/");
            string weaponCrit;

            if (Pos >= 0)
            {
                weaponCrit    = weaponsDamage.Substring(Pos + 1);
                weaponsDamage = weaponsDamage.Substring(0, Pos);
            }
            StatBlockInfo.HDBlockInfo damageSB = new StatBlockInfo.HDBlockInfo();
            damageSB.ParseHDBlock(weaponsDamage.Trim());

            if (weapon.name == "rock" && _monSBSearch.HasSpecialAttackGeneral("rock throwing"))
            {
                if (damageComputed.Modifier != (_abilityScores.StrMod * 1.5))
                {
                    _messageXML.AddFail("Ranged Attack Damage- Rock ", (_abilityScores.StrMod * 1.5).ToString(), damageComputed.Modifier.ToString());
                }
            }


            if (weapon.name == "bomb" && _sbCheckerBaseInput.CharacterClasses.HasClass("alchemist"))
            {
                damageComputed        = new StatBlockInfo.HDBlockInfo();
                damageComputed.HDType = StatBlockInfo.HitDiceCategories.d6;
                int alchemistLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("alchemist");
                damageComputed.Multiplier = ((alchemistLevel - 1) / 2) + 1;
                damageComputed.Modifier   = _abilityScores.IntMod;

                formula = "+" + _abilityScores.IntMod.ToString() + " Int mod";
            }

            if (damageSB.Equals(damageComputed))
            {
                _messageXML.AddPass("Ranged Attack Damage " + weapon.Weapon_FullName(), formula);
            }
            else
            {
                _messageXML.AddFail("Ranged Attack Damage " + weapon.Weapon_FullName(), damageComputed.ToString(), damageSB.ToString(), formula);
            }

            //string tempWeaponCrit = weapon.critical.Replace("/×2", string.Empty);
            //tempWeaponCrit = tempWeaponCrit.Replace((char)(8211), Char.Parse("-"));
            //if (tempWeaponCrit == weaponCrit)
            //{
            //    _messageXML.AddPass("Ranged Attack Critical- " + weapon.Weapon_FullName());
            //}
            //else
            //{
            //    _messageXML.AddFail("Ranged Attack Critical- " + weapon.Weapon_FullName(), weapon.critical, weaponCrit);

            //}
        }
        private void CheckOneMeleeOrBlock(List <string> foundWeapons, string meleeWeapon)
        {
            NaturalWeapon natural_weapon        = null;
            Weapon        weapon                = null;
            bool          twoWeaponFighting     = false;
            bool          multipleWepons        = false;
            bool          naturalMultipleWepons = false;
            bool          lightWeapon;
            bool          biteAttack;
            List <string> meleeList = new List <string>();

            string[] splitFind = new string[] { " and" };
            meleeWeapon = meleeWeapon.Replace('\n', ' ');

            //find "and"s in parenths
            int posAnd = meleeWeapon.IndexOf("and");

            if (posAnd > 0)
            {
                int startPos = 0;;
                while (posAnd <= meleeWeapon.Length || posAnd == -1)
                {
                    int openparen = meleeWeapon.IndexOf(PathfinderConstants.PAREN_LEFT, startPos);
                    if (openparen < 0)
                    {
                        break;
                    }

                    int closeparen = meleeWeapon.IndexOf(PathfinderConstants.PAREN_RIGHT, openparen);
                    if (posAnd > openparen && openparen < closeparen)
                    {
                        meleeWeapon = meleeWeapon.Insert(posAnd, "|");
                    }
                    posAnd   = meleeWeapon.IndexOf("and", closeparen);
                    startPos = closeparen;
                }
            }

            Utility.ParenCommaFix(ref meleeWeapon);

            if (FindNonParenAnd(meleeWeapon))
            {
                meleeList = meleeWeapon.Split(splitFind, StringSplitOptions.RemoveEmptyEntries).ToList();
                for (int a = 0; a <= meleeList.Count - 1; a++)
                {
                    meleeList[a] = meleeList[a].Replace("|", string.Empty);
                }
            }
            else if (meleeWeapon.Contains(", "))
            {
                splitFind = new string[] { ", " };
                meleeList = meleeWeapon.Split(splitFind, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            else
            {
                meleeList.Add(meleeWeapon);
            }

            lightWeapon = false;
            biteAttack  = false;
            if (meleeList.Any())
            {
                multipleWepons = true;
                foreach (string weap in meleeList)
                {
                    if (weap.Contains("bite"))
                    {
                        biteAttack = true;
                    }
                    if (FindLightWeapon(weap))
                    {
                        lightWeapon = true;
                    }
                }
                if (NonNaturalWeaponCount(meleeList) != 1)
                {
                    twoWeaponFighting = true;
                }
            }

            foundWeapons.Add(meleeWeapon);
            if (HasNonNaturalWeapon(meleeList))
            {
                naturalMultipleWepons = true;
            }
            int  weaponIndex = 0;
            bool SimpleOne   = false;

            foreach (string MW in meleeList) // loop on "and" blocks
            {
                weapon         = null;
                natural_weapon = null;
                weaponIndex++;
                bool MagicWeapon;
                bool GreaterMagicWeapon;

                WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness);
                if (weaponCommon.FindWeapon(ref weapon, ref natural_weapon, MW.Trim(), out MagicWeapon, out GreaterMagicWeapon))
                {
                    foundWeapons.Add(MW);
                    CheckOneMeleeWeaponFound(natural_weapon, weapon, twoWeaponFighting, multipleWepons, lightWeapon,
                                             biteAttack, meleeList.Count, weaponIndex, MW, MagicWeapon, GreaterMagicWeapon, ref SimpleOne, _raceWeapons, naturalMultipleWepons);
                }
                else
                {
                    _sbCheckerBaseInput.MessageXML.AddFail("Melee Attack", "Missing Weapon-" + MW.Trim());
                }
            }
        }