예제 #1
0
        static void createTerrefyingHowl()
        {
            var dazzling_display = library.Get <BlueprintAbility>("5f3126d4120b2b244a95cb2ec23d69fb");

            terrifying_howl_ability = library.CopyAndAdd <BlueprintAbility>("08cb5f4c3b2695e44971bf5c45205df0", "TerrifyingHowlAbility", "");
            terrifying_howl_ability.SetName("Terrifying Howl");
            terrifying_howl_ability.SetDescription("The barbarian unleashes a terrifying howl as a standard action. All shaken enemies within 30 feet must make a Will save (DC equal to 10 + 1/2 the barbarian’s level + the barbarian’s Strength modifier) or be frightened for 1d4+1 rounds.\n"
                                                   + "Once an enemy has made a save versus terrifying howl (successful or not), it is immune to this power for 24 hours.");
            terrifying_howl_ability.Type = AbilityType.Extraordinary;
            terrifying_howl_ability.RemoveComponents <SpellComponent>();
            terrifying_howl_ability.RemoveComponents <SpellListComponent>();
            terrifying_howl_ability.Range = AbilityRange.Personal;

            var frighteneed_buff = library.Get <BlueprintBuff>("f08a7239aa961f34c8301518e71d4cdf");
            var shaken_buff      = library.Get <BlueprintBuff>("25ec6cb6ab1845c48a95f9c20b034220");
            var cooldown_buff    = Helpers.CreateBuff("TerrifyingHowlCooldownBuff",
                                                      "Cooldown: Terrifying Howl",
                                                      terrifying_howl_ability.Description,
                                                      "",
                                                      terrifying_howl_ability.Icon,
                                                      null);

            cooldown_buff.SetBuffFlags(BuffFlags.RemoveOnRest);
            var on_failed_save = Common.createContextSavedApplyBuff(frighteneed_buff,
                                                                    Helpers.CreateContextDuration(Common.createSimpleContextValue(1),
                                                                                                  Kingmaker.UnitLogic.Mechanics.DurationRate.Rounds,
                                                                                                  Kingmaker.RuleSystem.DiceType.D4,
                                                                                                  Common.createSimpleContextValue(1)
                                                                                                  ),
                                                                    is_dispellable: false
                                                                    );

            var apply_cooldown = Common.createContextActionApplyBuff(cooldown_buff, Helpers.CreateContextDuration(Common.createSimpleContextValue(1),
                                                                                                                  Kingmaker.UnitLogic.Mechanics.DurationRate.Days),
                                                                     dispellable: false
                                                                     );
            PrefabLink p = new PrefabLink();

            p.AssetId = "cbfe312cb8e63e240a859efaad8e467c";
            var fx = Common.createContextActionSpawnFx(p);


            var condition = Helpers.CreateConditional(new Condition[] { Helpers.CreateConditionHasBuffFromCaster(cooldown_buff, true),
                                                                        Helpers.CreateConditionHasFact(shaken_buff),
                                                                        Helpers.Create <ContextConditionIsEnemy>() },
                                                      Common.createContextActionSavingThrow(SavingThrowType.Will, Helpers.CreateActionList(on_failed_save, apply_cooldown, fx)));

            condition.ConditionsChecker.Operation = Operation.And;

            terrifying_howl_ability.ReplaceComponent <AbilityEffectRunAction>(Helpers.CreateRunActions(condition));
            terrifying_howl_ability.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClasses(new BlueprintCharacterClass[] { barbarian_class }, StatType.Strength));
            terrifying_howl_ability.AddComponent(dazzling_display.GetComponent <AbilitySpawnFx>());
            terrifying_howl_ability.AddComponent(Common.createAbilityCasterHasFacts(rage_marker_caster)); // allow to use only on rage
            terrifying_howl_feature        = Common.AbilityToFeature(terrifying_howl_ability, false);
            terrifying_howl_feature.Groups = new FeatureGroup[] { FeatureGroup.RagePower };
            terrifying_howl_feature.AddComponent(Helpers.PrerequisiteClassLevel(barbarian_class, 8));
            addToSelection(terrifying_howl_feature);
        }
예제 #2
0
        static void createGangUp()
        {
            var freebooter_bane_buff = library.Get <BlueprintBuff>("76dabd40a1c1c644c86ce30e41ad5cab");
            var gang_up_buff         = library.CopyAndAdd <BlueprintBuff>(vindicative_smite_buff.AssetGuid, "GangUpBuff", "");

            gang_up_buff.SetName("Gang Up");
            gang_up_buff.SetIcon(freebooter_bane_buff.Icon);
            gang_up_buff.ReplaceComponent <ACBonusAgainstTarget>(a => { a.CheckCaster = false; a.CheckCasterFriend = true; });
            gang_up_buff.ReplaceComponent <AttackBonusAgainstTarget>(a => { a.CheckCaster = false; a.CheckCasterFriend = true; });
            gang_up_buff.ReplaceComponent <DamageBonusAgainstTarget>(a => { a.CheckCaster = false; a.CheckCasterFriend = true; });


            gang_up_ability = library.CopyAndAdd <BlueprintAbility>(vindicative_smite_ability.AssetGuid, "GangUpAbility", "");
            gang_up_ability.RemoveComponents <AbilityTargetHasFact>();
            gang_up_ability.RemoveComponents <AbilityResourceLogic>();
            gang_up_ability.AddComponent(Common.createAbilityTargetHasFact(false, vindicative_smite_buff));
            gang_up_ability.ActionType = CommandType.Move;

            foreach (var c in gang_up_ability.GetComponents <ContextRankConfig>().ToArray())
            {
                var new_c = c.CreateCopy();
                Helpers.SetField(new_c, "m_Min", 1);
                Helpers.SetField(new_c, "m_UseMin", true);
                Helpers.SetField(new_c, "m_Progression", ContextRankProgression.Div2);
                gang_up_ability.ReplaceComponent(c, new_c);
            }

            var apply_buff = Common.createContextActionApplyBuff(gang_up_buff, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.SpeedBonus)), dispellable: false);

            gang_up_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(apply_buff));
            gang_up_ability.AddComponent(Helpers.CreateContextRankConfig(ContextRankBaseValueType.StatBonus, min: 1, type: AbilityRankType.SpeedBonus, stat: StatType.Charisma));
            gang_up_ability.SetName(gang_up_buff.Name);
            gang_up_ability.SetIcon(gang_up_buff.Icon);
            gang_up_ability.SetDescription("At 5th level, a vindictive bastard forms a close bond with her companions. This allows her to spend a move action to grant half her vindictive smite bonus against a single target to all allies who can see and hear her. This bonus lasts for a number of rounds equal to the vindictive bastard’s Charisma modifier (minimum 1).");

            swift_gang_up_ability            = library.CopyAndAdd <BlueprintAbility>(gang_up_ability.AssetGuid, "SwiftGangUpAbility", "");
            swift_gang_up_ability.ActionType = CommandType.Swift;
            swift_gang_up_ability.SetName("Swift Justice");
            swift_gang_up_ability.SetDescription("At 11th level, a vindictive bastard can activate her gang up ability as a swift action.");

            gang_up       = Common.AbilityToFeature(gang_up_ability, false, "");
            swift_justice = Common.AbilityToFeature(swift_gang_up_ability, false, "");
        }
예제 #3
0
        static public void addClassToAbility(BlueprintCharacterClass class_to_add, BlueprintArchetype[] archetypes_to_add, BlueprintAbility a, BlueprintCharacterClass class_to_check)
        {
            var components = a.ComponentsArray.ToArray();

            foreach (var c in components.ToArray())
            {
                if (c is AbilityVariants)
                {
                    foreach (var v in (c as AbilityVariants).Variants)
                    {
                        addClassToAbility(class_to_add, archetypes_to_add, v, class_to_check);
                    }
                }
                else if (c is ContextRankConfig)
                {
                    addClassToContextRankConfig(class_to_add, archetypes_to_add, c as ContextRankConfig, a.name, class_to_check);
                }
                else if (c is AbilityEffectRunAction)
                {
                    addClassToActionList(class_to_add, archetypes_to_add, (c as AbilityEffectRunAction).Actions, class_to_check);
                }
                else if (c is ContextCalculateAbilityParamsBasedOnClass)
                {
                    var c_typed = c as ContextCalculateAbilityParamsBasedOnClass;
                    if (c_typed.CharacterClass == class_to_check)
                    {
                        a.ReplaceComponent(c, Common.createContextCalculateAbilityParamsBasedOnClassesWithArchetypes(new BlueprintCharacterClass[] { c_typed.CharacterClass, class_to_add }.Distinct().ToArray(), archetypes_to_add, c_typed.StatType));
                    }
                }
                else if (c is NewMechanics.ContextCalculateAbilityParamsBasedOnClasses)
                {
                    var c_typed = c as NewMechanics.ContextCalculateAbilityParamsBasedOnClasses;
                    if (c_typed.CharacterClasses.Contains(class_to_check))
                    {
                        a.ReplaceComponent(c, Common.createContextCalculateAbilityParamsBasedOnClassesWithArchetypes(c_typed.CharacterClasses.AddToArray(class_to_add).Distinct().ToArray(), c_typed.archetypes.AddToArray(archetypes_to_add).Distinct().ToArray(), c_typed.StatType));
                    }
                }
                else if (c is AbilityEffectStickyTouch)
                {
                    addClassToAbility(class_to_add, archetypes_to_add, (c as AbilityEffectStickyTouch).TouchDeliveryAbility, class_to_check);
                }
            }
        }
예제 #4
0
        static internal void UpdateDismiss()
        {
            BlueprintAbility dismissAbility = library.Get <BlueprintAbility>("5b21f6f7f14347948a2b77e3ae7e1fc4");

            dismissAbility.SetDescription("This ability allows caster to dismiss any area effect that they created at the target location, to dismiss a summoned or animated creature, or to release a dominated creature from control.");
            ContextActionDismissSpell dismiss = Helpers.Create <ExpandedContextActionDismissSpell>();

            dismissAbility.GetComponent <AbilityEffectRunAction>().Actions = Helpers.CreateActionList(dismiss);
            dismissAbility.ReplaceComponent <AbilityTargetCanDismiss>(Helpers.Create <ExpandedAbilityTargetCanDismiss>());
        }
예제 #5
0
        static void createVindicativeSmite()
        {
            vindicative_smite_buff = library.CopyAndAdd <BlueprintBuff>("b6570b8cbb32eaf4ca8255d0ec3310b0", "VindicativeSmiteBuff", "");
            vindicative_smite_buff.SetName("Vindictive Smite");
            vindicative_smite_buff.RemoveComponents <IgnoreTargetDR>();

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


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

            vindicative_smite_allowed.SetBuffFlags(BuffFlags.RemoveOnRest);


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

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

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

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

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

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

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

            GameAction trigger = apply_allowed;

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

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

            vindicative_smite_trigger.SetBuffFlags(BuffFlags.HiddenInUi);

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

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

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

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

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

            add_vindicative_smite_use = library.CopyAndAdd <BlueprintFeature>("0f5c99ffb9c084545bbbe960b825d137", "VindicativeSmiteAdditionalUse", "");
            add_vindicative_smite_use.SetName("Vindicative Smite - Additional Use");
            add_vindicative_smite_use.SetDescription(vindicative_smite.Description);
        }
        static void createDivineBond()
        {
            var loh_resource = library.Get <BlueprintAbilityResource>("9dedf41d995ff4446a181f143c3db98c");
            var resource     = Helpers.CreateAbilityResource("SacredServantDivineBondResource", "", "", "", null);

            resource.SetIncreasedByLevelStartPlusDivStep(1, 9, 1, 4, 1, 0, 0.0f, new BlueprintCharacterClass[] { archetype.GetParentClass() });
            divine_bond_buff = Helpers.CreateBuff("SacredServantDivineBondBuff",
                                                  "Divine Bond",
                                                  "At 5th level, instead of forming a divine bond with her weapon or a mount, a sacred servant forms a bond with her holy symbol.\n"
                                                  + "At 5th level, the spirit grants one bonus. For every three levels beyond 5th, the spirit grants one additional bonus. These bonuses can be spent in a number of ways to grant the paladin enhanced abilities to channel positive energy and to cast spells.\n"
                                                  + "Each bonus can be used to grant one of the following enhancements:\n"
                                                  + "+1 caster level to any paladin spell cast,\n"
                                                  + "+1 to the DC to halve the damage of channel positive energy when used to harm undead,\n"
                                                  + "+1d6 to channel positive energy,\n"
                                                  + "restore one use/day of lay on hands.\n"
                                                  + "These enhancements stack and can be selected multiple times. The enhancements granted by the spirit are determined when the spirit is called and cannot be changed until the spirit is called again. If the sacred servant increases her number of uses of lay on hands per day in this way, that choice is set for the rest of the day, and once used, these additional uses are not restored (even if the spirit is called again that day). The celestial spirit imparts no enhancements if the holy symbol is held by anyone other than the sacred servant, but resumes giving enhancements if returned to the sacred servant. A sacred servant can use this ability once per day at 5th level, and one additional time per day for every four levels beyond 5th, to a total of four times per day at 17th level.",
                                                  "",
                                                  LoadIcons.Image2Sprite.Create(@"AbilityIcons/Wish.png"),
                                                  null);

            divine_bond_ability = library.CopyAndAdd <BlueprintAbility>("7ff088ab58c69854b82ea95c2b0e35b4", "SacredServantDivineBondAbility", "");
            divine_bond_ability.SetNameDescriptionIcon(divine_bond_buff);
            var apply_buff = Common.createContextActionApplyBuff(divine_bond_buff, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default), DurationRate.Minutes), dispellable: false);

            divine_bond_ability.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = resource);
            divine_bond_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions        = Helpers.CreateActionList(apply_buff,
                                                                                                                           Helpers.Create <ResourceMechanics.RestoreResourceAmountEqualToRemainingGroupSize>(r => { r.resource = loh_resource; r.group = ActivatableAbilityGroup.DivineWeaponProperty; }))
                                                                          );
            divine_bond_ability.setMiscAbilityParametersSelfOnly();

            var cl_icon           = Helpers.GetIcon("1bc83efec9f8c4b42a46162d72cbf494"); //burst of glory
            var channel_dice_icon = Helpers.GetIcon("0d657aa811b310e4bbd8586e60156a2d"); //cure critical wounds
            var channel_dc_icon   = Helpers.GetIcon("a9a52760290591844a96d0109e30e04d"); //undeath to death

            var cl_bonuses           = new BlueprintActivatableAbility[6];
            var channel_dc_bonuses   = new BlueprintActivatableAbility[6];
            var channel_dice_bonuses = new BlueprintActivatableAbility[6];



            cl_bonuses = createSacredBondAbility("SacredServantDivineBondCLBonus",
                                                 "Caster Level Bonus",
                                                 divine_bond_buff.Description,
                                                 cl_icon,
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 1; }),
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 2; }),
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 3; }),
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 4; }),
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 5; }),
                                                 Helpers.Create <NewMechanics.IncreaseAllSpellsCLForSpecificSpellbook>(cl => { cl.spellbook = archetype.GetParentClass().Spellbook; cl.Value = 6; })
                                                 );

            var channels = ChannelEnergyEngine.getChannelAbilities(e => e.scalesWithClass(archetype.GetParentClass())).ToArray();

            channel_dc_bonuses = createSacredBondAbility("SacredServantDivineBondChannelDCBonus",
                                                         "Channel Energy DC Bonus",
                                                         divine_bond_buff.Description,
                                                         channel_dc_icon,
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 1; }),
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 2; }),
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 3; }),
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 4; }),
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 5; }),
                                                         Helpers.Create <NewMechanics.ContextIncreaseAbilitiesDC>(c => { c.abilities = channels; c.Value = 6; })
                                                         );

            channel_dice_bonuses = createSacredBondAbility("SacredServantDivineBondChannelDiceBonus",
                                                           "Channel Energy Dice Bonus",
                                                           divine_bond_buff.Description,
                                                           channel_dice_icon,
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 2; }),
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 4; }),
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 6; }),
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 8; }),
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 10; }),
                                                           Helpers.Create <NewMechanics.ContextIncreaseCasterLevelForSelectedSpells>(c => { c.spells = channels; c.value = 12; })
                                                           );

            for (int i = 0; i < 6; i++)
            {
                divine_bond[i] = Helpers.CreateFeature($"SacredServantDivineBond{i+1}Feature",
                                                       divine_bond_ability.Name,
                                                       divine_bond_ability.Description,
                                                       "",
                                                       divine_bond_ability.Icon,
                                                       FeatureGroup.None);
                if (i == 0)
                {
                    divine_bond[i].AddComponent(resource.CreateAddAbilityResource());
                    divine_bond[i].AddComponent(Helpers.CreateAddFact(divine_bond_ability));
                }
                else
                {
                    divine_bond[i].AddComponent(Common.createIncreaseActivatableAbilityGroupSize(ActivatableAbilityGroup.DivineWeaponProperty));
                }
                divine_bond[i].AddComponent(Helpers.CreateAddFacts(cl_bonuses[i], channel_dc_bonuses[i], channel_dice_bonuses[i]));
            }
        }
예제 #7
0
        static internal void createDeadlyJuggernaut()
        {
            var sneak_attack = library.Get <BlueprintFeature>("df4f34f7cac73ab40986bc33f87b1a3c");
            var false_life   = library.Get <BlueprintAbility>("7a5b5bf845779a941a67251539545762");

            deadly_juggernaut = library.CopyAndAdd <BlueprintAbility>("779179912e6c6fe458fa4cfb90d96e10", "DeadlyJuggernautAbility", "");
            deadly_juggernaut.RemoveComponents <SpellListComponent>();
            deadly_juggernaut.ReplaceComponent <AbilitySpawnFx>(false_life.GetComponent <AbilitySpawnFx>());
            deadly_juggernaut.ReplaceComponent <SpellComponent>(false_life.GetComponent <SpellComponent>());

            deadly_juggernaut.SetIcon(sneak_attack.Icon);
            deadly_juggernaut.SetName("Deadly Juggernaut");
            deadly_juggernaut.SetDescription("With every enemy life you take, you become increasingly dangerous and difficult to stop. During the duration of the spell, you gain a cumulative +1 luck bonus on melee attack rolls, melee weapon damage rolls, Strength checks, and Strength-based skill checks as well as DR 2/— each time you reduce a qualifying opponent to 0 or few hit points (maximum +5 bonus and DR 10/—) with a melee attack.");
            deadly_juggernaut.RemoveComponents <AbilityEffectRunAction>();


            BlueprintBuff[] buffs = new BlueprintBuff[5];

            for (int i = 0; i < buffs.Length; i++)
            {
                int bonus = i + 1;
                buffs[i] = Helpers.CreateBuff($"DeadlyJuggernaut{i + 1}Buff",
                                              $"Deadly Juggernaut (+{i + 1})",
                                              deadly_juggernaut.Description,
                                              "",
                                              deadly_juggernaut.Icon,
                                              null,
                                              Common.createAttackTypeAttackBonus(Common.createSimpleContextValue(bonus), AttackTypeAttackBonus.WeaponRangeType.Melee, ModifierDescriptor.Luck),
                                              Helpers.CreateAddStatBonus(StatType.AdditionalDamage, bonus, ModifierDescriptor.Luck),
                                              Common.createAbilityScoreCheckBonus(Common.createSimpleContextValue(bonus), ModifierDescriptor.Luck, StatType.Strength),
                                              Helpers.CreateAddStatBonus(StatType.SkillAthletics, bonus, ModifierDescriptor.Luck),
                                              Common.createPhysicalDR(bonus * 2)
                                              );
            }

            var conditional = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buffs[0]),
                                                        new GameAction[] { Common.createContextActionApplyBuff(buffs[1], Helpers.CreateContextDuration(), is_from_spell: true, is_child: true, is_permanent: true),
                                                                           Common.createContextActionRemoveBuff(buffs[0]) },
                                                        new GameAction[] { Common.createContextActionApplyBuff(buffs[0], Helpers.CreateContextDuration(), is_from_spell: true, is_child: true, is_permanent: true) }
                                                        );

            for (int i = 1; i < buffs.Length; i++)
            {
                GameAction[] if_true = null;
                if (i < buffs.Length - 1)
                {
                    if_true = new GameAction[] { Common.createContextActionRemoveBuff(buffs[i]),
                                                 Common.createContextActionApplyBuff(buffs[i + 1],
                                                                                     Helpers.CreateContextDuration(),
                                                                                     is_from_spell: true,
                                                                                     is_child: true,
                                                                                     is_permanent: true) };
                }
                conditional = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buffs[i]),
                                                        if_true,
                                                        new GameAction[] { conditional });
            }



            var on_kill = Common.createAddInitiatorAttackWithWeaponTrigger(Helpers.CreateActionList(conditional),
                                                                           reduce_hp_to_zero: true,
                                                                           check_weapon_range_type: true,
                                                                           on_initiator: true,
                                                                           range_type: AttackTypeAttackBonus.WeaponRangeType.Melee);

            var buff = Helpers.CreateBuff("DeadlyJuggernautBuff",
                                          deadly_juggernaut.Name,
                                          deadly_juggernaut.Description,
                                          "",
                                          deadly_juggernaut.Icon,
                                          null,
                                          on_kill);

            buff.Stacking = StackingType.Replace;
            var apply_buff = Common.createContextActionApplyBuff(buff,
                                                                 Helpers.CreateContextDuration(bonus: Helpers.CreateContextValue(AbilityRankType.Default), rate: DurationRate.Minutes),
                                                                 is_from_spell: true);

            deadly_juggernaut.AddComponent(Helpers.CreateRunActions(apply_buff));


            deadly_juggernaut.AddToSpellList(Helpers.clericSpellList, 3);
            deadly_juggernaut.AddToSpellList(Helpers.inquisitorSpellList, 3);
            deadly_juggernaut.AddToSpellList(Helpers.paladinSpellList, 3);
            deadly_juggernaut.AddSpellAndScroll("539ff89add7d8e4409ab92df30e6afee"); //lead_blades
        }
예제 #8
0
        static void createFlameBlade()
        {
            var bless_weapon       = library.Get <BlueprintAbility>("831e942864e924846a30d2e0678e438b");
            var flaming_enchatment = library.Get <BlueprintWeaponEnchantment>("30f90becaaac51f41bf56641966c4121");
            var scimitar_type      = library.Get <BlueprintWeaponType>("d9fbec4637d71bd4ebc977628de3daf3");
            var immaterial         = Helpers.Create <NewMechanics.Immaterial>();

            BlueprintWeaponEnchantment[] flame_blade_enchantments = new BlueprintWeaponEnchantment[11];
            var fire_damage = Common.createEnergyDamageDescription(Kingmaker.Enums.Damage.DamageEnergyType.Fire);

            for (int i = 0; i < flame_blade_enchantments.Length; i++)
            {
                var flame_blade_enchant = Helpers.Create <NewMechanics.WeaponDamageChange>(w =>
                {
                    w.bonus_damage            = i;
                    w.dice_formula            = new DiceFormula(1, DiceType.D8);
                    w.damage_type_description = fire_damage;
                });
                flame_blade_enchantments[i] = Common.createWeaponEnchantment($"FlameBlade{i}Enchantment",
                                                                             "Flame Blade",
                                                                             "You transform a non-magical scimitar into a 3-foot-long, blazing beam of red-hot fire springs. Attacks with the flame blade are melee touch attacks. The blade deals 1d8 points of fire damage + 1 point per two caster levels (maximum +10). Since the blade is immaterial, your Strength modifier does not apply to the damage. If you stop wielding it, the weapon loses magical properties.",
                                                                             "",
                                                                             "",
                                                                             "",
                                                                             0,
                                                                             flaming_enchatment.WeaponFxPrefab,
                                                                             immaterial,
                                                                             flame_blade_enchant
                                                                             );
            }


            var empower = Common.createWeaponEnchantment("EmpowerWeaponEnchantment",
                                                         "Empowered",
                                                         "All variable, numeric effects of an empowered spell are increased by half including bonuses to those dice rolls.",
                                                         "",
                                                         "",
                                                         "",
                                                         0,
                                                         null,
                                                         Helpers.Create <NewMechanics.WeaponMetamagicDamage>(w => w.empower = true)
                                                         );
            var maximize = Common.createWeaponEnchantment("MaximizeWeaponEnchantment",
                                                          "Maximized",
                                                          "All variable, numeric effects of a spell are maximized.",
                                                          "",
                                                          "",
                                                          "",
                                                          0,
                                                          null,
                                                          Helpers.Create <NewMechanics.WeaponMetamagicDamage>(w => w.maximize = true)
                                                          );


            var empower_buff = Common.createBuffContextEnchantPrimaryHandWeaponIfHasMetamagic(Kingmaker.UnitLogic.Abilities.Metamagic.Empower,
                                                                                              true, true,
                                                                                              new BlueprintWeaponType[] { scimitar_type }, empower);

            var maximize_buff = Common.createBuffContextEnchantPrimaryHandWeaponIfHasMetamagic(Kingmaker.UnitLogic.Abilities.Metamagic.Maximize,
                                                                                               true, true,
                                                                                               new BlueprintWeaponType[] { scimitar_type }, maximize);


            var buff = Helpers.CreateBuff("FlameBladeBuff",
                                          flame_blade_enchantments[0].Name,
                                          flame_blade_enchantments[0].Description,
                                          "",
                                          bless_weapon.Icon,
                                          null,
                                          Common.createBuffContextEnchantPrimaryHandWeapon(Helpers.CreateContextValue(AbilityRankType.DamageBonus), true, true,
                                                                                           new BlueprintWeaponType[] { scimitar_type }, flame_blade_enchantments),
                                          empower_buff,
                                          maximize_buff,
                                          Helpers.CreateContextRankConfig(baseValueType: ContextRankBaseValueType.CasterLevel, progression: ContextRankProgression.OnePlusDivStep,
                                                                          type: AbilityRankType.DamageBonus, stepLevel: 2)
                                          );

            buff.Stacking = Kingmaker.UnitLogic.Buffs.Blueprints.StackingType.Replace;

            flame_blade = library.CopyAndAdd <BlueprintAbility>(shillelagh.AssetGuid, "FlameBladeAbility", "");
            flame_blade.SetIcon(bless_weapon.Icon);
            flame_blade.SetName(buff.Name);
            flame_blade.SetDescription(buff.Description);

            flame_blade.ReplaceComponent <AbilityCasterMainWeaponCheck>(Common.createAbilityCasterMainWeaponCheck(scimitar_type.Category));
            flame_blade.ReplaceComponent <SpellComponent>(Helpers.CreateSpellComponent(Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation));

            var apply_buff = Common.createContextActionApplyBuff(buff,
                                                                 Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default), DurationRate.Minutes)
                                                                 );

            flame_blade.ReplaceComponent <AbilityEffectRunAction>(Helpers.CreateRunActions(apply_buff));
            flame_blade.AvailableMetamagic = flame_blade.AvailableMetamagic | Kingmaker.UnitLogic.Abilities.Metamagic.Empower | Kingmaker.UnitLogic.Abilities.Metamagic.Maximize;
            flame_blade.AddComponent(Helpers.CreateSpellDescriptor(SpellDescriptor.Fire));

            flame_blade.AddToSpellList(Helpers.druidSpellList, 2);
            flame_blade.AddSpellAndScroll("fbdd06f0414c3ef458eb4b2a8072e502"); //bless weapon
        }