public BlueprintFeature createFocusedForce()
        {
            var buff = Helpers.CreateBuff(name_prefix + "FocusedForceBuff",
                                          "Focused Force",
                                          "When casting a force spell, the psychic can increase the spell’s damage by spending 1 point from her phrenic pool. Increase the die size for the spell’s damage by one step (from 1d4 to 1d6, 1d6 to 1d8, 1d8 to 1d10, or 1d10 to 1d12). This increases the size of each die rolled, so a spell that dealt 4d6+3 points of force damage would deal 4d8+3 points of force damage instead. This amplification can be linked only to spells that deal force damage, and only if that damage includes a die value. A spell that already uses d12s for damage can’t be amplified in this way.",
                                          "",
                                          Helpers.GetIcon("0a2f7c6aa81bc6548ac7780d8b70bcbc"),
                                          null,
                                          Helpers.Create <NewMechanics.MetamagicMechanics.MetamagicOnSpellDescriptor>(m =>
            {
                m.amount           = 1;
                m.resource         = resource;
                m.spell_descriptor = SpellDescriptor.Force;
                m.Metamagic        = (Metamagic)MetamagicFeats.MetamagicExtender.ForceFocus;
                m.spellbook        = spellbook;
            })
                                          );

            var toggle = Common.buffToToggle(buff, UnitCommand.CommandType.Free, true,
                                             resource.CreateActivatableResourceLogic(spendType: ActivatableAbilityResourceLogic.ResourceSpendType.Never)
                                             );

            toggle.Group = ActivatableAbilityGroupExtension.PhrenicAmplification.ToActivatableAbilityGroup();
            var feature = Common.ActivatableAbilityToFeature(toggle, false);

            feature.AddComponent(Helpers.Create <OnCastMechanics.ForceFocusSpellDamageDiceIncrease>(s => { s.spellbook = spellbook; s.SpellDescriptor = SpellDescriptor.Force; }));
            return(feature);
        }
        static BlueprintActivatableAbility CreateRewindTime(BlueprintFeature feat, BlueprintAbilityResource resource, String assetId, RuleType ruleType, String displayName)
        {
            var buff = Helpers.CreateBuff($"{feat.name}{ruleType}Buff", $"{feat.Name} — {displayName}", feat.Description,
                                          Helpers.MergeIds("a1dcc2e1a0884123a6fc85f831e033e2", assetId),
                                          null, null,
                                          Helpers.Create <ModifyD20AndSpendResource>(m =>
            {
                m.RequiredResource = resource;
                m.Rule             = ruleType;
                // Note: technically this should take the second roll, regardless of what it is.
                // However if `TakeBest` is set to false, it will take the worse of the two rolls,
                // which is not what we want.
                m.TakeBest           = true;
                m.RollsAmount        = 1;
                m.RerollOnlyIfFailed = ruleType != RuleType.Intiative;
            }));

            buff.SetBuffFlags(BuffFlags.HiddenInUi);

            var ability = Helpers.CreateActivatableAbility($"{feat.name}{ruleType}ToggleAbility", buff.Name, feat.Description,
                                                           assetId, feat.Icon, buff, AbilityActivationType.Immediately, CommandType.Free, null,
                                                           resource.CreateActivatableResourceLogic(ResourceSpendType.Never));

            ability.IsOnByDefault = true;
            return(ability);
        }
Exemplo n.º 3
0
        static void createBlazingRondo()
        {
            var haste_buff    = library.Get <BlueprintBuff>("03464790f40c3c24aa684b57155f3280"); //haste
            var fatigued      = library.Get <BlueprintBuff>("e6f2fc5d73d88064583cb828801212f4");
            var apply_haste   = Common.createContextActionApplyBuff(haste_buff, Helpers.CreateContextDuration(), is_child: true, dispellable: false, is_permanent: true);
            var apply_fatigue = Common.createContextActionApplyBuff(fatigued, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilitySharedValue.Duration)), dispellable: false);
            var fatigue_saved = Helpers.CreateActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateConditionalSaved(null, apply_fatigue));

            var effect_buff = Helpers.CreateBuff("BlazingRondoEffectBuff",
                                                 "Blazing Rondo",
                                                 "You and your allies gain the benefits of haste while you maintain this masterpiece, except the bonus to AC and on attack rolls and Reflex saves is one-fifth of your bard level. Allies must be within 50 feet of you to receive this benefit. When you cease performing this masterpiece, any creature that received this benefit must succeed at a Fortitude save at this masterpiece’s DC or be fatigued for twice as many rounds as they were affected.\n"
                                                 + "Use: 1 round of bardic performance per round.",
                                                 "",
                                                 haste_buff.Icon,
                                                 null,
                                                 Helpers.CreateAddContextStatBonus(StatType.AdditionalAttackBonus, ModifierDescriptor.UntypedStackable),
                                                 Helpers.CreateAddContextStatBonus(StatType.AC, ModifierDescriptor.Dodge),
                                                 Helpers.CreateAddContextStatBonus(StatType.SaveReflex, ModifierDescriptor.UntypedStackable),
                                                 Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, classes: new BlueprintCharacterClass[] { bard_class, Skald.skald_class },
                                                                                 progression: ContextRankProgression.DelayedStartPlusDivStep,
                                                                                 startLevel: 10, stepLevel: 5),
                                                 Common.createContextCalculateAbilityParamsBasedOnClasses(new BlueprintCharacterClass[] { bard_class, Skald.skald_class }, StatType.Charisma),
                                                 Helpers.CreateAddFactContextActions(activated: apply_haste,
                                                                                     newRound: Helpers.Create <ContextActionChangeSharedValue>(c => { c.AddValue = 2; c.Type = SharedValueChangeType.Add; c.SharedValue = AbilitySharedValue.Duration; }),
                                                                                     deactivated: fatigue_saved)
                                                 );
            var toggle = Common.createToggleAreaEffect(effect_buff, 50.Feet(), Helpers.CreateConditionsCheckerAnd(Helpers.Create <ContextConditionIsAlly>()),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("5d4308fa344af0243b2dd3b1e500b2cc"), //inspire courage
                                                       Common.createPrefabLink("9353083f430e5a44a8e9d6e26faec248")
                                                       );

            toggle.Group = ActivatableAbilityGroup.BardicPerformance;
            toggle.AddComponent(performance_resource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            blazing_rondo        = Common.ActivatableAbilityToFeature(toggle, false);
            blazing_rondo.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            blazing_rondo.AddComponents(Helpers.PrerequisiteClassLevel(bard_class, 7, any: true),
                                        Helpers.PrerequisiteClassLevel(Skald.skald_class, 7, any: true));
            blazing_rondo_buff = effect_buff;
        }
Exemplo n.º 4
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));
        }
        public BlueprintFeature[] createMimicMetamagic()
        {
            var metamagics = library.GetAllBlueprints().OfType <BlueprintFeature>().Where(b => b.Groups.Contains(FeatureGroup.WizardFeat) && (b.GetComponent <AddMetamagicFeat>() != null) && b.AssetGuid != "2f5d1e705c7967546b72ad8218ccf99c").ToArray();

            var metamagic_selection = Helpers.CreateFeatureSelection(name_prefix + "MimicMetamagicSelection",
                                                                     "Mimic Metamagic",
                                                                     "When the psychic gains this amplification, she chooses two metamagic feats; she need not have these feats to select them. When she casts a spell, she can spend points from her phrenic pool to apply one of the chosen feats to the linked spell without increasing the spell’s level or casting time. She must spend a number of points equal to double the number of levels by which the feat normally increases a spell’s level (minimum 2 points). If the metamagic feat alters the spell’s casting time in a different way than the standard rules for a spontaneous caster using a metamagic feat (as in the case of Quicken Spell), it changes the casting time accordingly. The psychic can still apply metamagic feats she knows to the spell while using this amplification, increasing the casting time and spell level as normal. This amplification can be applied only to a spell that the chosen metamagic feat could normally affect, and only if the spellcaster can cast spells of a high enough level that she would be able to apply the metamagic feat in question to the linked spell. For example, an 11th-level psychic could spend 8 points to quicken a 1st-level spell, but couldn’t quicken a 2nd-level spell because she’s unable to cast 6th-level spells. This ability doesn’t require her to have any free spell slots in the relevant level, however, so the psychic in the example could quicken a 1st-level spell even if she had cast all her 5th-level spells for the day. A psychic can select this amplification multiple times, adding two additional options to the list of metamagic feats she can apply using this amplification each time.",
                                                                     "",
                                                                     null,
                                                                     FeatureGroup.None);

            foreach (var m in metamagics)
            {
                var metamagic_enum = m.GetComponent <AddMetamagicFeat>().Metamagic;
                var feature        = Helpers.CreateFeature(name_prefix + m.name,
                                                           "Mimic Metamagic: " + m.Name,
                                                           metamagic_selection.Description + "\n" + m.Name + ": " + m.Description,
                                                           "",
                                                           m.Icon,
                                                           FeatureGroup.None);

                var buff = Helpers.CreateBuff(name_prefix + m.name + "Buff",
                                              feature.Name,
                                              feature.Description,
                                              "",
                                              feature.Icon,
                                              null,
                                              Helpers.Create <NewMechanics.MetamagicMechanics.MetamagicOnSpellDescriptor>(mm =>
                {
                    mm.Metamagic         = metamagic_enum;
                    mm.limit_spell_level = true;
                    mm.resource          = resource;
                    mm.amount            = metamagic_enum.DefaultCost() * 2;
                    mm.specific_class    = character_class;
                })
                                              );
                var toggle = Common.buffToToggle(buff, UnitCommand.CommandType.Free, true,
                                                 resource.CreateActivatableResourceLogic(spendType: ActivatableAbilityResourceLogic.ResourceSpendType.Never)
                                                 );
                toggle.Group = ActivatableAbilityGroupExtension.PhrenicAmplification.ToActivatableAbilityGroup();
                toggle.AddComponent(Helpers.Create <ResourceMechanics.RestrictionHasEnoughResource>(r => { r.resource = resource; r.amount = metamagic_enum.DefaultCost() * 2; }));
                feature.AddComponent(Helpers.CreateAddFact(toggle));
                metamagic_selection.AllFeatures = metamagic_selection.AllFeatures.AddToArray(feature);
            }


            var amplifications = new BlueprintFeature[metamagics.Length / 2];

            for (int i = 0; i < amplifications.Length; i++)
            {
                amplifications[i] = Helpers.CreateFeature(name_prefix + $"{i + 1}MimicMetamagicFeature",
                                                          metamagic_selection.Name + " " + Common.roman_id[i + 1],
                                                          metamagic_selection.Description,
                                                          "",
                                                          metamagic_selection.Icon,
                                                          FeatureGroup.None,
                                                          Helpers.Create <EvolutionMechanics.addSelection>(a => a.selection = metamagic_selection),
                                                          Helpers.Create <EvolutionMechanics.addSelection>(a => a.selection = metamagic_selection)
                                                          );
                if (i > 0)
                {
                    amplifications[i].AddComponent(Helpers.PrerequisiteFeature(amplifications[i - 1]));
                }
            }

            return(amplifications);
        }
        public static void Load()
        {
            BlueprintCharacterClass inquisitor            = library.Get <BlueprintCharacterClass>("f1a70d9e1b0b41e49874e1fa9052a1ce"); // Inquisitor
            BlueprintProgression    inquisitorProgression = library.Get <BlueprintProgression>("4e945c2fe5e252f4ea61eee7fb560017");    // InquisitorProgression

            livingGrimoire = Helpers.Create <BlueprintArchetype>(l =>
            {
                l.name                 = "LivingGrimoireArchetype";
                l.LocalizedName        = Helpers.CreateString("LivingGrimoire.Name", "Living Grimoire");
                l.LocalizedDescription = Helpers.CreateString("LivingGrimoire.Description", "The living grimoire literally wields the sacred word of his deity, using his holy tome to smite the foes of his god with divine might. Unlike most inquisitors, a living grimoire focuses on careful study of divine scripture, valuing knowledge over intuition.");
            });

            livingGrimoireArray = new BlueprintArchetype[] { livingGrimoire };
            library.AddAsset(livingGrimoire, Helpers.getGuid("LivingGrimoireArchetype"));
            livingGrimoire.SetIcon(inquisitor.Icon);
            livingGrimoire.BaseAttackBonus = inquisitor.BaseAttackBonus;
            livingGrimoire.FortitudeSave   = inquisitor.FortitudeSave;
            livingGrimoire.ReflexSave      = inquisitor.ReflexSave;
            livingGrimoire.WillSave        = inquisitor.WillSave;

            Helpers.SetField(livingGrimoire, "m_ParentClass", inquisitor);

            livingGrimoire.LocalizedName = Helpers.CreateString("LivingGrimoire.Name", "Living Grimoire");

            BlueprintSpellbook MagusSpellbook      = library.Get <BlueprintSpellbook>("5d8d04e76dff6c5439de99af0d57be63"); // MagusSpellbook
            BlueprintSpellbook InquisitorSpellbook = library.Get <BlueprintSpellbook>("57fab75111f377248810ece84193a5a5"); // InquisitorSpellbook
            BlueprintSpellbook spellbook           = Helpers.Create <BlueprintSpellbook>();

            spellbook.name = "LivingGrimoireSpellbook";
            library.AddAsset(spellbook, Helpers.getGuid("LivingGrimoireSpellbook"));
            spellbook.Name             = livingGrimoire.LocalizedName;
            spellbook.SpellsPerDay     = MagusSpellbook.SpellsPerDay;
            spellbook.SpellList        = InquisitorSpellbook.SpellList;
            spellbook.CharacterClass   = inquisitor;
            spellbook.CastingAttribute = StatType.Intelligence;
            spellbook.Spontaneous      = false;
            spellbook.SpellsPerLevel   = 2;
            spellbook.AllSpellsKnown   = false;
            spellbook.CanCopyScrolls   = true;
            spellbook.IsArcane         = false;
            spellbook.CantripsType     = CantripsType.Orisions;


            livingGrimoire.ReplaceSpellbook = spellbook;

            BlueprintItem[] items = new BlueprintItem[]
            {
                (BlueprintItem)((IList <BlueprintCategoryDefaults.CategoryDefaultEntry>)Game.Instance.BlueprintRoot.Progression.CategoryDefaults.Entries).FirstOrDefault <BlueprintCategoryDefaults.CategoryDefaultEntry>((Func <BlueprintCategoryDefaults.CategoryDefaultEntry, bool>)(p => p.Key == WeaponCategory.LightMace))?.DefaultWeapon,
                library.Get <BlueprintItem>("f4cef3ba1a15b0f4fa7fd66b602ff32b"),
                library.Get <BlueprintItem>("d7963e1fcf260c148877afd3252dbc91"),
                library.Get <BlueprintItem>("ec619484fb1a13441b30f6d08e1c5b6f")
            };

            livingGrimoire.StartingItems = items;


            BlueprintFeature HolyBookFeature = Helpers.CreateFeature(
                "HolyBook",
                "Holy Book",
                "At 1st level, a living grimoire forms a supernatural bond with a large ironbound tome containing the holy text of his deity and learns to use it as a weapon.\n When wielding the holy book as a weapon, he deals base damage as if it were a cold iron light mace(but see Sacred Word below), is considered proficient with the book, takes no improvised weapon penalty, and gains a + 1 bonus on attack rolls with the book.The tome serves as his holy symbol and divine focus, and can be enchanted as a magic weapon. \nHe can replace his bonded tome with another book at any time, though he must perform a 24 - hour binding ritual to attune himself to the new book. \n Dev note: This ability works with all light maces.",
                Helpers.getGuid("HolyBook"),
                null,
                FeatureGroup.None,
                Helpers.Create <HolyBookLogic>()
                );

            BlueprintFeature SacredWordFeature = Helpers.CreateFeature(
                "SacredWord",
                "Sacred Word",
                "At 1st (level, a living grimoire learns to charge his holy book with the power of his faith. The inquisitor gains the benefits of the warpriest’s sacred weapon class ability, but the benefits apply only to his bonded holy book. Like a warpriest’s sacred weapon, the living grimoire’s book deals damage based on the inquisitor’s level, not the book’s base damage (unless the inquisitor chooses to use the book’s base damage).\nAt 4th level, the living grimoire gains the ability to enhance his holy book with divine power as a swift action.This ability grants the holy book a + 1 enhancement bonus.For every 4 inquisitor levels the living grimoire has beyond 4th, this bonus increases by 1(to a maximum of + 5 at 20th level).\nThese bonuses stack with any existing bonuses the holy book might have, to a maximum of + 5.The living grimoire can enhance his holy book to have any of the special abilities listed in the warpriest’s sacred weapon ability, subject to the same alignment restrictions, but adds bane to the general special ability list.Adding any of these special abilities to the holy book consumes an amount of enhancement bonus equal to the special ability’s base price modifier.The holy book must have at least a + 1 enhancement bonus before the living grimoire can add any special abilities to it.The living grimoire can use this ability a number of rounds per day equal to his inquisitor level, but these rounds don’t need to be consecutive.As with the warpriest sacred weapon ability, he determines the enhancement bonus and special abilities the first time he uses the ability each day, and they cannot be changed until the next day. \nThis ability replaces judgment.\n Dev note: This ability works with all light maces.",
                Helpers.getGuid("SacredWordFeature"),
                null,
                FeatureGroup.None,
                Helpers.Create <FocusedWeaponLogic>(x =>
            {
                x.Category = WeaponCategory.LightMace;
                x.Class    = inquisitor;
            })
                );

            BlueprintFeature SacredWordFeature1d8 = Helpers.CreateFeature(
                "SacredWord_1d8",
                "Sacred Word 1d8",
                "The damage of your holy book (light maces) increases to 1d8.",
                Helpers.getGuid("SacredWord_1d8"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature1d10 = Helpers.CreateFeature(
                "SacredWord_1d10",
                "Sacred Word 1d10",
                "The damage of your holy book (light maces) increases to 1d10.",
                Helpers.getGuid("SacredWord_1d10"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature2d6 = Helpers.CreateFeature(
                "SacredWord_2d6",
                "Sacred Word 2d6",
                "The damage of your holy book (light maces) increases to 2d6.",
                Helpers.getGuid("SacredWord_2d6"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature2d8 = Helpers.CreateFeature(
                "SacredWord_2d8",
                "Sacred Word 2d8",
                "The damage of your holy book (light maces) increases to 2d8.",
                Helpers.getGuid("SacredWord_2d8"),
                null,
                FeatureGroup.None
                );


            BlueprintBuff InspireCourageBuff = library.Get <BlueprintBuff>("b4027a834204042409248889cc8abf67");
            BlueprintActivatableAbility InspireCourageToggleAbility = library.Get <BlueprintActivatableAbility>("5250fe10c377fdb49be449dfe050ba70"); // InspireCourageToggleAbility

            BlueprintItemEnchantment[] defaultEnchantments = new BlueprintItemEnchantment[]
            {
                library.Get <BlueprintItemEnchantment>("d704f90f54f813043a525f304f6c0050"),
                library.Get <BlueprintItemEnchantment>("9e9bab3020ec5f64499e007880b37e52"),
                library.Get <BlueprintItemEnchantment>("d072b841ba0668846adeb007f623bd6c"),
                library.Get <BlueprintItemEnchantment>("6a6a0901d799ceb49b33d4851ff72132"),
                library.Get <BlueprintItemEnchantment>("746ee366e50611146821d61e391edf16")
            };

            BlueprintBuff SacredWordBuff = Helpers.CreateBuff(
                "SacredWordBuff",
                "Sacred Word",
                "",
                Helpers.getGuid("SacredWordBuff"),
                null,
                InspireCourageBuff.FxOnStart,
                Helpers.Create <AddSacredWordBonus>(x =>
            {
                x.DefaultEnchantments = defaultEnchantments;
                x.DurationValue       = Helpers.CreateContextDuration(rate: DurationRate.Rounds, bonus: 1);
                x.Group       = ActivatableAbilityGroup.DivineWeaponProperty;
                x.EnchantPool = EnchantPoolType.DivineWeaponBond;
            })
                );

            BlueprintAbilityResource abilityResource = Helpers.CreateAbilityResource(
                "SacredWordResource",
                "Sacred Word Resource",
                "",
                Helpers.getGuid("SacredWordResource"),
                null
                );

            abilityResource.SetIncreasedByLevel(1, 1, new BlueprintCharacterClass[] { inquisitor });

            BlueprintAbility            WeaponBondSwitchAbility = library.Get <BlueprintAbility>("7ff088ab58c69854b82ea95c2b0e35b4"); //WeaponBondSwitchAbility
            BlueprintActivatableAbility SacredWordToggleAbility = Helpers.CreateActivatableAbility(
                "SacredWordSwitchAbility",
                "Sacred Word",
                "",
                Helpers.getGuid("SacredWordSwitchAbility"),
                WeaponBondSwitchAbility.Icon,
                SacredWordBuff,
                AbilityActivationType.WithUnitCommand,
                UnitCommand.CommandType.Swift,
                InspireCourageToggleAbility.ActivateWithUnitAnimation,
                abilityResource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound)
                );

            SacredWordToggleAbility.DeactivateIfCombatEnded   = true;
            SacredWordToggleAbility.DeactivateIfOwnerDisabled = true;


            BlueprintActivatableAbility SacredWordFrost      = library.CopyAndAdd <BlueprintActivatableAbility>("b338e43a8f81a2f43a73a4ae676353a5", "SacredWordFrost", Helpers.getGuid("SacredWordFrost"));           // ArcaneWeaponFrostChoice
            BlueprintActivatableAbility SacredWordShock      = library.CopyAndAdd <BlueprintActivatableAbility>("a3a9e9a2f909cd74e9aee7788a7ec0c6", "SacredWordShock", Helpers.getGuid("SacredWordShock"));           // ArcaneWeaponShockChoice
            BlueprintActivatableAbility SacredWordAnarchic   = library.CopyAndAdd <BlueprintActivatableAbility>("8ed07b0cc56223c46953348f849f3309", "SacredWordAnarchic", Helpers.getGuid("SacredWordAnarchic"));     // ArcaneWeaponAnarchicChoice
            BlueprintActivatableAbility SacredWordGhostTouch = library.CopyAndAdd <BlueprintActivatableAbility>("688d42200cbb2334c8e27191c123d18f", "SacredWordGhostTouch", Helpers.getGuid("SacredWordGhostTouch")); // ArcaneWeaponGhostTouchChoice
            BlueprintActivatableAbility SacredWordUnholy     = library.CopyAndAdd <BlueprintActivatableAbility>("561803a819460f34ea1fe079edabecce", "SacredWordUnholy", Helpers.getGuid("SacredWordUnholy"));         // ArcaneWeaponUnholyChoice
            BlueprintActivatableAbility SacredWordBane       = library.CopyAndAdd <BlueprintActivatableAbility>("3a909d1effa3bbc4084f2b5ac95f5306", "SacredWordBane", Helpers.getGuid("SacredWordBane"));             // ArcaneWeaponUnholyChoice

            SacredWordFrost.Group        = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordShock.Group        = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordAnarchic.Group     = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordGhostTouch.Group   = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordUnholy.Group       = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordBane.Group         = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordBane.WeightInGroup = 1;



            BlueprintFeature SacredWordFeatureLevel4 = Helpers.CreateFeature(
                "SacredWord_FeatureLevel4",
                "Sacred Word",
                "At 4th level, the living grimoire gains the ability to enhance his holy book with divine power as a swift action.This ability grants the holy book a + 1 enhancement bonus.For every 4 inquisitor levels the living grimoire has beyond 4th, this bonus increases by 1(to a maximum of + 5 at 20th level).\nThese bonuses stack with any existing bonuses the holy book might have, to a maximum of + 5.The living grimoire can enhance his holy book to have any of the special abilities listed in the warpriest’s sacred weapon ability, subject to the same alignment restrictions, but adds bane to the general special ability list.Adding any of these special abilities to the holy book consumes an amount of enhancement bonus equal to the special ability’s base price modifier.The holy book must have at least a + 1 enhancement bonus before the living grimoire can add any special abilities to it.The living grimoire can use this ability a number of rounds per day equal to his inquisitor level, but these rounds don’t need to be consecutive.As with the warpriest sacred weapon ability, he determines the enhancement bonus and special abilities the first time he uses the ability each day, and they cannot be changed until the next day. \nThis ability replaces judgment.\n Dev note: This ability works with all light maces.",
                Helpers.getGuid("SacredWord_FeatureLevel4"),
                null,
                FeatureGroup.None,
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                SacredWordToggleAbility,
                library.Get <BlueprintActivatableAbility>("7902941ef70a0dc44bcfc174d6193386"),    //WeaponBondFlamingChoice
                library.Get <BlueprintActivatableAbility>("27d76f1afda08a64d897cc81201b5218"),    //WeaponBondKeenChoice
                SacredWordFrost,
                SacredWordShock,
                SacredWordGhostTouch,
            }),
                Helpers.Create <AddAbilityResources>(x =>
            {
                x.UseThisAsResource = false;
                x.Resource          = library.Get <BlueprintAbilityResource>("3683d1af071c1744185ff93cba9db10b"); // WeaponBondResourse
                x.Amount            = 0;
                x.RestoreAmount     = true;
                x.RestoreOnLevelUp  = false;
            }),
                abilityResource.CreateAddAbilityResource(),
                Helpers.Create <IncreaseResourcesByClass>(x =>
            {
                x.CharacterClass = inquisitor;
                x.Resource       = abilityResource;
                x.BaseValue      = 1;
            })

                );

            BlueprintFeature SacredWordPlus2 = Helpers.CreateFeature(
                "SacredWord_Plus2",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1. Adds the enchantments Anarchic, Axiomatic, Disruption, Holy, Unholy",
                Helpers.getGuid("SacredWord_Plus2"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty),
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                library.Get <BlueprintActivatableAbility>("d76e8a80ab14ac942b6a9b8aaa5860b1"),    //WeaponBondAxiomaticChoice
                library.Get <BlueprintActivatableAbility>("ce0ece459ebed9941bb096f559f36fa8"),    //WeaponBondHolyChoice
                library.Get <BlueprintActivatableAbility>("8c714fbd564461e4588330aeed2fbe1d"),    //WeaponBondDisruptionChoice
                SacredWordAnarchic,
                SacredWordUnholy,
                SacredWordBane
            }));

            BlueprintFeature SacredWordPlus3 = Helpers.CreateFeature(
                "SacredWord_Plus3",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1.",
                Helpers.getGuid("SacredWord_Plus3"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty)
                );

            BlueprintFeature SacredWordPlus4 = Helpers.CreateFeature(
                "SacredWord_Plus4",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1. Adds the enchantment Brilliant Energy",
                Helpers.getGuid("SacredWord_Plus4"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty),
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                library.Get <BlueprintActivatableAbility>("f1eec5cc68099384cbfc6964049b24fa"),    //WeaponBondBrilliantEnergyChoice
            }));

            BlueprintFeature SacredWordPlus5 = Helpers.CreateFeature(
                "SacredWord_Plus5",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1.",
                Helpers.getGuid("SacredWord_Plus5"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty)
                );

            BlueprintFeatureSelection BlessedScriptSelection = Helpers.CreateFeatureSelection(
                "BlessedScript",
                "Blessed Script",
                "At 5th level, a living grimoire can permanently tattoo one spell of 2nd level or lower from his holy book onto his body. The tattooed spell cannot have an expensive material component or focus. The living grimoire can cast his tattooed spells as a spell-like ability once per day.",
                Helpers.getGuid("BlessedScript"),
                null,
                FeatureGroup.None
                );

            List <BlueprintFeatureSelection> BlessedScriptSpellLevelSelection = new List <BlueprintFeatureSelection>();

            for (int i = 1; i < 7; i++)
            {
                BlueprintFeatureSelection BlessedScriptSpellSelection = Helpers.CreateFeatureSelection(
                    "BlessedScriptLevel" + (i),
                    "Blessed Script Level " + (i),
                    "At 5th level, a living grimoire can permanently tattoo one spell of 2nd level or lower from his holy book onto his body. The tattooed spell cannot have an expensive material component or focus. The living grimoire can cast his tattooed spells as a spell-like ability once per day.",
                    Helpers.getGuid("BlessedScriptLevel" + (i)),
                    null,
                    FeatureGroup.None,
                    inquisitor.PrerequisiteClassLevel((i - 1) * 4)
                    );
                List <BlueprintFeature> SpellSelection = new List <BlueprintFeature>();
                foreach (BlueprintAbility Spell in InquisitorSpellbook.SpellList.GetSpells(i))
                {
                    if (Spell.MaterialComponent.Item != null)
                    {
                        continue;
                    }

                    BlueprintAbilityResource BlessedScriptAbilityResource = Helpers.CreateAbilityResource(
                        "BlessedScriptAbilityResource" + Spell.name,
                        "",
                        "",
                        Helpers.getGuid("BlessedScriptAbilityResource" + Spell.name),
                        null);
                    BlessedScriptAbilityResource.SetFixedResource(1);


                    BlueprintAbility ability        = library.CopyAndAdd(Spell, "BlessedScriptAbility" + Spell.name, Helpers.getGuid("BlessedScriptAbility" + Spell.name));
                    SpellComponent   spellComponent = ability.GetComponent <SpellComponent>();
                    if (spellComponent != null)
                    {
                        ability.RemoveComponent(spellComponent);
                    }
                    ability.AddComponent(Helpers.Create <AbilityResourceLogic>(x =>
                    {
                        x.Amount           = 1;
                        x.IsSpendResource  = true;
                        x.CostIsCustom     = false;
                        x.RequiredResource = BlessedScriptAbilityResource;
                    }));

                    BlueprintFeature BlessedScriptSpell = Helpers.CreateFeature(
                        "BlessedScript" + Spell.name,
                        "Blessed Script (" + Spell.Name + ")",
                        "You have tattooed the spell \"" + Spell.Name + "\" onto your body. You can  can cast his tattooed spells as a spell-like ability once per day.",
                        Helpers.getGuid("BlessedScript" + Spell.name),
                        null,
                        FeatureGroup.None,
                        Helpers.Create <PrerequisiteKnowsSpell>(x =>
                    {
                        x.Ability        = Spell;
                        x.CharacterClass = inquisitor;
                    }),
                        Helpers.CreateAddFacts(ability),
                        Helpers.CreateAddAbilityResource(BlessedScriptAbilityResource)
                        );
                    BlessedScriptSpell.AddComponent(BlessedScriptSpell.PrerequisiteNoFeature());
                    SpellSelection.Add(BlessedScriptSpell);
                }
                BlessedScriptSpellSelection.SetFeatures(SpellSelection);
                BlessedScriptSpellLevelSelection.Add(BlessedScriptSpellSelection);
            }
            BlessedScriptSelection.SetFeatures(BlessedScriptSpellLevelSelection);


            BlueprintBuff TrueJudgmentCooldownBuff = library.Get <BlueprintBuff>("65058aafc91a12042b158527f9d0506a");

            ContextValue CooldownBuff = new ContextValue();

            CooldownBuff.Value = 24;

            BlueprintAbilityResource WordOfGodAbilityResource = Helpers.CreateAbilityResource(
                "WordOfGodAbilityResource",
                "",
                "",
                Helpers.getGuid("WordOfGodAbilityResource"),
                null);

            WordOfGodAbilityResource.SetFixedResource(7);

            AbilityEffectRunAction   abilityEffectRunAction = Helpers.Create <AbilityEffectRunAction>();
            ContextActionSavingThrow savingThrow            = Helpers.Create <ContextActionSavingThrow>();

            savingThrow.Type = SavingThrowType.Fortitude;

            ContextActionConditionalSaved saved = Helpers.Create <ContextActionConditionalSaved>();

            saved.Succeed = new ActionList
            {
                Actions = new GameAction[]
                {
                    Helpers.Create <ContextActionApplyBuff>(ap =>
                    {
                        ap.Buff          = TrueJudgmentCooldownBuff;
                        ap.DurationValue = Helpers.CreateContextDuration(CooldownBuff, DurationRate.Hours);
                    })
                }
            };
            saved.Failed = new ActionList {
                Actions = new GameAction[] { Helpers.Create <ContextActionKillTarget>() }
            };
            savingThrow.Actions = new ActionList {
                Actions = new GameAction[] { saved }
            };


            Conditional conditional = Helpers.Create <Conditional>();

            conditional.ConditionsChecker = new ConditionsChecker();

            ContextConditionHasBuffFromCaster condition = Helpers.Create <ContextConditionHasBuffFromCaster>();

            condition.Buff = TrueJudgmentCooldownBuff;

            conditional.ConditionsChecker.Conditions = new Condition[] { condition };
            conditional.IfFalse = new ActionList {
                Actions = new GameAction[] { savingThrow }
            };

            abilityEffectRunAction.Actions = new ActionList {
                Actions = new GameAction[] { conditional }
            };

            BlueprintAbility TrueJudgmentAbility = library.Get <BlueprintAbility>("d69715dc0de8f8b44ac9f20188c7c22e");

            BlueprintAbility WordOfGodAbility = Helpers.CreateAbility(
                "WordOfGodAbility",
                "Word of God",
                "At 20th level, a living grimoire can smite his foes with the holy word of his deity. Up to seven times per day, the inquisitor can make a single melee attack with his holy book against a target. If the attack hits, it deals damage normally and the target must succeed at a Fortitude save or die (DC = 10 + 1/2 the living grimoire’s inquisitor level + his Intelligence modifier). Regardless of whether the save is successful, the target creature is immune to the living grimoire’s word of god ability for 24 hours. Once the living grimoire uses this ability, he can’t use it again for 1d4 rounds.\nThis ability replaces true judgment.",
                Helpers.getGuid("WordOfGodAbility"),
                TrueJudgmentAbility.Icon,
                AbilityType.Supernatural,
                UnitCommand.CommandType.Standard,
                AbilityRange.Weapon,
                "Instant",
                "Fortitude",
                abilityEffectRunAction
                ,
                Helpers.Create <AbilityResourceLogic>(x =>
            {
                x.Amount           = 1;
                x.IsSpendResource  = true;
                x.CostIsCustom     = false;
                x.RequiredResource = WordOfGodAbilityResource;
            })
                );

            WordOfGodAbility.CanTargetEnemies = true;
            WordOfGodAbility.CanTargetSelf    = false;

            BlueprintFeature TrueJudgmentFeature = library.Get <BlueprintFeature>("f069b6557a2013544ac3636219186632"); // TrueJudgmentFeature

            BlueprintFeature WordOfGod = Helpers.CreateFeature("WordOfGod",
                                                               "Word of God",
                                                               "At 20th level, a living grimoire can smite his foes with the holy word of his deity. Up to seven times per day, the inquisitor can make a single melee attack with his holy book against a target. If the attack hits, it deals damage normally and the target must succeed at a Fortitude save or die (DC = 10 + 1/2 the living grimoire’s inquisitor level + his Intelligence modifier). Regardless of whether the save is successful, the target creature is immune to the living grimoire’s word of god ability for 24 hours. Once the living grimoire uses this ability, he can’t use it again for 1d4 rounds.\nThis ability replaces true judgment.",
                                                               Helpers.getGuid("WordOfGod"),
                                                               TrueJudgmentFeature.Icon,
                                                               FeatureGroup.None,
                                                               Helpers.CreateAddFacts(WordOfGodAbility),
                                                               Helpers.Create <ReplaceAbilitiesStat>(x =>
            {
                x.Stat    = StatType.Intelligence;
                x.Ability = new BlueprintAbility[] { WordOfGodAbility };
            }),
                                                               Helpers.Create <ReplaceCasterLevelOfAbility>(x =>
            {
                x.Spell = WordOfGodAbility;
                x.Class = inquisitor;
            }),
                                                               WordOfGodAbilityResource.CreateAddAbilityResource()
                                                               );

            List <LevelEntry> addFeatures = new List <LevelEntry>();

            addFeatures.Add(Helpers.LevelEntry(1, HolyBookFeature, SacredWordFeature));
            addFeatures.Add(Helpers.LevelEntry(4, SacredWordFeatureLevel4));
            addFeatures.Add(Helpers.LevelEntry(5, BlessedScriptSelection, SacredWordFeature1d8));
            addFeatures.Add(Helpers.LevelEntry(8, SacredWordPlus2, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(10, SacredWordFeature1d10));
            addFeatures.Add(Helpers.LevelEntry(12, SacredWordPlus3, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(15, SacredWordFeature2d6));
            addFeatures.Add(Helpers.LevelEntry(16, SacredWordPlus4, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(20, SacredWordPlus5, WordOfGod, SacredWordFeature2d8));


            BlueprintFeature JudgmentAdditionalUse = library.Get <BlueprintFeature>("ee50875819478774b8968701893b52f5"); //JudgmentAdditionalUse
            BlueprintFeature SecondJudgment        = library.Get <BlueprintFeature>("33bf0404b70d65f42acac989ec5295b2"); // SecondJudgment
            BlueprintFeature ThirdJudgment         = library.Get <BlueprintFeature>("490c7e92b22cc8a4bb4885a027b355db"); // ThirdJudgment

            List <LevelEntry> removeFeatures = new List <LevelEntry>();

            removeFeatures.Add(Helpers.LevelEntry(1, library.Get <BlueprintFeature>("981def910b98200499c0c8f85a78bde8"))); //JudgmentFeature
            removeFeatures.Add(Helpers.LevelEntry(2, library.Get <BlueprintFeature>("6be8b4031d8b9fc4f879b72b5428f1e0"))); //CunningInitiative
            removeFeatures.Add(Helpers.LevelEntry(4, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(5, library.Get <BlueprintFeature>("7ddf7fbeecbe78342b83171d888028cf"))); //InquisitorBaneNormalFeatureAdd
            removeFeatures.Add(Helpers.LevelEntry(7, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(8, SecondJudgment));
            removeFeatures.Add(Helpers.LevelEntry(10, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(12, library.Get <BlueprintFeature>("6e694114b2f9e0e40a6da5d13736ff33")));//InquisitorBaneGreaterFeature
            removeFeatures.Add(Helpers.LevelEntry(13, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(16, JudgmentAdditionalUse, ThirdJudgment));
            removeFeatures.Add(Helpers.LevelEntry(19, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(20, TrueJudgmentFeature));

            livingGrimoire.AddFeatures    = addFeatures.ToArray();
            livingGrimoire.RemoveFeatures = removeFeatures.ToArray();

            UIGroup SacredWordGroup = new UIGroup();

            SacredWordGroup.Features.Add(SacredWordFeature);
            SacredWordGroup.Features.Add(SacredWordFeatureLevel4);
            SacredWordGroup.Features.Add(SacredWordPlus2);
            SacredWordGroup.Features.Add(SacredWordPlus3);
            SacredWordGroup.Features.Add(SacredWordPlus4);
            SacredWordGroup.Features.Add(SacredWordPlus5);
            SacredWordGroup.Features.Add(SacredWordFeature1d8);
            SacredWordGroup.Features.Add(SacredWordFeature1d10);
            SacredWordGroup.Features.Add(SacredWordFeature2d6);
            SacredWordGroup.Features.Add(SacredWordFeature2d8);
            inquisitorProgression.UIGroups = inquisitorProgression.UIGroups.AddToArray(SacredWordGroup);
            UIGroup BlessedScriptGroup = new UIGroup();

            BlessedScriptGroup.Features.Add(BlessedScriptSelection);
            inquisitorProgression.UIGroups = inquisitorProgression.UIGroups.AddToArray(BlessedScriptGroup);

            List <BlueprintArchetype> archetypes = inquisitor.Archetypes.ToList();

            archetypes.Insert(0, livingGrimoire);
            inquisitor.Archetypes = archetypes.ToArray();
        }