示例#1
0
        public void CheckSpellsLevels()
        {
            List <string> Names              = CharacterClasses.GetClassNames();
            List <int>    Levels             = new List <int>();
            List <int>    LevelFrequency     = new List <int>();
            SpellList     SL                 = null;
            string        spellsHold         = string.Empty;
            string        spellLevelHold     = string.Empty;
            string        CR                 = string.Empty;
            string        SpellBlock         = string.Empty;
            int           overloadLevel      = 0;
            int           overloadClassLevel = 0;

            foreach (string name in Names)
            {
                if (CharacterClasses.CanClassCastSpells(name.ToLower()))
                {
                    SL = null;
                    if (ClassSpells.ContainsKey(name))
                    {
                        SL = GetClassSpellsByClassName(name);
                    }

                    if (SL != null)
                    {
                        int casterLevel = SL.CasterLevel;
                        int classLevel  = CharacterClasses.FindClassLevel(name);
                        switch (name.ToLower())
                        {
                        case "antipaladin":
                            classLevel -= 3;
                            break;

                        case "paladin":
                            classLevel -= 3;
                            break;

                        case "ranger":
                            classLevel -= 3;
                            break;
                        }

                        overloadLevel = 0;
                        CharacterClasses.GetSpellOverLoadsForPrestigeClasses(out overloadLevel, out overloadClassLevel);
                        GetSpellOverLoads(ref overloadLevel, ref overloadClassLevel, casterLevel, classLevel);

                        classLevel += overloadLevel;

                        if (casterLevel != classLevel)
                        {
                            _messageXML.AddFail("Caster Level", "Character level not equal to caster level for " + name);
                        }

                        GetSpellLevels(ref Levels, name, overloadLevel);
                        LevelFrequency = CharacterClasses.GetClassSpellsPerDay(name.ToLower(), overloadLevel);
                    }
                    string     SpellBonusAbility      = CharacterClasses.GetSpellBonusAbility(name.ToLower());
                    int        SpellBonusAbilityValue = MonSB.GetAbilityScoreValue(SpellBonusAbility);
                    bool       IsInquisitor           = name == "Inquisitor";
                    List <int> SpellBonus             = StatBlockInfo.GetSpellBonus(SpellBonusAbilityValue, IsInquisitor);

                    switch (name)
                    {
                    case "Bard":
                    case "Skald":
                    case "Sorcerer":
                    case "Summoner":
                    case "Inquisitor":
                    case "Red Mantis Assassin":
                    case "Arcanist":
                        SpellBonus = new List <int>()
                        {
                            0
                        };
                        break;

                    case "Oracle":     //cure or inflict bonus
                        SpellBonus = new List <int> {
                            0, 1, 1, 1, 1, 1, 1, 1, 1
                        };
                        break;
                    }


                    if (Levels != null)
                    {
                        if (SL != null)
                        {
                            CheckSpellCount(Levels, LevelFrequency, SL, name, SpellBonusAbility, SpellBonusAbilityValue, SpellBonus, overloadClassLevel, IsInquisitor);
                            CheckBonusSpells(SL, name, CharacterClasses.FindClassLevel(name));
                        }
                        else if (Levels.Any() && SpellBonusAbilityValue <= 10)
                        {
                            _messageXML.AddInfo("Lacks Ability Score to cast spells with " + SpellBonusAbility + " " + SpellBonusAbilityValue.ToString());
                        }
                    }
                    else
                    {
                        _messageXML.AddFail("CheckSpellsLevels", "Failed to load GetSpellLevels() for " + name);
                    }
                }
            }
        }
        public void CheckSpellsLevels()
        {
            List <string> classNames     = _characterClasses.GetClassNames();
            List <int>    levels         = new List <int>();
            List <int>    levelFrequency = new List <int>();
            SpellList     spellList;
            int           overloadLevel      = 0;
            int           overloadClassLevel = 0;

            foreach (string name in classNames)
            {
                if (_characterClasses.CanClassCastSpells(name.ToLower()))
                {
                    spellList = null;
                    if (_classSpells.ContainsKey(name))
                    {
                        spellList = GetClassSpellsByClassName(name);
                    }

                    if (spellList != null)
                    {
                        int casterLevel = spellList.CasterLevel;
                        int classLevel  = _characterClasses.FindClassLevel(name);
                        switch (name.ToLower())
                        {
                        case "antipaladin":
                            classLevel -= 3;
                            break;

                        case "paladin":
                            classLevel -= 3;
                            break;

                        case "ranger":
                            classLevel -= 3;
                            break;
                        }

                        overloadLevel = 0;
                        _characterClasses.GetSpellOverLoadsForPrestigeClasses(out overloadLevel, out overloadClassLevel);
                        classLevel += overloadLevel;

                        if (casterLevel != classLevel)
                        {
                            _messageXML.AddFail("Caster Level", "Character level not equal to caster level for " + name);
                        }

                        GetSpellLevels(ref levels, name, overloadLevel);
                        levelFrequency = _characterClasses.GetClassSpellsPerDay(name.ToLower(), overloadLevel);
                    }
                    string     SpellBonusAbility      = _characterClasses.GetSpellBonusAbility(name.ToLower());
                    int        SpellBonusAbilityValue = _monsterSB.GetAbilityScoreValue(SpellBonusAbility);
                    bool       IsInquisitor           = name == "Inquisitor";
                    List <int> SpellBonus             = StatBlockInfo.GetSpellBonus(SpellBonusAbilityValue, IsInquisitor);

                    switch (name)
                    {
                    case "Bard":
                    case "Skald":
                    case "Sorcerer":
                    case "Summoner":
                    case "Inquisitor":
                    case "Red Mantis Assassin":
                    case "Arcanist":
                        SpellBonus = new List <int>()
                        {
                            0
                        };
                        break;

                    case "Oracle":     //cure or inflict bonus
                        SpellBonus = new List <int> {
                            0, 1, 1, 1, 1, 1, 1, 1, 1
                        };
                        break;
                    }


                    if (levels != null)
                    {
                        if (spellList != null)
                        {
                            CheckSpellCount(levels, levelFrequency, spellList, name, SpellBonusAbility, SpellBonusAbilityValue, SpellBonus, overloadClassLevel, IsInquisitor);
                            CheckBonusSpells(spellList, name, _characterClasses.FindClassLevel(name));
                        }
                        else if (levels.Any() && SpellBonusAbilityValue <= 10)
                        {
                            _messageXML.AddInfo("Lacks Ability Score to cast spells with " + SpellBonusAbility + PathfinderConstants.SPACE + SpellBonusAbilityValue.ToString());
                        }
                    }
                    else
                    {
                        _messageXML.AddFail("CheckSpellsLevels", "Failed to load GetSpellLevels() for " + name);
                    }
                }
            }
        }