using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Pigeon.UI; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("CoinWin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CoinWin")] [assembly: AssemblyTitle("CoinWin")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 CoinWin { [MycoMod(/*Could not decode attribute arguments.*/)] [BepInPlugin("coinin.coinwin", "CoinWin", "1.2.0")] public sealed class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(CoinflipColin), "DoCoinflipCoroutine")] private static class CoinflipColinWinPatch { private static void Prefix(ref bool heads) { if (heads != headResult) { Log.LogDebug((object)$"Forced Coinflip Colin result from {heads} to {headResult}."); } heads = headResult; } } [HarmonyPatch(typeof(CoinflipColin), "CollectUpgrades")] private static class CoinflipColinReusePatch { private static void Postfix(ref bool ___canInteract, ref UpgradeInstance ___selectedUpgrade) { ___canInteract = true; ___selectedUpgrade = null; } } private const string PluginGuid = "coinin.coinwin"; private const string PluginName = "CoinWin"; private const string PluginVersion = "1.2.0"; internal static ManualLogSource Log = null; private static bool headResult = true; private Harmony? harmony; private OuroGearWindow? currentWindow; private Button? headButton; private void Awake() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; harmony = new Harmony("coinin.coinwin"); harmony.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)"CoinWin loaded. Coinflip Colin will always win and can be reused."); } private void Update() { if (!CanUseWindow(out OuroGearWindow window)) { DestroyHeadButton(); return; } if ((Object)(object)currentWindow == (Object)(object)window && (Object)(object)headButton != (Object)null) { SetHeadButtonText(); return; } DestroyHeadButton(); if (!TryFindCloseButton(window, out Button closeButton)) { Log.LogWarning((object)"Could not find OuroGearWindow Close button."); } else { CreateHeadButton(window, closeButton); } } private void OnDestroy() { DestroyHeadButton(); Harmony? obj = harmony; if (obj != null) { obj.UnpatchSelf(); } harmony = null; } private void CreateHeadButton(OuroGearWindow window, Button closeButton) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown Button val = Object.Instantiate