Esempio n. 1
0
        private int FindSpellCasterLevel(string spell)
        {
            if (!_spellsData.ClassSpells.Any() && !_spellsData.SLA.Any())
            {
                return(-1);
            }
            SpellList tempList = null;

            if (spell.Contains("self only"))
            {
                int pos = spell.IndexOf(PathfinderConstants.PAREN_LEFT);
                spell = spell.Substring(0, pos - 1);
            }

            foreach (KeyValuePair <string, SpellList> kvp in _spellsData.ClassSpells)
            {
                tempList = kvp.Value;
                if (tempList.SpellExists(spell))
                {
                    return(tempList.CasterLevel);
                }
            }

            foreach (KeyValuePair <string, SpellList> kvp in _spellsData.SLA)
            {
                tempList = kvp.Value;
                if (tempList.SpellExists(spell))
                {
                    return(tempList.CasterLevel);
                }
            }

            return(0);
        }
Esempio n. 2
0
        private void CheckBonusSpells(SpellList SL, string name, int casterLevel)
        {
            string checkName = "CheckBonusSpells";

            Dictionary <string, int> MysteryBonusSpells = CharacterClasses.GetMysteryBonusSpells();

            if (MysteryBonusSpells != null && MysteryBonusSpells.Any())
            {
                foreach (KeyValuePair <string, int> kvp in MysteryBonusSpells)
                {
                    if (!SL.SpellExists(kvp.Key))
                    {
                        _messageXML.AddFail(checkName, "Missing bonus Mystery Spell from spell list -" + kvp.Key);
                    }
                }
            }

            List <string> PatronBonusSpells = CharacterClasses.GetPatronBonusSpells();

            if (PatronBonusSpells != null && PatronBonusSpells.Any())
            {
                foreach (string spell in PatronBonusSpells)
                {
                    if (!SL.SpellExists(spell))
                    {
                        _messageXML.AddFail(checkName, "Missing bonus Patron Spell from spell list -" + spell);
                    }
                }
            }

            Dictionary <string, int> BloodlineBonusSpells = CharacterClasses.GetBloodlineBonusSpells();

            if (BloodlineBonusSpells != null && BloodlineBonusSpells.Any())
            {
                foreach (KeyValuePair <string, int> kvp in BloodlineBonusSpells)
                {
                    if (!SL.SpellExists(kvp.Key) && casterLevel >= kvp.Value)
                    {
                        _messageXML.AddFail(checkName, "Missing bonus Bloodline Spell from spell list -" + kvp.Key);
                    }
                }
            }
        }