Decompiled source of ForkInfectedCompany v1.0.0

BepInEx/plugins/InfectedCompany.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Dissonance;
using DunGen;
using EasingCurve;
using GameNetcodeStuff;
using HarmonyLib;
using InfectedCompany.Core;
using InfectedCompany.Core.Assets;
using InfectedCompany.Core.Config;
using InfectedCompany.Core.Data;
using InfectedCompany.Core.Extentions;
using InfectedCompany.Core.Game;
using InfectedCompany.Core.Input;
using InfectedCompany.Core.Items;
using InfectedCompany.Core.Logger;
using InfectedCompany.Core.Networking;
using InfectedCompany.Core.Objects;
using InfectedCompany.Core.Player;
using InfectedCompany.Core.Rooms;
using InfectedCompany.Core.SFX;
using InfectedCompany.Core.UI;
using InfectedCompany.Core.Utils;
using InfectedCompany.Core.VFX;
using InfectedCompany.Patches;
using InfectedCompany.Patches.QuarantinePatches;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Steamworks.Data;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("InfectedCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InfectedCompany")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dfed064e-ab44-4aa7-b361-7a59370d39a8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace EasingCurve
{
	public static class CubicBezierFitter
	{
		private const int MAX_DATA_COUNT = 100000;

		private const float MIN_ERROR = 1E-06f;

		public static List<Vector2> FitCurve(Vector2[] d, float error)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			Vector2 tHat = ComputeLeftTangent(d, 0);
			Vector2 tHat2 = ComputeRightTangent(d, d.Length - 1);
			List<Vector2> result = new List<Vector2>
			{
				new Vector2(0f, 0f)
			};
			FitCubic(d, 0, d.Length - 1, tHat, tHat2, error, result);
			return result;
		}

		private static void FitCubic(Vector2[] d, int first, int last, Vector2 tHat1, Vector2 tHat2, float error, List<Vector2> result)
		{
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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)
			//IL_00f8: 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_0114: 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_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: 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_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: 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)
			int num = 4;
			error = Mathf.Max(error, 1E-06f);
			float num2 = error * error;
			Vector2[] array;
			if (last - first + 1 == 2)
			{
				Vector2 val = d[first] - d[last];
				float num3 = ((Vector2)(ref val)).magnitude / 3f;
				array = (Vector2[])(object)new Vector2[4];
				array[0] = d[first];
				array[3] = d[last];
				array[1] = tHat1 * num3 + array[0];
				array[2] = tHat2 * num3 + array[3];
				result.Add(array[1]);
				result.Add(array[2]);
				result.Add(array[3]);
				return;
			}
			float[] array2 = ChordLengthParameterize(d, first, last);
			array = GenerateBezier(d, first, last, array2, tHat1, tHat2);
			float num4 = ComputeMaxError(d, first, last, array, array2, out var splitVector);
			if (num4 < error)
			{
				result.Add(array[1]);
				result.Add(array[2]);
				result.Add(array[3]);
				return;
			}
			if (num4 < num2)
			{
				for (int i = 0; i < num; i++)
				{
					float[] array3 = Reparameterize(d, first, last, array2, array);
					array = GenerateBezier(d, first, last, array3, tHat1, tHat2);
					num4 = ComputeMaxError(d, first, last, array, array3, out splitVector);
					if (num4 < error)
					{
						result.Add(array[1]);
						result.Add(array[2]);
						result.Add(array[3]);
						return;
					}
					array2 = array3;
				}
			}
			Vector2 val2 = ComputeCenterTangent(d, splitVector);
			FitCubic(d, first, splitVector, tHat1, val2, error, result);
			val2 = -val2;
			FitCubic(d, splitVector, last, val2, tHat2, error, result);
		}

		private static Vector2[] GenerateBezier(Vector2[] d, int first, int last, float[] uPrime, Vector2 tHat1, Vector2 tHat2)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: 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_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: 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_02e6: 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_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: 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_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: 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_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			Vector2[,] array = new Vector2[100000, 2];
			float[,] array2 = new float[2, 2];
			float[] array3 = new float[2];
			Vector2[] array4 = (Vector2[])(object)new Vector2[4];
			int num = last - first + 1;
			for (int i = 0; i < num; i++)
			{
				Vector2 val = tHat1;
				Vector2 val2 = tHat2;
				val *= B1(uPrime[i]);
				val2 *= B2(uPrime[i]);
				array[i, 0] = val;
				array[i, 1] = val2;
			}
			array2[0, 0] = 0f;
			array2[0, 1] = 0f;
			array2[1, 0] = 0f;
			array2[1, 1] = 0f;
			array3[0] = 0f;
			array3[1] = 0f;
			for (int i = 0; i < num; i++)
			{
				array2[0, 0] += V2Dot(array[i, 0], array[i, 0]);
				array2[0, 1] += V2Dot(array[i, 0], array[i, 1]);
				array2[1, 0] = array2[0, 1];
				array2[1, 1] += V2Dot(array[i, 1], array[i, 1]);
				Vector2 b = d[first + i] - (d[first] * B0(uPrime[i]) + (d[first] * B1(uPrime[i]) + (d[last] * B2(uPrime[i]) + d[last] * B3(uPrime[i]))));
				array3[0] += V2Dot(array[i, 0], b);
				array3[1] += V2Dot(array[i, 1], b);
			}
			float num2 = array2[0, 0] * array2[1, 1] - array2[1, 0] * array2[0, 1];
			float num3 = array2[0, 0] * array3[1] - array2[1, 0] * array3[0];
			float num4 = array3[0] * array2[1, 1] - array3[1] * array2[0, 1];
			float num5 = ((num2 == 0f) ? 0f : (num4 / num2));
			float num6 = ((num2 == 0f) ? 0f : (num3 / num2));
			Vector2 val3 = d[first] - d[last];
			float magnitude = ((Vector2)(ref val3)).magnitude;
			float num7 = 1E-06f * magnitude;
			if (num5 < num7 || num6 < num7)
			{
				float num8 = magnitude / 3f;
				array4[0] = d[first];
				array4[3] = d[last];
				array4[1] = tHat1 * num8 + array4[0];
				array4[2] = tHat2 * num8 + array4[3];
				return array4;
			}
			array4[0] = d[first];
			array4[3] = d[last];
			array4[1] = tHat1 * num5 + array4[0];
			array4[2] = tHat2 * num6 + array4[3];
			return array4;
		}

		private static float[] Reparameterize(Vector2[] d, int first, int last, float[] u, Vector2[] bezCurve)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			float[] array = new float[last - first + 1];
			for (int i = first; i <= last; i++)
			{
				array[i - first] = NewtonRaphsonRootFind(bezCurve, d[i], u[i - first]);
			}
			return array;
		}

		private static float NewtonRaphsonRootFind(Vector2[] Q, Vector2 P, float u)
		{
			//IL_0011: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: 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_017e: Unknown result type (might be due to invalid IL or missing references)
			Vector2[] array = (Vector2[])(object)new Vector2[3];
			Vector2[] array2 = (Vector2[])(object)new Vector2[2];
			Vector2 val = BezierII(3, Q, u);
			for (int i = 0; i <= 2; i++)
			{
				array[i].x = (Q[i + 1].x - Q[i].x) * 3f;
				array[i].y = (Q[i + 1].y - Q[i].y) * 3f;
			}
			for (int i = 0; i <= 1; i++)
			{
				array2[i].x = (array[i + 1].x - array[i].x) * 2f;
				array2[i].y = (array[i + 1].y - array[i].y) * 2f;
			}
			Vector2 val2 = BezierII(2, array, u);
			Vector2 val3 = BezierII(1, array2, u);
			float num = (val.x - P.x) * val2.x + (val.y - P.y) * val2.y;
			float num2 = val2.x * val2.x + val2.y * val2.y + (val.x - P.x) * val3.x + (val.y - P.y) * val3.y;
			if (num2 == 0f)
			{
				return u;
			}
			return u - num / num2;
		}

		private static Vector2 BezierII(int degree, Vector2[] V, float t)
		{
			//IL_0011: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			Vector2[] array = (Vector2[])(object)new Vector2[degree + 1];
			for (int i = 0; i <= degree; i++)
			{
				array[i] = V[i];
			}
			for (int i = 1; i <= degree; i++)
			{
				for (int j = 0; j <= degree - i; j++)
				{
					array[j].x = (1f - t) * array[j].x + t * array[j + 1].x;
					array[j].y = (1f - t) * array[j].y + t * array[j + 1].y;
				}
			}
			return array[0];
		}

		private static float B0(float u)
		{
			float num = 1f - u;
			return num * num * num;
		}

		private static float B1(float u)
		{
			float num = 1f - u;
			return 3f * u * (num * num);
		}

		private static float B2(float u)
		{
			float num = 1f - u;
			return 3f * u * u * num;
		}

		private static float B3(float u)
		{
			return u * u * u;
		}

		private static Vector2 ComputeLeftTangent(Vector2[] d, int end)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			Vector2 result = d[end + 1] - d[end];
			((Vector2)(ref result)).Normalize();
			return result;
		}

		private static Vector2 ComputeRightTangent(Vector2[] d, int end)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			Vector2 result = d[end - 1] - d[end];
			((Vector2)(ref result)).Normalize();
			return result;
		}

		private static Vector2 ComputeCenterTangent(Vector2[] d, int center)
		{
			//IL_0002: 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_0013: 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_001d: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			Vector2 result = default(Vector2);
			Vector2 val = d[center - 1] - d[center];
			Vector2 val2 = d[center] - d[center + 1];
			result.x = (val.x + val2.x) / 2f;
			result.y = (val.y + val2.y) / 2f;
			((Vector2)(ref result)).Normalize();
			return result;
		}

		private static float[] ChordLengthParameterize(Vector2[] d, int first, int last)
		{
			//IL_0028: 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_0034: 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)
			float[] array = new float[last - first + 1];
			array[0] = 0f;
			for (int i = first + 1; i <= last; i++)
			{
				int num = i - first;
				float num2 = array[i - first - 1];
				Vector2 val = d[i - 1] - d[i];
				array[num] = num2 + ((Vector2)(ref val)).magnitude;
			}
			for (int i = first + 1; i <= last; i++)
			{
				array[i - first] /= array[last - first];
			}
			return array;
		}

		private static float ComputeMaxError(Vector2[] d, int first, int last, Vector2[] bezCurve, float[] u, out int splitVector2)
		{
			//IL_001e: 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)
			//IL_002a: 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)
			splitVector2 = (last - first + 1) / 2;
			float num = 0f;
			for (int i = first + 1; i < last; i++)
			{
				Vector2 val = BezierII(3, bezCurve, u[i - first]) - d[i];
				float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude;
				if (sqrMagnitude >= num)
				{
					num = sqrMagnitude;
					splitVector2 = i;
				}
			}
			return num;
		}

		private static float V2Dot(Vector2 a, Vector2 b)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			return a.x * b.x + a.y * b.y;
		}
	}
	public static class EasingAnimationCurve
	{
		private static bool s_ThrowException = true;

		private static Vector2[] EaseInQuad = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 0f),
			new Vector2(0.666667f, 0.333333f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutQuad = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 0.666667f),
			new Vector2(0.666667f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutQuad = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.166667f, 0f),
			new Vector2(0.333333f, 0.166667f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.666667f, 0.833333f),
			new Vector2(0.833333f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInCubic = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 0f),
			new Vector2(0.666667f, 0f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutCubic = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 1f),
			new Vector2(0.666667f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutCubic = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.166667f, 0f),
			new Vector2(0.333333f, 0f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.666667f, 1f),
			new Vector2(0.833333f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInQuart = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.434789f, 0.006062f),
			new Vector2(0.730901f, -0.07258f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutQuart = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.269099f, 1.072581f),
			new Vector2(0.565211f, 0.993938f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutQuart = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.217394f, 0.003031f),
			new Vector2(0.365451f, -0.036291f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.634549f, 1.03629f),
			new Vector2(0.782606f, 0.996969f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInQuint = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.519568f, 0.012531f),
			new Vector2(0.774037f, -0.118927f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutQuint = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.225963f, 1.11926f),
			new Vector2(0.481099f, 0.987469f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutQuint = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.259784f, 0.006266f),
			new Vector2(0.387018f, -0.059463f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.612982f, 1.05963f),
			new Vector2(0.740549f, 0.993734f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInSine = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.36078f, -0.000436f),
			new Vector2(0.673486f, 0.486554f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutSine = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.330931f, 0.520737f),
			new Vector2(0.641311f, 1.000333f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutSine = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.18039f, -0.000217f),
			new Vector2(0.336743f, 0.243277f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.665465f, 0.760338f),
			new Vector2(0.820656f, 1.000167f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInExpo = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.636963f, 0.0199012f),
			new Vector2(0.844333f, -0.0609379f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutExpo = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.155667f, 1.060938f),
			new Vector2(0.363037f, 0.980099f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutExpo = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.318482f, 0.009951f),
			new Vector2(0.422167f, -0.030469f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.577833f, 1.030469f),
			new Vector2(0.681518f, 0.9900494f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInCirc = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.55403f, 0.001198f),
			new Vector2(0.998802f, 0.449801f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutCirc = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.001198f, 0.553198f),
			new Vector2(0.445976f, 0.998802f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutCirc = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.277013f, 0.000599f),
			new Vector2(0.499401f, 0.223401f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.500599f, 0.776599f),
			new Vector2(0.722987f, 0.999401f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] Spring = (Vector2[])(object)new Vector2[16]
		{
			new Vector2(0f, 0f),
			new Vector2(0.080285f, 0.287602f),
			new Vector2(0.189354f, 0.568038f),
			new Vector2(0.336583f, 0.828268f),
			new Vector2(0.384005f, 0.912086f),
			new Vector2(0.450141f, 1.048536f),
			new Vector2(0.550666f, 1.079651f),
			new Vector2(0.645743f, 1.10908f),
			new Vector2(0.697447f, 0.993654f),
			new Vector2(0.779498f, 0.974607f),
			new Vector2(0.822437f, 0.964639f),
			new Vector2(0.858526f, 0.992624f),
			new Vector2(0.897999f, 1.003668f),
			new Vector2(0.93173f, 1.013104f),
			new Vector2(0.966372f, 1.006806f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInBounce = (Vector2[])(object)new Vector2[13]
		{
			new Vector2(0f, 0f),
			new Vector2(0.030303f, 0.020833f),
			new Vector2(0.060606f, 0.020833f),
			new Vector2(0.0909f, 0f),
			new Vector2(0.151515f, 0.083333f),
			new Vector2(0.212121f, 0.083333f),
			new Vector2(0.2727f, 0f),
			new Vector2(0.393939f, 0.333333f),
			new Vector2(0.515152f, 0.333333f),
			new Vector2(0.6364f, 0f),
			new Vector2(0.757576f, 0.666667f),
			new Vector2(0.878788f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutBounce = (Vector2[])(object)new Vector2[13]
		{
			new Vector2(0f, 0f),
			new Vector2(0.121212f, 0f),
			new Vector2(0.242424f, 0.333333f),
			new Vector2(0.3636f, 1f),
			new Vector2(0.484848f, 0.666667f),
			new Vector2(0.60606f, 0.666667f),
			new Vector2(0.7273f, 1f),
			new Vector2(0.787879f, 0.916667f),
			new Vector2(0.848485f, 0.916667f),
			new Vector2(0.9091f, 1f),
			new Vector2(0.939394f, 47f / 48f),
			new Vector2(32f / 33f, 47f / 48f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutBounce = (Vector2[])(object)new Vector2[25]
		{
			new Vector2(0f, 0f),
			new Vector2(0.015152f, 0.010417f),
			new Vector2(0.030303f, 0.010417f),
			new Vector2(0.0455f, 0f),
			new Vector2(0.075758f, 0.041667f),
			new Vector2(0.106061f, 0.041667f),
			new Vector2(0.1364f, 0f),
			new Vector2(0.19697f, 0.166667f),
			new Vector2(0.257576f, 0.166667f),
			new Vector2(0.3182f, 0f),
			new Vector2(0.378788f, 0.333333f),
			new Vector2(0.439394f, 0.5f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.560606f, 0.5f),
			new Vector2(0.621212f, 0.666667f),
			new Vector2(0.6818f, 1f),
			new Vector2(0.742424f, 0.833333f),
			new Vector2(0.80303f, 0.833333f),
			new Vector2(0.8636f, 1f),
			new Vector2(0.893939f, 0.958333f),
			new Vector2(0.924242f, 0.958333f),
			new Vector2(0.955f, 1f),
			new Vector2(32f / 33f, 0.989583f),
			new Vector2(0.984848f, 0.989583f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInBack = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 0f),
			new Vector2(0.666667f, -0.567193f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutBack = (Vector2[])(object)new Vector2[4]
		{
			new Vector2(0f, 0f),
			new Vector2(0.333333f, 1.567193f),
			new Vector2(0.666667f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutBack = (Vector2[])(object)new Vector2[7]
		{
			new Vector2(0f, 0f),
			new Vector2(0.166667f, 0f),
			new Vector2(0.333333f, -0.432485f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.666667f, 1.432485f),
			new Vector2(0.833333f, 1f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInElastic = (Vector2[])(object)new Vector2[13]
		{
			new Vector2(0f, 0f),
			new Vector2(0.175f, 0.00250747f),
			new Vector2(0.173542f, 0f),
			new Vector2(0.175f, 0f),
			new Vector2(0.4425f, -0.0184028f),
			new Vector2(0.3525f, 0.05f),
			new Vector2(0.475f, 0f),
			new Vector2(0.735f, -0.143095f),
			new Vector2(0.6575f, 0.383333f),
			new Vector2(0.775f, 0f),
			new Vector2(0.908125f, -0.586139f),
			new Vector2(0.866875f, -0.666667f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseOutElastic = (Vector2[])(object)new Vector2[13]
		{
			new Vector2(0f, 0f),
			new Vector2(0.133125f, 1.666667f),
			new Vector2(0.091875f, 1.586139f),
			new Vector2(0.225f, 1f),
			new Vector2(0.3425f, 0.616667f),
			new Vector2(0.265f, 1.143095f),
			new Vector2(0.525f, 1f),
			new Vector2(0.6475f, 0.95f),
			new Vector2(0.5575f, 1.0184028f),
			new Vector2(0.825f, 1f),
			new Vector2(0.826458f, 1f),
			new Vector2(0.825f, 0.9974925f),
			new Vector2(1f, 1f)
		};

		private static Vector2[] EaseInOutElastic = (Vector2[])(object)new Vector2[25]
		{
			new Vector2(0f, 0f),
			new Vector2(0.0875f, 0.001254f),
			new Vector2(0.086771f, 0f),
			new Vector2(0.0875f, 0f),
			new Vector2(0.22125f, -0.009201f),
			new Vector2(0.17625f, 0.025f),
			new Vector2(0.2375f, 0f),
			new Vector2(0.3675f, -0.071548f),
			new Vector2(0.32875f, 0.191667f),
			new Vector2(0.3875f, 0f),
			new Vector2(0.454063f, -0.29307f),
			new Vector2(0.433438f, -0.333334f),
			new Vector2(0.5f, 0.5f),
			new Vector2(0.5665625f, 1.333334f),
			new Vector2(0.5459375f, 1.29307f),
			new Vector2(0.6125f, 1f),
			new Vector2(0.67125f, 0.808334f),
			new Vector2(0.6325f, 1.071548f),
			new Vector2(0.7625f, 1f),
			new Vector2(0.82375f, 0.975f),
			new Vector2(0.77875f, 1.009201f),
			new Vector2(0.9125f, 1f),
			new Vector2(0.913229f, 1f),
			new Vector2(0.9125f, 0.9987463f),
			new Vector2(1f, 1f)
		};

		private static AnimationCurve StepAnimationCurve
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				AnimationCurve val = new AnimationCurve();
				Keyframe[] array = new Keyframe[4];
				Keyframe val2 = default(Keyframe);
				((Keyframe)(ref val2))..ctor(0f, 0f);
				((Keyframe)(ref val2)).outTangent = 0f;
				array[0] = val2;
				((Keyframe)(ref val2))..ctor(0.5f, 0f);
				((Keyframe)(ref val2)).inTangent = 0f;
				((Keyframe)(ref val2)).outTangent = 0f;
				array[1] = val2;
				((Keyframe)(ref val2))..ctor(0.5f, 1f);
				((Keyframe)(ref val2)).inTangent = 0f;
				((Keyframe)(ref val2)).outTangent = 0f;
				array[2] = val2;
				((Keyframe)(ref val2))..ctor(1f, 1f);
				((Keyframe)(ref val2)).inTangent = 0f;
				array[3] = val2;
				Keyframe[] keys = (Keyframe[])(object)array;
				val.keys = keys;
				return val;
			}
		}

		public static AnimationCurve EaseToAnimationCurve(EasingFunctions.Ease ease)
		{
			return (AnimationCurve)(ease switch
			{
				EasingFunctions.Ease.EaseInQuad => BezierToAnimationCurve(EaseInQuad), 
				EasingFunctions.Ease.EaseOutQuad => BezierToAnimationCurve(EaseOutQuad), 
				EasingFunctions.Ease.EaseInOutQuad => BezierToAnimationCurve(EaseInOutQuad), 
				EasingFunctions.Ease.EaseInCubic => BezierToAnimationCurve(EaseInCubic), 
				EasingFunctions.Ease.EaseOutCubic => BezierToAnimationCurve(EaseOutCubic), 
				EasingFunctions.Ease.EaseInOutCubic => BezierToAnimationCurve(EaseInOutCubic), 
				EasingFunctions.Ease.EaseInQuart => BezierToAnimationCurve(EaseInQuart), 
				EasingFunctions.Ease.EaseOutQuart => BezierToAnimationCurve(EaseOutQuart), 
				EasingFunctions.Ease.EaseInOutQuart => BezierToAnimationCurve(EaseInOutQuart), 
				EasingFunctions.Ease.EaseInQuint => BezierToAnimationCurve(EaseInQuint), 
				EasingFunctions.Ease.EaseOutQuint => BezierToAnimationCurve(EaseOutQuint), 
				EasingFunctions.Ease.EaseInOutQuint => BezierToAnimationCurve(EaseInOutQuint), 
				EasingFunctions.Ease.EaseInSine => BezierToAnimationCurve(EaseInSine), 
				EasingFunctions.Ease.EaseOutSine => BezierToAnimationCurve(EaseOutSine), 
				EasingFunctions.Ease.EaseInOutSine => BezierToAnimationCurve(EaseInOutSine), 
				EasingFunctions.Ease.EaseInExpo => BezierToAnimationCurve(EaseInExpo), 
				EasingFunctions.Ease.EaseOutExpo => BezierToAnimationCurve(EaseOutExpo), 
				EasingFunctions.Ease.EaseInOutExpo => BezierToAnimationCurve(EaseInOutExpo), 
				EasingFunctions.Ease.EaseInCirc => BezierToAnimationCurve(EaseInCirc), 
				EasingFunctions.Ease.EaseOutCirc => BezierToAnimationCurve(EaseOutCirc), 
				EasingFunctions.Ease.EaseInOutCirc => BezierToAnimationCurve(EaseInOutCirc), 
				EasingFunctions.Ease.Linear => AnimationCurve.Linear(0f, 0f, 1f, 1f), 
				EasingFunctions.Ease.Spring => BezierToAnimationCurve(Spring), 
				EasingFunctions.Ease.EaseInBounce => BezierToAnimationCurve(EaseInBounce), 
				EasingFunctions.Ease.EaseOutBounce => BezierToAnimationCurve(EaseOutBounce), 
				EasingFunctions.Ease.EaseInOutBounce => BezierToAnimationCurve(EaseInOutBounce), 
				EasingFunctions.Ease.EaseInBack => BezierToAnimationCurve(EaseInBack), 
				EasingFunctions.Ease.EaseOutBack => BezierToAnimationCurve(EaseOutBack), 
				EasingFunctions.Ease.EaseInOutBack => BezierToAnimationCurve(EaseInOutBack), 
				EasingFunctions.Ease.EaseInElastic => BezierToAnimationCurve(EaseInElastic), 
				EasingFunctions.Ease.EaseOutElastic => BezierToAnimationCurve(EaseOutElastic), 
				EasingFunctions.Ease.EaseInOutElastic => BezierToAnimationCurve(EaseInOutElastic), 
				EasingFunctions.Ease.Step => StepAnimationCurve, 
				_ => throw new ArgumentException("Undefined Easing Function: " + ease), 
			});
		}

		public static AnimationCurve EaseToAnimationCurveBruteForce(EasingFunctions.Ease ease, int segements = 20)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			AnimationCurve val = new AnimationCurve();
			Keyframe[] array = (Keyframe[])(object)new Keyframe[segements];
			for (int i = 0; i < array.Length; i++)
			{
				float num = (float)i / (float)(array.Length - 1);
				float num2 = EasingFunctions.GetEasingFunction(ease)(0f, 1f, num);
				array[i] = new Keyframe(num, num2);
			}
			val.keys = array;
			for (int j = 1; j < array.Length - 1; j++)
			{
				val.SmoothTangents(j, 0f);
			}
			return val;
		}

		public static AnimationCurve BezierToAnimationCurve(Vector2[] controlPointStrips)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_000d: Expected O, but got Unknown
			AnimationCurve val = new AnimationCurve();
			BezierToAnimationCurve(val, controlPointStrips);
			return val;
		}

		private static void BezierToAnimationCurve(AnimationCurve outCurve, Vector2[] controlPointStrips)
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Expected O, but got Unknown
			if (s_ThrowException)
			{
				if (controlPointStrips.Length < 4)
				{
					throw new ArgumentException("The number of control point strips should more than 4!");
				}
				if ((controlPointStrips.Length - 4) % 3 != 0)
				{
					throw new ArgumentException("The number of control point strips N should be (N-4)%3==0");
				}
			}
			int num = 1 + (controlPointStrips.Length - 4) / 3;
			Keyframe[] array = (Keyframe[])(object)new Keyframe[num + 1];
			Keyframe val = default(Keyframe);
			((Keyframe)(ref val))..ctor(controlPointStrips[0].x, controlPointStrips[0].y);
			((Keyframe)(ref val)).weightedMode = (WeightedMode)3;
			array[0] = val;
			for (int i = 0; i < num; i++)
			{
				int num2 = i * 3;
				((Keyframe)(ref array[i])).outTangent = Tangent(in controlPointStrips[num2], in controlPointStrips[num2 + 1]);
				float length = controlPointStrips[num2 + 3].x - controlPointStrips[num2].x;
				((Keyframe)(ref array[i])).outWeight = Weight(in controlPointStrips[num2], in controlPointStrips[num2 + 1], length);
				int num3 = i + 1;
				((Keyframe)(ref val))..ctor(controlPointStrips[num2 + 3].x, controlPointStrips[num2 + 3].y);
				((Keyframe)(ref val)).inTangent = Tangent(in controlPointStrips[num2 + 2], in controlPointStrips[num2 + 3]);
				((Keyframe)(ref val)).inWeight = Weight(in controlPointStrips[num2 + 2], in controlPointStrips[num2 + 3], length);
				((Keyframe)(ref val)).weightedMode = (WeightedMode)3;
				array[num3] = val;
			}
			if (outCurve == null)
			{
				outCurve = new AnimationCurve();
			}
			outCurve.keys = array;
		}

		private static float Tangent(in Vector2 from, in Vector2 to)
		{
			//IL_0001: 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_0012: 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)
			Vector2 val = to - from;
			return val.y / val.x;
		}

		private static float Weight(in Vector2 from, in Vector2 to, float length)
		{
			return (to.x - from.x) / length;
		}
	}
	public static class EasingFunctions
	{
		public enum Ease
		{
			EaseInQuad,
			EaseOutQuad,
			EaseInOutQuad,
			EaseInCubic,
			EaseOutCubic,
			EaseInOutCubic,
			EaseInQuart,
			EaseOutQuart,
			EaseInOutQuart,
			EaseInQuint,
			EaseOutQuint,
			EaseInOutQuint,
			EaseInSine,
			EaseOutSine,
			EaseInOutSine,
			EaseInExpo,
			EaseOutExpo,
			EaseInOutExpo,
			EaseInCirc,
			EaseOutCirc,
			EaseInOutCirc,
			Linear,
			Spring,
			EaseInBounce,
			EaseOutBounce,
			EaseInOutBounce,
			EaseInBack,
			EaseOutBack,
			EaseInOutBack,
			EaseInElastic,
			EaseOutElastic,
			EaseInOutElastic,
			Step
		}

		public delegate float Function(float start, float end, float value);

		private const float NATURAL_LOG_OF_2 = 0.6931472f;

		public static float Linear(float start, float end, float value)
		{
			return Mathf.Lerp(start, end, value);
		}

		public static float Spring(float start, float end, float value)
		{
			value = Mathf.Clamp01(value);
			value = (Mathf.Sin(value * (float)Math.PI * (0.2f + 2.5f * value * value * value)) * Mathf.Pow(1f - value, 2.2f) + value) * (1f + 1.2f * (1f - value));
			return start + (end - start) * value;
		}

		public static float EaseInQuad(float start, float end, float value)
		{
			end -= start;
			return end * value * value + start;
		}

		public static float EaseOutQuad(float start, float end, float value)
		{
			end -= start;
			return (0f - end) * value * (value - 2f) + start;
		}

		public static float EaseInOutQuad(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * 0.5f * value * value + start;
			}
			value -= 1f;
			return (0f - end) * 0.5f * (value * (value - 2f) - 1f) + start;
		}

		public static float EaseInCubic(float start, float end, float value)
		{
			end -= start;
			return end * value * value * value + start;
		}

		public static float EaseOutCubic(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return end * (value * value * value + 1f) + start;
		}

		public static float EaseInOutCubic(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * 0.5f * value * value * value + start;
			}
			value -= 2f;
			return end * 0.5f * (value * value * value + 2f) + start;
		}

		public static float EaseInQuart(float start, float end, float value)
		{
			end -= start;
			return end * value * value * value * value + start;
		}

		public static float EaseOutQuart(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return (0f - end) * (value * value * value * value - 1f) + start;
		}

		public static float EaseInOutQuart(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * 0.5f * value * value * value * value + start;
			}
			value -= 2f;
			return (0f - end) * 0.5f * (value * value * value * value - 2f) + start;
		}

		public static float EaseInQuint(float start, float end, float value)
		{
			end -= start;
			return end * value * value * value * value * value + start;
		}

		public static float EaseOutQuint(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return end * (value * value * value * value * value + 1f) + start;
		}

		public static float EaseInOutQuint(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * 0.5f * value * value * value * value * value + start;
			}
			value -= 2f;
			return end * 0.5f * (value * value * value * value * value + 2f) + start;
		}

		public static float EaseInSine(float start, float end, float value)
		{
			end -= start;
			return (0f - end) * Mathf.Cos(value * ((float)Math.PI / 2f)) + end + start;
		}

		public static float EaseOutSine(float start, float end, float value)
		{
			end -= start;
			return end * Mathf.Sin(value * ((float)Math.PI / 2f)) + start;
		}

		public static float EaseInOutSine(float start, float end, float value)
		{
			end -= start;
			return (0f - end) * 0.5f * (Mathf.Cos((float)Math.PI * value) - 1f) + start;
		}

		public static float EaseInExpo(float start, float end, float value)
		{
			end -= start;
			return end * Mathf.Pow(2f, 10f * (value - 1f)) + start;
		}

		public static float EaseOutExpo(float start, float end, float value)
		{
			end -= start;
			return end * (0f - Mathf.Pow(2f, -10f * value) + 1f) + start;
		}

		public static float EaseInOutExpo(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * 0.5f * Mathf.Pow(2f, 10f * (value - 1f)) + start;
			}
			value -= 1f;
			return end * 0.5f * (0f - Mathf.Pow(2f, -10f * value) + 2f) + start;
		}

		public static float EaseInCirc(float start, float end, float value)
		{
			end -= start;
			return (0f - end) * (Mathf.Sqrt(1f - value * value) - 1f) + start;
		}

		public static float EaseOutCirc(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return end * Mathf.Sqrt(1f - value * value) + start;
		}

		public static float EaseInOutCirc(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return (0f - end) * 0.5f * (Mathf.Sqrt(1f - value * value) - 1f) + start;
			}
			value -= 2f;
			return end * 0.5f * (Mathf.Sqrt(1f - value * value) + 1f) + start;
		}

		public static float EaseInBounce(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			return end - EaseOutBounce(0f, end, num - value) + start;
		}

		public static float EaseOutBounce(float start, float end, float value)
		{
			value /= 1f;
			end -= start;
			if (value < 0.36363637f)
			{
				return end * (7.5625f * value * value) + start;
			}
			if (value < 0.72727275f)
			{
				value -= 0.54545456f;
				return end * (7.5625f * value * value + 0.75f) + start;
			}
			if ((double)value < 0.9090909090909091)
			{
				value -= 0.8181818f;
				return end * (7.5625f * value * value + 0.9375f) + start;
			}
			value -= 21f / 22f;
			return end * (7.5625f * value * value + 63f / 64f) + start;
		}

		public static float EaseInOutBounce(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			if (value < num * 0.5f)
			{
				return EaseInBounce(0f, end, value * 2f) * 0.5f + start;
			}
			return EaseOutBounce(0f, end, value * 2f - num) * 0.5f + end * 0.5f + start;
		}

		public static float EaseInBack(float start, float end, float value)
		{
			end -= start;
			value /= 1f;
			float num = 1.70158f;
			return end * value * value * ((num + 1f) * value - num) + start;
		}

		public static float EaseOutBack(float start, float end, float value)
		{
			float num = 1.70158f;
			end -= start;
			value -= 1f;
			return end * (value * value * ((num + 1f) * value + num) + 1f) + start;
		}

		public static float EaseInOutBack(float start, float end, float value)
		{
			float num = 1.70158f;
			end -= start;
			value /= 0.5f;
			if (value < 1f)
			{
				num *= 1.525f;
				return end * 0.5f * (value * value * ((num + 1f) * value - num)) + start;
			}
			value -= 2f;
			num *= 1.525f;
			return end * 0.5f * (value * value * ((num + 1f) * value + num) + 2f) + start;
		}

		public static float EaseInElastic(float start, float end, float value)
		{
			float num = end - start;
			if (value <= 0f)
			{
				return start;
			}
			if (value >= 1f)
			{
				return start + num;
			}
			return start + num * ((0f - Mathf.Pow(2f, 10f * value - 10f)) * Mathf.Sin((value * 10f - 10.75f) * (float)Math.PI * 2f / 3f));
		}

		public static float EaseOutElastic(float start, float end, float value)
		{
			float num = end - start;
			if (value <= 0f)
			{
				return start;
			}
			if (value >= 1f)
			{
				return start + num;
			}
			return start + num * (Mathf.Pow(2f, -10f * value) * Mathf.Sin((value * 10f - 0.75f) * (float)Math.PI * 2f / 3f) + 1f);
		}

		public static float EaseInOutElastic(float start, float end, float value)
		{
			float num = end - start;
			if (value <= 0f)
			{
				return start;
			}
			if (value >= 1f)
			{
				return start + num;
			}
			float num2 = value * 2f;
			if (!((double)num2 < 1.0))
			{
				return 0.5f * EaseOutElastic(start, end, num2 - 1f) + 0.5f;
			}
			return 0.5f * EaseInElastic(start, end, num2);
		}

		public static float Step(float start, float end, float value)
		{
			if (!(value >= 0.5f))
			{
				return start;
			}
			return end;
		}

		public static float LinearD(float start, float end, float value)
		{
			return end - start;
		}

		public static float EaseInQuadD(float start, float end, float value)
		{
			return 2f * (end - start) * value;
		}

		public static float EaseOutQuadD(float start, float end, float value)
		{
			end -= start;
			return (0f - end) * value - end * (value - 2f);
		}

		public static float EaseInOutQuadD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * value;
			}
			value -= 1f;
			return end * (1f - value);
		}

		public static float EaseInCubicD(float start, float end, float value)
		{
			return 3f * (end - start) * value * value;
		}

		public static float EaseOutCubicD(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return 3f * end * value * value;
		}

		public static float EaseInOutCubicD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return 1.5f * end * value * value;
			}
			value -= 2f;
			return 1.5f * end * value * value;
		}

		public static float EaseInQuartD(float start, float end, float value)
		{
			return 4f * (end - start) * value * value * value;
		}

		public static float EaseOutQuartD(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return -4f * end * value * value * value;
		}

		public static float EaseInOutQuartD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return 2f * end * value * value * value;
			}
			value -= 2f;
			return -2f * end * value * value * value;
		}

		public static float EaseInQuintD(float start, float end, float value)
		{
			return 5f * (end - start) * value * value * value * value;
		}

		public static float EaseOutQuintD(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return 5f * end * value * value * value * value;
		}

		public static float EaseInOutQuintD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return 2.5f * end * value * value * value * value;
			}
			value -= 2f;
			return 2.5f * end * value * value * value * value;
		}

		public static float EaseInSineD(float start, float end, float value)
		{
			return (end - start) * 0.5f * (float)Math.PI * Mathf.Sin((float)Math.PI / 2f * value);
		}

		public static float EaseOutSineD(float start, float end, float value)
		{
			end -= start;
			return (float)Math.PI / 2f * end * Mathf.Cos(value * ((float)Math.PI / 2f));
		}

		public static float EaseInOutSineD(float start, float end, float value)
		{
			end -= start;
			return end * 0.5f * (float)Math.PI * Mathf.Sin((float)Math.PI * value);
		}

		public static float EaseInExpoD(float start, float end, float value)
		{
			return 6.931472f * (end - start) * Mathf.Pow(2f, 10f * (value - 1f));
		}

		public static float EaseOutExpoD(float start, float end, float value)
		{
			end -= start;
			return 3.465736f * end * Mathf.Pow(2f, 1f - 10f * value);
		}

		public static float EaseInOutExpoD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return 3.465736f * end * Mathf.Pow(2f, 10f * (value - 1f));
			}
			value -= 1f;
			return 3.465736f * end / Mathf.Pow(2f, 10f * value);
		}

		public static float EaseInCircD(float start, float end, float value)
		{
			return (end - start) * value / Mathf.Sqrt(1f - value * value);
		}

		public static float EaseOutCircD(float start, float end, float value)
		{
			value -= 1f;
			end -= start;
			return (0f - end) * value / Mathf.Sqrt(1f - value * value);
		}

		public static float EaseInOutCircD(float start, float end, float value)
		{
			value /= 0.5f;
			end -= start;
			if (value < 1f)
			{
				return end * value / (2f * Mathf.Sqrt(1f - value * value));
			}
			value -= 2f;
			return (0f - end) * value / (2f * Mathf.Sqrt(1f - value * value));
		}

		public static float EaseInBounceD(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			return EaseOutBounceD(0f, end, num - value);
		}

		public static float EaseOutBounceD(float start, float end, float value)
		{
			value /= 1f;
			end -= start;
			if (value < 0.36363637f)
			{
				return 2f * end * 7.5625f * value;
			}
			if (value < 0.72727275f)
			{
				value -= 0.54545456f;
				return 2f * end * 7.5625f * value;
			}
			if ((double)value < 0.9090909090909091)
			{
				value -= 0.8181818f;
				return 2f * end * 7.5625f * value;
			}
			value -= 21f / 22f;
			return 2f * end * 7.5625f * value;
		}

		public static float EaseInOutBounceD(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			if (value < num * 0.5f)
			{
				return EaseInBounceD(0f, end, value * 2f) * 0.5f;
			}
			return EaseOutBounceD(0f, end, value * 2f - num) * 0.5f;
		}

		public static float EaseInBackD(float start, float end, float value)
		{
			float num = 1.70158f;
			return 3f * (num + 1f) * (end - start) * value * value - 2f * num * (end - start) * value;
		}

		public static float EaseOutBackD(float start, float end, float value)
		{
			float num = 1.70158f;
			end -= start;
			value -= 1f;
			return end * ((num + 1f) * value * value + 2f * value * ((num + 1f) * value + num));
		}

		public static float EaseInOutBackD(float start, float end, float value)
		{
			float num = 1.70158f;
			end -= start;
			value /= 0.5f;
			if (value < 1f)
			{
				num *= 1.525f;
				return 0.5f * end * (num + 1f) * value * value + end * value * ((num + 1f) * value - num);
			}
			value -= 2f;
			num *= 1.525f;
			return 0.5f * end * ((num + 1f) * value * value + 2f * value * ((num + 1f) * value + num));
		}

		public static float EaseInElasticD(float start, float end, float value)
		{
			return EaseOutElasticD(start, end, 1f - value);
		}

		public static float EaseOutElasticD(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			float num2 = num * 0.3f;
			float num3 = 0f;
			float num4;
			if (num3 == 0f || num3 < Mathf.Abs(end))
			{
				num3 = end;
				num4 = num2 * 0.25f;
			}
			else
			{
				num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
			}
			return num3 * (float)Math.PI * num * Mathf.Pow(2f, 1f - 10f * value) * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / num2 - 3.465736f * num3 * Mathf.Pow(2f, 1f - 10f * value) * Mathf.Sin((float)Math.PI * 2f * (num * value - num4) / num2);
		}

		public static float EaseInOutElasticD(float start, float end, float value)
		{
			end -= start;
			float num = 1f;
			float num2 = num * 0.3f;
			float num3 = 0f;
			float num4;
			if (num3 == 0f || num3 < Mathf.Abs(end))
			{
				num3 = end;
				num4 = num2 / 4f;
			}
			else
			{
				num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
			}
			if (value < 1f)
			{
				value -= 1f;
				return -3.465736f * num3 * Mathf.Pow(2f, 10f * value) * Mathf.Sin((float)Math.PI * 2f * (num * value - 2f) / num2) - num3 * (float)Math.PI * num * Mathf.Pow(2f, 10f * value) * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / num2;
			}
			value -= 1f;
			return num3 * (float)Math.PI * num * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / (num2 * Mathf.Pow(2f, 10f * value)) - 3.465736f * num3 * Mathf.Sin((float)Math.PI * 2f * (num * value - num4) / num2) / Mathf.Pow(2f, 10f * value);
		}

		public static float SpringD(float start, float end, float value)
		{
			value = Mathf.Clamp01(value);
			end -= start;
			return end * (6f * (1f - value) / 5f + 1f) * (-2.2f * Mathf.Pow(1f - value, 1.2f) * Mathf.Sin((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + Mathf.Pow(1f - value, 2.2f) * ((float)Math.PI * (2.5f * value * value * value + 0.2f) + 23.561945f * value * value * value) * Mathf.Cos((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + 1f) - 6f * end * (Mathf.Pow(1f - value, 2.2f) * Mathf.Sin((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + value / 5f);
		}

		public static float StepD(float start, float end, float value)
		{
			if (value != 0.5f)
			{
				return 0f;
			}
			return (end - start) / Time.deltaTime;
		}

		public static Function GetEasingFunction(Ease easingFunction)
		{
			return easingFunction switch
			{
				Ease.EaseInQuad => EaseInQuad, 
				Ease.EaseOutQuad => EaseOutQuad, 
				Ease.EaseInOutQuad => EaseInOutQuad, 
				Ease.EaseInCubic => EaseInCubic, 
				Ease.EaseOutCubic => EaseOutCubic, 
				Ease.EaseInOutCubic => EaseInOutCubic, 
				Ease.EaseInQuart => EaseInQuart, 
				Ease.EaseOutQuart => EaseOutQuart, 
				Ease.EaseInOutQuart => EaseInOutQuart, 
				Ease.EaseInQuint => EaseInQuint, 
				Ease.EaseOutQuint => EaseOutQuint, 
				Ease.EaseInOutQuint => EaseInOutQuint, 
				Ease.EaseInSine => EaseInSine, 
				Ease.EaseOutSine => EaseOutSine, 
				Ease.EaseInOutSine => EaseInOutSine, 
				Ease.EaseInExpo => EaseInExpo, 
				Ease.EaseOutExpo => EaseOutExpo, 
				Ease.EaseInOutExpo => EaseInOutExpo, 
				Ease.EaseInCirc => EaseInCirc, 
				Ease.EaseOutCirc => EaseOutCirc, 
				Ease.EaseInOutCirc => EaseInOutCirc, 
				Ease.Linear => Linear, 
				Ease.Spring => Spring, 
				Ease.EaseInBounce => EaseInBounce, 
				Ease.EaseOutBounce => EaseOutBounce, 
				Ease.EaseInOutBounce => EaseInOutBounce, 
				Ease.EaseInBack => EaseInBack, 
				Ease.EaseOutBack => EaseOutBack, 
				Ease.EaseInOutBack => EaseInOutBack, 
				Ease.EaseInElastic => EaseInElastic, 
				Ease.EaseOutElastic => EaseOutElastic, 
				Ease.EaseInOutElastic => EaseInOutElastic, 
				Ease.Step => Step, 
				_ => null, 
			};
		}

		public static Function GetEasingFunctionDerivative(Ease easingFunction)
		{
			return easingFunction switch
			{
				Ease.EaseInQuad => EaseInQuadD, 
				Ease.EaseOutQuad => EaseOutQuadD, 
				Ease.EaseInOutQuad => EaseInOutQuadD, 
				Ease.EaseInCubic => EaseInCubicD, 
				Ease.EaseOutCubic => EaseOutCubicD, 
				Ease.EaseInOutCubic => EaseInOutCubicD, 
				Ease.EaseInQuart => EaseInQuartD, 
				Ease.EaseOutQuart => EaseOutQuartD, 
				Ease.EaseInOutQuart => EaseInOutQuartD, 
				Ease.EaseInQuint => EaseInQuintD, 
				Ease.EaseOutQuint => EaseOutQuintD, 
				Ease.EaseInOutQuint => EaseInOutQuintD, 
				Ease.EaseInSine => EaseInSineD, 
				Ease.EaseOutSine => EaseOutSineD, 
				Ease.EaseInOutSine => EaseInOutSineD, 
				Ease.EaseInExpo => EaseInExpoD, 
				Ease.EaseOutExpo => EaseOutExpoD, 
				Ease.EaseInOutExpo => EaseInOutExpoD, 
				Ease.EaseInCirc => EaseInCircD, 
				Ease.EaseOutCirc => EaseOutCircD, 
				Ease.EaseInOutCirc => EaseInOutCircD, 
				Ease.Linear => LinearD, 
				Ease.Spring => SpringD, 
				Ease.EaseInBounce => EaseInBounceD, 
				Ease.EaseOutBounce => EaseOutBounceD, 
				Ease.EaseInOutBounce => EaseInOutBounceD, 
				Ease.EaseInBack => EaseInBackD, 
				Ease.EaseOutBack => EaseOutBackD, 
				Ease.EaseInOutBack => EaseInOutBackD, 
				Ease.EaseInElastic => EaseInElasticD, 
				Ease.EaseOutElastic => EaseOutElasticD, 
				Ease.EaseInOutElastic => EaseInOutElasticD, 
				Ease.Step => StepD, 
				_ => null, 
			};
		}
	}
}
namespace InfectedCompany
{
	[BepInPlugin("InfectedCompany.InfectedCompany", "InfectedCompany", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class InfectedCompanyPlugin : BaseUnityPlugin
	{
		private const string modGUID = "InfectedCompany.InfectedCompany";

		private const string modName = "InfectedCompany";

		private const string modVersion = "1.0.0";

		private static bool debugVersion;

		private readonly Harmony harmony = new Harmony("InfectedCompany.InfectedCompany");

		public static InfectedCompanyPlugin Instance;

		private const string ITEM_ASSET_NAME = "infectedcompanyitems";

		private const string MISC_ASSET_NAME = "infectedcompanymisc";

		public AssetBundle infectedCompanyItemAssets;

		public AssetBundle infectedCompanyMiscAssets;

		private ManualLogSource logger;

		private bool isInitialized;

		public static string ModGUID => "InfectedCompany.InfectedCompany";

		public static string ModVersion => "1.0.0";

		public static string ModName => "InfectedCompany";

		public static bool DebugVersion
		{
			get
			{
				return debugVersion;
			}
			set
			{
				debugVersion = value;
			}
		}

		private void Awake()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			if (!isInitialized)
			{
				logger = Logger.CreateLogSource("InfectedCompany.InfectedCompany");
				logger.LogInfo((object)"Loaded InfectedCompany mod. Patching.");
				ApplyPatches();
				logger.LogInfo((object)"Completed patching. Initializing.");
				LoadAssets();
				GameObject val = new GameObject("InfectedCompany_CORE");
				val.AddComponent<ConfigManager>();
				val.AddComponent<GameLogger>();
				val.AddComponent<AssetManager>();
				LoadGameAssets();
				((Object)val).hideFlags = (HideFlags)61;
				Object.DontDestroyOnLoad((Object)val);
				NetcodePatcher();
				logger.LogInfo((object)"Completed initialization.");
				isInitialized = true;
			}
		}

		private void ApplyPatches()
		{
			harmony.PatchAll(typeof(InfectedCompanyPlugin));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(RoundManagerpatch));
			harmony.PatchAll(typeof(PlayerControllerBPatches));
			harmony.PatchAll(typeof(EnemyAIPatch));
			harmony.PatchAll(typeof(TimeOfDayPatch));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(DeleteFileButtonPatch));
			harmony.PatchAll(typeof(NetworkObjectManager));
			harmony.PatchAll(typeof(LobbyListPatch));
			harmony.PatchAll(typeof(GameBalancePatch));
			harmony.PatchAll(typeof(ShipTeleporterQuarantine));
			harmony.PatchAll(typeof(ShipMonitorQuarantine));
			harmony.PatchAll(typeof(WalkieTalkieQuarantine));
			harmony.PatchAll(typeof(PlayerControllerBQuarantine));
		}

		private void LoadAssets()
		{
			logger.LogInfo((object)"Loading assets");
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			infectedCompanyItemAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "infectedcompanyitems"));
			infectedCompanyMiscAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "infectedcompanymisc"));
			if ((Object)(object)infectedCompanyItemAssets == (Object)null || (Object)(object)infectedCompanyMiscAssets == (Object)null)
			{
				logger.LogError((object)("Failed to load " + ModName + " mod assets"));
			}
			else
			{
				logger.LogInfo((object)"Done loading assets");
			}
		}

		private void LoadGameAssets()
		{
			GameLogger.Instance.LogDebug("Loading in-game assets");
			AssetManager.Instance.LoadAssets();
			GameLogger.Instance.LogDebug("Done loading in-game assets");
		}

		private static void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			for (int i = 0; i < types.Length; i++)
			{
				MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
}
namespace InfectedCompany.Patches
{
	[HarmonyPatch(typeof(EnemyAI))]
	internal class EnemyAIPatch
	{
		[HarmonyPatch("PlayerIsTargetable")]
		[HarmonyPostfix]
		private static void CannotTargetInfectedPlayers(PlayerControllerB playerScript, ref bool __result)
		{
			if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null)
			{
				PlayerGameController playerGameControllerFromClientId = ServerGameNetworkManager.Instance.GetPlayerGameControllerFromClientId(((NetworkBehaviour)playerScript).OwnerClientId);
				if ((Object)(object)playerGameControllerFromClientId != (Object)null && playerGameControllerFromClientId.IsInfectedMonster && playerGameControllerFromClientId.Mode == PlayerGameController.PlayerMode.MONSTER)
				{
					__result = false;
				}
			}
		}
	}
	internal class LobbyListPatch
	{
		[CompilerGenerated]
		private sealed class <MarkLobbySlot>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public LobbySlot lobbySlot;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Expected O, but got Unknown
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0206: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_023a: Unknown result type (might be due to invalid IL or missing references)
				//IL_024e: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					string data = ((Lobby)(ref lobbySlot.thisLobby)).GetData("name");
					if (!string.IsNullOrEmpty(data) && data.Contains("\u200c"))
					{
						Transform obj = ((Component)lobbySlot).transform.Find("Outline");
						Image val = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null);
						Transform obj2 = ((Component)lobbySlot).transform.Find("JoinButton/SelectionHighlight");
						Image val2 = ((obj2 != null) ? ((Component)obj2).GetComponent<Image>() : null);
						Color colorFromRGBA = GetColorFromRGBA(202, 115, 0, 255);
						if (Object.op_Implicit((Object)(object)val))
						{
							((Graphic)val).color = colorFromRGBA;
						}
						if (Object.op_Implicit((Object)(object)val2))
						{
							((Graphic)val2).color = GetColorFromRGBA(150, 70, 0, 125);
						}
						TextMeshProUGUI lobbyName = lobbySlot.LobbyName;
						TextMeshProUGUI playerCount = lobbySlot.playerCount;
						((Graphic)lobbyName).color = colorFromRGBA;
						((Graphic)playerCount).color = colorFromRGBA;
						((Graphic)((Component)lobbySlot).GetComponent<Image>()).color = GetColorFromRGBA(98, 60, 0, 255);
						if (!((Object)((Component)lobbySlot).transform).name.Contains("Challenge"))
						{
							RectTransform component = new GameObject("inf_label", new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>();
							TextMeshProUGUI obj3 = ((Component)component).gameObject.AddComponent<TextMeshProUGUI>();
							((TMP_Text)obj3).fontSize = 26f;
							((TMP_Text)obj3).text = "INFECTED COMPANY";
							((TMP_Text)obj3).alignment = (TextAlignmentOptions)4097;
							((TMP_Text)obj3).font = ((TMP_Text)playerCount).font;
							((Graphic)obj3).color = GetColorFromRGBA(128, 77, 0, 255);
							((Transform)component).SetParent(((Component)lobbySlot).transform);
							component.anchorMin = new Vector2(0f, 1f);
							component.anchorMax = new Vector2(0f, 1f);
							component.pivot = new Vector2(0f, 1f);
							((Transform)component).localScale = new Vector3(0.8497399f, 0.8497399f, 0.8497399f);
							((Transform)component).localPosition = new Vector3(130f, -10f, -7f);
							component.sizeDelta = new Vector2(269f, 24f);
						}
					}
					return false;
				}
				}
			}

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

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

		public const string IDENTIFIER_CHARACTER = "\u200c";

		[HarmonyPatch(typeof(MenuManager), "ConfirmHostButton")]
		[HarmonyPrefix]
		private static void AddServerNameChar(MenuManager __instance)
		{
			string text = __instance.lobbyNameInputField.text;
			if (__instance.hostSettings_LobbyPublic)
			{
				if (!text.Contains("\u200c"))
				{
					text = ((text.Length > 3) ? text.Insert(text.Length - 2, "\u200c") : (text + "\u200c"));
				}
				if (ConfigManager.Instance.tagPublicServer && !text.Trim().StartsWith("[INFECTED COMPANY]"))
				{
					text = "[INFECTED COMPANY] " + text;
				}
				__instance.lobbyNameInputField.text = text;
			}
			else
			{
				__instance.lobbyNameInputField.text = text.Replace("\u200c", "");
			}
		}

		[HarmonyPatch(typeof(LobbySlot), "Awake")]
		[HarmonyPostfix]
		private static void LobbySlotPostfix(LobbySlot __instance)
		{
			if ((Object)(object)__instance != (Object)null)
			{
				((MonoBehaviour)__instance).StartCoroutine(MarkLobbySlot(__instance));
			}
		}

		[IteratorStateMachine(typeof(<MarkLobbySlot>d__3))]
		private static IEnumerator MarkLobbySlot(LobbySlot lobbySlot)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <MarkLobbySlot>d__3(0)
			{
				lobbySlot = lobbySlot
			};
		}

		private static Color GetColorFromRGBA(int r, int g, int b, int a)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, (float)a / 255f);
		}
	}
	[HarmonyPatch]
	internal class NetworkObjectManager
	{
		private static GameObject networkPrefab;

		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		[HarmonyPostfix]
		public static void Init()
		{
			_ = (Object)(object)networkPrefab != (Object)null;
		}

		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		[HarmonyPostfix]
		private static void SpawnNetworkCenter()
		{
			if ((Object)(object)UIManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<UIManager>();
			}
			if (StartOfRound.Instance.isChallengeFile)
			{
				UIManager.Instance.AddTextToChatWindow(InfectedCompanyPlugin.ModName + " (v" + InfectedCompanyPlugin.ModVersion + ") is disabled for Challenge Moons.", -1, showToEveryone: false, 30f);
				return;
			}
			if ((Object)(object)ServerGameNetworkManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<ServerGameNetworkManager>();
			}
			if ((Object)(object)GameRoundManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<GameRoundManager>();
			}
			if ((Object)(object)VFXManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<VFXManager>();
			}
			if ((Object)(object)SFXManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<SFXManager>();
			}
			if ((Object)(object)PlayerActionsNetworkManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<PlayerActionsNetworkManager>();
			}
			if ((Object)(object)GameControlCenter.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<GameControlCenter>();
			}
			if ((Object)(object)ShipManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<ShipManager>().SpawnAndAttachScoreScreen();
			}
			if ((Object)(object)GamePlayerScoreManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<GamePlayerScoreManager>();
			}
			if ((Object)(object)GameDataManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<GameDataManager>();
			}
			if ((Object)(object)GameBalanceManager.Instance == (Object)null)
			{
				((Component)StartOfRound.Instance).gameObject.AddComponent<GameBalanceManager>();
			}
		}
	}
	internal class PlayerControllerBPatches
	{
		[HarmonyPatch(typeof(PlayerControllerB), "Start")]
		[HarmonyPostfix]
		private static void PlayerStart(PlayerControllerB __instance)
		{
			if (!StartOfRound.Instance.isChallengeFile && (Object)(object)((Component)__instance).gameObject.GetComponent<PlayerGameController>() == (Object)null)
			{
				((Component)__instance).gameObject.AddComponent<PlayerGameController>();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		private static void ConnectClientToPlayerObjectPostfix(PlayerControllerB __instance)
		{
			if (!StartOfRound.Instance.isChallengeFile)
			{
				PlayerGameController component = ((Component)__instance).gameObject.GetComponent<PlayerGameController>();
				if ((Object)(object)component != (Object)null)
				{
					GameControlCenter.Instance.LocalPlayerGameController = component;
					component.LocalInitialize();
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "PlayerLookInput")]
		[HarmonyPrefix]
		private static bool PlayerLookInputPrefix()
		{
			if (!StartOfRound.Instance.isChallengeFile && (Object)(object)GameControlCenter.Instance != (Object)null)
			{
				PlayerGameController localPlayerGameController = GameControlCenter.Instance.LocalPlayerGameController;
				if ((Object)(object)localPlayerGameController != (Object)null && !localPlayerGameController.PlayerController.isPlayerDead)
				{
					if (localPlayerGameController.CanControl && localPlayerGameController.CanRotate)
					{
						return !localPlayerGameController.InAnimation;
					}
					return false;
				}
			}
			return true;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")]
		[HarmonyPrefix]
		private static void ReduceDamageForInfectedFromOtherClient(ref int damageNumber, PlayerControllerB __instance)
		{
			if (!((NetworkBehaviour)__instance).IsOwner || !((Object)(object)ServerGameNetworkManager.Instance != (Object)null))
			{
				return;
			}
			PlayerGameController playerGameControllerFromClientId = ServerGameNetworkManager.Instance.GetPlayerGameControllerFromClientId(((NetworkBehaviour)__instance).OwnerClientId);
			if ((Object)(object)playerGameControllerFromClientId != (Object)null && playerGameControllerFromClientId.IsInfectedMonster && playerGameControllerFromClientId.Mode == PlayerGameController.PlayerMode.MONSTER)
			{
				try
				{
					float infectedModeDamageReductionPercent = ServerGameNetworkManager.Instance.hostGameSettings.infectedModeDamageReductionPercent;
					float num = 1f - infectedModeDamageReductionPercent / 100f;
					damageNumber = Mathf.RoundToInt((float)damageNumber * num);
				}
				catch (Exception ex)
				{
					damageNumber = Mathf.RoundToInt((float)damageNumber * 0.5f);
					GameLogger.Instance.LogError("Exception when trying to calculate infected damage reduction. Falling back to 50%: " + ex.Message);
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "SpawnDeadBody")]
		[HarmonyPostfix]
		private static void KillPlayerPostfix(PlayerControllerB __instance)
		{
			if (StartOfRound.Instance.isChallengeFile)
			{
				return;
			}
			PlayerGameController component = ((Component)__instance).GetComponent<PlayerGameController>();
			if ((Object)(object)component != (Object)null)
			{
				GameLogger.Instance.LogDebug("Kill player postfix");
				if (component.IsInfectedMonster && component.Mode == PlayerGameController.PlayerMode.MONSTER)
				{
					component.SpawnAndAttachBoneManRagdollToPlayerRagdoll();
				}
				if (component.WasKilledByBoneMan)
				{
					component.SpawnAndAttachBloodSprayToRagdoll();
				}
				component.PlayerDeathResetValues();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "SpawnPlayerAnimation")]
		[HarmonyPostfix]
		private static void DisablePlayerModelLOD(PlayerControllerB __instance)
		{
			if (!StartOfRound.Instance.isChallengeFile && (Object)(object)GameControlCenter.Instance != (Object)null && (Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				GameControlCenter.Instance.LocalPlayerGameController.DisableLOD();
			}
		}

		[HarmonyPatch(typeof(CharacterController), "Move")]
		[HarmonyPrefix]
		private static bool PlayerMovePrefix(CharacterController __instance)
		{
			if (!StartOfRound.Instance.isChallengeFile && (Object)(object)GameControlCenter.Instance != (Object)null)
			{
				PlayerGameController localPlayerGameController = GameControlCenter.Instance.LocalPlayerGameController;
				if ((Object)(object)localPlayerGameController != (Object)null && (Object)(object)localPlayerGameController.PlayerController.thisController == (Object)(object)__instance && !localPlayerGameController.PlayerController.isPlayerDead)
				{
					if (localPlayerGameController.CanControl && localPlayerGameController.CanMove)
					{
						return !localPlayerGameController.InAnimation;
					}
					return false;
				}
			}
			return true;
		}
	}
	internal class GameBalancePatch
	{
		[HarmonyPatch(typeof(TimeOfDay), "Start")]
		[HarmonyPostfix]
		private static void UpdateGameBalanceTime(TimeOfDay __instance)
		{
			__instance.totalTime *= 1.3f;
			__instance.timeUntilDeadline *= 1.3f;
		}

		[HarmonyPatch(typeof(RoundManager), "GenerateNewFloor")]
		[HarmonyPostfix]
		private static void LogValues(RoundManager __instance)
		{
			GameLogger.Instance.LogDebug($"Map size multiplier: {__instance.mapSizeMultiplier}");
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerpatch
	{
		[HarmonyPatch("FinishGeneratingLevel")]
		[HarmonyPrefix]
		private static void FinishGeneratingLevelPrefix(RoundManager __instance)
		{
			if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null)
			{
				ServerGameNetworkManager.Instance.SpawnDiscoRoomIfPossible();
			}
		}

		[HarmonyPatch("SyncScrapValuesClientRpc")]
		[HarmonyPostfix]
		private static void SetNewRoundScrapValueQuota()
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && ((NetworkBehaviour)GameRoundManager.Instance).IsServer)
			{
				GameRoundManager.Instance.SERVER_SetNewRoundScrapValueQuota();
			}
		}

		[HarmonyPatch("CollectNewScrapForThisRound")]
		[HarmonyPostfix]
		private static void CollectNewScrap(GrabbableObject scrapObject)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && ((NetworkBehaviour)GameRoundManager.Instance).IsServer)
			{
				GameRoundManager.Instance.SERVER_CollectNewScrapForThisRound(scrapObject);
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[CompilerGenerated]
		private sealed class <ShipLandPostfix>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public IEnumerator original;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = original;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null && ServerGameNetworkManager.Instance.IsLocalPlayerInfectedMonster())
					{
						ServerGameNetworkManager.Instance.DisableLeverLocal(disable: true, "[Infected cannot start the ship]");
					}
					return false;
				}
			}

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

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

		[CompilerGenerated]
		private sealed class <TravelToLevelEffectsPostfix>d__2 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public IEnumerator original;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = original;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null)
					{
						ServerGameNetworkManager.Instance.DisableLeverAndCheckIfCanStartGame();
					}
					return false;
				}
			}

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

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

		[HarmonyPatch("ShipHasLeft")]
		[HarmonyPrefix]
		private static void ShipHasLeftPrefix()
		{
			if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null && ((NetworkBehaviour)ServerGameNetworkManager.Instance).IsServer)
			{
				ServerGameNetworkManager.Instance.SERVER_EndOfRoundCleanUp();
			}
		}

		[HarmonyPatch("StartGame")]
		[HarmonyPostfix]
		private static void StartGamePostfix()
		{
			if ((Object)(object)ServerGameNetworkManager.Instance != (Object)null && ((NetworkBehaviour)ServerGameNetworkManager.Instance).IsServer)
			{
				ServerGameNetworkManager.Instance.SERVER_StartOfRoundInitialization();
			}
		}

		[IteratorStateMachine(typeof(<TravelToLevelEffectsPostfix>d__2))]
		[HarmonyPatch(typeof(StartOfRound), "TravelToLevelEffects")]
		[HarmonyPostfix]
		private static IEnumerator TravelToLevelEffectsPostfix(IEnumerator original)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <TravelToLevelEffectsPostfix>d__2(0)
			{
				original = original
			};
		}

		[IteratorStateMachine(typeof(<ShipLandPostfix>d__3))]
		[HarmonyPatch(typeof(StartOfRound), "openingDoorsSequence")]
		[HarmonyPostfix]
		private static IEnumerator ShipLandPostfix(IEnumerator original)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ShipLandPostfix>d__3(0)
			{
				original = original
			};
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		[HarmonyPatch("ChangeControlTipMultiple")]
		[HarmonyPrefix]
		private static void AddInfectedMonsterControls(ref string[] allLines)
		{
		}
	}
	[HarmonyPatch(typeof(DeleteFileButton))]
	internal class DeleteFileButtonPatch
	{
		[HarmonyPatch("DeleteFile")]
		[HarmonyPostfix]
		private static void DeleteInfectedCompanyFile(DeleteFileButton __instance)
		{
			int fileToDelete = __instance.fileToDelete;
			string gameFileName = "LCSaveFile1";
			switch (fileToDelete)
			{
			case 0:
				gameFileName = "LCSaveFile1";
				break;
			case 1:
				gameFileName = "LCSaveFile2";
				break;
			case 2:
				gameFileName = "LCSaveFile3";
				break;
			}
			string currentSaveFileName = GetCurrentSaveFileName(gameFileName);
			if (ES3.FileExists(currentSaveFileName))
			{
				ES3.DeleteFile(currentSaveFileName);
			}
		}

		public static string GetCurrentSaveFileName(string gameFileName)
		{
			return gameFileName + "_InfectedCompany";
		}
	}
	[HarmonyPatch(typeof(TimeOfDay))]
	internal class TimeOfDayPatch
	{
		private static int originalStartingCredits;

		private static int originalStartingQuota;

		private static float originalQuotaIncreaseSteepness;

		[HarmonyPatch("VoteShipToLeaveEarly")]
		[HarmonyPrefix]
		private static bool VoteToLeaveEarly()
		{
			GameControlCenter instance = GameControlCenter.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				return true;
			}
			PlayerGameController localPlayerGameController = instance.LocalPlayerGameController;
			if ((Object)(object)localPlayerGameController == (Object)null)
			{
				return true;
			}
			return !localPlayerGameController.IsInfectedMonster;
		}
	}
}
namespace InfectedCompany.Patches.QuarantinePatches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBQuarantine
	{
	}
	[HarmonyPatch(typeof(ManualCameraRenderer))]
	internal class ShipMonitorQuarantine
	{
		[HarmonyPatch("SwitchScreenButton")]
		[HarmonyPrefix]
		private static bool DisableMonitorIfInQuarantine(ManualCameraRenderer __instance)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && GameRoundManager.Instance.IsShipMonitorDisabled && (Object)(object)StartOfRound.Instance.mapScreen == (Object)(object)__instance)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("SwitchRadarTargetForward")]
		[HarmonyPrefix]
		private static bool DisableMonitorRadarTarghetIfInQuarantine(ManualCameraRenderer __instance)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && GameRoundManager.Instance.IsShipMonitorDisabled && (Object)(object)StartOfRound.Instance.mapScreen == (Object)(object)__instance)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(WalkieTalkie))]
	internal class WalkieTalkieQuarantine
	{
		[HarmonyPatch("SetLocalClientSpeaking")]
		[HarmonyPrefix]
		private static bool DisableWalkieTalkieIfQuarantine(WalkieTalkie __instance, ref bool speaking)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && GameRoundManager.Instance.IsWalkieTalkieDisabled)
			{
				speaking = false;
			}
			return true;
		}

		[HarmonyPatch("SwitchWalkieTalkieOn")]
		[HarmonyPrefix]
		private static bool SwitchWalkieTalkieOn(WalkieTalkie __instance, bool on)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && GameRoundManager.Instance.IsWalkieTalkieDisabled && (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)GameControlCenter.Instance.GetLocalPlayer())
			{
				GameRoundManager.Instance.PlayWalkieTalkieStatic(on);
			}
			return true;
		}

		[HarmonyPatch(typeof(GrabbableObject), "EquipItem")]
		[HarmonyPrefix]
		private static bool EquipItem(GrabbableObject __instance)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && __instance is WalkieTalkie && GameRoundManager.Instance.IsWalkieTalkieDisabled && (Object)(object)__instance.playerHeldBy == (Object)(object)GameControlCenter.Instance.GetLocalPlayer() && __instance.isBeingUsed)
			{
				GameRoundManager.Instance.PlayWalkieTalkieStatic(play: true);
			}
			return true;
		}

		[HarmonyPatch(typeof(GrabbableObject), "PocketItem")]
		[HarmonyPrefix]
		private static bool PocketItem(GrabbableObject __instance)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && __instance is WalkieTalkie && GameRoundManager.Instance.IsWalkieTalkieDisabled && (Object)(object)__instance.playerHeldBy == (Object)(object)GameControlCenter.Instance.GetLocalPlayer())
			{
				GameRoundManager.Instance.PlayWalkieTalkieStatic(play: false);
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ShipTeleporter))]
	internal class ShipTeleporterQuarantine
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void DisableNormalTeleporterIfInQuarantine(ShipTeleporter __instance)
		{
			if ((Object)(object)GameRoundManager.Instance != (Object)null && GameRoundManager.Instance.IsTeleportersDisabled && !__instance.isInverseTeleporter)
			{
				__instance.buttonTrigger.interactable = false;
				__instance.buttonTrigger.disabledHoverTip = "[Disabled during facility quarantine.]";
			}
		}
	}
}
namespace InfectedCompany.Core
{
	internal class GameBalanceManager : MonoBehaviour
	{
		public static GameBalanceManager Instance;

		private int ogQuotaStartingCredits;

		private float ogQuotaIncreaseSteepness;

		private float ogMapSizeMultiplier;

		private float ogScrapAmountMultiplier;

		private Dictionary<string, int> ogItemPrices = new Dictionary<string, int>();

		private Dictionary<string, int> ogMoonPrices = new Dictionary<string, int>();

		private bool ogValuesSaved;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		public void SaveOriginalGameValues()
		{
			if (ogValuesSaved)
			{
				GameLogger.Instance.LogDebug("OG game values already saved");
				return;
			}
			try
			{
				ogMapSizeMultiplier = RoundManager.Instance.mapSizeMultiplier;
				ogScrapAmountMultiplier = RoundManager.Instance.scrapAmountMultiplier;
				Terminal terminal = Object.FindObjectOfType<Terminal>(false);
				ogItemPrices = GetAllItemPrices(terminal);
				ogMoonPrices = GetAllMoonPrices(terminal);
				ogQuotaStartingCredits = TimeOfDay.Instance.quotaVariables.startingCredits;
				ogQuotaIncreaseSteepness = TimeOfDay.Instance.quotaVariables.increaseSteepness;
				ogValuesSaved = true;
				GameLogger.Instance.LogDebug("Saved og item prices: " + ogItemPrices.ToJSONString());
				GameLogger.Instance.LogDebug("Saved og moon prices: " + ogMoonPrices.ToJSONString());
				GameLogger.Instance.LogDebug("Initialized og game values");
			}
			catch (Exception ex)
			{
				GameLogger.Instance.LogError("Failed to save og game values: " + ex.Message + ".");
			}
		}

		public void UpdateMonsterSpawnRate(HostSharedGameSettings hostSettings)
		{
			try
			{
				if (hostSettings.gameBalanceChangeMonsterSpawnRate)
				{
					RoundManager.Instance.currentMaxInsidePower = Mathf.RoundToInt((float)RoundManager.Instance.currentLevel.maxEnemyPowerCount * 1.5f);
					RoundManager.Instance.currentMaxOutsidePower = Mathf.RoundToInt((float)RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount * 1.5f);
				}
			}
			catch (Exception ex)
			{
				GameLogger.Instance.LogError("Failed to adjust monster spawn rate: " + ex.Message);
			}
		}

		public void UpdateGameBalanceQuota(HostSharedGameSettings hostSettings)
		{
			try
			{
				if (hostSettings.gameBalanceChangeProfitQuota)
				{
					TimeOfDay.Instance.quotaVariables.startingCredits = Mathf.RoundToInt((float)ogQuotaStartingCredits * 1.5f);
					TimeOfDay.Instance.quotaVariables.increaseSteepness = ogQuotaIncreaseSteepness * 1.3f;
				}
			}
			catch (Exception ex)
			{
				GameLogger.Instance.LogError("Failed to update game balance quota: " + ex.Message);
			}
		}

		public void UpdateMapSize(HostSharedGameSettings hostSettings)
		{
			try
			{
				if (hostSettings.gameBalanceChangeMapSize)
				{
					RoundManager.Instance.mapSizeMultiplier = ogMapSizeMultiplier * 1.5f;
					RoundManager.Instance.scrapAmountMultiplier = ogScrapAmountMultiplier * 1.5f;
				}
			}
			catch (Exception ex)
			{
				GameLogger.Instance.LogError("Failed to update map size: " + ex.Message);
			}
		}

		public void UpdateShopItemPrices(HostSharedGameSettings hostSettings)
		{
			try
			{
				Terminal val = Object.FindObjectOfType<Terminal>(false);
				Item[] buyableItemsList = val.buyableItemsList;
				foreach (Item val2 in buyableItemsList)
				{
					try
					{
						if (hostSettings.gameBalanceChangeItemPrices)
						{
							if (val2.itemName.ToLower() == "shovel")
							{
								UpdateSingleShopItemPrice(val2, 90, val);
							}
						}
						else if (val2.itemName.ToLower() == "shovel")
						{
							UpdateSingleShopItemPrice(val2, ogItemPrices["shovel"], val);
						}
					}
					catch (Exception ex)
					{
						GameLogger.Instance.LogError("Failed to update " + val2.itemName.ToLower() + " price: " + ex.Message);
					}
				}
			}
			catch (Exception ex2)
			{
				GameLogger.Instance.LogError("Failed to update shop item prices: " + ex2.Message);
			}
		}

		public void UpdateMoonPrices(HostSharedGameSettings hostSettings)
		{
			try
			{
				Terminal terminal = Object.FindObjectOfType<Terminal>(false);
				if (hostSettings.gameBalanceChangeMoonPrices)
				{
					UpdateSingleMoonPrice("rend", 0, terminal);
					UpdateSingleMoonPrice("dine", 0, terminal);
					UpdateSingleMoonPrice("titan", 0, terminal);
				}
				else
				{
					UpdateSingleMoonPrice("rend", ogMoonPrices["rend"], terminal);
					UpdateSingleMoonPrice("dine", ogMoonPrices["dine"], terminal);
					UpdateSingleMoonPrice("titan", ogMoonPrices["titan"], terminal);
				}
			}
			catch (Exception ex)
			{
				GameLogger.Instance.LogError("Failed to update moon prices: " + ex.Message);
			}
		}

		private Dictionary<string, int> GetAllMoonPrices(Terminal terminal)
		{
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			TerminalKeyword val = terminal.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "route");
			if (val != null && val.compatibleNouns.Length != 0)
			{
				foreach (CompatibleNoun item in val.compatibleNouns.ToList())
				{
					TerminalNode result = item.result;
					string text = item.noun?.word?.ToLower();
					int itemCost = result.itemCost;
					if (!string.IsNullOrEmpty(text) && !dictionary.ContainsKey(text))
					{
						dictionary[text] = itemCost;
					}
				}
			}
			return dictionary;
		}

		private void UpdateSingleMoonPrice(string routeName, int newItemPriceCredits, Terminal terminal)
		{
			TerminalKeyword val = terminal.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "route");
			if (val == null || val.compatibleNouns.Length == 0)
			{
				return;
			}
			foreach (CompatibleNoun item in from n in val.compatibleNouns.ToList()
				where n.noun.word == routeName.ToLower()
				select n)
			{
				TerminalNode result = item.result;
				result.itemCost = newItemPriceCredits;
				if (result.terminalOptions.Length == 0)
				{
					continue;
				}
				CompatibleNoun[] terminalOptions = result.terminalOptions;
				foreach (CompatibleNoun val2 in terminalOptions)
				{
					if ((Object)(object)val2.result != (Object)null && val2.result.buyRerouteToMoon != -1)
					{
						val2.result.itemCost = newItemPriceCredits;
					}
				}
			}
		}

		private Dictionary<string, int> GetAllItemPrices(Terminal terminal)
		{
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			TerminalKeyword val = terminal.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy");
			if (val != null && val.compatibleNouns.Length != 0)
			{
				foreach (CompatibleNoun item in val.compatibleNouns.ToList())
				{
					TerminalNode result = item.result;
					string text = item.noun?.word?.ToLower();
					int itemCost = result.itemCost;
					if (!string.IsNullOrEmpty(text) && !dictionary.ContainsKey(text))
					{
						dictionary[text] = itemCost;
					}
				}
			}
			return dictionary;
		}

		private void UpdateSingleShopItemPrice(Item item, int newItemPriceCredits, Terminal terminal)
		{
			item.creditsWorth = newItemPriceCredits;
			TerminalKeyword val = terminal.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy");
			if (val == null || val.compatibleNouns.Length == 0)
			{
				return;
			}
			List<CompatibleNoun> source = val.compatibleNouns.ToList();
			if (!source.Any((CompatibleNoun noun) => noun.noun.word == item.itemName.ToLower()))
			{
				return;
			}
			TerminalNode result = source.First((CompatibleNoun n) => n.noun.word == item.itemName.ToLower()).result;
			result.itemCost = newItemPriceCredits;
			if (result.terminalOptions.Length == 0)
			{
				return;
			}
			CompatibleNoun[] terminalOptions = result.terminalOptions;
			foreach (CompatibleNoun val2 in terminalOptions)
			{
				if ((Object)(object)val2.result != (Object)null && val2.result.buyItemIndex != -1)
				{
					val2.result.itemCost = newItemPriceCredits;
				}
			}
		}
	}
	internal class PlayerThirdPersonCamera : MonoBehaviour
	{
		protected bool isInitialized;

		private bool canRotate = true;

		protected float camDistance;

		pr