Decompiled source of HorizonCarMod v1.1.1

HorizonCarMod.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Xml;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI.Components;
using Landfall.TABS.GameMode;
using Landfall.TABS.GameState;
using Landfall.TABS.UnitEditor;
using Landfall.TABS.WinConditions;
using Landfall.TABS.Workshop;
using ModdingForDummies;
using ModdingForDummies.AssetManagement;
using ModdingForDummies.TABSSimp;
using Newtonsoft.Json;
using Sirenix.Serialization;
using TFBGames;
using Unity.Entities;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ModdingForDummies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ModdingForDummies")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1619c49c-bc45-486c-bbca-6b52cef4f478")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HorizonCar
{
	public static class CarAudioFactory
	{
		private struct Rng
		{
			private ulong s;

			public Rng(ulong seed)
			{
				s = seed;
			}

			public float Next()
			{
				s ^= s << 13;
				s ^= s >> 7;
				s ^= s << 17;
				return (float)((double)(s >> 11) * 1.1102230246251565E-16) * 2f - 1f;
			}
		}

		private const int SampleRate = 44100;

		private const string RealFileName = "mclaren_engine.mp3";

		private static AudioClip _engine;

		private static AudioClip _electric;

		private static AudioClip _offroad;

		private static AudioClip _crash;

		private static AudioClip _realEngine;

		private static AudioClip _horn;

		private static AudioClip _synthHorn;

		private static bool _loadStarted;

		private static bool _hornLoadStarted;

		public static bool HasRealClip => (Object)(object)_realEngine != (Object)null;

		public static AudioClip Engine
		{
			get
			{
				if ((Object)(object)_realEngine != (Object)null)
				{
					return _realEngine;
				}
				if ((Object)(object)_engine == (Object)null)
				{
					_engine = BuildEngine();
				}
				return _engine;
			}
		}

		public static AudioClip Electric
		{
			get
			{
				if ((Object)(object)_electric == (Object)null)
				{
					_electric = BuildElectric();
				}
				return _electric;
			}
		}

		public static AudioClip Offroad
		{
			get
			{
				if ((Object)(object)_offroad == (Object)null)
				{
					_offroad = BuildOffroad();
				}
				return _offroad;
			}
		}

		public static AudioClip HornRecording => _horn;

		public static AudioClip Horn
		{
			get
			{
				if ((Object)(object)_synthHorn == (Object)null)
				{
					_synthHorn = BuildHorn();
				}
				return _synthHorn;
			}
		}

		public static AudioClip Crash
		{
			get
			{
				if ((Object)(object)_crash == (Object)null)
				{
					_crash = BuildCrash();
				}
				return _crash;
			}
		}

		public static event Action<AudioClip> RealEngineReady;

		public static void BeginLoad(string pluginDir, MonoBehaviour host)
		{
			if (_loadStarted || (Object)(object)host == (Object)null)
			{
				return;
			}
			_loadStarted = true;
			try
			{
				string text = Path.Combine(pluginDir ?? "", "mclaren_engine.mp3");
				if (!File.Exists(text))
				{
					CarLog.Warn("Real engine sound not found, using synth: " + text);
				}
				else
				{
					host.StartCoroutine(LoadRoutine(text));
				}
			}
			catch (Exception ex)
			{
				CarLog.Error("BeginLoad engine clip failed: " + ex);
			}
		}

		public static void BeginLoadHorn(string pluginDir, string fileName, MonoBehaviour host)
		{
			if (_hornLoadStarted || (Object)(object)host == (Object)null || string.IsNullOrEmpty(fileName))
			{
				return;
			}
			_hornLoadStarted = true;
			try
			{
				string text = Path.Combine(pluginDir ?? "", fileName);
				if (!File.Exists(text))
				{
					CarLog.Warn("Horn sound not found, using synth: " + text);
				}
				else
				{
					host.StartCoroutine(LoadHornRoutine(text));
				}
			}
			catch (Exception ex)
			{
				CarLog.Error("BeginLoad horn failed: " + ex);
			}
		}

		private static IEnumerator LoadHornRoutine(string path)
		{
			string text = "file:///" + path.Replace('\\', '/');
			UnityWebRequest req = UnityWebRequestMultimedia.GetAudioClip(text, (AudioType)13);
			DownloadHandler downloadHandler = req.downloadHandler;
			DownloadHandlerAudioClip val = (DownloadHandlerAudioClip)(object)((downloadHandler is DownloadHandlerAudioClip) ? downloadHandler : null);
			if (val != null)
			{
				val.streamAudio = false;
			}
			req.SendWebRequest();
			while (!req.isDone)
			{
				yield return null;
			}
			bool flag;
			try
			{
				flag = req.isNetworkError || req.isHttpError;
			}
			catch
			{
				flag = true;
			}
			if (flag)
			{
				CarLog.Error("Horn clip download failed: " + req.error);
				req.Dispose();
				yield break;
			}
			AudioClip val2 = null;
			try
			{
				val2 = DownloadHandlerAudioClip.GetContent(req);
			}
			catch (Exception ex)
			{
				CarLog.Error("Horn GetContent failed: " + ex);
			}
			req.Dispose();
			if ((Object)(object)val2 == (Object)null)
			{
				CarLog.Error("Horn clip decoded to null");
				yield break;
			}
			((Object)val2).name = "HZD_TruckHorn";
			NormalizePeak(val2, 0.95f);
			_horn = val2;
			CarLog.Log("Truck horn clip loaded: " + val2.length.ToString("0.00") + "s");
		}

		private static IEnumerator LoadRoutine(string path)
		{
			string text = "file:///" + path.Replace('\\', '/');
			UnityWebRequest req = UnityWebRequestMultimedia.GetAudioClip(text, (AudioType)13);
			DownloadHandler downloadHandler = req.downloadHandler;
			DownloadHandlerAudioClip val = (DownloadHandlerAudioClip)(object)((downloadHandler is DownloadHandlerAudioClip) ? downloadHandler : null);
			if (val != null)
			{
				val.streamAudio = false;
			}
			req.SendWebRequest();
			while (!req.isDone)
			{
				yield return null;
			}
			bool flag;
			try
			{
				flag = req.isNetworkError || req.isHttpError;
			}
			catch
			{
				flag = true;
			}
			if (flag)
			{
				CarLog.Error("Engine clip download failed: " + req.error);
				req.Dispose();
				yield break;
			}
			AudioClip val2 = null;
			try
			{
				val2 = DownloadHandlerAudioClip.GetContent(req);
			}
			catch (Exception ex)
			{
				CarLog.Error("GetContent failed: " + ex);
			}
			req.Dispose();
			if ((Object)(object)val2 == (Object)null)
			{
				CarLog.Error("Engine clip decoded to null (bad MP3?)");
				yield break;
			}
			((Object)val2).name = "HZD_RealEngine";
			NormalizePeak(val2, 0.97f);
			_realEngine = val2;
			CarLog.Log("Real engine clip loaded: " + val2.length.ToString("0.0") + "s");
			try
			{
				if (CarAudioFactory.RealEngineReady != null)
				{
					CarAudioFactory.RealEngineReady(val2);
				}
			}
			catch (Exception ex2)
			{
				CarLog.Error("RealEngineReady handler: " + ex2);
			}
		}

		private static void NormalizePeak(AudioClip clip, float targetPeak)
		{
			try
			{
				int samples = clip.samples;
				int channels = clip.channels;
				float[] array = new float[samples * channels];
				if (!clip.GetData(array, 0))
				{
					CarLog.Warn("GetData failed, using raw clip level");
					return;
				}
				float num = 0.0001f;
				for (int i = 0; i < array.Length; i++)
				{
					float num2 = Mathf.Abs(array[i]);
					if (num2 > num)
					{
						num = num2;
					}
				}
				float num3 = Mathf.Min(targetPeak / num, 8f);
				if (!(num3 <= 1.001f))
				{
					for (int j = 0; j < array.Length; j++)
					{
						array[j] = Mathf.Clamp(array[j] * num3, -1f, 1f);
					}
					clip.SetData(array, 0);
					CarLog.Log("Engine clip normalized: peak " + num.ToString("F3") + " gain x" + num3.ToString("F2"));
				}
			}
			catch (Exception ex)
			{
				CarLog.Warn("Normalize skipped: " + ex.Message);
			}
		}

		private static AudioClip BuildEngine()
		{
			int num = 176400;
			int num2 = (int)Math.Round(220.0);
			float[] array = new float[num];
			Rng rng = new Rng(100669264uL);
			double num3 = 0.0;
			double num4 = 0.0;
			for (int i = 1; i <= 6; i++)
			{
				num4 += ((i % 2 == 0) ? 1.12 : 0.7) / Math.Pow(i, 1.55);
			}
			for (int j = 0; j < num; j++)
			{
				double num5 = (double)j * (double)num2 / (double)num % 1.0;
				double num6 = 0.0;
				for (int k = 1; k <= 6; k++)
				{
					double num7 = ((k % 2 == 0) ? 1.12 : 0.7) / Math.Pow(k, 1.55);
					num6 += Math.Sin(Math.PI * 2.0 * (double)k * num5) * num7;
				}
				num6 /= num4;
				double num8 = 0.86 + 0.14 * Math.Sin(Math.PI * 2.0 * num5);
				double num9 = Math.Sin(Math.PI * num5) * 0.22;
				double num10 = rng.Next();
				num3 += (num10 - num3) * 0.03;
				double num11 = num6 * num8 * 0.92 + num9 + num3 * 0.015;
				num11 = Math.Tanh(num11 * 0.7);
				array[j] = (float)num11;
			}
			float num12 = 0.0001f;
			for (int l = 0; l < num; l++)
			{
				num12 = Math.Max(num12, Math.Abs(array[l]));
			}
			float num13 = 0.82f / num12;
			for (int m = 0; m < num; m++)
			{
				array[m] *= num13;
			}
			AudioClip obj = AudioClip.Create("HZD_EngineLoop", num, 1, 44100, false);
			obj.SetData(array, 0);
			return obj;
		}

		private static AudioClip BuildElectric()
		{
			int num = 176400;
			int num2 = (int)Math.Round(720.0);
			float[] array = new float[num];
			Rng rng = new Rng(8027300uL);
			double num3 = 0.0;
			double[] array2 = new double[6] { 1.0, 2.0, 3.0, 4.5, 6.0, 9.0 };
			double[] array3 = new double[6] { 1.0, 0.52, 0.3, 0.16, 0.1, 0.045 };
			double num4 = 0.0;
			for (int i = 0; i < array2.Length; i++)
			{
				num4 += array3[i];
			}
			for (int j = 0; j < num; j++)
			{
				double num5 = (double)j * (double)num2 / (double)num % 1.0;
				double num6 = 0.0;
				for (int k = 0; k < array2.Length; k++)
				{
					double num7 = num5 * array2[k] % 1.0;
					num6 += Math.Sin(Math.PI * 2.0 * num7) * array3[k];
				}
				num6 /= num4;
				double num8 = Math.Sin(Math.PI * 2.0 * (num5 * 0.5 % 1.0)) * 0.28;
				double num9 = 1.0 + 0.035 * Math.Sin(Math.PI * 2.0 * (num5 * 12.0 % 1.0));
				double num10 = rng.Next();
				num3 += (num10 - num3) * 0.05;
				double num11 = num6 * num9 * 0.62 + num8 + num3 * 0.012;
				num11 = Math.Tanh(num11 * 0.8);
				array[j] = (float)num11;
			}
			float num12 = 0.0001f;
			for (int l = 0; l < num; l++)
			{
				num12 = Math.Max(num12, Math.Abs(array[l]));
			}
			float num13 = 0.8f / num12;
			for (int m = 0; m < num; m++)
			{
				array[m] *= num13;
			}
			AudioClip obj = AudioClip.Create("HZD_ElectricLoop", num, 1, 44100, false);
			obj.SetData(array, 0);
			return obj;
		}

		private static AudioClip BuildOffroad()
		{
			int num = 176400;
			int num2 = (int)Math.Round(168.0);
			float[] array = new float[num];
			Rng rng = new Rng(16728109uL);
			double num3 = 0.0;
			double num4 = 0.0;
			for (int i = 1; i <= 9; i++)
			{
				num4 += ((i % 2 == 0) ? 1.25 : 0.55) / Math.Pow(i, 1.3);
			}
			for (int j = 0; j < num; j++)
			{
				double num5 = (double)j * (double)num2 / (double)num % 1.0;
				double num6 = 0.0;
				for (int k = 1; k <= 9; k++)
				{
					double num7 = ((k % 2 == 0) ? 1.25 : 0.55) / Math.Pow(k, 1.3);
					num6 += Math.Sin(Math.PI * 2.0 * (double)k * num5) * num7;
				}
				num6 /= num4;
				double num8 = 0.66 + 0.34 * Math.Sin(Math.PI * 2.0 * num5);
				double num9 = 0.92 + 0.08 * Math.Sin(Math.PI * 2.0 * (num5 * 0.5 % 1.0));
				double num10 = Math.Sin(Math.PI * num5) * 0.38;
				double num11 = rng.Next();
				num3 += (num11 - num3) * 0.02;
				double num12 = num6 * num8 * num9 * 0.96 + num10 + num3 * 0.02;
				num12 = Math.Tanh(num12 * 0.9);
				array[j] = (float)num12;
			}
			float num13 = 0.0001f;
			for (int l = 0; l < num; l++)
			{
				num13 = Math.Max(num13, Math.Abs(array[l]));
			}
			float num14 = 0.85f / num13;
			for (int m = 0; m < num; m++)
			{
				array[m] *= num14;
			}
			AudioClip obj = AudioClip.Create("HZD_OffroadLoop", num, 1, 44100, false);
			obj.SetData(array, 0);
			return obj;
		}

		private static AudioClip BuildHorn()
		{
			int num = 33075;
			float[] array = new float[num];
			Rng rng = new Rng(16544uL);
			double num2 = 0.0;
			double[] array2 = new double[3] { 311.0, 392.0, 466.0 };
			double[] array3 = new double[3] { 1.0, 0.72, 0.45 };
			for (int i = 0; i < num; i++)
			{
				double num3 = (double)i / 44100.0;
				double num4 = Math.Min(1.0, num3 / 0.022);
				if (num3 > 0.59)
				{
					num4 *= Math.Max(0.0, (0.75 - num3) / 0.16);
				}
				num4 *= Math.Min(1.0, num4 + 0.25);
				double num5 = 0.0;
				for (int j = 0; j < array2.Length; j++)
				{
					double num6 = array2[j] * (1.0 - 0.012 * num3);
					double num7 = Math.PI * 2.0 * num6 * num3;
					double num8 = Math.Sin(num7) + 0.34 * Math.Sin(2.0 * num7) + 0.16 * Math.Sin(3.0 * num7);
					num5 += num8 * array3[j];
				}
				num5 *= 0.36;
				double num9 = rng.Next();
				num2 += (num9 - num2) * 0.35;
				num5 += num2 * 0.05 * Math.Exp((0.0 - num3) * 18.0);
				array[i] = (float)Math.Tanh(num5 * num4 * 1.1);
			}
			float num10 = 0.0001f;
			for (int k = 0; k < num; k++)
			{
				num10 = Math.Max(num10, Math.Abs(array[k]));
			}
			float num11 = 0.95f / num10;
			for (int l = 0; l < num; l++)
			{
				array[l] *= num11;
			}
			AudioClip obj = AudioClip.Create("HZD_TruckHornSynth", num, 1, 44100, false);
			obj.SetData(array, 0);
			return obj;
		}

		private static AudioClip BuildCrash()
		{
			int num = 26460;
			float[] array = new float[num];
			Rng rng = new Rng(49237uL);
			double num2 = 0.0;
			for (int i = 0; i < num; i++)
			{
				double num3 = (double)i / 44100.0;
				double num4 = Math.Exp((0.0 - num3) * 6.5);
				num2 += ((double)rng.Next() - num2) * 0.22;
				double num5 = Math.Sin(Math.PI * 124.0 * num3) * Math.Exp((0.0 - num3) * 11.0);
				double value = (num2 * 0.8 + num5 * 0.9) * num4;
				array[i] = (float)Math.Tanh(value);
			}
			AudioClip obj = AudioClip.Create("HZD_Crash", num, 1, 44100, false);
			obj.SetData(array, 0);
			return obj;
		}
	}
	public static class CarContent
	{
		private class CarModBoot : Mod
		{
			public void Boot()
			{
				Mod.DEV_MODE = false;
			}
		}

		public const string FactionName = "地平线驾驶汽车";

		public const int FactionId = 2026100901;

		public static ModFaction Faction;

		public static readonly CarProfile DaYunTrailer;

		private static readonly List<CarProfile> _profiles;

		public static IList<CarProfile> Profiles => _profiles;

		static CarContent()
		{
			DaYunTrailer = CarProfile.DaYunTrailer();
			_profiles = new List<CarProfile>
			{
				CarProfile.McLaren(),
				CarProfile.Taycan(),
				CarProfile.Amg(),
				CarProfile.F8(),
				CarProfile.Tesla(),
				CarProfile.G63(),
				CarProfile.HuracanEvo(),
				CarProfile.DaYun()
			};
			for (int i = 0; i < _profiles.Count; i++)
			{
				if (_profiles[i].Key == "dayun")
				{
					_profiles[i].TrailerProfile = DaYunTrailer;
				}
			}
		}

		public static void Build()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_051a: Unknown result type (might be due to invalid IL or missing references)
			new CarModBoot().Boot();
			Faction = Mod.CreateFaction("地平线驾驶汽车");
			Faction.Visible = true;
			Faction.ColorInternal(0, Utilities.HexColor("#FF7A1A"));
			Sprite icon = CarIcon.Make();
			Faction.Icon = icon;
			HashSet<int> hashSet = new HashSet<int>();
			foreach (CarProfile profile in _profiles)
			{
				if (!hashSet.Add(profile.UnitId))
				{
					CarLog.Error("DUPLICATE unit id " + profile.UnitId + " (" + profile.UnitName + "): another unit already owns it, placing this one will spawn the wrong unit");
				}
				ModUnit modUnit = Faction.NewUnit(profile.UnitName);
				modUnit.Health = profile.Health;
				modUnit.Cost = profile.Cost;
				modUnit.Mass = 9f;
				modUnit.Size = 1f;
				modUnit.Balance = 10f;
				modUnit.BalanceStrength = 10f;
				modUnit.Speed = 0f;
				modUnit.TurnSpeed = 0f;
				modUnit.Priority = 5f;
				modUnit.Icon = CarIcon.MakeCar(profile);
				ReKeyUnit(modUnit.internalObject, MakeId(profile.UnitId));
				CarLog.Log("Unit registered: " + profile.UnitName + " id=" + profile.UnitId);
			}
			if (!hashSet.Add(2026100907))
			{
				CarLog.Error("DUPLICATE unit id " + 2026100907 + " (独角兽高达(可驾驶)): another unit already owns it, placing this one will spawn the wrong unit");
			}
			ModUnit modUnit2 = Faction.NewUnit("独角兽高达(可驾驶)");
			modUnit2.Health = 108000f;
			modUnit2.Cost = 300000;
			modUnit2.Mass = 9f;
			modUnit2.Size = 1f;
			modUnit2.Balance = 10f;
			modUnit2.BalanceStrength = 10f;
			modUnit2.Speed = 0f;
			modUnit2.TurnSpeed = 0f;
			modUnit2.Priority = 5f;
			modUnit2.Icon = CarIcon.MakeGundam();
			ReKeyUnit(modUnit2.internalObject, MakeId(2026100907));
			CarLog.Log("Unit registered: 独角兽高达(可驾驶) id=" + 2026100907);
			if (!hashSet.Add(2026100911))
			{
				CarLog.Error("DUPLICATE unit id " + 2026100911 + " (强袭自由高达(可驾驶)): another unit already owns it, placing this one will spawn the wrong unit");
			}
			ModUnit modUnit3 = Faction.NewUnit("强袭自由高达(可驾驶)");
			modUnit3.Health = 240000f;
			modUnit3.Cost = 290000;
			modUnit3.Mass = 9f;
			modUnit3.Size = 1f;
			modUnit3.Balance = 10f;
			modUnit3.BalanceStrength = 10f;
			modUnit3.Speed = 0f;
			modUnit3.TurnSpeed = 0f;
			modUnit3.Priority = 5f;
			modUnit3.Icon = CarIcon.MakeStrikeFreedom();
			ReKeyUnit(modUnit3.internalObject, MakeId(2026100911));
			CarLog.Log("Unit registered: 强袭自由高达(可驾驶) id=" + 2026100911);
			if (!hashSet.Add(2026103001))
			{
				CarLog.Error("DUPLICATE unit id " + 2026103001 + " (扎古II(可驾驶)): another unit already owns it, placing this one will spawn the wrong unit");
			}
			ModUnit modUnit4 = Faction.NewUnit("扎古II(可驾驶)");
			modUnit4.Health = 38000f;
			modUnit4.Cost = 90000;
			modUnit4.Mass = 9f;
			modUnit4.Size = 1f;
			modUnit4.Balance = 10f;
			modUnit4.BalanceStrength = 10f;
			modUnit4.Speed = 0f;
			modUnit4.TurnSpeed = 0f;
			modUnit4.Priority = 5f;
			modUnit4.Icon = CarIcon.MakeZaku();
			ReKeyUnit(modUnit4.internalObject, MakeId(2026103001));
			CarLog.Log("Unit registered: 扎古II(可驾驶) id=" + 2026103001);
			if (!hashSet.Add(2026103002))
			{
				CarLog.Error("DUPLICATE unit id " + 2026103002 + " (扎古III(可驾驶)): another unit already owns it, placing this one will spawn the wrong unit");
			}
			ModUnit modUnit5 = Faction.NewUnit("扎古III(可驾驶)");
			modUnit5.Health = 39000f;
			modUnit5.Cost = 90000;
			modUnit5.Mass = 10f;
			modUnit5.Size = 1f;
			modUnit5.Balance = 10f;
			modUnit5.BalanceStrength = 10f;
			modUnit5.Speed = 0f;
			modUnit5.TurnSpeed = 0f;
			modUnit5.Priority = 5f;
			modUnit5.Icon = CarIcon.MakeZakuIII();
			ReKeyUnit(modUnit5.internalObject, MakeId(2026103002));
			CarLog.Log("Unit registered: 扎古III(可驾驶) id=" + 2026103002);
			ReKeyFaction(Faction.internalObject, MakeId(2026100901));
			CarLog.Log("Faction registered with " + _profiles.Count + " car units + 4 mechs: 地平线驾驶汽车");
		}

		public static bool IsGundamBlueprint(UnitBlueprint bp)
		{
			if ((Object)(object)bp != (Object)null && bp.Entity != null)
			{
				return bp.Entity.Name == "独角兽高达(可驾驶)";
			}
			return false;
		}

		public static bool IsStrikeFreedomBlueprint(UnitBlueprint bp)
		{
			if ((Object)(object)bp != (Object)null && bp.Entity != null)
			{
				return bp.Entity.Name == "强袭自由高达(可驾驶)";
			}
			return false;
		}

		public static bool IsZakuBlueprint(UnitBlueprint bp)
		{
			if ((Object)(object)bp != (Object)null && bp.Entity != null)
			{
				return bp.Entity.Name == "扎古II(可驾驶)";
			}
			return false;
		}

		public static bool IsZakuIIIBlueprint(UnitBlueprint bp)
		{
			if ((Object)(object)bp != (Object)null && bp.Entity != null)
			{
				return bp.Entity.Name == "扎古III(可驾驶)";
			}
			return false;
		}

		public static bool IsAnyMechBlueprint(UnitBlueprint bp)
		{
			if (!IsGundamBlueprint(bp) && !IsStrikeFreedomBlueprint(bp) && !IsZakuBlueprint(bp))
			{
				return IsZakuIIIBlueprint(bp);
			}
			return true;
		}

		public static bool IsCarBlueprint(UnitBlueprint bp)
		{
			return ProfileOf(bp) != null;
		}

		public static CarProfile ProfileOf(UnitBlueprint bp)
		{
			if ((Object)(object)bp == (Object)null || bp.Entity == null)
			{
				return null;
			}
			string name = bp.Entity.Name;
			for (int i = 0; i < _profiles.Count; i++)
			{
				if (_profiles[i].UnitName == name)
				{
					return _profiles[i];
				}
			}
			return null;
		}

		public static CarProfile ProfileByName(string name)
		{
			for (int i = 0; i < _profiles.Count; i++)
			{
				if (_profiles[i].UnitName == name)
				{
					return _profiles[i];
				}
			}
			return null;
		}

		private static DatabaseID MakeId(int id)
		{
			//IL_0002: 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)
			return new DatabaseID
			{
				m_modID = -2,
				m_ID = id
			};
		}

		private static Dictionary<DatabaseID, Object> NonStreamable()
		{
			return (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Utilities.fullDatabase.AssetLoader);
		}

		private static Dictionary<DatabaseID, UnitBlueprint> UnitDict()
		{
			return (Dictionary<DatabaseID, UnitBlueprint>)typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Utilities.database);
		}

		private static Dictionary<DatabaseID, Faction> FactionDict()
		{
			return (Dictionary<DatabaseID, Faction>)typeof(LandfallContentDatabase).GetField("m_factions", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Utilities.database);
		}

		private static void ReKeyUnit(UnitBlueprint unit, DatabaseID id)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_002d: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			DatabaseID gUID = unit.Entity.GUID;
			Dictionary<DatabaseID, UnitBlueprint> dictionary = UnitDict();
			Dictionary<DatabaseID, Object> dictionary2 = NonStreamable();
			dictionary.Remove(gUID);
			dictionary2.Remove(gUID);
			unit.Entity.GUID = id;
			dictionary[id] = unit;
			dictionary2[id] = (Object)(object)unit;
		}

		private static void ReKeyFaction(Faction faction, DatabaseID id)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_002d: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			DatabaseID gUID = faction.Entity.GUID;
			Dictionary<DatabaseID, Faction> dictionary = FactionDict();
			Dictionary<DatabaseID, Object> dictionary2 = NonStreamable();
			dictionary.Remove(gUID);
			dictionary2.Remove(gUID);
			faction.Entity.GUID = id;
			dictionary[id] = faction;
			dictionary2[id] = (Object)(object)faction;
		}
	}
	public class CarEngineAudio : MonoBehaviour
	{
		private const float SynthIdlePitch = 0.9f;

		private const float SynthRedlinePitch = 2.5f;

		private const float RealIdlePitch = 0.94f;

		private const float RealRedlinePitch = 1.3f;

		private const float EvIdlePitch = 0.42f;

		private const float EvRedlinePitch = 3.4f;

		private const float OffroadIdlePitch = 0.78f;

		private const float OffroadRedlinePitch = 2.05f;

		private CarRig _rig;

		private CarProfile _profile;

		private AudioSource _eng;

		private AudioSource _crash;

		private AudioSource _horn;

		private AudioLowPassFilter _lp;

		private float _rpm01;

		private float _volume;

		private bool _stopRequested;

		private float _lastCrash;

		private bool _real;

		private bool _electric;

		private bool _offroad;

		private bool _hornHeld;

		private float _hornUntil;

		private float _aiBlend;

		public void Init(CarRig rig, CarProfile profile)
		{
			_rig = rig;
			_profile = profile;
			_electric = profile?.Electric ?? false;
			_offroad = profile?.Offroad ?? false;
			_real = !_electric && !_offroad && CarAudioFactory.HasRealClip;
			_eng = ((Component)this).gameObject.AddComponent<AudioSource>();
			_eng.clip = (_electric ? CarAudioFactory.Electric : (_offroad ? CarAudioFactory.Offroad : CarAudioFactory.Engine));
			_eng.loop = true;
			_eng.spatialBlend = 0f;
			_eng.dopplerLevel = 0f;
			_eng.playOnAwake = false;
			_eng.volume = 0f;
			_eng.pitch = IdlePitch();
			_lp = ((Component)this).gameObject.AddComponent<AudioLowPassFilter>();
			_lp.cutoffFrequency = (_electric ? 3200f : (_offroad ? 900f : 1300f));
			_lp.lowpassResonanceQ = 1.1f;
			_crash = ((Component)this).gameObject.AddComponent<AudioSource>();
			_crash.clip = CarAudioFactory.Crash;
			_crash.loop = false;
			_crash.spatialBlend = 0f;
			_crash.playOnAwake = false;
			_crash.volume = 0.8f;
			if (profile != null && profile.HornFile != null)
			{
				_horn = ((Component)this).gameObject.AddComponent<AudioSource>();
				_horn.clip = CarAudioFactory.HornRecording ?? CarAudioFactory.Horn;
				_horn.loop = true;
				_horn.spatialBlend = 0f;
				_horn.dopplerLevel = 0f;
				_horn.playOnAwake = false;
				_horn.volume = 0f;
			}
			if (!_electric && !_offroad)
			{
				CarAudioFactory.RealEngineReady += OnRealClipReady;
			}
			((Behaviour)this).enabled = false;
		}

		private float IdlePitch()
		{
			if (_electric)
			{
				return 0.42f;
			}
			if (_offroad)
			{
				return 0.78f;
			}
			if (!_real)
			{
				return 0.9f;
			}
			return 0.94f;
		}

		private float RedlinePitch()
		{
			if (_electric)
			{
				return 3.4f;
			}
			if (_offroad)
			{
				return 2.05f;
			}
			if (!_real)
			{
				return 2.5f;
			}
			return 1.3f;
		}

		private void OnDestroy()
		{
			if (!_electric && !_offroad)
			{
				CarAudioFactory.RealEngineReady -= OnRealClipReady;
			}
		}

		private void OnRealClipReady(AudioClip clip)
		{
			if (!_electric && !_offroad && !((Object)(object)_eng == (Object)null) && !((Object)(object)clip == (Object)null))
			{
				bool isPlaying = _eng.isPlaying;
				_eng.clip = clip;
				_real = true;
				if (isPlaying)
				{
					_eng.timeSamples = 0;
					_eng.Play();
				}
			}
		}

		public void Begin()
		{
			_stopRequested = false;
			((Behaviour)this).enabled = true;
			_rpm01 = (_electric ? 0.12f : 0.08f);
			if (!_eng.isPlaying)
			{
				_eng.Play();
			}
		}

		public void End()
		{
			_stopRequested = true;
			_hornHeld = false;
		}

		public void SetHorn(bool on)
		{
			if (on && !_hornHeld)
			{
				_hornHeld = true;
			}
			else if (!on)
			{
				_hornHeld = false;
			}
		}

		public void Honk(float seconds)
		{
			if (!((Object)(object)_horn == (Object)null))
			{
				_hornUntil = Mathf.Max(_hornUntil, Time.time + Mathf.Max(0.15f, seconds));
			}
		}

		public void Crash(float impact)
		{
			if ((Object)(object)_crash == (Object)null)
			{
				return;
			}
			float time = Time.time;
			if (!(time - _lastCrash < 0.25f))
			{
				_lastCrash = time;
				float num = Mathf.Clamp01((impact - 5f) / 18f) * 0.9f;
				if (num > 0.05f)
				{
					_crash.volume = num;
					_crash.pitch = Random.Range(0.85f, 1.15f);
					_crash.PlayOneShot(CarAudioFactory.Crash, num);
				}
			}
		}

		private void UpdateHorn()
		{
			if ((Object)(object)_horn == (Object)null)
			{
				return;
			}
			AudioClip hornRecording = CarAudioFactory.HornRecording;
			if ((Object)(object)hornRecording != (Object)null && (Object)(object)_horn.clip != (Object)(object)hornRecording)
			{
				bool num = _horn.volume > 0.02f && _horn.isPlaying;
				_horn.clip = hornRecording;
				if (num)
				{
					_horn.Play();
				}
			}
			int num2;
			float num3;
			if (!_hornHeld)
			{
				num2 = ((Time.time < _hornUntil) ? 1 : 0);
				if (num2 == 0)
				{
					num3 = 0f;
					goto IL_00a6;
				}
			}
			else
			{
				num2 = 1;
			}
			num3 = ((_profile != null) ? _profile.HornVolume : 1f);
			goto IL_00a6;
			IL_00a6:
			float num4 = num3;
			_horn.volume = Mathf.MoveTowards(_horn.volume, num4, Time.deltaTime * 8f);
			if (num2 != 0 && !_horn.isPlaying)
			{
				_horn.Play();
			}
			if (num2 == 0 && _horn.volume < 0.01f && _horn.isPlaying)
			{
				_horn.Stop();
			}
		}

		private void Update()
		{
			if ((Object)(object)_eng == (Object)null)
			{
				return;
			}
			UpdateHorn();
			bool flag = (Object)(object)_rig != (Object)null && !_rig.Driving && _rig.AutoDriving;
			float num = ((_profile != null) ? _profile.MaxForwardSpeed : 42f);
			if (flag)
			{
				num *= Mathf.Max(1f, (_profile != null) ? _profile.AiSpeedScale : 1f);
			}
			float num2 = (((Object)(object)_rig != (Object)null && _rig.Driving) ? 0f : 1f);
			if (Mathf.Abs(_aiBlend - num2) > 0.01f)
			{
				_aiBlend = num2;
				_eng.spatialBlend = num2;
				_eng.minDistance = 6f;
				_eng.maxDistance = 220f;
				if ((Object)(object)_crash != (Object)null)
				{
					_crash.spatialBlend = num2;
				}
				if ((Object)(object)_horn != (Object)null)
				{
					_horn.spatialBlend = num2;
				}
			}
			float num5;
			float num6;
			if (!_stopRequested && (Object)(object)_rig != (Object)null && (_rig.Driving || flag))
			{
				float num3 = Mathf.Clamp01(Mathf.Abs(_rig.CurrentSpeed) / num);
				float num4 = Mathf.Max(0f, _rig.Throttle);
				if (_electric)
				{
					num5 = Mathf.Clamp01(0.1f + num3 * 0.86f + num4 * 0.1f);
					num6 = 0.04f + num5 * 0.26f;
				}
				else
				{
					num5 = Mathf.Clamp01(0.06f + num3 * (_offroad ? 0.62f : 0.7f) + num4 * (_offroad ? 0.26f : 0.22f));
					num6 = (_real ? (0.55f + _rpm01 * 0.4f) : (_offroad ? (0.22f + _rpm01 * 0.26f) : (0.18f + _rpm01 * 0.24f)));
				}
			}
			else
			{
				num5 = (_electric ? 0.06f : 0.05f);
				num6 = 0f;
			}
			float num7 = (_electric ? 5f : (_offroad ? 1.9f : 2.6f));
			float num8 = (_electric ? 3.2f : (_offroad ? 1f : 1.4f));
			_rpm01 = Mathf.MoveTowards(_rpm01, num5, Time.deltaTime * ((num5 > _rpm01) ? num7 : num8));
			_volume = Mathf.MoveTowards(_volume, num6, Time.deltaTime * ((num6 > _volume) ? 4f : 2.2f));
			float num9 = Mathf.Clamp(Time.timeScale, 0.05f, 1f);
			_eng.pitch = Mathf.Lerp(IdlePitch(), RedlinePitch(), _rpm01) * num9;
			_eng.volume = _volume;
			if ((Object)(object)_lp != (Object)null)
			{
				if (_electric)
				{
					_lp.cutoffFrequency = Mathf.Lerp(2600f, 15000f, _rpm01);
				}
				else if (_offroad)
				{
					_lp.cutoffFrequency = Mathf.Lerp(620f, 2400f, _rpm01);
				}
				else
				{
					_lp.cutoffFrequency = (_real ? Mathf.Lerp(1500f, 6500f, _rpm01) : Mathf.Lerp(900f, 4200f, _rpm01));
				}
			}
			if (_stopRequested && _volume < 0.01f && _eng.isPlaying)
			{
				_eng.Stop();
				((Behaviour)this).enabled = false;
			}
		}
	}
	public static class CarHooks
	{
		private static GameObject _rocketBoom;

		private static bool _rocketBoomResolved;

		internal static bool IsConvertedCar(DataHandler data)
		{
			if ((Object)(object)data == (Object)null || (Object)(object)data.unit == (Object)null)
			{
				return false;
			}
			CarRig carRig = CarRig.Of(data.unit);
			if ((Object)(object)carRig != (Object)null)
			{
				return carRig.Converted;
			}
			return false;
		}

		internal static bool IsConvertedGundam(DataHandler data)
		{
			if ((Object)(object)data == (Object)null || (Object)(object)data.unit == (Object)null)
			{
				return false;
			}
			GundamRig gundamRig = GundamRig.Of(data.unit);
			if ((Object)(object)gundamRig != (Object)null)
			{
				return gundamRig.Converted;
			}
			return false;
		}

		internal static bool IsConvertedStrikeFreedom(DataHandler data)
		{
			if ((Object)(object)data == (Object)null || (Object)(object)data.unit == (Object)null)
			{
				return false;
			}
			StrikeFreedomRig strikeFreedomRig = StrikeFreedomRig.Of(data.unit);
			if ((Object)(object)strikeFreedomRig != (Object)null)
			{
				return strikeFreedomRig.Converted;
			}
			return false;
		}

		internal static bool IsConvertedZaku(DataHandler data)
		{
			if ((Object)(object)data == (Object)null || (Object)(object)data.unit == (Object)null)
			{
				return false;
			}
			ZakuRig zakuRig = ZakuRig.Of(data.unit);
			if ((Object)(object)zakuRig != (Object)null)
			{
				return zakuRig.Converted;
			}
			return false;
		}

		internal static bool IsConvertedZakuIII(DataHandler data)
		{
			if ((Object)(object)data == (Object)null || (Object)(object)data.unit == (Object)null)
			{
				return false;
			}
			ZakuIIIRig zakuIIIRig = ZakuIIIRig.Of(data.unit);
			if ((Object)(object)zakuIIIRig != (Object)null)
			{
				return zakuIIIRig.Converted;
			}
			return false;
		}

		internal static bool IsConvertedRig(DataHandler data)
		{
			if (!IsConvertedCar(data) && !IsConvertedGundam(data) && !IsConvertedStrikeFreedom(data) && !IsConvertedZaku(data))
			{
				return IsConvertedZakuIII(data);
			}
			return true;
		}

		internal static void PushNavGround(DataHandler data, Vector3 position, float groundY, Vector3 normal)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)data == (Object)null))
			{
				data.groundPosition = new Vector3(position.x, groundY, position.z);
				data.groundNormal = ((((Vector3)(ref normal)).sqrMagnitude > 0.01f) ? ((Vector3)(ref normal)).normalized : Vector3.up);
				data.isGrounded = true;
			}
		}

		internal static Vector3 ClampMove(Transform self, Vector3 from, Vector3 to, float radius, float height)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: 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_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: 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_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: 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_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(to.x - from.x, 0f, to.z - from.z);
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (magnitude < 0.0001f)
			{
				return to;
			}
			Vector3 val2 = val / magnitude;
			Vector3 val3 = from + Vector3.up * (radius * 0.9f);
			Vector3 val4 = from + Vector3.up * Mathf.Max(radius * 1.2f, height);
			float num = magnitude + radius * 0.35f;
			RaycastHit[] array = Physics.CapsuleCastAll(val3, val4, radius, val2, num, -1, (QueryTriggerInteraction)1);
			float num2 = float.MaxValue;
			Vector3 val5 = Vector3.zero;
			for (int i = 0; i < array.Length; i++)
			{
				RaycastHit val6 = array[i];
				if ((Object)(object)((RaycastHit)(ref val6)).collider == (Object)null)
				{
					continue;
				}
				Transform transform = ((Component)((RaycastHit)(ref val6)).collider).transform;
				if (!((Object)(object)self != (Object)null) || (!transform.IsChildOf(self) && !self.IsChildOf(transform)))
				{
					Rigidbody attachedRigidbody = ((RaycastHit)(ref val6)).collider.attachedRigidbody;
					if ((!((Object)(object)attachedRigidbody != (Object)null) || attachedRigidbody.isKinematic) && !((Object)(object)((Component)transform).GetComponentInParent<Unit>() != (Object)null) && !(((RaycastHit)(ref val6)).normal.y > 0.55f) && !(((RaycastHit)(ref val6)).normal.y < -0.55f) && !(((RaycastHit)(ref val6)).distance <= 0f) && ((RaycastHit)(ref val6)).distance < num2)
					{
						num2 = ((RaycastHit)(ref val6)).distance;
						val5 = ((RaycastHit)(ref val6)).normal;
					}
				}
			}
			if (num2 > magnitude + 0.02f)
			{
				return to;
			}
			float num3 = Mathf.Max(0f, num2 - 0.22f);
			Vector3 val7 = from + val2 * num3;
			Vector3 val8 = default(Vector3);
			((Vector3)(ref val8))..ctor(val5.x, 0f, val5.z);
			if (((Vector3)(ref val8)).sqrMagnitude < 0.0001f)
			{
				return new Vector3(val7.x, to.y, val7.z);
			}
			((Vector3)(ref val8)).Normalize();
			Vector3 val9 = val - Vector3.Dot(val, val8) * val8;
			Vector3 val10 = val7 + val9 * 0.85f;
			return new Vector3(val10.x, to.y, val10.z);
		}

		internal static GameObject ResolveRocketBoom()
		{
			if (_rocketBoomResolved)
			{
				return _rocketBoom;
			}
			_rocketBoomResolved = true;
			Explosion[] explosions = Utilities.explosions;
			if (explosions == null || explosions.Length == 0)
			{
				CarLog.Warn("[Boom] no vanilla explosions in the database");
				return null;
			}
			string[] array = new string[7] { "rocket", "bazooka", "rpg", "launcher", "grenade", "bomb", "barrel" };
			for (int i = 0; i < array.Length; i++)
			{
				if (!((Object)(object)_rocketBoom == (Object)null))
				{
					break;
				}
				foreach (Explosion val in explosions)
				{
					if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && ((Object)((Component)val).gameObject).name.ToLowerInvariant().Contains(array[i]))
					{
						_rocketBoom = ((Component)val).gameObject;
						break;
					}
				}
			}
			if ((Object)(object)_rocketBoom == (Object)null && (Object)(object)explosions[0] != (Object)null)
			{
				_rocketBoom = ((Component)explosions[0]).gameObject;
			}
			CarLog.Log("[Boom] rocket explosion = " + (((Object)(object)_rocketBoom != (Object)null) ? ((Object)_rocketBoom).name : "none"));
			return _rocketBoom;
		}

		internal static void SpawnBlast(Vector3 at, float scale)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ResolveRocketBoom();
			if (!((Object)(object)val == (Object)null))
			{
				GameObject val2 = Object.Instantiate<GameObject>(val, at, Quaternion.identity);
				val2.transform.localScale = Vector3.one * Mathf.Max(1f, scale);
				val2.SetActive(true);
				ParticleSystem[] componentsInChildren = val2.GetComponentsInChildren<ParticleSystem>(true);
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].Clear(true);
					componentsInChildren[i].Play(true);
				}
				Object.Destroy((Object)(object)val2, 8f);
			}
		}

		internal static void SpawnVisualBlast(Vector3 at, float scale)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ResolveRocketBoom();
			if (!((Object)(object)val == (Object)null))
			{
				GameObject val2 = Object.Instantiate<GameObject>(val, at, Quaternion.identity);
				val2.transform.localScale = Vector3.one * Mathf.Max(0.25f, scale);
				Explosion[] componentsInChildren = val2.GetComponentsInChildren<Explosion>(true);
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					((Behaviour)componentsInChildren[i]).enabled = false;
				}
				val2.SetActive(true);
				ParticleSystem[] componentsInChildren2 = val2.GetComponentsInChildren<ParticleSystem>(true);
				for (int j = 0; j < componentsInChildren2.Length; j++)
				{
					componentsInChildren2[j].Clear(true);
					componentsInChildren2[j].Play(true);
				}
				Object.Destroy((Object)(object)val2, 3f);
			}
		}
	}
	[HarmonyPatch(typeof(RigidbodyHolder), "Start")]
	public static class CarHolderStartPatch
	{
		public static void Prefix(RigidbodyHolder __instance)
		{
			Unit val = (((Object)(object)__instance.data != (Object)null && (Object)(object)__instance.data.unit != (Object)null) ? __instance.data.unit : ((Component)__instance).GetComponentInParent<Unit>());
			if ((Object)(object)val != (Object)null && (CarContent.IsCarBlueprint(val.unitBlueprint) || CarContent.IsGundamBlueprint(val.unitBlueprint) || CarContent.IsStrikeFreedomBlueprint(val.unitBlueprint) || CarContent.IsZakuBlueprint(val.unitBlueprint) || CarContent.IsZakuIIIBlueprint(val.unitBlueprint)))
			{
				__instance.randomizeRigidbodySizes = false;
			}
		}
	}
	[HarmonyPatch(typeof(Unit), "Start")]
	public static class CarUnitStartPatch
	{
		public static void Postfix(Unit __instance)
		{
			UnitBlueprint unitBlueprint = __instance.unitBlueprint;
			if (CarContent.IsGundamBlueprint(unitBlueprint))
			{
				if ((Object)(object)((Component)__instance).GetComponent<GundamRig>() == (Object)null)
				{
					((Component)__instance).gameObject.AddComponent<GundamRig>();
				}
			}
			else if (CarContent.IsStrikeFreedomBlueprint(unitBlueprint))
			{
				if ((Object)(object)((Component)__instance).GetComponent<StrikeFreedomRig>() == (Object)null)
				{
					((Component)__instance).gameObject.AddComponent<StrikeFreedomRig>();
				}
			}
			else if (CarContent.IsZakuBlueprint(unitBlueprint))
			{
				if ((Object)(object)((Component)__instance).GetComponent<ZakuRig>() == (Object)null)
				{
					((Component)__instance).gameObject.AddComponent<ZakuRig>();
				}
			}
			else if (CarContent.IsZakuIIIBlueprint(unitBlueprint))
			{
				if ((Object)(object)((Component)__instance).GetComponent<ZakuIIIRig>() == (Object)null)
				{
					((Component)__instance).gameObject.AddComponent<ZakuIIIRig>();
				}
			}
			else if (CarContent.IsCarBlueprint(unitBlueprint) && (Object)(object)((Component)__instance).GetComponent<CarRig>() == (Object)null)
			{
				((Component)__instance).gameObject.AddComponent<CarRig>();
			}
		}
	}
	[HarmonyPatch(typeof(MovementHandler), "BatchedFixedUpdate")]
	public static class CarMovementPatch
	{
		public static bool Prefix(MovementHandler __instance)
		{
			return !CarHooks.IsConvertedRig(__instance.data);
		}
	}
	[HarmonyPatch(typeof(Balance), "BatchedUpdate")]
	public static class CarBalancePatch
	{
		public static bool Prefix(Balance __instance)
		{
			Unit componentInParent = ((Component)__instance).GetComponentInParent<Unit>();
			CarRig carRig = CarRig.Of(componentInParent);
			GundamRig gundamRig = GundamRig.Of(componentInParent);
			StrikeFreedomRig strikeFreedomRig = StrikeFreedomRig.Of(componentInParent);
			ZakuRig zakuRig = ZakuRig.Of(componentInParent);
			ZakuIIIRig zakuIIIRig = ZakuIIIRig.Of(componentInParent);
			if (((Object)(object)carRig == (Object)null || !carRig.Converted) && ((Object)(object)gundamRig == (Object)null || !gundamRig.Converted) && ((Object)(object)strikeFreedomRig == (Object)null || !strikeFreedomRig.Converted) && ((Object)(object)zakuRig == (Object)null || !zakuRig.Converted))
			{
				if (!((Object)(object)zakuIIIRig == (Object)null))
				{
					return !zakuIIIRig.Converted;
				}
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(DataHandler), "BatchedUpdate")]
	public static class CarDataUpdatePatch
	{
		public static bool Prefix(DataHandler __instance)
		{
			return !CarHooks.IsConvertedRig(__instance);
		}
	}
	[HarmonyPatch(typeof(DataHandler), "BatchedFixedUpdate")]
	public static class CarDataFixedPatch
	{
		public static bool Prefix(DataHandler __instance)
		{
			return !CarHooks.IsConvertedRig(__instance);
		}
	}
	public static class CarIcon
	{
		private const int W = 128;

		private const int H = 128;

		public static Sprite Make()
		{
			//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_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: 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_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: 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_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Expected O, but got Unknown
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = (Color[])(object)new Color[16384];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = new Color(0f, 0f, 0f, 0f);
			}
			Color c = default(Color);
			((Color)(ref c))..ctor(1f, 0.42f, 0.08f, 1f);
			Color c2 = default(Color);
			((Color)(ref c2))..ctor(0.72f, 0.26f, 0.04f, 1f);
			Color c3 = default(Color);
			((Color)(ref c3))..ctor(0.08f, 0.1f, 0.14f, 1f);
			Color c4 = default(Color);
			((Color)(ref c4))..ctor(0.05f, 0.05f, 0.06f, 1f);
			Color c5 = default(Color);
			((Color)(ref c5))..ctor(0.7f, 0.72f, 0.75f, 1f);
			Color c6 = default(Color);
			((Color)(ref c6))..ctor(1f, 0.95f, 0.75f, 1f);
			Color c7 = default(Color);
			((Color)(ref c7))..ctor(0.9f, 0.08f, 0.05f, 1f);
			Color c8 = default(Color);
			((Color)(ref c8))..ctor(0f, 0f, 0f, 0.3f);
			FillEllipse(array, 64, 108, 52, 7, c8);
			FillPoly(array, (Vector2[])(object)new Vector2[10]
			{
				new Vector2(8f, 92f),
				new Vector2(14f, 80f),
				new Vector2(34f, 76f),
				new Vector2(46f, 56f),
				new Vector2(62f, 48f),
				new Vector2(84f, 50f),
				new Vector2(96f, 64f),
				new Vector2(112f, 72f),
				new Vector2(120f, 84f),
				new Vector2(120f, 92f)
			}, c);
			FillRect(array, 10, 90, 110, 4, c2);
			FillRect(array, 6, 70, 20, 4, c2);
			FillRect(array, 12, 74, 3, 14, c2);
			FillRect(array, 20, 74, 3, 14, c2);
			FillPoly(array, (Vector2[])(object)new Vector2[5]
			{
				new Vector2(48f, 73f),
				new Vector2(57f, 58f),
				new Vector2(80f, 56f),
				new Vector2(91f, 70f),
				new Vector2(91f, 73f)
			}, c3);
			FillRect(array, 110, 78, 8, 4, c6);
			FillRect(array, 8, 80, 5, 5, c7);
			FillCircle(array, 38, 96, 17, c4);
			FillCircle(array, 96, 96, 17, c4);
			FillCircle(array, 38, 96, 9, c5);
			FillCircle(array, 96, 96, 9, c5);
			FillCircle(array, 38, 96, 3, c4);
			FillCircle(array, 96, 96, 3, c4);
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false);
			Color[] array2 = (Color[])(object)new Color[16384];
			for (int j = 0; j < 128; j++)
			{
				for (int k = 0; k < 128; k++)
				{
					array2[j * 128 + k] = array[(127 - j) * 128 + k];
				}
			}
			val.SetPixels(array2);
			val.Apply();
			((Texture)val).filterMode = (FilterMode)1;
			Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 128f);
			((Object)obj).name = "HZD_CarIcon";
			return obj;
		}

		private static void Plot(Color[] px, int x, int y, Color c)
		{
			//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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if (x >= 0 && y >= 0 && x < 128 && y < 128)
			{
				px[y * 128 + x] = Blend(px[y * 128 + x], c);
			}
		}

		private static Color Blend(Color dst, Color src)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_0067: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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)
			float num = src.a + dst.a * (1f - src.a);
			if (num <= 0.001f)
			{
				return new Color(0f, 0f, 0f, 0f);
			}
			return new Color((src.r * src.a + dst.r * dst.a * (1f - src.a)) / num, (src.g * src.a + dst.g * dst.a * (1f - src.a)) / num, (src.b * src.a + dst.b * dst.a * (1f - src.a)) / num, num);
		}

		private static void FillRect(Color[] px, int x0, int y0, int w, int h, Color c)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			for (int i = y0; i < y0 + h; i++)
			{
				for (int j = x0; j < x0 + w; j++)
				{
					Plot(px, j, i, c);
				}
			}
		}

		private static void FillCircle(Color[] px, int cx, int cy, int r, Color c)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			int num = r * r;
			for (int i = -r; i <= r; i++)
			{
				for (int j = -r; j <= r; j++)
				{
					if (j * j + i * i <= num)
					{
						Plot(px, cx + j, cy + i, c);
					}
				}
			}
		}

		private static void FillEllipse(Color[] px, int cx, int cy, int rx, int ry, Color c)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			for (int i = -ry; i <= ry; i++)
			{
				for (int j = -rx; j <= rx; j++)
				{
					if ((float)j * (float)j / (float)(rx * rx) + (float)i * (float)i / (float)(ry * ry) <= 1f)
					{
						Plot(px, cx + j, cy + i, c);
					}
				}
			}
		}

		private static void FillPoly(Color[] px, Vector2[] poly, Color c)
		{
			//IL_005b: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_00ab: 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_00ba: 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_00ce: 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_0165: Unknown result type (might be due to invalid IL or missing references)
			int num = int.MaxValue;
			int num2 = int.MinValue;
			for (int i = 0; i < poly.Length; i++)
			{
				int num3 = Mathf.CeilToInt(poly[i].y);
				if (num3 < num)
				{
					num = num3;
				}
				if (num3 > num2)
				{
					num2 = num3;
				}
			}
			for (int j = num; j <= num2; j++)
			{
				int? num4 = null;
				int? num5 = null;
				for (int k = 0; k < poly.Length; k++)
				{
					Vector2 val = poly[k];
					Vector2 val2 = poly[(k + 1) % poly.Length];
					if ((val.y <= (float)j && val2.y > (float)j) || (val2.y <= (float)j && val.y > (float)j))
					{
						float num6 = ((float)j - val.y) / (val2.y - val.y);
						int num7 = Mathf.RoundToInt(val.x + num6 * (val2.x - val.x));
						if (!num4.HasValue || num7 < num4)
						{
							num4 = num7;
						}
						if (!num5.HasValue || num7 > num5)
						{
							num5 = num7;
						}
					}
				}
				if (num4.HasValue)
				{
					for (int l = num4.Value; l <= num5.Value; l++)
					{
						Plot(px, l, j, c);
					}
				}
			}
		}

		private static Color[] NewCanvas()
		{
			//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)
			Color[] array = (Color[])(object)new Color[16384];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = new Color(0f, 0f, 0f, 0f);
			}
			return array;
		}

		private static Sprite Finish(Color[] px, string name)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0087: 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_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)
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false);
			Color[] array = (Color[])(object)new Color[16384];
			for (int i = 0; i < 128; i++)
			{
				for (int j = 0; j < 128; j++)
				{
					array[i * 128 + j] = px[(127 - i) * 128 + j];
				}
			}
			val.SetPixels(array);
			val.Apply();
			((Texture)val).filterMode = (FilterMode)1;
			Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 128f);
			((Object)obj).name = name;
			return obj;
		}

		private static void Keyline(Color[] px)
		{
			//IL_00d1: 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)
			Color[] array = (Color[])px.Clone();
			Color val = default(Color);
			((Color)(ref val))..ctor(0.07f, 0.08f, 0.12f, 0.94f);
			for (int i = 1; i < 127; i++)
			{
				for (int j = 1; j < 127; j++)
				{
					if (!(array[i * 128 + j].a > 0.04f) && (array[(i - 1) * 128 + j].a > 0.85f || array[(i + 1) * 128 + j].a > 0.85f || array[i * 128 + j - 1].a > 0.85f || array[i * 128 + j + 1].a > 0.85f))
					{
						px[i * 128 + j] = val;
					}
				}
			}
		}

		private static void Wheel(Color[] px, int cx, int cy, int r, Color tire, Color rim)
		{
			//IL_0004: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			FillCircle(px, cx, cy, r, tire);
			FillCircle(px, cx, cy, r - 5, rim);
			FillCircle(px, cx, cy, Mathf.Max(2, r - 10), tire);
		}

		public static Sprite MakeCar(CarProfile p)
		{
			//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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_013f: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: 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_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: 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_0291: 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_02a7: 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_02bd: 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_02d4: 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_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: 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_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: 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_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: 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_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04be: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0513: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Unknown result type (might be due to invalid IL or missing references)
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Unknown result type (might be due to invalid IL or missing references)
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Unknown result type (might be due to invalid IL or missing references)
			//IL_069c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0704: Unknown result type (might be due to invalid IL or missing references)
			//IL_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_073d: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_0794: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07af: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0802: Unknown result type (might be due to invalid IL or missing references)
			//IL_0807: Unknown result type (might be due to invalid IL or missing references)
			//IL_0818: Unknown result type (might be due to invalid IL or missing references)
			//IL_081d: Unknown result type (might be due to invalid IL or missing references)
			//IL_082e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Unknown result type (might be due to invalid IL or missing references)
			//IL_085c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_0866: Unknown result type (might be due to invalid IL or missing references)
			//IL_087f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0884: Unknown result type (might be due to invalid IL or missing references)
			//IL_0895: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0905: Unknown result type (might be due to invalid IL or missing references)
			//IL_0912: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Unknown result type (might be due to invalid IL or missing references)
			//IL_092e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0930: Unknown result type (might be due to invalid IL or missing references)
			//IL_093e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0940: Unknown result type (might be due to invalid IL or missing references)
			//IL_0960: Unknown result type (might be due to invalid IL or missing references)
			//IL_0965: Unknown result type (might be due to invalid IL or missing references)
			//IL_0976: Unknown result type (might be due to invalid IL or missing references)
			//IL_097b: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0991: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a15: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4b: Unknown result type (might be due to invalid IL or missing references)
			Color[] px = NewCanvas();
			Color bodyColor = p.BodyColor;
			bodyColor.a = 1f;
			if (bodyColor.r + bodyColor.g + bodyColor.b < 0.42f)
			{
				((Color)(ref bodyColor))..ctor(0.17f, 0.18f, 0.22f);
			}
			Color c = default(Color);
			((Color)(ref c))..ctor(bodyColor.r * 0.55f, bodyColor.g * 0.55f, bodyColor.b * 0.55f, 1f);
			Color c2 = default(Color);
			((Color)(ref c2))..ctor(0.1f, 0.13f, 0.18f, 1f);
			Color tire = default(Color);
			((Color)(ref tire))..ctor(0.05f, 0.05f, 0.06f, 1f);
			Color rim = default(Color);
			((Color)(ref rim))..ctor(0.72f, 0.74f, 0.78f, 1f);
			Color c3 = default(Color);
			((Color)(ref c3))..ctor(1f, 0.96f, 0.78f, 1f);
			Color c4 = default(Color);
			((Color)(ref c4))..ctor(0.95f, 0.1f, 0.07f, 1f);
			Color c5 = default(Color);
			((Color)(ref c5))..ctor(1f, 1f, 1f, 0.22f);
			Color c6 = default(Color);
			((Color)(ref c6))..ctor(0f, 0f, 0f, 0.26f);
			FillEllipse(px, 64, 112, 50, 6, c6);
			string text = ((p.Key == null) ? "" : p.Key.ToLowerInvariant());
			if (text.Contains("dayun"))
			{
				FillRect(px, 10, 40, 72, 46, new Color(0.84f, 0.85f, 0.89f));
				FillRect(px, 10, 40, 72, 3, new Color(0.52f, 0.54f, 0.59f));
				FillRect(px, 10, 40, 3, 46, new Color(0.52f, 0.54f, 0.59f));
				FillPoly(px, (Vector2[])(object)new Vector2[6]
				{
					new Vector2(80f, 96f),
					new Vector2(80f, 60f),
					new Vector2(86f, 46f),
					new Vector2(110f, 46f),
					new Vector2(120f, 60f),
					new Vector2(120f, 96f)
				}, bodyColor);
				FillPoly(px, (Vector2[])(object)new Vector2[4]
				{
					new Vector2(88f, 50f),
					new Vector2(110f, 50f),
					new Vector2(116f, 60f),
					new Vector2(88f, 60f)
				}, c2);
				FillRect(px, 118, 62, 3, 6, c3);
				Wheel(px, 26, 94, 15, tire, rim);
				Wheel(px, 46, 94, 15, tire, rim);
				Wheel(px, 66, 94, 15, tire, rim);
				Wheel(px, 104, 94, 16, tire, rim);
			}
			else if (text.Contains("g63"))
			{
				FillPoly(px, (Vector2[])(object)new Vector2[11]
				{
					new Vector2(12f, 98f),
					new Vector2(12f, 74f),
					new Vector2(17f, 62f),
					new Vector2(30f, 58f),
					new Vector2(38f, 46f),
					new Vector2(88f, 46f),
					new Vector2(98f, 54f),
					new Vector2(106f, 60f),
					new Vector2(114f, 74f),
					new Vector2(120f, 78f),
					new Vector2(120f, 98f)
				}, bodyColor);
				FillPoly(px, (Vector2[])(object)new Vector2[6]
				{
					new Vector2(40f, 58f),
					new Vector2(46f, 48f),
					new Vector2(86f, 48f),
					new Vector2(96f, 56f),
					new Vector2(96f, 63f),
					new Vector2(42f, 63f)
				}, c2);
				FillRect(px, 14, 74, 104, 5, c);
				FillRect(px, 16, 42, 18, 4, c);
				FillRect(px, 84, 42, 18, 4, c);
				FillRect(px, 112, 62, 7, 5, c3);
				FillRect(px, 12, 78, 5, 7, c4);
				Wheel(px, 34, 94, 17, tire, rim);
				Wheel(px, 98, 94, 17, tire, rim);
			}
			else if (text.Contains("amg"))
			{
				FillPoly(px, (Vector2[])(object)new Vector2[11]
				{
					new Vector2(10f, 96f),
					new Vector2(10f, 78f),
					new Vector2(24f, 74f),
					new Vector2(34f, 56f),
					new Vector2(52f, 50f),
					new Vector2(66f, 52f),
					new Vector2(76f, 62f),
					new Vector2(94f, 68f),
					new Vector2(112f, 74f),
					new Vector2(120f, 84f),
					new Vector2(120f, 96f)
				}, bodyColor);
				FillPoly(px, (Vector2[])(object)new Vector2[6]
				{
					new Vector2(36f, 57f),
					new Vector2(54f, 51f),
					new Vector2(66f, 53f),
					new Vector2(76f, 62f),
					new Vector2(76f, 66f),
					new Vector2(38f, 66f)
				}, c2);
				FillRect(px, 12, 90, 104, 5, c);
				FillRect(px, 8, 72, 24, 4, c);
				FillRect(px, 14, 76, 3, 12, c);
				FillRect(px, 24, 76, 3, 12, c);
				FillRect(px, 112, 80, 7, 5, c3);
				FillRect(px, 10, 84, 5, 5, c4);
				Wheel(px, 34, 94, 16, tire, rim);
				Wheel(px, 98, 94, 16, tire, rim);
			}
			else if (text.Contains("taycan") || text.Contains("tesla"))
			{
				FillPoly(px, (Vector2[])(object)new Vector2[11]
				{
					new Vector2(10f, 96f),
					new Vector2(10f, 82f),
					new Vector2(20f, 78f),
					new Vector2(28f, 60f),
					new Vector2(40f, 50f),
					new Vector2(70f, 50f),
					new Vector2(82f, 58f),
					new Vector2(96f, 70f),
					new Vector2(112f, 76f),
					new Vector2(120f, 84f),
					new Vector2(120f, 96f)
				}, bodyColor);
				FillPoly(px, (Vector2[])(object)new Vector2[6]
				{
					new Vector2(32f, 60f),
					new Vector2(43f, 51f),
					new Vector2(69f, 51f),
					new Vector2(79f, 59f),
					new Vector2(79f, 64f),
					new Vector2(34f, 64f)
				}, c2);
				FillRect(px, 12, 90, 104, 5, c);
				FillRect(px, 112, 80, 7, 5, c3);
				FillRect(px, 10, 84, 5, 5, c4);
				Wheel(px, 34, 94, 16, tire, rim);
				Wheel(px, 98, 94, 16, tire, rim);
			}
			else
			{
				FillPoly(px, (Vector2[])(object)new Vector2[11]
				{
					new Vector2(10f, 96f),
					new Vector2(10f, 82f),
					new Vector2(22f, 78f),
					new Vector2(32f, 62f),
					new Vector2(46f, 56f),
					new Vector2(60f, 56f),
					new Vector2(72f, 64f),
					new Vector2(88f, 70f),
					new Vector2(108f, 76f),
					new Vector2(120f, 84f),
					new Vector2(120f, 96f)
				}, bodyColor);
				FillPoly(px, (Vector2[])(object)new Vector2[6]
				{
					new Vector2(34f, 62f),
					new Vector2(47f, 57f),
					new Vector2(60f, 57f),
					new Vector2(71f, 65f),
					new Vector2(71f, 69f),
					new Vector2(36f, 69f)
				}, c2);
				FillRect(px, 12, 90, 106, 5, c);
				FillRect(px, 8, 74, 22, 4, c);
				FillRect(px, 14, 78, 3, 12, c);
				FillRect(px, 23, 78, 3, 12, c);
				FillRect(px, 113, 82, 7, 4, c3);
				FillRect(px, 10, 84, 5, 5, c4);
				Wheel(px, 34, 94, 16, tire, rim);
				Wheel(px, 98, 94, 16, tire, rim);
			}
			FillRect(px, 44, 50, 26, 2, c5);
			Keyline(px);
			return Finish(px, "HZD_Icon_" + (p.Key ?? "car"));
		}

		private static Color[] MechCanvas()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			Color[] array = NewCanvas();
			FillEllipse(array, 64, 118, 34, 5, new Color(0f, 0f, 0f, 0.26f));
			return array;
		}

		private static void MechLegs(Color[] px, Color main, Color dark, Color accent)
		{
			//IL_0009: 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_0027: 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_0044: 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)
			FillRect(px, 48, 78, 14, 30, main);
			FillRect(px, 66, 78, 14, 30, main);
			FillRect(px, 49, 94, 12, 12, dark);
			FillRect(px, 67, 94, 12, 12, dark);
			FillRect(px, 42, 106, 22, 6, accent);
			FillRect(px, 64, 106, 22, 6, accent);
		}

		private static void MechBody(Color[] px, Color main, Color dark)
		{
			//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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_008b: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			FillPoly(px, (Vector2[])(object)new Vector2[6]
			{
				new Vector2(46f, 40f),
				new Vector2(82f, 40f),
				new Vector2(86f, 60f),
				new Vector2(78f, 72f),
				new Vector2(50f, 72f),
				new Vector2(42f, 60f)
			}, main);
			FillRect(px, 52, 70, 24, 12, dark);
			FillRect(px, 51, 58, 26, 3, dark);
		}

		private static void MechArms(Color[] px, Color main, Color dark)
		{
			//IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			FillRect(px, 31, 58, 10, 30, dark);
			FillRect(px, 87, 58, 10, 30, dark);
			FillCircle(px, 36, 90, 5, main);
			FillCircle(px, 92, 90, 5, main);
		}

		private static void MechHead(Color[] px, Color main, Color dark, Color visor)
		{
			//IL_0008: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			FillRect(px, 58, 32, 12, 8, dark);
			FillRect(px, 56, 18, 16, 15, main);
			FillRect(px, 59, 24, 10, 4, visor);
		}

		private static void MechShoulders(Color[] px, Color main, int h)
		{
			//IL_0008: 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)
			FillRect(px, 26, 40, 20, h, main);
			FillRect(px, 82, 40, 20, h, main);
		}

		public static Sprite MakeGundam()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00d7: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: 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_016d: 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_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: 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_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			Color main = default(Color);
			((Color)(ref main))..ctor(0.93f, 0.94f, 0.96f, 1f);
			Color val = default(Color);
			((Color)(ref val))..ctor(0.21f, 0.22f, 0.26f, 1f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.8f, 0.06f, 0.07f, 1f);
			Color c = default(Color);
			((Color)(ref c))..ctor(0.96f, 0.79f, 0.24f, 1f);
			Color visor = default(Color);
			((Color)(ref visor))..ctor(0.42f, 1f, 0.58f, 1f);
			Color[] px = MechCanvas();
			MechLegs(px, main, val, val2);
			MechBody(px, main, val);
			MechArms(px, main, val);
			MechShoulders(px, main, 20);
			MechHead(px, main, val, visor);
			FillRect(px, 57, 46, 14, 7, val2);
			FillRect(px, 51, 63, 26, 4, val2);
			FillPoly(px, (Vector2[])(object)new Vector2[3]
			{
				new Vector2(57f, 21f),
				new Vector2(41f, 6f),
				new Vector2(55f, 19f)
			}, c);
			FillPoly(px, (Vector2[])(object)new Vector2[3]
			{
				new Vector2(71f, 21f),
				new Vector2(87f, 6f),
				new Vector2(73f, 19f)
			}, c);
			FillPoly(px, (Vector2[])(object)new Vector2[3]
			{
				new Vector2(62f, 17f),
				new Vector2(64f, 4f),
				new Vector2(66f, 17f)
			}, c);
			FillPoly(px, (Vector2[])(object)new Vector2[6]
			{
				new Vector2(18f, 58f),
				new Vector2(33f, 53f),
				new Vector2(38f, 61f),
				new Vector2(38f, 92f),
				new Vector2(28f, 99f),
				new Vector2(18f, 92f)
			}, val);
			FillPoly(px, (Vector2[])(object)new Vector2[6]
			{
				new Vector2(20f, 60f),
				new Vector2(32f, 55f),
				new Vector2(36f, 62f),
				new Vector2(36f, 90f),
				new Vector2(28f, 96f),
				new Vector2(20f, 90f)
			}, new Color(0.82f, 0.84f, 0.89f, 1f));
			FillRect(px, 24, 58, 8, 3, val2);
			FillCircle(px, 28, 74, 4, val2);
			Keyline(px);
			return Finish(px, "HZD_Icon_Unicorn");
		}

		public static Sprite MakeStrikeFreedom()
		{
			//IL_00b5: 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_00e1: 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_010d: 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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: 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_01be: 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_01c7: Unknown result