Decompiled source of TrioMod v1.1.1

TrioMod.dll

Decompiled 2 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using REPOLib.Modules;
using ScalerCore;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TrioMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.1")]
[assembly: AssemblyProduct("TrioMod")]
[assembly: AssemblyTitle("TrioMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TrioMod
{
	[HarmonyPatch(typeof(PhysGrabCart), "Start")]
	internal static class ChristmasCartPatch
	{
		private static void Postfix(PhysGrabCart __instance)
		{
			if (!Plugin.XmasCarts.Value)
			{
				return;
			}
			try
			{
				ChristmasCart.Decorate(__instance);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Déco de Noël impossible : " + ex));
			}
		}
	}
	public class ChristmasCart : MonoBehaviour
	{
		private static readonly Color[] BulbColors = (Color[])(object)new Color[5]
		{
			new Color(1f, 0.12f, 0.12f),
			new Color(0.15f, 1f, 0.3f),
			new Color(1f, 0.75f, 0.1f),
			new Color(0.2f, 0.45f, 1f),
			new Color(1f, 0.3f, 0.9f)
		};

		private static readonly Color Pine = new Color(0.04f, 0.32f, 0.1f);

		private static readonly Color PineDark = new Color(0.02f, 0.22f, 0.07f);

		private static readonly Color Gold = new Color(1f, 0.82f, 0.2f);

		private static Mesh coneMesh;

		private static Mesh starMesh;

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

		private readonly List<Color> bulbBase = new List<Color>();

		private Transform star;

		private Light glow;

		private float timer;

		private int phase;

		private static bool CartBox(PhysGrabCart cart, out Bounds box)
		{
			//IL_000e: 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_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_0066: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_0084: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: 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_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)cart).transform;
			Bounds acc = default(Bounds);
			bool any = false;
			box = default(Bounds);
			BoxCollider[] componentsInChildren = ((Component)transform).GetComponentsInChildren<BoxCollider>(true);
			foreach (BoxCollider val in componentsInChildren)
			{
				if (PathHas(((Component)val).transform, transform, "Wall"))
				{
					Transform transform2 = ((Component)val).transform;
					Vector3 center = val.center;
					Vector3 val2 = val.size * 0.5f;
					for (int j = 0; j < 8; j++)
					{
						Vector3 val3 = center + new Vector3(((j & 1) == 0) ? (0f - val2.x) : val2.x, ((j & 2) == 0) ? (0f - val2.y) : val2.y, ((j & 4) == 0) ? (0f - val2.z) : val2.z);
						Add(transform.InverseTransformPoint(transform2.TransformPoint(val3)));
					}
				}
			}
			if (any)
			{
				box = acc;
				return true;
			}
			MeshRenderer cartMesh = cart.cartMesh;
			MeshFilter val4 = (((Object)(object)cartMesh != (Object)null) ? ((Component)cartMesh).GetComponent<MeshFilter>() : null);
			if ((Object)(object)val4 == (Object)null || (Object)(object)val4.sharedMesh == (Object)null)
			{
				return false;
			}
			Bounds bounds = val4.sharedMesh.bounds;
			for (int k = 0; k < 8; k++)
			{
				Vector3 val5 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((k & 1) != 0) ? 1 : (-1)), (float)(((k & 2) != 0) ? 1 : (-1)), (float)(((k & 4) != 0) ? 1 : (-1))));
				Add(transform.InverseTransformPoint(((Component)cartMesh).transform.TransformPoint(val5)));
			}
			box = acc;
			return true;
			void Add(Vector3 localPoint)
			{
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				if (!any)
				{
					acc = new Bounds(localPoint, Vector3.zero);
					any = true;
				}
				else
				{
					((Bounds)(ref acc)).Encapsulate(localPoint);
				}
			}
		}

		private static bool PathHas(Transform t, Transform root, string word)
		{
			while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)root)
			{
				if (((Object)t).name.Contains(word))
				{
					return true;
				}
				t = t.parent;
			}
			return false;
		}

		internal static void Decorate(PhysGrabCart cart)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0062: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: 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_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_055a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_058c: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_073c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0763: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07df: Expected O, but got Unknown
			//IL_07f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0802: Unknown result type (might be due to invalid IL or missing references)
			//IL_080c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((Component)cart).GetComponentInChildren<ChristmasCart>(true) != (Object)null || !CartBox(cart, out var box))
			{
				return;
			}
			Transform transform = ((Component)cart).transform;
			GameObject val = new GameObject("TrioMod Noël");
			val.transform.SetParent(transform, false);
			ChristmasCart christmasCart = val.AddComponent<ChristmasCart>();
			Material baseMat = (((Object)(object)cart.cartMesh != (Object)null) ? ((Renderer)cart.cartMesh).sharedMaterial : null);
			float y = ((Bounds)(ref box)).max.y;
			float num = Mathf.Min(((Bounds)(ref box)).size.x, ((Bounds)(ref box)).size.z);
			float num2 = Mathf.Clamp(num * 0.045f, 0.018f, 0.05f);
			float thickness = num2 * 0.18f;
			float num3 = num2 * 0.9f;
			float drop = num2 * 1.2f;
			Vector3[] array = (Vector3[])(object)new Vector3[4]
			{
				new Vector3(((Bounds)(ref box)).min.x, y, ((Bounds)(ref box)).min.z),
				new Vector3(((Bounds)(ref box)).max.x, y, ((Bounds)(ref box)).min.z),
				new Vector3(((Bounds)(ref box)).max.x, y, ((Bounds)(ref box)).max.z),
				new Vector3(((Bounds)(ref box)).min.x, y, ((Bounds)(ref box)).max.z)
			};
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(((Bounds)(ref box)).center.x, y, ((Bounds)(ref box)).center.z);
			int num4 = 0;
			for (int i = 0; i < 4; i++)
			{
				Vector3 val3 = array[i];
				Vector3 val4 = array[(i + 1) % 4];
				Vector3 val5 = (val3 + val4) * 0.5f - val2;
				val5.y = 0f;
				((Vector3)(ref val5)).Normalize();
				Vector3 val6 = val3 - val2;
				val6.y = 0f;
				Vector3 val7 = val4 - val2;
				val7.y = 0f;
				Vector3 A = val3 + new Vector3(Mathf.Sign(val6.x), 0f, Mathf.Sign(val6.z)) * num3;
				Vector3 C = val4 + new Vector3(Mathf.Sign(val7.x), 0f, Mathf.Sign(val7.z)) * num3;
				float num5 = Vector3.Distance(A, C);
				int scallops = Mathf.Max(2, Mathf.RoundToInt(num5 / (num2 * 9f)));
				float sagAmp = num2 * 1.6f;
				int num6 = scallops * 8;
				for (int j = 0; j < num6; j++)
				{
					Vector3 p = P((float)j / (float)num6);
					Vector3 p2 = P((float)(j + 1) / (float)num6);
					christmasCart.Segment(val.transform, p, p2, thickness, PineDark, baseMat);
				}
				int num7 = scallops * 3;
				for (int k = 0; k < num7; k++)
				{
					float t = ((float)k + 0.5f) / (float)num7;
					Color val8 = BulbColors[num4++ % BulbColors.Length];
					Material item = christmasCart.Part((PrimitiveType)0, val.transform, P(t) + Vector3.down * num2 * 0.45f, new Vector3(num2 * 0.8f, num2 * 1.1f, num2 * 0.8f), Quaternion.identity, val8, baseMat, emissive: true);
					christmasCart.bulbMats.Add(item);
					christmasCart.bulbBase.Add(val8);
				}
				for (int l = 0; l <= scallops; l++)
				{
					christmasCart.Part((PrimitiveType)0, val.transform, P((float)l / (float)scallops), Vector3.one * num2 * 0.55f, Quaternion.identity, Gold, baseMat, emissive: false);
				}
				Vector3 P(float num9)
				{
					//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_000d: 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_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					return Vector3.Lerp(A, C, num9) + Vector3.down * (drop + sagAmp * Mathf.Abs(Mathf.Sin(num9 * (float)scallops * MathF.PI)));
				}
			}
			float num8 = Mathf.Clamp(num * 0.55f, 0.22f, 0.55f);
			Vector3 val9 = array[2];
			Vector3 val10 = val2 - val9;
			val10.y = 0f;
			((Vector3)(ref val10)).Normalize();
			Vector3 val11 = val9 + val10 * num8 * 0.12f;
			christmasCart.BuildTree(val.transform, val11, num8, baseMat);
			Vector3 val12 = default(Vector3);
			((Vector3)(ref val12))..ctor(((Bounds)(ref box)).center.x, y - drop * 0.5f, ((Bounds)(ref box)).min.z - num3 * 1.2f);
			if (((Bounds)(ref box)).size.x < ((Bounds)(ref box)).size.z)
			{
				((Vector3)(ref val12))..ctor(((Bounds)(ref box)).min.x - num3 * 1.2f, y - drop * 0.5f, ((Bounds)(ref box)).center.z);
			}
			Vector3 val13 = val12 - new Vector3(((Bounds)(ref box)).center.x, val12.y, ((Bounds)(ref box)).center.z);
			((Vector3)(ref val13)).Normalize();
			Quaternion val14 = Quaternion.LookRotation(val13, Vector3.up);
			Color color = default(Color);
			((Color)(ref color))..ctor(0.8f, 0.03f, 0.08f);
			christmasCart.Part((PrimitiveType)0, val.transform, val12 + val14 * new Vector3((0f - num2) * 1.3f, 0f, 0f), new Vector3(num2 * 2.4f, num2 * 1.6f, num2 * 0.8f), val14 * Quaternion.Euler(0f, 0f, 20f), color, baseMat, emissive: false);
			christmasCart.Part((PrimitiveType)0, val.transform, val12 + val14 * new Vector3(num2 * 1.3f, 0f, 0f), new Vector3(num2 * 2.4f, num2 * 1.6f, num2 * 0.8f), val14 * Quaternion.Euler(0f, 0f, -20f), color, baseMat, emissive: false);
			christmasCart.Part((PrimitiveType)3, val.transform, val12 + val14 * new Vector3((0f - num2) * 0.6f, (0f - num2) * 1.6f, 0f), new Vector3(num2 * 0.7f, num2 * 2.4f, num2 * 0.3f), val14 * Quaternion.Euler(0f, 0f, -15f), color, baseMat, emissive: false);
			christmasCart.Part((PrimitiveType)3, val.transform, val12 + val14 * new Vector3(num2 * 0.6f, (0f - num2) * 1.6f, 0f), new Vector3(num2 * 0.7f, num2 * 2.4f, num2 * 0.3f), val14 * Quaternion.Euler(0f, 0f, 15f), color, baseMat, emissive: false);
			christmasCart.Part((PrimitiveType)0, val.transform, val12, Vector3.one * num2 * 0.9f, Quaternion.identity, Gold, baseMat, emissive: true);
			if (Plugin.XmasLight.Value)
			{
				GameObject val15 = new GameObject("Lumière");
				val15.transform.SetParent(val.transform, false);
				val15.transform.localPosition = val11 + Vector3.up * num8 * 0.6f;
				christmasCart.glow = val15.AddComponent<Light>();
				christmasCart.glow.type = (LightType)2;
				christmasCart.glow.range = Mathf.Max(1.2f, num * 1.6f);
				christmasCart.glow.intensity = 0.7f;
				christmasCart.glow.shadows = (LightShadows)0;
			}
		}

		private void BuildTree(Transform parent, Vector3 b, float h, Material baseMat)
		{
			//IL_000a: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			Part((PrimitiveType)2, parent, b + Vector3.up * h * 0.06f, new Vector3(h * 0.1f, h * 0.06f, h * 0.1f), Quaternion.identity, new Color(0.3f, 0.17f, 0.07f), baseMat, emissive: false);
			Part((PrimitiveType)2, parent, b + Vector3.up * h * 0.03f, new Vector3(h * 0.2f, h * 0.03f, h * 0.2f), Quaternion.identity, new Color(0.7f, 0.05f, 0.08f), baseMat, emissive: false);
			float[] array = new float[4] { 0.36f, 0.3f, 0.23f, 0.15f };
			float[] array2 = new float[4] { 0.1f, 0.3f, 0.5f, 0.68f };
			float[] array3 = new float[4] { 0.32f, 0.3f, 0.26f, 0.26f };
			Random random = new Random(((Object)this).GetInstanceID());
			int num = random.Next(BulbColors.Length);
			for (int i = 0; i < array.Length; i++)
			{
				float num2 = array[i] * h;
				float num3 = array2[i] * h;
				float num4 = array3[i] * h;
				Part(null, parent, b + Vector3.up * num3, new Vector3(num2 * 2f, num4, num2 * 2f), Quaternion.Euler(0f, (float)i * 37f, 0f), (i % 2 == 0) ? Pine : (Pine * 1.15f), baseMat, emissive: false);
				int num5 = 4 + (3 - i);
				for (int j = 0; j < num5; j++)
				{
					float num6 = ((float)j + (float)random.NextDouble() * 0.5f) / (float)num5 * MathF.PI * 2f + (float)i;
					float num7 = 0.12f + (float)random.NextDouble() * 0.25f;
					float num8 = num2 * (1f - num7) * 0.95f;
					Vector3 localPos = b + Vector3.up * (num3 + num4 * num7) + new Vector3(Mathf.Cos(num6) * num8, 0f, Mathf.Sin(num6) * num8);
					Color val = BulbColors[num++ % BulbColors.Length];
					Material item = Part((PrimitiveType)0, parent, localPos, Vector3.one * h * 0.05f, Quaternion.identity, val, baseMat, emissive: true);
					bulbMats.Add(item);
					bulbBase.Add(val);
				}
			}
			int turns = 3;
			int num9 = 60;
			for (int k = 0; k < num9; k++)
			{
				Segment(parent, Spiral((float)k / (float)num9), Spiral((float)(k + 1) / (float)num9), h * 0.012f, Gold, baseMat);
			}
			Material val2 = Part(null, parent, b + Vector3.up * h * 1f, Vector3.one * h * 0.16f, Quaternion.identity, Gold, baseMat, emissive: true, StarMesh());
			star = (((Object)(object)val2 == (Object)null) ? null : parent.GetChild(parent.childCount - 1));
			bulbMats.Add(val2);
			bulbBase.Add(Gold);
			Vector3 Spiral(float t)
			{
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				float num10 = Mathf.Lerp(0.16f, 0.86f, t) * h;
				float num11 = Mathf.Lerp(0.33f, 0.06f, t) * h;
				float num12 = t * (float)turns * MathF.PI * 2f;
				return b + new Vector3(Mathf.Cos(num12) * num11, num10, Mathf.Sin(num12) * num11);
			}
		}

		private Material Segment(Transform parent, Vector3 p0, Vector3 p1, float thickness, Color color, Material baseMat)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = p1 - p0;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (magnitude < 1E-05f)
			{
				return null;
			}
			return Part((PrimitiveType)2, parent, (p0 + p1) * 0.5f, new Vector3(thickness, magnitude * 0.5f + thickness * 0.3f, thickness), Quaternion.FromToRotation(Vector3.up, val / magnitude), color, baseMat, emissive: false);
		}

		private Material Part(PrimitiveType? type, Transform parent, Vector3 localPos, Vector3 size, Quaternion rot, Color color, Material baseMat, bool emissive, Mesh customMesh = null)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_000b: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			GameObject val;
			if (type.HasValue)
			{
				val = GameObject.CreatePrimitive(type.Value);
				Collider component = val.GetComponent<Collider>();
				if ((Object)(object)component != (Object)null)
				{
					Object.DestroyImmediate((Object)(object)component);
				}
			}
			else
			{
				val = new GameObject();
				val.AddComponent<MeshFilter>().sharedMesh = customMesh ?? ConeMesh();
				val.AddComponent<MeshRenderer>();
			}
			((Object)val).name = "Déco";
			val.transform.SetParent(parent, false);
			val.transform.localPosition = localPos;
			val.transform.localRotation = rot;
			Vector3 lossyScale = parent.lossyScale;
			val.transform.localScale = new Vector3(size.x / Mathf.Max(lossyScale.x, 0.0001f), size.y / Mathf.Max(lossyScale.y, 0.0001f), size.z / Mathf.Max(lossyScale.z, 0.0001f));
			MeshRenderer component2 = val.GetComponent<MeshRenderer>();
			((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0;
			Material val2 = (((Object)(object)baseMat != (Object)null) ? new Material(baseMat) : new Material(Shader.Find("Standard")));
			val2.mainTexture = null;
			if (val2.HasProperty("_Glossiness"))
			{
				val2.SetFloat("_Glossiness", emissive ? 0.8f : 0.25f);
			}
			SetColor(val2, color, emissive ? 1.6f : 0f);
			((Renderer)component2).sharedMaterial = val2;
			return val2;
		}

		private static Mesh ConeMesh()
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Expected O, but got Unknown
			if ((Object)(object)coneMesh != (Object)null)
			{
				return coneMesh;
			}
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			Vector3 val = default(Vector3);
			Vector3 val2 = default(Vector3);
			for (int i = 0; i < 14; i++)
			{
				float num = (float)i * MathF.PI * 2f / 14f;
				float num2 = (float)(i + 1) * MathF.PI * 2f / 14f;
				((Vector3)(ref val))..ctor(Mathf.Cos(num) * 0.5f, 0f, Mathf.Sin(num) * 0.5f);
				((Vector3)(ref val2))..ctor(Mathf.Cos(num2) * 0.5f, 0f, Mathf.Sin(num2) * 0.5f);
				Vector3 item = (val + val2) * 0.5f * 1.08f + Vector3.down * 0.04f;
				int count = list.Count;
				list.Add(Vector3.up);
				list.Add(val2);
				list.Add(item);
				list.Add(val);
				list2.AddRange(new int[6]
				{
					count,
					count + 1,
					count + 2,
					count,
					count + 2,
					count + 3
				});
				int count2 = list.Count;
				list.Add(Vector3.zero);
				list.Add(val);
				list.Add(item);
				list.Add(val2);
				list2.AddRange(new int[6]
				{
					count2,
					count2 + 1,
					count2 + 2,
					count2,
					count2 + 2,
					count2 + 3
				});
			}
			coneMesh = new Mesh
			{
				name = "TrioCone"
			};
			coneMesh.SetVertices(list);
			coneMesh.SetTriangles(list2, 0);
			coneMesh.RecalculateNormals();
			coneMesh.RecalculateBounds();
			return coneMesh;
		}

		private static Mesh StarMesh()
		{
			//IL_0027: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_0083: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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_00ee: Expected O, but got Unknown
			if ((Object)(object)starMesh != (Object)null)
			{
				return starMesh;
			}
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			Vector3 item3 = default(Vector3);
			Vector3 item4 = default(Vector3);
			for (int i = 0; i < 10; i++)
			{
				Vector3 item = Pt(i);
				Vector3 item2 = Pt(i + 1);
				((Vector3)(ref item3))..ctor(0f, 0f, -0.12f);
				((Vector3)(ref item4))..ctor(0f, 0f, 0.12f);
				int count = list.Count;
				list.Add(item3);
				list.Add(item);
				list.Add(item2);
				list.Add(item4);
				list.Add(item2);
				list.Add(item);
				list2.AddRange(new int[6]
				{
					count,
					count + 2,
					count + 1,
					count + 3,
					count + 5,
					count + 4
				});
			}
			starMesh = new Mesh
			{
				name = "TrioStar"
			};
			starMesh.SetVertices(list);
			starMesh.SetTriangles(list2, 0);
			starMesh.RecalculateNormals();
			starMesh.RecalculateBounds();
			return starMesh;
			static Vector3 Pt(int num2)
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				float num = MathF.PI / 2f + (float)num2 * MathF.PI / 5f;
				float num3 = ((num2 % 2 == 0) ? 0.5f : 0.21f);
				return new Vector3(Mathf.Cos(num) * num3, Mathf.Sin(num) * num3, 0f);
			}
		}

		private static void SetColor(Material m, Color color, float emission)
		{
			//IL_001d: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)m == (Object)null)
			{
				return;
			}
			if (m.HasProperty("_Color"))
			{
				m.SetColor("_Color", color);
			}
			if (m.HasProperty("_BaseColor"))
			{
				m.SetColor("_BaseColor", color);
			}
			if (m.HasProperty("_EmissionColor"))
			{
				if (emission > 0f)
				{
					m.EnableKeyword("_EMISSION");
					m.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1;
				}
				m.SetColor("_EmissionColor", color * emission);
			}
		}

		private void Update()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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)
			if ((Object)(object)star != (Object)null)
			{
				star.Rotate(Vector3.up, 60f * Time.deltaTime, (Space)1);
			}
			timer -= Time.deltaTime;
			if (!(timer > 0f))
			{
				timer = 0.5f;
				phase++;
				for (int i = 0; i < bulbMats.Count; i++)
				{
					bool flag = (i + phase) % 3 != 0;
					SetColor(bulbMats[i], bulbBase[i] * (flag ? 1f : 0.4f), flag ? 1.8f : 0.2f);
				}
				if ((Object)(object)glow != (Object)null)
				{
					glow.color = BulbColors[phase % BulbColors.Length];
				}
			}
		}

		private void OnDestroy()
		{
			foreach (Material bulbMat in bulbMats)
			{
				if ((Object)(object)bulbMat != (Object)null)
				{
					Object.Destroy((Object)(object)bulbMat);
				}
			}
		}
	}
	public class ContinueVote : MonoBehaviour
	{
		private const byte EvStart = 147;

		private const byte EvCast = 148;

		private const byte EvTally = 149;

		private const byte EvEnd = 150;

		internal static ContinueVote Instance;

		private bool active;

		private float endTime;

		private int yes;

		private int no;

		private int total;

		private int continuesLeft = -1;

		private bool? myVote;

		private string resultText;

		private float resultUntil;

		private readonly Dictionary<int, bool> votes = new Dictionary<int, bool>();

		internal static bool Bypass;

		internal static int ContinuesUsed;

		private bool resolving;

		private GUIStyle boxStyle;

		private GUIStyle titleStyle;

		private GUIStyle textStyle;

		private static bool IsHost => SemiFunc.IsMasterClientOrSingleplayer();

		private static bool Multi => SemiFunc.IsMultiplayer();

		private void Awake()
		{
			Instance = this;
			SceneManager.sceneLoaded += delegate
			{
				ResetState();
			};
		}

		private void OnEnable()
		{
			PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
		}

		private void OnDisable()
		{
			PhotonNetwork.NetworkingClient.EventReceived -= OnEvent;
		}

		private void ResetState()
		{
			active = false;
			resolving = false;
			myVote = null;
			votes.Clear();
			yes = (no = 0);
		}

		internal bool HostIntercept()
		{
			if (resolving)
			{
				return true;
			}
			if (active)
			{
				return true;
			}
			int value = Plugin.VoteMaxContinues.Value;
			if (value > 0 && ContinuesUsed >= value)
			{
				return false;
			}
			active = true;
			votes.Clear();
			yes = (no = 0);
			total = CountPlayers();
			myVote = null;
			float value2 = Plugin.VoteDuration.Value;
			endTime = Time.time + value2;
			continuesLeft = ((value > 0) ? (value - ContinuesUsed) : (-1));
			if (Multi)
			{
				Raise(147, new object[2] { value2, continuesLeft }, (ReceiverGroup)0);
			}
			Plugin.Log.LogInfo((object)"Toute l'équipe est morte : vote lancé.");
			return true;
		}

		private static int CountPlayers()
		{
			if (!Multi)
			{
				return 1;
			}
			Room currentRoom = PhotonNetwork.CurrentRoom;
			return Mathf.Max(1, (currentRoom == null) ? 1 : currentRoom.PlayerCount);
		}

		private void HostReceiveVote(int actor, bool cont)
		{
			if (!active || resolving)
			{
				return;
			}
			votes[actor] = cont;
			yes = 0;
			no = 0;
			foreach (bool value in votes.Values)
			{
				if (value)
				{
					yes++;
				}
				else
				{
					no++;
				}
			}
			total = CountPlayers();
			if (Multi)
			{
				Raise(149, new object[3] { yes, no, total }, (ReceiverGroup)0);
			}
			if (votes.Count >= total)
			{
				HostResolve();
			}
		}

		private void HostResolve()
		{
			if (resolving)
			{
				return;
			}
			resolving = true;
			bool flag = ((votes.Count == 0) ? Plugin.VoteDefaultContinue.Value : (yes >= no));
			if (Multi)
			{
				Raise(150, new object[1] { flag }, (ReceiverGroup)0);
			}
			ShowResult(flag);
			active = false;
			RunManager instance = RunManager.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			Bypass = true;
			try
			{
				if (flag)
				{
					ContinuesUsed++;
					int value = Plugin.VoteMoneyPenalty.Value;
					if (value > 0)
					{
						int num = SemiFunc.StatGetRunCurrency();
						SemiFunc.StatSetRunCurrency(Mathf.Max(0, Mathf.RoundToInt((float)(num * (100 - value)) / 100f)));
					}
					instance.ChangeLevel(false, false, (ChangeLevelType)1);
				}
				else
				{
					instance.ChangeLevel(false, true, (ChangeLevelType)0);
				}
			}
			finally
			{
				Bypass = false;
			}
		}

		private void Update()
		{
			//IL_0025: 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)
			if (!active)
			{
				return;
			}
			Keyboard current = Keyboard.current;
			if (current != null && !myVote.HasValue)
			{
				if (((ButtonControl)current[Plugin.VoteKeyYes.Value]).wasPressedThisFrame)
				{
					CastVote(cont: true);
				}
				else if (((ButtonControl)current[Plugin.VoteKeyNo.Value]).wasPressedThisFrame)
				{
					CastVote(cont: false);
				}
			}
			if (IsHost && Time.time >= endTime)
			{
				HostResolve();
			}
		}

		private void CastVote(bool cont)
		{
			myVote = cont;
			if (IsHost)
			{
				int actor = (Multi ? PhotonNetwork.LocalPlayer.ActorNumber : 0);
				HostReceiveVote(actor, cont);
			}
			else
			{
				Raise(148, new object[1] { cont }, (ReceiverGroup)2);
			}
		}

		private void ShowResult(bool cont)
		{
			resultText = ((!cont) ? "Abandon... Game Over." : ((Plugin.VoteMoneyPenalty.Value > 0) ? $"On continue ! (-{Plugin.VoteMoneyPenalty.Value}% d'argent)" : "On continue !"));
			resultUntil = Time.time + 6f;
		}

		private void OnEvent(EventData ev)
		{
			if (ev.Code < 147 || ev.Code > 150)
			{
				return;
			}
			object[] array = ev.CustomData as object[];
			switch (ev.Code)
			{
			case 147:
				if (!IsHost)
				{
					active = true;
					myVote = null;
					yes = (no = 0);
					total = CountPlayers();
					endTime = Time.time + (float)array[0];
					continuesLeft = (int)array[1];
				}
				break;
			case 148:
				if (IsHost)
				{
					HostReceiveVote(ev.Sender, (bool)array[0]);
				}
				break;
			case 149:
				yes = (int)array[0];
				no = (int)array[1];
				total = (int)array[2];
				break;
			case 150:
				active = false;
				ShowResult((bool)array[0]);
				break;
			}
		}

		private static void Raise(byte code, object[] content, ReceiverGroup group)
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			PhotonNetwork.RaiseEvent(code, (object)content, new RaiseEventOptions
			{
				Receivers = group
			}, SendOptions.SendReliable);
		}

		private void OnGUI()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00fb: 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_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			if (active || !(Time.time > resultUntil))
			{
				if (boxStyle == null)
				{
					boxStyle = new GUIStyle(GUI.skin.box);
					Texture2D val = new Texture2D(1, 1);
					val.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.75f));
					val.Apply();
					boxStyle.normal.background = val;
					titleStyle = new GUIStyle(GUI.skin.label)
					{
						fontSize = 30,
						fontStyle = (FontStyle)1,
						alignment = (TextAnchor)4
					};
					titleStyle.normal.textColor = new Color(1f, 0.35f, 0.3f);
					textStyle = new GUIStyle(GUI.skin.label)
					{
						fontSize = 20,
						alignment = (TextAnchor)4,
						richText = true
					};
					textStyle.normal.textColor = Color.white;
				}
				float num = 620f;
				float num2 = (active ? 200 : 80);
				Rect val2 = default(Rect);
				((Rect)(ref val2))..ctor(((float)Screen.width - num) / 2f, (float)Screen.height * 0.18f, num, num2);
				GUI.Box(val2, GUIContent.none, boxStyle);
				GUILayout.BeginArea(new Rect(((Rect)(ref val2)).x + 10f, ((Rect)(ref val2)).y + 10f, ((Rect)(ref val2)).width - 20f, ((Rect)(ref val2)).height - 20f));
				if (active)
				{
					GUILayout.Label("TOUTE L'ÉQUIPE EST MORTE !", titleStyle, Array.Empty<GUILayoutOption>());
					string arg = ((continuesLeft >= 0) ? string.Format(" ({0} restant{1})", continuesLeft, (continuesLeft > 1) ? "s" : "") : "");
					GUILayout.Label($"<b>[{Plugin.VoteKeyYes.Value}]</b> Continuer sur une nouvelle carte{arg}     <b>[{Plugin.VoteKeyNo.Value}]</b> Abandonner", textStyle, Array.Empty<GUILayoutOption>());
					GUILayout.Label($"<color=#7CFC7C>Continuer : {yes}</color>     <color=#FF8080>Abandonner : {no}</color>     ({yes + no}/{total})", textStyle, Array.Empty<GUILayoutOption>());
					string arg2 = ((!myVote.HasValue) ? "Vote maintenant !" : (myVote.Value ? "Tu as voté : Continuer" : "Tu as voté : Abandonner"));
					GUILayout.Label($"{arg2}  —  {Mathf.Max(0, Mathf.CeilToInt(endTime - Time.time))} s", textStyle, Array.Empty<GUILayoutOption>());
				}
				else
				{
					GUILayout.Label(resultText, titleStyle, Array.Empty<GUILayoutOption>());
				}
				GUILayout.EndArea();
			}
		}
	}
	[HarmonyPatch(typeof(RunManager), "ChangeLevel")]
	internal static class ChangeLevelPatch
	{
		[HarmonyPriority(800)]
		private static bool Prefix(bool _completedLevel, bool _levelFailed, ChangeLevelType _changeLevelType)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (ContinueVote.Bypass || !Plugin.VoteEnabled.Value)
			{
				return true;
			}
			if (!_levelFailed || _completedLevel || (int)_changeLevelType != 0)
			{
				return true;
			}
			if (!SemiFunc.IsMasterClientOrSingleplayer())
			{
				return true;
			}
			if (!SemiFunc.RunIsLevel())
			{
				return true;
			}
			if ((Object)(object)ContinueVote.Instance == (Object)null)
			{
				return true;
			}
			return !ContinueVote.Instance.HostIntercept();
		}
	}
	[HarmonyPatch(typeof(RunManager), "ResetProgress")]
	internal static class ResetProgressPatch
	{
		private static void Postfix()
		{
			ContinueVote.ContinuesUsed = 0;
		}
	}
	[HarmonyPatch(typeof(StatsManager), "RunStartStats")]
	internal static class CustomItems
	{
		private static bool done;

		private static GameObject holder;

		[HarmonyPriority(800)]
		private static void Postfix(StatsManager __instance)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			if (done || !Plugin.ItemsEnabled.Value || (Object)(object)RunManager.instance == (Object)null || __instance.itemDictionary.Count == 0)
			{
				return;
			}
			done = true;
			try
			{
				holder = new GameObject("TrioMod Prefabs");
				holder.SetActive(false);
				Object.DontDestroyOnLoad((Object)(object)holder);
				List<Item> items = __instance.itemDictionary.Values.ToList();
				Make(items, new string[3] { "Gun Handgun", "Handgun", "Gun" }, new string[1] { "ItemGun" }, "Item Trio Grappin", "Grappin", "Vise une surface et appuie sur [Utiliser] pour t'y propulser. Réappuie pour lâcher.", Plugin.GrapplePrice.Value, typeof(GrappleBehaviour), new Color(0.2f, 0.9f, 1f));
				Make(items, new string[4] { "Leaf Blower", "LeafBlower", "Orb Zero Gravity", "Orb" }, new string[2] { "ItemLeafBlower", "ItemOrb" }, "Item Trio Souffleur Fusee", "Souffleur-Fusée", "Maintiens [Utiliser] pour voler dans la direction où tu regardes. Se recharge tout seul.", Plugin.JetpackPrice.Value, typeof(JetpackBehaviour), new Color(1f, 0.45f, 0.1f));
			}
			catch (Exception ex)
			{
				Plugin.Log.LogError((object)("Création des nouveaux objets impossible : " + ex));
			}
		}

		private static void Make(List<Item> items, string[] baseNames, string[] stripPrefixes, string assetName, string displayName, string description, float priceMult, Type behaviour, Color tint)
		{
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			Item val = null;
			GameObject val2 = null;
			foreach (string text in baseNames)
			{
				foreach (Item item in items)
				{
					if (!((Object)(object)item == (Object)null) && !item.disabled && ((Object)item).name.Replace(" ", "").ToLower().Contains(text.Replace(" ", "").ToLower()))
					{
						GameObject val3 = ((item.prefab != null && ((PrefabRef<GameObject>)(object)item.prefab).IsValid()) ? ((PrefabRef<GameObject>)(object)item.prefab).Prefab : null);
						if (!((Object)(object)val3 == (Object)null) && !((Object)(object)val3.GetComponent<ItemAttributes>() == (Object)null) && val3.GetComponents<MonoBehaviour>().Any((MonoBehaviour m) => (Object)(object)m != (Object)null && stripPrefixes.Any((string p) => ((object)m).GetType().Name.StartsWith(p))))
						{
							val = item;
							val2 = val3;
							break;
						}
					}
				}
				if ((Object)(object)val != (Object)null)
				{
					break;
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Log.LogWarning((object)("Objet de base introuvable pour « " + displayName + " »."));
				return;
			}
			GameObject val4 = Object.Instantiate<GameObject>(val2, holder.transform);
			((Object)val4).name = assetName;
			foreach (MonoBehaviour item2 in (from m in val4.GetComponentsInChildren<MonoBehaviour>(true)
				where (Object)(object)m != (Object)null && stripPrefixes.Any((string p) => ((object)m).GetType().Name.StartsWith(p))
				orderby ((object)m).GetType().Name.Length descending
				select m).ToList())
			{
				try
				{
					Object.DestroyImmediate((Object)(object)item2, true);
				}
				catch (Exception ex)
				{
					Plugin.Log.LogWarning((object)("Impossible de retirer " + ((object)item2).GetType().Name + " : " + ex.Message));
				}
			}
			Item val5 = Object.Instantiate<Item>(val);
			((Object)val5).name = assetName;
			val5.itemName = displayName;
			val5.itemNameLocalized = null;
			val5.description = description;
			val5.disabled = false;
			Value val6 = Object.Instantiate<Value>(val.value);
			((Object)val6).name = assetName + " Value";
			val6.valueMin = val.value.valueMin * priceMult;
			val6.valueMax = val.value.valueMax * priceMult;
			val5.value = val6;
			val5.maxAmountInShop = Mathf.Max(1, val.maxAmountInShop);
			val4.GetComponent<ItemAttributes>().item = val5;
			val4.AddComponent(behaviour);
			Tint(val4, tint);
			PrefabRef val7 = Items.RegisterItem(val4.GetComponent<ItemAttributes>());
			Plugin.Log.LogInfo((object)((val7 != null) ? ("Nouvel objet « " + displayName + " » créé (base : " + ((Object)val).name + ").") : ("Échec de l'enregistrement de « " + displayName + " ».")));
		}

		private static void Tint(GameObject go, Color tint)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] componentsInChildren = go.GetComponentsInChildren<MeshRenderer>(true);
			foreach (MeshRenderer val in componentsInChildren)
			{
				Material[] sharedMaterials = ((Renderer)val).sharedMaterials;
				for (int j = 0; j < sharedMaterials.Length; j++)
				{
					if (!((Object)(object)sharedMaterials[j] == (Object)null))
					{
						Material val2 = new Material(sharedMaterials[j]);
						if (val2.HasProperty("_Color"))
						{
							val2.SetColor("_Color", Color.Lerp(val2.GetColor("_Color"), tint, 0.5f));
						}
						sharedMaterials[j] = val2;
					}
				}
				((Renderer)val).sharedMaterials = sharedMaterials;
			}
		}
	}
	public abstract class TrioItemBase : MonoBehaviour
	{
		protected PhysGrabObject grab;

		internal static TrioItemBase HeldLocal;

		protected bool HeldByMe
		{
			get
			{
				if ((Object)(object)grab != (Object)null && grab.heldByLocalPlayer && (Object)(object)PlayerController.instance != (Object)null && (Object)(object)PlayerAvatar.instance != (Object)null)
				{
					return !PlayerAvatar.instance.isDisabled;
				}
				return false;
			}
		}

		protected virtual void Start()
		{
			grab = ((Component)this).GetComponent<PhysGrabObject>();
		}

		protected virtual void Update()
		{
			if (HeldByMe)
			{
				HeldLocal = this;
			}
			else if ((Object)(object)HeldLocal == (Object)(object)this)
			{
				HeldLocal = null;
			}
		}

		internal abstract string HudText();
	}
	public class GrappleBehaviour : TrioItemBase
	{
		private bool hooked;

		private Vector3 point;

		private float hookTime;

		private LineRenderer line;

		protected override void Update()
		{
			//IL_0045: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			base.Update();
			if (!base.HeldByMe)
			{
				Release();
				return;
			}
			if (SemiFunc.InputDown((InputKey)2))
			{
				if (hooked)
				{
					Release();
				}
				else
				{
					TryHook();
				}
			}
			if (!hooked)
			{
				return;
			}
			PlayerController instance = PlayerController.instance;
			Vector3 val = point - ((Component)instance).transform.position;
			if (((Vector3)(ref val)).magnitude < 1.6f || Time.time - hookTime > 4f)
			{
				Release();
				return;
			}
			instance.AntiGravity(0.25f);
			instance.MoveForce(((Vector3)(ref val)).normalized, Plugin.GrappleSpeed.Value, 0.12f);
			if ((Object)(object)line == (Object)null)
			{
				CreateLine();
			}
			((Renderer)line).enabled = true;
			line.SetPosition(0, ((Component)this).transform.position);
			line.SetPosition(1, point);
		}

		private void TryHook()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_008c: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			Camera main = Camera.main;
			if ((Object)(object)main == (Object)null)
			{
				return;
			}
			IOrderedEnumerable<RaycastHit> orderedEnumerable = from h in Physics.RaycastAll(new Ray(((Component)main).transform.position, ((Component)main).transform.forward), Plugin.GrappleRange.Value, -1, (QueryTriggerInteraction)1)
				orderby ((RaycastHit)(ref h)).distance
				select h;
			Transform val = (((Object)(object)PlayerAvatar.instance != (Object)null) ? ((Component)PlayerAvatar.instance).transform : null);
			foreach (RaycastHit item in orderedEnumerable)
			{
				RaycastHit current = item;
				Transform transform = ((Component)((RaycastHit)(ref current)).collider).transform;
				if (!transform.IsChildOf(((Component)this).transform) && (!((Object)(object)val != (Object)null) || !transform.IsChildOf(val)) && !((Object)(object)((Component)((RaycastHit)(ref current)).collider).GetComponentInParent<PlayerController>() != (Object)null) && !((Object)(object)((Component)((RaycastHit)(ref current)).collider).GetComponentInParent<PlayerAvatar>() != (Object)null))
				{
					hooked = true;
					point = ((RaycastHit)(ref current)).point;
					hookTime = Time.time;
					break;
				}
			}
		}

		private void Release()
		{
			hooked = false;
			if ((Object)(object)line != (Object)null)
			{
				((Renderer)line).enabled = false;
			}
		}

		private void CreateLine()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			GameObject val = new GameObject("Grappin Corde");
			val.transform.SetParent(((Component)this).transform, false);
			line = val.AddComponent<LineRenderer>();
			line.positionCount = 2;
			line.startWidth = 0.025f;
			line.endWidth = 0.015f;
			line.useWorldSpace = true;
			Shader val2 = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color");
			if ((Object)(object)val2 != (Object)null)
			{
				((Renderer)line).material = new Material(val2);
			}
			LineRenderer obj = line;
			LineRenderer obj2 = line;
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(0.3f, 0.95f, 1f);
			obj2.endColor = val3;
			obj.startColor = val3;
		}

		internal override string HudText()
		{
			if (!hooked)
			{
				return "Grappin : vise et appuie sur [Utiliser]";
			}
			return "Grappin : accroché ! ([Utiliser] pour lâcher)";
		}

		private void OnDisable()
		{
			Release();
		}
	}
	public class JetpackBehaviour : TrioItemBase
	{
		private float fuel = -1f;

		private bool flying;

		private ParticleSystem[] particles;

		protected override void Start()
		{
			base.Start();
			particles = ((Component)this).GetComponentsInChildren<ParticleSystem>(true);
		}

		protected override void Update()
		{
			//IL_0074: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			base.Update();
			float value = Plugin.JetpackFuel.Value;
			if (fuel < 0f)
			{
				fuel = value;
			}
			bool flag = base.HeldByMe && SemiFunc.InputHold((InputKey)2) && fuel > 0f;
			if (flag)
			{
				PlayerController instance = PlayerController.instance;
				Camera main = Camera.main;
				Vector3 val = (((Object)(object)main != (Object)null) ? ((Component)main).transform.forward : ((Component)instance).transform.forward) * 0.8f + Vector3.up * 0.9f;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				instance.AntiGravity(0.3f);
				instance.MoveForce(normalized, Plugin.JetpackSpeed.Value, 0.1f);
				fuel -= Time.deltaTime;
			}
			else
			{
				fuel = Mathf.Min(value, fuel + Time.deltaTime * value / 4f);
			}
			if (flag == flying)
			{
				return;
			}
			flying = flag;
			if (particles == null)
			{
				return;
			}
			ParticleSystem[] array = particles;
			foreach (ParticleSystem val2 in array)
			{
				if (!((Object)(object)val2 == (Object)null))
				{
					if (flag)
					{
						val2.Play();
					}
					else
					{
						val2.Stop();
					}
				}
			}
		}

		internal override string HudText()
		{
			float value = Plugin.JetpackFuel.Value;
			int num = Mathf.RoundToInt(Mathf.Clamp01(fuel / value) * 10f);
			return "Souffleur-Fusée [" + new string('|', num) + new string('.', 10 - num) + "]  maintiens [Utiliser]";
		}
	}
	public class ItemHud : MonoBehaviour
	{
		private GUIStyle style;

		private void OnGUI()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			TrioItemBase heldLocal = TrioItemBase.HeldLocal;
			if (!((Object)(object)heldLocal == (Object)null))
			{
				if (style == null)
				{
					style = new GUIStyle(GUI.skin.label)
					{
						fontSize = 18,
						fontStyle = (FontStyle)1,
						alignment = (TextAnchor)4
					};
					style.normal.textColor = new Color(1f, 0.9f, 0.6f);
				}
				GUI.Label(new Rect(0f, (float)Screen.height * 0.78f, (float)Screen.width, 30f), heldLocal.HudText(), style);
			}
		}
	}
	public class GhostCards : MonoBehaviour
	{
		private enum Card
		{
			Soin,
			Souffle,
			Oeil,
			Lune,
			CrochePatte,
			Mini,
			Bourrasque,
			Geant
		}

		private const byte EvCard = 151;

		private static readonly Dictionary<Card, (string nom, string desc, bool bonus)> Info = new Dictionary<Card, (string, string, bool)>
		{
			{
				Card.Soin,
				("Soin d'outre-tombe", "+30 PV aux vivants", true)
			},
			{
				Card.Souffle,
				("Second souffle", "Énergie au max", true)
			},
			{
				Card.Oeil,
				("Œil du fantôme", "Révèle 3 objets non scannés", true)
			},
			{
				Card.Lune,
				("Pas lunaire", "Gravité réduite 10 s", true)
			},
			{
				Card.CrochePatte,
				("Croche-patte", "Les vivants se cassent la figure", false)
			},
			{
				Card.Mini,
				("Mini-moi", "Les vivants rapetissent 20 s", false)
			},
			{
				Card.Bourrasque,
				("Bourrasque", "Projette les vivants au hasard", false)
			},
			{
				Card.Geant,
				("Géant maladroit", "Les vivants grandissent 15 s", false)
			}
		};

		private float readyAt = -1f;

		private Card[] hand;

		private bool wasGhost;

		private readonly List<(string text, float until)> toasts = new List<(string, float)>();

		private GUIStyle box;

		private GUIStyle title;

		private GUIStyle line;

		private GUIStyle toastStyle;

		private static bool IsGhost
		{
			get
			{
				if (Plugin.GhostEnabled.Value && SemiFunc.IsMultiplayer() && SemiFunc.RunIsLevel() && (Object)(object)PlayerAvatar.instance != (Object)null && PlayerAvatar.instance.isDisabled)
				{
					return AnyoneAlive();
				}
				return false;
			}
		}

		private void Awake()
		{
			SceneManager.sceneLoaded += delegate
			{
				hand = null;
				wasGhost = false;
				readyAt = -1f;
			};
		}

		private void OnEnable()
		{
			PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
		}

		private void OnDisable()
		{
			PhotonNetwork.NetworkingClient.EventReceived -= OnEvent;
		}

		private static bool AnyoneAlive()
		{
			GameDirector instance = GameDirector.instance;
			if ((Object)(object)instance != (Object)null)
			{
				return instance.PlayerList.Any((PlayerAvatar p) => (Object)(object)p != (Object)null && !p.isDisabled);
			}
			return false;
		}

		private void Update()
		{
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_0113: Expected O, but got Unknown
			bool isGhost = IsGhost;
			if (isGhost && !wasGhost)
			{
				readyAt = Time.time + Plugin.GhostFirstDelay.Value;
			}
			wasGhost = isGhost;
			if (!isGhost)
			{
				hand = null;
				return;
			}
			if (hand == null && Time.time >= readyAt)
			{
				hand = Draw();
			}
			if (hand == null)
			{
				return;
			}
			Keyboard current = Keyboard.current;
			if (current != null)
			{
				int num = ((!((ButtonControl)current.digit1Key).wasPressedThisFrame && !((ButtonControl)current.numpad1Key).wasPressedThisFrame) ? ((((ButtonControl)current.digit2Key).wasPressedThisFrame || ((ButtonControl)current.numpad2Key).wasPressedThisFrame) ? 1 : ((((ButtonControl)current.digit3Key).wasPressedThisFrame || ((ButtonControl)current.numpad3Key).wasPressedThisFrame) ? 2 : (-1))) : 0);
				if (num >= 0)
				{
					string text = PlayerAvatar.instance.playerName ?? "Un fantôme";
					PhotonNetwork.RaiseEvent((byte)151, (object)new object[2]
					{
						(int)hand[num],
						text
					}, new RaiseEventOptions
					{
						Receivers = (ReceiverGroup)1
					}, SendOptions.SendReliable);
					hand = null;
					readyAt = Time.time + Plugin.GhostCooldown.Value;
				}
			}
		}

		private static Card[] Draw()
		{
			List<Card> list = (from k in Info
				where k.Value.bonus
				select k.Key into _
				orderby Random.value
				select _).ToList();
			List<Card> list2 = (from k in Info
				where !k.Value.bonus
				select k.Key into _
				orderby Random.value
				select _).ToList();
			return new List<Card>
			{
				list[0],
				list2[0],
				(Random.value < 0.5f) ? list[1] : list2[1]
			}.OrderBy((Card _) => Random.value).ToArray();
		}

		private void OnEvent(EventData ev)
		{
			if (ev.Code != 151)
			{
				return;
			}
			object[] obj = (object[])ev.CustomData;
			Card card = (Card)(int)obj[0];
			string text = (string)obj[1];
			(string, string, bool) tuple = Info[card];
			toasts.Add((text + " (fantôme) a lancé : " + tuple.Item1 + "  —  " + tuple.Item2, Time.time + 6f));
			try
			{
				Apply(card);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Carte fantôme : " + ex.Message));
			}
		}

		private static void Apply(Card card)
		{
			//IL_009b: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			PlayerAvatar instance = PlayerAvatar.instance;
			bool flag = (Object)(object)instance != (Object)null && !instance.isDisabled;
			PlayerController instance2 = PlayerController.instance;
			switch (card)
			{
			case Card.Soin:
				if (flag)
				{
					instance.playerHealth.Heal(30, true);
				}
				break;
			case Card.Souffle:
				if (flag && (Object)(object)instance2 != (Object)null)
				{
					instance2.EnergyCurrent = instance2.EnergyStart;
				}
				break;
			case Card.Lune:
				if (flag && (Object)(object)instance2 != (Object)null)
				{
					instance2.AntiGravity(10f);
					instance2.ForceImpulse(Vector3.up * 3f);
				}
				break;
			case Card.CrochePatte:
				if (flag && (Object)(object)instance.tumble != (Object)null)
				{
					instance.tumble.TumbleRequest(true, false);
					instance.tumble.TumbleOverrideTime(2.5f);
				}
				break;
			case Card.Bourrasque:
				if (flag && (Object)(object)instance2 != (Object)null)
				{
					Vector3 insideUnitSphere = Random.insideUnitSphere;
					insideUnitSphere.y = 0f;
					instance2.ForceImpulse(((Vector3)(ref insideUnitSphere)).normalized * 9f + Vector3.up * 5f);
				}
				break;
			case Card.Oeil:
				if (!SemiFunc.IsMasterClientOrSingleplayer() || !((Object)(object)ValuableDirector.instance != (Object)null))
				{
					break;
				}
				{
					foreach (ValuableObject item in (from _ in ValuableDirector.instance.valuableList
						where (Object)(object)_ != (Object)null && !_.discovered
						orderby Random.value
						select _).Take(3))
					{
						item.Discover((State)0);
					}
					break;
				}
			case Card.Mini:
				ScaleLiving(0.45f, 20f);
				break;
			case Card.Geant:
				ScaleLiving(1.6f, 15f);
				break;
			}
		}

		private static void ScaleLiving(float factor, float duration)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)GameDirector.instance == (Object)null)
			{
				return;
			}
			PlayerSizeSync.PauseUntil = Time.time + duration + 1f;
			foreach (PlayerAvatar player in GameDirector.instance.PlayerList)
			{
				if (!((Object)(object)player == (Object)null) && !player.isDisabled)
				{
					ScaleOptions val = ((factor > 1f) ? ScaleOptions.Growth : ScaleOptions.Default);
					val.Factor = factor;
					val.Duration = duration;
					val.SuppressCameraShake = true;
					ScaleManager.ForceApply(((Component)player).gameObject, val);
				}
			}
		}

		private void OnGUI()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			if (box == null)
			{
				box = new GUIStyle(GUI.skin.box);
				Texture2D val = new Texture2D(1, 1);
				val.SetPixel(0, 0, new Color(0.05f, 0f, 0.12f, 0.8f));
				val.Apply();
				box.normal.background = val;
				title = new GUIStyle(GUI.skin.label)
				{
					fontSize = 22,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				title.normal.textColor = new Color(0.75f, 0.7f, 1f);
				line = new GUIStyle(GUI.skin.label)
				{
					fontSize = 17,
					richText = true
				};
				line.normal.textColor = Color.white;
				toastStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 19,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				toastStyle.normal.textColor = new Color(0.8f, 0.75f, 1f);
			}
			toasts.RemoveAll(((string text, float until) t) => Time.time > t.until);
			for (int num = 0; num < toasts.Count; num++)
			{
				GUI.Label(new Rect(0f, (float)Screen.height * 0.12f + (float)(num * 28), (float)Screen.width, 28f), toasts[num].text, toastStyle);
			}
			if (!IsGhost)
			{
				return;
			}
			float num2 = 520f;
			float num3 = ((hand != null) ? 150 : 50);
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor((float)Screen.width - num2 - 20f, (float)Screen.height - num3 - 140f, num2, num3);
			GUI.Box(val2, GUIContent.none, box);
			GUILayout.BeginArea(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).y + 8f, ((Rect)(ref val2)).width - 24f, ((Rect)(ref val2)).height - 16f));
			if (hand == null)
			{
				GUILayout.Label($"Fantôme : nouvelles cartes dans {Mathf.Max(0, Mathf.CeilToInt(readyAt - Time.time))} s", title, Array.Empty<GUILayoutOption>());
			}
			else
			{
				GUILayout.Label("Fantôme : choisis une carte !", title, Array.Empty<GUILayoutOption>());
				for (int num4 = 0; num4 < hand.Length; num4++)
				{
					(string, string, bool) tuple = Info[hand[num4]];
					string text = (tuple.Item3 ? "#7CFC7C" : "#FF9060");
					GUILayout.Label($"<b>[{num4 + 1}]</b> <color={text}>{tuple.Item1}</color>  <size=14>{tuple.Item2}</size>", line, Array.Empty<GUILayoutOption>());
				}
			}
			GUILayout.EndArea();
		}
	}
	public class MapCounter : MonoBehaviour
	{
		private float nextCount;

		private int hidden;

		private int total;

		private float foundValue;

		private float totalValue;

		private readonly Dictionary<int, (float value, bool discovered)> seen = new Dictionary<int, (float, bool)>();

		private GUIStyle style;

		private GUIStyle shadow;

		private static bool MapOpen
		{
			get
			{
				if ((Object)(object)Map.Instance != (Object)null && Map.Instance.Active)
				{
					return SemiFunc.RunIsLevel();
				}
				return false;
			}
		}

		private void Awake()
		{
			SceneManager.sceneLoaded += delegate
			{
				seen.Clear();
			};
		}

		private void Update()
		{
			if (!Plugin.MapCounterEnabled.Value || !SemiFunc.RunIsLevel() || Time.time < nextCount)
			{
				return;
			}
			nextCount = Time.time + (MapOpen ? 0.5f : 2f);
			ValuableDirector instance = ValuableDirector.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			hidden = (total = 0);
			foreach (ValuableObject valuable in instance.valuableList)
			{
				if (!((Object)(object)valuable == (Object)null))
				{
					total++;
					if (!valuable.discovered)
					{
						hidden++;
					}
					if (valuable.dollarValueSet)
					{
						int instanceID = ((Object)valuable).GetInstanceID();
						(float, bool) value;
						bool item = valuable.discovered || (seen.TryGetValue(instanceID, out value) && value.Item2);
						seen[instanceID] = (valuable.dollarValueOriginal, item);
					}
				}
			}
			foundValue = (totalValue = 0f);
			foreach (var value2 in seen.Values)
			{
				totalValue += value2.value;
				if (value2.discovered)
				{
					foundValue += value2.value;
				}
			}
		}

		private static string Money(float v)
		{
			if (!(v >= 1000f))
			{
				return Mathf.RoundToInt(v).ToString();
			}
			return (v / 1000f).ToString((v >= 100000f) ? "0" : "0.#", CultureInfo.InvariantCulture) + "k";
		}

		private void OnGUI()
		{
			//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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0087: 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_01a1: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.MapCounterEnabled.Value && MapOpen && total != 0)
			{
				if (style == null)
				{
					style = new GUIStyle(GUI.skin.label)
					{
						fontSize = 22,
						fontStyle = (FontStyle)1,
						alignment = (TextAnchor)1,
						richText = true
					};
					style.normal.textColor = Color.white;
					shadow = new GUIStyle(style);
					shadow.normal.textColor = Color.black;
				}
				string text = ((hidden == 0) ? "#7CFC7C" : "#FFD24A");
				string text2 = ((hidden == 0) ? $"<color={text}>Tous les objets ont été trouvés ! ({total})</color>" : string.Format("<color={0}>{1}</color> objet{2} pas encore scanné{3} / {4}", text, hidden, (hidden > 1) ? "s" : "", (hidden > 1) ? "s" : "", total));
				string text3 = ((totalValue > 0f) ? ("Valeur trouvée : <color=#7CFC7C>$" + Money(foundValue) + "</color> / $" + Money(totalValue)) : "");
				Draw(new Rect(0f, 18f, (float)Screen.width, 32f), text2);
				if (text3.Length > 0)
				{
					Draw(new Rect(0f, 50f, (float)Screen.width, 32f), text3);
				}
			}
		}

		private void Draw(Rect r, string text)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			GUI.Label(new Rect(((Rect)(ref r)).x + 2f, ((Rect)(ref r)).y + 2f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), Regex.Replace(text, "<.*?>", ""), shadow);
			GUI.Label(r, text, style);
		}
	}
	public class PinkName : MonoBehaviour
	{
		internal const string SteamId = "76561199255371357";

		internal const string Pseudo = "Kill_Me";

		internal static readonly Color Pink = new Color(1f, 0.42f, 0.75f);

		private readonly Dictionary<PlayerAvatar, ParticleSystem> hearts = new Dictionary<PlayerAvatar, ParticleSystem>();

		private readonly Dictionary<PlayerAvatar, ParticleSystem> trails = new Dictionary<PlayerAvatar, ParticleSystem>();

		private float nextScan;

		private static Material heartMat;

		internal static bool IsSpecial(PlayerAvatar a)
		{
			if ((Object)(object)a != (Object)null)
			{
				if (!(a.steamID == "76561199255371357"))
				{
					return string.Equals(a.playerName, "Kill_Me", StringComparison.OrdinalIgnoreCase);
				}
				return true;
			}
			return false;
		}

		internal static string Decorate(TMP_Text t, string name)
		{
			string text = (((Object)(object)t != (Object)null && (Object)(object)t.font != (Object)null && t.font.HasCharacter('♥', true, false)) ? "♥" : "&lt;3");
			return text + " " + name + " " + text;
		}

		private void Update()
		{
			if (Time.time < nextScan)
			{
				return;
			}
			nextScan = Time.time + 1f;
			GameDirector instance = GameDirector.instance;
			Clean(hearts);
			Clean(trails);
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			foreach (PlayerAvatar player in instance.PlayerList)
			{
				if (!IsSpecial(player) || (Object)(object)player.playerAvatarVisuals == (Object)null)
				{
					continue;
				}
				try
				{
					if (!player.isLocal && !hearts.ContainsKey(player))
					{
						hearts[player] = BuildHearts(((Component)player.playerAvatarVisuals).transform);
					}
					if (!trails.ContainsKey(player))
					{
						trails[player] = BuildTrail(((Component)player.playerAvatarVisuals).transform);
					}
				}
				catch (Exception ex)
				{
					Plugin.Log.LogWarning((object)("Effets : " + ex.Message));
				}
			}
			Toggle(hearts);
			Toggle(trails);
		}

		private static void Clean(Dictionary<PlayerAvatar, ParticleSystem> d)
		{
			List<PlayerAvatar> list = new List<PlayerAvatar>();
			foreach (KeyValuePair<PlayerAvatar, ParticleSystem> item in d)
			{
				if ((Object)(object)item.Key == (Object)null || (Object)(object)item.Value == (Object)null || !IsSpecial(item.Key))
				{
					list.Add(item.Key);
				}
			}
			foreach (PlayerAvatar item2 in list)
			{
				if ((Object)(object)d[item2] != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)d[item2]).gameObject);
				}
				d.Remove(item2);
			}
		}

		private static void Toggle(Dictionary<PlayerAvatar, ParticleSystem> d)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<PlayerAvatar, ParticleSystem> item in d)
			{
				bool enabled = !item.Key.isDisabled && (Object)(object)item.Key.playerAvatarVisuals != (Object)null && ((Component)item.Key.playerAvatarVisuals).gameObject.activeInHierarchy;
				EmissionModule emission = item.Value.emission;
				((EmissionModule)(ref emission)).enabled = enabled;
			}
		}

		private static ParticleSystem BuildTrail(Transform follow)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_002d: 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_004c: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00d5: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01ab: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: 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)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0289: Expected O, but got Unknown
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("TrioMod Trace");
			val.transform.SetParent(follow, false);
			val.transform.localPosition = new Vector3(0f, 0.03f, 0f);
			ParticleSystem val2 = val.AddComponent<ParticleSystem>();
			val2.Stop(true, (ParticleSystemStopBehavior)0);
			MainModule main = val2.main;
			((MainModule)(ref main)).loop = true;
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			((MainModule)(ref main)).startLifetime = new MinMaxCurve(3.5f, 4.5f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f);
			((MainModule)(ref main)).startSize = new MinMaxCurve(0.12f, 0.2f);
			((MainModule)(ref main)).startRotation = new MinMaxCurve(-0.5f, 0.5f);
			((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.3f, 0.6f), new Color(1f, 0.55f, 0.8f));
			((MainModule)(ref main)).maxParticles = 120;
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).rateOverDistance = MinMaxCurve.op_Implicit(2.5f);
			ShapeModule shape = val2.shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10;
			((ShapeModule)(ref shape)).radius = 0.15f;
			((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 0f);
			ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(Color.white, 0f),
				new GradientColorKey(Color.white, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[4]
			{
				new GradientAlphaKey(0f, 0f),
				new GradientAlphaKey(0.9f, 0.05f),
				new GradientAlphaKey(0.8f, 0.6f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3);
			SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[4]
			{
				new Keyframe(0f, 0.3f),
				new Keyframe(0.08f, 1.15f),
				new Keyframe(0.15f, 1f),
				new Keyframe(1f, 0.6f)
			}));
			ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>();
			component.renderMode = (ParticleSystemRenderMode)2;
			((Renderer)component).shadowCastingMode = (ShadowCastingMode)0;
			((Renderer)component).sharedMaterial = HeartMat();
			val2.Play();
			return val2;
		}

		private static Material HeartMat()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			if ((Object)(object)heartMat == (Object)null)
			{
				heartMat = new Material(Shader.Find("Sprites/Default") ?? Shader.Find("Particles/Standard Unlit") ?? Shader.Find("Unlit/Transparent"))
				{
					mainTexture = (Texture)(object)HeartTexture(),
					color = Color.white
				};
			}
			return heartMat;
		}

		private static ParticleSystem BuildHearts(Transform follow)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_002d: 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_004c: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unkno