Decompiled source of Platform Zero v0.11.0

BepInEx/plugins/PlatformZero/PlatformZero.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen.Graph;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using TMPro;
using Unity.AI.Navigation;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyVersion("0.11.0.0")]
namespace PlatformZero;

public sealed class Station : MonoBehaviour
{
	private sealed class Bulkhead
	{
		internal Transform Panel;

		internal Collider Collider;

		internal Vector3 Center;

		internal Quaternion Rotation;

		internal float Width;

		internal float Fraction;

		internal float NextUse;

		internal bool Open;
	}

	private sealed class MovingDecoration
	{
		internal Transform Transform;

		internal Vector3 Position;

		internal Vector3 Axis;

		internal Quaternion Rotation;

		internal float Speed;

		internal float Bob;

		internal float Phase;
	}

	private const int PassageDoorBase = 500;

	private const int PassageOpen = 11;

	private const int PassageClose = 12;

	private const int CallboxBase = 300;

	private const int ServiceStart = 8;

	private const int ServiceStop = 9;

	private const int ServiceChime = 10;

	private const int ReturnBell = 200;

	private const int InspectionStart = 1;

	private const int Ticket = 2;

	private const int Blackout = 3;

	private const int Train = 4;

	private const int Return = 5;

	private const int Watcher = 7;

	private AudioSource ambience;

	private readonly Dictionary<string, Mesh[]> authoredProps = new Dictionary<string, Mesh[]>();

	private Material enamel;

	private Material brass;

	private Material paper;

	private Material fabric;

	private Material hazard;

	private Material floorTile;

	private readonly List<Texture2D> detailTextures = new List<Texture2D>();

	private readonly List<Mesh> detailMeshes = new List<Mesh>();

	private readonly Dictionary<Vector3, Mesh> surfaceMeshes = new Dictionary<Vector3, Mesh>();

	private readonly Dictionary<Material, List<CombineInstance>> detailBatches = new Dictionary<Material, List<CombineInstance>>();

	private Mesh detailCube;

	private Mesh detailCylinder;

	private int detailPieces;

	private int detailDraws;

	private Material[] photographs;

	private Material masterpiece;

	private Material gilding;

	private int photographCount;

	private int masterpieceCount;

	private readonly Dictionary<int, InteractTrigger> inspectionControls = new Dictionary<int, InteractTrigger>();

	private readonly Dictionary<int, TextMeshPro> inspectionLabels = new Dictionary<int, TextMeshPro>();

	private readonly Dictionary<int, float> inspectionReadyAt = new Dictionary<int, float>();

	private TextMeshPro detentionCountdown;

	private float nextInspectionLabel;

	private readonly Dictionary<int, Bulkhead> bulkheads = new Dictionary<int, Bulkhead>();

	private AudioClip doorGrind;

	private float nextDoorCheck;

	private readonly ReturnServiceState returnService = new ReturnServiceState();

	private readonly List<TextMeshPro> serviceLabels = new List<TextMeshPro>();

	private readonly List<GameObject> routeMarkers = new List<GameObject>();

	private int[] serviceRoute = new int[0];

	private Mesh serviceArrow;

	private double nextServiceChime;

	private double nextServiceLabel;

	private int serviceChimeIndex;

	internal bool LootReported;

	private StationPlan plan;

	private Random events;

	internal static readonly Vector3 Origin = new Vector3(0f, -600f, 0f);

	private readonly List<Material> materials = new List<Material>();

	private readonly List<AudioClip> clips = new List<AudioClip>();

	private readonly List<Action> restores = new List<Action>();

	private readonly List<Light> lights = new List<Light>();

	private readonly List<Vector3> loot = new List<Vector3>();

	private readonly Dictionary<int, Vector3> buttons = new Dictionary<int, Vector3>();

	private readonly Dictionary<int, float> cooldowns = new Dictionary<int, float>();

	private readonly Dictionary<ulong, float> detained = new Dictionary<ulong, float>();

	private readonly HashSet<int> tickets = new HashSet<int>();

	private Material concrete;

	private Material tile;

	private Material rust;

	private Material dark;

	private Material teal;

	private Material amber;

	private Material red;

	private Material white;

	private TMP_FontAsset font;

	private Sprite hand;

	private AudioClip chime;

	private AudioClip rumble;

	private AudioClip breath;

	private TextMeshPro board;

	private GameObject train;

	private Vector3 trainFrom;

	private Vector3 trainTo;

	private readonly List<Vector3> exitArrivals = new List<Vector3>();

	private float nextEvent;

	private float blackoutUntil;

	private float boardUntil;

	private float trainStarted = -100f;

	private int lastEvent = -1;

	private bool ready;

	private bool restored;

	private bool localDetained;

	private Vector3 localReturn;

	private float localRelease;

	private static readonly string[] SurrealNotices = new string[44]
	{
		"THE TENANT IS STILL UPSTAIRS", "THE ECLIPSE IS LOOKING BACK", "NO DIVING INTO THE CEILING", "YOU HAVE ALREADY CLIMBED THESE", "PLEASE SPEAK INTO THE DARK", "THE TREES REMEMBER YOUR VOICE", "TIME SERVED IS NOT TIME LEFT", "LEAVE YOUR WEIGHT AT THE DOOR", "YOUR DESK IS AT THE END", "DO NOT JOIN THE CHOIR",
		"FEED ONLY AFTER THE GLASS BLINKS", "YOUR CALL IS COMING FROM INSIDE", "THE PORTRAITS ARE YOUR PREDECESSORS", "THE LAST DANCE HAS NO PARTNER", "KEEP THE STARS ASLEEP", "SUNRISE HAS BEEN CANCELLED", "ALL COMPLAINTS HAVE BEEN RELEASED", "THE COMPANY FINDS YOU REPLACEABLE", "ALL FLOORS ARE THE SAME FLOOR", "PLEASE DO NOT TOUCH THE KEYS",
		"THIS MOON WAS NOT ON THE MANIFEST", "BELIEF IS NOT A VALID TICKET", "PLEASE RETURN THE SMALL PEOPLE", "THERE IS ALWAYS ONE MORE DOOR", "DECLARE ALL REFLECTIONS", "DO NOT TOUCH THE GLASS ROOTS", "PLEASE RETURN TOMORROWS FILES", "PRECIPITATION IS COMPANY PROPERTY", "APPLAUSE IS STRICTLY PROHIBITED", "YOUR REMAINING HOURS ARE ON DEPOSIT",
		"THIS IS NOT YOUR NIGHT SKY", "REMOVE ALL PERSONAL GRAVITY", "DO NOT BURN AFTER READING", "EVERY EXHIBIT MISSED THE LAST TRAIN", "EXCHANGE ONLY UNOPENED STORMS", "YOUR GUESTS HAVE ALREADY LEFT", "STAND BEHIND THE OTHER YELLOW LINE", "PLEASE WAIT FOR YOUR VOICE TO RETURN", "THIS IS NOT THE STATIONS ONLY HEART", "DEVELOP ONLY IN THE ABSENCE OF MEMORY",
		"TRACK ENDS / JOURNEY CONTINUES", "INTEREST ACCRUES WHILE YOU SLEEP", "DO NOT WAKE THE RESERVE PASSENGERS", "REPEAT UNTIL EVERYONE HAS LEFT"
	};

	private readonly List<MovingDecoration> movingDecorations = new List<MovingDecoration>();

	private double ServiceTime
	{
		get
		{
			//IL_0012: 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)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null))
			{
				NetworkTime serverTime = NetworkManager.Singleton.ServerTime;
				return ((NetworkTime)(ref serverTime)).Time;
			}
			return Time.time;
		}
	}

	public int Seed { get; private set; }

	internal Vector3 MainArrival => W(plan.Rooms[0].X + 5, 0.15f, (float)plan.Rooms[0].Z + (float)plan.Rooms[0].Depth / 2f - 1.8f);

	private void BuildAmbience()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected O, but got Unknown
		AudioClip val = AudioClip.Create("Platform Zero - After the last service", 1058400, 1, 22050, false);
		val.SetData(Soundscape.Create(), 0);
		clips.Add(val);
		GameObject val2 = new GameObject("Station ambient soundtrack");
		val2.transform.SetParent(((Component)this).transform, false);
		ambience = val2.AddComponent<AudioSource>();
		ambience.clip = val;
		ambience.loop = true;
		ambience.playOnAwake = false;
		ambience.spatialBlend = 0f;
		if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.musicSource != (Object)null)
		{
			ambience.outputAudioMixerGroup = SoundManager.Instance.musicSource.outputAudioMixerGroup;
		}
		ambience.volume = 0f;
		ambience.priority = 200;
		ambience.Play();
	}

	private void UpdateAmbience()
	{
		if (!((Object)(object)ambience == (Object)null))
		{
			PlayerControllerB val = Local();
			bool flag = (Object)(object)val != (Object)null && !val.isPlayerDead && InStation(val) && (Object)(object)StartOfRound.Instance != (Object)null && !StartOfRound.Instance.inShipPhase;
			float num = (flag ? Plugin.Instance.AmbientVolume.Value : 0f);
			if (flag && InRedRoom(val))
			{
				num *= 0.3f;
			}
			ambience.volume = Mathf.MoveTowards(ambience.volume, num, Time.deltaTime * 0.08f);
		}
	}

	private Vector3 WallPoint(StationPlan.Room r, int side, float along, float height, float inset)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		return (Vector3)(side switch
		{
			0 => W((float)r.X + along, height, (float)r.Z + (float)r.Depth * 0.5f - inset), 
			1 => W((float)r.X + along, height, (float)r.Z - (float)r.Depth * 0.5f + inset), 
			2 => W((float)r.X + (float)r.Width * 0.5f - inset, height, (float)r.Z + along), 
			_ => W((float)r.X - (float)r.Width * 0.5f + inset, height, (float)r.Z + along), 
		});
	}

	private bool WallOpen(StationPlan.Room r, int side)
	{
		int num = side switch
		{
			3 => -1, 
			2 => 1, 
			_ => 0, 
		};
		int num2 = side switch
		{
			1 => -1, 
			0 => 1, 
			_ => 0, 
		};
		int a = Array.IndexOf(plan.Rooms, r);
		for (int i = 0; i < plan.Rooms.Length; i++)
		{
			if (plan.Rooms[i].CellX == r.CellX + num && plan.Rooms[i].CellZ == r.CellZ + num2 && plan.Connected(a, i))
			{
				return true;
			}
		}
		return false;
	}

	private void DetailRoom(StationPlan.Room r, int index)
	{
		//IL_039a: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0282: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_053e: Unknown result type (might be due to invalid IL or missing references)
		//IL_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_030c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0641: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0715: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < 4; i++)
		{
			float num = ((i < 2) ? r.Width : r.Depth);
			float yaw = ((i >= 2) ? 90 : 0);
			bool flag = WallOpen(r, i);
			for (float num2 = (0f - num) / 2f + 1.5f; num2 < num / 2f - 1f; num2 += 3f)
			{
				if ((flag && Math.Abs(num2) < 3.5f) || (i == 1 && Math.Abs(num2 + 5f) < 2.6f))
				{
					continue;
				}
				DBox(WallPoint(r, i, num2, 0.85f, 0.28f), new Vector3(2.86f, 1.7f, 0.12f), enamel, yaw);
				DBox(WallPoint(r, i, num2, 1.76f, 0.37f), new Vector3(2.95f, 0.09f, 0.12f), brass, yaw);
				DBox(WallPoint(r, i, num2, 0.12f, 0.39f), new Vector3(2.95f, 0.24f, 0.16f), dark, yaw);
				DBox(WallPoint(r, i, num2 - 1.43f, 2.5f, 0.3f), new Vector3(0.13f, 4.9f, 0.19f), rust, yaw);
				for (int j = -1; j <= 1; j += 2)
				{
					DBox(WallPoint(r, i, num2 + (float)j * 1.28f, 1.55f, 0.36f), new Vector3(0.065f, 0.065f, 0.05f), brass, yaw);
				}
				if (((int)(num2 + num) + r.Variant) % 3 == 0)
				{
					DBox(WallPoint(r, i, num2, 3.15f, 0.27f), new Vector3(1.4f, 0.85f, 0.13f), dark, yaw);
					for (int k = 0; k < 6; k++)
					{
						DBox(WallPoint(r, i, num2, 2.85f + (float)k * 0.12f, 0.36f), new Vector3(1.32f, 0.055f, 0.06f), rust, yaw);
					}
				}
			}
			DBox(WallPoint(r, i, 0f, (float)r.Height - 0.5f, 0.35f), new Vector3(num - 0.8f, 0.32f, 0.36f), rust, yaw);
			if (flag)
			{
				for (int l = -1; l <= 1; l += 2)
				{
					DBox(WallPoint(r, i, (float)l * 2.14f, 1.85f, 0.32f), new Vector3(0.24f, 3.7f, 0.28f), enamel, yaw);
				}
				DBox(WallPoint(r, i, 0f, 3.68f, 0.32f), new Vector3(4.5f, 0.28f, 0.3f), enamel, yaw);
				DBox(WallPoint(r, i, 0f, 0.035f, 0.48f), new Vector3(3.9f, 0.045f, 0.55f), hazard, yaw);
			}
		}
		for (int m = -1; m <= 1; m++)
		{
			float z = (float)r.Z + (float)(m * r.Depth) * 0.28f;
			DBox(W(r.X, (float)r.Height - 0.8f, z), new Vector3((float)r.Width - 0.6f, 0.36f, 0.18f), dark);
			DBox(W(r.X, (float)r.Height - 0.99f, z), new Vector3((float)r.Width - 0.6f, 0.08f, 0.55f), rust);
		}
		for (int n = -1; n <= 1; n += 2)
		{
			DBox(W((float)r.X + (float)n * 0.55f, (float)r.Height - 1.35f, r.Z), new Vector3(0.08f, 0.16f, (float)r.Depth - 0.8f), rust);
		}
		for (float num3 = -r.Depth / 2 + 1; num3 < (float)(r.Depth / 2); num3 += 1.5f)
		{
			DBox(W(r.X, (float)r.Height - 1.4f, (float)r.Z + num3), new Vector3(1.1f, 0.05f, 0.08f), dark);
		}
		for (int num4 = 0; num4 < 3; num4++)
		{
			Rod(W((float)r.X - 0.32f + (float)num4 * 0.32f, (float)r.Height - 1.31f, (float)(r.Z - r.Depth / 2) + 0.5f), W((float)r.X - 0.32f + (float)num4 * 0.32f, (float)r.Height - 1.31f, (float)(r.Z + r.Depth / 2) - 0.5f), 0.07f, (num4 == 1) ? rust : dark);
		}
		for (int num5 = -1; num5 <= 1; num5 += 2)
		{
			float x = r.X + num5 * (r.Width / 2 - 3);
			DBox(W(x, 0.018f, r.Z), new Vector3(0.48f, 0.022f, (float)(r.Depth - 6)), dark);
			for (float num6 = -r.Depth / 2 + 3; num6 < (float)(r.Depth / 2 - 3); num6 += 0.65f)
			{
				DBox(W(x, 0.035f, (float)r.Z + num6), new Vector3(0.46f, 0.015f, 0.055f), rust);
			}
		}
		DetailWallBay(r, index);
		DetailFurniture(r);
		Random random = StationPlan.CreateRandom(Seed, (uint)(1145394176 + index));
		for (int num7 = 0; num7 < 7; num7++)
		{
			float x2 = (float)r.X + (float)((num7 % 2 != 0) ? 1 : (-1)) * ((float)(r.Width / 2) - 3.5f);
			float z2 = (float)(r.Z - 4) + (float)random.NextDouble() * 8f;
			DBox(W(x2, 0.06f, z2), new Vector3(0.2f + (float)random.NextDouble() * 0.2f, 0.025f, 0.3f), (num7 % 3 == 0) ? rust : paper, random.Next(180));
		}
	}

	private void DetailPassage(float x, float z, float length, bool horizontal, StationPlan.Link link)
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		float yaw = (horizontal ? 90 : 0);
		for (int i = -1; i <= 1; i += 2)
		{
			Vector3 val = W(x + (horizontal ? 0f : ((float)i * ((float)(link.Width / 2) - 0.26f))), 1f, z + (horizontal ? ((float)i * ((float)(link.Width / 2) - 0.26f)) : 0f));
			DBox(val, new Vector3(0.12f, 1.8f, length), enamel, yaw);
			DBox(val + Vector3.up * 0.97f, new Vector3(0.2f, 0.08f, length), brass, yaw);
			Vector3 val2 = W(x + (horizontal ? ((0f - length) / 2f) : ((float)i * ((float)(link.Width / 2) - 0.4f))), 3.5f, z + (horizontal ? ((float)i * ((float)(link.Width / 2) - 0.4f)) : ((0f - length) / 2f)));
			Vector3 b = val2 + (horizontal ? Vector3.right : Vector3.forward) * length;
			Rod(val2, b, 0.17f, rust);
		}
		for (float num = (0f - length) / 2f + 0.5f; num < length / 2f; num += 2.7f)
		{
			float num2 = x + (horizontal ? num : 0f);
			float num3 = z + (horizontal ? 0f : num);
			DBox(W(num2, 4.35f, num3), new Vector3((float)link.Width, 0.16f, 0.24f), enamel, yaw);
			for (int j = -1; j <= 1; j += 2)
			{
				DBox(W(num2 + (horizontal ? 0f : ((float)j * ((float)(link.Width / 2) - 0.28f))), 2.15f, num3 + (horizontal ? ((float)j * ((float)(link.Width / 2) - 0.28f)) : 0f)), new Vector3(0.18f, 4.3f, 0.22f), rust, yaw);
			}
		}
		FlushDetails("Passage structural details");
	}

	private Mesh[] LoadProp(string name)
	{
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Expected O, but got Unknown
		if (authoredProps.TryGetValue(name, out var value))
		{
			return value;
		}
		using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PlatformZero.Art." + name + ".p0mesh"))
		{
			if (stream == null)
			{
				throw new InvalidOperationException("Missing authored prop: " + name);
			}
			using BinaryReader binaryReader = new BinaryReader(stream);
			if (binaryReader.ReadInt32() != 1345342769 || binaryReader.ReadInt32() != 5)
			{
				throw new InvalidDataException("Invalid prop header");
			}
			value = (Mesh[])(object)new Mesh[5];
			for (int i = 0; i < 5; i++)
			{
				int num = binaryReader.ReadInt32();
				int num2 = binaryReader.ReadInt32();
				if (num != i || num2 < 0 || num2 > 60000 || num2 % 3 != 0)
				{
					throw new InvalidDataException("Invalid prop mesh");
				}
				if (num2 != 0)
				{
					Vector3[] array = (Vector3[])(object)new Vector3[num2];
					Vector3[] array2 = (Vector3[])(object)new Vector3[num2];
					Vector2[] array3 = (Vector2[])(object)new Vector2[num2];
					int[] array4 = new int[num2];
					for (int j = 0; j < num2; j++)
					{
						ref Vector3 reference = ref array[j];
						reference = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
						ref Vector3 reference2 = ref array2[j];
						reference2 = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
						ref Vector2 reference3 = ref array3[j];
						reference3 = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle());
						array4[j] = j;
					}
					Mesh val = new Mesh();
					((Object)val).name = "P0 Blender " + name + " " + i;
					val.vertices = array;
					val.normals = array2;
					val.uv = array3;
					val.triangles = array4;
					val.RecalculateBounds();
					value[i] = val;
					detailMeshes.Add(val);
				}
			}
		}
		authoredProps.Add(name, value);
		return value;
	}

	private void AuthoredRoomProps(StationPlan.Room room, int index)
	{
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Expected O, but got Unknown
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		string text = StationPlan.Names[room.Kind];
		string text2 = ((text.Contains("LUGGAGE") || text.Contains("ARCHIVE") || text.Contains("CUSTOMS")) ? "trolley" : ((text.Contains("GENERATOR") || text.Contains("SIGNAL") || text.Contains("SERVER") || text.Contains("ENGINE")) ? "cabinet" : ((text.Contains("PLATFORM") || text.Contains("CANTEEN") || text.Contains("DEPARTURE") || text.Contains("TRANSIT")) ? "bench" : null)));
		if (text2 == null)
		{
			return;
		}
		Vector3 val = W((float)room.X - (float)room.Width * 0.5f + ((text2 == "cabinet") ? 0.38f : ((text2 == "trolley") ? 1.2f : 0.9f)), (text2 == "cabinet") ? 1.1f : 0f, (float)room.Z + (float)room.Depth * 0.5f - 4.2f);
		Quaternion rotation = Quaternion.Euler(0f, -90f, 0f);
		Material[] array = (Material[])(object)new Material[5] { enamel, rust, dark, brass, paper };
		Mesh[] array2 = LoadProp(text2);
		for (int i = 0; i < array2.Length; i++)
		{
			if ((Object)(object)array2[i] != (Object)null)
			{
				AddDetail(array2[i], val, Vector3.one, rotation, array[i]);
			}
		}
		GameObject val2 = new GameObject("Authored " + text2 + " collision");
		val2.transform.SetParent(((Component)this).transform, false);
		val2.transform.position = val;
		val2.transform.rotation = rotation;
		val2.layer = LayerMask.NameToLayer("Room");
		BoxCollider val3 = val2.AddComponent<BoxCollider>();
		val3.center = new Vector3(0f, (text2 == "bench") ? 0.5f : ((text2 == "trolley") ? 0.65f : 0.85f), 0f);
		val3.size = ((text2 == "bench") ? new Vector3(2.6f, 1.05f, 0.85f) : ((text2 == "trolley") ? new Vector3(1.15f, 1.3f, 1.8f) : new Vector3(0.85f, 1.5f, 0.45f)));
	}

	private void BuildDetailMaterials()
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		PaintSurface(concrete, 0);
		PaintSurface(tile, 1);
		PaintSurface(rust, 2);
		PaintSurface(dark, 2);
		enamel = Mat("Worn transit enamel", new Color(0.18f, 0.32f, 0.29f), 0f);
		PaintSurface(enamel, 2);
		brass = Mat("Tarnished brass", new Color(0.48f, 0.35f, 0.18f), 0f);
		PaintSurface(brass, 2);
		brass.SetFloat("_Metallic", 0.65f);
		paper = Mat("Aged paper", new Color(0.68f, 0.61f, 0.43f), 0f);
		PaintSurface(paper, 3);
		fabric = Mat("Seat upholstery", new Color(0.2f, 0.27f, 0.23f), 0f);
		PaintSurface(fabric, 4);
		hazard = Mat("Scuffed hazard paint", Color.white, 0f);
		PaintSurface(hazard, 5);
		floorTile = Mat("Station terrazzo", new Color(0.39f, 0.41f, 0.36f), 0f);
		PaintSurface(floorTile, 6);
		GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
		detailCube = val.GetComponent<MeshFilter>().sharedMesh;
		val.SetActive(false);
		Object.Destroy((Object)(object)val);
		val = GameObject.CreatePrimitive((PrimitiveType)2);
		detailCylinder = val.GetComponent<MeshFilter>().sharedMesh;
		val.SetActive(false);
		Object.Destroy((Object)(object)val);
	}

	private void PaintSurface(Material material, int style)
	{
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Expected O, but got Unknown
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Expected O, but got Unknown
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_027e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
		Color32[] array = (Color32[])(object)new Color32[65536];
		Color32[] array2 = (Color32[])(object)new Color32[array.Length];
		Random random = new Random(1977 + style * 53);
		Color val = default(Color);
		for (int i = 0; i < 256; i++)
		{
			for (int j = 0; j < 256; j++)
			{
				float num = (float)random.NextDouble();
				float num2 = Mathf.PerlinNoise((float)j / 37f + (float)(style * 7), (float)i / 42f);
				float num3 = 0.65f + num2 * 0.35f + (num - 0.5f) * 0.18f;
				((Color)(ref val))..ctor(num3, num3 * 0.98f, num3 * 0.94f);
				if (style == 1 || style == 6)
				{
					int num4 = ((style == 1) ? 64 : 128);
					int num5 = ((style == 1) ? 32 : 128);
					int num6 = (j + i / num5 % 2 * ((style == 1) ? 32 : 0)) % num4;
					int num7 = i % num5;
					if (num6 < 2 || num7 < 2)
					{
						((Color)(ref val))..ctor(0.16f, 0.18f, 0.17f);
					}
					else
					{
						val = ((num6 != 2 && num7 != 2) ? (val * (0.86f + 0.14f * Mathf.PerlinNoise((float)(j / num4 * 13), (float)(i / num5 * 11)))) : (Color.white * 0.94f));
					}
					if (style == 6 && num > 0.93f)
					{
						val *= 0.52f;
					}
				}
				if (style == 2)
				{
					if (num2 < 0.34f && num > 0.35f)
					{
						((Color)(ref val))..ctor(0.36f, 0.23f, 0.13f);
					}
					if (j % 61 < 1 && num > 0.7f)
					{
						val *= 0.42f;
					}
				}
				if (style == 3)
				{
					val *= 0.82f + num * 0.18f;
				}
				if (style == 4)
				{
					val *= (((j + i) % 3 == 0) ? 0.55f : 0.94f);
				}
				if (style == 5)
				{
					val = (((j + i) / 32 % 2 == 0) ? new Color(0.82f, 0.57f, 0.13f) : new Color(0.06f, 0.065f, 0.055f)) * num3;
				}
				if (style == 0 && Math.Abs((double)(j - 128) - Math.Sin((double)i * 0.053) * 11.0) < 1.0)
				{
					val *= 0.35f;
				}
				ref Color32 reference = ref array[i * 256 + j];
				reference = Color32.op_Implicit(val);
				byte b = (byte)(style switch
				{
					2 => 0.32f, 
					1 => 0.42f, 
					_ => 0.12f, 
				} * 255f * (0.7f + num * 0.3f));
				ref Color32 reference2 = ref array2[i * 256 + j];
				reference2 = new Color32((byte)((style == 2) ? 90u : 0u), byte.MaxValue, (byte)0, b);
			}
		}
		Texture2D val2 = new Texture2D(256, 256, (TextureFormat)4, true);
		((Object)val2).name = "P0 original surface " + style;
		((Texture)val2).wrapMode = (TextureWrapMode)0;
		((Texture)val2).filterMode = (FilterMode)2;
		((Texture)val2).anisoLevel = 4;
		val2.SetPixels32(array);
		val2.Apply(true, true);
		detailTextures.Add(val2);
		material.SetTexture("_BaseColorMap", (Texture)(object)val2);
		Texture2D val3 = new Texture2D(256, 256, (TextureFormat)4, true, true);
		((Object)val3).name = "P0 roughness " + style;
		((Texture)val3).wrapMode = (TextureWrapMode)0;
		val3.SetPixels32(array2);
		val3.Apply(true, true);
		detailTextures.Add(val3);
		material.SetTexture("_MaskMap", (Texture)(object)val3);
		material.EnableKeyword("_MASKMAP");
		material.SetFloat("_SmoothnessRemapMin", 0.05f);
		material.SetFloat("_SmoothnessRemapMax", 0.55f);
	}

	private Mesh SurfaceMesh(Vector3 size)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		if (surfaceMeshes.TryGetValue(size, out var value))
		{
			return value;
		}
		value = Object.Instantiate<Mesh>(detailCube);
		((Object)value).name = "P0 metre-scaled surface";
		Vector3[] vertices = value.vertices;
		Vector3[] normals = value.normals;
		Vector2[] uv = value.uv;
		for (int i = 0; i < uv.Length; i++)
		{
			Vector3 val = Vector3.Scale(vertices[i] + Vector3.one * 0.5f, size);
			Vector3 val2 = normals[i];
			ref Vector2 reference = ref uv[i];
			reference = ((Mathf.Abs(val2.y) > 0.5f) ? new Vector2(val.x, val.z) : ((Mathf.Abs(val2.x) > 0.5f) ? new Vector2(val.z, val.y) : new Vector2(val.x, val.y)));
			ref Vector2 reference2 = ref uv[i];
			reference2 *= 0.5f;
		}
		value.uv = uv;
		surfaceMeshes[size] = value;
		detailMeshes.Add(value);
		return value;
	}

	private void ApplySurfaceUV(GameObject obj, Vector3 size, Material material)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)detailCube != (Object)null && (Object)(object)material.GetTexture("_BaseColorMap") != (Object)null)
		{
			obj.GetComponent<MeshFilter>().sharedMesh = SurfaceMesh(size);
		}
	}

	private void DBox(Vector3 pos, Vector3 size, Material material, float yaw = 0f)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: 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)
		AddDetail(SurfaceMesh(size), pos, size, Quaternion.Euler(0f, yaw, 0f), material);
	}

	private void Rod(Vector3 a, Vector3 b, float diameter, Material material)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = b - a;
		if (!(((Vector3)(ref val)).sqrMagnitude < 1E-05f))
		{
			AddDetail(detailCylinder, (a + b) * 0.5f, new Vector3(diameter, ((Vector3)(ref val)).magnitude * 0.5f, diameter), Quaternion.FromToRotation(Vector3.up, val), material);
		}
	}

	private void AddDetail(Mesh mesh, Vector3 pos, Vector3 size, Quaternion rotation, Material material)
	{
		//IL_0028: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		if (!detailBatches.TryGetValue(material, out var value))
		{
			value = new List<CombineInstance>();
			detailBatches[material] = value;
		}
		List<CombineInstance> list = value;
		CombineInstance item = default(CombineInstance);
		((CombineInstance)(ref item)).mesh = mesh;
		((CombineInstance)(ref item)).transform = Matrix4x4.TRS(pos - Origin, rotation, size);
		list.Add(item);
		detailPieces++;
	}

	private void FlushDetails(string name)
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Expected O, but got Unknown
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Expected O, but got Unknown
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		foreach (KeyValuePair<Material, List<CombineInstance>> detailBatch in detailBatches)
		{
			if (detailBatch.Value.Count != 0)
			{
				Mesh val = new Mesh();
				((Object)val).name = "P0 " + name;
				val.indexFormat = (IndexFormat)1;
				val.CombineMeshes(detailBatch.Value.ToArray(), true, true);
				val.RecalculateBounds();
				detailMeshes.Add(val);
				GameObject val2 = new GameObject(name);
				val2.transform.SetParent(((Component)this).transform, false);
				val2.transform.position = Origin;
				val2.AddComponent<MeshFilter>().sharedMesh = val;
				MeshRenderer val3 = val2.AddComponent<MeshRenderer>();
				((Renderer)val3).sharedMaterial = detailBatch.Key;
				((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0;
				detailDraws++;
				detailBatch.Value.Clear();
			}
		}
	}

	private void DisposeDetails()
	{
		foreach (Texture2D detailTexture in detailTextures)
		{
			if ((Object)(object)detailTexture != (Object)null)
			{
				Object.Destroy((Object)(object)detailTexture);
			}
		}
		foreach (Mesh detailMesh in detailMeshes)
		{
			if ((Object)(object)detailMesh != (Object)null)
			{
				Object.Destroy((Object)(object)detailMesh);
			}
		}
	}

	private void Dial(float x, float y, float z, float radius)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		Rod(W(x, y, z + 0.06f), W(x, y, z - 0.02f), radius * 2f, brass);
		Rod(W(x, y, z - 0.03f), W(x, y, z - 0.05f), radius * 1.7f, paper);
		for (int i = 0; i < 8; i++)
		{
			float num = (float)i * (float)Math.PI / 4f;
			DBox(W(x + Mathf.Sin(num) * radius * 0.68f, y + Mathf.Cos(num) * radius * 0.68f, z - 0.07f), new Vector3(0.024f, 0.04f, 0.018f), dark);
		}
		Rod(W(x, y, z - 0.085f), W(x + radius * 0.35f, y + radius * 0.45f, z - 0.085f), 0.018f, red);
	}

	private void DetailWallBay(StationPlan.Room r, int index)
	{
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0540: Unknown result type (might be due to invalid IL or missing references)
		//IL_0554: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_091b: Unknown result type (might be due to invalid IL or missing references)
		//IL_092f: Unknown result type (might be due to invalid IL or missing references)
		//IL_099d: Unknown result type (might be due to invalid IL or missing references)
		//IL_09bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0599: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0604: Unknown result type (might be due to invalid IL or missing references)
		//IL_062e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0642: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0337: Unknown result type (might be due to invalid IL or missing references)
		//IL_070a: Unknown result type (might be due to invalid IL or missing references)
		//IL_071e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_0757: Unknown result type (might be due to invalid IL or missing references)
		//IL_0837: Unknown result type (might be due to invalid IL or missing references)
		//IL_0846: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0409: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_047b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0509: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_0899: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_068f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_078b: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0800: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
		float num = r.X + 5;
		float num2 = (float)(r.Z + r.Depth / 2) - 0.45f;
		int num3;
		switch (r.Kind)
		{
		case 0:
		case 2:
		case 4:
		case 8:
		case 14:
		case 16:
		case 36:
		case 46:
			num3 = 0;
			break;
		case 1:
		case 6:
		case 10:
		case 15:
		case 18:
		case 24:
		case 27:
		case 39:
		case 47:
		case 51:
		case 52:
		case 54:
			num3 = 1;
			break;
		case 3:
		case 5:
		case 7:
		case 11:
		case 17:
		case 20:
		case 28:
		case 31:
		case 37:
		case 44:
		case 50:
			num3 = 2;
			break;
		case 13:
		case 22:
		case 25:
		case 30:
		case 34:
		case 45:
			num3 = 3;
			break;
		case 12:
		case 19:
		case 21:
		case 26:
		case 35:
		case 40:
		case 49:
			num3 = 4;
			break;
		default:
			num3 = 5;
			break;
		}
		DBox(W(num, 2.45f, num2), new Vector3(3.8f, 2.5f, 0.17f), dark);
		DBox(W(num, 2.45f, num2 - 0.11f), new Vector3(3.6f, 2.3f, 0.1f), enamel);
		for (int i = -1; i <= 1; i += 2)
		{
			DBox(W(num + (float)i * 1.86f, 2.45f, num2 - 0.2f), new Vector3(0.07f, 2.5f, 0.05f), brass);
		}
		TextMeshPro val = Label("P0 / " + StationPlan.Names[r.Kind] + "\n" + num3 switch
		{
			0 => "UNCLAIMED INVENTORY", 
			1 => "AUXILIARY SERVICES", 
			_ => "PASSENGER INFORMATION", 
		}, W(num, 3.95f, num2 - 0.13f), 0f, 1.45f, new Color(0.87f, 0.77f, 0.53f));
		((TMP_Text)val).rectTransform.sizeDelta = new Vector2(4.5f, 1f);
		switch (num3)
		{
		case 0:
		{
			for (int num6 = 0; num6 < 3; num6++)
			{
				for (int num7 = 0; num7 < 5; num7++)
				{
					float x2 = num - 1.4f + (float)num7 * 0.7f;
					float num8 = 1.6f + (float)num6 * 0.64f;
					DBox(W(x2, num8, num2 - 0.23f), new Vector3(0.62f, 0.54f, 0.1f), rust);
					DBox(W(x2, num8 + 0.08f, num2 - 0.3f), new Vector3(0.29f, 0.13f, 0.025f), paper);
					DBox(W(x2, num8 - 0.11f, num2 - 0.34f), new Vector3(0.23f, 0.055f, 0.1f), brass);
				}
			}
			Label("CONTENTS RETAINED AFTER DEATH", W(num, 1.04f, num2 - 0.22f), 0f, 0.95f, Color.white);
			return;
		}
		case 1:
		{
			for (int n = -1; n <= 1; n++)
			{
				Dial(num + (float)n, 2.95f, num2 - 0.3f, 0.27f);
			}
			for (int num5 = 0; num5 < 6; num5++)
			{
				float x = num - 1.4f + (float)num5 * 0.55f;
				DBox(W(x, 2f, num2 - 0.25f), new Vector3(0.3f, 0.62f, 0.14f), dark);
				Rod(W(x, 1.85f, num2 - 0.38f), W(x, 2.17f, num2 - 0.43f), 0.075f, brass);
				DBox(W(x, 2.48f, num2 - 0.3f), new Vector3(0.14f, 0.09f, 0.03f), (num5 == r.Variant % 6) ? red : teal);
			}
			Rod(W(num + 1.55f, 1.3f, num2 - 0.25f), W(num + 1.55f, 0.3f, num2 - 0.25f), 0.16f, rust);
			Label("PRESSURE / SIGNAL / LOAD\nDISCONNECT BEFORE SERVICING", W(num, 1.05f, num2 - 0.22f), 0f, 0.95f, Color.white);
			return;
		}
		case 2:
		{
			DBox(W(num - 0.65f, 2.55f, num2 - 0.21f), new Vector3(1.7f, 1.65f, 0.04f), paper);
			for (int num9 = 0; num9 < 9; num9++)
			{
				DBox(W(num - 0.75f + (float)(num9 % 3) * 0.08f, 3.15f - (float)num9 * 0.15f, num2 - 0.24f), new Vector3((num9 % 3 == 0) ? 1.2f : 0.9f, 0.025f, 0.008f), dark);
			}
			DBox(W(num + 1.05f, 2.85f, num2 - 0.28f), new Vector3(0.78f, 0.8f, 0.15f), dark);
			DBox(W(num + 1.05f, 2.93f, num2 - 0.37f), new Vector3(0.56f, 0.41f, 0.025f), teal);
			for (int num10 = 0; num10 < 3; num10++)
			{
				DBox(W(num + 0.86f + (float)num10 * 0.19f, 2.56f, num2 - 0.38f), new Vector3(0.085f, 0.05f, 0.025f), brass);
			}
			Label("DEPARTURES\n00:00  HOME\n00:00  HOME\n00:00  HOME", W(num + 0.9f, 1.8f, num2 - 0.24f), 0f, 0.95f, Color.white);
			return;
		}
		case 3:
		{
			for (int j = -1; j <= 1; j++)
			{
				float num4 = num + (float)j;
				DBox(W(num4, 2.5f, num2 - 0.24f), new Vector3(0.8f, 1.65f, 0.1f), dark);
				Rod(W(num4, 1.87f, num2 - 0.34f), W(num4, 3.1f, num2 - 0.34f), 0.075f, brass);
				for (int k = 0; k < 3; k++)
				{
					Rod(W(num4, 2.05f + (float)k * 0.25f, num2 - 0.35f), W(num4 + ((k % 2 == 0) ? 0.28f : (-0.28f)), 2.35f + (float)k * 0.25f, num2 - 0.35f), 0.045f, enamel);
				}
				DBox(W(num4, 1.46f, num2 - 0.3f), new Vector3(0.7f, 0.17f, 0.02f), paper);
			}
			Label("SPECIMENS MUST NOT BE FED", W(num, 1.02f, num2 - 0.21f), 0f, 1f, Color.white);
			return;
		}
		case 4:
		{
			for (int l = -1; l <= 1; l++)
			{
				Dial(num + (float)l, 2.6f, num2 - 0.3f, 0.42f);
			}
			Label("LOCAL TIME     LOST TIME     YOUR TIME\n00:00             19:77             --:--", W(num, 1.65f, num2 - 0.24f), 0f, 1f, Color.white);
			for (int m = 0; m < 4; m++)
			{
				DBox(W(num - 1.3f + (float)m * 0.85f, 1.23f, num2 - 0.29f), new Vector3(0.45f, 0.08f, 0.07f), brass);
			}
			return;
		}
		}
		DBox(W(num, 2.45f, num2 - 0.2f), new Vector3(3.12f, 1.88f, 0.04f), paper);
		Label("COMPANY TRANSIT AUTHORITY\n\n" + RoomNotice(r.Kind) + "\n\nORDER " + (197700 + index) + " / STILL IN FORCE", W(num, 2.5f, num2 - 0.25f), 0f, 1.04f, new Color(0.14f, 0.18f, 0.16f));
		for (int num11 = -1; num11 <= 1; num11 += 2)
		{
			for (int num12 = -1; num12 <= 1; num12 += 2)
			{
				DBox(W(num + (float)num11 * 1.43f, 2.45f + (float)num12 * 0.82f, num2 - 0.26f), new Vector3(0.055f, 0.055f, 0.022f), brass);
			}
		}
	}

	private void DetailFurniture(StationPlan.Room r)
	{
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0275: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_032a: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_044a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0480: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_050f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0569: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0613: Unknown result type (might be due to invalid IL or missing references)
		//IL_0649: Unknown result type (might be due to invalid IL or missing references)
		//IL_065c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0686: Unknown result type (might be due to invalid IL or missing references)
		//IL_069f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_072c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0749: Unknown result type (might be due to invalid IL or missing references)
		//IL_077b: Unknown result type (might be due to invalid IL or missing references)
		//IL_078f: Unknown result type (might be due to invalid IL or missing references)
		if (r.Kind >= 20)
		{
			return;
		}
		for (int i = 0; i < 4; i++)
		{
			if (i == r.Variant % 4 && r.Kind != 19)
			{
				continue;
			}
			float num = r.X + ((i % 2 == 0) ? (-5) : 5);
			float num2 = (float)r.Z + ((i < 2) ? (-3.5f) : 3.5f);
			int kind = r.Kind;
			switch (kind)
			{
			case 0:
			case 2:
			case 4:
			case 8:
			case 16:
			{
				for (int num5 = -1; num5 <= 1; num5++)
				{
					DBox(W(num + (float)num5, 1.25f, num2 - 0.72f), new Vector3(0.73f, 2.36f, 0.06f), enamel);
					DBox(W(num + (float)num5 + 0.24f, 1.14f, num2 - 0.81f), new Vector3(0.06f, 0.28f, 0.1f), brass);
					for (int num6 = 0; num6 < 4; num6++)
					{
						DBox(W(num + (float)num5, 2.11f + (float)num6 * 0.075f, num2 - 0.76f), new Vector3(0.46f, 0.028f, 0.015f), dark);
					}
					DBox(W(num + (float)num5, 1.82f, num2 - 0.76f), new Vector3(0.37f, 0.2f, 0.02f), paper);
					for (int num7 = 0; num7 < 2; num7++)
					{
						DBox(W(num + (float)num5 - 0.34f, 0.55f + (float)num7 * 1.3f, num2 - 0.78f), new Vector3(0.065f, 0.2f, 0.055f), rust);
					}
				}
				break;
			}
			case 6:
			case 10:
			case 18:
			{
				DBox(W(num, 0.12f, num2), new Vector3(3.3f, 0.23f, 2.25f), dark);
				for (int k = -1; k <= 1; k++)
				{
					Dial(num + (float)k, 1.7f, num2 - 1.08f, 0.21f);
					DBox(W(num + (float)k, 0.6f, num2 - 1.02f), new Vector3(0.77f, 0.66f, 0.07f), enamel);
					for (int l = 0; l < 5; l++)
					{
						DBox(W(num + (float)k - 0.27f + (float)l * 0.13f, 0.6f, num2 - 1.07f), new Vector3(0.035f, 0.51f, 0.04f), dark);
					}
				}
				Rod(W(num - 1f, 2.45f, num2), W(num + 1f, 2.45f, num2), 0.38f, enamel);
				Rod(W(num + 1f, 2.45f, num2), W(num + 1f, 3.1f, num2), 0.38f, enamel);
				Rod(W(num + 1f, 3.1f, num2 - 0.1f), W(num + 1f, 3.1f, num2 + 0.1f), 0.65f, brass);
				DBox(W(num, 2.1f, num2 - 1.07f), new Vector3(1.7f, 0.16f, 0.035f), hazard);
				break;
			}
			case 14:
			case 17:
			{
				for (int m = 0; m < 10; m++)
				{
					Rod(W(num - 1.6f + (float)m * 0.35f, 0.99f, num2 - 0.94f), W(num - 1.6f + (float)m * 0.35f, 0.99f, num2 + 0.94f), 0.09f, rust);
				}
				for (int n = -1; n <= 1; n++)
				{
					DBox(W(num + (float)n, 1.47f, num2), new Vector3(0.85f, 0.045f, 0.12f), brass);
					DBox(W(num + (float)n, 1.2f, num2 - 0.51f), new Vector3(0.32f, 0.14f, 0.02f), paper);
					Rod(W(num + (float)n - 0.16f, 1.52f, num2), W(num + (float)n + 0.16f, 1.52f, num2), 0.045f, dark);
				}
				break;
			}
			case 1:
			case 3:
			case 12:
			case 15:
			case 19:
			{
				for (int num3 = -1; num3 <= 1; num3 += 2)
				{
					DBox(W(num + (float)num3 * 1.65f, 0.88f, num2), new Vector3(0.1f, 0.17f, 2f), brass);
				}
				DBox(W(num - 1.05f, 1.115f, num2 - 0.6f), new Vector3(0.5f, 0.025f, 0.6f), paper, 12f);
				for (int num4 = 0; num4 < 4; num4++)
				{
					DBox(W(num - 1.05f, 1.13f, num2 - 0.8f + (float)num4 * 0.09f), new Vector3(0.3f, 0.005f, 0.013f), dark);
				}
				if (kind == 3)
				{
					Rod(W(num + 0.8f, 1.11f, num2), W(num + 0.8f, 1.14f, num2), 0.55f, paper);
					Rod(W(num + 0.8f, 1.15f, num2 + 0.5f), W(num + 0.8f, 1.38f, num2 + 0.5f), 0.2f, enamel);
				}
				break;
			}
			case 7:
			{
				for (int j = -1; j <= 1; j += 2)
				{
					Rod(W(num + (float)j * 1.4f, 0.15f, num2 - 0.6f), W(num + (float)j * 1.4f, 1.35f, num2 - 0.6f), 0.085f, brass);
					Rod(W(num + (float)j * 1.4f, 1.35f, num2 - 0.6f), W(num + (float)j * 1.4f, 1.35f, num2 + 0.6f), 0.085f, brass);
				}
				DBox(W(num - 0.9f, 0.9f, num2), new Vector3(0.55f, 0.14f, 1.15f), paper);
				break;
			}
			}
		}
	}

	private void DressRoom(StationPlan.Room r, int index)
	{
		//IL_0038: 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)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		for (int i = -1; i <= 1; i += 2)
		{
			Box("Perimeter expansion joint", W((float)r.X + (float)i * ((float)r.Width / 2f - 0.5f), 0.018f, r.Z), new Vector3(0.08f, 0.02f, (float)(r.Depth - 1)), dark, solid: false);
			Box("Perimeter expansion joint", W(r.X, 0.018f, (float)r.Z + (float)i * ((float)r.Depth / 2f - 0.5f)), new Vector3((float)(r.Width - 1), 0.02f, 0.08f), dark, solid: false);
			float x = (float)r.X + (float)i * 3.2f;
			Box("Ceiling service pipe", W(x, (float)r.Height - 0.45f, r.Z), new Vector3(0.16f, 0.16f, (float)(r.Depth - 1)), rust, solid: false);
			for (int j = -1; j <= 1; j++)
			{
				Box("Pipe mounting collar", W(x, (float)r.Height - 0.45f, r.Z + j * 5), new Vector3(0.32f, 0.32f, 0.15f), dark, solid: false);
			}
		}
		Box("Ceiling access grille", W(r.X + 4, (float)r.Height - 0.06f, r.Z - 4), new Vector3(2f, 0.08f, 1.5f), dark, solid: false);
		for (int k = -2; k <= 2; k++)
		{
			Box("Grille slat", W((float)(r.X + 4) + (float)k * 0.34f, (float)r.Height - 0.11f, r.Z - 4), new Vector3(0.06f, 0.04f, 1.35f), tile, solid: false);
		}
		TextMeshPro val = Label("P0 / " + (index + 1).ToString("00") + " / SERVICE 1977", W(r.X - 5, 2.5f, (float)r.Z + (float)r.Depth / 2f - 0.31f), 0f, 1.05f, new Color(0.55f, 0.7f, 0.65f));
		((TMP_Text)val).rectTransform.sizeDelta = new Vector2(5f, 0.4f);
		for (int l = 0; l < 3; l++)
		{
			GameObject val2 = Box("Floor repair seam", W(r.X + (l - 1) * 3, 0.025f, (float)(r.Z - 1) - (float)r.Variant * 0.12f), new Vector3(0.025f, 0.015f, 0.7f + (float)l * 0.25f), dark, solid: false);
			val2.transform.rotation = Quaternion.Euler(0f, (float)(15 + r.Variant * 13 + l * 21), 0f);
		}
	}

	private void Pedestal(float x, float z, string inscription, Material accent)
	{
		//IL_000e: 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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: 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)
		Box("Display plinth", W(x, 0.45f, z), new Vector3(2f, 0.9f, 1.6f), dark);
		Box("Plinth inset", W(x, 0.8f, z - 0.81f), new Vector3(1.7f, 0.12f, 0.025f), accent, solid: false);
		Label(inscription, W(x, 0.45f, z - 0.83f), 0f, 1.2f, Color.white);
	}

	private void BuildExpansionRoom(StationPlan.Room r, Random random, Material glow)
	{
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0456: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0652: Unknown result type (might be due to invalid IL or missing references)
		//IL_0678: Unknown result type (might be due to invalid IL or missing references)
		//IL_0687: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0535: Unknown result type (might be due to invalid IL or missing references)
		//IL_0549: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0703: Unknown result type (might be due to invalid IL or missing references)
		//IL_0708: Unknown result type (might be due to invalid IL or missing references)
		//IL_0712: Unknown result type (might be due to invalid IL or missing references)
		//IL_0746: Unknown result type (might be due to invalid IL or missing references)
		//IL_0755: Unknown result type (might be due to invalid IL or missing references)
		//IL_0846: Unknown result type (might be due to invalid IL or missing references)
		//IL_084b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0855: Unknown result type (might be due to invalid IL or missing references)
		//IL_0909: Unknown result type (might be due to invalid IL or missing references)
		//IL_091d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0946: Unknown result type (might be due to invalid IL or missing references)
		//IL_095a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0981: Unknown result type (might be due to invalid IL or missing references)
		//IL_0995: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dcb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ddf: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0884: Unknown result type (might be due to invalid IL or missing references)
		//IL_0898: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ad3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ce7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e0a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d37: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0efb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f32: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d63: Unknown result type (might be due to invalid IL or missing references)
		float num = r.X;
		float num2 = r.Z;
		float num3 = r.Height;
		switch (r.Kind)
		{
		case 44:
		{
			for (int num9 = -1; num9 <= 1; num9 += 2)
			{
				for (int num10 = -1; num10 <= 1; num10 += 2)
				{
					float x = num + (float)(num9 * 5);
					float num11 = num2 + (float)num10 * 3.5f;
					Frame("Customs mirror", x, 3f, num11, 3f, 4.5f, glow);
					Box("False reflective surface", W(x, 3f, num11 + 0.08f), new Vector3(2.8f, 4.3f, 0.08f), dark, solid: false);
					Sculpture("Unregistered reflection", (PrimitiveType)1, W(x, 2.8f, num11 - 0.08f), new Vector3(0.55f, 1.1f, 0.15f), white);
					Label("REFLECTION " + ((num9 == num10) ? "DENIED" : "PENDING"), W(x, 5.4f, num11), 0f, 1.4f, Color.white);
				}
			}
			break;
		}
		case 45:
		{
			for (int num14 = -1; num14 <= 1; num14 += 2)
			{
				for (int num15 = -1; num15 <= 1; num15 += 2)
				{
					float num16 = num + (float)(num14 * 5);
					float z4 = num2 + (float)num15 * 3.5f;
					Pedestal(num16, z4, "GLASS ROOT / DO NOT WATER", teal);
					for (int num17 = 0; num17 < 4; num17++)
					{
						GameObject val2 = Sculpture("Crystalline stem", (PrimitiveType)2, W(num16 + ((float)num17 - 1.5f) * 0.35f, 2.1f + (float)num17 * 0.25f, z4), new Vector3(0.12f, 1.2f, 0.12f), teal);
						val2.transform.rotation = Quaternion.Euler(0f, 0f, ((float)num17 - 1.5f) * 13f);
						Sculpture("Glass blossom", (PrimitiveType)0, W(num16 + ((float)num17 - 1.5f) * 0.5f, 3.2f + (float)num17 * 0.4f, z4), Vector3.one * 0.55f, white);
					}
				}
			}
			break;
		}
		case 46:
		{
			for (int num31 = -1; num31 <= 1; num31 += 2)
			{
				for (int num32 = 0; num32 < 5; num32++)
				{
					Box("Archive shelf", W(num + (float)(num31 * 5), 1 + num32, num2 + 3.5f), new Vector3(3.5f, 0.12f, 1.8f), rust, solid: false);
					for (int num33 = 0; num33 < 4; num33++)
					{
						Box("Future file", W(num + (float)(num31 * 5) - 1.2f + (float)num33 * 0.8f, 1.4f + (float)num32, num2 + 3.5f), new Vector3(0.5f, 0.7f, 1.1f), (num33 == r.Variant % 4) ? glow : tile, solid: false);
					}
				}
				GameObject obj4 = Box("Unwritten record", W(num + (float)num31 * 4.5f, 4f, num2 - 3.5f), new Vector3(1.2f, 0.03f, 1.6f), white, solid: false);
				Animate(obj4, Vector3.up, 4f, 0.2f, num31);
				Label("FILED TOMORROW", W(num + (float)(num31 * 5), 6.2f, num2 + 3.5f), 0f, 2f, Color.white);
			}
			break;
		}
		case 47:
		{
			Ring(num, num3 - 2f, num2, 5f, rust, 0);
			Box("Rain collector", W(num, num3 - 1.5f, num2), new Vector3(9f, 0.4f, 6f), dark, solid: false);
			for (int num26 = 0; num26 < 20; num26++)
			{
				float x5 = num + (float)random.Next(-6, 7);
				float z6 = num2 + (float)random.Next(-5, 6);
				GameObject obj3 = Box("Arrested rainfall", W(x5, 4.2f + (float)random.Next(3) * 0.6f, z6), new Vector3(0.035f, 0.7f, 0.035f), teal, solid: false);
				Animate(obj3, Vector3.up, 0f, 0.25f, num26);
			}
			for (int num27 = -1; num27 <= 1; num27 += 2)
			{
				Pedestal(num + (float)(num27 * 5), num2 - 3.5f, "RAIN PRESSURE 000", glow);
				Sculpture("Pressure dial", (PrimitiveType)0, W(num + (float)(num27 * 5), 1.5f, num2 - 3.5f), new Vector3(0.8f, 0.8f, 0.2f), glow);
			}
			break;
		}
		case 48:
		{
			for (int m = -1; m <= 1; m += 2)
			{
				Bench(num + (float)(m * 5), num2 - 3.5f, 0f);
				Bench(num + (float)(m * 5), num2 + 3.5f, 0f);
				for (int n = 0; n < 4; n++)
				{
					Box("Gathered curtain", W(num + (float)m * (4.5f + (float)n * 0.6f), 4f, num2 + 7f), new Vector3(0.45f, 6f, 0.5f), rust, solid: false);
				}
			}
			Frame("Silent stage", num, 4.5f, num2 + 7f, 8f, 5f, glow);
			Box("Suspended microphone", W(num, 4f, num2 + 6.8f), new Vector3(0.12f, 2f, 0.12f), white, solid: false);
			Label("NOW PLAYING: YOUR ABSENCE", W(num, 7f, num2 + 6.8f), 0f, 2.4f, Color.white);
			break;
		}
		case 49:
		{
			for (int num21 = -1; num21 <= 1; num21 += 2)
			{
				for (int num22 = -1; num22 <= 1; num22 += 2)
				{
					float x3 = num + (float)(num21 * 5);
					float z5 = num2 + (float)num22 * 3.5f;
					Pedestal(x3, z5, "TIME DEPOSIT", amber);
					Frame("Hourglass cage", x3, 2.4f, z5, 1.8f, 2.4f, rust);
					Sculpture("Frozen hour", (PrimitiveType)0, W(x3, 2.4f, z5), Vector3.one * 0.8f, amber);
					Label((1977 + r.Variant + num22).ToString(), W(x3, 3.9f, z5), 0f, 2f, Color.white);
				}
			}
			Ring(num, 5.5f, num2, 3f, glow, 1);
			break;
		}
		case 50:
		{
			for (int num28 = -1; num28 <= 1; num28 += 2)
			{
				Pedestal(num + (float)(num28 * 5), num2 - 3.5f, "UNLISTED COORDINATES", teal);
				Frame("Map easel", num + (float)(num28 * 5), 2.6f, num2 + 3.5f, 3f, 3f, white);
			}
			for (int num29 = 0; num29 < 12; num29++)
			{
				float num30 = (float)num29 * (float)Math.PI / 6f;
				float x6 = num + Mathf.Cos(num30) * 6f;
				float z7 = num2 + Mathf.Sin(num30) * 6f;
				Sculpture("Charted star", (PrimitiveType)0, W(x6, 5.2f + (float)(num29 % 3) * 0.4f, z7), Vector3.one * 0.3f, (num29 % 3 == 0) ? amber : teal);
				Box("Coordinate filament", W(x6, 6.1f, z7), new Vector3(0.025f, 1.4f, 0.025f), white, solid: false);
			}
			Ring(num, 5.6f, num2, 6f, teal, 0);
			break;
		}
		case 51:
		{
			for (int num23 = -1; num23 <= 1; num23 += 2)
			{
				for (int num24 = -1; num24 <= 1; num24 += 2)
				{
					float x4 = num + (float)(num23 * 5);
					float num25 = num2 + (float)num24 * 3.5f;
					Box("Industrial washer", W(x4, 1f, num25), new Vector3(2f, 2f, 1.5f), tile);
					Sculpture("Washer aperture", (PrimitiveType)0, W(x4, 1f, num25 - 0.8f), new Vector3(1.3f, 1.3f, 0.1f), dark);
					Box("Washer controls", W(x4, 1.8f, num25 - 0.77f), new Vector3(1.5f, 0.1f, 0.05f), glow, solid: false);
					GameObject obj2 = Box("Weightless uniform", W(x4, 4.5f, num25), new Vector3(1.4f, 0.04f, 2f), rust, solid: false);
					Animate(obj2, new Vector3(0f, 1f, 0.2f), 5f, 0.25f, num23 + num24);
				}
			}
			break;
		}
		case 52:
		{
			for (int num18 = -1; num18 <= 1; num18 += 2)
			{
				Frame("Furnace bookshelf", num + (float)(num18 * 5), 3f, num2 + 3.5f, 3.5f, 5f, rust);
				for (int num19 = 0; num19 < 4; num19++)
				{
					Box("Heated shelf", W(num + (float)(num18 * 5), 1 + num19, num2 + 3.5f), new Vector3(3.3f, 0.12f, 1.5f), dark, solid: false);
					for (int num20 = 0; num20 < 5; num20++)
					{
						Box("Ember volume", W(num + (float)(num18 * 5) - 1.2f + (float)num20 * 0.6f, 1.4f + (float)num19, num2 + 3.5f), new Vector3(0.35f, 0.6f, 1f), (num20 == r.Variant % 5) ? amber : rust, solid: false);
					}
				}
				Pedestal(num + (float)(num18 * 5), num2 - 3.5f, "FIREPROOF MEMORIES", red);
			}
			break;
		}
		case 53:
		{
			for (int num12 = -1; num12 <= 1; num12 += 2)
			{
				for (int num13 = -1; num13 <= 1; num13 += 2)
				{
					float x2 = num + (float)(num12 * 5);
					float z3 = num2 + (float)num13 * 3.5f;
					Pedestal(x2, z3, (num12 == num13) ? "LAST TICKET" : "LEFT BEHIND", glow);
					Frame("Museum case", x2, 2.4f, z3, 2.4f, 3f, teal);
					GameObject obj = Box("Passenger relic", W(x2, 2.2f, z3), (num12 == num13) ? new Vector3(0.8f, 0.05f, 1.2f) : new Vector3(0.8f, 1f, 0.4f), (num12 == num13) ? white : rust, solid: false);
					Animate(obj, Vector3.up, 8f, 0.12f, num12 + num13);
				}
			}
			break;
		}
		case 54:
		{
			for (int num5 = -1; num5 <= 1; num5 += 2)
			{
				for (int num6 = -1; num6 <= 1; num6 += 2)
				{
					float num7 = num + (float)(num5 * 5);
					float z2 = num2 + (float)num6 * 3.5f;
					Pedestal(num7, z2, (num5 == num6) ? "BOTTLED THUNDER" : "SEALED FOG", teal);
					Frame("Weather cabinet", num7, 2.8f, z2, 2.6f, 3.6f, rust);
					Sculpture("Stored cloud", (PrimitiveType)0, W(num7, 3.1f, z2), new Vector3(2f, 0.9f, 1.3f), tile);
					for (int num8 = 0; num8 < 3; num8++)
					{
						GameObject val = Box("Frozen lightning", W(num7 + (float)(num8 - 1) * 0.35f, 2.1f - (float)num8 * 0.25f, z2), new Vector3(0.08f, 0.7f, 0.08f), glow, solid: false);
						val.transform.rotation = Quaternion.Euler(0f, 0f, (float)((num8 % 2 == 0) ? 30 : (-30)));
					}
				}
			}
			break;
		}
		case 55:
		{
			for (int i = -1; i <= 1; i += 2)
			{
				for (int j = -1; j <= 1; j += 2)
				{
					float num4 = num + (float)(i * 5);
					float z = num2 + (float)j * 3.5f;
					Box("Unclaimed dining table", W(num4, 1f, z), new Vector3(3f, 0.15f, 2f), tile);
					for (int k = -1; k <= 1; k += 2)
					{
						Box("Banquet table foot", W(num4 + (float)k, 0.5f, z), new Vector3(0.15f, 1f, 1.5f), rust);
					}
					for (int l = -1; l <= 1; l += 2)
					{
						Sculpture("Empty plate", (PrimitiveType)2, W(num4 + (float)l * 0.7f, 1.12f, z), new Vector3(0.65f, 0.035f, 0.65f), white);
						Box("Waiting cutlery", W(num4 + (float)l * 0.7f + 0.4f, 1.13f, z), new Vector3(0.035f, 0.025f, 0.6f), rust, solid: false);
					}
					Box("Cold candle", W(num4, 1.6f, z), new Vector3(0.15f, 1f, 0.15f), white, solid: false);
					Sculpture("Unmoving flame", (PrimitiveType)0, W(num4, 2.2f, z), new Vector3(0.12f, 0.3f, 0.12f), amber);
				}
			}
			break;
		}
		}
	}

	private Texture2D ReadArt(string name, bool repeat)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		using Stream stream = typeof(Station).Assembly.GetManifestResourceStream("PlatformZero.Art." + name);
		if (stream == null)
		{
			throw new InvalidOperationException("Missing bundled art: " + name);
		}
		using MemoryStream memoryStream = new MemoryStream();
		stream.CopyTo(memoryStream);
		Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true);
		if (!ImageConversion.LoadImage(val, memoryStream.ToArray(), true))
		{
			Object.Destroy((Object)(object)val);
			throw new InvalidOperationException("Invalid art: " + name);
		}
		((Object)val).name = "P0 bundled " + name;
		((Texture)val).wrapMode = (TextureWrapMode)(!repeat);
		((Texture)val).filterMode = (FilterMode)2;
		((Texture)val).anisoLevel = 4;
		detailTextures.Add(val);
		return val;
	}

	private Material PictureMaterial(string name)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		Material val = Mat(name, Color.white, 0f);
		val.SetColor("_BaseColor", Color.white);
		val.SetTexture("_BaseColorMap", (Texture)(object)ReadArt(name, repeat: false));
		val.SetFloat("_Smoothness", 0.08f);
		return val;
	}

	private void BuildGalleryMaterials()
	{
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		tile.SetTexture("_BaseColorMap", (Texture)(object)ReadArt("wall.png", repeat: true));
		floorTile.SetTexture("_BaseColorMap", (Texture)(object)ReadArt("floor.png", repeat: true));
		photographs = (Material[])(object)new Material[2]
		{
			PictureMaterial("platform-photo.png"),
			PictureMaterial("canteen-photo.png")
		};
		masterpiece = PictureMaterial("masterpiece.png");
		gilding = Mat("Masterpiece antique gilt", new Color(0.55f, 0.4f, 0.16f), 0f);
		gilding.SetColor("_BaseColor", new Color(0.55f, 0.4f, 0.16f));
		gilding.SetFloat("_Metallic", 0.65f);
	}

	private void BuildRoomGallery(StationPlan.Room room, int index)
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Expected O, but got Unknown
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Expected O, but got Unknown
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_034c: Unknown result type (might be due to invalid IL or missing references)
		//IL_049c: Unknown result type (might be due to invalid IL or missing references)
		//IL_049e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04be: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0373: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_0396: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0509: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_043a: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_053d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_055c: Unknown result type (might be due to invalid IL or missing references)
		//IL_055e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0571: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Unknown result type (might be due to invalid IL or missing references)
		//IL_057b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0585: Unknown result type (might be due to invalid IL or missing references)
		//IL_058a: Unknown result type (might be due to invalid IL or missing references)
		//IL_058f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0592: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c4: Expected O, but got Unknown
		//IL_05de: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_061b: Unknown result type (might be due to invalid IL or missing references)
		bool flag = GalleryPlan.IsMasterpiece(Seed, index);
		int num = GalleryPlan.Photograph(Seed, index);
		if (!flag && num < 0)
		{
			return;
		}
		Material val = (flag ? masterpiece : photographs[num]);
		Texture texture = val.GetTexture("_BaseColorMap");
		float num2 = (flag ? 3.2f : 2.5f);
		float num3 = num2 * (float)texture.height / (float)texture.width;
		Vector3 val2 = W(room.X - 5, 3.35f, (float)room.Z + (float)room.Depth / 2f - 0.85f);
		float num4 = (flag ? 0.2f : 0.085f);
		DBox(val2 + Vector3.forward * 0.1f, new Vector3(num2 + 0.65f, num3 + 0.65f, 0.14f), dark);
		GameObject val3 = new GameObject(flag ? "The Masterpiece" : "Station archival photograph");
		val3.transform.SetParent(((Component)this).transform, false);
		val3.transform.position = val2;
		Mesh val4 = new Mesh();
		((Object)val4).name = "P0 photograph quad";
		val4.vertices = (Vector3[])(object)new Vector3[4]
		{
			new Vector3((0f - num2) / 2f, (0f - num3) / 2f, 0f),
			new Vector3((0f - num2) / 2f, num3 / 2f, 0f),
			new Vector3(num2 / 2f, num3 / 2f, 0f),
			new Vector3(num2 / 2f, (0f - num3) / 2f, 0f)
		};
		val4.uv = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0f, 1f),
			new Vector2(1f, 1f),
			new Vector2(1f, 0f)
		};
		val4.triangles = new int[6] { 0, 1, 2, 0, 2, 3 };
		val4.RecalculateNormals();
		val4.RecalculateBounds();
		detailMeshes.Add(val4);
		val3.AddComponent<MeshFilter>().sharedMesh = val4;
		((Renderer)val3.AddComponent<MeshRenderer>()).sharedMaterial = val;
		for (int i = -1; i <= 1; i += 2)
		{
			DBox(val2 + new Vector3((float)i * (num2 + num4) / 2f, 0f, -0.035f), new Vector3(num4, num3 + num4 * 2f, 0.14f), flag ? gilding : rust);
			DBox(val2 + new Vector3(0f, (float)i * (num3 + num4) / 2f, -0.035f), new Vector3(num2 + num4 * 2f, num4, 0.14f), flag ? gilding : rust);
			if (flag)
			{
				DBox(val2 + new Vector3((float)i * (num2 / 2f + 0.25f), 0f, -0.08f), new Vector3(0.07f, num3 + 0.65f, 0.09f), gilding);
				DBox(val2 + new Vector3(0f, (float)i * (num3 / 2f + 0.25f), -0.08f), new Vector3(num2 + 0.65f, 0.07f, 0.09f), gilding);
				for (int j = -1; j <= 1; j++)
				{
					DBox(val2 + new Vector3((float)j * 1.35f, (float)i * (num3 / 2f + 0.26f), -0.14f), new Vector3(0.16f, 0.16f, 0.06f), gilding, 45f);
				}
			}
		}
		string text = (flag ? "THE MASTERPIECE\nUNKNOWN MASTER / PRICELESS\nON LOAN. DO NOT LICK." : ((num == 0) ? "ARCHIVE 017 / LAST SHIFT\nSIX CLOCKED IN. NONE CLOCKED OUT." : "ARCHIVE 031 / STAFF CANTEEN\nTHE CHAIR WAS EMPTY IN THE NEGATIVE."));
		Vector3 val5 = val2 + Vector3.down * (num3 / 2f + 0.62f);
		FrameDetails(val2, num2, num3, flag);
		DBox(val5, new Vector3(flag ? 3.6f : 3.1f, 0.55f, 0.1f), flag ? gilding : dark);
		Label(text, val5 + Vector3.back * 0.06f, 0f, flag ? 1.05f : 1.1f, flag ? Color.black : Color.white);
		if (flag)
		{
			masterpieceCount++;
			Vector3 val6 = val2 + Vector3.up * (num3 / 2f + 0.5f) + Vector3.back * 0.35f;
			DBox(val6, new Vector3(1.2f, 0.14f, 0.3f), gilding);
			GameObject val7 = new GameObject("Masterpiece picture light");
			val7.transform.SetParent(((Component)this).transform, false);
			val7.transform.position = val6 + Vector3.down * 0.15f;
			Light val8 = val7.AddComponent<Light>();
			val8.type = (LightType)2;
			val8.color = new Color(1f, 0.9f, 0.72f);
			val8.range = 5f;
			val8.shadows = (LightShadows)0;
			val7.AddComponent<HDAdditionalLightData>().SetIntensity(450f, (LightUnit)0);
			Plugin.Log.LogInfo((object)("Masterpiece gallery roll: room=" + index + "; seed=" + Seed));
		}
		else
		{
			photographCount++;
		}
	}

	private void InstrumentDesk(float x, float z, string caption)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0275: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		DBox(W(x, 1.05f, z), new Vector3(3f, 0.15f, 1.6f), enamel);
		for (int i = -1; i <= 1; i += 2)
		{
			DBox(W(x + (float)i * 1.2f, 0.5f, z), new Vector3(0.16f, 1f, 1.3f), rust);
			DBox(W(x + (float)i * 0.95f, 0.72f, z - 0.7f), new Vector3(0.8f, 0.4f, 0.08f), dark);
			DBox(W(x + (float)i * 0.95f, 0.72f, z - 0.77f), new Vector3(0.22f, 0.055f, 0.08f), brass);
		}
		DBox(W(x, 1.42f, z + 0.2f), new Vector3(1.55f, 0.6f, 0.48f), dark);
		Dial(x - 0.38f, 1.48f, z - 0.06f, 0.21f);
		Dial(x + 0.38f, 1.48f, z - 0.06f, 0.21f);
		for (int j = 0; j < 5; j++)
		{
			DBox(W(x - 0.5f + (float)j * 0.25f, 1.15f, z - 0.5f), new Vector3(0.12f, 0.05f, 0.13f), (j == 2) ? amber : brass);
		}
		DBox(W(x + 0.9f, 1.14f, z + 0.03f), new Vector3(0.48f, 0.025f, 0.6f), paper, -8f);
		for (int k = 0; k < 5; k++)
		{
			DBox(W(x + 0.9f, 1.158f, z - 0.15f + (float)k * 0.065f), new Vector3(0.32f, 0.008f, 0.015f), dark);
		}
		Label(caption, W(x, 1.98f, z + 0.2f), 0f, 1.1f, Color.white);
	}

	private void RivetedVessel(float x, float z, float height, Material accent)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		Rod(W(x, 0.35f, z), W(x, height, z), 1.55f, enamel);
		for (float num = 0.4f; num < height; num += 0.85f)
		{
			Rod(W(x, num - 0.065f, z), W(x, num + 0.065f, z), 1.68f, rust);
			for (int i = 0; i < 8; i++)
			{
				DBox(W(x + Mathf.Sin((float)i * (float)Math.PI / 4f) * 0.82f, num, z + Mathf.Cos((float)i * (float)Math.PI / 4f) * 0.82f), Vector3.one * 0.085f, brass);
			}
		}
		DBox(W(x, height * 0.55f, z - 0.8f), new Vector3(0.55f, height * 0.48f, 0.12f), dark);
		for (int j = 0; j < 7; j++)
		{
			DBox(W(x, height * 0.34f + (float)j * height * 0.065f, z - 0.88f), new Vector3(0.38f, 0.05f, 0.025f), accent);
		}
		Dial(x + 0.6f, height - 0.4f, z - 0.6f, 0.2f);
		Rod(W(x + 0.72f, 0.5f, z), W(x + 0.72f, height + 0.5f, z), 0.13f, rust);
	}

	private void BuildIdentityRoom(StationPlan.Room r, Random random, Material glow)
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Unknown result type (might be due to invalid IL or missing references)
		//IL_058a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05de: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0676: Unknown result type (might be due to invalid IL or missing references)
		//IL_138d: Unknown result type (might be due to invalid IL or missing references)
		//IL_139c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0709: Unknown result type (might be due to invalid IL or missing references)
		//IL_072e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0742: Unknown result type (might be due to invalid IL or missing references)
		//IL_0839: Unknown result type (might be due to invalid IL or missing references)
		//IL_084d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0872: Unknown result type (might be due to invalid IL or missing references)
		//IL_0886: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_091e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0932: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d2c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d33: Expected O, but got Unknown
		//IL_0d52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ead: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ebc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f63: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f77: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f9d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fdd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
		//IL_1178: Unknown result type (might be due to invalid IL or missing references)
		//IL_118c: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_11fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_1210: Unknown result type (might be due to invalid IL or missing references)
		//IL_1237: Unknown result type (might be due to invalid IL or missing references)
		//IL_124b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0336: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0423: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown