Exemple #1
0
        public int GetOnGoingStatBlockModValueStackable(OnGoingStatBlockModifier.StatBlockModifierTypes Type,
                                                        OnGoingStatBlockModifier.StatBlockModifierSubTypes SubType, bool CheckStackable)
        {
            string fou = string.Empty;

            return(GetOnGoingStatBlockModValue(Type, SubType, CheckStackable, ref fou));
        }
Exemple #2
0
        public int GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes Type,
                                               OnGoingStatBlockModifier.StatBlockModifierSubTypes SubType)
        {
            string fou = string.Empty;

            return(GetOnGoingStatBlockModValue(Type, SubType, false, ref fou));
        }
        public static OnGoingStatBlockModifier.StatBlockModifierSubTypes GetOnGoingAbilitySubTypeFromString(string AbilityName)
        {
            OnGoingStatBlockModifier.StatBlockModifierSubTypes type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.None;
            switch (AbilityName)
            {
            case StatBlockInfo.STR:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Str;
                break;

            case StatBlockInfo.INT:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Int;
                break;

            case StatBlockInfo.WIS:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Wis;
                break;

            case StatBlockInfo.DEX:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Dex;
                break;

            case StatBlockInfo.CON:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Con;
                break;

            case StatBlockInfo.CHA:
                type = OnGoingStatBlockModifier.StatBlockModifierSubTypes.Ability_Cha;
                break;
            }

            return(type);
        }
Exemple #4
0
        public int GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes Type,
                                               OnGoingStatBlockModifier.StatBlockModifierSubTypes SubType, ref string formula)
        {
            int modValue = 0;

            foreach (OnGoingStatBlockModifier mod in _onGoingModifers)
            {
                if (mod.ModType == Type && mod.SubType == SubType && mod.ConditionGroup == string.Empty)
                {
                    modValue += mod.Modifier;
                    formula  += " +" + mod.Modifier.ToString() + PathfinderConstants.SPACE + mod.Name;
                    //calculation += " +" + mod.Modifier.ToString();
                }
            }

            return(modValue);
        }
Exemple #5
0
        public int GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes Type,
                                               OnGoingStatBlockModifier.StatBlockModifierSubTypes SubType, bool CheckStackable, ref string formula)
        {
            int modValue = 0;
            Dictionary <OnGoingStatBlockModifier.StatBlockModifierSubTypes, OnGoingStatBlockModifier> StackableValues = new Dictionary <OnGoingStatBlockModifier.StatBlockModifierSubTypes, OnGoingStatBlockModifier>();

            foreach (OnGoingStatBlockModifier mod in OnGoingStatBlockMods)
            {
                if (mod.ModType == Type && mod.SubType == SubType && mod.ConditionGroup == string.Empty)
                {
                    if (CheckStackable)
                    {
                        if (StackableValues.ContainsKey(SubType))
                        {
                            if (StackableValues[SubType].Modifier < mod.Modifier)
                            {
                                StackableValues[SubType].Modifier = mod.Modifier;
                            }
                        }
                        else
                        {
                            StackableValues.Add(SubType, mod);
                        }
                    }
                    else
                    {
                        modValue += mod.Modifier;
                        formula  += " +" + mod.Modifier.ToString() + PathfinderConstants.SPACE + mod.Name;
                    }
                }
            }

            if (CheckStackable)
            {
                foreach (KeyValuePair <OnGoingStatBlockModifier.StatBlockModifierSubTypes, OnGoingStatBlockModifier> kvp in StackableValues)
                {
                    modValue += kvp.Value.Modifier;
                    formula  += " +" + kvp.Value.Modifier.ToString() + PathfinderConstants.SPACE + kvp.Value.Name;
                }
            }

            return(modValue);
        }
Exemple #6
0
        public void CheckSpellDC(bool IsGnome)
        {
            List <string> Names   = CharacterClasses.GetClassNames();
            SpellList     SL      = null;
            string        formula = string.Empty;

            foreach (string name in Names)
            {
                formula = string.Empty;
                if (CharacterClasses.CanClassCastSpells(name.ToLower()))
                {
                    if (ClassSpells.ContainsKey(name))
                    {
                        SL = ClassSpells[name];
                        List <SpellData> ListOfSpells = SL.ListOfSpells;
                        int AbilityScore = MonSB.GetAbilityScoreValue(CharacterClasses.GetSpellBonusAbility(name));
                        OnGoingStatBlockModifier.StatBlockModifierSubTypes subType = Utility.GetOnGoingAbilitySubTypeFromString(CharacterClasses.GetSpellBonusAbility(name));
                        AbilityScore += _indvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.Ability, subType);
                        int AbilityBonus = StatBlockInfo.GetAbilityModifier(AbilityScore);

                        int Bonus = 0;

                        foreach (SpellData SD in ListOfSpells)
                        {
                            try
                            {
                                string Temp = SD.Name;
                                Temp = Temp.Replace("†", string.Empty);
                                List <string> School;

                                Temp = Utility.RemoveSuperScripts(Temp);

                                string search = Utility.SearchMod(Temp);
                                if (search == "empty slot")
                                {
                                    continue;
                                }
                                ISpellStatBlock Spell = SpellStatBlock.GetSpellByName(search);
                                Bonus = 0;


                                if (Spell == null)
                                {
                                    _messageXML.AddFail("Spell DC", "Missing spell: " + search);
                                }
                                else
                                {
                                    if (_monSBSearch.HasSpellFocusFeat(out School))
                                    {
                                        if (School.Contains(Spell.school))
                                        {
                                            Bonus++;
                                        }
                                        List <string> School2;
                                        if (_monSBSearch.HasGreaterSpellFocusFeat(out School2))
                                        {
                                            if (School2.Contains(Spell.school))
                                            {
                                                Bonus++;
                                            }
                                        }
                                        if (SLA_SaveFail(SD, Spell))
                                        {
                                            _messageXML.AddFail("SLA Save-" + SD.Name, Spell.saving_throw, SD.DC.ToString());
                                        }
                                    }

                                    if (_monSBSearch.HasElementalSkillFocusFeat(out School))
                                    {
                                        if (School.Contains(Spell.school))
                                        {
                                            Bonus++;
                                        }
                                        List <string> School2;
                                        if (_monSBSearch.HasGreaterElementalSkillFocusFeat(out School2))
                                        {
                                            if (School2.Contains(Spell.school))
                                            {
                                                Bonus++;
                                            }
                                        }
                                        if (SLA_SaveFail(SD, Spell))
                                        {
                                            _messageXML.AddFail("SLA Save-" + SD.Name, Spell.saving_throw, SD.DC.ToString());
                                        }
                                    }

                                    if (SD.DC > 0)
                                    {
                                        ComputeSpellDC(IsGnome, ref formula, name, AbilityBonus, ref Bonus, SD, Spell);
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                _messageXML.AddFail("CheckSpellDC--" + SD.Name, ex.Message);
                            }
                        }
                    }
                }
            }

            if (!Names.Any() && MonSB.SpellsPrepared.Length > 0)
            {
                string temp = MonSB.SpellsPrepared;
                temp = temp.Substring(0, temp.IndexOf(" "));
                if (ClassSpells.ContainsKey(temp))
                {
                    SL = ClassSpells[temp];
                    List <SpellData> ListOfSpells = SL.ListOfSpells;
                    int AbilityBonus = StatBlockInfo.GetAbilityModifier(MonSB.GetAbilityScoreValue(CharacterClasses.GetSpellBonusAbility(temp)));

                    foreach (SpellData SD in ListOfSpells)
                    {
                        if (SD.DC > 0)
                        {
                            int computedDC = 10 + SD.Level + AbilityBonus;
                            formula = "10 +" + SD.Level.ToString() + " spell level +" + AbilityBonus.ToString() + " ability bonus";
                            if (computedDC == SD.DC)
                            {
                                _messageXML.AddPass("Spell DC-" + SD.Name);
                            }
                            else
                            {
                                _messageXML.AddFail("Spell DC-" + SD.Name, computedDC.ToString(), SD.DC.ToString(), formula);
                            }
                        }
                    }
                }
            }

            if (!Names.Any() && MonSB.SpellsKnown.Length > 0)
            {
                string temp = MonSB.SpellsKnown;
                temp = temp.Substring(0, temp.IndexOf(" "));
                if (ClassSpells.ContainsKey(temp))
                {
                    SL = ClassSpells[temp];
                    List <SpellData> ListOfSpells = SL.ListOfSpells;
                    if (temp == "Spells")
                    {
                        temp = "Sorcerer";
                    }
                    int AbilityBonus = StatBlockInfo.GetAbilityModifier(MonSB.GetAbilityScoreValue(CharacterClasses.GetSpellBonusAbility(temp)));

                    foreach (SpellData SD in ListOfSpells)
                    {
                        if (SD.DC > 0)
                        {
                            int computedDC = 10 + SD.Level + AbilityBonus;
                            formula = "10 +" + SD.Level.ToString() + " spell level +" + AbilityBonus.ToString() + " ability bonus";
                            if (computedDC == SD.DC)
                            {
                                _messageXML.AddPass("Spell DC-" + SD.Name);
                            }
                            else
                            {
                                _messageXML.AddFail("Spell DC-" + SD.Name, computedDC.ToString(), SD.DC.ToString(), formula);
                            }
                        }
                    }
                }
            }
        }
        private SpellList CkeckClassSpellDCs(bool isGnome, ref string formula, string name)
        {
            SpellList SL;

            {
                SL = _classSpells[name];
                List <SpellData> listOfSpells = SL.ListOfSpells;
                int abilityScoreValue         = _monsterSB.GetAbilityScoreValue(_characterClasses.GetSpellBonusAbility(name));
                OnGoingStatBlockModifier.StatBlockModifierSubTypes subType = Utility.GetOnGoingAbilitySubTypeFromString(_characterClasses.GetSpellBonusAbility(name));
                abilityScoreValue += _indvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.Ability, subType);
                int abilityBonus = StatBlockInfo.GetAbilityModifier(abilityScoreValue);

                int bonus = 0;

                foreach (SpellData spellData in listOfSpells)
                {
                    try
                    {
                        string        temp = spellData.Name.Replace("†", string.Empty);
                        List <string> schoolList;

                        temp = Utility.RemoveSuperScripts(temp);

                        string search = Utility.SearchMod(temp);
                        if (search == "empty slot")
                        {
                            continue;
                        }
                        ISpellStatBlock spell = _spellStatBlockBusiness.GetSpellByName(search);
                        bonus = 0;

                        if (spell == null)
                        {
                            _messageXML.AddFail("Spell DC", "Missing spell: " + search);
                        }
                        else
                        {
                            if (_monSBSearch.HasSpellFocusFeat(out schoolList))
                            {
                                if (schoolList.Contains(spell.school))
                                {
                                    bonus++;
                                }
                                List <string> schoolList2;
                                if (_monSBSearch.HasGreaterSpellFocusFeat(out schoolList2))
                                {
                                    if (schoolList2.Contains(spell.school))
                                    {
                                        bonus++;
                                    }
                                }
                                if (SLA_SaveFail(spellData, spell))
                                {
                                    _messageXML.AddFail("SLA Save-" + spellData.Name, spell.saving_throw, spellData.DC.ToString());
                                }
                            }

                            if (_monSBSearch.HasElementalSkillFocusFeat(out schoolList))
                            {
                                if (schoolList.Contains(spell.school))
                                {
                                    bonus++;
                                }
                                List <string> schoolList2;
                                if (_monSBSearch.HasGreaterElementalSkillFocusFeat(out schoolList2))
                                {
                                    if (schoolList2.Contains(spell.school))
                                    {
                                        bonus++;
                                    }
                                }
                                if (SLA_SaveFail(spellData, spell))
                                {
                                    _messageXML.AddFail("SLA Save-" + spellData.Name, spell.saving_throw, spellData.DC.ToString());
                                }
                            }

                            if (spellData.DC > 0)
                            {
                                ComputeSpellDC(isGnome, ref formula, name, abilityBonus, ref bonus, spellData, spell);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        _messageXML.AddFail("CheckSpellDC--" + spellData.Name, ex.Message);
                    }
                }
            }

            return(SL);
        }
Exemple #8
0
        public int GetOnGoingStatBlockSkillAbilityModValue(OnGoingStatBlockModifier.StatBlockModifierTypes Type, OnGoingStatBlockModifier.StatBlockModifierSubTypes SubType, ref string formula)
        {
            int modValue = 0;

            foreach (OnGoingStatBlockModifier mod in OnGoingStatBlockMods)
            {
                if (mod.ModType == Type && mod.SubType == SubType)
                {
                    modValue += mod.Modifier;
                    formula  += " +" + mod.Modifier.ToString() + PathfinderConstants.SPACE + mod.Name;
                }
            }

            return(modValue);
        }