using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DropSourceForItems.Modded.ModSupport; using EnemiesReturns.Enemies.LynxTribe; using EntityStates; using EntityStates.DroneScrapper; using EntityStates.Scrapper; using Mdh.EnemiesReturns.Enemies.LynxTribe.LynxTribeShrine; using Mdh.EntityStates.DroneScrapper.DroneScrappingToIdle; using Mdh.EntityStates.Scrapper.ScrappingToIdle; using Mdh.RiskyTweaks.Tweaks.Interactables.ShrineCombatItems; using Mdh.RoR2.ArenaMissionController; using Mdh.RoR2.ChestBehavior; using Mdh.RoR2.GenericPickupController; using Mdh.RoR2.HalcyoniteShrineInteractable; using Mdh.RoR2.OptionChestBehavior; using Mdh.RoR2.PickupDistributorBehavior; using Mdh.RoR2.PickupDropletController; using Mdh.RoR2.PickupPickerController; using Mdh.RoR2.RouletteChestController; using Mdh.RoR2.ScavBackpackBehavior; using Mdh.RoR2.ShopTerminalBehavior; using Mdh.RoR2.ShrineChanceBehavior; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil.Cil; using Mono.Collections.Generic; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoMod.Cil; using On.RoR2; using RiskyTweaks.Tweaks.Interactables; using RoR2; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("EnemiesReturns")] [assembly: IgnoresAccessChecksTo("RiskyTweaks")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LordVGames.DropSourceForItems")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LordVGames.DropSourceForItems")] [assembly: AssemblyTitle("DropSourceForItems")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Mdh.EntityStates.Scrapper.ScrappingToIdle { internal static class OnEnter { public delegate void PrefixSignature(ScrappingToIdle self); public delegate void PostfixSignature(ScrappingToIdle self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ScrappingToIdle); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Scrapper.ScrappingToIdle", "OnEnter"); } return method; } } } namespace Mdh.EntityStates.DroneScrapper.DroneScrappingToIdle { internal static class DropPickup { public delegate void PrefixSignature(DroneScrappingToIdle self); public delegate void PostfixSignature(DroneScrappingToIdle self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(DroneScrappingToIdle); MethodInfo method = typeFromHandle.GetMethod("DropPickup", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.DroneScrapper.DroneScrappingToIdle", "DropPickup"); } return method; } } internal static class OnEnter { public delegate void PrefixSignature(DroneScrappingToIdle self); public delegate void PostfixSignature(DroneScrappingToIdle self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(DroneScrappingToIdle); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.DroneScrapper.DroneScrappingToIdle", "OnEnter"); } return method; } } } namespace Mdh.RiskyTweaks.Tweaks.Interactables.ShrineCombatItems { internal static class ShrineCombatBehavior_OnDefeatedServer { public delegate void PrefixSignature(ShrineCombatItems self, ref orig_OnDefeatedServer orig, ref ShrineCombatBehavior self1); public delegate void PostfixSignature(ShrineCombatItems self, ref orig_OnDefeatedServer orig, ref ShrineCombatBehavior self1); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ShrineCombatItems); MethodInfo method = typeFromHandle.GetMethod("ShrineCombatBehavior_OnDefeatedServer", (BindingFlags)(-1), null, new Type[2] { typeof(orig_OnDefeatedServer), typeof(ShrineCombatBehavior) }, null); if ((object)method == null) { throw new MissingMethodException("RiskyTweaks.Tweaks.Interactables.ShrineCombatItems", "ShrineCombatBehavior_OnDefeatedServer"); } return method; } } } namespace Mdh.EnemiesReturns.Enemies.LynxTribe.LynxTribeShrine { internal static class DropItems { public delegate void PrefixSignature(LynxTribeShrine self); public delegate void PostfixSignature(LynxTribeShrine self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(LynxTribeShrine); MethodInfo method = typeFromHandle.GetMethod("DropItems", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("EnemiesReturns.Enemies.LynxTribe.LynxTribeShrine", "DropItems"); } return method; } } internal static class AddShrineStack { public delegate void PrefixSignature(LynxTribeShrine self, ref Interactor activator); public delegate void PostfixSignature(LynxTribeShrine self, ref Interactor activator); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(LynxTribeShrine); MethodInfo method = typeFromHandle.GetMethod("AddShrineStack", (BindingFlags)(-1), null, new Type[1] { typeof(Interactor) }, null); if ((object)method == null) { throw new MissingMethodException("EnemiesReturns.Enemies.LynxTribe.LynxTribeShrine", "AddShrineStack"); } return method; } } } namespace Mdh.RoR2.PickupDistributorBehavior { internal static class Drop { public delegate void PrefixSignature(PickupDistributorBehavior self); public delegate void PostfixSignature(PickupDistributorBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PickupDistributorBehavior); MethodInfo method = typeFromHandle.GetMethod("Drop", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.PickupDistributorBehavior", "Drop"); } return method; } } } namespace Mdh.RoR2.ArenaMissionController { internal static class MissionCompleted { internal static class OnEnter { public delegate void PrefixSignature(MissionCompleted self); public delegate void PostfixSignature(MissionCompleted self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(MissionCompleted); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ArenaMissionController+MissionCompleted", "OnEnter"); } return method; } } } internal static class EndRound { public delegate void PrefixSignature(ArenaMissionController self); public delegate void PostfixSignature(ArenaMissionController self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ArenaMissionController); MethodInfo method = typeFromHandle.GetMethod("EndRound", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ArenaMissionController", "EndRound"); } return method; } } } namespace Mdh.RoR2.OptionChestBehavior { internal static class ItemDrop { public delegate void PrefixSignature(OptionChestBehavior self); public delegate void PostfixSignature(OptionChestBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(OptionChestBehavior); MethodInfo method = typeFromHandle.GetMethod("ItemDrop", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.OptionChestBehavior", "ItemDrop"); } return method; } } } namespace Mdh.RoR2.ScavBackpackBehavior { internal static class ItemDrop { public delegate void PrefixSignature(ScavBackpackBehavior self); public delegate void PostfixSignature(ScavBackpackBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ScavBackpackBehavior); MethodInfo method = typeFromHandle.GetMethod("ItemDrop", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ScavBackpackBehavior", "ItemDrop"); } return method; } } } namespace Mdh.RoR2.PickupPickerController { internal static class CreatePickup_RoR2_UniquePickup { public delegate void PrefixSignature(PickupPickerController self, ref UniquePickup pickupState); public delegate void PostfixSignature(PickupPickerController self, ref UniquePickup pickupState); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PickupPickerController); MethodInfo method = typeFromHandle.GetMethod("CreatePickup", (BindingFlags)(-1), null, new Type[1] { typeof(UniquePickup) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.PickupPickerController", "CreatePickup"); } return method; } } } namespace Mdh.RoR2.HalcyoniteShrineInteractable { internal static class DropRewards { public delegate void PrefixSignature(HalcyoniteShrineInteractable self); public delegate void PostfixSignature(HalcyoniteShrineInteractable self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HalcyoniteShrineInteractable); MethodInfo method = typeFromHandle.GetMethod("DropRewards", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.HalcyoniteShrineInteractable", "DropRewards"); } return method; } } } namespace Mdh.RoR2.RouletteChestController { internal static class EjectPickupServer { public delegate void PrefixSignature(RouletteChestController self, ref UniquePickup pickup); public delegate void PostfixSignature(RouletteChestController self, ref UniquePickup pickup); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(RouletteChestController); MethodInfo method = typeFromHandle.GetMethod("EjectPickupServer", (BindingFlags)(-1), null, new Type[1] { typeof(UniquePickup) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController", "EjectPickupServer"); } return method; } } internal static class RouletteChestControllerBaseState { internal static class OnEnter { public delegate void PrefixSignature(RouletteChestControllerBaseState self); public delegate void PostfixSignature(RouletteChestControllerBaseState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(RouletteChestControllerBaseState); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+RouletteChestControllerBaseState", "OnEnter"); } return method; } } } internal static class Idle { internal static class OnEnter { public delegate void PrefixSignature(Idle self); public delegate void PostfixSignature(Idle self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Idle); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+Idle", "OnEnter"); } return method; } } } internal static class Startup { internal static class OnEnter { public delegate void PrefixSignature(Startup self); public delegate void PostfixSignature(Startup self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Startup); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+Startup", "OnEnter"); } return method; } } } internal static class Cycling { internal static class OnEnter { public delegate void PrefixSignature(Cycling self); public delegate void PostfixSignature(Cycling self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Cycling); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+Cycling", "OnEnter"); } return method; } } } internal static class Opening { internal static class OnEnter { public delegate void PrefixSignature(Opening self); public delegate void PostfixSignature(Opening self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Opening); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+Opening", "OnEnter"); } return method; } } } internal static class Opened { internal static class OnEnter { public delegate void PrefixSignature(Opened self); public delegate void PostfixSignature(Opened self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Opened); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.RouletteChestController+Opened", "OnEnter"); } return method; } } } } namespace Mdh.RoR2.ShopTerminalBehavior { internal static class DropPickup { public delegate void PrefixSignature(ShopTerminalBehavior self); public delegate void PostfixSignature(ShopTerminalBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ShopTerminalBehavior); MethodInfo method = typeFromHandle.GetMethod("DropPickup", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ShopTerminalBehavior", "DropPickup"); } return method; } } internal static class DropPickup_System_Boolean { public delegate void PrefixSignature(ShopTerminalBehavior self, ref bool isDuplicated); public delegate void PostfixSignature(ShopTerminalBehavior self, ref bool isDuplicated); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ShopTerminalBehavior); MethodInfo method = typeFromHandle.GetMethod("DropPickup", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.ShopTerminalBehavior", "DropPickup"); } return method; } } } namespace Mdh.RoR2.ChestBehavior { internal static class BaseItemDrop { public delegate void PrefixSignature(ChestBehavior self); public delegate void PostfixSignature(ChestBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ChestBehavior); MethodInfo method = typeFromHandle.GetMethod("BaseItemDrop", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ChestBehavior", "BaseItemDrop"); } return method; } } internal static class ItemDrop { public delegate void PrefixSignature(ChestBehavior self); public delegate void PostfixSignature(ChestBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ChestBehavior); MethodInfo method = typeFromHandle.GetMethod("ItemDrop", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.ChestBehavior", "ItemDrop"); } return method; } } } namespace Mdh.RoR2.ShrineChanceBehavior { internal static class AddShrineStack { public delegate void PrefixSignature(ShrineChanceBehavior self, ref Interactor activator); public delegate void PostfixSignature(ShrineChanceBehavior self, ref Interactor activator); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ShrineChanceBehavior); MethodInfo method = typeFromHandle.GetMethod("AddShrineStack", (BindingFlags)(-1), null, new Type[1] { typeof(Interactor) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.ShrineChanceBehavior", "AddShrineStack"); } return method; } } } namespace Mdh.RoR2.PickupDropletController { internal static class CreatePickup { public delegate void PrefixSignature(PickupDropletController self); public delegate void PostfixSignature(PickupDropletController self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PickupDropletController); MethodInfo method = typeFromHandle.GetMethod("CreatePickup", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.PickupDropletController", "CreatePickup"); } return method; } } internal static class CreateCommandCube { public delegate void PrefixSignature(PickupDropletController self); public delegate void PostfixSignature(PickupDropletController self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PickupDropletController); MethodInfo method = typeFromHandle.GetMethod("CreateCommandCube", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.PickupDropletController", "CreateCommandCube"); } return method; } } internal static class Init { public delegate void PrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PickupDropletController); MethodInfo method = typeFromHandle.GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.PickupDropletController", "Init"); } return method; } } } namespace Mdh.RoR2.GenericPickupController { internal static class CreatePickup { public delegate void PrefixSignature(ref CreatePickupInfo createPickupInfo); public delegate void PostfixSignature(ref CreatePickupInfo createPickupInfo, ref GenericPickupController returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericPickupController); MethodInfo method = typeFromHandle.GetMethod("CreatePickup", (BindingFlags)(-1), null, new Type[1] { typeof(CreatePickupInfo).MakeByRefType() }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.GenericPickupController", "CreatePickup"); } return method; } } internal static class Init { public delegate void PrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericPickupController); MethodInfo method = typeFromHandle.GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.GenericPickupController", "Init"); } return method; } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute(Type? targetType = null) : Attribute(), IMonoDetourTargets { public Type? TargetType { get; } = targetType; public bool IncludeNestedTypes { get; set; } = true; public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Microsoft.CodeAnalysis { [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace DropSourceForItems { public static class ConfigOptions { private const string _sectionName = "when the config has options"; internal static ConfigEntry ShowDebugLogging; internal static void BindConfigOptions(ConfigFile config) { ShowDebugLogging = Extensions.BindOption(config, "when the config has options", "Show debug logging", "does what it says", false, (ConfigFlags)0); } } internal static class ILHelpers { internal static void LogILInstructions(this ILWeaver w) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Enumerator enumerator = w.Instructions.GetEnumerator(); try { while (enumerator.MoveNext()) { Instruction current = enumerator.Current; Log.Warning(current); } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { if (ConfigOptions.ShowDebugLogging.Value) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [MonoDetourTargets(typeof(GenericPickupController))] [MonoDetourTargets(typeof(PickupDropletController))] public static class Main { [CompilerGenerated] private static class <>O { public static Manipulator <0>__TransferDropSourceToPickup; public static Manipulator <1>__TransferDropSourceToCommandPickup; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<0>__TransferDropSourceToPickup; if (obj == null) { Manipulator val = TransferDropSourceToPickup; <>O.<0>__TransferDropSourceToPickup = val; obj = (object)val; } Mdh.RoR2.GenericPickupController.CreatePickup.ILHook((Manipulator)obj); object obj2 = <>O.<1>__TransferDropSourceToCommandPickup; if (obj2 == null) { Manipulator val2 = TransferDropSourceToCommandPickup; <>O.<1>__TransferDropSourceToCommandPickup = val2; obj2 = (object)val2; } CreateCommandCube.ILHook((Manipulator)obj2); } private static void TransferDropSourceToCommandPickup(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(PickupPickerController), ref val); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetComponent") && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchDup(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[2] { w.Create(OpCodes.Stloc, val), w.Create(OpCodes.Ldloc, val) })); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "chestGeneratedFrom") && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Spawn") }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[3] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(PickupDropletController pdc, PickupPickerController ppc) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Log.Debug("AfterPickupMadeCommand"); if (!((Object)(object)pdc == (Object)null) && !((Object)(object)ppc == (Object)null)) { _ = pdc.pickupState; GameObject pickupDropSource = PatchedPickupInfoInterop.GetPickupDropSource(ref pdc.createPickupInfo); if ((Object)(object)pickupDropSource == (Object)null) { Log.Debug($"Drop source on createPickupInfo for {((CreatePickupInfo)(ref pdc.createPickupInfo)).pickup} was null!"); } else { Log.Debug($"Drop source on createPickupInfo for {((CreatePickupInfo)(ref pdc.createPickupInfo)).pickup} is {pickupDropSource}"); PatchedPickupInfoInterop.SetPickupDropSource(ppc, PatchedPickupInfoInterop.GetPickupDropSource(ref pdc.createPickupInfo)); } } })) })); } private static void TransferDropSourceToPickup(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Spawn") }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[5] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldobj, typeof(CreatePickupInfo))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_1)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_3)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(CreatePickupInfo createPickupInfo, GenericPickupController gpc, PickupPickerController ppc) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Log.Debug("AfterPickupMade"); _ = ((CreatePickupInfo)(ref createPickupInfo)).pickup; GameObject pickupDropSource = PatchedPickupInfoInterop.GetPickupDropSource(ref createPickupInfo); if ((Object)(object)pickupDropSource == (Object)null) { Log.Debug($"Drop source on createPickupInfo for {((CreatePickupInfo)(ref createPickupInfo)).pickup} was null!"); } else { Log.Debug($"Drop source on createPickupInfo for {((CreatePickupInfo)(ref createPickupInfo)).pickup} is {pickupDropSource}"); if ((Object)(object)gpc != (Object)null) { Log.Debug("Setting drop source on GenericPickupController"); PatchedPickupInfoInterop.SetPickupDropSource(gpc, pickupDropSource); } else if ((Object)(object)ppc != (Object)null) { Log.Debug("Setting drop source on PickupPickerController"); PatchedPickupInfoInterop.SetPickupDropSource(ppc, pickupDropSource); } else { Log.Error("Both GenericPickupController AND PickupPickerController were null when trying to transfer drop source???"); } } })) })); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("LordVGames.DropSourceForItems", "DropSourceForItems", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string Id = "LordVGames.DropSourceForItems"; public static string Name => "DropSourceForItems"; public static string Version => "1.0.0"; public void Awake() { ConfigOptions.BindConfigOptions(((BaseUnityPlugin)this).Config); Log.Init(((BaseUnityPlugin)this).Logger); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly, false); } } } namespace DropSourceForItems.Vanilla { [MonoDetourTargets(typeof(ShrineChanceBehavior))] internal static class ChanceShrine { [CompilerGenerated] private static class <>O { public static Manipulator <0>__AddShrineStack; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__AddShrineStack; if (obj == null) { Manipulator val = AddShrineStack; <>O.<0>__AddShrineStack = val; obj = (object)val; } Mdh.RoR2.ShrineChanceBehavior.AddShrineStack.ILHook((Manipulator)obj); } private static void AddShrineStack(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(UniquePickup), ref val3); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[11] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(ShrineChanceBehavior chanceShrineBehavior, UniquePickup pickup, Vector3 position, Vector3 velocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val4 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val4)).pickup = pickup; val4.position = position; val4.duplicated = false; val4.recycled = false; CreatePickupInfo val5 = val4; PatchedPickupInfoInterop.SetPickupDropSource(ref val5, ((Component)chanceShrineBehavior).gameObject); PickupDropletController.CreatePickupDroplet(val5, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 3], w.Current); } } [MonoDetourTargets(typeof(ChestBehavior))] internal static class ChestBehaviorSources { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ChestItemDrop; } private const int createPickupInfoVariableNumber = 4; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ChestItemDrop; if (obj == null) { Manipulator val = ChestItemDrop; <>O.<0>__ChestItemDrop = val; obj = (object)val; } BaseItemDrop.ILHook((Manipulator)obj); } private static void ChestItemDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "chest") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, ChestBehavior chestBehavior) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chestBehavior == (Object)null || (Object)(object)((Component)chestBehavior).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)chestBehavior).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 4)) })); } } [MonoDetourTargets(typeof(DroneScrappingToIdle))] internal static class DroneScrapper { [CompilerGenerated] private static class <>O { public static Manipulator <0>__DropPickup; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__DropPickup; if (obj == null) { Manipulator val = DropPickup; <>O.<0>__DropPickup = val; obj = (object)val; } Mdh.EntityStates.DroneScrapper.DroneScrappingToIdle.DropPickup.ILHook((Manipulator)obj); } private static void DropPickup(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(bool), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val3); VariableDefinition val4 = default(VariableDefinition); w.DeclareVariable(typeof(UniquePickup), ref val4); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[14] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(DroneScrappingToIdle droneScrappingToIdle, UniquePickup pickup, Vector3 position, Vector3 velocity, bool isDuplicated) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val5 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val5)).pickup = pickup; val5.position = position; val5.duplicated = isDuplicated; val5.recycled = false; CreatePickupInfo val6 = val5; PatchedPickupInfoInterop.SetPickupDropSource(ref val6, ((EntityState)droneScrappingToIdle).gameObject); PickupDropletController.CreatePickupDroplet(val6, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 4], w.Current); } } [MonoDetourTargets(typeof(RouletteChestController))] internal static class GambaChest { [CompilerGenerated] private static class <>O { public static Manipulator <0>__EjectPickupServer; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__EjectPickupServer; if (obj == null) { Manipulator val = EjectPickupServer; <>O.<0>__EjectPickupServer = val; obj = (object)val; } Mdh.RoR2.RouletteChestController.EjectPickupServer.ILHook((Manipulator)obj); } private static void EjectPickupServer(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(UniquePickup), ref val3); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[11] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(RouletteChestController rouletteChestController, UniquePickup pickup, Vector3 position, Vector3 velocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val4 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val4)).pickup = pickup; val4.position = position; val4.duplicated = false; val4.recycled = false; CreatePickupInfo val5 = val4; PatchedPickupInfoInterop.SetPickupDropSource(ref val5, ((Component)rouletteChestController).gameObject); PickupDropletController.CreatePickupDroplet(val5, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 3], w.Current); } } [MonoDetourTargets(typeof(HalcyoniteShrineInteractable))] internal static class HalcyonShrine { [CompilerGenerated] private static class <>O { public static Manipulator <0>__DropRewards; } private const int createPickupInfoVariableNumber = 9; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__DropRewards; if (obj == null) { Manipulator val = DropRewards; <>O.<0>__DropRewards = val; obj = (object)val; } Mdh.RoR2.HalcyoniteShrineInteractable.DropRewards.ILHook((Manipulator)obj); } private static void DropRewards(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchMultipleRelaxed((Action)delegate(ILWeaver val) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) val.InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, 9)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(val.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, HalcyoniteShrineInteractable halcyoniteShrineInteractable) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)halcyoniteShrineInteractable == (Object)null || (Object)(object)((Component)halcyoniteShrineInteractable).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)halcyoniteShrineInteractable).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Stloc, 9)) })); }, new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 9), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 4), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "position") && w.SetCurrentTo(x) }).ThrowIfFailure(); } } [MonoDetourTargets(typeof(PickupPickerController))] internal static class OptionsPickup { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ILHookThing; } private const int createPickupInfoVariableNumber = 1; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ILHookThing; if (obj == null) { Manipulator val = ILHookThing; <>O.<0>__ILHookThing = val; obj = (object)val; } CreatePickup_RoR2_UniquePickup.ILHook((Manipulator)obj); } private static void ILHookThing(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "chestGeneratedFrom"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "chest") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 1)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, PickupPickerController pickupPickerController) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pickupPickerController == (Object)null || (Object)(object)((Component)pickupPickerController).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)pickupPickerController).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 1)) })); } } [MonoDetourTargets(typeof(ScavBackpackBehavior))] internal static class ScavBackpack { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ItemDrop; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ItemDrop; if (obj == null) { Manipulator val = ItemDrop; <>O.<0>__ItemDrop = val; obj = (object)val; } Mdh.RoR2.ScavBackpackBehavior.ItemDrop.ILHook((Manipulator)obj); } private static void ItemDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(PickupIndex), ref val3); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[11] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(ShrineChanceBehavior chanceShrineBehavior, PickupIndex pickupIndex, Vector3 position, Vector3 velocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val4 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val4)).pickup = new UniquePickup { pickupIndex = pickupIndex }; val4.position = position; val4.duplicated = false; val4.recycled = false; CreatePickupInfo val5 = val4; PatchedPickupInfoInterop.SetPickupDropSource(ref val5, ((Component)chanceShrineBehavior).gameObject); PickupDropletController.CreatePickupDroplet(val5, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 3], w.Current); } } [MonoDetourTargets(typeof(ScrappingToIdle))] internal static class Scrapper { [CompilerGenerated] private static class <>O { public static Manipulator <0>__DroppingScrap; } private const int createPickupInfoVariableNumber = 2; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__DroppingScrap; if (obj == null) { Manipulator val = DroppingScrap; <>O.<0>__DroppingScrap = val; obj = (object)val; } Mdh.EntityStates.Scrapper.ScrappingToIdle.OnEnter.ILHook((Manipulator)obj); } private static void DroppingScrap(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.GenericPickupController/CreatePickupInfo", "set_pickup") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, ScrappingToIdle scrappingToIdle) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (scrappingToIdle == null || (Object)(object)((EntityState)scrappingToIdle).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((EntityState)scrappingToIdle).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 2)) })); } } [MonoDetourTargets(typeof(ShopTerminalBehavior))] internal static class ShopTerminalBehaviorSources { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ShopTerminalDrop; } [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ShopTerminalDrop; if (obj == null) { Manipulator val = ShopTerminalDrop; <>O.<0>__ShopTerminalDrop = val; obj = (object)val; } DropPickup_System_Boolean.ILHook((Manipulator)obj); } private static void ShopTerminalDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(bool), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val3); VariableDefinition val4 = default(VariableDefinition); w.DeclareVariable(typeof(UniquePickup), ref val4); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[14] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(ShopTerminalBehavior shopTerminalBehavior, UniquePickup pickup, Vector3 position, Vector3 velocity, bool isDuplicated) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val5 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val5)).pickup = pickup; val5.position = position; val5.duplicated = isDuplicated; val5.recycled = false; CreatePickupInfo val6 = val5; PatchedPickupInfoInterop.SetPickupDropSource(ref val6, ((Component)shopTerminalBehavior).gameObject); PickupDropletController.CreatePickupDroplet(val6, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 4], w.Current); } } [MonoDetourTargets(typeof(PickupDistributorBehavior))] internal static class TempItemDistributor { [CompilerGenerated] private static class <>O { public static Manipulator <0>__TempItemDrop; } private const int createPickupInfoVariableNumber = 4; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__TempItemDrop; if (obj == null) { Manipulator val = TempItemDrop; <>O.<0>__TempItemDrop = val; obj = (object)val; } Drop.ILHook((Manipulator)obj); } private static void TempItemDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_position"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "position") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, PickupDistributorBehavior pickupDistributorBehavior) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pickupDistributorBehavior == (Object)null || (Object)(object)((Component)pickupDistributorBehavior).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)pickupDistributorBehavior).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 4)) })); } } [MonoDetourTargets(typeof(ArenaMissionController))] internal static class VoidFieldsCellCompletion { [CompilerGenerated] private static class <>O { public static Manipulator <0>__EndRound; } private const int createPickupInfoVariableNumber = 13; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__EndRound; if (obj == null) { Manipulator val = EndRound; <>O.<0>__EndRound = val; obj = (object)val; } Mdh.RoR2.ArenaMissionController.EndRound.ILHook((Manipulator)obj); } private static void EndRound(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 13), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "pickupPrefab"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "prefabOverride") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 13)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, ArenaMissionController arenaMissionController) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)arenaMissionController == (Object)null || (Object)(object)arenaMissionController.rewardSpawnPosition == (Object)null) { return createPickupInfo; } Transform transform = arenaMissionController.rewardSpawnPosition.transform; object obj; if (transform == null) { obj = null; } else { Transform parent = transform.parent; if (parent == null) { obj = null; } else { Transform parent2 = parent.parent; obj = ((parent2 != null) ? ((Component)parent2).gameObject : null); } } GameObject val = (GameObject)obj; if ((Object)(object)val == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, val); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 13)) })); } } [MonoDetourTargets(typeof(OptionChestBehavior))] internal static class VoidPotential { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ItemDrop; } private const int createPickupInfoVariableNumber = 0; [MonoDetourHookInitialize] private static void Setup() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ItemDrop; if (obj == null) { Manipulator val = ItemDrop; <>O.<0>__ItemDrop = val; obj = (object)val; } Mdh.RoR2.OptionChestBehavior.ItemDrop.ILHook((Manipulator)obj); } private static void ItemDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "pickupPrefab"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "prefabOverride") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, OptionChestBehavior optionChestBehavior) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)optionChestBehavior == (Object)null || (Object)(object)((Component)optionChestBehavior).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)optionChestBehavior).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, 0)) })); } } } namespace DropSourceForItems.Modded { [MonoDetourTargets(typeof(LynxTribeShrine))] internal static class LynxTotem { [CompilerGenerated] private static class <>O { public static Manipulator <0>__DropItems; } [MonoDetourHookInitialize] private static void Setup() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (EnemiesReturnsMod.ModIsRunning) { object obj = <>O.<0>__DropItems; if (obj == null) { Manipulator val = DropItems; <>O.<0>__DropItems = val; obj = (object)val; } Mdh.EnemiesReturns.Enemies.LynxTribe.LynxTribeShrine.DropItems.ILHook((Manipulator)obj); } } private static void DropItems(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); VariableDefinition val = default(VariableDefinition); w.DeclareVariable(typeof(bool), ref val); VariableDefinition val2 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); w.DeclareVariable(typeof(Vector3), ref val3); VariableDefinition val4 = default(VariableDefinition); w.DeclareVariable(typeof(UniquePickup), ref val4); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[14] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(LynxTribeShrine lynxTribeShrine, UniquePickup pickup, Vector3 position, Vector3 velocity, bool isDuplicated) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val5 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val5)).pickup = pickup; val5.position = position; val5.duplicated = isDuplicated; val5.recycled = false; CreatePickupInfo val6 = val5; PatchedPickupInfoInterop.SetPickupDropSource(ref val6, ((Component)lynxTribeShrine).gameObject); PickupDropletController.CreatePickupDroplet(val6, position, velocity); })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, val)) })) .InsertBranchOver(w.Instructions[w.Index - 4], w.Current); } } [MonoDetourTargets(typeof(ShrineCombatItems))] internal static class RiskyTweaksCombatShrine { [CompilerGenerated] private static class <>O { public static Manipulator <0>__OnDefeated; } [MonoDetourHookInitialize] private static void Setup() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (RiskyTweaksMod.ModIsRunning) { object obj = <>O.<0>__OnDefeated; if (obj == null) { Manipulator val = OnDefeated; <>O.<0>__OnDefeated = val; obj = (object)val; } ShrineCombatBehavior_OnDefeatedServer.ILHook((Manipulator)obj); } } private static void OnDefeated(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); bool matchedFirst = false; w.MatchMultipleRelaxed((Action)delegate(ILWeaver val) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) if (!matchedFirst) { matchedFirst = true; VariableDefinition val2 = default(VariableDefinition); val.DeclareVariable(typeof(Vector3), ref val2); VariableDefinition val3 = default(VariableDefinition); val.DeclareVariable(typeof(Vector3), ref val3); VariableDefinition val4 = default(VariableDefinition); val.DeclareVariable(typeof(PickupIndex), ref val4); val.InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[11] { InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Stloc, val2)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Stloc, val3)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Stloc, val4)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldarg_2)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val2)), InstructionOrEnumerable.op_Implicit(val.CreateDelegateCall>((Action)delegate(ShrineCombatBehavior shrineCombatBehavior, PickupIndex pickupIndex, Vector3 position, Vector3 velocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val5 = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val5)).pickup = new UniquePickup { pickupIndex = pickupIndex }; val5.position = position; val5.duplicated = false; val5.recycled = false; CreatePickupInfo val6 = val5; PatchedPickupInfoInterop.SetPickupDropSource(ref val6, ((Component)shrineCombatBehavior).gameObject); PickupDropletController.CreatePickupDroplet(val6, position, velocity); })), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val4)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val3)), InstructionOrEnumerable.op_Implicit(val.Create(OpCodes.Ldloc, val2)) })).InsertBranchOver(val.Instructions[val.Index - 3], val.Current); } }, new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") && w.SetCurrentTo(x) }).ThrowIfFailure(); int createPickupInfoVariableNumber = 22; w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, createPickupInfoVariableNumber), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_identity"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.GenericPickupController/CreatePickupInfo", "rotation") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, createPickupInfoVariableNumber)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_2)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CreatePickupInfo createPickupInfo, ShrineCombatBehavior shrineCombatBehavior) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)shrineCombatBehavior == (Object)null || (Object)(object)((Component)shrineCombatBehavior).gameObject == (Object)null) { return createPickupInfo; } PatchedPickupInfoInterop.SetPickupDropSource(ref createPickupInfo, ((Component)shrineCombatBehavior).gameObject); return createPickupInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc, createPickupInfoVariableNumber)) })); } } } namespace DropSourceForItems.Modded.ModSupport { internal static class EnemiesReturnsMod { private static bool? _modexists; internal static bool ModIsRunning { get { bool valueOrDefault = _modexists == true; if (!_modexists.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.Viliger.EnemiesReturns"); _modexists = valueOrDefault; } return _modexists.Value; } } } internal static class RiskyTweaksMod { internal const string GUID = "com.Moffein.RiskyTweaks"; private static bool? _modexists; internal static bool ModIsRunning { get { bool valueOrDefault = _modexists == true; if (!_modexists.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.Moffein.RiskyTweaks"); _modexists = valueOrDefault; } return _modexists.Value; } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }