Decompiled source of Ratpack v1.12.1

CodyGunCards.Presentation.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("1.11.0.0")]
[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 CodyGunCards.Presentation
{
	public static class Visuals
	{
		private struct Pt
		{
			public float x;

			public float y;

			public Pt(float a, float b)
			{
				x = a;
				y = b;
			}

			public static Pt operator +(Pt a, Pt b)
			{
				return new Pt(a.x + b.x, a.y + b.y);
			}

			public static Pt operator -(Pt a, Pt b)
			{
				return new Pt(a.x - b.x, a.y - b.y);
			}

			public static Pt operator *(Pt a, float s)
			{
				return new Pt(a.x * s, a.y * s);
			}
		}

		private class Part
		{
			public object sr;

			public object tr;

			public int frame;
		}

		private class Hit
		{
			public float until;

			public int streak;

			public int dir;
		}

		private class ObjFx
		{
			public int pid;

			public int id;

			public float until;
		}

		private class Flash
		{
			public Pt at;

			public float start;

			public int color;

			public bool portal;
		}

		private class Bolt
		{
			public object go;

			public float until;

			public bool pie;

			public Pt last;
		}

		private const BindingFlags BF = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		private static Dictionary<string, Type> types = new Dictionary<string, Type>();

		private static Dictionary<string, MemberInfo> members = new Dictionary<string, MemberInfo>();

		private static Dictionary<string, MethodInfo> methods = new Dictionary<string, MethodInfo>();

		private static object White = null;

		private static Dictionary<string, Part> parts = new Dictionary<string, Part>();

		private static int frame;

		private static float nextTick;

		private static HashSet<string> warned = new HashSet<string>();

		private static float epoch;

		private static bool battling;

		private static float musicScan;

		private static object music;

		private static object clip;

		private static Dictionary<object, bool> muted = new Dictionary<object, bool>();

		private static bool doorWindow;

		private static bool doorBattleSeen;

		private static Dictionary<int, Hit> hits = new Dictionary<int, Hit>();

		private static Dictionary<long, ObjFx> objects = new Dictionary<long, ObjFx>();

		private static List<Flash> flashes = new List<Flash>();

		private static List<Bolt> bolts = new List<Bolt>();

		private static object ottoClip;

		private static object ottoSource;

		private static bool ottoLoaded;

		private static readonly Dictionary<object, float> reloads = new Dictionary<object, float>();

		private static readonly Dictionary<object, bool> reloadKeys = new Dictionary<object, bool>();

		private static object reloadPermit;

		private static bool ammoInstalled;

		private static bool rideWasPlaying;

		private static float Time => F(G(T("UnityEngine.Time"), "time"));

		private static Type T(string n)
		{
			if (types.TryGetValue(n, out var value))
			{
				return value;
			}
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			for (int i = 0; i < assemblies.Length; i++)
			{
				if ((value = assemblies[i].GetType(n)) != null)
				{
					return types[n] = value;
				}
			}
			throw new TypeLoadException(n);
		}

		private static Type X(string n)
		{
			return T("CodyGunCards.Extras." + n);
		}

		private static Type R(string n)
		{
			return T("CodyGunCards.Runtime." + n);
		}

		private static MemberInfo Member(object o, string n)
		{
			Type type = (o as Type) ?? o.GetType();
			string text = type.FullName + "/" + n;
			if (members.TryGetValue(text, out var value))
			{
				return value;
			}
			while (type != null)
			{
				value = (MemberInfo)(((object)type.GetField(n, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) ?? ((object)type.GetProperty(n, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)));
				if (value != null)
				{
					return members[text] = value;
				}
				type = type.BaseType;
			}
			throw new MissingMemberException(text);
		}

		private static object G(object o, string n)
		{
			if (o == null)
			{
				return null;
			}
			MemberInfo memberInfo = Member(o, n);
			if (!(memberInfo is FieldInfo))
			{
				return ((PropertyInfo)memberInfo).GetValue((o is Type) ? null : o, null);
			}
			return ((FieldInfo)memberInfo).GetValue((o is Type) ? null : o);
		}

		private static void S(object o, string n, object v)
		{
			MemberInfo memberInfo = Member(o, n);
			if (memberInfo is FieldInfo)
			{
				((FieldInfo)memberInfo).SetValue((o is Type) ? null : o, v);
			}
			else
			{
				((PropertyInfo)memberInfo).SetValue((o is Type) ? null : o, v, null);
			}
		}

		private static object C(object o, string n, params object[] a)
		{
			Type type = (o as Type) ?? o.GetType();
			string text = type.FullName + "/" + n + "/" + string.Join(",", a.Select((object x) => (x != null) ? x.GetType().FullName : "null").ToArray());
			if (!methods.TryGetValue(text, out var value))
			{
				Type type2 = type;
				while (type2 != null && value == null)
				{
					MethodInfo[] array = type2.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
					foreach (MethodInfo methodInfo in array)
					{
						if (!(methodInfo.Name != n) && !methodInfo.ContainsGenericParameters)
						{
							ParameterInfo[] parameters = methodInfo.GetParameters();
							if (parameters.Length == a.Length && !parameters.Where((ParameterInfo v, int i) => a[i] != null && !v.ParameterType.IsInstanceOfType(a[i])).Any())
							{
								value = methodInfo;
								break;
							}
						}
					}
					type2 = type2.BaseType;
				}
				if (value == null)
				{
					throw new MissingMethodException(text);
				}
				methods[text] = value;
			}
			return value.Invoke((o is Type) ? null : o, a);
		}

		private static float F(object v)
		{
			if (v != null)
			{
				return Convert.ToSingle(v);
			}
			return 0f;
		}

		private static int I(object v)
		{
			if (v != null)
			{
				return Convert.ToInt32(v);
			}
			return 0;
		}

		private static bool B(object v)
		{
			if (v is bool)
			{
				return (bool)v;
			}
			return false;
		}

		private static IEnumerable<object> Each(object o)
		{
			if (o != null)
			{
				return ((IEnumerable)o).Cast<object>();
			}
			return Enumerable.Empty<object>();
		}

		private static bool Live(object o)
		{
			if (o != null)
			{
				return B(C(T("UnityEngine.Object"), "op_Implicit", o));
			}
			return false;
		}

		private static object V2(float x, float y)
		{
			return Activator.CreateInstance(T("UnityEngine.Vector2"), x, y);
		}

		private static object V3(float x, float y, float z = 0f)
		{
			return Activator.CreateInstance(T("UnityEngine.Vector3"), x, y, z);
		}

		private static object Col(float r, float g, float b, float a = 1f)
		{
			return Activator.CreateInstance(T("UnityEngine.Color"), r, g, b, a);
		}

		private static float Sin(float x)
		{
			return (float)Math.Sin(x);
		}

		private static float Cos(float x)
		{
			return (float)Math.Cos(x);
		}

		private static float Clamp(float x, float a = 0f, float b = 1f)
		{
			return Math.Max(a, Math.Min(b, x));
		}

		private static object Color(int i, float a = 1f)
		{
			return (i % 4) switch
			{
				0 => Col(1f, 0.27f, 0.66f, a), 
				1 => Col(0.24f, 0.93f, 1f, a), 
				2 => Col(1f, 0.81f, 0.24f, a), 
				_ => Col(0.62f, 0.38f, 1f, a), 
			};
		}

		private static Pt Pos(object o)
		{
			object o2 = G(G(o, "transform"), "position");
			return new Pt(F(G(o2, "x")), F(G(o2, "y")));
		}

		private static Pt P(object v)
		{
			return new Pt(F(G(v, "x")), F(G(v, "y")));
		}

		private static void Safe(string n, Action f)
		{
			try
			{
				f();
			}
			catch (Exception ex)
			{
				if (warned.Add(n))
				{
					C(T("CodyGunCards.Plugin"), "Warn", "Presentation " + n + ": " + (ex.InnerException ?? ex).Message);
				}
			}
		}

		private static object Shape(string key, string shape, Pt at, float w, float h, object color, int z = 15, float angle = 0f)
		{
			if (!parts.TryGetValue(key, out var value) || !Live(value.sr))
			{
				value = new Part();
				value.sr = C(R("Fx"), "MakeSprite", "CGC_VFX_" + key, G(R("Fx"), shape), color, z);
				value.tr = G(value.sr, "transform");
				parts[key] = value;
			}
			value.frame = frame;
			S(value.sr, "enabled", true);
			S(value.sr, "color", color);
			S(value.tr, "position", V3(at.x, at.y));
			S(value.tr, "localScale", V3(w, h, 1f));
			S(value.tr, "rotation", C(T("UnityEngine.Quaternion"), "Euler", 0f, 0f, angle));
			return value.sr;
		}

		private static void Dot(string k, Pt p, float s, object c, int z = 15)
		{
			Shape(k, "Disc", p, s, s, c, z);
		}

		private static void Line(string k, Pt a, Pt b, float w, object c, int z = 15)
		{
			Pt pt = b - a;
			Shape(k, "Pixel", (a + b) * 0.5f, (float)Math.Sqrt(pt.x * pt.x + pt.y * pt.y), w, c, z, (float)(Math.Atan2(pt.y, pt.x) * 180.0 / Math.PI));
		}

		private static void Ring(string k, Pt p, float s, object c, int z = 14)
		{
			Shape(k, "Ring", p, s, s, c, z);
		}

		private static void Star(string k, Pt p, float s, object c, int z = 18)
		{
			Line(k + "x", p + new Pt(0f - s, 0f), p + new Pt(s, 0f), s * 0.24f, c, z);
			Line(k + "y", p + new Pt(0f, 0f - s), p + new Pt(0f, s), s * 0.24f, c, z);
		}

		private static void Arc(string k, Pt p, float r, float from, float length, object c, float width = 0.045f, int count = 12)
		{
			for (int i = 0; i < count; i++)
			{
				float x = from + length * (float)i / (float)count;
				float x2 = from + length * (float)(i + 1) / (float)count;
				Line(k + i, p + new Pt(Cos(x), Sin(x)) * r, p + new Pt(Cos(x2), Sin(x2)) * r, width, c);
			}
		}

		private static void Eyes(string k, Pt p, float s, float face = 1f)
		{
			for (int i = 0; i < 2; i++)
			{
				Pt pt = p + new Pt(((i == 0) ? (-0.16f) : 0.16f) * s, 0.08f * s);
				Dot(k + "w" + i, pt, 0.23f * s, Col(1f, 1f, 0.96f), 24);
				Dot(k + "p" + i, pt + new Pt(0.04f * face * s, 0f), 0.1f * s, Col(0.07f, 0.055f, 0.1f), 25);
			}
		}

		private static void HideOld(string p)
		{
			C(X("Pen"), "Off", p);
		}

		private static object State(string type, string field, int id)
		{
			if (!(G(X(type), field) is IDictionary dictionary) || !dictionary.Contains(id))
			{
				return null;
			}
			return dictionary[id];
		}

		private static bool Has(object p, long flag)
		{
			return B(C(R("Loadout"), "Has", p, Enum.ToObject(T("CodyGunCards.Core.Weapon"), flag)));
		}

		public static void Prepare()
		{
			Safe("audio preload", delegate
			{
				if (clip != null)
				{
					return;
				}
				using Stream stream = typeof(Visuals).Assembly.GetManifestResourceStream("CodyGunCards.Presentation.NeonSteps.pcm");
				if (stream == null)
				{
					throw new FileNotFoundException("NeonSteps.pcm");
				}
				BinaryReader binaryReader = new BinaryReader(stream);
				float[] array = new float[stream.Length / 2];
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = (float)binaryReader.ReadInt16() / 32768f;
				}
				clip = C(T("UnityEngine.AudioClip"), "Create", "Neon Steps - 133.333 BPM", array.Length / 2, 2, 22050, false);
				C(clip, "SetData", array, 0);
			});
		}

		public static float NextSpawn(float now)
		{
			return epoch + (float)(Math.Floor((double)(now - epoch) / 0.9) + 1.0) * 0.9f;
		}

		public static float Arrival(float now)
		{
			return epoch + (float)Math.Round((double)(now - epoch) / 0.9) * 0.9f + 1.8f;
		}

		public static void Reset()
		{
			EndDoors();
			Safe("reload reset", ClearReloads);
			ResetRide();
			foreach (Part value in parts.Values)
			{
				if (Live(value.sr))
				{
					C(T("UnityEngine.Object"), "Destroy", G(value.sr, "gameObject"));
				}
			}
			parts.Clear();
			hits.Clear();
			objects.Clear();
			flashes.Clear();
			bolts.Clear();
			StopMusic();
			OttoAudio(active: false);
			battling = false;
			nextTick = 0f;
		}

		private static void StopMusic()
		{
			if (Live(music))
			{
				C(music, "Stop");
			}
			foreach (KeyValuePair<object, bool> item in muted)
			{
				if (Live(item.Key))
				{
					S(item.Key, "mute", item.Value);
				}
			}
			muted.Clear();
		}

		private static bool MusicSource(object s)
		{
			if (s == music || s == ottoSource)
			{
				return false;
			}
			string text = "";
			object o = G(s, "transform");
			int num = 0;
			while (num < 7 && Live(o))
			{
				text = text + " " + G(o, "name");
				num++;
				o = G(o, "parent");
			}
			object o2 = G(s, "outputAudioMixerGroup");
			if (Live(o2))
			{
				text = text + " " + G(o2, "name");
			}
			object o3 = G(s, "clip");
			if (Live(o3))
			{
				text = text + " " + G(o3, "name");
			}
			text = text.ToLowerInvariant();
			if (!text.Contains("music") && !text.Contains("soundtrack"))
			{
				return text.Contains("bgm");
			}
			return true;
		}

		private static void Music(bool active, float now)
		{
			if (!active)
			{
				if (muted.Count > 0 || (Live(music) && B(G(music, "isPlaying"))))
				{
					StopMusic();
				}
				return;
			}
			if (!Live(clip))
			{
				Prepare();
			}
			if (!Live(clip))
			{
				return;
			}
			if (!Live(music))
			{
				object obj = Activator.CreateInstance(T("UnityEngine.GameObject"), "CGC_NeonSteps");
				music = C(obj, "AddComponent", T("UnityEngine.AudioSource"));
				C(T("UnityEngine.Object"), "DontDestroyOnLoad", obj);
				S(music, "clip", clip);
				S(music, "loop", true);
				S(music, "playOnAwake", false);
				S(music, "spatialBlend", 0f);
				S(music, "volume", 0.65f);
			}
			if (now >= musicScan)
			{
				musicScan = now + 0.5f;
				foreach (object item in Each(C(T("UnityEngine.Object"), "FindObjectsOfType", T("UnityEngine.AudioSource"))))
				{
					if (Live(item) && MusicSource(item))
					{
						if (!muted.ContainsKey(item))
						{
							muted[item] = B(G(item, "mute"));
						}
						S(item, "mute", true);
						object obj2 = G(item, "outputAudioMixerGroup");
						if (Live(obj2))
						{
							S(music, "outputAudioMixerGroup", obj2);
						}
					}
				}
			}
			float num = F(G(T("UnityEngine.Time"), "timeScale"));
			S(music, "pitch", num);
			float num2 = (now - epoch) % 28.8f;
			if (num2 < 0f)
			{
				num2 += 28.8f;
			}
			if (!B(G(music, "isPlaying")))
			{
				S(music, "time", num2);
				C(music, "Play");
			}
			else if (Math.Abs(F(G(music, "time")) - num2) > 0.06f)
			{
				S(music, "time", num2);
			}
		}

		public static bool CanUseDoors()
		{
			object obj = G(T("GameManager"), "instance");
			if (doorWindow && obj != null && B(G(obj, "isPlaying")))
			{
				return B(G(obj, "battleOngoing"));
			}
			return false;
		}

		public static void EndDoors()
		{
			doorWindow = false;
			doorBattleSeen = false;
			Safe("portal data cleanup", delegate
			{
				string[] array = new string[3] { "Doors", "Travelled", "Stepped" };
				foreach (string n in array)
				{
					if (G(X("Spells"), n) is IDictionary dictionary)
					{
						dictionary.Clear();
					}
				}
			});
			Safe("portal sprite cleanup", delegate
			{
				string[] array = parts.Keys.Where((string k) => k.StartsWith("portal", StringComparison.Ordinal)).ToArray();
				foreach (string key in array)
				{
					Part part = parts[key];
					if (Live(part.sr))
					{
						S(part.sr, "enabled", false);
						C(T("UnityEngine.Object"), "Destroy", G(part.sr, "gameObject"));
					}
					parts.Remove(key);
				}
				flashes.RemoveAll((Flash f) => f.portal);
				if (G(X("Pen"), "Sprites") is IDictionary dictionary)
				{
					array = (from string k in dictionary.Keys
						where k.StartsWith("door", StringComparison.Ordinal)
						select k).ToArray();
					foreach (string key2 in array)
					{
						object o = dictionary[key2];
						if (Live(o))
						{
							S(o, "enabled", false);
							C(T("UnityEngine.Object"), "Destroy", G(o, "gameObject"));
						}
						dictionary.Remove(key2);
					}
				}
			});
		}

		public static IEnumerator EndDoorsHook(object ignored)
		{
			EndDoors();
			ResetRide();
			return new object[0].GetEnumerator();
		}

		public static IEnumerator BeginDoorsHook(object ignored)
		{
			EndDoors();
			doorWindow = true;
			return new object[0].GetEnumerator();
		}

		public static void DoorLifecycleTick()
		{
			Safe("portal lifecycle", delegate
			{
				if (CanUseDoors())
				{
					doorBattleSeen = true;
				}
				else if (!doorWindow || doorBattleSeen)
				{
					IDictionary dictionary = G(X("Spells"), "Doors") as IDictionary;
					if (doorWindow || (dictionary != null && dictionary.Count > 0) || parts.Keys.Any((string k) => k.StartsWith("portal", StringComparison.Ordinal)))
					{
						EndDoors();
					}
				}
			});
		}

		public static bool InBattle()
		{
			object obj = G(T("GameManager"), "instance");
			if (obj != null && B(G(obj, "isPlaying")))
			{
				return B(G(obj, "battleOngoing"));
			}
			return false;
		}

		public static void BeginFrame()
		{
			DoorLifecycleTick();
			GameplayTick();
			Safe("battle clock", delegate
			{
				if (Live(music))
				{
					S(music, "pitch", F(G(T("UnityEngine.Time"), "timeScale")));
				}
				if (InBattle() && !battling)
				{
					battling = true;
					epoch = Time;
					musicScan = 0f;
				}
			});
		}

		public static void Tick()
		{
			Safe("frame", delegate
			{
				float now = Time;
				if (!InBattle())
				{
					if (battling)
					{
						Reset();
					}
				}
				else
				{
					if (!battling)
					{
						battling = true;
						epoch = now;
						musicScan = 0f;
					}
					if (!(now < nextTick))
					{
						nextTick = now + 1f / 30f;
						frame++;
						White = Col(1f, 1f, 1f);
						bool dance = false;
						foreach (object p in Each(G(G(T("PlayerManager"), "instance"), "players")))
						{
							if (Live(p))
							{
								bool num = B(C(R("Util"), "Alive", p));
								if (Has(p, 268435456L))
								{
									dance = true;
								}
								if (num)
								{
									Safe("player", delegate
									{
										Player(p, now);
									});
								}
							}
						}
						Safe("doors", delegate
						{
							IDictionary dictionary = (IDictionary)G(X("Spells"), "Doors");
							if (CanUseDoors())
							{
								foreach (DictionaryEntry item in dictionary)
								{
									Door("portal" + item.Key?.ToString() + "a/", G(item.Value, "A"), Color(3), now);
									Door("portal" + item.Key?.ToString() + "b/", G(item.Value, "B"), Color(1), now);
								}
							}
						});
						Safe("disco", delegate
						{
							Discos(now);
						});
						Safe("slot machine", delegate
						{
							Slots(now);
						});
						Safe("objects", delegate
						{
							Objects(now);
						});
						Safe("projectile effects", delegate
						{
							Projectiles(now);
						});
						Safe("music", delegate
						{
							Music(dance, now);
						});
						foreach (Part value in parts.Values)
						{
							if (value.frame != frame && Live(value.sr))
							{
								S(value.sr, "enabled", false);
							}
						}
						if (frame % 60 == 0)
						{
							string[] array = parts.Keys.ToArray();
							foreach (string key in array)
							{
								Part part = parts[key];
								if (frame - part.frame > 120)
								{
									if (Live(part.sr))
									{
										C(T("UnityEngine.Object"), "Destroy", G(part.sr, "gameObject"));
									}
									parts.Remove(key);
								}
							}
						}
					}
				}
			});
		}

		public static void Door(string key, object at, object color, float time)
		{
			Safe("portal", delegate
			{
				Pt pt = P(at);
				object c = Col(F(G(color, "r")), F(G(color, "g")), F(G(color, "b")), 0.8f);
				Shape(key + "glow", "Glow", pt, 2.1f, 3.2f, Col(0.45f, 0.2f, 1f, 0.22f), 4);
				Dot(key + "arch", pt + new Pt(0f, 0.48f), 1.35f, Col(0.005f, 0.004f, 0.013f), 6);
				Shape(key + "body", "Pixel", pt + new Pt(0f, -0.4f), 1.35f, 1.78f, Col(0.005f, 0.004f, 0.013f), 6);
				Arc(key + "rim", pt + new Pt(0f, 0.48f), 0.69f, 0f, (float)Math.PI, c, 0.035f, 16);
				Line(key + "left", pt + new Pt(-0.69f, 0.48f), pt + new Pt(-0.69f, -1.29f), 0.035f, c, 7);
				Line(key + "right", pt + new Pt(0.69f, 0.48f), pt + new Pt(0.69f, -1.29f), 0.035f, c, 7);
				for (int i = 0; i < 10; i++)
				{
					float num = (time * 0.75f + (float)i * 0.137f) % 1f;
					float num2 = Sin((float)i * 73f) * 0.55f;
					Pt p = pt + new Pt(num2 * (1f - num), -1.02f + num * 2.05f);
					Star(key + "spark" + i, p, 0.02f + 0.05f * Sin(num * (float)Math.PI), Col(0.65f + 0.35f * num, 0.5f + 0.5f * num, 1f, Sin(num * (float)Math.PI)), 8);
				}
			});
		}

		private static void Sheep(object p, Pt at, float s, float t, string k)
		{
			HideOld("sheep" + I(G(p, "playerID")) + "_");
			Pt pt = P(C(R("Motion"), "Velocity", p));
			float num = ((!(pt.x < -0.1f)) ? 1 : (-1));
			float num2 = Sin(t * (6f + Math.Min(18f, Math.Abs(pt.x) * 2f)));
			Shape(k + "shadow", "Glow", at + new Pt(0f, -0.56f * s), 1.6f * s, 0.38f * s, Col(0.08f, 0.06f, 0.12f, 0.4f), 10);
			for (int i = 0; i < 4; i++)
			{
				float num3 = ((float)i * 0.27f - 0.43f) * s;
				float num4 = ((i % 2 == 0) ? num2 : (0f - num2)) * 0.07f * s;
				Line(k + "leg" + i, at + new Pt(num3, -0.2f * s), at + new Pt(num3 + num4, -0.63f * s), 0.15f * s, Col(0.19f, 0.17f, 0.23f), 17);
				Dot(k + "hoof" + i, at + new Pt(num3 + num4, -0.63f * s), 0.2f * s, Col(0.07f, 0.06f, 0.1f), 18);
			}
			for (int j = 0; j < 9; j++)
			{
				float x = (float)j * 6.283185f / 9f;
				Pt pt2 = at + new Pt(Cos(x) * 0.44f * s, Sin(x) * 0.31f * s);
				Dot(k + "woolshadow" + j, pt2, 0.54f * s, Col(0.69f, 0.7f, 0.77f), 19);
				Dot(k + "wool" + j, pt2 + new Pt(-0.025f, 0.045f) * s, 0.47f * s, Col(0.98f, 0.97f, 0.9f), 20);
			}
			Shape(k + "body", "Disc", at, 1.08f * s, 0.84f * s, Col(0.98f, 0.97f, 0.9f), 20);
			Pt pt3 = at + new Pt(0.56f * num, 0.12f) * s;
			Shape(k + "head", "Disc", pt3, 0.48f * s, 0.63f * s, Col(0.19f, 0.17f, 0.23f), 21, (0f - num) * 12f);
			Shape(k + "ear", "Disc", pt3 + new Pt(-0.19f * num, 0.21f) * s, 0.42f * s, 0.15f * s, Col(0.19f, 0.17f, 0.23f), 22, num * 25f);
			Eyes(k, pt3, 0.75f * s, num);
			Line(k + "brow", pt3 + new Pt(-0.21f, 0.23f) * s, pt3 + new Pt(0.14f, 0.16f) * s, 0.06f * s, Col(0.08f, 0.06f, 0.12f), 26);
			for (int l = 0; l < 3; l++)
			{
				Dot(k + "tuft" + l, pt3 + new Pt((float)(l - 1) * 0.15f, 0.31f) * s, 0.23f * s, Col(1f, 0.99f, 0.94f), 23);
			}
		}

		private static void Player(object p, float t)
		{
			ReloadIndicator(p, t);
			int id = I(G(p, "playerID"));
			string text = "p" + id + "/";
			Pt pt = Pos(p);
			float num = Clamp(F(C(X("Wild"), "SizeOf", p)), 0.5f, 3f);
			object obj = State("Spells", "Minds", id);
			if (obj != null && F(G(obj, "SheepUntil")) > t)
			{
				Sheep(p, pt, num, t, text + "sheep/");
			}
			if (obj != null && F(G(obj, "DanceUntil")) > t)
			{
				HideOld("note" + id + "_");
				for (int i = 0; i < 3; i++)
				{
					float x = t * 2f + (float)i * 2.1f;
					Pt p2 = pt + new Pt(Cos(x) * num, (1.2f + 0.15f * Sin(t * 8f + (float)i)) * num);
					Note(text + "note" + i, p2, 0.23f, Color(i));
				}
			}
			if (B(C(X("Images"), "IsImage", p)))
			{
				Mirror(text, pt, num, t, id);
			}
			object obj2 = State("Wild", "States", id);
			if (obj2 != null)
			{
				Wild(p, obj2, text + "wild/", pt, num, t);
			}
			object obj3 = State("Boosts", "States", id);
			if (obj3 != null)
			{
				Boost(p, obj3, text, pt, num, t);
			}
			object obj4 = State("Dance", "States", id);
			if (obj4 != null && Has(p, 268435456L) && B(C(R("Util"), "IsMine", p)))
			{
				Dance(p, obj4, text + "dance/", pt, num, t);
			}
			object obj5 = Each(G(X("Slip"), "Live")).FirstOrDefault((object d) => G(d, "P") == p);
			if (obj5 != null && F(G(obj5, "Until")) > t)
			{
				Wind(text + "slip/", pt, P(G(obj5, "Dir")), num, t);
			}
		}

		private static void Note(string k, Pt p, float s, object c)
		{
			Shape(k + "dot", "Disc", p, s * 1.1f, s * 0.75f, c, 22, -20f);
			Line(k + "stem", p + new Pt(s * 0.4f, 0f), p + new Pt(s * 0.4f, s * 1.8f), s * 0.18f, c, 22);
			Line(k + "flag", p + new Pt(s * 0.4f, s * 1.8f), p + new Pt(s * 1.1f, s * 1.35f), s * 0.25f, c, 22);
		}

		private static void Mirror(string k, Pt p, float s, float t, int id)
		{
			for (int i = 0; i < 4; i++)
			{
				float x = t * 0.9f + (float)i * 1.5708f + (float)id;
				Pt p2 = p + new Pt(Cos(x), Sin(x)) * s * 0.85f;
				Star(k + "shard" + i, p2, 0.1f * s, Col(0.6f, 0.8f, 1f, 0.35f + 0.25f * Sin(t * 5f + (float)i)));
			}
			Shape(k + "scan", "Pixel", p + new Pt(0f, Sin(t * 2.8f) * s * 0.55f), 1.05f * s, 0.035f, Col(0.6f, 1f, 1f, 0.55f), 20);
		}

		private static void Wind(string k, Pt p, Pt dir, float s, float t)
		{
			float num = (float)Math.Sqrt(dir.x * dir.x + dir.y * dir.y);
			if (num < 0.01f)
			{
				dir = new Pt(1f, 0f);
			}
			else
			{
				dir *= 1f / num;
			}
			Pt pt = new Pt(0f - dir.y, dir.x);
			for (int i = 0; i < 3; i++)
			{
				float num2 = (float)(i - 1) * 0.42f * s;
				for (int j = 0; j < 5; j++)
				{
					float num3 = (float)j * 0.46f;
					Pt a = p - dir * (num3 + 0.2f) + pt * (num2 + Sin(t * 15f + (float)j * 0.7f + (float)i) * 0.065f);
					Pt b = p - dir * (num3 + 0.64f) + pt * (num2 + Sin(t * 15f + (float)(j + 1) * 0.7f + (float)i) * 0.065f);
					Line(k + i + "/" + j, a, b, (0.065f - 0.008f * (float)j) * s, Col(0.42f, 0.9f, 1f, 0.65f - (float)j * 0.1f), 12);
				}
			}
		}

		private static void Boost(object p, object b, string k, Pt at, float s, float t)
		{
			int num = I(G(b, "Level"));
			float num2 = F(G(b, "Charge"));
			if (num > 0 || num2 > 0f)
			{
				float num3 = Clamp(((float)num + num2) / 5f);
				for (int i = 0; i < 10; i++)
				{
					float x = 2.7f - (float)i * 0.24f;
					Pt pt = new Pt(Cos(x), Sin(x));
					Line(k + "rpm" + i, at + pt * 1f * s, at + pt * 1.12f * s, 0.07f * s, ((float)i < num3 * 10f) ? Col(1f, 0.6f * (1f - num3), 0.16f, 0.9f) : Col(0.25f, 0.18f, 0.2f, 0.35f), 14);
				}
				Pt pt2 = P(C(R("Motion"), "Velocity", p));
				float num4 = (float)Math.Sqrt(pt2.x * pt2.x + pt2.y * pt2.y);
				if (num4 > 2f)
				{
					Pt pt3 = pt2 * (1f / num4);
					Pt pt4 = new Pt(0f - pt3.y, pt3.x);
					for (int j = 0; j < 3; j++)
					{
						Line(k + "redtrail" + j, at - pt3 * 0.6f + pt4 * ((float)(j - 1) * 0.2f), at - pt3 * (1f + num3 * 2f) + pt4 * ((float)(j - 1) * 0.25f), 0.06f, Col(1f, 0.3f + 0.35f * (1f - num3), 0.12f, num3 * 0.6f), 10);
					}
				}
			}
			float num5 = t - F(G(b, "BouncedAt"));
			if (num5 >= 0f && num5 < 0.5f)
			{
				Ring(k + "bounce", at, (1f + num5 * 4f) * s, Col(0.45f, 1f, 0.5f, (1f - num5 * 2f) * 0.6f));
				for (int l = 0; l < 4; l++)
				{
					float x2 = (float)l * 1.5708f + 0.5f;
					Star(k + "spring" + l, at + new Pt(Cos(x2), Sin(x2)) * (0.7f + num5 * 3f) * s, 0.12f * (1f - num5 * 2f), Col(0.65f, 1f, 0.6f));
				}
			}
			if (F(G(b, "RubberUntil")) > t)
			{
				Arc(k + "elastic", at, 1f * s, t * 4f, 2.5f, Col(0.5f, 1f, 0.65f, 0.5f));
			}
		}

		public static void Feedback(int pid, int streak, float heal, int dir)
		{
			hits[pid] = new Hit
			{
				until = Time + 0.6f,
				streak = streak,
				dir = dir
			};
		}

		private static void Arrow(string k, Pt p, int d, float s, object c, bool target)
		{
			Pt pt = d switch
			{
				1 => new Pt(0f, 1f), 
				0 => new Pt(-1f, 0f), 
				_ => new Pt(1f, 0f), 
			};
			Pt pt2 = new Pt(0f - pt.y, pt.x);
			Pt pt3 = p + pt * (0.26f * s);
			Line(k + "stem", p - pt * (0.28f * s), pt3, (target ? 0.055f : 0.12f) * s, c, 22);
			Line(k + "a", pt3, pt3 - pt * (0.26f * s) + pt2 * (0.25f * s), (target ? 0.055f : 0.12f) * s, c, 22);
			Line(k + "b", pt3, pt3 - pt * (0.26f * s) - pt2 * (0.25f * s), (target ? 0.055f : 0.12f) * s, c, 22);
		}

		private static void Dance(object p, object st, string k, Pt at, float s, float t)
		{
			s = Clamp(s, 0.65f, 1.6f);
			Pt pt = at + new Pt(0f, 1.65f * s);
			float num = (B(C(R("Controls"), "CrouchHeld", p)) ? 1f : 0.48f);
			float num2 = (t - epoch) / 0.45f;
			float num3 = (float)Math.Pow(1f - (num2 - (float)Math.Floor(num2)), 4.0);
			Shape(k + "panel", "Pixel", pt + new Pt(0f, 0.88f * s), 2.65f * s, 2.48f * s, Col(0.025f, 0.035f, 0.09f, 0.58f * num), 11);
			for (int i = 0; i < 3; i++)
			{
				Pt pt2 = pt + new Pt((float)(i - 1) * 0.85f * s, 0f);
				Line(k + "lane" + i, pt2 + new Pt(-0.37f * s, -0.24f * s), pt2 + new Pt(-0.37f * s, 2.02f * s), 0.018f, Color(i, 0.3f * num), 12);
				Shape(k + "targetglow" + i, "Glow", pt2, 0.8f * s, 0.8f * s, Color(i, (0.18f + 0.18f * num3) * num), 13);
				Arrow(k + "target" + i, pt2, i, s, Color(i, 0.75f * num), target: true);
			}
			Line(k + "judge", pt + new Pt(-1.25f * s, 0f), pt + new Pt(1.25f * s, 0f), 0.023f, Col(1f, 1f, 1f, 0.24f * num), 14);
			int num4 = 0;
			foreach (object item in Each(G(st, "Arrows")))
			{
				foreach (object item2 in Each(G(item, "Parts")))
				{
					if (Live(item2))
					{
						S(item2, "enabled", false);
					}
				}
				int num5 = I(G(item, "Dir"));
				float num6 = (F(G(item, "Arrives")) - t) / 1.8f;
				Pt pt3 = pt + new Pt((float)(num5 - 1) * 0.85f * s, 1.92f * s * num6);
				float num7 = Clamp(1.15f - num6) * num;
				Shape(k + "noteGlow" + num4, "Glow", pt3, 0.67f * s, 0.67f * s, Color(num5, num7 * 0.3f), 18);
				Arrow(k + "note" + num4, pt3, num5, s, Color(num5, num7), target: false);
				num4++;
			}
			int num8 = I(G(st, "Streak"));
			for (int j = 0; j < 5; j++)
			{
				Dot(k + "combo" + j, pt + new Pt((float)(j - 2) * 0.23f * s, -0.34f * s), 0.09f * s, (j < num8) ? Color(j % 3, num) : Col(0.4f, 0.45f, 0.6f, 0.24f * num), 22);
			}
			if (!hits.TryGetValue(I(G(p, "playerID")), out var value) || !(t < value.until))
			{
				return;
			}
			float num9 = (value.until - t) / 0.6f;
			Pt pt4 = pt + new Pt((float)(value.dir - 1) * 0.85f * s, 0f);
			Ring(k + "hit", pt4, (0.7f + (1f - num9) * 0.8f) * s, (value.streak > 0) ? Col(1f, 1f, 1f, num9 * 0.8f) : Col(1f, 0.2f, 0.25f, num9));
			if (value.streak > 0)
			{
				for (int l = 0; l < 4; l++)
				{
					float x = (float)l * 1.5708f + 0.7f;
					Star(k + "hitstar" + l, pt4 + new Pt(Cos(x), Sin(x)) * (1f - num9) * s, 0.085f * num9, Color(value.dir, num9));
				}
			}
		}

		private static void Discos(float t)
		{
			int num = 0;
			bool active = false;
			foreach (object item in Each(G(X("Spells"), "Discos")))
			{
				if (!(F(G(item, "Until")) <= t))
				{
					active = true;
					HideOld("disco");
					DiscoSphere("discoV" + num++ + "/", P(G(item, "At")), t, F(G(item, "Radius")));
				}
			}
			Safe("Otto audio", delegate
			{
				OttoAudio(active);
			});
		}

		public static void Enchant(int pid, int id)
		{
			long key = ((long)pid << 32) | (uint)id;
			objects[key] = new ObjFx
			{
				pid = pid,
				id = id,
				until = Time + 13f
			};
		}

		public static void EndEnchant(int pid, int id)
		{
			objects.Remove(((long)pid << 32) | (uint)id);
		}

		private static void ObjectFace(string k, object obj, float t)
		{
			if (Live(obj))
			{
				Pt pt = Pos(obj);
				Eyes(k, pt, 0.9f);
				Line(k + "browL", pt + new Pt(-0.32f, 0.26f), pt + new Pt(-0.08f, 0.19f), 0.055f, Col(0.11f, 0.08f, 0.18f), 26);
				Line(k + "browR", pt + new Pt(0.32f, 0.26f), pt + new Pt(0.08f, 0.19f), 0.055f, Col(0.11f, 0.08f, 0.18f), 26);
				Arc(k + "spell", pt, 0.67f, t * 2f, 3.5f, Col(0.65f, 0.4f, 1f, 0.6f), 0.035f, 8);
				for (int i = 0; i < 2; i++)
				{
					float x = t * 2f + (float)i * 3.14159f;
					Star(k + "star" + i, pt + new Pt(Cos(x), Sin(x)) * 0.8f, 0.075f, Col(0.82f, 0.64f, 1f, 0.8f));
				}
			}
		}

		private static void Objects(float t)
		{
			KeyValuePair<long, ObjFx>[] array = objects.ToArray();
			for (int i = 0; i < array.Length; i++)
			{
				KeyValuePair<long, ObjFx> keyValuePair = array[i];
				ObjFx value = keyValuePair.Value;
				object obj = C(R("LaunchedBox"), "Find", value.pid, value.id);
				if (t > value.until || !Live(obj))
				{
					objects.Remove(keyValuePair.Key);
				}
				else
				{
					ObjectFace("object" + keyValuePair.Key + "/", obj, t);
				}
			}
			int num = 0;
			foreach (object item in Each(G(X("Spells"), "Things")))
			{
				if (I(G(item, "Id")) < 0)
				{
					ObjectFace("loose" + num++ + "/", G(item, "Loose"), t);
				}
			}
		}

		public static void SpellProjectile(object go)
		{
			Track(go, pie: false);
		}

		public static void PieProjectile(object go)
		{
			Track(go, pie: true);
		}

		private static void Track(object go, bool pie)
		{
			Safe("projectile", delegate
			{
				if (Live(go))
				{
					if (bolts.Count >= 64)
					{
						bolts.RemoveAt(0);
					}
					bolts.Add(new Bolt
					{
						go = go,
						until = Time + 8f,
						pie = pie,
						last = Pos(go)
					});
				}
			});
		}

		public static void SheepBurst(int pid, float duration)
		{
			Safe("transformation", delegate
			{
				object o = C(R("Util"), "PlayerById", pid);
				if (Live(o))
				{
					AddFlash(Pos(o), 3);
				}
			});
		}

		private static void AddFlash(Pt at, int c, bool portal = false)
		{
			if (flashes.Count >= 24)
			{
				flashes.RemoveAt(0);
			}
			flashes.Add(new Flash
			{
				at = at,
				start = Time,
				color = c,
				portal = portal
			});
		}

		public static void PortalBurst(float ax, float ay, float bx, float by)
		{
			if (CanUseDoors())
			{
				AddFlash(new Pt(ax, ay), 3, portal: true);
				AddFlash(new Pt(bx, by), 1, portal: true);
			}
		}

		private static void Projectiles(float t)
		{
			for (int num = bolts.Count - 1; num >= 0; num--)
			{
				Bolt bolt = bolts[num];
				if (!Live(bolt.go) || t > bolt.until)
				{
					bolts.RemoveAt(num);
				}
				else
				{
					Pt pt = Pos(bolt.go);
					string text = "bolt" + num + "/";
					if (bolt.pie)
					{
						Shape(text + "crust", "Disc", pt, 0.66f, 0.36f, Col(0.88f, 0.64f, 0.32f), 20);
						Shape(text + "cream", "Disc", pt + new Pt(0f, 0.05f), 0.58f, 0.25f, Col(1f, 0.97f, 0.86f), 21);
						Dot(text + "cherry", pt + new Pt(0f, 0.16f), 0.12f, Col(1f, 0.18f, 0.27f), 22);
					}
					else
					{
						Shape(text + "glow", "Glow", pt, 0.9f, 0.9f, Col(0.75f, 0.35f, 1f, 0.3f), 13);
						for (int i = 0; i < 3; i++)
						{
							float x = t * 9f + (float)i * 2.0944f;
							Star(text + "star" + i, pt + new Pt(Cos(x), Sin(x)) * 0.25f, 0.055f, Color(i, 0.8f));
						}
						Line(text + "trail", bolt.last, pt, 0.035f, Col(0.8f, 0.5f, 1f, 0.5f), 12);
					}
					bolt.last = pt;
				}
			}
			for (int num2 = flashes.Count - 1; num2 >= 0; num2--)
			{
				Flash flash = flashes[num2];
				float num3 = (t - flash.start) / 0.55f;
				if (num3 >= 1f)
				{
					flashes.RemoveAt(num2);
				}
				else
				{
					string text2 = (flash.portal ? "portalFlash" : "flash") + num2 + "/";
					Ring(text2 + "ring", flash.at, 0.4f + num3 * 2.3f, Color(flash.color, (1f - num3) * 0.7f));
					for (int j = 0; j < 8; j++)
					{
						float x2 = (float)j * 0.7854f;
						Star(text2 + j, flash.at + new Pt(Cos(x2), Sin(x2)) * (0.25f + num3 * 1.6f), 0.1f * (1f - num3), Color((j + flash.color) % 4, 1f - num3));
					}
				}
			}
			int num4 = 0;
			foreach (object item in Each(G(X("WildBlobs"), "Live")))
			{
				if (!B(G(item, "Bounce")))
				{
					continue;
				}
				Pt pt2 = P(G(item, "Pos"));
				float num5 = F(G(item, "Radius"));
				string text3 = "grocery" + num4 + "/";
				if (num4 % 3 == 0)
				{
					Dot(text3 + "apple", pt2, num5 * 2f, Col(0.9f, 0.2f, 0.15f), 18);
					Line(text3 + "stem", pt2 + new Pt(0f, num5 * 0.5f), pt2 + new Pt(0.05f, num5 * 1.3f), 0.04f, Col(0.4f, 0.25f, 0.12f), 19);
					Shape(text3 + "leaf", "Disc", pt2 + new Pt(num5 * 0.6f, num5), num5, num5 * 0.4f, Col(0.4f, 0.85f, 0.3f), 20, 25f);
				}
				else if (num4 % 3 == 1)
				{
					Shape(text3 + "milk", "Pixel", pt2, num5 * 1.6f, num5 * 2.3f, Col(0.92f, 0.98f, 1f), 18, Sin(t * 4f + (float)num4) * 12f);
					Shape(text3 + "label", "Pixel", pt2, num5 * 1.25f, num5 * 0.75f, Col(0.25f, 0.65f, 1f), 19);
				}
				else
				{
					Shape(text3 + "bread", "Disc", pt2, num5 * 2.4f, num5 * 1.5f, Col(0.9f, 0.66f, 0.32f), 18, 30f);
					for (int k = 0; k < 2; k++)
					{
						Line(text3 + "score" + k, pt2 + new Pt(((float)k - 0.5f) * num5, (0f - num5) * 0.3f), pt2 + new Pt(((float)k - 0.8f) * num5, num5 * 0.3f), 0.045f, Col(1f, 0.89f, 0.6f), 19);
					}
				}
				num4++;
			}
		}

		private static void Wild(object player, object st, string k, Pt p, float s, float t)
		{
			IDictionary dictionary = G(st, "Sprites") as IDictionary;
			float num = F(G(st, "Face"));
			if (num == 0f)
			{
				num = 1f;
			}
			Func<int, bool> func = (int i) => B(C(X("Wild"), "Has", st, i));
			if (func(2))
			{
				string[] array = new string[3] { "2_crownL", "2_crownM", "2_crownR" };
				foreach (string key in array)
				{
					if (dictionary != null && dictionary.Contains(key) && Live(dictionary[key]))
					{
						S(dictionary[key], "enabled", false);
					}
				}
				Pt pt = p + new Pt(0f, 1.02f * s);
				Line(k + "crownbase", pt + new Pt(-0.4f * s, 0f), pt + new Pt(0.4f * s, 0f), 0.17f * s, Col(1f, 0.73f, 0.12f), 20);
				for (int num3 = 0; num3 < 3; num3++)
				{
					Pt pt2 = pt + new Pt((float)(num3 - 1) * 0.28f * s, 0.24f * s);
					Line(k + "prong" + num3, pt2 - new Pt(0f, 0.24f * s), pt2, 0.14f * s, Col(1f, 0.84f, 0.25f), 20);
					Dot(k + "gem" + num3, pt2, 0.1f * s, Color(num3), 21);
				}
				Arc(k + "bossAura", p, s * 1.13f, t * 0.8f, 2f, Col(1f, 0.72f, 0.15f, 0.24f));
			}
			if (func(3) && t < F(G(st, "StretchUntil")))
			{
				Pt p2 = P(G(st, "StretchTo"));
				Eyes(k + "accordion", p2, 0.7f * s, num);
				for (int num4 = 0; num4 < 3; num4++)
				{
					Note(k + "accnote" + num4, p + new Pt((float)(num4 - 1) * s, (1.3f + 0.1f * Sin(t * 8f + (float)num4)) * s), 0.14f, Color(num4));
				}
			}
			if (func(4))
			{
				for (int num5 = 0; num5 < 3; num5++)
				{
					string key2 = "4_rock" + num5;
					if (dictionary != null && dictionary.Contains(key2) && Live(dictionary[key2]) && B(G(dictionary[key2], "enabled")))
					{
						Pt pt3 = Pos(dictionary[key2]);
						Dot(k + "crater" + num5, pt3 + new Pt(0.07f, 0.04f) * s, 0.13f * s, Col(0.32f, 0.36f, 0.48f), 20);
						Dot(k + "craterB" + num5, pt3 + new Pt(-0.1f, -0.075f) * s, 0.065f * s, Col(0.4f, 0.43f, 0.53f), 20);
						Star(k + "moonstar" + num5, pt3 + new Pt(-0.24f, 0.2f) * s, 0.045f, Col(0.8f, 0.9f, 1f, 0.7f));
					}
				}
				Arc(k + "orbit", p, 1.8f * s, t * 0.4f, 1.4f, Col(0.65f, 0.8f, 1f, 0.16f), 0.025f);
			}
			if (func(5))
			{
				Pt pt4 = p + new Pt(0f, -0.55f * s);
				Line(k + "basketbase", pt4 + new Pt(-0.7f, -0.25f) * s, pt4 + new Pt(0.65f, -0.25f) * s, 0.06f * s, Col(0.7f, 0.82f, 0.9f), 18);
				for (int num6 = 0; num6 < 5; num6++)
				{
					Line(k + "basketbar" + num6, pt4 + new Pt((float)(num6 - 2) * 0.27f, -0.25f) * s, pt4 + new Pt((float)(num6 - 2) * 0.32f, 0.35f) * s, 0.035f * s, Col(0.7f, 0.82f, 0.9f), 18);
				}
				Line(k + "basketrim", pt4 + new Pt(-0.72f, 0.35f) * s, pt4 + new Pt(0.72f, 0.35f) * s, 0.07f * s, Col(0.8f, 0.9f, 1f), 18);
			}
			if (func(6))
			{
				for (int num7 = 0; num7 < 4; num7++)
				{
					string key3 = "6_duck" + num7;
					if (dictionary != null && dictionary.Contains(key3) && Live(dictionary[key3]) && B(G(dictionary[key3], "enabled")))
					{
						Pt pt5 = Pos(dictionary[key3]);
						Dot(k + "duckhead" + num7, pt5 + new Pt(0.12f * num, 0.18f), 0.28f, Col(1f, 0.87f, 0.27f), 19);
						Dot(k + "duckeye" + num7, pt5 + new Pt(0.17f * num, 0.23f), 0.058f, Col(0.06f, 0.07f, 0.1f), 21);
						Shape(k + "duckwing" + num7, "Disc", pt5 + new Pt(-0.04f * num, -0.01f), 0.27f, 0.14f, Col(1f, 0.67f, 0.12f), 20, Sin(t * 12f + (float)num7) * 15f);
						Line(k + "duckbeak" + num7, pt5 + new Pt(0.22f * num, 0.16f), pt5 + new Pt(0.38f * num, 0.16f), 0.1f, Col(1f, 0.42f, 0.08f), 20);
					}
				}
			}
			if (func(7))
			{
				for (int num8 = 0; num8 < 5; num8++)
				{
					Dot(k + "clownhair" + num8, p + new Pt((float)(num8 - 2) * 0.21f, 0.74f + Sin(num8) * 0.08f) * s, 0.3f * s, Color(num8), 19);
				}
				Shape(k + "shoeL", "Disc", p + new Pt(-0.4f, -0.8f) * s, 0.65f * s, 0.24f * s, Col(1f, 0.2f, 0.22f), 18, -8f);
				Shape(k + "shoeR", "Disc", p + new Pt(0.4f, -0.8f) * s, 0.65f * s, 0.24f * s, Col(0.3f, 0.6f, 1f), 18, 8f);
			}
			if (func(8))
			{
				Shape(k + "balloonshine", "Disc", p + new Pt(-0.3f, 0.32f) * s, 0.14f * s, 0.38f * s, Col(1f, 1f, 1f, 0.5f), 22, -30f);
				for (int num9 = 0; num9 < 5; num9++)
				{
					float num10 = (float)num9 * 0.22f;
					Line(k + "balloonstring" + num9, p + new Pt(Sin(t * 2f + (float)num9 * 0.6f) * 0.1f, -0.8f - num10) * s, p + new Pt(Sin(t * 2f + (float)(num9 + 1) * 0.6f) * 0.1f, -1.02f - num10) * s, 0.027f, Col(1f, 1f, 1f, 0.65f), 13);
				}
			}
			if (func(9))
			{
				Shape(k + "fridge", "Pixel", p, 1.35f * s, 1.82f * s, Col(0.78f, 0.86f, 0.88f), 17);
				Shape(k + "fridgefront", "Pixel", p + new Pt(-0.06f, 0.02f) * s, 1.14f * s, 1.66f * s, Col(0.93f, 0.98f, 0.94f), 18);
				Line(k + "seam", p + new Pt(-0.55f, 0.32f) * s, p + new Pt(0.52f, 0.32f) * s, 0.045f * s, Col(0.38f, 0.5f, 0.58f), 19);
				Line(k + "handle", p + new Pt(0.4f, -0.18f) * s, p + new Pt(0.4f, 0.18f) * s, 0.065f * s, Col(0.3f, 0.42f, 0.48f), 20);
				Eyes(k + "fridge", p + new Pt(-0.1f, 0.57f) * s, 0.55f * s);
			}
			if (func(10))
			{
				for (int num11 = 0; num11 < 8; num11++)
				{
					float num12 = (t * 0.8f + (float)num11 * 0.131f) % 1f;
					Pt at = p + new Pt(Sin((float)num11 * 31f) * 2f * s, (2.4f - num12 * 3f) * s);
					Shape(k + "confetti" + num11, "Pixel", at, 0.07f, 0.13f, Color(num11, (1f - num12) * 0.65f), 16, t * 120f + (float)(num11 * 35));
				}
				Star(k + "spotlight", p + new Pt(2.5f, 5f), 0.2f, Col(1f, 0.93f, 0.6f, 0.6f));
			}
			if (func(11))
			{
				Shape(k + "forkbody", "Pixel", p + new Pt(-0.27f * num, -0.45f) * s, 1.14f * s, 0.5f * s, Col(1f, 0.68f, 0.07f), 17);
				for (int num13 = 0; num13 < 2; num13++)
				{
					Pt p3 = p + new Pt(((num13 == 0) ? (-0.65f) : 0.25f) * s, -0.78f * s);
					Dot(k + "tire" + num13, p3, 0.38f * s, Col(0.11f, 0.12f, 0.15f), 18);
					Dot(k + "hub" + num13, p3, 0.18f * s, Col(0.65f, 0.7f, 0.72f), 19);
				}
				float num14 = 0.4f + 0.6f * Math.Max(0f, Sin(t * 8f));
				Shape(k + "beaconGlow", "Glow", p + new Pt(-0.25f * num, 1f) * s, 0.55f, 0.5f, Col(1f, 0.6f, 0.05f, num14 * 0.3f), 19);
				Dot(k + "beacon", p + new Pt(-0.25f * num, 1f) * s, 0.16f * s, Col(1f, 0.65f, 0.1f, num14), 20);
			}
			if (func(12))
			{
				Shape(k + "printerbody", "Pixel", p, 1.35f * s, 0.88f * s, Col(0.82f, 0.85f, 0.85f), 18);
				Shape(k + "printertop", "Pixel", p + new Pt(0f, 0.38f) * s, 1.15f * s, 0.23f * s, Col(0.2f, 0.23f, 0.28f), 19);
				Shape(k + "paper", "Pixel", p + new Pt(0f, 0.69f) * s, 0.68f * s, 0.4f * s, Col(0.97f, 0.97f, 0.9f), 18);
				for (int num15 = 0; num15 < 3; num15++)
				{
					Line(k + "printline" + num15, p + new Pt(-0.23f, 0.61f + (float)num15 * 0.075f) * s, p + new Pt(0.18f, 0.61f + (float)num15 * 0.075f) * s, 0.025f * s, Col(0.35f, 0.4f, 0.45f), 19);
				}
				Eyes(k + "printer", p, 0.65f * s);
				bool flag = t < F(G(st, "JamUntil"));
				Dot(k + "printerled", p + new Pt(0.48f, -0.25f) * s, 0.1f * s, flag ? Col(1f, 0.15f, 0.1f) : Col(0.35f, 1f, 0.55f), 22);
			}
		}

		public static Random NewRandom()
		{
			return new SecureRandom();
		}

		private static void ReloadIndicator(object player, float t)
		{
			object obj = AmmoFor(C(R("Util"), "GunOf", player));
			if (obj != null && reloads.TryGetValue(obj, out var value))
			{
				float num = Math.Max(0.05f, F(C(obj, "ReloadTime")));
				float num2 = Clamp(1f - (value - t) / num);
				Pt pt = Pos(player) + new Pt(0f, -1.1f);
				string text = "reload" + I(G(player, "playerID")) + "/";
				Shape(text + "track", "Pixel", pt, 1.2f, 0.09f, Col(0.08f, 0.11f, 0.19f, 0.85f), 18);
				Shape(text + "fill", "Pixel", pt + new Pt((num2 - 1f) * 0.6f, 0f), 1.2f * num2, 0.06f, Col(0.5f, 0.92f, 1f), 19);
			}
		}

		private static void DiscoSphere(string k, Pt p, float t, float radius)
		{
			float num = (float)Math.Pow(1f - ((t - epoch) / 0.45f % 1f + 1f) % 1f, 4.0);
			Line(k + "wire", p, p + new Pt(0f, 3f), 0.025f, Col(0.65f, 0.72f, 0.88f, 0.55f), 5);
			Shape(k + "halo", "Glow", p, 1.65f, 1.65f, Col(0.4f, 0.7f, 1f, 0.14f + 0.07f * num), 14);
			Dot(k + "rim", p, 1.04f, Col(0.035f, 0.06f, 0.12f), 16);
			Dot(k + "ball", p, 0.98f, Col(0.19f, 0.25f, 0.34f), 17);
			for (int i = -4; i <= 4; i++)
			{
				float x = (float)i * 0.29f;
				float b = Sin(x) * 0.46f;
				float num2 = Cos(x) * 0.46f;
				for (int j = 0; j < 20; j++)
				{
					float x2 = (float)j * 0.314159f + t * 0.9f;
					float num3 = Cos(x2);
					if (!(num3 <= 0.03f))
					{
						float a = Sin(x2) * num2;
						float w = Math.Max(0.014f, num2 * 0.27f * num3);
						float h = 0.105f * Cos(x);
						float num4 = (float)Math.Pow(Math.Max(0f, num3 * 0.74f - Sin(x2) * 0.45f + Sin(x) * 0.32f), 7.0);
						Shape(k + "facet" + i + "/" + j, "Pixel", p + new Pt(a, b), w, h, Col(0.28f + 0.7f * num4 + 0.12f * num3, 0.4f + 0.57f * num4 + 0.1f * num3, 0.55f + 0.43f * num4), 18);
					}
				}
			}
			Star(k + "glintA", p + new Pt(-0.19f, 0.25f), 0.11f + 0.04f * num, Col(1f, 1f, 1f, 0.95f), 20);
			Star(k + "glintB", p + new Pt(0.3f, -0.15f), 0.065f, Col(0.7f, 0.9f, 1f, 0.8f), 20);
			for (int l = 0; l < 8; l++)
			{
				float x3 = t * 0.34f + (float)l * 0.785398f;
				Pt pt = new Pt(Cos(x3), Sin(x3) * 0.72f);
				Pt pt2 = p + pt * radius;
				for (int m = 1; m <= 5; m++)
				{
					float num5 = (float)m / 5f;
					Pt at = p + pt * (radius * num5 * 0.85f);
					Shape(k + "wash" + l + "/" + m, "Glow", at, 0.12f + num5 * 0.65f, 0.12f + num5 * 0.65f, Color(l, (0.02f + 0.016f * num) * (1f - num5 * 0.5f)), 3);
				}
				Shape(k + "softBeam" + l, "SoftLine", (p + pt2) * 0.5f, (float)Math.Sqrt((pt2 - p).x * (pt2 - p).x + (pt2 - p).y * (pt2 - p).y), 0.3f + 0.18f * num, Color(l, 0.1f + 0.05f * num), 3, (float)(Math.Atan2(pt.y, pt.x) * 180.0 / Math.PI));
				Line(k + "beam" + l, p + pt * 0.5f, pt2, 0.018f, Color(l, 0.18f + 0.12f * num), 4);
				Shape(k + "spot" + l, "Glow", pt2, 0.55f, 0.23f, Color(l, 0.23f + 0.22f * num), 5);
				Star(k + "spark" + l, pt2, 0.055f + 0.055f * num, Color(l, 0.65f), 6);
			}
		}

		private static void SlotSymbol(string k, Pt p, int symbol, float s)
		{
			object c = Col(1f, 0.77f, 0.12f);
			symbol = (symbol % 5 + 5) % 5;
			switch (symbol)
			{
			case 0:
			{
				for (int m = 0; m < 5; m++)
				{
					float x = 1.5708f + (float)m * 1.25664f;
					Line(k + m, p, p + new Pt(Cos(x), Sin(x)) * 0.24f * s, 0.12f * s, c, 24);
				}
				Dot(k + "core", p, 0.23f * s, c, 24);
				Star(k + "shine", p + new Pt(-0.06f, 0.07f) * s, 0.045f * s, White, 25);
				break;
			}
			case 1:
			{
				Dot(k + "skull", p + new Pt(0f, 0.04f) * s, 0.36f * s, Col(1f, 0.18f, 0.25f), 24);
				Shape(k + "jaw", "Pixel", p + new Pt(0f, -0.13f) * s, 0.22f * s, 0.13f * s, Col(1f, 0.18f, 0.25f), 24);
				for (int j = 0; j < 2; j++)
				{
					Dot(k + "eye" + j, p + new Pt((j == 0) ? (-0.075f) : 0.075f, 0.05f) * s, 0.08f * s, Col(0.13f, 0.035f, 0.1f), 25);
				}
				break;
			}
			case 2:
				Shape(k + "diamond", "Pixel", p, 0.3f * s, 0.3f * s, Col(0.16f, 0.79f, 1f), 24, 45f);
				Line(k + "cut", p + new Pt(-0.17f, 0.03f) * s, p + new Pt(0.17f, 0.03f) * s, 0.025f * s, Col(0.7f, 1f, 1f), 25);
				Line(k + "facet", p + new Pt(0f, 0.19f) * s, p + new Pt(0f, -0.19f) * s, 0.02f * s, Col(0.7f, 1f, 1f), 25);
				break;
			case 3:
			{
				for (int l = 0; l < 2; l++)
				{
					Pt pt = p + new Pt((l == 0) ? (-0.1f) : 0.1f, -0.06f) * s;
					Dot(k + "cherry" + l, pt, 0.23f * s, Col(1f, 0.15f, 0.37f), 24);
					Line(k + "stem" + l, pt + new Pt(0f, 0.1f) * s, p + new Pt(0f, 0.24f) * s, 0.035f * s, Col(0.2f, 0.65f, 0.25f), 24);
					Dot(k + "shine" + l, pt + new Pt(-0.035f, 0.045f) * s, 0.055f * s, Col(1f, 0.85f, 0.8f), 25);
				}
				break;
			}
			default:
			{
				Line(k + "crown", p + new Pt(-0.19f, -0.1f) * s, p + new Pt(0.19f, -0.1f) * s, 0.12f * s, c, 24);
				for (int i = 0; i < 3; i++)
				{
					Line(k + "point" + i, p + new Pt((float)(i - 1) * 0.15f, -0.06f) * s, p + new Pt((float)(i - 1) * 0.18f, 0.15f) * s, 0.1f * s, c, 24);
				}
				Dot(k + "gem", p, 0.065f * s, Col(0.6f, 0.25f, 1f), 25);
				break;
			}
			}
		}

		private static void Slots(float t)
		{
			Type o;
			try
			{
				o = T("LetItRide.Machine");
			}
			catch (TypeLoadException)
			{
				return;
			}
			if (!(G(o, "States") is IDictionary dictionary))
			{
				return;
			}
			foreach (DictionaryEntry item in dictionary)
			{
				object value = item.Value;
				float num = t - F(G(value, "SpinFrom"));
				if (num < 0f || num > 3f)
				{
					continue;
				}
				object obj = C(R("Util"), "PlayerById", (int)item.Key);
				if (!Live(obj) || !B(C(R("Util"), "Alive", obj)))
				{
					continue;
				}
				float num2 = Clamp(Math.Abs(F(G(G(G(obj, "transform"), "localScale"), "x"))), 0.7f, 1.5f);
				Pt pt = Pos(obj) + new Pt(0f, 2.3f * num2);
				string text = "slotV" + item.Key?.ToString() + "/";
				Shape(text + "shadow", "Glow", pt, 3.4f * num2, 2f * num2, Col(0.03f, 0.025f, 0.09f, 0.35f), 10);
				Shape(text + "rim", "Pixel", pt, 2.54f * num2, 1.35f * num2, Col(1f, 0.67f, 0.12f), 19);
				Shape(text + "body", "Pixel", pt + new Pt(0f, 0.015f) * num2, 2.4f * num2, 1.2f * num2, Col(0.6f, 0.04f, 0.13f), 20);
				Shape(text + "recess", "Pixel", pt, 2.13f * num2, 0.87f * num2, Col(0.13f, 0.035f, 0.065f), 21);
				for (int i = 0; i < 12; i++)
				{
					float a = ((float)i - 5.5f) * 0.19f * num2;
					bool flag = (i + (int)(t * 10f)) % 3 == 0;
					Dot(text + "bulb" + i, pt + new Pt(a, 0.57f * num2), 0.067f * num2, flag ? Col(1f, 1f, 0.7f) : Col(0.88f, 0.39f, 0.08f), 22);
					if (flag)
					{
						Shape(text + "bulbGlow" + i, "Glow", pt + new Pt(a, 0.57f * num2), 0.18f * num2, 0.18f * num2, Col(1f, 0.7f, 0.1f, 0.35f), 21);
					}
				}
				for (int j = 0; j < 3; j++)
				{
					Pt pt2 = pt + new Pt((float)(j - 1) * 0.7f * num2, 0f);
					Shape(text + "window" + j, "Pixel", pt2, 0.62f * num2, 0.73f * num2, Col(1f, 0.96f, 0.79f), 22);
					float num3 = 1.8f * (0.55f + 0.2f * (float)j);
					bool flag2 = num < num3;
					int symbol = (flag2 ? ((int)(num * 14f + (float)(j * 2))) : I(C(o, "Stopped", I(G(value, "Outcome")), j)));
					float b = (flag2 ? ((0.5f - num * 14f % 1f) * 0.35f * num2) : 0f);
					SlotSymbol(text + "symbol" + j + "/", pt2 + new Pt(0f, b), symbol, num2);
					Line(text + "windowTop" + j, pt2 + new Pt(-0.29f, 0.34f) * num2, pt2 + new Pt(0.29f, 0.34f) * num2, 0.05f * num2, Col(0.8f, 0.58f, 0.23f, 0.65f), 26);
				}
				float num4 = Clamp(num / 0.25f) * (1f - Clamp((num - 0.25f) / 0.3f));
				Pt pt3 = pt + new Pt(1.48f, 0.56f - 0.8f * num4) * num2;
				Line(text + "lever", pt + new Pt(1.19f, -0.22f) * num2, pt3, 0.075f * num2, Col(0.65f, 0.73f, 0.82f), 21);
				Dot(text + "knob", pt3, 0.27f * num2, Col(1f, 0.15f, 0.25f), 22);
				Dot(text + "knobShine", pt3 + new Pt(-0.045f, 0.055f) * num2, 0.07f * num2, Col(1f, 0.8f, 0.75f), 23);
				if (!(num >= 1.8f))
				{
					continue;
				}
				int num5 = I(G(value, "Outcome"));
				object c = ((num5 == 1) ? Col(1f, 0.84f, 0.23f) : ((num5 < 0) ? Col(1f, 0.18f, 0.3f) : Col(0.3f, 0.85f, 1f)));
				Line(text + "result", pt + new Pt(-1.12f, -0.56f) * num2, pt + new Pt(1.12f, -0.56f) * num2, 0.06f * num2, c, 25);
				if (num5 == 1)
				{
					for (int k = 0; k < 8; k++)
					{
						float x = (float)k * 0.7854f + t;
						Star(text + "win" + k, pt + new Pt(Cos(x) * 1.55f, Sin(x) * 0.9f) * num2, 0.065f * num2, c, 26);
					}
				}
			}
		}

		private static void OttoAudio(bool active)
		{
			if (!active)
			{
				if (Live(ottoSource))
				{
					C(ottoSource, "Stop");
				}
				return;
			}
			if (!ottoLoaded)
			{
				ottoLoaded = true;
				string path = Path.Combine(Path.GetDirectoryName(typeof(Visuals).Assembly.Location), "OttoDisco.wav");
				if (File.Exists(path))
				{
					using BinaryReader binaryReader = new BinaryReader(File.OpenRead(path));
					if (new string(binaryReader.ReadChars(4)) != "RIFF")
					{
						throw new InvalidDataException("OttoDisco.wav must be PCM16 WAV");
					}
					binaryReader.ReadInt32();
					if (new string(binaryReader.ReadChars(4)) != "WAVE")
					{
						throw new InvalidDataException("Invalid WAV");
					}
					int num = 0;
					int num2 = 0;
					byte[] array = null;
					while (binaryReader.BaseStream.Position + 8 <= binaryReader.BaseStream.Length)
					{
						string text = new string(binaryReader.ReadChars(4));
						int num3 = binaryReader.ReadInt32();
						if (num3 < 0 || num3 > binaryReader.BaseStream.Length - binaryReader.BaseStream.Position)
						{
							throw new InvalidDataException("WAV chunk");
						}
						long num4 = binaryReader.BaseStream.Position + num3;
						if (text == "fmt ")
						{
							if (num3 < 16 || binaryReader.ReadInt16() != 1)
							{
								throw new InvalidDataException("Use PCM16 WAV");
							}
							num = binaryReader.ReadInt16();
							num2 = binaryReader.ReadInt32();
							binaryReader.ReadInt32();
							binaryReader.ReadInt16();
							if (binaryReader.ReadInt16() != 16)
							{
								throw new InvalidDataException("Use 16-bit WAV");
							}
						}
						else if (text == "data")
						{
							array = binaryReader.ReadBytes(num3);
						}
						binaryReader.BaseStream.Position = num4 + num3 % 2;
					}
					if (array == null || num < 1 || num > 2 || num2 < 8000 || num2 > 96000 || array.Length % (num * 2) != 0)
					{
						throw new InvalidDataException("Unsupported WAV");
					}
					float[] array2 = new float[array.Length / 2];
					for (int i = 0; i < array2.Length; i++)
					{
						array2[i] = (float)BitConverter.ToInt16(array, i * 2) / 32768f;
					}
					ottoClip = C(T("UnityEngine.AudioClip"), "Create", "Otto Disco", array2.Length / num, num, num2, false);
					C(ottoClip, "SetData", array2, 0);
				}
			}
			if (Live(ottoClip))
			{
				if (!Live(ottoSource))
				{
					object obj = Activator.CreateInstance(T("UnityEngine.GameObject"), "CGC_OttoDisco");
					ottoSource = C(obj, "AddComponent", T("UnityEngine.AudioSource"));
					C(T("UnityEngine.Object"), "DontDestroyOnLoad", obj);
					S(ottoSource, "clip", ottoClip);
					S(ottoSource, "loop", true);
					S(ottoSource, "playOnAwake", false);
					S(ottoSource, "volume", 0.6f);
					S(ottoSource, "spatialBlend", 0f);
				}
				S(ottoSource, "pitch", F(G(T("UnityEngine.Time"), "timeScale")));
				if (!B(G(ottoSource, "isPlaying")))
				{
					C(ottoSource, "Play");
				}
			}
		}

		private static object AmmoFor(object gun)
		{
			if (!Live(gun))
			{
				return null;
			}
			return C(gun, "GetComponentInChildren", T("GunAmmo"), true);
		}

		private static object GunFor(object ammo)
		{
			foreach (object item in Each(G(G(T("PlayerManager"), "instance"), "players")))
			{
				if (Live(item))
				{
					object obj = C(R("Util"), "GunOf", item);
					if (AmmoFor(obj) == ammo)
					{
						return obj;
					}
				}
			}
			return null;
		}

		private static object OwnerFor(object ammo)
		{
			foreach (object item in Each(G(G(T("PlayerManager"), "instance"), "players")))
			{
				if (Live(item) && AmmoFor(C(R("Util"), "GunOf", item)) == ammo)
				{
					return item;
				}
			}
			return null;
		}

		private static void HarmonyPatch(object harmony, MethodInfo target, string prefix, string postfix = null)
		{
			if (target == null)
			{
				throw new MissingMethodException("GunAmmo patch target");
			}
			Type type = T("HarmonyLib.HarmonyMethod");
			object[] parameters = new object[5]
			{
				target,
				(prefix == null) ? null : Activator.CreateInstance(type, typeof(Visuals).GetMethod(prefix)),
				(postfix == null) ? null : Activator.CreateInstance(type, typeof(Visuals).GetMethod(postfix)),
				null,
				null
			};
			harmony.GetType().GetMethods().Single((MethodInfo m) => m.Name == "Patch" && m.GetParameters().Length == 5)
				.Invoke(harmony, parameters);
		}

		public static void InstallGameplay()
		{
		}

		private static bool WeaponCooldown(object ammo)
		{
			object obj = OwnerFor(ammo);
			if (!Live(obj))
			{
				return false;
			}
			return (Convert.ToInt64(C(R("Loadout"), "Of", obj)) & 0x501) != 0;
		}

		public static bool AmmoUpdatePrefix(object __instance)
		{
			return true;
		}

		public static bool AmmoReloadPrefix(object __instance)
		{
			return true;
		}

		public static void AmmoShootPostfix(object __instance)
		{
		}

		public static void CompleteCardReload(object gun)
		{
			Safe("card reload", delegate
			{
				object obj = AmmoFor(gun);
				if (Live(obj))
				{
					FinishAmmo(obj, gun);
				}
			});
		}

		private static void FinishAmmo(object ammo, object gun)
		{
			object obj = reloadPermit;
			try
			{
				reloadPermit = ammo;
				C(ammo, "ReloadAmmo", true);
			}
			finally
			{
				reloadPermit = obj;
				reloads.Remove(ammo);
				if (Live(gun))
				{
					S(gun, "isReloading", false);
				}
			}
		}

		public static bool CanFire(object gun)
		{
			return true;
		}

		public static bool RequestReload(object player)
		{
			return false;
		}

		public static void BeginManualReload(int pid)
		{
		}

		private static bool ReloadHeld(object player)
		{
			bool flag = B(C(R("Controls"), "Action", player, "Reload"));
			if (B(C(R("Controls"), "IsKeyboardPlayer", player)))
			{
				if (!flag)
				{
					return B(C(T("UnityEngine.Input"), "GetKey", Enum.ToObject(T("UnityEngine.KeyCode"), 114)));
				}
				return true;
			}
			object obj = G(G(G(player, "data"), "playerActions"), "Device");
			if (!flag)
			{
				if (obj != null)
				{
					return B(G(G(obj, "RightStickButton"), "IsPressed"));
				}
				return false;
			}
			return true;
		}

		public static void GameplayTick()
		{
			Safe("slot lifecycle", delegate
			{
				bool num = CanUseDoors();
				if (!num && rideWasPlaying)
				{
					ResetRide();
				}
				rideWasPlaying = num;
			});
		}

		private static void ClearReloads()
		{
			object[] array = reloads.Keys.ToArray();
			for (int i = 0; i < array.Length; i++)
			{
				object o = GunFor(array[i]);
				if (Live(o))
				{
					S(o, "isReloading", false);
				}
			}
			reloads.Clear();
			reloadKeys.Clear();
		}

		public static bool CanPull(int pid)
		{
			if (!CanUseDoors() || !B(C(T("LetItRide.Machine"), "IsHost")))
			{
				return false;
			}
			Type o = T("LetItRide.Machine");
			C(o, "Resolve");
			if (G(o, "_remove") == null)
			{
				return false;
			}
			object o2 = C(o, "Of", pid);
			if (Time < F(G(o2, "NextPull")) || Time - F(G(o2, "SpinFrom")) < 3f)
			{
				return false;
			}
			S(o2, "NextPull", Time + 0.5f);
			return true;
		}

		public static bool CanReceiveSpin()
		{
			return CanUseDoors();
		}

		public static void StartReturnedCoroutine(object result)
		{
			if (result is IEnumerator enumerator)
			{
				object o = G(T("LetItRide.Plugin"), "Instance");
				if (Live(o))
				{
					C(o, "StartCoroutine", enumerator);
				}
			}
		}

		public static void ResetRide()
		{
			Safe("slot reset", delegate
			{
				Type o;
				try
				{
					o = T("LetItRide.Machine");
				}
				catch (TypeLoadException)
				{
					return;
				}
				object o2 = G(T("LetItRide.Plugin"), "Instance");
				if (Live(o2))
				{
					C(o2, "StopAllCoroutines");
				}
				if (G(o, "States") is IDictionary dictionary)
				{
					dictionary.Clear();
				}
				Type o3 = T("LetItRide.Draw");
				if (G(o3, "Named") is IDictionary dictionary2)
				{
					foreach (object value in dictionary2.Values)
					{
						if (Live(value))
						{
							C(T("UnityEngine.Object"), "Destroy", G(value, "gameObject"));
						}
					}
					dictionary2.Clear();
				}
				if (G(o3, "Pieces") is IList list)
				{
					foreach (object item in list)
					{
						object o4 = G(item, "Sprite");
						if (Live(o4))
						{
							C(T("UnityEngine.Object"), "Destroy", G(o4, "gameObject"));
						}
					}
					list.Clear();
				}
				object o5 = G(o3, "_source");
				if (Live(o5))
				{
					C(o5, "Stop");
				}
				foreach (object item2 in Each(C(T("UnityEngine.Object"), "FindObjectsOfType", T("LetItRide.FloatingLabel"))))
				{
					if (Live(item2))
					{
						C(T("UnityEngine.Object"), "Destroy", G(item2, "gameObject"));
					}
				}
			});
		}
	}
	public sealed class SecureRandom : Random
	{
		private readonly RandomNumberGenerator generator = RandomNumberGenerator.Create();

		private readonly byte[] bytes = new byte[4];

		private readonly object gate = new object();

		private uint Draw()
		{
			generator.GetBytes(bytes);
			return BitConverter.ToUInt32(bytes, 0);
		}

		private uint Below(uint bound)
		{
			if (bound == 0)
			{
				return 0u;
			}
			uint num = (0 - bound) % bound;
			lock (gate)
			{
				uint num2;
				do
				{
					num2 = Draw();
				}
				while (num2 < num);
				return num2 % bound;
			}
		}

		public override int Next()
		{
			return (int)Below(2147483647u);
		}

		public override int Next(int maxValue)
		{
			if (maxValue < 0)
			{
				throw new ArgumentOutOfRangeException("maxValue");
			}
			return (int)Below((uint)maxValue);
		}

		public override int Next(int minValue, int maxValue)
		{
			if (minValue > maxValue)
			{
				throw new ArgumentOutOfRangeException("minValue");
			}
			return (int)(minValue + Below((uint)((ulong)maxValue - (ulong)minValue)));
		}

		protected override double Sample()
		{
			lock (gate)
			{
				return (double)Draw() / 4294967296.0;
			}
		}

		public override double NextDouble()
		{
			return Sample();
		}

		public override void NextBytes(byte[] buffer)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			lock (gate)
			{
				generator.GetBytes(buffer);
			}
		}
	}
}

LetItRide.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using BepInEx;
using CodyGunCards.Presentation;
using HarmonyLib;
using ModdingUtils.Utils;
using Photon.Pun;
using SoundImplementation;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Networking;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("1.1.0.0")]
namespace LetItRide;

internal static class Draw
{
	private sealed class Piece
	{
		internal SpriteRenderer Sprite;

		internal Vector2 Pos;

		internal Vector2 Vel;

		internal float Life;

		internal float Spin;

		internal float Angle;
	}

	private static Sprite _pixel;

	private static Sprite _disc;

	private static readonly Dictionary<string, SpriteRenderer> Named = new Dictionary<string, SpriteRenderer>();

	private static readonly List<Piece> Pieces = new List<Piece>();

	private const int Rate = 44100;

	private static AudioSource _source;

	private static AudioClip _tick;

	private static AudioClip _win;

	private static AudioClip _lose;

	private static AudioClip _pull;

	internal static Sprite Pixel
	{
		get
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_005d: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_pixel == (Object)null)
			{
				Texture2D val = new Texture2D(4, 4, (TextureFormat)4, false);
				for (int i = 0; i < 4; i++)
				{
					for (int j = 0; j < 4; j++)
					{
						val.SetPixel(j, i, Color.white);
					}
				}
				val.Apply();
				Object.DontDestroyOnLoad((Object)(object)val);
				_pixel = Sprite.Create(val, new Rect(0f, 0f, 4f, 4f), new Vector2(0.5f, 0.5f), 4f);
			}
			return _pixel;
		}
	}

	internal static Sprite Disc
	{
		get
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_007c: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_disc == (Object)null)
			{
				Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false);
				for (int i = 0; i < 64; i++)
				{
					for (int j = 0; j < 64; j++)
					{
						val.SetPixel(j, i, new Color(1f, 1f, 1f, DiscAlpha(j, i, 64)));
					}
				}
				val.Apply();
				Object.DontDestroyOnLoad((Object)(object)val);
				_disc = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f);
			}
			return _disc;
		}
	}

	internal static float DiscAlpha(int x, int y, int size)
	{
		float num = (float)size * 0.5f;
		float num2 = (float)x + 0.5f - num;
		float num3 = (float)y + 0.5f - num;
		float num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
		float num5 = num - num4;
		if (!(num5 <= 0f))
		{
			if (!(num5 >= 1f))
			{
				return num5;
			}
			return 1f;
		}
		return 0f;
	}

	internal static SpriteRenderer MakeSprite(string name, Sprite sprite, Color color, int order)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		SpriteRenderer obj = new GameObject(name).AddComponent<SpriteRenderer>();
		obj.sprite = sprite;
		obj.color = color;
		((Renderer)obj).sortingOrder = order;
		return obj;
	}

	private static SpriteRenderer Get(string key, Sprite sprite, Color colour, int order)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		if (!Named.TryGetValue(key, out var value) || (Object)(object)value == (Object)null)
		{
			value = MakeSprite("LIR_" + key, sprite, colour, order);
			Named[key] = value;
		}
		((Renderer)value).enabled = true;
		value.color = colour;
		return value;
	}

	internal static void Dot(string key, Vector2 at, float scale, Color colour, int order)
	{
		//IL_0006: 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)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		SpriteRenderer obj = Get(key, Disc, colour, order);
		((Component)obj).transform.position = new Vector3(at.x, at.y, 0f);
		((Component)obj).transform.localScale = new Vector3(scale, scale, 1f);
	}

	internal static void Line(string key, Vector2 a, Vector2 b, float width, Color colour, int order)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: 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_0030: 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_0048: 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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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)
		SpriteRenderer obj = Get(key, Pixel, colour, order);
		Vector2 val = b - a;
		((Component)obj).transform.position = new Vector3((a.x + b.x) * 0.5f, (a.y + b.y) * 0.5f, 0f);
		((Component)obj).transform.rotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(val.y, val.x) * 57.29578f);
		((Component)obj).transform.localScale = new Vector3(Mathf.Max(0.01f, ((Vector2)(ref val)).magnitude), width, 1f);
	}

	internal static void Off(string prefix)
	{
		foreach (KeyValuePair<string, SpriteRenderer> item in Named)
		{
			if ((Object)(object)item.Value != (Object)null && item.Key.StartsWith(prefix, StringComparison.Ordinal))
			{
				((Renderer)item.Value).enabled = false;
			}
		}
	}

	internal static void Confetti(Vector2 at, int count, Random rng)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: 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_007c: 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_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: 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_017c: Unknown result type (might be due to invalid IL or missing references)
		Color[] array = (Color[])(object)new Color[5]
		{
			new Color(1f, 0.3f, 0.4f, 1f),
			new Color(0.3f, 0.8f, 1f, 1f),
			new Color(1f, 0.9f, 0.2f, 1f),
			new Color(0.5f, 1f, 0.4f, 1f),
			new Color(0.9f, 0.4f, 1f, 1f)
		};
		for (int i = 0; i < count; i++)
		{
			if (Pieces.Count >= 200)
			{
				break;
			}
			Piece piece = new Piece();
			double num = rng.NextDouble() * Math.PI * 2.0;
			float num2 = 5f + 11f * (float)rng.NextDouble();
			piece.Pos = at;
			piece.Vel = new Vector2((float)Math.Cos(num) * num2, (float)Math.Sin(num) * num2 + 6f);
			piece.Life = 1.1f + 0.6f * (float)rng.NextDouble();
			piece.Spin = -400f + 800f * (float)rng.NextDouble();
			piece.Sprite = MakeSprite("LIR_Confetti", Pixel, array[i % 5], 14);
			((Component)piece.Sprite).transform.localScale = new Vector3(0.22f, 0.11f, 1f);
			Pieces.Add(piece);
		}
	}

	internal static void Tick(float dt)
	{
		//IL_00a2: 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_00b4: 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_00c4: 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_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: 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_014b: 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_0168: Unknown result type (might be due to invalid IL or missing references)
		for (int num = Pieces.Count - 1; num >= 0; num--)
		{
			Piece piece = Pieces[num];
			piece.Life -= dt;
			if (piece.Life <= 0f || (Object)(object)piece.Sprite == (Object)null)
			{
				if ((Object)(object)piece.Sprite != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)piece.Sprite).gameObject);
				}
				Pieces.RemoveAt(num);
			}
			else
			{
				piece.Vel = new Vector2(piece.Vel.x * (1f - 1.5f * dt), piece.Vel.y - 16f * dt);
				piece.Pos += piece.Vel * dt;
				piece.Angle += piece.Spin * dt;
				((Component)piece.Sprite).transform.position = new Vector3(piece.Pos.x, piece.Pos.y, 0f);
				((Component)piece.Sprite).transform.rotation = Quaternion.Euler(0f, 0f, piece.Angle);
				Color color = piece.Sprite.color;
				piece.Sprite.color = new Color(color.r, color.g, color.b, Mathf.Clamp01(piece.Life / 0.4f));
			}
		}
	}

	internal static float[] Tone(float seconds, float from, float to, bool square, float level)
	{
		float[] array = new float[(int)(44100f * seconds)];
		double num = 0.0;
		for (int i = 0; i < array.Length; i++)
		{
			float num2 = (float)i / (float)array.Length;
			num += Math.PI * 2.0 * (double)(from + (to - from) * num2) / 44100.0;
			float num3 = (float)Math.Sin(num);
			if (square)
			{
				num3 = ((num3 > 0f) ? 0.6f : (-0.6f));
			}
			float num4 = Math.Min(1f, (float)i / 176.40001f);
			float num5 = Math.Min(1f, (float)(array.Length - i) / 1323f);
			array[i] = num3 * level * num4 * num5;
		}
		return array;
	}

	internal static float[] Join(params float[][] parts)
	{
		int num = 0;
		for (int i = 0; i < parts.Length; i++)
		{
			num += parts[i].Length;
		}
		float[] array = new float[num];
		int num2 = 0;
		for (int j = 0; j < parts.Length; j++)
		{
			Array.Copy(parts[j], 0, array, num2, parts[j].Length);
			num2 += parts[j].Length;
		}
		return array;
	}

	internal static float[] WinJingle()
	{
		return Join(Tone(0.09f, 523f, 523f, square: false, 0.5f), Tone(0.09f, 659f, 659f, square: false, 0.5f), Tone(0.09f, 784f, 784f, square: false, 0.5f), Tone(0.28f, 1047f, 1047f, square: false, 0.55f));
	}

	internal static float[] LoseBuzz()
	{
		return Join(Tone(0.16f, 220f, 196f, square: true, 0.4f), Tone(0.3f, 165f, 110f, square: true, 0.4f));
	}

	private static AudioClip Clip(string name, float[] data)
	{
		AudioClip obj = AudioClip.Create(name, data.Length, 1, 44100, false);
		obj.SetData(data, 0);
		return obj;
	}

	private static AudioSource Source()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		if ((Object)(object)_source != (Object)null)
		{
			return _source;
		}
		GameObject val = new GameObject("LIR_Audio");
		Object.DontDestroyOnLoad((Object)val);
		_source = val.AddComponent<AudioSource>();
		_source.playOnAwake = false;
		_source.spatialBlend = 0f;
		_source.volume = 0.5f;
		try
		{
			SoundVolumeManager instance = SoundVolumeManager.Instance;
			if ((Object)instance != (Object)null && (Object)(object)instance.audioMixer != (Object)null)
			{
				AudioMixerGroup[] array = instance.audioMixer.FindMatchingGroups("SFX");
				if (array != null && array.Length != 0)
				{
					_source.outputAudioMixerGroup = array[0];
				}
			}
		}
		catch
		{
		}
		return _source;
	}

	internal static void Play(int which, float volume)
	{
		try
		{
			if ((Object)(object)_tick == (Object)null)
			{
				_tick = Clip("LIR_Tick", Tone(0.03f, 1500f, 1200f, square: true, 0.3f));
				_pull = Clip("LIR_Pull", Tone(0.18f, 300f, 140f, square: false, 0.5f));
				_win = Clip("LIR_Win", WinJingle());
				_lose = Clip("LIR_Lose", LoseBuzz());
			}
			AudioClip val = (AudioClip)(which switch
			{
				2 => _win, 
				1 => _pull, 
				0 => _tick, 
				_ => _lose, 
			});
			Source().PlayOneShot(val, volume);
		}
		catch (Exception ex)
		{
			Plugin.Warn("Sound: " + ex.Message);
		}
	}
}
internal sealed class FloatingLabel : MonoBehaviour
{
	private const float Life = 2.2f;

	private PixelText _text;

	private Transform _follow;

	private Color _color;

	private float _born;

	private string _label;

	private int _row;

	internal static void Show(Player p, string text, Color color)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		Show(p, text, color, 0);
	}

	internal static void Show(Player p, string text, Color color, int row)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_0027: 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)
		if (!((Object)(object)p == (Object)null))
		{
			GameObject val = new GameObject("LIR_FloatingLabel");
			FloatingLabel floatingLabel = val.AddComponent<FloatingLabel>();
			floatingLabel._follow = ((Component)p).transform;
			floatingLabel._color = color;
			floatingLabel._born = Time.time;
			floatingLabel._label = Clean(text);
			floatingLabel._row = row;
			floatingLabel._text = new PixelText(val.transform, 310);
		}
	}

	internal static string Clean(string s)
	{
		StringBuilder stringBuilder = new StringBuilder();
		string text = (s ?? string.Empty).ToUpperInvariant();
		foreach (char c in text)
		{
			stringBuilder.Append((!PixelFont.Has(c) && c != ' ') ? ' ' : c);
		}
		return stringBuilder.ToString();
	}

	private void LateUpdate()
	{
		//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_005f: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		float num = Time.time - _born;
		if (num > 2.2f || (Object)(object)_follow == (Object)null)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		float alpha = Mathf.Clamp01(num / 0.15f) * Mathf.Clamp01((2.2f - num) / 0.5f);
		Vector2 centerTop = Vector2.op_Implicit(_follow.position) + Vector2.up * (2f + (float)_row * 0.8f + num * 0.6f);
		_text.Set(_label, _color, centerTop, 0.09f, alpha);
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.cody.rounds.letitride", "Let It Ride", "1.1.0")]
[BepInProcess("Rounds.exe")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
	public const string Id = "com.cody.rounds.letitride";

	public const string Version = "1.1.0";

	internal static Plugin Instance;

	private void Awake()
	{
		Instance = this;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Let It Ride 1.1.0 loading");
	}

	private void Start()
	{
		try
		{
			CustomCard.BuildCard<LetItRideCard>((Action<CardInfo>)delegate(CardInfo c)
			{
				LetItRideCard.Card = c;
				Log("Registered card: Let It Ride");
			});
		}
		catch (Exception ex)
		{
			Warn("Could not build the card: " + ex.Message);
		}
	}

	private void Update()
	{
		try
		{
			Machine.Tick();
			Draw.Tick(Mathf.Min(Time.deltaTime, 0.05f));
		}
		catch (Exception ex)
		{
			Machine.Complain(ex);
		}
	}

	internal static void Log(string message)
	{
		if ((Object)(object)Instance != (Object)null)
		{
			((BaseUnityPlugin)Instance).Logger.LogInfo((object)message);
		}
	}

	internal static void Warn(string message)
	{
		if ((Object)(object)Instance != (Object)null)
		{
			((BaseUnityPlugin)Instance).Logger.LogWarning((object)message);
		}
	}

	private void OnDisable()
	{
		Visuals.ResetRide();
	}

	private void OnDestroy()
	{
		Visuals.ResetRide();
	}

	private void OnApplicationQuit()
	{
		Visuals.ResetRide();
	}
}
public class LetItRideCard : CustomCard
{
	internal static CardInfo Card;

	private static GameObject _art;

	protected override string GetTitle()
	{
		return "Let It Ride";
	}

	protected override string GetDescription()
	{
		return "Hold W, A, S and D together to bet one of your cards on a slot machine. Win and you keep it and gain another for the rest of the match.";
	}

	protected override CardInfoStat[] GetStats()
	{
		return (CardInfoStat[])(object)new CardInfoStat[4]
		{
			Stat(positive: true, "Win a new card", "25%"),
			Stat(positive: true, "Nothing happens", "50%"),
			Stat(positive: false, "Lose the staked card", "25%"),
			Stat(positive: true, "Extra copies", "Shorter wait")
		};
	}

	private static CardInfoStat Stat(bool positive, string stat, string amount)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Expected O, but got Unknown
		return new CardInfoStat
		{
			positive = positive,
			stat = stat,
			amount = amount,
			simepleAmount = (SimpleAmount)0
		};
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)2;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)1;
	}

	public override string GetModName()
	{
		return "Let It Ride";
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		cardInfo.allowMultiple = true;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	protected override GameObject GetCardArt()
	{
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00b7: 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_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)
		//IL_00fa: Expected O, but got Unknown
		//IL_00fa: 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_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: 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_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Expected O, but got Unknown
		//IL_0179: Expected O, but got Unknown
		if ((Object)(object)_art != (Object)null)
		{
			return _art;
		}
		try
		{
			using Stream stream = typeof(LetItRideCard).Assembly.GetManifestResourceStream("LetItRide.Art.letitride.png");
			if (stream == null)
			{
				Plugin.Warn("Card art is missing from the DLL.");
				return null;
			}
			byte[] array = new byte[stream.Length];
			int num;
			for (int i = 0; i < array.Length; i += num)
			{
				num = stream.Read(array, i, array.Length - i);
				if (num <= 0)
				{
					break;
				}
			}
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			if (!ImageConversion.LoadImage(val, array))
			{
				return null;
			}
			((Texture)val).filterMode = (FilterMode)1;
			Object.DontDestroyOnLoad((Object)(object)val);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
			GameObject val2 = new GameObject("LIR_Art", new Type[1] { typeof(RectTransform) });
			Object.DontDestroyOnLoad((Object)val2);
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			((Graphic)obj).raycastTarget = false;
			((Graphic)obj).color = Color.white;
			RectTransform component = val2.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.pivot = new Vector2(0.5f, 0.5f);
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			((Transform)component).localScale = Vector3.one;
			_art = val2;
			return val2;
		}
		catch (Exception ex)
		{
			Plugin.Warn("Card art failed: " + ex.Message);
			return null;
		}
	}
}
public static class Machine
{
	internal sealed class State
	{
		internal float SpinFrom = -99f;

		internal float NextPull = -99f;

		internal float AskedAt = -99f;

		internal float NextTick;

		internal int Outcome;

		internal string Stake = "";

		internal string Prize = "";

		internal bool Shown = true;

		internal bool WasHeld;
	}

	internal const string Name = "Let It Ride";

	internal const int Win = 1;

	internal const int Nothing = 0;

	internal const int Loss = -1;

	internal const float SpinTime = 1.8f;

	internal const float ShowTime = 1.2f;

	internal const float Cooldown = 12f;

	internal static readonly Dictionary<int, State> States = new Dictionary<int, State>();

	private static Random _rng = Visuals.NewRandom();

	private static MethodInfo _remove;

	private static MethodInfo _allowed;

	private static FieldInfo _pool;

	private static bool _resolved;

	private static readonly Dictionary<string, FieldInfo> Actions = new Dictionary<string, FieldInfo>();

	private static PropertyInfo _isPressed;

	private static Func<KeyCode, bool> _getKey;

	private static bool _keysResolved;

	private static float _lastComplaint = -99f;

	internal static void Complain(Exception ex)
	{
		if (Time.unscaledTime - _lastComplaint > 5f)
		{
			_lastComplaint = Time.unscaledTime;
			Plugin.Warn((ex.InnerException ?? ex).GetType().Name + ": " + (ex.InnerException ?? ex).Message);
		}
	}

	internal static State Of(int playerId)
	{
		if (!States.TryGetValue(playerId, out var value))
		{
			value = new State();
			States[playerId] = value;
		}
		return value;
	}

	internal static int OutcomeOf(int roll)
	{
		return ((roll % 4 + 4) % 4) switch
		{
			3 => -1, 
			0 => 1, 
			_ => 0, 
		};
	}

	internal static float CooldownFor(int copies)
	{
		return 12f / (float)Math.Max(1, copies);
	}

	internal static int Copies(IList<CardInfo> held)
	{
		int num = 0;
		int num2 = 0;
		while (held != null && num2 < held.Count)
		{
			if ((Object)(object)held[num2] != (Object)null && string.Equals(held[num2].cardName, "Let It Ride", StringComparison.OrdinalIgnoreCase))
			{
				num++;
			}
			num2++;
		}
		return num;
	}

	internal static List<int> Stakes(IList<CardInfo> held)
	{
		List<int> list = new List<int>();
		int num = 0;
		while (held != null && num < held.Count)
		{
			if ((Object)(object)held[num] != (Object)null && !string.Equals(held[num].cardName, "Let It Ride", StringComparison.OrdinalIgnoreCase))
			{
				list.Add(num);
			}
			num++;
		}
		return list;
	}

	internal static List<CardInfo> Prizes(IList<CardInfo> pool, IList<CardInfo> held)
	{
		List<CardInfo> list = new List<CardInfo>();
		HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
		int num = 0;
		while (pool != null && num < pool.Count)
		{
			CardInfo val = pool[num];
			if (!((Object)(object)val == (Object)null) && !string.IsNullOrEmpty(val.cardName) && !string.Equals(val.cardName, "Let It Ride", StringComparison.OrdinalIgnoreCase) && hashSet.Add(val.cardName))
			{
				bool flag = false;
				int num2 = 0;
				while (held != null && num2 < held.Count)
				{
					if ((Object)(object)held[num2] != (Object)null && string.Equals(held[num2].cardName, val.cardName, StringComparison.OrdinalIgnoreCase))
					{
						flag = true;
					}
					num2++;
				}
				if (!flag || val.allowMultiple)
				{
					list.Add(val);
				}
			}
			num++;
		}
		return list;
	}

	internal static int Stopped(int outcome, int reel)
	{
		return outcome switch
		{
			-1 => 1, 
			1 => 0, 
			_ => 2 + reel, 
		};
	}

	private static bool IsMine(Player p)
	{
		if ((Object)(object)p == (Object)null)
		{
			return false;
		}
		if (PhotonNetwork.OfflineMode)
		{
			return true;
		}
		if ((Object)(object)p.data != (Object)null && (Object)(object)p.data.view != (Object)null)
		{
			return p.data.view.IsMine;
		}
		return false;
	}

	private static bool IsHost()
	{
		if (!PhotonNetwork.OfflineMode)
		{
			return PhotonNetwork.IsMasterClient;
		}
		return true;
	}

	private static bool Alive(Player p)
	{
		if ((Object)(object)p != (Object)null && (Object)(object)p.data != (Object)null && !p.data.dead)
		{
			return (Object)(object)p.data.healthHandler != (Object)null;
		}
		return false;
	}

	private static Player ById(int id)
	{
		if ((Object)(object)PlayerManager.instance == (Object)null || PlayerManager.instance.players == null)
		{
			return null;
		}
		foreach (Player player in PlayerManager.instance.players)
		{
			if ((Object)(object)player != (Object)null && player.playerID == id)
			{
				return player;
			}
		}
		return null;
	}

	private static bool? Pressed(Player p, string action)
	{
		try
		{
			if ((Object)(object)p.data == (Object)null || p.data.playerActions == null)
			{
				return null;
			}
			if (!Actions.TryGetValue(action, out var value))
			{
				value = AccessTools.Field(typeof(PlayerActions), action);
				Actions[action] = value;
			}
			if (value == null)
			{
				return null;
			}
			object value2 = value.GetValue(p.data.playerActions);
			if (value2 == null)
			{
				return null;
			}
			if (_isPressed == null)
			{
				_isPressed = AccessTools.Property(value2.GetType(), "IsPressed");
			}
			return (_isPressed == null) ? ((bool?)null) : new bool?((bool)_isPressed.GetValue(value2, null));
		}
		catch
		{
			return null;
		}
	}

	private static bool Key(KeyCode key)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		if (!_keysResolved)
		{
			_keysResolved = true;
			try
			{
				Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
				foreach (Assembly assembly in assemblies)
				{
					Type type = null;
					try
					{
						type = assembly.GetType("UnityEngine.Input", throwOnError: false);
					}
					catch
					{
					}
					if (!(type == null))
					{
						MethodInfo method = type.GetMethod("GetKey", BindingFlags.Static | BindingFlags.Public, null, new Type[1] { typeof(KeyCode) }, null);
						if (method != null)
						{
							_getKey = (Func<KeyCode, bool>)Delegate.CreateDelegate(typeof(Func<KeyCode, bool>), method);
						}
						break;
					}
				}
			}
			catch
			{
			}
		}
		if (_getKey != null)
		{
			return _getKey(key);
		}
		return false;
	}

	internal static bool AllFour(bool? up, bool? left, bool? down, bool? right, bool w, bool a, bool s, bool d)
	{
		if ((up == true || w) && (left == true || a) && (down == true || s))
		{
			return right == true || d;
		}
		return false;
	}

	private static bool LeverHeld(Player p, bool firstLocal)
	{
		bool? up = Pressed(p, "Up");
		bool? left = Pressed(p, "Left");
		bool? down = Pressed(p, "Down");
		bool? right = Pressed(p, "Right");
		return AllFour(up, left, down, right, firstLocal && Key((KeyCode)119), firstLocal && Key((KeyCode)97), firstLocal && Key((KeyCode)115), firstLocal && Key((KeyCode)100));
	}

	internal static void Tick()
	{
		if (!Visuals.CanReceiveSpin() || (Object)(object)PlayerManager.instance == (Object)null || PlayerManager.instance.players == null)
		{
			return;
		}
		List<Player> players = PlayerManager.instance.players;
		bool firstLocal = true;
		for (int i = 0; i < players.Count; i++)
		{
			Player val = players[i];
			if ((Object)(object)val == (Object)null || (Object)(object)val.data == (Object)null || val.data.currentCards == null)
			{
				continue;
			}
			try
			{
				bool flag = val.playerID < 100 && Copies(val.data.currentCards) > 0;
				if (States.TryGetValue(val.playerID, out var value))
				{
					goto IL_00cd;
				}
				if (!flag)
				{
					continue;
				}
				value = Of(val.playerID);
				goto IL_00cd;
				IL_00cd:
				if (flag && IsMine(val) && Alive(val))
				{
					Lever(val, value, firstLocal);
					firstLocal = false;
				}
				Spin(val, value);
			}
			catch (Exception ex)
			{
				Complain(ex);
			}
		}
	}

	private static void Lever(Player p, State s, bool firstLocal)
	{
		bool flag = LeverHeld(p, firstLocal);
		bool num = flag && !s.WasHeld;
		s.WasHeld = flag;
		if (num && !(Time.time < s.NextPull) && !(Time.time - s.AskedAt < 1f) && !(Time.time - s.SpinFrom < 3f))
		{
			s.AskedAt = Time.time;
			NetworkingManager.RPC(typeof(Machine), "RPC_Pull", new object[1] { p.playerID });
		}
	}

	private static void Resolve()
	{
		if (_resolved)
		{
			return;
		}
		_resolved = true;
		try
		{
			MethodInfo[] methods = typeof(Cards).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (MethodInfo methodInfo in methods)
			{
				ParameterInfo[] parameters = methodInfo.GetParameters();
				if (methodInfo.Name == "RemoveCardFromPlayer" && parameters.Length >= 2 && parameters[0].ParameterType == typeof(Player) && parameters[1].ParameterType == typeof(int))
				{
					_remove = methodInfo;
				}
				if (methodInfo.Name == "PlayerIsAllowedCard" && parameters.Length == 2 && parameters[0].ParameterType == typeof(Player) && parameters[1].ParameterType == typeof(CardInfo))
				{
					_allowed = methodInfo;
				}
			}
			_pool = AccessTools.Field(typeof(CardChoice), "cards");
			if (_remove == null)
			{
				Plugin.Warn("This version of ModdingUtils has no RemoveCardFromPlayer(player, index); a losing spin will not take the card.");
			}
		}
		catch (Exception ex)
		{
			Plugin.Warn(ex.Message);
		}
	}

	private static IList<CardInfo> Pool()
	{
		Resolve();
		try
		{
			if (_pool != null && (Object)(object)CardChoice.instance != (Object)null && _pool.GetValue(CardChoice.instance) is CardInfo[] array && array.Length != 0)
			{
				return array;
			}
		}
		catch
		{
		}
		return Cards.all;
	}

	private static bool Allowed(Player p, CardInfo card)
	{
		try
		{
			if (_allowed != null && Cards.instance != null)
			{
				return (bool)_allowed.Invoke(Cards.instance, new object[2] { p, card });
			}
		}
		catch
		{
		}
		return true;
	}

	private static CardInfo Find(IList<CardInfo> cards, string name)
	{
		int num = 0;
		while (cards != null && num < cards.Count)
		{
			if ((Object)(object)cards[num] != (Object)null && string.Equals(cards[num].cardName, name, StringComparison.Ordinal))
			{
				return cards[num];
			}
			num++;
		}
		return null;
	}

	[UnboundRPC]
	public static void RPC_Pull(int pid)
	{
		if (!Visuals.CanPull(pid) || !IsHost())
		{
			return;
		}
		Player val = ById(pid);
		if ((Object)(object)val == (Object)null || (Object)(object)val.data == (Object)null || val.data.currentCards == null || !Alive(val) || Copies(val.data.currentCards) == 0)
		{
			return;
		}
		State state = Of(pid);
		if (Time.time - state.SpinFrom < 3f)
		{
			return;
		}
		List<int> list = Stakes(val.data.currentCards);
		if (list.Count == 0)
		{
			NetworkingManager.RPC(typeof(Machine), "RPC_Spin", new object[5] { pid, 0, -1, "", "" });
			return;
		}
		int num = list[_rng.Next(list.Count)];
		int num2 = OutcomeOf(_rng.Next(4));
		string text = "";
		if (num2 == 1)
		{
			List<CardInfo> list2 = Prizes(Pool(), val.data.currentCards);
			for (int num3 = list2.Count - 1; num3 >= 0; num3--)
			{
				if (!Allowed(val, list2[num3]))
				{
					list2.RemoveAt(num3);
				}
			}
			if (list2.Count == 0)
			{
				num2 = 0;
			}
			else
			{
				text = list2[_rng.Next(list2.Count)].cardName;
			}
		}
		NetworkingManager.RPC(typeof(Machine), "RPC_Spin", new object[5]
		{
			pid,
			num2,
			num,
			val.data.currentCards[num].cardName,
			text
		});
	}

	[UnboundRPC]
	public static void RPC_Spin(int pid, int outcome, int stakeIndex, string stake, string prize)
	{
		//IL_0101: 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)
		if (!Visuals.CanReceiveSpin())
		{
			return;
		}
		State state = Of(pid);
		Player val = ById(pid);
		state.Outcome = outcome;
		state.Stake = stake ?? "";
		state.Prize = prize ?? "";
		state.NextPull = Time.time + 1.8f + CooldownFor((!((Object)(object)val != (Object)null) || !((Object)(object)val.data != (Object)null)) ? 1 : Copies(val.data.currentCards));
		if ((Object)(object)val == (Object)null)
		{
			return;
		}
		if (stakeIndex < 0)
		{
			FloatingLabel.Show(val, "NOTHING TO BET", new Color(1f, 1f, 1f, 1f));
			return;
		}
		state.SpinFrom = Time.time;
		state.Shown = false;
		FloatingLabel.Show(val, "BET " + state.Stake, new Color(1f, 0.85f, 0.3f, 1f));
		Draw.Play(1, 0.5f);
		if (IsHost() && (Object)(object)Plugin.Instance != (Object)null)
		{
			((MonoBehaviour)Plugin.Instance).StartCoroutine(Settle(val, outcome, stakeIndex, state.Stake, state.Prize));
		}
	}

	private static IEnumerator Settle(Player p, int outcome, int stakeIndex, string stake, string prize)
	{
		float wait = 0f;
		while (wait < 1.8f)
		{
			wait += ((Time.deltaTime > 0f) ? Time.deltaTime : 0f);
			yield return null;
		}
		if ((Object)(object)p == (Object)null || (Object)(object)p.data == (Object)null || p.data.currentCards == null)
		{
			yield break;
		}
		try
		{
			Resolve();
			Cards instance = Cards.instance;
			switch (outcome)
			{
			case 1:
			{
				CardInfo val = Find(Pool(), prize) ?? Find(Cards.all, prize);
				if ((Object)(object)val != (Object)null)
				{
					instance.AddCardToPlayer(p, val, false, string.Empty, 0f, 0f, true);
					Plugin.Log("Player " + p.playerID + " staked " + stake + " and won " + prize + ".");
				}
				break;
			}
			case -1:
			{
				List<CardInfo> currentCards = p.data.currentCards;
				int num = ((stakeIndex < currentCards.Count && (Object)(object)currentCards[stakeIndex] != (Object)null && currentCards[stakeIndex].cardName == stake) ? stakeIndex : (-1));
				int num2 = 0;
				while (num < 0 && num2 < currentCards.Count)
				{
					if ((Object)(object)currentCards[num2] != (Object)null && currentCards[num2].cardName == stake)
					{
						num = num2;
					}
					num2++;
				}
				if (num >= 0 && _remove != null)
				{
					ParameterInfo[] parameters = _remove.GetParameters();
					object[] array = new object[parameters.Length];
					array[0] = p;
					array[1] = num;
					for (int i = 2; i < parameters.Length; i++)
					{
						array[i] = (parameters[i].HasDefaultValue ? parameters[i].DefaultValue : ((parameters[i].ParameterType == typeof(bool)) ? ((object)true) : null));
					}
					Visuals.StartReturnedCoroutine(_remove.Invoke(instance, array));
					Plugin.Log("Player " + p.playerID + " staked " + stake + " and lost it.");
				}
				break;
			}
			}
		}
		catch (Exception ex)
		{
			Plugin.Warn("Could not change cards: " + (ex.InnerException ?? ex).Message);
		}
	}

	private static Color Symbol(int index)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: 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)
		return (Color)(((index % 5 + 5) % 5) switch
		{
			0 => new Color(1f, 0.82f, 0.2f, 1f), 
			1 => new Color(0.95f, 0.25f, 0.3f, 1f), 
			2 => new Color(0.4f, 0.85f, 1f, 1f), 
			3 => new Color(0.5f, 1f, 0.55f, 1f), 
			_ => new Color(0.8f, 0.5f, 1f, 1f), 
		});
	}

	private static void Spin(Player p, State s)
	{
		//IL_004d: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: 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_00e1: 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_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: 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_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: 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_01c8: 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_01e1: 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_01f3: 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_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_040c: 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_0450: Unknown result type (might be due to invalid IL or missing references)
		string text = "slot" + p.playerID + "_";
		float num = Time.time - s.SpinFrom;
		if (num < 0f || num > 3f || !Alive(p))
		{
			Draw.Off(text);
			return;
		}
		float num2 = Mathf.Clamp(Mathf.Abs(((Component)p).transform.localScale.x), 0.6f, 4f);
		Vector2 val = Vector2.op_Implicit(((Component)p).transform.position) + new Vector2(0f, 2.3f * num2);
		LegacyLine(text + "box", val + new Vector2(-1.05f, 0f), val + new Vector2(1.05f, 0f), 0.95f, new Color(0.75f, 0.12f, 0.16f, 1f), 11);
		LegacyLine(text + "top", val + new Vector2(-1.05f, 0.5f), val + new Vector2(1.05f, 0.5f), 0.14f, new Color(1f, 0.82f, 0.2f, 1f), 12);
		LegacyLine(text + "base", val + new Vector2(-1.15f, -0.5f), val + new Vector2(1.15f, -0.5f), 0.14f, new Color(1f, 0.82f, 0.2f, 1f), 12);
		float num3 = Mathf.Clamp01(num / 0.25f) * (1f - Mathf.Clamp01((num - 0.25f) / 0.3f));
		Vector2 val2 = val + new Vector2(1.4f, 0.45f - 0.7f * num3);
		LegacyLine(text + "arm", val + new Vector2(1.05f, -0.1f), val2, 0.08f, new Color(0.8f, 0.82f, 0.86f, 1f), 12);
		LegacyDot(text + "knob", val2, 0.26f, new Color(1f, 0.2f, 0.2f, 1f), 13);
		for (int i = 0; i < 3; i++)
		{
			Vector2 val3 = val + new Vector2((float)(i - 1) * 0.65f, 0f);
			LegacyLine(text + "win" + i, val3 + new Vector2(-0.26f, 0f), val3 + new Vector2(0.26f, 0f), 0.6f, new Color(1f, 1f, 1f, 1f), 12);
			float num4 = 1.8f * (0.55f + 0.2f * (float)i);
			int index = ((num < num4) ? ((int)(Time.time * 14f) + i * 2) : Stopped(s.Outcome, i));
			LegacyDot(text + "sym" + i, val3, 0.38f, Symbol(index), 13);
		}
		if (num < 1.8f && Time.time >= s.NextTick)
		{
			s.NextTick = Time.time + 0.09f;
			Draw.Play(0, 0.25f);
		}
		if (num >= 1.8f && !s.Shown)
		{
			s.Shown = true;
			if (s.Outcome == 1)
			{
				Draw.Confetti(val, 60, _rng);
				Draw.Confetti(Vector2.op_Implicit(((Component)p).transform.position), 30, _rng);
				Draw.Play(2, 0.6f);
				FloatingLabel.Show(p, "WIN  +" + s.Prize, new Color(1f, 0.85f, 0.3f, 1f));
			}
			else if (s.Outcome == -1)
			{
				Draw.Play(3, 0.5f);
				FloatingLabel.Show(p, "LOST  -" + s.Stake, new Color(1f, 0.3f, 0.3f, 1f));
			}
			else
			{
				Draw.Play(0, 0.4f);
				FloatingLabel.Show(p, "NO LUCK", new Color(0.85f, 0.85f, 0.9f, 1f));
			}
		}
	}

	private static void LegacyLine(string key, Vector2 a, Vector2 b, float width, Color colour, int order)
	{
	}

	private static void LegacyDot(string key, Vector2 at, float scale, Color colour, int order)
	{
	}
}
internal static class PixelFont
{
	private static readonly Dictionary<char, string> Rows = new Dictionary<char, string>
	{
		{ 'A', "01110100011000111111100011000110001" },
		{ 'B', "11110100011000111110100011000111110" },
		{ 'C', "01110100011000010000100001000101110" },
		{ 'D', "11110100011000110001100011000111110" },
		{ 'E', "11111100001000011110100001000011111" },
		{ 'F', "11111100001000011110100001000010000" },
		{ 'G', "01110100011000010111100011000101111" },
		{ 'H', "10001100011000111111100011000110001" },
		{ 'I', "01110001000010000100001000010001110" },
		{ 'J', "00111000100001000010000101001001100" },
		{ 'K', "10001100101010011000101001001010001" },
		{ 'L', "10000100001000010000100001000011111" },
		{ 'M', "10001110111010110101100011000110001" },
		{ 'N', "10001100011100110101100111000110001" },
		{ 'O', "01110100011000110001100011000101110" },
		{ 'P', "11110100011000111110100001000010000" },
		{ 'Q', "01110100011000110001101011001001101" },
		{ 'R', "11110100011000111110101001001010001" },
		{ 'S', "01111100001000001110000010000111110" },
		{ 'T', "11111001000010000100001000010000100" },
		{ 'U', "10001100011000110001100011000101110" },
		{ 'V', "10001100011000110001100010101000100" },
		{ 'W', "10001100011000110101101011010101010" },
		{ 'X', "10001100010101000100010101000110001" },
		{ 'Y', "10001100010101000100001000010000100" },
		{ 'Z', "11111000010001000100010001000011111" },
		{ '0', "01110100011001110101110011000101110" },
		{ '1', "00100011000010000100001000010001110" },
		{ '2', "01110100010000100010001000100011111" },
		{ '3', "11111000100010000010000011000101110" },
		{ '4', "00010001100101010010111110001000010" },
		{ '5', "11111100001111000001000011000101110" },
		{ '6', "00110010001000011110100011000101110" },
		{ '7', "11111000010001000100010000100001000" },
		{ '8', "01110100011000101110100011000101110" },
		{ '9', "01110100011000101111000010001001100" },
		{ '/', "00001000100001000100010000100010000" },
		{ '!', "00100001000010000100001000000000100" },
		{ '-', "00000000000000011111000000000000000" },
		{ '.', "00000000000000000000000000110001100" },
		{ ':', "00000011000110000000011000110000000" },
		{ '\'', "00100001000100000000000000000000000" },
		{ '+', "00000001000010011111001000010000000" }
	};

	private static readonly Dictionary<char, Sprite> Cache = new Dictionary<char, Sprite>();

	internal static Sprite Glyph(char c)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		c = char.ToUpperInvariant(c);
		if (Cache.TryGetValue(c, out var value) && (Object)(object)value != (Object)null)
		{
			return value;
		}
		if (!Rows.TryGetValue(c, out var value2))
		{
			return null;
		}
		Texture2D val = new Texture2D(5, 7, (TextureFormat)4, false);
		((Texture)val).filterMode = (FilterMode)0;
		for (int i = 0; i < 7; i++)
		{
			for (int j = 0; j < 5; j++)
			{
				val.SetPixel(j, 6 - i, (value2[i * 5 + j] != '1') ? Color.clear : Color.white);
			}
		}
		val.Apply();
		Object.DontDestroyOnLoad((Object)(object)val);
		value = Sprite.Create(val, new Rect(0f, 0f, 5f, 7f), new Vector2(0f, 1f), 1f);
		Cache[c] = value;
		return value;
	}

	internal static bool Has(char c)
	{
		return Rows.ContainsKey(char.ToUpperInvariant(c));
	}
}
internal sealed class PixelText
{
	private readonly Transform _root;

	private readonly List<SpriteRenderer> _fg = new List<SpriteRenderer>();

	private readonly List<SpriteRenderer> _bg = new List<SpriteRenderer>();

	private string _text = string.Empty;

	private readonly int _order;

	internal PixelText(Transform parent, int order)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		_root = new GameObject("LIR_Text").transform;
		_root.SetParent(parent, false);
		_order = order;
	}

	internal float Width(float px)
	{
		if (_text.Length == 0)
		{
			return 0f;
		}
		return (float)(_text.Length * 6 - 1) * px;
	}

	internal void Set(string text, Color color, Vector2 centerTop, float px, float alpha)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		text = (text ?? string.Empty).ToUpperInvariant();
		if (text != _text)
		{
			Rebuild(text);
		}
		float num = centerTop.x - Width(px) * 0.5f;
		float num2 = px * 0.6f;
		Vector3 val3 = default(Vector3);
		for (int i = 0; i < _fg.Count; i++)
		{
			SpriteRenderer val = _fg[i];
			SpriteRenderer val2 = _bg[i];
			if ((Object)(object)val.sprite == (Object)null)
			{
				((Renderer)val).enabled = false;
				((Renderer)val2).enabled = false;
				continue;
			}
			((Renderer)val).enabled = alpha > 0.01f;
			((Renderer)val2).enabled = ((Renderer)val).enabled;
			((Vector3)(ref val3))..ctor(num + (float)(i * 6) * px, centerTop.y, 0f);
			((Component)val).transform.position = val3;
			((Component)val2).transform.position = val3 + new Vector3(num2, 0f - num2, 0f);
			((Component)val).transform.localScale = new Vector3(px, px, 1f);
			((Component)val2).transform.localScale = new Vector3(px, px, 1f);
			val.color = new Color(color.r, color.g, color.b, color.a * alpha);
			val2.color = new Color(0f, 0f, 0f, 0.55f * alpha);
		}
	}

	internal void Hide()
	{
		foreach (SpriteRenderer item in _fg)
		{
			((Renderer)item).enabled = false;
		}
		foreach (SpriteRenderer item2 in _bg)
		{
			((Renderer)item2).enabled = false;
		}
	}

	private void Rebuild(string text)
	{
		//IL_000f: 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)
		_text = text;
		while (_fg.Count < text.Length)
		{
			SpriteRenderer val = Draw.MakeSprite("LIR_Glyph", null, Color.black, _order);
			((Component)val).transform.SetParent(_root, false);
			SpriteRenderer val2 = Draw.MakeSprite("LIR_Glyph", null, Color.white, _order + 1);
			((Component)val2).transform.SetParent(_root, false);
			_bg.Add(val);
			_fg.Add(val2);
		}
		for (int i = 0; i < _fg.Count; i++)
		{
			Sprite sprite = ((i >= text.Length) ? null : PixelFont.Glyph(text[i]));
			_fg[i].sprite = sprite;
			_bg[i].sprite = sprite;
		}
	}
}

CodyGunCards.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CodyGunCards.Cards;
using CodyGunCards.Core;
using CodyGunCards.Extras;
using CodyGunCards.Modes;
using CodyGunCards.Presentation;
using CodyGunCards.Runtime;
using HarmonyLib;
using ModdingUtils.Utils;
using Photon.Pun;
using Photon.Realtime;
using Sonigon;
using SoundImplementation;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Extensions;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CodyGunCards")]
[assembly: AssemblyFileVersion("1.11.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.11.0.0")]
[module: UnverifiableCode]
namespace CodyGunCards
{
	internal static class VeryRare
	{
		internal const string Name = "Very Rare";

		internal const float Weight = 0.04f;

		private static bool _resolved;

		private static Rarity _value = (Rarity)2;

		internal static Rarity Value
		{
			get
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: 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_006d: Unknown result type (might be due to invalid IL or missing references)
				if (_resolved)
				{
					return _value;
				}
				try
				{
					Type type = AccessTools.TypeByName("RarityLib.Utils.RarityUtils");
					MethodInfo methodInfo = ((!(type == null)) ? AccessTools.Method(type, "GetRarity", new Type[1] { typeof(string) }, (Type[])null) : null);
					if (methodInfo != null)
					{
						Rarity val = (Rarity)methodInfo.Invoke(null, new object[1] { "Very Rare" });
						if ((int)val != 0)
						{
							_value = val;
						}
					}
					_resolved = true;
				}
				catch
				{
				}
				return _value;
			}
		}

		internal static void Register()
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Type type = AccessTools.TypeByName("RarityLib.Utils.RarityUtils");
				MethodInfo methodInfo = ((!(type == null)) ? AccessTools.Method(type, "AddRarity", new Type[4]
				{
					typeof(string),
					typeof(float),
					typeof(Color),
					typeof(Color)
				}, (Type[])null) : null);
				if (methodInfo == null)
				{
					Plugin.Warn("RarityLib not found; Very Rare cards fall back to Rare.");
					return;
				}
				methodInfo.Invoke(null, new object[4]
				{
					"Very Rare",
					0.04f,
					(object)new Color(1f, 0.45f, 0.05f),
					(object)new Color(0.55f, 0.25f, 0.05f)
				});
			}
			catch (Exception ex)
			{
				Plugin.Warn("Could not register Very Rare: " + ex.Message);
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.cody.rounds.codyguncards", "Ratpack", "1.12.0")]
	[BepInProcess("Rounds.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public const string ModId = "com.cody.rounds.codyguncards";

		public const string ModName = "Ratpack";

		public const string Version = "1.12.0";

		public const string ModInitials = "Ratpack";

		internal static ConfigEntry<int> BestWave;

		internal static ConfigEntry<int> BestBoss;

		internal static ConfigEntry<int> BossClears;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			Instance = this;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Ratpack 1.12.0 loading");
			BindConfig();
			VeryRare.Register();
			Harmony val = new Harmony("com.cody.rounds.codyguncards");
			Type[] types;
			try
			{
				types = typeof(Plugin).Assembly.GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				types = ex.Types;
			}
			Type[] array = types;
			foreach (Type type in array)
			{
				if (!(type == null))
				{
					try
					{
						val.CreateClassProcessor(type).Patch();
					}
					catch (Exception ex2)
					{
						((BaseUnityPlugin)this).Logger.LogWarning((object)("Harmony skipped " + type.FullName + ": " + ex2.Message));
					}
				}
			}
		}

		private void Start()
		{
			Boot.OnStart(this);
			Build<LaserCard>(delegate(CardInfo c)
			{
				LaserCard.Card = c;
			});
			Build<MinesCard>(delegate(CardInfo c)
			{
				MinesCard.Card = c;
			});
			Build<HarpoonCard>(delegate(CardInfo c)
			{
				HarpoonCard.Card = c;
			});
			Build<SawbladeCard>(delegate(CardInfo c)
			{
				SawbladeCard.Card = c;
			});
			Build<LightningArcCard>(delegate(CardInfo c)
			{
				LightningArcCard.Card = c;
			});
			Build<GravityWellCard>(delegate(CardInfo c)
			{
				GravityWellCard.Card = c;
			});
			Build<SplitterPodsCard>(delegate(CardInfo c)
			{
				SplitterPodsCard.Card = c;
			});
			Build<RemoteChargesCard>(delegate(CardInfo c)
			{
				RemoteChargesCard.Card = c;
			});
			Build<RailgunCard>(delegate(CardInfo c)
			{
				RailgunCard.Card = c;
			});
			Build<ChargeCannonCard>(delegate(CardInfo c)
			{
				ChargeCannonCard.Card = c;
			});
			Build<BoxLauncherCard>(delegate(CardInfo c)
			{
				BoxLauncherCard.Card = c;
			});
			Build<ShockwaveCard>(delegate(CardInfo c)
			{
				ShockwaveCard.Card = c;
			});
			Build<BipolarCard>(delegate(CardInfo c)
			{
				BipolarCard.Card = c;
			});
			Build<BlackHoleRoundCard>(delegate(CardInfo c)
			{
				BlackHoleRoundCard.Card = c;
			});
			Build<BreakawayArmourCard>(delegate(CardInfo c)
			{
				BreakawayArmourCard.Card = c;
			});
			Build<DeadMansSwitchCard>(delegate(CardInfo c)
			{
				DeadMansSwitchCard.Card = c;
			});
			Build<PorcupineCard>(delegate(CardInfo c)
			{
				PorcupineCard.Card = c;
			});
			Build<BorrowedCoverCard>(delegate(CardInfo c)
			{
				BorrowedCoverCard.Card = c;
			});
			Build<EmergencyExitCard>(delegate(CardInfo c)
			{
				EmergencyExitCard.Card = c;
			});
			Build<CounterweightCard>(delegate(CardInfo c)
			{
				CounterweightCard.Card = c;
			});
			Build<PickpocketCard>(delegate(CardInfo c)
			{
				PickpocketCard.Card = c;
			});
			Build<EmergencyUnzipCard>(delegate(CardInfo c)
			{
				EmergencyUnzipCard.Card = c;
			});
			Build<MovingDayCard>(delegate(CardInfo c)
			{
				MovingDayCard.Card = c;
			});
			Build<ReloadRelayCard>(delegate(CardInfo c)
			{
				ReloadRelayCard.Card = c;
			});
			Build<HostileArchitectureCard>(delegate(CardInfo c)
			{
				HostileArchitectureCard.Card = c;
			});
			Build<HotPotatoCard>(delegate(CardInfo c)
			{
				HotPotatoCard.Card = c;
			});
			Build<ReversePickpocketCard>(delegate(CardInfo c)
			{
				ReversePickpocketCard.Card = c;
			});
			Build<FrictionlessCard>(delegate(CardInfo c)
			{
				FrictionlessCard.Card = c;
			});
			Build<PacemakerCard>(delegate(CardInfo c)
			{
				PacemakerCard.Card = c;
			});
			Build<UnfinishedBusinessCard>(delegate(CardInfo c)
			{
				UnfinishedBusinessCard.Card = c;
			});
			Build<HeavyCrownCard>(delegate(CardInfo c)
			{
				HeavyCrownCard.Card = c;
			});
			Build<KickflipCard>(delegate(CardInfo c)
			{
				KickflipCard.Card = c;
			});
			Build<BulletRiderCard>(delegate(CardInfo c)
			{
				BulletRiderCard.Card = c;
			});
			Build<ContactSportCard>(delegate(CardInfo c)
			{
				ContactSportCard.Card = c;
			});
			Build<KineticHammerCard>(delegate(CardInfo c)
			{
				KineticHammerCard.Card = c;
			});
			Build<PaintballCard>(delegate(CardInfo c)
			{
				PaintballCard.Card = c;
			});
			Build<BlackPowderCard>(delegate(CardInfo c)
			{
				BlackPowderCard.Card = c;
			});
			Build<WreckingBallCard>(delegate(CardInfo c)
			{
				WreckingBallCard.Card = c;
			});
			Build<FeatherfallCard>(delegate(CardInfo c)
			{
				FeatherfallCard.Card = c;
			});
			Build<SkatingRinkCard>(delegate(CardInfo c)
			{
				SkatingRinkCard.Card = c;
			});
			Build<PassengerCard>(delegate(CardInfo c)
			{
				PassengerCard.Card = c;
			});
			Build<HeadroomCard>(delegate(CardInfo c)
			{
				HeadroomCard.Card = c;
			});
			Build<LastWordCard>(delegate(CardInfo c)
			{
				LastWordCard.Card = c;
			});
			Build<VacuumChamberCard>(delegate(CardInfo c)
			{
				VacuumChamberCard.Card = c;
			});
			Build<StiltsCard>(delegate(CardInfo c)
			{
				StiltsCard.Card = c;
			});
			Build<CatapultCard>(delegate(CardInfo c)
			{
				CatapultCard.Card = c;
			});
			Build<HandshakeCard>(delegate(CardInfo c)
			{
				HandshakeCard.Card = c;
			});
			Build<PlungeCard>(delegate(CardInfo c)
			{
				PlungeCard.Card = c;
			});
			Build<KatanaCard>(delegate(CardInfo c)
			{
				KatanaCard.Card = c;
			});
			((Component)this).gameObject.AddComponent<PerkWatcher>();
			RegisterModes();
			HammerFilter.Register();
			try
			{
				GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)ClearWorld);
				GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart);
				GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)OnPointStart);
				GameModeManager.AddHook("RoundStart", (Func<IGameModeHandler, IEnumerator>)OnPointStart);
				GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)ClearWorld);
				GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)ClearWorld);
				Bipolar.RegisterHooks();
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Game mode hooks failed: " + ex));
			}
			try
			{
				Unbound.RegisterCredits("Ratpack", new string[1] { "Cody" }, new string[0], new string[0]);
			}
			catch (Exception ex2)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Credits skipped: " + ex2.Message));
			}
			Visuals.Prepare();
			Visuals.InstallGameplay();
		}

		private void RegisterModes()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			try
			{
				GameModeManager.AddHandler<GM_Waves>("Waves", (IGameModeHandler)new WavesHandler());
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Waves mode failed: " + ex));
			}
			try
			{
				GameModeManager.AddHandler<GM_BossRush>("Boss Rush", (IGameModeHandler)new BossRushHandler());
			}
			catch (Exception ex2)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Boss Rush mode failed: " + ex2));
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private void BindConfig()
		{
			try
			{
				BestWave = ((BaseUnityPlugin)this).Config.Bind<int>("Records", "Best Wave", 0, "Highest wave cleared in Waves.");
				BestBoss = ((BaseUnityPlugin)this).Config.Bind<int>("Records", "Furthest Boss", 0, "Most bosses beaten in one Boss Rush run.");
				BossClears = ((BaseUnityPlugin)this).Config.Bind<int>("Records", "Boss Rush Clears", 0, "Full Boss Rush clears.");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Records skipped: " + ex.Message));
			}
			try
			{
				Controls.CrouchKeys = Controls.ParseKeys(((BaseUnityPlugin)this).Config.Bind<string>("Controls", "Crouch", "S, DownArrow", "Keys for Plunge (dive), Catapult (hold), Skating Rink (brake), Featherfall (fold wings) and letting go of a ceiling.").Value, Controls.CrouchKeys);
				Controls.UpKeys = Controls.ParseKeys(((BaseUnityPlugin)this).Config.Bind<string>("Controls", "Up", "W, UpArrow", "Keys for Stilts (hold on the ground) and climbing walls with Headroom. While a card uses this key the game's jump on it is swallowed; Space still jumps.").Value, Controls.UpKeys);
				Controls.JumpKeys = Controls.ParseKeys(((BaseUnityPlugin)this).Config.Bind<string>("Controls", "Jump", "Space", "Jump key for Featherfall (hold in the air to glide), Bullet Rider (hold while firing) and jumping off a wall or ceiling.").Value, Controls.JumpKeys);
				Controls.LeftKeys = Controls.ParseKeys(((BaseUnityPlugin)this).Config.Bind<string>("Controls", "Left", "A, LeftArrow", "Steering left while gliding, skating or on a ceiling.").Value, Controls.LeftKeys);
				Controls.RightKeys = Controls.ParseKeys(((BaseUnityPlugin)this).Config.Bind<string>("Controls", "Right", "D, RightArrow", "Steering right while gliding, skating or on a ceiling.").Value, Controls.RightKeys);
				Controls.Debug = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Log card activity", false, "Writes a line to the BepInEx log whenever a movement card starts or stops doing something. Turn on if a card seems dead and send the log.").Value;
			}
			catch (Exception ex2)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Controls config skipped: " + ex2.Message));
			}
			try
			{
				Sfx.Volume = Mathf.Clamp01(((BaseUnityPlugin)this).Config.Bind<float>("Sound", "Volume", 0.5f, "Loudness of this mod's own sound effects, 0 (silent) to 1. Game sounds (explosions, hits) follow the game's volume.").Value);
				((BaseUnityPlugin)this).Logger.LogInfo((object)("Sound volume " + Sfx.Volume.ToString("0.00")));
			}
			catch (Exception ex3)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Config skipped: " + ex3.Message));
			}
		}

		private void Build<T>(Action<CardInfo> store) where T : CustomCard
		{
			try
			{
				CustomCard.BuildCard<T>((Action<CardInfo>)delegate(CardInfo c)
				{
					store(c);
					<>n__0().LogInfo((object)("Registered card: " + ((!((Object)(object)c != (Object)null)) ? typeof(T).Name : c.cardName)));
				});
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Could not build " + typeof(T).Name + ": " + ex));
			}
		}

		private static IEnumerator ClearWorld(IGameModeHandler gm)
		{
			Guard.Hazards_ClearAll();
			Guard.Perks_ResetAll();
			Guard.Tricks_ResetAll();
			Guard.Moves_ResetAll();
			Guard.Arsenal_ResetAll();
			Guard.Movement_ResetAll();
			Guard.Bipolar_ClearAll();
			Guard.GunController_ResetAll();
			Guard.HarpoonLine_ResetAll();
			Guard.LaunchedBox_ClearAll();
			yield break;
		}

		private static IEnumerator OnGameStart(IGameModeHandler gm)
		{
			Bipolar.ClearAll();
			yield break;
		}

		private static IEnumerator OnPointStart(IGameModeHandler gm)
		{
			Guard.Hazards_ClearAll();
			Guard.Perks_ResetAll();
			Guard.Tricks_ResetAll();
			Guard.Moves_ResetAll();
			Guard.Arsenal_ResetAll();
			Guard.Movement_ResetAll();
			Guard.Bipolar_ClearAll();
			Guard.GunController_ResetAll();
			Guard.HarpoonLine_ResetAll();
			Guard.LaunchedBox_ClearAll();
			Guard.Loadout_EnforceMagazines();
			yield break;
		}

		internal static void Log(string message)
		{
			if ((Object)(object)Instance != (Object)null)
			{
				((BaseUnityPlugin)Instance).Logger.LogInfo((object)message);
			}
		}

		internal static void Warn(string message)
		{
			if ((Object)(object)Instance != (Object)null)
			{
				((BaseUnityPlugin)Instance).Logger.LogWarning((object)message);
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private ManualLogSource <>n__0()
		{
			return ((BaseUnityPlugin)this).Logger;
		}
	}
}
namespace CodyGunCards.Core
{
	public static class Rules
	{
		public const double BaseHealth = 100.0;

		public const double LaserBaseDuration = 5.0;

		public const double LaserReload = 5.0;

		public const double LaserBaseDps = 33.333333333333336;

		public const double GravityDuration = 0.5;

		public const double MineDirectMultiplier = 0.5;

		public const double MineBlastMultiplier = 1.25;

		public const double SplitDelay = 0.8;

		public const int SplitChildren = 6;

		public const double SplitChildMultiplier = 0.25;

		public const double SawDuration = 5.0;

		public const double MineFuse = 15.0;

		public const double SawHitMultiplier = 0.4;

		public const double LightningMultiplier = 0.6;

		public const double RailWindup = 1.0;

		public const double ChargeTime = 2.0;

		public const double FullChargeMultiplier = 2.5;

		public const int RemoteLimit = 4;

		public const double VeryRareRelativeWeight = 0.025;

		public const double RareRelativeWeight = 0.1;

		public const double MineArmDelay = 0.4;

		public const int MineLimit = 8;

		public const double SurfaceSpawnInterval = 0.5;

		public const double SawTargetInterval = 0.25;

		public static readonly IReadOnlyList<Card> Cards = Array.AsReadOnly(new Card[49]
		{
			new Card(Weapon.Laser, "Laser", Tier.VeryRare, "5s beam, then 5s reload. Each extra projectile adds 1s and multiplies DPS by 0.9. Bounces become reflections. Other cards reshape the beam."),
			new Card(Weapon.Mines, "Mines", Tier.Uncommon, "Direct hits consume the mine for 50% bullet damage. Floor mines detonate on proximity for 125%."),
			new Card(Weapon.Harpoon, "Harpoon", Tier.Uncommon, "Pull hit opponents towards you; hitting terrain pulls you towards the anchor. One-shot magazine; 3s base reload."),
			new Card(Weapon.Sawblade, "Sawblade", Tier.Uncommon, "A blade follows terrain for 4s. Deals 40% bullet damage per contact with a per-target cooldown."),
			new Card(Weapon.LightningArc, "Lightning Arc", Tier.Uncommon, "Short-range electrical attack; chains a weaker arc to a nearby opponent. 40% less damage."),
			new Card(Weapon.GravityWell, "Gravity Well", Tier.Rare, "An anchored orb pulls players and projectiles for 0.5s, then bursts. One-shot magazine; pulls its owner too."),
			new Card(Weapon.SplitterPods, "Splitter Pods", Tier.Rare, "After 0.8s a harmless pod releases six radial children, each dealing 25% bullet damage. Children cannot split again."),
			new Card(Weapon.RemoteCharges, "Remote Charges", Tier.Rare, "Plant up to four charges. A successful block activation detonates them for 125% bullet damage each."),
			new Card(Weapon.Railgun, "Railgun", Tier.VeryRare, "One piercing ray per magazine after a visible 1s wind-up."),
			new Card(Weapon.ChargeCannon, "Charge Cannon", Tier.Rare, "Hold fire up to 2s to charge. Full charge deals 250% damage and consumes the magazine. Slower movement while charging."),
			new Card(Weapon.BoxLauncher, "Box Launcher", Tier.Uncommon, "Fires crates that smash into players, then land as solid terrain for 10s."),
			new Card(Weapon.Shockwave, "Shockwave", Tier.Rare, "Impacts release an expanding wave that throws players and bullets away."),
			new Card(Weapon.Bipolar, "Bipolar", Tier.VeryRare, "A real second player joins each battle on your team with a copy of your cards. It walks, jumps, aims, blocks and fires when you do, has its own health and dies when you die."),
			new Card(Weapon.BlackHoleRound, "Black Hole Round", Tier.VeryRare, "A slow, heavy orb that sucks in nearby bullets and drags enemies along, slamming them into whatever it hits."),
			new Card(Weapon.BreakawayArmour, "Breakaway Armour", Tier.Uncommon, "A hit over 25% of your max health sheds a shell: the hit is halved and you're launched away. One shell per life."),
			new Card(Weapon.DeadMansSwitch, "Dead Man's Switch", Tier.Common, "Taking damage arms a pulse for 0.75s. Blocking in that window pushes nearby enemies and bullets away."),
			new Card(Weapon.Porcupine, "Porcupine Principle", Tier.Uncommon, "Bullets that hit you leave shards (max 6). Your next block fires them outward for 8% max health each. Resets each round."),
			new Card(Weapon.BorrowedCover, "Borrowed Cover", Tier.Common, "Blocking on the ground pulls up a slab of cover in front of you for 2s. It stops your shots too."),
			new Card(Weapon.EmergencyExit, "Emergency Exit", Tier.Rare, "Hold block to mark a spot. Your next lethal hit returns you there with 1 HP. Once per life."),
			new Card(Weapon.Counterweight, "Counterweight", Tier.Common, "Absorbs part of incoming knockback. Your next jump releases it as extra lift. Slower while storing."),
			new Card(Weapon.Pickpocket, "Pickpocket", Tier.Common, "Passing close to an opponent takes one loaded round from them. 3s per opponent; never their last round."),
			new Card(Weapon.EmergencyUnzip, "Emergency Unzip", Tier.Rare, "A lethal hit splits you in two. Reach your other half within 3s to reform with 20% health. Once per life."),
			new Card(Weapon.MovingDay, "Moving Day", Tier.Common, "Blocking against a wall slides you along it and around the next corner, ceilings included."),
			new Card(Weapon.ReloadRelay, "Reload Relay", Tier.Common, "Reloading ejects a glowing magazine into the arena. Catch it to finish the reload at once."),
			new Card(Weapon.HostileArchitecture, "Hostile Architecture", Tier.Uncommon, "Two shots into terrain mark two points. Blocking builds a temporary solid bridge between them."),
			new Card(Weapon.HotPotato, "Hot Potato", Tier.Rare, "First hit after reloading sticks a 5s bomb on the target. Touching another player passes it on."),
			new Card(Weapon.ReversePickpocket, "Reverse Pickpocket", Tier.Common, "Passing through an opponent loads a dud: their next shot is confetti and a hard recoil."),
			new Card(Weapon.Frictionless, "Frictionless", Tier.Uncommon, "Your movement leaves a short trail of slippery terrain. Anyone touching it keeps sliding until they leave it."),
			new Card(Weapon.Pacemaker, "Dance Dance", Tier.Uncommon, "Arrows fall towards a line above your head. Hold S and press each arrow's direction as it lands to heal; a streak heals more."),
			new Card(Weapon.UnfinishedBusiness, "Unfinished Business", Tier.Rare, "After dying, you briefly steer one moving piece of the arena and can ram it into your opponent."),
			new Card(Weapon.HeavyCrown, "Heavy Crown", Tier.Uncommon, "The player with the most health is heavier: harder to knock back, but slower and worse at jumping. The crown moves as health changes."),
			new Card(Weapon.Kickflip, "Kickflip", Tier.Rare, "Jump beside an enemy projectile to kick off it: you launch perpendicular to its path and it is deflected. Mistime it and it hits you."),
			new Card(Weapon.BulletRider, "Bullet Rider", Tier.VeryRare, "Hold jump while firing to ride your first projectile. Let go of jump to dismount with its momentum."),
			new Card(Weapon.ContactSport, "Contact Sport", Tier.Rare, "Colliding with an opponent swaps your velocities: rush into them to send them flying while you stop."),
			new Card(Weapon.KineticHammer, "Kinetic Hammer", Tier.Rare, "Your shot becomes a big hammer swing that also shoves terrain. Bullet damage and fire rate scale it; landing sends a 25% quake."),
			new Card(Weapon.Paintball, "Paintball", Tier.Rare, "A rapid paintball gun: less damage, faster fire, more ammo. Hits turn enemies your colour and your shots curve towards them. Blocking washes it off."),
			new Card(Weapon.BlackPowder, "Black Powder", Tier.Rare, "Your shots leave a powder trail for 6s. Any other bullet through it sets it burning along its length. Stacks make a bigger trail."),
			new Card(Weapon.WreckingBall, "Wrecking Ball", Tier.VeryRare, "Your weapon becomes a wrecking ball on a chain that obeys gravity and your momentum. Fire to fling it out for 1s before it swings back. It never hurts you and blocks enemy shots."),
			new Card(Weapon.Featherfall, "Featherfall", Tier.Rare, "Hold jump in the air to glide. Steer with A and D; let go or hold S to drop."),
			new Card(Weapon.SkatingRink, "Skating Rink", Tier.VeryRare, "You glide over any surface like ice: speed keeps building, uphill included, and carries. Hold S or push the other way to stop."),
			new Card(Weapon.Passenger, "Passenger", Tier.Rare, "Standing on a moving crate or platform adds its momentum to your next jump. Heavier machinery launches you further."),
			new Card(Weapon.Headroom, "Headroom", Tier.Rare, "Walk on walls and ceilings: jump into a ceiling or push into a wall to stick, W/S to climb, A/D along ceilings. Firing lets go."),
			new Card(Weapon.LastWord, "Last Word", Tier.Rare, "The last round in your magazine gains a bonus for every earlier shot that missed. A hit resets the bonus."),
			new Card(Weapon.VacuumChamber, "Vacuum Chamber", Tier.VeryRare, "Shots leave a wind tunnel for 5s with arrows showing the way. Step in and you are carried at the bullet's speed; crates and props are dragged along too."),
			new Card(Weapon.Stilts, "Stilts", Tier.Rare, "Hold W on the ground to rise on stilts above low shots in a fraction of a second (Space still jumps). Your legs can be shot and you move slowly."),
			new Card(Weapon.Catapult, "Catapult", Tier.Rare, "Hold S on or beside movable terrain for 0.9s to throw it away from you. Longer holds throw harder."),
			new Card(Weapon.Handshake, "Handshake", Tier.VeryRare, "Touching an opponent trades one random card each way. The trade lasts for the rest of the game or until the next handshake."),
			new Card(Weapon.Plunge, "Plunge", Tier.Rare, "Hold S in the air to slam straight down on a dagger for 50% of your bullet damage. The blade blocks bullets from below and landing blasts everyone nearby. 8 second cooldown."),
			new Card(Weapon.Katana, "Katana", Tier.Rare, "Your gun becomes a sheathed katana. Fire to draw and slash for 130% bullet damage; slash just as a bullet arrives to send it back and ready the blade again. Otherwise the next draw waits for your reload time. Gun cards that can't apply turn into sword stats. With Laser it becomes a laser katana: every slash is a laser sweep that deals the whole beam's damage at once.")
		});

		public static bool Has(Weapon flags, Weapon card)
		{
			return (flags & card) == card;
		}

		public static int ExtraProjectiles(int totalProjectiles)
		{
			return Math.Max(0, totalProjectiles - 1);
		}

		public static double LaserDuration(int totalProjectiles)
		{
			return 5.0 + (double)ExtraProjectiles(totalProjectiles);
		}

		public static double LaserDps(int totalProjectiles, double ordinaryDamageMultiplier)
		{
			return 33.333333333333336 * Math.Pow(0.9, ExtraProjectiles(totalProjectiles)) * NonNegative(ordinaryDamageMultiplier);
		}

		public static double ChargeMultiplier(double heldSeconds)
		{
			return 1.0 + 1.5 * Clamp(heldSeconds / 2.0, 0.0, 1.0);
		}

		public static double NonNegative(double value)
		{
			if (double.IsNaN(value) || double.IsInfinity(value))
			{
				throw new ArgumentOutOfRangeException("value");
			}
			return Math.Max(0.0, value);
		}

		public static double Clamp(double value, double min, double max)
		{
			return Math.Max(min, Math.Min(max, value));
		}

		public static Delivery GetDelivery(Weapon cards)
		{
			if (Has(cards, Weapon.Laser))
			{
				return Delivery.Beam;
			}
			if (Has(cards, Weapon.Railgun))
			{
				return Delivery.PiercingRay;
			}
			if (Has(cards, Weapon.LightningArc))
			{
				return Delivery.ShortArc;
			}
			return Delivery.Projectile;
		}

		public static double DamageMultiplier(Weapon cards, double chargeSeconds, bool splitChild)
		{
			double num = ((!Has(cards, Weapon.ChargeCannon)) ? 1.0 : ChargeMultiplier(chargeSeconds));
			if (Has(cards, Weapon.LightningArc))
			{
				num *= 0.6;
			}
			if (splitChild)
			{
				num *= 0.25;
			}
			return num;
		}

		public static int Magazine(Weapon cards, int ordinaryMagazine)
		{
			Weapon weapon = Weapon.Laser | Weapon.Harpoon | Weapon.GravityWell | Weapon.Railgun;
			if ((cards & weapon) == Weapon.None)
			{
				return Math.Max(1, ordinaryMagazine);
			}
			return 1;
		}

		public static double BaseReload(Weapon cards, double ordinaryReload)
		{
			if (Has(cards, Weapon.Laser))
			{
				return 5.0;
			}
			if (Has(cards, Weapon.Harpoon))
			{
				return 3.0;
			}
			return NonNegative(ordinaryReload);
		}

		public static bool CanSplit(Weapon cards, int generation)
		{
			if (Has(cards, Weapon.SplitterPods))
			{
				return generation == 0;
			}
			return false;
		}

		public static int HazardLimit(Weapon cards)
		{
			if (Has(cards, Weapon.RemoteCharges))
			{
				return 4;
			}
			return 8;
		}
	}
	public sealed class Card
	{
		public readonly Weapon Weapon;

		public readonly string Name;

		public readonly Tier Tier;

		public readonly string Description;

		public Card(Weapon weapon, string name, Tier tier, string description)
		{
			Weapon = weapon;
			Name = name;
			Tier = tier;
			Description = description;
		}
	}
	public enum Delivery
	{
		Projectile,
		Beam,
		PiercingRay,
		ShortArc
	}
	public sealed class EnemyCards
	{
		public readonly Weapon Mine;

		public readonly IReadOnlyList<string> Vanilla;

		public EnemyCards(Weapon mine, IReadOnlyList<string> vanilla)
		{
			Mine = mine;
			Vanilla = vanilla;
		}
	}
	public sealed class WaveSpec
	{
		public readonly int Number;

		public readonly IReadOnlyList<EnemySpec> Enemies;

		public readonly bool EliteWave;

		public readonly double Overtime;

		public readonly int MaxAlive;

		public readonly double Interval;

		public double TotalHealth
		{
			[CompilerGenerated]
			get
			{
				return Enemies.Sum((EnemySpec e) => e.Health);
			}
		}

		public WaveSpec(int number, IReadOnlyList<EnemySpec> enemies, bool eliteWave, double overtime, int maxAlive, double interval)
		{
			Number = number;
			Enemies = enemies;
			EliteWave = eliteWave;
			Overtime = overtime;
			MaxAlive = maxAlive;
			Interval = interval;
		}
	}
	public static class BossRules
	{
		public const double MinionHealth = 90.0;

		public const double MinionDamage = 0.6;

		public const double EnrageAt = 0.35;

		public const double EnrageFireRate = 1.35;

		public const double EnrageSpeed = 1.2;

		public const double OvertimeAfter = 45.0;

		public const double BossSize = 1.15;

		public const double FirstReinforcement = 6.0;

		public const double ReinforceEvery = 14.0;

		public static readonly IReadOnlyList<Boss> Roster = Array.AsReadOnly(new Boss[8]
		{
			new Boss("THE FOREMAN", 4, 350.0, 0.8, Brain.Grunt, Weapon.BoxLauncher | Weapon.BreakawayArmour | Weapon.HeavyCrown, 0, "Huge"),
			new Boss("THE PAINTER", 6, 450.0, 0.85, Brain.Grunt, Weapon.SplitterPods | Weapon.Porcupine | Weapon.Paintball, 0, "Bouncy"),
			new Boss("THE DEMOLITIONIST", 18, 550.0, 0.9, Brain.Marksman, Weapon.Mines | Weapon.HotPotato | Weapon.BlackPowder, 0, "Explosive Bullet"),
			new Boss("THE WRECKER", 16, 650.0, 1.0, Brain.Rusher, Weapon.ContactSport | Weapon.WreckingBall | Weapon.Handshake, 0, "Brawler"),
			new Boss("THE CONDUCTOR", 7, 750.0, 1.05, Brain.Marksman, Weapon.LightningArc | Weapon.Pacemaker | Weapon.VacuumChamber, 1, "Quick Reload"),
			new Boss("THE HUNTER", 19, 850.0, 1.15, Brain.Marksman, Weapon.Harpoon | Weapon.EmergencyExit | Weapon.LastWord, 1, "Homing"),
			new Boss("THE SINGULARITY", 21, 1000.0, 1.25, Brain.Marksman, Weapon.GravityWell | Weapon.BlackHoleRound | Weapon.UnfinishedBusiness, 2),
			new Boss("THE RAILMASTER", 17, 1200.0, 1.4, Brain.Marksman, Weapon.Railgun | Weapon.BreakawayArmour | Weapon.DeadMansSwitch, 2, "Steady Shot")
		});

		public static int Reinforcements(Boss b)
		{
			return b.Minions * 3;
		}

		public static bool Enraged(double health, double maxHealth)
		{
			if (maxHealth > 0.0)
			{
				return health / maxHealth <= 0.35;
			}
			return false;
		}

		public static int ColorAvoiding(int wanted, IEnumerable<int> taken)
		{
			HashSet<int> hashSet = new HashSet<int>(taken);
			int num = wanted;
			for (int i = 0; i < 32; i++)
			{
				if (!hashSet.Contains(num))
				{
					break;
				}
				num = (num + 8) % 32;
			}
			return num;
		}
	}
	public enum BeamState
	{
		Ready,
		Firing,
		Reloading
	}
	public sealed class Boss
	{
		public readonly string Name;

		public readonly int Color;

		public readonly double Health;

		public readonly double Damage;

		public readonly Brain Brain;

		public readonly Weapon Cards;

		public readonly IReadOnlyList<string> Vanilla;

		public readonly int Minions;

		public Boss(string name, int color, double health, double damage, Brain brain, Weapon cards, int minions, params string[] vanilla)
		{
			Name = name;
			Color = color;
			Health = health;
			Damage = damage;
			Brain = brain;
			Cards = cards;
			Minions = minions;
			Vanilla = Array.AsReadOnly(vanilla ?? new string[0]);
		}
	}
	public sealed class EnemySpec
	{
		public readonly Brain Brain;

		public readonly double Health;

		public readonly double Damage;

		public readonly int Cards;

		public readonly bool Elite;

		public readonly Build Build;

		public EnemySpec(Brain brain, double health, double damage, int cards, bool elite, Build build = Build.Normal)
		{
			Brain = brain;
			Health = health;
			Damage = damage;
			Cards = cards;
			Elite = elite;
			Build = build;
		}
	}
	public enum Tier
	{
		Rare,
		VeryRare,
		Common,
		Uncommon
	}
	public static class Builds
	{
		public static double Health(Build b)
		{
			return b switch
			{
				Build.Tiny => 0.45, 
				Build.Brute => 2.4, 
				_ => 1.0, 
			};
		}

		public static double Damage(Build b)
		{
			return b switch
			{
				Build.Tiny => 0.6, 
				Build.Brute => 1.35, 
				_ => 1.0, 
			};
		}

		public static double Size(Build b)
		{
			return b switch
			{
				Build.Tiny => 0.62, 
				Build.Brute => 1.4, 
				_ => 1.0, 
			};
		}

		public static double Speed(Build b)
		{
			return b switch
			{
				Build.Tiny => 1.35, 
				Build.Brute => 0.75, 
				_ => 1.0, 
			};
		}

		public static int Color(Build b)
		{
			return b switch
			{
				Build.Tiny => 10, 
				Build.Brute => 26, 
				_ => 2, 
			};
		}
	}
	public sealed class BeamCycle
	{
		public BeamState State { get; private set; }

		public double FireEnds { get; private set; }

		public double ReloadEnds { get; private set; }

		public bool TryStart(double now, int projectileCount)
		{
			Tick(now);
			if (State != BeamState.Ready)
			{
				return false;
			}
			FireEnds = now + Rules.LaserDuration(projectileCount);
			ReloadEnds = FireEnds + 5.0;
			State = BeamState.Firing;
			return true;
		}

		public void Tick(double now)
		{
			if (State == BeamState.Firing && now >= FireEnds)
			{
				State = BeamState.Reloading;
			}
			if (State == BeamState.Reloading && now >= ReloadEnds)
			{
				State = BeamState.Ready;
			}
		}

		public double ActiveSeconds(double frameStart, double frameEnd, double fireStarted)
		{
			return Math.Max(0.0, Math.Min(frameEnd, FireEnds) - Math.Max(frameStart, fireStarted));
		}

		public void Reset()
		{
			State = BeamState.Ready;
			double num = (ReloadEnds = 0.0);
			double fireEnds = num;
			FireEnds = fireEnds;
		}
	}
	public enum Brain
	{
		Grunt,
		Rusher,
		Marksman
	}
	public static class WaveRules
	{
		public const int MaxEnemies = 12;

		public const int AliveCap = 5;

		public const int Opening = 2;

		public const int EliteEvery = 5;

		public const double DamageCap = 1.4;

		public const double OvertimeDrainPerSecond = 0.05;

		public static readonly Weapon[] EnemyWeapons = new Weapon[6]
		{
			Weapon.Mines,
			Weapon.Sawblade,
			Weapon.LightningArc,
			Weapon.SplitterPods,
			Weapon.BoxLauncher,
			Weapon.Shockwave
		};

		public static readonly Weapon[] EnemyPerks = new Weapon[9]
		{
			Weapon.BreakawayArmour,
			Weapon.Porcupine,
			Weapon.Pacemaker,
			Weapon.HeavyCrown,
			Weapon.Paintball,
			Weapon.BlackPowder,
			Weapon.LastWord,
			Weapon.HotPotato,
			Weapon.DeadMansSwitch
		};

		public static readonly string[] EnemyVanilla = new string[22]
		{
			"Big Bullet", "Bouncy", "Buckshot", "Quick Reload", "Poison", "Explosive Bullet", "Fast Balls", "Spray", "Homing", "Burst",
			"Barrage", "Brawler", "Huge", "Lifestealer", "Chase", "Cold Bullets", "Parasite", "Scavenger", "Tactical Reload", "Quick Shot",
			"Steady Shot", "Riccochet"
		};

		public static bool IsElite(int wave)
		{
			if (wave > 0)
			{
				return wave % 5 == 0;
			}
			return false;
		}

		public static double GruntHealth(int wave)
		{
			return 60 + 10 * Math.Max(1, wave);
		}

		public static double EliteHealth(int wave)
		{
			return GruntHealth(wave) * 3.0 + 100.0;
		}

		public static double Damage(int wave)
		{
			return Math.Min(1.4, 0.5 + 0.06 * (double)Math.Max(1, wave));
		}

		public static int GruntCards(int wave)
		{
			return Math.Min(5, (Math.Max(1, wave) - 1) / 3);
		}

		public static int MaxAlive(int wave)
		{
			return Math.Min(5, 2 + Math.Max(1, wave) / 4);
		}

		public static double Interval(int wave)
		{
			return Math.Max(1.2, 3.2 - 0.1 * (double)Math.Max(1, wave));
		}

		public static Build BuildFor(int wave, int slot)
		{
			if (wave >= 7 && slot % 5 == 4)
			{
				return Build.Brute;
			}
			if (wave >= 4 && slot % 4 == 3)
			{
				return Build.Tiny;
			}
			return Build.Normal;
		}

		public static WaveSpec For(int wave)
		{
			if (wave < 1)
			{
				throw new ArgumentOutOfRangeException("wave");
			}
			List<EnemySpec> list = new List<EnemySpec>();
			double num = Damage(wave);
			int num2 = GruntCards(wave);
			bool flag = IsElite(wave);
			int num3 = ((!flag) ? Math.Min(12, 1 + wave * 2 / 3) : Math.Min(11, wave * 2 / 3));
			for (int i = 0; i < num3; i++)
			{
				Brain brain = Brain.Grunt;
				if (wave >= 6 && i % 3 == 2)
				{
					brain = Brain.Marksman;
				}
				else if (wave >= 3 && i % 3 == 1)
				{
					brain = Brain.Rusher;
				}
				Build build = BuildFor(wave, i);
				switch (build)
				{
				case Build.Tiny:
					brain = Brain.Rusher;
					break;
				case Build.Brute:
					brain = Brain.Grunt;
					break;
				}
				list.Add(new EnemySpec(brain, GruntHealth(wave) * Builds.Health(build), Math.Min(1.4, num * Builds.Damage(build)), num2, elite: false, build));
			}
			if (!flag && wave >= 4)
			{
				for (int j = 0; j < wave / 4; j++)
				{
					if (list.Count >= 12)
					{
						break;
					}
					list.Add(new EnemySpec(Brain.Rusher, GruntHealth(wave) * Builds.Health(Build.Tiny), Math.Min(1.4, num * Builds.Damage(Build.Tiny)), Math.Max(0, num2 - 1), elite: false, Build.Tiny));
				}
			}
			if (flag)
			{
				list.Add(new EnemySpec(Brain.Marksman, EliteHealth(wave), Math.Min(1.4, num * 1.2), Math.Min(7, num2 + 2), elite: true));
			}
			return new WaveSpec(wave, list.AsReadOnly(), flag, 40 + 4 * Math.Min(list.Count, MaxAlive(wave)), MaxAlive(wave), Interval(wave));
		}

		public static EnemyCards LoadoutFor(int cards, int seed)
		{
			Random random = new Random(seed);
			Weapon mine = Weapon.None;
			List<string> list = new List<string>();
			bool flag = false;
			for (int i = 0; i < cards; i++)
			{
				double num = random.NextDouble();
				if (num < 0.25 && !flag)
				{
					mine |= EnemyWeapons[random.Next(EnemyWeapons.Length)];
					flag = true;
				}
				else if (num < 0.55)
				{
					Weapon[] array = EnemyPerks.Where((Weapon p) => (mine & p) == 0).ToArray();
					if (array.Length != 0)
					{
						mine |= array[random.Next(array.Length)];
					}
					else
					{
						list.Add(EnemyVanilla[random.Next(EnemyVanilla.Length)]);
					}
				}
				else
				{
					list.Add(EnemyVanilla[random.Next(EnemyVanilla.Length)]);
				}
			}
			return new EnemyCards(mine, list.AsReadOnly());
		}

		public static int Score(int wavesCleared, int kills)
		{
			return wavesCleared * 100 + kills * 10;
		}
	}
	[Flags]
	public enum Weapon : long
	{
		None = 0L,
		Laser = 1L,
		Mines = 2L,
		Harpoon = 4L,
		Sawblade = 8L,
		LightningArc = 0x10L,
		GravityWell = 0x20L,
		SplitterPods = 0x40L,
		RemoteCharges = 0x80L,
		Railgun = 0x100L,
		ChargeCannon = 0x200L,
		BoxLauncher = 0x400L,
		Shockwave = 0x800L,
		Bipolar = 0x1000L,
		BlackHoleRound = 0x2000L,
		BreakawayArmour = 0x4000L,
		DeadMansSwitch = 0x8000L,
		Porcupine = 0x10000L,
		BorrowedCover = 0x20000L,
		EmergencyExit = 0x40000L,
		Counterweight = 0x80000L,
		Pickpocket = 0x100000L,
		EmergencyUnzip = 0x200000L,
		MovingDay = 0x400000L,
		ReloadRelay = 0x800000L,
		HostileArchitecture = 0x1000000L,
		HotPotato = 0x2000000L,
		ReversePickpocket = 0x4000000L,
		Frictionless = 0x8000000L,
		Pacemaker = 0x10000000L,
		UnfinishedBusiness = 0x20000000L,
		HeavyCrown = 0x40000000L,
		Kickflip = 0x80000000L,
		BulletRider = 0x100000000L,
		ContactSport = 0x200000000L,
		KineticHammer = 0x400000000L,
		Paintball = 0x800000000L,
		BlackPowder = 0x1000000000L,
		WreckingBall = 0x2000000000L,
		Featherfall = 0x4000000000L,
		SkatingRink = 0x8000000000L,
		Passenger = 0x10000000000L,
		Headroom = 0x20000000000L,
		LastWord = 0x40000000000L,
		VacuumChamber = 0x80000000000L,
		Stilts = 0x100000000000L,
		Catapult = 0x200000000000L,
		Handshake = 0x400000000000L,
		Plunge = 0x800000000000L,
		Katana = 0x1000000000000L
	}
	public enum MineState
	{
		Flying,
		Arming,
		Armed,
		Consumed
	}
	public enum Build
	{
		Normal,
		Tiny,
		Brute
	}
	public sealed class MineLifecycle
	{
		private double armedAt;

		public MineState State { get; private set; }

		public bool HasProximityTrigger { get; }

		public bool HasRemoteTrigger { get; }

		public double BulletDamage { get; }

		public MineLifecycle(double bulletDamage, bool proximity, bool remote)
		{
			BulletDamage = Rules.NonNegative(bulletDamage);
			HasProximityTrigger = proximity;
			HasRemoteTrigger = remote;
		}

		public double DirectHit()
		{
			if (State != MineState.Flying)
			{
				return 0.0;
			}
			State = MineState.Consumed;
			return BulletDamage * 0.5;
		}

		public bool Land(double now)
		{
			if (State != MineState.Flying)
			{
				return false;
			}
			State = MineState.Arming;
			armedAt = now + 0.4;
			return true;
		}

		public void Tick(double now)
		{
			if (State == MineState.Arming && now >= armedAt)
			{
				State = MineState.Armed;
			}
		}

		public double Detonate(double now, bool remote)
		{
			Tick(now);
			if (State != MineState.Armed || ((!remote) ? (!HasProximityTrigger) : (!HasRemoteTrigger)))
			{
				return 0.0;
			}
			State = MineState.Consumed;
			return BulletDamage * 1.25;
		}

		public void Expire()
		{
			State = MineState.Consumed;
		}
	}
}
namespace CodyGunCards.Runtime
{
	internal sealed class LastWordRound : MonoBehaviour
	{
		private SpriteRenderer _glow;

		private float _next;

		internal void Init(float mult)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			_glow = Fx.MakeSprite("CGC_LastWord", Fx.Glow, new Color(1f, 0.25f, 0.2f, 0.8f), 7);
			((Component)_glow).transform.localScale = Vector3.one * (0.9f + 0.35f * (mult - 1f));
		}

		private void Update()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_glow != (Object)null)
			{
				((Component)_glow).transform.position = ((Component)this).transform.position;
			}
			if (Time.time >= _next)
			{
				_next = Time.time + 0.03f;
				Perks.Sparks(Vector2.op_Implicit(((Component)this).transform.position), Vector2.up, new Color(1f, 0.45f, 0.25f, 1f), 180f, 1f, 3f, 1, 0.3f, 0.05f, 0f);
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)_glow != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)_glow).gameObject);
			}
		}
	}
	internal sealed class SplitSelfHit : MonoBehaviour
	{
		private static MethodInfo _removeOwn;

		private static bool _resolved;

		private float _at;

		private bool _done;

		private void Start()
		{
			_at = Time.time + 0.15f;
		}

		private void Update()
		{
			if (_done || Time.time < _at)
			{
				return;
			}
			_done = true;
			((Behaviour)this).enabled = false;
			try
			{
				ProjectileHit component = ((Component)this).GetComponent<ProjectileHit>();
				if (!((Object)(object)component == (Object)null))
				{
					if (!_resolved)
					{
						_resolved = true;
						_removeOwn = AccessTools.Method(typeof(ProjectileHit), "RemoveOwnPlayerFromPlayersHit", (Type[])null, (Type[])null);
					}
					if (_removeOwn != null)
					{
						_removeOwn.Invoke(component, null);
					}
				}
			}
			catch (Exception ex)
			{
				Plugin.Warn("Split bullet self-hit: " + ex.Message);
			}
		}
	}
	internal sealed class BeatRing : MonoBehaviour
	{
		private static readonly List<BeatRing> Live = new List<BeatRing>();

		private Player _p;

		private SpriteRenderer _ring;

		private SpriteRenderer _pulse;

		private readonly List<SpriteRenderer> _pips = new List<SpriteRenderer>();

		private float _lastBeat = -1f;

		private float _flash;

		private Color _flashColour;

		internal static void Ensure(Player p)
		{
			if (!((Object)(object)p == (Object)null) && !((Object)(object)((Component)p).GetComponent<BeatRing>() != (Object)null))
			{
				BeatRing beatRing = ((Component)p).gameObject.AddComponent<BeatRing>();
				beatRing._p = p;
				Live.Add(beatRing);
			}
		}

		internal static void ClearAll()
		{
			BeatRing[] array = Live.ToArray();
			foreach (BeatRing beatRing in array)
			{
				if ((Object)(object)beatRing != (Object)null)
				{
					Object.Destroy((Object)(object)beatRing);
				}
			}
			Live.Clear();
		}

		private SpriteRenderer Make(string name, Sprite s, Color c, int order)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			SpriteRenderer obj = Fx.MakeSprite(name, s, c, order);
			((Component)obj).transform.SetParent(((Component)this).transform, false);
			return obj;
		}

		internal void Hit(int streak)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005c: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			_flash = Time.time;
			_flashColour = new Color(0.4f, 1f, 0.6f, 1f);
			Fx.Burst(Vector2.op_Implicit(((Component)this).transform.position), 1.6f + 0.15f * (float)streak, new Color(0.4f, 1f, 0.6f, 0.9f));
			Perks.Sparks(Vector2.op_Implicit(((Component)this).transform.position), Vector2.up, new Color(0.5f, 1f, 0.6f, 1f), 40f, 3f, 6f, 2 + streak, 0.5f, 0.06f, -6f);
		}

		internal void Miss()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			_flash = Time.time;
			_flashColour = new Color(1f, 0.4f, 0.35f, 1f);
		}

		private void OnDestroy()
		{
			Live.Remove(this);
			if ((Object)(object)_ring != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)_ring).gameObject);
			}
			if ((Object)(object)_pulse != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)_pulse).gameObject);
			}
			foreach (SpriteRenderer pip in _pips)
			{
				if ((Object)(object)pip != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)pip).gameObject);
				}
			}
		}

		private void Update()
		{
			//IL_0063: 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_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: 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_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_p == (Object)null)
			{
				return;
			}
			if (!Loadout.Has(_p, Weapon.Pacemaker))
			{
				Object.Destroy((Object)(object)this);
				return;
			}
			bool flag = Util.Alive(_p);
			if ((Object)(object)_ring == (Object)null)
			{
				_ring = Make("CGC_BeatRing", Fx.Ring, new Color(1f, 0.45f, 0.5f, 0.35f), 4);
				_pulse = Make("CGC_BeatPulse", Fx.Ring, new Color(1f, 0.45f, 0.5f, 0.8f), 5);
			}
			((Component)_ring).gameObject.SetActive(flag);
			((Component)_pulse).gameObject.SetActive(flag);
			if (!flag)
			{
				return;
			}
			float num = Time.time % 0.6f / 0.6f;
			int num2 = (int)(Time.time / 0.6f);
			if (num2 != (int)_lastBeat)
			{
				_lastBeat = num2;
				if (Util.IsMine(_p))
				{
					Sfx.Play(Sfx.Heartbeat, 0.2f);
				}
			}
			float num3 = Mathf.Exp((0f - num) * 7f);
			((Component)_ring).transform.localScale = Vector3.one * (2.2f + 0.25f * num3);
			((Component)_pulse).transform.localScale = Vector3.one * (2.2f + 1.3f * num);
			Color val = (Color)((!(Time.time - _flash < 0.25f)) ? new Color(1f, 0.45f, 0.5f, 1f) : _flashColour);
			_pulse.color = new Color(val.r, val.g, val.b, 0.7f * (1f - num));
			_ring.color = new Color(val.r, val.g, val.b, 0.25f + 0.35f * num3);
			int num4 = Tricks.StreakOf(_p);
			while (_pips.Count < 5)
			{
				_pips.Add(Make("CGC_BeatPip", Fx.Disc, Color.white, 6));
			}
			for (int i = 0; i < _pips.Count; i++)
			{
				float num5 = (90f + ((float)i - 2f) * 16f) * ((float)Math.PI / 180f);
				((Component)_pips[i]).transform.localPosition = new Vector3(Mathf.Cos(num5), Mathf.Sin(num5), 0f) * 1.45f;
				((Component)_pips[i]).transform.localScale = Vector3.one * 0.14f;
				_pips[i].color = ((i >= num4) ? new Color(1f, 1f, 1f, 0.18f) : new Color(0.45f, 1f, 0.6f, 1f));
			}
		}
	}
	public static class Handshake
	{
		internal const float Range = 1.3f;

		internal const float Cooldown = 3f;

		internal const float SwapDelay = 0.15f;

		private static readonly Dictionary<long, float> PairAt = new Dictionary<long, float>();

		private static readonly Random Rng = new Random();

		private static readonly HashSet<int> Trading = new HashSet<int>();

		internal static int Swaps;

		internal static void Tick()
		{
			//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)
			//IL_00ff: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)PlayerManager.instance == (Object)null || !Util.IsAuthority())
			{
				return;
			}
			foreach (Player player in PlayerManager.instance.players)
			{
				if ((Object)(object)player == (Object)null || !Util.Alive(player) || Bipolar.IsTwin(player) || Trading.Contains(player.playerID) || !Loadout.Has(player, Weapon.Handshake))
				{
					continue;
				}
				foreach (Player player2 in PlayerManager.instance.players)
				{
					if ((Object)(object)player2 == (Object)null || (Object)(object)player2 == (Object)(object)player || !Util.Alive(player2) || Bipolar.IsTwin(player2) || Trading.Contains(player2.playerID) || !Util.IsEnemy(player, player2))
					{
						continue;
					}
					Vector2 val = Vector2.op_Implicit(((Component)player2).transform.position) - Vector2.op_Implicit(((Component)player).transform.position);
					if (((Vector2)(ref val)).magnitude > 1.3f)
					{
						continue;
					}
					long key = Perks.Pair(Math.Min(player.playerID, player2.playerID), Math.Max(player.playerID, player2.playerID));
					if (!PairAt.TryGetValue(key, out var value) || !(Time.time - value < 3f))
					{
						PairAt[key] = Time.time;
						List<CardInfo> list = Tradeable(player);
						List<CardInfo> list2 = Tradeable(player2);
						if (list.Count != 0 && list2.Count != 0)
						{
							CardInfo fromA = list[Rng.Next(list.Count)];
							CardInfo fromB = list2[Rng.Next(list2.Count)];
							Trading.Add(player.playerID);
							Trading.Add(player2.playerID);
							Runner.Run(Trade(player, player2, fromA, fromB));
							break;
						}
						NetworkingManager.RPC(typeof(Handshake), "RPCA_Handshake", new object[4]
						{
							player.playerID,
							player2.playerID,
							string.Empty,
							string.Empty
						});
					}
				}
			}
		}

		internal static List<CardInfo> Tradeable(Player p)
		{
			List<CardInfo> list = new List<CardInfo>();
			if ((Object)(object)p == (Object)null || (Object)(object)p.data == (Object)null || p.data.currentCards == null)
			{
				return list;
			}
			foreach (CardInfo currentCard in p.data.currentCards)
			{
				if ((Object)(object)currentCard != (Object)null && !string.Equals(currentCard.cardName, "Handshake", StringComparison.OrdinalIgnoreCase))
				{
					list.Add(currentCard);
				}
			}
			return list;
		}

		private static IEnumerator Trade(Player a, Player b, CardInfo fromA, CardInfo fromB)
		{
			Cards instance = Cards.instance;
			int num = IndexOf(a, fromA);
			int num2 = IndexOf(b, fromB);
			if (num < 0 || num2 < 0)
			{
				Plugin.Warn("Handshake: card not found on a player; trade skipped.");
				Trading.Remove(a.playerID);
				Trading.Remove(b.playerID);
				yield break;
			}
			IEnumerator enumerator = null;
			IEnumerator second = null;
			try
			{
				enumerator = instance.ReplaceCard(a, num, fromB, string.Empty, 0f, 0f, true);
				second = instance.ReplaceCard(b, num2, fromA, string.Empty, 0f, 0f, true);
			}
			catch (Exception ex)
			{
				Plugin.Warn("Handshake trade: " + ex.Message);
			}
			if (enumerator != null)
			{
				yield return enumerator;
			}
			if (second != null)
			{
				yield return second;
			}
			Swaps++;
			Trading.Remove(a.playerID);
			Trading.Remove(b.playerID);
			Loadout.Invalidate();
			Plugin.Log("Handshake: player " + a.playerID + " gave " + fromA.cardName + " for " + fromB.cardName + " from player " + b.playerID);
		}

		private static int IndexOf(Player p, CardInfo card)
		{
			if ((Object)(object)p == (Object)null || (Object)(object)p.data == (Object)null || p.data.currentCards == null || (Object)(object)card == (Object)null)
			{
				return -1;
			}
			for (int i = 0; i < p.data.currentCards.Count; i++)
			{
				if ((Object)(object)p.data.currentCards[i] == (Object)(object)card)
				{
					return i;
				}
			}
			for (int j = 0; j < p.data.currentCards.Count; j++)
			{
				CardInfo val = p.data.currentCards[j];
				if ((Object)(object)val != (Object)null && string.Equals(val.cardName, card.cardName, StringComparison.OrdinalIgnoreCase))
				{
					return j;
				}
			}
			return -1;
		}

		[UnboundRPC]
		public static void RPCA_Handshake(int aId, int bId, string gave, string took)
		{
			//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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0079: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			Player val = Util.PlayerById(aId);
			Player val2 = Util.PlayerById(bId);
			if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null))
			{
				long key = Perks.Pair(Math.Min(aId, bId), Math.Max(aId, bId));
				PairAt[key] = Time.time;
				Vector2 at = (Vector2.op_Implicit(((Component)val).transform.position) + Vector2.op_Implicit(((Component)val2).transform.position)) * 0.5f;
				Fx.Burst(at, 1.5f, new Color(1f, 0.85f, 0.4f, 1f));
				Perks.Sparks(at, Vector2.up, new Color(1f, 0.9f, 0.5f, 1f), 180f, 3f, 7f, 10, 0.4f, 0.06f, 5f);
				Sfx.Play(Sfx.HandshakeSound, 0.65f);
				if (!string.IsNullOrEmpty(gave) && !string.IsNullOrEmpty(took))
				{
					FloatingLabel.Show(val, "+" + took, Util.ColourOf(val2));
					FloatingLabel.Show(val2, "+" + gave, Util.ColourOf(val));
				}
			}
		}

		internal static void RestoreAll()
		{
			PairAt.Clear();
			Trading.Clear();
		}
	}
	internal sealed class FlyingRound : MonoBehaviour
	{
		private Transform _from;

		private Transform _to;

		private float _born;

		private SpriteRenderer _round;

		private SpriteRenderer _glow;

		internal const float Time_ = 0.22f;

		internal static void Send(Transform from, Transform to)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_002a: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)from == (Object)null) && !((Object)(object)to == (Object)null))
			{
				GameObject val = new GameObject("CGC_FlyingRound");
				val.transform.position = from.position;
				FlyingRound flyingRound = val.AddComponent<FlyingRound>();
				flyingRound._from = from;
				flyingRound._to = to;
				flyingRound._born = Time.time;
				flyingRound._glow = Fx.MakeSprite("glow", Fx.Glow, new Color(1f, 0.85f, 0.35f, 0.6f), 7);
				((Component)flyingRound._glow).transform.SetParent(val.transform, false);
				((Component)flyingRound._glow).transform.localScale = Vector3.one * 0.9f;
				flyingRound._round = Fx.MakeSprite("round", Fx.Pixel, new Color(1f, 0.9f, 0.55f, 1f), 8);
				((Component)flyingRound._round).transform.SetParent(val.transform, false);
				((Component)flyingRound._round).transform.localScale = new Vector3(0.3f, 0.12f, 1f);
			}
		}

		private void Update()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_from == (Object)null || (Object)(object)_to == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			float num = Mathf.Clamp01((Time.time - _born) / 0.22f);
			Vector2 val = Vector2.op_Implicit(_from.position);
			Vector2 val2 = Vector2.op_Implicit(_to.position);
			Vector2 val3 = val + (val2 - val) * num + Vector2.up * (Mathf.Sin(num * (float)Math.PI) * 1.2f);
			((Component)this).transform.position = Vector2.op_Implicit(val3);
			((Component)_round).transform.localRotation = Quaternion.Euler(0f, 0f, num * 900f);
			if (num >= 1f)
			{
				Fx.Burst(val2, 0.7f, new Color(1f, 0.9f, 0.5f, 0.9f));
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	[HarmonyPatch(typeof(Gun), "BulletInit")]
	internal static class BulletInitPatch
	{
		private static void Postfix(Gun __instance, GameObject bullet)
		{
			try
			{
				if ((Object)(object)bullet == (Object)null || (Object)(object)__instance == (Object)null || (Object)(object)__instance.player == (Object)null)
				{
					return;
				}
				Weapon weapon = Loadout.Of(__instance.player);
				if (weapon == Weapon.None)
				{
					return;
				}
				CodyBullet codyBullet = bullet.GetComponent<CodyBullet>() ?? bullet.AddComponent<CodyBullet>();
				bool initialisingChild = Splitter.InitialisingChild;
				codyBullet.Init(__instance.player, weapon, initialisingChild);
				Arsenal.OnBulletInit(__instance.player, bullet, initialisingChild || Splitter.InitialisingMirror);
				if (!initialisingChild)
				{
					if ((weapon & Weapon.BlackHoleRound) != Weapon.None && (Object)(object)bullet.GetComponent<BlackHoleOrb>() == (Object)null)
					{
						bullet.AddComponent<BlackHoleOrb>().Init();
					}
					if ((weapon & Weapon.ChargeCannon) != Weapon.None)
					{
						codyBullet.ApplyCharge(ChargeShots.For(__instance.player));
					}
					if ((weapon & Weapon.LightningArc) != Weapon.None)
					{
						NodeZaps.OnShot(__instance.player);
					}
					if ((weapon & Weapon.Bipolar) != Weapon.None && !Splitter.InitialisingMirror && Util.IsMine(__instance.player))
					{
						Bipolar.Mirror(__instance.player, bullet);
					}
					if ((weapon & Weapon.BulletRider) != Weapon.None && !Splitter.InitialisingMirror)
					{
						Moves.OnBullet(__instance.player, bullet);
					}
				}
			}
			catch (Exception ex)
			{
				Plugin.Warn("BulletInit: " + ex.Message);
			}
		}
	}
	internal sealed class Potato : MonoBehaviour
	{
		private static readonly Dictionary<int, Potato> ByAttacker = new Dictionary<int, Potato>();

		internal const float Fuse = 3f;

		internal const float PassRange = 1.4f;

		internal const float PassCooldown = 0.4f;

		internal const float DamageMultiplier = 2.5f;

		private Player _attacker;

		private Player _holder;

		private float _end;

		private float _lastPass;

		private float _nextBeep;

		private bool _boomSent;

		private float _nextSpark;

		private AudioSource _fuse;

		private SpriteRenderer _body;

		private SpriteRenderer _glow;

		internal static bool HasLive(int attackerId)
		{
			if (ByAttacker.TryGetValue(attackerId, out var value))
			{
				return (Object)(object)value != (Object)null;
			}
			return false;
		}

		internal static Player HolderOf(int attackerId)
		{
			if (ByAttacker.TryGetValue(attackerId, out var value) && (Object)(object)value != (Object)null)
			{
				return value._holder;
			}
			return null;
		}

		internal static void Attach(Player attacker, Player holder)
		{
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)attacker == (Object)null) && !((Object)(object)holder == (Object)null) && !HasLive(attacker.playerID))
			{
				GameObject val = new GameObject("CGC_Potato");
				val.transform.position = ((Component)holder).transform.position;
				Potato potato = val.AddComponent<Potato>();
				potato._attacker = attacker;
				potato._holder = holder;
				potato._end = Time.time + 5f;
				potato._lastPass = Time.time;
				potato._glow = Fx.MakeSprite("glow", Fx.Glow, new Color(1f, 0.3f, 0.2f, 0.5f), 7);
				((Component)potato._glow).transform.SetParent(val.transform, false);
				((Component)potato._glow).transform.localScale = Vector3.one * 1.4f;
				potato._body = Fx.MakeSprite("bomb", Fx.Disc, new Color(0.15f, 0.15f, 0.18f, 1f), 8);
				((Component)potato._body).transform.SetParent(val.transform, false);
				((Component)potato._body).transform.localScale = Vector3.one * 0.6f;
				ByAttacker[attacker.playerID] = potato;
				try
				{
					potato._fuse = Sfx.MakeSource(val.transform, "fuse");
					potato._fuse.clip = Sfx.FuseLoop;
					potato._fuse.loop = true;
					potato._fuse.volume = 0.35f;
					potato._fuse.Play();
				}
				catch
				{
				}
				Fx.Burst(Vector2.op_Implicit(((Component)holder).transform.position), 1.3f, new Color(1f, 0.5f, 0.2f, 0.9f));
				Sfx.Play(Sfx.PotatoStick, 0.6f);
			}
		}

		internal static void Pass(int attackerId, Player to)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)to == (Object)null) && ByAttacker.TryGetValue(attackerId, out var value) && !((Object)(object)value == (Object)null))
			{
				value._holder = to;
				value._lastPass = Time.time;
				Fx.Burst(Vector2.op_Implicit(((Component)to).transform.position), 1.1f, new Color(1f, 0.5f, 0.2f, 0.8f));
				Sfx.Play(Sfx.PotatoPass, 0.6f);
			}
		}

		internal static void Boom(int attackerId)
		{
			//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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			if (ByAttacker.TryGetValue(attackerId, out var value) && !((Object)(object)value == (Object)null))
			{
				ByAttacker.Remove(attackerId);
				Vector2 val = Vector2.op_Implicit(((Component)value).transform.position);
				Fx.Burst(val, 2.6f, new Color(1f, 0.55f, 0.2f, 1f));
				Perks.Sparks(val, Vector2.up, new Color(1f, 0.7f, 0.3f, 1f), 180f, 8f, 20f, 16, 0.5f, 0.12f, 25f);
				Sfx.Explosion(val);
				PowderCloud.Scatter(val, 2.5f);
				if (Util.IsAuthority() && (Object)(object)value._holder != (Object)null && Util.Alive(value._holder))
				{
					float amount = Util.BulletDamage(Util.GunOf(value._attacker)) * 2.5f;
					Util.Damage(value._holder, amount, val + Vector2.down * 0.1f, value._attacker);
					Util.Push(value._holder, Vector2.up * 5000f, 0.5f);
				}
				Object.Destroy((Object)(object)((Component)value).gameObject);
			}
		}

		internal static void ClearAll()
		{
			foreach (Potato value in ByAttacker.Values)
			{
				if ((Object)(object)value != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)value).gameObject);
				}
			}
			ByAttacker.Clear();
		}

		private void Update()
		{
			//IL_005c: 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_00e8: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_holder == (Object)null || !Util.Alive(_holder))
			{
				if ((Object)(object)_attacker != (Object)null)
				{
					ByAttacker.Remove(_attacker.playerID);
				}
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			((Component)this).transform.position = ((Component)_holder).transform.position + new Vector3(0f, 1.4f, 0f);
			float num = _end - Time.time;
			float num2 = ((!(num < 1f)) ? 7f : 16f);
			if ((Object)(object)_glow != (Object)null)
			{
				_glow.color = new Color(1f, 0.3f, 0.2f, 0.3f + 0.4f * (0.5f + 0.5f * Mathf.Sin(Time.time * num2)));
			}
			if (Time.time >= _nextSpark)
			{
				_nextSpark = Time.time + 0.05f;
				Perks.Sparks(Vector2.op_Implicit(((Component)this).transform.position) + new Vector2(0.25f, 0.3f), Vector2.up, new Color(1f, 0.75f, 0.3f, 1f), 50f, 2f, 5f, 1, 0.25f, 0.05f, 12f);
			}
			if (Time.time >= _nextBeep)
			{
				Sfx.Play(Sfx.Beep, 0.2f);
				_nextBeep = Time.time + Mathf.Lerp(0.1f, 0.5f, Mathf.Clamp01(num / 5f));
			}
			if (!Util.IsAuthority())
			{
				return;
			}
			if (num <= 0f)
			{
				if (!_boomSent)
				{
					_boomSent = true;
					NetworkingManager.RPC(typeof(Perks), "RPCA_PotatoBoom", new object[1] { _attacker.playerID });
				}
			}
			else
			{
				if (Time.time - _lastPass < 0.4f || (Object)(object)PlayerManager.instance == (Object)null)
				{
					return;
				}
				foreach (Player player in PlayerManager.instance.players)
				{
					if (!((Object)(object)player == (Object)null) && !((Object)(object)player == (Object)(object)_holder) && Util.Alive(player))
					{
						Vector2 val = Vector2.op_Implicit(((Component)player).transform.position) - Vector2.op_Implicit(((Component)_holder).transform.position);
						if (!(((Vector2)(ref val)).magnitude > 1.4f))
						{
							_lastPass = Time.time;
							NetworkingManager.RPC(typeof(Perks), "RPCA_PotatoPass", new object[2] { _attacker.playerID, player.playerID });
							break;
						}
					}
				}
			}
		}
	}
	public static class Moves
	{
		internal const float KickRange = 1.7f;

		internal const float KickSpeed = 22f;

		internal const float BumpRange = 1.35f;

		internal const float BumpMinSpeed = 4f;

		internal const float BumpCooldown = 0.4f;

		private static readonly Dictionary<int, Vector2> LastPos = new Dictionary<int, Vector2>();

		private static readonly Dictionary<int, Vector2> Est = new Dictionary<int, Vector2>();

		private static readonly Dictionary<long, float> BumpAt = new Dictionary<long, float>();

		private static float _lastTick = -1f;

		private static float _rideStarted = -99f;

		internal static void ResetAll()
		{
			LastPos.Clear();
			Est.Clear();
			BumpAt.Clear();
			Ride.ClearAll();
			Hammer.ClearAll();
			Katana.ClearAll();
		}

		internal static void Tick()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_00c6: 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_00a9: 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_00b1: 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_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: 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)
			if ((Object)(object)PlayerManager.instance == (Object)null || PlayerManager.instance.players == null)
			{
				return;
			}
			List<Player> players = PlayerManager.instance.players;
			float num = ((!(_lastTick < 0f)) ? (Time.time - _lastTick) : 0f);
			_lastTick = Time.time;
			foreach (Player item in players)
			{
				if (!((Object)(object)item == (Object)null))
				{
					Vector2 val = Vector2.op_Implicit(((Component)item).transform.position);
					if (num > 0.0001f && LastPos.TryGetValue(item.playerID, out var value))
					{
						Est[item.playerID] = (val - value) / num;
					}
					LastPos[item.playerID] = val;
					if (Loadout.Has(item, Weapon.KineticHammer))
					{
						Hammer.Ensure(item);
					}
					if (Katana.Active(item))
					{
						Katana.Ensure(item);
					}
				}
			}
			foreach (Player item2 in players)
			{
				if ((Object)(object)item2 == (Object)null || !Util.IsMine(item2) || !Util.Alive(item2) || !Loadout.Has(item2, Weapon.ContactSport))
				{
					continue;
				}
				foreach (Player item3 in players)
				{
					if ((Object)(object)item3 == (Object)null || (Object)(object)item3 == (Object)(object)item2 || !Util.Alive(item3) || !Util.IsEnemy(item2, item3))
					{
						continue;
					}
					Vector2 val2 = Vector2.op_Implicit(((Component)item3).transform.position) - Vector2.op_Implicit(((Component)item2).transform.position);
					if (((Vector2)(ref val2)).magnitude > 1.35f)
					{
						continue;
					}
					long key = Perks.Pair(item2.playerID, item3.playerID);
					if (!BumpAt.TryGetValue(key, out var value2) || !(Time.time - value2 < 0.4f))
					{
						Vector2 value3 = Motion.Velocity(item2);
						if (((Vector2)(ref value3)).sqrMagnitude < 0.0001f)
						{
							Est.TryGetValue(item2.playerID, out value3);
						}
						Est.TryGetValue(item3.playerID, out var value4);
						val2 = value3 - value4;
						if (!(((Vector2)(ref val2)).magnitude < 4f))
						{
							BumpAt[key] = Time.time;
							Motion.SetVelocity(item2, value4);
							NetworkingManager.RPC(typeof(Moves), "RPCA_Bump", new object[4]
							{
								item2.playerID,
								item3.playerID,
								value3.x,
								value3.y + 3f
							});
						}
					}
				}
			}
		}

		[UnboundRPC]
		public static void RPCA_Bump(int fromId, int toId, float vx, float vy)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_0079: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			Player val = Util.PlayerById(fromId);
			Player val2 = Util.PlayerById(toId);
			if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null))
			{
				Vector2 at = (Vector2.op_Implicit(((Component)val).transform.position) + Vector2.op_Implicit(((Component)val2).transform.position)) * 0.5f;
				Fx.Burst(at, 1.4f, new Color(1f, 0.85f, 0.5f, 1f));
				Perks.Sparks(at, Vector2.up, new Color(1f, 0.9f, 0.6f, 1f), 180f, 4f, 10f, 8, 0.3f, 0.06f, 15f);
				Sfx.Play(Sfx.Bump, 0.7f);
				if (Util.IsMine(val2))
				{
					Motion.SetVelocity(val2, new Vector2(vx, vy));
				}
			}
		}

		internal static void OnJump(Player p)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: 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_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: 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_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: 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_028e: 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_00dc: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)p == (Object)null || !Util.IsMine(p) || !Util.Alive(p) || !Loadout.Has(p, Weapon.Kickflip))
			{
				return;
			}
			Vector2 val = Vector2.op_Implicit(((Component)p).transform.position);
			ProjectileHit val2 = null;
			float num = 1.7f;
			ProjectileHit[] array = Object.FindObjectsOfType<ProjectileHit>();
			Vector2 val4;
			foreach (ProjectileHit val3 in array)
			{
				if ((Object)(object)val3 == (Object)null || (Object)(object)val3.ownPlayer == (Object)null || !Util.IsEnemy(p, val3.ownPlayer))
				{
					continue;
				}
				Vector3 localScale = ((Component)val3).transform.localScale;
				if (((Vector3)(ref localScale)).sqrMagnitude < 0.0001f)
				{
					continue;
				}
				MoveTransform component = ((Component)val3).GetComponent<MoveTransform>();
				if ((Object)(object)component == (Object)null)
				{
					continue;
				}
				val4 = Vector2.op_Implicit(component.velocity);
				if (!(((Vector2)(ref val4)).magnitude < 3f))
				{
					val4 = Vector2.op_Implicit(((Component)val3).transform.position) - val;
					float magnitude = ((Vector2)(ref val4)).magnitude;
					if (magnitude < num)
					{
						num = magnitude;
						val2 = val3;
					}
				}
			}
			if ((Object)(object)val2 == (Object)null)
			{
				return;
			}
			MoveTransform component2 = ((Component)val2).GetComponent<MoveTransform>();
			Vector2 val5 = Vector2.op_Implicit(component2.velocity);
			val4 = new Vector2(0f - val5.y, val5.x);
			Vector2 val6 = ((Vector2)(ref val4)).normalized;
			float num2 = Vector2.Dot(val6, val - Vector2.op_Implicit(((Component)val2).transform.position));
			if (Mathf.Abs(num2) < 0.3f)
			{
				if (val6.y < 0f)
				{
					val6 = -val6;
				}
			}
			else if (num2 < 0f)
			{
				val6 = -val6;
			}
			val4 = val6 + Vector2.up * 0.35f;
			Motion.SetVelocity(p, ((Vector2)(ref val4)).normalized * 22f);
			val4 = ((Vector2)(ref val5)).normalized * 0.5f - val6;
			Vector2 val7 = ((Vector2)(ref val4)).normalized * ((Vector2)(ref val5)).magnitude;
			PhotonView component3 = ((Component)val2).GetComponent<PhotonView>();
			NetworkingManager.RPC(typeof(Moves), "RPCA_Kick", new object[6]
			{
				p.playerID,
				(!((Object)(object)component3 != (Object)null)) ? (-1) : component3.ViewID,
				((Component)val2).transform.position.x,
				((Component)val2).transform.position.y,
				val7.x,
				val7.y
			});
			if ((Object)(object)component3 == (Object)null)
			{
				component2.velocity = Vector2.op_Implicit(val7);
			}
		}

		[UnboundRPC]
		public static void RPCA_Kick(int pid, int viewId, float x, float y, float vx, float vy)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0072: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (viewId >= 0)
			{
				PhotonView val = PhotonView.Find(viewId);
				MoveTransform val2 = ((!((Object)(object)val != (Object)null)) ? null : ((Component)val).GetComponent<MoveTransform>());
				if ((Object)(object)val2 != (Object)null)
				{
					val2.velocity = new Vector3(vx, vy, 0f);
				}
			}
			Vector2 at = new Vector2(x, y);
			Fx.Burst(at, 1.1f, new Color(0.7f, 0.95f, 1f, 1f));
			Vector2 val3 = new Vector2(vx, vy);
			Perks.Sparks(at, ((Vector2)(ref val3)).normalized, new Color(0.8f, 1f, 1f, 1f), 40f, 6f, 14f, 6, 0.25f, 0.06f, 0f);
			Sfx.Play(Sfx.KickClack, 0.7f);
		}

		internal static void OnBullet(Player p, GameObject bullet)
		{
			if (Loadout.Has(p, Weapon.BulletRider) && Util.IsMine(p) && Util.Alive(p) && !(Time.time - _rideStarted < 0.1f) && !((Object)(object)((Component)p).GetComponent<Ride>() != (Object)null) && Controls.JumpHeld(p))
			{
				_rideStarted = Time.time;
				Ride.Begin(p, bullet);
			}
		}

		[UnboundRPC]
		public static void RPCA_RideBullet(int viewId)
		{
			PhotonView val = PhotonView.Find(viewId);
			if ((Object)(object)val != (Object)null)
			{
				RiddenBullet.Mark(((Component)val).gameObject);
			}
		}

		[UnboundRPC]
		public static void RPCA_Ride(int pid, bool on)
		{
			Player val = Util.PlayerById(pid);
			if (!((Object)(object)val == (Object)null))
			{
				Ride.Show(val, on);
			}
		}

		[UnboundRPC]
		public static void RPCA_HammerWind(int pid)
		{
			Hammer hammer = Hammer.Of(Util.PlayerById(pid));
			if ((Object)(object)hammer != (Object)null)
			{
				hammer.ShowWind();
			}
		}

		[UnboundRPC]
		public static void RPCA_HammerSwing(int pid, float ax, float ay, float charge, float momentum)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Hammer hammer = Hammer.Of(Util.PlayerById(pid));
			if ((Object)(object)hammer != (Object)null)
			{
				hammer.ShowSwing(new Vector2(ax, ay), charge, momentum);
			}
		}

		[UnboundRPC]
		public static void RPCA_HammerHit(float x, float y, float power)
		{
			//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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Vector2 at = new Vector2(x, y);
			Fx.Burst(at, 1.4f + power, new Color(1f, 0.8f, 0.45f, 1f));
			Perks.Sparks(at, Vector2.up, new Color(1f, 0.85f, 0.5f, 1f), 180f, 5f, 14f, 10, 0.35f, 0.07f, 25f);
			Sfx.Play(Sfx.HammerHit, 0.4f);
		}

		[UnboundRPC]
		public static void RPCA_HammerStrike(int pid, float x, float y, float power)
		{
			//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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0071: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			Vector2 at = new Vector2(x, y);
			Fx.Burst(at, 1.4f + power, new Color(1f, 0.8f, 0.45f, 1f));
			Perks.Sparks(at, Vector2.up, new Color(1f, 0.85f, 0.5f, 1f), 180f, 5f, 14f, 10, 0.35f, 0.07f, 25f);
			Perks.Sparks(at, Vector2.up, new Color(1f, 0.6f, 0.25f, 0.9f), 160f, 1.5f, 5f, 8, 1.1f, 0.06f, 9f);
			Perks.Sparks(at, Vector2.up, new Color(1f, 0.9f, 0.7f, 0.8f), 120f, 0.5f, 2.5f, 6, 1.6f, 0.04f, 3f);
			Sfx.Play(Sfx.HammerHit, 0.75f);
			Hammer hammer = Hammer.Of(Util.PlayerById(pid));
			if ((Object)(object)hammer != (Object)null)
			{
				hammer.ShowHit(power);
			}
		}

		[UnboundRPC]
		public static void RPCA_HammerQuake(int pid, float x, float y, float damage, float radius)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0049: 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)
			Player val = Util.PlayerById(pid);
			if (!((Object)(object)val == (Object)null))
			{
				GameObject val2 = new GameObject("CGC_HammerQuake");
				val2.transform.position = new Vector3(x, y, 0f);
				val2.AddComponent<ShockwaveHazard>().InitQuake(val, damage, radius);
				Perks.Sparks(new Vector2(x, y), Vector2.up, new Color(0.8f, 0.75f, 0.65f, 1f), 80f, 4f, 12f, 14, 0.5f, 0.09f, 30f);
				Sfx.Play(Sfx.HammerQuake, 0.8f);
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "CallTakeDamage")]
	internal static class HarpoonEdgeDamagePatch
	{
		private static bool Prefix(HealthHandler __instance)
		{
			Player current = EdgeBouncePatch.Current;
			if ((Object)(object)current == (Object)null)
			{
				return true;
			}
			if ((Object)(object)((Component)__instance).GetComponentInParent<Player>() != (Object)(object)current)
			{
				return true;
			}
			if (Loadout.Has(current, Weapon.Harpoon))
			{
				return !HarpoonLine.EdgeImmune(current);
			}
			return true;
		}
	}
	internal sealed class RiddenBullet : MonoBehaviour
	{
		private MoveTransform _move;

		internal static void Mark(GameObject bullet)
		{
			if (!((Object)(object)bullet == (Object)null) && !((Object)(object)bullet.GetComponent<RiddenBullet>() != (Object)null))
			{
				bullet.AddComponent<RiddenBullet>()._move = bullet.GetComponent<MoveTransform>();
			}
		}

		private void Update()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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)
			if (!((Object)(object)_move == (Object)null))
			{
				Vector2 val = Vector2.op_Implicit(_move.velocity);
				if (((Vector2)(ref val)).magnitude > 30f * RideSafe.SpeedScale(this))
				{
					_move.velocity = Vector2.op_Implicit(((Vector2)(ref val)).normalized * (30f * RideSafe.SpeedScale(this)));
				}
			}
		}
	}
	internal static class Payload
	{
		internal const float ChainRange = 8f;

		internal static Player ChainTarget(Player owner, Player exclude, Vector2 from)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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)
			if ((Object)(object)PlayerManager.instance == (Object)null)
			{
				return null;
			}
			Player result = null;
			float num = 64f;
			foreach (Player player in PlayerManager.instance.players)
			{
				if (Util.Alive(player) && !((Object)(object)player == (Object)(object)exclude) && Util.IsEnemy(owner, player))
				{
					Vector2 val = Vector2.op_Implicit(((Component)player).transform.position) - from;
					float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude;
					if (sqrMagnitude < num)
					{
						num = sqrMagnitude;
						result = player;
					}
				}
			}
			return result;
		}

		internal static Vector2 PullForce(Vector2 from, Vector2 to)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = to - from;
			float magnitude = ((Vector2)(ref val)).magnitude;
			if (magnitude < 0.01f)
			{
				return Vector2.zero;
			}
			Vector2 val2 = val / magnitude + Vector2.up * 0.25f;
			return ((Vector2)(ref val2)).normalized * Mathf.Clamp(magnitude * 650f, 3000f, 9000f);
		}

		internal static void OnProjectileHit(ProjectileHit ph, Vector2 point, Vector2 normal, Vector2 vel, int viewID, bool blocked)
		{
			//IL_015d: 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_015f: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: 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_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing refere