public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(DoAnyMovesYieldLOFToAnyHostileNode_Tick), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(HighestPriorityMoveCandidateIsAttackNode_Tick), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(ToHit_GetAllModifiersDescription), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        private static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var markerMethod = AccessTools.Property(typeof(Rand), nameof(Rand.Value)).GetGetMethod();
            var sneakyMethod = AccessTools.Method(typeof(Patch_MakeNewToils), nameof(Patch_MakeNewToils.PatchedRandValue));

            return(Transpilers.MethodReplacer(instructions, markerMethod, sneakyMethod));
        }
Esempio n. 5
0
        public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var page_CreateWorldParams_ctor    = AccessTools.Constructor(typeof(Page_CreateWorldParams));
            var planets_CreateWorldParams_ctor = AccessTools.Constructor(typeof(Planets_CreateWorldParams));

            return(Transpilers.MethodReplacer(instructions, from: page_CreateWorldParams_ctor, to: planets_CreateWorldParams_ctor));
        }
Esempio n. 6
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "AmmoCategory").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(PoorlyMaintainedEffect_ApplyEffectsToVehicle), nameof(AmmoCategory));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 7
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(LOFCache_UnitHasLOFToTarget), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 8
0
        private static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            MethodInfo from = AccessTools.Method(typeof(ThreeDaysOfNight), "IsActive");
            MethodInfo to   = AccessTools.Method(typeof(Patches), "IsActive");

            return(Transpilers.MethodReplacer(instructions, from, to));
        }
Esempio n. 9
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(AbstractActor_GetLongestRangeWeapon), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        //public void DoPlaySettingsGlobalControls(WidgetRow row, bool worldView)
        public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            MethodInfo ToggleableIconInfo        = AccessTools.Method(typeof(WidgetRow), nameof(WidgetRow.ToggleableIcon));
            MethodInfo ToggleableIconReplacement = AccessTools.Method(typeof(RemoveUnusedToggles), nameof(ToggleableIconFiltered));

            return(Transpilers.MethodReplacer(instructions, ToggleableIconInfo, ToggleableIconReplacement));
        }
Esempio n. 11
0
            public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
            {
                var from = AccessTools.PropertyGetter(typeof(SteamManager), nameof(SteamManager.Initialized));
                var to   = SymbolExtensions.GetMethodInfo(() => TrueReturner());

                return(Transpilers.MethodReplacer(instructions, from, to));
            }
Esempio n. 12
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(AIRoleAssignment_EvaluateSniper), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 13
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(PreferNotLethalPositionFactor_expectedDamageForShooting), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 14
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(CombatHUDWeaponTickMarks_GetValidSlots), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 15
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(PreferFiringSolutionWhenExposedAllyPositionalFactor_EvaluateInfluenceMapFactorAtPosition), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 16
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(PreferExposedAlonePositionalFactor_InitEvaluationForPhaseForUnit), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 17
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "IndirectFireCapable").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(MultiAttack_ValidateMultiAttackOrder), nameof(IndirectFireCapable));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 18
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "AmmoCategory").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(Weapon_HasAmmo), nameof(AmmoCategory));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 19
0
        private static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var markerMethod = AccessTools.Method(typeof(Messages), nameof(Messages.Message), new Type[] { typeof(string), typeof(LookTargets), typeof(MessageTypeDef), typeof(bool) });
            var sneakyMethod = AccessTools.Method(typeof(Patch_FailConstruction), nameof(Patch_FailConstruction.ConditionalMessage));

            return(Transpilers.MethodReplacer(instructions, markerMethod, sneakyMethod));
        }
Esempio n. 20
0
        public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            MethodInfo DestroyInfo        = AccessTools.Method(typeof(Thing), nameof(Thing.Destroy));
            MethodInfo DestroyReplaceInfo = AccessTools.Method(typeof(RebuildTransportPod), nameof(DestroyReplace));

            return(Transpilers.MethodReplacer(instructions, DestroyInfo, DestroyReplaceInfo));
        }
Esempio n. 21
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var from = AccessTools.Constructor(typeof(DamageFlasher), new Type[] { typeof(Pawn) });
            var to   = AccessTools.Constructor(typeof(ZombieDamageFlasher), new Type[] { typeof(Pawn) });

            return(Transpilers.MethodReplacer(instructions, from, to));
        }
Esempio n. 22
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(AIUtil_ExpectedDamageForMeleeAttackUsingUnitsBVs), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 23
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(AttackEvaluator_MakeAttackOrderForTarget_AP), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 24
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(MoveTowardsHighestPriorityMoveCandidateNode_Tick), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 25
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(CombatTestFire_MeleeAttackSequence), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 26
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(MechRepresentation_PlayImpactAnim), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 27
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "Category").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(SelectionStateMove_ProjectedHeatForState), nameof(Category));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "ShotsWhenFired").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(ClusteredShotRandomCacheEnabler),
                                                          nameof(ShotsWhenFiredRandomizerOverider));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
Esempio n. 29
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var targetPropertyGetter = AccessTools.Property(typeof(Weapon), "ShotsWhenFired").GetGetMethod();
            var replacementMethod    = AccessTools.Method(typeof(CombatHUDWeaponSlot_RefreshDisplayedWeapon1),
                                                          nameof(ShotsWhenFiredDisplayOverider));

            return(Transpilers.MethodReplacer(instructions, targetPropertyGetter, replacementMethod));
        }
        //GenClosest::ClosestThingReachable
        //protected Job ResourceDeliverJobFor(Pawn pawn, IConstructible c, bool canRemoveExistingFloorUnderNearbyNeeders = true)
        public static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            instructions = Transpilers.MethodReplacer(instructions,
                                                      AccessTools.Method(typeof(GenClosest), nameof(GenClosest.ClosestThingReachable)),
                                                      AccessTools.Method(typeof(UseInventory), nameof(OrUseInventory)));

            return(Transpilers.MethodReplacer(instructions,
                                              AccessTools.Method(typeof(ItemAvailability), nameof(ItemAvailability.ThingsAvailableAnywhere)),
                                              AccessTools.Method(typeof(UseInventory), nameof(OrInInventory))));
        }