Decompiled source of Pocket Room Library MelanieMelicious v2.0.7

MelMPocketLib.dll

Decompiled 12 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Dawn.Internal;
using GameNetcodeStuff;
using HarmonyLib;
using MelMPocketLib.NetcodePatcher;
using MelaniePocketRoom;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using loaforcsSoundAPI.LethalCompany.Conditions.Player;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MelaniePocketRoom")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MelanieMelicious")]
[assembly: AssemblyProduct("MelaniePocketRoom")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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;
		}
	}
}
public class DawnLibCompat
{
	[HarmonyTranspiler]
	[HarmonyPatch(typeof(ItemSaveDataHandler), "LoadFromRoot")]
	private static IEnumerable<CodeInstruction> TranspilerISDHLFR(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Expected O, but got Unknown
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Expected O, but got Unknown
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		object operand = val.Operand;
		val.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[4]
		{
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_S, (object)12),
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null)),
			new CodeInstruction(OpCodes.Brtrue_S, operand)
		});
		return val.InstructionEnumeration();
	}
}
public class HarmonyPatches
{
	internal static HashSet<EnemyType> blacklist = new HashSet<EnemyType>();

	internal static HashSet<EnemyType> mediumEmy = new HashSet<EnemyType>();

	internal static HashSet<EnemyType> largeEmy = new HashSet<EnemyType>();

	internal static bool walkWarp;

	[HarmonyPrefix]
	[HarmonyPatch(typeof(PlayerControllerB), "Start")]
	private static void PlayerPostStart(PlayerControllerB __instance)
	{
		__instance.isInElevator = true;
		__instance.isInHangarShipRoom = true;
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	[HarmonyBefore(new string[] { "MelanieMelicious.2StoryShip" })]
	private static void PreStart(StartOfRound __instance)
	{
		walkWarp = PocketRoomCfg.walkWarp.Value;
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	[HarmonyAfter(new string[] { "MelanieMelicious.2StoryShip", "mborsh.WiderShipMod" })]
	private static void PostStart(StartOfRound __instance)
	{
		EnemyType[] array = Resources.FindObjectsOfTypeAll<EnemyType>();
		foreach (EnemyType val in array)
		{
			string[] array2 = PocketRoomCfg.warpBlacklist.Value.Split(new char[1] { ',' });
			foreach (string text in array2)
			{
				if (val.enemyName == text)
				{
					blacklist.Add(val);
					Plugin.mls.LogInfo((object)$"Found and added {val} to door teleport blacklist.");
				}
			}
			string[] array3 = PocketRoomCfg.largeEmy.Value.Split(new char[1] { ',' });
			foreach (string text2 in array3)
			{
				if (val.enemyName == text2)
				{
					largeEmy.Add(val);
					Plugin.mls.LogInfo((object)$"Found and added {val} to large enemy list.");
				}
			}
		}
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(QuickMenuManager), "LeaveGameConfirm")]
	private static void PreQuit()
	{
		MelShipBoundsCheck.roomBounds.Clear();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(AudioReverbTrigger), "ChangeAudioReverbForPlayer")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerARTCARFP(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Expected O, but got Unknown
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Expected O, but got Unknown
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Expected O, but got Unknown
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.Advance(1).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)null, (string)null)
		});
		list.AddRange(val.InstructionsWithOffsets(0, 2));
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		}).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[7]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label),
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[1],
			list[2],
			list[3],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1)
			.Labels.Add(label);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(BeltBagItem), "RemoveObjectFromBag")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerBBIROFB(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Expected O, but got Unknown
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Expected O, but got Unknown
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Expected O, but got Unknown
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Expected O, but got Unknown
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Expected O, but got Unknown
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Expected O, but got Unknown
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Expected O, but got Unknown
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Expected O, but got Unknown
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		Label label2 = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		})
			.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4]
			{
				new CodeInstruction(OpCodes.Brtrue, (object)label),
				new CodeInstruction(OpCodes.Ldarg_0, (object)null),
				new CodeInstruction(OpCodes.Ldloc_S, (object)4),
				new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
			})
			.Advance(1)
			.Labels.Add(label);
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		}).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label2),
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_S, (object)4),
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		})
			.Advance(1)
			.Labels.Add(label2);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(DeadBodyInfo), "LateUpdate")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerDBILU(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Expected O, but got Unknown
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Expected O, but got Unknown
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Expected O, but got Unknown
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null)
		});
		list.AddRange(val.InstructionsWithOffsets(0, 1));
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		}).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[6]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label),
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[1],
			list[2],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1)
			.Labels.Add(label);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(ElevatorAnimationEvents), "SetBodiesKinematic")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerEAESBK(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Expected O, but got Unknown
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Expected O, but got Unknown
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Expected O, but got Unknown
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Expected O, but got Unknown
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Expected O, but got Unknown
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Expected O, but got Unknown
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Expected O, but got Unknown
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.Advance(1).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)null, (string)null)
		});
		list.Add(val.Instruction);
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Callvirt, (object)null, (string)null)
		});
		list.Add(val.Instruction);
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		}).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[10]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label),
			list[0],
			new CodeInstruction(OpCodes.Ldloc_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_1, (object)null),
			new CodeInstruction(OpCodes.Ldelem_Ref, (object)null),
			list[1],
			new CodeInstruction(OpCodes.Ldc_I4_5, (object)null),
			new CodeInstruction(OpCodes.Ldelem_Ref, (object)null),
			list[2],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1)
			.Labels.Add(label);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(PlayerControllerB), "DiscardHeldObject")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerPCBDHO(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		list.Add(val.InstructionAt(-2));
		list.Add(val.Instruction);
		val.Insert((CodeInstruction[])(object)new CodeInstruction[5]
		{
			list[2],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[0],
			list[1],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		});
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(ShipBuildModeManager), "Update")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerSBMMU(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Expected O, but got Unknown
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Expected O, but got Unknown
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Expected O, but got Unknown
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Expected O, but got Unknown
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		Label label = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Br, (object)null, (string)null)
		});
		object operand = val.Operand;
		list.AddRange(val.InstructionsWithOffsets(-3, -2));
		val.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Brtrue_S, (object)label)).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[6]
		{
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[1],
			list[2],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null)),
			new CodeInstruction(OpCodes.Brtrue_S, (object)label)
		}).Advance(1)
			.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2]
			{
				new CodeInstruction(OpCodes.Br, operand),
				new CodeInstruction(OpCodes.Ldc_I4_1, (object)null)
			})
			.Advance(-1)
			.Labels.Add(label);
		val.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[1]
		{
			new CodeInstruction(OpCodes.Br, operand)
		});
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(SoccerBallProp), "BeginKickBall")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerSBPBKB(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Expected O, but got Unknown
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Expected O, but got Unknown
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Expected O, but got Unknown
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Expected O, but got Unknown
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Expected O, but got Unknown
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Expected O, but got Unknown
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Expected O, but got Unknown
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Expected O, but got Unknown
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Expected O, but got Unknown
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Expected O, but got Unknown
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Expected O, but got Unknown
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Expected O, but got Unknown
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Expected O, but got Unknown
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		Label label = generator.DefineLabel();
		Label label2 = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		list.Add(val.Instruction);
		val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4]
		{
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_0, (object)null),
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		});
		list.Add(val.InstructionAt(-1));
		val.Advance(2).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null)
		}).Advance(1)
			.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[8]
			{
				new CodeInstruction(OpCodes.Brtrue_S, (object)label),
				list[1],
				new CodeInstruction(OpCodes.Ldloc_0, (object)null),
				new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null)),
				new CodeInstruction(OpCodes.Brtrue_S, (object)label),
				new CodeInstruction(OpCodes.Ldc_I4_1, (object)null),
				new CodeInstruction(OpCodes.Br_S, (object)label2),
				new CodeInstruction(OpCodes.Ldc_I4_0, (object)null)
			})
			.Advance(-1)
			.Labels.Add(label);
		val.Advance(1).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
		{
			new CodeInstruction(OpCodes.Br_S, (object)label2)
		}).Labels.Add(label2);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(StartOfRound), "LoadShipGrabbableItems")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerLSGI(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Expected O, but got Unknown
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Expected O, but got Unknown
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Expected O, but got Unknown
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Expected O, but got Unknown
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		object operand = val.Operand;
		val.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[6]
		{
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_2, (object)null),
			new CodeInstruction(OpCodes.Ldloc_S, (object)9),
			new CodeInstruction(OpCodes.Ldelem, (object)typeof(Vector3)),
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null)),
			new CodeInstruction(OpCodes.Brtrue, operand)
		});
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(StartOfRound), "TeleportPlayerInShipIfOutOfRoomBounds")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerTPISIOORB(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Expected O, but got Unknown
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		list.Add(val.Instruction);
		list.AddRange(val.InstructionsWithOffsets(-5, -2));
		val.Insert((CodeInstruction[])(object)new CodeInstruction[7]
		{
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[1],
			list[2],
			list[3],
			list[4],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		});
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(StartOfRound), "LateUpdate")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerLU(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Expected O, but got Unknown
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Expected O, but got Unknown
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Expected O, but got Unknown
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Expected O, but got Unknown
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Expected O, but got Unknown
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Expected O, but got Unknown
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Expected O, but got Unknown
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Expected O, but got Unknown
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0282: Expected O, but got Unknown
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Expected O, but got Unknown
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		Label label = generator.DefineLabel();
		Label label2 = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null)
		});
		list.Add(val.Instruction);
		list.AddRange(val.InstructionsWithOffsets(-5, -2));
		val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[7]
		{
			list[0],
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[1],
			list[2],
			list[3],
			list[4],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		});
		list.Clear();
		list.AddRange(val.InstructionsWithOffsets(-5, -2));
		val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[7]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label),
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[0],
			list[1],
			list[2],
			list[3],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1).Labels.Add(label);
		val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		});
		list.Clear();
		list.AddRange(val.InstructionsWithOffsets(-5, -2));
		val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[7]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label2),
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			list[0],
			list[1],
			list[2],
			list[3],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1).Labels.Add(label2);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(StartOfRound), "GetValueOfAllScrap")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerGVOAS(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Expected O, but got Unknown
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Expected O, but got Unknown
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Expected O, but got Unknown
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Expected O, but got Unknown
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		List<CodeInstruction> list = new List<CodeInstruction>();
		Label label = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipInnerRoomBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		});
		list.AddRange(val.InstructionsWithOffsets(-5, -2));
		val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[8]
		{
			new CodeInstruction(OpCodes.Brtrue, (object)label),
			new CodeInstruction(OpCodes.Ldarg_0, (object)null),
			new CodeInstruction(OpCodes.Ldloc_0, (object)null),
			list[0],
			list[1],
			list[2],
			list[3],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1).Labels.Add(label);
		return val.InstructionEnumeration();
	}

	[HarmonyTranspiler]
	[HarmonyPatch(typeof(StormyWeather), "PlayThunderEffects")]
	[HarmonyPriority(800)]
	private static IEnumerable<CodeInstruction> TranspilerSWPTE(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Expected O, but got Unknown
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Expected O, but got Unknown
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null)
		})
			.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4]
			{
				new CodeInstruction(OpCodes.Brtrue, (object)label),
				new CodeInstruction(OpCodes.Ldarg_0, (object)null),
				new CodeInstruction(OpCodes.Ldarg_1, (object)null),
				new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
			})
			.Advance(1)
			.Labels.Add(label);
		return val.InstructionEnumeration();
	}
}
public class MelShipBoundsCheck
{
	public static List<Collider> roomBounds = new List<Collider>();

	internal bool IsInShipRooms(Vector3 pos)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		foreach (BoxCollider roomBound in roomBounds)
		{
			BoxCollider val = roomBound;
			Bounds bounds = ((Collider)val).bounds;
			if (((Bounds)(ref bounds)).Contains(pos))
			{
				return true;
			}
		}
		return false;
	}
}
public class PocketRoom : NetworkBehaviour
{
	public Collider[] roomBounds;

	public Vector3 position;

	public Vector3 rotation;

	private void Awake()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.parent = StartOfRound.Instance.elevatorTransform;
		((Component)this).transform.localPosition = position;
		((Component)this).transform.localRotation = Quaternion.Euler(rotation);
		Collider[] array = roomBounds;
		foreach (Collider item in array)
		{
			MelShipBoundsCheck.roomBounds.Add(item);
		}
	}

	protected override void __initializeVariables()
	{
		((NetworkBehaviour)this).__initializeVariables();
	}

	protected override void __initializeRpcs()
	{
		((NetworkBehaviour)this).__initializeRpcs();
	}

	protected internal override string __getTypeName()
	{
		return "PocketRoom";
	}
}
internal static class PocketRoomCfg
{
	internal static ConfigEntry<bool> walkWarp;

	internal static ConfigEntry<string> warpBlacklist;

	internal static ConfigEntry<string> largeEmy;

	internal static ConfigEntry<int> enterTime0;

	internal static ConfigEntry<int> exitTime0;

	internal static ConfigEntry<int> enterTime1;

	internal static ConfigEntry<int> exitTime1;

	internal static void SetupConfig(ConfigFile config)
	{
		walkWarp = config.Bind<bool>("Customization", "Walk-In Teleport", true, "Toggle walk-in teleports when not in build mode.");
		warpBlacklist = config.Bind<string>("Customization", "Enemy Door Warp Blacklist", "SandWorm,ForestGiant,RadMech,Tornado,Guardsman,Cactus Budling,Driftwood Menace,Redwood Titan,Carnivorous Plant,Elder,Ogopogo,T-rex,Stegosaurus", "Prevent most listed enemies from using doors to pocket rooms.");
		largeEmy = config.Bind<string>("Customization", "Large-Size Enemy List", "MouthDog,Peace Keeper,Monarch", "Enemies considered large-sized for enter and exit times.");
		enterTime0 = config.Bind<int>("Customization", "Small Enemy Entrance Teleport Time", 2, "How long small enemies need to stand by entrances to teleport.");
		exitTime0 = config.Bind<int>("Customization", "Small Enemy Exit Teleport Time", 2, "How long small enemies need to stand by exits to teleport.");
		enterTime1 = config.Bind<int>("Customization", "Large Enemy Entrance Teleport Time", 3, "How long medium enemies need to stand by entrances to teleport.");
		exitTime1 = config.Bind<int>("Customization", "Large Enemy Exit Teleport Time", 3, "How long medium enemies need to stand by exits to teleport.");
	}
}
public class RoomTeleport : NetworkBehaviour
{
	[CompilerGenerated]
	private sealed class <TeleportTrigger>d__11 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public NavMeshAgent agent;

		public int time;

		public RoomTeleport <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <TeleportTrigger>d__11(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds((float)time);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				if (<>4__this.teleport || agent.isOnOffMeshLink)
				{
					agent.Warp(<>4__this.exitPoint.position);
				}
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public Transform entrancePoint;

	public Transform exitPoint;

	public bool isExit;

	private StartOfRound playersManager;

	private bool teleport = false;

	private int teleportTime0;

	private int teleportTime1;

	private void Awake()
	{
		playersManager = Object.FindObjectOfType<StartOfRound>();
		if (isExit)
		{
			teleportTime0 = PocketRoomCfg.exitTime0.Value;
			teleportTime1 = PocketRoomCfg.exitTime1.Value;
		}
		else
		{
			teleportTime0 = PocketRoomCfg.enterTime0.Value;
			teleportTime1 = PocketRoomCfg.enterTime1.Value;
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		EnemyAICollisionDetect val = default(EnemyAICollisionDetect);
		NavMeshAgent agent = default(NavMeshAgent);
		if (((Component)other).gameObject.CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent<PlayerControllerB>()) && (HarmonyPatches.walkWarp || ShipBuildModeManager.Instance.InBuildMode))
		{
			TeleportPlayer();
		}
		else if (((Component)other).gameObject.layer == 19 && ((Component)other).TryGetComponent<EnemyAICollisionDetect>(ref val) && !HarmonyPatches.blacklist.Contains(val.mainScript.enemyType) && ((Component)val.mainScript).TryGetComponent<NavMeshAgent>(ref agent))
		{
			if (HarmonyPatches.largeEmy.Contains(val.mainScript.enemyType))
			{
				((MonoBehaviour)this).StartCoroutine(TeleportTrigger(agent, teleportTime1));
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(TeleportTrigger(agent, teleportTime0));
			}
		}
	}

	private void OnTriggerStay(Collider other)
	{
		if (((Component)other).gameObject.layer == 19)
		{
			teleport = true;
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (((Component)other).gameObject.layer == 19)
		{
			teleport = false;
		}
	}

	[IteratorStateMachine(typeof(<TeleportTrigger>d__11))]
	private IEnumerator TeleportTrigger(NavMeshAgent agent, int time)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <TeleportTrigger>d__11(0)
		{
			<>4__this = this,
			agent = agent,
			time = time
		};
	}

	public void TeleportPlayer()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		Transform thisPlayerBody = GameNetworkManager.Instance.localPlayerController.thisPlayerBody;
		GameNetworkManager.Instance.localPlayerController.TeleportPlayer(exitPoint.position, false, 0f, false, true);
		thisPlayerBody.eulerAngles = new Vector3(thisPlayerBody.eulerAngles.x, exitPoint.eulerAngles.y, thisPlayerBody.eulerAngles.z);
		TeleportPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
	}

	[ServerRpc(RequireOwnership = false)]
	public void TeleportPlayerServerRpc(int playerObj)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(685105481u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerObj);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 685105481u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				TeleportPlayerClientRpc(playerObj);
			}
		}
	}

	[ClientRpc]
	public void TeleportPlayerClientRpc(int playerObj)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(784327969u, val, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, playerObj);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 784327969u, val, (RpcDelivery)0);
		}
		if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
		{
			base.__rpc_exec_stage = (__RpcExecStage)0;
			if (!((Object)(object)playersManager.allPlayerScripts[playerObj] == (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				playersManager.allPlayerScripts[playerObj].TeleportPlayer(exitPoint.position, true, exitPoint.eulerAngles.y, false, true);
			}
		}
	}

	protected override void __initializeVariables()
	{
		((NetworkBehaviour)this).__initializeVariables();
	}

	protected override void __initializeRpcs()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		((NetworkBehaviour)this).__registerRpc(685105481u, new RpcReceiveHandler(__rpc_handler_685105481), "TeleportPlayerServerRpc");
		((NetworkBehaviour)this).__registerRpc(784327969u, new RpcReceiveHandler(__rpc_handler_784327969), "TeleportPlayerClientRpc");
		((NetworkBehaviour)this).__initializeRpcs();
	}

	private static void __rpc_handler_685105481(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int playerObj = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((RoomTeleport)(object)target).TeleportPlayerServerRpc(playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_784327969(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int playerObj = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((RoomTeleport)(object)target).TeleportPlayerClientRpc(playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "RoomTeleport";
	}
}
public class SoundAPICompat
{
	[HarmonyTranspiler]
	[HarmonyPatch(typeof(PlayerLocationCondition), "EvaluateWithContext")]
	private static IEnumerable<CodeInstruction> TranspilerEWC(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: 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_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Expected O, but got Unknown
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Expected O, but got Unknown
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Expected O, but got Unknown
		CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
		Label label = generator.DefineLabel();
		List<CodeInstruction> list = new List<CodeInstruction>();
		List<CodeInstruction> list2 = new List<CodeInstruction>();
		val.Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(StartOfRound), "shipBounds"), (string)null)
		}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null)
		});
		list.AddRange(val.InstructionsWithOffsets(-3, -1));
		val.Advance(1).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[5]
		{
			new CodeInstruction(OpCodes.Brtrue_S, (object)label),
			list[0],
			list[1],
			list[2],
			new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MelShipBoundsCheck), "IsInShipRooms", (Type[])null, (Type[])null))
		}).Advance(1)
			.Labels.Add(label);
		return val.InstructionEnumeration();
	}
}
namespace MelaniePocketRoom
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("MelanieMelicious.pocketRoomLib", "Melanie Melicious - Pocket Room Library", "2.0.7")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.pocketRoomLib";

		private const string NAME = "Melanie Melicious - Pocket Room Library";

		private const string VERSION = "2.0.7";

		private readonly Harmony harmony = new Harmony("MelanieMelicious.pocketRoomLib");

		public static ManualLogSource mls;

		public static Plugin instance;

		private void Awake()
		{
			instance = this;
			PocketRoomCfg.SetupConfig(((BaseUnityPlugin)this).Config);
			mls = Logger.CreateLogSource("MelanieMelicious - Pocket Room Library");
			mls = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll(typeof(HarmonyPatches));
			if (Chainloader.PluginInfos.ContainsKey("com.github.teamxiaolan.dawnlib"))
			{
				harmony.PatchAll(typeof(DawnLibCompat));
			}
			else if (Chainloader.PluginInfos.ContainsKey("me.loaforc.soundapi.lethalcompany"))
			{
				harmony.PatchAll(typeof(SoundAPICompat));
			}
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace MelMPocketLib.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}