示例#1
0
        static void createSymphonyOfElysianHeart()
        {
            var buff = library.CopyAndAdd <BlueprintBuff>("1533e782fca42b84ea370fc1dcbf4fc1", "SymphonyOfElysianHeartEffectBuff", ""); //freedom of movement

            var toggle = Common.createToggleAreaEffect(buff, 30.Feet(), Helpers.CreateConditionsCheckerAnd(Helpers.Create <ContextConditionIsAlly>()),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("79665f3d500fdf44083feccf4cbfc00a"), //inspire competence area
                                                       Common.createPrefabLink("9353083f430e5a44a8e9d6e26faec248")
                                                       );

            toggle.Group = ActivatableAbilityGroup.BardicPerformance;
            toggle.SetNameDescription("Symphony of the Elysian Heart",
                                      "Effect: The complex arpeggios in this piece follow each other so quickly that the music can sound jumbled and disjointed at first. As the piece progresses, however, distinct phrases emerge, creating a wild but harmonious piece that inspires feelings of unfettered freedom. You and your allies within 30 feet who can hear you can move and attack normally for the duration of your performance, even if under the influence of magic that usually impedes movement. This effect is identical to that of freedom of movement, except that this masterpiece does not allow subjects to move and attack normally while underwater unless these creatures would already be able to do so, and only lasts as long as you continue the performance.\n"
                                      + "Use: 1 bardic performance round per round."
                                      );

            toggle.AddComponent(performance_resource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            symphony_of_elysian_heart        = Common.ActivatableAbilityToFeature(toggle, false);
            symphony_of_elysian_heart.Groups = new FeatureGroup[] { FeatureGroup.Feat };
            symphony_of_elysian_heart.AddComponents(Helpers.PrerequisiteClassLevel(bard_class, 7, any: true),
                                                    Helpers.PrerequisiteClassLevel(Skald.skald_class, 7, any: true));

            symphony_of_elysian_heart_buff = buff;
        }
 internal FlySpellInfo(BlueprintAbility fly, BlueprintAbility overlandFlight, BlueprintBuff flyBuff, BlueprintBuff overlandBuff)
 {
     this.Fly                = fly;
     this.OverlandFlight     = overlandFlight;
     this.FlyBuff            = flyBuff;
     this.OverlandFlightBuff = overlandBuff;
 }
        public BlueprintBuff[] createPhysicalEnhancement()
        {
            var property = ImplementMechanics.InvestedImplementFocusAmountProperty.createProperty(prefix + "PhysicalEnhancementProperty", "",
                                                                                                  createClassScalingConfig(ContextRankProgression.StartPlusDivStep, type: AbilityRankType.StatBonus, startLevel: -4, stepLevel: 2),//1 + (lvl + 4)/2 = 3 + lvl/2
                                                                                                  false,
                                                                                                  SpellSchool.Transmutation);

            var stats = new StatType[] { StatType.Constitution, StatType.Dexterity, StatType.Strength };
            var icons = new UnityEngine.Sprite[] { Helpers.GetIcon("99cf556b967c2074ca284e127d815711"), Helpers.GetIcon("3553bda4d6dfe6344ad89b25f7be939a"), Helpers.GetIcon("c7773d1b408fea24dbbb0f7bf3eb864e") };
            var buffs = new BlueprintBuff[3];

            for (int i = 0; i < 3; i++)
            {
                buffs[i] = Helpers.CreateBuff(prefix + stats[i].ToString() + "PhysicalEnhancementBuff",
                                              "Physical Enhancement: " + stats[i].ToString(),
                                              "The implement enhances its bearer’s body. When you invest mental focus in the implement, select a physical ability score. The implement grants a +2 temporary enhancement bonus to that physical ability score for every 3 points of mental focus invested in the implement (to a maximum of +2 at 1st level, plus an additional 2 for every 6 occultist levels you possess).",
                                              "",
                                              icons[i],
                                              null,
                                              Helpers.CreateAddContextStatBonus(stats[i], ModifierDescriptor.Enhancement, multiplier: 2),
                                              Helpers.CreateContextRankConfig(ContextRankBaseValueType.CustomProperty, ContextRankProgression.DivStep, stepLevel: 3,
                                                                              customProperty: property)
                                              );
            }
            return(buffs);
        }
示例#4
0
        public BlueprintFeature createSpiritBoost(string name_prefix, string display_name, string description)
        {
            if (spirirt_boost_hp_buff == null)
            {
                spirirt_boost_hp_buff = library.CopyAndAdd <BlueprintBuff>("4814db563c105e64d948161162715661", "LifeMysterySpiritBoostTemporaryHpBuff", "");
                spirirt_boost_hp_buff.SetNameDescriptionIcon("", "", Helpers.GetIcon("7792da00c85b9e042a0fdfc2b66ec9a8")); //break enchantment
                spirirt_boost_hp_buff.RemoveComponents <ContextCalculateSharedValue>();
                //spirirt_boost_hp_buff.ReplaceComponent<TemporaryHitPointsFromAbilityValue>(t => t.Value = Helpers.CreateContextValue((AbilitySharedValue)100));

                /*spirirt_boost_hp_buff.ComponentsArray = new BlueprintComponent[]
                 * {
                 *  Helpers.Create<HealingMechanics.TemporaryHpBonusInternal>(h => h.RemoveWhenHitPointsEnd = true)
                 * }*/;
            }

            return(Helpers.CreateFeature(name_prefix + "Feature",
                                         display_name,
                                         description,
                                         "",
                                         Helpers.GetIcon("7792da00c85b9e042a0fdfc2b66ec9a8"), // break enchantment
                                         FeatureGroup.None,
                                         Helpers.Create <HealingMechanics.HealingWithOverflowToTemporaryHp>(h =>
                                                                                                            { h.temporary_hp_buff = spirirt_boost_hp_buff;
                                                                                                              h.duration = Helpers.CreateContextValue(AbilityRankType.Default);
                                                                                                              h.max_hp = Helpers.CreateContextValue(AbilityRankType.Default);
                                                                                                              h.shared_value_type = AbilitySharedValue.Heal; }
                                                                                                            ),
                                         Helpers.CreateContextRankConfig(baseValueType: ContextRankBaseValueType.ClassLevel, classes: classes)
                                         ));
        }
示例#5
0
        static void createPoisonBuffAndPoisonImprovements()
        {
            var per_round_damage = Helpers.CreateActionDealDirectDamage(Helpers.CreateContextDiceValue(DiceType.Zero, 0, Helpers.CreateContextValue(AbilityRankType.Default)), false, false, true);

            //poison buffs for every poison condition (and empty one)
            poison_buff = Helpers.CreateBuff("ToxicantPoisonBuff",
                                             "Toxicant Poison",
                                             "At 1st level, a toxicant has learned to mimic creatures with the ability to secrete harmful toxins through the skin. Once per day, in a process that takes 10 minutes, the toxicant can create and imbibe a tincture that causes her skin to secrete a mild toxin. The toxicant is immune to this secretion, but any creature that hits her with a natural attack or unarmed strike must succeed at a Fortitude save (DC = 10 + 1/2 the toxicant’s alchemist level + the toxicant’s Intelligence modifier). On a failed save, the target takes an amount of damage equal to the toxicant’s Intelligence modifier. At 4th level, a target that fails its save must succeed at a second save 1 round later or take the same amount of damage again. This effect repeats as long as the target continues to fail its saving throws, to a maximum number of rounds equal to 1 + 1 for every 4 alchemist levels the toxicant possesses (to a maximum of 6 rounds at 20th level).",
                                             "",
                                             Helpers.GetIcon("d797007a142a6c0409a74b064065a15e"),
                                             Common.createPrefabLink("fbf39991ad3f5ef4cb81868bb9419bff"),
                                             Helpers.CreateAddFactContextActions(activated: per_round_damage,
                                                                                 newRound: Helpers.CreateActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateConditionalSaved(Helpers.Create <ContextActionRemoveSelf>(), per_round_damage))
                                                                                 ),
                                             Helpers.CreateSpellDescriptor(SpellDescriptor.Poison),
                                             Helpers.CreateContextRankConfig(ContextRankBaseValueType.StatBonus, stat: StatType.Intelligence)
                                             );
            //3
            var bleed1d6 = library.Get <BlueprintBuff>("75039846c3d85d940aa96c249b97e562");
            var dazzled  = library.Get <BlueprintBuff>("df6d1025da07524429afbae248845ecc");
            var fatigued = library.Get <BlueprintBuff>("e6f2fc5d73d88064583cb828801212f4");
            var sickened = library.Get <BlueprintBuff>("4e42460798665fd4cb9173ffa7ada323");
            //6
            var shaken    = library.Get <BlueprintBuff>("25ec6cb6ab1845c48a95f9c20b034220");
            var staggered = library.Get <BlueprintBuff>("df3950af5a783bd4d91ab73eb8fa0fd3");
            //9
            var blinded = library.Get <BlueprintBuff>("0ec36e7596a4928489d2049e1e1c76a7");   //requires dazzled
            var dazed   = Common.dazed_non_mind_affecting;                                   //requires staggered
            //12
            var exhausted = library.Get <BlueprintBuff>("46d1b9cc3d0fd36469a471b047d773a2"); //requries fatigued
            //18
            var stunned = library.Get <BlueprintBuff>("09d39b38bb7c6014394b6daced9bacd3");   //requries exhausted, staggerred

            var extra_effects = new (BlueprintBuff, int, BlueprintBuff[])[]
示例#6
0
        public static SpecificBuffImmunity CreateSpecificBuffImmunity(BlueprintBuff buff)
        {
            var result = ScriptableObject.CreateInstance <SpecificBuffImmunity>();

            result.Buff = buff;
            return(result);
        }
示例#7
0
 public static String CollationName(this BlueprintBuff bp)
 {
     if (bp.IsClassFeature)
     {
         return("Class Feature");
     }
     if (bp.IsFromSpell)
     {
         return("From Spell");
     }
     if (bp.Harmful)
     {
         return("Harmful");
     }
     if (bp.RemoveOnRest)
     {
         return("Rest Removes");
     }
     if (bp.RemoveOnResurrect)
     {
         return("Res Removes");
     }
     if (bp.Ranks > 0)
     {
         return($"{bp.Ranks} Ranks");
     }
     return(bp.GetType().ToString());
 }
示例#8
0
 public static ContextActionApplyBuff CreateActionApplyBuff(BlueprintBuff buff, int duration = 0, DurationRate rate = DurationRate.Rounds, bool dispellable = false, bool permanent = false)
 {
     return(Helpers.CreateApplyBuff(buff, Helpers.CreateContextDuration(bonus: new ContextValue()
     {
         Value = duration
     }, rate: rate), fromSpell: false, dispellable: dispellable, permanent: permanent));
 }
示例#9
0
        public BlueprintFeature createBleedingWounds(string name_prefix, string display_name, string description)
        {
            var bleed1d4 = library.Get <BlueprintBuff>("5eb68bfe186d71a438d4f85579ce40c1");
            var bleed1d6 = library.Get <BlueprintBuff>("75039846c3d85d940aa96c249b97e562");
            var bleed2d6 = library.Get <BlueprintBuff>("16249b8075ab8684ca105a78a047a5ef");
            var icon     = bleed1d4.Icon;
            var buffs    = new BlueprintBuff[] { bleed1d4, bleed1d6, bleed2d6 };

            var features = new BlueprintFeature[buffs.Length];

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

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

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

            return(feature);
        }
示例#10
0
        static void createInspiredStrike()
        {
            var arcane_weapon_speed = library.Get <BlueprintBuff>("f9e6281bffd7030499e2ab469e15f1a7");
            var arcane_weapon_keen  = library.Get <BlueprintBuff>("49083bf0cdd00ec4dacbffb4be26e69a");

            inspired_strike_attack_buff = CreateBuff("InspiredStrikeAttackBonusSwashbucklerBuff",
                                                     "Inspired Strike (Attack Bonus)",
                                                     "At 11th level, an inspired blade can spend 1 panache point when making an attack with a rapier to gain an insight bonus on that attack roll equal to her Intelligence modifier (minimum +1).",
                                                     "6c5fd556bc4f4392ace2156c97537fc7",
                                                     arcane_weapon_speed.Icon,
                                                     null, //TODO fx
                                                     Create <InspiredStrikeLogic>()
                                                     );

            var apply_buff = Common.createContextActionApplyBuff(inspired_strike_attack_buff, CreateContextDuration(1), dispellable: false);

            var inspired_strike_attack_ability = CreateAbility("InspiredStrikeAttackBonusSwashbucklerAbility",
                                                               inspired_strike_attack_buff.Name,
                                                               inspired_strike_attack_buff.Description,
                                                               "5ff08b489cc641bf8463029c2ec7d58b",
                                                               inspired_strike_attack_buff.Icon,
                                                               AbilityType.Extraordinary,
                                                               CommandType.Free,
                                                               AbilityRange.Personal,
                                                               "",
                                                               "",
                                                               CreateRunActions(new GameAction[] { apply_buff }),
                                                               Create <AbilityResourceLogic>(a => { a.IsSpendResource = true; a.Amount = 1; a.CostIsCustom = false; a.RequiredResource = Swashbuckler.panache_resource; })
                                                               );

            inspired_strike_critical_buff = CreateBuff("InspiredStrikeCriticalBonusSwashbucklerBuff",
                                                       "Inspired Strike (Critical Bonus)",
                                                       "When an inspired blade hits with an attack augmented by inspired strike, she can spend 1 additional panache point to make the hit a critical threat, though if she does so, she does not regain panache if she confirms that critical threat.",
                                                       "8d45cc0c4fde464db38389b35e6d59e6",
                                                       arcane_weapon_keen.Icon,
                                                       null //TODO fx
                                                       );

            var inspired_strike_crit_ability = CreateActivatableAbility("InspiredStrikeCriticalBonusSwashbucklerAbility",
                                                                        inspired_strike_critical_buff.Name,
                                                                        inspired_strike_critical_buff.Description,
                                                                        "86e1b4dcd2d948d98154795e594a8c30",
                                                                        inspired_strike_critical_buff.Icon,
                                                                        inspired_strike_critical_buff,
                                                                        AbilityActivationType.Immediately,
                                                                        CommandType.Free,
                                                                        null,
                                                                        Helpers.CreateActivatableResourceLogic(Swashbuckler.panache_resource, ActivatableAbilityResourceLogic.ResourceSpendType.Never),
                                                                        Common.createActivatableAbilityRestrictionHasFact(inspired_strike_attack_buff)
                                                                        );

            inspired_strike_deed = CreateFeature("InspiredStrikeSwashbucklerFeature",
                                                 "Inspired Strike",
                                                 "At 11th level, an inspired blade can spend 1 panache point when making an attack with a rapier to gain an insight bonus on that attack roll equal to her Intelligence modifier (minimum +1). When an inspired blade hits with an attack augmented by inspired strike, she can spend 1 additional panache point to make the hit a critical threat, though if she does so, she does not regain panache if she confirms that critical threat. The cost of this deed cannot be reduced by abilities such as Signature Deed.",
                                                 "bd648a4dc1f64001af8b658e194057e2",
                                                 arcane_weapon_speed.Icon,
                                                 FeatureGroup.None,
                                                 CreateAddFacts(new BlueprintUnitFact[] { inspired_strike_attack_ability, inspired_strike_crit_ability })
                                                 );
        }
示例#11
0
        internal static BlueprintBuff CreateBuffForAbility(BlueprintBuff realBuff, String assetId,
                                                           BlueprintAbilityResource resource, DurationRate duration,
                                                           bool dispellable = true, bool removeWhenTurnedOff = false)
        {
            // Clone the real buff, but remove its functionality and UI.
            var clonedBuff = UnityEngine.Object.Instantiate(realBuff);

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

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

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

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

            clonedBuff.SetComponents(logic);
            return(clonedBuff);
        }
        static internal void createGreaterCelestialTotem()
        {
            greater_celestial_totem_buff = Helpers.CreateBuff("GreaterCelestialTotemBuff",
                                                              "",
                                                              "",
                                                              "",
                                                              null,
                                                              null,
                                                              Common.createSavingThrowBonusAgainstAlignment(2, ModifierDescriptor.UntypedStackable, AlignmentComponent.Evil),
                                                              Common.createSpellResistanceAgainstSpellDescriptor(Helpers.CreateContextValue(AbilityRankType.StatBonus), SpellDescriptor.Evil),
                                                              Helpers.CreateContextRankConfig(baseValueType: Kingmaker.UnitLogic.Mechanics.Components.ContextRankBaseValueType.ClassLevel,
                                                                                              progression: Kingmaker.UnitLogic.Mechanics.Components.ContextRankProgression.BonusValue,
                                                                                              type: AbilityRankType.StatBonus,
                                                                                              stepLevel: 11,
                                                                                              classes: new BlueprintCharacterClass[] { barbarian_class }
                                                                                              )
                                                              );
            greater_celestial_totem_buff.SetBuffFlags(BuffFlags.HiddenInUi);

            greater_celestial_totem = Helpers.CreateFeature("GreaterCelestialTotemFeature",
                                                            "Celestial Totem, Greater",
                                                            "While raging, the barbarian gains spell resistance equal to 11 + the barbarian’s class level against spells with the evil descriptor. She also gains a +2 bonus on all saving throws against spells and effects from evil creatures.",
                                                            "",
                                                            lesser_celestial_totem.Icon,
                                                            FeatureGroup.RagePower,
                                                            Helpers.PrerequisiteClassLevel(barbarian_class, 12),
                                                            Helpers.PrerequisiteFeature(celestial_totem)
                                                            );
            Common.addContextActionApplyBuffOnFactsToActivatedAbilityBuffNoRemove(rage_buff, greater_celestial_totem_buff, greater_celestial_totem);
            addToSelection(greater_celestial_totem);
        }
        static internal void createLesserDaemonTotem()
        {
            lesser_daemon_totem = Helpers.CreateFeature("LesserDaemonTotemFeature",
                                                        "Daemon Totem, Lesser",
                                                        "While raging, the barbarian gains a +2 bonus on saving throws against acid damage, death effects, disease, and poison. This bonus increases by 1 for each daemon totem rage power the barbarian has, excluding this one.",
                                                        "",
                                                        library.Get <BlueprintProgression>("e76a774cacfb092498177e6ca706064d").Icon,   //infernal
                                                        FeatureGroup.RagePower);
            lesser_daemon_totem_buff = Helpers.CreateBuff("LesserDaemonTotemBuff",
                                                          "",
                                                          "",
                                                          "",
                                                          null,
                                                          null,
                                                          Common.createContextSavingThrowBonusAgainstDescriptor(Helpers.CreateContextValue(AbilityRankType.StatBonus),
                                                                                                                ModifierDescriptor.UntypedStackable,
                                                                                                                SpellDescriptor.Acid),
                                                          Common.createContextSavingThrowBonusAgainstDescriptor(Helpers.CreateContextValue(AbilityRankType.StatBonus),
                                                                                                                ModifierDescriptor.UntypedStackable,
                                                                                                                SpellDescriptor.Disease),
                                                          Common.createContextSavingThrowBonusAgainstDescriptor(Helpers.CreateContextValue(AbilityRankType.StatBonus),
                                                                                                                ModifierDescriptor.UntypedStackable,
                                                                                                                SpellDescriptor.Poison),
                                                          Common.createContextSavingThrowBonusAgainstDescriptor(Helpers.CreateContextValue(AbilityRankType.StatBonus),
                                                                                                                ModifierDescriptor.UntypedStackable,
                                                                                                                SpellDescriptor.Death)
                                                          );
            lesser_daemon_totem_buff.SetBuffFlags(BuffFlags.HiddenInUi);

            Common.addContextActionApplyBuffOnFactsToActivatedAbilityBuffNoRemove(rage_buff, lesser_daemon_totem_buff, lesser_daemon_totem);
            addToSelection(lesser_daemon_totem, is_totem: true);
        }
            private static void AddQuiver(BlueprintActivatableAbility ability, BlueprintBuff buff, string guid, PhysicalDamageMaterial material)
            {
                var component = ScriptableObject.CreateInstance <AddOutgoingPhysicalDamageProperty>();

                component.AddMaterial = true;
                component.Material    = material;

                var quiverBuff = Object.Instantiate(buff);

                quiverBuff.ComponentsArray = new BlueprintComponent[] { component };
                Main.Accessors.SetBlueprintUnitFactDisplayName(quiverBuff, new L10NString($"craftMagicItems-mundane-{material.ToString().ToLower()}-quiver-name"));
                Main.Accessors.SetBlueprintUnitFactDescription(quiverBuff, new L10NString($"craftMagicItems-mundane-{material.ToString().ToLower()}-quiver-description"));

                var quiverAbility = Object.Instantiate(ability);

                quiverAbility.Buff = quiverBuff;
                Main.Accessors.SetBlueprintUnitFactDisplayName(quiverAbility, new L10NString($"craftMagicItems-mundane-{material.ToString().ToLower()}-quiver-name"));
                Main.Accessors.SetBlueprintUnitFactDescription(quiverAbility, new L10NString($"craftMagicItems-mundane-{material.ToString().ToLower()}-quiver-description"));

                var newGuid = $"{guid}#CraftMagicItems({material.ToString()}QuiverAbility)";

                Main.Accessors.SetBlueprintScriptableObjectAssetGuid(quiverAbility, newGuid);
                ResourcesLibrary.LibraryObject.BlueprintsByAssetId?.Add(newGuid, quiverAbility);
                ResourcesLibrary.LibraryObject.GetAllBlueprints().Add(quiverAbility);
            }
示例#15
0
        static void createBeastformMutagen()
        {
            var pounce_buff = Helpers.CreateBuff("BeasmorphPounceBuff",
                                                 "Pounce",
                                                 "At 10th level, when under effect of his mutagen, the beastmorph gains pounce ability.",
                                                 "",
                                                 Helpers.GetIcon("c78506dd0e14f7c45a599990e4e65038"),
                                                 null,
                                                 Helpers.CreateAddMechanics(AddMechanicsFeature.MechanicsFeatureType.Pounce)
                                                 );

            var blindsense_buff = Helpers.CreateBuff("BeasmorphBlindsenseBuff",
                                                     "Blindsense",
                                                     "At 14th level, when under effect of his mutagen, the beastmorph gains blindsense ability within 30 feet.",
                                                     "",
                                                     Helpers.GetIcon("b3da3fbee6a751d4197e446c7e852bcb"), //true seeing
                                                     null,
                                                     Common.createBlindsense(30)
                                                     );

            var buffs = new BlueprintBuff[] { pounce_buff, blindsense_buff };
            List <BlueprintFeature> features = new List <BlueprintFeature>();

            var mutagens = new BlueprintFeature[]
            {
                library.Get <BlueprintFeature>("cee8f65448ce71c4b8b8ca13751dd8ea"), //mutagen
                library.Get <BlueprintFeature>("76c61966afdd82048911f3d63c6fe0bc"), //greater mutagen
                library.Get <BlueprintFeature>("6f5cb651e26bd97428523061b07ffc85"), //grand mutagen

                library.Get <BlueprintFeature>("e3f460ea61fcc504183c7d6818bbbf7a"), //cognatogen
                library.Get <BlueprintFeature>("18eb29676492e844eb5a55d1c855ce69"), //greater cognatogen
                library.Get <BlueprintFeature>("af4a320648eb5724889d6ff6255090b2"), //grand cognatogen
            };

            foreach (var b in buffs)
            {
                var feature = Helpers.CreateFeature(b.name + "Feature",
                                                    b.Name,
                                                    b.Description,
                                                    "",
                                                    b.Icon,
                                                    FeatureGroup.None
                                                    );
                foreach (var m in mutagens)
                {
                    var comp = m.GetComponent <AddFacts>();

                    foreach (var f in comp.Facts)
                    {
                        var mutagen_buff = Common.extractActions <ContextActionApplyBuff>((f as BlueprintAbility).GetComponent <AbilityEffectRunAction>().Actions.Actions)[0].Buff;
                        Common.addContextActionApplyBuffOnCasterFactsToActivatedAbilityBuffNoRemove(mutagen_buff, b, feature);
                    }
                }
                features.Add(feature);
            }

            pounce     = features[0];
            blindsense = features[1];
        }
示例#16
0
        public static ContextActionRemoveBuff CreateActionRemoveBuff(BlueprintBuff buff, bool toCaster = false)
        {
            var result = ScriptableObject.CreateInstance <ContextActionRemoveBuff>();

            result.Buff     = buff;
            result.ToCaster = toCaster;
            return(result);
        }
 public static void SetBuffDuration(this UnitEntityData unit, BlueprintBuff blueprint, float duration)
 {
     if (unit.Descriptor.GetFact(blueprint) is Buff buff)
     {
         buff.EndTime = Game.Instance.TimeController.GameTime + TimeSpan.FromSeconds(duration);
         unit.Descriptor.Buffs.UpdateNextEvent();
     }
 }
 public static void AddBuffDuration(this UnitEntityData unit, BlueprintBuff blueprint, float duration)
 {
     if (unit.Descriptor.GetFact(blueprint) is Buff buff)
     {
         buff.EndTime += TimeSpan.FromSeconds(duration);
         unit.Descriptor.Buffs.UpdateNextEvent();
     }
 }
示例#19
0
        public static BuffSubstitutionOnApply CreateBuffSubstitutionOnApply(BlueprintBuff GainedFact, BlueprintBuff SubstituteBuff)
        {
            var result = ScriptableObject.CreateInstance <BuffSubstitutionOnApply>();

            result.GainedFact     = GainedFact;
            result.SubstituteBuff = SubstituteBuff;
            return(result);
        }
示例#20
0
        public static WishSpellOppositionSchoolCheck Create(BlueprintBuff wish, BlueprintFeature opposition)
        {
            var w = Helpers.Create <WishSpellOppositionSchoolCheck>();

            w.OppositionSchool = opposition;
            w.WishBuff         = wish;
            return(w);
        }
示例#21
0
        public static MysteryLifeSpiritBoostLogic Create(BlueprintBuff buff, AbilitySharedValue variable = AbilitySharedValue.Heal)
        {
            var m = Helpers.Create <MysteryLifeSpiritBoostLogic>();

            m.HitPointBuff          = buff;
            m.HitPointValueToUpdate = variable;
            return(m);
        }
        static public void undeadImmunitiesChange()
        {
            BlueprintFeature undeadImmunities = library.Get <BlueprintFeature>("8a75eb16bfff86949a4ddcb3dd2f83ae");

            //Undead have 3 condition immunities, 1 for nauseated, 1 for fatigued and 1 for sickened

            //They also 2 base buff descriptor immunities, which in turn each grant many immunities
            //Buff descriptor immunity: Poison, Disease, Sickened, Shaken, Fatigue, Frightened, Exhausted, Confusion, Death, Bleed, VilderavnBleed
            //Buff descriptor immunity: MindAffecting, Fear, Compulsion, Emotion, Charm, Daze, Shaken, Frightened, Confusion, Sleep

            //Stun and sleep are added here because, by PnP rules, Undead are immune to these traits in addition to being immune to mind-affecting things
            //SpellDescriptor sd1 = (SpellDescriptor)((long)SpellDescriptor.Poison + (long)SpellDescriptor.Disease + (long)SpellDescriptor.Fatigue + (long)SpellDescriptor.Exhausted + (long)SpellDescriptor.Death + (long)SpellDescriptor.Bleed + (long)SpellDescriptor.VilderavnBleed) + (long)SpellDescriptor.Stun + (long)SpellDescriptor.Sleep;
            SpellDescriptor sd1 = (SpellDescriptor)((long)SpellDescriptor.Poison + (long)SpellDescriptor.Disease + (long)SpellDescriptor.Sickened + (long)SpellDescriptor.Fatigue + (long)SpellDescriptor.Exhausted + (long)SpellDescriptor.Death + (long)SpellDescriptor.Bleed + (long)SpellDescriptor.VilderavnBleed + (long)SpellDescriptor.Stun + (long)SpellDescriptor.Sleep);
            //The list to bypass now includes only mindaffecting elements. As the PnP rules do not specificy that Daze
            //is mind-affecting that has been removed from their immunities entirely
            //its possible that this should be the mindaffecting trait alone or all of the mind affecting things
            //SpellDescriptor sd2 = (SpellDescriptor)((long)SpellDescriptor.MindAffecting + (long)SpellDescriptor.Fear + (long)SpellDescriptor.Compulsion + (long)SpellDescriptor.Emotion + (long)SpellDescriptor.Charm + (long)SpellDescriptor.Shaken + (long)SpellDescriptor.Frightened + (long)SpellDescriptor.Confusion);
            SpellDescriptor sd2 = (SpellDescriptor)((long)SpellDescriptor.MindAffecting);

            foreach (BuffDescriptorImmunity bdi in undeadImmunities.GetComponents <BuffDescriptorImmunity>())
            {
                if ((long)bdi.Descriptor.Value == 6597687263488) //This is the first buff descriptor's value which includes redundant buffs
                {
                    bdi.Descriptor = sd1;
                }
                if ((long)bdi.Descriptor.Value == 4366631152)
                {
                    bdi.Descriptor = sd2;
                }
                //Main.logger.Log("Buff descriptor immunity list: " + bdi.Descriptor.Value.ToString());
            }

            //undead also have a derivative stat bonus immunity which they should retain
            //undead have immunitities to spells in a manner similar to buffs. They are immune to Any spell with a descriptor that matches their condition immunities
            //The value is different here because the base game immunities do not include the VildravenBleed from the conditions immunities list
            //This block function similarly to the one above just for spell immunity instead of just condition immunity
            foreach (SpellImmunityToSpellDescriptor sitsd in undeadImmunities.GetComponents <SpellImmunityToSpellDescriptor>())
            {
                if ((long)sitsd.Descriptor.Value == 2199640752384) //the initial value similar to above minus the value of the vildravn bleed. yes it is a 13 digit number thank you very much
                {
                    sitsd.Descriptor = sd1;
                }
                if ((long)sitsd.Descriptor.Value == 4366631152)
                {
                    sitsd.Descriptor = sd2;
                }
                //Main.logger.Log("Spell descriptor immunity list: " + sitsd.Descriptor.Value.ToString());
            }

            //because undead should be immune to all fortitude negates effects, they should have immunity to the baleful polymorph buff
            BlueprintBuff        balefulPolymorphBuff = library.Get <BlueprintBuff>("0a52d8761bfd125429842103aed48b90");
            SpecificBuffImmunity sbi = new SpecificBuffImmunity
            {
                Buff = balefulPolymorphBuff
            };

            undeadImmunities.ComponentsArray = undeadImmunities.ComponentsArray.AddToArray(sbi);
        }
示例#23
0
        static void createTerrorOfTheGreatWyrm()
        {
            var dazzling_display      = library.Get <BlueprintAbility>("5f3126d4120b2b244a95cb2ec23d69fb");
            var shaken                = library.Get <BlueprintBuff>("25ec6cb6ab1845c48a95f9c20b034220");
            var frightened            = library.Get <BlueprintBuff>("f08a7239aa961f34c8301518e71d4cdf");
            var demoralize            = (dazzling_display.GetComponent <AbilityEffectRunAction>().Actions.Actions[0] as Demoralize);
            var great_wyrm_demoralize = Helpers.Create <TerrorOfTheGreatWyrmDemoralize>(a => { a.Buff = shaken; a.GreaterBuff = frightened; });
            var fear = library.Get <BlueprintAbility>("d2aeac47450c76347aebbc02e4f463e0");

            var great_wyrm_demoralize_action = Helpers.CreateAbility("TerrorOfTheGreatWyrmDemoralizeSwashbucklerAbility",
                                                                     "",
                                                                     "",
                                                                     "161e71362f964d758742750374e71232",
                                                                     null,
                                                                     AbilityType.Extraordinary,
                                                                     CommandType.Free,
                                                                     AbilityRange.Personal,
                                                                     "",
                                                                     "",
                                                                     Helpers.CreateRunActions(great_wyrm_demoralize),
                                                                     dazzling_display.GetComponent <AbilityTargetsAround>(),
                                                                     dazzling_display.GetComponent <AbilitySpawnFx>(),
                                                                     Helpers.Create <CallOfTheWild.NewMechanics.AbilityTargetIsCaster>()
                                                                     );


            terror_of_the_great_wyrm_buff = CreateBuff("TerrorOfTheGreatWyrmSwashbucklerBuff",
                                                       "Terror of the Great Wyrm",
                                                       "At 15th level, the Rostland bravo can use her inevitable victory deed as part of a full attack or dragon’s rage. If a creature demoralized in this way would be shaken for 3 or more rounds, the Rostland bravo can make the target frightened for 1 round before becoming shaken for the appropriate duration.",
                                                       "f9906d4f50c2479d9a489c6771cc334f",
                                                       fear.Icon,
                                                       null,
                                                       Create <AddInitiatorAttackWithWeaponTrigger>(a => { a.Category = WeaponCategory.DuelingSword; a.OnlyOnFirstAttack = true; a.OnlyOnFullAttack = true; a.Action = CreateActionList(Create <ContextActionCastSpell>(c => c.Spell = great_wyrm_demoralize_action), Create <SpendPanache>(s => { s.resource = Swashbuckler.panache_resource; s.amount = 1; })); })
                                                       );

            var terror_of_the_great_wyrm_ability = CreateActivatableAbility("TerrorOfTheGreatWyrmSwashbucklerActivatableAbility",
                                                                            terror_of_the_great_wyrm_buff.Name,
                                                                            terror_of_the_great_wyrm_buff.Description,
                                                                            "9f0494e84a3a490ca2d2cc412ac88240",
                                                                            terror_of_the_great_wyrm_buff.Icon,
                                                                            terror_of_the_great_wyrm_buff,
                                                                            AbilityActivationType.Immediately,
                                                                            CommandType.Free,
                                                                            null,
                                                                            CallOfTheWild.Helpers.CreateActivatableResourceLogic(Swashbuckler.panache_resource, ActivatableAbilityResourceLogic.ResourceSpendType.Never)
                                                                            );


            terror_of_the_great_wyrm_deed = CreateFeature("TerrorOfTheGreatWyrmSwashbucklerFeature",
                                                          terror_of_the_great_wyrm_buff.Name,
                                                          terror_of_the_great_wyrm_buff.Description,
                                                          "bb9f3383f6ee40919d1cc434f3c387b8",
                                                          terror_of_the_great_wyrm_buff.Icon,
                                                          FeatureGroup.None,
                                                          Helpers.CreateAddFact(terror_of_the_great_wyrm_ability)
                                                          );
        }
示例#24
0
        static void processRage()
        {
            BlueprintBuff[] rage_buffs = new BlueprintBuff[] { Bloodrager.bloodrage_buff, //same as barabrian rage
                                                               Skald.inspired_rage_effect_buff,
                                                               Skald.controlled_rage_str_buff,
                                                               Skald.controlled_rage_dex_buff,
                                                               Skald.controlled_rage_con_buff,
                                                               Skald.insightful_contemplation_buff,
                                                               NewRagePowers.greater_ferocious_beast_buff };
            //rage_buffs = rage_buffs.AddToArray(Bloodrager.urban_bloodrage_buffs); //same AddFactContextActions as in normal rage only bonuses are different
            //to ensure coexistance of different rages we need to do the following:
            //on every condition on activated add check that target has no buff to avoid replacing existing buffs,
            //then we need to add all activated conditional actions to new round (to reapply buffs if they dissapear)
            //then in deactivated on remove buff will need to be replaced with remove buff from caster (to avoid removing buffs that are not ours?)


            foreach (var buff in rage_buffs)
            {
                var context_actions   = buff.GetComponent <AddFactContextActions>();
                var activated_actions = context_actions.Activated.Actions;
                var new_round_actions = context_actions.NewRound;
                List <GameAction> actions_for_new_round = new List <GameAction>();

                foreach (var action in activated_actions)
                {
                    if (!(action is Conditional))
                    {
                        continue;
                    }

                    var conditional_action = (Conditional)action;
                    if (conditional_action.IfTrue.Actions.Length != 1 || !(conditional_action.IfTrue.Actions[0] is ContextActionApplyBuff))
                    {
                        continue;
                    }

                    var applied_buff = ((ContextActionApplyBuff)conditional_action.IfTrue.Actions[0]).Buff;
                    conditional_action.ConditionsChecker.Conditions = conditional_action.ConditionsChecker.Conditions.AddToArray(Common.createContextConditionHasFact(applied_buff, false));
                    conditional_action.ConditionsChecker.Operation  = Operation.And;
                    actions_for_new_round.Add(action);
                }
                new_round_actions.Actions = actions_for_new_round.ToArray().AddToArray(new_round_actions.Actions);

                var deactivated_actions = context_actions.Deactivated;

                for (int i = 0; i < deactivated_actions.Actions.Length; i++)
                {
                    if (!(deactivated_actions.Actions[i] is ContextActionRemoveBuff))
                    {
                        continue;
                    }
                    var buff_to_remove = ((ContextActionRemoveBuff)deactivated_actions.Actions[i]).Buff;
                    deactivated_actions.Actions[i] = Common.createContextActionRemoveBuffFromCaster(buff_to_remove);
                }
            }
            addRageRejection();
        }
示例#25
0
        static internal void UpdateDominationEffects()
        {
            BlueprintBuff dominate_person = library.Get <BlueprintBuff>("c0f4e1c24c9cd334ca988ed1bd9d201f");

            AddControllableToChangeFaction(dominate_person.GetComponent <ChangeFaction>());
            BlueprintBuff control_undead = library.Get <BlueprintBuff>("21d20a30b93e4ae281a6d70d9ae1a64d");

            AddControllableToChangeFaction(control_undead.GetComponent <ChangeFaction>());
        }
示例#26
0
        static internal BlueprintAbility CreateAddDCAbl()
        {
            AddCLDCOnNextSpell_AR component = Helpers.Create <AddCLDCOnNextSpell_AR>();

            component.valueCL     = 0;
            component.valueDC     = 1;
            component.PotentMagic = PotentMagic.exploit;
            Sprite        icon = Helpers.GetIcon("f001c73999fb5a543a199f890108d936");   //vanish
            BlueprintBuff buff = Helpers.CreateBuff("ArcanistClassReservoirAddDCBuff", "", "",
                                                    "85143f03db31082e776c095f3518a505", //MD5-32[ArcanistClass.Reservoir.AddDCBuff]
                                                    icon,
                                                    null,
                                                    component);

            buff.SetName(Helpers.CreateString("ArcanistClass.Reservoir.AddDCBuff.Name"));
            buff.SetDescription(Helpers.CreateString("ArcanistClass.Reservoir.AddDCBuff.Desc"));

            var ablResourceLogicComp = Helpers.Create <AbilityResourceLogic>();

            ablResourceLogicComp.RequiredResource = resource;
            ablResourceLogicComp.IsSpendResource  = true;
            ablResourceLogicComp.CostIsCustom     = false;
            ablResourceLogicComp.Amount           = 1;

            var ablEffectComp       = Helpers.Create <AbilityEffectRunAction>();
            var ablEffectCompAction = Helpers.Create <ContextActionApplyBuff>();

            ablEffectCompAction.Buff            = buff;
            ablEffectCompAction.Permanent       = false;
            ablEffectCompAction.DurationValue   = PresetDurations.threeRounds;
            ablEffectCompAction.IsFromSpell     = false;
            ablEffectCompAction.IsNotDispelable = false;
            ablEffectCompAction.ToCaster        = false;
            ablEffectCompAction.AsChild         = true;
            ablEffectComp.Actions = new ActionList {
                Actions = new GameAction[] { null, ablEffectCompAction }
            };

            BlueprintAbility abl = Helpers.CreateAbility("ArcanistClassReservoirAddDCAbl", "", "",
                                                         "a572d2412acba81b25cb7ca77c129010",//MD5-32[ArcanistClass.Reservoir.AddDCAbl]
                                                         icon,
                                                         AbilityType.Supernatural,
                                                         Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Free,
                                                         AbilityRange.Personal,
                                                         "",
                                                         "",
                                                         ablResourceLogicComp,
                                                         ablEffectComp,
                                                         Helpers.Create <AbilityRequirementNoSupremancy>());

            abl.SetName(Helpers.CreateString("ArcanistClass.Reservoir.AddDCAbl.Name"));
            abl.SetDescription(Helpers.CreateString("ArcanistClass.Reservoir.AddDCAbl.Desc"));
            abl.LocalizedDuration    = Helpers.CreateString("ArcaneTide.ThreeRounds");
            abl.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.CanAbandon");
            return(abl);
        }
示例#27
0
        static void createRagingTactician()
        {
            raging_tactician    = new BlueprintFeature[3];
            raging_tactician[0] = Helpers.CreateFeature("RagingTactician1Feature",
                                                        "Raging Tactician",
                                                        "At 7th level, while a pack rager is raging, she grants a single teamwork feat she knows to all allies within 30 feet who can see and hear her. She chooses the feat at the start of the rage, and cannot change it during the rage. An ally who moves more than 30 feet away from the raging pack rager loses access to the feat, but regains it again each time he moves back within 30 feet of the raging pack rager. Allies do not need to meet the prerequisites of these teamwork feats.\n"
                                                        + "At 13th level, the pack rager chooses two teamwork feats when she enters a rage, and grants her allies the use of both of those feats when they are within 30 feet of her.\n"
                                                        + "At 16th level, the pack rager grants these teamwork feats as long as her allies are within 60 feet of her.\n"
                                                        + "At 19th level, the pack rager chooses three teamwork feats when she enters a rage, and grants her allies the use of all three feats when they are within 60 feet of her.",
                                                        "",
                                                        Helpers.GetIcon("93e78cad499b1b54c859a970cbe4f585"),
                                                        FeatureGroup.None
                                                        );

            raging_tactician_increased_range = library.CopyAndAdd(raging_tactician[0], "RagingTacticianIncreasedRangeFeature", "");

            raging_tactician_buff = Helpers.CreateBuff("RagingTacticianEffectBuff",
                                                       raging_tactician[0].Name,
                                                       raging_tactician[0].Description,
                                                       "",
                                                       raging_tactician[0].Icon,
                                                       null,
                                                       Helpers.Create <TeamworkMechanics.AddFactsFromCasterIfHasBuffs>()
                                                       );


            foreach (var tw in teamwork_feat.AllFeatures)
            {
                addToRagingTactician(tw);
            }

            var rage_buff = Common.createBuffAreaEffect(raging_tactician_buff,
                                                        30.Feet(),
                                                        Helpers.CreateConditionsCheckerAnd(Helpers.Create <ContextConditionIsAlly>(), Common.createContextConditionIsCaster(not: true))
                                                        );

            var rage_buff2 = Common.createBuffAreaEffect(raging_tactician_buff,
                                                         60.Feet(),
                                                         Helpers.CreateConditionsCheckerAnd(Helpers.Create <ContextConditionIsAlly>(), Common.createContextConditionIsCaster(not: true)),
                                                         "AreaIncreasedRange");

            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuffNoRemove(NewRagePowers.rage_buff,
                                                                                      Helpers.CreateConditional(Common.createContextConditionCasterHasFact(raging_tactician_increased_range),
                                                                                                                Common.createContextActionApplyChildBuff(rage_buff2),
                                                                                                                Helpers.CreateConditional(Common.createContextConditionHasFact(raging_tactician[0]),
                                                                                                                                          Common.createContextActionApplyChildBuff(rage_buff2)
                                                                                                                                          )
                                                                                                                )
                                                                                      );

            for (int i = 1; i <= 2; i++)
            {
                raging_tactician[i] = library.CopyAndAdd(raging_tactician[0], $"RagingTactician{i + 1}Feature", "");
                raging_tactician[i].AddComponent(Common.createIncreaseActivatableAbilityGroupSize(ActivatableAbilityGroupExtension.RagingTacticianTeamworkFeatShare.ToActivatableAbilityGroup()));
            }
        }
示例#28
0
 static BuffConsideration getSingleTargetNoBuff(BlueprintBuff buff)
 {
     if (!no_buff_consideration.ContainsKey(buff))
     {
         var c = library.CopyAndAdd <BuffConsideration>("14698bcd142fb924bbb912d57c3fe712", "KingmakerAiNo" + buff.name + "Consideration", "");
         c.Buffs = new BlueprintBuff[] { buff };
         no_buff_consideration[buff] = c;
     }
     return(no_buff_consideration[buff]);
 }
 private static void createCanOnlyTargetSelfBuff()
 {
     can_only_target_self_buff = Helpers.CreateBuff("CanOnlyTargetSelfBuff",
                                                    "Target Self",
                                                    "",
                                                    "",
                                                    null,
                                                    null);
     can_only_target_self_buff.SetBuffFlags(BuffFlags.HiddenInUi);
 }
示例#30
0
        public void removeAllBuffsByBlueprint(BlueprintBuff buff)
        {
            var found_buffs = buffs.FindAll(b => b.Blueprint == buff).OfType <Buff>().ToArray();

            buffs.RemoveAll(b => b.Blueprint == buff);
            foreach (var b in found_buffs)
            {
                b.Remove();
            }
        }