Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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 createCanOnlyTargetSelfBuff()
 {
     can_only_target_self_buff = Helpers.CreateBuff("CanOnlyTargetSelfBuff",
                                                    "Target Self",
                                                    "",
                                                    "",
                                                    null,
                                                    null);
     can_only_target_self_buff.SetBuffFlags(BuffFlags.HiddenInUi);
 }
Exemplo n.º 4
0
        static void createRageMarker()
        {
            rage_marker_caster = Helpers.CreateBuff("RageMarkerBuff",
                                                    "",
                                                    "",
                                                    "",
                                                    null,
                                                    null);
            rage_marker_caster.SetBuffFlags(BuffFlags.HiddenInUi);
            var conditional_caster = Helpers.CreateConditional(Common.createContextConditionIsCaster(),
                                                               Common.createContextActionApplyBuff(rage_marker_caster, Helpers.CreateContextDuration(),
                                                                                                   is_child: true, dispellable: false, is_permanent: true)
                                                               );

            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuff(rage_buff, conditional_caster);
        }
Exemplo n.º 5
0
        static internal void createLesserSpiritTotem()
        {
            var blur = library.Get <BlueprintAbility>("14ec7a4e52e90fa47a4c8d63c69fd5c1");

            lesser_spirit_totem_slam_attack = library.CopyAndAdd <BlueprintItemWeapon>("7445b0b255796d34495a8bca81b2e2d4", "LesserSpiritTotemSlam", "");
            Helpers.SetField(lesser_spirit_totem_slam_attack, "m_OverrideDamageDice", true);
            Helpers.SetField(lesser_spirit_totem_slam_attack, "m_DamageDice", new DiceFormula(1, DiceType.D4));
            Helpers.SetField(lesser_spirit_totem_slam_attack, "m_OverrideDamageType", true);
            Helpers.SetField(lesser_spirit_totem_slam_attack, "m_DamageType", Common.createEnergyDamageDescription(Kingmaker.Enums.Damage.DamageEnergyType.NegativeEnergy));

            var enchant = Common.createWeaponEnchantment("LesserSpiritTotemSlamEnchantment",
                                                         "Spirit",
                                                         "Spirit weapon uses wielders Charisma modifier for attack and damage bonus.",
                                                         "Spirit", "",
                                                         "",
                                                         0,
                                                         null,
                                                         Common.createWeaponAttackStatReplacementEnchantment(StatType.Charisma),
                                                         Common.createWeaponDamageStatReplacementEnchantment(StatType.Charisma)
                                                         );

            Common.addEnchantment(lesser_spirit_totem_slam_attack, enchant);

            lesser_spirit_totem_buff = Helpers.CreateBuff("LesserSpiritTotemBuff",
                                                          "",
                                                          "",
                                                          "",
                                                          null,
                                                          null,
                                                          Common.createAddSecondaryAttacks(lesser_spirit_totem_slam_attack)
                                                          );
            lesser_spirit_totem_buff.SetBuffFlags(BuffFlags.HiddenInUi);

            lesser_spirit_totem = Helpers.CreateFeature("LesserSpiritTotemFeature",
                                                        "Sprit Totem, Lesser",
                                                        "While raging, the barbarian is surrounded by spirit wisps that harass her foes. These spirits make one slam attack each round against a living foe that is adjacent to the barbarian. This slam attack is made using the barbarian’s full base attack bonus, plus the barbarian’s Charisma modifier. The slam deals 1d4 points of negative energy damage, plus the barbarian’s Charisma modifier.\n"
                                                        + "Note: Totem rage powers grant powers related to a theme.A barbarian cannot select from more than one group of totem rage powers; for example, a barbarian who selects a beast totem rage power cannot later choose to gain any of the dragon totem rage powers(any rage power with “dragon totem” in its title).",
                                                        "",
                                                        blur.Icon,
                                                        FeatureGroup.RagePower
                                                        );

            addToSelection(lesser_spirit_totem, is_totem: true);
        }
Exemplo n.º 6
0
        static internal void createLesserCelestialTotem()
        {
            lesser_celestial_totem = Helpers.CreateFeature("LesserCelestialTotemFeature",
                                                           "Celestial Totem, Lesser",
                                                           "Whenever barbarian is subject to a spell that cures hit point damage, she heals 1 additional point of damage per caster level. In the case of non-spell healing effects (such as channeled energy or lay on hands), she heals a number of additional points equal to the class level of the character performing the magical healing. This does not affect fast healing or regeneration.",
                                                           "",
                                                           library.Get <BlueprintAbility>("75a10d5a635986641bfbcceceec87217").Icon, //angelic aspect
                                                           FeatureGroup.RagePower);
            lesser_celestial_totem_buff = Helpers.CreateBuff("LesserCelestialTotemBuff",
                                                             "",
                                                             "",
                                                             "",
                                                             null,
                                                             null
                                                             );
            lesser_celestial_totem_buff.SetBuffFlags(BuffFlags.HiddenInUi);

            Common.addContextActionApplyBuffOnFactsToActivatedAbilityBuffNoRemove(rage_buff, lesser_celestial_totem_buff, lesser_celestial_totem);
            addToSelection(lesser_celestial_totem, is_totem: true);
        }
Exemplo n.º 7
0
        static void createDeificFocus()
        {
            deific_focus = Helpers.CreateFeature("DeificFocusResource",
                                                 "Deific Focus",
                                                 "At 1st level, a relic hunter learns to invest divine power into her chosen relics. This acts like the occultist’s focus powers and mental focus class features, with the following adjustments.\n"
                                                 + "Each day, a relic hunter has a number of points of deific focus equal to her inquisitor level + her Wisdom modifier, and she must spend 1 hour in prayer with her relics to invest them with divine power. These points refresh at the start of each day.",
                                                 "",
                                                 Occultist.implement_icons[SpellSchool.Universalist],
                                                 FeatureGroup.None,
                                                 Helpers.Create <ImplementMechanics.AddImplements>()
                                                 );

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

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

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

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

            reset_focus_ability.setMiscAbilityParametersSelfOnly();

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

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

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

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

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

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

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

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

            wrapper.SetNameDescriptionIcon(deific_focus);

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

            foreach (var panoply in Enum.GetValues(typeof(Occultist.Panoply)))
            {
                var resource = Helpers.CreateAbilityResource(panoply.ToString() + "DeificFocusResource", "", "", "", null);
                resource.SetFixedResource(100);
                deific_focus_resource[(SpellSchool)panoply] = resource;
            }
        }
Exemplo n.º 8
0
        static public BlueprintFeature Create()
        {
            if (library.BlueprintsByAssetId.ContainsKey("b04d23c4d4f14d431d316063db884fe5"))
            {
                return(library.Get <BlueprintFeature>("b04d23c4d4f14d431d316063db884fe5"));
            }
            var variants = new List <BlueprintAbility>();

            buffDict = new Dictionary <Pair <int, int>, BlueprintBuff>();
            flagBuff = Helpers.CreateBuff("ArcanistClassSponMetamagicFlagBuff", "", "",
                                          OtherUtils.GetMd5("ArcanistClassSponMetamagicFlagBuff"), null, null);
            flagBuff.SetBuffFlags(flagBuff.GetBuffFlags() | BuffFlags.HiddenInUi);

            //make metamagics other than heighten
            foreach (var kv in MetaFeats.dict)
            {
                Metamagic        metaId   = (Metamagic)(kv.Key);
                BlueprintFeature metaFeat = library.Get <BlueprintFeature>(kv.Value);
                if (metaId == Metamagic.Heighten)
                {
                    continue;
                }
                RealMetamagicOnNextSpell comp = Helpers.Create <RealMetamagicOnNextSpell>();
                comp.metamagic = metaId;
                var buff_i = Helpers.CreateBuff($"ArcanistClassSponMetamagic{metaId}SubBuff", "", "",
                                                OtherUtils.GetMd5($"ArcanistClassSponMetamagic{metaId}SubBuff"),
                                                metaFeat.Icon, null, comp);
                buff_i.SetName(metaFeat.GetName());
                buff_i.SetDescription(metaFeat.GetDescription());

                var ablEffectComp       = Helpers.Create <AbilityEffectRunAction>();
                var ablEffectCompAction = Helpers.Create <ContextActionApplyBuff>();
                ablEffectCompAction.Buff            = buff_i;
                ablEffectCompAction.Permanent       = false;
                ablEffectCompAction.DurationValue   = PresetDurations.oneRound;
                ablEffectCompAction.IsFromSpell     = false;
                ablEffectCompAction.IsNotDispelable = false;
                ablEffectCompAction.ToCaster        = false;
                ablEffectCompAction.AsChild         = true;
                ablEffectComp.Actions = new ActionList {
                    Actions = new GameAction[] { null, ablEffectCompAction }
                };

                var ablRequirementComp = Helpers.Create <AbilityRequirementFeature>();
                ablRequirementComp.Feat = metaFeat;
                ablRequirementComp.Not  = false;

                var abl_i = Helpers.CreateAbility($"ArcanistClassSponMetamagic{metaId}SubAbl", "", "",
                                                  OtherUtils.GetMd5($"ArcanistClassSponMetamagic{metaId}SubAbl"),
                                                  metaFeat.Icon,
                                                  AbilityType.Special,
                                                  UnitCommand.CommandType.Free,
                                                  AbilityRange.Personal,
                                                  "", "",
                                                  ablEffectComp, ablRequirementComp);
                abl_i.SetName(metaFeat.GetName());
                abl_i.SetDescription(metaFeat.GetDescription());
                abl_i.LocalizedDuration    = Helpers.CreateString("ArcaneTide.OneRound");
                abl_i.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm");

                variants.Add(abl_i);
                buffDict[OtherUtils.make_pair <int, int>((int)metaId, 0)] = buff_i;
            }


            var abl = Helpers.CreateAbility("ArcanistClassSponMetamagicAbl", "", "",
                                            "d4abbfad4a4cd0eadde062132945f7bf",//MD5-32[ArcanistClass.SponMetamagic.Abl]
                                            IconSet.metamagic,
                                            AbilityType.Special,
                                            UnitCommand.CommandType.Free,
                                            AbilityRange.Personal,
                                            "", "");

            abl.SetName(Helpers.CreateString("ArcanistClass.SponMetamagic.Abl.Name"));
            abl.SetDescription(Helpers.CreateString("ArcanistClass.SponMetamagic.Abl.Desc"));
            abl.LocalizedDuration    = Helpers.CreateString("ArcaneTide.OneRound");
            abl.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm");
            abl.AddComponent(Helpers.CreateAbilityVariants(abl, variants));

            var ablHeighten = CreateHeighten();

            feat = Helpers.CreateFeature("ArcanistClassSponMetamagicFeat", "", "",
                                         "b04d23c4d4f14d431d316063db884fe5",//MD5-32[ArcanistClass.SponMetamagic.Feat]
                                         null,
                                         FeatureGroup.None,
                                         Helpers.Create <AddFacts>(a => a.Facts = new BlueprintUnitFact[] { abl, ablHeighten }));
            feat.HideInUI = true;
            return(feat);
        }