//subordinate spell
        //dispelling pulse

        public PhrenicAmplificationsEngine(BlueprintAbilityResource pool_resource, BlueprintSpellbook linked_spellbook, BlueprintCharacterClass linked_class, string asset_prefix)
        {
            resource        = pool_resource;
            spellbook       = linked_spellbook;
            character_class = linked_class;
            name_prefix     = asset_prefix;
        }
Exemplo n.º 2
0
        public static void SetIncreasedByLevelStartPlusDivStep(this BlueprintAbilityResource resource, int baseValue,
                                                               int startingLevel, int startingIncrease, int levelStep, int perStepIncrease, int minClassLevelIncrease, float otherClassesModifier,
                                                               BlueprintCharacterClass[] classes, BlueprintArchetype[] archetypes = null)
        {
            var amount = getMaxAmount(resource);

            Helpers.SetField(amount, "BaseValue", baseValue);
            Helpers.SetField(amount, "IncreasedByLevelStartPlusDivStep", true);
            Helpers.SetField(amount, "StartingLevel", startingLevel);
            Helpers.SetField(amount, "StartingIncrease", startingIncrease);
            Helpers.SetField(amount, "LevelStep", levelStep);
            Helpers.SetField(amount, "PerStepIncrease", perStepIncrease);
            Helpers.SetField(amount, "MinClassLevelIncrease", minClassLevelIncrease);
            Helpers.SetField(amount, "OtherClassesModifier", otherClassesModifier);

            Helpers.SetField(amount, "ClassDiv", classes);
            var emptyArchetypes = Array.Empty <BlueprintArchetype>();

            Helpers.SetField(amount, "ArchetypesDiv", archetypes ?? emptyArchetypes);

            // Enusre arrays are at least initialized to empty.
            var fieldName = "Class";

            if (Helpers.GetField(amount, fieldName) == null)
            {
                Helpers.SetField(amount, fieldName, Array.Empty <BlueprintCharacterClass>());
            }
            fieldName = "Archetypes";
            if (Helpers.GetField(amount, fieldName) == null)
            {
                Helpers.SetField(amount, fieldName, emptyArchetypes);
            }

            setMaxAmount(resource, amount);
        }
Exemplo n.º 3
0
        //static readonly Type blueprintAbilityResource_Amount = Harmony12.AccessTools.Inner(typeof(BlueprintAbilityResource), "Amount");

        public static void SetIncreasedByLevel(this BlueprintAbilityResource resource, int baseValue, int levelIncrease, BlueprintCharacterClass[] classes, BlueprintArchetype[] archetypes = null)
        {
            var amount = getMaxAmount(resource);

            Helpers.SetField(amount, "BaseValue", baseValue);
            Helpers.SetField(amount, "IncreasedByLevel", true);
            Helpers.SetField(amount, "LevelIncrease", levelIncrease);
            Helpers.SetField(amount, "Class", classes);
            var emptyArchetypes = Array.Empty <BlueprintArchetype>();

            Helpers.SetField(amount, "Archetypes", archetypes ?? emptyArchetypes);

            // Enusre arrays are at least initialized to empty.
            var field = "ClassDiv";

            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, Array.Empty <BlueprintCharacterClass>());
            }
            field = "ArchetypesDiv";
            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, emptyArchetypes);
            }

            setMaxAmount(resource, amount);
        }
Exemplo n.º 4
0
        public static void SetIncreasedByStat(this BlueprintAbilityResource resource, int baseValue, StatType stat)
        {
            var amount = getMaxAmount(resource);

            Helpers.SetField(amount, "BaseValue", baseValue);
            Helpers.SetField(amount, "IncreasedByStat", true);
            Helpers.SetField(amount, "ResourceBonusStat", stat);

            // Enusre arrays are at least initialized to empty.
            var emptyClasses    = Array.Empty <BlueprintCharacterClass>();
            var emptyArchetypes = Array.Empty <BlueprintArchetype>();
            var field           = "Class";

            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, emptyClasses);
            }
            field = "ClassDiv";
            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, emptyClasses);
            }
            field = "Archetypes";
            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, emptyArchetypes);
            }
            field = "ArchetypesDiv";
            if (Helpers.GetField(amount, field) == null)
            {
                Helpers.SetField(amount, field, emptyArchetypes);
            }

            setMaxAmount(resource, amount);
        }
Exemplo n.º 5
0
        static public BlueprintFeature CreateReservoir()
        {
            if (library.BlueprintsByAssetId.ContainsKey("46c10437728d31d5b7611eb34f6cb011"))
            {
                // has created arcane reservoir already.
                return(library.Get <BlueprintFeature>("46c10437728d31d5b7611eb34f6cb011"));
            }
            Sprite          icon_AR        = library.Get <BlueprintFeature>("55edf82380a1c8540af6c6037d34f322").Icon;//use icon of Elven Magic(elf race feature)
            LocalizedString reservoir_name = Helpers.CreateString("ArcanistClass.Reservoir.Name");
            LocalizedString reservoir_desc = Helpers.CreateString("ArcanistClass.Reservoir.Desc");

            BlueprintAbilityResource reservoir_resource = Helpers.CreateAbilityResource("ArcanistArcaneReservoirResource",
                                                                                        "", "",
                                                                                        "b0fb97baca84839a03906195bbc06a1b",//MD5-32[ArcanistClass.ArcaneReservoir.Resource]
                                                                                        icon_AR);

            reservoir_resource.LocalizedName        = reservoir_name;
            reservoir_resource.LocalizedDescription = reservoir_desc;
            resource = reservoir_resource;
            resource.SetIncreasedByLevel(3, 1, new BlueprintCharacterClass[] { arcanist });

            var comp1 = Helpers.Create <AddAbilityResources>(a => a.Resource = resource);

            comp1.RestoreAmount = false;
            comp1.Amount        = 3;
            reservoir           = Helpers.CreateFeature("ArcanistClassArcaneReservoir",
                                                        "", "", "46c10437728d31d5b7611eb34f6cb011",//MD5-32[ArcanistClass.ArcaneReservoir]
                                                        icon_AR,
                                                        FeatureGroup.None,
                                                        comp1);
            reservoir.SetName(reservoir_name);
            reservoir.SetDescription(reservoir_desc);
            return(reservoir);
        }
        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.º 7
0
        internal static BlueprintBuff CreateBuffForAbility(BlueprintBuff realBuff, String assetId,
                                                           BlueprintAbilityResource resource, DurationRate duration,
                                                           bool dispellable = true, bool removeWhenTurnedOff = false)
        {
            // Clone the real buff, but remove its functionality and UI.
            var clonedBuff = UnityEngine.Object.Instantiate(realBuff);

            clonedBuff.name = $"{realBuff.name}ResourceBuff";
            Main.library.AddAsset(clonedBuff, Helpers.MergeIds(realBuff.AssetGuid, assetId));
            var flags = realBuff.GetBuffFlags();

            clonedBuff.SetBuffFlags(flags | BuffFlags.HiddenInUi);
            clonedBuff.FxOnStart  = new PrefabLink();
            clonedBuff.FxOnRemove = new PrefabLink();

            var logic = Helpers.Create <LingeringBuffLogic>();

            logic.RequiredResource    = resource;
            logic.BuffDuration        = duration;
            logic.RealBuff            = realBuff;
            logic.Dispellable         = dispellable;
            logic.RemoveWhenTurnedOff = removeWhenTurnedOff;

            clonedBuff.SetComponents(logic);
            return(clonedBuff);
        }
        public static ResourceIsFullChecker Create(BlueprintAbilityResource resource, bool not)
        {
            var r = Helpers.Create <ResourceIsFullChecker>();

            r.Resource = resource;
            r.Not      = not;
            return(r);
        }
 public void CalculateMaxResourceAmount(BlueprintAbilityResource resource, ref int bonus)
 {
     if (!this.Fact.Active || (resource != this.Resource))
     {
         return;
     }
     bonus += this.Value.Calculate(this.Fact.MaybeContext);
 }
Exemplo n.º 10
0
        public static RunActionOnFailedSave Create(BlueprintAbilityResource resource, SpellDescriptor descriptor, GameAction failedSave)
        {
            var i = Helpers.Create <RunActionOnFailedSave>();

            i.Resource     = resource;
            i.Descriptor   = descriptor;
            i.OnFailedSave = Helpers.CreateActionList(failedSave);
            return(i);
        }
        public static RetrySkillCheckLogic Create(BlueprintAbilityResource resource, ContextValue value, params StatType[] stats)
        {
            var r = Helpers.Create <RetrySkillCheckLogic>();

            r.RequiredResource = resource;
            r.Value            = value;
            r.Stats            = stats;
            return(r);
        }
Exemplo n.º 12
0
 public ImplementsEngine(string name_prefix, BlueprintAbilityResource ability_resource, BlueprintCharacterClass[] scaling_classes, StatType scaling_stat, bool check_focus_investment = true, BlueprintArchetype scaling_archetype = null)
 {
     stat                 = scaling_stat;
     classes              = scaling_classes;
     archetype            = scaling_archetype;
     resource             = ability_resource;
     prefix               = name_prefix + "Implement";
     check_invested_focus = check_focus_investment;
 }
Exemplo n.º 13
0
        static bool Prefix(BlueprintAbilityResource __instance, UnitDescriptor unit, ref int __result)
        {
            try
            {
                var self   = __instance;
                var amount = ExtensionMethods.getMaxAmount(self);
                if ((bool)getIncreasedByLevel(amount))
                {
                    var classes = (BlueprintCharacterClass[])getClass(amount);
                    if (classes?.Contains(Helpers.sorcererClass) == true)
                    {
                        var level = unit.Get <UnitPartBloodline>()?.CalcLevel(self);
                        if (level.HasValue)
                        {
                            int num   = (int)getBaseValue(amount) + level.Value * (int)getLevelIncrease(amount);
                            int bonus = 0;
                            EventBus.RaiseEvent(unit.Unit, (IResourceAmountBonusHandler h) => h.CalculateMaxResourceAmount(self, ref bonus));
                            __result = (int)applyMinMax(self, num) + bonus;
                            Log.Write($"BlueprintAbilityResource: modify amount of {self.name}: {__result}");
                            return(false);
                        }
                    }
                }
                else if ((bool)getIncreasedByLevelStartPlusDivStep(amount))
                {
                    var classes = (BlueprintCharacterClass[])getClassDiv(amount);
                    if (classes?.Contains(Helpers.sorcererClass) == true)
                    {
                        var level = unit.Get <UnitPartBloodline>()?.CalcLevel(self);
                        if (level.HasValue)
                        {
                            int num        = (int)getBaseValue(amount);
                            int totalLevel = level.Value;
                            totalLevel += (int)((unit.Progression.CharacterLevel - totalLevel) * (float)getOtherClassesModifier(amount));
                            if ((int)getStartingLevel(amount) <= totalLevel)
                            {
                                num += Math.Max((int)getStartingIncrease(amount) + (int)getPerStepIncrease(amount) * (totalLevel - (int)getStartingLevel(amount)) / (int)getLevelStep(amount), (int)getMinClassLevelIncrease(amount));
                            }

                            int bonus = 0;
                            EventBus.RaiseEvent(unit.Unit, (IResourceAmountBonusHandler h) => h.CalculateMaxResourceAmount(self, ref bonus));
                            __result = (int)applyMinMax(self, num) + bonus;
                            Log.Write($"BlueprintAbilityResource: modify amount of {self.name} (start plus div step): {__result}");
                            return(false);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
            return(true);
        }
Exemplo n.º 14
0
        static void createHealingBuffer()
        {
            var healing_burst  = library.Get <BlueprintAbility>("db611ffeefb8f1e4f88e7d5393fc651d");
            var kinetic_healer = library.Get <BlueprintAbility>("eff667a3a43a77d45a193bb7c94b3a6c"); //kinetic healer
            var heal_varinats  = kinetic_healer.GetComponent <AbilityVariants>();

            var buffer_resource = Helpers.CreateAbilityResource("KineticistHelearBufferResource", "", "", "", null);

            buffer_resource.SetFixedResource(1);

            var icon           = Helpers.GetIcon("be2062d6d85f4634ea4f26e9e858c3b8"); //cleanse
            var spend_resource = Helpers.Create <NewMechanics.ContextActionSpendResource>(s => s.resource = buffer_resource);
            var buff           = Helpers.CreateBuff("HealerBufferBuff",
                                                    "Healer Buffer",
                                                    "At 6th level, a kinetic chirurgeon’s internal buffer has double the usual maximum size, and she can use it only when she would accept points of burn for the kinetic healer wild talent.\n"
                                                    + "Internal Buffer: At 6th level, a kineticist’s study of her body and the elemental forces that course through it allow her to form an internal buffer to store extra energy.\n" +
                                                    "When she would otherwise accept burn, a kineticist can spend energy from her buffer to avoid accepting 1 point of burn. She can do it once per day. Kineticist gets an additional use of this ability at levels 11 and 16.",
                                                    "",
                                                    icon,
                                                    null,
                                                    Helpers.Create <KineticistMechanics.DecreaseWildTalentCostForSpecificTalents>(a =>
            {
                a.actions   = Helpers.CreateActionList(spend_resource);
                a.abilities = heal_varinats.Variants.Where(v => v.GetComponent <AbilityKineticist>().WildTalentBurnCost > 0).ToArray().AddToArray(healing_burst);
            }
                                                                                                                                  )
                                                    );

            var ability = Helpers.CreateActivatableAbility("HealerBufferActivatableAbility",
                                                           buff.Name,
                                                           buff.Description,
                                                           "",
                                                           buff.Icon,
                                                           buff,
                                                           AbilityActivationType.Immediately,
                                                           UnitCommand.CommandType.Free,
                                                           null,
                                                           Helpers.CreateActivatableResourceLogic(buffer_resource, ActivatableAbilityResourceLogic.ResourceSpendType.Never)
                                                           );

            ability.DeactivateImmediately = true;

            healing_buffer = Common.ActivatableAbilityToFeature(ability, hide: false);
            healing_buffer.AddComponents(Helpers.CreateAddAbilityResource(buffer_resource),
                                         Helpers.Create <ResourceMechanics.ContextIncreaseResourceAmount>(c => { c.Resource = buffer_resource; c.Value = Helpers.CreateContextValue(AbilityRankType.Default); }),
                                         Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, ContextRankProgression.StartPlusDoubleDivStep, startLevel: 6, stepLevel: 5,
                                                                         classes: new BlueprintCharacterClass[] { archetype.GetParentClass() }
                                                                         )
                                         );
            healing_buffer.ReapplyOnLevelUp = true;

            healing_buffer_resource = buffer_resource;
        }
Exemplo n.º 15
0
        static void createKiPool()
        {
            var rogue_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("299aa766dee3cbf4790da4efb8c72484");

            ki_resource = Helpers.CreateAbilityResource("NinjaKiResource", "", "", "", null);
            ki_resource.SetIncreasedByStat(0, StatType.Charisma);
            ki_resource.SetIncreasedByLevelStartPlusDivStep(0, 0, 0, 2, 1, 0, 0.0f, getRogueArray());

            var buff_extra_attack = library.Get <BlueprintBuff>("cadf8a5c42002494cabfc6c1196b514a");

            buff_extra_attack.SetNameDescription("", ""); //inherit from parent ability

            var ki_extra_attack = library.CopyAndAdd <BlueprintAbility>("ca948bb4ce1a2014fbf4d8d44b553074", "NinjaKiExtraAttackAbility", "");

            ki_extra_attack.SetDescription("By spending 1 point from his ki pool as a swift action, a ninja can make one additional attack at his highest attack bonus when making a full attack. This bonus attack stacks with haste and similar effects.");
            ki_extra_attack.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = ki_resource);

            var ki_speed_buff = library.CopyAndAdd <BlueprintBuff>("9ea4ec3dc30cd7940a372a4d699032e7", "NinjaKiSpeedBoostBuff", "");

            ki_speed_buff.ReplaceComponent <BuffMovementSpeed>(b => b.Value = 20);
            var ki_speed_burst = library.CopyAndAdd <BlueprintAbility>("8c98b8f3ac90fa245afe14116e48c7da", "NinjaKiSpeedBoostAbility", "");

            var new_actions = Common.changeAction <ContextActionApplyBuff>(ki_speed_burst.GetComponent <AbilityEffectRunAction>().Actions.Actions,
                                                                           c =>
            {
                c.Buff          = ki_speed_buff;
                c.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Rounds);
            }
                                                                           );

            ki_speed_burst.ReplaceComponent <AbilityEffectRunAction>(Helpers.CreateRunActions(new_actions));
            ki_speed_burst.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = ki_resource);
            ki_speed_burst.SetNameDescription("Ki Speed Burst",
                                              "A ninja with this ki power can spend 1 point from his ki pool as a swift action to grant himself a sudden burst of speed. This increases the ninja's base land speed by 20 feet for 1 round.");


            var ki_extra_attack_feature = Common.AbilityToFeature(ki_extra_attack);

            ki_pool = Helpers.CreateFeature("KiPoolNinjaFeature",
                                            "Ki Pool",
                                            "At 2nd level, a ninja gains a pool of ki points, supernatural energy she can use to accomplish amazing feats. The number of points in the ninja’s ki pool is equal to 1/2 her ninja level + her Charisma modifier.\n"
                                            + "By spending 1 point from her ki pool, a ninja can make one additional attack at her highest attack bonus, but she can do so only when making a full attack. In addition, she can spend 1 point to increase her speed by 20 feet for 1 round. Each of these powers is activated as a swift action. A ninja can gain additional powers that consume points from her ki pool by selecting certain ninja tricks.",
                                            "",
                                            null,
                                            FeatureGroup.None,
                                            Helpers.CreateAddFacts(ki_speed_burst),
                                            Helpers.CreateAddFeatureOnClassLevel(ki_extra_attack_feature, 5, new BlueprintCharacterClass[] { archetype.GetParentClass() }, before: true),
                                            ki_resource.CreateAddAbilityResource());

            ninja_ki_extra_attack_ability = ki_extra_attack;
        }
Exemplo n.º 16
0
        static void Postfix(BlueprintAbilityResource __instance, UnitDescriptor unit, ref int __result)
        {
            var min_resource_component = __instance.GetComponent <MinResourceAmount>();

            if (min_resource_component == null)
            {
                return;
            }

            if (__result < min_resource_component.value)
            {
                __result = min_resource_component.value;
            }
        }
Exemplo n.º 17
0
        public BlueprintAbilityResource[] getConnectedResource(BlueprintAbilityResource base_resource)
        {
            foreach (var b in buffs)
            {
                var r = b.Blueprint.GetComponent <ConnectResource>();
                if (r == null || r.base_resource != base_resource)
                {
                    continue;
                }
                return(r.connected_resources);
            }

            return(null);
        }
Exemplo n.º 18
0
        public BlueprintFeature createLifeDrain(BlueprintAbilityResource initial_resource)
        {
            var enervation = library.Get <BlueprintAbility>("f34fb78eaaec141469079af124bcfa0f");

            var actions = new ActionList[4];

            for (int i = 0; i < actions.Length; i++)
            {
                var level_drain = Helpers.CreateActionEnergyDrain(Helpers.CreateContextDiceValue(DiceType.Zero, 0, i + 1),
                                                                  Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default), DurationRate.Minutes),
                                                                  Kingmaker.RuleSystem.Rules.EnergyDrainType.Temporary
                                                                  );

                var recover_hp = Common.createContextActionOnContextCaster(Common.createContextActionHealTarget(Helpers.CreateContextDiceValue(DiceType.Zero, 0, Helpers.CreateContextValue(AbilityRankType.Default))));

                var effect = Helpers.CreateConditional(Common.createContextConditionHasFacts(false, Common.undead, Common.elemental, Common.construct),
                                                       new GameAction[0],
                                                       new GameAction[] { level_drain }.AddToArray(Enumerable.Repeat(recover_hp, i + 1))
                                                       );
                actions[i] = Helpers.CreateActionList(effect);
            }

            var ability = Helpers.CreateAbility(prefix + "LifeDrainAbility",
                                                "Life Drain",
                                                "At 8th level, a necroccultist can expend 1 point of mental focus from a necromancy implement to unleash a life-draining ray as a ranged touch attack that causes the target to accrue 1d4 negative levels. The ray has a medium range. The negative levels last a number of minutes equal to the necroccultist’s occultist level.\n"
                                                + "For each negative level this attack gives a target, the necroccultist regains a number of hit points equal to his occultist level. The necroccultist can use this ability once per day at 8th level, plus one additional time per day for every 3 occultist levels thereafter.",
                                                "",
                                                enervation.Icon,
                                                AbilityType.SpellLike,
                                                CommandType.Standard,
                                                AbilityRange.Medium,
                                                "",
                                                "",
                                                Helpers.CreateRunActions(Common.createContextActionRandomize(actions)),
                                                Helpers.CreateSpellDescriptor(SpellDescriptor.Death),
                                                Helpers.CreateSpellComponent(SpellSchool.Necromancy),
                                                enervation.GetComponent <AbilityDeliverProjectile>(),
                                                createClassScalingConfig(),
                                                createDCScaling(),
                                                initial_resource.CreateResourceLogic()
                                                );

            ability.setMiscAbilityParametersSingleTargetRangedHarmful(true);
            ability.SpellResistance = true;

            addFocusInvestmentCheck(ability, SpellSchool.Necromancy);

            return(Common.AbilityToFeature(ability, false));
        }
Exemplo n.º 19
0
        public BlueprintFeature createCombatTrick(BlueprintAbilityResource reduced_resource)
        {
            var feature = Helpers.CreateFeatureSelection(prefix + "CombatTrickFeature",
                                                         "Combat Trick",
                                                         "You receive one combat feat.",
                                                         "",
                                                         null,
                                                         FeatureGroup.None
                                                         );

            feature.AddComponent(Helpers.PrerequisiteNoFeature(feature));
            feature.AllFeatures = library.Get <BlueprintFeatureSelection>("41c8486641f7d6d4283ca9dae4147a9f").AllFeatures;

            return(feature);
        }
 static void Postfix(AbilityData __instance, ref int __result)
 {
     if (__result == -1 && __instance.ConvertedFrom != null)
     {
         if (__instance.Blueprint != null)
         {
             AbilityResourceLogic     abilityResourceLogic     = __instance.Blueprint.GetComponents <AbilityResourceLogic>().FirstOrDefault <AbilityResourceLogic>();
             BlueprintAbilityResource blueprintAbilityResource = (abilityResourceLogic != null && abilityResourceLogic.IsSpendResource) ? abilityResourceLogic.RequiredResource : null;
             if (blueprintAbilityResource != null)
             {
                 __result = __instance.Fact.Owner.Resources.GetResourceAmount(blueprintAbilityResource) / abilityResourceLogic.CalculateCost(__instance);
             }
         }
     }
 }
        public BlueprintFeature createMetamagicKnowledge(BlueprintAbilityResource reduced_resource)
        {
            var metamagics = library.GetAllBlueprints().OfType <BlueprintFeature>().Where(b => b.Groups.Contains(FeatureGroup.WizardFeat) && (b.GetComponent <AddMetamagicFeat>() != null)).ToArray();
            var feature    = Helpers.CreateFeatureSelection(prefix + "MetamagicKnowledgeFeature",
                                                            "Metamagic Knowledge",
                                                            "You receive one metamagic feat.",
                                                            "",
                                                            null,
                                                            FeatureGroup.None
                                                            );

            feature.AllFeatures = metamagics;
            feature.AddComponent(Helpers.PrerequisiteNoFeature(feature));

            return(feature);
        }
Exemplo n.º 22
0
        public BlueprintFeature createCombatTrick(BlueprintAbilityResource reduced_resource)
        {
            var feature = Helpers.CreateFeatureSelection(prefix + "CombatTrickFeature",
                                                         "Combat Trick",
                                                         "You receive one combat feat. This also permanently reduce your mental focus pool by 2.",
                                                         "",
                                                         null,
                                                         FeatureGroup.None,
                                                         Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = reduced_resource; i.Value = -2; })
                                                         );

            feature.AddComponent(Helpers.PrerequisiteNoFeature(feature));
            feature.AllFeatures = library.Get <BlueprintFeatureSelection>("41c8486641f7d6d4283ca9dae4147a9f").AllFeatures;

            return(feature);
        }
        public BlueprintFeature createMetamagicKnowledge(BlueprintAbilityResource reduced_resource)
        {
            var metamagics = library.GetAllBlueprints().OfType <BlueprintFeature>().Where(b => b.Groups.Contains(FeatureGroup.WizardFeat) && (b.GetComponent <AddMetamagicFeat>() != null)).ToArray();
            var feature    = Helpers.CreateFeatureSelection(prefix + "MetamagicKnowledgeFeature",
                                                            "Metamagic Knowledge",
                                                            "You receive one metamagic feat. This also permanently reduce your mental focus pool by 3.",
                                                            "",
                                                            null,
                                                            FeatureGroup.None,
                                                            Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = reduced_resource; i.Value = -3; })
                                                            );

            feature.AllFeatures = metamagics;
            feature.AddComponent(Helpers.PrerequisiteNoFeature(feature));

            return(feature);
        }
Exemplo n.º 24
0
        static BlueprintFeature CreateChannel()
        {
            var channelEnergy       = library.Get <BlueprintAbility>("f5fc9a1a2a3c1a946a31b320d1dd31b2");
            var channelPositiveHarm = library.Get <BlueprintAbility>("279447a6bf2d3544d93a0a39c3b8e91d");

            var feat = Helpers.CreateFeature("MysteryLifeChannel", "Channel Energy",
                                             "You can channel positive energy like a cleric, using your oracle level as your effective cleric level when determining the amount of damage healed (or caused to undead) and the DC. " +
                                             "You can use this ability a number of times per day equal to 1+your Charisma modifier.",
                                             "86763655ebbc406f8a4d9a58415847d5",
                                             channelEnergy.Icon, FeatureGroup.None);
            var resource = library.CopyAndAdd <BlueprintAbilityResource>("5e2bba3e07c37be42909a12945c27de7", // channel energy resource
                                                                         $"{feat.name}Resource", "fd1b7cfdcc2e4eb29c6ecdd4f5e378a4");

            resource.SetIncreasedByStat(1, StatType.Charisma);
            channelResource = resource;

            var lifeChannel     = library.CopyAndAdd(channelEnergy, $"{feat.name}Heal", "bfa9138753e3431a99043773f94f40ee");
            var lifeChannelHarm = library.CopyAndAdd(channelPositiveHarm, $"{feat.name}HarmUndead", "ed2cda862d97431ea13dcbbf27359e3b");

            lifeChannel.ReplaceResourceLogic(resource);
            lifeChannel.ReplaceContextRankConfig(Helpers.CreateContextRankConfig(
                                                     ContextRankBaseValueType.ClassLevel, ContextRankProgression.OnePlusDiv2, classes: oracleArray));

            lifeChannelHarm.ReplaceResourceLogic(resource);
            lifeChannelHarm.ReplaceContextRankConfig(Helpers.CreateContextRankConfig(
                                                         ContextRankBaseValueType.ClassLevel, ContextRankProgression.OnePlusDiv2, classes: oracleArray));

            feat.SetComponents(resource.CreateAddAbilityResource(),
                               lifeChannel.CreateAddFact(), lifeChannelHarm.CreateAddFact());

            // Add Extra Channel, fix Selective Channel
            var extraChannel = library.CopyAndAdd <BlueprintFeature>("cd9f19775bd9d3343a31a065e93f0c47",
                                                                     "ExtraChannelOracle", "670d560ed7fe4329b2d311eba3600949");

            extraChannel.SetName("Extra Channel (Oracle)");
            extraChannel.SetComponents(feat.PrerequisiteFeature(), resource.CreateIncreaseResourceAmount(2));
            library.AddFeats(extraChannel);

            var selectiveChannel = library.Get <BlueprintFeature>("fd30c69417b434d47b6b03b9c1f568ff");

            selectiveChannel.AddComponent(feat.PrerequisiteFeature(true));

            return(feat);
        }
            private static bool Prefix(BlueprintAbilityResource __instance, UnitDescriptor unit, ref int __result)
            {
                if (__instance.GetType() == typeof(WarriorSpiritPoolLogic))
                {
                    __result = 0;
                    if (unit.Progression.GetClassLevel(Helpers.fighterClass) >= 5)
                    {
                        int basePool = 1;

                        int weaponTrainingValue = AdvancedWeaponTraining.GetWeaponTrainingRank(unit, ((WarriorSpiritPoolLogic)__instance).WeaponTraining);

                        __result = basePool + weaponTrainingValue;
                    }

                    return(false);
                }

                return(true);
            }
        static BlueprintFeature CreateChannel()
        {
            var channelEnergy       = library.Get <BlueprintAbility>("f5fc9a1a2a3c1a946a31b320d1dd31b2");
            var channelPositiveHarm = library.Get <BlueprintAbility>("279447a6bf2d3544d93a0a39c3b8e91d");

            var feat = Helpers.CreateFeature("MysteryLifeChannel", "导引能量",
                                             "你可以像牧师一样引导正能量。当决定你的导能的治疗效果或者对不死生物的伤害和豁免DC时,使用你的先知等级作为有效牧师等级。 " +
                                             "你每天可以导引能量的次数为1+你的魅力调整值。",
                                             "86763655ebbc406f8a4d9a58415847d5",
                                             channelEnergy.Icon, FeatureGroup.None);
            var resource = library.CopyAndAdd <BlueprintAbilityResource>("5e2bba3e07c37be42909a12945c27de7", // channel energy resource
                                                                         $"{feat.name}Resource", "fd1b7cfdcc2e4eb29c6ecdd4f5e378a4");

            resource.SetIncreasedByStat(1, StatType.Charisma);
            channelResource = resource;

            var lifeChannel     = library.CopyAndAdd(channelEnergy, $"{feat.name}Heal", "bfa9138753e3431a99043773f94f40ee");
            var lifeChannelHarm = library.CopyAndAdd(channelPositiveHarm, $"{feat.name}HarmUndead", "ed2cda862d97431ea13dcbbf27359e3b");

            lifeChannel.ReplaceResourceLogic(resource);
            lifeChannel.ReplaceContextRankConfig(Helpers.CreateContextRankConfig(
                                                     ContextRankBaseValueType.ClassLevel, ContextRankProgression.OnePlusDiv2, classes: oracleArray));

            lifeChannelHarm.ReplaceResourceLogic(resource);
            lifeChannelHarm.ReplaceContextRankConfig(Helpers.CreateContextRankConfig(
                                                         ContextRankBaseValueType.ClassLevel, ContextRankProgression.OnePlusDiv2, classes: oracleArray));

            feat.SetComponents(resource.CreateAddAbilityResource(),
                               lifeChannel.CreateAddFact(), lifeChannelHarm.CreateAddFact());

            // Add Extra Channel, fix Selective Channel
            var extraChannel = library.CopyAndAdd <BlueprintFeature>("cd9f19775bd9d3343a31a065e93f0c47",
                                                                     "ExtraChannelOracle", "670d560ed7fe4329b2d311eba3600949");

            extraChannel.SetName("额外导能 (先知)");
            extraChannel.SetComponents(feat.PrerequisiteFeature(), resource.CreateIncreaseResourceAmount(2));
            library.AddFeats(extraChannel);

            var selectiveChannel = library.Get <BlueprintFeature>("fd30c69417b434d47b6b03b9c1f568ff");

            selectiveChannel.AddComponent(feat.PrerequisiteFeature(true));
            return(feat);
        }
        public void CalculateMaxResourceAmount(BlueprintAbilityResource resource, ref int bonus)
        {
            if (!this.Fact.Active || ((Object)resource != (Object)this.resource))
            {
                return;
            }
            var unit_part = this.Owner.Get <UnitPartImplements>();

            if (unit_part == null)
            {
                return;
            }

            if (locked_focus && !unit_part.isLocked())
            {
                return;
            }
            bonus += unit_part.getInvestedFocusAmount(school);
        }
Exemplo n.º 28
0
        static void createSoloTactics()
        {
            var inquisitor_solo_tactics = library.Get <BlueprintFeature>("5602845cd22683840a6f28ec46331051");
            var swift_tactician         = library.Get <BlueprintFeature>("4ca47c023f1c158428bd55deb44c735f");
            var solo_tactics_buff       = Helpers.CreateBuff("VindicativeBastardSoloTacticsBuff",
                                                             "Solo Tactics",
                                                             "At 2nd level, a vindictive bastard gains solo tactics, as per the inquisitor class feature. She can activate this ability as a swift action and gains the benefits of it for 1 round. She can use this ability a number of rounds per day equal to half her paladin level + her Charisma modifier.",
                                                             "",
                                                             swift_tactician.Icon,
                                                             null,
                                                             inquisitor_solo_tactics.ComponentsArray[0]);

            solo_tactics_resource = Helpers.CreateAbilityResource("HolyVindicatorSoloTacticsResource", "", "", "", null);
            solo_tactics_resource.SetIncreasedByStat(0, StatType.Charisma);
            solo_tactics_resource.SetIncreasedByLevelStartPlusDivStep(0, 2, 1, 2, 1, 0, 0.0f, getVindicativeBastardArray());

            var solo_tactics_ability = Helpers.CreateActivatableAbility("VindicativeBastardSoloTacticsActivatableAbility",
                                                                        solo_tactics_buff.Name,
                                                                        solo_tactics_buff.Description,
                                                                        "",
                                                                        solo_tactics_buff.Icon,
                                                                        solo_tactics_buff,
                                                                        AbilityActivationType.Immediately,
                                                                        CommandType.Free,
                                                                        null,
                                                                        Helpers.CreateActivatableResourceLogic(solo_tactics_resource, ResourceSpendType.NewRound)
                                                                        );

            if (!test_mode)
            {
                Helpers.SetField(solo_tactics_ability, "m_ActivateWithUnitCommand", CommandType.Swift);
                solo_tactics_ability.DeactivateIfCombatEnded = true;
                solo_tactics_ability.AddComponent(Common.createActivatableAbilityUnitCommand(CommandType.Swift));
            }

            solo_tactics = Common.ActivatableAbilityToFeature(solo_tactics_ability, false);
            solo_tactics.AddComponent(Helpers.CreateAddAbilityResource(solo_tactics_resource));
        }
Exemplo n.º 29
0
 public static void SetIcon(this BlueprintAbilityResource resource, Sprite icon) => setIcon(resource, icon);
Exemplo n.º 30
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));
        }