Exemple #1
0
        static void createConfidentDefense()
        {
            var monk = library.Get <BlueprintCharacterClass>("e8f21e5b58e0569468e420ebea456124");
            var paladin_proficiencies   = library.Get <BlueprintFeature>("b10ff88c03308b649b50c31611c2fefb");
            var simple_proficiency      = library.Get <BlueprintFeature>("e70ecf1ed95ca2f40b754f1adb22bbdd");
            var martial_proficiency     = library.Get <BlueprintFeature>("203992ef5b35c864390b4e4a1e200629");
            var light_armor_proficiency = library.Get <BlueprintFeature>("6d3728d4e9c9898458fe5e9532951132");

            confident_defense = library.CopyAndAdd(paladin_proficiencies, "IroranPaladinConfidentDefenseFeature", "");
            confident_defense.ReplaceComponent <AddFacts>(a => a.Facts = new BlueprintUnitFact[] { light_armor_proficiency, martial_proficiency, simple_proficiency });


            var scaled_fist_ac = library.Get <BlueprintFeature>("3929bfd1beeeed243970c9fc0cf333f8");

            scaled_fist_ac.SetDescription("");
            scaled_fist_ac.Ranks++;
            foreach (var c in scaled_fist_ac.GetComponents <ContextRankConfig>().ToArray())
            {
                if (c.IsBasedOnClassLevel)
                {
                    //fix it to not to work with normal monk levels
                    var new_c = Helpers.CreateContextRankConfig(ContextRankBaseValueType.SummClassLevelWithArchetype,
                                                                classes: new BlueprintCharacterClass[] { monk },
                                                                type: c.Type,
                                                                archetype: library.Get <BlueprintArchetype>("5868fc82eb11a4244926363983897279"),
                                                                progression: ContextRankProgression.DivStep,
                                                                stepLevel: 4);
                    scaled_fist_ac.ReplaceComponent(c, new_c);
                }
                if (c.IsBasedOnCustomProperty) //for balance fixes (class level limiter on charisma)
                {
                    var property = Helpers.GetField <BlueprintUnitProperty>(c, "m_CustomProperty");
                    var cfg      = property.GetComponent <NewMechanics.ContextValueWithLimitProperty>().max_value;
                    ClassToProgression.addClassToContextRankConfig(archetype.GetParentClass(), new BlueprintArchetype[] { archetype }, cfg, "IroranPaladin", monk);
                }
            }

            confident_defense.AddComponents(Helpers.Create <MonkNoArmorAndMonkWeaponFeatureUnlock>(c => c.NewFact = scaled_fist_ac));
            confident_defense.AddComponents(Helpers.Create <WeaponTrainingMechanics.AddFeatureOnArmor>(a =>
            {
                a.feature         = scaled_fist_ac;
                a.required_armor  = new ArmorProficiencyGroup[] { ArmorProficiencyGroup.Light, ArmorProficiencyGroup.None };
                a.forbidden_armor = new ArmorProficiencyGroup[] { ArmorProficiencyGroup.Buckler, ArmorProficiencyGroup.LightShield, ArmorProficiencyGroup.HeavyShield, ArmorProficiencyGroup.TowerShield };
            }));
            confident_defense.SetNameDescription("Confident Defense",
                                                 $"At 1st level, when wearing light or no armor and not using a shield, an Iroran paladin adds 1 point of his Charisma bonus (if any){(Main.settings.balance_fixes_monk_ac ? " per class level" : "")} as a dodge bonus to his Armor Class. If he is caught flat-footed or otherwise denied his Dexterity bonus, he also loses this bonus. This ability replaces his proficiency with medium armor, heavy armor, and shields.");
        }
            void createGreaterSpiritAbility()
            {
                var resource = Helpers.CreateAbilityResource(prefix + "BodyOfEarthResource", "", "", "", null);

                resource.SetFixedResource(3);

                var icon = library.Get <BlueprintAbility>("4aa7942c3e62a164387a73184bca3fc1").Icon;//disintegrate

                var cooldown_buff = Helpers.CreateBuff(prefix + "BodyOfEarthCooldownBuff",
                                                       "Body of Earth: Cooldown",
                                                       "As a standard action, she can cause jagged pieces of stone to explode from her body in a 10-foot-radius burst. This deals 1d6 points of piercing damage per 2 shaman levels she possesses. A successful Reflex saving throw halves this damage. The shaman can use this ability three times per day, but she must wait 1d4 rounds between each use.",
                                                       "",
                                                       icon,
                                                       null);
                var apply_cooldown = Common.createContextActionApplyBuff(cooldown_buff, Helpers.CreateContextDuration(0, diceType: DiceType.D4, diceCount: 1), dispellable: false);
                var dmg            = Helpers.CreateActionDealDamage(PhysicalDamageForm.Piercing,
                                                                    Helpers.CreateContextDiceValue(DiceType.D6, Helpers.CreateContextValue(AbilityRankType.Default)),
                                                                    isAoE: true, halfIfSaved: true);

                var effect = Helpers.CreateConditional(Common.createContextConditionIsCaster(),
                                                       null,
                                                       Common.createContextActionSavingThrow(SavingThrowType.Reflex, Helpers.CreateActionList(dmg))
                                                       );

                var body_of_Earth_ability = Helpers.CreateAbility(prefix + "BodyOfEarthAbility",
                                                                  "Body of Earth",
                                                                  cooldown_buff.Description,
                                                                  "",
                                                                  icon,
                                                                  AbilityType.Supernatural,
                                                                  CommandType.Standard,
                                                                  AbilityRange.Personal,
                                                                  "",
                                                                  Helpers.reflexHalfDamage,
                                                                  Helpers.CreateRunActions(effect),
                                                                  Helpers.CreateContextRankConfig(baseValueType: ContextRankBaseValueType.ClassLevel, progression: ContextRankProgression.Div2,
                                                                                                  classes: hex_engine.hex_classes),
                                                                  Helpers.CreateAbilityTargetsAround(10.Feet(), TargetType.Any),
                                                                  Common.createAbilitySpawnFx("2644dac00cee8b840a35f2445c4dffd9", anchor: AbilitySpawnFxAnchor.Caster),
                                                                  Common.createContextCalculateAbilityParamsBasedOnClasses(hex_engine.hex_classes, primary_stat),
                                                                  Common.createAbilityExecuteActionOnCast(Helpers.CreateActionList(Common.createContextActionOnContextCaster(apply_cooldown))),
                                                                  Common.createAbilityCasterHasNoFacts(cooldown_buff),
                                                                  Helpers.CreateResourceLogic(resource)
                                                                  );

                body_of_Earth_ability.setMiscAbilityParametersSelfOnly();
                body_of_Earth_ability.AddComponent(Common.createAbilityCasterHasNoFacts(cooldown_buff));

                greater_spirit_ability = Common.AbilityToFeature(body_of_Earth_ability, false);
                greater_spirit_ability.AddComponents(Common.createMaterialDR(Helpers.CreateContextValue(AbilityRankType.Default), PhysicalDamageMaterial.Adamantite),
                                                     Helpers.CreateContextRankConfig(baseValueType: ContextRankBaseValueType.ClassLevel, progression: ContextRankProgression.DivStep,
                                                                                     classes: hex_engine.hex_classes, stepLevel: 4),
                                                     Helpers.CreateAddAbilityResource(resource)
                                                     );
                greater_spirit_ability.SetDescription("The shaman gains DR 2/adamantine. This DR increases by 1 for every 4 levels beyond 8th the shaman possesses. In addition, as a standard action, she can cause jagged pieces of stone to explode from her body in a 10-foot-radius burst. This deals 1d6 points of piercing damage per 2 shaman levels she possesses. A successful Reflex saving throw halves this damage. The shaman can use this ability three times per day, but she must wait 1d4 rounds between each use.");
            }
Exemple #3
0
        static void createClamorOfHeavens()
        {
            var bard_class     = library.Get <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var undead_stunned = library.CopyAndAdd <BlueprintBuff>("09d39b38bb7c6014394b6daced9bacd3", "UndeadStunnedBuff", "");

            undead_stunned.RemoveComponents <SpellDescriptorComponent>();

            var staggered = library.Get <BlueprintBuff>("df3950af5a783bd4d91ab73eb8fa0fd3");
            var blinded   = library.Get <BlueprintBuff>("0ec36e7596a4928489d2049e1e1c76a7");
            var shaken    = library.Get <BlueprintBuff>("25ec6cb6ab1845c48a95f9c20b034220");

            var apply_stun    = Common.createContextActionApplyBuff(undead_stunned, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true, is_child: true);
            var apply_stagger = Common.createContextActionApplyBuff(staggered, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true, is_child: true);
            var apply_blind   = Common.createContextActionApplyBuff(blinded, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true, is_child: true);
            var apply_shaken  = Common.createContextActionApplyBuff(shaken, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true, is_child: true);

            var effect = Helpers.CreateConditional(Common.createContextConditionHasFacts(false, Common.undead, Common.outsider),
                                                   Helpers.CreateConditionalSaved(apply_stagger, apply_stun),
                                                   Helpers.CreateConditionalSaved(apply_shaken, apply_blind)
                                                   );
            var effect_saved = Helpers.CreateActionSavingThrow(SavingThrowType.Will, effect);
            var effect_buff  = Helpers.CreateBuff("ClamorOfHeavensEffectBuff",
                                                  "Clamor Of the Heavens",
                                                  "Effect: Evil creatures that hear the performance and fail a Will save against the effect are blinded and deafened for the duration. On a successful save, they are shaken instead. Undead or creatures with the evil subtype that fail their saves are stunned for the duration, while those that succeed are staggered.\n"
                                                  + "Use: 3 bardic performance rounds, +1 round per additional round of duration.",
                                                  "",
                                                  Helpers.GetIcon("574cf074e8b65e84d9b69a8c6f1af27b"),
                                                  null,
                                                  Common.createContextCalculateAbilityParamsBasedOnClasses(new BlueprintCharacterClass[] { bard_class, Skald.skald_class }, StatType.Charisma),
                                                  Helpers.CreateAddFactContextActions(activated: effect_saved)
                                                  );

            var toggle = Common.createToggleAreaEffect(effect_buff, 30.Feet(), Helpers.CreateConditionsCheckerAnd(Helpers.CreateContextConditionAlignment(AlignmentComponent.Evil)),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("dfc59904273f7ee49ab00e5278d86e16"),
                                                       Common.createPrefabLink("9353083f430e5a44a8e9d6e26faec248")
                                                       );

            toggle.Group = ActivatableAbilityGroup.BardicPerformance;
            toggle.Buff.AddComponent(Helpers.CreateAddFactContextActions(activated: Helpers.Create <ResourceMechanics.ContextActionSpendResourceFromCaster>(a =>
            {
                a.resource = performance_resource;
                a.amount   = 2;
            })));
            toggle.AddComponent(performance_resource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound));
            toggle.AddComponent(Helpers.Create <ResourceMechanics.RestrictionHasEnoughResource>(r => { r.resource = performance_resource; r.amount = 3; }));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            clamor_of_hevens        = Common.ActivatableAbilityToFeature(toggle, false);
            clamor_of_hevens.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            clamor_of_hevens.AddComponents(Helpers.PrerequisiteClassLevel(bard_class, 10, any: true),
                                           Helpers.PrerequisiteClassLevel(Skald.skald_class, 10, any: true));
        }
Exemple #4
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;
        }
        static void createDeceptiveKi()
        {
            deceptive_ki = library.CopyAndAdd <BlueprintFeature>("e9590244effb4be4f830b1e3fffced13", "DeceptiveKiFeature", "");
            deceptive_ki.RemoveComponents <AddFacts>();

            var resource = deceptive_ki.GetComponent <AddAbilityResources>().Resource;

            var ki_feint = library.CopyAndAdd(NewFeats.improved_feint_ability, "KiFeintAbility", "");

            ki_feint.SetNameDescriptionIcon("Ki Feint",
                                            "A sage counselor can spend 1 ki point while performing a flurry of blows to feint an opponent as a swift action, but he can’t spend 1 ki point to make an additional attack when making a flurry of blows.",
                                            LoadIcons.Image2Sprite.Create(@"FeatIcons/FeintingFlurry.png"));
            ki_feint.ActionType = CommandType.Swift;
            ki_feint.AddComponent(resource.CreateResourceLogic());



            var deceptive_ki_buff = Helpers.CreateBuff("DeceptiveKiBuff",
                                                       "Deceptive Ki",
                                                       "At 3rd level, the sage counselor can spend 1 point from his ki pool as a swift action to give himself a +4 insight bonus on his next Bluff check.",
                                                       "",
                                                       Helpers.GetIcon("b3da3fbee6a751d4197e446c7e852bcb"), //true seeing
                                                       null,
                                                       Helpers.CreateAddStatBonus(StatType.CheckBluff, 4, ModifierDescriptor.Insight)
                                                       );

            deceptive_ki_buff.AddComponents(Helpers.Create <AddInitiatorSkillRollTrigger>(a => { a.Skill = StatType.CheckBluff; a.Action = Helpers.CreateActionList(Common.createContextActionRemoveBuff(deceptive_ki_buff)); }),
                                            Helpers.Create <AddInitiatorPartySkillRollTrigger>(a => { a.Skill = StatType.CheckBluff; a.Action = Helpers.CreateActionList(Common.createContextActionRemoveBuff(deceptive_ki_buff)); })
                                            );

            var ability = Helpers.CreateAbility("DeceptiveKiAbility",
                                                deceptive_ki_buff.Name,
                                                deceptive_ki_buff.Description,
                                                "",
                                                deceptive_ki_buff.Icon,
                                                AbilityType.Supernatural,
                                                CommandType.Swift,
                                                AbilityRange.Personal,
                                                "",
                                                "",
                                                Helpers.CreateRunActions(Common.createContextActionApplyBuff(deceptive_ki_buff, Helpers.CreateContextDuration(), is_permanent: true, dispellable: false)),
                                                resource.CreateResourceLogic()
                                                );

            ability.setMiscAbilityParametersSelfOnly();

            deceptive_ki.AddComponents(Helpers.CreateAddFacts(ki_feint, ability));
            deceptive_ki.SetNameDescription("Deceptive Ki",
                                            "A sage counselor can spend 1 ki point while performing a flurry of blows to feint an opponent as a swift action, but he can’t spend 1 ki point to make an additional attack when making a flurry of blows.\n"
                                            + "In addition, the sage counselor can spend 1 point from his ki pool as a swift action to give himself a +4 insight bonus on his next Bluff check. The sage counselor does not gain the ability to spend ki to increase his speed by 20 feet for 1 round."
                                            );
        }
        static void createArrowSongStrike()
        {
            var bard_class       = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var add_spell_combat = Helpers.Create <AddMagusMechanicPart>(); //needed for unit_part magus creation (no actual ability though)

            Helpers.SetField(add_spell_combat, "m_Feature", 1);
            Helpers.SetField(add_spell_combat, "m_MagusClass", bard_class);
            //it should not be used since it sets spell combat to be always active by default (ok on magus though since the corresponding toggle is always active by default)

            var add_magus_part = Helpers.Create <NewMechanics.ActivateUnitPartMagus>(a => a.magus_class = bard_class);

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

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

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

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

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

            spellstrike.SetName("Arrowsong Strike");
            spellstrike.SetDescription("At 6th level, an Arrowsong minstrel can use spellstrike (as per the magus class feature) to cast a single-target ranged touch attack spell and deliver it through a ranged weapon attack.");
            spellstrike.SetIcon(NewSpells.flame_arrow.Icon);
            arrowsong_strike = Common.ActivatableAbilityToFeature(spellstrike, false);
            arrowsong_strike.AddComponents(add_magus_part, add_eldritch_archer, add_spellstrike);

            var add_spell_combat18 = library.Get <BlueprintFeature>("2464ba53317c7fc4d88f383fac2b45f9").GetComponent <AddMagusMechanicPart>().CreateCopy(); //spell combat

            Helpers.SetField(add_spell_combat18, "m_MagusClass", bard_class);
            var spell_combat_buff = library.Get <BlueprintBuff>("91e4b45ab5f29574aa1fb41da4bbdcf2");

            ray_spell_combat = Helpers.CreateFeature("RaySpellCombatFeature",
                                                     "Arrowsong Strike II",
                                                     "At 18th level, an arrowsong minstrel can make a full attack when using arrowsong strike.",
                                                     "",
                                                     LoadIcons.Image2Sprite.Create(@"AbilityIcons/LingeringAcid.png"),
                                                     FeatureGroup.None,
                                                     Helpers.CreateAddFact(Common.ignore_spell_combat_penalty),
                                                     add_spell_combat18
                                                     );
            var spellcombat_penalty_buff = library.Get <BlueprintBuff>("7b4cf64d3a49e3d45b1dbd2385f4eb6d");

            spellcombat_penalty_buff.AddComponent(Helpers.Create <NewMechanics.BuffExtraAttackIfHasFact>(b => { b.num_attacks = -1; b.fact = ray_spell_combat; }));
            var apply_spell_combat = Common.createContextActionApplyBuff(spell_combat_buff, Helpers.CreateContextDuration(), is_child: true, dispellable: false, is_permanent: true);

            spellstrike.Buff.AddComponent(Helpers.CreateAddFactContextActions(Helpers.CreateConditional(Common.createContextConditionHasFact(ray_spell_combat),
                                                                                                        apply_spell_combat)
                                                                              )
                                          );
        }
Exemple #7
0
        static void fixRangerAbilitiesScaling()
        {
            ranger_casting_stat_property = NewMechanics.CastingStatPropertyGetter.createProperty("RangerCastingStatProperty", "", StatType.Wisdom, archetype.GetParentClass());

            var hunters_bond_ability = library.Get <BlueprintAbility>("cd80ea8a7a07a9d4cb1a54e67a9390a5");

            hunters_bond_ability.ReplaceComponent <ContextRankConfig>(c =>
            {
                Helpers.SetField(c, "m_BaseValueType", ContextRankBaseValueType.CustomProperty);
                Helpers.SetField(c, "m_CustomProperty", ranger_casting_stat_property);
            }
                                                                      );


            var master_hunter = library.Get <BlueprintFeature>("9d53ef63441b5d84297587d75f72fc17");

            master_hunter.RemoveComponents <BindAbilitiesToClass>();
            master_hunter.RemoveComponents <ReplaceCasterLevelOfAbility>();
            master_hunter.RemoveComponents <ReplaceAbilitiesStat>();

            var master_hunter_ability = library.Get <BlueprintAbility>("8a57e1072da4f6f4faaa55b7b7dc633c");

            master_hunter_ability.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClassesWithProperty(new BlueprintCharacterClass[] { archetype.GetParentClass() }, ranger_casting_stat_property));

            //fix stromwreden weapon buff resource
            var stromwarden_weapon_ability_resource = library.Get <BlueprintAbilityResource>("6bc707c120d6d38498ccb70767d55a69");

            fey_touched.AddComponents(Helpers.Create <IncreaseResourceAmountBySharedValue>(i =>
            {
                i.Decrease = true;
                i.Resource = stromwarden_weapon_ability_resource;
                i.Value    = Helpers.CreateContextValue(AbilityRankType.Default);
            }
                                                                                           ),
                                      Helpers.Create <IncreaseResourceAmountBySharedValue>(i =>
            {
                i.Resource = stromwarden_weapon_ability_resource;
                i.Value    = Helpers.CreateContextValue(AbilityRankType.StatBonus);
            }
                                                                                           ),
                                      Helpers.CreateContextRankConfig(ContextRankBaseValueType.StatBonus, type: AbilityRankType.StatBonus, stat: StatType.Charisma),
                                      Helpers.CreateContextRankConfig(ContextRankBaseValueType.StatBonus, stat: StatType.Wisdom),
                                      Helpers.Create <RecalculateOnStatChange>(r => r.Stat = StatType.Wisdom),
                                      Helpers.Create <RecalculateOnStatChange>(r => r.Stat = StatType.Charisma)

                                      );
            //warpriest blessing have 3 + 1/2 level so no need to change
        }
        static void FixDragonDisciple(BlueprintFeature feat, BlueprintFeature[] bloodlines)
        {
            feat.AddComponents(
                feat.GetComponents <AddFeatureIfHasFact>()
                .Where(a => bloodlines.Contains(a.CheckedFact))
                .Select(addFeat =>
            {
                var newAdd         = UnityEngine.Object.Instantiate(addFeat);
                newAdd.CheckedFact = crossbloodForBloodline[(BlueprintProgression)addFeat.CheckedFact];
                return(newAdd);
            }));

            foreach (var addOnClass in feat.GetComponents <AddFeatureOnClassLevel>())
            {
                FixDragonDisciple(addOnClass.Feature, bloodlines);
            }
        }
Exemple #9
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;
        }
Exemple #10
0
        static void createBansheesRequiem()
        {
            var effect = Helpers.CreateActionEnergyDrain(Helpers.CreateContextDiceValue(DiceType.Zero, 0, 2), Helpers.CreateContextDuration(1, DurationRate.Hours), EnergyDrainType.Permanent);

            var effect_saved = Helpers.CreateActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateConditionalSaved(null, effect));
            var effect_buff  = Helpers.CreateBuff("BansheesRequiemBuff",
                                                  "Banshee’s Requiem",
                                                  "Effect: All living creatures you select within 30 feet at the start of your turn each round gain 2 negative levels unless they succeed at a Fortitude saving throw (DC = 10 + 1/2 your bard level + your Charisma bonus). This is a death effect and a sonic effect. This performance has audible components.\n"
                                                  + "Use: 3 rounds of bardic performance per round.",
                                                  "",
                                                  Helpers.GetIcon("b24583190f36a8442b212e45226c54fc"), //banshee blast
                                                  null,
                                                  Common.createContextCalculateAbilityParamsBasedOnClasses(new BlueprintCharacterClass[] { bard_class, Skald.skald_class }, StatType.Charisma),
                                                  Helpers.CreateAddFactContextActions(activated: effect_saved, newRound: effect_saved),
                                                  Helpers.CreateSpellDescriptor(SpellDescriptor.Death | SpellDescriptor.Sonic)
                                                  );

            var toggle = Common.createToggleAreaEffect(effect_buff, 30.Feet(), Helpers.CreateConditionsCheckerAnd(Common.createContextConditionHasFact(Common.undead, has: false),
                                                                                                                  Common.createContextConditionHasFact(Common.elemental, has: false),
                                                                                                                  Common.createContextConditionHasFact(Common.construct, has: false),
                                                                                                                  Helpers.Create <ContextConditionIsEnemy>()),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("20caf000cd4c3434da00a74f4a49dccc"), //dirge of doom
                                                       Common.createPrefabLink("39da71647ad4747468d41920d0edd721")  //dirge of doom
                                                       );

            toggle.Group = ActivatableAbilityGroup.BardicPerformance;
            toggle.Buff.AddComponent(Helpers.CreateAddFactContextActions(activated: Helpers.Create <ResourceMechanics.ContextActionSpendResourceFromCaster>(a =>
            {
                a.resource = performance_resource;
                a.amount   = 3;
            })));
            toggle.AddComponent(performance_resource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound));
            toggle.AddComponent(Helpers.Create <ResourceMechanics.RestrictionHasEnoughResource>(r => { r.resource = performance_resource; r.amount = 3; }));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            banshees_requiem        = Common.ActivatableAbilityToFeature(toggle, false);
            banshees_requiem.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            banshees_requiem.AddComponents(Helpers.PrerequisiteClassLevel(bard_class, 17, any: true),
                                           Helpers.PrerequisiteClassLevel(Skald.skald_class, 17, any: true));
        }
        private static void LoadDeitySelection()
        {
            // For RP flavor, this adds an optional deity/atheism selection to the character creation page.
            BlueprintFeatureSelection baseDeitySelection = library.Get <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4");
            BlueprintFeature          atheismFeature     = library.Get <BlueprintFeature>("92c0d2da0a836ce418a267093c09ca54");

            // Classes tagged with "no atheism" can't select it on the Deity selection.
            // (in practice, most of them wouldn't get the option, since they have their own deity selection feature.
            // This is mainly for Oracles, but it also serves as nice documentation.)
            atheismFeature.AddComponents(
                Helpers.classes.Where(c => c.GetComponents <PrerequisiteNoFeature>().Any(p => p.Feature == atheismFeature))
                .Select(c => Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = c)));

            BlueprintFeatureSelection deitySelection = library.CopyAndAdd(baseDeitySelection, "DeitySelectionAny", "d5c3c9d4080043f98e6c09f4e843440e");

            deitySelection.Group = FeatureGroup.None; // to prevent "determinators" page clutter.
            BlueprintFeature noDeityChoice = Helpers.CreateFeature("SkipDeity", "(Skip)",
                                                                   "Choose this to skip selecting a deity at character creation. You may select one later if you gain a level in a class that requires it (such as Cleric, Inquisitor, or Paladin).",
                                                                   "e1f5711210404b34a805b00749eeba20",
                                                                   null, FeatureGroup.None);

            noDeityChoice.HideInUI = true;

            List <BlueprintFeature> choices = new List <BlueprintFeature> {
                noDeityChoice
            };

            choices.AddRange(baseDeitySelection.AllFeatures);
            choices.Add(atheismFeature);
            deitySelection.SetFeatures(choices);

            BlueprintFeatureSelection paladinDeitySelection = library.Get <BlueprintFeatureSelection>("a7c8b73528d34c2479b4bd638503da1d");

            ApplyClassMechanics_Apply_Patch.onChargenApply.Add((state, unit) => {
                if (!state.Selections.Any(s => s.Selection.GetGroup() == FeatureGroup.Deities ||
                                          (object)s.Selection == paladinDeitySelection))
                {
                    deitySelection.AddSelection(state, unit, 1);
                }
            });
        }
Exemple #12
0
        static void createDanceOf23Steps()
        {
            var bard_class = library.Get <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var buff       = Helpers.CreateBuff("DanceOf23StepsBuff",
                                                "The Dance of 23 Steps",
                                                "Effect: The shuffling steps, bends, and leaps of this intricate dance make you a difficult target to hit, but also make it more difficult for you to perform other actions. When using this masterpiece, you take a –2 penalty on melee attack rolls and combat maneuver checks, and you must make a concentration check to cast any spell (DC 15 + the spell’s level), but you gain a +2 dodge bonus to your Armor Class. When you have 8 bard levels, and every 4 levels thereafter, the penalty increases by –1 and the dodge bonus increases by +1. You can combine this masterpiece with fighting defensively and Combat Expertise, but not total defense. When you use this masterpiece, it lasts until the start of your next turn. Abilities that extend the duration of a bardic performance (such as Lingering Performance) affect this masterpiece; this allows you to get multiple rounds of its benefit (and its penalties) at the cost of only 1 round of bardic performance."
                                                + "Use: 1 bardic performance round. Starting this performance is free action.",
                                                "",
                                                NewSpells.irresistible_dance.Icon,
                                                Common.createPrefabLink("91ef30ab58fa0d3449d4d2ccc20cb0f8"),
                                                Helpers.CreateAddContextStatBonus(StatType.AdditionalAttackBonus, ModifierDescriptor.None, multiplier: -1),
                                                Helpers.CreateAddContextStatBonus(StatType.AC, ModifierDescriptor.Dodge),
                                                Common.createAddCondition(UnitCondition.SpellCastingIsDifficult),
                                                Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, ContextRankProgression.OnePlusDivStep,
                                                                                classes: new BlueprintCharacterClass[] { bard_class, Skald.skald_class },
                                                                                min: 2, stepLevel: 4)
                                                );

            var toggle = Helpers.CreateActivatableAbility(buff.name + "ToggleAbility",
                                                          buff.Name,
                                                          buff.Description,
                                                          "",
                                                          buff.Icon,
                                                          buff,
                                                          AbilityActivationType.Immediately,
                                                          UnitCommand.CommandType.Free,
                                                          null);

            toggle.Group = ActivatableAbilityGroup.BardicPerformance;
            toggle.AddComponent(performance_resource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            dance_of_23_steps        = Common.ActivatableAbilityToFeature(toggle, false);
            dance_of_23_steps.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            dance_of_23_steps.AddComponents(Helpers.PrerequisiteClassLevel(bard_class, 4, any: true),
                                            Helpers.PrerequisiteClassLevel(Skald.skald_class, 4, any: true));
        }
Exemple #13
0
        static void createArrowSongStrike()
        {
            var bard_class       = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var add_spell_combat = Helpers.Create <AddMagusMechanicPart>(); //needed for unit_part magus creation (no actual ability though)

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

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

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

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

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

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

            spellstrike.SetName("Arrowsong Strike");
            spellstrike.SetDescription("At 6th level, an Arrowsong minstrel can use spellstrike (as per the magus class feature) to cast a single-target ranged touch attack spell and deliver it through a ranged weapon attack.");
            spellstrike.SetIcon(NewSpells.flame_arrow.Icon);
            arrowsong_strike = Common.ActivatableAbilityToFeature(spellstrike, false);
            arrowsong_strike.AddComponents(add_spell_combat, add_eldritch_archer, add_spellstrike);
        }
Exemple #14
0
        static void createSpellSynthesis()
        {
            var icon = LoadIcons.Image2Sprite.Create(@"AbilityIcons/StormOfSouls.png");

            spell_synthesis = Helpers.CreateFeature("SpellSynthesisFeature",
                                                    "Spell Synthesis",
                                                    "At 10th level, a mystic theurge can cast two spells, one from each of his spellcasting classes, using one action. Both of the spells must have the same casting time. The mystic theurge can make any decisions concerning the spells independently.Any target affected by both of the spells takes a –2 penalty on saves made against each spell.The mystic theurge receives a + 2 bonus on caster level checks made to overcome spell resistance with these two spells. A mystic theurge may use this ability once per day.",
                                                    "",
                                                    icon,
                                                    FeatureGroup.None);

            var buff = Helpers.CreateBuff("SpellSynthesisBuff",
                                          spell_synthesis.Name,
                                          spell_synthesis.Description,
                                          "",
                                          icon,
                                          null,
                                          Helpers.Create <NewMechanics.IncreaseAllSpellsDC>(i => i.Value = 2),
                                          Helpers.Create <SpellPenetrationBonus>(s => s.Value            = 2)
                                          );

            buff.SetBuffFlags(BuffFlags.HiddenInUi);


            CommandType[]           action_types = new CommandType[] { CommandType.Standard, CommandType.Standard, CommandType.Swift };
            bool[]                  full_round   = new bool[] { true, false, false };
            string[]                names        = new string[] { "Full Round Action", "Standard Action", "Swift Action" };
            List <BlueprintAbility> abilities    = new List <BlueprintAbility>();

            var resource = Helpers.CreateAbilityResource("SpellSynthesisResource", "", "", "", null);

            resource.SetFixedResource(1);

            for (int i = 0; i < action_types.Length; i++)
            {
                var arcane_buff = Helpers.CreateBuff($"SpellSynthesis{i}ArcaneBuff",
                                                     "Spell Synthesis (Arcane): " + names[i],
                                                     spell_synthesis.Description,
                                                     "",
                                                     icon,
                                                     null,
                                                     Helpers.Create <TurnActionMechanics.SpellSynthesis>(s =>
                                                                                                         { s.action_type     = action_types[i];
                                                                                                           s.is_full_round   = full_round[i];
                                                                                                           s.max_spell_level = 100;
                                                                                                           s.is_arcane       = true; }
                                                                                                         )
                                                     );

                var divine_buff = Helpers.CreateBuff($"SpellSynthesis{i}DivineBuff",
                                                     "Spell Synthesis (Divine): " + names[i],
                                                     spell_synthesis.Description,
                                                     "",
                                                     icon,
                                                     null,
                                                     Helpers.Create <TurnActionMechanics.SpellSynthesis>(s =>
                {
                    s.action_type     = action_types[i];
                    s.is_full_round   = full_round[i];
                    s.max_spell_level = 100;
                    s.is_arcane       = false;
                }
                                                                                                         )
                                                     );

                var ability = Helpers.CreateAbility($"SpellSynthesis{i}Ability",
                                                    "Spell Synthesis: " + names[i],
                                                    spell_synthesis.Description,
                                                    "",
                                                    icon,
                                                    Kingmaker.UnitLogic.Abilities.Blueprints.AbilityType.Supernatural,
                                                    action_types[i],
                                                    Kingmaker.UnitLogic.Abilities.Blueprints.AbilityRange.Personal,
                                                    Helpers.oneRoundDuration,
                                                    "",
                                                    Helpers.CreateRunActions(Common.createContextActionApplyBuff(arcane_buff, Helpers.CreateContextDuration(1), dispellable: false),
                                                                             Common.createContextActionApplyBuff(divine_buff, Helpers.CreateContextDuration(1), dispellable: false),
                                                                             Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(1), dispellable: false)
                                                                             ),
                                                    Helpers.CreateResourceLogic(resource)
                                                    );
                ability.setMiscAbilityParametersSelfOnly();
                if (full_round[i])
                {
                    Common.setAsFullRoundAction(ability);
                }

                abilities.Add(ability);
            }

            var base_ability = Common.createVariantWrapper("SpellSynthesisAbility", "", abilities.ToArray());

            base_ability.SetName(spell_synthesis.Name);

            spell_synthesis.AddComponents(Helpers.CreateAddFact(base_ability),
                                          Helpers.CreateAddAbilityResource(resource));

            mystic_theurge_progression.LevelEntries[9].Features.Add(spell_synthesis);

            extra_spell_synthesis = Helpers.CreateFeature("ExtraSpellSynthesisFeature",
                                                          "Extra Spell Synthesis",
                                                          "You can perform one additional spell synthesis per day.\n"
                                                          + "Special: You can select this feat multiple times. Each time you take the feat, you can use this ability one additional time per day.",
                                                          "",
                                                          icon,
                                                          FeatureGroup.Feat,
                                                          Helpers.Create <ResourceMechanics.ContextIncreaseResourceAmount>(c => { c.Resource = resource; c.Value = Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default); }),
                                                          Helpers.PrerequisiteFeature(spell_synthesis)
                                                          );
            extra_spell_synthesis.AddComponent(Helpers.CreateContextRankConfig(baseValueType: Kingmaker.UnitLogic.Mechanics.Components.ContextRankBaseValueType.FeatureRank,
                                                                               feature: extra_spell_synthesis)
                                               );
            extra_spell_synthesis.ReapplyOnLevelUp = true;
            extra_spell_synthesis.Ranks            = 10;

            library.AddFeats(extra_spell_synthesis);
        }
        static BlueprintSpellbook createMesmeristSpellbook()
        {
            var bard_class          = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var mesmerist_spellbook = Helpers.Create <BlueprintSpellbook>();

            mesmerist_spellbook.name = "MesmeristSpellbook";
            library.AddAsset(mesmerist_spellbook, "");
            mesmerist_spellbook.Name                = mesmerist_class.LocalizedName;
            mesmerist_spellbook.SpellsPerDay        = bard_class.Spellbook.SpellsPerDay;
            mesmerist_spellbook.SpellsKnown         = bard_class.Spellbook.SpellsKnown;
            mesmerist_spellbook.Spontaneous         = true;
            mesmerist_spellbook.IsArcane            = false;
            mesmerist_spellbook.AllSpellsKnown      = false;
            mesmerist_spellbook.CanCopyScrolls      = false;
            mesmerist_spellbook.CastingAttribute    = StatType.Charisma;
            mesmerist_spellbook.CharacterClass      = mesmerist_class;
            mesmerist_spellbook.CasterLevelModifier = 0;
            mesmerist_spellbook.CantripsType        = CantripsType.Cantrips;
            mesmerist_spellbook.SpellsPerLevel      = bard_class.Spellbook.SpellsPerLevel;

            mesmerist_spellbook.SpellList      = Helpers.Create <BlueprintSpellList>();
            mesmerist_spellbook.SpellList.name = "MesmeristSpellList";
            library.AddAsset(mesmerist_spellbook.SpellList, "");
            mesmerist_spellbook.SpellList.SpellsByLevel = new SpellLevelList[10];
            for (int i = 0; i < mesmerist_spellbook.SpellList.SpellsByLevel.Length; i++)
            {
                mesmerist_spellbook.SpellList.SpellsByLevel[i] = new SpellLevelList(i);
            }

            Common.SpellId[] spells = new Common.SpellId[]
            {
                new Common.SpellId("55f14bc84d7c85446b07a1b5dd6b2b4c", 0), //daze
                new Common.SpellId("f0f8e5b9808f44e4eadd22b138131d52", 0), //flare
                new Common.SpellId("95f206566c5261c42aa5b3e7e0d1e36c", 0), //mage light
                new Common.SpellId("5bf3315ce1ed4d94e8805706820ef64d", 0), //touch of fatigue

                new Common.SpellId("8bc64d869456b004b9db255cdd1ea734", 1), //bane
                new Common.SpellId(NewSpells.burst_of_adrenaline.AssetGuid, 1),
                new Common.SpellId(NewSpells.burst_of_insight.AssetGuid, 1),
                new Common.SpellId("bd81a3931aa285a4f9844585b5d97e51", 1),  //cause fear
                new Common.SpellId("91da41b9793a4624797921f221db653c", 1),  //color spray
                new Common.SpellId("fbdd8c455ac4cde4a9a3e18c84af9485", 1),  //doom
                new Common.SpellId("4f8181e7a7f1d904fbaea64220e83379", 1),  //expeditious retreat
                new Common.SpellId("4d9bf81b7939b304185d58a09960f589", 1),  //faerie fire
                new Common.SpellId("95851f6e85fe87d4190675db0419d112", 1),  //grease
                new Common.SpellId("fd4d9fd7f87575d47aafe2a64a6e2d8d", 1),  //hideous laughter
                new Common.SpellId("fd4d9fd7f87575d47aafe2a64a6e2d8d", 1),  //hypnotism
                new Common.SpellId(Witch.ill_omen.AssetGuid, 1),
                new Common.SpellId(NewSpells.invigorate.AssetGuid, 1),
                new Common.SpellId(NewSpells.obscuring_mist.AssetGuid, 1),
                new Common.SpellId("450af0402422b0b4980d9c2175869612", 1),  //ray of enfeeblement
                new Common.SpellId("fa3078b9976a5b24caf92e20ee9c0f54", 1),  //ray of sickening
                new Common.SpellId("55a037e514c0ee14a8e3ed14b47061de", 1),  //remove fear
                new Common.SpellId("f6f95242abdfac346befd6f4f6222140", 1),  //remove sickness
                new Common.SpellId("bb7ecad2d3d2c8247a38f44855c99061", 1),  //sleep
                new Common.SpellId("ad10bfec6d7ae8b47870e3a545cc8900", 1),  //tocuh of gracelessness
                new Common.SpellId("8fd74eddd9b6c224693d9ab241f25e84", 1),  //summon monster 1
                new Common.SpellId("f001c73999fb5a543a199f890108d936", 1),  //vanish

                new Common.SpellId(NewSpells.babble.AssetGuid, 2),
                new Common.SpellId("46fd02ad56c35224c9c91c88cd457791", 2),  //blindness
                new Common.SpellId(NewSpells.blistering_invective.AssetGuid, 2),
                new Common.SpellId("14ec7a4e52e90fa47a4c8d63c69fd5c1", 2),  //blur
                new Common.SpellId("ce4c4e52c53473549ae033e2bb44b51a", 2),  //castigate
                new Common.SpellId(NewSpells.bone_fists.AssetGuid, 2),
                new Common.SpellId("de7a025d48ad5da4991e7d3c682cf69d", 2),  //cat's grace
                new Common.SpellId("b48b4c5ffb4eab0469feba27fc86a023", 2),  //delay poison
                new Common.SpellId("446f7bf201dc1934f96ac0a26e324803", 2),  //eagle's splendor
                new Common.SpellId("7a5b5bf845779a941a67251539545762", 2),  //false life
                new Common.SpellId("ce7dad2b25acf85429b6c9550787b2d9", 2),  //glitterdust
                new Common.SpellId("c7104f7526c4c524f91474614054547e", 2),  //hold person
                new Common.SpellId("41bab342089c0254ca222eb918e98cd4", 2),  //hold animal
                new Common.SpellId(NewSpells.howling_agony.AssetGuid, 2),
                new Common.SpellId(NewSpells.hypnotic_pattern.AssetGuid, 2),
                new Common.SpellId(NewSpells.inflict_pain.AssetGuid, 2),
                new Common.SpellId("89940cde01689fb46946b2f8cd7b66b7", 2),  //invisibility
                new Common.SpellId("3e4ab69ada402d145a5e0ad3ad4b8564", 2),  //mirror image
                new Common.SpellId("97b991256e43bb140b263c326f690ce2", 2),  //rage
                new Common.SpellId("e84fc922ccf952943b5240293669b171", 2),  //restoration lesser
                new Common.SpellId("08cb5f4c3b2695e44971bf5c45205df0", 2),  //scare
                new Common.SpellId(NewSpells.silence.AssetGuid, 2),
                new Common.SpellId(NewSpells.stricken_heart.AssetGuid, 2),

                new Common.SpellId("989ab5c44240907489aba0a8568d0603", 3),  //bestow curse
                new Common.SpellId("cf6c901fb7acc904e85c63b342e9c949", 3),  //confusion
                new Common.SpellId("4baf4109145de4345861fe0f2209d903", 3),  //crushing despair
                new Common.SpellId("7658b74f626c56a49939d9c20580885e", 3),  //deep slumber
                new Common.SpellId("92681f181b507b34ea87018e8f7a528a", 3),  //dispel magic
                new Common.SpellId("903092f6488f9ce45a80943923576ab3", 3),  //displacement
                new Common.SpellId("754c478a2aa9bb54d809e648c3f7ac0e", 3),  //dominate animal
                new Common.SpellId("dc6af3b4fd149f841912d8a3ce0983de", 3),  //false life, greater
                new Common.SpellId("d2aeac47450c76347aebbc02e4f463e0", 3),  //fear
                new Common.SpellId(NewSpells.invigorate_mass.AssetGuid, 3),
                new Common.SpellId("dd2918e4a77c50044acba1ac93494c36", 3),  //overwhelming grief
                new Common.SpellId(NewSpells.ray_of_exhaustion.AssetGuid, 3),
                new Common.SpellId("c927a8b0cd3f5174f8c0b67cdbfde539", 3),  //remove blindness
                new Common.SpellId("b48674cef2bff5e478a007cf57d8345b", 3),  //remove curse
                new Common.SpellId("30e5dc243f937fc4b95d2f8f4e1b7ff3", 3),  //see invisibility
                new Common.SpellId(NewSpells.spite.AssetGuid, 3),
                new Common.SpellId(NewSpells.synesthesia.AssetGuid, 3),
                new Common.SpellId("8a28a811ca5d20d49a863e832c31cce1", 3),  //vampyric touch
                new Common.SpellId(NewSpells.synaptic_pulse.AssetGuid, 3),

                new Common.SpellId("7792da00c85b9e042a0fdfc2b66ec9a8", 4),  //break enchantment
                new Common.SpellId(NewSpells.command_greater.AssetGuid, 4),
                new Common.SpellId(NewSpells.daze_mass.AssetGuid, 4),
                new Common.SpellId(NewSpells.curse_major.AssetGuid, 4),
                new Common.SpellId("4a648b57935a59547b7a2ee86fb4f26a", 4),  //dimensions door
                new Common.SpellId("d7cbd2004ce66a042aeab2e95a3c5c61", 4),  //dominate person
                new Common.SpellId("f34fb78eaaec141469079af124bcfa0f", 4),  //enervation
                new Common.SpellId("4c349361d720e844e846ad8c19959b1e", 4),  //freedom of movement
                new Common.SpellId("41e8a952da7a5c247b3ec1c2dbb73018", 4),  //hold monster
                new Common.SpellId("ecaa0def35b38f949bd1976a6c9539e0", 4),  //invisibility greater
                new Common.SpellId("6717dbaef00c0eb4897a1c908a75dfe5", 4),  //phantasmal killer
                new Common.SpellId("2a6eda8ef30379142a4b75448fb214a3", 4),  //poison
                new Common.SpellId("f2115ac1148256b4ba20788f7e966830", 4),  //restoration
                new Common.SpellId("d316d3d94d20c674db2c24d7de96f6a7", 4),  //serenity
                new Common.SpellId(NewSpells.shadow_conjuration.AssetGuid, 4),
                new Common.SpellId(NewSpells.solid_fog.AssetGuid, 4),
                new Common.SpellId(NewSpells.synapse_overload.AssetGuid, 4),
                new Common.SpellId(NewSpells.synaptic_pulse_greater.AssetGuid, 4),

                new Common.SpellId("41236cf0e476d7043bc16a33a9f449bd", 5),  //castigate
                new Common.SpellId("7f71a70d822af94458dc1a235507e972", 5),  //cloak of dreams
                new Common.SpellId(NewSpells.inflict_pain_mass.AssetGuid, 5),
                new Common.SpellId("444eed6e26f773a40ab6e4d160c67faa", 5),  //feeblemind
                new Common.SpellId("15a04c40f84545949abeedef7279751a", 5),  //joyful rapture
                new Common.SpellId("eabf94e4edc6e714cabd96aa69f8b207", 5),  //mind fog
                new Common.SpellId("12fb4a4c22549c74d949e2916a2f0b6a", 5),  //phantasmal web
                new Common.SpellId("1f2e6019ece86d64baa5effa15e81ecc", 5),  //phantasmal putrefaction
                new Common.SpellId("07d577a74441a3a44890e3006efcf604", 5),  //primal regression
                new Common.SpellId(NewSpells.psychic_surgery.AssetGuid, 5),
                new Common.SpellId("237427308e48c3341b3d532b9d3a001f", 5),  //shadow evocation
                new Common.SpellId("8878d0c46dfbd564e9d5756349d5e439", 5),  //waves of fatigue

                new Common.SpellId("740d943e42b60f64a8de74926ba6ddf7", 6),  //euphoric tranquility
                new Common.SpellId("3167d30dd3c622c46b0c0cb242061642", 6),  //eyebite
                new Common.SpellId(NewSpells.hold_person_mass.AssetGuid, 6),
                new Common.SpellId("2b044152b3620c841badb090e01ed9de", 6),  //insanity
                new Common.SpellId("98310a099009bbd4dbdf66bcef58b4cd", 6),  //invisibility mass
                new Common.SpellId(NewSpells.irresistible_dance.AssetGuid, 6),
                new Common.SpellId("41cf93453b027b94886901dbfc680cb9", 6),  //overwhelming presence
                new Common.SpellId("261e1788bfc5ac1419eec68b1d485dbc", 6),  //power word blind
                new Common.SpellId(NewSpells.song_of_discord_greater.AssetGuid, 6),
                new Common.SpellId("4cf3d0fae3239ec478f51e86f49161cb", 6),  //true seeing
                new Common.SpellId("1e2d1489781b10a45a3b70192bba9be3", 6),  //waves of ectasy
                new Common.SpellId("3e4d3b9a5bd03734d9b053b9067c2f38", 6),  //waves of exhaustion
            };

            foreach (var spell_id in spells)
            {
                var spell = library.Get <BlueprintAbility>(spell_id.guid);
                spell.AddToSpellList(mesmerist_spellbook.SpellList, spell_id.level);
            }

            mesmerist_spellbook.AddComponent(Helpers.Create <SpellbookMechanics.PsychicSpellbook>());

            mesmerist_spellcasting = Helpers.CreateFeature("MesmeristSpellCasting",
                                                           "Mesmerist Spellcasting",
                                                           "A mesmerist casts psychic spells drawn from the mesmerist spell list. He can cast any spell he knows without preparing it ahead of time. To learn or cast a spell, a mesmerist must have a Charisma score equal to at least 10 + the spell’s level. The saving throw DC against a mesmerist’s spell is 10 + the spell’s level + the mesmerist’s Charisma modifier.\n"
                                                           + "Like other spellcasters, a mesmerist can cast only a certain number of spells of each spell level per day. In addition, he receives bonus spells per day if he has a high Charisma score.\n"
                                                           + "The mesmerist’s selection of spells is limited. A mesmerist begins play knowing four 0-level spells and two 1st-level spells of the mesmerist’s choice. At each new mesmerist level, he learns one or more new spells.",
                                                           "",
                                                           null,
                                                           FeatureGroup.None);

            mesmerist_spellcasting.AddComponents(Helpers.Create <SpellFailureMechanics.PsychicSpellbook>(p => p.spellbook = mesmerist_spellbook),
                                                 Helpers.CreateAddMechanics(AddMechanicsFeature.MechanicsFeatureType.NaturalSpell));
            mesmerist_spellcasting.AddComponent(Helpers.Create <SpellbookMechanics.AddUndercastSpells>(p => p.spellbook = mesmerist_spellbook));
            mesmerist_spellcasting.AddComponent(Helpers.CreateAddFact(Investigator.center_self));
            mesmerist_spellcasting.AddComponents(Common.createCantrips(mesmerist_class, StatType.Charisma, mesmerist_spellbook.SpellList.SpellsByLevel[0].Spells.ToArray()));
            mesmerist_spellcasting.AddComponents(Helpers.CreateAddFacts(mesmerist_spellbook.SpellList.SpellsByLevel[0].Spells.ToArray()));

            return(mesmerist_spellbook);
        }
Exemple #16
0
        static void createBombs()
        {
            var smoke_bomb_ability = library.CopyAndAdd(NewSpells.obscuring_mist, "NinjaSmokeBombAbility", "");

            smoke_bomb_ability.RemoveComponents <SpellListComponent>();
            smoke_bomb_ability.RemoveComponents <ContextRankConfig>();
            smoke_bomb_ability.Type = AbilityType.Extraordinary;
            smoke_bomb_ability.AvailableMetamagic = 0;
            smoke_bomb_ability.Animation          = Kingmaker.Visual.Animation.Kingmaker.Actions.UnitAnimationActionCastSpell.CastAnimationStyle.Thrown;
            smoke_bomb_ability.AnimationStyle     = Kingmaker.View.Animation.CastAnimationStyle.CastActionThrown;
            smoke_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = NewSpells.obscuring_mist_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            smoke_bomb_ability.LocalizedDuration = Helpers.oneMinuteDuration;
            smoke_bomb_ability.Range             = AbilityRange.Close;
            smoke_bomb_ability.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClass(getRogueArray()[0], StatType.Charisma));
            smoke_bomb_ability.AddComponent(ki_resource.CreateResourceLogic());
            smoke_bomb_ability.SetNameDescription("Smoke Bomb",
                                                  "This ability allows a ninja to throw a smoke bomb that creates a cloud of smoke with a 20 - foot radius. This acts like a fog cloud spell with duration of 1 minute. Using this ability is a standard action. Each use of this ability uses up 1 ki point.");
            smoke_bomb_ability.AddComponent(ki_resource.CreateAddAbilityResource());
            smoke_bomb = Common.AbilityToFeature(smoke_bomb_ability, false);


            var chocking_bomb_ability = library.CopyAndAdd(smoke_bomb_ability, "NinjaNausetingBombAbility", "");
            var chocking_bomb_area    = library.CopyAndAdd <BlueprintAbilityAreaEffect>(NewSpells.obscuring_mist_area, "ChockingBombArea", "");
            var staggered_buff        = library.Get <BlueprintBuff>("df3950af5a783bd4d91ab73eb8fa0fd3");
            var apply_buff            = Helpers.CreateConditionalSaved(null, Common.createContextActionApplyBuff(staggered_buff, Helpers.CreateContextDuration(0, DurationRate.Rounds, DiceType.D4, 1), dispellable: false));

            var apply_buff_saved = Helpers.CreateConditional(Common.createContextConditionHasFact(staggered_buff), null,
                                                             Common.createContextActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateActionList(apply_buff)));
            var chocking_bomb_action = Helpers.Create <NewMechanics.AbilityAreaEffectRunActionWithFirstRound>(a =>
            {
                a.UnitEnter  = Helpers.CreateActionList(apply_buff_saved);
                a.Round      = Helpers.CreateActionList(apply_buff_saved);
                a.FirstRound = Helpers.CreateActionList(apply_buff_saved);
            });

            chocking_bomb_area.AddComponent(chocking_bomb_action);
            chocking_bomb_area.Fx = library.Get <BlueprintAbilityAreaEffect>("aa2e0a0fe89693f4e9205fd52c5ba3e5").Fx;  //stinking cloud
            chocking_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = chocking_bomb_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            chocking_bomb_ability.SetNameDescriptionIcon("Chocking Bomb",
                                                         "Whenever a ninja throws a smoke bomb, all living creatures in the resulting cloud must make a Fortitude save or become staggered by the choking black smoke for 1d4 rounds. The DC of this saving throw is equal to 10 + 1/2 the ninja’s level + the ninja’s Charisma modifier.",
                                                         staggered_buff.Icon);
            chocking_bomb = Common.AbilityToFeature(chocking_bomb_ability, false);
            chocking_bomb.AddComponent(Helpers.PrerequisiteFeature(smoke_bomb));


            var blinding_bomb_ability = library.CopyAndAdd(smoke_bomb_ability, "NinjaBlindingBombAbility", "");
            var blinding_bomb_area    = library.CopyAndAdd <BlueprintAbilityAreaEffect>(NewSpells.obscuring_mist_area, "BlindingBombArea", "");
            var blind_buff            = library.Get <BlueprintBuff>("187f88d96a0ef464280706b63635f2af");
            var apply_buff2           = Helpers.CreateConditionalSaved(null, Common.createContextActionApplyBuff(blind_buff, Helpers.CreateContextDuration(0, DurationRate.Rounds, DiceType.D4, 1), dispellable: false));

            var apply_buff_saved2 = Helpers.CreateConditional(Common.createContextConditionHasFact(blind_buff), null,
                                                              Common.createContextActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateActionList(apply_buff2)));
            var blinding_bomb_action = Helpers.Create <NewMechanics.AbilityAreaEffectRunActionWithFirstRound>(a =>
            {
                a.UnitEnter  = Helpers.CreateActionList(apply_buff_saved2);
                a.Round      = Helpers.CreateActionList(apply_buff_saved2);
                a.FirstRound = Helpers.CreateActionList(apply_buff_saved2);
            });

            blinding_bomb_area.AddComponent(blinding_bomb_action);
            blinding_bomb_area.Fx = library.Get <BlueprintAbilityAreaEffect>("aa2e0a0fe89693f4e9205fd52c5ba3e5").Fx;  //stinking cloud
            blinding_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = blinding_bomb_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            blinding_bomb_ability.SetNameDescriptionIcon("Blinding Bomb",
                                                         "Whenever the ninja throws a smoke bomb, all living creatures in the cloud must make a Fortitude save or be blinded by the black smoke for 1d4 rounds. The DC of this saving throw is equal to 10 + 1/2 the ninja’s level + the ninja’s Charisma modifier.",
                                                         Helpers.GetIcon("bd05918a568c41e49aed7b9526ba596b") //blinding bomb
                                                         );
            blinding_bomb = Common.AbilityToFeature(blinding_bomb_ability, false);
            blinding_bomb.AddComponents(Helpers.PrerequisiteFeature(smoke_bomb), Helpers.PrerequisiteFeature(chocking_bomb));
        }
Exemple #17
0
        static void createDeificFocus()
        {
            deific_focus = Helpers.CreateFeature("DeificFocusResource",
                                                 "Deific Focus",
                                                 "At 1st level, a relic hunter learns to invest divine power into her chosen relics. This acts like the occultist’s focus powers and mental focus class features, with the following adjustments.\n"
                                                 + "Each day, a relic hunter has a number of points of deific focus equal to her inquisitor level + her Wisdom modifier, and she must spend 1 hour in prayer with her relics to invest them with divine power. These points refresh at the start of each day.",
                                                 "",
                                                 Occultist.implement_icons[SpellSchool.Universalist],
                                                 FeatureGroup.None,
                                                 Helpers.Create <ImplementMechanics.AddImplements>()
                                                 );

            locked_focus_buff = Helpers.CreateBuff("RelicHunterLockedFocusBuff",
                                                   "Deific Focus Invested",
                                                   "You have invested deific focus into your implements.",
                                                   "",
                                                   Occultist.implement_icons[SpellSchool.Universalist],
                                                   null,
                                                   Helpers.CreateAddFactContextActions(deactivated: Helpers.Create <ImplementMechanics.ContextActionUnlockFocus>())
                                                   );
            locked_focus_buff.SetBuffFlags(BuffFlags.HiddenInUi | BuffFlags.RemoveOnRest | BuffFlags.StayOnDeath);

            var lock_focus_ability = Helpers.CreateAbility("RelicHunterLockFocusAbility",
                                                           "Lock Invested Deific Focus",
                                                           "Lock invested deific focus until you rest.",
                                                           "",
                                                           Occultist.implement_icons[SpellSchool.Universalist],
                                                           AbilityType.Special,
                                                           CommandType.Standard,
                                                           AbilityRange.Personal,
                                                           "",
                                                           "",
                                                           Helpers.CreateRunActions(Helpers.Create <ImplementMechanics.ContextActionLockFocus>(),
                                                                                    Common.createContextActionApplyBuff(locked_focus_buff, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true)
                                                                                    ),
                                                           Helpers.Create <ImplementMechanics.AbilityCasterFocusLocked>(a => a.not = true)
                                                           );

            lock_focus_ability.setMiscAbilityParametersSelfOnly();
            Common.setAsFullRoundAction(lock_focus_ability);

            var reset_focus_ability = Helpers.CreateAbility("RelicHunterResetFocusAbility",
                                                            "Reset Invested Deific Focus",
                                                            "Reset deific focus you invested into your implements and redistribute it anew.",
                                                            "",
                                                            Occultist.implement_icons[SpellSchool.None],
                                                            AbilityType.Special,
                                                            CommandType.Free,
                                                            AbilityRange.Personal,
                                                            "",
                                                            "",
                                                            Helpers.CreateRunActions(Helpers.Create <ImplementMechanics.ContextActionResetFocus>()),
                                                            Helpers.Create <ImplementMechanics.AbilityCasterFocusLocked>(a => a.not = true)
                                                            );

            reset_focus_ability.setMiscAbilityParametersSelfOnly();

            List <BlueprintAbility> abilities = new List <BlueprintAbility>();

            abilities.Add(lock_focus_ability);
            abilities.Add(reset_focus_ability);

            foreach (SpellSchool school in Enum.GetValues(typeof(SpellSchool)))
            {
                if (school == SpellSchool.None)
                {
                    continue;
                }

                var resource = Helpers.CreateAbilityResource(school.ToString() + "DeificFocusResource", "", "", "", null);
                if (school == SpellSchool.Universalist)
                {
                    resource.SetIncreasedByLevel(0, 1, getOccultistArray());
                    resource.SetIncreasedByStat(0, StatType.Wisdom);
                }
                else
                {
                    resource.SetFixedResource(0);
                }
                deific_focus_resource[school] = resource;
                deific_focus.AddComponent(resource.CreateAddAbilityResource());
                var reset_action = reset_focus_ability.GetComponent <AbilityEffectRunAction>().Actions;
                reset_action.Actions = reset_action.Actions.AddToArray(Helpers.Create <ResourceMechanics.ContextRestoreResource>(c => { c.full = true; c.Resource = resource; }));

                if (school == SpellSchool.Universalist)
                {
                    continue;
                }

                var invest_focus_ability = Helpers.CreateAbility(school.ToString() + "RelicHunterInvestFocusAbility",
                                                                 "Invest Deific Focus: " + school.ToString(),
                                                                 "Invest deific focus into specified implement.",
                                                                 "",
                                                                 Occultist.implement_icons[school],
                                                                 AbilityType.Special,
                                                                 CommandType.Free,
                                                                 AbilityRange.Personal,
                                                                 "",
                                                                 "",
                                                                 Helpers.CreateRunActions(Helpers.Create <ImplementMechanics.ContextActionInvestFocus>(c => { c.school = school; c.resource = deific_focus_resource[school]; })),
                                                                 resource.CreateResourceLogic()
                                                                 );
                invest_focus_ability.setMiscAbilityParametersSelfOnly();
                abilities.Add(invest_focus_ability);
                invest_focus_abilities[school] = invest_focus_ability;
            }

            foreach (var ability in abilities)
            {
                ability.MaybeReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = deific_focus_resource[SpellSchool.Universalist]);
            }

            var wrapper = Common.createVariantWrapper("DeificFocusAbilityBase", "", abilities.ToArray());

            wrapper.SetNameDescriptionIcon(deific_focus);

            deific_focus.AddComponent(Helpers.CreateAddFact(wrapper));
            deific_focus.AddComponents(Helpers.Create <ImplementMechanics.IncreaseResourceAmountBasedOnInvestedFocus>(r =>
            {
                r.resource = deific_focus_resource[SpellSchool.Universalist];
                r.school   = SpellSchool.Universalist;
            })
                                       );

            foreach (var panoply in Enum.GetValues(typeof(Occultist.Panoply)))
            {
                var resource = Helpers.CreateAbilityResource(panoply.ToString() + "DeificFocusResource", "", "", "", null);
                resource.SetFixedResource(100);
                deific_focus_resource[(SpellSchool)panoply] = resource;
            }
        }
        static void createTheurgy()
        {
            var feat_icon        = LoadIcons.Image2Sprite.Create(@"FeatIcons/Theurgy.png");
            var feat_name        = "Theurgy";
            var feat_description = " You can augment the power of your divine spells with arcane energy and augment your arcane spells with divine energy.\n"
                                   + "You may sacrifice an arcane spell slot or arcane prepared spell as a swift action to increase caster level of next divine spell of the same level or lower you will cast in this round.\n"
                                   + "You may sacrifice a divine spell slot or divine prepared spell as a swift action to increase caster level of next arcane spell of the same level or lower you will cast in this round.\n"
                                   + "In addition this feat allows to reduce spell level requirement to 1st-level spells for one of the classes when qualifying for Mystic Theurge prestige class.";

            var arcane_buffs_list = new List <BlueprintBuff>();
            var divine_buffs_list = new List <BlueprintBuff>();

            for (int l = 1; l < 10; l++)
            {
                var arcane_buff = Helpers.CreateBuff($"TheurgyArcane{l}Buff",
                                                     feat_name + $": Arcane Spells Caster Level Bonus ({l})",
                                                     feat_description,
                                                     "",
                                                     feat_icon,
                                                     null,
                                                     Helpers.Create <SpellManipulationMechanics.IncreaseSpellTypeCasterLevel>(i => { i.apply_to_arcane = true; i.bonus = 1; i.remove_after_use = true; i.max_lvl = l; })
                                                     );
                arcane_buff.Stacking = StackingType.Replace;
                var divine_buff = Helpers.CreateBuff($"TheurgyDivine{l}Buff",
                                                     feat_name + $": Divine Spells Caster Level Bonus ({l})",
                                                     feat_description,
                                                     "",
                                                     feat_icon,
                                                     null,
                                                     Helpers.Create <SpellManipulationMechanics.IncreaseSpellTypeCasterLevel>(i => { i.apply_to_divine = true; i.bonus = 1; i.remove_after_use = true; i.max_lvl = l; })
                                                     );
                divine_buff.Stacking = StackingType.Replace;
                arcane_buffs_list.Add(arcane_buff);
                divine_buffs_list.Add(divine_buff);
            }

            var abilities = new List <BlueprintAbility>();

            theurgy = Helpers.CreateFeature("TheurgyFeature",
                                            feat_name,
                                            feat_description,
                                            "",
                                            feat_icon,
                                            FeatureGroup.Feat,
                                            Helpers.PrerequisiteStatValue(StatType.Wisdom, 13),
                                            Helpers.PrerequisiteStatValue(StatType.Intelligence, 13, any: true),
                                            Helpers.PrerequisiteStatValue(StatType.Charisma, 13, any: true),
                                            Common.createPrerequisiteCasterTypeSpellLevel(true, 1),
                                            Helpers.Create <SpellbookMechanics.PrerequisiteDivineCasterTypeSpellLevel>(p => { p.RequiredSpellLevel = 1; })
                                            );

            for (int i = 1; i < 10; i++)
            {
                int x = i;
                Predicate <AbilityData> check_slot_predicate = delegate(AbilityData spell)
                {
                    if (spell.Spellbook == null)
                    {
                        return(false);
                    }
                    if (spell.SpellLevel != x)
                    {
                        return(false);
                    }
                    return(spell.Spellbook.Blueprint.IsArcane ||
                           !(spell.Spellbook.Blueprint.IsAlchemist || spell.Spellbook.Blueprint.GetComponent <SpellbookMechanics.PsychicSpellbook>() != null));
                };

                var apply_divine = Common.createContextActionApplyBuff(divine_buffs_list[i - 1], Helpers.CreateContextDuration(1), dispellable: false);
                var apply_arcane = Common.createContextActionApplyBuff(arcane_buffs_list[i - 1], Helpers.CreateContextDuration(1), dispellable: false);
                var ability      = Helpers.CreateAbility($"Theurgy{i}Ability",
                                                         feat_name,
                                                         feat_description,
                                                         "",
                                                         feat_icon,
                                                         AbilityType.Supernatural,
                                                         CommandType.Swift,
                                                         AbilityRange.Personal,
                                                         Helpers.oneRoundDuration,
                                                         "",
                                                         Helpers.Create <SpellManipulationMechanics.RunActionOnTargetBasedOnSpellType>(r =>
                {
                    r.action_arcane = Helpers.CreateActionList(Helpers.Create <NewMechanics.ContextActionRemoveBuffs>(c => c.Buffs = divine_buffs_list.ToArray()),
                                                               apply_divine);
                    r.action_divine = Helpers.CreateActionList(Helpers.Create <NewMechanics.ContextActionRemoveBuffs>(c => c.Buffs = arcane_buffs_list.ToArray()),
                                                               apply_arcane);
                    r.check_slot_predicate = check_slot_predicate;
                    r.context_fact         = theurgy;
                })
                                                         );
                abilities.Add(ability);
            }

            theurgy.AddComponents(Helpers.CreateAddFacts(abilities.ToArray()));
            library.AddFeats(theurgy);

            mystic_theurge.RemoveComponents <PrerequisiteCasterTypeSpellLevel>();
            mystic_theurge.AddComponents(Helpers.Create <PrerequisiteMechanics.CompoundPrerequisites>(p =>
            {
                p.prerequisites = new Prerequisite[]
                {
                    Common.createPrerequisiteCasterTypeSpellLevel(true, 2),
                    Helpers.Create <SpellbookMechanics.PrerequisiteDivineCasterTypeSpellLevel>(pp => { pp.RequiredSpellLevel = 2; })
                };
                p.Group = Prerequisite.GroupType.Any;
            }),
                                         Helpers.Create <PrerequisiteMechanics.CompoundPrerequisites>(p =>
            {
                p.prerequisites = new Prerequisite[]
                {
                    Common.createPrerequisiteCasterTypeSpellLevel(true, 2),
                    Helpers.Create <SpellbookMechanics.PrerequisiteDivineCasterTypeSpellLevel>(pp => { pp.RequiredSpellLevel = 1; }),
                    Helpers.PrerequisiteFeature(theurgy)
                };
                p.Group = Prerequisite.GroupType.Any;
            }),
                                         Helpers.Create <PrerequisiteMechanics.CompoundPrerequisites>(p =>
            {
                p.prerequisites = new Prerequisite[]
                {
                    Common.createPrerequisiteCasterTypeSpellLevel(true, 1),
                    Helpers.Create <SpellbookMechanics.PrerequisiteDivineCasterTypeSpellLevel>(pp => { pp.RequiredSpellLevel = 2; }),
                    Helpers.PrerequisiteFeature(theurgy)
                };
                p.Group = Prerequisite.GroupType.Any;
            })
                                         );

            var arcane_spellbook_selection = library.Get <BlueprintFeatureSelection>("97f510c6483523c49bc779e93e4c4568");
            var divine_spellbook_selection = library.Get <BlueprintFeatureSelection>("7cd057944ce7896479717778330a4933");

            foreach (var sb in arcane_spellbook_selection.AllFeatures)
            {
                sb.ReplaceComponent <PrerequisiteClassSpellLevel>(p => p.RequiredSpellLevel = 1);
            }
            foreach (var sb in divine_spellbook_selection.AllFeatures)
            {
                sb.ReplaceComponent <PrerequisiteClassSpellLevel>(p => p.RequiredSpellLevel = 1);
            }
        }
Exemple #19
0
        static void createPersonalTrial()
        {
            var icon = Helpers.GetIcon("c3a8f31778c3980498d8f00c980be5f5"); //guidance

            var config = Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, classes: new BlueprintCharacterClass[] { archetype.GetParentClass() },
                                                         progression: ContextRankProgression.OnePlusDivStep, stepLevel: 4);
            var buff = Helpers.CreateBuff("PersonalTrialBuff",
                                          "",
                                          "",
                                          "",
                                          icon,
                                          Common.createPrefabLink("5b4cdc22715305949a1bd80fab08302b"),
                                          Helpers.Create <UniqueBuff>(),
                                          Helpers.Create <ACBonusAgainstTarget>(a =>
            {
                a.CheckCaster = true;
                a.Descriptor  = ModifierDescriptor.Insight;
                a.Value       = Helpers.CreateContextValue(AbilityRankType.Default);
            }
                                                                                ),
                                          Helpers.Create <DamageBonusAgainstTarget>(a =>
            {
                a.CheckCaster        = true;
                a.ApplyToSpellDamage = true;
                a.Value = Helpers.CreateContextValue(AbilityRankType.Default);
            }
                                                                                    ),
                                          config
                                          );

            buff.SetBuffFlags(BuffFlags.RemoveOnRest);
            var ability = library.CopyAndAdd <BlueprintAbility>("7bb9eb2042e67bf489ccd1374423cdec", "PersonalTrialAbility", "");

            ability.RemoveComponents <AbilityEffectRunAction>();
            ability.RemoveComponents <ContextRankConfig>();

            ability.AddComponent(Helpers.CreateRunActions(Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(), dispellable: false, is_permanent: true)));
            ability.SetNameDescriptionIcon("Personal Trial",
                                           " Once per day, an Iroran paladin can as a swift action declare one target within line of sight as his personal trial. The Iroran paladin gains a +1 insight bonus on attack rolls and damage rolls against that creature, to his AC against attacks made by the target, and on saving throws against the target’s spells and special abilities. This bonus increases by 1 at 4th level and every 4 levels thereafter, to a maximum bonus of +6 at 20th level. The personal trial effect remains until the target of the trial is dead or the next time the paladin rests and regains daily uses of this ability. At 4th level and every three levels thereafter, the Iroran paladin can use personal trial one additional time per day.",
                                           icon);

            personal_trial = Common.AbilityToFeature(ability, false);
            personal_trial.AddComponent(ability.GetComponent <AbilityResourceLogic>().RequiredResource.CreateAddAbilityResource());

            personal_trial.AddComponents(Helpers.Create <NewMechanics.SavingThrowBonusAgainstFactFromCaster>(s =>
            {
                s.CheckedFact = buff;
                s.Descriptor  = ModifierDescriptor.Insight;
                s.Value       = Helpers.CreateContextValue(AbilityRankType.Default);
            }),
                                         Helpers.Create <NewMechanics.AttackBonusAgainstFactsOwner>(s =>
            {
                s.CheckedFacts     = new BlueprintUnitFact[] { buff };
                s.Descriptor       = ModifierDescriptor.Insight;
                s.Bonus            = Helpers.CreateContextValue(AbilityRankType.Default);
                s.only_from_caster = true;
                s.attack_types     = new AttackType[] { AttackType.Melee, AttackType.Touch, AttackType.RangedTouch, AttackType.Ranged };
            }),
                                         config
                                         );
            personal_trial.ReapplyOnLevelUp = true;
            personal_trial_extra_use        = library.CopyAndAdd <BlueprintFeature>("0f5c99ffb9c084545bbbe960b825d137", "PersonalTrialExtraUse", "");
            personal_trial_extra_use.SetNameDescriptionIcon(personal_trial);


            personal_trial_buff = buff;
        }
Exemple #20
0
        static void createShieldedSpellstrikeAndSpellCombat()
        {
            var add_spell_combat = Helpers.Create <AddMagusMechanicPart>(); //needed for unit_part magus creation (no actual ability though)

            Helpers.SetField(add_spell_combat, "m_Feature", 1);
            Helpers.SetField(add_spell_combat, "m_MagusClass", archetype.GetParentClass());
            //it should not be used since it sets spell combat to be always active by default (ok on magus though since the corresponding toggle is always active by default)

            var add_magus_part = Helpers.Create <NewMechanics.ActivateUnitPartMagus>(a => a.magus_class = archetype.GetParentClass());

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

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

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

            spellstrike.SetDescription("At 1st level, a skirnir may use this ability with a weapon or shield bash attack.");

            shielded_spellstrike = Common.ActivatableAbilityToFeature(spellstrike, false);
            shielded_spellstrike.AddComponents(add_magus_part, add_spellstrike);

            var spell_combat = library.CopyAndAdd <BlueprintActivatableAbility>("8898a573e8a8a184b8186dbc3a26da74", "SkirnirSpellCombatACtivatableAbility", "");

            spell_combat.SetNameDescription("Shield Spell Combat",
                                            "At 8th level, a skirnir gains the spell combat ability, but only when wielding his bonded shield. A skirnir may use his shield hand to perform somatic components for magus spells, forfeiting the shield’s bonus to AC until the beginning of his next turn; if the bonded shield is a buckler, he retains its bonus to AC. At 14th level, he gains the benefits of improved spell combat.\n"
                                            + "At 19th level, he retains his shield’s bonus to AC when using any type of shield with spell combat."
                                            );
            spell_combat.AddComponent(Helpers.Create <NewMechanics.ActivatableAbilityHasShieldRestriction>());
            shielded_spell_combat = Common.ActivatableAbilityToFeature(spell_combat, false);
            shielded_spell_combat.AddComponent(library.Get <BlueprintFeature>("2464ba53317c7fc4d88f383fac2b45f9").GetComponent <AddMagusMechanicPart>());
            shielded_spell_combat.AddComponent(Helpers.Create <HoldingItemsMechanics.UseSpellCombatWithShield>());

            //TODO: need to remove shield ac when using spell combat if skirnir lvl < 19 and it is not a buckler
            //Simply subtracting shield / shield enhancement and shield focus AC looks tempting but it will likely conflict with brilliant energy and pinpoint targeting
            var spell_combat_penalty = library.Get <BlueprintBuff>("7b4cf64d3a49e3d45b1dbd2385f4eb6d");

            greater_shielded_spellcombat = Helpers.CreateFeature("GreaterSpellCombatFeature",
                                                                 "",
                                                                 "",
                                                                 "",
                                                                 null,
                                                                 FeatureGroup.None
                                                                 );
            greater_shielded_spellcombat.HideInCharacterSheetAndLevelUp = true;
            greater_shielded_spellcombat.HideInUI = true;

            var penalty_buff = Helpers.CreateBuff("ShieldedSpellCombatPenalty",
                                                  "Shielded Spell Combat Penalty",
                                                  shielded_spell_combat.Description,
                                                  "",
                                                  shielded_spell_combat.Icon,
                                                  null,
                                                  Helpers.Create <RemoveShieldACIfHasShield>(r =>
            {
                r.only_if_has_feature = shielded_spell_combat;
                r.unless_feature      = greater_shielded_spellcombat;
                r.proficiency_groups  = new ArmorProficiencyGroup[] { ArmorProficiencyGroup.HeavyShield,
                                                                      ArmorProficiencyGroup.LightShield,
                                                                      ArmorProficiencyGroup.TowerShield };
            })
                                                  );
            var penalty_action = Helpers.CreateConditional(Common.createContextConditionHasFact(shielded_spell_combat), Common.createContextActionApplyBuff(penalty_buff, Helpers.CreateContextDuration(1), dispellable: false));

            spell_combat_penalty.AddComponent(Helpers.CreateAddFactContextActions(activated: penalty_action));
        }
Exemple #21
0
        static void createLesserSpellSynthesis()
        {
            var icon            = LoadIcons.Image2Sprite.Create(@"AbilityIcons/FontOfSpiritMagic.png");
            var combined_spells = library.Get <BlueprintFeature>("80ea00ac94323cd43b6e743f2fa168c8");

            lesser_spell_synthesis = Helpers.CreateFeature("LesserSpellSynthesisFeature",
                                                           "Lesser Spell Synthesis",
                                                           "Once per day as a full-round action, you can cast two spells, each from a different spellcasting class. Both spells must have a casting time of 1 standard action and must be a spell level equal to or lower than the level of spells you can prepare with the combined spells ability. You can make any decisions concerning the spells, such as the spells’ targets, independently.",
                                                           "",
                                                           icon,
                                                           FeatureGroup.Feat,
                                                           Helpers.PrerequisiteFeature(combined_spells));

            var resource = Helpers.CreateAbilityResource("LesserSpellSynthesisResource", "", "", "", null);

            resource.SetFixedResource(1);

            var arcane_buff = Helpers.CreateBuff($"LesserSpellSynthesisArcaneBuff",
                                                 lesser_spell_synthesis.Name + " (Arcane)",
                                                 lesser_spell_synthesis.Description,
                                                 "",
                                                 icon,
                                                 null,
                                                 Helpers.Create <TurnActionMechanics.SpellSynthesis>(s =>
            {
                s.action_type     = CommandType.Standard;
                s.is_full_round   = false;
                s.max_spell_level = Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default);
                s.is_arcane       = true;
            }
                                                                                                     ),
                                                 Helpers.CreateContextRankConfig(baseValueType: Kingmaker.UnitLogic.Mechanics.Components.ContextRankBaseValueType.ClassLevel,
                                                                                 classes: new BlueprintCharacterClass[] { mystic_theurge },
                                                                                 progression: Kingmaker.UnitLogic.Mechanics.Components.ContextRankProgression.OnePlusDiv2
                                                                                 )
                                                 );

            var divine_buff = Helpers.CreateBuff($"LesserSpellSynthesisDivineBuff",
                                                 lesser_spell_synthesis.Name + " (Divine)",
                                                 lesser_spell_synthesis.Description,
                                                 "",
                                                 icon,
                                                 null,
                                                 Helpers.Create <TurnActionMechanics.SpellSynthesis>(s =>
            {
                s.action_type     = CommandType.Standard;
                s.is_full_round   = false;
                s.max_spell_level = Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default);
                s.is_arcane       = false;
            }
                                                                                                     ),
                                                 Helpers.CreateContextRankConfig(baseValueType: Kingmaker.UnitLogic.Mechanics.Components.ContextRankBaseValueType.ClassLevel,
                                                                                 classes: new BlueprintCharacterClass[] { mystic_theurge },
                                                                                 progression: Kingmaker.UnitLogic.Mechanics.Components.ContextRankProgression.OnePlusDiv2
                                                                                 )
                                                 );


            var buff = Helpers.CreateBuff("LesserSpellSynthesisBuff",
                                          lesser_spell_synthesis.Name,
                                          lesser_spell_synthesis.Description,
                                          "",
                                          icon,
                                          null
                                          );

            buff.SetBuffFlags(BuffFlags.HiddenInUi);

            var ability = Helpers.CreateAbility($"LesserSpellSynthesisAbility",
                                                "Lesser Spell Synthesis",
                                                lesser_spell_synthesis.Description,
                                                "",
                                                icon,
                                                Kingmaker.UnitLogic.Abilities.Blueprints.AbilityType.Supernatural,
                                                CommandType.Standard,
                                                Kingmaker.UnitLogic.Abilities.Blueprints.AbilityRange.Personal,
                                                Helpers.oneRoundDuration,
                                                "",
                                                Helpers.CreateRunActions(Common.createContextActionApplyBuff(arcane_buff, Helpers.CreateContextDuration(1), dispellable: false),
                                                                         Common.createContextActionApplyBuff(divine_buff, Helpers.CreateContextDuration(1), dispellable: false),
                                                                         Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(1), dispellable: false)
                                                                         ),
                                                Helpers.CreateResourceLogic(resource)
                                                );

            ability.setMiscAbilityParametersSelfOnly();
            Common.setAsFullRoundAction(ability);

            lesser_spell_synthesis.AddComponents(Helpers.CreateAddFact(ability),
                                                 Helpers.CreateAddAbilityResource(resource));


            extra_lesser_spell_synthesis = Helpers.CreateFeature("ExtraLesserSpellSynthesisFeature",
                                                                 "Extra Lesser Spell Synthesis",
                                                                 "You can perform one additional lesser spell synthesis per day.\n"
                                                                 + "Special: You can select this feat multiple times. Each time you take the feat, you can use this ability one additional time per day.",
                                                                 "",
                                                                 icon,
                                                                 FeatureGroup.Feat,
                                                                 Helpers.Create <ResourceMechanics.ContextIncreaseResourceAmount>(c => { c.Resource = resource; c.Value = Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default); }),
                                                                 Helpers.PrerequisiteFeature(combined_spells),
                                                                 Helpers.PrerequisiteFeature(lesser_spell_synthesis)
                                                                 );
            extra_lesser_spell_synthesis.AddComponent(Helpers.CreateContextRankConfig(baseValueType: Kingmaker.UnitLogic.Mechanics.Components.ContextRankBaseValueType.FeatureRank,
                                                                                      feature: extra_lesser_spell_synthesis)
                                                      );
            extra_lesser_spell_synthesis.ReapplyOnLevelUp = true;
            extra_lesser_spell_synthesis.Ranks            = 10;

            library.AddFeats(lesser_spell_synthesis, extra_lesser_spell_synthesis);
        }
Exemple #22
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));
        }
Exemple #23
0
        static void createSpellShield()
        {
            var arcane_pool_resource = library.Get <BlueprintAbilityResource>("effc3e386331f864e9e06d19dc218b37");

            spell_shield = Helpers.CreateFeature("SpellShieldFeature",
                                                 "Spellshield",
                                                 "At 7th level, as a standard action, a skirnir may store a magus spell in his shield by spending 1 point from his arcane pool per level of the spell. This functions as the spell storing weapon special ability, but activates only on a successful shield bash by the skirnir and is not limited to spells of 3rd level or less. ",
                                                 "",
                                                 Helpers.GetIcon("ef768022b0785eb43a18969903c537c4"), //mage shield
                                                 FeatureGroup.None,
                                                 Helpers.Create <SpellManipulationMechanics.FactStoreSpell>(f => f.always_hit = true));

            var release_buff = Helpers.CreateBuff("SpellShieldToggleBuff",
                                                  spell_shield.Name + ": Release",
                                                  spell_shield.Description,
                                                  "",
                                                  spell_shield.Icon,
                                                  null,
                                                  Helpers.Create <SpellManipulationMechanics.AddStoredSpellToCaption>(a => a.store_fact = spell_shield));

            var spell_shield_activatable_ability = Helpers.CreateActivatableAbility("SpellShieldToggleAbility",
                                                                                    spell_shield.Name + ": Release",
                                                                                    spell_shield.Description,
                                                                                    "",
                                                                                    spell_shield.Icon,
                                                                                    release_buff,
                                                                                    AbilityActivationType.Immediately,
                                                                                    CommandType.Free,
                                                                                    null,
                                                                                    Helpers.Create <NewMechanics.ActivatableAbilityHasShieldRestriction>(),
                                                                                    Helpers.Create <SpellManipulationMechanics.ActivatableAbilitySpellStoredInFactRestriction>(a => a.fact = spell_shield));

            spell_shield_activatable_ability.DeactivateImmediately = true;

            var release_action       = Helpers.Create <SpellManipulationMechanics.ReleaseSpellStoredInSpecifiedBuff>(r => r.fact = spell_shield);
            var release_on_condition = Helpers.CreateConditional(Common.createContextConditionCasterHasFact(release_buff),
                                                                 release_action
                                                                 );
            var on_attack_action = Common.createAddInitiatorAttackWithWeaponTriggerWithCategory(Helpers.CreateActionList(release_on_condition), weapon_category: WeaponCategory.SpikedHeavyShield);

            spell_shield.AddComponents(Common.createAddInitiatorAttackWithWeaponTriggerWithCategory(Helpers.CreateActionList(release_on_condition), weapon_category: WeaponCategory.SpikedHeavyShield),
                                       Common.createAddInitiatorAttackWithWeaponTriggerWithCategory(Helpers.CreateActionList(release_on_condition), weapon_category: WeaponCategory.SpikedLightShield),
                                       Common.createAddInitiatorAttackWithWeaponTriggerWithCategory(Helpers.CreateActionList(release_on_condition), weapon_category: WeaponCategory.WeaponHeavyShield),
                                       Common.createAddInitiatorAttackWithWeaponTriggerWithCategory(Helpers.CreateActionList(release_on_condition), weapon_category: WeaponCategory.WeaponLightShield));
            spell_shield.AddComponent(Helpers.CreateAddFact(spell_shield_activatable_ability));

            int max_variants = 10; //due to ui limitation
            Predicate <AbilityData> check_slot_predicate = delegate(AbilityData spell)
            {
                return(spell.Spellbook?.Blueprint == archetype.ReplaceSpellbook &&
                       spell.Blueprint.EffectOnEnemy == AbilityEffectOnUnit.Harmful &&
                       spell.Blueprint.Range != AbilityRange.Personal &&
                       spell.Blueprint.CanTargetEnemies &&
                       !spell.Blueprint.CanTargetPoint &&
                       !spell.Blueprint.IsFullRoundAction &&
                       (!spell.Blueprint.HasVariants || spell.Variants.Count < max_variants) &&
                       !spell.Blueprint.HasAreaEffect() &&
                       (!spell.RequireMaterialComponent || spell.HasEnoughMaterialComponent));
            };

            for (int i = 0; i < max_variants; i++)
            {
                var ability = Helpers.CreateAbility($"SpellShield{i + 1}Ability",
                                                    spell_shield.Name,
                                                    spell_shield.Description,
                                                    "",
                                                    spell_shield.Icon,
                                                    AbilityType.Supernatural,
                                                    CommandType.Standard,
                                                    AbilityRange.Personal,
                                                    "",
                                                    "",
                                                    Helpers.Create <SpellManipulationMechanics.AbilityStoreSpellInFact>(s => { s.fact = spell_shield; s.check_slot_predicate = check_slot_predicate; s.variant = i; }),
                                                    Helpers.CreateResourceLogic(arcane_pool_resource, cost_is_custom: true),
                                                    library.Get <BlueprintAbility>("1bd76e00b6e056d42a8ecc1031dd43b4").GetComponent <AbilityMagusSpellRecallCostCalculator>()
                                                    );
                ability.setMiscAbilityParametersSelfOnly();
                spell_shield.AddComponent(Helpers.CreateAddFact(ability));
            }

            greater_spellshield = Helpers.CreateFeature("GreaterSpellshieldFeature",
                                                        "Greater Spellshield",
                                                        "At 16th level, a skirnir may activate a stored spell as a swift action after being struck in combat.",
                                                        "",
                                                        Helpers.GetIcon("183d5bb91dea3a1489a6db6c9cb64445"), //shield of faith
                                                        FeatureGroup.None);

            var release_buff2 = Helpers.CreateBuff("GreaterSpellshieldToggleBuff",
                                                   greater_spellshield.Name + ": Release",
                                                   greater_spellshield.Description,
                                                   "",
                                                   greater_spellshield.Icon,
                                                   null,
                                                   Helpers.Create <SpellManipulationMechanics.AddStoredSpellToCaption>(a => a.store_fact = spell_shield));

            var greater_spell_shield_ability = Helpers.CreateActivatableAbility("GreaterSpellshieldToggleAbility",
                                                                                greater_spellshield.Name + ": Release",
                                                                                greater_spellshield.Description,
                                                                                "",
                                                                                greater_spellshield.Icon,
                                                                                release_buff2,
                                                                                AbilityActivationType.Immediately,
                                                                                CommandType.Free,
                                                                                null,
                                                                                Helpers.Create <NewMechanics.ActivatableAbilityLightOrNoArmor>(),
                                                                                Helpers.Create <SpellManipulationMechanics.ActivatableAbilitySpellStoredInFactRestriction>(a => a.fact = spell_shield));

            greater_spell_shield_ability.DeactivateImmediately = true;

            var release_on_condition_swift = Helpers.CreateConditional(new Condition[] { Common.createContextConditionCasterHasFact(release_buff2),
                                                                                         Helpers.Create <TurnActionMechanics.ContextConditionHasAction>(c => { c.has_swift = true; c.check_caster = true; }) },
                                                                       new GameAction[] { release_action,
                                                                                          Helpers.Create <TurnActionMechanics.ConsumeAction>(c => { c.consume_swift = true; c.from_caster = true; }) }
                                                                       );
            var on_attacked_action = Common.createAddTargetAttackWithWeaponTrigger(action_attacker: Helpers.CreateActionList(release_on_condition_swift),
                                                                                   not_reach: false, only_melee: true,
                                                                                   wait_for_attack_to_resolve: true);

            greater_spellshield.AddComponent(on_attacked_action);
            greater_spellshield.AddComponent(Helpers.CreateAddFact(greater_spell_shield_ability));
        }