Decompiled source of LethalCompanyMod v1.23.1

BepInEx/plugins/LethalCompanyMod/LethalCompanyMod.dll

Decompiled 18 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalCompanyMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalCompanyMod")]
[assembly: AssemblyTitle("LethalCompanyMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalCompanyMod
{
	internal static class DomainArt
	{
		internal const int FilmFrames = 8;

		internal const int FilmFramePixels = 128;

		internal static Texture2D ToTexture(string name, int width, int height, Color[] pixels, TextureWrapMode wrapU, TextureWrapMode wrapV, bool mipmaps = true)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			Texture2D val = new Texture2D(width, height, (TextureFormat)4, mipmaps)
			{
				name = name,
				wrapModeU = wrapU,
				wrapModeV = wrapV,
				filterMode = (FilterMode)((!mipmaps) ? 1 : 2),
				anisoLevel = 4
			};
			val.SetPixels(pixels);
			val.Apply(mipmaps, false);
			return val;
		}

		private static float Step(float edge0, float edge1, float x)
		{
			float num = Mathf.Clamp01((x - edge0) / (edge1 - edge0));
			return num * num * (3f - 2f * num);
		}

		private static float RoundRect(float x, float y, float halfWidth, float halfHeight, float radius)
		{
			float num = Mathf.Abs(x) - halfWidth + radius;
			float num2 = Mathf.Abs(y) - halfHeight + radius;
			float num3 = Mathf.Sqrt(Mathf.Max(num, 0f) * Mathf.Max(num, 0f) + Mathf.Max(num2, 0f) * Mathf.Max(num2, 0f));
			return Mathf.Min(Mathf.Max(num, num2), 0f) + num3 - radius;
		}

		private static float Segment(float px, float py, float ax, float ay, float bx, float by)
		{
			float num = bx - ax;
			float num2 = by - ay;
			float num3 = num * num + num2 * num2;
			float num4 = ((num3 > 1E-09f) ? Mathf.Clamp01(((px - ax) * num + (py - ay) * num2) / num3) : 0f);
			float num5 = px - (ax + num * num4);
			float num6 = py - (ay + num2 * num4);
			return Mathf.Sqrt(num5 * num5 + num6 * num6);
		}

		private static float Fbm(float x, float y, int seed, int period, int octaves)
		{
			float num = 0f;
			float num2 = 0.5f;
			float num3 = 0f;
			for (int i = 0; i < octaves; i++)
			{
				num += Vfx.ValueNoise(x, y, seed + i * 17, period) * num2;
				num3 += num2;
				x *= 2f;
				y *= 2f;
				period *= 2;
				num2 *= 0.5f;
			}
			return num / num3;
		}

		private static float Hash(int n)
		{
			n = (n << 13) ^ n;
			return (float)((n * (n * n * 15731 + 789221) + 1376312589) & 0x7FFFFFFF) / 2.1474836E+09f;
		}

		internal static float RunnerDistance(float x, float y, float phase)
		{
			float num = 0.43f + 0.025f * Mathf.Cos(phase * 2f);
			float num2 = 0f;
			float num3 = num2 + 0.075f;
			float num4 = num + 0.27f;
			float num5 = num3 + 0.045f;
			float num6 = num4 + 0.105f;
			float num7 = Mathf.Sqrt((x - num5) * (x - num5) + (y - num6) * (y - num6)) - 0.062f;
			num7 = Mathf.Min(num7, Segment(x, y, num2, num, num3, num4) - 0.05f);
			for (int i = 0; i < 2; i++)
			{
				float num8 = phase + (float)i * MathF.PI;
				float num9 = 0.72f * Mathf.Sin(num8);
				float num10 = 0.2f + 1.25f * Mathf.Pow(0.5f - 0.5f * Mathf.Cos(num8 + 1.25f), 1.6f);
				float num11 = num2 + 0.2f * Mathf.Sin(num9);
				float num12 = num - 0.2f * Mathf.Cos(num9);
				float num13 = num11 + 0.21f * Mathf.Sin(num9 - num10);
				float num14 = num12 - 0.21f * Mathf.Cos(num9 - num10);
				num7 = Mathf.Min(num7, Segment(x, y, num2, num, num11, num12) - 0.036f);
				num7 = Mathf.Min(num7, Segment(x, y, num11, num12, num13, num14) - 0.03f);
				num7 = Mathf.Min(num7, Segment(x, y, num13, num14, num13 + 0.05f, num14 - 0.005f) - 0.018f);
				float num15 = -0.85f * Mathf.Sin(num8);
				float num16 = num3 + 0.145f * Mathf.Sin(num15);
				float num17 = num4 - 0.145f * Mathf.Cos(num15);
				float num18 = num15 + 1.35f;
				float bx = num16 + 0.13f * Mathf.Sin(num18);
				float num19 = num17 - 0.13f * Mathf.Cos(num18);
				num7 = Mathf.Min(num7, Segment(x, y, num3, num4, num16, num17) - 0.027f);
				num7 = Mathf.Min(num7, Segment(x, y, num16, num17, bx, num19) - 0.023f);
			}
			return num7;
		}

		internal static Color[] FilmStripPixels(out int width, out int height)
		{
			//IL_00d6: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: 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_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: 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_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: 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_0335: 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_01a4: 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_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			width = 1024;
			height = 128;
			Color[] array = (Color[])(object)new Color[width * height];
			Color val = default(Color);
			((Color)(ref val))..ctor(0.035f, 0.028f, 0.03f, 1f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.16f, 0.13f, 0.12f, 1f);
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(1f, 0.96f, 0.86f, 1f);
			Color val4 = default(Color);
			((Color)(ref val4))..ctor(1f, 0.93f, 0.8f, 1f);
			Color val5 = default(Color);
			((Color)(ref val5))..ctor(0.06f, 0.035f, 0.05f, 1f);
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					int num = j / 128;
					float num2 = (float)(j % 128) + 0.5f;
					float num3 = (float)i + 0.5f;
					Color val6 = val;
					float num4 = Vfx.ValueNoise((float)j * 0.35f, (float)i * 0.35f, 7, width) * 0.02f;
					((Color)(ref val6))..ctor(val6.r + num4, val6.g + num4 * 0.8f, val6.b + num4 * 0.7f, 1f);
					if (num3 < 4f || num3 > (float)height - 4f)
					{
						val6 = val2;
					}
					for (int k = 0; k < 2; k++)
					{
						float num5 = ((k == 0) ? 14f : ((float)height - 14f));
						for (int l = 0; l < 4; l++)
						{
							float num6 = 16f + (float)l * 32f;
							float num7 = RoundRect(num2 - num6, num3 - num5, 8.5f, 6.5f, 2.5f);
							if (num7 < 1f)
							{
								val6 = Color.Lerp(val6, val3, Mathf.Clamp01(1f - num7));
							}
						}
					}
					float num8 = num2 - 64f;
					float num9 = num3 - (float)height * 0.5f;
					float num10 = RoundRect(num8, num9, 57f, 38f, 4f);
					if (num10 < 1f)
					{
						float num11 = num8 / 76f;
						float num12 = (num9 + 38f) / 76f;
						float num13 = 1f - Mathf.Clamp01(num11 * num11 * 0.45f + (num12 - 0.5f) * (num12 - 0.5f) * 0.9f);
						Color val7 = val4 * (0.55f + 0.45f * num13);
						float num14 = RunnerDistance(num11 * 0.95f, num12 * 0.95f + 0.02f, (float)num * MathF.PI * 2f / 8f);
						float num15 = Mathf.Clamp01(0.5f - num14 * 76f);
						float num16 = Step(0.13f, 0.1f, num12) * 0.6f;
						Color val8 = Color.Lerp(val7, val5, Mathf.Max(num15, num16));
						val8.a = 1f;
						val6 = Color.Lerp(val6, val8, Mathf.Clamp01(1f - num10));
					}
					if (num2 < 2f || num2 > 126f)
					{
						val6 = Color.Lerp(val6, Color.black, 0.8f);
					}
					array[i * width + j] = val6;
				}
			}
			return array;
		}

		internal static Color[] MoonPixels(int size)
		{
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: 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_0485: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[size * size];
			float[] array2 = new float[size * size];
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = ((float)j + 0.5f) / (float)size * 2f - 1f;
					float num2 = ((float)i + 0.5f) / (float)size * 2f - 1f;
					if (!(Mathf.Sqrt(num * num + num2 * num2) > 1.02f))
					{
						float x = Fbm(num * 1.7f + 3.1f, num2 * 1.7f + 7.3f, 91, 64, 4);
						float num3 = Step(0.5f, 0.64f, x);
						float num4 = Fbm(num * 9f + 11f, num2 * 9f + 5f, 37, 256, 3);
						array2[i * size + j] = Mathf.Lerp(0.92f, 0.66f, num3) + (num4 - 0.5f) * 0.1f;
					}
				}
			}
			for (int k = 0; k < 46; k++)
			{
				float num5 = Hash(k * 3 + 1) * MathF.PI * 2f;
				float num6 = Mathf.Sqrt(Hash(k * 3 + 2)) * 0.9f;
				float num7 = Mathf.Cos(num5) * num6;
				float num8 = Mathf.Sin(num5) * num6;
				float num9 = Mathf.Lerp(0.015f, 0.1f, Mathf.Pow(Hash(k * 3 + 3), 2.4f));
				bool flag = k == 5;
				if (flag)
				{
					num7 = 0.18f;
					num8 = -0.42f;
					num9 = 0.045f;
				}
				float num10 = (flag ? 9f : 1.4f);
				int num11 = Mathf.Max(0, Mathf.FloorToInt((num7 - num9 * num10 + 1f) * 0.5f * (float)size));
				int num12 = Mathf.Min(size - 1, Mathf.CeilToInt((num7 + num9 * num10 + 1f) * 0.5f * (float)size));
				int num13 = Mathf.Max(0, Mathf.FloorToInt((num8 - num9 * num10 + 1f) * 0.5f * (float)size));
				int num14 = Mathf.Min(size - 1, Mathf.CeilToInt((num8 + num9 * num10 + 1f) * 0.5f * (float)size));
				for (int l = num13; l <= num14; l++)
				{
					for (int m = num11; m <= num12; m++)
					{
						float num15 = ((float)m + 0.5f) / (float)size * 2f - 1f;
						float num16 = ((float)l + 0.5f) / (float)size * 2f - 1f;
						float num17 = (num15 - num7) / num9;
						float num18 = (num16 - num8) / num9;
						float num19 = Mathf.Sqrt(num17 * num17 + num18 * num18);
						if (!(num19 > num10))
						{
							float num20 = ((num19 > 0.0001f) ? ((num17 * -0.7f + num18 * 0.7f) / num19) : 0f);
							float num21 = 0f;
							if (num19 < 0.95f)
							{
								num21 += -0.03f - 0.11f * num20 * Step(0.15f, 0.95f, num19);
							}
							num21 += 0.07f * num20 * Mathf.Exp(0f - Mathf.Pow((num19 - 1.02f) / 0.14f, 2f));
							if (flag && num19 > 1.2f)
							{
								float num22 = Mathf.Pow(Mathf.Clamp01(Vfx.ValueNoise(Mathf.Atan2(num18, num17) * 9f + 40f, 0.5f, 77, 57) * 1.4f - 0.45f), 2f);
								num21 += num22 * 0.16f * Mathf.Clamp01(1f - (num19 - 1.2f) / (num10 - 1.2f));
							}
							array2[l * size + m] += num21;
						}
					}
				}
			}
			for (int n = 0; n < size; n++)
			{
				for (int num23 = 0; num23 < size; num23++)
				{
					float num24 = ((float)num23 + 0.5f) / (float)size * 2f - 1f;
					float num25 = ((float)n + 0.5f) / (float)size * 2f - 1f;
					float num26 = Mathf.Sqrt(num24 * num24 + num25 * num25);
					float num27 = Mathf.Clamp01((1f - num26) * (float)size * 0.5f);
					if (num27 <= 0f)
					{
						array[n * size + num23] = new Color(1f, 1f, 1f, 0f);
						continue;
					}
					float num28 = Mathf.Sqrt(Mathf.Max(0f, 1f - num26 * num26));
					float num29 = Mathf.Clamp01(array2[n * size + num23]) * (0.5f + 0.5f * Mathf.Pow(num28, 0.55f));
					array[n * size + num23] = new Color(num29 * 0.95f, num29 * 0.965f, num29, num27);
				}
			}
			return array;
		}

		internal static Color[] ReelFloorPixels(int width, int height, float radiusMeters, float innerFraction)
		{
			//IL_014e: 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_0150: 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_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: 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_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: 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_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04df: 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_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: 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_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: 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_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: 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_0338: 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_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: 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_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: 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_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[width * height];
			Color val = default(Color);
			((Color)(ref val))..ctor(0.035f, 0.034f, 0.045f, 1f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.11f, 0.105f, 0.13f, 1f);
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(0.3f, 0.29f, 0.36f, 1f);
			Color val4 = default(Color);
			((Color)(ref val4))..ctor(0.02f, 0.014f, 0.016f, 1f);
			Color val5 = default(Color);
			((Color)(ref val5))..ctor(0.05f, 0.036f, 0.034f, 1f);
			Color val6 = default(Color);
			((Color)(ref val6))..ctor(0.26f, 0.28f, 0.36f, 1f);
			Color val7 = default(Color);
			((Color)(ref val7))..ctor(0.75f, 0.72f, 0.82f, 1f);
			float num = radiusMeters * (1f - innerFraction);
			float[] array2 = new float[4] { 0.24f, 0.43f, 0.62f, 0.8f };
			Color val9 = default(Color);
			for (int i = 0; i < height; i++)
			{
				float num2 = ((float)i + 0.5f) / (float)height;
				float num3 = (innerFraction + num2 * (1f - innerFraction)) * radiusMeters;
				float num4 = MathF.PI * 2f * num3;
				for (int j = 0; j < width; j++)
				{
					float num5 = ((float)j + 0.5f) / (float)width;
					float num6 = num5 * num4;
					Color val8 = ((Mathf.Repeat(num2 * 190f, 1f) < 0.5f) ? val4 : val5);
					float[] array3 = array2;
					foreach (float num7 in array3)
					{
						float num8 = (num2 - num7) / 0.055f;
						if (!(Mathf.Abs(num8) > 1f))
						{
							float num9 = 0.11f * num;
							float num10 = radiusMeters * (innerFraction + num7 * (1f - innerFraction));
							int num11 = Mathf.Max(8, Mathf.RoundToInt(MathF.PI * 2f * num10 / num9));
							float num12 = Mathf.Repeat(num5 * (float)num11, 1f);
							float num13 = Mathf.Floor(num5 * (float)num11);
							((Color)(ref val9))..ctor(0.03f, 0.024f, 0.025f, 1f);
							if (((Mathf.Abs(num8) > 0.72f && Mathf.Abs(num8) < 0.93f) ? 1f : 0f) > 0f && Mathf.Repeat(num12 * 4f, 1f) > 0.3f && Mathf.Repeat(num12 * 4f, 1f) < 0.7f)
							{
								((Color)(ref val9))..ctor(0.28f, 0.3f, 0.38f, 1f);
							}
							if (Mathf.Abs(num8) < 0.6f && num12 > 0.05f && num12 < 0.95f)
							{
								float num14 = (num12 - 0.5f) * 1.25f;
								float y = (num8 + 0.6f) / 1.2f;
								float num15 = RunnerDistance(num14, y, num13 * MathF.PI * 2f / 8f);
								float num16 = 0.55f + 0.45f * (1f - Mathf.Abs(num14));
								val9 = Color.Lerp(val6 * num16, new Color(0.04f, 0.03f, 0.03f, 1f), Mathf.Clamp01(0.5f - num15 * 60f));
								val9.a = 1f;
							}
							val8 = val9;
						}
					}
					float num17 = Mathf.Repeat(num5 * 6f, 1f) - 0.5f;
					float num18 = 0.34f * num4 / 6f;
					float x = num17 * num4 / 6f;
					float y2 = (num2 - 0.5f) * num;
					float halfHeight = 0.36f * num;
					float radius = Mathf.Min(3.2f, num18 * 0.6f);
					float num19 = RoundRect(x, y2, num18, halfHeight, radius);
					if (num19 > 0f)
					{
						float num20 = Vfx.ValueNoise(num5 * 900f, num2 * 12f, 23, 900) * 0.035f;
						Color val10 = Color.Lerp(val, val2, 0.35f + 0.35f * Mathf.Sin(num5 * MathF.PI * 12f) * 0.5f) + new Color(num20, num20, num20, 0f);
						float num21 = Mathf.Exp((0f - num19) * num19 * 18f);
						val10 = Color.Lerp(val10, val3, num21);
						float num22 = 1.4f;
						float num23 = Mathf.Abs(num19 - 0.55f);
						float num24 = Mathf.Repeat(num6, num22) - num22 * 0.5f;
						float num25 = Mathf.Sqrt(num24 * num24 + num23 * num23 * 4f);
						if (num25 < 0.16f)
						{
							val10 = Color.Lerp(val10, val3 * 1.2f, Step(0.16f, 0.08f, num25));
						}
						val10.a = 1f;
						val8 = val10;
					}
					else if (num19 > -0.12f)
					{
						val8 = Color.Lerp(val8, Color.black, 0.7f);
					}
					if (num2 < 0.035f)
					{
						val8 = Color.Lerp(val3, val2, num2 / 0.035f);
					}
					if (num2 > 0.93f)
					{
						float num26 = (num2 - 0.93f) / 0.07f;
						Color val11 = Color.Lerp(val2, val3, Mathf.Sin(num26 * MathF.PI));
						float num27 = Mathf.Repeat(num5 * 24f, 1f);
						if (num26 > 0.25f && num26 < 0.8f && (num27 < 0.012f || num27 > 0.988f))
						{
							val11 = val7;
						}
						float num28 = Mathf.Repeat(num5 * 96f, 1f);
						if (num26 > 0.45f && num26 < 0.75f && (num28 < 0.02f || num28 > 0.98f))
						{
							val11 = Color.Lerp(val11, val7, 0.55f);
						}
						val11.a = 1f;
						val8 = val11;
					}
					array[i * width + j] = val8;
				}
			}
			return array;
		}

		internal static Color[] ReelSealPixels(int size)
		{
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[size * size];
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = ((float)j + 0.5f) / (float)size * 2f - 1f;
					float num2 = ((float)i + 0.5f) / (float)size * 2f - 1f;
					float num3 = Mathf.Sqrt(num * num + num2 * num2);
					float num4 = Mathf.Atan2(num2, num) / (MathF.PI * 2f) + 0.5f;
					float num5 = 0f;
					num5 += Mathf.Exp(0f - Mathf.Pow((num3 - 0.955f) / 0.012f, 2f));
					num5 += Mathf.Exp(0f - Mathf.Pow((num3 - 0.72f) / 0.01f, 2f));
					num5 += Mathf.Exp(0f - Mathf.Pow((num3 - 0.34f) / 0.008f, 2f)) * 0.8f;
					if (num3 > 0.74f && num3 < 0.94f)
					{
						float num6 = (num3 - 0.74f) / 0.2f;
						float num7 = Mathf.Repeat(num4 * 48f, 1f);
						bool flag = (num6 < 0.2f || num6 > 0.8f) && Mathf.Repeat(num4 * 192f, 1f) > 0.3f && Mathf.Repeat(num4 * 192f, 1f) < 0.7f;
						bool flag2 = num7 < 0.06f || num7 > 0.94f;
						num5 = Mathf.Max(num5, flag ? 0.9f : ((flag2 && num6 > 0.25f && num6 < 0.75f) ? 0.7f : 0.12f));
					}
					float num8 = Mathf.Repeat(num4 * 24f, 1f);
					if (num3 > 0.36f && num3 < 0.7f && (num8 < 0.015f || num8 > 0.985f))
					{
						num5 = Mathf.Max(num5, 0.85f * Step(0.36f, 0.42f, num3));
					}
					float num9 = Mathf.Repeat(num4 + num3 * 3f, 1f / 6f) * 6f;
					if (num3 > 0.1f && num3 < 0.33f)
					{
						num5 = Mathf.Max(num5, Mathf.Exp(0f - Mathf.Pow((num9 - 0.5f) / 0.05f, 2f)) * 0.5f);
					}
					num5 = Mathf.Clamp01(num5) * Step(1f, 0.97f, num3);
					array[i * size + j] = new Color(1f, 1f, 1f, num5);
				}
			}
			return array;
		}

		internal static Color[] CelFramePixels(int width, int height, int frameNumber)
		{
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num = (float)j + 0.5f - (float)width * 0.5f;
					float num2 = (float)i + 0.5f - (float)height * 0.5f;
					float num3 = RoundRect(num, num2, (float)width * 0.5f - 2f, (float)height * 0.5f - 2f, 6f);
					float num4 = 0f;
					if (num3 < 0f)
					{
						num4 = 0.16f + 0.06f * Vfx.ValueNoise((float)j * 0.05f, (float)i * 0.05f, 3, 64);
						if (num3 > -9f)
						{
							num4 = 1f;
						}
						if (Mathf.Abs(RoundRect(num, num2, (float)width * 0.5f - 18f, (float)height * 0.5f - 18f, 3f)) < 1.4f)
						{
							num4 = Mathf.Max(num4, 0.65f);
						}
						float num5 = Mathf.Abs(num + num2 * 0.6f - (float)width * 0.18f);
						if (num5 < 10f)
						{
							num4 = Mathf.Max(num4, 0.26f * (1f - num5 / 10f));
						}
					}
					float num6 = (float)height * 0.5f - 32f;
					if (Mathf.Min(Mathf.Min(Mathf.Sqrt((num - (float)width * 0.22f) * (num - (float)width * 0.22f) + (num2 - num6) * (num2 - num6)) - 7f, Mathf.Sqrt((num + (float)width * 0.22f) * (num + (float)width * 0.22f) + (num2 - num6) * (num2 - num6)) - 7f), RoundRect(num, num2 - num6, 16f, 6f, 6f)) < 0f)
					{
						num4 = 0f;
					}
					array[i * width + j] = new Color(1f, 1f, 1f, num4);
				}
			}
			string text = frameNumber.ToString("00");
			int num7 = Mathf.Max(2, width / 64);
			int num8 = width - 22 - text.Length * 6 * num7;
			int num9 = 20;
			for (int k = 0; k < text.Length; k++)
			{
				for (int l = 0; l < 5; l++)
				{
					for (int m = 0; m < 7; m++)
					{
						if (!GambleArt.GlyphLit(text[k], l, m))
						{
							continue;
						}
						for (int n = 0; n < num7; n++)
						{
							for (int num10 = 0; num10 < num7; num10++)
							{
								int num11 = num8 + (k * 6 + l) * num7 + num10;
								int num12 = num9 + (6 - m) * num7 + n;
								if (num11 >= 0 && num11 < width && num12 >= 0 && num12 < height)
								{
									array[num12 * width + num11] = new Color(1f, 1f, 1f, 0.95f);
								}
							}
						}
					}
				}
			}
			return array;
		}

		internal static Color[] CellPixels(int size)
		{
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[size * size];
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = ((float)j + 0.5f) / (float)size * 2f - 1f;
					float num2 = ((float)i + 0.5f) / (float)size * 2f - 1f;
					float num3 = (Vfx.ValueNoise(Mathf.Atan2(num2, num) * 2f + 10f, 3.3f, 5, 13) - 0.5f) * 0.05f;
					float num4 = Mathf.Sqrt(num * num + num2 * num2) + num3;
					float num5 = Mathf.Exp(0f - Mathf.Pow((num4 - 0.9f) / 0.035f, 2f)) * 0.95f;
					if (num4 < 0.9f)
					{
						num5 += 0.07f + Fbm(num * 4f + 20f, num2 * 4f + 20f, 61, 16, 3) * 0.08f;
					}
					float num6 = num + 0.18f;
					float num7 = num2 - 0.1f;
					float num8 = Mathf.Sqrt(num6 * num6 + num7 * num7);
					num5 += Mathf.Exp(0f - Mathf.Pow((num8 - 0.27f) / 0.03f, 2f)) * 0.55f;
					if (num8 < 0.27f)
					{
						num5 += 0.16f;
					}
					if (Mathf.Sqrt((num6 - 0.06f) * (num6 - 0.06f) + (num7 + 0.05f) * (num7 + 0.05f)) < 0.07f)
					{
						num5 += 0.35f;
					}
					for (int k = 0; k < 9; k++)
					{
						float num9 = Hash(k * 5 + 11) * 1.2f - 0.6f;
						float num10 = Hash(k * 5 + 12) * 1.2f - 0.6f;
						if (!(num9 * num9 + num10 * num10 > 0.5f) && !((num9 + 0.18f) * (num9 + 0.18f) + (num10 - 0.1f) * (num10 - 0.1f) < 0.12f))
						{
							float num11 = Mathf.Sqrt((num - num9) * (num - num9) * 2.4f + (num2 - num10) * (num2 - num10));
							num5 += Mathf.Exp((0f - num11) * num11 * 900f) * 0.4f;
						}
					}
					num5 *= Step(1f, 0.94f, num4);
					array[i * size + j] = new Color(1f, 1f, 1f, Mathf.Clamp01(num5));
				}
			}
			return array;
		}

		internal static Color[] SprocketBarPixels(int width, int height)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float x = (float)j + 0.5f - (float)width * 0.5f;
					float y = Mathf.Repeat((float)i + 0.5f, (float)height * 0.25f) - (float)height * 0.125f;
					float num = Mathf.Clamp01(RoundRect(x, y, (float)width * 0.22f, (float)height * 0.06f, (float)width * 0.08f) + 0.5f);
					array[i * width + j] = new Color(0.02f, 0.015f, 0.02f, num * 0.92f);
				}
			}
			return array;
		}

		internal static Color[] InkSheenPixels(int size)
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[size * size];
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = (float)j / (float)size * 6f;
					float num2 = (float)i / (float)size * 6f;
					float num3 = Fbm(num + 1.7f, num2 + 9.2f, 71, 6, 3) * 2.2f;
					float num4 = Fbm(num + 8.3f, num2 + 2.8f, 83, 6, 3) * 2.2f;
					float num5 = Fbm(num + num3, num2 + num4, 97, 6, 4);
					float num6 = Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(num5 - 0.5f) * 7f), 2.5f);
					float num7 = Mathf.Pow(Mathf.Clamp01(Fbm(num * 3f, num2 * 3f, 13, 18, 2) - 0.62f) * 4f, 3f);
					array[i * size + j] = new Color(1f, 1f, 1f, Mathf.Clamp01(num6 * 0.55f + num7 * 0.5f));
				}
			}
			return array;
		}

		internal static Color[] RipplePixels(int width, int height)
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num = ((float)j + 0.5f) / (float)width;
					float num2 = ((float)i + 0.5f) / (float)height;
					float num3 = Mathf.Exp(0f - Mathf.Pow((num - 0.18f) / 0.018f, 2f));
					float num4 = Mathf.Exp(0f - Mathf.Pow((num - 0.28f) / 0.06f, 2f)) * 0.25f;
					float num5 = 0.35f + 0.65f * Fbm(num * 3f, num2 * 12f, 29, 3, 3);
					array[i * width + j] = new Color(1f, 1f, 1f, Mathf.Clamp01((num3 + num4) * num5));
				}
			}
			return array;
		}

		internal static Color[] InkEdgePixels(int width, int height)
		{
			//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)
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num = ((float)j + 0.5f) / (float)width;
					float num2 = ((float)i + 0.5f) / (float)height;
					float num3 = 0.42f + 0.22f * Fbm(num * 8f, 0.5f, 41, 8, 4);
					float num4 = Mathf.Repeat(num * 14f + Fbm(num * 4f, num2 * 2f, 53, 4, 2) * 0.6f, 1f);
					float num5 = 0.6f + 0.35f * Hash(Mathf.FloorToInt(num * 14f) * 5 + 2);
					float num6 = 0.07f * Step(num5 + 0.02f, num3, num2) + 0.012f;
					float num7 = Step(num6, num6 * 0.5f, Mathf.Abs(num4 - 0.5f)) * Step(num5, num5 - 0.08f, num2) * ((Hash(Mathf.FloorToInt(num * 14f)) > 0.4f) ? 1f : 0f);
					float num8 = Step(num3 + 0.04f, num3 - 0.04f, num2);
					float num9 = 0f;
					float num10 = num * 40f;
					float num11 = num2 * 6f;
					int num12 = Mathf.FloorToInt(num10);
					int num13 = Mathf.FloorToInt(num11);
					float num14 = (float)num12 + 0.2f + Hash(num12 * 7 + num13 * 131 + 5) * 0.6f;
					float num15 = (float)num13 + 0.2f + Hash(num12 * 11 + num13 * 97 + 9) * 0.6f;
					float num16 = 0.12f + Hash(num12 * 3 + num13 * 71) * 0.18f;
					float x = Mathf.Sqrt((num10 - num14) * (num10 - num14) + (num11 - num15) * (num11 - num15) * 6f);
					if (num2 > num3 && Hash(num12 * 13 + num13 * 7 + 1) > 0.55f)
					{
						num9 = Step(num16, num16 * 0.6f, x) * Step(0.98f, 0.6f, num2);
					}
					float num17 = Mathf.Clamp01(Mathf.Max(num8, Mathf.Max(num7, num9)));
					array[i * width + j] = new Color(0.004f, 0.004f, 0.01f, num17);
				}
			}
			return array;
		}

		internal static Color[] RabbitPixels(int size)
		{
			//IL_01c9: 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_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[size * size];
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = ((float)j + 0.5f) / (float)size;
					float num2 = ((float)i + 0.5f) / (float)size;
					float num3 = Mathf.Sqrt((num - 0.44f) * (num - 0.44f) / 0.07f + (num2 - 0.34f) * (num2 - 0.34f) / 0.035f) - 1f;
					float num4 = Mathf.Sqrt((num - 0.68f) * (num - 0.68f) + (num2 - 0.5f) * (num2 - 0.5f)) - 0.13f;
					float num5 = Segment(num, num2, 0.66f, 0.58f, 0.6f, 0.9f) - 0.045f;
					float num6 = Segment(num, num2, 0.71f, 0.58f, 0.74f, 0.88f) - 0.04f;
					float num7 = Mathf.Sqrt((num - 0.17f) * (num - 0.17f) + (num2 - 0.4f) * (num2 - 0.4f)) - 0.065f;
					float num8 = Segment(num, num2, 0.34f, 0.18f, 0.2f, 0.12f) - 0.045f;
					float num9 = Mathf.Min(Mathf.Min(num3 * 0.12f, num4), Mathf.Min(Mathf.Min(num5, num6), Mathf.Min(num7, num8)));
					float num10 = Mathf.Clamp01(0.5f - num9 * (float)size);
					Color val = ((Mathf.Sqrt((num - 0.73f) * (num - 0.73f) + (num2 - 0.53f) * (num2 - 0.53f)) - 0.022f < 0f) ? new Color(0.35f, 0.05f, 0.08f, num10) : new Color(1f, 1f, 1f, num10));
					array[i * size + j] = val;
				}
			}
			return array;
		}

		internal static Color[] BrushStrokePixels(int width, int height)
		{
			//IL_01e4: 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)
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num = ((float)j + 0.5f) / (float)width;
					float num2 = ((float)i + 0.5f) / (float)height;
					float num3 = 0.36f + 0.1f * Fbm(num * 3f, 1.5f, 5, 3, 2) - 0.2f * Mathf.Pow(Mathf.Abs(num - 0.45f) * 2f, 3f);
					float num4 = 0.5f + 0.06f * Mathf.Sin(num * 5f);
					float num5 = Mathf.Abs(num2 - num4) / Mathf.Max(0.05f, num3);
					float x = Fbm(num * 1.5f + 4f, num2 * 64f, 19, 2, 3) + (Fbm(num * 6f, num2 * 64f, 31, 6, 2) - 0.5f) * 0.3f;
					float num6 = Step(0.45f, 1f, num);
					float num7 = Step(num6 * 0.75f - 0.05f, num6 * 0.75f + 0.05f, x);
					float num8 = Step(1f, 0.82f, num5 + (Fbm(num * 30f, num2 * 6f, 7, 30, 2) - 0.5f) * 0.4f);
					float num9 = Step(0f, 0.035f, num - Mathf.Pow(Mathf.Abs(num2 - num4) * 1.6f, 2f) * 0.05f) * Step(1f, 0.86f, num + (Fbm(num2 * 8f, 0.2f, 3, 8, 2) - 0.5f) * 0.2f);
					float num10 = Mathf.Clamp01(num8 * num9 * num7);
					array[i * width + j] = new Color(1f, 1f, 1f, num10);
				}
			}
			return array;
		}
	}
	internal static class GambleArt
	{
		private static readonly Dictionary<char, string[]> Glyphs = new Dictionary<char, string[]>
		{
			['A'] = new string[7] { ".###.", "#...#", "#...#", "#####", "#...#", "#...#", "#...#" },
			['B'] = new string[7] { "####.", "#...#", "#...#", "####.", "#...#", "#...#", "####." },
			['C'] = new string[7] { ".###.", "#...#", "#....", "#....", "#....", "#...#", ".###." },
			['D'] = new string[7] { "###..", "#..#.", "#...#", "#...#", "#...#", "#..#.", "###.." },
			['E'] = new string[7] { "#####", "#....", "#....", "####.", "#....", "#....", "#####" },
			['F'] = new string[7] { "#####", "#....", "#....", "####.", "#....", "#....", "#...." },
			['G'] = new string[7] { ".###.", "#...#", "#....", "#.###", "#...#", "#...#", ".####" },
			['H'] = new string[7] { "#...#", "#...#", "#...#", "#####", "#...#", "#...#", "#...#" },
			['I'] = new string[7] { ".###.", "..#..", "..#..", "..#..", "..#..", "..#..", ".###." },
			['J'] = new string[7] { "..###", "...#.", "...#.", "...#.", "...#.", "#..#.", ".##.." },
			['K'] = new string[7] { "#...#", "#..#.", "#.#..", "##...", "#.#..", "#..#.", "#...#" },
			['L'] = new string[7] { "#....", "#....", "#....", "#....", "#....", "#....", "#####" },
			['M'] = new string[7] { "#...#", "##.##", "#.#.#", "#.#.#", "#...#", "#...#", "#...#" },
			['N'] = new string[7] { "#...#", "#...#", "##..#", "#.#.#", "#..##", "#...#", "#...#" },
			['O'] = new string[7] { ".###.", "#...#", "#...#", "#...#", "#...#", "#...#", ".###." },
			['P'] = new string[7] { "####.", "#...#", "#...#", "####.", "#....", "#....", "#...." },
			['R'] = new string[7] { "####.", "#...#", "#...#", "####.", "#.#..", "#..#.", "#...#" },
			['S'] = new string[7] { ".####", "#....", "#....", ".###.", "....#", "....#", "####." },
			['T'] = new string[7] { "#####", "..#..", "..#..", "..#..", "..#..", "..#..", "..#.." },
			['U'] = new string[7] { "#...#", "#...#", "#...#", "#...#", "#...#", "#...#", ".###." },
			['V'] = new string[7] { "#...#", "#...#", "#...#", "#...#", "#...#", ".#.#.", "..#.." },
			['W'] = new string[7] { "#...#", "#...#", "#...#", "#.#.#", "#.#.#", "#.#.#", ".#.#." },
			['X'] = new string[7] { "#...#", "#...#", ".#.#.", "..#..", ".#.#.", "#...#", "#...#" },
			['Y'] = new string[7] { "#...#", "#...#", "#...#", ".#.#.", "..#..", "..#..", "..#.." },
			['0'] = new string[7] { ".###.", "#...#", "#..##", "#.#.#", "##..#", "#...#", ".###." },
			['1'] = new string[7] { "..#..", ".##..", "..#..", "..#..", "..#..", "..#..", ".###." },
			['2'] = new string[7] { ".###.", "#...#", "....#", "...#.", "..#..", ".#...", "#####" },
			['3'] = new string[7] { "#####", "...#.", "..#..", "...#.", "....#", "#...#", ".###." },
			['4'] = new string[7] { "...#.", "..##.", ".#.#.", "#..#.", "#####", "...#.", "...#." },
			['5'] = new string[7] { "#####", "#....", "####.", "....#", "....#", "#...#", ".###." },
			['6'] = new string[7] { "..##.", ".#...", "#....", "####.", "#...#", "#...#", ".###." },
			['7'] = new string[7] { "#####", "....#", "...#.", "..#..", ".#...", ".#...", ".#..." },
			['8'] = new string[7] { ".###.", "#...#", "#...#", ".###.", "#...#", "#...#", ".###." },
			['9'] = new string[7] { ".###.", "#...#", "#...#", ".####", "....#", "...#.", ".##.." },
			['!'] = new string[7] { "..#..", "..#..", "..#..", "..#..", "..#..", ".....", "..#.." },
			['-'] = new string[7] { ".....", ".....", ".....", "#####", ".....", ".....", "....." },
			[' '] = new string[7] { ".....", ".....", ".....", ".....", ".....", ".....", "....." }
		};

		private static readonly Color[] DigitColors = (Color[])(object)new Color[10]
		{
			new Color(0.12f, 0.16f, 0.42f),
			new Color(0.08f, 0.7f, 0.32f),
			new Color(0.12f, 0.42f, 0.95f),
			new Color(1f, 0.72f, 0.08f),
			new Color(0.55f, 0.18f, 0.85f),
			new Color(1f, 0.22f, 0.6f),
			new Color(0.05f, 0.72f, 0.85f),
			new Color(0.92f, 0.08f, 0.1f),
			new Color(1f, 0.45f, 0.08f),
			new Color(0.05f, 0.55f, 0.5f)
		};

		internal const int ReelPanels = 10;

		private static bool Lit(char c, int column, int row)
		{
			if (!Glyphs.TryGetValue(char.ToUpperInvariant(c), out string[] value))
			{
				value = Glyphs[' '];
			}
			return value[row][column] == '#';
		}

		internal static bool GlyphLit(char c, int column, int row)
		{
			return Lit(c, column, row);
		}

		internal static Texture2D Sign(string text, Color lit, Color unlit, int dot = 8)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_00f6: 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_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_017c: Unknown result type (might be due to invalid IL or missing references)
			int num = text.Length * 6 - 1 + 4;
			int num2 = 11;
			int num3 = num * dot;
			int num4 = num2 * dot;
			Texture2D val = new Texture2D(num3, num4, (TextureFormat)4, true)
			{
				name = "LCM Sign " + text,
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)2
			};
			Color[] array = (Color[])(object)new Color[num3 * num4];
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.015f, 0.015f, 0.02f, 1f);
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = val2;
			}
			float num5 = (float)dot * 0.4f;
			for (int j = 0; j < num; j++)
			{
				for (int k = 0; k < num2; k++)
				{
					int num6 = j - 2;
					int num7 = num2 - 1 - k - 2;
					bool flag = false;
					if (num6 >= 0 && num7 >= 0 && num7 < 7)
					{
						int num8 = num6 / 6;
						int num9 = num6 % 6;
						flag = num8 < text.Length && num9 < 5 && Lit(text[num8], num9, num7);
					}
					Color val3 = (flag ? lit : unlit);
					for (int l = 0; l < dot; l++)
					{
						for (int m = 0; m < dot; m++)
						{
							float num10 = (float)m + 0.5f - (float)dot * 0.5f;
							float num11 = (float)l + 0.5f - (float)dot * 0.5f;
							float num12 = Mathf.Clamp01(num5 - Mathf.Sqrt(num10 * num10 + num11 * num11) + 0.5f);
							if (!(num12 <= 0f))
							{
								int num13 = (k * dot + l) * num3 + j * dot + m;
								array[num13] = Color.Lerp(val2, val3, num12);
							}
						}
					}
				}
			}
			val.SetPixels(array);
			val.Apply(true, false);
			return val;
		}

		internal static Texture2D ReelStrip()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: 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_00a7: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: 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_019d: Unknown result type (might be due to invalid IL or missing references)
			int num = 128;
			int num2 = 1280;
			Texture2D val = new Texture2D(num, num2, (TextureFormat)4, true)
			{
				name = "LCM Reel Strip",
				wrapMode = (TextureWrapMode)0,
				filterMode = (FilterMode)2
			};
			Color[] array = (Color[])(object)new Color[num * num2];
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.97f, 0.97f, 0.94f, 1f);
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(0.62f, 0.64f, 0.66f, 1f);
			for (int i = 0; i < num2; i++)
			{
				bool flag = i % 128 < 2 || i % 128 >= 126;
				for (int j = 0; j < num; j++)
				{
					array[i * num + j] = (flag ? val3 : val2);
				}
			}
			for (int k = 0; k < 10; k++)
			{
				char c = (char)(48 + k);
				Color val4 = DigitColors[k];
				Color val5 = Color.Lerp(val4, Color.black, 0.65f);
				Color val6 = Color.Lerp(val4, Color.white, 0.45f);
				int num3 = 31;
				int num4 = k * 128 + 18;
				for (int l = 0; l < 7; l++)
				{
					for (int m = 0; m < 5; m++)
					{
						if (!Lit(c, m, l))
						{
							continue;
						}
						int num5 = num3 + m * 13;
						int num6 = num4 + (6 - l) * 13;
						for (int n = 0; n < 13; n++)
						{
							for (int num7 = 0; num7 < 13; num7++)
							{
								bool flag2 = num7 == 0 || n == 0 || num7 == 12 || n == 12;
								bool flag3 = !flag2 && n >= 9 && num7 < 10;
								array[(num6 + n) * num + num5 + num7] = (flag2 ? val5 : (flag3 ? val6 : val4));
							}
						}
					}
				}
			}
			val.SetPixels(array);
			val.Apply(true, false);
			return val;
		}

		internal static Texture2D PlatformTiles()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, true)
			{
				name = "LCM Platform Tiles",
				wrapMode = (TextureWrapMode)0,
				filterMode = (FilterMode)2
			};
			Color[] array = (Color[])(object)new Color[16384];
			for (int i = 0; i < 128; i++)
			{
				for (int j = 0; j < 128; j++)
				{
					int num = j % 64;
					int num2 = i % 64;
					bool num3 = num < 2 || num2 < 2;
					float num4 = Mathf.Clamp01(1f - Mathf.Abs((float)(num - num2) / 64f) * 3f) * 0.06f;
					Color val2 = (num3 ? new Color(0.7f, 0.73f, 0.75f) : new Color(0.9f + num4, 0.93f + num4, 0.94f + num4));
					array[i * 128 + j] = val2;
				}
			}
			val.SetPixels(array);
			val.Apply(true, false);
			return val;
		}

		internal static Texture2D Fade()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//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)
			Texture2D val = new Texture2D(4, 64, (TextureFormat)4, false)
			{
				name = "LCM Fade",
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)1
			};
			Color[] array = (Color[])(object)new Color[256];
			for (int i = 0; i < 64; i++)
			{
				float num = Mathf.Pow((float)i / 63f, 1.6f);
				for (int j = 0; j < 4; j++)
				{
					array[i * 4 + j] = new Color(1f, 1f, 1f, num);
				}
			}
			val.SetPixels(array);
			val.Apply(false, false);
			return val;
		}

		internal static Mesh ReelDrum(float radius, float width, int segments = 48)
		{
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: 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_0172: 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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: 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_00b1: 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)
			int num = segments + 1;
			Vector3[] array = (Vector3[])(object)new Vector3[num * 2];
			Vector3[] array2 = (Vector3[])(object)new Vector3[array.Length];
			Vector2[] array3 = (Vector2[])(object)new Vector2[array.Length];
			Vector3 val = default(Vector3);
			for (int i = 0; i < 2; i++)
			{
				float num2 = ((i == 0) ? ((0f - width) * 0.5f) : (width * 0.5f));
				for (int j = 0; j <= segments; j++)
				{
					float num3 = MathF.PI * 2f * (float)j / (float)segments;
					((Vector3)(ref val))..ctor(0f, Mathf.Sin(num3), 0f - Mathf.Cos(num3));
					int num4 = i * num + j;
					array[num4] = new Vector3(num2, 0f, 0f) + val * radius;
					array2[num4] = val;
					array3[num4] = new Vector2((float)i, (float)j / (float)segments);
				}
			}
			int[] array4 = new int[segments * 6];
			int num5 = 0;
			for (int k = 0; k < segments; k++)
			{
				int num6 = k;
				int num7 = k + 1;
				int num8 = num + k;
				int num9 = num + k + 1;
				array4[num5++] = num6;
				array4[num5++] = num7;
				array4[num5++] = num8;
				array4[num5++] = num8;
				array4[num5++] = num7;
				array4[num5++] = num9;
			}
			Mesh val2 = new Mesh
			{
				name = "LCM Reel Drum",
				vertices = array,
				normals = array2,
				uv = array3,
				triangles = array4
			};
			val2.RecalculateBounds();
			return val2;
		}

		internal static float ReelAngleFor(int digit)
		{
			return (0f - ((float)digit + 0.5f)) * 360f / 10f;
		}
	}
	internal sealed class GroundSampler
	{
		private static int groundMask = -2;

		private readonly Vector3 origin;

		private readonly float[] ringRadii;

		private readonly float[,] heights;

		private readonly int segments;

		internal float Radius => ringRadii[ringRadii.Length - 1];

		private static int GroundMask
		{
			get
			{
				if (groundMask == -2)
				{
					groundMask = LayerMask.GetMask(new string[6] { "Default", "Room", "Colliders", "Terrain", "MiscLevelGeometry", "DecalStickableSurface" });
					if (groundMask == 0)
					{
						groundMask = -5;
					}
				}
				return groundMask;
			}
		}

		internal Vector3 Origin => origin;

		private GroundSampler(Vector3 origin, float[] ringRadii, float[,] heights, int segments)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			this.origin = origin;
			this.ringRadii = ringRadii;
			this.heights = heights;
			this.segments = segments;
		}

		internal static GroundSampler Build(Vector3 worldOrigin, float radius, float ringSpacing, int segments)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			int num = Mathf.Max(1, Mathf.CeilToInt(radius / ringSpacing));
			float[] array = new float[num + 1];
			for (int i = 0; i <= num; i++)
			{
				array[i] = Mathf.Min((float)i * ringSpacing, radius);
			}
			float[,] array2 = new float[num + 1, segments];
			RaycastHit[] hits = (RaycastHit[])(object)new RaycastHit[16];
			int mask = GroundMask;
			float num2 = Probe(worldOrigin, 0f, 0f, 0f, hits, mask, 3f, 12f);
			for (int j = 0; j < segments; j++)
			{
				array2[0, j] = num2;
			}
			for (int k = 1; k <= num; k++)
			{
				for (int l = 0; l < segments; l++)
				{
					float num3 = MathF.PI * 2f * (float)l / (float)segments;
					float x = Mathf.Cos(num3) * array[k];
					float z = Mathf.Sin(num3) * array[k];
					array2[k, l] = Probe(worldOrigin, x, z, array2[k - 1, l], hits, mask, 18f, 46f);
				}
				RemoveSpikes(array2, k, segments);
			}
			return new GroundSampler(worldOrigin, array, array2, segments);
		}

		private static float Probe(Vector3 worldOrigin, float x, float z, float predicted, RaycastHit[] hits, int mask, float above, float length)
		{
			//IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			int num = Physics.RaycastNonAlloc(worldOrigin + new Vector3(x, predicted + above, z), Vector3.down, hits, length, mask, (QueryTriggerInteraction)1);
			float result = predicted;
			float num2 = float.MaxValue;
			for (int i = 0; i < num; i++)
			{
				float num3 = ((RaycastHit)(ref hits[i])).point.y - worldOrigin.y;
				float num4 = Mathf.Abs(num3 - predicted) + ((((RaycastHit)(ref hits[i])).normal.y < 0.4f) ? 6f : 0f);
				if (num4 < num2)
				{
					num2 = num4;
					result = num3;
				}
			}
			return result;
		}

		private static void RemoveSpikes(float[,] heights, int ring, int segments)
		{
			for (int i = 0; i < segments; i++)
			{
				float num = heights[ring, (i + segments - 1) % segments];
				float num2 = heights[ring, (i + 1) % segments];
				float num3 = heights[ring, i];
				if ((num3 - num > 1.2f && num3 - num2 > 1.2f) || (num - num3 > 1.2f && num2 - num3 > 1.2f))
				{
					heights[ring, i] = (num + num2) * 0.5f;
				}
			}
		}

		internal float HeightAt(float x, float z)
		{
			float num = Mathf.Sqrt(x * x + z * z);
			int num2 = ringRadii.Length - 1;
			int i;
			for (i = 0; i < num2 - 1 && ringRadii[i + 1] < num; i++)
			{
			}
			int num3 = Mathf.Min(i + 1, num2);
			float num4 = ringRadii[num3] - ringRadii[i];
			float num5 = ((num4 > 1E-05f) ? Mathf.Clamp01((num - ringRadii[i]) / num4) : 0f);
			float num6 = Mathf.Atan2(z, x);
			if (num6 < 0f)
			{
				num6 += MathF.PI * 2f;
			}
			float num7 = num6 / (MathF.PI * 2f) * (float)segments;
			int num8 = Mathf.FloorToInt(num7) % segments;
			int num9 = (num8 + 1) % segments;
			float num10 = num7 - Mathf.Floor(num7);
			float num11 = Mathf.Lerp(heights[i, num8], heights[i, num9], num10);
			float num12 = Mathf.Lerp(heights[num3, num8], heights[num3, num9], num10);
			return Mathf.Lerp(num11, num12, num5);
		}

		internal Vector3 OnGround(Vector3 local)
		{
			//IL_0000: 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_000d: 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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(local.x, HeightAt(local.x, local.z) + local.y, local.z);
		}

		internal Mesh BuildDisc(string name, float radius, float lift, Func<Vector2, Vector2> uv, Func<float, float> alpha)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: 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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: 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_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: 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_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Expected O, but got Unknown
			int num = ringRadii.Length - 1;
			int i;
			for (i = 1; i < num && ringRadii[i] < radius; i++)
			{
			}
			float[] array = new float[i + 1];
			for (int j = 0; j <= i; j++)
			{
				array[j] = Mathf.Min(ringRadii[j], radius);
			}
			array[i] = radius;
			int num2 = 1 + i * segments;
			Vector3[] array2 = (Vector3[])(object)new Vector3[num2];
			Vector2[] array3 = (Vector2[])(object)new Vector2[num2];
			Color32[] array4 = (Color32[])(object)new Color32[num2];
			Vector3[] array5 = (Vector3[])(object)new Vector3[num2];
			array2[0] = new Vector3(0f, HeightAt(0f, 0f) + lift, 0f);
			array3[0] = uv(Vector2.zero);
			array4[0] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)Mathf.RoundToInt(Mathf.Clamp01(alpha(0f)) * 255f));
			for (int k = 1; k <= i; k++)
			{
				byte b = (byte)Mathf.RoundToInt(Mathf.Clamp01(alpha(array[k])) * 255f);
				for (int l = 0; l < segments; l++)
				{
					float num3 = MathF.PI * 2f * (float)l / (float)segments;
					float num4 = Mathf.Cos(num3) * array[k];
					float num5 = Mathf.Sin(num3) * array[k];
					int num6 = 1 + (k - 1) * segments + l;
					array2[num6] = new Vector3(num4, HeightAt(num4, num5) + lift, num5);
					array3[num6] = uv(new Vector2(num4, num5));
					array4[num6] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b);
				}
			}
			for (int m = 0; m < num2; m++)
			{
				array5[m] = Vector3.up;
			}
			int[] array6 = new int[(segments + (i - 1) * segments * 2) * 3];
			int num7 = 0;
			for (int n = 0; n < segments; n++)
			{
				array6[num7++] = 0;
				array6[num7++] = 1 + (n + 1) % segments;
				array6[num7++] = 1 + n;
			}
			for (int num8 = 1; num8 < i; num8++)
			{
				int num9 = 1 + (num8 - 1) * segments;
				int num10 = 1 + num8 * segments;
				for (int num11 = 0; num11 < segments; num11++)
				{
					int num12 = (num11 + 1) % segments;
					array6[num7++] = num9 + num11;
					array6[num7++] = num9 + num12;
					array6[num7++] = num10 + num11;
					array6[num7++] = num10 + num11;
					array6[num7++] = num9 + num12;
					array6[num7++] = num10 + num12;
				}
			}
			Mesh val = new Mesh
			{
				name = name,
				indexFormat = (IndexFormat)(num2 > 65000),
				vertices = array2,
				normals = array5,
				uv = array3,
				colors32 = array4,
				triangles = array6
			};
			val.RecalculateBounds();
			return val;
		}
	}
	public sealed class VfxUvSpinner : MonoBehaviour
	{
		private Mesh mesh;

		private Vector3[] vertices = Array.Empty<Vector3>();

		private Vector2[] uvs = Array.Empty<Vector2>();

		private float size = 1f;

		private float speed;

		private float angle;

		internal void Initialize(Mesh target, float textureSize, float degreesPerSecond)
		{
			mesh = target;
			vertices = target.vertices;
			uvs = (Vector2[])(object)new Vector2[vertices.Length];
			size = textureSize;
			speed = degreesPerSecond;
			Apply();
		}

		private void LateUpdate()
		{
			if (!((Object)(object)mesh == (Object)null))
			{
				angle += speed * Time.deltaTime;
				Apply();
			}
		}

		private void Apply()
		{
			//IL_0095: 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)
			float num = angle * (MathF.PI / 180f);
			float num2 = Mathf.Cos(num);
			float num3 = Mathf.Sin(num);
			for (int i = 0; i < vertices.Length; i++)
			{
				float num4 = vertices[i].x * num2 - vertices[i].z * num3;
				float num5 = vertices[i].x * num3 + vertices[i].z * num2;
				uvs[i] = new Vector2(num4 / size + 0.5f, num5 / size + 0.5f);
			}
			mesh.uv = uvs;
		}
	}
	[BepInPlugin("anton.lethalcompanymod", "LethalCompanyMod", "1.23.1")]
	public sealed class Plugin : BaseUnityPlugin
	{
		private sealed class AnimatedSlashSprite
		{
			internal Transform Transform;

			internal Renderer Renderer;

			internal Vector3 Anchor;

			internal Vector3 Drift;

			internal Vector3 BaseScale;

			internal Color Tint;

			internal float Phase;

			internal float Speed;

			internal float Roll;

			internal bool CameraAttached;
		}

		private sealed class SoulMeterVisual
		{
			internal GameObject Root;

			internal Image Fill;

			internal Transform Target;
		}

		private sealed class HollowPurpleChargeState
		{
			internal ulong Id;

			internal ulong CasterId;

			internal float StartRealtime;

			internal bool LocalCaster;

			internal bool FireRequested;

			internal Vector3 LockedPosition;

			internal int ProtectedHealth;

			internal GameObject Root;

			internal EnergyOrb Red;

			internal EnergyOrb Blue;

			internal EnergyOrb Purple;

			internal Transform RingA;

			internal Transform RingB;

			internal Transform RingC;

			internal Transform PurpleShockRing;

			internal Renderer FusionFlash;

			internal float FusionFlashStart = -1f;

			internal bool FusionBurstPlayed;

			internal Light? Light;

			internal VfxScreenVolume? Screen;

			internal GameObject? AudioRoot;

			internal AudioSource? AudioSource;

			internal readonly List<LineRenderer> FusionArcs = new List<LineRenderer>();
		}

		private sealed class HostHollowPurpleCharge
		{
			internal ulong Id;

			internal ulong CasterId;

			internal float FireDeadline;
		}

		private sealed class HollowPurpleProjectileState
		{
			internal ulong Id;

			internal ulong CasterId;

			internal Vector3 Position;

			internal Vector3 PreviousPosition;

			internal Vector3 Direction;

			internal float StartRealtime;

			internal float EndRealtime;

			internal GameObject Root;

			internal Transform Core;

			internal Renderer PlasmaA;

			internal Renderer PlasmaB;

			internal Renderer Rim;

			internal Renderer HaloInner;

			internal Renderer HaloOuter;

			internal Renderer ReleaseFlash;

			internal Renderer ReleaseWave;

			internal Transform RingA;

			internal Transform RingB;

			internal Transform RingC;

			internal Transform ShockRingA;

			internal Transform ShockRingB;

			internal GameObject ScarRoot;

			internal ParticleSystem Scars;

			internal ParticleSystem Debris;

			internal float NextScarRealtime;

			internal Light? Light;

			internal VfxScreenVolume? Screen;

			internal readonly HashSet<EnemyAI> HitEnemies = new HashSet<EnemyAI>();

			internal readonly HashSet<ulong> HitPlayers = new HashSet<ulong>();
		}

		private sealed class HiddenTerrainState
		{
			internal Behaviour Terrain;

			internal bool WasEnabled;
		}

		private sealed class ArenaEntityState
		{
			internal Vector3 Position;

			internal Quaternion Rotation;

			internal Vector3 Velocity;

			internal Vector3 AngularVelocity;
		}

		private class NetworkDomainSession
		{
			internal ulong Id;

			internal DomainKind Domain;

			internal Vector3 SourceCenter;

			internal Vector3 ArenaCenter;

			internal ulong CasterId;

			internal float Duration;

			internal readonly Dictionary<int, Vector3> Participants = new Dictionary<int, Vector3>();
		}

		private sealed class HostDomainSession : NetworkDomainSession
		{
			internal float TimeLeft;

			internal float OpeningTimeLeft = 2.35f;

			internal float OpeningEndRealtime;

			internal float EndRealtime;

			internal float EffectTimeLeft;

			internal float GambleTimeLeft;

			internal bool ArenaActivated;

			internal readonly HashSet<ulong> ParticipantClientIds = new HashSet<ulong>();

			internal readonly Dictionary<EnemyAI, ArenaEntityState> EnemyStates = new Dictionary<EnemyAI, ArenaEntityState>();

			internal readonly Dictionary<EnemyAI, float> EnemySpeeds = new Dictionary<EnemyAI, float>();

			internal readonly Dictionary<GrabbableObject, ArenaEntityState> ItemStates = new Dictionary<GrabbableObject, ArenaEntityState>();

			internal readonly Dictionary<NetworkObject, ArenaEntityState> NetworkEntityStates = new Dictionary<NetworkObject, ArenaEntityState>();

			internal readonly Dictionary<ulong, float> PlayerSoulValues = new Dictionary<ulong, float>();

			internal readonly Dictionary<EnemyAI, float> EnemySoulValues = new Dictionary<EnemyAI, float>();

			internal readonly HashSet<ulong> SoulDeathsSent = new HashSet<ulong>();

			internal readonly Dictionary<EnemyAI, Vector3> TrackedPositions = new Dictionary<EnemyAI, Vector3>();

			internal readonly Dictionary<EnemyAI, float> TrackedCooldowns = new Dictionary<EnemyAI, float>();

			internal float StrikeTimeLeft;

			internal int StrikeCount;
		}

		private enum DomainKind
		{
			InfiniteVoid,
			MalevolentShrineOpen,
			MalevolentShrineClosed,
			IdleDeathGamble,
			SelfEmbodimentOfPerfection,
			TimeCellMoonPalace,
			ChimeraShadowGarden
		}

		private enum DomainInputCommand
		{
			ToggleDomainMenu,
			ToggleAbilityMenu,
			Select1,
			Select2,
			Select3,
			Select4,
			Select5,
			Select6,
			Select7,
			Confirm
		}

		private readonly struct DomainStyle
		{
			public readonly Color BoundaryColor;

			public readonly Color CoreColor;

			public readonly Color AccentColor;

			public readonly Color LightColor;

			public readonly Color FogColor;

			public readonly Color TextColor;

			public readonly float LightIntensity;

			public DomainStyle(Color boundaryColor, Color coreColor, Color accentColor, Color lightColor, Color fogColor, Color textColor, float lightIntensity)
			{
				//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_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_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: 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_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				BoundaryColor = boundaryColor;
				CoreColor = coreColor;
				AccentColor = accentColor;
				LightColor = lightColor;
				FogColor = fogColor;
				TextColor = textColor;
				LightIntensity = lightIntensity;
			}
		}

		private enum ReelMode
		{
			Spin,
			Braking,
			Hold
		}

		private sealed class ReelState
		{
			internal ReelMode Mode;

			internal float Angle;

			internal float From;

			internal float Target;

			internal float BrakeStart;

			internal float BrakeDuration;

			internal float HoldUntil;

			internal float StopAt;

			internal int PendingDigit = -1;
		}

		private sealed class GambleRows
		{
			internal int Outline;

			internal int White;

			internal int Chrome;

			internal int DoorGrey;

			internal int Glass;

			internal int Rubber;

			internal int NeonGreen;

			internal int NeonPink;

			internal int Yellow;

			internal int Gold;

			internal int DarkPanel;

			internal int Ball;
		}

		private sealed class EnergyOrb
		{
			internal Transform Root;

			internal Renderer Rim;

			internal Renderer Plasma;

			internal Renderer GlowInner;

			internal Renderer GlowOuter;

			internal Color GlowColor;

			internal Color RimColor;
		}

		private sealed class MoonTarget
		{
			internal Transform Transform;

			internal PlayerControllerB? Player;

			internal EnemyAI? Enemy;

			internal float NeckHeight;

			internal Vector3 LastPosition;

			internal float RearmAt;

			internal float Attach;

			internal GameObject Root;

			internal readonly Mesh[] Lines = (Mesh[])(object)new Mesh[2];

			internal readonly Vector3[][] Vertices = new Vector3[2][];

			internal readonly Vector2[][] Uvs = new Vector2[2][];

			internal readonly Renderer?[] Clips = (Renderer?[])(object)new Renderer[2];

			internal bool Seen;
		}

		private sealed class MoonFreezeFx
		{
			internal GameObject Root;

			internal Renderer Panel;

			internal Vector3 Anchor;

			internal float Born;

			internal bool Shattered;

			internal readonly List<Transform> Shards = new List<Transform>();

			internal readonly List<Vector3> Velocities = new List<Vector3>();

			internal readonly List<Vector3> Spins = new List<Vector3>();
		}

		private sealed class MoonCellFx
		{
			internal Transform Transform;

			internal Vector3 Home;

			internal Vector3 Drift;

			internal float Size;

			internal float Phase;
		}

		private sealed class MoonRows
		{
			internal int Outline;

			internal int Sclera;

			internal int Back;

			internal int Lid;

			internal int Waterline;

			internal int Vein;

			internal int Iris;

			internal int IrisLight;

			internal int IrisDark;

			internal int Gold;

			internal int Pupil;

			internal int Glint;

			internal int Metal;

			internal int MetalDark;

			internal int Brass;
		}

		private sealed class ShadowSeaLayer
		{
			internal Mesh Mesh;

			internal float[] Radii;

			internal float[] Angles;

			internal Vector3[] Vertices;

			internal Vector2[] Uvs;

			internal Color32[] Colors;

			internal float Lift;

			internal int UvMode;

			internal float BandInner;

			internal float BandOuter;

			internal float FadeFrom;

			internal float FadeTo;

			internal bool Normals;

			internal GroundSampler Ground;

			internal Transform Transform;
		}

		private sealed class ShadowRiser
		{
			internal Transform Transform;

			internal float Radius;

			internal float Height;

			internal float Phase;

			internal float Rise;

			internal Quaternion BaseRotation;

			internal bool Clone;
		}

		private sealed class ShadowSwimmer
		{
			internal Transform Transform;

			internal float Radius;

			internal float Angle;

			internal float Speed;

			internal float Phase;
		}

		private sealed class ShadowRipple
		{
			internal Transform Transform;

			internal float Born;

			internal float Life;

			internal float Size;
		}

		private sealed class ShadowOpeningVertebra
		{
			internal Transform Transform;

			internal float DissolveAt;

			internal float Scale;

			internal bool Burst;
		}

		private sealed class ShadowStrikeFx
		{
			internal int Kind;

			internal GameObject Root;

			internal Transform? Actor;

			internal Transform? Target;

			internal Vector3 TargetPoint;

			internal Vector3 Start;

			internal Vector3 End;

			internal float Born;

			internal float Duration;

			internal bool Struck;

			internal bool Emerged;

			internal bool Dived;

			internal LineRenderer? Bolt;

			internal LineRenderer? Branch;

			internal Light? Flash;

			internal float NextJitter;
		}

		private sealed class ShadowRows
		{
			internal int Outline;

			internal int Ink;

			internal int InkDeep;

			internal int WhiteFur;

			internal int MarkingWhite;

			internal int EyeGlow;

			internal int Mask;

			internal int Bone;

			internal int Fang;

			internal int Scute;
		}

		private sealed class ShrineRows
		{
			internal int Outline;

			internal int Bone;

			internal int Tooth;

			internal int Horn;

			internal int Socket;

			internal int EyeGlow;

			internal int Lacquer;

			internal int DarkWood;

			internal int Roof;

			internal int Stone;

			internal int Gore;

			internal int Lip;

			internal int Gum;

			internal int Throat;

			internal int Tongue;

			internal int Rope;

			internal int Paper;
		}

		private sealed class SoulRows
		{
			internal int Outline;

			internal int Skin;

			internal int SkinShadowed;

			internal int Stitch;

			internal int Nail;

			internal int Crystal;
		}

		private struct HandPose
		{
			internal float Curl;

			internal float Spread;

			internal float ThumbCurl;

			internal HandPose(float curl, float spread, float thumbCurl)
			{
				Curl = curl;
				Spread = spread;
				ThumbCurl = thumbCurl;
			}
		}

		public const string PluginGuid = "anton.lethalcompanymod";

		public const string PluginName = "LethalCompanyMod";

		public const string PluginVersion = "1.23.1";

		private const float DomainDuration = 30f;

		private const float IdleDeathGambleMinDuration = 45f;

		private const float IdleDeathGambleMaxDuration = 70f;

		private const float OpeningDuration = 2.35f;

		private const float DomainRadius = 26f;

		private const float MalevolentShrineOpenRadius = 55f;

		private const int MalevolentShrineOpenDamage = 3;

		private const float ForcedJackpotChance = 0.065f;

		private const float EffectInterval = 0.35f;

		private const float ClosedBarrierRadius = 23.4f;

		private const float SelfEmbodimentInteriorScale = 1.5f;

		private const float BarrierReturnOffset = 1.5f;

		private const float InfiniteVoidMovementMultiplier = 0.015f;

		private const float JackpotDuration = 100f;

		private const float JackpotRegenInterval = 0.1f;

		private const int JackpotRegenHealAmount = 32;

		private const int JackpotMinimumHealth = 92;

		private const ulong NoJackpotRegenClientId = ulong.MaxValue;

		private const float GambleSpinInterval = 4.2f;

		private const float DomainRequestRetryInterval = 1.5f;

		private const int MaxDomainRequestAttempts = 4;

		private const float ArenaFloorSize = 62f;

		private const float ArenaCaptureRadius = 26f;

		private const float ArenaSafeSpawnHeight = 0.7f;

		private const float ArenaFallRecoveryDepth = 1.25f;

		private const float ExteriorBarrierPostTeleportDelay = 0.2f;

		private const float MaximumSoul = 100f;

		private const float MinimumSoulDrainPerSecond = 2.75f;

		private const float MaximumSoulDrainPerSecond = 20f;

		private const float SoulDrainFalloffDistance = 14f;

		private const float SoulExileDepth = 1500f;

		private const float HollowPurpleChargeDuration = 20f;

		private const float HollowPurpleProjectileDuration = 20f;

		private const float HollowPurpleProjectileSpeed = 22f;

		private const float HollowPurpleProjectileRadius = 5.75f;

		private const float HollowPurpleAudioStartTime = 125f;

		private const float HollowPurpleAudioEndTime = 173f;

		private const float HollowPurpleRequestTimeout = 6f;

		private const string OpenDomainMessage = "LethalCompanyMod.OpenDomain";

		private const string RequestDomainMessage = "LethalCompanyMod.RequestDomain";

		private const string CloseDomainMessage = "LethalCompanyMod.CloseDomain";

		private const string GambleRollMessage = "LethalCompanyMod.GambleRoll";

		private const string ShrineDamageMessage = "LethalCompanyMod.ShrineDamage";

		private const string DomainDeniedMessage = "LethalCompanyMod.DomainDenied";

		private const string DomainConfigMessage = "LethalCompanyMod.DomainConfig";

		private const string SoulStateMessage = "LethalCompanyMod.SoulState";

		private const string SoulDeathMessage = "LethalCompanyMod.SoulDeath";

		private const string HollowPurpleRequestMessage = "LethalCompanyMod.HollowPurpleRequest";

		private const string HollowPurpleChargeMessage = "LethalCompanyMod.HollowPurpleCharge";

		private const string HollowPurpleFireRequestMessage = "LethalCompanyMod.HollowPurpleFireRequest";

		private const string HollowPurpleFireMessage = "LethalCompanyMod.HollowPurpleFire";

		private const string HollowPurpleCancelMessage = "LethalCompanyMod.HollowPurpleCancel";

		private const string HollowPurpleDeniedMessage = "LethalCompanyMod.HollowPurpleDenied";

		private const string HollowPurpleDeathMessage = "LethalCompanyMod.HollowPurpleDeath";

		private readonly Dictionary<EnemyAI, float> originalEnemySpeeds = new Dictionary<EnemyAI, float>();

		private readonly Dictionary<DomainKind, AudioClip> domainSounds = new Dictionary<DomainKind, AudioClip>();

		private readonly HashSet<DomainKind> missingSoundWarnings = new HashSet<DomainKind>();

		private readonly Dictionary<ulong, int> domainUsesConsumedThisMoon = new Dictionary<ulong, int>();

		private ConfigEntry<int> domainUsesPerMoonConfig;

		private ConfigEntry<bool> infiniteDomainUsesConfig;

		private AudioClip? slotRollClip;

		private AudioClip? jackpotSoundClip;

		private AudioClip? selfEmbodimentOpeningClip;

		private AudioClip? hollowPurpleThemeClip;

		private Texture2D? infiniteVoidGalaxyTexture;

		private Texture2D? infiniteVoidBlackHoleTexture;

		private Texture2D? infiniteVoidInkTexture;

		private Texture2D? infiniteVoidStreakTexture;

		private Texture2D? malevolentShrineOpenBarrierTexture;

		private Texture2D? malevolentShrineClosedBarrierTexture;

		private Texture2D? idleDeathGambleBarrierTexture;

		private Texture2D? malevolentShrineGroundSealTexture;

		private Texture2D? malevolentShrineSlashTexture;

		private Texture2D? malevolentShrineSlashCoreTexture;

		private readonly List<Transform> infiniteVoidRotators = new List<Transform>();

		private readonly List<LineRenderer> infiniteVoidPulseLines = new List<LineRenderer>();

		private readonly List<ParticleSystem> infiniteVoidParticleSystems = new List<ParticleSystem>();

		private readonly List<float> infiniteVoidParticleRates = new List<float>();

		private readonly List<LineRenderer> malevolentShrineSlashLines = new List<LineRenderer>();

		private readonly List<float> malevolentShrineSlashPhases = new List<float>();

		private readonly List<float> malevolentShrineSlashSpeeds = new List<float>();

		private readonly List<float> malevolentShrineSlashWidths = new List<float>();

		private readonly List<AnimatedSlashSprite> malevolentShrineSlashSprites = new List<AnimatedSlashSprite>();

		private readonly List<Transform> openingRotators = new List<Transform>();

		private readonly List<float> openingRotationSpeeds = new List<float>();

		private readonly List<ParticleSystem> openingTimedParticles = new List<ParticleSystem>();

		private readonly List<float> openingParticleStopProgress = new List<float>();

		private readonly List<Renderer> idleDeathGambleChaseLights = new List<Renderer>();

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

		private readonly Dictionary<Renderer, bool> hiddenDomainRenderers = new Dictionary<Renderer, bool>();

		private readonly Dictionary<Light, bool> hiddenDomainLights = new Dictionary<Light, bool>();

		private readonly List<HiddenTerrainState> hiddenDomainTerrains = new List<HiddenTerrainState>();

		private readonly Dictionary<DomainKind, GameObject> persistentDomainArenas = new Dictionary<DomainKind, GameObject>();

		private readonly List<NavMeshDataInstance> persistentArenaNavMeshes = new List<NavMeshDataInstance>();

		private readonly List<NavMeshData> persistentArenaNavMeshData = new List<NavMeshData>();

		private readonly Dictionary<EnemyAI, ArenaEntityState> arenaEnemyStates = new Dictionary<EnemyAI, ArenaEntityState>();

		private readonly Dictionary<GrabbableObject, ArenaEntityState> arenaItemStates = new Dictionary<GrabbableObject, ArenaEntityState>();

		private readonly Dictionary<NetworkObject, ArenaEntityState> arenaNetworkEntityStates = new Dictionary<NetworkObject, ArenaEntityState>();

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

		private readonly Dictionary<ulong, HostDomainSession> hostDomainSessions = new Dictionary<ulong, HostDomainSession>();

		private readonly Dictionary<ulong, NetworkDomainSession> knownDomainSessions = new Dictionary<ulong, NetworkDomainSession>();

		private readonly Dictionary<ulong, GameObject> domainExteriorRoots = new Dictionary<ulong, GameObject>();

		private readonly HashSet<ulong> pendingExteriorBarrierSessions = new HashSet<ulong>();

		private readonly Dictionary<ulong, GameObject> sessionDomainArenas = new Dictionary<ulong, GameObject>();

		private readonly Dictionary<DomainInputCommand, InputAction> domainInputActions = new Dictionary<DomainInputCommand, InputAction>();

		private readonly Dictionary<DomainInputCommand, bool> domainInputLatches = new Dictionary<DomainInputCommand, bool>();

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

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

		private readonly Dictionary<EnemyAI, float> localDirectEnemySoulValues = new Dictionary<EnemyAI, float>();

		private readonly Dictionary<ulong, SoulMeterVisual> playerSoulMeters = new Dictionary<ulong, SoulMeterVisual>();

		private readonly Dictionary<ulong, SoulMeterVisual> enemySoulMeters = new Dictionary<ulong, SoulMeterVisual>();

		private readonly Dictionary<ulong, HollowPurpleChargeState> hollowPurpleCharges = new Dictionary<ulong, HollowPurpleChargeState>();

		private readonly Dictionary<ulong, HostHollowPurpleCharge> hostHollowPurpleCharges = new Dictionary<ulong, HostHollowPurpleCharge>();

		private readonly Dictionary<ulong, HollowPurpleProjectileState> hollowPurpleProjectiles = new Dictionary<ulong, HollowPurpleProjectileState>();

		private Renderer? activeDomainInteriorRenderer;

		private GameObject? shrineCameraVfxRoot;

		private GameObject? domainCameraBackdropRoot;

		private bool atmosphereCaptured;

		private bool originalFogEnabled;

		private FogMode originalFogMode;

		private Color originalFogColor;

		private float originalFogDensity;

		private Color originalAmbientLight;

		private Material? originalSkybox;

		private Material? domainSkyboxMaterial;

		private Transform? selfEmbodimentCrystalRoot;

		private float selfEmbodimentVisualTime;

		private bool skyboxCaptured;

		private Camera? domainGameplayCamera;

		private CameraClearFlags originalCameraClearFlags;

		private Color originalCameraBackgroundColor;

		private bool domainCameraCaptured;

		private bool domainArenaActivated;

		private bool localPlayerInDomainArena;

		private bool localPlayerReturnCaptured;

		private int arenaRoundInstanceId;

		private float idleDeathGambleVisualTime;

		private float idleDeathGambleRollPulse;

		private DomainKind selectedDomain;

		private bool menuOpen;

		private bool abilityMenuOpen;

		private bool domainOpen;

		private bool openingActive;

		private bool domainVisualBuilt;

		private bool domainAffectsGameplay;

		private bool readyTipShown;

		private bool inputDebugLogged;

		private bool networkHandlersRegistered;

		private NetworkManager? registeredNetworkManager;

		private Harmony? harmony;

		private bool runtimeCallbacksRegistered;

		private bool runtimeDriverLogged;

		private bool runtimeShutdown;

		private bool pluginHostDestroyed;

		private bool detachedRuntimeTickLogged;

		private bool applicationQuitting;

		private bool runtimeResourcesInitialized;

		private bool runtimeInitializing;

		private bool domainSoundLoadScheduled;

		private bool jackpotSoundLoadScheduled;

		private bool hollowPurpleAudioLoadScheduled;

		private bool selfEmbodimentOpeningWarningLogged;

		private bool domainRequestPending;

		private DomainKind pendingDomainRequest;

		private Vector3 pendingDomainCenter;

		private ulong pendingDomainCasterId;

		private float domainRequestRetryTimer;

		private int domainRequestAttempts;

		private bool moonUsageStateInitialized;

		private bool previousShipHasLanded;

		private bool domainUsesAvailableOnMoon;

		private bool hostConfigReceived;

		private int syncedDomainUsesPerMoon = 1;

		private bool syncedInfiniteDomainUses;

		private float configSyncTimer;

		private int moonUsageLevelId = int.MinValue;

		private int lastTickFrame = -1;

		private int lastLateTickFrame = -1;

		private int lastMenuToggleFrame = -1;

		private int lastHollowPurpleCastFrame = -1;

		private float openingTime;

		private float domainTimeLeft;

		private float activeDomainDuration;

		private float openingEndRealtime;

		private float domainEndRealtime;

		private float effectTimer;

		private float gambleTimer;

		private float barrierTipCooldown;

		private float jackpotRegenTimeLeft;

		private float jackpotRegenTick;

		private float spinDisplayTimeLeft;

		private int jackpotRoll;

		private ulong casterClientId;

		private ulong activeDomainSessionId;

		private ulong nextHostDomainSessionId = 1uL;

		private ulong nextHostHollowPurpleId = 1uL;

		private Vector3 activeDomainArenaCenter;

		private ulong jackpotRegenClientId = ulong.MaxValue;

		private Vector3 domainCenter;

		private Vector3 domainSourceCenter;

		private Vector3 localPlayerReturnPosition;

		private Quaternion localPlayerReturnRotation;

		private Vector3 lastLocalPlayerPosition;

		private bool hasLastLocalPlayerPosition;

		private GameObject? driverHost;

		private DomainRuntimeDriver? runtimeDriver;

		private GameObject? menuCanvasRoot;

		private Text? menuText;

		private Image? menuAccent;

		private GameObject? spinCanvasRoot;

		private Text? spinText;

		private GameObject? soulHudCanvasRoot;

		private Image? soulHudFill;

		private Text? soulHudText;

		private GameObject? domainRoot;

		private GameObject? openingRoot;

		private GameObject? jackpotSoundObject;

		private AudioSource? jackpotSoundSource;

		private Light? domainLight;

		private string statusText = "Press F1 for Domains or F2 for Abilities.";

		private string soundDirectory = string.Empty;

		private string textureDirectory = string.Empty;

		private float infiniteVoidVisualTime;

		private float infiniteVoidSurge;

		private float malevolentShrineVisualTime;

		private bool hollowPurpleRequestPending;

		private float hollowPurpleRequestSentRealtime;

		private static readonly string[] DomainSfxNames = new string[12]
		{
			"sfx_tcmp_open", "sfx_tcmp_shutter", "sfx_tcmp_rupture", "sfx_tcmp_film_snap", "sfx_tcmp_projector_loop", "sfx_csg_open", "sfx_csg_splash", "sfx_csg_bite", "sfx_csg_serpent", "sfx_csg_lightning",
			"sfx_csg_howl", "sfx_csg_ooze_loop"
		};

		private readonly Dictionary<string, AudioClip> domainSfxClips = new Dictionary<string, AudioClip>();

		private readonly Dictionary<DomainKind, AudioClip> domainVoiceClips = new Dictionary<DomainKind, AudioClip>();

		private readonly HashSet<string> missingSfxWarnings = new HashSet<string>();

		private readonly List<AudioSource> domainLoopSources = new List<AudioSource>();

		private readonly List<float> domainLoopVolumes = new List<float>();

		private bool domainSfxLoadScheduled;

		private AudioSource? domainThemeSource;

		private float domainThemeVolume = 1f;

		private GameObject? titleCardRoot;

		private RawImage? titleCardBrush;

		private Text? titleCardHeader;

		private Text? titleCardName;

		private Text? titleCardSubtitle;

		private float titleCardAge;

		private DomainKind titleCardDomain;

		private string titleCardFullName = string.Empty;

		private bool titleCardPunched;

		private static Font? titleCardFont;

		private static bool titleCardFontResolved;

		private static bool titleCardKanji;

		private static Texture2D? titleBrushTexture;

		private VfxScreenVolume? domainScreen;

		private VfxScreenVolume? openingScreen;

		private float domainScreenAge;

		private ConfigEntry<float> effectLightBrightnessConfig;

		private ConfigEntry<float> bloomStrengthConfig;

		private ConfigEntry<bool> screenEffectsConfig;

		private const float ReelSpinSpeed = 600f;

		private static Texture2D? reelStripTexture;

		private static Texture2D? platformTileTexture;

		private static Texture2D? reelFadeTexture;

		private static Texture2D? gambleSignTexture;

		private static Texture2D? trainSignTexture;

		private readonly List<Transform> idleDeathGambleReels = new List<Transform>();

		private readonly List<Transform> idleDeathGambleFloaters = new List<Transform>();

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

		private readonly List<Transform> openingSpinners = new List<Transform>();

		private readonly ReelState[] reelStates = new ReelState[3]
		{
			new ReelState(),
			new ReelState(),
			new ReelState()
		};

		private const float PlayfieldCenterY = 3.5f;

		private const float PlayfieldRadius = 2.25f;

		private static readonly Color LapseBlueCore = new Color(0.62f, 0.86f, 1f, 1f);

		private static readonly Color LapseBlueGlow = new Color(0.08f, 0.42f, 1f, 1f);

		private static readonly Color LapseBlueRim = new Color(0.5f, 0.85f, 1f, 1f);

		private static readonly Color ReversalRedCore = new Color(1f, 0.64f, 0.56f, 1f);

		private static readonly Color ReversalRedGlow = new Color(1f, 0.06f, 0.1f, 1f);

		private static readonly Color ReversalRedRim = new Color(1f, 0.42f, 0.36f, 1f);

		private static readonly Color HollowPurpleCore = new Color(0.94f, 0.8f, 1f, 1f);

		private static readonly Color HollowPurpleGlow = new Color(0.6f, 0.12f, 1f, 1f);

		private static readonly Color HollowPurpleMagenta = new Color(1f, 0.22f, 0.86f, 1f);

		private static readonly Color HollowPurpleDeep = new Color(0.32f, 0.04f, 0.9f, 1f);

		private const float HollowPurpleCoreDiameter = 7.2f;

		private static Mesh? debrisMesh;

		private const float MoonPalaceFps = 24f;

		private const float MoonPalaceMoveThreshold = 0.5f;

		private const int MoonPalacePlayerDamage = 10;

		private const int MoonPalaceEnemyDamage = 1;

		private const float MoonPalaceFreezeSeconds = 0.6f;

		private const float MoonPalaceRearmSeconds = 0.9f;

		private const float MoonPalaceInteriorScale = 1.3f;

		private const float MoonPalaceEyeDistance = 17.5f;

		private const float MoonPalaceEyeHeight = 11.5f;

		private const float MoonPalaceEyeScale = 1.12f;

		private const float MoonPalaceFilmWidth = 0.46f;

		private static Texture2D? moonFilmTexture;

		private static Texture2D? moonDiscTexture;

		private static Texture2D? moonReelTexture;

		private static Texture2D? moonSealTexture;

		private static Texture2D? moonCelTexture;

		private static Texture2D? moonCellTexture;

		private static Texture2D? moonSprocketTexture;

		private static Mesh? moonShardMesh;

		private Transform? moonFloor;

		private Transform? moonEye;

		private Transform? moonIris;

		private Transform? moonEyeHalo;

		private Mesh? moonIrisMesh;

		private Vector3[]? moonIrisRestVertices;

		private Vector3[]? moonIrisAnimatedVertices;

		private Transform? moonZoetrope;

		private readonly Transform?[] moonEyeFilmAnchors = (Transform?[])(object)new Transform[2];

		private Material? moonFilmMaterial;

		private Material? moonFilmLineMaterial;

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

		private readonly List<Transform> moonFilmLoops = new List<Transform>();

		private readonly List<Quaternion> moonFilmLoopBases = new List<Quaternion>();

		private readonly List<MoonCellFx> moonCells = new List<MoonCellFx>();

		private readonly Dictionary<int, MoonTarget> moonTargets = new Dictionary<int, MoonTarget>();

		private readonly List<MoonFreezeFx> moonFreezeFrames = new List<MoonFreezeFx>();

		private Light? moonEyeLight;

		private Light? moonMoonLight;

		private float moonVisualTime;

		private int moonFrameStep = -1;

		private float moonTargetScanTimer;

		private float moonViolationPulse;

		private float moonLocalFreezeUntil;

		private float moonLocalRearmAt;

		private Vector3 moonLocalFreezePosition;

		private Vector3 moonLocalLastPosition;

		private bool moonLocalHasLast;

		private readonly Dictionary<EnemyAI, Vector3> moonLocalEnemyPositions = new Dictionary<EnemyAI, Vector3>();

		private readonly Dictionary<EnemyAI, float> moonLocalEnemyCooldowns = new Dictionary<EnemyAI, float>();

		private readonly List<Transform> moonOpeningFrames = new List<Transform>();

		private Transform? moonOpeningRing;

		private Mesh? moonOpeningHelix;

		private int[]? moonOpeningHelixTriangles;

		private Renderer? moonOpeningMoon;

		private Renderer? moonOpeningMoonHalo;

		private Material? moonOpeningFilmMaterial;

		private int moonOpeningStep = -1;

		private GameObject? moonHudRoot;

		private RawImage? moonHudLeftGate;

		private RawImage? moonHudRightGate;

		private Text? moonHudCounter;

		private Image? moonHudFlash;

		private readonly List<Image> moonHudBorder = new List<Image>();

		private float moonHudFlashAge = 10f;

		private float moonHudFade;

		private const float MoonPalaceHubRadius = 2.1f;

		private const float MoonEyeIrisRadius = 2.65f;

		private const float MoonEyePupilRadius = 0.97f;

		internal static readonly Vector3 MoonEyeFilmAnchor = new Vector3(7.5f, 0f, 0.4f);

		private const float ShadowGardenRadius = 30f;

		private const float ShadowGardenCaptureRadius = 38f;

		private const float ShadowGardenFloodSeconds = 1.7f;

		private const float ShadowGardenOpeningPoolRadius = 7.5f;

		private const float ShadowGardenPlayerSpeed = 0.55f;

		private const float ShadowGardenEnemySpeed = 0.4f;

		private const string DomainStrikeMessage = "LethalCompanyMod.DomainStrike";

		private const int ShadowStrikeDog = 0;

		private const int ShadowStrikeSerpent = 1;

		private const int ShadowStrikeNue = 2;

		private const int ShadowStrikeRabbits = 3;

		private const int ShadowStrikeIdleLeap = 4;

		private static Texture2D? shadowSheenTexture;

		private static Texture2D? shadowRippleTexture;

		private static Texture2D? shadowEdgeTexture;

		private static Texture2D? shadowRabbitTexture;

		private GroundSampler? shadowGround;

		private readonly List<ShadowSeaLayer> shadowSeaLayers = new List<ShadowSeaLayer>();

		private readonly List<ShadowRiser> shadowRisers = new List<ShadowRiser>();

		private readonly List<ShadowStrikeFx> shadowStrikes = new List<ShadowStrikeFx>();

		private readonly List<ShadowSwimmer> shadowSwimmers = new List<ShadowSwimmer>();

		private readonly List<ShadowRipple> shadowRipples = new List<ShadowRipple>();

		private ToonPalette? shadowPalette;

		private ShadowRows? shadowRows;

		private Mesh? shadowBlackDogMesh;

		private Mesh? shadowWhiteDogMesh;

		private Mesh? shadowSerpentMesh;

		private Mesh? shadowCloneMesh;

		private Transform? shadowNue;

		private Transform? shadowNueWingLeft;

		private Transform? shadowNueWingRight;

		private float shadowVisualTime;

		private float shadowFloodScale;

		private float shadowLastStrikeVisual;

		private float shadowNextRabbits;

		private float shadowNextCloneShift;

		private int shadowCloneShiftIndex;

		private float shadowNueFlapBoost;

		private float shadowLocalStrikeTimer;

		private int shadowLocalStrikeCount;

		private Vector3 shadowLastPlayerPosition;

		private bool shadowHasLastPlayerPosition;

		private Material? shadowRippleRingMaterial;

		private readonly List<ShadowOpeningVertebra> shadowOpeningSpine = new List<ShadowOpeningVertebra>();

		private Transform? shadowOpeningSpineRoot;

		private ShadowSeaLayer? shadowOpeningPool;

		private readonly List<Transform> shadowOpeningDogs = new List<Transform>();

		private Vector3 shadowOpeningCaster;

		private Vector3 shadowOpeningForward;

		private bool shadowOpeningRabbitsReleased;

		private bool shadowOpeningHowled;

		private float shadowOpeningNextRipple;

		private ParticleSystem? shadowOpeningEruption;

		private Transform? shrineJaw;

		private GroundSampler? shrineGround;

		private const float ShrineMawCenterY = 4.05f;

		private const float ShrineMawLipZ = 2.55f;

		private const float ShrineMawHalfWidth = 1.62f;

		private const float ShrineMawHalfHeight = 1.2f;

		private static readonly Vector3 ShrineJawHinge = new Vector3(0f, 4.05f, 0.2f);

		private static Texture2D? bloodPoolTexture;

		private const float PalmSquareness = 0.55f;

		internal static ManualLogSource Log { get; private set; } = null;

		internal static Plugin? Instance { get; private set; }

		private static float MoonPalaceFloorRadius => 33.8f;

		private void Awake()
		{
			Instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)("Plugin Awake: enabled=" + ((Behaviour)this).enabled + ", active=" + ((Component)this).gameObject.activeInHierarchy + ", host=" + ((Object)((Component)this).gameObject).name + "."));
			InitializeRuntimeHooks();
			BindConfig();
			InitializeInputActions();
			soundDirectory = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? Paths.PluginPath, "sounds");
			textureDirectory = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? Paths.PluginPath, "textures");
			Log.LogInfo((object)"Runtime scene objects are deferred until the first post-chainloader frame.");
			Log.LogInfo((object)"LethalCompanyMod 1.23.1 loaded. F1 Domain menu, F2 Ability menu, multiplayer sync enabled.");
		}

		private void OnEnable()
		{
			if (Log != null)
			{
				Log.LogInfo((object)("Plugin OnEnable: active=" + ((Component)this).gameObject.activeInHierarchy + "."));
			}
		}

		private void Start()
		{
			Log.LogInfo((object)"Plugin Start callback fired.");
		}

		private void OnDisable()
		{
			if (Log != null)
			{
				Log.LogInfo((object)"Plugin OnDisable callback fired; persistent runtime driver