Esempio n. 1
0
        static BlueprintFeatureSelection CreateDragonMagic()
        {
            // Note: this ability was reworked a bit from PnP.
            // It should add the spells as spell-like abilities, not as spells known.
            //
            // It's tricky to implement as SLA: we'd need BindAbilitiesToClass and resource logic,
            // which would require cloning all spells in the game into spell-like ability versions,
            // just in case they're selected. It's a pretty big cost for this one revelation.
            //
            // In terms of mechanics it's a bit of a wash:
            // - SLAs don't count against your spells per day, but can only be cast a fixed amount
            // - SLAs don't require material components, but they can't use metamagic
            //
            // (Wish/Limited Wish/Miracle do use SLAs like this, but they use a different resource pool.)
            var noFeature = Helpers.PrerequisiteNoFeature(null);
            var name      = "MysteryDragonMagic";
            var feat      = Helpers.CreateFeatureSelection($"{name}Selection", "Dragon Magic",
                                                           "Your draconic power grants you a limited form of access to arcane magic. Select one spell from the sorcerer/wizard spell list that is 2 levels lower than the highest-level spell you can cast, or two spells that are both at least 3 levels lower. You add them to your spellbook and can cast them as divine spells.",
                                                           "e8c546fcff0b4734a787281cb5d37d32",
                                                           Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                                           FeatureGroup.None,
                                                           noFeature,
                                                           PrerequisiteCasterSpellLevel.Create(oracle, 3));

            noFeature.Feature = feat;

            var pickOneSpell = Helpers.CreateParamSelection <SelectAnySpellAtComputedLevel>(
                $"{name}OneSpellSelection",
                "Dragon Magic (one spell)",
                feat.Description,
                "6215b0ab90574ed1b228b70d83959694",
                null,
                FeatureGroup.None,
                Helpers.wizardSpellList.CreateLearnSpell(oracle));

            pickOneSpell.SpellList         = Helpers.wizardSpellList;
            pickOneSpell.SpellcasterClass  = oracle;
            pickOneSpell.SpellLevelPenalty = 2;

            var pickTwoSpells = Helpers.CreateFeature($"{name}TwoSpellProgression",
                                                      "Dragon Magic (two spells)",
                                                      feat.Description,
                                                      "b76fa49eab1e4fa7bdb2a6e678b7ba2b",
                                                      null,
                                                      FeatureGroup.None,
                                                      PrerequisiteCasterSpellLevel.Create(oracle, 4));

            var pickSpellChoice1 = CreateDragonMagicSpellSelection(feat, 1, "6b36673c1912498c9977d1774f7ca834");
            var pickSpellChoice2 = CreateDragonMagicSpellSelection(feat, 2, "1cffc8df18884a74bf18b40c7284515a");

            SelectFeature_Apply_Patch.onApplyFeature.Add(pickTwoSpells, (state, unit) =>
            {
                pickSpellChoice1.AddSelection(state, unit, 1);
                pickSpellChoice2.AddSelection(state, unit, 1);
            });

            feat.SetFeatures(pickOneSpell, pickTwoSpells);
            return(feat);
        }
        public static PrerequisiteCasterSpellLevel Create(BlueprintCharacterClass @class, int spellLevel)
        {
            PrerequisiteCasterSpellLevel p = Helpers.Create <PrerequisiteCasterSpellLevel>();

            p.CharacterClass     = @class;
            p.RequiredSpellLevel = spellLevel;
            return(p);
        }
        static BlueprintFeatureSelection CreateDragonMagicSpellSelection(BlueprintFeature feat, int index, String assetId)
        {
            var pickSpell = Helpers.CreateFeatureSelection($"{feat.name}Spell{index}",
                                                           feat.Name, feat.Description, assetId, feat.Icon,
                                                           FeatureGroup.None);
            var wizardList = Helpers.wizardSpellList;

            Traits.FillSpellSelection(pickSpell, 1, 6, wizardList, (level) => new BlueprintComponent[] {
                PrerequisiteCasterSpellLevel.Create(oracle, level + 3),
                wizardList.CreateLearnSpell(oracle, level)
            }, oracle);
            return(pickSpell);
        }
Esempio n. 4
0
        static BlueprintFeatureSelection CreateSpellBlendingSelection(
            BlueprintCharacterClass magus, BlueprintFeature feat, int index, String assetId)
        {
            var pickSpell = Helpers.CreateFeatureSelection($"{feat.name}Spell{index}",
                                                           feat.Name, feat.Description, assetId, feat.Icon,
                                                           FeatureGroup.MagusArcana);
            var wizardList = Helpers.wizardSpellList;

            Traits.FillSpellSelection(pickSpell, 1, 6, wizardList, (level) => new BlueprintComponent[] {
                PrerequisiteCasterSpellLevel.Create(magus, level + 1),
                Helpers.wizardSpellList.CreateLearnSpell(magus, level)
            }, magus);
            return(pickSpell);
        }
Esempio n. 5
0
        static BlueprintFeature CreateSpellBlending()
        {
            var name = "SpellBlending";
            var feat = Helpers.CreateFeatureSelection($"{name}Selection", "Spell Blending",
                                                      "When a magus selects this arcana, they must select one spell from the wizard spell list that is of a magus spell level they can cast. They adds this spell to their spellbook and list of magus spells known as a magus spell of its wizard spell level. They can instead select two spells to add in this way, but both must be at least one level lower than the highest-level magus spell they can cast.\nSpecial: A magus can select this magus arcana more than once.",
                                                      "0a273cce57ed44bdb2b9f36270c23cb8",
                                                      Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                                      FeatureGroup.MagusArcana);

            var pickOneSpell = Helpers.CreateParamSelection <SelectAnySpellAtComputedLevel>(
                $"{name}OneSpellSelection",
                $"{feat.Name} (one spell)",
                feat.Description,
                "0744c1eca7084c18aef2230828680cc9",
                null,
                FeatureGroup.MagusArcana,
                Helpers.wizardSpellList.CreateLearnSpell(magus));

            pickOneSpell.SpellList        = Helpers.wizardSpellList;
            pickOneSpell.SpellcasterClass = magus;

            var pickTwoSpells = Helpers.CreateFeature($"{name}TwoSpellProgression",
                                                      $"{feat.Name} (two spells)",
                                                      feat.Description,
                                                      "1fa334799e9a4a169fa53d154af86363",
                                                      null,
                                                      FeatureGroup.MagusArcana,
                                                      PrerequisiteCasterSpellLevel.Create(magus, 2));

            var pickSpellChoice1 = CreateSpellBlendingSelection(magus, feat, 1, "98aa453c00304b3e990d08b709e2fd24");
            var pickSpellChoice2 = CreateSpellBlendingSelection(magus, feat, 2, "cc40113b6e884c99b4141a25b7825aa8");

            SelectFeature_Apply_Patch.onApplyFeature.Add(pickTwoSpells, (state, unit) =>
            {
                var choice = pickSpellChoice1;
                state.AddSelection(null, choice, choice, 1);
                choice = pickSpellChoice2;
                state.AddSelection(null, choice, choice, 1);
            });

            feat.SetFeatures(pickOneSpell, pickTwoSpells, UndoSelection.Feature.Value);
            return(feat);
        }
        static BlueprintFeature CreateSpellBlending()
        {
            var name = "SpellBlending";
            var feat = Helpers.CreateFeatureSelection($"{name}Selection", "法术混合",
                                                      "当魔战士选择这个奥秘时,他可以向法术书中添加一个他可以施展的位于法师列表中的法术。 使用他的魔战士等级作为法师等级来决定施法者等级。 他也可以选择以这种方式添加两个法术, 但这两个法术必须至少比他能施展的最高环法术低一环。\n特殊: 魔战士可以多次选择这个奥秘。",
                                                      "0a273cce57ed44bdb2b9f36270c23cb8",
                                                      Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                                      FeatureGroup.MagusArcana);

            var pickOneSpell = Helpers.CreateParamSelection <SelectAnySpellAtComputedLevel>(
                $"{name}OneSpellSelection",
                $"{feat.Name} (单个法术)",
                feat.Description,
                "0744c1eca7084c18aef2230828680cc9",
                null,
                FeatureGroup.MagusArcana,
                Helpers.wizardSpellList.CreateLearnSpell(magus));

            pickOneSpell.SpellList        = Helpers.wizardSpellList;
            pickOneSpell.SpellcasterClass = magus;

            var pickTwoSpells = Helpers.CreateFeature($"{name}TwoSpellProgression",
                                                      $"{feat.Name} (两个法术)",
                                                      feat.Description,
                                                      "1fa334799e9a4a169fa53d154af86363",
                                                      null,
                                                      FeatureGroup.MagusArcana,
                                                      PrerequisiteCasterSpellLevel.Create(magus, 2));

            var pickSpellChoice1 = CreateSpellBlendingSelection(magus, feat, 1, "98aa453c00304b3e990d08b709e2fd24");
            var pickSpellChoice2 = CreateSpellBlendingSelection(magus, feat, 2, "cc40113b6e884c99b4141a25b7825aa8");

            SelectFeature_Apply_Patch.onApplyFeature.Add(pickTwoSpells, (state, unit) =>
            {
                var choice = pickSpellChoice1;
                state.AddSelection(null, choice, choice, 1);
                choice = pickSpellChoice2;
                state.AddSelection(null, choice, choice, 1);
            });

            feat.SetFeatures(pickOneSpell, pickTwoSpells, UndoSelection.Feature.Value);
            return(feat);
        }
Esempio n. 7
0
        static BlueprintFeature CreateExtraSpellChoice(BlueprintCharacterClass @class, int spellLevel)
        {
            var className = @class.Name.ToLower();

            var components = new List <BlueprintComponent>();

            components.Add(Helpers.PrerequisiteFeaturesFromList(extraSpellRaces));
            components.Add(PrerequisiteCasterSpellLevel.Create(@class, spellLevel + 1));
            components.Add(Helpers.Create <AddOneSpellChoice>(a => { a.CharacterClass = @class; a.SpellLevel = spellLevel; }));

            var feat = Helpers.CreateFeature($"Favored{@class.name}BonusSpellLevel{spellLevel}",
                                             string.Format(RES.BonusSpellLevelFeatureName_info, spellLevel),
                                             string.Format(RES.BonusSpellLevelFeatureDescription_info, spellLevel, className, className),
                                             Helpers.MergeIds(@class.AssetGuid, spellLevelGuids[spellLevel - 1]),
                                             Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                             FeatureGroup.None,
                                             components.ToArray());

            feat.Ranks = 20;
            return(feat);
        }
        static BlueprintFeature CreateExtraSpellChoice(BlueprintCharacterClass @class, int spellLevel)
        {
            var className = @class.Name.ToLower();

            var components = new List <BlueprintComponent>();

            components.Add(Helpers.PrerequisiteFeaturesFromList(extraSpellRaces));
            components.Add(PrerequisiteCasterSpellLevel.Create(@class, spellLevel + 1));
            components.Add(Helpers.Create <AddOneSpellChoice>(a => { a.CharacterClass = @class; a.SpellLevel = spellLevel; }));

            var feat = Helpers.CreateFeature($"Favored{@class.name}BonusSpellLevel{spellLevel}",
                                             $"Bonus Known Spell (Level {spellLevel})",
                                             $"Add one level {spellLevel} spell known from the {className} spell list. This spell must be at least one level below the highest {className} spell you can cast.",
                                             Helpers.MergeIds(@class.AssetGuid, spellLevelGuids[spellLevel - 1]),
                                             Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                             FeatureGroup.None,
                                             components.ToArray());

            feat.Ranks = 20;
            return(feat);
        }
        static BlueprintFeature CreateExtraSpellChoice(BlueprintCharacterClass @class, int spellLevel)
        {
            var className = @class.Name.ToLower();

            var components = new List <BlueprintComponent>();

            components.Add(Helpers.PrerequisiteFeaturesFromList(extraSpellRaces));
            components.Add(PrerequisiteCasterSpellLevel.Create(@class, spellLevel + 1));
            components.Add(Helpers.Create <AddOneSpellChoice>(a => { a.CharacterClass = @class; a.SpellLevel = spellLevel; }));

            var feat = Helpers.CreateFeature($"Favored{@class.name}BonusSpellLevel{spellLevel}",
                                             $"奖励已知法术 (Level {spellLevel})",
                                             $"增加一个 {spellLevel} 环 {className} 法术。这个法术必须比你当前所能施展的最高环 {className} 法术低一环。",
                                             Helpers.MergeIds(@class.AssetGuid, spellLevelGuids[spellLevel - 1]),
                                             Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                             FeatureGroup.None,
                                             components.ToArray());

            feat.Ranks = 20;
            return(feat);
        }
        static BlueprintFeatureSelection CreateDragonMagic()
        {
            // Note: this ability was reworked a bit from PnP.
            // It should add the spells as spell-like abilities, not as spells known.
            //
            // It's tricky to implement as SLA: we'd need BindAbilitiesToClass and resource logic,
            // which would require cloning all spells in the game into spell-like ability versions,
            // just in case they're selected. It's a pretty big cost for this one revelation.
            //
            // In terms of mechanics it's a bit of a wash:
            // - SLAs don't count against your spells per day, but can only be cast a fixed amount
            // - SLAs don't require material components, but they can't use metamagic
            //
            // (Wish/Limited Wish/Miracle do use SLAs like this, but they use a different resource pool.)
            var noFeature = Helpers.PrerequisiteNoFeature(null);
            var name      = "MysteryDragonMagic";
            var feat      = Helpers.CreateFeatureSelection($"{name}Selection", "龙之魔力",
                                                           "你来自于巨龙的庞大魔力可以给予你模仿有限的奥术法术的能力。从法师/术士列表中选择一个比你当前可释放的最高环位的法术低两环的法术,或者两个比你当前可释放的最高环位的法术低三环的法术,将他们加入你的已知法术中,并且视作神术释放。",
                                                           "e8c546fcff0b4734a787281cb5d37d32",
                                                           Helpers.GetIcon("55edf82380a1c8540af6c6037d34f322"), // elven magic
                                                           FeatureGroup.None,
                                                           noFeature,
                                                           PrerequisiteCasterSpellLevel.Create(oracle, 3));

            noFeature.Feature = feat;

            var pickOneSpell = Helpers.CreateParamSelection <SelectAnySpellAtComputedLevel>(
                $"{name}OneSpellSelection",
                "龙之魔力 (one spell)",
                feat.Description,
                "6215b0ab90574ed1b228b70d83959694",
                null,
                FeatureGroup.None,
                Helpers.wizardSpellList.CreateLearnSpell(oracle));

            pickOneSpell.SpellList         = Helpers.wizardSpellList;
            pickOneSpell.SpellcasterClass  = oracle;
            pickOneSpell.SpellLevelPenalty = 2;

            var pickTwoSpells = Helpers.CreateFeature($"{name}TwoSpellProgression",
                                                      "龙之魔力 (two spells)",
                                                      feat.Description,
                                                      "b76fa49eab1e4fa7bdb2a6e678b7ba2b",
                                                      null,
                                                      FeatureGroup.None,
                                                      PrerequisiteCasterSpellLevel.Create(oracle, 4));

            var pickSpellChoice1 = CreateDragonMagicSpellSelection(feat, 1, "6b36673c1912498c9977d1774f7ca834");
            var pickSpellChoice2 = CreateDragonMagicSpellSelection(feat, 2, "1cffc8df18884a74bf18b40c7284515a");

            SelectFeature_Apply_Patch.onApplyFeature.Add(pickTwoSpells, (state, unit) =>
            {
                var choice = pickSpellChoice1;
                state.AddSelection(null, choice, choice, 1);
                choice = pickSpellChoice2;
                state.AddSelection(null, choice, choice, 1);
            });

            feat.SetFeatures(pickOneSpell, pickTwoSpells);
            return(feat);
        }