Decompiled source of GoldRain v1.0.0

GoldRain.dll

Decompiled 2 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GoldRain.Configuration;
using GoldRain.Core;
using GoldRain.Network;
using GoldRain.UI;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("GoldRain")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d05048946890eab44ea471314ff393f0eaef99eb")]
[assembly: AssemblyProduct("GoldRain")]
[assembly: AssemblyTitle("GoldRain")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/UncleBugDev/GoldRain")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 GoldRain
{
	[BepInPlugin("com.unclebug.goldrain", "GoldRain", "1.0.0")]
	public class GoldRainPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(Game), "Start")]
		private static class Game_Start_Patch
		{
			private static void Postfix()
			{
				GoldRainSettingsGUI.EnsureExists();
			}
		}

		public const string ModGUID = "com.unclebug.goldrain";

		public const string ModName = "GoldRain";

		public const string ModVersion = "1.0.0";

		private Harmony _harmony;

		public static GoldRainPlugin Instance { get; private set; }

		public static ManualLogSource Log => ((BaseUnityPlugin)Instance).Logger;

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			Instance = this;
			ModConfig.Init(((BaseUnityPlugin)this).Config);
			_harmony = new Harmony("com.unclebug.goldrain");
			_harmony.PatchAll();
			Log.LogInfo((object)"[GoldRain] Мод v1.0.0 успешно загружен и готов к работе.");
		}

		private void OnDestroy()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void Update()
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			if (ModConfig.ModEnabled != null && !ModConfig.ModEnabled.Value)
			{
				Player localPlayer = Player.m_localPlayer;
				if ((Object)(object)localPlayer != (Object)null)
				{
					PeeController component = ((Component)localPlayer).GetComponent<PeeController>();
					if ((Object)(object)component != (Object)null && component.IsPeeing)
					{
						component.SetPeeing(state: false);
						PeeNetwork.SendPeeState(localPlayer, state: false);
					}
				}
			}
			else
			{
				if (IsInputBlocked())
				{
					return;
				}
				Player localPlayer2 = Player.m_localPlayer;
				if ((Object)(object)localPlayer2 == (Object)null || ((Character)localPlayer2).IsDead())
				{
					return;
				}
				PeeController peeController = ((Component)localPlayer2).GetComponent<PeeController>();
				if ((Object)(object)peeController == (Object)null)
				{
					peeController = ((Component)localPlayer2).gameObject.AddComponent<PeeController>();
				}
				KeyCode val = (KeyCode)((ModConfig.PeeHotkey == null) ? 112 : ((int)ModConfig.PeeHotkey.Value));
				if ((int)val == 0)
				{
					return;
				}
				if (ModConfig.PeeMode != null && ModConfig.PeeMode.Value == PeeMode.Toggle)
				{
					if (Input.GetKeyDown(val))
					{
						bool flag = !peeController.IsPeeing;
						peeController.SetPeeing(flag);
						PeeNetwork.SendPeeState(localPlayer2, flag);
					}
				}
				else if (Input.GetKeyDown(val))
				{
					if (!peeController.IsPeeing)
					{
						peeController.SetPeeing(state: true);
						PeeNetwork.SendPeeState(localPlayer2, state: true);
					}
				}
				else if (Input.GetKeyUp(val))
				{
					if (peeController.IsPeeing)
					{
						peeController.SetPeeing(state: false);
						PeeNetwork.SendPeeState(localPlayer2, state: false);
					}
				}
				else if (peeController.IsPeeing && !Input.GetKey(val))
				{
					peeController.SetPeeing(state: false);
					PeeNetwork.SendPeeState(localPlayer2, state: false);
				}
			}
		}

		private static bool IsInputBlocked()
		{
			if (GoldRainSettingsGUI.IsOpen)
			{
				return true;
			}
			if ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus())
			{
				return true;
			}
			if (Console.IsVisible())
			{
				return true;
			}
			if (TextInput.IsVisible())
			{
				return true;
			}
			if (Menu.IsVisible())
			{
				return true;
			}
			return false;
		}
	}
}
namespace GoldRain.UI
{
	public static class EscMenuButton
	{
		[HarmonyPatch(typeof(Menu), "Start")]
		private static class Menu_Start_Patch
		{
			private static void Postfix(Menu __instance)
			{
				EnsureButton(__instance);
			}
		}

		[HarmonyPatch(typeof(Menu), "Update")]
		private static class Menu_Update_Patch
		{
			private static void Postfix(Menu __instance)
			{
				EnsureButton(__instance);
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__1_0;

			internal void <EnsureButton>b__1_0()
			{
				GoldRainSettingsGUI.EnsureExists();
				GoldRainSettingsGUI.Instance?.Toggle();
			}
		}

		private static GameObject? s_buttonObj;

		public static void EnsureButton(Menu menu)
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			if ((Object)(object)menu == (Object)null || (Object)(object)menu.m_settingsButton == (Object)null || (Object)(object)s_buttonObj != (Object)null)
			{
				return;
			}
			Transform parent = ((Component)menu.m_settingsButton).transform.parent;
			if ((Object)(object)parent == (Object)null)
			{
				return;
			}
			try
			{
				s_buttonObj = Object.Instantiate<GameObject>(((Component)menu.m_settingsButton).gameObject, parent);
				((Object)s_buttonObj).name = "GoldRain_MenuButton";
				int siblingIndex = ((Component)menu.m_settingsButton).transform.GetSiblingIndex();
				s_buttonObj.transform.SetSiblingIndex(siblingIndex + 1);
				Button component = s_buttonObj.GetComponent<Button>();
				if ((Object)(object)component != (Object)null)
				{
					component.onClick = new ButtonClickedEvent();
					ButtonClickedEvent onClick = component.onClick;
					object obj = <>c.<>9__1_0;
					if (obj == null)
					{
						UnityAction val = delegate
						{
							GoldRainSettingsGUI.EnsureExists();
							GoldRainSettingsGUI.Instance?.Toggle();
						};
						<>c.<>9__1_0 = val;
						obj = (object)val;
					}
					((UnityEvent)onClick).AddListener((UnityAction)obj);
				}
				MonoBehaviour[] componentsInChildren = s_buttonObj.GetComponentsInChildren<MonoBehaviour>(true);
				foreach (MonoBehaviour val2 in componentsInChildren)
				{
					if ((Object)(object)val2 != (Object)null && ((object)val2).GetType().Name.ToLower().Contains("localize"))
					{
						Object.Destroy((Object)(object)val2);
					}
				}
				TMP_Text componentInChildren = s_buttonObj.GetComponentInChildren<TMP_Text>();
				if ((Object)(object)componentInChildren != (Object)null)
				{
					componentInChildren.text = "<color=#FFE600>Золотой Дождь</color>";
				}
				else
				{
					Text componentInChildren2 = s_buttonObj.GetComponentInChildren<Text>();
					if ((Object)(object)componentInChildren2 != (Object)null)
					{
						componentInChildren2.text = "Золотой Дождь";
					}
				}
				if ((Object)(object)menu.menuEntriesParent != (Object)null)
				{
					LayoutRebuilder.ForceRebuildLayoutImmediate(menu.menuEntriesParent);
				}
			}
			catch (Exception ex)
			{
				Debug.LogWarning((object)("[GoldRain] Не удалось добавить кнопку в ESC меню: " + ex.Message));
			}
		}
	}
	public class GoldRainSettingsGUI : MonoBehaviour
	{
		private bool m_isOpen;

		private bool m_isRebinding;

		private bool m_justStartedRebinding;

		private Rect m_windowRect;

		private Vector2 m_scrollPosition;

		private Font? m_valheimFont;

		private GUIStyle? m_windowStyle;

		private GUIStyle? m_headerBannerStyle;

		private GUIStyle? m_subHeaderStyle;

		private GUIStyle? m_buttonStyle;

		private GUIStyle? m_activeButtonStyle;

		private GUIStyle? m_rebindButtonStyle;

		private GUIStyle? m_boxStyle;

		private GUIStyle? m_labelStyle;

		private GUIStyle? m_boldLabelStyle;

		private GUIStyle? m_sliderTrackStyle;

		private GUIStyle? m_sliderThumbStyle;

		private static Texture2D? s_windowTex;

		private static Texture2D? s_btnNormalTex;

		private static Texture2D? s_btnHoverTex;

		private static Texture2D? s_btnActiveTex;

		private static Texture2D? s_bannerTex;

		private static Texture2D? s_boxTex;

		private static Texture2D? s_sliderTrackTex;

		private static Texture2D? s_sliderThumbTex;

		public static GoldRainSettingsGUI? Instance { get; private set; }

		public static bool IsOpen
		{
			get
			{
				if ((Object)(object)Instance != (Object)null)
				{
					return Instance.m_isOpen;
				}
				return false;
			}
		}

		public static void EnsureExists()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			if (!((Object)(object)Instance != (Object)null))
			{
				GameObject val = new GameObject("GoldRain_SettingsGUI");
				Object.DontDestroyOnLoad((Object)val);
				Instance = val.AddComponent<GoldRainSettingsGUI>();
			}
		}

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			float num = 500f;
			float num2 = Mathf.Min(560f, (float)Screen.height - 40f);
			m_windowRect = new Rect(((float)Screen.width - num) * 0.5f, ((float)Screen.height - num2) * 0.5f, num, num2);
		}

		private void Update()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Invalid comparison between Unknown and I4
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			if (!m_isOpen)
			{
				return;
			}
			if (!m_isRebinding)
			{
				Input.ResetInputAxes();
			}
			ZCursor.LockState = (CursorLockMode)0;
			ZCursor.Show();
			if (Input.GetKeyDown((KeyCode)27))
			{
				if (m_isRebinding)
				{
					m_isRebinding = false;
				}
				else
				{
					Close();
				}
			}
			else
			{
				if (!m_isRebinding)
				{
					return;
				}
				if (m_justStartedRebinding)
				{
					m_justStartedRebinding = false;
					return;
				}
				KeyCode[] array = (KeyCode[])Enum.GetValues(typeof(KeyCode));
				foreach (KeyCode val in array)
				{
					if (!Input.GetKeyDown(val) || (int)val == 0)
					{
						continue;
					}
					if ((int)val != 27)
					{
						ModConfig.PeeHotkey.Value = val;
						ModConfig.Save();
						if ((Object)(object)Player.m_localPlayer != (Object)null && ModConfig.ShowNotifications.Value)
						{
							((Character)Player.m_localPlayer).Message((MessageType)1, "[Gold Rain] Клавиша назначена: <color=#FFE600><b>" + FormatKeyCodeName(val) + "</b></color>", 0, (Sprite)null, false);
						}
					}
					m_isRebinding = false;
					break;
				}
			}
		}

		public void Toggle()
		{
			if (m_isOpen)
			{
				Close();
			}
			else
			{
				Open();
			}
		}

		public void Open()
		{
			//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)
			m_isOpen = true;
			m_isRebinding = false;
			m_justStartedRebinding = false;
			float num = 500f;
			float num2 = Mathf.Min(560f, (float)Screen.height - 40f);
			m_windowRect = new Rect(((float)Screen.width - num) * 0.5f, ((float)Screen.height - num2) * 0.5f, num, num2);
			SetMenuInteractable(state: false);
			ZCursor.LockState = (CursorLockMode)0;
			ZCursor.Show();
		}

		public void Close()
		{
			m_isOpen = false;
			m_isRebinding = false;
			ModConfig.Save();
			SetMenuInteractable(state: true);
			if ((Object)(object)Player.m_localPlayer != (Object)null && !Menu.IsVisible() && !InventoryGui.IsVisible() && !Minimap.IsOpen())
			{
				ZCursor.LockState = (CursorLockMode)1;
				ZCursor.Hide();
			}
		}

		private static void SetMenuInteractable(bool state)
		{
			try
			{
				if ((Object)(object)Menu.instance != (Object)null && (Object)(object)Menu.instance.m_menuDialog != (Object)null)
				{
					CanvasGroup val = ((Component)Menu.instance.m_menuDialog).GetComponent<CanvasGroup>();
					if ((Object)(object)val == (Object)null)
					{
						val = ((Component)Menu.instance.m_menuDialog).gameObject.AddComponent<CanvasGroup>();
					}
					val.blocksRaycasts = state;
					val.interactable = state;
				}
			}
			catch
			{
			}
		}

		private void OnDestroy()
		{
			SetMenuInteractable(state: true);
		}

		private void OnGUI()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (m_isOpen)
			{
				InitStyles();
				GUI.depth = -1000;
				m_windowRect = GUI.ModalWindow(748192, m_windowRect, new WindowFunction(DrawWindowContent), "Золотой Дождь — Настройки", m_windowStyle);
			}
		}

		private void DrawWindowContent(int windowId)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(6f);
			GUILayout.Label("  Процедурная механика мочеиспускания викинга", m_headerBannerStyle, Array.Empty<GUILayoutOption>());
			m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.BeginVertical(m_boxStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("<b>1. Общие настройки</b>", m_subHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Работа мода:", m_labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			bool value = ModConfig.ModEnabled.Value;
			string text = (value ? "<color=#A0FFA0><b>ВКЛЮЧЕН</b></color>" : "<color=#FFA0A0><b>ОТКЛЮЧЕН</b></color>");
			if (GUILayout.Button("Мод: " + text, m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ModConfig.ModEnabled.Value = !value;
				ModConfig.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Уведомления на экране:", m_labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			bool value2 = ModConfig.ShowNotifications.Value;
			if (GUILayout.Button(value2 ? "<color=#FFE600>ВКЛ</color>" : "<color=#AAAAAA>ВЫКЛ</color>", m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }))
			{
				ModConfig.ShowNotifications.Value = !value2;
				ModConfig.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Space(8f);
			GUILayout.BeginVertical(m_boxStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("<b>2. Режим управления струей</b>", m_subHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			bool flag = ModConfig.PeeMode.Value == PeeMode.Toggle;
			GUIStyle val = (flag ? m_activeButtonStyle : m_buttonStyle);
			if (GUILayout.Button("Переключатель (Toggle)", val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) }))
			{
				ModConfig.PeeMode.Value = PeeMode.Toggle;
				ModConfig.Save();
			}
			GUIStyle val2 = ((!flag) ? m_activeButtonStyle : m_buttonStyle);
			if (GUILayout.Button("Удержание (Hold)", val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) }))
			{
				ModConfig.PeeMode.Value = PeeMode.Hold;
				ModConfig.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(flag ? "<color=#CCCCCC><i>Нажал клавишу — струя полилась, нажал еще раз — остановилась.</i></color>" : "<color=#CCCCCC><i>Струя льется только пока вы удерживаете клавишу нажатой.</i></color>", m_labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.Space(8f);
			GUILayout.BeginVertical(m_boxStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("<b>3. Горячая клавиша</b>", m_subHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Клавиша мочеиспускания:", m_labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			if (m_isRebinding)
			{
				if (GUILayout.Button("<color=#FFE600><b>Слушаю клавишу... (ESC отмена)</b></color>", m_rebindButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }))
				{
					m_isRebinding = false;
				}
			}
			else
			{
				string text2 = FormatKeyCodeName(ModConfig.PeeHotkey.Value);
				if (GUILayout.Button("<b>" + text2 + "</b>  <color=#FFE600>[Изменить]</color>", m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }))
				{
					m_isRebinding = true;
					m_justStartedRebinding = true;
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Space(8f);
			GUILayout.BeginVertical(m_boxStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("<b>4. Физика дуги и 3D звук</b>", m_subHeaderStyle, Array.Empty<GUILayoutOption>());
			float value3 = ModConfig.StreamForce.Value;
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Сила струи (скорость дуги): <b><color=#FFE600>{value3:F1}x</color></b>", m_labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			float num = GUILayout.HorizontalSlider(value3, 1f, 5f, m_sliderTrackStyle, m_sliderThumbStyle, Array.Empty<GUILayoutOption>());
			if (Mathf.Abs(num - value3) > 0.05f)
			{
				ModConfig.StreamForce.Value = (float)Math.Round(num, 1);
			}
			GUILayout.Space(6f);
			float value4 = ModConfig.AudioVolume.Value;
			int num2 = Mathf.RoundToInt(value4 * 100f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Громкость звука струи: <b><color=#FFE600>{num2}%</color></b>", m_labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			float num3 = GUILayout.HorizontalSlider(value4, 0f, 1f, m_sliderTrackStyle, m_sliderThumbStyle, Array.Empty<GUILayoutOption>());
			if (Mathf.Abs(num3 - value4) > 0.01f)
			{
				ModConfig.AudioVolume.Value = (float)Math.Round(num3, 2);
			}
			GUILayout.EndVertical();
			GUILayout.Space(8f);
			GUILayout.BeginVertical(m_boxStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("<b>5. Благодарности и ссылки</b>", m_subHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("Мод сделан благодаря стримеру <b><color=#A970FF>DaymonMontage</color></b>", m_labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("<b>Twitch: daymonmontage</b>", m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				Application.OpenURL("https://www.twitch.tv/daymonmontage");
			}
			if (GUILayout.Button("<b>Хаб: daymon-site</b>", m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				Application.OpenURL("https://daymonmontage.github.io/daymon-site/");
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndScrollView();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Сброс по умолчанию", m_buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(160f),
				GUILayout.Height(34f)
			}))
			{
				ModConfig.ModEnabled.Value = true;
				ModConfig.PeeHotkey.Value = (KeyCode)112;
				ModConfig.PeeMode.Value = PeeMode.Toggle;
				ModConfig.StreamForce.Value = 3f;
				ModConfig.AudioVolume.Value = 0.35f;
				ModConfig.ShowNotifications.Value = true;
				ModConfig.Save();
			}
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("<b>Закрыть</b>", m_activeButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(130f),
				GUILayout.Height(34f)
			}))
			{
				Close();
			}
			GUILayout.EndHorizontal();
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref m_windowRect)).width, 32f));
		}

		private unsafe static string FormatKeyCodeName(KeyCode kc)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected I4, but got Unknown
			//IL_00a6: 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_00c7: Expected I4, but got Unknown
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected I4, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Invalid comparison between Unknown and I4
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected I4, but got Unknown
			if ((int)kc <= 61)
			{
				if ((int)kc == 9)
				{
					return "Tab";
				}
				if ((int)kc == 13)
				{
					return "Enter";
				}
				switch (kc - 32)
				{
				case 16:
					return "0";
				case 17:
					return "1";
				case 18:
					return "2";
				case 19:
					return "3";
				case 20:
					return "4";
				case 21:
					return "5";
				case 22:
					return "6";
				case 23:
					return "7";
				case 24:
					return "8";
				case 25:
					return "9";
				case 0:
					return "Пробел (Space)";
				case 7:
					return "' (русская э)";
				case 27:
					return "; (русская ж)";
				case 12:
					return ", (русская б)";
				case 14:
					return ". (русская ю)";
				case 15:
					return "/";
				case 13:
					return "-";
				case 29:
					return "=";
				}
			}
			else if ((int)kc <= 271)
			{
				switch (kc - 91)
				{
				default:
					if ((int)kc != 271)
					{
						break;
					}
					return "Num Enter";
				case 5:
					return "~ (русская ё)";
				case 1:
					return "\\";
				case 0:
					return "[ (русская х)";
				case 2:
					return "] (русская ъ)";
				case 3:
				case 4:
					break;
				}
			}
			else
			{
				switch (kc - 303)
				{
				case 1:
					return "Левый Shift";
				case 0:
					return "Правый Shift";
				case 3:
					return "Левый Ctrl";
				case 2:
					return "Правый Ctrl";
				case 5:
					return "Левый Alt";
				case 4:
					return "Правый Alt";
				}
				switch (kc - 323)
				{
				case 0:
					return "Левая кнопка мыши (ЛКМ)";
				case 1:
					return "Правая кнопка мыши (ПКМ)";
				case 2:
					return "Колёсико мыши (СКМ)";
				case 3:
					return "Боковая кнопка 3";
				case 4:
					return "Боковая кнопка 4";
				case 5:
					return "Боковая кнопка 5";
				case 6:
					return "Боковая кнопка 6";
				}
			}
			return ((object)(*(KeyCode*)(&kc))/*cast due to .constrained prefix*/).ToString();
		}

		private void InitStyles()
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Expected O, but got Unknown
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Expected O, but got Unknown
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Expected O, but got Unknown
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Expected O, but got Unknown
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Expected O, but got Unknown
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Expected O, but got Unknown
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Expected O, but got Unknown
			//IL_0416: Expected O, but got Unknown
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Expected O, but got Unknown
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Expected O, but got Unknown
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Expected O, but got Unknown
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Expected O, but got Unknown
			//IL_0513: Expected O, but got Unknown
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Unknown result type (might be due to invalid IL or missing references)
			//IL_0560: Expected O, but got Unknown
			//IL_0565: Expected O, but got Unknown
			if ((Object)(object)m_valheimFont == (Object)null)
			{
				Font[] array = Resources.FindObjectsOfTypeAll<Font>();
				foreach (Font val in array)
				{
					if ((Object)(object)val != (Object)null && (((Object)val).name.Contains("Averia") || ((Object)val).name.Contains("Norse") || ((Object)val).name.Contains("Valheim")))
					{
						m_valheimFont = val;
						break;
					}
				}
			}
			if (m_windowStyle == null)
			{
				GUIStyle val2 = new GUIStyle(GUI.skin.window);
				val2.normal.background = GetVikingWindowTexture();
				val2.normal.textColor = new Color(0.95f, 0.8f, 0.45f, 1f);
				val2.onNormal.background = GetVikingWindowTexture();
				val2.onNormal.textColor = new Color(0.95f, 0.8f, 0.45f, 1f);
				val2.border = new RectOffset(14, 14, 14, 14);
				val2.padding = new RectOffset(16, 16, 24, 16);
				val2.font = m_valheimFont;
				val2.fontStyle = (FontStyle)1;
				val2.fontSize = 15;
				val2.alignment = (TextAnchor)1;
				m_windowStyle = val2;
			}
			if (m_headerBannerStyle == null)
			{
				GUIStyle val3 = new GUIStyle(GUI.skin.label);
				val3.normal.background = GetVikingBannerTexture();
				val3.normal.textColor = new Color(1f, 0.88f, 0.52f, 1f);
				val3.border = new RectOffset(6, 6, 6, 6);
				val3.padding = new RectOffset(10, 10, 5, 5);
				val3.font = m_valheimFont;
				val3.fontStyle = (FontStyle)1;
				val3.fontSize = 12;
				val3.alignment = (TextAnchor)3;
				m_headerBannerStyle = val3;
			}
			if (m_subHeaderStyle == null)
			{
				GUIStyle val4 = new GUIStyle(GUI.skin.label)
				{
					font = m_valheimFont,
					fontSize = 13,
					fontStyle = (FontStyle)1
				};
				val4.normal.textColor = new Color(0.95f, 0.82f, 0.45f, 1f);
				val4.richText = true;
				m_subHeaderStyle = val4;
			}
			if (m_buttonStyle == null)
			{
				GUIStyle val5 = new GUIStyle(GUI.skin.button);
				val5.normal.background = GetVikingButtonTexture(hover: false, active: false);
				val5.normal.textColor = new Color(0.92f, 0.88f, 0.82f, 1f);
				val5.hover.background = GetVikingButtonTexture(hover: true, active: false);
				val5.hover.textColor = new Color(1f, 0.95f, 0.6f, 1f);
				val5.active.background = GetVikingButtonTexture(hover: false, active: true);
				val5.active.textColor = Color.white;
				val5.border = new RectOffset(8, 8, 8, 8);
				val5.font = m_valheimFont;
				val5.fontStyle = (FontStyle)1;
				val5.fontSize = 12;
				val5.richText = true;
				val5.alignment = (TextAnchor)4;
				m_buttonStyle = val5;
			}
			if (m_activeButtonStyle == null)
			{
				GUIStyle val6 = new GUIStyle(m_buttonStyle);
				val6.normal.background = GetVikingButtonTexture(hover: true, active: false);
				val6.normal.textColor = new Color(1f, 0.92f, 0.45f, 1f);
				val6.fontStyle = (FontStyle)1;
				m_activeButtonStyle = val6;
			}
			if (m_rebindButtonStyle == null)
			{
				GUIStyle val7 = new GUIStyle(m_buttonStyle);
				val7.normal.background = GetVikingButtonTexture(hover: true, active: false);
				val7.normal.textColor = new Color(1f, 0.9f, 0.2f, 1f);
				val7.fontStyle = (FontStyle)1;
				m_rebindButtonStyle = val7;
			}
			if (m_boxStyle == null)
			{
				GUIStyle val8 = new GUIStyle(GUI.skin.box);
				val8.normal.background = GetVikingBoxTexture();
				val8.border = new RectOffset(6, 6, 6, 6);
				val8.padding = new RectOffset(10, 10, 8, 8);
				m_boxStyle = val8;
			}
			if (m_labelStyle == null)
			{
				GUIStyle val9 = new GUIStyle(GUI.skin.label)
				{
					richText = true,
					font = m_valheimFont,
					fontSize = 12
				};
				val9.normal.textColor = new Color(0.9f, 0.86f, 0.8f, 1f);
				val9.alignment = (TextAnchor)3;
				m_labelStyle = val9;
			}
			if (m_boldLabelStyle == null)
			{
				GUIStyle val10 = new GUIStyle(m_labelStyle)
				{
					fontStyle = (FontStyle)1
				};
				val10.normal.textColor = new Color(1f, 0.9f, 0.5f, 1f);
				m_boldLabelStyle = val10;
			}
			if (m_sliderTrackStyle == null)
			{
				GUIStyle val11 = new GUIStyle(GUI.skin.horizontalSlider);
				val11.normal.background = GetSliderTrackTexture();
				val11.fixedHeight = 12f;
				val11.border = new RectOffset(4, 4, 4, 4);
				val11.margin = new RectOffset(4, 4, 6, 6);
				m_sliderTrackStyle = val11;
			}
			if (m_sliderThumbStyle == null)
			{
				GUIStyle val12 = new GUIStyle(GUI.skin.horizontalSliderThumb);
				val12.normal.background = GetSliderThumbTexture();
				val12.fixedWidth = 16f;
				val12.fixedHeight = 20f;
				val12.border = new RectOffset(4, 4, 4, 4);
				m_sliderThumbStyle = val12;
			}
		}

		private static Texture2D GetVikingWindowTexture()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_windowTex != (Object)null)
			{
				return s_windowTex;
			}
			Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)1,
				wrapMode = (TextureWrapMode)1
			};
			Color32[] array = (Color32[])(object)new Color32[4096];
			for (int i = 0; i < 64; i++)
			{
				for (int j = 0; j < 64; j++)
				{
					int num = j;
					int num2 = 63 - j;
					int num3 = i;
					int num4 = 63 - i;
					int num5 = Mathf.Min(Mathf.Min(num, num2), Mathf.Min(num3, num4));
					if (num5 <= 1)
					{
						array[i * 64 + j] = new Color32((byte)38, (byte)30, (byte)22, byte.MaxValue);
						continue;
					}
					switch (num5)
					{
					case 2:
					case 3:
						array[i * 64 + j] = new Color32((byte)205, (byte)164, (byte)88, byte.MaxValue);
						continue;
					case 4:
						array[i * 64 + j] = new Color32((byte)18, (byte)14, (byte)10, byte.MaxValue);
						continue;
					}
					byte b = (byte)((j % 4 == 0) ? 2u : 0u);
					byte b2 = (byte)Mathf.Clamp((float)i / 64f * 12f, 0f, 15f);
					byte b3 = (byte)(22 + b + b2);
					byte b4 = (byte)(18 + b + b2);
					byte b5 = (byte)(14 + b + b2);
					array[i * 64 + j] = new Color32(b3, b4, b5, (byte)248);
				}
			}
			val.SetPixels32(array);
			val.Apply();
			s_windowTex = val;
			return val;
		}

		private static Texture2D GetVikingButtonTexture(bool hover, bool active)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			if (active && (Object)(object)s_btnActiveTex != (Object)null)
			{
				return s_btnActiveTex;
			}
			if (hover && (Object)(object)s_btnHoverTex != (Object)null)
			{
				return s_btnHoverTex;
			}
			if (!hover && !active && (Object)(object)s_btnNormalTex != (Object)null)
			{
				return s_btnNormalTex;
			}
			Texture2D val = new Texture2D(64, 32, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)1,
				wrapMode = (TextureWrapMode)1
			};
			Color32[] array = (Color32[])(object)new Color32[2048];
			Color32 val2 = (active ? new Color32((byte)229, (byte)184, (byte)92, byte.MaxValue) : (hover ? new Color32(byte.MaxValue, (byte)215, (byte)68, byte.MaxValue) : new Color32((byte)138, (byte)105, (byte)54, byte.MaxValue)));
			Color32 val3 = (active ? new Color32((byte)26, (byte)20, (byte)15, byte.MaxValue) : (hover ? new Color32((byte)52, (byte)42, (byte)32, byte.MaxValue) : new Color32((byte)36, (byte)28, (byte)22, byte.MaxValue)));
			for (int i = 0; i < 32; i++)
			{
				for (int j = 0; j < 64; j++)
				{
					int num = Mathf.Min(Mathf.Min(j, 63 - j), Mathf.Min(i, 31 - i));
					if (num <= 1)
					{
						array[i * 64 + j] = val2;
					}
					else if (num == 2)
					{
						array[i * 64 + j] = new Color32((byte)18, (byte)14, (byte)10, byte.MaxValue);
					}
					else
					{
						array[i * 64 + j] = val3;
					}
				}
			}
			val.SetPixels32(array);
			val.Apply();
			if (active)
			{
				s_btnActiveTex = val;
			}
			else if (hover)
			{
				s_btnHoverTex = val;
			}
			else
			{
				s_btnNormalTex = val;
			}
			return val;
		}

		private static Texture2D GetVikingBannerTexture()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_bannerTex != (Object)null)
			{
				return s_bannerTex;
			}
			Texture2D val = new Texture2D(64, 28, (TextureFormat)4, false);
			Color32[] array = (Color32[])(object)new Color32[1792];
			for (int i = 0; i < 28; i++)
			{
				for (int j = 0; j < 64; j++)
				{
					if (Mathf.Min(Mathf.Min(j, 63 - j), Mathf.Min(i, 27 - i)) <= 1)
					{
						array[i * 64 + j] = new Color32((byte)180, (byte)140, (byte)68, byte.MaxValue);
					}
					else
					{
						array[i * 64 + j] = new Color32((byte)42, (byte)32, (byte)20, (byte)240);
					}
				}
			}
			val.SetPixels32(array);
			val.Apply();
			s_bannerTex = val;
			return val;
		}

		private static Texture2D GetVikingBoxTexture()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_boxTex != (Object)null)
			{
				return s_boxTex;
			}
			Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false);
			Color32[] array = (Color32[])(object)new Color32[1024];
			for (int i = 0; i < 32; i++)
			{
				for (int j = 0; j < 32; j++)
				{
					if (Mathf.Min(Mathf.Min(j, 31 - j), Mathf.Min(i, 31 - i)) <= 1)
					{
						array[i * 32 + j] = new Color32((byte)85, (byte)68, (byte)48, (byte)200);
					}
					else
					{
						array[i * 32 + j] = new Color32((byte)20, (byte)16, (byte)12, (byte)220);
					}
				}
			}
			val.SetPixels32(array);
			val.Apply();
			s_boxTex = val;
			return val;
		}

		private static Texture2D GetSliderTrackTexture()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_sliderTrackTex != (Object)null)
			{
				return s_sliderTrackTex;
			}
			Texture2D val = new Texture2D(32, 12, (TextureFormat)4, false);
			Color32[] array = (Color32[])(object)new Color32[384];
			for (int i = 0; i < 12; i++)
			{
				for (int j = 0; j < 32; j++)
				{
					if (Mathf.Min(Mathf.Min(j, 31 - j), Mathf.Min(i, 11 - i)) == 0)
					{
						array[i * 32 + j] = new Color32((byte)100, (byte)80, (byte)50, byte.MaxValue);
					}
					else
					{
						array[i * 32 + j] = new Color32((byte)14, (byte)12, (byte)10, (byte)240);
					}
				}
			}
			val.SetPixels32(array);
			val.Apply();
			s_sliderTrackTex = val;
			return val;
		}

		private static Texture2D GetSliderThumbTexture()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_sliderThumbTex != (Object)null)
			{
				return s_sliderThumbTex;
			}
			Texture2D val = new Texture2D(16, 20, (TextureFormat)4, false);
			Color32[] array = (Color32[])(object)new Color32[320];
			for (int i = 0; i < 20; i++)
			{
				for (int j = 0; j < 16; j++)
				{
					switch (Mathf.Min(Mathf.Min(j, 15 - j), Mathf.Min(i, 19 - i)))
					{
					case 0:
						array[i * 16 + j] = new Color32((byte)220, (byte)180, (byte)80, byte.MaxValue);
						break;
					case 1:
						array[i * 16 + j] = new Color32((byte)160, (byte)120, (byte)50, byte.MaxValue);
						break;
					default:
						array[i * 16 + j] = new Color32((byte)50, (byte)40, (byte)28, byte.MaxValue);
						break;
					}
				}
			}
			val.SetPixels32(array);
			val.Apply();
			s_sliderThumbTex = val;
			return val;
		}
	}
}
namespace GoldRain.Network
{
	public static class PeeNetwork
	{
		[HarmonyPatch(typeof(Player), "Awake")]
		private static class Player_Awake_Patch
		{
			private static void Postfix(Player __instance)
			{
				RegisterRPC(__instance);
			}
		}

		[HarmonyPatch(typeof(Player), "Update")]
		private static class Player_Update_Patch
		{
			private static void Postfix(Player __instance)
			{
				CheckLateJoinSync(__instance);
			}
		}

		public const string RPC_PEE_NAME = "RPC_GoldRain_Pee";

		public const string RPC_PEE_HIT = "RPC_GoldRain_PeeHit";

		public const string ZDO_PEE_KEY = "GoldRain_IsPeeing";

		public static ZNetView? GetZNetView(Player? player)
		{
			if (!((Object)(object)player != (Object)null))
			{
				return null;
			}
			return ((Component)player).GetComponent<ZNetView>();
		}

		public static void SendPeeHit(Player targetPlayer)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)targetPlayer == (Object)null)
			{
				return;
			}
			Player localPlayer = Player.m_localPlayer;
			if (!((Object)(object)localPlayer == (Object)null))
			{
				ZNetView zNetView = GetZNetView(localPlayer);
				if (!((Object)(object)zNetView == (Object)null) && zNetView.IsOwner())
				{
					ZDOID zDOID = ((Character)targetPlayer).GetZDOID();
					zNetView.InvokeRPC(ZNetView.Everybody, "RPC_GoldRain_PeeHit", new object[1] { zDOID });
					GoldPeeWetDrip.Apply(targetPlayer);
				}
			}
		}

		public static void SendPeeState(Player player, bool state)
		{
			ZNetView zNetView = GetZNetView(player);
			if (!((Object)(object)zNetView == (Object)null) && zNetView.IsOwner())
			{
				zNetView.InvokeRPC(ZNetView.Everybody, "RPC_GoldRain_Pee", new object[1] { state });
				ZDO zDO = zNetView.GetZDO();
				if (zDO != null)
				{
					zDO.Set("GoldRain_IsPeeing", state);
				}
			}
		}

		public static void RegisterRPC(Player player)
		{
			ZNetView zNetView = GetZNetView(player);
			if ((Object)(object)zNetView == (Object)null)
			{
				return;
			}
			zNetView.Register<bool>("RPC_GoldRain_Pee", (Action<long, bool>)delegate(long sender, bool state)
			{
				PeeController peeController = ((Component)player).GetComponent<PeeController>();
				if ((Object)(object)peeController == (Object)null)
				{
					peeController = ((Component)player).gameObject.AddComponent<PeeController>();
				}
				if ((Object)(object)peeController != (Object)null)
				{
					peeController.SetPeeing(state);
				}
			});
			zNetView.Register<ZDOID>("RPC_GoldRain_PeeHit", (Action<long, ZDOID>)delegate(long sender, ZDOID targetID)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				ZNetScene instance = ZNetScene.instance;
				GameObject val = ((instance != null) ? instance.FindInstance(targetID) : null);
				if ((Object)(object)val != (Object)null)
				{
					Player component = val.GetComponent<Player>();
					if ((Object)(object)component != (Object)null)
					{
						GoldPeeWetDrip.Apply(component);
						if ((Object)(object)component == (Object)(object)Player.m_localPlayer)
						{
							MessageHud instance2 = MessageHud.instance;
							if (instance2 != null)
							{
								instance2.ShowMessage((MessageType)2, "<color=#FFE600>Вас обмочили! (Золотой дождь)</color>", 0, (Sprite)null, false, true);
							}
						}
					}
				}
			});
			CheckLateJoinSync(player);
		}

		public static void CheckLateJoinSync(Player player)
		{
			ZNetView zNetView = GetZNetView(player);
			if ((Object)(object)zNetView == (Object)null || zNetView.IsOwner())
			{
				return;
			}
			ZDO zDO = zNetView.GetZDO();
			if (zDO == null)
			{
				return;
			}
			bool flag = zDO.GetBool("GoldRain_IsPeeing", false);
			PeeController component = ((Component)player).GetComponent<PeeController>();
			if ((Object)(object)component != (Object)null)
			{
				if (component.IsPeeing != flag)
				{
					component.SetPeeing(flag);
				}
			}
			else if (flag)
			{
				component = ((Component)player).gameObject.AddComponent<PeeController>();
				component.SetPeeing(state: true);
			}
		}
	}
}
namespace GoldRain.Core
{
	public class GoldPeeWetDrip : MonoBehaviour
	{
		private Player? _player;

		private float _remainingDuration;

		private GameObject? _dripEmitterObject;

		private ParticleSystem? _dripParticleSystem;

		private ParticleSystemRenderer? _dripRenderer;

		private static Material? s_dripMaterial;

		public static void Apply(Player player, float duration = 15f)
		{
			if (!((Object)(object)player == (Object)null) && !((Character)player).IsDead())
			{
				SEMan sEMan = ((Character)player).GetSEMan();
				if (sEMan != null)
				{
					sEMan.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wet"), true, 0, 0f, (short)(-1));
				}
				GoldPeeWetDrip goldPeeWetDrip = ((Component)player).GetComponent<GoldPeeWetDrip>();
				if ((Object)(object)goldPeeWetDrip == (Object)null)
				{
					goldPeeWetDrip = ((Component)player).gameObject.AddComponent<GoldPeeWetDrip>();
				}
				goldPeeWetDrip.Refresh(duration);
			}
		}

		public void Refresh(float duration)
		{
			_remainingDuration = Mathf.Max(_remainingDuration, duration);
			EnsureEmitter();
		}

		private void Awake()
		{
			_player = ((Component)this).GetComponent<Player>();
			EnsureEmitter();
		}

		private void EnsureEmitter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Expected O, but got Unknown
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			if (!((Object)(object)_dripEmitterObject != (Object)null))
			{
				_dripEmitterObject = new GameObject("GoldRain_WetDripEmitter");
				_dripEmitterObject.transform.SetParent(((Component)this).transform, false);
				_dripEmitterObject.transform.localPosition = new Vector3(0f, 1.1f, 0f);
				_dripParticleSystem = _dripEmitterObject.AddComponent<ParticleSystem>();
				_dripRenderer = _dripEmitterObject.GetComponent<ParticleSystemRenderer>();
				if ((Object)(object)s_dripMaterial == (Object)null)
				{
					s_dripMaterial = new Material(Shader.Find("Particles/Standard Unlit") ?? Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default"))
					{
						name = "GoldRain_WetDripMat"
					};
				}
				((Renderer)_dripRenderer).material = s_dripMaterial;
				MainModule main = _dripParticleSystem.main;
				((MainModule)(ref main)).duration = 1f;
				((MainModule)(ref main)).loop = true;
				((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.85f);
				((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.2f, 0.6f);
				((MainModule)(ref main)).startSize = new MinMaxCurve(0.025f, 0.045f);
				((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(1.3f);
				((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
				((MainModule)(ref main)).maxParticles = 30;
				EmissionModule emission = _dripParticleSystem.emission;
				((EmissionModule)(ref emission)).enabled = true;
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(18f);
				ShapeModule shape = _dripParticleSystem.shape;
				((ShapeModule)(ref shape)).enabled = true;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5;
				((ShapeModule)(ref shape)).scale = new Vector3(0.5f, 0.9f, 0.4f);
				ColorOverLifetimeModule colorOverLifetime = _dripParticleSystem.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
				Gradient val = new Gradient();
				val.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
				{
					new GradientColorKey(new Color(1f, 0.88f, 0.05f), 0f),
					new GradientColorKey(new Color(1f, 0.72f, 0f), 0.7f),
					new GradientColorKey(new Color(0.9f, 0.6f, 0f), 1f)
				}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
				{
					new GradientAlphaKey(0.9f, 0f),
					new GradientAlphaKey(0.8f, 0.6f),
					new GradientAlphaKey(0f, 1f)
				});
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val);
				_dripParticleSystem.Play();
			}
		}

		private void Update()
		{
			_remainingDuration -= Time.deltaTime;
			if (_remainingDuration <= 0f || ((Object)(object)_player != (Object)null && ((Character)_player).IsDead()))
			{
				Object.Destroy((Object)(object)this);
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)_dripEmitterObject != (Object)null)
			{
				Object.Destroy((Object)(object)_dripEmitterObject);
			}
		}
	}
	public class PeeController : MonoBehaviour
	{
		private Player _player;

		private Animator? _animator;

		private Transform? _hips;

		private Transform? _spine;

		private Transform? _leftUpperArm;

		private Transform? _rightUpperArm;

		private Transform? _leftLowerArm;

		private Transform? _rightLowerArm;

		private Transform? _leftHand;

		private Transform? _rightHand;

		private GameObject? _streamEmitterObject;

		private LineRenderer? _lineRenderer;

		private ParticleSystem? _particleSystem;

		private ParticleSystemRenderer? _particleRenderer;

		private Material? _streamMaterial;

		private AudioSource? _audioSource;

		private float _lastHealth;

		private bool _initialized;

		private float _targetVolume;

		private float _lastHitSyncTime;

		private Quaternion _fixedSpineRot;

		private Quaternion _fixedUpperArmL;

		private Quaternion _fixedUpperArmR;

		private Quaternion _fixedLowerArmL;

		private Quaternion _fixedLowerArmR;

		private Quaternion _fixedHandL;

		private Quaternion _fixedHandR;

		private bool _hasFixedPose;

		private float _poseBlend;

		private float _currentAimYaw;

		private float _currentAimPitch;

		private static readonly MethodInfo? s_showHandItems = typeof(Humanoid).GetMethod("ShowHandItems", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		private static AudioClip? s_fermenterClip;

		private static AudioClip? s_sharedAudioClip;

		private static Texture2D? s_sharedParticleTex;

		public bool IsPeeing { get; private set; }

		private void Awake()
		{
			EnsureInitialized();
		}

		public void EnsureInitialized()
		{
			if (!_initialized)
			{
				_initialized = true;
				_player = ((Component)this).GetComponent<Player>();
				if ((Object)(object)_player != (Object)null)
				{
					_lastHealth = ((Character)_player).GetHealth();
					_animator = ((Component)this).GetComponentInChildren<Animator>();
				}
				CacheBones();
				CreateParticleStreamSystem();
				CreateAudioSystem();
			}
		}

		private void CacheBones()
		{
			if ((Object)(object)_animator == (Object)null)
			{
				_animator = ((Component)this).GetComponentInChildren<Animator>();
			}
			if ((Object)(object)_animator != (Object)null && _animator.isHuman)
			{
				if ((Object)(object)_hips == (Object)null)
				{
					_hips = _animator.GetBoneTransform((HumanBodyBones)0);
				}
				if ((Object)(object)_spine == (Object)null)
				{
					_spine = _animator.GetBoneTransform((HumanBodyBones)7);
				}
				if ((Object)(object)_leftUpperArm == (Object)null)
				{
					_leftUpperArm = _animator.GetBoneTransform((HumanBodyBones)13);
				}
				if ((Object)(object)_rightUpperArm == (Object)null)
				{
					_rightUpperArm = _animator.GetBoneTransform((HumanBodyBones)14);
				}
				if ((Object)(object)_leftLowerArm == (Object)null)
				{
					_leftLowerArm = _animator.GetBoneTransform((HumanBodyBones)15);
				}
				if ((Object)(object)_rightLowerArm == (Object)null)
				{
					_rightLowerArm = _animator.GetBoneTransform((HumanBodyBones)16);
				}
				if ((Object)(object)_leftHand == (Object)null)
				{
					_leftHand = _animator.GetBoneTransform((HumanBodyBones)17);
				}
				if ((Object)(object)_rightHand == (Object)null)
				{
					_rightHand = _animator.GetBoneTransform((HumanBodyBones)18);
				}
			}
			if ((Object)(object)_hips == (Object)null)
			{
				_hips = FindBoneInChildren(((Component)this).transform, "hips", "pelvis");
			}
			if ((Object)(object)_spine == (Object)null)
			{
				_spine = FindBoneInChildren(((Component)this).transform, "spine", "chest");
			}
			if ((Object)(object)_leftUpperArm == (Object)null)
			{
				_leftUpperArm = FindBoneInChildren(((Component)this).transform, "arm_l", "leftupperarm", "shoulder_l", "upperarm.l");
			}
			if ((Object)(object)_rightUpperArm == (Object)null)
			{
				_rightUpperArm = FindBoneInChildren(((Component)this).transform, "arm_r", "rightupperarm", "shoulder_r", "upperarm.r");
			}
			if ((Object)(object)_leftLowerArm == (Object)null)
			{
				_leftLowerArm = FindBoneInChildren(((Component)this).transform, "forearm_l", "leftlowerarm", "elbow_l", "lowerarm.l");
			}
			if ((Object)(object)_rightLowerArm == (Object)null)
			{
				_rightLowerArm = FindBoneInChildren(((Component)this).transform, "forearm_r", "rightlowerarm", "elbow_r", "lowerarm.r");
			}
			if ((Object)(object)_leftHand == (Object)null)
			{
				_leftHand = FindBoneInChildren(((Component)this).transform, "hand_l", "lefthand", "wrist_l", "hand.l");
			}
			if ((Object)(object)_rightHand == (Object)null)
			{
				_rightHand = FindBoneInChildren(((Component)this).transform, "hand_r", "righthand", "wrist_r", "hand.r");
			}
		}

		private static Transform? FindBoneInChildren(Transform root, params string[] names)
		{
			foreach (string targetName in names)
			{
				Transform val = FindRecursive(root, targetName);
				if ((Object)(object)val != (Object)null)
				{
					return val;
				}
			}
			return null;
		}

		private static Transform? FindRecursive(Transform current, string targetName)
		{
			if (((Object)current).name.ToLowerInvariant().Contains(targetName.ToLowerInvariant()))
			{
				return current;
			}
			for (int i = 0; i < current.childCount; i++)
			{
				Transform val = FindRecursive(current.GetChild(i), targetName);
				if ((Object)(object)val != (Object)null)
				{
					return val;
				}
			}
			return null;
		}

		private void CreateParticleStreamSystem()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_streamEmitterObject != (Object)null))
			{
				_streamEmitterObject = new GameObject("GoldRain_StreamEmitter");
				_streamEmitterObject.transform.SetParent(((Component)this).transform, false);
				Shader val = Shader.Find("Particles/Standard Unlit") ?? Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default");
				_streamMaterial = new Material(val)
				{
					name = "GoldRain_PeeStreamMat"
				};
				_streamMaterial.mainTexture = (Texture)(object)GetOrCreateParticleTexture();
				_lineRenderer = _streamEmitterObject.AddComponent<LineRenderer>();
				_lineRenderer.useWorldSpace = true;
				_lineRenderer.positionCount = 20;
				_lineRenderer.startWidth = 0.024f;
				_lineRenderer.endWidth = 0.042f;
				((Renderer)_lineRenderer).material = _streamMaterial;
				_lineRenderer.numCapVertices = 4;
				_lineRenderer.numCornerVertices = 4;
				_lineRenderer.alignment = (LineAlignment)0;
				((Renderer)_lineRenderer).enabled = false;
				Gradient val2 = new Gradient();
				val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
				{
					new GradientColorKey(new Color(1f, 0.9f, 0.05f), 0f),
					new GradientColorKey(new Color(1f, 0.74f, 0f), 0.7f),
					new GradientColorKey(new Color(0.92f, 0.62f, 0f), 1f)
				}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
				{
					new GradientAlphaKey(0.92f, 0f),
					new GradientAlphaKey(0.85f, 0.7f),
					new GradientAlphaKey(0.4f, 1f)
				});
				_lineRenderer.colorGradient = val2;
				_particleSystem = _streamEmitterObject.AddComponent<ParticleSystem>();
				_particleRenderer = _streamEmitterObject.GetComponent<ParticleSystemRenderer>();
				((Renderer)_particleRenderer).material = _streamMaterial;
				_particleRenderer.renderMode = (ParticleSystemRenderMode)0;
				MainModule main = _particleSystem.main;
				((MainModule)(ref main)).duration = 1f;
				((MainModule)(ref main)).loop = true;
				((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.35f);
				((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.4f, 1.1f);
				((MainModule)(ref main)).startSize = new MinMaxCurve(0.025f, 0.05f);
				((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(1.2f);
				((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
				((MainModule)(ref main)).maxParticles = 25;
				((MainModule)(ref main)).playOnAwake = false;
				EmissionModule emission = _particleSystem.emission;
				((EmissionModule)(ref emission)).enabled = true;
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(22f);
				ShapeModule shape = _particleSystem.shape;
				((ShapeModule)(ref shape)).enabled = true;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4;
				((ShapeModule)(ref shape)).angle = 45f;
				((ShapeModule)(ref shape)).radius = 0.04f;
				ColorOverLifetimeModule colorOverLifetime = _particleSystem.colorOverLifetime;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
				((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val2);
			}
		}

		private void CreateAudioSystem()
		{
			if (!((Object)(object)_audioSource != (Object)null) && !((Object)(object)_streamEmitterObject == (Object)null))
			{
				_audioSource = _streamEmitterObject.AddComponent<AudioSource>();
				_audioSource.clip = GetFermenterClip() ?? GetOrCreateStreamClip();
				_audioSource.loop = true;
				_audioSource.spatialBlend = 1f;
				_audioSource.minDistance = 0.5f;
				_audioSource.maxDistance = 8f;
				_audioSource.rolloffMode = (AudioRolloffMode)1;
				_audioSource.dopplerLevel = 0f;
				_audioSource.playOnAwake = false;
				_audioSource.volume = 0f;
			}
		}

		private static AudioClip? GetFermenterClip()
		{
			if ((Object)(object)s_fermenterClip != (Object)null)
			{
				return s_fermenterClip;
			}
			try
			{
				if ((Object)(object)ZNetScene.instance != (Object)null)
				{
					GameObject prefab = ZNetScene.instance.GetPrefab("fermenter");
					if ((Object)(object)prefab != (Object)null)
					{
						Fermenter component = prefab.GetComponent<Fermenter>();
						if ((Object)(object)component != (Object)null && component.m_tapEffects != null && component.m_tapEffects.m_effectPrefabs != null)
						{
							EffectData[] effectPrefabs = component.m_tapEffects.m_effectPrefabs;
							foreach (EffectData val in effectPrefabs)
							{
								if ((Object)(object)val?.m_prefab != (Object)null)
								{
									ZSFX componentInChildren = val.m_prefab.GetComponentInChildren<ZSFX>();
									if ((Object)(object)componentInChildren != (Object)null && componentInChildren.m_audioClips != null && componentInChildren.m_audioClips.Length != 0)
									{
										s_fermenterClip = componentInChildren.m_audioClips[0];
										return s_fermenterClip;
									}
									AudioSource componentInChildren2 = val.m_prefab.GetComponentInChildren<AudioSource>();
									if ((Object)(object)componentInChildren2 != (Object)null && (Object)(object)componentInChildren2.clip != (Object)null)
									{
										s_fermenterClip = componentInChildren2.clip;
										return s_fermenterClip;
									}
								}
							}
						}
					}
				}
			}
			catch
			{
			}
			return null;
		}

		public void SetPeeing(bool state)
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			if (IsPeeing == state)
			{
				return;
			}
			IsPeeing = state;
			if (state)
			{
				EnsureInitialized();
				if ((Object)(object)_player != (Object)null)
				{
					((Humanoid)_player).HideHandItems(false, false);
				}
				if ((Object)(object)_player != (Object)null)
				{
					_lastHealth = ((Character)_player).GetHealth();
				}
				Quaternion val = (((Object)(object)_spine != (Object)null) ? _spine.rotation : ((Component)this).transform.rotation);
				Quaternion val2 = (((Object)(object)_leftUpperArm != (Object)null) ? _leftUpperArm.rotation : ((Component)this).transform.rotation);
				Quaternion val3 = (((Object)(object)_rightUpperArm != (Object)null) ? _rightUpperArm.rotation : ((Component)this).transform.rotation);
				Quaternion val4 = (((Object)(object)_leftLowerArm != (Object)null) ? _leftLowerArm.rotation : ((Component)this).transform.rotation);
				Quaternion val5 = (((Object)(object)_rightLowerArm != (Object)null) ? _rightLowerArm.rotation : ((Component)this).transform.rotation);
				Quaternion val6 = (((Object)(object)_leftHand != (Object)null) ? _leftHand.rotation : ((Component)this).transform.rotation);
				Quaternion val7 = (((Object)(object)_rightHand != (Object)null) ? _rightHand.rotation : ((Component)this).transform.rotation);
				_fixedSpineRot = Quaternion.AngleAxis(-5f, ((Component)this).transform.right) * val;
				_fixedUpperArmL = Quaternion.AngleAxis(-28f, ((Component)this).transform.right) * Quaternion.AngleAxis(22f, ((Component)this).transform.up) * val2;
				_fixedUpperArmR = Quaternion.AngleAxis(-28f, ((Component)this).transform.right) * Quaternion.AngleAxis(-22f, ((Component)this).transform.up) * val3;
				_fixedLowerArmL = Quaternion.AngleAxis(-65f, ((Component)this).transform.right) * Quaternion.AngleAxis(35f, ((Component)this).transform.up) * val4;
				_fixedLowerArmR = Quaternion.AngleAxis(-65f, ((Component)this).transform.right) * Quaternion.AngleAxis(-35f, ((Component)this).transform.up) * val5;
				_fixedHandL = Quaternion.AngleAxis(-15f, ((Component)this).transform.right) * Quaternion.AngleAxis(25f, ((Component)this).transform.up) * val6;
				_fixedHandR = Quaternion.AngleAxis(-15f, ((Component)this).transform.right) * Quaternion.AngleAxis(-25f, ((Component)this).transform.up) * val7;
				_hasFixedPose = true;
				_poseBlend = 0f;
				_currentAimYaw = 0f;
				_currentAimPitch = 0f;
				if ((Object)(object)_lineRenderer != (Object)null)
				{
					((Renderer)_lineRenderer).enabled = true;
				}
				if ((Object)(object)_particleSystem != (Object)null)
				{
					_particleSystem.Play();
				}
				if ((Object)(object)_audioSource != (Object)null)
				{
					AudioClip fermenterClip = GetFermenterClip();
					if ((Object)(object)fermenterClip != (Object)null && (Object)(object)_audioSource.clip != (Object)(object)fermenterClip)
					{
						_audioSource.clip = fermenterClip;
					}
					_audioSource.loop = true;
					if (!_audioSource.isPlaying)
					{
						_audioSource.volume = 0f;
						_audioSource.Play();
					}
					_targetVolume = ((ModConfig.AudioVolume != null) ? ModConfig.AudioVolume.Value : 0.35f) * 0.2f;
				}
				if ((Object)(object)_player != (Object)null && (Object)(object)_player == (Object)(object)Player.m_localPlayer && ModConfig.ShowNotifications != null && ModConfig.ShowNotifications.Value)
				{
					((Character)_player).Message((MessageType)2, "<color=#FFE600>Облегчение...</color>", 0, (Sprite)null, false);
				}
			}
			else
			{
				if ((Object)(object)_lineRenderer != (Object)null)
				{
					((Renderer)_lineRenderer).enabled = false;
				}
				if ((Object)(object)_particleSystem != (Object)null)
				{
					_particleSystem.Stop(true, (ParticleSystemStopBehavior)0);
				}
				_targetVolume = 0f;
				_hasFixedPose = false;
				_poseBlend = 0f;
				RestoreWeapons();
				if ((Object)(object)_player != (Object)null && (Object)(object)_player == (Object)(object)Player.m_localPlayer && ModConfig.ShowNotifications != null && ModConfig.ShowNotifications.Value)
				{
					((Character)_player).Message((MessageType)1, "<color=#FFE600>Готово.</color>", 0, (Sprite)null, false);
				}
			}
		}

		private void RestoreWeapons()
		{
			if ((Object)(object)_player != (Object)null)
			{
				try
				{
					s_showHandItems?.Invoke(_player, new object[2] { false, false });
				}
				catch
				{
				}
			}
		}

		public void StopPeeing()
		{
			if (IsPeeing)
			{
				SetPeeing(state: false);
				if ((Object)(object)_player != (Object)null && (Object)(object)_player == (Object)(object)Player.m_localPlayer)
				{
					PeeNetwork.SendPeeState(_player, state: false);
				}
			}
		}

		private void Update()
		{
			if (IsPeeing)
			{
				_targetVolume = ((ModConfig.AudioVolume != null) ? ModConfig.AudioVolume.Value : 0.35f) * 0.2f;
			}
			if ((Object)(object)_audioSource != (Object)null && _audioSource.isPlaying)
			{
				_audioSource.volume = Mathf.MoveTowards(_audioSource.volume, _targetVolume, Time.deltaTime * 3.5f);
				if (_targetVolume <= 0f && _audioSource.volume <= 0.01f)
				{
					_audioSource.Stop();
				}
			}
		}

		private void LateUpdate()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			if (!IsPeeing)
			{
				return;
			}
			if ((Object)(object)_player != (Object)null)
			{
				if (((Character)_player).IsDead() || ((Character)_player).IsSwimming())
				{
					StopPeeing();
					return;
				}
				if ((Object)(object)_player == (Object)(object)Player.m_localPlayer)
				{
					Vector3 velocity = ((Character)_player).GetVelocity();
					Vector3 val = default(Vector3);
					((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
					if (((ZInput.GetButton("Forward") || ZInput.GetButton("Backward") || ZInput.GetButton("Left") || ZInput.GetButton("Right")) && ((Vector3)(ref val)).magnitude > 0.6f) || ((Vector3)(ref val)).magnitude > 1.3f || ((Character)_player).IsRunning())
					{
						StopPeeing();
						return;
					}
					if (velocity.y > 2.8f || velocity.y < -4f)
					{
						StopPeeing();
						return;
					}
					if (((Character)_player).InAttack() || ((Character)_player).InDodge())
					{
						StopPeeing();
						return;
					}
					float health = ((Character)_player).GetHealth();
					if (health < _lastHealth - 1f)
					{
						_lastHealth = health;
						StopPeeing();
						return;
					}
					_lastHealth = Mathf.Max(_lastHealth, health);
				}
			}
			UpdateEmitterTransform();
			ApplyProceduralPose();
			UpdateStreamArc();
		}

		private void ApplyProceduralPose()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			if (!_hasFixedPose)
			{
				return;
			}
			_poseBlend = Mathf.MoveTowards(_poseBlend, 1f, Time.deltaTime * 10f);
			Quaternion val = Quaternion.AngleAxis(_currentAimYaw * 0.35f, ((Component)this).transform.up);
			Quaternion val2 = Quaternion.AngleAxis(_currentAimPitch * 0.15f, ((Component)this).transform.right);
			Quaternion val3 = val * val2;
			Quaternion val4 = val3 * _fixedSpineRot;
			Quaternion val5 = val3 * _fixedUpperArmL;
			Quaternion val6 = val3 * _fixedUpperArmR;
			Quaternion val7 = val3 * _fixedLowerArmL;
			Quaternion val8 = val3 * _fixedLowerArmR;
			Quaternion val9 = val3 * _fixedHandL;
			Quaternion val10 = val3 * _fixedHandR;
			if (_poseBlend >= 0.999f)
			{
				if ((Object)(object)_spine != (Object)null)
				{
					_spine.rotation = val4;
				}
				if ((Object)(object)_leftUpperArm != (Object)null)
				{
					_leftUpperArm.rotation = val5;
				}
				if ((Object)(object)_rightUpperArm != (Object)null)
				{
					_rightUpperArm.rotation = val6;
				}
				if ((Object)(object)_leftLowerArm != (Object)null)
				{
					_leftLowerArm.rotation = val7;
				}
				if ((Object)(object)_rightLowerArm != (Object)null)
				{
					_rightLowerArm.rotation = val8;
				}
				if ((Object)(object)_leftHand != (Object)null)
				{
					_leftHand.rotation = val9;
				}
				if ((Object)(object)_rightHand != (Object)null)
				{
					_rightHand.rotation = val10;
				}
			}
			else
			{
				if ((Object)(object)_spine != (Object)null)
				{
					_spine.rotation = Quaternion.Slerp(_spine.rotation, val4, _poseBlend);
				}
				if ((Object)(object)_leftUpperArm != (Object)null)
				{
					_leftUpperArm.rotation = Quaternion.Slerp(_leftUpperArm.rotation, val5, _poseBlend);
				}
				if ((Object)(object)_rightUpperArm != (Object)null)
				{
					_rightUpperArm.rotation = Quaternion.Slerp(_rightUpperArm.rotation, val6, _poseBlend);
				}
				if ((Object)(object)_leftLowerArm != (Object)null)
				{
					_leftLowerArm.rotation = Quaternion.Slerp(_leftLowerArm.rotation, val7, _poseBlend);
				}
				if ((Object)(object)_rightLowerArm != (Object)null)
				{
					_rightLowerArm.rotation = Quaternion.Slerp(_rightLowerArm.rotation, val8, _poseBlend);
				}
				if ((Object)(object)_leftHand != (Object)null)
				{
					_leftHand.rotation = Quaternion.Slerp(_leftHand.rotation, val9, _poseBlend);
				}
				if ((Object)(object)_rightHand != (Object)null)
				{
					_rightHand.rotation = Quaternion.Slerp(_rightHand.rotation, val10, _poseBlend);
				}
			}
		}

		private void UpdateEmitterTransform()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: 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_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or mis