Ejemplo n.º 1
0
        private string ParseTemplatesApplied_SkeletalChampion(string raceLine)
        {
            raceLine = ParseTemplatesApplied_SkeletonBase(raceLine.ToLower());

            if (_sbcommonBaseInput.IndvidSB.TemplatesApplied.Length > 0)
            {
                _sbcommonBaseInput.IndvidSB.TemplatesApplied  = _sbcommonBaseInput.IndvidSB.TemplatesApplied.Substring(0, _sbcommonBaseInput.IndvidSB.TemplatesApplied.Length - 1);
                _sbcommonBaseInput.IndvidSB.TemplatesApplied += "@skeletal champion|";
            }
            else
            {
                _sbcommonBaseInput.IndvidSB.TemplatesApplied += "skeletal champion|";
            }
            raceLine = raceLine.Replace("skeletal champion", string.Empty);

            //check for other non-skeletal champion templates
            MonsterStatBlock tempSB = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(raceLine);

            if (tempSB == null)
            {
                raceLine = ParseTemplatesApplied_Normal(raceLine);
            }
            return(raceLine);
        }
        public RaceBase(object RaceValue, CreatureTypeFoundation creatureType, bool isBestiaryStatBlock,
                        IndividualStatBlock_Combat IndivSB, string searchName, IMonsterStatBlockBusiness monsterStatBlockBusiness)
        {
            BaseRaceType = RaceType.None;
            if (RaceValue == null)
            {
                return;
            }
            _indvSB = IndivSB;

            CreatureTypeMaster = new CreatureTypeMaster();
            CreatureTypeMaster.CreatureTypeInstance = creatureType;
            try
            {
                RaceFoundationType = (RaceFoundation)RaceValue;
                BaseRaceType       = RaceType.Race;
                Race_SB            = monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(RaceFoundationType.Name);
                if (Race_SB == null)
                {
                    if (!string.IsNullOrEmpty(searchName) && searchName != RaceFoundationType.Name)
                    {
                        Race_SB = monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(searchName);
                        if (Race_SB == null)
                        {
                            throw new Exception(RaceFoundationType.Name + " has no Core Race entry");
                        }
                    }
                    else
                    {
                        throw new Exception(RaceFoundationType.Name + " has no Core Race entry");
                    }
                }
                //  IsHumanoid = true;
            }
            catch
            {
                try
                {
                    Race_SB = (MonsterStatBlock)RaceValue;
                    if (Race_SB.Environment.Length > 0 && isBestiaryStatBlock)
                    {
                        BaseRaceType = RaceType.BestiaryStatBlock;
                    }
                    else
                    {
                        BaseRaceType = RaceType.StatBlock;
                    }
                    if (Race_SB.Race.Contains("humanoid") || Race_SB.Type.Contains("humanoid"))
                    {
                        //   IsHumanoid = true;
                    }
                    UseRacialHD = Race_SB.DontUseRacialHD ? false : true;

                    int HD = RacialHDValue();
                    if (CreatureTypeMaster.GetSaveType("will") == StatBlockInfo.SaveBonusType.Varies)
                    {
                        int Will = Convert.ToInt32(Race_SB.Will);
                        if (HasFeat("Iron Will"))
                        {
                            Will -= 2;
                        }
                        WillOverride = StatBlockInfo.ComputeSaveBonusType(HD, Race_SB.GetAbilityScoreValue(StatBlockInfo.WIS), Will);
                    }
                    if (CreatureTypeMaster.GetSaveType("ref") == StatBlockInfo.SaveBonusType.Varies)
                    {
                        int Ref = Convert.ToInt32(Race_SB.Ref);
                        if (HasFeat("Lightning Reflexes"))
                        {
                            Ref -= 2;
                        }
                        Ref        -= GetRefOnGoingMods();
                        RefOverride = StatBlockInfo.ComputeSaveBonusType(HD, Race_SB.GetAbilityScoreValue(StatBlockInfo.DEX), Ref);
                    }
                    if (CreatureTypeMaster.GetSaveType("fort") == StatBlockInfo.SaveBonusType.Varies)
                    {
                        int Fort = Convert.ToInt32(Race_SB.Fort);
                        if (HasFeat("Great Fortitude"))
                        {
                            Fort -= 2;
                        }

                        FortOverride = StatBlockInfo.ComputeSaveBonusType(HD, Race_SB.GetAbilityScoreValue(StatBlockInfo.CON), Fort);
                    }
                    BaseBABType = StatBlockInfo.ComputeBABType(RacialHDValue(), Convert.ToInt32(Race_SB.BaseAtk));
                    ParseSkills();
                }
                catch
                {
                }
            }
        }
Ejemplo n.º 3
0
        public void ParseRace()
        {
            _sbCheckerBaseInput.Race_Base = null;
            string tempRace = _sbCheckerBaseInput.MonsterSB.Race;

            if (tempRace.Length == 0)
            {
                tempRace = _sbCheckerBaseInput.MonsterSB.name;
            }
            if (tempRace.Contains(PathfinderConstants.PAREN_LEFT))
            {
                int Pos = tempRace.IndexOf(PathfinderConstants.PAREN_LEFT);
                tempRace = tempRace.Substring(0, Pos).Trim();
            }

            if (tempRace.Length > 0)
            {
                if (tempRace.Contains(" tiefling"))
                {
                    int    Pos  = tempRace.IndexOf(" tiefling");
                    string temp = tempRace.Substring(0, Pos);
                    tempRace = tempRace.Replace(temp, string.Empty).Trim();
                }
                if (tempRace.Contains("Weakened"))
                {
                    tempRace = tempRace.Replace("Weakened", string.Empty).Trim();
                }

                List <string> baseRaceNames = CommonMethods.GetBaseRaceNames();
                foreach (string brn in baseRaceNames)
                {
                    if (tempRace.EndsWith(brn))
                    {
                        tempRace = tempRace.Replace(brn, string.Empty).Trim();
                    }
                }

                RaceManager.RaceMaster RM = new RaceMaster();
                _sbCheckerBaseInput.Race_Base = new RaceBase(RM.ParceRace(tempRace), _creatureType, tempRace, _monsterStatBlockBusiness);
                if (_sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.None)
                {
                    if (_sbCheckerBaseInput.MonsterSB.Environment.Length == 0)
                    {
                        MonsterStatBlock Mon_SB = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(tempRace);

                        _sbCheckerBaseInput.Race_Base = new RaceBase(Mon_SB, _creatureType, false, _sbCheckerBaseInput.IndvSB, string.Empty, _monsterStatBlockBusiness);
                        if (Mon_SB == null)
                        {
                            if (tempRace.Contains("Animal Companion") || tempRace.Contains("animal companion") ||
                                tempRace.Contains(" Tier") || tempRace.Contains(" familiar"))
                            {
                                tempRace = tempRace.Replace("Animal Companion", string.Empty);
                                tempRace = tempRace.Replace("animal companion", string.Empty);
                                int Pos = tempRace.IndexOf("Tier");
                                if (Pos > 0)
                                {
                                    tempRace = tempRace.Substring(0, Pos).Trim();
                                }
                                tempRace = tempRace.Replace("familiar", string.Empty);
                                Mon_SB   = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(tempRace);
                                _sbCheckerBaseInput.Race_Base = new RaceBase(Mon_SB, _creatureType, false, _sbCheckerBaseInput.IndvSB, string.Empty, _monsterStatBlockBusiness);
                                if (Mon_SB == null)
                                {
                                    _sbCheckerBaseInput.MessageXML.AddFail("Missing Familiar/Companion Race", tempRace);
                                }
                            }
                            else if (tempRace.Contains("elemental"))
                            {
                                if (!tempRace.Contains(_sbCheckerBaseInput.MonsterSB.Size))
                                {
                                    tempRace = _sbCheckerBaseInput.MonsterSB.Size + PathfinderConstants.SPACE + tempRace;
                                }
                                Mon_SB = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(tempRace);
                                _sbCheckerBaseInput.Race_Base = new RaceBase(Mon_SB, _creatureType, false, _sbCheckerBaseInput.IndvSB, string.Empty, _monsterStatBlockBusiness);
                                if (Mon_SB == null)
                                {
                                    _sbCheckerBaseInput.MessageXML.AddFail("Missing Race", tempRace);
                                }
                            }
                            else if (tempRace.ToLower().Contains("graven guardian"))
                            {
                                tempRace = tempRace.Substring(0, "graven guardian".Length);
                                Mon_SB   = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(tempRace);
                                _sbCheckerBaseInput.Race_Base = new RaceBase(Mon_SB, _creatureType, false, _sbCheckerBaseInput.IndvSB, string.Empty, _monsterStatBlockBusiness);
                                if (Mon_SB == null)
                                {
                                    _sbCheckerBaseInput.MessageXML.AddFail("Missing Race", tempRace);
                                }
                            }
                            else
                            {
                                List <string> tempCommonTempaltes = CommonMethods.GetCommonTemplates();
                                string        hold  = string.Empty;
                                bool          Found = false;
                                foreach (string common in tempCommonTempaltes)
                                {
                                    if (tempRace.ToLower().Contains(common.ToLower()))
                                    {
                                        hold   = tempRace.ToLower().Replace(common.ToLower(), string.Empty).Trim();
                                        Mon_SB = _monsterStatBlockBusiness.GetBestiaryMonsterByNamePathfinderDefault(hold);
                                        if (Mon_SB != null)
                                        {
                                            Found = true;
                                            _sbCheckerBaseInput.MonsterSB.Race              = _sbCheckerBaseInput.MonsterSB.Race.Replace(common.ToLower(), string.Empty).Trim();
                                            _sbCheckerBaseInput.MonsterSB.TemplatesApplied += common.ToLower() + "|";
                                            break;
                                        }
                                    }
                                }
                                //if (!Found && CharacterClasses.HasClass("eidolon"))
                                //{
                                //    //find eidolon base
                                //}
                                //else
                                if (!Found)
                                {
                                    _sbCheckerBaseInput.MessageXML.AddFail("Missing Race", tempRace);
                                }
                            }
                        }
                        else
                        {
                            if (Mon_SB.DontUseRacialHD)
                            {
                                _sbCheckerBaseInput.MessageXML.AddFail("Missing Race, no race data", tempRace);
                            }
                        }
                    }

                    if (_sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.None) //Bestiary SB
                    {
                        _sbCheckerBaseInput.Race_Base = new RaceBase(_sbCheckerBaseInput.MonsterSB, _creatureType, true, _sbCheckerBaseInput.IndvSB, string.Empty, _monsterStatBlockBusiness);
                    }
                }
            }
            else
            {
                throw new Exception("ParceRace: Both Race and Name are empty");
            }

            if (_sbCheckerBaseInput.Race_Base.RaceSB == null)
            {
                _sbCheckerBaseInput.MessageXML.AddFail("ParseRace", "Missing Race, no Bestiary Race entry for " + tempRace);
            }

            List <OnGoingStatBlockModifier> mods = _sbCheckerBaseInput.Race_Base.RacialOnGoingMods();

            foreach (OnGoingStatBlockModifier mod in mods)
            {
                _sbCheckerBaseInput.IndvSB.AddOnGoingStatBlockMod(mod);
            }
        }