static BlueprintSpellsTable CreateSpellsKnown(BlueprintSpellbook spellbook)
        {
            var baseSpellLevels = spellbook.SpellsKnown.Levels;
            var spellLevels     = new SpellsLevelEntry[baseSpellLevels.Length];

            for (int i = 0; i < spellLevels.Length; i++)
            {
                var known = baseSpellLevels[i].Count.ToArray();
                for (int j = 1; j < known.Length; j++)
                {
                    // Reduce known spells by 1, but keep the minimum per level at 1.
                    //
                    // In PnP Crossblooded starts each spell level with zero spells known. But that seems to bug
                    // the game UI (it fails to allow any spells to be added later). Perhaps it computes the
                    // "max spell level" incorrectly for the spellbook. This might be fixable with some patching
                    // (e.g. ApplySpellbook.Apply).
                    //
                    // Another issue: in PnP a sorcerer can cast lower level spells in higher level slots without
                    // a feat, so they're able to use those slots. In PF:K that isn't possible (unless a no-op
                    // metamagic is added) so I'd rather they are able to cast something. Last but not least, the
                    // penalty is considered rather harsh in PnP, so it seems reasonable to skip it for balance
                    // reasons.
                    known[j] = Math.Max(known[j] - 1, 1);
                }
                spellLevels[i] = new SpellsLevelEntry()
                {
                    Count = known
                };
            }
            return(Helpers.Create <BlueprintSpellsTable>(s => s.Levels = spellLevels));
        }
Esempio n. 2
0
            public static bool Prefix(CharacterBuildController __instance, BlueprintAbility spell, int spellLevel, bool multilevel)
            {
                if (!settings.toggleMulticlass)
                {
                    return(false);
                }
                BlueprintSpellbook spellbook = __instance.Spells.CurrentSpellSelectionData.Spellbook;
                BlueprintSpellList spellList = __instance.Spells.CurrentSpellSelectionData.SpellList;
                int spellsCollectionIndex    = __instance.Spells.CurrentSpellsCollectionIndex;

                if (multilevel)
                {
                    __instance.LevelUpController.UnselectSpell(spellbook, spellList, spellsCollectionIndex, spellLevel);
                }
                else
                {
                    __instance.LevelUpController.UnselectSpell(spellbook, spellList, spellsCollectionIndex, -1);
                }
                if (!__instance.LevelUpController.SelectSpell(spellbook, spellList, spellLevel, spell, spellsCollectionIndex))
                {
                    return(true);
                }
                // Begin Mod Lines
                BlueprintCharacterClass selectedClass = __instance.LevelUpController.State.SelectedClass;

                __instance.LevelUpController.State.SelectedClass = spellbook.CharacterClass;
                // End Mod Lines
                __instance.DefineAvailibleData();
                __instance.Spells.IsDirty = true;
                __instance.Total.IsDirty  = true;
                __instance.Spells.SetSpellbooklevel(spellLevel);
                __instance.SetupUI();
                __instance.LevelUpController.State.SelectedClass = selectedClass; // Mod Line
                return(true);
            }
Esempio n. 3
0
 static void createVindicativeBastardSpellbook()
 {
     vindicative_bastard_spellbook                     = library.CopyAndAdd <BlueprintSpellbook>("bce4989b070ce924b986bf346f59e885", "VindicativeBastardSpellbook", "");
     vindicative_bastard_spellbook.Name                = vindicative_bastard_class.LocalizedName;
     vindicative_bastard_spellbook.CharacterClass      = vindicative_bastard_class;
     vindicative_bastard_spellbook.CasterLevelModifier = -3;
 }
        //subordinate spell
        //dispelling pulse

        public PhrenicAmplificationsEngine(BlueprintAbilityResource pool_resource, BlueprintSpellbook linked_spellbook, BlueprintCharacterClass linked_class, string asset_prefix)
        {
            resource        = pool_resource;
            spellbook       = linked_spellbook;
            character_class = linked_class;
            name_prefix     = asset_prefix;
        }
Esempio n. 5
0
        static BlueprintFeatureSelection CreateSpellReplacementFeature(BlueprintSpellbook spellbook, int maxSpellLevel, BlueprintFeature keepAllSpells)
        {
            var caster = spellbook.CharacterClass;

            var    displayName = $"Replace Spell ({spellbook.CharacterClass.Name})";
            var    description = GetDescription(spellbook);
            Sprite icon        = null; // TODO: grab icon like the spellbook UI does

            var replaceFeat = Helpers.CreateParamSelection <ReplaceSpellSelection>(
                spellbook.name + $"ReplaceSpellParameterized{maxSpellLevel}",
                displayName,
                description,
                Helpers.MergeIds(spellbook.AssetGuid, guidsByLevel[maxSpellLevel]),
                icon,
                FeatureGroup.None,
                Helpers.Create <ReplaceSpellParametrized>(r => r.Spellbook = spellbook));

            replaceFeat.SpellcasterClass = caster;
            replaceFeat.SpellLevel       = maxSpellLevel;
            replaceFeat.HideInUI         = true;

            var selection = Helpers.CreateFeatureSelection(
                spellbook.name + $"ReplaceSpellSelection{maxSpellLevel}",
                displayName,
                description,
                Helpers.MergeIds(replaceFeat.AssetGuid, "e8c5583ddc2942cfb176582b2cc99254"),
                icon,
                FeatureGroup.None);

            selection.HideInUI = true;
            selection.SetFeatures(replaceFeat, keepAllSpells);
            //Log.Write(selection, showSelection : true);
            return(selection);
        }
Esempio n. 6
0
        public static String GetDisplayName(this BlueprintSpellbook bp)
        {
            var name = bp.DisplayName;

            if (name == null || name.Length == 0)
            {
                name = bp.name.Replace("Spellbook", "");
            }
            return(name);
        }
Esempio n. 7
0
 static void createSpellbook()
 {
     spellbook                  = library.CopyAndAdd <BlueprintSpellbook>("762858a4a28eaaf43aa00f50441d7027", "FeywardenSpellbook", "");
     spellbook.Name             = Helpers.CreateString("FeywardenSpellbook.Name", archetype.Name);
     spellbook.AllSpellsKnown   = false;
     spellbook.CastingAttribute = StatType.Charisma;
     spellbook.CanCopyScrolls   = false;
     spellbook.Spontaneous      = true;
     spellbook.SpellsPerLevel   = 0;
     spellbook.SpellsKnown      = Common.createSpontaneousHalfCasterSpellsKnownDelayed("FeywardenSpellKnownTable", "");
     spellbook.SpellsPerDay     = Common.createSpontaneousHalfCasterSpellsPerDayDelayed("FeywardenSpellPerDayTable", "");
 }
 public void UnselectSpell([NotNull] BlueprintSpellbook spellbook, [NotNull] BlueprintSpellList spellList, int slotIndex, int level)
 {
     if (level >= 0)
     {
         this.RemoveAction <SelectSpell>((SelectSpell a) => a.SlotIndex == slotIndex && a.SpellLevel == level && a.SpellList == spellList && a.Spellbook == spellbook);
     }
     else
     {
         this.RemoveAction <SelectSpell>((SelectSpell a) => a.SlotIndex == slotIndex && a.SpellList == spellList && a.Spellbook == spellbook);
     }
     this.UpdatePreview();
 }
Esempio n. 9
0
        static BlueprintFeature CreateKeepAllSpellsFeat(BlueprintSpellbook spellbook)
        {
            var feat = Helpers.CreateFeature(spellbook.name + "KnownAllSpellsFeature",
                                             "Keep all spells", "Choose this to skip replacing a known spell this level.",
                                             Helpers.MergeIds(spellbook.AssetGuid, "b09dfa039e3e4893a8c1f5df5c7f8195"),
                                             spellbook.CharacterClass.Icon,
                                             FeatureGroup.None);

            feat.HideInUI = true;
            feat.Ranks    = 10;
            return(feat);
        }
        static BlueprintFeature CreateKeepAllSpellsFeat(BlueprintSpellbook spellbook)
        {
            var feat = Helpers.CreateFeature(spellbook.name + "KnownAllSpellsFeature",
                                             RES.KeepAllSpellsFeatureName_info, RES.KeepAllSpellsFeatureDescription_info,
                                             Helpers.MergeIds(spellbook.AssetGuid, "b09dfa039e3e4893a8c1f5df5c7f8195"),
                                             spellbook.CharacterClass.Icon,
                                             FeatureGroup.None);

            feat.HideInUI = true;
            feat.Ranks    = 10;
            return(feat);
        }
Esempio n. 11
0
        static BlueprintFeature CreateKeepAllSpellsFeat(BlueprintSpellbook spellbook)
        {
            var feat = Helpers.CreateFeature(spellbook.name + "KnownAllSpellsFeature",
                                             Main.lc.GetTranslate("ReplaceSpell.KeepSpellDisplayText"),
                                             Main.lc.GetTranslate("ReplaceSpell.KeepSpellDesc"),
                                             Helpers.MergeIds(spellbook.AssetGuid, "b09dfa039e3e4893a8c1f5df5c7f8195"),
                                             spellbook.CharacterClass.Icon,
                                             FeatureGroup.None);

            feat.HideInUI = true;
            feat.Ranks    = 10;
            return(feat);
        }
        static String GetDescription(BlueprintSpellbook spellbook)
        {
            var  spellProgression      = spellbook.GetCasterSpellProgression();
            bool isFullCaster          = spellProgression == CasterSpellProgression.FullCaster;
            bool isThreeQuartersCaster = spellProgression == CasterSpellProgression.ThreeQuartersCaster;

            var firstSpell           = isFullCaster ? 4 : (isThreeQuartersCaster ? 5 : 8);
            var replacementFrequency = isFullCaster ? 2 : 3;
            var secondSpell          = firstSpell + replacementFrequency;
            var thirdSpell           = firstSpell + replacementFrequency * 2;
            var className            = spellbook.CharacterClass.Name.ToLower();

            return(string.Format(RES.ReplacementFeatureDescription_info, firstSpell, replacementFrequency, className, secondSpell, thirdSpell, className, className, className));
        }
Esempio n. 13
0
        public bool IsAvailableFor(AbilityData ability)
        {
            UnitDescriptor     unit      = ability.Caster;
            ClassData          classData = unit.Progression.GetClassData(characterClass);
            BlueprintSpellbook x         = (classData != null) ? classData.Spellbook : null;

            if (x != null)
            {
                Spellbook spellbook     = unit.DemandSpellbook(classData.CharacterClass);
                int       maxSpellLevel = spellbook.MaxSpellLevel;
                return(maxSpellLevel >= RequiredSpellLevel);
            }
            return(false);
        }
Esempio n. 14
0
        static String GetDescription(BlueprintSpellbook spellbook)
        {
            var  spellProgression      = spellbook.GetCasterSpellProgression();
            bool isFullCaster          = spellProgression == CasterSpellProgression.FullCaster;
            bool isThreeQuartersCaster = spellProgression == CasterSpellProgression.ThreeQuartersCaster;

            var firstSpell           = isFullCaster ? 4 : (isThreeQuartersCaster ? 5 : 8);
            var replacementFrequency = isFullCaster ? 2 : 3;
            var secondSpell          = firstSpell + replacementFrequency;
            var thirdSpell           = firstSpell + replacementFrequency * 2;

            var className = spellbook.CharacterClass.Name.ToLower();

            return($"Upon reaching {firstSpell}th level, and at every {replacementFrequency} {className} level after that ({secondSpell}th, {thirdSpell}th, and so on), a {className} can choose to learn a new spell in place of one they already know. In effect, the {className} loses the old spell in exchange for the new one. The new spell's level must be the same as that of the spell being exchanged. A {className} may swap only a single spell at any given level, and must choose whether or not to swap the spell at the same time that they gain new spells known for the level.");
        }
Esempio n. 15
0
 public override bool Check(
     FeatureSelectionState selectionState,
     UnitDescriptor unit,
     LevelUpState state)
 {
     foreach (ClassData classData in unit.Progression.Classes)
     {
         BlueprintSpellbook spellbook = classData.Spellbook;
         if (spellbook != null)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 16
0
        private AbilityData CreateAbilityData(
            UnitDescriptor caster,
            Kingmaker.UnitLogic.Abilities.Ability fact,
            BlueprintSpellbook spellbook)
        {
            AbilityData ad = new AbilityData(ability, caster, fact, spellbook);

            if (variant == null)
            {
                return(ad);
            }
            return(new AbilityData(variant, caster, fact, spellbook)
            {
                ConvertedFrom = ad
            });
        }
Esempio n. 17
0
        private AbilityData getAbilityData()
        {
            var descriptor = caster.Descriptor;
            var ad         = this.getAbilityForUse(descriptor);

            if ((ad != null))
            {
                return(ad);
            }
            BlueprintSpellbook spellbook = this.getSpellbookForUse(descriptor);

            if (spellbook == null)
            {
                return(null);
            }
            return(this.CreateAbilityData(descriptor, null, spellbook));
        }
Esempio n. 18
0
        public static CasterSpellProgression GetCasterSpellProgression(this BlueprintSpellbook spellbook)
        {
            var spellsPerDay = spellbook.SpellsPerDay;

            if (spellsPerDay.GetCount(6, 3).HasValue)
            {
                return(CasterSpellProgression.FullCaster);
            }
            else if (spellsPerDay.GetCount(7, 3).HasValue)
            {
                return(CasterSpellProgression.ThreeQuartersCaster);
            }
            else if (spellsPerDay.GetCount(10, 3).HasValue)
            {
                return(CasterSpellProgression.HalfCaster);
            }
            return(CasterSpellProgression.UnknownCaster);
        }
 public override bool Check(
     FeatureSelectionState selectionState,
     UnitDescriptor unit,
     LevelUpState state)
 {
     foreach (ClassData classData in unit.Progression.Classes)
     {
         BlueprintSpellbook spellbook = classData.Spellbook;
         if (spellbook != null &&
             (!this.OnlySpontaneous || spellbook.Spontaneous) &&
             spellbook.GetComponent <PsychicSpellbook>() != null &&
             unit.DemandSpellbook(classData.CharacterClass).MaxSpellLevel >= this.RequiredSpellLevel)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 20
0
        static void createDiminishedSpellCasting()
        {
            spellbook      = library.CopyAndAdd <BlueprintSpellbook>("682545e11e5306c45b14ca78bcbe3e62", "SkirnirSpellbook", "");
            spellbook.Name = Helpers.CreateString(spellbook.name + ".Name", archetype.Name);

            diminished_spellcasting = Helpers.CreateFeature("DiminishedSpellcastingSkirnirFeature",
                                                            "Diminished Spellcasting",
                                                            "A skirnir casts one fewer spell of each level than normal. If this reduces the number to 0, he may cast spells of that level only if his Intelligence allows bonus spells of that level.",
                                                            "",
                                                            null,
                                                            FeatureGroup.None
                                                            );

            var magus_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("45a4607686d96a1498891b3286121780");

            //add check against arrowsong minstrel archetype for exisitng bard spellbooks
            var selections_to_fix = new BlueprintFeatureSelection[] { Common.EldritchKnightSpellbookSelection,
                                                                      Common.ArcaneTricksterSelection,
                                                                      Common.MysticTheurgeArcaneSpellbookSelection };

            foreach (var s in selections_to_fix)
            {
                foreach (var f in s.AllFeatures)
                {
                    if (f.GetComponents <PrerequisiteClassSpellLevel>().Where(c => c.CharacterClass == magus_class).Count() > 0)
                    {
                        f.AddComponent(Common.prerequisiteNoArchetype(magus_class, archetype));
                    }
                }
            }

            Common.addReplaceSpellbook(Common.EldritchKnightSpellbookSelection, spellbook, "EldritchKnightArrowsongSkirnir",
                                       Common.createPrerequisiteClassSpellLevel(magus_class, 3),
                                       Common.createPrerequisiteArchetypeLevel(magus_class, archetype, 1));

            Common.addReplaceSpellbook(Common.ArcaneTricksterSelection, spellbook, "ArcaneTricksterArrowsongSkirinir",
                                       Common.createPrerequisiteClassSpellLevel(magus_class, 2),
                                       Common.createPrerequisiteArchetypeLevel(magus_class, archetype, 1));

            Common.addReplaceSpellbook(Common.MysticTheurgeArcaneSpellbookSelection, spellbook, "MysticTheurgeArrowosngSkirinir",
                                       Common.createPrerequisiteClassSpellLevel(magus_class, 2),
                                       Common.createPrerequisiteArchetypeLevel(magus_class, archetype, 1));
        }
        static public int getArcanistMemorizeSlotCnt(int spellLevel, Spellbook spellBook)
        {
            BlueprintSpellbook           spellBookBlueprint = spellBook.Blueprint;
            ModifiableValueAttributeStat castingStat        = spellBook.Owner.Stats.GetStat <ModifiableValueAttributeStat>(spellBookBlueprint.CastingAttribute);

            if (castingStat == null)
            {
                return(0);
            }
            if (castingStat < 10 + spellLevel)
            {
                return(0);
            }
            if (spellLevel < 0 || spellLevel > spellBook.MaxSpellLevel)
            {
                return(0);
            }
            return(spellBookBlueprint.SpellsKnown.GetCount(spellBook.CasterLevel + 20, spellLevel).Value);
        }
        static void createHolyMagic()
        {
            var cleric_spell_list     = library.Get <BlueprintSpellList>("8443ce803d2d31347897a3d85cc32f53");
            var inquisitor_spell_list = archetype.GetParentClass().Spellbook.SpellList;

            var ravener_spell_list = Common.combineSpellLists("ReavenerHunterSpellList",
                                                              (spell, spell_list, lvl) =>
            {
                if ((spell.SpellDescriptor & (SpellDescriptor.Evil | SpellDescriptor.Law | SpellDescriptor.Chaos)) != 0)
                {
                    return(false);
                }
                if (lvl > 6)
                {
                    return(false);
                }
                if (spell_list == cleric_spell_list && (spell.SpellDescriptor & SpellDescriptor.Good) == 0)
                {
                    return(false);
                }
                return(true);
            },
                                                              inquisitor_spell_list, cleric_spell_list
                                                              );

            spellbook           = library.CopyAndAdd(archetype.GetParentClass().Spellbook, "RavenerHunterSpellbook", "");
            spellbook.SpellList = ravener_spell_list;

            var feature = Helpers.CreateFeature("RavenerHunterHolyMagic",
                                                "Holy Magic",
                                                "A demon hunter must be non-evil. She adds all spells of 6th-level and lower on the cleric spell list with the good descriptor to her inquisitor spell list as inquisitor spells of the same level. If a spell appears on both the cleric and inquisitor spell lists, the demon hunter uses the lower of the two spell levels listed for the spell. She cannot cast a spell with the chaotic, evil, or lawful descriptors, even from spell trigger or spell completion items.",
                                                "",
                                                Helpers.GetIcon("808ab74c12df8784ab4eeaf6a107dbea"), //protection from evil
                                                FeatureGroup.None,
                                                Common.createPrerequisiteAlignment(AlignmentMaskType.Good | AlignmentMaskType.ChaoticNeutral | AlignmentMaskType.TrueNeutral | AlignmentMaskType.LawfulNeutral)
                                                );

            holy_magic            = Common.featureToSelection(feature);
            holy_magic.Obligatory = true;
        }
Esempio n. 23
0
        static void createDrawbacks()
        {
            drawbacks = Helpers.CreateFeature("CrossbloodedDrawbacksFeature",
                                              "Drawbacks",
                                              "A crossblooded sorcerer has one fewer spell known at each level than is presented on the sorcerer spells known table. Furthermore, the conflicting urges created by the divergent nature of the crossblooded sorcerer’s dual heritage forces her to constantly take some mental effort just to remain focused on her current situation and needs. This leaves her with less mental resolve to deal with external threats. A crossblooded sorcerer always takes a –2 penalty on Will saves.",
                                              "",
                                              Helpers.GetIcon("eabf94e4edc6e714cabd96aa69f8b207"),
                                              FeatureGroup.None,
                                              Helpers.CreateAddStatBonus(StatType.SaveWill, -2, ModifierDescriptor.UntypedStackable)
                                              );

            spellbook      = library.CopyAndAdd <BlueprintSpellbook>("b3db3766a4b605040b366265e2af0e50", "CrossbloodedSorcererSpellbook", "");
            spellbook.Name = Helpers.CreateString(archetype.name + ".Spellbook", archetype.Name + " Sorcerer");

            spellbook.SpellsKnown = Common.createSpellsTable("CrossbloodedSpellsKnownTable", "",
                                                             Common.createSpellsLevelEntry(),                             //0
                                                             Common.createSpellsLevelEntry(0, 1),                         //1
                                                             Common.createSpellsLevelEntry(0, 1),                         //2
                                                             Common.createSpellsLevelEntry(0, 2),                         //3
                                                             Common.createSpellsLevelEntry(0, 2),                         //4
                                                             Common.createSpellsLevelEntry(0, 3, 1),                      //5
                                                             Common.createSpellsLevelEntry(0, 3, 1),                      //6
                                                             Common.createSpellsLevelEntry(0, 4, 2, 1),                   //7
                                                             Common.createSpellsLevelEntry(0, 4, 2, 1),                   //8
                                                             Common.createSpellsLevelEntry(0, 4, 3, 2, 1),                //9
                                                             Common.createSpellsLevelEntry(0, 4, 3, 2, 1),                //10
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 2, 1),             //11
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 2, 1),             //12
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 2, 1),          //13
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 2, 1),          //14
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 1),       //15
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 1),       //16
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 2, 1),    //17
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 2, 1),    //18
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 2, 2, 1), //19
                                                             Common.createSpellsLevelEntry(0, 4, 4, 3, 3, 3, 2, 2, 2, 2)  //20
                                                             );
        }
Esempio n. 24
0
        static void CreateSpellReplacementProgression(BlueprintSpellbook spellbook)
        {
            if (spellbook == null || !spellbook.Spontaneous)
            {
                return;
            }

            var caster       = spellbook.CharacterClass;
            var levelEntries = new Dictionary <int, BlueprintFeatureSelection>();

            // Replace a spell is optional, so provide a way to opt out.
            var keepAllSpellsFeat = CreateKeepAllSpellsFeat(spellbook);

            // The minimum level for spell replacement is 4.
            //
            // This creates an entry at every level, because it's possible that the caster level
            // increases won't follow a predictable pattern due to multiclassing.
            BlueprintFeatureSelection replaceFeat = null;
            int previousMaxSpell = 0;

            for (var level = 4; level <= 20; level++)
            {
                var spellsKnown   = spellbook.SpellsKnown;
                int maxSpellLevel = spellsKnown.Levels[level].Count.Length - 2;
                if (maxSpellLevel < 1)
                {
                    continue;                    // can't replace spells yet.
                }
                if (maxSpellLevel != previousMaxSpell)
                {
                    replaceFeat      = CreateSpellReplacementFeature(spellbook, maxSpellLevel, keepAllSpellsFeat);
                    previousMaxSpell = maxSpellLevel;
                }
                levelEntries[level] = replaceFeat;
            }

            casterProgressions[spellbook] = levelEntries;
        }
Esempio n. 25
0
        static void createSpellcasting()
        {
            var wizard = library.Get <BlueprintCharacterClass>("ba34257984f4c41408ce1dc2004e342e");

            spellbook                  = library.CopyAndAdd <BlueprintSpellbook>("762858a4a28eaaf43aa00f50441d7027", "StygianSlayerSpellbook", "");//ranger spellbook
            spellbook.IsArcane         = true;
            spellbook.CharacterClass   = archetype.GetParentClass();
            spellbook.Name             = Helpers.CreateString("StygianSlayerSpellbook.Name", archetype.Name);
            spellbook.AllSpellsKnown   = false;
            spellbook.CanCopyScrolls   = true;
            spellbook.CastingAttribute = StatType.Intelligence;

            spellbook.SpellList = Common.combineSpellLists("StygianSlayerSpelllist",
                                                           (spell, spelllist, lvl) =>
            {
                return(lvl <= 4 && lvl > 0 &&
                       (spell.School == SpellSchool.Illusion ||
                        spell == NewSpells.obscuring_mist ||
                        spell == NewSpells.barrow_haze
                       ));
            },
                                                           wizard.Spellbook.SpellList);

            spellcasting = Helpers.CreateFeature("StygianSlayerSpellcasting",
                                                 "Spell Use",
                                                 "Beginning at 4th level, a stygian slayer gains the ability to cast a small number of arcane spells. He can only cast wizard spells of the illusion school of spell level 1 through 4th, obscuring mist and barrow haze. A stygian slayer must choose and prepare his spells in advance.\n"
                                                 + "To prepare or cast a spell, a stygian slayer must have an Intelligence score equal to at least 10 + the spell level. The Difficulty Class for a saving throw against a stygian slayer’s spell is 10 + the spell level + the stygian slayer’s Intelligence modifier.\n"
                                                 + "A stygian slayer can cast only a certain number of spells of each spell level per day. Her base daily spell allotment is the same as the ranger class.\n"
                                                 + "Through 3rd level, a stygian slayer has no caster level. At 4th level and higher, his caster level is equal to his stygian slayer level – 3.\n"
                                                 + "Stygian slayer learns, prepares, and casts spells exactly as a wizard does, but does not gain additional spells known each time he gains a slayer level with this archetype.\n"
                                                 + "A stygian slayer can cast his spells while wearing light armor without incurring the normal arcane spell failure chance. Like any other arcane spellcaster, a stygian slayer wearing medium or heavy armor or using a shield incurs a chance of arcane spell failure if the spell in question has a somatic component.",
                                                 "",
                                                 Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"),
                                                 FeatureGroup.None,
                                                 Common.createArcaneArmorProficiency(ArmorProficiencyGroup.Light)
                                                 );
        }
Esempio n. 26
0
 public static String CollationName(this BlueprintSpellbook bp)
 {
     if (bp.IsMythic)
     {
         return("Mythic");
     }
     if (bp.IsAlchemist)
     {
         return("Alchemist");
     }
     if (bp.IsArcane)
     {
         return("Arcane");
     }
     if (bp.IsSinMagicSpecialist)
     {
         return("Specialist");
     }
     if (bp.CharacterClass.IsDivineCaster)
     {
         return("Divine");
     }
     return(bp.GetType().ToString());
 }
Esempio n. 27
0
            private bool checkSpellbook(BlueprintSpellbook spellbook)
            {
                if (spellbook == null)
                {
                    return(false);
                }

                if (spellbook.IsArcane)
                {
                    return(apply_to_arcane);
                }
                else if (spellbook.IsAlchemist)
                {
                    return(apply_to_alchemist);
                }
                else if (spellbook.GetComponent <SpellbookMechanics.PsychicSpellbook>() != null)
                {
                    return(apply_to_psychic);
                }
                else
                {
                    return(apply_to_divine);
                }
            }
Esempio n. 28
0
 public static ClassData GetOwnerClassData(this BlueprintSpellbook spellbook, UnitDescriptor unit) => unit.Progression.Classes.FirstOrDefault(item => item.Spellbook == spellbook);
Esempio n. 29
0
 public static BlueprintCharacterClass GetOwnerClass(this BlueprintSpellbook spellbook, UnitDescriptor unit) => unit.Progression.Classes.FirstOrDefault(item => item.Spellbook == spellbook)?.CharacterClass;
 public override void OnTurnOn()
 {
     this.Owner.Ensure <UnitPartArcanistPreparedMetamagic>().spellbook = spellbook;
 }