Decompiled source of RoundsPatchworkPlus v1.1.7
RoundsPatchworkPlus.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using InControl; using Microsoft.CodeAnalysis; using Photon.Pun; using RoundsPatchworkPlus.Patches; using UnboundLib.GameModes; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("RoundsPatchworkPlus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.7.0")] [assembly: AssemblyInformationalVersion("1.1.7+a9683e63ca16947f8f974b7519887660cfa64efc")] [assembly: AssemblyProduct("RoundsPatchworkPlus")] [assembly: AssemblyTitle("RoundsPatchworkPlus")] [assembly: AssemblyVersion("1.1.7.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 RoundsPatchworkPlus { [BepInPlugin("com.naccel.rounds.patchworkplus", "ROUNDS Patchwork Plus", "1.1.7")] [BepInProcess("Rounds.exe")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class RoundsPatchworkPlusPlugin : BaseUnityPlugin { public const string ModId = "com.naccel.rounds.patchworkplus"; public const string ModName = "ROUNDS Patchwork Plus"; public const string ModVersion = "1.1.7"; public static RoundsPatchworkPlusPlugin Instance { get; private set; } public static ManualLogSource Logger { get; private set; } public static Harmony HarmonyInstance { get; private set; } private void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown Instance = this; Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"[ROUNDS Patchwork Plus] v1.1.7 initializing stability and compatibility pipeline..."); try { HarmonyInstance = new Harmony("com.naccel.rounds.patchworkplus"); HarmonyInstance.PatchAll(); ModSafetyFixesPatch.Apply(HarmonyInstance); } catch (Exception arg) { Logger.LogError((object)string.Format("[{0}] Error applying Harmony patches: {1}", "ROUNDS Patchwork Plus", arg)); } } private void Start() { try { ModSafetyFixesPatch.Apply(HarmonyInstance); } catch (Exception ex) { Logger.LogWarning((object)("[ROUNDS Patchwork Plus] Late-stage safety patch check: " + ex.Message)); } Logger.LogInfo((object)"[ROUNDS Patchwork Plus] Patchwork Plus engine active and protecting game session."); } } } namespace RoundsPatchworkPlus.Patches { public static class ModSafetyFixesPatch { public class BotStuckTracker { public Vector2 LastPos; public float StuckDuration; public bool IsStuck; public void Update(Vector2 currentPos, bool attemptingMove) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!attemptingMove) { StuckDuration = 0f; IsStuck = false; LastPos = currentPos; } else if (Vector2.Distance(currentPos, LastPos) < 0.08f) { StuckDuration += Time.deltaTime; if (StuckDuration > 0.35f) { IsStuck = true; } } else { StuckDuration = 0f; IsStuck = false; LastPos = currentPos; } } } private static bool _isApplying; private static bool _patchedRwfFollow; private static bool _patchedWwcFollow; private static bool _patchedRwfSpotlight; private static bool _patchedUnboundColor; private static bool _patchedGoBack; private static bool _patchedDeckCustomization; private static bool _patchedCardsPlus; private static bool _patchedDemonicPact; private static bool _patchedModdingUtils; private static bool _patchedPCE; private static bool _patchedWWCPlasma; private static bool _patchedRwfRoomHandler; private static bool _patchedClientSideBlock; private static bool _patchedToggleEffects; private static bool _patchedGravityPatch; private static bool _patchedPlayerManagerReset; private static bool _patchedPlayerFullReset; private static bool _patchedPerformanceImprovements; private static bool _patchedCosmicRounds; private static bool _patchedRayHitReflect; private static bool _patchedProjectileHit; private static bool _patchedPCESuperJump; private static bool _patchedExplosion; private static bool _patchedMapTransitionMove; private static bool _patchedPlayerManagerMove; private static bool _patchedSetPlayerSpriteLayer; private static bool _patchedOnDestroyCleanup; private static bool _patchedUnboundDisableCard; private static bool _patchedStatReveal; private static bool _patchedStarMono; private static bool _patchedRoundsWithBots; private static bool _patchedEveryonePicksBots; private static bool _patchedMenuLazyVisuals; private static bool _patchedFixSoundEffect; private static bool _patchedDoubleViEffect; private static bool _patchedCardChoiceTheme; private static bool _patchedBotSmartNavigation; private static bool _patchedFastTransitions; private static bool _patchedCpcHit; private static bool _patchedMapShffuler; private static bool _patchedGauntletVisual; private static bool _patchedMenuDictionarySafety; private static bool _patchedCpcCoreHit; private static bool _patchedDuringReloadTrigger; private static bool _patchedTimeHandler; private static bool _patchedStickFightMaps; private static bool _patchedDeckCustomizationNewGUI; private static bool _patchedASKRarity; private static bool _patchedProjectileHitCoroutine; private static bool _patchedWwmCurseSpam; private static FieldInfo _fieldWwmCurseCategory; private static FieldInfo _fieldWwmCountAsCurseCategory; private static FieldInfo _fieldWwmCanDrawCurses; private static float _hitStopStuckTimer = 0f; private static float _gameOverStuckTimer = 0f; private static FieldInfo _fieldAIMovement_pathfindingHandler; private static FieldInfo _fieldAIMovement_isJumping; private static FieldInfo _fieldAIModule_playerAPI; private static FieldInfo _fieldAIPathfind_TargetNode; private static readonly ConditionalWeakTable<GameObject, CardInfo> _pendingMenuCardVisuals = new ConditionalWeakTable<GameObject, CardInfo>(); private static readonly HashSet<GameObject> _initializedMenuCards = new HashSet<GameObject>(); private static bool _suppressLazyVisualGuard = false; private static MethodInfo _cachedUnboundSetupCardVisuals; private static MethodInfo _cachedSandboxSetupCardVisuals; private static readonly MethodInfo PlayerFullResetMethod = typeof(Player).GetMethod("FullReset", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly string[] CosmicRoundsProjectileTypes = new string[15] { "CR.MonoBehaviors.DroneMono", "CR.MonoBehaviors.CloudMono", "CR.MonoBehaviors.PulseMono", "CR.MonoBehaviors.DriveMono", "CR.MonoBehaviors.SunMono", "CR.MonoBehaviors.MeteorMono", "CR.MonoBehaviors.CometMono", "CR.MonoBehaviors.CareenMono", "CR.MonoBehaviors.AsteroidMono", "CR.MonoBehaviors.ShootingStarMono", "CR.MonoBehaviors.SatelliteMono", "CR.MonoBehaviors.BeeMono", "CR.MonoBehaviors.SquidMono", "CR.MonoBehaviors.MoonMono", "CR.MonoBehaviors.MistletoeMono" }; private static readonly FieldInfo RayHitReflect_move_field = typeof(RayHitReflect).GetField("move", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo RayHitReflect_projHit_field = typeof(RayHitReflect).GetField("projHit", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Explosion_spawned_field = typeof(Explosion).GetField("spawned", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static bool _botReflectionInitialized; private static Type _charExtType; private static MethodInfo _charExtGetAddDataMethod; private static PropertyInfo _charExtIsBotProp; private static Type _botsManagerType; private static PropertyInfo _botsManagerInstanceProp; private static FieldInfo _botsManagerBotListField; private static PropertyInfo _botsManagerBotListProp; private static Type _moddingCharExtType; private static MethodInfo _moddingCharExtGetAddDataMethod; private static MemberInfo _moddingCharExtIsMinionMember; private static readonly HashSet<int> _loggedBotIntercepts = new HashSet<int>(); private static readonly Dictionary<int, BotStuckTracker> _botTrackers = new Dictionary<int, BotStuckTracker>(); private static int _lastTeleportScanTicks = 0; private static readonly List<Vector2> _cachedTeleports = new List<Vector2>(); private static bool _hasProbedPortalType = false; private static Type _cachedPortalType = null; private static FieldInfo _cachedExitField = null; public static void Apply(Harmony harmony) { //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Expected O, but got Unknown //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Expected O, but got Unknown //IL_09ed: Unknown result type (might be due to invalid IL or missing references) //IL_0e35: Unknown result type (might be due to invalid IL or missing references) //IL_0ef7: Unknown result type (might be due to invalid IL or missing references) //IL_1154: Unknown result type (might be due to invalid IL or missing references) //IL_1414: Unknown result type (might be due to invalid IL or missing references) //IL_14c2: Unknown result type (might be due to invalid IL or missing references) //IL_14cb: Unknown result type (might be due to invalid IL or missing references) //IL_14d6: Expected O, but got Unknown //IL_14d6: Expected O, but got Unknown //IL_2361: Unknown result type (might be due to invalid IL or missing references) //IL_27e6: Unknown result type (might be due to invalid IL or missing references) //IL_27f4: Expected O, but got Unknown //IL_2c7b: Unknown result type (might be due to invalid IL or missing references) //IL_2c84: Unknown result type (might be due to invalid IL or missing references) //IL_2c8f: Expected O, but got Unknown //IL_2c8f: Expected O, but got Unknown //IL_2d02: Unknown result type (might be due to invalid IL or missing references) //IL_2d0f: Expected O, but got Unknown //IL_2fcf: Unknown result type (might be due to invalid IL or missing references) //IL_2fdd: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Expected O, but got Unknown //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Expected O, but got Unknown //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Expected O, but got Unknown //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Expected O, but got Unknown //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Expected O, but got Unknown //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Expected O, but got Unknown //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Expected O, but got Unknown //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Expected O, but got Unknown //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Expected O, but got Unknown //IL_0e4b: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0f92: Expected O, but got Unknown //IL_1066: Unknown result type (might be due to invalid IL or missing references) //IL_11d3: Unknown result type (might be due to invalid IL or missing references) //IL_142a: Unknown result type (might be due to invalid IL or missing references) //IL_1520: Unknown result type (might be due to invalid IL or missing references) //IL_1529: Unknown result type (might be due to invalid IL or missing references) //IL_1534: Expected O, but got Unknown //IL_1534: Expected O, but got Unknown //IL_167b: Unknown result type (might be due to invalid IL or missing references) //IL_1684: Unknown result type (might be due to invalid IL or missing references) //IL_168f: Expected O, but got Unknown //IL_168f: Expected O, but got Unknown //IL_17b9: Unknown result type (might be due to invalid IL or missing references) //IL_17c7: Expected O, but got Unknown //IL_198e: Unknown result type (might be due to invalid IL or missing references) //IL_1999: Expected O, but got Unknown //IL_1b87: Unknown result type (might be due to invalid IL or missing references) //IL_1b95: Expected O, but got Unknown //IL_226a: Unknown result type (might be due to invalid IL or missing references) //IL_23ad: Unknown result type (might be due to invalid IL or missing references) //IL_2377: Unknown result type (might be due to invalid IL or missing references) //IL_24ba: Unknown result type (might be due to invalid IL or missing references) //IL_24c8: Expected O, but got Unknown //IL_26fe: Unknown result type (might be due to invalid IL or missing references) //IL_280e: Unknown result type (might be due to invalid IL or missing references) //IL_281c: Expected O, but got Unknown //IL_28cb: Unknown result type (might be due to invalid IL or missing references) //IL_2993: Unknown result type (might be due to invalid IL or missing references) //IL_299c: Unknown result type (might be due to invalid IL or missing references) //IL_29a7: Expected O, but got Unknown //IL_29a7: Expected O, but got Unknown //IL_2b34: Unknown result type (might be due to invalid IL or missing references) //IL_2b3d: Unknown result type (might be due to invalid IL or missing references) //IL_2b48: Expected O, but got Unknown //IL_2b48: Expected O, but got Unknown //IL_2d92: Unknown result type (might be due to invalid IL or missing references) //IL_2da0: Expected O, but got Unknown //IL_2e50: Unknown result type (might be due to invalid IL or missing references) //IL_2e59: Unknown result type (might be due to invalid IL or missing references) //IL_2e64: Expected O, but got Unknown //IL_2e64: Expected O, but got Unknown //IL_2f15: Unknown result type (might be due to invalid IL or missing references) //IL_2f20: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0ae2: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Expected O, but got Unknown //IL_0e56: Expected O, but got Unknown //IL_0fc7: Unknown result type (might be due to invalid IL or missing references) //IL_0fd2: Expected O, but got Unknown //IL_0f0d: Unknown result type (might be due to invalid IL or missing references) //IL_107c: Unknown result type (might be due to invalid IL or missing references) //IL_116a: Unknown result type (might be due to invalid IL or missing references) //IL_1435: Expected O, but got Unknown //IL_16fd: Unknown result type (might be due to invalid IL or missing references) //IL_1706: Unknown result type (might be due to invalid IL or missing references) //IL_1711: Expected O, but got Unknown //IL_1711: Expected O, but got Unknown //IL_19f0: Unknown result type (might be due to invalid IL or missing references) //IL_19fb: Expected O, but got Unknown //IL_2280: Unknown result type (might be due to invalid IL or missing references) //IL_23c3: Unknown result type (might be due to invalid IL or missing references) //IL_2382: Expected O, but got Unknown //IL_24e2: Unknown result type (might be due to invalid IL or missing references) //IL_24f0: Expected O, but got Unknown //IL_2714: Unknown result type (might be due to invalid IL or missing references) //IL_28e1: Unknown result type (might be due to invalid IL or missing references) //IL_29db: Unknown result type (might be due to invalid IL or missing references) //IL_29e4: Unknown result type (might be due to invalid IL or missing references) //IL_29ef: Expected O, but got Unknown //IL_29ef: Expected O, but got Unknown //IL_2bc9: Unknown result type (might be due to invalid IL or missing references) //IL_2bd2: Unknown result type (might be due to invalid IL or missing references) //IL_2bdd: Expected O, but got Unknown //IL_2bdd: Expected O, but got Unknown //IL_2f3a: Unknown result type (might be due to invalid IL or missing references) //IL_2f48: Expected O, but got Unknown //IL_30aa: Unknown result type (might be due to invalid IL or missing references) //IL_30b8: Expected O, but got Unknown //IL_1087: Expected O, but got Unknown //IL_11e9: Unknown result type (might be due to invalid IL or missing references) //IL_1299: Unknown result type (might be due to invalid IL or missing references) //IL_12a4: Expected O, but got Unknown //IL_135a: Unknown result type (might be due to invalid IL or missing references) //IL_1365: Expected O, but got Unknown //IL_1ef5: Unknown result type (might be due to invalid IL or missing references) //IL_219a: Unknown result type (might be due to invalid IL or missing references) //IL_228b: Expected O, but got Unknown //IL_23ce: Expected O, but got Unknown //IL_25ea: Unknown result type (might be due to invalid IL or missing references) //IL_25f7: Expected O, but got Unknown //IL_2569: Unknown result type (might be due to invalid IL or missing references) //IL_2577: Expected O, but got Unknown //IL_271f: Expected O, but got Unknown //IL_28ec: Expected O, but got Unknown //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Expected O, but got Unknown //IL_1599: Unknown result type (might be due to invalid IL or missing references) //IL_1c35: Unknown result type (might be due to invalid IL or missing references) //IL_1c42: Expected O, but got Unknown //IL_2052: Unknown result type (might be due to invalid IL or missing references) //IL_1f4d: Unknown result type (might be due to invalid IL or missing references) //IL_21b0: Unknown result type (might be due to invalid IL or missing references) //IL_2642: Unknown result type (might be due to invalid IL or missing references) //IL_264f: Expected O, but got Unknown //IL_2591: Unknown result type (might be due to invalid IL or missing references) //IL_259f: Expected O, but got Unknown //IL_0cc6: Unknown result type (might be due to invalid IL or missing references) //IL_0cd1: Expected O, but got Unknown //IL_0c54: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c3f: Expected O, but got Unknown //IL_0d3f: Unknown result type (might be due to invalid IL or missing references) //IL_15a2: Unknown result type (might be due to invalid IL or missing references) //IL_15ad: Expected O, but got Unknown //IL_20a4: Unknown result type (might be due to invalid IL or missing references) //IL_20b2: Expected O, but got Unknown //IL_2066: Unknown result type (might be due to invalid IL or missing references) //IL_1f9f: Unknown result type (might be due to invalid IL or missing references) //IL_1fad: Expected O, but got Unknown //IL_1f61: Unknown result type (might be due to invalid IL or missing references) //IL_1f09: Unknown result type (might be due to invalid IL or missing references) //IL_21bb: Expected O, but got Unknown //IL_0d55: Unknown result type (might be due to invalid IL or missing references) //IL_2073: Expected O, but got Unknown //IL_1f6e: Expected O, but got Unknown //IL_2a61: Unknown result type (might be due to invalid IL or missing references) //IL_2a6c: Expected O, but got Unknown //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Expected O, but got Unknown //IL_18be: Unknown result type (might be due to invalid IL or missing references) //IL_1a82: Unknown result type (might be due to invalid IL or missing references) //IL_1a8f: Expected O, but got Unknown //IL_1ce1: Unknown result type (might be due to invalid IL or missing references) //IL_1cef: Expected O, but got Unknown //IL_18d4: Unknown result type (might be due to invalid IL or missing references) //IL_1d5c: Unknown result type (might be due to invalid IL or missing references) //IL_1d6a: Expected O, but got Unknown if (harmony == null || _isApplying) { return; } _isApplying = true; try { try { if (!_patchedRwfFollow) { Type type = AccessTools.TypeByName("RWF.UI.FollowPlayer"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "Update", (Type[])null, (Type[])null); MethodInfo method = typeof(ModSafetyFixesPatch).GetMethod("FollowPlayer_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo != null && method != null) { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedRwfFollow = true; ManualLogSource logger = RoundsPatchworkPlusPlugin.Logger; if (logger != null) { logger.LogInfo((object)"[ROUNDS Patchwork Plus] RWF FollowPlayer NRE safety patch applied."); } } } } } catch { } try { if (!_patchedWwcFollow) { Type type2 = AccessTools.TypeByName("WWC.UI.FollowPlayer"); if (type2 != null) { MethodInfo methodInfo2 = AccessTools.Method(type2, "Update", (Type[])null, (Type[])null); MethodInfo method2 = typeof(ModSafetyFixesPatch).GetMethod("FollowPlayer_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo2 != null && method2 != null) { harmony.Patch((MethodBase)methodInfo2, new HarmonyMethod(method2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedWwcFollow = true; ManualLogSource logger2 = RoundsPatchworkPlusPlugin.Logger; if (logger2 != null) { logger2.LogInfo((object)"[ROUNDS Patchwork Plus] WWC FollowPlayer NRE safety patch applied."); } } } } } catch { } try { if (!_patchedRwfSpotlight) { Type type3 = AccessTools.TypeByName("RWF.UI.PlayerSpotlight"); if (type3 != null) { MethodInfo methodInfo3 = AccessTools.Method(type3, "SetShadowOpacity", (Type[])null, (Type[])null); MethodInfo method3 = typeof(ModSafetyFixesPatch).GetMethod("Spotlight_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo3 != null && method3 != null) { harmony.Patch((MethodBase)methodInfo3, new HarmonyMethod(method3), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedRwfSpotlight = true; ManualLogSource logger3 = RoundsPatchworkPlusPlugin.Logger; if (logger3 != null) { logger3.LogInfo((object)"[ROUNDS Patchwork Plus] RWF PlayerSpotlight NRE safety patch applied."); } } } } } catch { } try { if (!_patchedUnboundColor) { Type type4 = AccessTools.TypeByName("UnboundLib.Extensions.PlayerExtensions"); if (type4 != null) { MethodInfo methodInfo4 = AccessTools.Method(type4, "AssignColorID", (Type[])null, (Type[])null); MethodInfo method4 = typeof(ModSafetyFixesPatch).GetMethod("AssignColorID_Prefix", BindingFlags.Static | BindingFlags.Public); if (methodInfo4 != null && method4 != null) { harmony.Patch((MethodBase)methodInfo4, new HarmonyMethod(method4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedUnboundColor = true; ManualLogSource logger4 = RoundsPatchworkPlusPlugin.Logger; if (logger4 != null) { logger4.LogInfo((object)"[ROUNDS Patchwork Plus] UnboundLib AssignColorID safety patch applied."); } } } } } catch { } try { if (!_patchedGoBack) { MethodInfo methodInfo5 = AccessTools.Method(typeof(GoBack), "Update", (Type[])null, (Type[])null); MethodInfo method5 = typeof(ModSafetyFixesPatch).GetMethod("GoBack_Update_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo5 != null && method5 != null) { harmony.Patch((MethodBase)methodInfo5, new HarmonyMethod(method5), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedGoBack = true; ManualLogSource logger5 = RoundsPatchworkPlusPlugin.Logger; if (logger5 != null) { logger5.LogInfo((object)"[ROUNDS Patchwork Plus] GoBack.Update NRE safety patch applied."); } } } } catch { } try { if (!_patchedDeckCustomization) { Type type5 = AccessTools.TypeByName("DeckCustomization.RarityUtils"); if (type5 != null) { MethodInfo methodInfo6 = AccessTools.Method(type5, "GetThemeColor", (Type[])null, (Type[])null); MethodInfo method6 = typeof(ModSafetyFixesPatch).GetMethod("DeckCustomization_GetThemeColor_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo6 != null && method6 != null) { harmony.Patch((MethodBase)methodInfo6, new HarmonyMethod(method6), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedDeckCustomization = true; ManualLogSource logger6 = RoundsPatchworkPlusPlugin.Logger; if (logger6 != null) { logger6.LogInfo((object)"[ROUNDS Patchwork Plus] DeckCustomization GetThemeColor safety patch applied."); } } } } } catch { } try { if (!_patchedCardsPlus) { Type type6 = AccessTools.TypeByName("CardsPlusPlugin.Cards.Cyberpunk.CyberCardEffect"); if (type6 != null) { MethodInfo methodInfo7 = AccessTools.Method(type6, "SetFont", (Type[])null, (Type[])null); MethodInfo method7 = typeof(ModSafetyFixesPatch).GetMethod("CyberCardEffect_SetFont_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo7 != null && method7 != null) { harmony.Patch((MethodBase)methodInfo7, new HarmonyMethod(method7), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo8 = AccessTools.Method(type6, "CreateFrame", (Type[])null, (Type[])null); MethodInfo method8 = typeof(ModSafetyFixesPatch).GetMethod("CyberCardEffect_CreateFrame_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method9 = typeof(ModSafetyFixesPatch).GetMethod("CyberCardEffect_CreateFrame_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo8 != null) { harmony.Patch((MethodBase)methodInfo8, (!(method8 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method8), (HarmonyMethod)null, (HarmonyMethod)null, (!(method9 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method9), (HarmonyMethod)null); } _patchedCardsPlus = true; ManualLogSource logger7 = RoundsPatchworkPlusPlugin.Logger; if (logger7 != null) { logger7.LogInfo((object)"[ROUNDS Patchwork Plus] CardsPlus CyberCardEffect safety patch applied."); } } } } catch { } try { if (!_patchedDemonicPact) { Type type7 = AccessTools.TypeByName("DemonicPactPatch.PlayerPatchFullReset"); if (type7 != null) { MethodInfo methodInfo9 = AccessTools.Method(type7, "Prefix", (Type[])null, (Type[])null); MethodInfo method10 = typeof(ModSafetyFixesPatch).GetMethod("DemonicPact_Prefix_Guard", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo9 != null && method10 != null) { harmony.Patch((MethodBase)methodInfo9, new HarmonyMethod(method10), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedDemonicPact = true; ManualLogSource logger8 = RoundsPatchworkPlusPlugin.Logger; if (logger8 != null) { logger8.LogInfo((object)"[ROUNDS Patchwork Plus] DemonicPactPatch.PlayerPatchFullReset safety patch applied."); } } } } } catch { } try { if (!_patchedModdingUtils) { Type type8 = AccessTools.TypeByName("ModdingUtils.Patches.PlayerPatchFullReset"); if (type8 != null) { MethodInfo methodInfo10 = AccessTools.Method(type8, "Prefix", (Type[])null, (Type[])null); MethodInfo method11 = typeof(ModSafetyFixesPatch).GetMethod("DemonicPact_Prefix_Guard", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo10 != null && method11 != null) { harmony.Patch((MethodBase)methodInfo10, new HarmonyMethod(method11), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedModdingUtils = true; ManualLogSource logger9 = RoundsPatchworkPlusPlugin.Logger; if (logger9 != null) { logger9.LogInfo((object)"[ROUNDS Patchwork Plus] ModdingUtils.Patches.PlayerPatchFullReset safety patch applied."); } } } } } catch { } try { if (!_patchedWWCPlasma) { Type type9 = AccessTools.TypeByName("WWC.MonoBehaviours.PlasmaWeapon_Mono"); if (type9 != null) { MethodInfo methodInfo11 = AccessTools.Method(type9, "UpdateChargeBar", (Type[])null, (Type[])null); MethodInfo method12 = typeof(ModSafetyFixesPatch).GetMethod("PlasmaWeapon_UpdateChargeBar_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo11 != null && method12 != null) { harmony.Patch((MethodBase)methodInfo11, new HarmonyMethod(method12), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedWWCPlasma = true; ManualLogSource logger10 = RoundsPatchworkPlusPlugin.Logger; if (logger10 != null) { logger10.LogInfo((object)"[ROUNDS Patchwork Plus] WWC PlasmaWeapon_Mono.UpdateChargeBar safety patch applied."); } } } } } catch { } try { if (!_patchedRwfRoomHandler) { Type type10 = AccessTools.TypeByName("RWF.PrivateRoomHandler"); if (type10 != null) { MethodInfo methodInfo12 = AccessTools.Method(type10, "SetGameSettings", (Type[])null, (Type[])null); MethodInfo method13 = typeof(ModSafetyFixesPatch).GetMethod("PrivateRoomHandler_SetGameSettings_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo12 != null && method13 != null) { harmony.Patch((MethodBase)methodInfo12, new HarmonyMethod(method13), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedRwfRoomHandler = true; ManualLogSource logger11 = RoundsPatchworkPlusPlugin.Logger; if (logger11 != null) { logger11.LogInfo((object)"[ROUNDS Patchwork Plus] RWF PrivateRoomHandler.SetGameSettings safety patch applied."); } } } } } catch { } try { if (!_patchedClientSideBlock) { Type type11 = AccessTools.TypeByName("ClientSideBlock.ProjectileHitPatch+<HitCoroutine>d__1"); if (type11 != null) { MethodInfo methodInfo13 = AccessTools.Method(type11, "MoveNext", (Type[])null, (Type[])null); MethodInfo method14 = typeof(ModSafetyFixesPatch).GetMethod("HitCoroutine_MoveNext_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo13 != null && method14 != null) { harmony.Patch((MethodBase)methodInfo13, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method14), (HarmonyMethod)null); _patchedClientSideBlock = true; ManualLogSource logger12 = RoundsPatchworkPlusPlugin.Logger; if (logger12 != null) { logger12.LogInfo((object)"[ROUNDS Patchwork Plus] ClientSideBlock ProjectileHitPatch safety patch applied."); } } } } } catch { } try { if (!_patchedPCE) { Type type12 = AccessTools.TypeByName("PCE.Patches.PlayerPatchFullReset"); if (type12 != null) { MethodInfo methodInfo14 = AccessTools.Method(type12, "Prefix", (Type[])null, (Type[])null); MethodInfo method15 = typeof(ModSafetyFixesPatch).GetMethod("DemonicPact_Prefix_Guard", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo14 != null && method15 != null) { harmony.Patch((MethodBase)methodInfo14, new HarmonyMethod(method15), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedPCE = true; ManualLogSource logger13 = RoundsPatchworkPlusPlugin.Logger; if (logger13 != null) { logger13.LogInfo((object)"[ROUNDS Patchwork Plus] PCE.Patches.PlayerPatchFullReset safety patch applied."); } } } } } catch { } try { if (!_patchedToggleEffects) { Type type13 = AccessTools.TypeByName("RoundsToggleEffectsMod.ToggleEffectsMod"); if (type13 != null) { MethodInfo methodInfo15 = AccessTools.Method(type13, "OnChromaticAbberationToggled", (Type[])null, (Type[])null); MethodInfo method16 = typeof(ModSafetyFixesPatch).GetMethod("OnChromaticAbberationToggled_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo15 != null && method16 != null) { harmony.Patch((MethodBase)methodInfo15, new HarmonyMethod(method16), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedToggleEffects = true; ManualLogSource logger14 = RoundsPatchworkPlusPlugin.Logger; if (logger14 != null) { logger14.LogInfo((object)"[ROUNDS Patchwork Plus] RoundsToggleEffectsMod chromatic aberration safety patch applied."); } } } } } catch { } try { if (!_patchedGravityPatch) { Type type14 = AccessTools.TypeByName("Gravity_Patch.Patch"); if (type14 != null) { MethodInfo methodInfo16 = AccessTools.Method(type14, "Prefix", (Type[])null, (Type[])null); MethodInfo method17 = typeof(ModSafetyFixesPatch).GetMethod("DemonicPact_Prefix_Guard", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo16 != null && method17 != null) { harmony.Patch((MethodBase)methodInfo16, new HarmonyMethod(method17), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedGravityPatch = true; ManualLogSource logger15 = RoundsPatchworkPlusPlugin.Logger; if (logger15 != null) { logger15.LogInfo((object)"[ROUNDS Patchwork Plus] Gravity_Patch.Patch safety patch applied."); } } } } } catch { } try { if (!_patchedPlayerManagerReset) { MethodInfo methodInfo17 = AccessTools.Method(typeof(PlayerManager), "ResetCharacters", (Type[])null, (Type[])null); MethodInfo method18 = typeof(ModSafetyFixesPatch).GetMethod("PlayerManager_ResetCharacters_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo17 != null && method18 != null) { harmony.Patch((MethodBase)methodInfo17, new HarmonyMethod(method18), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedPlayerManagerReset = true; ManualLogSource logger16 = RoundsPatchworkPlusPlugin.Logger; if (logger16 != null) { logger16.LogInfo((object)"[ROUNDS Patchwork Plus] PlayerManager.ResetCharacters cleanup safety patch applied."); } } } } catch { } try { if (!_patchedPlayerFullReset) { MethodInfo methodInfo18 = AccessTools.Method(typeof(Player), "FullReset", (Type[])null, (Type[])null); MethodInfo method19 = typeof(ModSafetyFixesPatch).GetMethod("Player_FullReset_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method20 = typeof(ModSafetyFixesPatch).GetMethod("Player_FullReset_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo18 != null) { harmony.Patch((MethodBase)methodInfo18, (!(method19 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method19, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method20 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method20), (HarmonyMethod)null); _patchedPlayerFullReset = true; ManualLogSource logger17 = RoundsPatchworkPlusPlugin.Logger; if (logger17 != null) { logger17.LogInfo((object)"[ROUNDS Patchwork Plus] Player.FullReset root guard and finalizer applied."); } } } } catch { } try { if (!_patchedPerformanceImprovements) { Type type15 = AccessTools.TypeByName("PerformanceImprovements.PerformanceImprovements"); if (type15 != null) { MethodInfo methodInfo19 = AccessTools.PropertyGetter(type15, "DisablePlayerParticles"); MethodInfo method21 = typeof(ModSafetyFixesPatch).GetMethod("DisablePlayerParticles_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo19 != null && method21 != null) { harmony.Patch((MethodBase)methodInfo19, new HarmonyMethod(method21), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo20 = AccessTools.Method(type15, "CycleArt", (Type[])null, (Type[])null); MethodInfo method22 = typeof(ModSafetyFixesPatch).GetMethod("CycleArt_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo20 != null && method22 != null) { harmony.Patch((MethodBase)methodInfo20, new HarmonyMethod(method22), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } _patchedPerformanceImprovements = true; ManualLogSource logger18 = RoundsPatchworkPlusPlugin.Logger; if (logger18 != null) { logger18.LogInfo((object)"[ROUNDS Patchwork Plus] PerformanceImprovements player model and art glitch protection applied."); } } } } catch { } try { if (!_patchedCosmicRounds) { MethodInfo method23 = typeof(ModSafetyFixesPatch).GetMethod("CosmicRounds_Start_Transpiler", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method24 = typeof(ModSafetyFixesPatch).GetMethod("CosmicRounds_Start_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method25 = typeof(ModSafetyFixesPatch).GetMethod("CareenMono_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method26 = typeof(ModSafetyFixesPatch).GetMethod("MistletoeMono_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method27 = typeof(ModSafetyFixesPatch).GetMethod("RayHitReflect_DoHitEffect_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method28 = typeof(ModSafetyFixesPatch).GetMethod("FireballMono_Update_Prefix", BindingFlags.Static | BindingFlags.NonPublic); int num = 0; string[] cosmicRoundsProjectileTypes = CosmicRoundsProjectileTypes; foreach (string text in cosmicRoundsProjectileTypes) { Type type16 = AccessTools.TypeByName(text); if (!(type16 != null)) { continue; } MethodInfo methodInfo21 = AccessTools.Method(type16, "Start", (Type[])null, (Type[])null); if (methodInfo21 != null) { HarmonyMethod val = null; if (text == "CR.MonoBehaviors.CareenMono" && method25 != null) { val = new HarmonyMethod(method25); } else if (text == "CR.MonoBehaviors.MistletoeMono" && method26 != null) { val = new HarmonyMethod(method26); } harmony.Patch((MethodBase)methodInfo21, val, (HarmonyMethod)null, (!(method23 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method23), (!(method24 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method24), (HarmonyMethod)null); num++; } if (text == "CR.MonoBehaviors.MistletoeMono") { MethodInfo methodInfo22 = AccessTools.Method(type16, "DoHitEffect", new Type[1] { typeof(HitInfo) }, (Type[])null); if (methodInfo22 != null && method27 != null) { harmony.Patch((MethodBase)methodInfo22, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method27), (HarmonyMethod)null); } } } cosmicRoundsProjectileTypes = new string[2] { "CR.MonoBehaviors.FireballMono", "CR.MonoBehaviors.HolyFireMono" }; for (int i = 0; i < cosmicRoundsProjectileTypes.Length; i++) { Type type17 = AccessTools.TypeByName(cosmicRoundsProjectileTypes[i]); if (type17 != null) { MethodInfo methodInfo23 = AccessTools.Method(type17, "Update", (Type[])null, (Type[])null); if (methodInfo23 != null && method28 != null) { harmony.Patch((MethodBase)methodInfo23, new HarmonyMethod(method28), (HarmonyMethod)null, (HarmonyMethod)null, (!(method24 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method24), (HarmonyMethod)null); num++; } } } if (num > 0) { _patchedCosmicRounds = true; ManualLogSource logger19 = RoundsPatchworkPlusPlugin.Logger; if (logger19 != null) { logger19.LogInfo((object)$"[ROUNDS Patchwork Plus] CosmicRounds projectile safety patches applied ({num} cards/effects protected)."); } } } } catch { } try { if (!_patchedRayHitReflect) { MethodInfo methodInfo24 = AccessTools.Method(typeof(RayHitReflect), "DoHitEffect", new Type[1] { typeof(HitInfo) }, (Type[])null); MethodInfo method29 = typeof(ModSafetyFixesPatch).GetMethod("RayHitReflect_DoHitEffect_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method30 = typeof(ModSafetyFixesPatch).GetMethod("RayHitReflect_DoHitEffect_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo24 != null && method29 != null) { harmony.Patch((MethodBase)methodInfo24, new HarmonyMethod(method29, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method30 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method30), (HarmonyMethod)null); _patchedRayHitReflect = true; ManualLogSource logger20 = RoundsPatchworkPlusPlugin.Logger; if (logger20 != null) { logger20.LogInfo((object)"[ROUNDS Patchwork Plus] RayHitReflect.DoHitEffect safety patch applied."); } } } } catch { } try { if (!_patchedProjectileHit) { MethodInfo methodInfo25 = AccessTools.Method(typeof(ProjectileHit), "RPCA_DoHit", (Type[])null, (Type[])null); MethodInfo method31 = typeof(ModSafetyFixesPatch).GetMethod("ProjectileHit_RPCA_DoHit_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method32 = typeof(ModSafetyFixesPatch).GetMethod("ProjectileHit_RPCA_DoHit_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo25 != null) { harmony.Patch((MethodBase)methodInfo25, (!(method31 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method31, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method32 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method32), (HarmonyMethod)null); _patchedProjectileHit = true; ManualLogSource logger21 = RoundsPatchworkPlusPlugin.Logger; if (logger21 != null) { logger21.LogInfo((object)"[ROUNDS Patchwork Plus] ProjectileHit.RPCA_DoHit network safety patch applied."); } } MethodInfo methodInfo26 = AccessTools.Method(typeof(ProjectileHit), "Hit", new Type[2] { typeof(HitInfo), typeof(bool) }, (Type[])null); if (methodInfo26 != null && method32 != null) { harmony.Patch((MethodBase)methodInfo26, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method32), (HarmonyMethod)null); } MethodInfo methodInfo27 = AccessTools.Method(typeof(ProjectileHit), "Update", (Type[])null, (Type[])null); if (methodInfo27 != null && method32 != null) { harmony.Patch((MethodBase)methodInfo27, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method32), (HarmonyMethod)null); } } } catch { } try { if (!_patchedPCESuperJump) { Type type18 = AccessTools.TypeByName("PCE.MonoBehaviours.SuperJumpEffect"); if (type18 != null) { MethodInfo methodInfo28 = AccessTools.Method(type18, "OnUpdate", (Type[])null, (Type[])null); MethodInfo method33 = typeof(ModSafetyFixesPatch).GetMethod("SuperJumpEffect_OnUpdate_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method34 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo28 != null && method33 != null) { harmony.Patch((MethodBase)methodInfo28, new HarmonyMethod(method33, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method34 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method34), (HarmonyMethod)null); _patchedPCESuperJump = true; ManualLogSource logger22 = RoundsPatchworkPlusPlugin.Logger; if (logger22 != null) { logger22.LogInfo((object)"[ROUNDS Patchwork Plus] PCE SuperJumpEffect safety patch applied."); } } } } } catch { } try { if (!_patchedExplosion) { MethodInfo methodInfo29 = AccessTools.Method(typeof(Explosion), "DoExplosionEffects", new Type[3] { typeof(Collider2D), typeof(float), typeof(float) }, (Type[])null); MethodInfo method35 = typeof(ModSafetyFixesPatch).GetMethod("Explosion_DoExplosionEffects_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method36 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo29 != null) { harmony.Patch((MethodBase)methodInfo29, (!(method35 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method35, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method36 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method36), (HarmonyMethod)null); } MethodInfo methodInfo30 = AccessTools.Method(typeof(Explosion), "Explode", (Type[])null, (Type[])null); MethodInfo method37 = typeof(ModSafetyFixesPatch).GetMethod("Explosion_Explode_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo30 != null) { harmony.Patch((MethodBase)methodInfo30, (!(method37 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method37, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method36 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method36), (HarmonyMethod)null); } _patchedExplosion = true; ManualLogSource logger23 = RoundsPatchworkPlusPlugin.Logger; if (logger23 != null) { logger23.LogInfo((object)"[ROUNDS Patchwork Plus] Explosion.DoExplosionEffects and Explode safety patches applied."); } } } catch { } try { if (!_patchedMapTransitionMove) { Type[] nestedTypes = typeof(MapTransition).GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic); foreach (Type type19 in nestedTypes) { if (!type19.Name.Contains("Move")) { continue; } MethodInfo method38 = type19.GetMethod("MoveNext", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method39 = typeof(ModSafetyFixesPatch).GetMethod("Coroutine_MoveNext_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (method38 != null && method39 != null) { harmony.Patch((MethodBase)method38, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method39), (HarmonyMethod)null); _patchedMapTransitionMove = true; ManualLogSource logger24 = RoundsPatchworkPlusPlugin.Logger; if (logger24 != null) { logger24.LogInfo((object)"[ROUNDS Patchwork Plus] MapTransition.Move coroutine safety patch applied."); } } } } } catch { } try { if (!_patchedPlayerManagerMove) { Type[] nestedTypes = typeof(PlayerManager).GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic); foreach (Type type20 in nestedTypes) { if (!type20.Name.Contains("Move")) { continue; } MethodInfo method40 = type20.GetMethod("MoveNext", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method41 = typeof(ModSafetyFixesPatch).GetMethod("Coroutine_MoveNext_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (method40 != null && method41 != null) { harmony.Patch((MethodBase)method40, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method41), (HarmonyMethod)null); _patchedPlayerManagerMove = true; ManualLogSource logger25 = RoundsPatchworkPlusPlugin.Logger; if (logger25 != null) { logger25.LogInfo((object)"[ROUNDS Patchwork Plus] PlayerManager.Move coroutine safety patch applied."); } } } } } catch { } try { if (!_patchedSetPlayerSpriteLayer) { MethodInfo methodInfo31 = AccessTools.Method(typeof(SetPlayerSpriteLayer), "Start", (Type[])null, (Type[])null); MethodInfo method42 = typeof(ModSafetyFixesPatch).GetMethod("SetPlayerSpriteLayer_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method43 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo31 != null && method42 != null) { harmony.Patch((MethodBase)methodInfo31, new HarmonyMethod(method42, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method43 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method43), (HarmonyMethod)null); _patchedSetPlayerSpriteLayer = true; ManualLogSource logger26 = RoundsPatchworkPlusPlugin.Logger; if (logger26 != null) { logger26.LogInfo((object)"[ROUNDS Patchwork Plus] SetPlayerSpriteLayer.Start safety patch applied."); } } } } catch { } try { if (!_patchedOnDestroyCleanup) { MethodInfo methodInfo32 = AccessTools.Method(typeof(EmpowerStopBlockObjectFollow), "OnDestroy", (Type[])null, (Type[])null); MethodInfo method44 = typeof(ModSafetyFixesPatch).GetMethod("EmpowerStopBlockObjectFollow_OnDestroy_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method45 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo32 != null && method44 != null) { harmony.Patch((MethodBase)methodInfo32, new HarmonyMethod(method44), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method45), (HarmonyMethod)null); } MethodInfo methodInfo33 = AccessTools.Method(typeof(ReloadTigger), "OnDestroy", (Type[])null, (Type[])null); MethodInfo method46 = typeof(ModSafetyFixesPatch).GetMethod("ReloadTigger_OnDestroy_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo33 != null && method46 != null) { harmony.Patch((MethodBase)methodInfo33, new HarmonyMethod(method46), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method45), (HarmonyMethod)null); } Type type21 = AccessTools.TypeByName("RoundsWithViewers.RWV"); if (type21 != null) { MethodInfo methodInfo34 = AccessTools.Method(type21, "OnDestroy", (Type[])null, (Type[])null); MethodInfo method47 = typeof(ModSafetyFixesPatch).GetMethod("RoundsWithViewers_OnDestroy_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo34 != null && method45 != null) { harmony.Patch((MethodBase)methodInfo34, (!(method47 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method47), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method45), (HarmonyMethod)null); } } _patchedOnDestroyCleanup = true; ManualLogSource logger27 = RoundsPatchworkPlusPlugin.Logger; if (logger27 != null) { logger27.LogInfo((object)"[ROUNDS Patchwork Plus] EmpowerStopBlock, ReloadTigger & RoundsWithViewers OnDestroy safety patches applied."); } } } catch { } try { if (!_patchedUnboundDisableCard) { Type type22 = AccessTools.TypeByName("UnboundLib.Utils.CardManager"); if (type22 != null) { MethodInfo methodInfo35 = AccessTools.Method(type22, "DisableCard", new Type[2] { typeof(CardInfo), typeof(bool) }, (Type[])null); MethodInfo method48 = typeof(ModSafetyFixesPatch).GetMethod("Unbound_DisableCard_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method49 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo35 != null && method48 != null) { harmony.Patch((MethodBase)methodInfo35, new HarmonyMethod(method48, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method49), (HarmonyMethod)null); _patchedUnboundDisableCard = true; ManualLogSource logger28 = RoundsPatchworkPlusPlugin.Logger; if (logger28 != null) { logger28.LogInfo((object)"[ROUNDS Patchwork Plus] UnboundLib CardManager.DisableCard safety patch applied."); } } MethodInfo methodInfo36 = AccessTools.Method(type22, "FirstTimeStart", (Type[])null, (Type[])null); MethodInfo method50 = typeof(ModSafetyFixesPatch).GetMethod("Unbound_CardManager_FirstTimeStart_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo36 != null && method50 != null) { harmony.Patch((MethodBase)methodInfo36, new HarmonyMethod(method50, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method49), (HarmonyMethod)null); } } } } catch { } try { if (!_patchedStatReveal) { Type type23 = AccessTools.TypeByName("RoundsMod.Patches.StatCalculator"); if (type23 != null) { MethodInfo methodInfo37 = AccessTools.Method(type23, "GetStatValue", new Type[3] { typeof(string), typeof(Gun), typeof(CharacterStatModifiers) }, (Type[])null); MethodInfo method51 = typeof(ModSafetyFixesPatch).GetMethod("StatCalculator_GetStatValue_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo37 != null && method51 != null) { harmony.Patch((MethodBase)methodInfo37, new HarmonyMethod(method51, 600, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedStatReveal = true; ManualLogSource logger29 = RoundsPatchworkPlusPlugin.Logger; if (logger29 != null) { logger29.LogInfo((object)"[ROUNDS Patchwork Plus] StatRevealMod 0.5% decimal truncation patch applied."); } } } } } catch { } try { if (!_patchedStarMono) { Type type24 = AccessTools.TypeByName("CR.MonoBehaviors.StarMono"); if (type24 != null) { Type[] nestedTypes2 = type24.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method52 = typeof(ModSafetyFixesPatch).GetMethod("StarMono_Attack_Lambda_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method53 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); bool flag = false; Type[] nestedTypes = nestedTypes2; foreach (Type type25 in nestedTypes) { if (!type25.Name.Contains("DisplayClass")) { continue; } MethodInfo[] methods = type25.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo38 in methods) { if (methodInfo38.Name.Contains("Attack") && methodInfo38.Name.Contains("b__")) { harmony.Patch((MethodBase)methodInfo38, (!(method52 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method52), (HarmonyMethod)null, (HarmonyMethod)null, (!(method53 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method53), (HarmonyMethod)null); flag = true; } } } if (flag) { _patchedStarMono = true; ManualLogSource logger30 = RoundsPatchworkPlusPlugin.Logger; if (logger30 != null) { logger30.LogInfo((object)"[ROUNDS Patchwork Plus] CosmicRounds StarMono Attack safety patch applied."); } } } } } catch { } try { if (!_patchedRoundsWithBots) { Type type26 = AccessTools.TypeByName("RoundsWithBots.AI.Movement.AIPathfindModule"); if (type26 != null) { MethodInfo methodInfo39 = AccessTools.Method(type26, "Update", (Type[])null, (Type[])null); MethodInfo method54 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo39 != null && method54 != null) { harmony.Patch((MethodBase)methodInfo39, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method54), (HarmonyMethod)null); } MethodInfo methodInfo40 = AccessTools.Method(type26, "AttemptPathfindToTarget", new Type[1] { typeof(Vector2) }, (Type[])null); MethodInfo method55 = typeof(ModSafetyFixesPatch).GetMethod("AIPathfindModule_AttemptPathfindToTarget_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo40 != null && method55 != null) { harmony.Patch((MethodBase)methodInfo40, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method55), (HarmonyMethod)null); } _patchedRoundsWithBots = true; ManualLogSource logger31 = RoundsPatchworkPlusPlugin.Logger; if (logger31 != null) { logger31.LogInfo((object)"[ROUNDS Patchwork Plus] RoundsWithBots AIPathfindModule safety patches applied."); } Type type27 = AccessTools.TypeByName("RoundsWithBots.AI.Movement.AIMovementModule"); if (!_patchedBotSmartNavigation && type27 != null) { MethodInfo methodInfo41 = AccessTools.Method(type27, "PathfindPlayer", (Type[])null, (Type[])null); MethodInfo method56 = typeof(ModSafetyFixesPatch).GetMethod("AIMovementModule_PathfindPlayer_Postfix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo41 != null && method56 != null) { harmony.Patch((MethodBase)methodInfo41, (HarmonyMethod)null, new HarmonyMethod(method56), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _fieldAIMovement_pathfindingHandler = AccessTools.Field(type27, "pathfindingHandler"); _fieldAIMovement_isJumping = AccessTools.Field(type27, "isJumping"); Type type28 = AccessTools.TypeByName("RoundsWithBots.AI.AIModuleBase"); _fieldAIModule_playerAPI = AccessTools.Field(type27, "playerAPI") ?? AccessTools.Field(type28, "playerAPI"); _fieldAIPathfind_TargetNode = AccessTools.Field(type26, "TargetNode"); _patchedBotSmartNavigation = true; ManualLogSource logger32 = RoundsPatchworkPlusPlugin.Logger; if (logger32 != null) { logger32.LogInfo((object)"[ROUNDS Patchwork Plus] RoundsWithBots AIMovementModule smart fallback & teleport navigation applied."); } } } } } } catch { } try { if (!_patchedEveryonePicksBots) { Type type29 = AccessTools.TypeByName("EveryonePicks.State"); if (type29 != null) { MethodInfo methodInfo42 = AccessTools.Method(type29, "IsLocalPlayer", new Type[1] { typeof(Player) }, (Type[])null); MethodInfo method57 = typeof(ModSafetyFixesPatch).GetMethod("EveryonePicks_IsLocalPlayer_Prefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo42 != null && method57 != null) { harmony.Patch((MethodBase)methodInfo42, new HarmonyMethod(method57), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logger33 = RoundsPatchworkPlusPlugin.Logger; if (logger33 != null) { logger33.LogInfo((object)"[ROUNDS Patchwork Plus] Patched EveryonePicks.State.IsLocalPlayer."); } } else { ManualLogSource logger34 = RoundsPatchworkPlusPlugin.Logger; if (logger34 != null) { logger34.LogWarning((object)$"[ROUNDS Patchwork Plus] Failed to find IsLocalPlayer method ({methodInfo42 != null}) or prefix ({method57 != null})."); } } MethodInfo methodInfo43 = AccessTools.Method(type29, "SeedPickers", new Type[1] { typeof(List<Player>) }, (Type[])null); MethodInfo method58 = typeof(ModSafetyFixesPatch).GetMethod("EveryonePicks_SeedPickers_Postfix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo43 != null && method58 != null) { harmony.Patch((MethodBase)methodInfo43, (HarmonyMethod)null, new HarmonyMethod(method58), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logger35 = RoundsPatchworkPlusPlugin.Logger; if (logger35 != null) { logger35.LogInfo((object)"[ROUNDS Patchwork Plus] Patched EveryonePicks.State.SeedPickers."); } } else { ManualLogSource logger36 = RoundsPatchworkPlusPlugin.Logger; if (logger36 != null) { logger36.LogWarning((object)$"[ROUNDS Patchwork Plus] Failed to find SeedPickers method ({methodInfo43 != null}) or postfix ({method58 != null})."); } } MethodInfo methodInfo44 = AccessTools.Method(type29, "ApplyRow", new Type[1] { typeof(string) }, (Type[])null); MethodInfo method59 = typeof(ModSafetyFixesPatch).GetMethod("EveryonePicks_ApplyRow_Prefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo44 != null && method59 != null) { harmony.Patch((MethodBase)methodInfo44, new HarmonyMethod(method59), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logger37 = RoundsPatchworkPlusPlugin.Logger; if (logger37 != null) { logger37.LogInfo((object)"[ROUNDS Patchwork Plus] Patched EveryonePicks.State.ApplyRow."); } } Type type30 = AccessTools.TypeByName("RoundsWithBots.Handlers.BotCardPickerHandler"); if (type30 != null) { MethodInfo methodInfo45 = AccessTools.Method(type30, "AiPickCard", (Type[])null, (Type[])null); MethodInfo method60 = typeof(ModSafetyFixesPatch).GetMethod("BotCardPickerHandler_AiPickCard_Prefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo45 != null && method60 != null) { harmony.Patch((MethodBase)methodInfo45, new HarmonyMethod(method60), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logger38 = RoundsPatchworkPlusPlugin.Logger; if (logger38 != null) { logger38.LogInfo((object)"[ROUNDS Patchwork Plus] Patched RoundsWithBots BotCardPickerHandler.AiPickCard."); } } } _patchedEveryonePicksBots = true; ManualLogSource logger39 = RoundsPatchworkPlusPlugin.Logger; if (logger39 != null) { logger39.LogInfo((object)"[ROUNDS Patchwork Plus] EveryonePicks + RoundsWithBots simultaneous bot pick pipeline applied successfully."); } } } } catch (Exception arg) { ManualLogSource logger40 = RoundsPatchworkPlusPlugin.Logger; if (logger40 != null) { logger40.LogWarning((object)$"[ROUNDS Patchwork Plus] EveryonePicks bot patching note: {arg}"); } } try { if (!_patchedMenuLazyVisuals) { Type type31 = AccessTools.TypeByName("UnboundLib.Utils.UI.ToggleCardsMenuHandler"); Type type32 = AccessTools.TypeByName("SandboxImprovements.Utilities.CardSpawnMenuHandler"); MethodInfo method61 = typeof(ModSafetyFixesPatch).GetMethod("MenuCard_SetupCardVisuals_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method62 = typeof(ModSafetyFixesPatch).GetMethod("MenuCard_SetupCardVisuals_Postfix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method63 = typeof(ModSafetyFixesPatch).GetMethod("MenuCard_UpdateVisualsCardObj_Prefix", BindingFlags.Static | BindingFlags.NonPublic); int num2 = 0; if (type31 != null) { _cachedUnboundSetupCardVisuals = AccessTools.Method(type31, "SetupCardVisuals", new Type[2] { typeof(CardInfo), typeof(GameObject) }, (Type[])null); MethodInfo methodInfo46 = AccessTools.Method(type31, "UpdateVisualsCardObj", new Type[2] { typeof(GameObject), typeof(bool?) }, (Type[])null); MethodInfo methodInfo47 = AccessTools.Method(type31, "Start", (Type[])null, (Type[])null); MethodInfo method64 = typeof(ModSafetyFixesPatch).GetMethod("ToggleCardsMenuHandler_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method65 = typeof(ModSafetyFixesPatch).GetMethod("ToggleCardsMenuHandler_Start_Postfix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo47 != null) { harmony.Patch((MethodBase)methodInfo47, (!(method64 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method64), (!(method65 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method65), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num2++; } if (_cachedUnboundSetupCardVisuals != null && method61 != null) { harmony.Patch((MethodBase)_cachedUnboundSetupCardVisuals, new HarmonyMethod(method61, 800, (string[])null, (string[])null, (bool?)null), (!(method62 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method62), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num2++; } if (methodInfo46 != null && method63 != null) { harmony.Patch((MethodBase)methodInfo46, new HarmonyMethod(method63, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num2++; } } if (type32 != null) { _cachedSandboxSetupCardVisuals = AccessTools.Method(type32, "SetupCardVisuals", new Type[2] { typeof(CardInfo), typeof(GameObject) }, (Type[])null); MethodInfo methodInfo48 = AccessTools.Method(type32, "UpdateVisualsCardObj", new Type[2] { typeof(GameObject), typeof(bool?) }, (Type[])null); if (_cachedSandboxSetupCardVisuals != null && method61 != null) { harmony.Patch((MethodBase)_cachedSandboxSetupCardVisuals, new HarmonyMethod(method61, 800, (string[])null, (string[])null, (bool?)null), (!(method62 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method62), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num2++; } if (methodInfo48 != null && method63 != null) { harmony.Patch((MethodBase)methodInfo48, new HarmonyMethod(method63, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num2++; } } if (num2 > 0) { _patchedMenuLazyVisuals = true; ManualLogSource logger41 = RoundsPatchworkPlusPlugin.Logger; if (logger41 != null) { logger41.LogInfo((object)$"[ROUNDS Patchwork Plus] Main menu lazy card visual engine applied ({num2} hooks active, eliminates startup freeze)."); } } } } catch (Exception ex) { ManualLogSource logger42 = RoundsPatchworkPlusPlugin.Logger; if (logger42 != null) { logger42.LogWarning((object)("[ROUNDS Patchwork Plus] Menu visual optimization note: " + ex.Message)); } } try { if (!_patchedFixSoundEffect) { Type type33 = AccessTools.TypeByName("FixSoundEffect"); if (type33 != null) { MethodInfo methodInfo49 = AccessTools.Method(type33, "Awake", (Type[])null, (Type[])null); MethodInfo method66 = typeof(ModSafetyFixesPatch).GetMethod("FixSoundEffect_Awake_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method67 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo49 != null && method66 != null) { harmony.Patch((MethodBase)methodInfo49, new HarmonyMethod(method66, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method67 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method67), (HarmonyMethod)null); _patchedFixSoundEffect = true; ManualLogSource logger43 = RoundsPatchworkPlusPlugin.Logger; if (logger43 != null) { logger43.LogInfo((object)"[ROUNDS Patchwork Plus] GearUpCards FixSoundEffect.Awake safety patch applied."); } } } } } catch { } try { if (!_patchedDoubleViEffect) { Type type34 = AccessTools.TypeByName("ZomC_Cards.MonoBehaviours.DoubleViEffect"); if (type34 != null) { MethodInfo methodInfo50 = AccessTools.Method(type34, "Start", (Type[])null, (Type[])null); MethodInfo method68 = typeof(ModSafetyFixesPatch).GetMethod("DoubleViEffect_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method69 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo50 != null && method68 != null) { harmony.Patch((MethodBase)methodInfo50, new HarmonyMethod(method68, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method69 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method69), (HarmonyMethod)null); _patchedDoubleViEffect = true; ManualLogSource logger44 = RoundsPatchworkPlusPlugin.Logger; if (logger44 != null) { logger44.LogInfo((object)"[ROUNDS Patchwork Plus] ZomC DoubleViEffect.Start safety patch applied."); } } } } } catch { } try { if (!_patchedCardChoiceTheme) { Type typeFromHandle = typeof(CardChoice); MethodInfo methodInfo51 = AccessTools.Method(typeFromHandle, "GetCardColor", new Type[1] { typeof(CardThemeColorType) }, (Type[])null); MethodInfo methodInfo52 = AccessTools.Method(typeFromHandle, "GetCardColor2", new Type[1] { typeof(CardThemeColorType) }, (Type[])null); MethodInfo method70 = typeof(ModSafetyFixesPatch).GetMethod("CardChoice_GetCardColor_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method71 = typeof(ModSafetyFixesPatch).GetMethod("CardChoice_GetCardColor_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo51 != null && method70 != null) { harmony.Patch((MethodBase)methodInfo51, new HarmonyMethod(method70, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method71 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method71), (HarmonyMethod)null); } if (methodInfo52 != null && method70 != null) { harmony.Patch((MethodBase)methodInfo52, new HarmonyMethod(method70, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method71 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method71), (HarmonyMethod)null); } _patchedCardChoiceTheme = true; ManualLogSource logger45 = RoundsPatchworkPlusPlugin.Logger; if (logger45 != null) { logger45.LogInfo((object)"[ROUNDS Patchwork Plus] CardChoice theme color null guards applied."); } } } catch { } try { if (!_patchedFastTransitions) { Type type35 = AccessTools.TypeByName("RWF.UI.PlayerSpotlight"); if (type35 != null) { MethodInfo methodInfo53 = AccessTools.Method(type35, "FadeIn", new Type[2] { typeof(float), typeof(float) }, (Type[])null); MethodInfo methodInfo54 = AccessTools.Method(type35, "FadeOut", new Type[2] { typeof(float), typeof(float) }, (Type[])null); MethodInfo method72 = typeof(ModSafetyFixesPatch).GetMethod("PlayerSpotlight_FadeIn_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method73 = typeof(ModSafetyFixesPatch).GetMethod("PlayerSpotlight_FadeOut_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo53 != null && method72 != null) { harmony.Patch((MethodBase)methodInfo53, new HarmonyMethod(method72), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } if (methodInfo54 != null && method73 != null) { harmony.Patch((MethodBase)methodInfo54, new HarmonyMethod(method73), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } Type type36 = AccessTools.TypeByName("RWF.GameModes.RWFGameMode") ?? AccessTools.TypeByName("RWF.RWFGameMode"); if (type36 != null) { MethodInfo methodInfo55 = AccessTools.Method(type36, "DoRoundStart", (Type[])null, (Type[])null); MethodInfo methodInfo56 = AccessTools.Method(type36, "DoPointStart", (Type[])null, (Type[])null); MethodInfo method74 = typeof(ModSafetyFixesPatch).GetMethod("RWFGameMode_DoRoundStart_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo55 != null && method74 != null) { harmony.Patch((MethodBase)methodInfo55, new HarmonyMethod(method74), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } if (methodInfo56 != null && method74 != null) { harmony.Patch((MethodBase)methodInfo56, new HarmonyMethod(method74), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } MethodInfo methodInfo57 = AccessTools.Method(typeof(PointVisualizer), "Start", (Type[])null, (Type[])null); MethodInfo method75 = typeof(ModSafetyFixesPatch).GetMethod("PointVisualizer_Start_Postfix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo57 != null && method75 != null) { harmony.Patch((MethodBase)methodInfo57, (HarmonyMethod)null, new HarmonyMethod(method75), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo58 = AccessTools.Method(typeof(MapTransition), "Start", (Type[])null, (Type[])null); MethodInfo method76 = typeof(ModSafetyFixesPatch).GetMethod("MapTransition_Start_Postfix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo58 != null && method76 != null) { harmony.Patch((MethodBase)methodInfo58, (HarmonyMethod)null, new HarmonyMethod(method76), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } _patchedFastTransitions = true; ManualLogSource logger46 = RoundsPatchworkPlusPlugin.Logger; if (logger46 != null) { logger46.LogInfo((object)"[ROUNDS Patchwork Plus] Fast round & point transition patches applied."); } } } catch { } try { if (!_patchedCpcHit) { Type type37 = AccessTools.TypeByName("CPCCrafter.Patches.ProjHitPatch"); if (type37 != null) { MethodInfo methodInfo59 = AccessTools.Method(type37, "Prefix", (Type[])null, (Type[])null); MethodInfo method77 = typeof(ModSafetyFixesPatch).GetMethod("CPCCrafter_ProjHitPatch_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method78 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo59 != null && method77 != null) { harmony.Patch((MethodBase)methodInfo59, new HarmonyMethod(method77, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method78 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method78), (HarmonyMethod)null); _patchedCpcHit = true; ManualLogSource logger47 = RoundsPatchworkPlusPlugin.Logger; if (logger47 != null) { logger47.LogInfo((object)"[ROUNDS Patchwork Plus] CPCCrafter ProjHitPatch NRE safety guard applied."); } } } } } catch { } try { if (!_patchedMapShffuler) { Type typeFromHandle2 = typeof(GameModeManager); MethodInfo methodInfo60 = AccessTools.Method(typeFromHandle2, "AddHook", new Type[2] { typeof(string), typeof(Func<IGameModeHandler, IEnumerator>) }, (Type[])null); MethodInfo methodInfo61 = AccessTools.Method(typeFromHandle2, "AddOnceHook", new Type[2] { typeof(string), typeof(Func<IGameModeHandler, IEnumerator>) }, (Type[])null); MethodInfo method79 = typeof(ModSafetyFixesPatch).GetMethod("GameModeManager_AddHook_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo60 != null && method79 != null) { harmony.Patch((MethodBase)methodInfo60, new HarmonyMethod(method79), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } if (methodInfo61 != null && method79 != null) { harmony.Patch((MethodBase)methodInfo61, new HarmonyMethod(method79), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } _patchedMapShffuler = true; ManualLogSource logger48 = RoundsPatchworkPlusPlugin.Logger; if (logger48 != null) { logger48.LogInfo((object)"[ROUNDS Patchwork Plus] GameModeManager hook null-safety wrapper applied."); } } } catch { } try { if (!_patchedGauntletVisual) { Type type38 = AccessTools.TypeByName("infinityStones.Cards.InfinityStone+GauntletVisualEffect"); if (type38 != null) { MethodInfo methodInfo62 = AccessTools.Method(type38, "Start", (Type[])null, (Type[])null); MethodInfo method80 = typeof(ModSafetyFixesPatch).GetMethod("GauntletVisualEffect_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method81 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo62 != null && method80 != null) { harmony.Patch((MethodBase)methodInfo62, new HarmonyMethod(method80, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, (!(method81 != null)) ? ((HarmonyMethod)null) : new HarmonyMethod(method81), (HarmonyMethod)null); _patchedGauntletVisual = true; ManualLogSource logger49 = RoundsPatchworkPlusPlugin.Logger; if (logger49 != null) { logger49.LogInfo((object)"[ROUNDS Patchwork Plus] InfinityStones GauntletVisualEffect NRE safety guard applied."); } } } } } catch { } try { if (!_patchedMenuDictionarySafety) { Type type39 = AccessTools.TypeByName("RootCore.Patches.ToggleCardsMenuPatch"); Type type40 = AccessTools.TypeByName("RootCore.Patches.ToggleCardsMenuPatchNew"); MethodInfo method82 = typeof(ModSafetyFixesPatch).GetMethod("RootCore_ToggleCardsMenuPatch_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method83 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (type39 != null && method82 != null) { MethodInfo methodInfo63 = AccessTools.Method(type39, "Postfix", (Type[])null, (Type[])null); if (methodInfo63 != null) { harmony.Patch((MethodBase)methodInfo63, new HarmonyMethod(method82), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method83), (HarmonyMethod)null); } } if (type40 != null && method82 != null) { MethodInfo methodInfo64 = AccessTools.Method(type40, "Postfix", (Type[])null, (Type[])null); if (methodInfo64 != null) { harmony.Patch((MethodBase)methodInfo64, new HarmonyMethod(method82), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method83), (HarmonyMethod)null); } } Type type41 = AccessTools.TypeByName("RarntyMenu.Patch"); if (type41 != null) { Type[] nestedTypes = type41.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic); for (int i = 0; i < nestedTypes.Length; i++) { MethodInfo[] methods = nestedTypes[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo65 in methods) { if (methodInfo65.Name.Contains("Prefix") || methodInfo65.Name.Contains("b__")) { harmony.Patch((MethodBase)methodInfo65, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method83), (HarmonyMethod)null); } } } } _patchedMenuDictionarySafety = true; ManualLogSource logger50 = RoundsPatchworkPlusPlugin.Logger; if (logger50 != null) { logger50.LogInfo((object)"[ROUNDS Patchwork Plus] RootCore & RarityMenu KeyNotFoundException safety applied."); } } } catch { } try { if (!_patchedCpcCoreHit) { Type type42 = AccessTools.TypeByName("CPCCore.Patches.ProjectileHitPatchHit"); if (type42 != null) { MethodInfo methodInfo66 = AccessTools.Method(type42, "Postfix", (Type[])null, (Type[])null); MethodInfo method84 = typeof(ModSafetyFixesPatch).GetMethod("CPCCore_ProjectileHitPatchHit_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method85 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo66 != null && method84 != null) { harmony.Patch((MethodBase)methodInfo66, new HarmonyMethod(method84, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method85), (HarmonyMethod)null); } } Type type43 = AccessTools.TypeByName("CPCCore.Patches.ProjectileHitPatchRPCA_DoHit"); if (type43 != null) { MethodInfo methodInfo67 = AccessTools.Method(type43, "Postfix", (Type[])null, (Type[])null); MethodInfo method86 = typeof(ModSafetyFixesPatch).GetMethod("CPCCore_ProjectileHitPatchRPCA_DoHit_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method87 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo67 != null && method86 != null) { harmony.Patch((MethodBase)methodInfo67, new HarmonyMethod(method86, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method87), (HarmonyMethod)null); } } _patchedCpcCoreHit = true; ManualLogSource logger51 = RoundsPatchworkPlusPlugin.Logger; if (logger51 != null) { logger51.LogInfo((object)"[ROUNDS Patchwork Plus] CPCCore bullet collision & damage safety guards applied."); } } } catch { } try { if (!_patchedDuringReloadTrigger) { MethodInfo methodInfo68 = AccessTools.Method(typeof(DuringReloadTrigger), "Update", (Type[])null, (Type[])null); MethodInfo method88 = typeof(ModSafetyFixesPatch).GetMethod("DuringReloadTrigger_Update_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method89 = typeof(ModSafetyFixesPatch).GetMethod("Safe_Null_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo68 != null && method88 != null) { harmony.Patch((MethodBase)methodInfo68, new HarmonyMethod(method88, 800, (string[])null, (string[])null, (bool?)null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method89), (HarmonyMethod)null); _patchedDuringReloadTrigger = true; ManualLogSource logger52 = RoundsPatchworkPlusPlugin.Logger; if (logger52 != null) { logger52.LogInfo((object)"[ROUNDS Patchwork Plus] DuringReloadTrigger.Update NRE safety patch applied."); } } } } catch { } try { if (!_patchedTimeHandler) { MethodInfo methodInfo69 = AccessTools.Method(typeof(TimeHandler), "Update", (Type[])null, (Type[])null); MethodInfo method90 = typeof(ModSafetyFixesPatch).GetMethod("TimeHandler_Update_Postfix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo69 != null && method90 != null) { harmony.Patch((MethodBase)methodInfo69, (HarmonyMethod)null, new HarmonyMethod(method90), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedTimeHandler = true; ManualLogSource logger53 = RoundsPatchworkPlusPlugin.Logger; if (logger53 != null) { logger53.LogInfo((object)"[ROUNDS Patchwork Plus] TimeHandler auto-recovery slow-motion prevention active."); } } } } catch { } try { if (!_patchedStickFightMaps) { Type type44 = AccessTools.TypeByName("StickFightMaps.MonoBehaviours.BossSlothPhysicsObject"); if (type44 != null) { MethodInfo methodInfo70 = AccessTools.Method(type44, "Start", (Type[])null, (Type[])null); MethodInfo method91 = typeof(ModSafetyFixesPatch).GetMethod("BossSlothPhysicsObject_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo70 != null && method91 != null) { harmony.Patch((MethodBase)methodInfo70, new HarmonyMethod(method91), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedStickFightMaps = true; ManualLogSource logger54 = RoundsPatchworkPlusPlugin.Logger; if (logger54 != null) { logger54.LogInfo((object)"[ROUNDS Patchwork Plus] StickFightMaps BossSlothPhysicsObject.Start compatibility patch applied."); } } } } } catch { } try { if (!_patchedDeckCustomizationNewGUI) { Type type45 = AccessTools.TypeByName("DeckCustomization.DeckCustomization"); if (type45 != null) { MethodInfo methodInfo71 = AccessTools.Method(type45, "NewGUI", new Type[1] { typeof(GameObject) }, (Type[])null); MethodInfo method92 = typeof(ModSafetyFixesPatch).GetMethod("DeckCustomization_NewGUI_Prefix", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method93 = typeof(ModSafetyFixesPatch).GetMethod("DeckCustomization_NewGUI_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo71 != null && method92 != null) { harmony.Patch((MethodBase)methodInfo71, new HarmonyMethod(method92), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method93), (HarmonyMethod)null); _patchedDeckCustomizationNewGUI = true; ManualLogSource logger55 = RoundsPatchworkPlusPlugin.Logger; if (logger55 != null) { logger55.LogInfo((object)"[ROUNDS Patchwork Plus] DeckCustomization NewGUI NRE menu safety patch applied."); } } } } } catch { } try { if (!_patchedASKRarity) { Type type46 = AccessTools.TypeByName("ASK.Main"); if (type46 != null) { MethodInfo methodInfo72 = AccessTools.Method(type46, "Awake", (Type[])null, (Type[])null); MethodInfo methodInfo73 = AccessTools.Method(type46, "Start", (Type[])null, (Type[])null); MethodInfo method94 = typeof(ModSafetyFixesPatch).GetMethod("ASK_Main_Awake_Finalizer", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo method95 = typeof(ModSafetyFixesPatch).GetMethod("ASK_Main_Start_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo72 != null && method94 != null) { harmony.Patch((MethodBase)methodInfo72, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method94), (HarmonyMethod)null); } if (methodInfo73 != null && method95 != null) { harmony.Patch((MethodBase)methodInfo73, new HarmonyMethod(method95), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } _patchedASKRarity = true; ManualLogSource logger56 = RoundsPatchworkPlusPlugin.Logger; if (logger56 != null) { logger56.LogInfo((object)"[ROUNDS Patchwork Plus] ASK (Aidan Scyye Keyanlux) RarityException safety patch applied."); } } } } catch { } try { if (!_patchedProjectileHitCoroutine) { MethodInfo methodInfo74 = AccessTools.Method(typeof(ProjectileHit), "AddPlayerToHeld", new Type[1] { typeof(HealthHandler) }, (Type[])null); MethodInfo method96 = typeof(ModSafetyFixesPatch).GetMethod("ProjectileHit_AddPlayerToHeld_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo74 != null && method96 != null) { harmony.Patch((MethodBase)methodInfo74, new HarmonyMethod(method96), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _patchedProjectileHitCoroutine = true; ManualLogSource logger57 = RoundsPatchworkPlusPlugin.Logger; if (logger57 != null) { logger57.LogInfo((object)"[ROUNDS Patchwork Plus] ProjectileHit inactive bullet coroutine safety patch applied."); } } } } catch { } try { if (_patchedWwmCurseSpam) { return; } Type type47 = AccessTools.TypeByName("WillsWackyManagers.Utils.CurseManager"); if (type47 != null) { FieldInfo field = type47.GetField("extremeDebugging", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { field.SetValue(null, false); } MethodInfo methodInfo75 = AccessTools.Method(type47, "CanDrawCursesCondition", new Type[2] { typeof(Player), typeof(CardInfo) }, (Type[])null); MethodInfo method97 = typeof(ModSafetyFixesPatch).GetMethod("CurseManager_CanDrawCursesCondition_Prefix", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo75 != null && method97 != null) { harmony.Patch((MethodBase)methodInfo75, new HarmonyMethod(method97), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } _patchedWwmCurseSpam = true; ManualLogSource logger58 = RoundsPatchworkPlusPlugin.Logger; if (logger58 != null) { logger58.LogInfo((object)"[ROUNDS Patchwork Plus] WillsWackyManagers CurseManager log throttle applied."); } } } catch { } } catch (Exception ex2) { ManualLogSource logger59 = RoundsPatchworkPlusPlugin.Logger; if (logger59 != null) { logger59.LogWarning((object)("[ROUNDS Patchwork Plus] Mod safety fixes note: " + ex2.Message)); } } finally { _isApplying = false; } } private static bool FollowPlayer_Prefix(Component __instance) { try { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.gameObject == (Object)null) { return false; } Type type = ((object)__instance).GetType(); object obj = null; PropertyInfo property = type.GetProperty("player", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { obj = property.GetValue(__instance, null); } else { FieldInfo fieldInfo = type.GetField("player", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? type.GetField("<player>k__BackingField", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (fieldInfo != null) { obj = fieldInfo.GetValue(__instance); } } if (obj == null) { Object.Destroy((Object)(object)__instance.gameObject); return false; } Object val = (Object)((obj is Object) ? obj : null); if (val != null && val == (Object)null) { Object.Destroy((Object)(object)__instance.gameObject); return false; } Player val2 = (Player)((obj is Player) ? obj : null); if (val2 != null && ((Object)(object)val2 == (Object)null || (Object)(object)((Component)val2).gameObject == (Object)null || (Object)(object)((Component)val2).transform == (Object)null)) { Object.Destroy((Object)(object)__instance.gameObject); return false; } } catch { return false; } return true; } private static bool Spotlight_Prefix() { try { PropertyInfo propertyInfo = AccessTools.Property(AccessTools.TypeByName("RWF.UI.PlayerSpotlight"), "BG"); if (propertyInfo != null && propertyInfo.GetValue(null, null) == null) { return false; } } catch { } return true; } private static bool GoBack_Update_Prefix(GoBack __instance) { try { if (__instance == null) { return false; } if (!((Component)__instance).gameObject.activeInHierarchy) { return false; } ListMenuPage componentInParent = ((Component)__instance).GetComponentInParent<ListMenuPage>(); if ((Object)(object)ListMenu.instance != (Object)null && (Object)(object)componentInParent != (Object)null && (Object)(object)ListMenu.instance.selectedPage != (Object)null && (Object)(object)ListMenu.instance.selectedPage != (Object)(object)componentInParent) { return false; } ReadOnlyCollection<InputDevice> activeDevices = InputManager.ActiveDevices; if (activeDevices != null) { for (int i = 0; i < activeDevices.Count; i++) { InputDevice val = activeDevices[i]; if (val != null && val.Action2 != null && ((OneAxisInputControl)val.Action2).WasPressed) { UnityEvent goBackEvent = __instance.goBackEvent; if (goBackEvent != null) { goBackEvent.Invoke(); } ListMenuPage target = __instance.target; if (target != null) { target.Open(); } return false; } } } if (Input.GetKeyDown((KeyCode)27)) { UnityEvent goBackEvent2 = __instance.goBackEvent; if (goBackEvent2 != null) { goBackEvent2.Invoke(); } ListMenuPage target2 = __instance.target; if (target2 != null) { target2.Open(); } } } catch { } return false; } private static bool DeckCustomization_GetThemeColor_Prefix(CardThemeColorType theme, ref Color __result) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)CardChoice.instance != (Object)null && CardChoice.instance.cardThemes != null) { for (int i = 0; i < CardChoice.instance.cardThemes.Length; i++) { CardThemeColor val = CardChoice.instance.cardThemes[i]; if (val != null && val.themeType == theme) { __result = val.targetColor; return false; } } } } catch { } __result = Color.white; return false; } private static bool CyberCardEffect_SetFont_Prefix(Component __instance) { try { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.transform == (Object)null) { return false; } if (__instance.transform.childCount <= 0) { return false; } } catch { return false; } return true; } private static bool DemonicPact_Prefix_Guard(Player __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).gameObject == (Object)null || (Object)(object)__instance.data == (Object)null) { return false; } return true; } private static bool PlasmaWeapon_UpdateChargeBar_Prefix(MonoBehaviour __instance) { try { if ((Object)(object)__instance == (Object)null) { return false; } Type type = ((object)__instance).GetType(); object? obj = AccessTools.Field(type, "gun")?.GetValue(__instance); Gun val = (Gun)((obj is Gun) ? obj : null); object? obj2 = AccessTools.Field(type, "chargeImage")?.GetValue(__instance); Image val2 = (Image)((obj2 is Image) ? obj2 : null); if ((Object)(object)val == (Object)null) { CharacterData componentInPar