Esempio n. 1
0
        static public void createMindShield(bool enabled = true)
        {
            var psychokineticist    = library.Get <BlueprintArchetype>("f2847dd4b12fffd41beaa3d7120d27ad");    //PsychokineticistArchetype
            var burn_number         = library.Get <BlueprintUnitProperty>("02c5943c77717974cb7fa1b7c0dc51f8"); //BurnNumberProperty
            var buff_daze           = library.Get <BlueprintBuff>("9934fedff1b14994ea90205d189c8759");         //DazeBuff
            var buff_confusion      = library.Get <BlueprintBuff>("886c7407dc629dc499b9f1465ff382df");         //Confusion
            var buff_cowering       = library.Get <BlueprintBuff>("02924d88f80c5374eacbbccb499d5778");         //CoweringCommonBuff
            var buff_frightened     = library.Get <BlueprintBuff>("f08a7239aa961f34c8301518e71d4cdf");         //Frightened
            var buff_dominateperson = library.Get <BlueprintBuff>("c0f4e1c24c9cd334ca988ed1bd9d201f");         //DominatePersonBuff
            //var buff_panicked = library.Get<BlueprintBuff>("");//

            var custom_daze = library.CopyAndAdd(buff_daze, "Dazed", "4b35a9e429fb472aaf45585d7d82e3e1");

            custom_daze.AddComponent(buff_dominateperson.ComponentsArray[2]);

            // - simply gives counter bonus to skill penalties
            // - also replaces most common will based debuffs with daze (idea being that daze is better than being mind-controlled or running in circles)
            // - also give new saving throw like DominatePersonBuff
            BlueprintBuff mind_shield_buff = Helpers.CreateBuff(
                "MindShieldBuff",
                "Mind Shield",
                "You ignore the penalties of Mind Burn to Wisdom-based skill checks. Additionally if you fail a Will saving throw against a mind-affecting spell, you are instead dazed for the duration of the spell, but you may re-try the saving throw each round.",
                "0ba3718f568a4c9097307a7af57c8f88",
                null,
                null
                );

            Harmony12.AccessTools.Field(typeof(BlueprintBuff), "m_Flags").SetValue(mind_shield_buff, 2);//HiddenInUi
            var b_comp1 = Helpers.CreateAddContextStatBonus(StatType.SkillPerception, ModifierDescriptor.UntypedStackable, ContextValueType.CasterCustomProperty, multiplier: 2);

            b_comp1.Value.CustomProperty = burn_number;
            var b_comp2 = Helpers.CreateAddContextStatBonus(StatType.SkillLoreNature, ModifierDescriptor.UntypedStackable, ContextValueType.CasterCustomProperty, multiplier: 2);

            b_comp2.Value.CustomProperty = burn_number;
            var b_comp3 = Helpers.CreateAddContextStatBonus(StatType.SkillLoreReligion, ModifierDescriptor.UntypedStackable, ContextValueType.CasterCustomProperty, multiplier: 2);

            b_comp3.Value.CustomProperty = burn_number;
            mind_shield_buff.SetComponents(b_comp1, b_comp2, b_comp3,
                                           Helper.CreateBuffSubstitutionOnApply(buff_confusion, custom_daze),
                                           Helper.CreateBuffSubstitutionOnApply(buff_cowering, custom_daze),
                                           Helper.CreateBuffSubstitutionOnApply(buff_frightened, custom_daze),
                                           Helper.CreateBuffSubstitutionOnApply(buff_dominateperson, custom_daze)
                                           );

            var mind_shield_feature = Helpers.CreateFeature(
                "MindShieldFeature",
                mind_shield_buff.Name,
                mind_shield_buff.Description,
                "eeab6701ee7447d3b62996a62e315bd7",
                cold_base.Icon,
                FeatureGroup.KineticWildTalent
                );
            var f_comp1 = psychokineticist.CreatePrerequisite(6);
            var f_comp2 = Helper.CreateAddKineticistBurnValueChangedTrigger(Helper.CreateActionApplyBuff(mind_shield_buff, permanent: true));
            var f_comp3 = Helpers.PrerequisiteNoFeature(mind_shield_feature);
            var f_comp4 = Helpers.CreateAddFact(mind_shield_buff);

            mind_shield_feature.SetComponents(f_comp1, f_comp2, f_comp3, f_comp4);

            if (enabled)
            {
                Helper.AppendAndReplace(ref wildtalent_selection.AllFeatures, mind_shield_feature);
            }
        }
Esempio n. 2
0
        // known issue:
        // - does not restrict your move action to be used for moving (won't fix)
        // - gathering long should not slow you, since it already consumes a standard action (won't fix)
        // - the slow effect is ignored, if applied while moving. the ability should interrupt movement shortly
        static public void createMobileGatheringFeat()
        {
            // --- base game stuff ---
            var buff1 = library.Get <BlueprintBuff>("e6b8b31e1f8c524458dc62e8a763cfb1");                 //GatherPowerBuffI
            var buff2 = library.Get <BlueprintBuff>("3a2bfdc8bf74c5c4aafb97591f6e4282");                 //GatherPowerBuffII
            var buff3 = library.Get <BlueprintBuff>("82eb0c274eddd8849bb89a8e6dbc65f8");                 //GatherPowerBuffIII
            var gather_original_ab = library.Get <BlueprintAbility>("6dcbffb8012ba2a4cb4ac374a33e2d9a"); //GatherPower

            //var slowed_debuff = library.Get<BlueprintBuff>("488e53ede2802ff4da9372c6a494fb66");    //Slowed
            // -----------------------

            buff1.SetIcon(gather_original_ab.Icon);
            buff1.SetName(buff1.Name + " Lv1");
            buff2.SetIcon(gather_original_ab.Icon);
            buff2.SetName(buff2.Name + " Lv2");
            buff3.SetIcon(gather_original_ab.Icon);
            buff3.SetName(buff3.Name + " Lv3");

            // new buff that halves movement speed, disallows normal gathering, penalty on concentration?
            mobile_debuff      = ScriptableObject.CreateInstance <BlueprintBuff>();
            mobile_debuff.name = "MobileGatheringDebuff";
            mobile_debuff.SetNameDescriptionIcon("Mobile Gathering Debuff", "Your movement speed is halved after gathering power.", Helper.Image2Sprite.Create("GatherMobileHigh.png"));
            //Harmony12.AccessTools.Field(typeof(BlueprintBuff), "m_Flags").SetValue(mobile_debuff, 2); //HiddenInUi
            mobile_debuff.IsClassFeature = true;
            mobile_debuff.SetComponents(UnitCondition.Slowed.CreateAddCondition());
            library.AddAsset(mobile_debuff, "ffd79fee05bf4e6dad7156e895f3cf27");
            var can_gather = Helper.CreateAbilidtyRequirementHasBuffTimed(NewComponents.CompareType.LessOrEqual, 1.Rounds().Seconds, buff1, buff2, buff3);

            // cannot use usual gathering after used mobile gathering
            gather_original_ab.AddComponent(Helper.CreateAbilityRequirementHasBuffs(true, mobile_debuff));

            // ability as free action that applies buff and 1 level of gatherpower
            // - is free action
            // - increases gather power by 1 level, similiar to GatherPower:6dcbffb8012ba2a4cb4ac374a33e2d9a
            // - applies debuff
            // - get same restriction as usual gathering
            var mobile_gathering_short_ab = Helpers.CreateAbility(
                "MobileGatheringShort",
                "Mobile Gathering (Move Action)",
                "You may move up to half your normal speed while gathering power.",
                "a482da35c21a4a0e801849610e03df87",
                Helper.Image2Sprite.Create("GatherMobileLow.png"),
                AbilityType.Special,
                UnitCommand.CommandType.Free,
                AbilityRange.Personal,
                "",
                ""
                );

            mobile_gathering_short_ab.CanTargetSelf    = true;
            mobile_gathering_short_ab.Animation        = UnitAnimationActionCastSpell.CastAnimationStyle.Self;//UnitAnimationActionCastSpell.CastAnimationStyle.Kineticist;
            mobile_gathering_short_ab.HasFastAnimation = true;
            //Helpers.CreateApplyBuff(mobile_debuff, Helpers.CreateContextDuration(1), false, false, true);
            var apply_debuff  = Helper.CreateActionApplyBuff(mobile_debuff, 1);
            var three2three   = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buff3), new GameAction[] { Helper.CreateActionApplyBuff(buff3, 2) });
            var two2three     = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buff2), new GameAction[] { Helper.CreateActionRemoveBuff(buff2), Helper.CreateActionApplyBuff(buff3, 2) });
            var one2two       = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buff1), new GameAction[] { Helper.CreateActionRemoveBuff(buff1), Helper.CreateActionApplyBuff(buff2, 2) });
            var zero2one      = Helpers.CreateConditional(Helper.CreateConditionHasNoBuff(buff1, buff2, buff3), new GameAction[] { Helper.CreateActionApplyBuff(buff1, 2) });
            var hasMoveAction = Helper.CreateRequirementActionAvailable(false, NewComponents.ActionType.Move);

            mobile_gathering_short_ab.SetComponents(can_gather, hasMoveAction, Helper.CreateAbilityEffectRunAction(0, apply_debuff, three2three, two2three, one2two, zero2one));

            // same as above but standard action and 2 levels of gatherpower
            var mobile_gathering_long_ab = Helpers.CreateAbility(
                "MobileGatheringLong",
                "Mobile Gathering (Full Round)",
                "You may move up to half your normal speed while gathering power.\nTip for Turn-Based Combat: Move before using this ability.",
                "e7cd3a8200f04c8fae099d5d2f4afa0b",
                Helper.Image2Sprite.Create("GatherMobileMedium.png"),
                AbilityType.Special,
                UnitCommand.CommandType.Standard,
                AbilityRange.Personal,
                "",
                ""
                );

            mobile_gathering_long_ab.CanTargetSelf    = true;
            mobile_gathering_long_ab.Animation        = UnitAnimationActionCastSpell.CastAnimationStyle.Self;
            mobile_gathering_long_ab.HasFastAnimation = true;
            var one2three = Helpers.CreateConditional(Helpers.CreateConditionHasBuff(buff1), new GameAction[] { Helper.CreateActionRemoveBuff(buff1), Helper.CreateActionApplyBuff(buff3, 2) });
            var zero2two  = Helpers.CreateConditional(Helper.CreateConditionHasNoBuff(buff1, buff2, buff3), new GameAction[] { Helper.CreateActionApplyBuff(buff2, 2) });

            mobile_gathering_long_ab.SetComponents(can_gather, Helper.CreateAbilityEffectRunAction(0, apply_debuff, three2three, two2three, one2three, zero2two));

            var mobile_gathering_feat = Helpers.CreateFeature(
                "MobileGatheringFeat",
                "Mobile Gathering",
                "While gathering power, you can move up to half your normal speed. This movement provokes attacks of opportunity as normal.",
                "60edffeba6d74e0f831c00692e5fc621",
                mobile_debuff.Icon,
                FeatureGroup.Feat,
                kineticist_class.PrerequisiteClassLevel(7, true),
                Helpers.CreateAddFacts(mobile_gathering_short_ab, mobile_gathering_long_ab)
                );

            mobile_gathering_feat.Ranks          = 1;
            mobile_gathering_feat.IsClassFeature = true;
            library.AddFeats(mobile_gathering_feat);
        }