Ejemplo n.º 1
0
            void createTrueSpiritAbility()
            {
                var resource = Helpers.CreateAbilityResource(prefix + "WindElementalFormResource", "", "", "", null);

                resource.SetFixedResource(1);

                var buff = library.CopyAndAdd <BlueprintBuff>("eb52d24d6f60fc742b32fe943b919180", prefix + "WindElementalFormBuff", "");

                buff.SetName("Elemental Form (Huge Air Elemental)");

                var ability = library.CopyAndAdd <BlueprintAbility>("e3ee03c3a959ca046a39827508ab8943", prefix + "WindElementalFormAbility", "");

                ability.ReplaceComponent <ContextRankConfig>(c => Helpers.SetField(c, "m_Class", hex_engine.hex_classes));
                ability.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = resource);
                ability.ReplaceComponent <AbilityTargetHasFact>(a => a.CheckedFacts     = new BlueprintUnitFact[] { buff });
                ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions        = Helpers.CreateActionList(Common.changeAction <ContextActionApplyBuff>(a.Actions.Actions,
                                                                                                                                                                b => b.Buff = buff)
                                                                                                                   )
                                                                  );
                ability.SetName("Elemental Form (Huge Air Elemental)");
                true_spirit_ability = Common.AbilityToFeature(ability, false);
                true_spirit_ability.SetDescription(Helpers.CreateString(true_spirit_ability.name + "2.Description", "As a standard action, the shaman assumes the form of a Huge air elemental, as if using elemental body IV with a duration of 1 hour per level. The shaman can use this ability once per day."));
                true_spirit_ability.AddComponent(Helpers.CreateAddAbilityResource(resource));
            }
Ejemplo n.º 2
0
            void createTrueSpiritAbility()
            {
                var resource = Helpers.CreateAbilityResource(prefix + "PhantasmagoricDisplay", "", "", "", null);

                resource.SetFixedResource(3);

                var ability = library.CopyAndAdd <BlueprintAbility>("b22fd434bdb60fb4ba1068206402c4cf", prefix + "HeavensPrismaticSprayAbility", "");

                ability.Type = AbilityType.SpellLike;

                ability.RemoveComponents <SpellListComponent>();
                ability.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClasses(hex_engine.hex_classes, primary_stat));
                ability.AddComponent(Helpers.CreateResourceLogic(resource));

                true_spirit_ability = Helpers.CreateFeature(prefix + "HeavensPrismaticSprayFeature",
                                                            "Phantasmagoric Display",
                                                            "Shaman can use Prismatic Spray spell 3 times per day as spell-like ability.",
                                                            "",
                                                            ability.Icon,
                                                            FeatureGroup.None,
                                                            Helpers.CreateAddFact(ability),
                                                            Helpers.CreateAddAbilityResource(resource)
                                                            );
            }
Ejemplo n.º 3
0
        static BlueprintArchetype CreateSeeker(BlueprintFeatureSelection revelation, BlueprintFeature mysteryClassSkills)
        {
            var seeker = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "SeekerOracleArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Seeker");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description",
                                                              "Oracles gain their magical powers through strange and mysterious ways, be they chosen by fate or blood. While most might be content with their strange powers, some oracles join the Pathfinders specifically to find out more about their mysteries and determine the genesis and history of their eldritch talents. These spellcasters are known among the Spells as seekers, after their obsession with researching ancient texts and obscure ruins for any clues they can find about their heritage and histories.");
            });

            Helpers.SetField(seeker, "m_ParentClass", oracle);
            library.AddAsset(seeker, "15c95e56e3414c089b624b50c18127a0");
            seeker.RemoveFeatures = new LevelEntry[] {
                Helpers.LevelEntry(1, mysteryClassSkills),
                Helpers.LevelEntry(3, revelation),
                Helpers.LevelEntry(15, revelation),
            };
            seeker.AddFeatures = new LevelEntry[] {
                Helpers.LevelEntry(1, CreateSeekerTinkering()),
                Helpers.LevelEntry(3, CreateSeekerLore()),
                Helpers.LevelEntry(15, CreateSeekerMagic()),
            };
            return(seeker);
        }
        static BlueprintFeature CreateHeritageFeat(
            BlueprintProgression bloodline, BlueprintFeature power, int powerLevel,
            String name, String displayName, Sprite icon, String assetId,
            List <BlueprintComponent> components)
        {
            var entries     = CollectLevelEntries(powerLevel, power, bloodline);
            var description = bloodline.Description + $"\n{power.Description}";

            if (entries.Count == 1)
            {
                var feat = library.CopyAndAdd(power, name, assetId);
                feat.Groups = new FeatureGroup[] { FeatureGroup.Feat };
                feat.SetNameDescriptionIcon(displayName, description, icon);
                if (feat is BlueprintFeatureSelection)
                {
                    feat.AddComponents(components);
                }
                else
                {
                    components.Add(feat.CreateAddFact());
                    feat.SetComponents(components);
                }
                return(feat);
            }
            else
            {
                var feat = Helpers.CreateFeature(name, displayName, description, assetId, icon, FeatureGroup.Feat);
                for (int i = 0; i < entries.Count; i++)
                {
                    var e = entries[i];
                    components.Add(AddFactOnBloodlineLevel.Create(e.Item2, $"${i}", e.Item1));
                }
                feat.SetComponents(components);
                return(feat);
            }
        }
Ejemplo n.º 5
0
        static void createVanishingTrickAndInvisibleBlade()
        {
            var invisibility_buff          = library.Get <BlueprintBuff>("525f980cb29bc2240b93e953974cb325");
            var improved_invisibility_buff = library.Get <BlueprintBuff>("e6b35473a237a6045969253beb09777c");

            invisible_blade = Helpers.CreateFeature("NinjaInvisibleBladeFeature",
                                                    "Invisible Blade",
                                                    "Whenever a ninja uses the vanishing trick ninja trick, she is treated as if she were under the effects of greater invisibility.",
                                                    "",
                                                    improved_invisibility_buff.Icon,
                                                    FeatureGroup.None);

            var apply_invisibility          = Common.createContextActionApplyBuff(invisibility_buff, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default)), dispellable: false);
            var apply_invisibility_improved = Common.createContextActionApplyBuff(improved_invisibility_buff, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default)), dispellable: false);

            var action = Helpers.CreateConditional(Common.createContextConditionHasFact(invisible_blade), apply_invisibility_improved, apply_invisibility);

            var ability = Helpers.CreateAbility("NinjaVanishingTrickAbility",
                                                "Vanishing Trick",
                                                "As a swift action, the ninja can disappear for 1 round per level. This ability functions as invisibility. Using this ability uses up 1 ki point.",
                                                "",
                                                invisibility_buff.Icon,
                                                AbilityType.Supernatural,
                                                CommandType.Swift,
                                                AbilityRange.Personal,
                                                Helpers.roundsPerLevelDuration,
                                                "",
                                                Helpers.CreateRunActions(action),
                                                Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, classes: getRogueArray(), progression: ContextRankProgression.AsIs),
                                                ki_resource.CreateResourceLogic()
                                                );

            ability.setMiscAbilityParametersSelfOnly();
            vanishing_trick = Common.AbilityToFeature(ability, false);
            invisible_blade.AddComponent(Helpers.PrerequisiteFeature(vanishing_trick));
        }
Ejemplo n.º 6
0
            void createManifestation()
            {
                var conditions = SpellDescriptor.Bleed | SpellDescriptor.Death | SpellDescriptor.Exhausted | SpellDescriptor.Fatigue | SpellDescriptor.Nauseated | SpellDescriptor.Sickened;

                manifestation = Helpers.CreateFeature(prefix + "LifeManifestation",
                                                      "Manifestation",
                                                      "Upon reaching 20th level, the shaman becomes a perfect channel for life energy. She gains immunity to bleed, death attacks, and negative energy, as well as to the exhausted, fatigued, nauseated, and sickened conditions. Ability damage and drain cannot reduce her to below 1 in any ability score. She also receives diehard feat for free.",
                                                      "",
                                                      Helpers.GetIcon("be2062d6d85f4634ea4f26e9e858c3b8"), // cleanse
                                                      FeatureGroup.None,
                                                      Common.createBuffDescriptorImmunity(conditions),
                                                      Common.createSpellImmunityToSpellDescriptor(conditions),
                                                      UnitCondition.Exhausted.CreateImmunity(),
                                                      UnitCondition.Fatigued.CreateImmunity(),
                                                      UnitCondition.Nauseated.CreateImmunity(),
                                                      UnitCondition.Paralyzed.CreateImmunity(),
                                                      UnitCondition.Sickened.CreateImmunity(),
                                                      Helpers.Create <AddImmunityToEnergyDrain>(),
                                                      Helpers.Create <HealingMechanics.StatsCannotBeReducedBelow1>(),
                                                      Common.createAddFeatureIfHasFact(library.Get <BlueprintFeature>("c99f3405d1ef79049bd90678a666e1d7"), //diehard
                                                                                       library.Get <BlueprintFeature>("86669ce8759f9d7478565db69b8c19ad"),
                                                                                       not: true)
                                                      );
            }
        private static void createSharedSpellFeat()
        {
            bonded_mind_feat = Helpers.CreateFeature("BindedMindFeat",
                                                     "Bonded Mind",
                                                     "You and your partner are so close that you can almost read each other’s minds. You can be target of the spells with range of Personal of any of your companions who have Share Spells feat.",
                                                     "",
                                                     LoadIcons.Image2Sprite.Create(@"FeatIcons/Icon_Bonded_Mind.png"),
                                                     FeatureGroup.Feat);
            bonded_mind_feat.Groups = new FeatureGroup[] { FeatureGroup.Feat, FeatureGroup.TeamworkFeat };
            share_spells_feat       = Helpers.CreateFeature("SharedSpellFeat",
                                                            "Share Spells",
                                                            "You can cast a spell with a range of Personal on an ally as a touch spell, as per the share spells familiar ability, so long as the ally possesses the Bonded Mind feat.",
                                                            "",
                                                            LoadIcons.Image2Sprite.Create(@"FeatIcons/Icon_Share_Spells.png"),
                                                            FeatureGroup.Feat,
                                                            Helpers.PrerequisiteFeature(bonded_mind_feat),
                                                            Helpers.PrerequisiteFeaturesFromList(new BlueprintFeature[] { ac_share_spell, familiar_share_spell }, true)
                                                            );
            share_spells_feat.Groups = new FeatureGroup[] { FeatureGroup.Feat, FeatureGroup.TeamworkFeat };
            library.AddFeats(bonded_mind_feat, share_spells_feat);

            //add these teamwork feats to feat sharing feats
            Common.addTemworkFeats(bonded_mind_feat, share_spells_feat);
        }
        static BlueprintFeature CreateMagusArcanaMetamagic(BlueprintFeature metamagicFeat, int requiredLevel)
        {
            var metamagic = metamagicFeat.GetComponent <AddMetamagicFeat>().Metamagic;
            var name      = metamagic.ToString();

            name += name.EndsWith("e") ? "d" : "ed";
            var feat = Helpers.CreateFeature($"Magus{name}Magic", $"{name} 奥秘",
                                             $"魔战士每天可以释放一个法术,就像它被 {metamagic} 超魔专长调整过一样. " +
                                             (metamagic == Metamagic.Quicken
                    ? "这不会增加法术的环级."
                    : "这不会增加法术的施法时间和环级."),
                                             Helpers.MergeIds(metamagicFeat.AssetGuid, "65768d69b6b84954b3d6a1d1dc265cf8"),
                                             metamagicFeat.Icon,
                                             FeatureGroup.MagusArcana);

            var resource = Helpers.CreateAbilityResource($"{feat.name}Resource", "", "",
                                                         Helpers.MergeIds(metamagicFeat.AssetGuid, "d7183ba98b094f8295181c9946319773"), null);

            resource.SetFixedResource(1);

            var buff = Helpers.CreateBuff($"{feat.name}Buff", feat.Name, feat.Description,
                                          Helpers.MergeIds(metamagicFeat.AssetGuid, "e1b0f16092b7411aa7789cc598e232da"), feat.Icon, null,
                                          Helpers.Create <MetamagicOnNextSpellFixed>(m => m.Metamagic = metamagic));

            var ability = Helpers.CreateAbility($"{feat.name}Ability", feat.Name, feat.Description,
                                                Helpers.MergeIds(metamagicFeat.AssetGuid, "2c79573d82754a178b7767d9c51bd247"), feat.Icon,
                                                AbilityType.Supernatural, CommandType.Free, AbilityRange.Personal, "", "",
                                                resource.CreateResourceLogic(),
                                                Helpers.CreateRunActions(Helpers.CreateApplyBuff(buff,
                                                                                                 Helpers.CreateContextDuration(1), permanent: true, fromSpell: false, dispellable: false, toCaster: true)));

            feat.SetComponents(magus.PrerequisiteClassLevel(requiredLevel),
                               resource.CreateAddAbilityResource(), ability.CreateAddFact());

            return(feat);
        }
Ejemplo n.º 9
0
        // work on hold! does not work as intended; composite blasts are not granted, simple blasts are not granted, or other issues
        static public void createExpandElementalFocus()
        {
            var expand_element_selection = Helpers.CreateFeatureSelection(
                "ExpandElementalFocus",
                "Expand Elemental Focus",
                "You learn to use another element. You can select any element and gain one of that element’s simple blast wild talents that you do not already possess.",
                "0e2aa6b75b334b019fbfa7375ecaca85",
                elemental_focus.Icon,   //ElementalFocusSelection.Icon
                FeatureGroup.Feat,
                kineticist_class.PrerequisiteClassLevel(1, true)
                );

            expand_element_selection.AllFeatures = new BlueprintFeature[6];
            //expand_element_selection.AllFeatures[0] = library.Get<BlueprintProgression>("6f1d86ae43adf1049834457ce5264003");  //AirBlastProgression
            //expand_element_selection.AllFeatures[1] = library.Get<BlueprintProgression>("e4027e0fec48e8048a172c6627d4eba9");  //WaterBlastProgression
            //expand_element_selection.AllFeatures[2] = library.Get<BlueprintProgression>("dbb1159b0e8137c4ea20434a854ae6a8");  //ColdBlastProgression
            //expand_element_selection.AllFeatures[3] = library.Get<BlueprintProgression>("fbed3ca8c0d89124ebb3299ccf68c439");  //FireBlastProgression
            //expand_element_selection.AllFeatures[4] = library.Get<BlueprintProgression>("d945ac76fc6a06e44b890252824db30a");  //EarthBlastProgression
            //expand_element_selection.AllFeatures[5] = library.Get<BlueprintProgression>("ba7767cb03f7f3949ad08bd3ff8a646f");  //ElectricBlastProgression

            expand_element_selection.AllFeatures = library.Get <BlueprintFeatureSelection>("4204bc10b3d5db440b1f52f0c375848b").AllFeatures;    //SecondatyElementalFocusSelection
            foreach (BlueprintProgression focus_selection in expand_element_selection.AllFeatures)
            {
                //focus_selection.LevelEntries[0].Level = 1;
                foreach (var entry in focus_selection.LevelEntries)
                {
                    entry.Level = 1;
                }
            }

            BlueprintFeature expand_element_feat = expand_element_selection;

            expand_element_feat.Ranks  = 1;
            expand_element_feat.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            library.AddFeats(expand_element_feat);
        }
        static void createKineticChirurgery()
        {
            var elemental_focus = library.Get <BlueprintFeatureSelection>("1f3a15a3ae8a5524ab8b97f469bf4e3d");                //to be able to pick talents
            var kinetic_knight_elemental_focus = library.Get <BlueprintFeatureSelection>("b1f296f0bd16bc242ae35d0638df82eb"); //to be able to pick talents
            var water = library.Get <BlueprintFeature>("7ab8947ce2e19c44a9edcf5fd1466686");
            var kinetic_knight_water = library.Get <BlueprintFeature>("5e839c743c6da6649a43cdeb70b6018f");
            var kinetic_healer       = library.Get <BlueprintFeature>("3ef666973adfa8f40af6c0679bd98ba5");

            kinetic_chirurgery = Helpers.CreateFeature("KineticChirurgeryFeature",
                                                       "Kinetic Chirurgery",
                                                       "A kinetic chirurgeon must select water as her primary element. She gains kinetic healer as a bonus wild talent at 1st level.",
                                                       "",
                                                       Helpers.GetIcon("3ef666973adfa8f40af6c0679bd98ba5"),
                                                       FeatureGroup.None,
                                                       Helpers.CreateAddFacts(kinetic_healer)
                                                       );

            foreach (var e in elemental_focus.AllFeatures)
            {
                if (e == water)
                {
                    continue;
                }
                e.AddComponent(Common.prerequisiteNoArchetype(archetype.GetParentClass(), archetype));
            }


            foreach (var e in kinetic_knight_elemental_focus.AllFeatures)
            {
                if (e == kinetic_knight_water)
                {
                    continue;
                }
                e.AddComponent(Common.prerequisiteNoArchetype(archetype.GetParentClass(), archetype));
            }
        }
Ejemplo n.º 11
0
        static void FixBloodlinePrerequisite(BlueprintFeature feat)
        {
            var components = feat.ComponentsArray.Where(c => !(c is PrerequisiteFeature || c is PrerequisiteFeaturesFromList)).ToList();

            foreach (var p in feat.GetComponents <PrerequisiteFeature>())
            {
                BlueprintProgression crossbloodline;
                if (crossbloodForBloodline.TryGetValue(p.Feature as BlueprintProgression, out crossbloodline))
                {
                    var prereq = Helpers.PrerequisiteFeaturesFromList(p.Feature, crossbloodline);
                    prereq.Group = p.Group;
                    components.Add(prereq);
                }
                else
                {
                    components.Add(p);
                }
            }
            foreach (var prereq in feat.GetComponents <PrerequisiteFeaturesFromList>().ToList())
            {
                var features = prereq.Features.ToList();
                foreach (var f in prereq.Features)
                {
                    BlueprintProgression crossbloodline;
                    if (crossbloodForBloodline.TryGetValue(f as BlueprintProgression, out crossbloodline))
                    {
                        //crossbloodline
                        features.Add(crossbloodline);
                    }
                }
                var newPrereq = Helpers.PrerequisiteFeaturesFromList(features);
                newPrereq.Group = prereq.Group;
                components.Add(newPrereq);
            }
            feat.SetComponents(components);
        }
Ejemplo n.º 12
0
            static void createTrueSpiritAbility()
            {
                var resource = Helpers.CreateAbilityResource("ShamanStoneElementalFormResource", "", "", "", null);

                resource.SetFixedResource(1);

                var buff = library.CopyAndAdd <BlueprintBuff>("f0826c3794c158c4cbbe9ceb4210d6d6", "ShamanStoneElementalFormBuff", "");

                buff.SetName("Elemental Form (Huge Earth Elemental)");

                var ability = library.CopyAndAdd <BlueprintAbility>("e49d2cde42f25e546826600d11b4833e", "ShamanStoneElementalFormAbility", "");

                ability.ReplaceComponent <ContextRankConfig>(c => Helpers.SetField(c, "m_Class", getShamanArray()));
                ability.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = resource);
                ability.ReplaceComponent <AbilityTargetHasFact>(a => a.CheckedFacts     = new BlueprintUnitFact[] { buff });
                ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions        = Helpers.CreateActionList(Common.changeAction <ContextActionApplyBuff>(a.Actions.Actions,
                                                                                                                                                                b => b.Buff = buff)
                                                                                                                   )
                                                                  );
                ability.SetName("Elemental Form (Huge Earth Elemental)");
                true_spirit_ability = Common.AbilityToFeature(ability, false);
                true_spirit_ability.SetDescription(Helpers.CreateString(true_spirit_ability.name + "2.Description", "As a standard action, the shaman assumes the form of a Huge (or smaller) earth elemental, as elemental body IV with a duration of 1 hour per level. The shaman can use this ability once per day."));
                true_spirit_ability.AddComponent(Helpers.CreateAddAbilityResource(resource));
            }
Ejemplo n.º 13
0
        static void createArrowSongStrike()
        {
            var bard_class       = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var add_spell_combat = Helpers.Create <AddMagusMechanicPart>(); //needed for unit_part magus creation (no actual ability though)

            Helpers.SetField(add_spell_combat, "m_Feature", 1);
            Helpers.SetField(add_spell_combat, "m_MagusClass", bard_class);

            var add_eldritch_archer = Helpers.Create <AddMagusMechanicPart>();

            Helpers.SetField(add_eldritch_archer, "m_Feature", 5);

            var add_spellstrike = Helpers.Create <AddMagusMechanicPart>();

            Helpers.SetField(add_spellstrike, "m_Feature", 2);

            var spellstrike = library.CopyAndAdd <BlueprintActivatableAbility>("e958891ef90f7e142a941c06c811181e", "ArrowsongMinstrelSpellstrike", "");

            spellstrike.SetName("Arrowsong Strike");
            spellstrike.SetDescription("At 6th level, an Arrowsong minstrel can use spellstrike (as per the magus class feature) to cast a single-target ranged touch attack spell and deliver it through a ranged weapon attack.");
            spellstrike.SetIcon(NewSpells.flame_arrow.Icon);
            arrowsong_strike = Common.ActivatableAbilityToFeature(spellstrike, false);
            arrowsong_strike.AddComponents(add_spell_combat, add_eldritch_archer, add_spellstrike);
        }
Ejemplo n.º 14
0
        static void createSolarInvocation()
        {
            solar_invocation_resource = Helpers.CreateAbilityResource("SolarInvocationResource", "", "", "", null);
            solar_invocation_resource.SetIncreasedByLevel(0, 2, getDawnflowerAcnchoriteArray());
            solar_invocation_resource.SetIncreasedByStat(0, StatType.Charisma);

            bask_in_radiance = Helpers.CreateFeature("BaskInRadianceFeature",
                                                     "Bask in Radiance",
                                                     "At 3rd level, when a Dawnflower anchorite uses his solar invocation ability, he can designate any number of allies within 30 feet to gain the bonuses granted by solar invocation for as long as he maintains the ability.",
                                                     "",
                                                     Helpers.GetIcon("0d657aa811b310e4bbd8586e60156a2d"), //cure critical wounds
                                                     FeatureGroup.None
                                                     );

            var icon = LoadIcons.Image2Sprite.Create(@"AbilityIcons/FontOfSpiritMagic.png");

            var effect_buff = Helpers.CreateBuff("SolarInvocationEffectBuff",
                                                 "Solar Invocation",
                                                 "A Dawnflower anchorite can harness the sun’s life-giving warmth to protect the innocent and smite the wicked. At 1st level, he can invoke the sun as a standard action, granting him a +1 competence bonus on attack rolls and damage rolls against evil creatures and adding 1 to the DC of his spells and spell-like abilities against evil creatures. The bonus on attack rolls and damage rolls increases to +2 at 5th level and +3 at 9th level. If a Dawnflower anchorite has an animal companion, the companion also gains the competence bonus on attack and damage rolls while this ability is active.\n"
                                                 + "A Dawnflower anchorite can invoke the sun for a number of rounds per day equal to twice his Dawnflower anchorite class level + his Charisma modifier. Maintaining this ability on subsequent rounds is a free action. These bonuses apply only when the Dawnflower anchorite is standing in an outdoor area.\n",
                                                 "",
                                                 icon,
                                                 null,
                                                 Helpers.Create <NewMechanics.AttackBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Competence; a.alignment = AlignmentComponent.Evil; }),
                                                 Helpers.Create <NewMechanics.SpellsDCBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.StatBonus); a.descriptor = ModifierDescriptor.UntypedStackable; a.alignment = AlignmentComponent.Evil; }),
                                                 Helpers.Create <NewMechanics.DamageBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Competence; a.alignment = AlignmentComponent.Evil; })
                                                 );

            var defense_effect_buff = Helpers.CreateBuff("SolarDefenseEffectBuff",
                                                         "Solar Defense",
                                                         "While using solar invocation, the Dawnflower anchorite adds his competence bonus on attack rolls to his Armor Class as a dodge bonus and to Reflex saving throws as a sacred bonus against evil creatures. The Dawnflower anchorite can select this credence twice—the second time he does so, the bonus to Armor Class and on Ref lex saves also applies to any companions who gain bonuses from the Dawnflower anchorite’s solar invocation.",
                                                         "",
                                                         Helpers.GetIcon("62888999171921e4dafb46de83f4d67d"), //shield of dawn
                                                         null,
                                                         Helpers.Create <NewMechanics.ArmorClassBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Dodge; a.alignment = AlignmentComponent.Evil; }),
                                                         Helpers.Create <NewMechanics.ContextSavingThrowBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Sacred; a.alignment = AlignmentComponent.Evil; a.save_type = SavingThrowType.Reflex; })
                                                         );

            solar_defense = Helpers.CreateFeature("SolarDefenseFeature",
                                                  "Solar Defense I",
                                                  defense_effect_buff.Description,
                                                  "",
                                                  defense_effect_buff.Icon,
                                                  FeatureGroup.None
                                                  );

            solar_defense2 = Helpers.CreateFeature("SolarDefense2Feature",
                                                   "Solar Defense II",
                                                   defense_effect_buff.Description,
                                                   "",
                                                   defense_effect_buff.Icon,
                                                   FeatureGroup.None,
                                                   Helpers.PrerequisiteFeature(solar_defense)
                                                   );

            var flaming            = library.Get <BlueprintWeaponEnchantment>("30f90becaaac51f41bf56641966c4121");
            var solar_weapons_buff = Helpers.CreateBuff("SolarWeaponsEffectBuff",
                                                        "Solar Weapons",
                                                        "While using solar invocation, the Dawnflower anchorite grants the flaming weapon special ability to one weapon of each creature affected by the Dawnflower anchorite’s solar invocation.",
                                                        "",
                                                        LoadIcons.Image2Sprite.Create(@"AbilityIcons/FlameBlade.png"),
                                                        null,
                                                        Common.createBuffContextEnchantPrimaryHandWeapon(1, false, true, new BlueprintWeaponEnchantment[] { flaming })
                                                        );

            solar_weapons = Helpers.CreateFeature("SolarWeaponsFeature",
                                                  solar_weapons_buff.Name,
                                                  solar_weapons_buff.Description,
                                                  "",
                                                  solar_weapons_buff.Icon,
                                                  FeatureGroup.None
                                                  );

            var apply_solar_defense = Common.createContextActionApplyBuff(defense_effect_buff, Helpers.CreateContextDuration(), false, true, true, false);
            var apply_solar_weapons = Common.createContextActionApplyBuff(solar_weapons_buff, Helpers.CreateContextDuration(), false, true, true, false);

            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuffNoRemove(effect_buff,
                                                                                      Helpers.CreateConditional(Common.createContextConditionCasterHasFact(solar_weapons),
                                                                                                                apply_solar_weapons
                                                                                                                )
                                                                                      );
            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuffNoRemove(effect_buff,
                                                                                      Helpers.CreateConditional(Common.createContextConditionCasterHasFact(solar_defense),
                                                                                                                Helpers.CreateConditional(Helpers.CreateConditionsCheckerOr(Common.createContextConditionIsCaster(),
                                                                                                                                                                            Common.createContextConditionCasterHasFact(solar_defense2)
                                                                                                                                                                            ),
                                                                                                                                          apply_solar_defense)
                                                                                                                )
                                                                                      );
            var toggle = Common.createToggleAreaEffect(effect_buff, 30.Feet(),
                                                       Helpers.CreateConditionsCheckerOr(Common.createContextConditionIsCaster(),
                                                                                         Helpers.Create <CompanionMechanics.ContextConditionIsPet>(),
                                                                                         Helpers.Create <NewMechanics.ContextConditionIsAllyAndCasterHasFact>(c => c.fact = bask_in_radiance)
                                                                                         ),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("dfc59904273f7ee49ab00e5278d86e16"),
                                                       Common.createPrefabLink("9353083f430e5a44a8e9d6e26faec248")
                                                       );

            toggle.AddComponents(solar_invocation_resource.CreateActivatableResourceLogic(ResourceSpendType.NewRound));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            toggle.Buff.SetBuffFlags(BuffFlags.HiddenInUi);
            toggle.Group     = ActivatableAbilityGroupExtension.SolarInvocation.ToActivatableAbilityGroup();
            solar_invocation = Common.ActivatableAbilityToFeature(toggle, false);
            solar_invocation.AddComponents(solar_invocation_resource.CreateAddAbilityResource());

            solar_invocation2 = SaveGameFix.createDummyFeature("SolarInvocation2Feature", "");
            solar_invocation3 = SaveGameFix.createDummyFeature("SolarInvocation3Feature", "");
            var solar_invocation4 = SaveGameFix.createDummyFeature("SolarInvocation4Feature", "");

            solar_invocation2.HideInCharacterSheetAndLevelUp = true;
            solar_invocation2.HideInUI = true;
            solar_invocation3.HideInCharacterSheetAndLevelUp = true;
            solar_invocation3.HideInUI = true;
            solar_invocation4.HideInCharacterSheetAndLevelUp = true;
            solar_invocation4.HideInUI = true;
            solar_invocation.AddComponents(Helpers.CreateAddFeatureOnClassLevel(solar_invocation2, 5, getDawnflowerAcnchoriteArray()),
                                           Helpers.CreateAddFeatureOnClassLevel(solar_invocation3, 9, getDawnflowerAcnchoriteArray()));

            //add scaling to buffs and dawnflower invocation

            var dawnflower_invocation_buff = Helpers.CreateBuff("DawnflowerInvocationBuff",
                                                                "Dawnflower Invocation",
                                                                "At 10th level, a Dawnflower anchorite is able to, once per day, use his solar invocation ability for 1 minute. The Dawnflower anchorite can also use this ability indoors or underground. While using Dawnflower invocation, all bonuses gained from solar invocation increase by 1. Using this ability doesn’t cost rounds per day of solar invocation.",
                                                                "",
                                                                Helpers.GetIcon("e67efd8c84f69d24ab472c9f546fff7e"),
                                                                null,
                                                                Helpers.CreateAddFactContextActions(activated: Common.createContextActionApplyBuff(toggle.Buff, Helpers.CreateContextDuration(), false, true, true, false)),
                                                                Helpers.CreateAddFact(solar_invocation4)
                                                                );

            var dawnflower_invocation_resource = Helpers.CreateAbilityResource("DawnflowerInvocationResource", "", "", "", null);

            dawnflower_invocation_resource.SetFixedResource(1);
            var dawnflower_invocation_ability = Helpers.CreateAbility("DawnflowerInvocationAbility",
                                                                      dawnflower_invocation_buff.Name,
                                                                      dawnflower_invocation_buff.Description,
                                                                      "",
                                                                      dawnflower_invocation_buff.Icon,
                                                                      AbilityType.Supernatural,
                                                                      CommandType.Swift,
                                                                      AbilityRange.Personal,
                                                                      Helpers.oneMinuteDuration,
                                                                      "",
                                                                      Helpers.CreateRunActions(Common.createContextActionApplyBuff(dawnflower_invocation_buff, Helpers.CreateContextDuration(1, DurationRate.Minutes), dispellable: false)),
                                                                      Common.createAbilitySpawnFx("52d413df527f9fa4a8cf5391fd593edd", anchor: AbilitySpawnFxAnchor.SelectedTarget, position_anchor: AbilitySpawnFxAnchor.None, orientation_anchor: AbilitySpawnFxAnchor.None),
                                                                      dawnflower_invocation_resource.CreateResourceLogic()
                                                                      );

            dawnflower_invocation_ability.setMiscAbilityParametersSelfOnly();
            dawnflower_invocation = Common.AbilityToFeature(dawnflower_invocation_ability, false);
            dawnflower_invocation.AddComponent(dawnflower_invocation_resource.CreateAddAbilityResource());

            toggle.AddComponent(Common.createActivatableAbilityRestrictionHasFact(dawnflower_invocation_buff, not: true));
            var config = Helpers.CreateContextRankConfig(ContextRankBaseValueType.FeatureList,
                                                         featureList: new BlueprintFeature[] { solar_invocation, solar_invocation2, solar_invocation3, solar_invocation4 }
                                                         );
            var config2 = Helpers.CreateContextRankConfig(ContextRankBaseValueType.FeatureList, type: AbilityRankType.StatBonus,
                                                          featureList: new BlueprintFeature[] { solar_invocation, solar_invocation4 }
                                                          );

            effect_buff.AddComponents(config, config2);
            defense_effect_buff.AddComponent(config);

            solar_invocation_move_action = Helpers.CreateFeature("SolarInvocationMoveActionFeature",
                                                                 "Solar Invocation: Move Action",
                                                                 "At 5th level, a Dawnflower anchorite can invoke the sun as a move action instead of a standard action. At 10th level, he can invoke the sun as a swift action.",
                                                                 "",
                                                                 Helpers.GetIcon("03a9630394d10164a9410882d31572f0"), //aid
                                                                 FeatureGroup.None,
                                                                 Helpers.Create <ActivatableAbilityActionTypeModierMechanics.ModifyActivatableAbilityGroupActionType>(m =>
            {
                m.group  = ActivatableAbilityGroupExtension.SolarInvocation.ToActivatableAbilityGroup();
                m.action = CommandType.Move;
            }
                                                                                                                                                                      )
                                                                 );
            solar_invocation_swift_action = library.CopyAndAdd(solar_invocation_move_action, "SolarInvocationSwiftActionFeature", "");
            solar_invocation_swift_action.SetName("Solar Invocation: Swift Action");
            solar_invocation_swift_action.ReplaceComponent <ActivatableAbilityActionTypeModierMechanics.ModifyActivatableAbilityGroupActionType>(m => m.action = CommandType.Swift);

            divine_light = Helpers.CreateFeature("DivineLightFeature",
                                                 "Divine Light",
                                                 "The Dawnflower anchorite can use solar invocation indoors or underground. He can use solar invocation 2 additional rounds per day.",
                                                 "",
                                                 Helpers.GetIcon("be2062d6d85f4634ea4f26e9e858c3b8"), //cleanse
                                                 FeatureGroup.None,
                                                 Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = solar_invocation_resource; i.Value = 2; })
                                                 );

            toggle.AddComponent(Helpers.Create <NewMechanics.OutdoorsUnlessHasFact>(o => o.fact = divine_light));
        }
Ejemplo n.º 15
0
        static void createUltimateVindication()
        {
            var disintegrate = library.CopyAndAdd <BlueprintAbility>("4aa7942c3e62a164387a73184bca3fc1", "UltimateVindicationDisintegrateAbility", "");

            disintegrate.RemoveComponents <SpellListComponent>();
            disintegrate.RemoveComponents <AbilityDeliverProjectile>();
            disintegrate.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClass(vindicative_bastard_class, StatType.Charisma));
            disintegrate.Type = AbilityType.Supernatural;

            var buff_cooldown = Helpers.CreateBuff("UltimateVindicationDisintegrateCooldownBuff",
                                                   "Ultimate Vindication Cooldown",
                                                   "",
                                                   "",
                                                   disintegrate.Icon,
                                                   null);

            var apply_cooldown = Common.createContextActionApplyBuff(buff_cooldown, Helpers.CreateContextDuration(1, DurationRate.Days), dispellable: false);

            disintegrate.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(a.Actions.Actions.AddToArray(apply_cooldown)));


            var buff_allowed = Helpers.CreateBuff("UltimateVindicationDisintegrateAllowedBuff",
                                                  "Ultimate Vindication Allowed",
                                                  "",
                                                  "",
                                                  disintegrate.Icon,
                                                  null);

            var hit_effect = Helpers.CreateConditional(new Condition[] { Helpers.CreateConditionHasBuff(buff_allowed), Common.createContextConditionHasBuffFromCaster(buff_cooldown, true) },
                                                       Helpers.Create <ContextActionCastSpell>(c => c.Spell = disintegrate)
                                                       );

            ultimate_vindication = Helpers.CreateFeature("UltimateVindicationFeature",
                                                         "Ultimate Vindication",
                                                         "At 20th level, if a foe knocks vindictive bastard or one of a vindictive bastard’s allies unconscious, the vindictive bastard musters a vindictive fury. The next time she hits that foe within 1 minute, the vindictive bastard can channel the effects of a disintegrate spell through her weapon, using her paladin level as her effective caster level.\n"
                                                         + " Whether or not the target succeeds at its save against the disintegrate effect, it is immune to this ability for the next 24 hours.",
                                                         "",
                                                         disintegrate.Icon,
                                                         FeatureGroup.None,
                                                         Common.createAddInitiatorAttackWithWeaponTrigger(Helpers.CreateActionList(hit_effect))
                                                         );


            var apply_allowed = Common.createContextActionApplyBuff(buff_allowed, Helpers.CreateContextDuration(1, DurationRate.Minutes), dispellable: false);

            GameAction trigger = apply_allowed;

            if (!test_mode)
            {
                trigger = Helpers.CreateConditional(Helpers.Create <ContextConditionIsEnemy>(), trigger);
            }

            var ultimate_vindication_trigger = Helpers.CreateBuff("UltimateVindicationTriggerBuff",
                                                                  "",
                                                                  "",
                                                                  "",
                                                                  null,
                                                                  null,
                                                                  Helpers.Create <NewMechanics.AddIncomingDamageTriggerOnAttacker>(c =>
                                                                                                                                   { c.Actions = Helpers.CreateActionList(trigger); c.reduce_below0 = true; })
                                                                  );

            ultimate_vindication_trigger.SetBuffFlags(BuffFlags.HiddenInUi);

            var ultimate_vindication_trigger_area = library.CopyAndAdd <BlueprintAbilityAreaEffect>("7ced0efa297bd5142ab749f6e33b112b", "UltimateVindicationTriggerArea", "");

            ultimate_vindication_trigger_area.Size = 100.Feet();
            ultimate_vindication_trigger_area.ReplaceComponent <AbilityAreaEffectBuff>(a => a.Buff = ultimate_vindication_trigger);

            var ultimate_vindication_area_buff = library.CopyAndAdd <BlueprintBuff>("c96380f6dcac83c45acdb698ae70ffc4", "UltimateVindicationTriggerAreaBuff", "");

            ultimate_vindication_area_buff.ReplaceComponent <AddAreaEffect>(a => a.AreaEffect = ultimate_vindication_trigger_area);

            ultimate_vindication.AddComponent(Common.createAuraFeatureComponent(ultimate_vindication_area_buff));
        }
Ejemplo n.º 16
0
 static void createStalwart()
 {
     stalwart = library.Get <BlueprintFeature>("ec9dbc9a5fa26e446a54fe5df6779088");
     stalwart.SetDescription("A character can use mental and physical resiliency to avoid certain attacks. If she makes a Fortitude or Will saving throw against an attack that has a halved damage on a successful save, she instead avoids the damage entirely.");
 }
Ejemplo n.º 17
0
        static void createVindicativeSmite()
        {
            vindicative_smite_buff = library.CopyAndAdd <BlueprintBuff>("b6570b8cbb32eaf4ca8255d0ec3310b0", "VindicativeSmiteBuff", "");
            vindicative_smite_buff.SetName("Vindictive Smite");
            vindicative_smite_buff.RemoveComponents <IgnoreTargetDR>();

            Common.addConditionToResoundingBlow(Common.createContextConditionHasBuffFromCaster(vindicative_smite_buff));


            var vindicative_smite_allowed = Helpers.CreateBuff("VindicativeSmiteAllowedBuff",
                                                               "Vindictive Smite Allowed",
                                                               "",
                                                               "",
                                                               vindicative_smite_buff.Icon,
                                                               null);

            vindicative_smite_allowed.SetBuffFlags(BuffFlags.RemoveOnRest);


            vindicative_smite_ability = library.CopyAndAdd <BlueprintAbility>("7bb9eb2042e67bf489ccd1374423cdec", "VindicativeSmiteAbility", "");
            vindicative_smite_ability.SetName(vindicative_smite_buff.Name);
            vindicative_smite_ability.SetDescription("A vindictive bastard is particularly ruthless against those who have harmed her or her allies. Once per day as a swift action, she can smite one target within sight who has dealt hit point damage to her or an ally. She adds her Charisma modifier to her attack rolls and adds her paladin level to damage rolls against the target of her smite. In addition, while vindictive smite is in effect, the vindictive bastard gains a deflection bonus equal to her Charisma bonus (if any) to her AC against attacks by the target of the smite.\n"
                                                     + "The vindictive smite effect remains until the target of the smite is dead or the next time the vindictive bastard rests and regains her uses of this ability. At 4th level and every 3 levels thereafter, the vindictive bastard can invoke her vindictive smite one additional time per day, to a maximum of seven times per day at 19th level.");

            vindicative_smite_ability.ReplaceComponent <AbilityCasterAlignment>(Common.createAbilityTargetHasFact(false, vindicative_smite_allowed));
            vindicative_smite_ability.AddComponent(Common.createAbilityTargetHasFact(true, vindicative_smite_buff));

            var apply_buff = Common.createContextActionApplyBuff(vindicative_smite_buff, Helpers.CreateContextDuration(), is_permanent: true, dispellable: false);

            vindicative_smite_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(apply_buff));

            var config     = vindicative_smite_ability.GetComponents <ContextRankConfig>().Where(c => c.IsBasedOnClassLevel).FirstOrDefault();
            var new_config = config.CreateCopy();

            Helpers.SetField(new_config, "m_Class", getVindicativeBastardArray());
            vindicative_smite_ability.ReplaceComponent(config, new_config);

            var apply_allowed = Common.createContextActionApplyBuff(vindicative_smite_allowed, Helpers.CreateContextDuration(), is_permanent: true, dispellable: false);

            GameAction trigger = apply_allowed;

            if (!test_mode)
            {
                trigger = Helpers.CreateConditional(Helpers.Create <ContextConditionIsEnemy>(), trigger);
            }

            var vindicative_smite_trigger = Helpers.CreateBuff("VindicativeSmiteTriggerBuff",
                                                               "",
                                                               "",
                                                               "",
                                                               null,
                                                               null,
                                                               Helpers.Create <NewMechanics.AddIncomingDamageTriggerOnAttacker>(c => c.Actions = Helpers.CreateActionList(trigger))
                                                               );

            vindicative_smite_trigger.SetBuffFlags(BuffFlags.HiddenInUi);

            var vindicative_smite_trigger_area = library.CopyAndAdd <BlueprintAbilityAreaEffect>("7ced0efa297bd5142ab749f6e33b112b", "VindicativeSmiteTriggerArea", "");

            vindicative_smite_trigger_area.Size = 100.Feet();
            vindicative_smite_trigger_area.ReplaceComponent <AbilityAreaEffectBuff>(a => a.Buff = vindicative_smite_trigger);

            var vindicative_smite_area_buff = library.CopyAndAdd <BlueprintBuff>("c96380f6dcac83c45acdb698ae70ffc4", "VindicativeSmiteTriggerAreaBuff", "");

            vindicative_smite_area_buff.ReplaceComponent <AddAreaEffect>(a => a.AreaEffect = vindicative_smite_trigger_area);
            smite_resource = library.Get <BlueprintAbilityResource>("b4274c5bb0bf2ad4190eb7c44859048b");//smite_evil_resource

            vindicative_smite = Helpers.CreateFeature("VindicativeSmiteFeature",
                                                      vindicative_smite_ability.Name,
                                                      vindicative_smite_ability.Description,
                                                      "",
                                                      vindicative_smite_ability.Icon,
                                                      FeatureGroup.None,
                                                      Common.createAuraFeatureComponent(vindicative_smite_area_buff),
                                                      Helpers.CreateAddAbilityResource(smite_resource),
                                                      Helpers.CreateAddFact(vindicative_smite_ability)
                                                      );

            add_vindicative_smite_use = library.CopyAndAdd <BlueprintFeature>("0f5c99ffb9c084545bbbe960b825d137", "VindicativeSmiteAdditionalUse", "");
            add_vindicative_smite_use.SetName("Vindicative Smite - Additional Use");
            add_vindicative_smite_use.SetDescription(vindicative_smite.Description);
        }
Ejemplo n.º 18
0
        static void createFlurry()
        {
            flurry1 = Helpers.CreateFeature("ZenArcherFlurry1Feature",
                                            "Flurry of Blows",
                                            "Starting at 1st level, a zen archer can make a flurry of blows as a full-attack action, but only when using a bow (even though it is a ranged weapon). He may not make a flurry of blows with his unarmed attacks or any other weapons. A zen archer does not apply his Strength bonus on damage rolls made with flurry of blows unless he is using a composite bow with a Strength rating.\n"
                                            + "A zen archer’s flurry of blows otherwise functions as normal for a monk of his level. (One additional attack at highest base attack bonus. Stacks with bonus attacks from haste and other similar effects. At 11th level, one additional attack at highest base attack bonus).\n"
                                            + "A zen archer cannot use Rapid Shot or Manyshot when making a flurry of blows with his bow.",
                                            "",
                                            zen_archer_proficiencies.Icon,
                                            FeatureGroup.None);
            flurry11 = Helpers.CreateFeature("ZenArcherFlurry11Feature",
                                             flurry1.Name,
                                             flurry1.Description,
                                             "",
                                             zen_archer_proficiencies.Icon,
                                             FeatureGroup.None);

            var flurry_effect = Helpers.CreateFeature("ZenArcherFlurryEffectFeature",
                                                      flurry1.Name,
                                                      flurry1.Description,
                                                      "",
                                                      zen_archer_proficiencies.Icon,
                                                      FeatureGroup.None,
                                                      Helpers.Create <NewMechanics.BuffExtraAttackCategorySpecific>(b =>
            {
                b.categories  = new WeaponCategory[] { WeaponCategory.Longbow, WeaponCategory.Shortbow };
                b.num_attacks = Helpers.CreateContextValue(AbilityRankType.Default);
            }
                                                                                                                    ),
                                                      Helpers.CreateContextRankConfig(ContextRankBaseValueType.FeatureList, featureList: new BlueprintFeature[] { flurry1, flurry11 }),
                                                      Helpers.Create <FeatureMechanics.DeactivateManyshot>());

            flurry_effect.HideInCharacterSheetAndLevelUp = true;

            var buff = Helpers.CreateBuff("ZenArcherFlurryBuff",
                                          flurry11.Name,
                                          flurry1.Description,
                                          "",
                                          flurry1.Icon,
                                          null,
                                          Helpers.Create <MonkNoArmorFeatureUnlock>(m => m.NewFact = flurry_effect)
                                          );

            var ability = Helpers.CreateActivatableAbility("ZenArcherFlurryToggleAbility",
                                                           buff.Name,
                                                           buff.Description,
                                                           "",
                                                           buff.Icon,
                                                           buff,
                                                           AbilityActivationType.Immediately,
                                                           CommandType.Free,
                                                           null);

            ability.IsOnByDefault = true;
            ability.Group         = ActivatableAbilityGroupExtension.RapidShot.ToActivatableAbilityGroup();

            //fix rapid shot
            library.Get <BlueprintActivatableAbility>("90a77bfe25ec2e14caf8bd5cde9febf2").Group = ability.Group;

            flurry1.AddComponent(Helpers.CreateAddFact(ability));
        }
        public static BlueprintFeatureSelection CreateRegionalTraits()
        {
            var noFeature      = Helpers.PrerequisiteNoFeature(null);
            var regionalTraits = Helpers.CreateFeatureSelection("RegionalTrait", "Regional Trait",
                                                                "Regional traits are keyed to specific regions, be they large (such as a nation or geographic region) or small (such as a city or a specific mountain). In order to select a regional trait, your PC must have spent at least a year living in that region. At 1st level, you can only select one regional trait (typically the one tied to your character’s place of birth or homeland), despite the number of regions you might wish to write into your character’s background.",
                                                                "6158dd4ad2544c27bc3a9b48c2e8a2ca", null, FeatureGroup.None, noFeature);

            noFeature.Feature = regionalTraits;

            // TODO: more regional traits.

            // Note: use the generic feat names/text to let players RP this as they choose.
            var choices = new List <BlueprintFeature>();


            var signatureSpell = Helpers.CreateFeatureSelection("SignatureSpellTrait", "Signature Spell",
                                                                "You have learned a mystical secret that empowers your spellcasting.\nBenefit: Pick one spell when you choose this trait—from this point on, whenever you cast that spell, you do so at +1 caster level.",
                                                                "7a3dfe274f45432b85361bdbb0a3009b",
                                                                Helpers.GetIcon("fe9220cdc16e5f444a84d85d5fa8e3d5"), // Spell Specialization Progression
                                                                FeatureGroup.None,
                                                                Helpers.Create <IncreaseCasterLevelForSpell>());

            Traits.FillSpellSelection(signatureSpell, 1, 9, Helpers.Create <IncreaseCasterLevelForSpell>());
            choices.Add(signatureSpell);

            var metamagicApprentice = Helpers.CreateFeatureSelection("MetamagicApprenticeTrait", "Metamagic Master",
                                                                     "Your ability to alter your spell of choice is greater than expected.\nBenefit: Select one spell of 3rd level or below; when you use the chosen spell with a metamagic feat, it uses one spell slot one level lower than it normally would.\nstarting level is still minimun",
                                                                     "00844f940e434033ab826e5ff5930012",
                                                                     Helpers.GetIcon("ee7dc126939e4d9438357fbd5980d459"), // Spell Penetration
                                                                     FeatureGroup.None);

            Traits.FillSpellSelection(metamagicApprentice, 1, 3, Helpers.Create <ReduceMetamagicCostForSpell>(r => { r.Reduction = 1; r.MaxSpellLevel = 3; }));
            choices.Add(metamagicApprentice);


            choices.Add(Helpers.CreateFeature("BlightedTrait", "Blighted Physiology",
                                              "Exposure to corruption has altered your body causing you to sprout horrific growths beneath your skin." +
                                              "\nBenefit: You gain a +1 natural armor bonus to AC, but your body does not work as a normal creature’s would. Anytime you receive magical healing you heal 1 hp less per die.",
                                              "c50bdfaad65b4028884dd4a74f14e792",
                                              Image2Sprite.Create("Mods/EldritchArcana/sprites/anatomist.png"),
                                              FeatureGroup.None,
                                              Helpers.CreateAddStatBonus(StatType.AC, 1, ModifierDescriptor.NaturalArmor),
                                              Helpers.Create <FeyFoundlingLogic>(s => { s.dieModefier = -1; s.flatModefier = 0; })));

            choices.Add(Helpers.CreateFeature("WanderlustTrait", "Wanderlust",
                                              "Your childhood was brightened by the new places you constantly saw as you traveled with your parents, who were merchants. Still excited by travel, you gain great energy when traveling overland." +
                                              "\nBenefit: Treat your base land speed as 10 feet higher when determining your overland speed.",
                                              "d40bdfaad65b4028884dd4a74f14e793",
                                              Helpers.NiceIcons(0),
                                              FeatureGroup.None,
                                              Helpers.CreateAddStatBonus(StatType.Speed, 10, ModifierDescriptor.Insight)));



            var dagger = Traits.library.Get <BlueprintWeaponType>("07cc1a7fceaee5b42b3e43da960fe76d");

            var riverrat = Traits.CreateAddStatBonus("DaggerboyTrait", "River Rat (Marsh or River)",
                                                     "You learned to swim right after you learned to walk. When you were a youth, a gang of river pirates put you to work swimming in night-time rivers. And canals with a dagger between your teeth so you could sever the anchor ropes of merchant vessels. \n Benefit: You gain a +1 trait bonus on damage rolls with a dagger and a +1 trait bonus on Swim(atletics is class skill) checks. and you start with a dagger.",
                                                     "e16eb56b2f964321a29976226dccb39f",
                                                     StatType.SkillAthletics // strongman

                                                     );

            //riverrat.Icon = Helpers.NiceIcons(38);

            /*
             * var riverratextra = Helpers.CreateFeature("AtleticsTrait", "Swimmer",
             *  "Your swimming made you athletic",
             *  "EB6BC4BF90B1433C80878C9D0C81AAED", Helpers.GetSkillFocus(StatType.SkillAthletics).Icon,
             *  FeatureGroup.None,
             *  Helpers.Create<AddStartingEquipment>(a =>
             *  {
             *      a.CategoryItems = new WeaponCategory[] { WeaponCategory.Dagger, WeaponCategory.Dagger };
             *      a.RestrictedByClass = Array.Empty<BlueprintCharacterClass>();
             *      a.BasicItems = Array.Empty<BlueprintItem>();
             *  }),
             *  //Helpers.CreateAddStatBonus(StatType.SkillAthletics,1,ModifierDescriptor.Trait),
             *  //,
             *  Helpers.Create<WeaponTypeDamageBonus>(a => { a.WeaponType = dagger; a.DamageBonus = 1; })
             *  //Helpers.Create<WeaponCategoryAttackBonus>(a => { a.Category = WeaponCategory.Dagger; a.AttackBonus = 1; })
             *  );
             */

            riverrat.AddComponent(Helpers.Create <WeaponTypeDamageBonus>(a => { a.WeaponType = dagger; a.DamageBonus = 1; }));
            riverrat.AddComponent(Helpers.Create <AddStartingEquipment>(a =>
            {
                a.CategoryItems     = new WeaponCategory[] { WeaponCategory.Dagger, WeaponCategory.Dagger };
                a.RestrictedByClass = Array.Empty <BlueprintCharacterClass>();
                a.BasicItems        = Array.Empty <BlueprintItem>();
            }));
            choices.Add(riverrat);
            //WeaponCategoryAttackBonus

            choices.Add(Helpers.CreateFeature("EmpathicDiplomatTrait", "Empathic Diplomat",
                                              "You have long followed the path of common sense and empathic insight when using diplomacy. \n" +
                                              "Benefit:You modify your Diplomacy checks using your Wisdom modifier, not your Charisma modifier.",
                                              "a987f5e69db44cdd88983985e37a6d2b",
                                              Helpers.NiceIcons(999), // Weapon Specialization
                                              FeatureGroup.None,
                                                                      //dwarfReq,
                                              Helpers.Create <ReplaceBaseStatForStatTypeLogic>(x =>
            {
                x.StatTypeToReplaceBastStatFor = StatType.SkillPersuasion;
                x.NewBaseStatType = StatType.Wisdom;
            })));

            var BruisingInt = Traits.CreateAddStatBonus("BruisingIntellectTrait", "Bruising Intellect",
                                                        "Your sharp intellect and rapier-like wit bruise egos. \n" +
                                                        "Benefits: Intimidate is always a class skill for you, and you may use your Intelligence modifier when making Intimidate checks instead of your Charisma modifier.",
                                                        "b222b5e69db44cdd88983985e37a6d2f",
                                                        StatType.SkillPersuasion
                                                        );

            BruisingInt.AddComponent(Helpers.Create <ReplaceBaseStatForStatTypeLogic>(x =>
            {
                x.StatTypeToReplaceBastStatFor = StatType.SkillPersuasion;
                x.NewBaseStatType = StatType.Intelligence;
            }));

            choices.Add(BruisingInt);


            var Education = Helpers.CreateFeatureSelection("BalancedEducationTrait", "Balanced Education",
                                                           "Your upbringing focused on strengthening mind and body in equal measure.\n" +
                                                           "Benefit: You can exchange ability modifiers between the following pairings: Strength with Intelligence, Dexterity with Wisdom, and Constitution with Charisma.",
                                                           "2d6dc2bca4e158cdaf2cd4c643249bc4",
                                                           Image2Sprite.Create("Mods/EldritchArcana/sprites/spell_perfection.png"),
                                                           FeatureGroup.None);

            var EducationOptions = new BlueprintFeature[11];
            var icons            = new int[] { 24, 48 };
            var Difforhumans     = new string[]
            {
                "Use Magic Device",
                "Persuasion",
                "Lore Nature",
                "Lore Religion",
                "Perception",
                "Knowledge Arcana",
                "Knowledge World",
                "Stealth",
                "Trickery",
                "Mobility",
                "Athletics",
            };



            var Stats = new StatType[] {
                StatType.SkillUseMagicDevice,
                StatType.SkillPersuasion,
                StatType.SkillLoreNature,
                StatType.SkillLoreReligion,
                StatType.SkillPerception,     //5
                StatType.SkillKnowledgeArcana,
                StatType.SkillKnowledgeWorld, //7
                StatType.SkillStealth,
                StatType.SkillThievery,
                StatType.SkillMobility, //10
                StatType.SkillAthletics //11
            };
            var Moddefiers = new StatType[]
            {
                StatType.Constitution,
                StatType.Constitution,
                StatType.Dexterity,
                StatType.Dexterity,
                StatType.Dexterity, //5
                StatType.Strength,
                StatType.Strength,  //7
                StatType.Wisdom,
                StatType.Wisdom,
                StatType.Wisdom,
                StatType.Intelligence//11
            };

            for (int i = 0; i < Stats.Length; i++)
            {
                EducationOptions[i] = Helpers.CreateFeature($"BalancedEducationTrait{Stats[i]}", $"Use {Moddefiers[i]} for calculating {Difforhumans[i]}",
                                                            "you can draw on this training to apply a physical ability modifier to a skill check instead of its usual mental ability modifier, or apply a mental ability modifier to a skill check instead of its usual physical ability modifier.\n" +
                                                            $"Benefit: You modify your {Difforhumans[i]} using your {Moddefiers[i]} modifier.",
                                                            $"a985f6e69db24c7d889b39{i+15}e37a6c1b",
                                                            Helpers.GetSkillFocus(Stats[i]).Icon,
                                                            FeatureGroup.None,
                                                            Helpers.Create <ReplaceBaseStatForStatTypeLogic>(x =>
                {
                    x.StatTypeToReplaceBastStatFor = Stats[i];
                    x.NewBaseStatType = Moddefiers[i];
                })
                                                            );
            }
            Education.SetFeatures(EducationOptions);
            choices.Add(Education);


            choices.Add(UndoSelection.Feature.Value);
            regionalTraits.SetFeatures(choices);
            return(regionalTraits);
        }
        public BlueprintFeature createLegacyWeapon()
        {
            var legacy_weapon_group = ActivatableAbilityGroupExtension.LegacyWeaponImplement.ToActivatableAbilityGroup();

            var divine_weapon = library.Get <BlueprintAbility>("7ff088ab58c69854b82ea95c2b0e35b4");
            var enchants      = WeaponEnchantments.temporary_enchants;

            var enhancement_buff = Helpers.CreateBuff(prefix + "LegacyWeaponEnchancementBaseBuff",
                                                      "",
                                                      "",
                                                      "",
                                                      null,
                                                      null,
                                                      Common.createBuffRemainingGroupsSizeEnchantPrimaryHandWeapon(legacy_weapon_group,
                                                                                                                   false, true,
                                                                                                                   enchants
                                                                                                                   )
                                                      );
            var weapon_enhancement_buff = Helpers.CreateBuff(prefix + "LegacyWeaponSwitchBuff",
                                                             "Legacy Weapon",
                                                             "As a standard action, you can expend 1 point of mental focus and touch a weapon to grant it an enhancement bonus. The bonus is equal to 1 + 1 for every 6 occultist levels you possess (to a maximum of +4 at 18th level). Enhancement bonuses gained by this ability stack with those of the weapon, to a maximum of +5.\n"
                                                             + "You can also imbue the weapon with any one weapon special ability with an equivalent enhancement bonus less than or equal to your maximum bonus by reducing the granted enhancement bonus by the appropriate amount. The item must have an enhancement bonus of at least +1 (from the item itself or from legacy weapon) to gain a weapon special ability. In either case, these bonuses last for 1 minute.\n"
                                                             + "You can expend 1 extra point of mental focus to use this ability as swift action.",
                                                             "",
                                                             divine_weapon.Icon,
                                                             null,
                                                             Helpers.CreateAddFactContextActions(activated: Common.createContextActionApplyBuff(enhancement_buff, Helpers.CreateContextDuration(),
                                                                                                                                                is_child: true, is_permanent: true, dispellable: false)
                                                                                                 )
                                                             );

            enhancement_buff.SetBuffFlags(BuffFlags.HiddenInUi);
            var brilliant_energy = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementBrilliantEnergy",
                                                                   "Legacy Weapon - Brilliant Energy",
                                                                   "An occultist can add the brilliant energy property to her weapon, but this consumes 4 points of enhancement bonus granted to this weapon.\nA brilliant energy weapon ignores nonliving matter.Armor and shield bonuses to AC(including any enhancement bonuses to that armor) do not count against it because the weapon passes through armor. (Dexterity, deflection, dodge, natural armor, and other such bonuses still apply.) A brilliant energy weapon cannot harm undead, constructs, or objects.",
                                                                   library.Get <BlueprintActivatableAbility>("f1eec5cc68099384cbfc6964049b24fa").Icon,
                                                                   weapon_enhancement_buff,
                                                                   library.Get <BlueprintWeaponEnchantment>("66e9e299c9002ea4bb65b6f300e43770"),
                                                                   4, legacy_weapon_group);

            var flaming = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementFlaming",
                                                          "Legacy Weapon - Flaming",
                                                          "An occultist can add the flaming property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\nA flaming weapon is sheathed in fire that deals an extra 1d6 points of fire damage on a successful hit. The fire does not harm the wielder.",
                                                          library.Get <BlueprintActivatableAbility>("7902941ef70a0dc44bcfc174d6193386").Icon,
                                                          weapon_enhancement_buff,
                                                          library.Get <BlueprintWeaponEnchantment>("30f90becaaac51f41bf56641966c4121"),
                                                          1, legacy_weapon_group);

            var frost = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementFrost",
                                                        "Legacy Weapon - Frost",
                                                        "An occultist can add the frost property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\nA frost weapon is sheathed in a terrible, icy cold that deals an extra 1d6 points of cold damage on a successful hit. The cold does not harm the wielder.",
                                                        library.Get <BlueprintActivatableAbility>("b338e43a8f81a2f43a73a4ae676353a5").Icon,
                                                        weapon_enhancement_buff,
                                                        library.Get <BlueprintWeaponEnchantment>("421e54078b7719d40915ce0672511d0b"),
                                                        1, legacy_weapon_group);

            var shock = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementShock",
                                                        "Legacy Weapon - Shock",
                                                        "An occultist can add the shock property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\nA shock weapon is sheathed in crackling electricity that deals an extra 1d6 points of electricity damage on a successful hit. The electricity does not harm the wielder.",
                                                        library.Get <BlueprintActivatableAbility>("a3a9e9a2f909cd74e9aee7788a7ec0c6").Icon,
                                                        weapon_enhancement_buff,
                                                        library.Get <BlueprintWeaponEnchantment>("7bda5277d36ad114f9f9fd21d0dab658"),
                                                        1, legacy_weapon_group);

            var ghost_touch = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementGhostTouch",
                                                              "Legacy Weapon - Ghost Touch",
                                                              "An occultist can add the ghost touch property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\nA ghost touch weapon deals damage normally against incorporeal creatures, regardless of its bonus. An incorporeal creature's 50% reduction in damage from corporeal sources does not apply to attacks made against it with ghost touch weapons.",
                                                              library.Get <BlueprintActivatableAbility>("688d42200cbb2334c8e27191c123d18f").Icon,
                                                              weapon_enhancement_buff,
                                                              library.Get <BlueprintWeaponEnchantment>("47857e1a5a3ec1a46adf6491b1423b4f"),
                                                              1, legacy_weapon_group);

            var keen = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementKeen",
                                                       "Legacy Weapon - Keen",
                                                       "An occultist can add the keen property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\nThe keen property doubles the threat range of a weapon. This benefit doesn't stack with any other effects that expand the threat range of a weapon (such as the keen edge spell or the Improved Critical feat).",
                                                       library.Get <BlueprintActivatableAbility>("27d76f1afda08a64d897cc81201b5218").Icon,
                                                       weapon_enhancement_buff,
                                                       library.Get <BlueprintWeaponEnchantment>("102a9c8c9b7a75e4fb5844e79deaf4c0"),
                                                       1, legacy_weapon_group);

            var disruption = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementDisruption",
                                                             "Legacy Weapon - Disruption",
                                                             "An occultist can add the disruption property to her weapon, but this consumes 2 points of enhancement bonus granted to this weapon.\nA disruption weapon is the bane of all undead. Any undead creature struck in combat must succeed on a DC 14 Will save or be destroyed. A disruption weapon must be a bludgeoning melee weapon.",
                                                             library.Get <BlueprintActivatableAbility>("27d76f1afda08a64d897cc81201b5218").Icon,
                                                             weapon_enhancement_buff,
                                                             library.Get <BlueprintWeaponEnchantment>("0f20d79b7049c0f4ca54ca3d1ea44baa"),
                                                             2, legacy_weapon_group);

            var holy = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementHoly",
                                                       "Legacy Weapon - Holy",
                                                       "An occultist can add the holy property to her weapon, but this consumes 2 points of enhancement bonus granted to this weapon.\nA holy weapon is imbued with holy power. This power makes the weapon good-aligned and thus overcomes the corresponding damage reduction. It deals an extra 2d6 points of damage against all creatures of evil alignment.",
                                                       library.Get <BlueprintActivatableAbility>("ce0ece459ebed9941bb096f559f36fa8").Icon,
                                                       weapon_enhancement_buff,
                                                       library.Get <BlueprintWeaponEnchantment>("28a9964d81fedae44bae3ca45710c140"),
                                                       2, legacy_weapon_group);

            var unholy = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementUnholy",
                                                         "Legacy Weapon - Unholy",
                                                         "An occultist can add the unholy property to her weapon, but this consumes 2 points of enhancement bonus granted to this weapon.\nAn unholy weapon is imbued with unholy power. This power makes the weapon evil-aligned and thus overcomes the corresponding damage reduction. It deals an extra 2d6 points of damage against all creatures of good alignment.",
                                                         library.Get <BlueprintActivatableAbility>("561803a819460f34ea1fe079edabecce").Icon,
                                                         weapon_enhancement_buff,
                                                         library.Get <BlueprintWeaponEnchantment>("d05753b8df780fc4bb55b318f06af453"),
                                                         2, legacy_weapon_group);

            var axiomatic = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementAxiomatic",
                                                            "Legacy Weapon - Axiomatic",
                                                            "An occultist can add the axiomatic property to her weapon, but this consumes 2 points of enhancement bonus granted to this weapon.\nAn axiomatic weapon is infused with lawful power. It makes the weapon lawful-aligned and thus overcomes the corresponding damage reduction. It deals an extra 2d6 points of damage against chaotic creatures.",
                                                            library.Get <BlueprintActivatableAbility>("d76e8a80ab14ac942b6a9b8aaa5860b1").Icon,
                                                            weapon_enhancement_buff,
                                                            library.Get <BlueprintWeaponEnchantment>("0ca43051edefcad4b9b2240aa36dc8d4"),
                                                            2, legacy_weapon_group);

            var anarchic = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementAnarchic",
                                                           "Legacy Weapon - Anarchic",
                                                           "An occultist can add the anarchic property to her weapon, but this consumes 2 points of enhancement bonus granted to this weapon.\nAn anarchic weapon is infused with the power of chaos. It makes the weapon chaotic-aligned and thus overcomes the corresponding damage reduction. It deals an extra 2d6 points of damage against all creatures of lawful alignment.",
                                                           LoadIcons.Image2Sprite.Create(@"AbilityIcons/HWAnarchic.png"),
                                                           weapon_enhancement_buff,
                                                           library.Get <BlueprintWeaponEnchantment>("57315bc1e1f62a741be0efde688087e9"),
                                                           2, legacy_weapon_group);

            var vicious = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementVicious",
                                                          "Legacy Weapon - Vicious",
                                                          $"An occultist can add the vicious property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\n{WeaponEnchantments.vicious.Description}",
                                                          LoadIcons.Image2Sprite.Create(@"AbilityIcons/HWVicious.png"),
                                                          weapon_enhancement_buff,
                                                          WeaponEnchantments.vicious,
                                                          1, legacy_weapon_group);

            var cruel = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementCruel",
                                                        "Legacy Weapon - Cruel",
                                                        $"An occultist can add the cruel property to her weapon, but this consumes 1 point of enhancement bonus granted to this weapon.\n{WeaponEnchantments.cruel.Description}",
                                                        LoadIcons.Image2Sprite.Create(@"AbilityIcons/HWCruel.png"),
                                                        weapon_enhancement_buff,
                                                        WeaponEnchantments.cruel,
                                                        1, legacy_weapon_group);

            var vorpal = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementVorpal",
                                                         "Legacy Weapon - Vorpal",
                                                         $"An occultist can add the vorpal property to her weapon, but this consumes 5 points of enhancement bonus granted to this weapon.\n{WeaponEnchantments.vorpal.Description}",
                                                         LoadIcons.Image2Sprite.Create(@"AbilityIcons/HWVorpal.png"),
                                                         weapon_enhancement_buff,
                                                         WeaponEnchantments.vorpal,
                                                         5, legacy_weapon_group);

            var speed_enchant = library.Get <BlueprintWeaponEnchantment>("f1c0c50108025d546b2554674ea1c006");
            var speed         = Common.createEnchantmentAbility(prefix + "WarriorSpiritEnchancementSpeed",
                                                                "Warrior Spirit - Speed",
                                                                "An occultist can add the vicious property to her weapon, but this consumes 3 points of enhancement bonus granted to this weapon.\n" + speed_enchant.Description,
                                                                library.Get <BlueprintActivatableAbility>("ed1ef581af9d9014fa1386216b31cdae").Icon, //speed
                                                                weapon_enhancement_buff,
                                                                speed_enchant,
                                                                3, legacy_weapon_group);

            var bane = Common.createEnchantmentAbility(prefix + "LegacyWeaponEnchancementBane",
                                                       "Legacy Weapon - Bane",
                                                       $"An occultist can add the bane property to her weapon, but this consumes 4 points of enhancement bonus granted to this weapon.\n{WeaponEnchantments.bane.Description}",
                                                       LoadIcons.Image2Sprite.Create(@"AbilityIcons/HWBane.png"),
                                                       weapon_enhancement_buff,
                                                       WeaponEnchantments.bane,
                                                       4, legacy_weapon_group);

            var apply_buff = Common.createContextActionApplyBuff(weapon_enhancement_buff, Helpers.CreateContextDuration(1, DurationRate.Minutes), dispellable: false);

            var ability = Helpers.CreateAbility(prefix + "LegacyWeaponEnchantmentAbility",
                                                weapon_enhancement_buff.Name,
                                                weapon_enhancement_buff.Description,
                                                "",
                                                weapon_enhancement_buff.Icon,
                                                AbilityType.Supernatural,
                                                Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Standard,
                                                AbilityRange.Personal,
                                                Helpers.oneMinuteDuration,
                                                "",
                                                Helpers.CreateRunActions(apply_buff),
                                                resource.CreateResourceLogic()
                                                );

            ability.setMiscAbilityParametersSelfOnly();

            var ability_swift = library.CopyAndAdd(ability, "Swift" + ability.name, "");

            ability_swift.ActionType = CommandType.Swift;
            ability_swift.SetName(ability_swift.Name + " (Swift)");
            ability_swift.ReplaceComponent <AbilityResourceLogic>(a => a.Amount = 2);
            var wrapper = Common.createVariantWrapper(prefix + "LegacyWeaponEnchantmentAbilityBase", "", ability, ability_swift);

            addFocusInvestmentCheck(wrapper, SpellSchool.Transmutation);

            var legacy_weapon_features = new BlueprintFeature[5];

            legacy_weapon_features[0] = Helpers.CreateFeature(prefix + "LegacyWeaponEnchancementFeature",
                                                              "Legacy Weapon",
                                                              weapon_enhancement_buff.Description,
                                                              "",
                                                              weapon_enhancement_buff.Icon,
                                                              FeatureGroup.None,
                                                              Helpers.CreateAddFacts(wrapper, flaming, frost, shock, ghost_touch, keen, cruel, vicious)
                                                              );

            legacy_weapon_features[1] = Helpers.CreateFeature(prefix + "LegacyWeaponEnchancement2Feature",
                                                              "Legacy Weapon +2",
                                                              weapon_enhancement_buff.Description,
                                                              "",
                                                              weapon_enhancement_buff.Icon,
                                                              FeatureGroup.None,
                                                              Common.createIncreaseActivatableAbilityGroupSize(legacy_weapon_group),
                                                              Helpers.CreateAddFacts(disruption, holy, unholy, axiomatic, anarchic)
                                                              );

            legacy_weapon_features[2] = Helpers.CreateFeature(prefix + "LegacyWeaponEnchancement3Feature",
                                                              "Legacy Weapon +3",
                                                              weapon_enhancement_buff.Description,
                                                              "",
                                                              weapon_enhancement_buff.Icon,
                                                              FeatureGroup.None,
                                                              Helpers.CreateAddFacts(speed),
                                                              Common.createIncreaseActivatableAbilityGroupSize(legacy_weapon_group)
                                                              );

            legacy_weapon_features[3] = Helpers.CreateFeature(prefix + "LegacyWeaponEnchancement4Feature",
                                                              "Legacy Weapon +4",
                                                              weapon_enhancement_buff.Description,
                                                              "",
                                                              weapon_enhancement_buff.Icon,
                                                              FeatureGroup.None,
                                                              Common.createIncreaseActivatableAbilityGroupSize(legacy_weapon_group),
                                                              Helpers.CreateAddFacts(brilliant_energy, bane)
                                                              );
            legacy_weapon_features[4] = Helpers.CreateFeature(prefix + "LegacyWeaponEnchancement5Feature",
                                                              "Legacy Weapon +5",
                                                              weapon_enhancement_buff.Description,
                                                              "",
                                                              weapon_enhancement_buff.Icon,
                                                              FeatureGroup.None,
                                                              Common.createIncreaseActivatableAbilityGroupSize(legacy_weapon_group),
                                                              Helpers.CreateAddFact(vorpal)
                                                              );

            legacy_weapon_features[0].AddComponents(createAddFeatureInLevelRange(legacy_weapon_features[1], 6, 100),
                                                    createAddFeatureInLevelRange(legacy_weapon_features[2], 12, 100),
                                                    createAddFeatureInLevelRange(legacy_weapon_features[3], 18, 100)
                                                    );
            mastery_features.Add(legacy_weapon_features[4]);
            return(legacy_weapon_features[0]);
        }
Ejemplo n.º 21
0
 public static BlueprintCharacterClass GetSourceClass(this BlueprintFeature feature, UnitDescriptor unit) => unit.Progression.Features.Enumerable.FirstOrDefault(item => item.Blueprint == feature)?.GetSourceClass();
        static void createHealUnlock()
        {
            var icon = Helpers.GetIcon("c541f80af8d0af4498e1abb6025780c7"); //skill focus religion

            var heal_ability = library.Get <BlueprintAbility>("4843cb4c23951f54290c5149a4907f54");

            heal_ability.Range = AbilityRange.Touch;

            var treat_deadly_wounds_cooldown = Helpers.CreateBuff("TreatDeadlyWoundsCooldown",
                                                                  "Treat Deadly Wounds Cooldown",
                                                                  "As a full-round action you can treat your ally's wounds if you succeed at DC 20 Lore (Religion) check. When treating deadly wounds, you can restore hit points to a damaged creature. Treating deadly wounds restores 1 hit point per level of the creature. If you exceed the DC by 5 or more, add your Wisdom modifier (if positive) to this amount. A single creature can not benefit from this ability more than once per day.",
                                                                  "",
                                                                  Helpers.GetIcon("f6f95242abdfac346befd6f4f6222140"),
                                                                  null
                                                                  );

            treat_deadly_wounds_cooldown.SetBuffFlags(BuffFlags.RemoveOnRest);


            heal_unlock = Helpers.CreateFeature("SignatureSkillHealFeature",
                                                "Signature Skill: Heal",
                                                "The amount of healing you can provide with Treat Deadly Wounds ability increases as you gain more skill ranks:\n"
                                                + "05 Ranks: 2 hit points per target level, and 2 points of ability damage for each damaged ability;\n"
                                                + "10 Ranks: 4 hit points per target level, and 4 points of ability damage for each damaged ability;\n"
                                                + "15 Ranks: 6 hit points per target level, and 6 points of ability damage for each damaged ability;\n"
                                                + "20 Ranks: 9 hit points per target level, and 9 points of ability damage for each damaged ability.",
                                                "",
                                                icon,
                                                FeatureGroup.Feat,
                                                Helpers.PrerequisiteStatValue(StatType.SkillLoreReligion, 5)
                                                );

            var heal_wis_value = Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default);

            var heal_unlock_action = Helpers.CreateConditional(Helpers.Create <SkillMechanics.ContextSkillRanks>(c => { c.check_caster = true; c.skill = StatType.SkillLoreReligion; c.value = 20; }),
                                                               Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => c.Value = 9),
                                                               Helpers.CreateConditional(Helpers.Create <SkillMechanics.ContextSkillRanks>(c => { c.check_caster = true; c.skill = StatType.SkillLoreReligion; c.value = 15; }),
                                                                                         Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => c.Value = 6),
                                                                                         Helpers.CreateConditional(Helpers.Create <SkillMechanics.ContextSkillRanks>(c => { c.check_caster = true; c.skill = StatType.SkillLoreReligion; c.value = 10; }),
                                                                                                                   Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => c.Value = 4),
                                                                                                                   Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => c.Value = 2)
                                                                                                                   )
                                                                                         )
                                                               );

            var heal_action = Helpers.CreateConditional(Common.createContextConditionCasterHasFact(heal_unlock),
                                                        heal_unlock_action,
                                                        Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => { c.Value = 1; c.stats_to_heal = new StatType[0]; })
                                                        );

            var wis_heal_action = Helpers.Create <HealingMechanics.ContextActionTreatDeadlyWounds>(c => { c.Value = heal_wis_value; c.stats_to_heal = new StatType[0]; c.multiply_by_hd = false; });
            var effect          = Helpers.Create <SkillMechanics.ContextActionSkillCheckWithFailures>(c =>
            {
                c.Stat          = StatType.SkillLoreReligion;
                c.on_caster     = true;
                c.use_custom_dc = true;
                c.custom_dc     = 20;
                c.Bypass5       = Helpers.CreateActionList(wis_heal_action);
                c.Bypass10      = Helpers.CreateActionList(wis_heal_action);
                c.Success       = Helpers.CreateActionList(heal_action);
            });

            var treat_deadly_wounds_ability = library.CopyAndAdd(heal_ability, "TreatDeadlyWoundsHealSkillAbility", "");

            treat_deadly_wounds_ability.SetNameDescriptionIcon("Treat Deadly Wounds", treat_deadly_wounds_cooldown.Description, treat_deadly_wounds_cooldown.Icon);
            Common.setAsFullRoundAction(treat_deadly_wounds_ability);
            treat_deadly_wounds_ability.ComponentsArray = new BlueprintComponent[]
            {
                Helpers.CreateRunActions(effect, Common.createContextActionApplyBuff(treat_deadly_wounds_cooldown, Helpers.CreateContextDuration(1, DurationRate.Days), dispellable: false)),
                Common.createAbilityTargetHasFact(inverted: true, treat_deadly_wounds_cooldown)
            };
            treat_deadly_wounds_ability.AddComponent(Helpers.CreateContextRankConfig(ContextRankBaseValueType.StatBonus, stat: StatType.Wisdom, min: 0));

            var heal_ability_copy = library.CopyAndAdd(heal_ability, heal_ability.name + "Child", "");

            heal_ability.ComponentsArray = new BlueprintComponent[]
            {
                Helpers.CreateAbilityVariants(heal_ability, treat_deadly_wounds_ability, heal_ability_copy)
            };
            heal_ability.SetNameDescription("Use Heal Skill", "You can use your healing skills to treat afflictions or deadly wounds.");

            signature_skill.AllFeatures = signature_skill.AllFeatures.AddToArray(heal_unlock);
        }
        public static void CreateAnimalAllyFeatLine()
        {
            Main.ApplyPatch(typeof(GetPortraitFolderPathPatch), "Test");

            BlueprintFeature skillFocusLoreNature = Main.library.Get <BlueprintFeature>("6507d2da389ed55448e0e1e5b871c013");

            BlueprintFeature natureSoul = Helpers.CreateFeature(
                "NatureSoul",
                "Nature Soul",
                "You are innately in tune with nature and venerate the power and mystery of the natural world. \n" +
                "Benefit: You get a + 2 bonus on all Knowledge(nature) checks and Survival checks.If you have 10 or more ranks in one of these skills, the bonus increases to + 4 for that skill.",
                Helpers.getGuid("NatureSoul"),
                skillFocusLoreNature.Icon,
                FeatureGroup.Feat,
                Helpers.Create <NatureSoulLogic>()
                );


            BlueprintFeature        animalDomainProgressionSecondary = Main.library.Get <BlueprintFeature>("f13eb6be93dd5234c8126e5384040009");
            BlueprintFeature        animalDomainProgression          = Main.library.Get <BlueprintFeature>("23d2f87aa54c89f418e68e790dba11e0");
            BlueprintArchetype      sacredHuntsmasterArchetype       = Main.library.Get <BlueprintArchetype>("46eb929c8b6d7164188eb4d9bcd0a012");
            BlueprintCharacterClass inquisitorClass = Main.library.Get <BlueprintCharacterClass>("f1a70d9e1b0b41e49874e1fa9052a1ce");


            BlueprintFeature AnimalCompanionEmptyCompanion     = Main.library.Get <BlueprintFeature>("472091361cf118049a2b4339c4ea836a");
            BlueprintFeature AnimalCompanionFeatureBear        = Main.library.Get <BlueprintFeature>("f6f1cdcc404f10c4493dc1e51208fd6f");
            BlueprintFeature AnimalCompanionFeatureBoar        = Main.library.Get <BlueprintFeature>("afb817d80b843cc4fa7b12289e6ebe3d");
            BlueprintFeature AnimalCompanionFeatureCentipede   = Main.library.Get <BlueprintFeature>("f9ef7717531f5914a9b6ecacfad63f46");
            BlueprintFeature AnimalCompanionFeatureDog         = Main.library.Get <BlueprintFeature>("f894e003d31461f48a02f5caec4e3359");
            BlueprintFeature AnimalCompanionFeatureEkun        = Main.library.Get <BlueprintFeature>("e992949eba096644784592dc7f51a5c7");
            BlueprintFeature AnimalCompanionFeatureElk         = Main.library.Get <BlueprintFeature>("aa92fea676be33d4dafd176d699d7996");
            BlueprintFeature AnimalCompanionFeatureLeopard     = Main.library.Get <BlueprintFeature>("2ee2ba60850dd064e8b98bf5c2c946ba");
            BlueprintFeature AnimalCompanionFeatureMammoth     = Main.library.Get <BlueprintFeature>("6adc3aab7cde56b40aa189a797254271");
            BlueprintFeature AnimalCompanionFeatureMonitor     = Main.library.Get <BlueprintFeature>("ece6bde3dfc76ba4791376428e70621a");
            BlueprintFeature AnimalCompanionFeatureSmilodon    = Main.library.Get <BlueprintFeature>("126712ef923ab204983d6f107629c895");
            BlueprintFeature AnimalCompanionFeatureWolf        = Main.library.Get <BlueprintFeature>("67a9dc42b15d0954ca4689b13e8dedea");
            BlueprintFeature AnimalCompanionFeatureGiantSpider = AddSpiderCompanion();

            BlueprintFeature[] features = new BlueprintFeature[]
            {
                AnimalCompanionEmptyCompanion,
                AnimalCompanionFeatureBear,
                AnimalCompanionFeatureBoar,
                AnimalCompanionFeatureCentipede,
                AnimalCompanionFeatureDog,
                AnimalCompanionFeatureEkun,
                AnimalCompanionFeatureElk,
                AnimalCompanionFeatureLeopard,
                AnimalCompanionFeatureMammoth,
                AnimalCompanionFeatureMonitor,
                AnimalCompanionFeatureSmilodon,
                AnimalCompanionFeatureWolf,
                AnimalCompanionFeatureGiantSpider
            };

            AddAnimalCompanionToAllSelections(AnimalCompanionFeatureGiantSpider);

            BlueprintProgression domainAnimalCompanionProgression = Main.library.Get <BlueprintProgression>("125af359f8bc9a145968b5d8fd8159b8");


            BlueprintProgression animalAllyProgression = Main.library.CopyAndAdd(domainAnimalCompanionProgression, "animalAllyProgression", Helpers.getGuid("animalAllyProgression"));

            animalAllyProgression.Classes = (BlueprintCharacterClass[])Array.Empty <BlueprintCharacterClass>();

            BlueprintFeatureSelection animalAlly = Helpers.CreateFeatureSelection(
                "AnimalAlly",
                "Animal Ally",
                "You gain an animal companion as if you were a druid of your character level –3 from the following list: badger, bird, camel, cat (small), dire rat, dog, horse, pony, snake (viper), or wolf. If you later gain an animal companion through another source (such as the Animal domain, divine bond, hunter’s bond, mount, or nature bond class features), the effective druid level granted by this feat stacks with that granted by other sources.",
                Helpers.getGuid("AnimalAlly"),
                skillFocusLoreNature.Icon,
                FeatureGroup.Feat,
                natureSoul.PrerequisiteFeature(),
                Helpers.PrerequisiteCharacterLevel(4),
                Helpers.Create <PrerequisiteNoArchetype>(x =>
            {
                x.Archetype      = sacredHuntsmasterArchetype;
                x.CharacterClass = inquisitorClass;
            }),
                animalDomainProgression.PrerequisiteNoFeature(),
                animalDomainProgressionSecondary.PrerequisiteNoFeature(),
                Helpers.Create <AddFeatureOnApply>(x => x.Feature = animalAllyProgression),
                Helpers.Create <AnimalAllyAdjustToLevelLogic>()
                );

            animalAlly.SetFeatures(features);

            Main.library.AddFeats(natureSoul, animalAlly);
        }
Ejemplo n.º 24
0
        static void createDustBringer()
        {
            var slayer_class = library.Get <BlueprintCharacterClass>("c75e0971973957d4dbad24bc7957e4fb");

            var icon            = Helpers.GetIcon("a9a52760290591844a96d0109e30e04d"); //undeath to death
            var assasinate_buff = Helpers.CreateBuff("GraveWardenDustbringerBuff",
                                                     "Dustbringer Target",
                                                     "At 10th level, a grave warden can slay a studied undead opponent. This functions as the assassinate slayer talent, except it requires a successful Will saving throw instead of a successful Fortitude save, affects only undead, and destroys the target instead of killing it. If the target succeeds at its saving throw, it becomes immune to that grave warden’s dustbringer ability for 24 hours.\n"
                                                     + "Assasiante: " + RogueTalents.assasinate.Description,
                                                     "",
                                                     icon,
                                                     null);

            assasinate_buff.Stacking = StackingType.Stack;

            var assasinate_cooldown = Helpers.CreateBuff("GraveWardenDustbringerCooldownBuff",
                                                         "Dustbringer Target Cooldown",
                                                         assasinate_buff.Description,
                                                         "",
                                                         icon,
                                                         null);

            assasinate_cooldown.Stacking = StackingType.Stack;
            var apply_cooldown = Helpers.CreateConditional(Common.createContextConditionHasBuffFromCaster(assasinate_cooldown), null,
                                                           Common.createContextActionApplyBuff(assasinate_cooldown, Helpers.CreateContextDuration(1, DurationRate.Days), dispellable: false));
            var apply_buff = Common.createContextActionApplyBuff(assasinate_buff, Helpers.CreateContextDuration(1, DurationRate.Rounds), dispellable: false);

            var ability = Helpers.CreateAbility("GraveWardenDustbringerAbility",
                                                "Dustbringer",
                                                assasinate_buff.Description,
                                                "",
                                                assasinate_buff.Icon,
                                                AbilityType.Extraordinary,
                                                UnitCommand.CommandType.Standard,
                                                AbilityRange.Close,
                                                Helpers.oneRoundDuration,
                                                "",
                                                Helpers.CreateRunActions(apply_buff),
                                                Common.createAbilityTargetHasNoFactUnlessBuffsFromCaster(new BlueprintBuff[] { assasinate_cooldown, assasinate_buff }),
                                                Common.createAbilityTargetHasFact(false, Common.undead)
                                                );

            ability.setMiscAbilityParametersSingleTargetRangedHarmful();
            ability.EffectOnEnemy = AbilityEffectOnUnit.None;
            //Common.setAsFullRoundAction(ability);

            var attempt_assasinate = Helpers.CreateConditional(Helpers.CreateConditionsCheckerAnd(Helpers.Create <ContextConditionIsFlatFooted>(), Common.createContextConditionHasBuffFromCaster(assasinate_buff)),
                                                               Helpers.CreateActionSavingThrow(SavingThrowType.Will, Helpers.CreateConditionalSaved(null, Helpers.Create <ContextActionKillTarget>()))
                                                               );

            dustbringer = Helpers.CreateFeature("GraveWardenDustbringerFeature",
                                                ability.Name,
                                                ability.Description,
                                                "",
                                                ability.Icon,
                                                FeatureGroup.None,
                                                Helpers.CreateAddFact(ability),
                                                Helpers.Create <AddInitiatorAttackRollTrigger>(a =>
            {
                a.OnlyHit     = true;
                a.SneakAttack = true;
                a.Action      = Helpers.CreateActionList(attempt_assasinate);
            }
                                                                                               ),
                                                Helpers.Create <AddInitiatorAttackRollTrigger>(a =>
            {
                a.OnlyHit = false;
                a.Action  = Helpers.CreateActionList(apply_cooldown, Common.createContextActionRemoveBuffFromCaster(assasinate_buff));
            }
                                                                                               ),
                                                Common.createContextCalculateAbilityParamsBasedOnClasses(new BlueprintCharacterClass[] { slayer_class }, StatType.Intelligence)
                                                );

            Common.addToSlayerStudiedTargetDC(dustbringer);
        }
        private static BlueprintFeature AddSpiderCompanion()
        {
            PortraitData portraitData = new PortraitData("AdvancedMartialArtsSpider");

            BlueprintPortrait portrait = Helpers.Create <BlueprintPortrait>();

            portrait.Data = portraitData;
            Main.library.AddAsset(portrait, Helpers.getGuid("GiantSpiderPortrait"));

            BlueprintUnitFact reducedReachFact = Main.library.Get <BlueprintUnitFact>("c33f2d68d93ceee488aa4004347dffca");
            BlueprintFeature  weaponFinesse    = Main.library.Get <BlueprintFeature>("90e54424d682d104ab36436bd527af09");

            BlueprintFeature animalCompanionUpgradeCentipede = Main.library.Get <BlueprintFeature>("c938099ca0438b242b3edecfa9083e9f");
            BlueprintUnit    animalCompanionUnitCentipede    = Main.library.Get <BlueprintUnit>("f9df16ffd0c8cec4d99a0ae6f025a3f8");

            BlueprintUnit giantSpider = Main.library.CopyAndAdd <BlueprintUnit>("c4b33e5fd3d3a6f46b2aade647b0bf25", "GiantSpiderCompanion", Helpers.getGuid("GiantSpiderCompanion"));

            BlueprintItemWeapon Bite1d6         = Main.library.Get <BlueprintItemWeapon>("a000716f88c969c499a535dadcf09286");
            BlueprintItemWeapon EmptyHandWeapon = Main.library.Get <BlueprintItemWeapon>("20375b5a0c9243d45966bd72c690ab74");

            giantSpider.Brain           = animalCompanionUnitCentipede.Brain;
            giantSpider.ComponentsArray = animalCompanionUnitCentipede.ComponentsArray;
            giantSpider.Body            = animalCompanionUnitCentipede.Body;
            giantSpider.AddFacts        = giantSpider.AddFacts.AddToArray(weaponFinesse);
            giantSpider.Faction         = Main.library.Get <BlueprintFaction>("d8de50cc80eb4dc409a983991e0b77ad"); // Neutral faction

            Helpers.SetField(giantSpider, "m_Portrait", portrait);

            BlueprintUnitAsksList giantSpiderBarks = Main.library.CopyAndAdd <BlueprintUnitAsksList>("7d340f75a57c47d45b0e79200a6b5eac", "SpiderAnimalCompanionBarks", Helpers.getGuid("SpiderAnimalCompanionBarks"));
            UnitAsksComponent     component        = giantSpiderBarks.GetComponent <UnitAsksComponent>();

            foreach (var componentAnimationBark in component.AnimationBarks)
            {
                if (componentAnimationBark.AnimationEvent == MappedAnimationEventType.AlertSound1 || componentAnimationBark.AnimationEvent == MappedAnimationEventType.AlertSound2)
                {
                    componentAnimationBark.Cooldown = 10f;
                    componentAnimationBark.DelayMin = 5f;
                }
            }

            ChangeUnitSize unitSize = Helpers.Create <ChangeUnitSize>(x => x.SizeDelta = 1);

            FieldInfo typeField = unitSize.GetType().GetField("m_Type", BindingFlags.NonPublic | BindingFlags.Instance);
            object    delta     = unitSize.GetType().GetNestedType("ChangeType", BindingFlags.NonPublic).GetField("Delta").GetValue(unitSize);

            typeField.SetValue(unitSize, delta);

            AddMechanicsFeature addMechanicsFeature = Helpers.Create <AddMechanicsFeature>();

            Traverse traverse = Traverse.Create(addMechanicsFeature);

            traverse.Field("m_Feature").SetValue(AddMechanicsFeature.MechanicsFeatureType.IterativeNaturalAttacks);


            typeField.SetValue(unitSize, delta);

            BlueprintFeature animalCompanionFeatureSpider = Main.library.CopyAndAdd <BlueprintFeature>("f9ef7717531f5914a9b6ecacfad63f46", "AnimalCompanionFeatureGiantSpider", Helpers.getGuid("AnimalCompanionFeatureGiantSpider"));

            animalCompanionFeatureSpider.SetNameDescription("Animal Companion — Giant Spider", "Size Medium\nSpeed 30 ft.\nAC +1 natural armor\nAttack bite (1d6 plus poison)\nAbility Scores Str 11, Dex 17, Con 12, Int 1, Wis 10, Cha 2\nSpecial Attacks poison (frequency 1 round (4); effect 1d2 Str damage; cure 1 save; Con-based DC)\nCMD +8 vs. trip.\nAt 7th level size becomes Large, Str +2, Dex +8, Con +4, +2 natural armor.");

            AddPet addPetFact = animalCompanionFeatureSpider.ComponentsArray.OfType <AddPet>().First();

            animalCompanionFeatureSpider.RemoveComponent(addPetFact);
            addPetFact = UnityEngine.Object.Instantiate(addPetFact);
            animalCompanionFeatureSpider.AddComponent(addPetFact);

            addPetFact.Pet            = giantSpider;
            addPetFact.UpgradeFeature = Helpers.CreateFeature(
                "AnimalCompanionUpgradeGiantSpider",
                "",
                "",
                Helpers.getGuid("AnimalCompanionUpgradeGiantSpider"),
                animalCompanionUpgradeCentipede.Icon,
                FeatureGroup.None,
                unitSize,
                Helpers.Create <AddStatBonus>(x =>
            {
                x.Stat       = StatType.AC;
                x.Value      = 2;
                x.Descriptor = ModifierDescriptor.NaturalArmor;
            }),
                Helpers.Create <AddStatBonus>(x =>
            {
                x.Stat  = StatType.Strength;
                x.Value = 2;
            }),
                Helpers.Create <AddStatBonus>(x =>
            {
                x.Stat  = StatType.Dexterity;
                x.Value = 8;
            }),
                Helpers.Create <AddStatBonus>(x =>
            {
                x.Stat  = StatType.Constitution;
                x.Value = 4;
            }),
                addMechanicsFeature,
                Helpers.CreateAddFacts(reducedReachFact)
                );
            addPetFact.UpgradeLevel = 7;
            return(animalCompanionFeatureSpider);
        }
Ejemplo n.º 26
0
        static void createMajorMagic()
        {
            var druid  = library.Get <BlueprintCharacterClass>("610d836f3a3a9ed42a4349b62f002e96");
            var spells = Helpers.wizardSpellList.SpellsByLevel[1].Spells;

            major_magic = Helpers.CreateFeatureSelection("MajorMagicRogueTalent",
                                                         "Major Magic",
                                                         "A rogue with this talent gains the ability to cast a 1st-level spell from the sorcerer/wizard spell list once per day as a spell-like ability for every 2 rogue levels she possesses. The rogue’s caster level for this ability is equal to her rogue level. The save DC for this spell is 11 + the rogue’s Intelligence modifier. A rogue must have the minor magic rogue talent and an Intelligence score of at least 11 to select this talent.",
                                                         "",
                                                         Helpers.GetIcon("4ac47ddb9fa1eaf43a1b6809980cfbd2"), //magic missile
                                                         FeatureGroup.RogueTalent,
                                                         Helpers.PrerequisiteStatValue(StatType.Intelligence, 11),
                                                         Helpers.PrerequisiteFeature(minor_magic)
                                                         );

            var classes = new BlueprintCharacterClass[] { library.Get <BlueprintCharacterClass>("299aa766dee3cbf4790da4efb8c72484"), //rogue
                                                          library.Get <BlueprintCharacterClass>("c75e0971973957d4dbad24bc7957e4fb"),
                                                          Investigator.investigator_class,
                                                          druid,                                                                       //for nature fang
                                                          Skald.skald_class,                                                           //for red tongue
                                                          library.Get <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f"),   //bard for archaelogist
                                                          library.Get <BlueprintCharacterClass>("f1a70d9e1b0b41e49874e1fa9052a1ce") }; //inquisitor for sanctified slayer


            foreach (var s in spells)
            {
                var resource = Helpers.CreateAbilityResource("MajorMagic" + s.name + "Resource", "", "", Helpers.MergeIds("27fea41a99cd46609f8ab2283d1afce0", s.AssetGuid), null);
                resource.SetIncreasedByLevelStartPlusDivStep(0, 2, 1, 2, 1, 0, 0.0f, classes);
                BlueprintFeature feature = null;
                if (!s.HasVariants)
                {
                    var spell_like = Common.convertToSpellLike(s, "MajorMagic", classes, StatType.Intelligence, resource, no_scaling: true,
                                                               guid: Helpers.MergeIds("0e6a36ac029049c98a682f688e419f45", s.AssetGuid));
                    feature = Common.AbilityToFeatureMaybeReuseGuid(spell_like, false, Helpers.MergeIds("fb026930ab7943da96f6e17b7c778f2b", s.AssetGuid));
                    spell_like.AddComponent(Helpers.Create <NewMechanics.BindAbilitiesToClassFixedLevel>(b =>
                    {
                        b.Abilites          = new BlueprintAbility[] { spell_like };
                        b.CharacterClass    = classes[0];
                        b.AdditionalClasses = classes.Skip(1).ToArray();
                        b.Cantrip           = false;
                        b.Stat        = StatType.Intelligence;
                        b.fixed_level = 1;
                        b.Archetypes  = new BlueprintArchetype[] { Archetypes.SanctifiedSlayer.archetype, Archetypes.NatureFang.archetype };
                    }
                                                                                                         )
                                            );
                }
                else
                {
                    List <BlueprintAbility> spell_likes = new List <BlueprintAbility>();
                    foreach (var v in s.Variants)
                    {
                        spell_likes.Add(Common.convertToSpellLike(v, "MajorMagic", classes, StatType.Intelligence, resource, no_scaling: true,
                                                                  guid: Helpers.MergeIds("0e6a36ac029049c98a682f688e419f45", v.AssetGuid)));
                    }
                    var wrapper = Common.createVariantWrapper("MajorMagic" + s.name, guid: Helpers.MergeIds("0e6a36ac029049c98a682f688e419f45", s.AssetGuid), spell_likes.ToArray());
                    wrapper.SetNameDescriptionIcon(s.Name, s.Description, s.Icon);
                    feature = Common.AbilityToFeatureMaybeReuseGuid(wrapper, false, Helpers.MergeIds("3704cc05c1b64ea990ae6a2b97d35311", s.AssetGuid));
                    feature.AddComponent(Helpers.Create <NewMechanics.BindAbilitiesToClassFixedLevel>(b =>
                    {
                        b.Abilites          = spell_likes.ToArray();
                        b.CharacterClass    = classes[0];
                        b.AdditionalClasses = classes.Skip(1).ToArray();
                        b.Cantrip           = false;
                        b.Stat        = StatType.Intelligence;
                        b.fixed_level = 1;
                        b.Archetypes  = new BlueprintArchetype[] { Archetypes.SanctifiedSlayer.archetype, Archetypes.NatureFang.archetype };
                    }
                                                                                                      )
                                         );
                }
                feature.SetName("Major Magic: " + feature.Name);
                feature.Groups = new FeatureGroup[] { FeatureGroup.RogueTalent };
                feature.AddComponent(resource.CreateAddAbilityResource());
                major_magic.AllFeatures = major_magic.AllFeatures.AddToArray(feature);
            }
            addToTalentSelection(major_magic);
        }
Ejemplo n.º 27
0
        public BlueprintFeature createBleedingWounds(string name_prefix, string display_name, string description)
        {
            var bleed1d4 = library.Get <BlueprintBuff>("5eb68bfe186d71a438d4f85579ce40c1");
            var bleed1d6 = library.Get <BlueprintBuff>("75039846c3d85d940aa96c249b97e562");
            var bleed2d6 = library.Get <BlueprintBuff>("16249b8075ab8684ca105a78a047a5ef");
            var icon     = bleed1d4.Icon;
            var buffs    = new BlueprintBuff[] { bleed1d4, bleed1d6, bleed2d6 };

            var features = new BlueprintFeature[buffs.Length];

            var buff = Helpers.CreateBuff(name_prefix + "Buff",
                                          display_name,
                                          description,
                                          "",
                                          icon,
                                          null,
                                          Helpers.Create <BleedMechanics.BleedBuff>(b => b.dice_value = Helpers.CreateContextDiceValue(DiceType.Zero, 0, Helpers.CreateContextValue(AbilityRankType.Default))),
                                          Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, classes: classes,
                                                                          progression: ContextRankProgression.OnePlusDivStep, stepLevel: 5),
                                          bleed1d6.GetComponent <CombatStateTrigger>(),
                                          bleed1d6.GetComponent <AddHealTrigger>()
                                          );
            var apply_buff = Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(), is_permanent: true, is_from_spell: false);

            for (int i = 0; i < features.Length; i++)
            {
                //var apply_buff = Common.createContextActionApplyBuff(buffs[i], Helpers.CreateContextDuration(), is_permanent: true, is_from_spell: false);
                features[i] = Helpers.CreateFeature(name_prefix + $"{i + 1}Feature",
                                                    display_name,
                                                    description,
                                                    "",
                                                    icon,
                                                    FeatureGroup.None,
                                                    Helpers.Create <NewMechanics.ActionOnSpellDamage>(a =>
                {
                    a.descriptor = SpellDescriptor.None;
                    a.use_energy = true;
                    a.energy     = DamageEnergyType.NegativeEnergy;
                    a.action     = Helpers.CreateActionList(apply_buff);
                })
                                                    );
                features[i].HideInUI = true;
                if (i > 0)
                {
                    features[i].AddComponent(Common.createRemoveFeatureOnApply(features[i - 1]));
                }
            }

            var feature = Helpers.CreateFeature(name_prefix + "Feature",
                                                display_name,
                                                description,
                                                "",
                                                icon,
                                                FeatureGroup.None,
                                                Helpers.CreateAddFeatureOnClassLevel(features[0], 10, classes, before: true),
                                                Helpers.CreateAddFeatureOnClassLevel(features[1], 10, classes),
                                                Helpers.CreateAddFeatureOnClassLevel(features[2], 20, classes)
                                                );

            return(feature);
        }
        static BlueprintArchetype CreateAncientLorekeeper(BlueprintFeatureSelection mysteries, BlueprintFeature mysteryClassSkills)
        {
            var lorekeeper = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "AncientLorekeeperArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "传古学者");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description",
                                                              "传古学者是精灵一族广博知识和信仰的活生生的图书馆。她在年轻时就已对此展现出浓厚的兴趣,并能理解历史、续写传说;而当成年时,她为自己这个长寿种族的久远记忆服务的意愿便已被所有认识她的人所熟知。\n" +
                                                              "传古学者将知识(奥秘)加入她的本职技能列表中。该能力取代来自先知秘示域的额外本职技能。");
            });

            Helpers.SetField(lorekeeper, "m_ParentClass", oracle);
            library.AddAsset(lorekeeper, "df571bf056a941babe0903e94430dc9d");

            lorekeeper.RemoveFeatures = new LevelEntry[] {
                Helpers.LevelEntry(1, mysteryClassSkills),
            };

            var classSkill = Helpers.CreateFeature("AncientLorekeeperClassSkills",
                                                   UIUtility.GetStatText(StatType.SkillKnowledgeArcana),
                                                   "传古学者将知识(奥秘)加入她的本职技能列表中。",
                                                   "a6edf10077d24a95b6d8a701b8fb51d5", null, FeatureGroup.None,
                                                   Helpers.Create <AddClassSkill>(a => a.Skill = StatType.SkillKnowledgeArcana));

            var entries = new List <LevelEntry> {
                Helpers.LevelEntry(1, classSkill),
            };
            var elvenArcana = CreateElvenArcana();

            for (int level = 2; level <= 18; level += 2)
            {
                entries.Add(Helpers.LevelEntry(level, elvenArcana));
            }
            lorekeeper.AddFeatures = entries.ToArray();

            // Enable archetype prerequisites
            var patchDescription = "Archetype prerequisites (such as Ancient Lorekeeper)";

            Main.ApplyPatch(typeof(CharBSelectorLayer_FillData_Patch), patchDescription);
            Main.ApplyPatch(typeof(DescriptionTemplatesLevelup_LevelUpClassPrerequisites_Patch), patchDescription);
            Main.ApplyPatch(typeof(CharacterBuildController_SetRace_Patch), patchDescription);

            lorekeeper.SetComponents(
                Helpers.PrerequisiteFeaturesFromList(Helpers.elf, Helpers.halfElf));

            // Adjust prerequisites for mysteries
            foreach (var mystery in mysteries.AllFeatures)
            {
                if (mystery == TimeMystery.mystery)
                {
                    mystery.AddComponent(Helpers.Create <PrerequisiteArchetypeLevel>(p => { p.Archetype = lorekeeper; p.CharacterClass = oracle; }));
                }
                else
                {
                    mystery.AddComponent(Helpers.Create <PrerequisiteNoArchetype>(p => { p.Archetype = lorekeeper; p.CharacterClass = oracle; }));
                }
            }

            return(lorekeeper);
        }
Ejemplo n.º 29
0
        public static BlueprintFeatureSelection CreateSocialTraits(out BlueprintFeatureSelection adopted)
        {
            var noFeature    = Helpers.PrerequisiteNoFeature(null);
            var socialTraits = Helpers.CreateFeatureSelection("SocialTrait", "Social Trait",
                                                              "Social traits focus on your character’s social class or upbringing.",
                                                              "9e41e60c929e45bc84ded046148c07ec", null, FeatureGroup.None, noFeature);

            noFeature.Feature = socialTraits;
            var choices = new List <BlueprintFeature>();

            // This trait is finished by CreateRaceTraits.
            adopted = Helpers.CreateFeatureSelection("AdoptedTrait", "Adopted",
                                                     "You were adopted and raised by someone not of your race, and raised in a society not your own.\nBenefit: As a result, you picked up a race trait from your adoptive parents and society, and may immediately select a race trait from your adoptive parents’ race.",
                                                     "b4b37968273b4782b29d31c0ca215f41",
                                                     Helpers.GetIcon("26a668c5a8c22354bac67bcd42e09a3f"), // Adaptability
                                                     FeatureGroup.None);

            adopted.IgnorePrerequisites = true;
            adopted.Obligatory          = true;
            choices.Add(adopted);

            choices.Add(Traits.CreateAddStatBonus("ChildOfTheStreetsTrait", "Child of the Streets",
                                                  "You grew up on the streets of a large city, and as a result you have developed a knack for picking pockets and hiding small objects on your person.",
                                                  "a181fd2561134715a04e1b05776ab7a3",
                                                  StatType.SkillThievery));

            choices.Add(Traits.CreateAddStatBonus("FastTalkerTrait", "Fast-Talker",
                                                  "You had a knack for getting yourself into trouble as a child, and as a result developed a silver tongue at an early age.",
                                                  "509458a5ded54ecd9a2a4ef5388de2b7",
                                                  StatType.SkillPersuasion));

            //var ArchaeologistCleverExplorer = Traits.library.Get<BlueprintFeature>("1322e50d2b36aba45ab5405db43c53a3");

            var performanceResource = Traits.library.Get <BlueprintAbilityResource>("e190ba276831b5c4fa28737e5e49e6a6");

            choices.Add(Helpers.CreateFeature("MaestroOfTheSocietyTrait", "Maestro of the Society",
                                              "The skills of the greatest musicians are at your fingertips, thanks to the vast treasure trove of musical knowledge in the vaults you have access to.\nBenefit: You may use bardic performance 3 additional rounds per day.",
                                              "847cdf262e4147cda2c670db81852c58",
                                              Helpers.GetIcon("0d3651b2cb0d89448b112e23214e744e"),
                                              FeatureGroup.None,
                                              Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = performanceResource; i.Value = 3; })));

            var gnomeReq = Helpers.PrerequisiteFeature(Helpers.gnome);
            //var performanceResource = Traits.library.Get<BlueprintAbilityResource>("e190ba276831b5c4fa28737e5e49e6a6");
            var MutagenResource = Traits.library.Get <BlueprintAbilityResource>("3b163587f010382408142fc8a97852b6");

            choices.Add(Helpers.CreateFeature("GnomishAlchemistTrait", "Gnomish Alchemist",
                                              "a Gnomish alchemist discovers how to create a special elixir that he can imbibe in order to heighten his ability This is so potent it can be used an extra time. When consumed, the elixir causes the Alchemist’s skin to change color to match the background and causes his hands and feet to secrete a sticky residue.\n" +
                                              "Benfefit:you can use your mutagen an additinal 2 times per day.",
                                              "125cdf262e4147cda2c670db81852c69",
                                              Helpers.GetIcon("0d3651b2cb0d89448b112e23214e744e"),
                                              FeatureGroup.None,
                                              Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = MutagenResource; i.Value = 2; }),
                                              gnomeReq));



            var Clever = Helpers.CreateFeatureSelection("CleverWordplayTrait", "Clever Wordplay",
                                                        "Your cunning and logic are more than a match for another’s confidence and poise.\n" +
                                                        "Benefit: Choose a skill normally decided by Charisma and use Intelligence instead.",
                                                        "2d4dcccc21e158cdaf2cd4c643249cbf",
                                                        Helpers.NiceIcons(46),
                                                        FeatureGroup.None);

            var CleverOptions = new BlueprintFeature[6];
            var icons         = new int[] { 24, 48 };

            var Stats = new StatType[] {
                StatType.SkillUseMagicDevice,
                StatType.SkillPersuasion,
            };

            for (int i = 0; i < 2; i++)
            {
                CleverOptions[i] = Helpers.CreateFeature($"CleverWordplayTrait{Stats[i]}", $"Use Intelligence for calculating {Stats[i]}",
                                                         "Your cunning and logic are more than a match for another’s confidence and poise.\n" +
                                                         $"Benefit: You modify your {Stats[i]} using your Intelligence modifier.",
                                                         $"a98{i}f{i}e69db44c{i}d889{i}3885e37a6c{i}b",
                                                         Helpers.NiceIcons(i),
                                                         FeatureGroup.None,
                                                         Helpers.Create <ReplaceBaseStatForStatTypeLogic>(x =>
                {
                    x.StatTypeToReplaceBastStatFor = Stats[i];
                    x.NewBaseStatType = StatType.Intelligence;
                })
                                                         );
            }
            Clever.SetFeatures(CleverOptions);
            choices.Add(Clever);



            var AvidReader = Helpers.CreateFeatureSelection("AvidReaderTrait", "Avid Reader",
                                                            "As a youth, you voraciously consumed books and scrolls provided by a member of an adventurer’s guild or a learned organization like the Pathfinder Society, and you have internalized these stories of bold adventurers." +
                                                            "\nBenefit: Choose one Knowledge skill. You always choose to take 10 on checks with the chosen Knowledge skill, even when distracted or threatened.",
                                                            "2e4dcdce32e159cbaf0fb3c641249cbf",
                                                            Image2Sprite.Create("Mods/EldritchArcana/sprites/opposition_research.png"), FeatureGroup.None);



            var AvidReaderOptions = new List <BlueprintFeature>()
            {
                Helpers.CreateFeature("AvidReaderArcana", "Knowledge Arcana",
                                      "Because you are a magic bookworm\n" +
                                      "Benefit: You can always choose to take 10 on checks with knowledge arcana, even when distracted or threatened.",
                                      $"a932f3e69db44cdd33965985e37a6d2b",
                                      Image2Sprite.Create("Mods/EldritchArcana/sprites/spell_perfection.png"),
                                      FeatureGroup.None,
                                      Helpers.Create <Take10ForSuccessLogic>(t => t.Skill = StatType.SkillKnowledgeArcana)
                                      ), Helpers.CreateFeature("AvidReaderWorld", "Knowledge World",
                                                               "Becouse you are a bookworm.\n" +
                                                               "Benefit: You can always choose to take 10 on checks with knowledge world, even when distracted or threatened.",
                                                               $"b254f3e69db44cdd33964985e37a6d1b",
                                                               Image2Sprite.Create("Mods/EldritchArcana/sprites/opposition_research.png"),
                                                               FeatureGroup.None,
                                                               Helpers.Create <Take10ForSuccessLogic>(t => t.Skill = StatType.SkillKnowledgeWorld)
                                                               ),
            };


            AvidReader.SetFeatures(AvidReaderOptions);
            choices.Add(AvidReader);

            choices.Add(Traits.CreateAddStatBonus("SuspiciousTrait", "Suspicious",
                                                  "You discovered at an early age that someone you trusted, perhaps an older sibling or a parent, had lied to you, and lied often, about something you had taken for granted, leaving you quick to question the claims of others.",
                                                  "2f4e86a9d42547bc85b4c829a47d054c",
                                                  StatType.SkillPerception));

            choices.Add(UndoSelection.Feature.Value);
            socialTraits.SetFeatures(choices);
            return(socialTraits);
        }
        internal static List <BlueprintArchetype> Create(BlueprintFeatureSelection mystery, BlueprintFeatureSelection revelation, BlueprintFeature mysteryClassSkills)
        {
            var archetypes = new List <BlueprintArchetype>();

            archetypes.Add(CreateSeeker(revelation, mysteryClassSkills));
            archetypes.Add(CreateAncientLorekeeper(mystery, mysteryClassSkills));
            //archetypes.Add(CreateDivineHerbalist(revelation, mysteryClassSkills));

            // TODO: oracle archetypes? Ideas
            // - Divine Herbalist (paladin feel -- lay on hands & chance to cure conditions, popular choice with Life)
            // - Dual Cursed (very popular choice, not too hard to implement other than the spells, see below.)
            // - Elementalist Oracle (not too bad if Admixture subschool is implemented.)
            // - ...
            //
            // Dual Cursed:
            // - Fortune: is basically the same as Rewind Time, so it's already implemented.
            // - Misfortune: forcing enemies to reroll saving throws is generally the best use
            //   of this ability; a toggle could be used to enable this for all enemies. Similar
            //   to Persistent Spell.
            // - Ill Omen spell: kind of like Rewind Time but reversed, must take worse rolls.
            // - Oracle's burden: a bit tricky because the curses are not really designed to work
            //   on

            return(archetypes);
        }