Exemplo n.º 1
0
        static public void addToRagingTactician(BlueprintFeature tw)
        {
            var choice_buff = Helpers.CreateBuff(tw.name + "RagingTacticianShareBuff",
                                                 "Raging Tactician: " + tw.Name,
                                                 "You can grant this teamwork feat to all allies within 30 feet who can see and hear you, using your tactician ability.",
                                                 Helpers.MergeIds("52674e84501b449c811bfcf8ce3d5a48", tw.AssetGuid),
                                                 tw.Icon,
                                                 null
                                                 );
            var toggle = Helpers.CreateActivatableAbility(tw.name + "RagingTacticianShareToggleAbility",
                                                          choice_buff.Name,
                                                          choice_buff.Description,
                                                          Helpers.MergeIds("311f55033cea46af96129d053e1e9c36", tw.AssetGuid),
                                                          tw.Icon,
                                                          choice_buff,
                                                          AbilityActivationType.Immediately,
                                                          UnitCommand.CommandType.Free,
                                                          null
                                                          );

            toggle.DeactivateImmediately = true;
            toggle.Group         = ActivatableAbilityGroupExtension.RagingTacticianTeamworkFeatShare.ToActivatableAbilityGroup();
            toggle.WeightInGroup = 1;

            var feature = Common.ActivatableAbilityToFeature(toggle, true, Helpers.MergeIds("949676fc1d3c482c84289c1920b5923c", tw.AssetGuid));

            raging_tactician[0].AddComponent(Helpers.Create <NewMechanics.AddFeatureIfHasFactsFromList>(a => { a.Feature = feature; a.CheckedFacts = new Kingmaker.Blueprints.Facts.BlueprintUnitFact[] { tw }; }));
            tw.AddComponent(Helpers.Create <NewMechanics.AddFeatureIfHasFactsFromList>(a => { a.Feature = feature; a.CheckedFacts = new Kingmaker.Blueprints.Facts.BlueprintUnitFact[] { raging_tactician[0] }; }));

            raging_tactician_buff.GetComponent <TeamworkMechanics.AddFactsFromCasterIfHasBuffs>().facts.Add(tw);
            raging_tactician_buff.GetComponent <TeamworkMechanics.AddFactsFromCasterIfHasBuffs>().prerequsites.Add(choice_buff);
        }
Exemplo n.º 2
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>());
        }
        static (BlueprintFeature, BlueprintFeature, BlueprintAbility, BlueprintBuff) createStunningFistVariant(string name, string display_name, string description, BlueprintBuff buff, ContextDurationValue duration, int level)
        {
            var stunning_fist_ability = library.Get <BlueprintAbility>("732ae7773baf15447a6737ae6547fc1e");
            var stunning_fist_buff    = library.Get <BlueprintBuff>("d9eaeba5690a7704da8bbf626456a50e");

            var new_buff = library.CopyAndAdd(stunning_fist_buff, name + "OwnerBuff", "");

            new_buff.SetNameDescriptionIcon(display_name, description, buff.Icon);

            var old_stunned = library.Get <BlueprintBuff>("09d39b38bb7c6014394b6daced9bacd3");

            foreach (var attack_trigger in new_buff.GetComponents <AddInitiatorAttackWithWeaponTrigger>().ToArray())
            {
                var actionst = attack_trigger.Action.Actions;
                actionst = Common.changeAction <ContextActionApplyBuff>(actionst, c =>
                {
                    if (c.Buff == old_stunned)
                    {
                        c.Buff = buff;
                        if (duration == null)
                        {
                            c.Permanent = true;
                        }
                        else
                        {
                            c.DurationValue = duration;
                        }
                    }
                }
                                                                        );
                actionst = Common.changeAction <ContextActionRemoveBuff>(actionst, c =>
                {
                    c.Buff = new_buff;
                }
                                                                         );
                new_buff.ReplaceComponent(attack_trigger, attack_trigger.CreateCopy(a => a.Action = Helpers.CreateActionList(actionst)));
            }

            var new_ability = library.CopyAndAdd(stunning_fist_ability, name + "Ability", "");

            new_ability.SetNameDescriptionIcon(new_buff);
            new_ability.GetComponent <AbilityCasterHasNoFacts>().Facts = new_ability.GetComponent <AbilityCasterHasNoFacts>().Facts.AddToArray(new_buff);

            var actions = new_ability.GetComponent <AbilityEffectRunAction>().Actions.Actions;

            actions = Common.changeAction <ContextActionApplyBuff>(actions, c => c.Buff = new_buff);

            new_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(actions));
            new_ability.ReplaceComponent <SpellDescriptorComponent>(buff.GetComponent <SpellDescriptorComponent>());

            var feature_monk = Common.AbilityToFeature(new_ability, false);

            feature_monk.AddComponent(Helpers.Create <ReplaceAbilityDC>(r => { r.Ability = new_ability; r.Stat = StatType.Wisdom; }));
            var scaled_fist_feature = library.CopyAndAdd <BlueprintFeature>(feature_monk, "ScaledFist" + feature_monk.name, "");

            scaled_fist_feature.ReplaceComponent <ReplaceAbilityDC>(r => r.Stat = StatType.Charisma);

            var monk_progression = library.Get <BlueprintProgression>("8a91753b978e3b34b9425419179aafd6");
            var scaled_fist      = library.Get <BlueprintArchetype>("5868fc82eb11a4244926363983897279");


            foreach (var le in monk_progression.LevelEntries)
            {
                if (le.Level == level)
                {
                    le.Features.Add(feature_monk);
                }
            }
            bool processed = false;

            foreach (var le in scaled_fist.RemoveFeatures)
            {
                if (le.Level == level)
                {
                    le.Features.Add(feature_monk);
                    processed = true;
                    break;
                }
            }
            if (!processed)
            {
                scaled_fist.RemoveFeatures = scaled_fist.RemoveFeatures.AddToArray(Helpers.LevelEntry(level, feature_monk));
            }

            processed = false;
            foreach (var le in scaled_fist.AddFeatures)
            {
                if (le.Level == level)
                {
                    le.Features.Add(scaled_fist_feature);
                    processed = true;
                    break;
                }
            }
            if (!processed)
            {
                scaled_fist.AddFeatures = scaled_fist.AddFeatures.AddToArray(Helpers.LevelEntry(level, feature_monk));
            }

            monk_progression.UIGroups[9].Features.Add(scaled_fist_feature);
            monk_progression.UIGroups[9].Features.Add(feature_monk);

            return(feature_monk, scaled_fist_feature, new_ability, new_buff);
        }