コード例 #1
0
        public void CheckFeatCount(string Feats)
        {
            string CheckName = "Feat Count";

            string hold = Feats;

            Utility.ParenCommaFix(ref hold);
            List <string> MythicFeats = new List <string>();
            List <string> featList    = hold.Replace("*", string.Empty).Split(',').ToList();

            featList.RemoveAll(p => p == string.Empty);
            List <string> NewFeats = new List <string>();

            featList = RemoveSuperScripts(featList); //not mythic M
            featList.RemoveAll(p => p == PathfinderConstants.SPACE);

            int Count = featList.Count - 1;

            for (int a = Count; a >= 0; a--)
            {
                string feat = featList[a];
                if (feat.Contains("- "))
                {
                    _sbCheckerBaseInput.MessageXML.AddFail("Feat Spelling", "hyphen space in feat name");
                }
                if (feat.Contains(PathfinderConstants.PAREN_LEFT))
                {
                    int    Pos   = feat.IndexOf(PathfinderConstants.PAREN_LEFT);
                    string temp3 = feat.Substring(Pos);
                    temp3 = temp3.Replace(PathfinderConstants.PAREN_LEFT, string.Empty);
                    temp3 = temp3.Replace(PathfinderConstants.PAREN_RIGHT, string.Empty);
                    int count;
                    int.TryParse(temp3, out count);
                    if (count > 0)
                    {
                        NewFeats.Add(feat);
                    }
                    else
                    {
                        if (temp3.Contains("|"))
                        {
                            List <string> MultipleFeats = temp3.Split('|').ToList();

                            Pos = feat.IndexOf(PathfinderConstants.PAREN_LEFT);
                            string baseFeat = feat.Substring(0, Pos).Trim();
                            featList[a] = baseFeat + " (" + MultipleFeats[0].Trim() + PathfinderConstants.PAREN_RIGHT;

                            for (int b = 1; b <= MultipleFeats.Count - 1; b++)
                            {
                                NewFeats.Add(baseFeat + " (" + MultipleFeats[b].Trim() + PathfinderConstants.PAREN_RIGHT);
                            }
                        }
                    }
                }
                //if (feat.EndsWith("M") || feat.Contains("M "))
                if (feat.Contains("[M]"))
                {
                    string temp2 = feat.Replace("[M]", string.Empty);
                    if (temp2.EndsWith("M"))
                    {
                        temp2 = temp2.Substring(0, temp2.Length - 1);
                    }
                    string tempOld = temp2;
                    if (temp2.Contains(PathfinderConstants.PAREN_LEFT))
                    {
                        int Pos = temp2.IndexOf(PathfinderConstants.PAREN_LEFT);
                        temp2 = temp2.Substring(0, Pos).Trim();
                    }
                    temp2 = temp2.Trim();
                    MythicFeats.Add(temp2.Trim());
                    IFeatStatBlock tempFeat = _featStatBlockBusiness.GetMythicFeatByName(temp2);
                    if (tempFeat != null && tempFeat.prerequisite_feats == temp2)
                    {
                        featList[a] = tempOld;
                    }
                    else
                    {
                        featList[a] = string.Empty;
                    }
                }
            }
            featList.RemoveAll(x => x == string.Empty);
            featList.AddRange(NewFeats);
            if (_sbCheckerBaseInput.MonsterSBSearch.IsMythic)
            {
                int value           = _sbCheckerBaseInput.MonsterSBSearch.MythicValue;
                int MythicFeatCount = StatBlockInfo.GetMythicFeats(value);

                if (MythicFeatCount == MythicFeats.Count)
                {
                    _sbCheckerBaseInput.MessageXML.AddPass("Mythic Feat Count");
                }
                else
                {
                    _sbCheckerBaseInput.MessageXML.AddFail("Mythic Feat Count", MythicFeatCount.ToString(), MythicFeats.Count.ToString(), "");
                }
            }

            int    FeatCount = _sbCheckerBaseInput.CharacterClasses.FindClassFeatCount();
            string formula   = FeatCount.ToString() + " classes";

            if ((featList.Contains("AlertnessB") || featList.Contains("Alertness")) && _sbCheckerBaseInput.MonsterSBSearch.HasFamiliar())
            {
                FeatCount++;
                formula += " +1 Familiar bonus";
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasHex("cauldron"))
            {
                FeatCount++;
                formula += " +1 cauldron hex";
            }

            //if (_sbCheckerBaseInput.Race_Base.RaceBaseType != RaceBase.RaceType.Race)
            //{
            int count2 = featList.Count;

            for (int a = count2 - 1; a >= 0; a--)
            {
                if (featList[a].LastIndexOf("B") == featList[a].Length - 1)
                {
                    featList.Remove(featList[a]);
                }
                else if (featList[a].Contains(PathfinderConstants.PAREN_LEFT))
                {
                    string tempFeat = featList[a].Substring(0, featList[a].IndexOf(PathfinderConstants.PAREN_LEFT)).Trim();
                    if (tempFeat.LastIndexOf("B") == tempFeat.Length - 1)
                    {
                        featList.Remove(featList[a]);
                    }
                }
                else if (featList[a].Contains("B "))
                {
                    featList.Remove(featList[a]);
                }
            }
            //}

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("secrets")) //loremaster
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("secret health"))
                {
                    FeatCount++;
                    formula += " +1 secret health";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("applicable knowledge"))
                {
                    FeatCount++;
                    formula += " +1 applicable knowledge";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("slayer talents"))
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("combat trick"))
                {
                    FeatCount++;
                    formula += " +1 combat trick";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("rogue talent") || _sbCheckerBaseInput.MonsterSBSearch.HasSQ("ninja tricks"))
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("combat trick"))
                {
                    FeatCount++;
                    formula += " +1 combat trick";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("finesse rogue"))
                {
                    FeatCount++; //weapon finesse
                    formula += " +1 finesse rogue";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("weapon training"))
                {
                    FeatCount++;
                    formula += " +1 weapon training";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("feat"))
                {
                    FeatCount++;
                    formula += " +1 rogue talent feat";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("card sharp"))
                {
                    FeatCount++;
                    formula += " +1 card sharp";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("grit"))
                {
                    FeatCount += 2;
                    formula   += " +2 grit";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasCavalierOrder("order of the cockatrice"))
            {
                int cavalierLevels = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("cavalier");
                if (cavalierLevels >= 2)
                {
                    FeatCount++;
                    formula += " +1 order of the cockatrice";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasCavalierOrder("order of the whip"))
            {
                int cavalierLevels = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("cavalier");
                if (cavalierLevels >= 2)
                {
                    FeatCount++;
                    formula += " +1 order of the whip";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("revelations") && _sbCheckerBaseInput.MonsterSBSearch.HasSQ("weapon mastery")) // oracle battle mystery
            {
                int OracleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("oracle");
                FeatCount++;
                formula += " +1 weapon focus";
                if (OracleLevel >= 8)
                {
                    FeatCount++;
                    formula += " +1 Improved Critical";
                }
                if (OracleLevel >= 12)
                {
                    FeatCount++;
                    formula += " +1 Greater Weapon Focus";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("revelations") && _sbCheckerBaseInput.MonsterSBSearch.HasSQ("stone stability")) // oracle stone mystery
            {
                int OracleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("oracle");
                if (OracleLevel >= 5)
                {
                    FeatCount++;
                    formula += " +1  Improved Trip";
                }
                if (OracleLevel >= 10)
                {
                    FeatCount++;
                    formula += " +1 Greater Trip";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("revelations") && _sbCheckerBaseInput.MonsterSBSearch.HasSQ("cinder dance")) // oracle flame mystery
            {
                int OracleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("oracle");
                if (OracleLevel >= 5)
                {
                    FeatCount++;
                    formula += " +1  Nimble Moves";
                }
                if (OracleLevel >= 10)
                {
                    FeatCount++;
                    formula += " +1 Acrobatic Steps";
                }
            }

            #region ClassArchetypes
            if (_sbCheckerBaseInput.MonsterSBSearch.HasAnyClassArchetypes())
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("unarmed fighter"))
                {
                    FeatCount++;
                    formula += " +1 Unarmed Style";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("pirate"))
                {
                    FeatCount++;
                    formula += " +1 Sea Legs";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("musketeer"))
                {
                    FeatCount += 2;
                    formula   += " +2 Musketeer Instruction";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("cad"))
                {
                    int CadLevels = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter");
                    if (CadLevels >= 3)
                    {
                        FeatCount++;                 // Catch Off Guard
                    }
                    formula += " +1 Catch Off Guard";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("steel hound"))
                {
                    int investigatorLevels = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("investigator");
                    if (investigatorLevels >= 2)
                    {
                        FeatCount += 2;                          // Amateur Gunslinger and Gunsmithing
                    }
                    formula += " +2 Packing Heat";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("constable"))
                {
                    FeatCount++; // Apprehend (Ex)
                    formula += " +1 Apprehend";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("staff magus"))
                {
                    FeatCount++; // Quarterstaff Master (Ex)
                    formula += " +1 Quarterstaff Master";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("musket master"))
                {
                    FeatCount++; // Rapid Reloader
                    formula += " +1 Rapid Reloader";
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("weapon adept"))
                {
                    int monkLevels = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("monk");
                    if (monkLevels >= 1)
                    {
                        FeatCount++;
                    }
                    formula += " +1 Perfect Strike";
                    if (monkLevels >= 2)
                    {
                        FeatCount++;
                        formula += " +1 Weapon Focus";
                    }
                }
            }
            #endregion ClassArchetypes

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomians())
            {
                int clericLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("cleric");
                if (clericLevel == 0)
                {
                    clericLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("druid");
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomain("Nobility") && clericLevel >= 8)
                {
                    FeatCount++;
                    formula += " +1 Nobility";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomain("Rune"))
                {
                    FeatCount++;
                    formula += " +1 Rune";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomain("Darkness"))
                {
                    FeatCount++;
                    formula += " +1 Darkness";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomain("Persistence"))
                {
                    FeatCount++;  //step up
                    formula += " +1 Persistence";
                }
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpellDomain("Black Powder"))
                {
                    FeatCount++;  //Gunsmithing  inquisition
                    formula += " +1 Black Powder";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasTemplate("worm that walks"))
            {
                FeatCount++;  //diehard
                formula += " +1 worm that walks";
            }

            if (_sbCheckerBaseInput.CharacterClasses.HasClass("arcanist"))
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSpecialAttack("metamagic knowledge"))
                {
                    FeatCount++;  //Metamagic Knowledge
                    formula += " +1 metamagic knowledge";
                }
            }

            if (_sbCheckerBaseInput.CharacterClasses.HasClass("slayer"))
            {
                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("ranger combat style"))
                {
                    int slayerLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("slayer");
                    int tempMod     = 0;

                    if (slayerLevel >= 2)
                    {
                        tempMod++;
                    }
                    if (slayerLevel >= 6)
                    {
                        tempMod++;
                    }
                    if (slayerLevel >= 10)
                    {
                        tempMod++;
                    }
                    if (slayerLevel >= 14)
                    {
                        tempMod++;
                    }
                    if (slayerLevel >= 18)
                    {
                        tempMod++;
                    }

                    if (tempMod > 0)
                    {
                        FeatCount += tempMod;
                        formula   += " +" + tempMod.ToString() + " ranger combat style";
                    }
                }

                if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("weapon training"))
                {
                    FeatCount += 1;
                    formula   += " +1 weapon training";
                }
            }

            if (_sbCheckerBaseInput.CharacterClasses.HasClass("hellknight signifer"))
            {
                int hellknightSigniferLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("hellknight signifer");
                if (hellknightSigniferLevel >= 2 && _sbCheckerBaseInput.MonsterSBSearch.HasFeat("Arcane Armor Training"))
                {
                    FeatCount++;  //Arcane Armor Mastery
                    formula += " +1 Arcane Armor Expertise";
                }
            }

            if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("investigator talent") && _sbCheckerBaseInput.MonsterSBSearch.HasSQ("bonus feat")) // oracle battle mystery
            {
                FeatCount++;                                                                                                                 //Investigator Talents
                formula += " +1 Investigator Talent";
            }


            int temp = 0;
            if (_sbCheckerBaseInput.Race_Base != null)
            {
                if (_sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.StatBlock && _sbCheckerBaseInput.Race_Base.UseRacialHD)
                {
                    if (!HasEnvirmonment)
                    {
                        temp       = _sbCheckerBaseInput.Race_Base.BonusFeatCount();
                        formula   += " +" + temp.ToString() + " Race";
                        FeatCount += temp;
                    }
                }

                //FeatCount += StatBlockInfo.GetHDFeats(_sbCheckerBaseInput.CharacterClasses.FindTotalClassLevels());
                temp       = StatBlockInfo.GetHDFeats(HDValue);
                formula   += " +" + temp.ToString() + " Hit Dice";
                FeatCount += temp;
                if (_sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.Race)
                {
                    temp       = _sbCheckerBaseInput.Race_Base.BonusFeatCount();
                    formula   += " +" + temp.ToString() + " Race";
                    FeatCount += temp;
                }
            }

            int SB_count = featList.Count();

            if (IntAbilityScoreValue == 0)
            {
                FeatCount = 0;
                formula   = " Int=0";
            }

            if (SB_count == FeatCount)
            {
                _sbCheckerBaseInput.MessageXML.AddPass(CheckName, formula);
            }
            else
            {
                _sbCheckerBaseInput.MessageXML.AddFail(CheckName, FeatCount.ToString(), SB_count.ToString(), formula);
            }
        }
コード例 #2
0
        private void ParseFeats(string feats)
        {
            MythicFeats = new List <string>();
            Feats       = feats.Replace("*", string.Empty).Split(',').ToList();
            Feats.RemoveAll(x => x == string.Empty);
            Feats.Remove(PathfinderConstants.SPACE);

            FeatCount = new Dictionary <string, int>();

            int Count = Feats.Count - 1;

            for (int a = Count; a >= 0; a--)
            {
                if (Feats[a].EndsWith("B"))
                {
                    Feats[a] = Feats[a].Substring(0, Feats[a].Length - 1);
                }

                if (Feats[a].Contains(PathfinderConstants.PAREN_LEFT))
                {
                    _featsHaveParens = true;
                    int    Pos  = Feats[a].IndexOf(PathfinderConstants.PAREN_LEFT);
                    string temp = Feats[a].Substring(Pos);
                    temp = Utility.RemoveParentheses(temp);
                    int value;
                    int.TryParse(temp, out value);
                    if (value > 0)
                    {
                        Feats[a] = Feats[a].Replace(temp, string.Empty);
                        temp     = Utility.RemoveParentheses(temp);
                        Feats[a] = Utility.RemoveParentheses(Feats[a]);
                        Feats[a] = Utility.RemoveSuperScripts(Feats[a]);
                        FeatCount.Add(Feats[a].Trim(), value);
                    }
                    else if (temp.Contains("see "))
                    {
                        Feats[a] = Feats[a].Replace(temp, string.Empty);
                    }
                }

                Feats[a] = Utility.RemoveSuperScripts(Feats[a]);
                if (Feats[a].EndsWith("[M]") || Feats[a].Contains("[M] "))
                {
                    string temp = Feats[a].Replace("[M] ", PathfinderConstants.SPACE);
                    if (temp.EndsWith("[M]"))
                    {
                        temp = temp.Substring(0, temp.Length - 3);
                    }
                    temp = temp.Trim();
                    string tempOld = temp;
                    MythicFeats.Add(temp);
                    if (temp.Contains(PathfinderConstants.PAREN_LEFT))
                    {
                        _featsHaveParens = true;
                        int Pos = temp.IndexOf(PathfinderConstants.PAREN_LEFT);
                        temp = temp.Substring(0, Pos).Trim();
                    }
                    IFeatStatBlock tempFeat = _featStatBlockBusiness.GetMythicFeatByName(temp);
                    if (tempFeat != null && tempFeat.prerequisite_feats == temp)
                    {
                        Feats[a] = tempOld;
                    }
                    else
                    {
                        Feats[a] = string.Empty;
                    }

                    Feats.RemoveAll(x => x == string.Empty);
                }
                else
                {
                    Feats[a] = Feats[a].Trim();
                }
            }
        }