using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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 EntityStates; using EntityStates.Barrel; using HG.Reflection; using IL.RoR2; using IL.RoR2.UI; using ItemQualities; using ItemQualities.Items; using Logger; using Md.ItemQualities.Items.LowerPricedChests; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.Barrel; using On.RoR2; using On.RoR2.Items; using R2API; using R2API.Models; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.ContentManagement; using RoR2.Items; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RetroactiveMacro")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0e2ae1a74c96c43153fbe37e93c845bf84f13eb1")] [assembly: AssemblyProduct("RetroactiveMacro")] [assembly: AssemblyTitle("RetroactiveMacro")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } 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 Md.ItemQualities.Items.LowerPricedChests { 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "Init"); } return method; } } internal static class CharacterMaster_TrySaleStar { public delegate void PrefixSignature(ref orig_TrySaleStar orig, ref CharacterMaster self1); public delegate void PostfixSignature(ref orig_TrySaleStar orig, ref CharacterMaster 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("CharacterMaster_TrySaleStar", (BindingFlags)(-1), null, new Type[2] { typeof(orig_TrySaleStar), typeof(CharacterMaster) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "CharacterMaster_TrySaleStar"); } return method; } } internal static class PurchaseInteraction_OnInteractionBegin { public delegate void PrefixSignature(ref ILContext il); public delegate void PostfixSignature(ref ILContext il); 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("PurchaseInteraction_OnInteractionBegin", (BindingFlags)(-1), null, new Type[1] { typeof(ILContext) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "PurchaseInteraction_OnInteractionBegin"); } return method; } } internal static class generateQualityDropTiersFromSaleStars { public delegate void PrefixSignature(ref GameObject purchasedObject, ref int dropCount, ref bool useFirstInteractionCost, ref Xoroshiro128Plus rng); public delegate void PostfixSignature(ref GameObject purchasedObject, ref int dropCount, ref bool useFirstInteractionCost, ref Xoroshiro128Plus rng, ref QualityTier[] 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("generateQualityDropTiersFromSaleStars", (BindingFlags)(-1), null, new Type[4] { typeof(GameObject), typeof(int), typeof(bool), typeof(Xoroshiro128Plus) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "generateQualityDropTiersFromSaleStars"); } return method; } } internal static class tryUpgradePickupQualityFromSaleStars { public delegate void PrefixSignature(ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex); public delegate void PostfixSignature(ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex, ref UniquePickup 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("tryUpgradePickupQualityFromSaleStars", (BindingFlags)(-1), null, new Type[3] { typeof(UniquePickup), typeof(QualityTier[]), typeof(int).MakeByRefType() }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "tryUpgradePickupQualityFromSaleStars"); } return method; } } internal static class ChestBehavior_BaseItemDrop { public delegate void PrefixSignature(ref ILContext il); public delegate void PostfixSignature(ref ILContext il); 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("ChestBehavior_BaseItemDrop", (BindingFlags)(-1), null, new Type[1] { typeof(ILContext) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "ChestBehavior_BaseItemDrop"); } return method; } } internal static class RouletteChestController_EjectPickupServer { public delegate void PrefixSignature(ref ILContext il); public delegate void PostfixSignature(ref ILContext il); 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("RouletteChestController_EjectPickupServer", (BindingFlags)(-1), null, new Type[1] { typeof(ILContext) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "RouletteChestController_EjectPickupServer"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_g__consumeQualitySaleStars_3_0 { public delegate void PrefixSignature(ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState); public delegate void PostfixSignature(ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState, ref bool 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("g__consumeQualitySaleStars|3_0", (BindingFlags)(-1), null, new Type[5] { typeof(bool), typeof(Interactor), typeof(ItemTransformation).MakeByRefType(), typeof(TryTransformResult).MakeByRefType(), typeof(QualitySaleStarState) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "g__consumeQualitySaleStars|3_0"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_g__addStackValues_3_8 { public delegate void PrefixSignature(ref ItemStackValues a, ref ItemStackValues b); public delegate void PostfixSignature(ref ItemStackValues a, ref ItemStackValues b); 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("g__addStackValues|3_8", (BindingFlags)(-1), null, new Type[2] { typeof(ItemStackValues).MakeByRefType(), typeof(ItemStackValues).MakeByRefType() }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "g__addStackValues|3_8"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_g__onPayCost_3_1 { public delegate void PrefixSignature(ref PayCostResults results, ref QualitySaleStarState saleStarState); public delegate void PostfixSignature(ref PayCostResults results, ref QualitySaleStarState saleStarState); 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("g__onPayCost|3_1", (BindingFlags)(-1), null, new Type[2] { typeof(PayCostResults), typeof(QualitySaleStarState) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "g__onPayCost|3_1"); } return method; } } internal static class _ChestBehavior_BaseItemDrop_g__getUpgradeQualityTiers_8_0 { public delegate void PrefixSignature(ref ChestBehavior chestBehavior); public delegate void PostfixSignature(ref ChestBehavior chestBehavior, ref QualityTier[] 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("g__getUpgradeQualityTiers|8_0", (BindingFlags)(-1), null, new Type[1] { typeof(ChestBehavior) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "g__getUpgradeQualityTiers|8_0"); } return method; } } internal static class _RouletteChestController_EjectPickupServer_g__getUpgradeQualityTiers_9_0 { public delegate void PrefixSignature(ref RouletteChestController rouletteChestController); public delegate void PostfixSignature(ref RouletteChestController rouletteChestController, ref QualityTier[] 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(LowerPricedChests); MethodInfo method = typeFromHandle.GetMethod("g__getUpgradeQualityTiers|9_0", (BindingFlags)(-1), null, new Type[1] { typeof(RouletteChestController) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests", "g__getUpgradeQualityTiers|9_0"); } return method; } } internal static class QualitySaleStarState { internal static class _ctor { public delegate void PrefixSignature(QualitySaleStarState self); public delegate void PostfixSignature(QualitySaleStarState 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(QualitySaleStarState); ConstructorInfo constructor = typeFromHandle.GetConstructor((BindingFlags)(-1), null, Array.Empty(), null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+QualitySaleStarState", ".ctor"); } return constructor; } } } internal static class ConsumeQualitySaleStarsDelegate { internal static class _ctor { public delegate void PrefixSignature(ConsumeQualitySaleStarsDelegate self, ref object @object, ref IntPtr method); public delegate void PostfixSignature(ConsumeQualitySaleStarsDelegate self, ref object @object, ref IntPtr method); 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(ConsumeQualitySaleStarsDelegate); ConstructorInfo constructor = typeFromHandle.GetConstructor((BindingFlags)(-1), null, new Type[2] { typeof(object), typeof(IntPtr) }, null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+ConsumeQualitySaleStarsDelegate", ".ctor"); } return constructor; } } internal static class Invoke { public delegate void PrefixSignature(ConsumeQualitySaleStarsDelegate self, ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState); public delegate void PostfixSignature(ConsumeQualitySaleStarsDelegate self, ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState, ref bool 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(ConsumeQualitySaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("Invoke", (BindingFlags)(-1), null, new Type[5] { typeof(bool), typeof(Interactor), typeof(ItemTransformation).MakeByRefType(), typeof(TryTransformResult).MakeByRefType(), typeof(QualitySaleStarState) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+ConsumeQualitySaleStarsDelegate", "Invoke"); } return method; } } internal static class BeginInvoke { public delegate void PrefixSignature(ConsumeQualitySaleStarsDelegate self, ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState, ref AsyncCallback callback, ref object @object); public delegate void PostfixSignature(ConsumeQualitySaleStarsDelegate self, ref bool result, ref Interactor activator, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref QualitySaleStarState saleStarState, ref AsyncCallback callback, ref object @object, ref IAsyncResult 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(ConsumeQualitySaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("BeginInvoke", (BindingFlags)(-1), null, new Type[7] { typeof(bool), typeof(Interactor), typeof(ItemTransformation).MakeByRefType(), typeof(TryTransformResult).MakeByRefType(), typeof(QualitySaleStarState), typeof(AsyncCallback), typeof(object) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+ConsumeQualitySaleStarsDelegate", "BeginInvoke"); } return method; } } internal static class EndInvoke { public delegate void PrefixSignature(ConsumeQualitySaleStarsDelegate self, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref IAsyncResult result); public delegate void PostfixSignature(ConsumeQualitySaleStarsDelegate self, ref ItemTransformation itemTransformation, ref TryTransformResult consumeTransformResult, ref IAsyncResult result, ref bool 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(ConsumeQualitySaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("EndInvoke", (BindingFlags)(-1), null, new Type[3] { typeof(ItemTransformation).MakeByRefType(), typeof(TryTransformResult).MakeByRefType(), typeof(IAsyncResult) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+ConsumeQualitySaleStarsDelegate", "EndInvoke"); } return method; } } } internal static class TryUpgradePickupQualityFromSaleStarsDelegate { internal static class _ctor { public delegate void PrefixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref object @object, ref IntPtr method); public delegate void PostfixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref object @object, ref IntPtr method); 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(TryUpgradePickupQualityFromSaleStarsDelegate); ConstructorInfo constructor = typeFromHandle.GetConstructor((BindingFlags)(-1), null, new Type[2] { typeof(object), typeof(IntPtr) }, null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+TryUpgradePickupQualityFromSaleStarsDelegate", ".ctor"); } return constructor; } } internal static class Invoke { public delegate void PrefixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex); public delegate void PostfixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex, ref UniquePickup 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(TryUpgradePickupQualityFromSaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("Invoke", (BindingFlags)(-1), null, new Type[3] { typeof(UniquePickup), typeof(QualityTier[]), typeof(int).MakeByRefType() }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+TryUpgradePickupQualityFromSaleStarsDelegate", "Invoke"); } return method; } } internal static class BeginInvoke { public delegate void PrefixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex, ref AsyncCallback callback, ref object @object); public delegate void PostfixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex, ref AsyncCallback callback, ref object @object, ref IAsyncResult 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(TryUpgradePickupQualityFromSaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("BeginInvoke", (BindingFlags)(-1), null, new Type[5] { typeof(UniquePickup), typeof(QualityTier[]), typeof(int).MakeByRefType(), typeof(AsyncCallback), typeof(object) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+TryUpgradePickupQualityFromSaleStarsDelegate", "BeginInvoke"); } return method; } } internal static class EndInvoke { public delegate void PrefixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref int pickupSequenceIndex, ref IAsyncResult result); public delegate void PostfixSignature(TryUpgradePickupQualityFromSaleStarsDelegate self, ref int pickupSequenceIndex, ref IAsyncResult result, ref UniquePickup 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(TryUpgradePickupQualityFromSaleStarsDelegate); MethodInfo method = typeFromHandle.GetMethod("EndInvoke", (BindingFlags)(-1), null, new Type[2] { typeof(int).MakeByRefType(), typeof(IAsyncResult) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+TryUpgradePickupQualityFromSaleStarsDelegate", "EndInvoke"); } return method; } } } internal static class __c__DisplayClass3_0 { internal static class _ctor { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0'"); } ConstructorInfo constructor = type.GetConstructor((BindingFlags)(-1), null, Array.Empty(), null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0", ".ctor"); } return constructor; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__3 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0'"); } MethodInfo method = type.GetMethod("b__3", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0", "b__3"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__4 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0'"); } MethodInfo method = type.GetMethod("b__4", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0", "b__4"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__6 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0'"); } MethodInfo method = type.GetMethod("b__6", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass3_0", "b__6"); } return method; } } } internal static class __c { internal static class _cctor { 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } ConstructorInfo constructor = type.GetConstructor((BindingFlags)(-1), null, Array.Empty(), null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", ".cctor"); } return constructor; } } internal static class _ctor { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } ConstructorInfo constructor = type.GetConstructor((BindingFlags)(-1), null, Array.Empty(), null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", ".ctor"); } return constructor; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__3_2 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__3_2", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__3_2"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__3_5 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__3_5", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__3_5"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__3_7 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__3_7", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__3_7"); } return method; } } internal static class _PurchaseInteraction_OnInteractionBegin_b__3_9 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__3_9", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__3_9"); } return method; } } internal static class _ChestBehavior_BaseItemDrop_b__8_1 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__8_1", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__8_1"); } return method; } } internal static class _ChestBehavior_BaseItemDrop_b__8_2 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__8_2", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__8_2"); } return method; } } internal static class _RouletteChestController_EjectPickupServer_b__9_1 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c'"); } MethodInfo method = type.GetMethod("b__9_1", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c", "b__9_1"); } return method; } } } internal static class __c__DisplayClass9_0 { internal static class _ctor { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0'"); } ConstructorInfo constructor = type.GetConstructor((BindingFlags)(-1), null, Array.Empty(), null); if ((object)constructor == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0", ".ctor"); } return constructor; } } internal static class _RouletteChestController_EjectPickupServer_b__2 { public delegate void PrefixSignature(object self, ref Instruction x); public delegate void PostfixSignature(object self, ref Instruction x, ref bool 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 type = Type.GetType("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0, ItemQualities"); if ((object)type == null) { throw new Exception("Missing Type: 'ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0'"); } MethodInfo method = type.GetMethod("b__2", (BindingFlags)(-1), null, new Type[1] { typeof(Instruction) }, null); if ((object)method == null) { throw new MissingMethodException("ItemQualities.Items.LowerPricedChests+<>c__DisplayClass9_0", "b__2"); } 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 Logger { internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void message(object data) { _logSource.LogInfo(data); if (data != null) { Chat.AddMessage(data.ToString()); } else { Chat.AddMessage("Null"); } } internal static void Debug(object data) { _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) { message(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace RetroactiveMacro { public static class Card { [CompilerGenerated] private static class <>O { public static hook_SetEquipmentInternal_EquipmentState_uint_uint <0>__SetEquipment; public static hook_OnEnter <1>__GenericCharacterDeath_OnEnter; public static hook_UpdatePickupDisplayAndAnimations <2>__UpdatePickupDisplayAndAnimations; public static hook_TryReviveOnBodyDeath <3>__TryReviveOnBodyDeath; public static hook_OnPurchase <4>__OnPurchase; public static Action <5>__PrePopulateSceneServer; } private static bool _onCooldown; [SystemInitializer(new Type[] { })] private static void Init() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) if (RetroactiveMacro.ChangeCard.Value) { object obj = <>O.<0>__SetEquipment; if (obj == null) { hook_SetEquipmentInternal_EquipmentState_uint_uint val = SetEquipment; <>O.<0>__SetEquipment = val; obj = (object)val; } Inventory.SetEquipmentInternal_EquipmentState_uint_uint += (hook_SetEquipmentInternal_EquipmentState_uint_uint)obj; object obj2 = <>O.<1>__GenericCharacterDeath_OnEnter; if (obj2 == null) { hook_OnEnter val2 = GenericCharacterDeath_OnEnter; <>O.<1>__GenericCharacterDeath_OnEnter = val2; obj2 = (object)val2; } GenericCharacterDeath.OnEnter += (hook_OnEnter)obj2; object obj3 = <>O.<2>__UpdatePickupDisplayAndAnimations; if (obj3 == null) { hook_UpdatePickupDisplayAndAnimations val3 = UpdatePickupDisplayAndAnimations; <>O.<2>__UpdatePickupDisplayAndAnimations = val3; obj3 = (object)val3; } ShopTerminalBehavior.UpdatePickupDisplayAndAnimations += (hook_UpdatePickupDisplayAndAnimations)obj3; object obj4 = <>O.<3>__TryReviveOnBodyDeath; if (obj4 == null) { hook_TryReviveOnBodyDeath val4 = TryReviveOnBodyDeath; <>O.<3>__TryReviveOnBodyDeath = val4; obj4 = (object)val4; } CharacterMaster.TryReviveOnBodyDeath += (hook_TryReviveOnBodyDeath)obj4; object obj5 = <>O.<4>__OnPurchase; if (obj5 == null) { hook_OnPurchase val5 = OnPurchase; <>O.<4>__OnPurchase = val5; obj5 = (object)val5; } MultiShopCardUtils.OnPurchase += (hook_OnPurchase)obj5; SceneDirector.onPrePopulateSceneServer += PrePopulateSceneServer; AsyncOperationHandle val6 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_TripleShop.TripleShop_prefab), (AsyncReferenceHandleUnloadType)2); val6.Completed += delegate(AsyncOperationHandle x) { x.Result.AddComponent(); }; val6 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_TripleShopEquipment.TripleShopEquipment_prefab), (AsyncReferenceHandleUnloadType)2); val6.Completed += delegate(AsyncOperationHandle x) { x.Result.AddComponent(); }; val6 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_TripleShopLarge.TripleShopLarge_prefab), (AsyncReferenceHandleUnloadType)2); val6.Completed += delegate(AsyncOperationHandle x) { x.Result.AddComponent(); }; val6 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_DLC1_FreeChestMultiShop.FreeChestMultiShop_prefab), (AsyncReferenceHandleUnloadType)2); val6.Completed += delegate(AsyncOperationHandle x) { x.Result.AddComponent(); }; val6 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_DLC3_TripleDroneShop.TripleDroneShop_prefab), (AsyncReferenceHandleUnloadType)2); val6.Completed += delegate(AsyncOperationHandle x) { x.Result.AddComponent(); }; } } private static void OnPurchase(orig_OnPurchase orig, PayCostContext context, int moneyCost) { _onCooldown = true; ((MonoBehaviour)RetroactiveMacro.Instance).StartCoroutine(UsedCard()); orig.Invoke(context, moneyCost); } private static IEnumerator UsedCard() { yield return (object)new WaitForSeconds(0.5f); _onCooldown = false; if (!PlayerTeamHasEquipment(Equipment.MultiShopCard.equipmentIndex)) { HasNoCard(); } } private static void PrePopulateSceneServer(SceneDirector director) { MultiShopController val = default(MultiShopController); DroneVendorMultiShopController val2 = default(DroneVendorMultiShopController); foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList()) { Transform parent = ((Component)instances).transform.parent; if (Object.op_Implicit((Object)(object)parent)) { if (((Component)parent).TryGetComponent(ref val)) { ((Component)parent).gameObject.AddComponent(); } if (((Component)parent).TryGetComponent(ref val2)) { ((Component)parent).gameObject.AddComponent(); } } } } private static bool TryReviveOnBodyDeath(orig_TryReviveOnBodyDeath orig, CharacterMaster self, CharacterBody body) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) bool flag = orig.Invoke(self, body); if (flag && PlayerTeamHasEquipment(Equipment.MultiShopCard.equipmentIndex)) { HasCard(); } return flag; } private static void UpdatePickupDisplayAndAnimations(orig_UpdatePickupDisplayAndAnimations orig, ShopTerminalBehavior self) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self.hasStarted && Object.op_Implicit((Object)(object)self.animator) && !self.hasBeenPurchased && self.pickup != UniquePickup.none) { int layerIndex = self.animator.GetLayerIndex("Body"); self.animator.PlayInFixedTime("Reopen", layerIndex); } } private static bool SetEquipment(orig_SetEquipmentInternal_EquipmentState_uint_uint orig, Inventory self, EquipmentState equipmentState, uint slot, uint set) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, equipmentState, slot, set); if (PlayerTeamHasEquipment(Equipment.MultiShopCard.equipmentIndex)) { HasCard(); } else { HasNoCard(); } return result; } private static void GenericCharacterDeath_OnEnter(orig_OnEnter orig, GenericCharacterDeath self) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self.isPlayerDeath && !PlayerTeamHasEquipment(Equipment.MultiShopCard.equipmentIndex)) { HasNoCard(); } } private static bool PlayerTeamHasEquipment(EquipmentIndex equipment) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (_onCooldown) { return true; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && instance.isConnected && instance.master.hasBody && Object.op_Implicit((Object)(object)instance.master.GetBody().healthComponent) && instance.master.GetBody().healthComponent.alive && HasEquipment(instance.master.inventory, equipment)) { return true; } } return false; } private static bool HasEquipment(Inventory inventory, EquipmentIndex equipment) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_001a: 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) for (uint num = 0u; num < inventory.GetEquipmentSlotCount(); num++) { for (uint num2 = 0u; num2 < inventory.GetEquipmentSetCount(num); num2++) { EquipmentState equipment2 = inventory.GetEquipment(num, num2); if (equipment2.equipmentIndex == equipment && equipment2.charges > 0) { return true; } } } return false; } private static void HasNoCard() { ShopTerminalBehavior val = default(ShopTerminalBehavior); foreach (MacroCardItemHandler instances in InstanceTracker.GetInstancesList()) { if (!instances.recoveredShop) { continue; } GameObject[] terminalGameObjects = instances.multiShopController.terminalGameObjects; for (int i = 0; i < terminalGameObjects.Length; i++) { if (terminalGameObjects[i].TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.animator) && !val.hasBeenPurchased) { instances.multiShopController.available = false; terminalGameObjects[i].GetComponent().available = false; val.SetNoPickup(); } } } foreach (MacroCardDroneHandler instances2 in InstanceTracker.GetInstancesList()) { if (!instances2.recoveredShop) { continue; } DroneVendorTerminalBehavior[] terminals = instances2.multiShopController._terminals; for (int j = 0; j < terminals.Length; j++) { if (!terminals[j].hasBeenPurchased) { instances2.multiShopController.available = false; terminals[j].purchaseInteraction.available = false; terminals[j].SetNoPickup(); } } } } private static void HasCard() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) ShopTerminalBehavior val = default(ShopTerminalBehavior); foreach (MacroCardItemHandler instances in InstanceTracker.GetInstancesList()) { GameObject[] terminalGameObjects = instances.multiShopController.terminalGameObjects; for (int i = 0; i < terminalGameObjects.Length; i++) { if (terminalGameObjects[i].TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.animator) && !val.hasBeenPurchased && !terminalGameObjects[i].GetComponent().available) { instances.recoveredShop = true; instances.multiShopController.available = true; terminalGameObjects[i].GetComponent().available = true; Util.PlaySound("Play_UI_tripleChestShutter", ((Component)val).gameObject); if (NetworkServer.active) { val.SetPickup(instances.savedPickups[i], instances.hidden[i]); val.UpdatePickupDisplayAndAnimations(); } } } } foreach (MacroCardDroneHandler instances2 in InstanceTracker.GetInstancesList()) { DroneVendorTerminalBehavior[] terminals = instances2.multiShopController._terminals; for (int j = 0; j < terminals.Length; j++) { if (!terminals[j].hasBeenPurchased && !terminals[j].purchaseInteraction.available) { instances2.recoveredShop = true; if (((Component)terminals[j]).GetComponent().state is Idle) { instances2.multiShopController.available = true; } ((Component)terminals[j]).GetComponent().available = true; terminals[j].SetPickup(instances2.savedPickups[j], false); } } } } } public class MacroCardItemHandler : MonoBehaviour { public MultiShopController multiShopController; public UniquePickup[] savedPickups; public bool[] hidden; public bool recoveredShop; private void Awake() { multiShopController = ((Component)this).GetComponent(); } private void OnPurchase(PayCostContext arg0, PayCostResults arg1) { bool[] doCloseOnTerminalPurchase = multiShopController.doCloseOnTerminalPurchase; foreach (bool flag in doCloseOnTerminalPurchase) { recoveredShop &= !flag; } } private void Start() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) savedPickups = (UniquePickup[])(object)new UniquePickup[multiShopController.terminalGameObjects.Length]; hidden = new bool[multiShopController.terminalGameObjects.Length]; ShopTerminalBehavior val2 = default(ShopTerminalBehavior); PurchaseInteraction val3 = default(PurchaseInteraction); for (int i = 0; i < multiShopController.terminalGameObjects.Length; i++) { GameObject val = multiShopController.terminalGameObjects[i]; if (val.TryGetComponent(ref val2)) { savedPickups[i] = val2.pickup; hidden[i] = val2.hidden; } if (val.TryGetComponent(ref val3)) { ((UnityEvent)(object)val3.onDetailedPurchaseServer).AddListener((UnityAction)OnPurchase); } } } private void OnEnable() { InstanceTracker.Add(this); } private void OnDisable() { InstanceTracker.Remove(this); } } public class MacroCardDroneHandler : MonoBehaviour { public DroneVendorMultiShopController multiShopController; public UniquePickup[] savedPickups; public bool recoveredShop; private void Awake() { multiShopController = ((Component)this).GetComponent(); } private void OnPurchase(PayCostContext arg0, PayCostResults arg1) { bool[] doCloseOnTerminalPurchase = multiShopController.doCloseOnTerminalPurchase; foreach (bool flag in doCloseOnTerminalPurchase) { recoveredShop &= !flag; } } private void Start() { //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) savedPickups = (UniquePickup[])(object)new UniquePickup[multiShopController._terminals.Length]; for (int i = 0; i < multiShopController._terminals.Length; i++) { DroneVendorTerminalBehavior val = multiShopController._terminals[i]; savedPickups[i] = val.currentPickup; ((UnityEvent)(object)val.purchaseInteraction.onDetailedPurchaseServer).AddListener((UnityAction)OnPurchase); } } private void OnEnable() { InstanceTracker.Add(this); } private void OnDisable() { InstanceTracker.Remove(this); } } internal static class Options { public static bool IsEnabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static void Init() { RetroactiveMacro.ChangeSaleStar = ((BaseUnityPlugin)RetroactiveMacro.Instance).Config.Bind("General", "Change Sale Star", true, "Reopen chests instead"); RetroactiveMacro.ChangeCard = ((BaseUnityPlugin)RetroactiveMacro.Instance).Config.Bind("General", "Change Credit Card", true, "While holding the card, reopen all closed multishops"); if (IsEnabled) { RiskOfOptionsConfig(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RiskOfOptionsConfig() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RetroactiveMacro.ChangeSaleStar, true), "Onyx.RetroactiveMacro", "RetroactiveMacro"); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RetroactiveMacro.ChangeCard), "Onyx.RetroactiveMacro", "RetroactiveMacro"); ModSettingsManager.SetModDescription("Options for RetroactiveMacro", "Onyx.RetroactiveMacro", "RetroactiveMacro"); FileInfo fileInfo = null; DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); do { FileInfo[] files = directoryInfo.GetFiles("icon.png", SearchOption.TopDirectoryOnly); if (files != null && files.Length != 0) { fileInfo = files[0]; break; } directoryInfo = directoryInfo.Parent; } while (directoryInfo != null && directoryInfo.Exists && !string.Equals(directoryInfo.Name, "plugins", StringComparison.OrdinalIgnoreCase)); if (fileInfo != null) { Texture2D val = new Texture2D(256, 256); if (ImageConversion.LoadImage(val, File.ReadAllBytes(fileInfo.FullName))) { Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); ((Object)val2).name = "RetroactiveMacroIcon"; ModSettingsManager.SetModIcon(val2, "Onyx.RetroactiveMacro", "RetroactiveMacro"); } } } } [BepInPlugin("Onyx.RetroactiveMacro", "RetroactiveMacro", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class RetroactiveMacro : BaseUnityPlugin { public const string PluginGUID = "Onyx.RetroactiveMacro"; public const string PluginAuthor = "Onyx"; public const string PluginName = "RetroactiveMacro"; public const string PluginVersion = "1.0.0"; public static RetroactiveMacro Instance; public static AssetBundle Bundle; public static ConfigEntry ChangeSaleStar { get; set; } public static ConfigEntry ChangeCard { get; set; } public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "bundle.bundle"); public void Awake() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) Log.Init(((BaseUnityPlugin)this).Logger); BepInPlugin bepInPlugin = new BepInPlugin("Onyx.RetroactiveMacro", "RetroactiveMacro", "1.0.0"); Instance = SingletonHelper.Assign(Instance, this); Options.Init(); MonoDetourManager.InvokeHookInitializers(Assembly.GetExecutingAssembly()); Bundle = AssetBundle.LoadFromFile(AssetBundlePath); bool flag = default(bool); ContentAddition.AddEntityState(ref flag); AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_MultiShopTerminal.animMultiShopTerminal_controller), (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle controller) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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) AnimatorDiff val2 = Bundle.LoadAsset("Assets/Animations/MultiShop/Reopen.controllerdiff"); AnimatorModifications val3 = AnimatorModifications.CreateFromDiff(val2, bepInPlugin); AnimationsAPI.AddModifications(GetBundlePath("ror2-base-multishopterminal_assets_all_e550cfc9295bb6ea35be13bc7fc042d2"), controller.Result, val3); AsyncOperationHandle val4 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_MultiShopTerminal.MultiShopTerminal_prefab), (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle prefab) { Transform val5 = prefab.Result.transform.Find("Display/mdlMultiShopTerminal"); AnimationsAPI.AddAnimatorController(((Component)val5).GetComponent(), controller.Result); }; val4 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_MultiShopEquipmentTerminal.MultiShopEquipmentTerminal_prefab), (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle prefab) { Transform val5 = prefab.Result.transform.Find("Display/mdlMultiShopTerminal"); AnimationsAPI.AddAnimatorController(((Component)val5).GetComponent(), controller.Result); }; val4 = AssetAsyncReferenceManager.LoadAsset(new AssetReferenceT(RoR2_Base_MultiShopLargeTerminal.MultiShopLargeTerminal_prefab), (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle prefab) { Transform val5 = prefab.Result.transform.Find("Display/mdlMultiShopTerminal"); AnimationsAPI.AddAnimatorController(((Component)val5).GetComponent(), controller.Result); }; }; } public static string GetBundlePath(string bundleName) { return Path.Combine(Addressables.RuntimePath, "StandaloneWindows64", bundleName + ".bundle"); } } public static class SaleStar { [CompilerGenerated] private static class <>O { public static hook_OnEnter <0>__Opened_OnEnter; public static Manipulator <1>__InteractionDriver_MyFixedUpdate; public static Manipulator <2>__PurchaseInteraction_OnInteractionBegin; public static Manipulator <3>__PingIndicator_Update; public static Action <4>__BeginExit; public static Func <5>__SaleStarChestPingable; public static Func <6>__checkReopen; public static Func <7>__checkReopen; } [SystemInitializer(new Type[] { })] private static void Init() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00b4: 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_00bf: Expected O, but got Unknown if (RetroactiveMacro.ChangeSaleStar.Value) { object obj = <>O.<0>__Opened_OnEnter; if (obj == null) { hook_OnEnter val = Opened_OnEnter; <>O.<0>__Opened_OnEnter = val; obj = (object)val; } Opened.OnEnter += (hook_OnEnter)obj; object obj2 = <>O.<1>__InteractionDriver_MyFixedUpdate; if (obj2 == null) { Manipulator val2 = InteractionDriver_MyFixedUpdate; <>O.<1>__InteractionDriver_MyFixedUpdate = val2; obj2 = (object)val2; } InteractionDriver.MyFixedUpdate += (Manipulator)obj2; object obj3 = <>O.<2>__PurchaseInteraction_OnInteractionBegin; if (obj3 == null) { Manipulator val3 = PurchaseInteraction_OnInteractionBegin; <>O.<2>__PurchaseInteraction_OnInteractionBegin = val3; obj3 = (object)val3; } PurchaseInteraction.OnInteractionBegin += (Manipulator)obj3; LanguageAPI.AddOverlay("ITEM_LOWERPRICEDCHESTS_PICKUP", "Reopen a chest for an additional reward. Usable once per stage.", "en"); LanguageAPI.AddOverlay("ITEM_LOWERPRICEDCHESTS_DESC", "Reopen a chest for an extra item. Each additional Sale Star increases the chance of getting more items by 5%.", "en"); object obj4 = <>O.<3>__PingIndicator_Update; if (obj4 == null) { Manipulator val4 = PingIndicator_Update; <>O.<3>__PingIndicator_Update = val4; obj4 = (object)val4; } PingIndicator.Update += (Manipulator)obj4; SceneExitController.onBeginExit += BeginExit; } } private static void BeginExit(SceneExitController controller) { //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) foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList()) { if (instances.saleStarCompatible && instances.costType == SaleStarCost.SaleStar) { instances.SetAvailable(false); } } } private static void PingIndicator_Update(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel label = null; if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(PurchaseInteraction), "available"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref label) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)SaleStarChestPingable); val.Emit(OpCodes.Brtrue, (object)label); } else { Log.Error(((MemberReference)il.Method).Name + "Failed to find patch location"); } static bool SaleStarChestPingable(PingIndicator self) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return self.pingTargetPurchaseInteraction.costType == SaleStarCost.SaleStar; } } private static void PurchaseInteraction_OnInteractionBegin(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel label = null; if (!val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(PurchaseInteraction), "saleStarCompatible"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label) })) { Log.Error(((MemberReference)il.Method).Name + "Failed to find patch location"); } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)checkReopen); val.Emit(OpCodes.Brfalse, (object)label); if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(ChestBehavior), "dropCount") })) { val.Emit(OpCodes.Ldc_I4_1); val.Emit(OpCodes.Sub); } else { Log.Error(((MemberReference)il.Method).Name + "Failed to find patch location"); } static bool checkReopen(PurchaseInteraction self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return self.costType == SaleStarCost.SaleStar; } } private static void InteractionDriver_MyFixedUpdate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel label = null; if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(PurchaseInteraction), "saleStarCompatible"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)checkReopen); val.Emit(OpCodes.Brfalse, (object)label); } else { Log.Error(((MemberReference)il.Method).Name + "Failed to find patch location"); } static bool checkReopen(InteractionDriver self) { //IL_001a: 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) PurchaseInteraction val2 = default(PurchaseInteraction); if (!self.currentInteractable.TryGetComponent(ref val2)) { return false; } return val2.costType == SaleStarCost.SaleStar; } } private static void Opened_OnEnter(orig_OnEnter orig, Opened self) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); ChestBehavior val = default(ChestBehavior); PurchaseInteraction val2 = default(PurchaseInteraction); if (!((EntityState)self).TryGetComponent(ref val) || !((EntityState)self).TryGetComponent(ref val2) || !val2.saleStarCompatible) { return; } if (val2.costType != SaleStarCost.SaleStar) { CharacterBody val3 = default(CharacterBody); if (Object.op_Implicit((Object)(object)val2.lastActivator) && ((Component)val2.lastActivator).TryGetComponent(ref val3) && Object.op_Implicit((Object)(object)val3.inventory) && val3.inventory.GetItemCountEffective(Items.LowerPricedChests) > 0) { val2.SetAvailable(true); } ((EntityState)self).SetPingable(true); val2.costType = SaleStarCost.SaleStar; val.openState = new SerializableEntityStateType(typeof(CloseOpen)); } else { val2.costType = (CostTypeIndex)1; } } } public class CloseOpen : Closing { public override void OnExit() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown ((EntityState)this).OnExit(); ChestBehavior val = default(ChestBehavior); PurchaseInteraction val2 = default(PurchaseInteraction); if (!((Component)((EntityState)this).outer).TryGetComponent(ref val) || !((Component)((EntityState)this).outer).TryGetComponent(ref val2)) { return; } val.Roll(); foreach (PersistentCall call in ((UnityEventBase)val2.onPurchase).m_PersistentCalls.m_Calls) { if (call.methodName == "ItemDrop") { val.ItemDrop(); break; } } ((EntityState)this).outer.SetNextState((EntityState)new Opening()); } } public class LowerPricedChestsBodyBehavoir : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] private static ItemDef GetItemDef() { return Items.LowerPricedChests; } private void OnEnable() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = default(EntityStateMachine); foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList()) { if (((Component)instances).TryGetComponent(ref val) && val.state is Opened && instances.saleStarCompatible && instances.costType == SaleStarCost.SaleStar) { instances.SetAvailable(true); } } } private void OnDisable() { //IL_000c: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (Util.GetItemCountForTeam(((BaseItemBodyBehavior)this).body.teamComponent.teamIndex, Items.LowerPricedChests.itemIndex, true, true) > 0) { return; } foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList()) { if (instances.saleStarCompatible && instances.costType == SaleStarCost.SaleStar) { instances.SetAvailable(false); } } } } [MonoDetourTargets(typeof(LowerPricedChests))] public class QualityCompat { [MonoDetourHookInitialize] private static void Init() { if (RetroactiveMacro.ChangeSaleStar.Value) { generateQualityDropTiersFromSaleStars.Prefix(test); tryUpgradePickupQualityFromSaleStars.Prefix(test2); } } private static void test2(ref UniquePickup pickup, ref QualityTier[] saleStarDropQualityTiers, ref int pickupSequenceIndex) { pickupSequenceIndex++; } private static void test(ref GameObject purchasedObject, ref int dropCount, ref bool useFirstInteractionCost, ref Xoroshiro128Plus rng) { dropCount++; } } public static class SaleStarCost { private static readonly CostTypeDef _saleStarCost; public static CostTypeIndex SaleStar { get; private set; } [SystemInitializer(new Type[] { })] private static void Init() { CostTypeCatalog.modHelper.getAdditionalEntries += delegate(List entries) { entries.Add(_saleStarCost); }; } [SystemInitializer(new Type[] { typeof(CostTypeCatalog) })] private static void InitCostType() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_001a: Unknown result type (might be due to invalid IL or missing references) for (CostTypeIndex val = (CostTypeIndex)0; (int)val < CostTypeCatalog.costTypeCount; val = (CostTypeIndex)(val + 1)) { CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef(val); if (costTypeDef == _saleStarCost) { SaleStar = val; } } } private static bool IsAffordableSaleStar(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = (Object.op_Implicit((Object)(object)context.activator) ? ((Component)context.activator).GetComponent() : null); Inventory val2 = (Object.op_Implicit((Object)(object)val) ? val.inventory : null); return Object.op_Implicit((Object)(object)val2) && val2.GetItemCountEffective(Items.LowerPricedChests) > 0; } static SaleStarCost() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) CostTypeDef val = new CostTypeDef(); val.name = "SaleStarCost"; val.colorIndex = (ColorIndex)2; val.itemTier = (ItemTier)1; val.costStringFormatToken = "ITEM_LOWERPRICEDCHESTS_NAME"; val.isAffordable = new IsAffordableDelegate(IsAffordableSaleStar); val.payCost = (PayCostDelegate)delegate { }; _saleStarCost = val; SaleStar = (CostTypeIndex)0; } } }