Decompiled source of HomebreweryTEST v4.7.43

Homebrewery.dll

Decompiled 3 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using AtlyssCommandLib.API;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CodeTalker.Networking;
using CodeTalker.Packets;
using GLTFast;
using GLTFast.Loading;
using GLTFast.Logging;
using GLTFast.Materials;
using HarmonyLib;
using Homebrewery.Code;
using Homebrewery.Code.Commands;
using Homebrewery.Code.Component;
using Homebrewery.Code.Config;
using Homebrewery.Code.Content;
using Homebrewery.Code.Content.Assets;
using Homebrewery.Code.Content.Items;
using Homebrewery.Code.Content.Parts;
using Homebrewery.Code.Enums;
using Homebrewery.Code.Objects;
using Homebrewery.Code.Structs;
using Marioalexsan.AtlyssGLTF;
using Microsoft.CodeAnalysis;
using Mirror;
using Mirror.RemoteCalls;
using Mono.Cecil;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Homebrewery")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("4.7.43.0")]
[assembly: AssemblyInformationalVersion("4.7.43+7bc78657e57f2aecda8da6070ac9d00f2a481325")]
[assembly: AssemblyProduct("Homebrewery")]
[assembly: AssemblyTitle("Homebrewery")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.7.43.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Homebrewery
{
	internal static class CT
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static BinaryPacketListener <0>__BP;

			public static PacketListener <1>__P;
		}

		internal const string MOD_ID = "CodeTalker";

		private static bool? _enabled;

		internal static uint _mainPlayerIndex;

		internal static bool _ready;

		internal static Dictionary<uint, Player> _players = new Dictionary<uint, Player>();

		internal static bool _floatsOn;

		internal static bool _stringsOn;

		private static readonly Dictionary<Folder, int> _typeIndexes = new Dictionary<Folder, int>
		{
			[Folder.Helm] = 1,
			[Folder.Cape] = 2,
			[Folder.Chestpiece] = 3,
			[Folder.Leggings] = 4,
			[Folder.Eyes] = 5,
			[Folder.Mouth] = 6
		};

		internal static bool Enabled
		{
			get
			{
				bool valueOrDefault = _enabled == true;
				if (!_enabled.HasValue)
				{
					valueOrDefault = Chainloader.PluginInfos.ContainsKey("CodeTalker");
					_enabled = valueOrDefault;
				}
				return _enabled.Value;
			}
		}

		internal static void RegisterListeners()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0045: 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: Expected O, but got Unknown
			object obj = <>O.<0>__BP;
			if (obj == null)
			{
				BinaryPacketListener val = BP;
				<>O.<0>__BP = val;
				obj = (object)val;
			}
			if (!CodeTalkerNetwork.RegisterBinaryListener<BF>((BinaryPacketListener)obj))
			{
				HB.Log("Could not register float packet listener!", 4);
			}
			else
			{
				_floatsOn = true;
			}
			object obj2 = <>O.<1>__P;
			if (obj2 == null)
			{
				PacketListener val2 = P;
				<>O.<1>__P = val2;
				obj2 = (object)val2;
			}
			if (!CodeTalkerNetwork.RegisterListener<S>((PacketListener)obj2))
			{
				HB.Log("Could not register string packet listener!", 4);
			}
			else
			{
				_stringsOn = true;
			}
		}

		internal static void P(PacketHeader header, PacketBase packet)
		{
			if (_ready && packet is S s)
			{
				StringsIn(s);
			}
		}

		internal static void BP(PacketHeader header, BinaryPacketBase packet)
		{
			if (_ready && packet is BF floats)
			{
				FloatsIn(floats);
			}
		}

		internal static void FloatsIn(BF floats)
		{
			uint sender = (uint)floats.V[1];
			float num = floats.V[0];
			if (num != 0f)
			{
				if (num != 1f)
				{
					if (num != 2f)
					{
						if (num != 3f)
						{
							if (num != 4f)
							{
								if (num != 5f)
								{
									if (num == 6f)
									{
										TailModeIn(sender, floats.V[3..]);
									}
								}
								else
								{
									AllDyesIn(sender, floats.V[2], floats.V[3..]);
								}
							}
							else
							{
								DyeColorIn(sender, floats.V[3..]);
							}
						}
						else
						{
							ScaleCmdIn(sender, floats.V[3..]);
						}
					}
					else
					{
						CondEffectIn(sender, floats.V[3..]);
					}
				}
				else
				{
					LimitsPacketIn(sender, floats.V[2], floats.V[3..]);
				}
			}
			else
			{
				HBHelloIn(sender);
			}
		}

		private static void HBHelloIn(uint sender)
		{
			if (sender == _mainPlayerIndex)
			{
				ZPartMarkersOut();
				LimitsPacketOut();
				AllDyesOut();
			}
			else
			{
				ZPartMarkersOut(sender.ToString(CultureInfo.InvariantCulture));
				LimitsPacketOut(sender);
				AllDyesOut(sender);
			}
			TailModeOut(CharDisplayManager._local.GetTailMode());
		}

		private static void LimitsPacketIn(uint sender, float recipient, float[] values)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a LimitsPacket that was ours", 2);
			}
			else if (recipient != -1f && recipient != (float)_mainPlayerIndex)
			{
				HB.Log("Ignored a LimitsPacket that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				charDisplayManager.SetYourLimits(CondType.Boobs, values[0], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Boobs, values[1], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Butt, values[2], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Butt, values[3], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Belly, values[4], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Belly, values[5], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Arms, values[6], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Arms, values[7], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Torso, values[8], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Torso, values[9], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Muzzle, values[10], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Muzzle, values[11], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Height, values[12], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Height, values[13], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Width, values[14], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Width, values[15], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Head, values[16], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Head, values[17], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Voice, values[18], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Voice, values[19], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Depth, values[20], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Depth, values[21], miniftrue: false);
			}
		}

		internal static void LimitsPacketOut(float recipient = -1f)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(1f, _mainPlayerIndex, CharDisplayManager._local.GetAllLimits(), recipient));
		}

		private static void CondEffectIn(uint sender, float[] values)
		{
			CondEffectManager condEffectManager = default(CondEffectManager);
			if (!_players.TryGetValue(sender, out Player value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value).TryGetComponent<CondEffectManager>(ref condEffectManager))
			{
				condEffectManager.GetEffect((CondType)values[0], values[1], values[2], values[3], values[4] != 0f);
			}
		}

		internal static void CondEffectOut(CondType cond, float duration, float power, float interval, bool delayed)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(2f, _mainPlayerIndex, new float[5]
			{
				(float)cond,
				duration,
				power,
				interval,
				delayed ? 1 : 0
			}));
		}

		private static void ScaleCmdIn(uint sender, float[] values)
		{
			CondEffectManager condEffectManager = default(CondEffectManager);
			if (!_players.TryGetValue(sender, out Player value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value).TryGetComponent<CondEffectManager>(ref condEffectManager))
			{
				CondType condType = (CondType)values[0];
				float num = 1f;
				float num2 = 0f;
				switch (condType)
				{
				case CondType.Boobs:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._boobWeight;
					break;
				case CondType.Butt:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._bottomWeight;
					break;
				case CondType.Belly:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._bellyWeight;
					break;
				case CondType.Height:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight;
					num = 2000f;
					break;
				case CondType.Width:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._widthWeight;
					num = 2000f;
					break;
				case CondType.Depth:
					num2 = condEffectManager.CharMan.GetDepth();
					num = 2000f;
					break;
				case CondType.HeightWidthDepth:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight;
					num = 2000f;
					break;
				case CondType.Head:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._headWidth;
					break;
				case CondType.Arms:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._armWeight;
					break;
				case CondType.Torso:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._torsoWeight;
					break;
				case CondType.Muzzle:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._muzzleWeight;
					break;
				case CondType.Voice:
					num2 = condEffectManager.Player._pSound._voicePitch;
					break;
				}
				float power = (values[1] - num2) / values[2] / 60f * num;
				condEffectManager.GetEffect(condType, values[2], power, 1f / 60f, delayed: false);
			}
		}

		internal static void ScaleCmdOut(CondType slider, float endPoint, float time)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(3f, _mainPlayerIndex, new float[3]
			{
				(float)slider,
				endPoint,
				time
			}));
		}

		private static void DyeColorIn(uint sender, float[] values)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			Player value;
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a DyeColor packet that was ours", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"Sender ID ({sender}) was not in Players Dictionary!", 4);
			}
			else
			{
				CharDisplayManager charDisplayManager = default(CharDisplayManager);
				if (!((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
				{
					return;
				}
				ColorAdjustShader_Profile colorAdjust = new ColorAdjustShader_Profile
				{
					_hue = values[1],
					_saturation = values[2],
					_brightness = values[3],
					_contrast = values[4]
				};
				float num = values[0];
				if (num != 0f)
				{
					if (num != 1f)
					{
						if (num != 2f)
						{
							if (num != 3f)
							{
								if (num != 4f)
								{
									if (num != 5f)
									{
										if (num == 6f)
										{
											charDisplayManager.RecolourMouth(colorAdjust);
										}
									}
									else
									{
										charDisplayManager.RecolourEyes(colorAdjust);
									}
								}
								else
								{
									charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust);
								}
							}
							else
							{
								charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust);
							}
						}
						else
						{
							charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust);
						}
					}
					else
					{
						charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust);
					}
				}
				else
				{
					charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust);
				}
			}
		}

		internal static void DyeColorOut(int type, ColorAdjustShader_Profile colorAdjust)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5] { type, colorAdjust._hue, colorAdjust._saturation, colorAdjust._brightness, colorAdjust._contrast }));
		}

		internal static void DyeColorOut(Folder type, ColorAdjustShader_Profile colorAdjust)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5]
			{
				_typeIndexes[type],
				colorAdjust._hue,
				colorAdjust._saturation,
				colorAdjust._brightness,
				colorAdjust._contrast
			}));
		}

		private static void AllDyesIn(uint sender, float recipient, float[] values)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			Player value;
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored an AllDyes Packet that was ours", 2);
			}
			else if (recipient != -1f && recipient != (float)_mainPlayerIndex)
			{
				HB.Log("Ignored an AllDyes Packet that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else
			{
				CharDisplayManager charDisplayManager = default(CharDisplayManager);
				if (!((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
				{
					return;
				}
				HB.Log("Got an AllDyes packet from: " + value._nickname, 2);
				int num = 1;
				for (int i = 0; (float)i < values[0]; i++)
				{
					ColorAdjustShader_Profile val = new ColorAdjustShader_Profile
					{
						_hue = values[num + 1],
						_saturation = values[num + 2],
						_brightness = values[num + 3],
						_contrast = values[num + 4]
					};
					float num2 = values[num];
					if (num2 != 1f)
					{
						if (num2 != 2f)
						{
							if (num2 != 3f)
							{
								if (num2 != 4f)
								{
									if (num2 != 5f)
									{
										if (num2 == 6f)
										{
											charDisplayManager.RecolourMouth(val);
											HB.Log($"Mouth: H {val._hue}, S {val._saturation}, B {val._brightness}, C {val._contrast}", 1);
										}
									}
									else
									{
										charDisplayManager.RecolourEyes(val);
									}
								}
								else
								{
									charDisplayManager.SetSlotDye(Folder.Leggings, val);
								}
							}
							else
							{
								charDisplayManager.SetSlotDye(Folder.Chestpiece, val);
							}
						}
						else
						{
							charDisplayManager.SetSlotDye(Folder.Cape, val);
						}
					}
					else
					{
						charDisplayManager.SetSlotDye(Folder.Helm, val);
					}
					num += 5;
				}
			}
		}

		private static void AllDyesOut(float recipient = -1f)
		{
			float[] dyesIfNotDefault = CharDisplayManager._local.GetDyesIfNotDefault();
			if (dyesIfNotDefault.Length != 0)
			{
				CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(5f, _mainPlayerIndex, dyesIfNotDefault, recipient));
			}
		}

		private static void TailModeIn(uint sender, float[] values)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a TailMode Packet that was ours", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				HB.Log("Got a TailMode packet from: " + value._nickname, 2);
				charDisplayManager.SetTailMode((TailMode)values[0]);
			}
		}

		internal static void TailModeOut(TailMode tailmode)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(6f, _mainPlayerIndex, new float[1] { (float)tailmode }));
		}

		internal static void StringsIn(S s)
		{
			if (uint.TryParse(s.V[1], out var result))
			{
				string text = s.V[0];
				if (text == "0")
				{
					ZPartMarkersIn(result, s.V[2], s.V[3..]);
				}
			}
		}

		internal static void ZPartMarkersIn(uint sender, string recipient, string[] s)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a ZPartMarkers that was ours", 2);
			}
			else if (recipient.Length > 0 && !recipient.Equals(_mainPlayerIndex.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
			{
				HB.Log("Ignored a ZPartMarkers that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				HB.Log("Got a ZPartMarkers packet from: " + value._nickname, 2);
				if (s[0].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Skin, s[0]);
				}
				if (s[1].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Mouth, s[1]);
				}
				if (s[2].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Eyes, s[2]);
				}
				if (s[3].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Hair, s[3]);
				}
				charDisplayManager._playerRaceModel.Apply_CharacterDisplay();
			}
		}

		internal static void ZPartMarkersOut(string recipient = "")
		{
			string partMarker = CharDisplayManager._local.GetPartMarker(Folder.Skin);
			string partMarker2 = CharDisplayManager._local.GetPartMarker(Folder.Mouth);
			string partMarker3 = CharDisplayManager._local.GetPartMarker(Folder.Eyes);
			string partMarker4 = CharDisplayManager._local.GetPartMarker(Folder.Hair);
			if (partMarker.Length + partMarker2.Length + partMarker3.Length + partMarker4.Length != 0)
			{
				CodeTalkerNetwork.SendNetworkPacket((PacketBase)(object)new S("0", _mainPlayerIndex.ToString(CultureInfo.InvariantCulture), new string[4] { partMarker, partMarker2, partMarker3, partMarker4 }, recipient));
			}
		}
	}
	internal sealed class BF : BinaryPacketBase
	{
		public float[] V { get; set; } = Array.Empty<float>();

		public override string PacketSignature => "HB.BF";

		public BF()
		{
		}

		public BF(float type, float sender, float[] values = null, float recipient = -1f)
		{
			List<float> list = new List<float>();
			list.Add(type);
			list.Add(sender);
			list.Add(recipient);
			list.AddRange(values ?? Array.Empty<float>());
			V = list.ToArray();
		}

		public override void Deserialize(byte[] data)
		{
			V = new float[data.Length / 4];
			Buffer.BlockCopy(data, 0, V, 0, data.Length);
		}

		public override byte[] Serialize()
		{
			byte[] array = new byte[V.Length * 4];
			Buffer.BlockCopy(V, 0, array, 0, array.Length);
			return array;
		}
	}
	internal sealed class S : PacketBase
	{
		public override string PacketSourceGUID => "Homebrewery";

		[JsonProperty]
		public string[] V { get; set; }

		public S(string type, string sender, string[] values = null, string recipient = "")
		{
			List<string> list = new List<string>();
			list.Add(type);
			list.Add(sender);
			list.Add(recipient);
			list.AddRange(values ?? Array.Empty<string>());
			V = list.ToArray();
			((PacketBase)this)..ctor();
		}
	}
	internal static class DataExtractor
	{
		internal static StringBuilder _loadedAssetsList = new StringBuilder();

		internal static void TellMeAbout(object? it, bool showempty = true)
		{
			HB.Log("TellMeAbout...");
			if (it == null)
			{
				HB.Log("It's null");
				HB.Log("...ToldYouAbout.\n");
				return;
			}
			HB.Log("Object: " + it);
			List<FieldInfo> list = it.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
			if (list.Count > 0)
			{
				list.Sort((FieldInfo f1, FieldInfo f2) => string.Compare(f1.Name, f2.Name, StringComparison.OrdinalIgnoreCase));
				foreach (FieldInfo item in list)
				{
					if (showempty || item.GetValue(it) != null)
					{
						HB.Log(item.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item.GetValue(it));
					}
				}
			}
			List<PropertyInfo> list2 = it.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
			if (list2.Count > 0)
			{
				list2.Sort((PropertyInfo p1, PropertyInfo p2) => string.Compare(p1.Name, p2.Name, StringComparison.OrdinalIgnoreCase));
				foreach (PropertyInfo item2 in list2)
				{
					if (showempty || item2.GetValue(it) != null)
					{
						HB.Log(item2.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item2.GetValue(it));
					}
				}
			}
			HB.Log("...ToldYouAbout.\n");
		}

		internal static string MaximumStats()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			ScriptableItem val = GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableEquipment && !((ScriptableObject)(object)i).IsIDNegative());
			ScriptableEquipment val2 = (ScriptableEquipment)val;
			ScriptableEquipment val3 = val2;
			ScriptableEquipment val4 = val2;
			ScriptableEquipment val5 = val2;
			ScriptableEquipment val6 = val2;
			ScriptableEquipment val7 = val2;
			ScriptableEquipment val8 = val2;
			ScriptableEquipment val9 = val2;
			ScriptableEquipment val10 = val2;
			ScriptableEquipment val11 = val2;
			ScriptableEquipment val12 = val2;
			ScriptableEquipment val13 = val2;
			ScriptableEquipment val14 = val2;
			ScriptableEquipment val15 = val2;
			ScriptableEquipment val16 = val2;
			ScriptableEquipment val17 = val2;
			ScriptableEquipment val18 = val2;
			ScriptableEquipment val19 = val2;
			ScriptableWeapon val20 = (ScriptableWeapon)GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableWeapon && !((ScriptableObject)(object)i).IsIDNegative());
			ScriptableWeapon val21 = val20;
			foreach (ScriptableItem item in GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => i is ScriptableEquipment && !((ScriptableObject)(object)i).IsIDNegative()))
			{
				ScriptableEquipment val22 = (ScriptableEquipment)(object)((item is ScriptableEquipment) ? item : null);
				if (val22 == null)
				{
					continue;
				}
				if (((ScriptableItem)val22)._vendorCost > val._vendorCost)
				{
					val = (ScriptableItem)(object)val22;
				}
				if (val22._equipmentLevel > val2._equipmentLevel)
				{
					val2 = val22;
				}
				if (val22._statArray._maxHealth > val3._statArray._maxHealth)
				{
					val3 = val22;
				}
				if (val22._statArray._maxMana > val4._statArray._maxMana)
				{
					val4 = val22;
				}
				if (val22._statArray._maxStamina > val5._statArray._maxStamina)
				{
					val5 = val22;
				}
				if (val22._statArray._attackPower > val6._statArray._attackPower)
				{
					val6 = val22;
				}
				if (val22._statArray._magicPower > val7._statArray._magicPower)
				{
					val7 = val22;
				}
				if (val22._statArray._dexPower > val8._statArray._dexPower)
				{
					val8 = val22;
				}
				if (val22._statArray._criticalRate > val9._statArray._criticalRate)
				{
					val9 = val22;
				}
				if (val22._statArray._evasion > val10._statArray._evasion)
				{
					val10 = val22;
				}
				if (val22._statArray._defense > val11._statArray._defense)
				{
					val11 = val22;
				}
				if (val22._statArray._resist > val12._statArray._resist)
				{
					val12 = val22;
				}
				if (val22._statArray._elementalPower > val13._statArray._elementalPower)
				{
					val13 = val22;
				}
				if (val22._statArray._firePower > val14._statArray._firePower)
				{
					val14 = val22;
				}
				if (val22._statArray._waterPower > val15._statArray._waterPower)
				{
					val15 = val22;
				}
				if (val22._statArray._naturePower > val16._statArray._naturePower)
				{
					val16 = val22;
				}
				if (val22._statArray._earthPower > val17._statArray._earthPower)
				{
					val17 = val22;
				}
				if (val22._statArray._holyPower > val18._statArray._holyPower)
				{
					val18 = val22;
				}
				if (val22._statArray._shadowPower > val19._statArray._shadowPower)
				{
					val19 = val22;
				}
				ScriptableWeapon val23 = (ScriptableWeapon)(object)((val22 is ScriptableWeapon) ? val22 : null);
				if (val23 != null)
				{
					if (val23._bonusFloorWeaponDamage > val20._bonusFloorWeaponDamage)
					{
						val20 = val23;
					}
					if (val23._bonusCeilingWeaponDamage > val21._bonusCeilingWeaponDamage)
					{
						val21 = val23;
					}
				}
			}
			return $"```\r\n_vendorCost : {val._itemName} : {val._vendorCost}\r\n\r\n_equipmentLevel : {((ScriptableItem)val2)._itemName} : {val2._equipmentLevel}\r\n\r\n_maxHealth : {((ScriptableItem)val3)._itemName} : {val3._statArray._maxHealth}\r\n_maxMana : {((ScriptableItem)val4)._itemName} : {val4._statArray._maxMana}\r\n_maxStamina : {((ScriptableItem)val5)._itemName} : {val5._statArray._maxStamina}\r\n_attackPower : {((ScriptableItem)val6)._itemName} : {val6._statArray._attackPower}\r\n_magicPower : {((ScriptableItem)val7)._itemName} : {val7._statArray._magicPower}\r\n_dexPower : {((ScriptableItem)val8)._itemName} : {val8._statArray._dexPower}\r\n_criticalRate : {((ScriptableItem)val9)._itemName} : {val9._statArray._criticalRate}\r\n_evasion : {((ScriptableItem)val10)._itemName} : {val10._statArray._evasion}\r\n_defense : {((ScriptableItem)val11)._itemName} : {val11._statArray._defense}\r\n_resist : {((ScriptableItem)val12)._itemName} : {val12._statArray._resist}\r\n_elementalPower : {((ScriptableItem)val13)._itemName} : {val13._statArray._elementalPower}\r\n_firePower : {((ScriptableItem)val14)._itemName} : {val14._statArray._firePower}\r\n_waterPower : {((ScriptableItem)val15)._itemName} : {val15._statArray._waterPower}\r\n_naturePower : {((ScriptableItem)val16)._itemName} : {val16._statArray._naturePower}\r\n_earthPower : {((ScriptableItem)val17)._itemName} : {val17._statArray._earthPower}\r\n_holyPower : {((ScriptableItem)val18)._itemName} : {val18._statArray._holyPower}\r\n_shadowPower : {((ScriptableItem)val19)._itemName} : {val19._statArray._shadowPower}\r\n\r\n_bonusFloorWeaponDamage : {((ScriptableItem)val20)._itemName} : {val20._bonusFloorWeaponDamage}\r\n_bonusCeilingWeaponDamage : {((ScriptableItem)val21)._itemName} : {val21._bonusCeilingWeaponDamage}\r\n```";
		}

		internal static void DumpAllScriptables()
		{
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Expected O, but got Unknown
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Expected O, but got Unknown
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Expected O, but got Unknown
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ae: Expected O, but got Unknown
			//IL_0a29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a30: Expected O, but got Unknown
			//IL_0bec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Expected O, but got Unknown
			//IL_0d82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d89: Expected O, but got Unknown
			//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eed: Expected O, but got Unknown
			//IL_0fff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1006: Expected O, but got Unknown
			//IL_11cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e4: Unknown result type (might be due to invalid IL or missing references)
			IEnumerable<ScriptableItem> enumerable = GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => !((ScriptableObject)(object)i).IsIDNegative());
			DirectoryInfo directoryInfo = HB.Location.CreateSubdirectory("Scriptable");
			File.WriteAllTextAsync(PathUtils.LongCombine(directoryInfo.FullName, "LoadedAssetsList.txt"), _loadedAssetsList.ToString());
			Dictionary<Type, DirectoryInfo> dictionary = new Dictionary<Type, DirectoryInfo>();
			dictionary.Add(typeof(ScriptableArmorDye), directoryInfo.CreateSubdirectory("ArmorDye"));
			dictionary.Add(typeof(ScriptableCape), directoryInfo.CreateSubdirectory("Cape"));
			dictionary.Add(typeof(ScriptableChestpiece), directoryInfo.CreateSubdirectory("Chestpiece"));
			dictionary.Add(typeof(ScriptableHelm), directoryInfo.CreateSubdirectory("Helm"));
			dictionary.Add(typeof(ScriptableLeggings), directoryInfo.CreateSubdirectory("Leggings"));
			dictionary.Add(typeof(ScriptableRing), directoryInfo.CreateSubdirectory("Ring"));
			dictionary.Add(typeof(ScriptableShield), directoryInfo.CreateSubdirectory("Shield"));
			dictionary.Add(typeof(ScriptableStatusConsumable), directoryInfo.CreateSubdirectory("StatusConsumable"));
			dictionary.Add(typeof(ScriptableTradeItem), directoryInfo.CreateSubdirectory("TradeItem"));
			dictionary.Add(typeof(ScriptableWeapon), directoryInfo.CreateSubdirectory("Weapon"));
			Dictionary<Type, DirectoryInfo> dictionary2 = dictionary;
			foreach (ScriptableItem item in enumerable)
			{
				try
				{
					List<string> list = new List<string>();
					Type type = ((object)item).GetType();
					if (!dictionary2.TryGetValue(type, out var value))
					{
						continue;
					}
					list.Add("- ScriptableItem -");
					list.Add("name : " + ((Object)item).name);
					list.Add("_itemName : " + item._itemName);
					list.Add("_itemDescription : " + item._itemDescription);
					list.Add($"_destroyOnDrop : {item._destroyOnDrop}");
					list.Add($"_vendorCost : {item._vendorCost}");
					list.Add($"_maxStackAmount : {item._maxStackAmount}");
					list.Add($"_itemIcon : {item._itemIcon}");
					list.Add($"_itemRarity : {item._itemRarity}");
					if (type == typeof(ScriptableTradeItem))
					{
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						continue;
					}
					if (type == typeof(ScriptableArmorDye) || type == typeof(ScriptableStatusConsumable))
					{
						ScriptableConsumable val = (ScriptableConsumable)item;
						list.Add("\n- ScriptableConsumable -");
						list.Add($"_consumableCooldown : {val._consumableCooldown}");
						list.Add($"_consumableObject : {val._consumableObject}");
						list.Add($"_useOnlyInTown : {val._useOnlyInTown}");
						list.Add($"_unperishable : {val._unperishable}");
						if (type == typeof(ScriptableStatusConsumable))
						{
							ScriptableStatusConsumable val2 = (ScriptableStatusConsumable)val;
							list.Add("\n- ScriptableStatusConsumable -");
							list.Add($"_healthApply : {val2._healthApply}");
							list.Add($"_manaApply : {val2._manaApply}");
							list.Add($"_staminaApply : {val2._staminaApply}");
							list.Add($"_expGain : {val2._expGain}");
							list.Add($"_resetSkillPoints : {val2._resetSkillPoints}");
							list.Add($"_resetAttributePoints : {val2._resetAttributePoints}");
							File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						}
						else if (type == typeof(ScriptableArmorDye))
						{
							list.Add("(Dyes are not actually unperishable in vanilla, HB sets them to be!)");
							ScriptableArmorDye val3 = (ScriptableArmorDye)val;
							list.Add("\n- ScriptableArmorDye -");
							list.Add("_particleColoration : " + ColorUtility.ToHtmlStringRGBA(val3._particleColoration));
							list.Add("_dyeParams : {");
							list.Add($"    _hue : {val3._dyeParams._hue}\r\n    _saturation : {val3._dyeParams._saturation}\r\n    _brightness : {val3._dyeParams._brightness}\r\n    _contrast : {val3._dyeParams._contrast}");
							list.Add("}");
							File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						}
						continue;
					}
					ScriptableEquipment val4 = (ScriptableEquipment)item;
					list.Add("\n- ScriptableEquipment -");
					list.Add($"_equipmentLevel : {val4._equipmentLevel}");
					list.Add($"_classRequirement : {val4._classRequirement}");
					list.Add("_statArray : {");
					list.Add($"    _maxHealth : {val4._statArray._maxHealth}\r\n    _maxMana : {val4._statArray._maxMana}\r\n    _maxStamina : {val4._statArray._maxStamina}\r\n    _experience : {val4._statArray._experience}\r\n    _attackPower : {val4._statArray._attackPower}\r\n    _magicPower : {val4._statArray._magicPower}\r\n    _dexPower : {val4._statArray._dexPower}\r\n    _criticalRate : {val4._statArray._criticalRate}\r\n    _evasion : {val4._statArray._evasion}\r\n    _defense : {val4._statArray._defense}\r\n    _resist : {val4._statArray._resist}\r\n    _elementalPower : {val4._statArray._elementalPower}\r\n    _firePower : {val4._statArray._firePower}\r\n    _waterPower : {val4._statArray._waterPower}\r\n    _naturePower : {val4._statArray._naturePower}\r\n    _earthPower : {val4._statArray._earthPower}\r\n    _holyPower : {val4._statArray._holyPower}\r\n    _shadowPower : {val4._statArray._shadowPower}");
					list.Add("}");
					if (val4._statModifierCost != null)
					{
						list.Add("_statModifierCost : {");
						list.Add($"    _scriptItem : {val4._statModifierCost._scriptItem}\r\n    _scriptItemQuantity : {val4._statModifierCost._scriptItemQuantity}");
						list.Add("}");
					}
					if (!(type == typeof(ScriptableCape)) && !(type == typeof(ScriptableChestpiece)) && !(type == typeof(ScriptableHelm)) && !(type == typeof(ScriptableLeggings)) && !(type == typeof(ScriptableRing)))
					{
						goto IL_0ece;
					}
					ScriptableArmor val5 = (ScriptableArmor)val4;
					list.Add("\n- ScriptableArmor -");
					list.Add($"_canDyeArmor : {val5._canDyeArmor}");
					list.Add("_colorAdjustParams : {");
					list.Add($"    _hue : {val5._colorAdjustParams._hue}\r\n    _saturation : {val5._colorAdjustParams._saturation}\r\n    _brightness : {val5._colorAdjustParams._brightness}\r\n    _contrast : {val5._colorAdjustParams._contrast}");
					list.Add("}");
					list.Add($"_armorTexture : {val5._armorTexture}");
					if (type == typeof(ScriptableRing))
					{
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableCape))
					{
						ScriptableCape val6 = (ScriptableCape)val5;
						list.Add("\n- ScriptableCape -");
						list.Add($"_capeMesh : {val6._capeMesh}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableChestpiece))
					{
						ScriptableChestpiece val7 = (ScriptableChestpiece)val5;
						list.Add("\n- ScriptableChestpiece -");
						list.Add($"_lockBoobs : {val7._lockBoobs}");
						list.Add($"_disableJiggleBoobBones : {val7._disableJiggleBoobBones}");
						list.Add($"_textureArms : {val7._textureArms}");
						list.Add($"_legOverlayTexture : {val7._legOverlayTexture}");
						list.Add($"_boobOverrideTexture : {val7._boobOverrideTexture}");
						list.Add($"_neckCollarMesh : {val7._neckCollarMesh}");
						list.Add($"_neckCollarTexture : {val7._neckCollarTexture}");
						list.Add($"_chestRenderDisplay : {val7._chestRenderDisplay}");
						list.Add($"_chestRenderTexture : {val7._chestRenderTexture}");
						list.Add($"_chestRenderBoobTexture : {val7._chestRenderBoobTexture}");
						list.Add($"_robeSkirtRender : {val7._robeSkirtRender}");
						list.Add($"_robeSkirtTexture : {val7._robeSkirtTexture}");
						list.Add($"_hipMeshDisplay : {val7._hipMeshDisplay}");
						list.Add($"_hipMeshTexture : {val7._hipMeshTexture}");
						list.Add($"_armCuffRender : {val7._armCuffRender}");
						list.Add($"_shoulderpadMesh : {val7._shoulderpadMesh}");
						list.Add($"_shoulderpadTexture : {val7._shoulderpadTexture}");
						list.Add($"_shoulderPadDisplayType : {val7._shoulderPadDisplayType}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableHelm))
					{
						ScriptableHelm val8 = (ScriptableHelm)val5;
						list.Add("\n- ScriptableHelm -");
						list.Add($"_blendHelmValue : {val8._blendHelmValue}");
						list.Add($"_useHelmHairDisplay : {val8._useHelmHairDisplay}");
						list.Add($"_hideEars : {val8._hideEars}");
						list.Add($"_hideMisc : {val8._hideMisc}");
						list.Add($"_isFullHelm : {val8._isFullHelm}");
						list.Add($"_helmRender : {val8._helmRender}");
						list.Add($"_helmOverrideMesh : {val8._helmOverrideMesh}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else
					{
						if (!(type == typeof(ScriptableLeggings)))
						{
							goto IL_0ece;
						}
						ScriptableLeggings val9 = (ScriptableLeggings)val5;
						list.Add("\n- ScriptableLeggings -");
						list.Add($"_textureUpperLegOnly : {val9._textureUpperLegOnly}");
						list.Add($"_textureFeet : {val9._textureFeet}");
						list.Add($"_legPieceRender_01 : {val9._legPieceRender_01}");
						list.Add($"_legPieceTexture_01 : {val9._legPieceTexture_01}");
						list.Add($"_legPieceRender_02 : {val9._legPieceRender_02}");
						list.Add($"_legPieceTexture_02 : {val9._legPieceTexture_02}");
						list.Add($"_legPieceRender_03 : {val9._legPieceRender_03}");
						list.Add($"_legPieceTexture_03 : {val9._legPieceTexture_03}");
						list.Add($"_legPieceRender_04 : {val9._legPieceRender_04}");
						list.Add($"_legPieceTexture_04 : {val9._legPieceTexture_04}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					goto end_IL_01b1;
					IL_0ece:
					if (type == typeof(ScriptableShield))
					{
						ScriptableShield val10 = (ScriptableShield)val4;
						list.Add("\n- ScriptableShield -");
						list.Add($"_shieldMesh : {val10._shieldMesh}");
						list.Add($"_shieldTexture : {val10._shieldTexture}");
						list.Add("_textureColorAdjust : {");
						list.Add($"    _hue : {val10._textureColorAdjust._hue}\r\n    _saturation : {val10._textureColorAdjust._saturation}\r\n    _brightness : {val10._textureColorAdjust._brightness}\r\n    _contrast : {val10._textureColorAdjust._contrast}");
						list.Add("}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableWeapon))
					{
						ScriptableWeapon val11 = (ScriptableWeapon)val4;
						list.Add("\n- ScriptableWeapon -");
						list.Add("weaponType : " + val11.weaponType._weaponTypeClassTag);
						if (Object.op_Implicit((Object)(object)val11._combatElement))
						{
							list.Add($"_combatElement : {val11._combatElement._elementName} - ID: {val11._combatElement._elementID}");
						}
						else
						{
							list.Add("_combatElement : None");
						}
						list.Add($"_weaponProjectileSet : {val11._weaponProjectileSet}");
						list.Add($"_bonusFloorWeaponDamage : {val11._bonusFloorWeaponDamage}");
						list.Add($"_bonusCeilingWeaponDamage : {val11._bonusCeilingWeaponDamage}");
						if (Object.op_Implicit((Object)(object)val11._weaponConditionSlot?._scriptableCondition))
						{
							list.Add("_weaponConditionSlot : {");
							list.Add($"    _scriptableCondition : {val11._weaponConditionSlot._scriptableCondition._conditionName} - ID: {val11._weaponConditionSlot._scriptableCondition._conditionID}\r\n    _chance : {val11._weaponConditionSlot._chance}\r\n    _conditionPower : {val11._weaponConditionSlot._conditionPower}\r\n    _bonusDuration : {val11._weaponConditionSlot._bonusDuration}");
							list.Add("}");
						}
						else
						{
							list.Add("_weaponConditionSlot : None");
						}
						list.Add($"weaponTexture : {val11.weaponTexture}");
						list.Add($"weaponMesh : {val11.weaponMesh}");
						list.Add("trailColors : #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[0]) + " & #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[1]));
						list.Add("_textureColorAdjust : {");
						list.Add($"    _hue : {val11._textureColorAdjust._hue}\r\n    _saturation : {val11._textureColorAdjust._saturation}\r\n    _brightness : {val11._textureColorAdjust._brightness}\r\n    _contrast : {val11._textureColorAdjust._contrast}");
						list.Add("}");
						list.Add($"_weaponTakeOutSfxIndex : {val11._weaponTakeOutSfxIndex}");
						list.Add($"_setWeaponTakeOutSfx : {val11._setWeaponTakeOutSfx}");
						list.Add($"_weaponSwingSfxIndex : {val11._weaponSwingSfxIndex}");
						list.Add($"_setWeaponSwingSfx : {val11._setWeaponSwingSfx}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					end_IL_01b1:;
				}
				catch
				{
					HB.Log("DumpAllScriptables() - Didn't manage to make a file for " + item._itemName);
					throw;
				}
			}
		}
	}
	internal static class FunStuff
	{
		internal static void Bumpscosity()
		{
			int[] array = new int[7] { 0, 1, 12, 50, 76, 100, 1000 };
			MainConfig._current._bumpscosity.Value = array[Random.Range(0, 6)];
			int value = MainConfig._current._bumpscosity.Value;
			if (value < 50)
			{
				if (value > 0)
				{
					if (value < 12)
					{
						if (value == 1)
						{
							HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a single bumpscosit. Still, it'll have to do.\n");
						}
						else
						{
							HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a few bumpscosits. Still, it'll have to do.\n");
						}
					}
					else
					{
						HB.Log("Just a light breeze of bumpscosity in here at the moment, not bad. I personally enjoy a bit more bumpscosity, but at this amount it's absolutely reasonable.\n");
					}
				}
				else
				{
					HB.Log("Dear me, where did all the bumpscosity go? Quite unnerving in here with all of it gone.\n");
				}
			}
			else if (value < 100)
			{
				if (value < 76)
				{
					HB.Log("Ahh, quite a pleasant amount of bumpscosity we've got today, wouldn't you say? Very enjoyable.\n");
				}
				else
				{
					HB.Log("Well, the bumpscosity in here is really getting up there, isn't it?\nNo matter, the story must carry on no matter how much or how little bumpscosity there is.\n");
				}
			}
			else if (value < 1000)
			{
				HB.Log("Who turned up the bumpscosity so high?\nI like bumpscosity as much as the next person, but a hundred is quite a lot, wouldn't you say?\n");
			}
			else
			{
				HB.Log("My god, the bumpscosity in here is absolutely overwhelming.\nA thousand?! You people have got to be nuts!\nHow can you stand this much bumpscosity?\n");
			}
		}
	}
	[BepInPlugin("Homebrewery", "Homebrewery", "4.7.43")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BepInExPlugin : BaseUnityPlugin
	{
		public BepInExPlugin()
		{
			HB._dll = new FileInfo(((BaseUnityPlugin)this).Info.Location);
			HB._logger = ((BaseUnityPlugin)this).Logger;
		}

		public void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			HB._homebreweryGameObject = new GameObject("Homebrewery-GameObject");
			Object.DontDestroyOnLoad((Object)(object)HB._homebreweryGameObject);
			HB._self = HB._homebreweryGameObject.AddComponent<HB>();
		}
	}
	public class HB : MonoBehaviour
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static MemoryUsageChangedCallback <>9__46_0;

			public static Func<Mesh, bool> <>9__61_0;

			public static Func<Mesh, bool> <>9__61_1;

			public static Func<Mesh, bool> <>9__61_2;

			public static Func<Mesh, bool> <>9__61_3;

			public static Func<Mesh, bool> <>9__61_4;

			public static Func<Mesh, bool> <>9__61_5;

			public static Func<Mesh, bool> <>9__61_6;

			public static Func<Mesh, bool> <>9__61_7;

			public static Func<Mesh, bool> <>9__61_8;

			public static Func<Mesh, bool> <>9__61_9;

			public static Func<Mesh, bool> <>9__61_10;

			public static Func<Mesh, bool> <>9__61_11;

			public static Func<Mesh, bool> <>9__61_12;

			public static Func<Mesh, bool> <>9__61_13;

			public static Func<Mesh, bool> <>9__61_14;

			public static Func<GameObject, bool> <>9__61_15;

			internal void <Awake>b__46_0(in ApplicationMemoryUsageChange newUsage)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected I4, but got Unknown
				Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage);
			}

			internal bool <LoadVanillaAssets>b__61_0(Mesh m)
			{
				return ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_1(Mesh m)
			{
				return ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_2(Mesh m)
			{
				return ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_3(Mesh m)
			{
				return ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_4(Mesh m)
			{
				return ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_5(Mesh m)
			{
				return ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_6(Mesh m)
			{
				return ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_7(Mesh m)
			{
				return ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_8(Mesh m)
			{
				return ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_9(Mesh m)
			{
				return ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_10(Mesh m)
			{
				return ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_11(Mesh m)
			{
				return ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_12(Mesh m)
			{
				return ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_13(Mesh m)
			{
				return ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_14(Mesh m)
			{
				return ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__61_15(GameObject c)
			{
				if (!((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase))
				{
					return ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase);
				}
				return true;
			}
		}

		internal static HB _self = null;

		internal static GameObject _homebreweryGameObject = null;

		internal static FileInfo _dll = null;

		internal static ManualLogSource _logger = null;

		private readonly Stopwatch _stopwatch = Stopwatch.StartNew();

		internal static DirectoryInfo _configHomebrewery = null;

		internal static DirectoryInfo _limitCfgsFolder = null;

		internal static int _bepinPathLength;

		private readonly Harmony _harmony = new Harmony("Homebrewery");

		public const StringComparison ORD = StringComparison.OrdinalIgnoreCase;

		internal static bool _isManualInstall;

		private static DirectoryInfo? _location;

		private static DirectoryInfo? _internal;

		internal static Dictionary<RaceType, RaceStruct> _raceStructs = new Dictionary<RaceType, RaceStruct>();

		internal static ScriptablePlayerRace _playerRace_imp = null;

		internal static ScriptablePlayerRace _playerRace_poon = null;

		internal static ScriptablePlayerRace _playerRace_kubold = null;

		internal static ScriptablePlayerRace _playerRace_byrdle = null;

		internal static ScriptablePlayerRace _playerRace_chang = null;

		internal static bool _hotkeysOn = true;

		public static readonly int UpdateCount = 11;

		internal const string UPDATE_STRING = "Thank you for using Homebrewery 4.7.43!\r\n\r\nI finally got around to reimplementing this once per update message.\r\n\r\nNow I can bother you with some random note about whatever this update even added... which is a lot more than I can really put here without it being a bit silly looking, so maybe not.\r\n\r\nUse Ctrl+P in-game to open HB Phone!\r\n(Has shortcuts to storage, portal and Vanity Mirror UIs)\r\n\r\nFind Skrit behind Sally's shop for custom items!\r\n(Option won't show the first time you speak to him)\r\n\r\nCustom parts are added to character customisation!\r\n(You can edit your character with the Vanity Mirror UI)\r\n\r\nUse \"/hb wiki cmd\" to open the chat commands info page!\r\n\r\nCaution: Place custom items into storage at your own risk!";

		internal static bool _shownUpdateMessage;

		public static readonly Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>();

		public static readonly Dictionary<string, GameObject> ConsumableObjects = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase);

		internal static float _foodLevel;

		internal static Shader _unlitColorAdjustCutout = null;

		internal static PlayerRaceModel[] _menuRaceModels = Array.Empty<PlayerRaceModel>();

		internal static PlayerRaceModel[] _inventoryRaceModels = Array.Empty<PlayerRaceModel>();

		internal static GameObject? _glbStorage;

		private static bool _awakeCompleted;

		private bool _chatIsKill;

		internal static int _byrdleVanillaHairsCount;

		internal static int _byrdleVanillaBeaksCount;

		internal static int _nudge;

		internal static DirectoryInfo Location
		{
			get
			{
				return _location ?? throw new InvalidOperationException("Location wasn't initialised!");
			}
			set
			{
				_location = value;
			}
		}

		internal static DirectoryInfo Internal
		{
			get
			{
				return _internal ?? throw new InvalidOperationException("Internal wasn't initialised!");
			}
			set
			{
				_internal = value;
			}
		}

		internal static List<TexReplace> _texReplacements => TexReplacer._texReplacements;

		internal static Dictionary<uint, Player> _players => CT._players;

		public static GameManager GM => GameManager._current.L<GameManager>() ?? throw new InvalidOperationException("Tried to use GameManager._current before it was ready!");

		internal static bool FolderCheck(DirectoryInfo dir)
		{
			DateTime lastAccessTime = dir.LastAccessTime;
			DateTime lastWriteTime = dir.LastWriteTime;
			dir.Refresh();
			if (dir.Exists)
			{
				if (!(lastAccessTime < dir.LastAccessTime))
				{
					return lastWriteTime < dir.LastWriteTime;
				}
				return true;
			}
			return false;
		}

		public static void Log(object? thing = null, int level = 0)
		{
			if (Object.op_Implicit((Object)(object)MainConfig._current) && MainConfig._current._logLevel.Value == -1)
			{
				return;
			}
			if (thing == null)
			{
				_logger.LogError((object)"Logged a null, nice one.");
				return;
			}
			switch (level)
			{
			case 1:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 1)
				{
					_logger.LogDebug(thing);
				}
				break;
			case 2:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 2)
				{
					_logger.LogMessage(thing);
				}
				break;
			case 3:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 3)
				{
					_logger.LogWarning((object)$"{thing}\n");
				}
				break;
			case 4:
				_logger.LogError((object)$"{thing}\n");
				break;
			default:
				_logger.LogInfo(thing);
				break;
			}
		}

		private static void TryMoveFile(string source, string destination)
		{
			if (File.Exists(source) && !File.Exists(destination))
			{
				File.Move(source, destination);
			}
		}

		private static void ConfigMover()
		{
			_configHomebrewery = Directory.CreateDirectory(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery"));
			_limitCfgsFolder = Directory.CreateDirectory(PathUtils.LongCombine(_configHomebrewery.FullName, "LimitCFGs"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "Homebrewery.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HB_JiggleSettings.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "JiggleSettings.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_OthersLimits.cfg"));
			if (Directory.Exists(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")) && !Directory.EnumerateFileSystemEntries(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")).Any())
			{
				Directory.Delete(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs"));
			}
		}

		private void Awake()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2);
			_self = this;
			object obj = <>c.<>9__46_0;
			if (obj == null)
			{
				MemoryUsageChangedCallback val = delegate(in ApplicationMemoryUsageChange newUsage)
				{
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_0016: Unknown result type (might be due to invalid IL or missing references)
					//IL_0020: Expected I4, but got Unknown
					Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage);
				};
				<>c.<>9__46_0 = val;
				obj = (object)val;
			}
			Application.memoryUsageChanged += (MemoryUsageChangedCallback)obj;
			_glbStorage = new GameObject("GLTFContainer");
			_glbStorage.transform.parent = _homebreweryGameObject.transform;
			_glbStorage.SetActive(false);
			ConfigMover();
			ConfigManager._current = _homebreweryGameObject.AddComponent<ConfigManager>();
			CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
			Log($"Waking up at {DateTime.UtcNow:yyyy-MM-dd h:mm:ss tt} UTC... Game Version is: {Application.version}");
			_bepinPathLength = PathUtils.LongCombine(Paths.BepInExRootPath).Length;
			if (!Application.version.Equals("62026.a1", StringComparison.OrdinalIgnoreCase))
			{
				Log("This version of Homebrewery was made for game version '62026.a1', so be wary of issues arising due to game changes!", 3);
			}
			FunStuff.Bumpscosity();
			Log($"AtlyssGLTF available: {AtlyssGLTF.Available}.");
			if (MainConfig._current._ignoreAtlyssGLTF.Value)
			{
				Log("'Ignore AtylssGLTF' debug setting is on! - Homebrewery will not import any GLB files!", 4);
			}
			Location = _dll.Directory;
			if (Location.Name.Equals("plugins", StringComparison.OrdinalIgnoreCase))
			{
				Log("[InstallError] Homebrewery is not installed correctly! The DLL should not be directly in the BepInEx/plugins folder - Leave it inside its 'Catman232-Homebrewery' folder!", 4);
				Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
				return;
			}
			if (Directory.Exists(PathUtils.LongCombine(Location.FullName, "plugins")))
			{
				_isManualInstall = true;
			}
			Internal = (_isManualInstall ? new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "Internal")) : new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "Internal")));
			TexReplacer._folder = (_isManualInstall ? new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "TextureReplace")) : new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "TextureReplace")));
			if (!Internal.Exists)
			{
				Log("[InstallError] Internal folder could not be found! Something is wrong with your mod installation!", 4);
				Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
				return;
			}
			TextureFile.BlitBleedSetup();
			Log("Calling _harmony.PatchAll");
			_harmony.PatchAll(Assembly.GetExecutingAssembly());
			TexReplacer.Go();
			Log("Loading Vanilla assets!", 2);
			LoadVanillaAssets();
			if (MainConfig._current._spreadVanillaParts.Value)
			{
				HairPartFolder.SetupVanillaHairParts();
				MiscPartFolder.SetupVanillaMiscParts();
				TailPartFolder.SetupVanillaTailParts();
				EarsPartFolder.SetupVanillaEarsParts();
			}
			if (MainConfig._current._unarmedDiveJump.Value && WeaponItemFolder._weaponTypes.TryGetValue("Unarmed", out ScriptableWeaponType value))
			{
				WeaponTypeCombatParams val2 = value._weaponData._weaponTypeCombatParams[0];
				val2._allowJumpAttack = true;
				val2._timeBeforeJumpAttack = 0.08f;
				val2._JumpAttackJumpForce = 50f;
				val2._JumpAttackFowardForce = 90f;
				val2._JumpAttackJumpGravityMultiply = 50f;
				val2._jumpLandDelayTime = 0.5f;
			}
			Cond.IDSet();
			Log("Making Internal Sprites!", 2);
			string[] array = new string[13]
			{
				"based", "Nokia_3310", "BrokenDye", "joker", "VanityIco", "PortalIco", "ExitIco", "ForwardIco", "BackIco", "NextIco",
				"PreviousIco", "StorageIco", "DungeonIco"
			};
			string[] array2 = array;
			foreach (string text in array2)
			{
				Sprites.Add(text, MakeSprite(Internal.FullName, text));
			}
			MainThreadJobber._jobber = _homebreweryGameObject.AddComponent<MainThreadJobber>();
			MeshObjManager._current = _homebreweryGameObject.AddComponent<MeshObjManager>();
			if (MainConfig._current._noFileSystemWatcher.Value)
			{
				Log("'No FileSystemWatcher' is True, automatic file reloading will not work! (This is fine if you don't need this feature)", 3);
			}
			else
			{
				Log("'No FileSystemWatcher' is False, this may add a dozen seconds to the load time, but automatic file reloading should be functional!", 3);
			}
			ContentLoader._current = _homebreweryGameObject.AddComponent<ContentLoader>();
			Log("Registering chat commands!");
			Cmd.RegisterCommands();
			if (CT.Enabled)
			{
				CT.RegisterListeners();
			}
			_awakeCompleted = true;
			Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
		}

		internal static async Task Cache_HBScriptableAssets()
		{
			if (!_awakeCompleted)
			{
				Log("HB.Awake() did not complete, skipping Cache_HBScriptableAssets()!", 4);
				return;
			}
			Log("Cache_HBScriptableAssets()", 1);
			if (GM._cachedScriptableConditions.TryGetValue(0, out var value))
			{
				ScriptableStatusCondition val = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val != null)
				{
					Cond._bleed = val;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(2, out value))
			{
				ScriptableStatusCondition val2 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val2 != null)
				{
					Cond._cold = val2;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(1, out value))
			{
				ScriptableStatusCondition val3 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val3 != null)
				{
					Cond._burn = val3;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(8, out value))
			{
				ScriptableStatusCondition val4 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val4 != null)
				{
					Cond._poison = val4;
				}
			}
			if (Object.op_Implicit((Object)(object)ContentLoader._current))
			{
				ModelAliases();
				await ContentLoader._current.InitAllItems().ConfigureAwait(continueOnCapturedContext: true);
				MouthPartFolder.ByrdleBeaksAndMouths();
			}
			if (MainConfig._current._spreadVanillaParts.Value)
			{
				Log("Sharing Vanilla parts around!");
				Log("Sharing Vanilla parts to Byrdle!", 1);
				PartSpreader(_raceStructs[RaceType.Byrdle]);
				Log("Sharing Vanilla parts to Chang!", 1);
				PartSpreader(_raceStructs[RaceType.Chang]);
				Log("Sharing Vanilla parts to Imp!", 1);
				PartSpreader(_raceStructs[RaceType.Imp]);
				Log("Sharing Vanilla parts to Kubold!", 1);
				PartSpreader(_raceStructs[RaceType.Kubold]);
				Log("Sharing Vanilla parts to Poon!", 1);
				PartSpreader(_raceStructs[RaceType.Poon]);
			}
			Log("Generating a shop source for some vanilla items!", 2);
			GetVanillaItems();
			Phone._current = _homebreweryGameObject.AddComponent<Phone>();
		}

		internal static void ModelAliases()
		{
			string[][] array = new string[12][]
			{
				new string[2] { "hood", "hood01" },
				new string[2] { "robeSkirt", "robeSkirt01" },
				new string[2] { "armCuffs_00", "armCuff01" },
				new string[2] { "armCuffs_01", "armCuff02" },
				new string[2] { "armCuffs_02", "armCuff03" },
				new string[2] { "chestMesh_00", "chestpiece03" },
				new string[2] { "hipMesh_00", "legPads03" },
				new string[2] { "legCuffs_00", "legCuffs03" },
				new string[2] { "legCuffs_01", "shinPads01" },
				new string[2] { "chestTabard_00", "chestTabard02" },
				new string[2] { "chestTabard_01", "chestTabard03" },
				new string[2] { "belt_00", "beltSash02" }
			};
			string[][] array2 = array;
			foreach (string[] array3 in array2)
			{
				ArmorRenderFile.CreateAlias(array3[0], array3[1]);
			}
			string[][] array4 = new string[5][]
			{
				new string[2] { "_collar_00", "vikingArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-warlockArmor_collar", "warlockArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-thiefArmor_collar", "thiefArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-mysticArmor_collar", "mysticArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-maidArmor_collar", "maidArmor_collar" }
			};
			string[][] array5 = array4;
			foreach (string[] array6 in array5)
			{
				MeshObj.CreateAlias(array6[0], array6[1]);
			}
		}

		internal static void WeaponTypeAliases()
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>
			{
				["Katars"] = "Dexterity_Melee_2H",
				["Scepter"] = "Mind_Ranged_1H",
				["Bell"] = "Mind_Ranged_2H",
				["Blade"] = "Sword",
				["Sword"] = "Strength_Melee_1H0",
				["Mace"] = "Strength_Melee_1H1",
				["Bow"] = "Dexterity_Ranged_2H0",
				["Shotgun"] = "Dexterity_Ranged_2H1",
				["Hammer"] = "Strength_Melee_2H0",
				["Greatblade"] = "Strength_Melee_2H1",
				["Polearm"] = "Strength_Melee_2H2"
			};
			foreach (var (key, key2) in dictionary)
			{
				if (WeaponItemFolder._weaponTypes.TryGetValue(key, out ScriptableWeaponType value))
				{
					WeaponItemFolder._weaponTypes[key2] = value;
				}
			}
		}

		private static void PartSpreader(RaceStruct thisrace)
		{
			foreach (RaceStruct value in _raceStructs.Values)
			{
				if (value._type == thisrace._type)
				{
					continue;
				}
				int num = 0;
				EyeTextureGroup[] eyes = value._eyes;
				foreach (EyeTextureGroup val in eyes)
				{
					int index = thisrace._scriptRace._eyeTextures.Length + num;
					string name = $"Atlyss-Eyes-{value._scriptRace._raceName}{num}";
					num++;
					EyesPartFolder._dictionary.AddName(thisrace._type, name, index);
				}
				ScriptablePlayerRace scriptRace = thisrace._scriptRace;
				EyeTextureGroup[] eyeTextures = thisrace._scriptRace._eyeTextures;
				EyeTextureGroup[] eyes2 = value._eyes;
				int num2 = 0;
				EyeTextureGroup[] array = (EyeTextureGroup[])(object)new EyeTextureGroup[eyeTextures.Length + eyes2.Length];
				ReadOnlySpan<EyeTextureGroup> readOnlySpan = new ReadOnlySpan<EyeTextureGroup>(eyeTextures);
				readOnlySpan.CopyTo(new Span<EyeTextureGroup>(array).Slice(num2, readOnlySpan.Length));
				num2 += readOnlySpan.Length;
				ReadOnlySpan<EyeTextureGroup> readOnlySpan2 = new ReadOnlySpan<EyeTextureGroup>(eyes2);
				readOnlySpan2.CopyTo(new Span<EyeTextureGroup>(array).Slice(num2, readOnlySpan2.Length));
				num2 += readOnlySpan2.Length;
				scriptRace._eyeTextures = array;
				num = 0;
				if (thisrace._type != RaceType.Kubold)
				{
					MouthTextureGroup[] mouth = value._mouth;
					foreach (MouthTextureGroup val2 in mouth)
					{
						int index = thisrace._scriptRace._mouthTextures.Length + num;
						string name2 = $"Atlyss-Mouth-{value._scriptRace._raceName}{num}";
						num++;
						MouthPartFolder._dictionary.AddName(thisrace._type, name2, index);
					}
					ScriptablePlayerRace scriptRace2 = thisrace._scriptRace;
					MouthTextureGroup[] mouthTextures = thisrace._scriptRace._mouthTextures;
					MouthTextureGroup[] mouth2 = value._mouth;
					num2 = 0;
					MouthTextureGroup[] array2 = (MouthTextureGroup[])(object)new MouthTextureGroup[mouthTextures.Length + mouth2.Length];
					ReadOnlySpan<MouthTextureGroup> readOnlySpan3 = new ReadOnlySpan<MouthTextureGroup>(mouthTextures);
					readOnlySpan3.CopyTo(new Span<MouthTextureGroup>(array2).Slice(num2, readOnlySpan3.Length));
					num2 += readOnlySpan3.Length;
					ReadOnlySpan<MouthTextureGroup> readOnlySpan4 = new ReadOnlySpan<MouthTextureGroup>(mouth2);
					readOnlySpan4.CopyTo(new Span<MouthTextureGroup>(array2).Slice(num2, readOnlySpan4.Length));
					num2 += readOnlySpan4.Length;
					scriptRace2._mouthTextures = array2;
				}
				num = 0;
				SkinTextureGroup[] skins = value._skins;
				foreach (SkinTextureGroup val3 in skins)
				{
					int index = thisrace._scriptRace._skinTextureGroups.Length + num;
					string name3 = $"Atlyss-Skin-{value._scriptRace._raceName}{num}";
					num++;
					SkinPartFolder._dictionary.AddName(thisrace._type, name3, index);
				}
				ScriptablePlayerRace scriptRace3 = thisrace._scriptRace;
				SkinTextureGroup[] skinTextureGroups = thisrace._scriptRace._skinTextureGroups;
				SkinTextureGroup[] skins2 = value._skins;
				num2 = 0;
				SkinTextureGroup[] array3 = (SkinTextureGroup[])(object)new SkinTextureGroup[skinTextureGroups.Length + skins2.Length];
				ReadOnlySpan<SkinTextureGroup> readOnlySpan5 = new ReadOnlySpan<SkinTextureGroup>(skinTextureGroups);
				readOnlySpan5.CopyTo(new Span<SkinTextureGroup>(array3).Slice(num2, readOnlySpan5.Length));
				num2 += readOnlySpan5.Length;
				ReadOnlySpan<SkinTextureGroup> readOnlySpan6 = new ReadOnlySpan<SkinTextureGroup>(skins2);
				readOnlySpan6.CopyTo(new Span<SkinTextureGroup>(array3).Slice(num2, readOnlySpan6.Length));
				num2 += readOnlySpan6.Length;
				scriptRace3._skinTextureGroups = array3;
			}
		}

		private static void GetVanillaItems()
		{
			ContentPack._atylssItself.RegenerateID();
			(string, int)[] array = new(string, int)[13]
			{
				("Red Dye", 1),
				("Orange Dye", 2),
				("Lime Dye", 3),
				("Green Dye", 4),
				("Blue Dye", 5),
				("Cyan Dye", 6),
				("Yellow Dye", 7),
				("Brown Dye", 8),
				("Pink Dye", 9),
				("Purple Dye", 10),
				("White Dye", 11),
				("Grey Dye", 12),
				("Black Dye", 13)
			};
			(string, int)[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				var (key, sortIndex) = array2[i];
				if (GM._cachedScriptableItems.TryGetValue(key, out var value))
				{
					ScriptableArmorDye val = (ScriptableArmorDye)(object)((value is ScriptableArmorDye) ? value : null);
					if (val != null)
					{
						((ScriptableConsumable)val)._unperishable = true;
					}
					ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value, sortIndex, ItemClass.Dye));
				}
			}
			string[] array3 = new string[5] { "Necro Marrow", "Leather Top", "Sagecloth Top", "Aero Top", "Nutso Top" };
			string[] array4 = array3;
			foreach (string key2 in array4)
			{
				if (GM._cachedScriptableItems.TryGetValue(key2, out var value2))
				{
					ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value2, 0, ItemClass.Chestpiece));
				}
			}
			array3 = new string[5] { "Necro Caustics", "Leather Britches", "Sagecloth Shorts", "Aero Pants", "Nutso Pants" };
			string[] array5 = array3;
			foreach (string key3 in array5)
			{
				if (GM._cachedScriptableItems.TryGetValue(key3, out var value3))
				{
					ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value3, 0, ItemClass.Leggings));
				}
			}
			ContentPack._atylssItself.SortItems(SortType.BySortIndexThenName);
		}

		private static Sprite MakeSprite(string path, string name)
		{
			//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_0089: 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_00aa: Expected O, but got Unknown
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			string text = PathUtils.LongCombine(path, name + ".png");
			byte[] array = Array.Empty<byte>();
			if (!File.Exists(text))
			{
				string text2 = text;
				int bepinPathLength = _bepinPathLength;
				Log("[InternalFileMissing] Could not find the file: \"" + text2.Substring(bepinPathLength, text2.Length - bepinPathLength) + "\"", 4);
			}
			else
			{
				array = File.ReadAllBytes(text);
			}
			Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false)
			{
				name = name + "_Tex",
				anisoLevel = 16,
				filterMode = (FilterMode)MainConfig._current._filterMode.Value,
				mipMapBias = 0f
			};
			ImageConversion.LoadImage(val, array, true);
			Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			((Object)val2).name = name + "_Spr";
			return val2;
		}

		private void Update()
		{
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Invalid comparison between Unknown and I4
			if (Input.GetKey((KeyCode)308) && Input.GetKeyUp((KeyCode)120))
			{
				_hotkeysOn = !_hotkeysOn;
				Log($"Toggled hotkeysOn to {_hotkeysOn}");
			}
			if (!_chatIsKill)
			{
				try
				{
					SlashShortcut();
				}
				catch (Exception ex) when (((ex is MissingFieldException || ex is NullReferenceException) ? 1 : 0) != 0)
				{
					_chatIsKill = true;
					Log("SlashShortcut experienced a MissingField or NullRef Exception! Not trying again.", 4);
				}
			}
			if (!_hotkeysOn)
			{
				return;
			}
			bool flag = CheckMainPlayer() && !Player._mainPlayer._inChat && !Player._mainPlayer._inUI;
			if (!flag && Input.GetKeyDown((KeyCode)114))
			{
				_ = Controls._anyCtrl;
			}
			if (flag)
			{
				if (!_shownUpdateMessage)
				{
					_shownUpdateMessage = true;
					if (!MainConfig._current._alwaysShowUpdateMsg.Value)
					{
						MainConfig._current._updateMessage.Value = UpdateCount;
					}
				}
				_foodLevel -= Time.deltaTime / MainConfig._current._foodDigestRate.Value;
				if (_foodLevel < 0f)
				{
					_foodLevel = 0f;
				}
			}
			MainMenuManager? obj = MainMenuManager._current.L<MainMenuManager>();
			if (obj != null && (int)obj._mainMenuCondition == 1 && (Object)(object)MainMenuManager._current._characterSelectManager.L<CharacterSelectManager>()?._setRaceModelED.L<RaceModelEquipDisplay>()?._playerRaceModel != (Object)null && !Controls._anyCtrl)
			{
				if (Input.GetKeyUp((KeyCode)119))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)1, 2f);
				}
				if (Input.GetKeyUp((KeyCode)115))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)2, 2f);
				}
				if (Input.GetKeyUp((KeyCode)97))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)3, 2f);
				}
				if (Input.GetKeyUp((KeyCode)100))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)4, 2f);
				}
				if (Input.GetKeyUp((KeyCode)101))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)8, 2f);
				}
				if (Input.GetKeyUp((KeyCode)113))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)7, 2f);
				}
				if (Input.GetKeyUp((KeyCode)114))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)5, 2f);
				}
				if (Input.GetKeyUp((KeyCode)102))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_MouthCondition((MouthCondition)1, 2f);
				}
			}
		}

		private void SlashShortcut()
		{
			if (MainConfig._current._slashShortcut.Value && Object.op_Implicit((Object)(object)Player._mainPlayer) && !Player._mainPlayer._bufferingStatus && !HostConsole._current._isOpen && !DialogManager._current._isDialogEnabled && !SettingsManager._current._isOpen && !ChatBehaviour._current._focusedInChat && ChatBehaviour._current._inputBuffer == 0f && Input.GetKeyDown((KeyCode)47))
			{
				if (Object.op_Implicit((Object)(object)ChatBehaviour._current._focusInputSfx))
				{
					ChatBehaviour._current.aSrc.PlayOneShot(ChatBehaviour._current._focusInputSfx, 0.55f);
				}
				ChatBehaviour._current._chatAssets._chatInput.ActivateInputField();
				ChatBehaviour._current._focusedInChat = true;
				ChatBehaviour._current._inputBuffer = 0.12f;
				((MonoBehaviour)this).StartCoroutine(AddSlash());
			}
		}

		private static IEnumerator AddSlash()
		{
			yield return null;
			ChatBehaviour._current._chatAssets._chatInput.text = "/";
			ChatBehaviour._current._chatAssets._chatInput.MoveTextEnd(false);
		}

		[DebuggerNonUserCode]
		internal static void DropMe(string item, int n = 1)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0063: Expected O, but got Unknown
			if (!Cmd.ItemMatcher(item, out ScriptableItem firstmatch))
			{
				Log(item + " is not a real item!", 3);
				return;
			}
			GameManager._current.Client_SpawnLocalItemObject(new ItemData
			{
				_itemName = firstmatch._itemName,
				_quantity = n
			}, ((NetworkBehaviour)Player._mainPlayer).netIdentity, ((Component)Player._mainPlayer).transform.position, 0, ((Component)Player._mainPlayer).transform, true);
		}

		internal static void LoadVanillaAssets()
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Expected O, but got Unknown
			//IL_0152: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			_playerRace_imp = Resources.Load<ScriptablePlayerRace>("_race/01_race_imp/playerrace_imp");
			_playerRace_poon = Resources.Load<ScriptablePlayerRace>("_race/02_race_poon/playerrace_poon");
			_playerRace_kubold = Resources.Load<ScriptablePlayerRace>("_race/03_race_kubold/playerrace_kubold");
			_playerRace_byrdle = Resources.Load<ScriptablePlayerRace>("_race/04_race_byrdle/playerrace_byrdle");
			_playerRace_chang = Resources.Load<ScriptablePlayerRace>("_race/05_race_chang/playerrace_chang");
			_byrdleVanillaHairsCount = _playerRace_byrdle._hairStyleMeshes.Length;
			_raceStructs.Add(RaceType.Imp, new RaceStruct(RaceType.Imp, _playerRace_imp, _playerRace_imp._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Poon, new RaceStruct(RaceType.Poon, _playerRace_poon, _playerRace_poon._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Kubold, new RaceStruct(RaceType.Kubold, _playerRace_kubold, _playerRace_kubold._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Chang, new RaceStruct(RaceType.Chang, _playerRace_chang, _playerRace_chang._raceModel.GetComponent<PlayerRaceModel>()));
			_playerRace_byrdle._disableEarSelector = false;
			_playerRace_byrdle._disableMouthSelector = false;
			MouthTextureGroup val = new MouthTextureGroup
			{
				_closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02"),
				_open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02")
			};
			MouthTextureGroup val2 = new MouthTextureGroup
			{
				_closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01"),
				_open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01")
			};
			MouthTextureGroup val3 = new MouthTextureGroup
			{
				_closed = (Texture)(object)Texture2D.blackTexture,
				_open = (Texture)(object)Texture2D.blackTexture
			};
			MouthTextureGroup val4 = new MouthTextureGroup
			{
				_closed = null,
				_open = null
			};
			_playerRace_byrdle._mouthTextures = Array.Empty<MouthTextureGroup>();
			_raceStructs.Add(RaceType.Byrdle, new RaceStruct(RaceType.Byrdle, _playerRace_byrdle, _playerRace_byrdle._raceModel.GetComponent<PlayerRaceModel>()));
			_byrdleVanillaBeaksCount = _raceStructs[RaceType.Byrdle]._miscSkinned.Length;
			_playerRace_byrdle._mouthTextures = (MouthTextureGroup[])(object)new MouthTextureGroup[4] { val4, val, val2, val3 };
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "UseBeak'sTextureIfAny", 0);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_02", 1);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_01", 2);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Catman-Homebrewery-Byrdle-Mouth-hbInvisBeak", 3);
			_unlitColorAdjustCutout = Resources.Load<Shader>("_graphic/_shader/unlit_coloradjust_cutout");
			List<Mesh> list = new List<Mesh>();
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_collars"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_shoulderpads/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_helms/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_capes/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/03_shield/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/"));
			IEnumerable<Mesh> enumerable = new <>z__ReadOnlyList<Mesh>(list);
			Mesh[] array = Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/weapon_models");
			foreach (Mesh val5 in array)
			{
				Resources.UnloadAsset((Object)(object)val5);
			}
			if (!enumerable.Any())
			{
				Log("No vanilla Gear Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("Gear Meshes:");
				foreach (Mesh item in enumerable)
				{
					if (!((Object)(object)item == (Object)null) && MeshObj.StashVanillaMesh(item, out string meshname))
					{
						DataExtractor._loadedAssetsList.AppendLine(meshname);
					}
				}
			}
			List<Mesh> list2 = new List<Mesh>();
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_chang/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_hairstyles/"));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mouth/mouthenemy_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mouth/mouthenemy_alt00_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/rukkah/ruko_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/sally/sally_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/sallyworkers/_sallyworker_00/_sallyworker_00")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/vivian/vivi_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase))));
			IEnumerable<Mesh> enumerable2 = new <>z__ReadOnlyList<Mesh>(list2);
			if (!enumerable2.Any())
			{
				Log("No vanilla Hair Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nHair Meshes:");
				foreach (Mesh item2 in enumerable2)
				{
					if (!((Object)(object)item2 == (Object)null) && MeshObj.StashVanillaMesh(item2, out string meshname2))
					{
						DataExtractor._loadedAssetsList.AppendLine(meshname2);
					}
				}
			}
			Mesh[] array2 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_horns/");
			Mesh[] array3 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_horns/");
			Mesh[] array4 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_horns/");
			int num = 0;
			Mesh[] array5 = (Mesh[])(object)new Mesh[8 + (array2.Length + array3.Length + array4.Length)];
			ReadOnlySpan<Mesh> readOnlySpan = new ReadOnlySpan<Mesh>(array2);
			readOnlySpan.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan.Length));
			num += readOnlySpan.Length;
			ReadOnlySpan<Mesh> readOnlySpan2 = new ReadOnlySpan<Mesh>(array3);
			readOnlySpan2.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan2.Length));
			num += readOnlySpan2.Length;
			ReadOnlySpan<Mesh> readOnlySpan3 = new ReadOnlySpan<Mesh>(array4);
			readOnlySpan3.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan3.Length));
			num += readOnlySpan3.Length;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/lordboar/lordboar")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mekboar/mekboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/moth/mothcreep_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/rageboar/rageboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/warboar/warboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/wizboar/wizboar")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/enok/enok_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase)));
			IEnumerable<Mesh> enumerable3 = new <>z__ReadOnlyArray<Mesh>(array5);
			if (!enumerable3.Any())
			{
				Log("No vanilla Static Misc Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nStatic Misc Meshes:");
				foreach (Mesh item3 in enumerable3)
				{
					if (!((Object)(object)item3 == (Object)null) && MeshObj.StashVanillaMesh(item3, out string meshname3))
					{
						DataExtractor._loadedAssetsList.AppendLine(meshname3);
					}
				}
			}
			IEnumerable<ScriptableArmorRender> enumerable4 = new <>z__ReadOnlyArray<ScriptableArmorRender>(Resources.LoadAll<ScriptableArmorRender>("_graphic/_mesh/00_player/player_meshes/_armormeshes").ToArray());
			if (!enumerable4.Any())
			{
				Log("No vanilla ScriptableArmorRenders loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nArmorRenders:");
				foreach (ScriptableArmorRender item4 in enumerable4)
				{
					if (!((Object)(object)item4 == (Object)null) && ArmorRenderFile.StashVanillaArmorRender(item4, out string name))
					{
						DataExtractor._loadedAssetsList.AppendLine(name);
					}
				}
			}
			IEnumerable<ScriptableWeaponType> enumerable5 = new <>z__ReadOnlyArray<ScriptableWeaponType>(Resources.LoadAll<ScriptableWeaponType>("_weapontype/").ToArray());
			if (!enumerable5.Any())
			{
				Log("No ScriptableWeaponTypes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nWeaponTypes:");
				foreach (ScriptableWeaponType item5 in enumerable5)
				{
					if (!((Object)(object)item5 == (Object)null))
					{
						WeaponItemFolder._weaponTypes[item5._weaponTypeClassTag] = item5;
						DataExtractor._loadedAssetsList.AppendLine(item5._weaponTypeClassTag);
					}
				}
				WeaponTypeAliases();
			}
			List<ScriptableWeaponProjectileSet> list3 = new List<ScriptableWeaponProjectileSet>();
			list3.AddRange(Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/01_dexterity/00_rangeweapon_projectilesets/"));
			list3.AddRange(Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/01_dexterity/00_shotgunprojectiles/"));
			list3.AddRange(Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/02_mind/scepterprojectilesets/"));
			list3.AddRange(Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/02_mind/bell_projectilesets/"));
			IEnumerable<ScriptableWeaponProjectileSet> enumerable6 = new <>z__ReadOnlyList<ScriptableWeaponProjectileSet>(list3);
			if (!enumerable6.Any())
			{
				Log("No ScriptableWeaponProjectileSets loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nProjectileSets:");
				foreach (ScriptableWeaponProjectileSet item6 in enumerable6)
				{
					if (!((Object)(object)item6 == (Object)null))
					{
						string text = ((Object)item6).name.Replace("weaponProjectileSet_", string.Empty, StringComparison.OrdinalIgnoreCase);
						WeaponItemFolder._projectileSets[text] = item6;
						DataExtractor._loadedAssetsList.AppendLine(text);
					}
				}
			}
			ConsumableItemFolder.ConsumableObject = Resources.Load<GameObject>("_item/02_consumable/03_status/_consumableeffect_healthconsumable");
			if ((Object)(object)ConsumableItemFolder.ConsumableObject == (Object)null)
			{
				Log("_consumableeffect_healthconsumable did not load! Gonna have to check the container paths in the assets!", 4);
			}
			if ((Object)(object)DyeItemFolder.DyeObject == (Object)null)
			{
				Log("_consumableeffect_blackdye did not load! Gonna have to check the container paths in the assets!", 4);
			}
			List<GameObject> list4 = new List<GameObject>();
			list4.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/01_dye/"));
			list4.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/02_skillscroll/"));
			list4.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/03_status/"));
			list4.AddRange(Resources.LoadAll<GameObject>("_generalconditions/"));
			list4.AddRange(from c in Resources.LoadAll<GameObject>("_skill/")
				where ((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase) || ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase)
				select c);
			IEnumerable<GameObject> enumerable7 = new <>z__ReadOnlyList<GameObject>(list4);
			foreach (GameObject item7 in enumerable7)
			{
				string text2 = ((Object)item7).name.Replace("_consumableEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionObject_", string.Empty, StringComparison.OrdinalIgnoreCase);
				if (!ConsumableObjects.TryAdd(text2, item7) && !ConsumableObjects.TryAdd(text2 + "HB", item7))
				{
					Log("ConsumableObject Name: " + ((Object)item7).name + " is too frequent! Cannot add to ConsumableObjects Dictionary!", 4);
				}
			}
			ConsumableObjects.Remove("crya");
			if (ConsumableObjects.Count == 0)
			{
				Log("No GameObjects for consumable/condition effects loaded! Gonna have to check the container paths in the assets!", 4);
				return;
			}
			DataExtractor._loadedAssetsList.AppendLine("\nConsumableObjects:");
			foreach (string key in ConsumableObjects.Keys)
			{
				DataExtractor._loadedAssetsList.AppendLine(key);
			}
		}

		internal static void Nudge(bool cmd = false)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			if (!cmd)
			{
				ErrorPromptTextManager.current.Init_ErrorPrompt("HB - Nudging you out of terrain.");
			}
			((Collider)Player._mainPlayer._pMove._playerController).enabled = false;
			Player._mainPlayer._pMove.UserCode_Target_SetRotation__Quaternion(Quaternion.LookRotation(Vector3.forward));
			Transform transform = ((Component)Player._mainPlayer._pMove._player).transform;
			transform.position += Vector3.up;
			((Collider)Player._mainPlayer._pMove._playerController).enabled = true;
		}

		internal static bool EasterEggChance(int mult = 1)
		{
			if (MainConfig._current._easterEggChance.Value >= 1)
			{
				return Random.Range(0, MainConfig._current._easterEggChance.Value * mult) == 0;
			}
			return false;
		}

		[DebuggerNonUserCode]
		private static void MakeASkill()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			ScriptableSkill skill = ScriptableObject.CreateInstance<ScriptableSkill>();
			((Object)skill).name = "SKILL_Cool Skill";
			skill._skillName = "Cool Skill";
			skill._skillIcon = Sprites["joker"];
			skill._skillRankParams = new SkillParameters();
			skill._toolTipRequirement = (SkillToolTipRequirement)1;
			skill._allowAsBonusSkill = true;
			ScriptableSkillScroll val = ScriptableObject.CreateInstance<ScriptableSkillScroll>();
			((ScriptableItem)val)._itemType = (ItemType)1;
			((ScriptableItem)val)._itemSortTag = (SortTag)10;
			((ScriptableItem)val)._itemName = "Skill Scroll (" + skill._skillName + ")";
			((ScriptableItem)val)._itemDescription = "Teaches the user " + skill._skillName + ", applying it to the general skillbook.";
			((ScriptableItem)val)._itemIcon = Sprites["joker"];
			val._scriptableSkill = skill;
			GameManager._current._cachedScriptableSkills.Add(skill._skillName, skill);
			int index = GameManager._current._foundBonusSkills.FindLastIndex((ScriptableSkill i) => i._skillUtilityType == skill._skillUtilityType && i._skillControlType == skill._skillControlType);
			GameManager._current._foundBonusSkills.Insert(index, skill);
			GameManager current = GameManager._current;
			current._bonusSkillCount++;
			GameManager._current.Refresh_StaticBonusSkills();
			GameManager._current._cachedScriptableItems.Add(((ScriptableItem)val)._itemName, (ScriptableItem)(object)val);
		}

		[DebuggerNonUserCode]
		private static void DumpAllScriptables()
		{
			DataExtractor.DumpAllScriptables();
		}

		[DebuggerNonUserCode]
		private static string MaximumStats()
		{
			return DataExtractor.MaximumStats();
		}

		public static bool CheckMainPlayer()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			Player? obj = Player._mainPlayer.L<Player>();
			if (obj == null)
			{
				return false;
			}
			return (int)obj._currentGameCondition == 1;
		}

		internal static TimeSpan StopTheClock()
		{
			_self._stopwatch.Stop();
			return _self._stopwatch.Elapsed;
		}
	}
	[HarmonyPatch(typeof(GameManager), "Cache_S