Decompiled source of JJK Powers v1.0.0

JJKPowers.dll

Decompiled 14 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using JJKPowers.Cards;
using JJKPowers.Core;
using Microsoft.CodeAnalysis;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Utils;
using Photon.Pun;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("JJKPowers")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JJKPowers")]
[assembly: AssemblyTitle("JJKPowers")]
[assembly: AssemblyVersion("1.0.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 JJKPowers
{
	internal static class CardArt
	{
		private const int BaseSize = 320;

		private const int LayerSize = 256;

		private static readonly Dictionary<string, GameObject> cache = new Dictionary<string, GameObject>();

		private static Sprite mote;

		private static Sprite MoteSprite
		{
			get
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: 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)
				if (Object.op_Implicit((Object)(object)mote))
				{
					return mote;
				}
				ArtCanvas artCanvas = new ArtCanvas(32);
				artCanvas.Glow(Vector2.zero, 1f, Color.white, 1.4f);
				Texture2D val = artCanvas.ToTexture(feather: false);
				return mote = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			}
		}

		public static GameObject Get(string key, Action<ArtCanvas> paint, Action<ArtSpec> animate)
		{
			if (cache.TryGetValue(key, out var value) && Object.op_Implicit((Object)(object)value))
			{
				return value;
			}
			ArtSpec artSpec = new ArtSpec();
			animate?.Invoke(artSpec);
			return cache[key] = Build("JJK_Art_" + key, paint, artSpec);
		}

		private static GameObject Build(string name, Action<ArtCanvas> paint, ArtSpec spec)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			GameObject val = new GameObject(name + "_Holder");
			val.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)val);
			Image val2 = NewImage(name, val.transform, Paint(320, paint, feather: true));
			ArtAnimator artAnimator = ((Component)val2).gameObject.AddComponent<ArtAnimator>();
			int count = spec.layers.Count;
			artAnimator.layers = (RectTransform[])(object)new RectTransform[count];
			artAnimator.images = (Image[])(object)new Image[count];
			artAnimator.spin = new float[count];
			artAnimator.pulse = new float[count];
			artAnimator.pulseHz = new float[count];
			artAnimator.flicker = new float[count];
			artAnimator.flickerHz = new float[count];
			for (int i = 0; i < count; i++)
			{
				(ArtMotion motion, Action<ArtCanvas> draw) tuple = spec.layers[i];
				ArtMotion item = tuple.motion;
				Action<ArtCanvas> item2 = tuple.draw;
				Image val3 = NewImage("Layer" + i, ((Component)val2).transform, Paint(256, item2, feather: false));
				artAnimator.layers[i] = ((Graphic)val3).rectTransform;
				artAnimator.images[i] = val3;
				artAnimator.spin[i] = item.spin;
				artAnimator.pulse[i] = item.pulse;
				artAnimator.pulseHz[i] = item.pulseHz;
				artAnimator.flicker[i] = item.flicker;
				artAnimator.flickerHz[i] = item.flickerHz;
			}
			artAnimator.moteSprite = MoteSprite;
			artAnimator.moteColors = spec.motes.ConvertAll(((Color color, int count, Vector2 drift, float size) m) => m.color).ToArray();
			artAnimator.moteCounts = spec.motes.ConvertAll(((Color color, int count, Vector2 drift, float size) m) => m.count).ToArray();
			artAnimator.moteDrift = spec.motes.ConvertAll(((Color color, int count, Vector2 drift, float size) m) => m.drift).ToArray();
			artAnimator.moteSize = spec.motes.ConvertAll(((Color color, int count, Vector2 drift, float size) m) => m.size).ToArray();
			return ((Component)val2).gameObject;
		}

		private static Image NewImage(string name, Transform parent, Texture2D tex)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) });
			val.transform.SetParent(parent, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			Image obj = val.AddComponent<Image>();
			obj.sprite = Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f));
			obj.preserveAspect = true;
			((Graphic)obj).raycastTarget = false;
			return obj;
		}

		private static Texture2D Paint(int size, Action<ArtCanvas> draw, bool feather)
		{
			ArtCanvas artCanvas = new ArtCanvas(size);
			draw(artCanvas);
			return artCanvas.ToTexture(feather);
		}
	}
	internal struct ArtMotion
	{
		public float spin;

		public float pulse;

		public float pulseHz;

		public float flicker;

		public float flickerHz;

		public static ArtMotion Spin(float degreesPerSecond)
		{
			return new ArtMotion
			{
				spin = degreesPerSecond
			};
		}

		public static ArtMotion Pulse(float amount, float hz)
		{
			return new ArtMotion
			{
				pulse = amount,
				pulseHz = hz
			};
		}

		public static ArtMotion Flicker(float amount, float hz)
		{
			return new ArtMotion
			{
				flicker = amount,
				flickerHz = hz
			};
		}

		public ArtMotion And(ArtMotion o)
		{
			return new ArtMotion
			{
				spin = spin + o.spin,
				pulse = pulse + o.pulse,
				pulseHz = pulseHz + o.pulseHz,
				flicker = flicker + o.flicker,
				flickerHz = flickerHz + o.flickerHz
			};
		}
	}
	internal class ArtSpec
	{
		public readonly List<(ArtMotion motion, Action<ArtCanvas> draw)> layers = new List<(ArtMotion, Action<ArtCanvas>)>();

		public readonly List<(Color color, int count, Vector2 drift, float size)> motes = new List<(Color, int, Vector2, float)>();

		public ArtSpec Layer(ArtMotion motion, Action<ArtCanvas> draw)
		{
			layers.Add((motion, draw));
			return this;
		}

		public ArtSpec Motes(Color color, int count, Vector2 drift, float size = 0.05f)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			motes.Add((color, count, drift, size));
			return this;
		}
	}
	internal class ArtAnimator : MonoBehaviour
	{
		private struct Mote
		{
			public RectTransform rt;

			public Image img;

			public Vector2 pos;

			public Vector2 drift;

			public float phase;

			public float size;

			public Color color;
		}

		public RectTransform[] layers;

		public Image[] images;

		public float[] spin;

		public float[] pulse;

		public float[] pulseHz;

		public float[] flicker;

		public float[] flickerHz;

		public Sprite moteSprite;

		public Color[] moteColors;

		public int[] moteCounts;

		public Vector2[] moteDrift;

		public float[] moteSize;

		private readonly List<Mote> motes = new List<Mote>();

		private float[] baseAlpha;

		private RectTransform self;

		private void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: 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_0119: 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)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			self = (RectTransform)((Component)this).transform;
			baseAlpha = new float[images.Length];
			for (int i = 0; i < images.Length; i++)
			{
				baseAlpha[i] = ((Graphic)images[i]).color.a;
			}
			Vector2 val3 = default(Vector2);
			for (int j = 0; j < moteColors.Length; j++)
			{
				for (int k = 0; k < moteCounts[j]; k++)
				{
					GameObject val = new GameObject("Mote", new Type[1] { typeof(RectTransform) });
					val.transform.SetParent(((Component)this).transform, false);
					Image val2 = val.AddComponent<Image>();
					val2.sprite = moteSprite;
					((Graphic)val2).raycastTarget = false;
					RectTransform rectTransform = ((Graphic)val2).rectTransform;
					((Vector2)(ref val3))..ctor(0.5f, 0.5f);
					rectTransform.anchorMax = val3;
					rectTransform.anchorMin = val3;
					motes.Add(new Mote
					{
						rt = rectTransform,
						img = val2,
						color = moteColors[j],
						drift = moteDrift[j],
						pos = Random.insideUnitCircle * 0.9f,
						phase = Random.value * 10f,
						size = moteSize[j] * Random.Range(0.5f, 1.3f)
					});
				}
			}
		}

		private void Update()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: 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_01ed: 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_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_01c8: 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_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: 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)
			float unscaledTime = Time.unscaledTime;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			for (int i = 0; i < layers.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)layers[i]))
				{
					((Transform)layers[i]).localRotation = Quaternion.Euler(0f, 0f, unscaledTime * spin[i]);
					((Transform)layers[i]).localScale = Vector3.one * (1f + pulse[i] * Mathf.Sin(unscaledTime * pulseHz[i] * (float)Math.PI * 2f));
					if (flicker[i] > 0f)
					{
						float num = Mathf.PerlinNoise(unscaledTime * flickerHz[i], (float)i * 3.1f);
						Color color = ((Graphic)images[i]).color;
						color.a = baseAlpha[i] * (1f - flicker[i] * num);
						((Graphic)images[i]).color = color;
					}
				}
			}
			Rect rect = self.rect;
			float num2 = ((Rect)(ref rect)).width * 0.5f;
			rect = self.rect;
			float num3 = ((Rect)(ref rect)).height * 0.5f;
			for (int j = 0; j < motes.Count; j++)
			{
				Mote value = motes[j];
				if (value.drift == Vector2.zero)
				{
					float magnitude = ((Vector2)(ref value.pos)).magnitude;
					float num4 = Mathf.Atan2(value.pos.y, value.pos.x) + unscaledDeltaTime * (0.6f / Mathf.Max(0.2f, magnitude));
					value.pos = new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * magnitude;
				}
				else
				{
					ref Vector2 pos = ref value.pos;
					pos += value.drift * unscaledDeltaTime * 2f;
					if (Mathf.Abs(value.pos.x) > 1f || Mathf.Abs(value.pos.y) > 1f)
					{
						value.pos = -((Vector2)(ref value.drift)).normalized * 0.95f + Vector2.Perpendicular(((Vector2)(ref value.drift)).normalized) * Random.Range(-0.9f, 0.9f);
					}
				}
				float num5 = 0.55f + 0.45f * Mathf.Sin(unscaledTime * 3f + value.phase);
				float num6 = Mathf.Clamp01((1f - ((Vector2)(ref value.pos)).magnitude) * 3f);
				value.rt.anchoredPosition = new Vector2(value.pos.x * num2, value.pos.y * num3);
				float num7 = value.size * Mathf.Min(num2, num3) * 2f;
				value.rt.sizeDelta = new Vector2(num7, num7);
				Color color2 = value.color;
				color2.a *= num5 * num6;
				((Graphic)value.img).color = color2;
				motes[j] = value;
			}
		}
	}
	internal class ArtCanvas
	{
		private readonly int size;

		private readonly Color[] px;

		public ArtCanvas(int size)
		{
			this.size = size;
			px = (Color[])(object)new Color[size * size];
		}

		public static Vector2 Polar(float angle, float radius)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * radius;
		}

		public void Background(Color deep, Color mid, Color accent, int seed)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0056: 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_00bc: 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)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			float num = (float)seed * 13.7f;
			float num2 = (float)seed * 7.3f;
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					Vector2 val = P(j, i);
					float num3 = Fbm(val.x * 1.6f + num, val.y * 1.6f + num2);
					float num4 = Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(Fbm(val.x * 2.4f + num2, val.y * 2.4f - num) - 0.5f) * 5f), 3f);
					float num5 = 1f - Mathf.Clamp01(((Vector2)(ref val)).magnitude * 0.75f - 0.15f);
					Color val2 = Color.Lerp(deep, mid, num3 * num5);
					val2 = Color.Lerp(val2, accent, num4 * 0.45f * num5);
					val2.a = 1f;
					px[i * size + j] = val2;
				}
			}
		}

		public void Glow(Vector2 c, float r, Color color, float strength = 1f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			Each(c.x - r, c.x + r, c.y - r, c.y + r, delegate(int i, Vector2 p)
			{
				//IL_0000: 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_0024: Unknown result type (might be due to invalid IL or missing references)
				float num = Vector2.Distance(p, c) / r;
				if (num < 1f)
				{
					Add(i, color, Mathf.Pow(1f - num, 2.2f) * strength);
				}
			});
		}

		public void FillCircle(Vector2 c, float r, Color color, float feather = 0.01f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			Fill((Vector2 p) => Vector2.Distance(p, c) - r, c.x - r, c.x + r, c.y - r, c.y + r, color, feather);
		}

		public void FillEllipse(Vector2 c, float rx, float ry, Color color, float feather = 0.01f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			Fill(delegate(Vector2 p)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				Vector2 val = new Vector2((p.x - c.x) / rx, (p.y - c.y) / ry);
				return (((Vector2)(ref val)).magnitude - 1f) * Mathf.Min(rx, ry);
			}, c.x - rx, c.x + rx, c.y - ry, c.y + ry, color, feather);
		}

		public void FillPoly(Vector2[] pts, Color color, float feather = 0.01f)
		{
			//IL_0037: 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_003f: 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_005b: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			float num = float.MaxValue;
			float num2 = float.MinValue;
			float num3 = float.MaxValue;
			float num4 = float.MinValue;
			Vector2[] array = pts;
			foreach (Vector2 val in array)
			{
				num = Mathf.Min(num, val.x);
				num2 = Mathf.Max(num2, val.x);
				num3 = Mathf.Min(num3, val.y);
				num4 = Mathf.Max(num4, val.y);
			}
			Fill(delegate(Vector2 p)
			{
				//IL_001b: 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_002f: 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_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: 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 num5 = float.MaxValue;
				bool flag = false;
				int num6 = 0;
				int num7 = pts.Length - 1;
				while (num6 < pts.Length)
				{
					num5 = Mathf.Min(num5, DistSegment(p, pts[num7], pts[num6]));
					if (pts[num6].y > p.y != pts[num7].y > p.y && p.x < (pts[num7].x - pts[num6].x) * (p.y - pts[num6].y) / (pts[num7].y - pts[num6].y) + pts[num6].x)
					{
						flag = !flag;
					}
					num7 = num6++;
				}
				return (!flag) ? num5 : (0f - num5);
			}, num, num2, num3, num4, color, feather);
		}

		public void Line(Vector2 a, Vector2 b, Color color, float width = 0.03f, bool glow = true, bool taper = false)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			float num = width * (glow ? 5f : 1f) + 0.04f;
			Stroke(delegate(Vector2 p)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: 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_007a: Unknown result type (might be due to invalid IL or missing references)
				Vector2 val = b - a;
				float num2 = ((((Vector2)(ref val)).sqrMagnitude < 1E-08f) ? 0f : Mathf.Clamp01(Vector2.Dot(p - a, val) / ((Vector2)(ref val)).sqrMagnitude));
				float item = (taper ? (width * (1f - 0.9f * num2)) : width);
				return (d: Vector2.Distance(p, a + val * num2), w: item);
			}, Mathf.Min(a.x, b.x) - num, Mathf.Max(a.x, b.x) + num, Mathf.Min(a.y, b.y) - num, Mathf.Max(a.y, b.y) + num, color, glow, width);
		}

		public void Ring(Vector2 c, float r, Color color, float width = 0.025f, bool glow = true)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			float num = r + width * 5f + 0.04f;
			Stroke((Vector2 p) => (d: Mathf.Abs(Vector2.Distance(p, c) - r), w: width), c.x - num, c.x + num, c.y - num, c.y + num, color, glow, width);
		}

		public void Curve(Func<float, Vector2> f, Color color, float width = 0.03f, int steps = 90, bool glow = true, bool taper = false)
		{
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			Vector2[] array = (Vector2[])(object)new Vector2[steps + 1];
			for (int i = 0; i <= steps; i++)
			{
				array[i] = f((float)i / (float)steps);
			}
			Path(array, color, width, glow, taper);
		}

		public void Polyline(IList<Vector2> points, Color color, float width = 0.03f, bool glow = true)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Vector2[] array = (Vector2[])(object)new Vector2[points.Count];
			points.CopyTo(array, 0);
			Path(array, color, width, glow, taper: false);
		}

		private void Path(Vector2[] pts, Color color, float width, bool glow, bool taper)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0094: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_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_0187: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0264: Unknown result type (might be due to invalid IL or missing references)
			float num = width * (glow ? 5f : 1f) + 0.04f;
			int num2 = pts.Length - 1;
			float[] array = new float[size * size];
			float[] array2 = new float[size * size];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = float.MaxValue;
			}
			int num3 = size;
			int num4 = 0;
			int num5 = size;
			int num6 = 0;
			for (int j = 0; j < num2; j++)
			{
				Vector2 val = pts[j];
				Vector2 val2 = pts[j + 1] - val;
				int num7 = ToPx(Mathf.Min(val.x, pts[j + 1].x) - num);
				int num8 = ToPx(Mathf.Max(val.x, pts[j + 1].x) + num);
				int num9 = ToPx(Mathf.Min(val.y, pts[j + 1].y) - num);
				int num10 = ToPx(Mathf.Max(val.y, pts[j + 1].y) + num);
				num3 = Mathf.Min(num3, num7);
				num4 = Mathf.Max(num4, num8);
				num5 = Mathf.Min(num5, num9);
				num6 = Mathf.Max(num6, num10);
				for (int k = num9; k <= num10; k++)
				{
					for (int l = num7; l <= num8; l++)
					{
						Vector2 val3 = P(l, k);
						float num11 = ((((Vector2)(ref val2)).sqrMagnitude < 1E-08f) ? 0f : Mathf.Clamp01(Vector2.Dot(val3 - val, val2) / ((Vector2)(ref val2)).sqrMagnitude));
						float num12 = Vector2.Distance(val3, val + val2 * num11);
						int num13 = k * size + l;
						if (num12 < array[num13])
						{
							array[num13] = num12;
							array2[num13] = ((float)j + num11) / (float)num2;
						}
					}
				}
			}
			for (int m = num5; m <= num6; m++)
			{
				for (int n = num3; n <= num4; n++)
				{
					int num14 = m * size + n;
					if (array[num14] != float.MaxValue)
					{
						float w = (taper ? (width * (1f - 0.9f * array2[num14])) : width);
						Shade(num14, array[num14], w, color, glow, width);
					}
				}
			}
		}

		public void Rays(Vector2 c, int count, float length, Color color, int seed, float width = 0.03f)
		{
			//IL_0052: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			Random random = new Random(seed);
			for (int i = 0; i < count; i++)
			{
				float num = (float)((double)i / (double)count * Math.PI * 2.0 + random.NextDouble() * 0.3);
				float num2 = length * (0.5f + 0.5f * (float)random.NextDouble());
				Line(c, c + new Vector2(Mathf.Cos(num), Mathf.Sin(num)) * num2, color, width * (0.6f + 0.8f * (float)random.NextDouble()), glow: true, taper: true);
			}
		}

		public void Stars(int count, int seed, Color color, float maxRadius = 0.02f)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_007e: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_00f0: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			Random random = new Random(seed);
			for (int i = 0; i < count; i++)
			{
				Vector2 val = new Vector2((float)random.NextDouble() * 2f - 1f, (float)random.NextDouble() * 2f - 1f) * 0.95f;
				float num = maxRadius * (0.3f + 0.7f * (float)random.NextDouble());
				Glow(val, num * 3f, color, 0.6f);
				if (num > maxRadius * 0.8f)
				{
					Line(val + Vector2.left * num * 4f, val + Vector2.right * num * 4f, color, num * 0.25f, glow: false);
					Line(val + Vector2.down * num * 4f, val + Vector2.up * num * 4f, color, num * 0.25f, glow: false);
				}
			}
		}

		public void Lightning(Vector2 a, Vector2 b, Color color, float width, int seed, int forks = 2)
		{
			//IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_0066: 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_006e: 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_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_00ea: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: 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_0122: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			Random random = new Random(seed);
			List<Vector2> list = new List<Vector2>();
			Vector2 val = b - a;
			Vector2 val2 = Vector2.Perpendicular(((Vector2)(ref val)).normalized);
			float num = Vector2.Distance(a, b);
			for (int i = 0; i <= 10; i++)
			{
				float num2 = (float)i / 10f;
				float num3 = ((i == 0 || i == 10) ? 0f : (((float)random.NextDouble() - 0.5f) * num * 0.25f));
				list.Add(Vector2.Lerp(a, b, num2) + val2 * num3);
			}
			Polyline(list, color, width);
			Polyline(list, Color.white, width * 0.35f, glow: false);
			for (int j = 0; j < forks; j++)
			{
				Vector2 val3 = list[1 + random.Next(8)];
				Quaternion val4 = Quaternion.Euler(0f, 0f, (float)(random.NextDouble() * 100.0 - 50.0));
				val = b - a;
				Vector2 val5 = Vector2.op_Implicit(val4 * Vector2.op_Implicit(((Vector2)(ref val)).normalized));
				Line(val3, val3 + val5 * num * 0.3f, color, width * 0.6f, glow: true, taper: true);
			}
		}

		private void Stroke(Func<Vector2, (float d, float w)> sample, float minX, float maxX, float minY, float maxY, Color color, bool glow, float maxWidth)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Each(minX, maxX, minY, maxY, delegate(int i, Vector2 p)
			{
				//IL_0006: 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)
				var (d, w) = sample(p);
				Shade(i, d, w, color, glow, maxWidth);
			});
		}

		private void Shade(int i, float d, float w, Color color, bool glow, float maxWidth)
		{
			//IL_0027: 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_0062: 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)
			float num = Mathf.Clamp01((w - d) / (2f / (float)size) + 0.5f);
			if (num > 0f)
			{
				Over(i, color, num * color.a);
			}
			if (glow)
			{
				float num2 = Mathf.Clamp01(1f - d / (maxWidth * 4f + 0.04f));
				if (num2 > 0f)
				{
					Add(i, color, num2 * num2 * 0.5f * color.a);
				}
			}
		}

		private void Fill(Func<Vector2, float> signedDistance, float minX, float maxX, float minY, float maxY, Color color, float feather)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			Each(minX - feather, maxX + feather, minY - feather, maxY + feather, delegate(int i, Vector2 p)
			{
				//IL_000b: 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)
				float num = Mathf.Clamp01(0.5f - signedDistance(p) / Mathf.Max(feather, 2f / (float)size));
				if (num > 0f)
				{
					Over(i, color, num * color.a);
				}
			});
		}

		private void Each(float minX, float maxX, float minY, float maxY, Action<int, Vector2> action)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			int num = ToPx(minX);
			int num2 = ToPx(maxX);
			int num3 = ToPx(minY);
			int num4 = ToPx(maxY);
			for (int i = num3; i <= num4; i++)
			{
				for (int j = num; j <= num2; j++)
				{
					action(i * size + j, P(j, i));
				}
			}
		}

		private Vector2 P(int x, int y)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((float)x + 0.5f) / (float)size * 2f - 1f, ((float)y + 0.5f) / (float)size * 2f - 1f);
		}

		private int ToPx(float v)
		{
			return Mathf.Clamp(Mathf.FloorToInt((v + 1f) * 0.5f * (float)size), 0, size - 1);
		}

		private void Over(int i, Color c, float a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			Color val = px[i];
			float num = a + val.a * (1f - a);
			if (!(num <= 0f))
			{
				px[i] = new Color((c.r * a + val.r * val.a * (1f - a)) / num, (c.g * a + val.g * val.a * (1f - a)) / num, (c.b * a + val.b * val.a * (1f - a)) / num, num);
			}
		}

		private void Add(int i, Color c, float amount)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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)
			Color val = px[i];
			px[i] = new Color(Mathf.Min(1f, val.r + c.r * amount), Mathf.Min(1f, val.g + c.g * amount), Mathf.Min(1f, val.b + c.b * amount), Mathf.Min(1f, val.a + amount));
		}

		private static float Fbm(float x, float y)
		{
			float num = 0f;
			float num2 = 0.5f;
			float num3 = 1f;
			for (int i = 0; i < 4; i++)
			{
				num += num2 * Mathf.PerlinNoise(x * num3, y * num3);
				num2 *= 0.5f;
				num3 *= 2.1f;
			}
			return Mathf.Clamp01(num * 1.1f);
		}

		private static float DistSegment(Vector2 p, Vector2 a, Vector2 b)
		{
			//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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			Vector2 val = b - a;
			float num = ((((Vector2)(ref val)).sqrMagnitude < 1E-08f) ? 0f : Mathf.Clamp01(Vector2.Dot(p - a, val) / ((Vector2)(ref val)).sqrMagnitude));
			return Vector2.Distance(p, a + val * num);
		}

		public Texture2D ToTexture(bool feather)
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_010f: Expected O, but got Unknown
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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)
			if (feather)
			{
				for (int i = 0; i < size; i++)
				{
					for (int j = 0; j < size; j++)
					{
						Vector2 val = P(j, i);
						float num = Mathf.Max(Mathf.Abs(val.x), Mathf.Abs(val.y));
						Vector2 val2 = new Vector2(Mathf.Max(0f, Mathf.Abs(val.x) - 0.7f), Mathf.Max(0f, Mathf.Abs(val.y) - 0.7f));
						float num2 = ((Vector2)(ref val2)).magnitude / 0.3f;
						float num3 = Mathf.Clamp01((1f - Mathf.Max(num, num2)) * 12f);
						px[i * size + j].a *= num3;
					}
				}
			}
			Texture2D val3 = new Texture2D(size, size, (TextureFormat)4, false)
			{
				wrapMode = (TextureWrapMode)1
			};
			val3.SetPixels(px);
			val3.Apply(false, true);
			return val3;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.toufic.jjkpowers", "JJK Powers", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public const string ModId = "com.toufic.jjkpowers";

		public const string ModName = "JJK Powers";

		public const string Version = "1.0.0";

		public const string ModInitials = "JJK";

		public static ConfigEntry<float> EffectsVolume;

		private void Awake()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			EffectsVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Effects volume", 0.4f, new ConfigDescription("Volume of JJK Powers sound effects (0 = muted, 1 = loudest). Also scaled by the game's SFX slider.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			new Harmony("com.toufic.jjkpowers").PatchAll();
		}

		private void Start()
		{
			CustomCard.BuildCard<Infinity>();
			CustomCard.BuildCard<UnlimitedVoid>();
			CustomCard.BuildCard<LimitlessBlue>();
			CustomCard.BuildCard<LimitlessRed>();
			CustomCard.BuildCard<HollowPurple>();
			CustomCard.BuildCard<Dismantle>();
			CustomCard.BuildCard<MalevolentShrine>();
			CustomCard.BuildCard<DivineDog>();
			CustomCard.BuildCard<Nue>();
			CustomCard.BuildCard<StrawDoll>();
			CustomCard.BuildCard<DivergentFist>();
			CustomCard.BuildCard<CursedToolBarrage>();
			CustomCard.BuildCard<CursedToolsMastery>();
			CustomCard.BuildCard<MultiCore>();
			CustomCard.BuildCard<BoogieWoogie>();
			CustomCard.BuildCard<RatioTechnique>();
			CustomCard.BuildCard<IdleTransfiguration>();
			CustomCard.BuildCard<VolcanicUnderworld>();
			CustomCard.BuildCard<RootDomain>();
			CustomCard.BuildCard<BloodManipulation>();
			CustomCard.BuildCard<Rika>();
			CustomCard.BuildCard<CursedSpiritManipulation>();
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)Cleanup);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)Cleanup);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)Cleanup);
		}

		private static IEnumerator Cleanup(IGameModeHandler gameModeHandler)
		{
			Zone.ClearAll();
			Summon.ClearAll();
			Bullets.Clear();
			Vfx.Clear();
			Particles.Clear();
			Feel.Clear();
			yield break;
		}
	}
}
namespace JJKPowers.Core
{
	internal abstract class Ability : MonoBehaviour
	{
		private static readonly Dictionary<Player, List<Ability>> byPlayer = new Dictionary<Player, List<Ability>>();

		private static readonly List<Ability> empty = new List<Ability>();

		public Player player { get; private set; }

		public int stacks { get; private set; }

		public virtual bool IsGunModifier => false;

		protected virtual int Order => 0;

		public virtual float DamageTakenMultiplier => 1f;

		public virtual float KnockbackTakenMultiplier => 1f;

		public static T Add<T>(Player player) where T : Ability
		{
			T val = ((Component)player).GetComponent<T>();
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)player).gameObject.AddComponent<T>();
			}
			int num = val.stacks;
			val.stacks = num + 1;
			val.OnStacksChanged();
			return val;
		}

		public static void Remove<T>(Player player) where T : Ability
		{
			T component = ((Component)player).GetComponent<T>();
			if (!((Object)(object)component == (Object)null))
			{
				int num = component.stacks;
				component.stacks = num - 1;
				if (component.stacks <= 0)
				{
					Object.DestroyImmediate((Object)(object)component);
				}
				else
				{
					component.OnStacksChanged();
				}
			}
		}

		public static List<Ability> On(Player player)
		{
			if (!((Object)(object)player != (Object)null) || !byPlayer.TryGetValue(player, out var value))
			{
				return empty;
			}
			return value;
		}

		public static T Get<T>(Player player) where T : Ability
		{
			foreach (Ability item in On(player))
			{
				if (item is T result)
				{
					return result;
				}
			}
			return null;
		}

		protected virtual void Awake()
		{
			player = ((Component)this).GetComponent<Player>();
			if (!byPlayer.TryGetValue(player, out var value))
			{
				value = (byPlayer[player] = new List<Ability>());
			}
			int num = value.FindIndex((Ability a) => a.Order > Order);
			value.Insert((num < 0) ? value.Count : num, this);
			Block block = player.data.block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(HandleBlock));
			HealthHandler healthHandler = player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
		}

		protected virtual void OnDestroy()
		{
			if (byPlayer.TryGetValue(player, out var value))
			{
				value.Remove(this);
				if (value.Count == 0)
				{
					byPlayer.Remove(player);
				}
			}
			if ((Object)(object)player != (Object)null)
			{
				Block block = player.data.block;
				block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(HandleBlock));
				HealthHandler healthHandler = player.data.healthHandler;
				healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
			}
		}

		private void HandleBlock(BlockTriggerType type)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			if ((int)type == 0)
			{
				OnBlock();
			}
		}

		protected virtual void OnStacksChanged()
		{
		}

		protected virtual void OnBlock()
		{
		}

		protected virtual void OnRevive()
		{
		}

		public virtual void OnBullet(ProjectileHit bullet)
		{
		}

		public virtual void BeforeHit(HitContext hit)
		{
		}

		public virtual void AfterHit(HitContext hit)
		{
		}

		public static void ForEach(Player player, Action<Ability> action)
		{
			List<Ability> list = On(player);
			for (int i = 0; i < list.Count; i++)
			{
				try
				{
					action(list[i]);
				}
				catch (Exception ex)
				{
					Debug.LogException(ex);
				}
			}
		}
	}
	internal class HitContext
	{
		public ProjectileHit bullet;

		public Player owner;

		public Player target;

		public Vector2 point;

		public float damage;

		public bool wasBlocked;

		public float damageMultiplier = 1f;

		public bool HitEnemy
		{
			get
			{
				if ((Object)(object)target != (Object)null)
				{
					return Game.IsEnemy(owner, target);
				}
				return false;
			}
		}
	}
	internal static class Art
	{
		private delegate float Shape(float x, float y);

		private const string GlowShaderName = "Legacy Shaders/Particles/Alpha Blended Premultiply";

		private static bool initialised;

		private static bool additive;

		private static Material spriteMaterial;

		private static readonly Dictionary<string, Sprite> sprites = new Dictionary<string, Sprite>();

		private static readonly Dictionary<Texture, Material> particleMaterials = new Dictionary<Texture, Material>();

		private static Material lineMaterial;

		private static Material plainMaterial;

		public static Sprite Glow => Get("glow", 64, 64, glow: true, (float x, float y) => Mathf.Exp((0f - R(x, y)) * R(x, y) * 5f) * Edge(x, y));

		public static Sprite Core => Get("core", 64, 64, glow: true, (float x, float y) => Mathf.Pow(Mathf.Clamp01(1f - R(x, y)), 3f));

		public static Sprite Ring => Get("ring", 128, 128, glow: true, (float x, float y) => Band(R(x, y), 0.9f, 0.06f) + 0.25f * Band(R(x, y), 0.9f, 0.16f));

		public static Sprite Spark => Get("spark", 64, 16, glow: true, (float x, float y) => Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(x)), 1.5f) * Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(y)), 2f));

		public static Sprite Star => Get("star", 64, 64, glow: true, (float x, float y) => Mathf.Clamp01(Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(x) * 6f), 2f) * Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(y)), 3f) + Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(y) * 6f), 2f) * Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(x)), 3f) + Mathf.Pow(Mathf.Clamp01(1f - R(x, y) * 2.5f), 2f)));

		public static Sprite Crescent => Get("crescent", 128, 64, glow: true, delegate(float x, float y)
		{
			float num = -0.55f + 0.95f * (1f - x * x);
			float num2 = 0.28f * (1f - x * x);
			float num3 = Mathf.Abs(y - num);
			return (!(num2 <= 0f)) ? Mathf.Pow(Mathf.Clamp01(1f - num3 / num2), 1.6f) : 0f;
		});

		public static Sprite Floor => Get("floor", 128, 128, glow: true, delegate(float x, float y)
		{
			float num = R(x, y);
			return (!(num > 1f)) ? (Mathf.Clamp01((1f - num) / 0.03f) * Mathf.Lerp(0.2f, 1f, Mathf.Pow(num, 5f))) : 0f;
		});

		public static Sprite Smoke => Get("smoke", 64, 64, glow: false, delegate(float x, float y)
		{
			float num = Mathf.PerlinNoise(x * 2.2f + 7.3f, y * 2.2f + 1.9f);
			return Mathf.Clamp01((1f - R(x, y) * (0.75f + 0.5f * num)) * 1.6f) * Edge(x, y);
		});

		public static Sprite Shadow => Get("shadow", 64, 64, glow: false, (float x, float y) => Mathf.Pow(Mathf.Clamp01(1f - R(x, y)), 1.4f));

		public static Sprite Nail => Get("nail", 16, 64, glow: false, delegate(float x, float y)
		{
			float num = 0.15f + 0.85f * (y + 1f) * 0.5f;
			return (!(y > 0.8f)) ? Mathf.Clamp01((1f - Mathf.Abs(x) / num) * 3f) : 1f;
		});

		public static Sprite ShrineSilhouette
		{
			get
			{
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				if (sprites.TryGetValue("shrine", out var value) && Object.op_Implicit((Object)(object)value))
				{
					return value;
				}
				return sprites["shrine"] = Make(128, 160, glow: false, delegate(float x, float y)
				{
					float num = (y + 1f) * 0.5f;
					float num2 = Mathf.Abs(x);
					for (int i = 0; i < 3; i++)
					{
						float num3 = 0.36f + (float)i * 0.21f;
						float num4 = 0.95f - (float)i * 0.25f;
						float num5 = 0.05f * num2 * num2 / (num4 * num4);
						if (num > num3 + num5 - 0.035f && num < num3 + num5 + 0.03f && num2 < num4)
						{
							return 1f;
						}
						if (num > num3 - 0.13f && num < num3 && num2 < num4 * 0.62f)
						{
							return 1f;
						}
					}
					if (num < 0.24f && num2 > 0.45f && num2 < 0.56f)
					{
						return 1f;
					}
					if (num > 0.18f && num < 0.24f && num2 < 0.8f)
					{
						return 1f;
					}
					return (num > 0.85f && num < 0.98f && num2 < 0.03f + (0.98f - num) * 0.12f) ? 1f : 0f;
				}, new Vector2(0.5f, 0f));
			}
		}

		public static Material SpriteMaterial
		{
			get
			{
				Init();
				return spriteMaterial;
			}
		}

		public static Material PlainMaterial
		{
			get
			{
				//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_0031: Expected O, but got Unknown
				if (Object.op_Implicit((Object)(object)plainMaterial))
				{
					return plainMaterial;
				}
				GameObject val = new GameObject("JJK_MaterialProbe");
				plainMaterial = ((Renderer)val.AddComponent<SpriteRenderer>()).sharedMaterial;
				Object.Destroy((Object)val);
				return plainMaterial;
			}
		}

		public static Material LineMaterial
		{
			get
			{
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: 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_0069: Expected O, but got Unknown
				//IL_006a: Expected O, but got Unknown
				Init();
				if (Object.op_Implicit((Object)(object)lineMaterial))
				{
					return lineMaterial;
				}
				Texture2D val = MakeTexture(4, 32, glow: true, (float x, float y) => Mathf.Pow(Mathf.Clamp01(1f - Mathf.Abs(y)), 1.8f));
				((Texture)val).wrapMode = (TextureWrapMode)1;
				Material val2 = new Material(spriteMaterial)
				{
					name = "JJK_Line",
					mainTexture = (Texture)(object)val
				};
				lineMaterial = val2;
				return val2;
			}
		}

		public static Material ParticleMaterial(Sprite sprite)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			Init();
			Texture2D texture = sprite.texture;
			if (particleMaterials.TryGetValue((Texture)(object)texture, out var value) && Object.op_Implicit((Object)(object)value))
			{
				return value;
			}
			value = new Material(spriteMaterial)
			{
				name = "JJK_Particle_" + ((Object)texture).name,
				mainTexture = (Texture)(object)texture
			};
			particleMaterials[(Texture)(object)texture] = value;
			return value;
		}

		private static void Init()
		{
			//IL_0064: 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_0079: Expected O, but got Unknown
			if (initialised)
			{
				return;
			}
			initialised = true;
			Shader val = Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply");
			if ((Object)(object)val == (Object)null)
			{
				Shader[] array = Resources.FindObjectsOfTypeAll<Shader>();
				foreach (Shader val2 in array)
				{
					if (((Object)val2).name == "Legacy Shaders/Particles/Alpha Blended Premultiply")
					{
						val = val2;
						break;
					}
				}
			}
			additive = (Object)(object)val != (Object)null;
			if (additive)
			{
				spriteMaterial = new Material(val)
				{
					name = "JJK_Glow"
				};
			}
			else
			{
				spriteMaterial = PlainMaterial;
			}
			Debug.Log((object)("[JJK] Effects rendering: " + (additive ? "additive glow" : "alpha-blend fallback")));
		}

		private static float R(float x, float y)
		{
			return Mathf.Sqrt(x * x + y * y);
		}

		private static float Edge(float x, float y)
		{
			return Mathf.Clamp01((1f - R(x, y)) * 8f);
		}

		private static float Band(float r, float center, float halfWidth)
		{
			float num = Mathf.Abs(r - center) / halfWidth;
			if (!(num >= 1f))
			{
				return 1f - num * num;
			}
			return 0f;
		}

		private static Sprite Get(string key, int w, int h, bool glow, Shape shape)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (sprites.TryGetValue(key, out var value) && Object.op_Implicit((Object)(object)value))
			{
				return value;
			}
			return sprites[key] = Make(w, h, glow, shape, new Vector2(0.5f, 0.5f));
		}

		private static Sprite Make(int w, int h, bool glow, Shape shape, Vector2 pivot)
		{
			//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)
			return Sprite.Create(MakeTexture(w, h, glow, shape), new Rect(0f, 0f, (float)w, (float)h), pivot, (float)Mathf.Max(w, h));
		}

		private static Texture2D MakeTexture(int w, int h, bool glow, Shape shape)
		{
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			Init();
			Color32[] array = (Color32[])(object)new Color32[w * h];
			for (int i = 0; i < h; i++)
			{
				for (int j = 0; j < w; j++)
				{
					byte b = (byte)(Mathf.Clamp01(shape(((float)j + 0.5f) / (float)w * 2f - 1f, ((float)i + 0.5f) / (float)h * 2f - 1f)) * 255f);
					array[i * w + j] = ((!additive) ? new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b) : (glow ? new Color32(b, b, b, (byte)0) : new Color32(b, b, b, b)));
				}
			}
			Texture2D val = new Texture2D(w, h, (TextureFormat)4, false)
			{
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)1
			};
			val.SetPixels32(array);
			val.Apply(false, true);
			return val;
		}
	}
	internal class Aura : MonoBehaviour
	{
		private SpriteRenderer sr;

		private float size;

		private float pulse;

		private float pulseSpeed;

		private float spin;

		private float phase;

		private Color color;

		public Color Color
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return color;
			}
			set
			{
				//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)
				color = value;
			}
		}

		public float Size
		{
			get
			{
				return size;
			}
			set
			{
				size = value;
			}
		}

		public bool Visible
		{
			get
			{
				return ((Renderer)sr).enabled;
			}
			set
			{
				((Renderer)sr).enabled = value;
			}
		}

		public SpriteRenderer Renderer => sr;

		public static Aura Create(Transform parent, Sprite sprite, Color color, float size, float pulse = 0.06f, float pulseSpeed = 3f, float spin = 0f, int order = 10, bool plain = false)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_006f: 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)
			GameObject val = new GameObject("JJK_Aura");
			val.transform.SetParent(parent, false);
			Aura aura = val.AddComponent<Aura>();
			aura.sr = val.AddComponent<SpriteRenderer>();
			((Renderer)aura.sr).sharedMaterial = (plain ? Art.PlainMaterial : Art.SpriteMaterial);
			aura.sr.sprite = sprite;
			((Renderer)aura.sr).sortingLayerName = "MostFront";
			((Renderer)aura.sr).sortingOrder = order;
			aura.color = color;
			aura.size = size;
			aura.pulse = pulse;
			aura.pulseSpeed = pulseSpeed;
			aura.spin = spin;
			aura.phase = Random.value * 10f;
			aura.Refresh();
			return aura;
		}

		private void LateUpdate()
		{
			Refresh();
		}

		private void Refresh()
		{
			//IL_0042: 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_0074: 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_00b8: 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)
			float num = Mathf.Sin((Time.time + phase) * pulseSpeed);
			float num2 = (Object.op_Implicit((Object)(object)((Component)this).transform.parent) ? Mathf.Max(0.01f, ((Component)this).transform.parent.lossyScale.x) : 1f);
			((Component)this).transform.localScale = Vector3.one * (size * (1f + pulse * num) / num2);
			((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, Time.time * spin + phase * 36f);
			sr.color = color.A(color.a * (0.8f + 0.2f * num));
		}

		public static void Destroy(ref Aura aura)
		{
			if (Object.op_Implicit((Object)(object)aura))
			{
				Object.Destroy((Object)(object)((Component)aura).gameObject);
			}
			aura = null;
		}
	}
	internal class Emitter : MonoBehaviour
	{
		public P preset;

		public Color color;

		public float rate;

		public float radius;

		public float size;

		public float life;

		public Vector2 drift;

		public bool on = true;

		private float accumulator;

		public static Emitter Create(GameObject host, P preset, Color color, float rate, float radius, float size, float life, Vector2 drift = default(Vector2))
		{
			//IL_000e: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			Emitter emitter = host.AddComponent<Emitter>();
			emitter.preset = preset;
			emitter.color = color;
			emitter.rate = rate;
			emitter.radius = radius;
			emitter.size = size;
			emitter.life = life;
			emitter.drift = drift;
			return emitter;
		}

		private void Update()
		{
			//IL_0028: 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_0032: 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)
			//IL_0078: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			if (on)
			{
				accumulator += rate * Time.deltaTime;
				Vector2 val = Vector2.op_Implicit(((Component)this).transform.position);
				float num = Mathf.Max(0.5f, ((Vector2)(ref drift)).magnitude * 0.4f);
				while (accumulator >= 1f)
				{
					accumulator -= 1f;
					Particles.Emit(preset, val + Random.insideUnitCircle * radius, drift + Random.insideUnitCircle * num, color, size * Random.Range(0.6f, 1.2f), life * Random.Range(0.7f, 1f), Random.Range(0f, 360f));
				}
			}
		}
	}
	internal static class Afterimage
	{
		private static readonly Dictionary<Player, (SpriteRenderer[] parts, float refreshAt)> cache = new Dictionary<Player, (SpriteRenderer[], float)>();

		public static void Of(Player player, Color tint, float life)
		{
			//IL_00d3: 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)
			if ((Object)(object)player == (Object)null)
			{
				return;
			}
			SpriteRenderer[] componentsInChildren;
			if (!cache.TryGetValue(player, out (SpriteRenderer[], float) value) || Time.time >= value.Item2)
			{
				List<SpriteRenderer> list = new List<SpriteRenderer>();
				componentsInChildren = ((Component)player).GetComponentsInChildren<SpriteRenderer>();
				foreach (SpriteRenderer val in componentsInChildren)
				{
					if (!((Object)val).name.StartsWith("JJK_") && (Object)(object)((Component)val).GetComponentInParent<Aura>() == (Object)null)
					{
						list.Add(val);
					}
				}
				value = (cache[player] = (list.ToArray(), Time.time + 2f));
			}
			componentsInChildren = value.Item1;
			foreach (SpriteRenderer val2 in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val2) && ((Renderer)val2).enabled && Object.op_Implicit((Object)(object)val2.sprite) && ((Component)val2).gameObject.activeInHierarchy && val2.color.a > 0.05f)
				{
					Vfx.Ghost(val2, tint, life);
				}
			}
		}
	}
	internal static class Bullets
	{
		private static readonly List<ProjectileHit> list = new List<ProjectileHit>();

		public static List<ProjectileHit> Active
		{
			get
			{
				Prune();
				return list;
			}
		}

		public static void Add(ProjectileHit bullet)
		{
			if (list.Count >= 256)
			{
				Prune();
			}
			list.Add(bullet);
		}

		private static void Prune()
		{
			list.RemoveAll((ProjectileHit b) => (Object)(object)b == (Object)null || !((Component)b).gameObject.activeInHierarchy);
		}

		public static void Clear()
		{
			list.Clear();
		}
	}
	internal static class Creatures
	{
		private const int Size = 256;

		private static readonly Dictionary<string, Sprite> cache = new Dictionary<string, Sprite>();

		private static readonly Color Fur = new Color(0.08f, 0.07f, 0.1f);

		private static readonly Color FurLight = new Color(0.92f, 0.92f, 0.95f);

		public static Sprite Rika => Get("rika", delegate(ArtCanvas c)
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: 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_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.8f, 0.78f, 0.86f);
			Color c2 = default(Color);
			((Color)(ref c2))..ctor(0.45f, 0.42f, 0.55f);
			Color color2 = default(Color);
			((Color)(ref color2))..ctor(0.12f, 0.08f, 0.16f);
			float[] array = new float[2] { -1f, 1f };
			foreach (float num in array)
			{
				c.Line(new Vector2(0.38f * num, -0.05f), new Vector2(0.72f * num, -0.35f), color, 0.1f, glow: false);
				c.Line(new Vector2(0.72f * num, -0.35f), new Vector2(0.86f * num, -0.72f), color, 0.08f, glow: false);
				for (int j = -1; j <= 1; j++)
				{
					c.Line(new Vector2(0.86f * num, -0.72f), new Vector2((0.86f + 0.1f * (float)j) * num, -0.95f + 0.03f * (float)Mathf.Abs(j)), color2, 0.022f, glow: false, taper: true);
				}
			}
			c.FillPoly((Vector2[])(object)new Vector2[4]
			{
				new Vector2(-0.46f, -0.02f),
				new Vector2(0.46f, -0.02f),
				new Vector2(0.24f, -0.98f),
				new Vector2(-0.24f, -0.98f)
			}, color);
			c.FillPoly((Vector2[])(object)new Vector2[4]
			{
				new Vector2(-0.3f, -0.45f),
				new Vector2(0.3f, -0.45f),
				new Vector2(0.22f, -0.98f),
				new Vector2(-0.22f, -0.98f)
			}, c2.A(0.6f));
			c.FillPoly((Vector2[])(object)new Vector2[9]
			{
				new Vector2(-0.4f, 0.42f),
				new Vector2(-0.5f, 0.88f),
				new Vector2(-0.28f, 0.6f),
				new Vector2(-0.16f, 0.97f),
				new Vector2(0f, 0.62f),
				new Vector2(0.16f, 0.97f),
				new Vector2(0.28f, 0.6f),
				new Vector2(0.5f, 0.88f),
				new Vector2(0.4f, 0.42f)
			}, color2);
			c.FillEllipse(new Vector2(0f, 0.3f), 0.43f, 0.38f, color);
			c.FillEllipse(new Vector2(0f, 0.18f), 0.36f, 0.2f, c2.A(0.5f));
			array = new float[2] { -1f, 1f };
			foreach (float num2 in array)
			{
				c.FillEllipse(new Vector2(0.17f * num2, 0.43f), 0.11f, 0.075f, Color.black);
				c.FillCircle(new Vector2(0.17f * num2, 0.43f), 0.028f, Color.white);
			}
			c.FillEllipse(new Vector2(0f, 0.1f), 0.32f, 0.17f, Color.black);
			for (int k = 0; k < 9; k++)
			{
				float num3 = -0.26f + (float)k * 0.065f;
				c.FillPoly((Vector2[])(object)new Vector2[3]
				{
					new Vector2(num3 - 0.028f, 0.2f),
					new Vector2(num3 + 0.028f, 0.2f),
					new Vector2(num3, 0.09f)
				}, Color.white);
				c.FillPoly((Vector2[])(object)new Vector2[3]
				{
					new Vector2(num3 - 0.025f, 0f),
					new Vector2(num3 + 0.025f, 0f),
					new Vector2(num3 + 0.01f, 0.1f)
				}, Color.white);
			}
		});

		public static Sprite Nue => Get("nue", delegate(ArtCanvas c)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c6: 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_00de: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_0131: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: 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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: 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_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.12f, 0.1f, 0.08f);
			float[] array = new float[2] { -1f, 1f };
			foreach (float num in array)
			{
				c.FillPoly((Vector2[])(object)new Vector2[10]
				{
					new Vector2(0.1f * num, 0.12f),
					new Vector2(0.95f * num, 0.48f),
					new Vector2(0.9f * num, 0.32f),
					new Vector2(1f * num, 0.22f),
					new Vector2(0.84f * num, 0.14f),
					new Vector2(0.95f * num, 0.02f),
					new Vector2(0.74f * num, -0.04f),
					new Vector2(0.8f * num, -0.15f),
					new Vector2(0.5f * num, -0.1f),
					new Vector2(0.12f * num, -0.12f)
				}, color);
				for (int j = 0; j < 4; j++)
				{
					c.Line(new Vector2(0.2f * num, 0.05f), new Vector2((0.55f + 0.1f * (float)j) * num, 0.3f - 0.12f * (float)j), Palette.NueYellow.A(0.35f), 0.008f, glow: false);
				}
				c.Line(new Vector2(0.06f * num, -0.4f), new Vector2(0.12f * num, -0.62f), Palette.NueYellow, 0.02f, glow: false, taper: true);
			}
			c.FillEllipse(new Vector2(0f, -0.08f), 0.16f, 0.32f, color);
			c.FillCircle(new Vector2(0f, 0.3f), 0.15f, color);
			c.FillPoly((Vector2[])(object)new Vector2[5]
			{
				new Vector2(-0.13f, 0.38f),
				new Vector2(0.13f, 0.38f),
				new Vector2(0.09f, 0.18f),
				new Vector2(0f, 0.12f),
				new Vector2(-0.09f, 0.18f)
			}, new Color(0.95f, 0.92f, 0.8f));
			c.FillCircle(new Vector2(-0.05f, 0.3f), 0.025f, Palette.NueYellow);
			c.FillCircle(new Vector2(0.05f, 0.3f), 0.025f, Palette.NueYellow);
			c.Glow(new Vector2(0f, 0.3f), 0.14f, Palette.NueYellow, 0.6f);
		});

		public static Sprite Hand => Get("hand", delegate(ArtCanvas c)
		{
			//IL_0037: 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_006b: 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_009e: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.74f, 0.78f, 0.84f);
			Color color2 = default(Color);
			((Color)(ref color2))..ctor(0.15f, 0.18f, 0.25f);
			c.FillEllipse(new Vector2(0f, -0.25f), 0.38f, 0.42f, color);
			for (int i = 0; i < 4; i++)
			{
				float num = -0.27f + (float)i * 0.18f;
				c.Line(new Vector2(num, -0.05f), new Vector2(num + 0.02f * ((float)i - 1.5f), 0.6f - Mathf.Abs((float)i - 1.5f) * 0.1f), color, 0.075f, glow: false);
			}
			c.Line(new Vector2(-0.33f, -0.3f), new Vector2(-0.65f, 0.08f), color, 0.07f, glow: false);
			c.Curve((float t) => new Vector2(Mathf.Lerp(-0.4f, 0.4f, t), -0.25f + 0.1f * Mathf.Sin(t * 9f)), color2, 0.012f, 60, glow: false);
			for (int num2 = 0; num2 < 9; num2++)
			{
				float num3 = -0.36f + (float)num2 * 0.09f;
				float num4 = -0.25f + 0.1f * Mathf.Sin((num3 + 0.4f) / 0.8f * 9f);
				c.Line(new Vector2(num3 - 0.02f, num4 - 0.06f), new Vector2(num3 + 0.02f, num4 + 0.06f), color2, 0.008f, glow: false);
			}
		});

		public static Sprite Doll => Get("doll", delegate(ArtCanvas c)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.82f, 0.7f, 0.42f);
			Color color2 = default(Color);
			((Color)(ref color2))..ctor(0.55f, 0.1f, 0.12f);
			c.FillCircle(new Vector2(0f, 0.5f), 0.2f, color);
			c.Line(new Vector2(-0.55f, 0.15f), new Vector2(0.55f, 0.15f), color, 0.08f, glow: false);
			c.Line(new Vector2(0f, 0.35f), new Vector2(0f, -0.3f), color, 0.11f, glow: false);
			c.Line(new Vector2(0f, -0.25f), new Vector2(-0.28f, -0.85f), color, 0.07f, glow: false);
			c.Line(new Vector2(0f, -0.25f), new Vector2(0.28f, -0.85f), color, 0.07f, glow: false);
			c.Line(new Vector2(-0.14f, 0.3f), new Vector2(0.14f, 0.3f), color2, 0.02f, glow: false);
			c.Line(new Vector2(-0.12f, -0.2f), new Vector2(0.12f, -0.2f), color2, 0.02f, glow: false);
			for (int i = 0; i < 8; i++)
			{
				c.Line(new Vector2(-0.1f, 0.25f - (float)i * 0.06f), new Vector2(0.1f, 0.22f - (float)i * 0.06f), new Color(0.6f, 0.48f, 0.25f), 0.006f, glow: false);
			}
		});

		public static Sprite Hammer => Get("hammer", delegate(ArtCanvas c)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			c.Line(new Vector2(0f, 0.45f), new Vector2(0f, -0.9f), new Color(0.4f, 0.28f, 0.16f), 0.06f, glow: false);
			c.FillPoly((Vector2[])(object)new Vector2[4]
			{
				new Vector2(-0.42f, 0.35f),
				new Vector2(0.42f, 0.35f),
				new Vector2(0.42f, 0.7f),
				new Vector2(-0.42f, 0.7f)
			}, Palette.MakiSteel);
			c.Line(new Vector2(-0.42f, 0.66f), new Vector2(0.42f, 0.66f), Color.white, 0.012f, glow: false);
		});

		public static Sprite Volcano => Get("volcano", delegate(ArtCanvas c)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_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_006e: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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_0121: Unknown result type (might be due to invalid IL or missing references)
			c.FillPoly((Vector2[])(object)new Vector2[4]
			{
				new Vector2(-0.95f, -0.95f),
				new Vector2(0.95f, -0.95f),
				new Vector2(0.22f, 0.3f),
				new Vector2(-0.22f, 0.3f)
			}, new Color(0.14f, 0.07f, 0.05f));
			c.Curve((float t) => new Vector2(0.06f * Mathf.Sin(t * 10f), Mathf.Lerp(0.28f, -0.8f, t)), Palette.JogoOrange, 0.035f, 50, glow: true, taper: true);
			c.Curve((float t) => new Vector2(-0.12f + 0.35f * t, Mathf.Lerp(0.26f, -0.6f, t)), Palette.GojoRed, 0.025f, 50, glow: true, taper: true);
			c.FillEllipse(new Vector2(0f, 0.3f), 0.22f, 0.06f, Palette.JogoOrange);
			c.Glow(new Vector2(0f, 0.32f), 0.4f, Palette.JogoOrange);
		});

		private static Sprite Get(string key, Action<ArtCanvas> paint)
		{
			//IL_004e: 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 (cache.TryGetValue(key, out var value) && Object.op_Implicit((Object)(object)value))
			{
				return value;
			}
			ArtCanvas artCanvas = new ArtCanvas(256);
			paint(artCanvas);
			Texture2D val = artCanvas.ToTexture(feather: false);
			return cache[key] = Sprite.Create(val, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f), 256f);
		}

		public static Sprite Dog(int frame)
		{
			return Get("dog" + frame, delegate(ArtCanvas c)
			{
				//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_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0111: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: 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_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0184: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_019a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_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_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: 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_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0200: Unknown result type (might be due to invalid IL or missing references)
				//IL_021a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0229: Unknown result type (might be due to invalid IL or missing references)
				//IL_0243: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_0279: 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_02a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bb: 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_02e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0313: Unknown result type (might be due to invalid IL or missing references)
				//IL_0318: Unknown result type (might be due to invalid IL or missing references)
				//IL_033a: Unknown result type (might be due to invalid IL or missing references)
				//IL_033f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0350: Unknown result type (might be due to invalid IL or missing references)
				//IL_0355: Unknown result type (might be due to invalid IL or missing references)
				//IL