Exemplo n.º 1
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 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);
        }
        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());
                }
            }
        }
Exemplo 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);
        }
Exemplo n.º 7
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());
                }
            }
        }
        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());
                }
            }
        }