Decompiled source of The Timestopper v1.5.3

The Timestopper.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using PluginConfiguratorComponents;
using Sandbox.Arm;
using TMPro;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("The Timestopper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("The Timestopper")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c602a639-0d74-4ae5-a633-6ae2db957a9e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace The_Timestopper;

[Serializable]
public class TimestopperProgress
{
	public bool hasArm;

	public bool equippedArm;

	public bool firstWarning;

	public int upgradeCount;

	public float maxTime = 3f;

	public float version = 0.9f;

	public const float latestVersion = 1f;

	private const string PROGRESS_FILE = "timestopper.state";

	private static TimestopperProgress inst;

	public static bool HasArm
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return timestopperProgress.hasArm;
		}
	}

	public static bool EquippedArm
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return timestopperProgress.equippedArm;
		}
	}

	public static bool FirstWarning
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return timestopperProgress.firstWarning;
		}
	}

	public static int UpgradeCount
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return timestopperProgress.upgradeCount;
		}
	}

	public static string UpgradeText
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return "<align=\"center\"><color=#FFFF42>" + GenerateTextBar('▮', timestopperProgress.upgradeCount) + "</color>";
		}
	}

	public static float MaxTime
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return timestopperProgress.maxTime;
		}
	}

	public static float UpgradeCost
	{
		get
		{
			TimestopperProgress timestopperProgress = Read();
			return 150000 + timestopperProgress.upgradeCount * 66000;
		}
	}

	public int upgradeCost => 150000 + upgradeCount * 66000;

	public new static string ToString()
	{
		TimestopperProgress timestopperProgress = Read();
		return $"Timestopper saved progress:\r\n            - has arm: {timestopperProgress.hasArm}\r\n            - equipped: {timestopperProgress.equippedArm}\r\n            - firstwarning: {timestopperProgress.firstWarning}\r\n            - upgrades: {timestopperProgress.upgradeCount}\r\n            - max time: {timestopperProgress.maxTime}\r\n            - version: {timestopperProgress.version}";
	}

	private static string GenerateTextBar(char c, int b)
	{
		string text = "";
		for (int i = 0; i < b; i++)
		{
			text += c;
		}
		return text;
	}

	public static void UpgradeArm()
	{
		TimestopperProgress timestopperProgress = Read();
		GameProgressSaver.AddMoney(-timestopperProgress.upgradeCost);
		timestopperProgress.maxTime += 1f + 1f / ((float)timestopperProgress.upgradeCount + 0.5f);
		timestopperProgress.upgradeCount++;
		Write(timestopperProgress);
	}

	public static void ForceDowngradeArm()
	{
		TimestopperProgress timestopperProgress = Read();
		if (Timestopper.maxUpgrades.value < 0)
		{
			Timestopper.maxUpgrades.value = 1;
		}
		while (timestopperProgress.upgradeCount > Timestopper.maxUpgrades.value)
		{
			timestopperProgress.upgradeCount--;
			timestopperProgress.maxTime -= 1f + 1f / ((float)timestopperProgress.upgradeCount + 0.5f);
		}
		Write(timestopperProgress);
	}

	public static void AcceptWarning()
	{
		TimestopperProgress timestopperProgress = Read();
		timestopperProgress.firstWarning = true;
		Write(timestopperProgress);
	}

	public static void GiveArm()
	{
		TimestopperProgress timestopperProgress = Read();
		timestopperProgress.hasArm = true;
		timestopperProgress.equippedArm = true;
		Write(timestopperProgress);
		Timestopper.mls.LogInfo((object)"Received Golden Arm");
		Playerstopper.Instance.EquipTimeArm();
	}

	public static void ChangeEquipmentStatus()
	{
		if ((Object)(object)Timestopper.LatestTerminal != (Object)null)
		{
			EquipArm(((TMP_Text)((Component)Timestopper.LatestTerminal.transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window/Variation Screen/Variations/Arm Panel (Gold)/Equipment/Equipment Status/Text (TMP)")).GetComponent<TextMeshProUGUI>()).text[0] == 'E');
		}
		else
		{
			Timestopper.mls.LogWarning((object)"LatestTerminal is Null!");
		}
		TimeHUD.ReconsiderAll();
		Timestopper.Log("Changed equipment status", extensive: true, 1);
	}

	public static void EquipArm(bool equipped)
	{
		TimestopperProgress timestopperProgress = Read();
		if (!((Object)(object)Playerstopper.Instance.timeArm == (Object)null))
		{
			if (timestopperProgress.hasArm)
			{
				timestopperProgress.equippedArm = equipped;
				Playerstopper.Instance.timeArm.SetActive(equipped);
				Timestopper.Log("Gold Arm Equipment Status changed: " + timestopperProgress.equippedArm, extensive: true, 1);
				Write(timestopperProgress);
			}
			else
			{
				Timestopper.Log("Invalid request of arm equipment, user doesn't have the arm yet!", extensive: true, 2);
				GiveArm();
			}
		}
	}

	public static void Reset()
	{
		Write(new TimestopperProgress());
	}

	public static TimestopperProgress Read()
	{
		try
		{
			string path = Path.Combine(GameProgressSaver.SavePath, "timestopper.state");
			if (File.Exists(path))
			{
				string text = File.ReadAllText(path);
				inst = JsonUtility.FromJson<TimestopperProgress>(text);
				if (inst == null)
				{
					inst = new TimestopperProgress();
				}
				if (inst.version < 1f && inst.version == 0.9f)
				{
					inst.version = 1f;
				}
			}
			else
			{
				inst = new TimestopperProgress();
			}
		}
		catch (Exception ex)
		{
			Timestopper.mls.LogError((object)$"Failed to read progress: {ex.Message}, resetting save file {GameProgressSaver.currentSlot}");
			inst = new TimestopperProgress();
			Write(inst);
		}
		return inst;
	}

	public static void Write(TimestopperProgress progress)
	{
		try
		{
			string path = Path.Combine(GameProgressSaver.SavePath, "timestopper.state");
			string contents = JsonUtility.ToJson((object)progress, true);
			File.WriteAllText(path, contents);
		}
		catch (Exception ex)
		{
			Timestopper.mls.LogError((object)("Failed to write progress: " + ex.Message));
		}
	}
}
[BepInPlugin("dev.galvin.timestopper", "The Timestopper", "1.5.3")]
public class Timestopper : BaseUnityPlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<string, bool> <>9__95_0;

		public static Func<string, bool> <>9__95_1;

		public static Func<string, bool> <>9__95_2;

		public static OnClick <>9__96_2;

		public static IntValueChangeEventDelegate <>9__96_3;

		public static OnClick <>9__96_4;

		public static Func<string, bool> <>9__99_0;

		public static Func<string, bool> <>9__99_1;

		public static Func<string, bool> <>9__99_2;

		public static Func<bool> <>9__107_0;

		public static Action <>9__109_0;

		internal bool <ReloadSoundProfilesList>b__95_0(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal bool <ReloadSoundProfilesList>b__95_1(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal bool <ReloadSoundProfilesList>b__95_2(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal void <InitializeConfig>b__96_2()
		{
			Application.OpenURL(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds"));
		}

		internal void <InitializeConfig>b__96_3(IntValueChangeEvent e)
		{
			if (e.value < 1)
			{
				e.value = 1;
				maxUpgrades.value = 1;
			}
		}

		internal void <InitializeConfig>b__96_4()
		{
			TimestopperProgress.Reset();
		}

		internal bool <LoadSoundProfiles>b__99_0(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal bool <LoadSoundProfiles>b__99_1(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal bool <LoadSoundProfiles>b__99_2(string file)
		{
			return file.EndsWith(".wav") || file.EndsWith(".ogg");
		}

		internal bool <InstantiateMenuItems>b__107_0()
		{
			return LoadDone;
		}

		internal void <OnSceneLoaded>b__109_0()
		{
			((MonoBehaviour)MonoSingleton<HudMessageReceiver>.Instance).Invoke("Done", 0f);
			firstLoad = false;
		}
	}

	public const string GUID = "dev.galvin.timestopper";

	public const string Name = "The Timestopper";

	public const string Version = "1.5.3";

	private readonly Harmony harmony = new Harmony("dev.galvin.timestopper");

	public static Timestopper Instance;

	public static ManualLogSource mls = Logger.CreateLogSource("The Timestopper");

	public const string ARM_PICKUP_MESSAGE = "<color=#FFFF23>TIMESTOPPER</color>: Use \"<color=#FF4223>{0}</color>\" to stop and start time at will.";

	public const string ARM_DESCRIPTION = "A Godfist that <color=#FFFF43>stops</color> time.\r\n\r\nRecharges very slow, but <color=#FF4343>parrying</color> helps it recharge faster.\r\n\r\nCan be <color=#FFFF24>upgraded</color> through terminals.\r\n";

	public const string ARM_NEW_MESSAGE = "Somewhere in the depths of <color=#FF0000>Violence /// First</color>, a new <color=#FFFF23>golden</color> door appears";

	public const string TIMESTOP_STYLE = "<color=#FFCF21>TIME STOP</color>";

	public static Shader grayscaleShader;

	public static Shader depthShader;

	public static AudioClip[] TimestopSounds;

	public static AudioClip[] StoppedTimeAmbiences;

	public static AudioClip[] TimestartSounds;

	public static Texture2D armGoldLogo;

	public static Texture2D modLogo;

	public static GameObject armTimeText;

	public static Texture2D armGoldColor;

	public static GameObject armGoldObj;

	public static RuntimeAnimatorController armGoldAC;

	public AssetBundle bundle;

	public static GameObject Dummy;

	public static GameObject LatestTerminal;

	public static GameObject TheCube;

	public static GameObject MenuCanvas;

	public static bool TimeStop;

	public static float StoppedTimeAmount;

	public static bool LoadDone;

	public static float realTimeScale = 1f;

	public static bool fixedCall;

	public static bool firstLoad = true;

	public static bool cybergrind;

	public static int cybergrindWave;

	public static bool UnscaleTimeSince;

	public static PrivateInsideTimer messageTimer = new PrivateInsideTimer();

	private GameObject currentLevelInfo;

	private TimeSince timeSinceLastTimestop = TimeSince.op_Implicit(0f);

	private IEnumerator timeStopper;

	private IEnumerator timeStarter;

	public static bool Compatability_JukeBox;

	public static KeyCodeField stopKey;

	public static StringListField stopSound;

	public static StringListField stoppedSound;

	public static StringListField startSound;

	public static ButtonField soundFileButton;

	public static ButtonField soundReloadButton;

	public static FloatField stopSpeed;

	public static FloatField startSpeed;

	public static FloatField affectSpeed;

	public static FloatField animationSpeed;

	public static FloatSliderField soundEffectVolume;

	public static BoolField filterMusic;

	public static FloatSliderField stoppedMusicPitch;

	public static FloatSliderField stoppedMusicVolume;

	public static BoolField grayscale;

	public static BoolField bubbleEffect;

	public static FloatField overallEffectIntensity;

	public static FloatField grayscaleIntensity;

	public static FloatField bubbleSmoothness;

	public static FloatField colorInversionArea;

	public static FloatField skyTransitionTreshold;

	public static FloatField bubbleDistance;

	public static FloatField bubbleProgression;

	public static ColorField grayscaleColorSpace;

	public static FloatField grayscaleColorSpaceIntensity;

	public static BoolField timestopHardDamage;

	public static IntField maxUpgrades;

	public static BoolField forceDowngrade;

	public static BoolField specialMode;

	public static BoolField extensiveLogging;

	public static FloatField lowerTreshold;

	public static FloatField refillMultiplier;

	public static FloatField bonusTimeForParry;

	public static FloatField antiHpMultiplier;

	public static ButtonField resetSaveButton;

	public static ColorField timeJuiceColorNormal;

	public static ColorField timeJuiceColorInsufficient;

	public static ColorField timeJuiceColorUsing;

	public static ColorField timeJuiceColorNoCooldown;

	private PluginConfigurator config;

	public static GameObject newTimeArm;

	public static GameObject newArmAltar;

	public static bool frameLaterer;

	private bool menuOpenLastFrame;

	private float time;

	public static GameObject Player
	{
		get
		{
			if ((Object)(object)MonoSingleton<NewMovement>.Instance == (Object)null)
			{
				return null;
			}
			return ((Component)MonoSingleton<NewMovement>.Instance).gameObject;
		}
	}

	[DefaultValue(1f)]
	public static float playerTimeScale { get; private set; }

	public static float playerDeltaTime
	{
		get
		{
			if (fixedCall)
			{
				return Time.fixedDeltaTime;
			}
			if (TimeStop)
			{
				return Time.unscaledDeltaTime * playerTimeScale;
			}
			return Time.deltaTime;
		}
	}

	public static float playerFixedDeltaTime
	{
		get
		{
			if (fixedCall)
			{
				return Time.fixedDeltaTime;
			}
			if (TimeStop)
			{
				return Time.fixedDeltaTime * playerTimeScale;
			}
			return Time.fixedDeltaTime;
		}
	}

	public static bool forbiddenScene
	{
		get
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			int result;
			if (!(((Scene)(ref activeScene)).name == "b3e7f2f8052488a45b35549efb98d902"))
			{
				activeScene = SceneManager.GetActiveScene();
				if (!(((Scene)(ref activeScene)).name == "Bootstrap"))
				{
					activeScene = SceneManager.GetActiveScene();
					if (!(((Scene)(ref activeScene)).name == "241a6a8caec7a13438a5ee786040de32"))
					{
						activeScene = SceneManager.GetActiveScene();
						if (!(((Scene)(ref activeScene)).name == "4c18368dae54f154da2ae65baf0e630e"))
						{
							activeScene = SceneManager.GetActiveScene();
							result = ((((Scene)(ref activeScene)).name == "d8e7c3bbb0c2f3940aa7c51dc5849781") ? 1 : 0);
							goto IL_007f;
						}
					}
				}
			}
			result = 1;
			goto IL_007f;
			IL_007f:
			return (byte)result != 0;
		}
	}

	public static void Log(string log, bool extensive = false, int err_lvl = 0)
	{
		if (!extensive || extensiveLogging.value)
		{
			if (err_lvl == 0)
			{
				mls.LogDebug((object)log);
			}
			if (err_lvl == 1)
			{
				mls.LogInfo((object)log);
			}
			if (err_lvl == 2)
			{
				mls.LogWarning((object)log);
			}
			if (err_lvl == 3)
			{
				mls.LogError((object)log);
			}
			if (err_lvl == 4)
			{
				mls.LogFatal((object)log);
			}
		}
	}

	public static void FixedUpdateFix(Transform target)
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		if ((Object)(object)((Component)target).GetComponent(typeof(MonoBehaviour)) != (Object)null && (Object)(object)((Component)target).GetComponent<FixedUpdateCaller>() == (Object)null)
		{
			((Component)target).gameObject.AddComponent<FixedUpdateCaller>();
		}
		foreach (Transform item in target)
		{
			Transform val = item;
			if ((Object)(object)((Component)val).GetComponent(typeof(MonoBehaviour)) != (Object)null && (Object)(object)((Component)val).GetComponent<FixedUpdateCaller>() == (Object)null)
			{
				((Component)val).gameObject.AddComponent<FixedUpdateCaller>();
			}
			FixedUpdateFix(val);
		}
	}

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		Log("The Timestopper has awakened!");
		InitializeConfig();
		playerTimeScale = 1f;
		harmony.PatchAll();
		TheCube = GameObject.CreatePrimitive((PrimitiveType)3);
		((Object)TheCube).name = "The Cube";
		SceneManager.sceneLoaded += OnSceneLoaded;
		SceneManager.sceneUnloaded += OnSceneUnloaded;
	}

	public void ReloadStringListField(StringListField slf, IEnumerable<string> values)
	{
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Expected O, but got Unknown
		FieldInfo field = typeof(StringListField).GetField("values", BindingFlags.Instance | BindingFlags.NonPublic);
		FieldInfo field2 = typeof(StringListField).GetField("currentUi", BindingFlags.Instance | BindingFlags.NonPublic);
		string[] source = (values as string[]) ?? values.ToArray();
		field?.SetValue(slf, source.ToList());
		if (!source.ToArray().Contains(slf.defaultValue))
		{
			slf.defaultValue = source.ToList()[0];
		}
		if (field2 != null && field2.GetValue(slf) != null)
		{
			((ConfigDropdownField)field2.GetValue(slf)).dropdown.options.Clear();
			string[] array = source.ToArray();
			foreach (string text in array)
			{
				((ConfigDropdownField)field2.GetValue(slf)).dropdown.options.Add(new OptionData(text));
			}
		}
		typeof(ConfigPanel).GetMethod("ProtectedInternalMethod", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)?.Invoke(((ConfigField)slf).parentPanel, null);
	}

	public void ReloadSoundProfilesList()
	{
		//IL_0528: Unknown result type (might be due to invalid IL or missing references)
		//IL_0532: Expected O, but got Unknown
		//IL_058e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0598: Expected O, but got Unknown
		//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ff: Expected O, but got Unknown
		bool flag = false;
		string[] array = new string[3] { "Stopping", "Stopped", "Starting" };
		if (Directory.Exists(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds")))
		{
			string[] array2 = array;
			foreach (string path in array2)
			{
				if (!Directory.Exists(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", path)) || Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", path), "*.*").Length == 0)
				{
					flag = true;
					break;
				}
			}
		}
		else
		{
			flag = true;
		}
		if (flag)
		{
			Directory.CreateDirectory(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds"));
			string[] array3 = array;
			foreach (string sounddirectory in array3)
			{
				Directory.CreateDirectory(Path.Combine(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", sounddirectory)));
				foreach (string item in from filename in Directory.GetFiles(Path.Combine(Paths.PluginPath, "GalvinVoltag-The_Timestopper"), "*.*").Select(Path.GetFileName)
					where filename.EndsWith(".ogg") && filename.StartsWith(sounddirectory)
					select filename)
				{
					Log("copying over sound file: " + sounddirectory + "/" + item, extensive: false, 3);
					if (!File.Exists(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", sounddirectory, item)))
					{
						File.Copy(Path.Combine(Paths.PluginPath, "GalvinVoltag-The_Timestopper", sounddirectory + "-" + item.TrimStart((sounddirectory + "-").ToCharArray())), Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", sounddirectory, item.TrimStart((sounddirectory + "-").ToCharArray())));
					}
				}
			}
			if (!File.Exists(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "README.txt")))
			{
				File.Copy(Path.Combine(Paths.PluginPath, "GalvinVoltag-The_Timestopper", "Sounds-readme.txt"), Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "README.txt"));
			}
		}
		string[] array4 = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Stopping"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).Select(Path.GetFileNameWithoutExtension).ToArray();
		string[] array5 = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Stopped"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).Select(Path.GetFileNameWithoutExtension).ToArray();
		string[] array6 = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Starting"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).Select(Path.GetFileNameWithoutExtension).ToArray();
		if (array4.Length < 1)
		{
			Log("No time stop sounds found!", extensive: false, 3);
			array4 = new string[1] { "FILE ERROR" };
		}
		if (array5.Length < 1)
		{
			Log("No time stop sounds found!", extensive: false, 3);
			array5 = new string[1] { "FILE ERROR" };
		}
		if (array6.Length < 1)
		{
			Log("No time stop sounds found!", extensive: false, 3);
			array6 = new string[1] { "FILE ERROR" };
		}
		string text = "Classic";
		string text2 = "Classic";
		string text3 = "Classic";
		if (!array4.Contains(text))
		{
			text = array4[0];
		}
		if (!array5.Contains(text2))
		{
			text2 = array5[0];
		}
		if (!array6.Contains(text3))
		{
			text3 = array6[0];
		}
		if (stopSound == null)
		{
			stopSound = new StringListField(config.rootPanel, "Timestop Sound", "timestopprofile", array4, text);
		}
		else
		{
			ReloadStringListField(stopSound, array4);
		}
		if (!array4.Contains(stopSound.value))
		{
			stopSound.value = array4[0];
		}
		if (stoppedSound == null)
		{
			stoppedSound = new StringListField(config.rootPanel, "Stopped Time Ambience", "ambienceprofile", array5, text2);
		}
		else
		{
			ReloadStringListField(stoppedSound, array5);
		}
		if (!array5.Contains(stoppedSound.value))
		{
			stoppedSound.value = array5[0];
		}
		if (startSound == null)
		{
			startSound = new StringListField(config.rootPanel, "Timestart Sound", "timestartprofile", array6, text3);
		}
		else
		{
			ReloadStringListField(startSound, array6);
		}
		if (!array6.Contains(startSound.value))
		{
			startSound.value = array6[0];
		}
	}

	private void InitializeConfig()
	{
		//IL_003d: 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_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Expected O, but got Unknown
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Expected O, but got Unknown
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Expected O, but got Unknown
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Expected O, but got Unknown
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Expected O, but got Unknown
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Expected O, but got Unknown
		//IL_013c: 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_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Expected O, but got Unknown
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Expected O, but got Unknown
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Expected O, but got Unknown
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Expected O, but got Unknown
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Expected O, but got Unknown
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Expected O, but got Unknown
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Expected O, but got Unknown
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Expected O, but got Unknown
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Expected O, but got Unknown
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Expected O, but got Unknown
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0285: Expected O, but got Unknown
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Expected O, but got Unknown
		//IL_02b9: 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_02c8: Expected O, but got Unknown
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Expected O, but got Unknown
		//IL_02f2: 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_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Expected O, but got Unknown
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0376: Expected O, but got Unknown
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a9: Expected O, but got Unknown
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c9: Expected O, but got Unknown
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Expected O, but got Unknown
		//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0405: Expected O, but got Unknown
		//IL_041b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Expected O, but got Unknown
		//IL_045f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0477: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_0499: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a5: Expected O, but got Unknown
		//IL_043e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Expected O, but got Unknown
		//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f3: Expected O, but got Unknown
		//IL_050d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Expected O, but got Unknown
		//IL_052d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0532: Unknown result type (might be due to invalid IL or missing references)
		//IL_053f: Expected O, but got Unknown
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0567: Unknown result type (might be due to invalid IL or missing references)
		//IL_0596: Unknown result type (might be due to invalid IL or missing references)
		//IL_059b: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a5: Expected O, but got Unknown
		//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dd: Expected O, but got Unknown
		//IL_0606: Unknown result type (might be due to invalid IL or missing references)
		//IL_060b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0615: Expected O, but got Unknown
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0643: Unknown result type (might be due to invalid IL or missing references)
		//IL_064d: Expected O, but got Unknown
		//IL_065d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0675: Unknown result type (might be due to invalid IL or missing references)
		//IL_0690: Unknown result type (might be due to invalid IL or missing references)
		//IL_0696: Expected O, but got Unknown
		//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c2: Expected O, but got Unknown
		//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d8: Expected O, but got Unknown
		//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f2: Expected O, but got Unknown
		//IL_0702: Unknown result type (might be due to invalid IL or missing references)
		//IL_070c: Expected O, but got Unknown
		//IL_0721: Unknown result type (might be due to invalid IL or missing references)
		//IL_072b: Expected O, but got Unknown
		//IL_04be: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c9: Expected O, but got Unknown
		//IL_0744: Unknown result type (might be due to invalid IL or missing references)
		//IL_0749: Unknown result type (might be due to invalid IL or missing references)
		//IL_074f: Expected O, but got Unknown
		if (config != null)
		{
			return;
		}
		config = PluginConfigurator.Create("The Timestopper", "dev.galvin.timestopper");
		new ConfigSpace(config.rootPanel, 6f);
		new ConfigHeader(config.rootPanel, "-- GENERAL --", 24);
		stopKey = new KeyCodeField(config.rootPanel, "Timestopper Key", "stopkey", (KeyCode)118);
		timestopHardDamage = new BoolField(config.rootPanel, "Timestop Hard Damage", "harddamage", true);
		stopSpeed = new FloatField(config.rootPanel, "Timestop Speed", "stopspeed", 0.6f);
		startSpeed = new FloatField(config.rootPanel, "Timestart Speed", "startspeed", 0.8f);
		affectSpeed = new FloatField(config.rootPanel, "Interaction Speed", "interactionspeed", 1f);
		animationSpeed = new FloatField(config.rootPanel, "Animation Speed", "animationspeed", 1.3f);
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- GRAPHICS --", 24);
		grayscale = new BoolField(config.rootPanel, "Shader Effects", "doGrayscale", false);
		ConfigDivision grayscaleOptions = new ConfigDivision(config.rootPanel, "grayscaleOptions")
		{
			interactable = grayscale.value
		};
		grayscale.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
		{
			((ConfigField)grayscaleOptions).interactable = e.value;
		};
		ConfigPanel val = new ConfigPanel((ConfigPanel)(object)grayscaleOptions, "SHADER OPTIONS", "shaderoptions");
		bubbleEffect = new BoolField(val, "Expanding Bubble Effect", "bubbleeffect", true);
		overallEffectIntensity = new FloatField(val, "Overall Intensity", "overalleffectintensity", 1f);
		grayscaleIntensity = new FloatField(val, "Grayscale Intensity", "grayscaleintensity", 1f);
		bubbleSmoothness = new FloatField(val, "Bubble Border Smoothness", "bubblesmoothness", 0.1f);
		colorInversionArea = new FloatField(val, "Inverted Border Thickness", "colorinversionarea", 0.01f);
		skyTransitionTreshold = new FloatField(val, "Sky Transition Treshold", "skytransitiontreshold", 10f);
		bubbleDistance = new FloatField(val, "Bubble Expansion rate", "bubbledistance", 20f);
		bubbleProgression = new FloatField(val, "Inverse Color Intensity", "bubbleprogression", 1f);
		grayscaleColorSpace = new ColorField(val, "Grayscale Color Space", "grayscalecolorspace", new Color(0.299f, 0.587f, 0.114f));
		grayscaleColorSpaceIntensity = new FloatField(val, "Grayscale Color Space Multiplier", "grayscalecolorspaceintensity", 1f);
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- AUDIO --", 24);
		soundEffectVolume = new FloatSliderField(config.rootPanel, "Sound Effects Volume", "effectvolume", new Tuple<float, float>(0f, 2f), 1f);
		stoppedMusicPitch = new FloatSliderField(config.rootPanel, "Music Pitch in Stopped Time", "musicpitch", new Tuple<float, float>(0f, 1f), 0.6f);
		stoppedMusicVolume = new FloatSliderField(config.rootPanel, "Music volume in Stopped Time", "musicvolume", new Tuple<float, float>(0f, 1f), 0.8f);
		filterMusic = new BoolField(config.rootPanel, "Filter Music in Stopped Time", "filtermusic", false);
		ReloadSoundProfilesList();
		soundReloadButton = new ButtonField(config.rootPanel, "Reload Sound Profiles", "soundprofilebutton");
		soundReloadButton.onClick += (OnClick)delegate
		{
			((MonoBehaviour)this).StartCoroutine(LoadSoundProfiles());
		};
		soundFileButton = new ButtonField(config.rootPanel, "Open Sound Profile Folder", "soundprofilebutton");
		ButtonField obj = soundFileButton;
		object obj2 = <>c.<>9__96_2;
		if (obj2 == null)
		{
			OnClick val2 = delegate
			{
				Application.OpenURL(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds"));
			};
			<>c.<>9__96_2 = val2;
			obj2 = (object)val2;
		}
		obj.onClick += (OnClick)obj2;
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- GAMEPLAY --", 24);
		maxUpgrades = new IntField(config.rootPanel, "Maximum Number of Upgrades", "maxupgrades", 10)
		{
			minimumValue = 1
		};
		IntField obj3 = maxUpgrades;
		object obj4 = <>c.<>9__96_3;
		if (obj4 == null)
		{
			IntValueChangeEventDelegate val3 = delegate(IntValueChangeEvent e)
			{
				if (e.value < 1)
				{
					e.value = 1;
					maxUpgrades.value = 1;
				}
			};
			<>c.<>9__96_3 = val3;
			obj4 = (object)val3;
		}
		obj3.onValueChange += (IntValueChangeEventDelegate)obj4;
		refillMultiplier = new FloatField(config.rootPanel, "Passive Income Multiplier", "refillmultiplier", 0.1f);
		bonusTimeForParry = new FloatField(config.rootPanel, "Time Juice Refill Per Parry", "bonustimeperparry", 1f);
		specialMode = new BoolField(config.rootPanel, "Special Mode", "specialmode", false)
		{
			interactable = false
		};
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- COLORS --", 24);
		timeJuiceColorNormal = new ColorField(config.rootPanel, "Time Juice Bar Normal Color", "timejuicecolornormal", new Color(1f, 1f, 0f, 1f));
		timeJuiceColorInsufficient = new ColorField(config.rootPanel, "Time Juice Bar Insufficient Color", "timejuicecolorinsufficient", new Color(1f, 0f, 0f, 1f));
		timeJuiceColorUsing = new ColorField(config.rootPanel, "Time Juice Bar Draining Color", "timejuicecolorusing", new Color(1f, 0.6f, 0f, 1f));
		timeJuiceColorNoCooldown = new ColorField(config.rootPanel, "Time Juice Bar No Cooldown Color", "timejuicecolornocooldown", new Color(0f, 1f, 1f, 1f));
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- ADVANCED OPTIONS --", 24);
		ConfigPanel val4 = new ConfigPanel(config.rootPanel, "ADVANCED", "advancedoptions");
		new ConfigSpace(config.rootPanel, 8f);
		extensiveLogging = new BoolField(val4, "Extensive Logging", "extensivelogging", false);
		forceDowngrade = new BoolField(val4, "Force Downgrade Arm", "forcedowngrade", true);
		lowerTreshold = new FloatField(val4, "Min Time Juice to Stop Time", "lowertreshold", 2f);
		antiHpMultiplier = new FloatField(val4, "Hard Damage Buildup Multiplier", "antihpmultiplier", 30f);
		resetSaveButton = new ButtonField(config.rootPanel, "RESET TIMESTOPPER PROGRESS", "resetsavebutton");
		ButtonField obj5 = resetSaveButton;
		object obj6 = <>c.<>9__96_4;
		if (obj6 == null)
		{
			OnClick val5 = delegate
			{
				TimestopperProgress.Reset();
			};
			<>c.<>9__96_4 = val5;
			obj6 = (object)val5;
		}
		obj5.onClick += (OnClick)obj6;
	}

	public IEnumerator LoadSoundProfiles()
	{
		((ConfigField)stopSound).interactable = false;
		((ConfigField)startSound).interactable = false;
		((ConfigField)stoppedSound).interactable = false;
		((ConfigField)soundReloadButton).interactable = false;
		ReloadSoundProfilesList();
		string[] timestopSoundsList = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Stopping"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).ToArray();
		TimestopSounds = (AudioClip[])(object)new AudioClip[timestopSoundsList.Length];
		for (int i = 0; i < timestopSoundsList.Length; i++)
		{
			AudioType audioType = (AudioType)20;
			if (timestopSoundsList[i].EndsWith(".ogg"))
			{
				audioType = (AudioType)14;
			}
			if (timestopSoundsList[i].EndsWith(".wav"))
			{
				audioType = (AudioType)20;
			}
			if (timestopSoundsList[i].EndsWith(".mp3"))
			{
				audioType = (AudioType)13;
			}
			UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip("file://" + timestopSoundsList[i], audioType);
			try
			{
				yield return request.SendWebRequest();
				TimestopSounds[i] = DownloadHandlerAudioClip.GetContent(request);
				Log("downloaded timestop audio cussessfully!");
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}
		string[] stopambienceSoundsList = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Stopped"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).ToArray();
		StoppedTimeAmbiences = (AudioClip[])(object)new AudioClip[stopambienceSoundsList.Length];
		for (int j = 0; j < stopambienceSoundsList.Length; j++)
		{
			AudioType audioType2 = (AudioType)20;
			if (stopambienceSoundsList[j].EndsWith(".ogg"))
			{
				audioType2 = (AudioType)14;
			}
			if (stopambienceSoundsList[j].EndsWith(".wav"))
			{
				audioType2 = (AudioType)20;
			}
			if (stopambienceSoundsList[j].EndsWith(".mp3"))
			{
				audioType2 = (AudioType)13;
			}
			UnityWebRequest request2 = UnityWebRequestMultimedia.GetAudioClip("file://" + stopambienceSoundsList[j], audioType2);
			try
			{
				yield return request2.SendWebRequest();
				StoppedTimeAmbiences[j] = DownloadHandlerAudioClip.GetContent(request2);
				Log("downloaded stopambience audio successfully!");
			}
			finally
			{
				((IDisposable)request2)?.Dispose();
			}
		}
		string[] timestartSoundsList = (from file in Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Timestopper", "Sounds", "Starting"), "*.*")
			where file.EndsWith(".wav") || file.EndsWith(".ogg")
			select file).ToArray();
		TimestartSounds = (AudioClip[])(object)new AudioClip[timestartSoundsList.Length];
		for (int k = 0; k < timestartSoundsList.Length; k++)
		{
			AudioType audioType3 = (AudioType)20;
			if (timestartSoundsList[k].EndsWith(".ogg"))
			{
				audioType3 = (AudioType)14;
			}
			if (timestartSoundsList[k].EndsWith(".wav"))
			{
				audioType3 = (AudioType)20;
			}
			if (timestartSoundsList[k].EndsWith(".mp3"))
			{
				audioType3 = (AudioType)13;
			}
			UnityWebRequest request3 = UnityWebRequestMultimedia.GetAudioClip("file://" + timestartSoundsList[k], audioType3);
			try
			{
				yield return request3.SendWebRequest();
				TimestartSounds[k] = DownloadHandlerAudioClip.GetContent(request3);
				Log("downloaded timestart audio successfully!");
			}
			finally
			{
				((IDisposable)request3)?.Dispose();
			}
		}
		((ConfigField)stopSound).interactable = true;
		((ConfigField)startSound).interactable = true;
		((ConfigField)stoppedSound).interactable = true;
		((ConfigField)soundReloadButton).interactable = true;
		ReloadSoundProfilesList();
	}

	public IEnumerator LoadBundle()
	{
		LoadDone = false;
		Type imageType = typeof(Image);
		GC.KeepAlive(imageType);
		Assembly assembler = Assembly.GetExecutingAssembly();
		string[] resourceNames = assembler.GetManifestResourceNames();
		Log("Scanning newly embedded resources: " + string.Join(", ", resourceNames), extensive: true);
		using (Stream stream = assembler.GetManifestResourceStream("The_Timestopper.timestopper_assets_assets_all.bundle"))
		{
			AssetBundle newBundle = AssetBundle.LoadFromStream(stream);
			newTimeArm = newBundle.LoadAsset<GameObject>("Assets/TimestopperMod/TimeArm.prefab");
			newArmAltar = newBundle.LoadAsset<GameObject>("Assets/TimestopperMod/TimeArmAltar.prefab");
			armTimeText = newBundle.LoadAsset<GameObject>("Assets/TimestopperMod/TimestopperText.prefab");
			armGoldLogo = newBundle.LoadAsset<Texture2D>("Assets/TimestopperMod/ArmTimestopper.png");
			modLogo = newBundle.LoadAsset<Texture2D>("Assets/TimestopperMod/icon_big.png");
			grayscaleShader = newBundle.LoadAsset<Shader>("Assets/TimestopperMod/GrayscaleObject.shader");
			depthShader = newBundle.LoadAsset<Shader>("Assets/TimestopperMod/DepthRenderer.shader");
			config.icon = Sprite.Create(modLogo, new Rect(0f, 0f, 750f, 750f), new Vector2(375f, 375f));
			Log("Total assets loaded: " + newBundle.GetAllAssetNames().Length, extensive: true, 1);
			string[] allAssetNames = newBundle.GetAllAssetNames();
			foreach (string asset in allAssetNames)
			{
				Log(asset, extensive: true, 1);
			}
			yield return LoadSoundProfiles();
		}
		Log("Scanning embedded resources: " + string.Join(", ", resourceNames), extensive: true);
		Log("      >:Bundle extraction done!", extensive: true);
		LoadDone = true;
	}

	public static GameObject UpdateTerminal(ShopZone ShopComp)
	{
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0541: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)ShopComp == (Object)null)
		{
			Log("Shop Component is null, cannot update terminal!", extensive: false, 3);
			return null;
		}
		GameObject gameObject = ((Component)ShopComp).gameObject;
		if ((Object)(object)gameObject.transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window") == (Object)null)
		{
			((Component)ShopComp).gameObject.AddComponent<TerminalExcluder>();
			return null;
		}
		GameObject gameObject2 = ((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject;
		GameObject gameObject3 = ((Component)gameObject2.transform.Find("Variation Screen/Variations/Arm Panel (Gold)")).gameObject;
		GameObject gameObject4 = ((Component)gameObject2.transform.Find("Arm Info (Gold)")).gameObject;
		if (TimestopperProgress.HasArm)
		{
			((Component)ShopComp).gameObject.AddComponent<TerminalExcluder>();
			gameObject3.GetComponent<ShopButton>().toActivate = (GameObject[])(object)new GameObject[1] { gameObject4 };
			((TMP_Text)((Component)gameObject3.transform.Find("Variation Name")).GetComponent<TextMeshProUGUI>()).text = "TIMESTOPPER";
			((Behaviour)gameObject3.GetComponent<VariationInfo>()).enabled = true;
			gameObject3.GetComponent<VariationInfo>().alreadyOwned = true;
			gameObject3.GetComponent<VariationInfo>().varPage = gameObject4;
			gameObject3.GetComponent<VariationInfo>().weaponName = "arm4";
			gameObject3.GetComponent<ShopButton>().PointerClickSuccess += gameObject.GetComponent<TerminalExcluder>().OverrideInfoMenu;
			((Component)gameObject4.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().PointerClickSuccess += TimestopperProgress.UpgradeArm;
			((Component)gameObject4.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().PointerClickSuccess += gameObject.GetComponent<TerminalExcluder>().OverrideInfoMenu;
			gameObject3.GetComponent<VariationInfo>().cost = (int)TimestopperProgress.UpgradeCost;
			((Component)gameObject3.transform.Find("Equipment/Equipment Status")).GetComponent<ShopButton>().PointerClickSuccess += TimestopperProgress.ChangeEquipmentStatus;
			((Component)gameObject3.transform.Find("Equipment/Buttons/Previous Button")).GetComponent<ShopButton>().PointerClickSuccess += TimestopperProgress.ChangeEquipmentStatus;
			((Component)gameObject3.transform.Find("Equipment/Buttons/Next Button")).GetComponent<ShopButton>().PointerClickSuccess += TimestopperProgress.ChangeEquipmentStatus;
			Sprite sprite = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 750f, 750f), new Vector2(750f, 750f) / 2f);
			((Component)gameObject3.transform.Find("Weapon Icon")).GetComponent<Image>().sprite = sprite;
			((Graphic)((Component)gameObject3.transform.Find("Weapon Icon")).GetComponent<Image>()).color = Color.yellow;
			((TMP_Text)((Component)gameObject4.transform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = "Timestopper";
			((TMP_Text)((Component)gameObject4.transform.Find("Panel/Name")).GetComponent<TextMeshProUGUI>()).text = "TIMESTOPPER";
			((TMP_Text)((Component)gameObject4.transform.Find("Panel/Description")).GetComponent<TextMeshProUGUI>()).text = "A Godfist that <color=#FFFF43>stops</color> time.\r\n\r\nRecharges very slow, but <color=#FF4343>parrying</color> helps it recharge faster.\r\n\r\nCan be <color=#FFFF24>upgraded</color> through terminals.\r\n" + TimestopperProgress.UpgradeText;
			Sprite sprite2 = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 750f, 750f), new Vector2(750f, 750f) / 2f);
			((Component)gameObject4.transform.Find("Panel/Icon Inset/Icon")).GetComponent<Image>().sprite = sprite2;
			if (!TimestopperProgress.FirstWarning)
			{
				GameObject val = Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Canvas/Background/Main Panel/The Cyber Grind/Cyber Grind Panel")).gameObject, gameObject.transform.Find("Canvas/Background/Main Panel"));
				((Object)val).name = "Warning Panel";
				val.transform.localPosition = new Vector3(-9.4417f, 6f, 0.0002f);
				((Component)val.transform.Find("Button 1")).gameObject.SetActive(false);
				((Component)val.transform.Find("Button 2")).gameObject.SetActive(false);
				((Component)val.transform.Find("Button 3")).gameObject.SetActive(false);
				((Component)val.transform.Find("Icon")).gameObject.SetActive(false);
				((TMP_Text)((Component)val.transform.Find("Panel/Text Inset/Text")).GetComponent<TextMeshProUGUI>()).text = "<color=#FF4343>!!! Extreme Hazard Detected !!!</color> \r\n\r\nYou have <color=#FF4343>The Timestopper</color> in your possession. Using this item may cause disturbance in space-time continuum.\r\n\r\n<color=#FF4343>Please acknowledge the consequences before proceeding further.</color>";
				GameObject val2 = Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Enemies/Enemies Panel/Icon")).gameObject, val.transform.Find("Title"));
				GameObject val3 = Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Enemies/Enemies Panel/Icon")).gameObject, val.transform.Find("Title"));
				val3.transform.localPosition = new Vector3(-37.1206f, -0.0031f, 0f);
				val2.transform.localPosition = new Vector3(97.8522f, -0.0031f, 0f);
				((TMP_Text)((Component)val.transform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = "WARNING";
				((TMP_Text)((Component)val.transform.Find("Title")).GetComponent<TextMeshProUGUI>()).transform.localPosition = new Vector3(-51.5847f, 189.9997f, 0f);
				GameObject gameObject5 = ((Component)val.transform.Find("Panel/Enter Button")).gameObject;
				((TMP_Text)((Component)gameObject5.transform.Find("Text")).GetComponent<TextMeshProUGUI>()).text = "ACCEPT";
				((Graphic)gameObject5.GetComponent<Image>()).color = new Color(0f, 1f, 0f, 1f);
				((Object)gameObject5).name = "Accept Button";
				Object.Destroy((Object)(object)gameObject5.GetComponent<AbruptLevelChanger>());
				val.SetActive(false);
				((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Main Menu")).gameObject.SetActive(false);
				((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Tip of the Day")).gameObject.SetActive(false);
				gameObject5.GetComponent<ShopButton>().PointerClickSuccess += TimestopperProgress.AcceptWarning;
				gameObject5.GetComponent<ShopButton>().toDeactivate = (GameObject[])(object)new GameObject[1] { val };
				gameObject5.GetComponent<ShopButton>().toActivate = (GameObject[])(object)new GameObject[2]
				{
					((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Tip of the Day")).gameObject,
					((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Main Menu")).gameObject
				};
				return val;
			}
		}
		else
		{
			((Behaviour)gameObject3.GetComponent<VariationInfo>()).enabled = true;
			gameObject3.GetComponent<VariationInfo>().alreadyOwned = false;
			gameObject3.GetComponent<VariationInfo>().varPage = gameObject4;
		}
		return null;
	}

	public void PreventNull()
	{
		if ((Object)(object)Player.GetComponent<TerminalUpdater>() == (Object)null)
		{
			Player.AddComponent<TerminalUpdater>();
		}
		if ((Object)(object)MenuCanvas == (Object)null)
		{
			MenuCanvas = FindRootGameObject("Canvas");
		}
	}

	public static Shader FindShader(string name)
	{
		Shader[] array = Resources.FindObjectsOfTypeAll<Shader>();
		foreach (Shader val in array)
		{
			if (((Object)val).name == name)
			{
				return val;
			}
		}
		Log("Couldn't find " + name + " shader!", extensive: true, 3);
		return null;
	}

	public IEnumerator LoadHUD()
	{
		float elapsedTime = 0f;
		Log("Loading HUD Elements...", extensive: true);
		do
		{
			if (elapsedTime > 5f)
			{
				Log("Time Juice Bar creation failed after 5 seconds!", extensive: false, 3);
				yield break;
			}
			elapsedTime += Time.unscaledDeltaTime;
			yield return null;
		}
		while ((Object)(object)Player.transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/AltRailcannonPanel") == (Object)null);
		GameObject[] TimeHUD = (GameObject[])(object)new GameObject[3]
		{
			Object.Instantiate<GameObject>(((Component)Player.transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/AltRailcannonPanel")).gameObject, Player.transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler")),
			default(GameObject),
			default(GameObject)
		};
		TimeHUD[0].SetActive(true);
		((Object)TimeHUD[0]).name = "Golden Time";
		TimeHUD[0].transform.localPosition = new Vector3(0f, 124.5f, 0f);
		((Component)TimeHUD[0].transform.Find("Image")).gameObject.GetComponent<Image>().fillAmount = 0f;
		Sprite mm = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 750f, 750f), new Vector2(750f, 750f) / 2f);
		((Component)TimeHUD[0].transform.Find("Icon")).gameObject.GetComponent<Image>().sprite = mm;
		TimeHUD[0].AddComponent<TimeHUD>();
		TimeHUD[0].GetComponent<TimeHUD>().type = 0;
		Transform transform = ((Component)HudController.Instance.speedometer).gameObject.transform;
		transform.localPosition += new Vector3(0f, 64f, 0f);
		Log("Time Juice Bar created successfully.", extensive: true);
		GameObject obj;
		do
		{
			if (elapsedTime > 5f)
			{
				Log("Time Juice Alt HUD creation failed after 5 seconds!", extensive: false, 3);
				yield break;
			}
			elapsedTime += Time.unscaledDeltaTime;
			yield return null;
			obj = FindRootGameObject("Canvas");
		}
		while ((Object)(object)((obj != null) ? obj.transform.Find("Crosshair Filler/AltHud/Filler/Speedometer") : null) == (Object)null);
		TimeHUD[1] = Object.Instantiate<GameObject>(((Component)FindRootGameObject("Canvas").transform.Find("Crosshair Filler/AltHud/Filler/Speedometer")).gameObject, FindRootGameObject("Canvas").transform.Find("Crosshair Filler/AltHud/Filler"));
		TimeHUD[2] = Object.Instantiate<GameObject>(((Component)FindRootGameObject("Canvas").transform.Find("Crosshair Filler/AltHud (2)/Filler/Speedometer")).gameObject, FindRootGameObject("Canvas").transform.Find("Crosshair Filler/AltHud (2)/Filler"));
		((TMP_Text)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).fontMaterial = ((TMP_Text)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).fontSharedMaterial;
		((Graphic)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).SetMaterialDirty();
		((Graphic)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).color = new Color(1f, 0.9f, 0.2f);
		((TMP_Text)((Component)TimeHUD[1].transform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = "TIME";
		TimeHUD[1].transform.localPosition = new Vector3(360f, -360f, 0f);
		Object.Destroy((Object)(object)TimeHUD[1].GetComponent<Speedometer>());
		((Object)TimeHUD[1]).name = "Time Juice";
		((TMP_Text)((Component)TimeHUD[2].transform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = "TIME";
		TimeHUD[2].transform.localPosition = new Vector3(360f, -360f, 0f);
		Object.Destroy((Object)(object)TimeHUD[2].GetComponent<Speedometer>());
		((Object)TimeHUD[2]).name = "Time Juice";
		TimeHUD[1].AddComponent<TimeHUD>();
		TimeHUD[1].GetComponent<TimeHUD>().type = 1;
		TimeHUD[2].AddComponent<TimeHUD>();
		TimeHUD[2].GetComponent<TimeHUD>().type = 2;
		Log("Golden Time Alt HUD created successfully.", extensive: true);
	}

	public static void ResetGoldArm()
	{
		StartTime(0f);
		if ((Object)(object)TimeArm.Instance != (Object)null)
		{
			TimeArm.Instance.Reset();
		}
	}

	public GameObject FindRootGameObject(string _name)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		Scene activeScene = SceneManager.GetActiveScene();
		GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
		foreach (GameObject val in rootGameObjects)
		{
			if (((Object)val).name == _name)
			{
				return val;
			}
		}
		return null;
	}

	public IEnumerator InstantiateMenuItems()
	{
		yield return (object)new WaitUntil((Func<bool>)(() => LoadDone));
		Log("custom menu items are loaded", extensive: false, 2);
		GameObject timeArmText = Object.Instantiate<GameObject>(armTimeText, FindRootGameObject("Canvas").transform.Find("Main Menu (1)/V1"));
		timeArmText.SetActive(TimestopperProgress.HasArm);
		GameObject timeArmText2 = Object.Instantiate<GameObject>(armTimeText, FindRootGameObject("Canvas").transform.Find("Difficulty Select (1)/Info Background/V1"));
		((Graphic)timeArmText2.GetComponent<Image>()).color = new Color(0.125f, 0.125f, 0.125f, 1f);
		timeArmText2.SetActive(TimestopperProgress.HasArm);
	}

	private IEnumerator StopAllRBDelayed(float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		Rigidbody[] array = Object.FindObjectsOfType<Rigidbody>();
		foreach (Rigidbody R in array)
		{
			RigidbodyStopper.AddRBS(((Component)R).gameObject);
		}
	}

	public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		//IL_026a: 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_02af: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0456: Unknown result type (might be due to invalid IL or missing references)
		//IL_045b: Unknown result type (might be due to invalid IL or missing references)
		RigidbodyStopper.HashedGameObjects.Clear();
		AudioPitcher.HashedGameObjects.Clear();
		if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902")
		{
			mls.LogWarning((object)"main menu loaded");
			if ((Object)(object)armTimeText == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadBundle());
			}
			((MonoBehaviour)this).StartCoroutine(InstantiateMenuItems());
		}
		if (!forbiddenScene)
		{
			InvokeCaller.ClearMonos();
			((MonoBehaviour)this).StartCoroutine(StopAllRBDelayed(2f));
			if ((Object)(object)Playerstopper.Instance == (Object)null)
			{
				Player.AddComponent<Playerstopper>();
			}
			Playerstopper.Instance.AddInvokeCallers(((Component)Playerstopper.Instance).transform);
			if (forceDowngrade.value)
			{
				TimestopperProgress.ForceDowngradeArm();
			}
			((MonoBehaviour)this).StartCoroutine(LoadHUD());
			StatsManager.checkpointRestart += ResetGoldArm;
			if (firstLoad && !TimestopperProgress.HasArm)
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Somewhere in the depths of <color=#FF0000>Violence /// First</color>, a new <color=#FFFF23>golden</color> door appears", "", "", 2, false, false, true);
				PrivateInsideTimer privateInsideTimer = messageTimer;
				privateInsideTimer.done = (Action)Delegate.Combine(privateInsideTimer.done, (Action)delegate
				{
					((MonoBehaviour)MonoSingleton<HudMessageReceiver>.Instance).Invoke("Done", 0f);
					firstLoad = false;
				});
				messageTimer.SetTimer(6f, _scaled: true);
			}
			FishObjectReference[] array = Object.FindObjectsOfType<FishObjectReference>(true);
			foreach (FishObjectReference val in array)
			{
				if (((Object)((Component)val).gameObject).name == "GoldArmPickup")
				{
					((Component)val).gameObject.AddComponent<TimeArmPickup>();
				}
			}
			MonoSingleton<StyleHUD>.Instance.RegisterStyleItem("timestopper.timestop", "<color=#FFCF21>TIME STOP</color>");
		}
		else
		{
			timeStopper = CStopTime(0f);
			timeStarter = CStartTime(0f);
		}
		if (ConfirmLevel("VIOLENCE /// FIRST"))
		{
			Log("7-1 level detected", extensive: true);
			GameObject val2 = Object.Instantiate<GameObject>(GameObject.Find("Crossroads -> Forward Hall"), GameObject.Find("Stairway Down").transform);
			((Object)val2).name = "Stairway Down -> Gold Arm Hall";
			val2.transform.position = new Vector3(-14.6292f, -25.0312f, 590.2311f);
			val2.transform.eulerAngles = new Vector3(0f, 270f, 0f);
			((Renderer)((Component)val2.transform.GetChild(0)).GetComponent<MeshRenderer>()).materials[1].color = Color.yellow;
			((Renderer)((Component)val2.transform.GetChild(0)).GetComponent<MeshRenderer>()).materials[2].color = Color.yellow;
			((Renderer)((Component)val2.transform.GetChild(1)).GetComponent<MeshRenderer>()).materials[1].color = Color.yellow;
			((Renderer)((Component)val2.transform.GetChild(1)).GetComponent<MeshRenderer>()).materials[2].color = Color.yellow;
			val2.GetComponent<Door>().Close(false);
			val2.GetComponent<Door>().Lock();
			val2.GetComponent<Door>().activatedRooms = (GameObject[])(object)new GameObject[0];
			GameObject val3 = Object.Instantiate<GameObject>(newArmAltar, GameObject.Find("Stairway Down").transform);
			val3.transform.position = new Vector3(-10.0146f, -24.9875f, 590.0158f);
			val3.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			Log("Added The New Arm Altar", extensive: true);
		}
		if (((Scene)(ref scene)).name == "9240e656c89994d44b21940f65ab57da")
		{
			cybergrind = true;
			if (!Chainloader.PluginInfos.ContainsKey("dev.flazhik.jukebox"))
			{
				return;
			}
			Compatability_JukeBox = true;
			Type type = Type.GetType("Jukebox.Components.NowPlayingHud, Jukebox");
			if (type != null)
			{
				Object obj = Object.FindObjectOfType(type);
				Component val4 = (Component)(object)((obj is Component) ? obj : null);
				if ((Object)(object)val4 != (Object)null)
				{
					Transform transform = val4.gameObject.transform;
					transform.localPosition += new Vector3(0f, 60f, 0f);
				}
				else
				{
					Log("Component C is null!", extensive: true, 3);
				}
			}
			else
			{
				Log("Could not get Jukebox.Components.NowPlayingHud, Cybergrind Music Explorer may have errors", extensive: true, 3);
			}
		}
		else
		{
			cybergrind = false;
			Compatability_JukeBox = false;
		}
	}

	public void OnSceneUnloaded(Scene scene)
	{
	}

	private bool ConfirmLevel(string LayerName)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)currentLevelInfo == (Object)null)
		{
			Scene activeScene = SceneManager.GetActiveScene();
			GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
			foreach (GameObject val in rootGameObjects)
			{
				if (((Object)val).name == "Level Info")
				{
					currentLevelInfo = val;
					if (((MapInfoBase)val.GetComponent<StockMapInfo>()).layerName == LayerName)
					{
						return true;
					}
				}
			}
		}
		else if (((MapInfoBase)currentLevelInfo.GetComponent<StockMapInfo>()).layerName == LayerName)
		{
			return true;
		}
		return false;
	}

	public IEnumerator CStopTime(float speed)
	{
		if (forbiddenScene)
		{
			yield break;
		}
		((MonoBehaviour)this).StopCoroutine(timeStarter);
		StoppedTimeAmount = 0f;
		if (filterMusic.value)
		{
			MonoSingleton<MusicManager>.Instance.FilterMusic();
		}
		Physics.simulationMode = (SimulationMode)2;
		RigidbodyStopper.FreezeAll();
		Animator[] array = Object.FindObjectsOfType<Animator>();
		foreach (Animator A in array)
		{
			if (((Component)A).gameObject.transform.IsChildOf(Player.transform) && (int)A.updateMode == 0)
			{
				A.updateMode = (AnimatorUpdateMode)2;
			}
		}
		if (speed == 0f)
		{
			Time.timeScale = 0f;
			realTimeScale = 0f;
			playerTimeScale = 1f;
			yield break;
		}
		do
		{
			Time.timeScale -= Time.unscaledDeltaTime / speed * (float)((!MonoSingleton<OptionsManager>.Instance.paused) ? 1 : 0);
			realTimeScale -= Time.unscaledDeltaTime / speed * (float)((!MonoSingleton<OptionsManager>.Instance.paused) ? 1 : 0);
			yield return null;
		}
		while (Time.timeScale > Time.unscaledDeltaTime / speed);
		Time.timeScale = 0f;
		realTimeScale = 0f;
	}

	public IEnumerator CStartTime(float speed, bool preventStyle = false)
	{
		if (forbiddenScene)
		{
			yield break;
		}
		((MonoBehaviour)this).StopCoroutine(timeStopper);
		if (filterMusic.value)
		{
			MonoSingleton<MusicManager>.Instance.UnfilterMusic();
		}
		Physics.simulationMode = (SimulationMode)0;
		Animator[] array = Object.FindObjectsOfType<Animator>();
		foreach (Animator A in array)
		{
			if (((Component)A).gameObject.transform.IsChildOf(Player.transform) && (int)A.updateMode == 2)
			{
				A.updateMode = (AnimatorUpdateMode)0;
			}
		}
		if (speed == 0f)
		{
			Time.timeScale = 1f;
			realTimeScale = 1f;
			StoppedTimeAmount = 0f;
			yield break;
		}
		if (Time.timeScale < 0f)
		{
			Time.timeScale = 0f;
		}
		do
		{
			Time.timeScale += Time.unscaledDeltaTime / speed * (float)((!MonoSingleton<OptionsManager>.Instance.paused) ? 1 : 0);
			realTimeScale += Time.unscaledDeltaTime / speed * (float)((!MonoSingleton<OptionsManager>.Instance.paused) ? 1 : 0);
			yield return null;
		}
		while (Time.timeScale < 1f);
		if (!preventStyle && StoppedTimeAmount > 2f)
		{
			MonoSingleton<StyleHUD>.Instance.AddPoints((int)StoppedTimeAmount * 100, "timestopper.timestop", ((Component)Playerstopper.Instance).gameObject, (EnemyIdentifier)null, -1, "", "");
		}
		StoppedTimeAmount = 0f;
		Time.timeScale = 1f;
		realTimeScale = 1f;
	}

	public static void StopTime(float time)
	{
		if (!forbiddenScene)
		{
			Instance.timeStopper = Instance.CStopTime(time);
			((MonoBehaviour)Instance).StartCoroutine(Instance.timeStopper);
			TimeStop = true;
		}
	}

	public static void StartTime(float time, bool preventStyle = false)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		if (!forbiddenScene)
		{
			Instance.timeStarter = Instance.CStartTime(time, preventStyle);
			((MonoBehaviour)Instance).StartCoroutine(Instance.timeStarter);
			Instance.timeSinceLastTimestop = TimeSince.op_Implicit(0f);
			TimeStop = false;
		}
	}

	private void HandleHitstop()
	{
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Expected O, but got Unknown
		if ((float)AccessTools.Field(typeof(TimeController), "currentStop").GetValue(MonoSingleton<TimeController>.Instance) <= 0f)
		{
			if (!(playerTimeScale <= 0f))
			{
				return;
			}
			playerTimeScale = 1f;
			Time.timeScale = 0f;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			object? value = AccessTools.Field(typeof(TimeController), "parryFlash").GetValue(MonoSingleton<TimeController>.Instance);
			object? obj = ((value is GameObject) ? value : null);
			if (obj != null)
			{
				((GameObject)obj).SetActive(false);
			}
			{
				foreach (Transform item in ((Component)Player.transform.Find("Main Camera/New Game Object")).transform)
				{
					Transform val = item;
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
				return;
			}
		}
		frameLaterer = true;
		playerTimeScale = 0f;
		Time.timeScale = 0f;
	}

	private void HandleMenuPause()
	{
		if (MonoSingleton<OptionsManager>.Instance.paused)
		{
			playerTimeScale = 0f;
		}
		else if (menuOpenLastFrame != MonoSingleton<OptionsManager>.Instance.paused)
		{
			playerTimeScale = 1f;
		}
		menuOpenLastFrame = MonoSingleton<OptionsManager>.Instance.paused;
	}

	public void FakeFixedUpdate()
	{
		if (TimeStop)
		{
			Time.timeScale = realTimeScale;
			if (playerDeltaTime > 0f)
			{
				Physics.Simulate(Time.fixedDeltaTime * (1f - realTimeScale));
			}
		}
	}

	public Vector3 GetPlayerVelocity(bool trueVelocity = false)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = MonoSingleton<NewMovement>.Instance.rb.velocity;
		if (!trueVelocity && MonoSingleton<NewMovement>.Instance.boost && !MonoSingleton<NewMovement>.Instance.sliding)
		{
			val /= 3f;
		}
		if (Object.op_Implicit((Object)(object)MonoSingleton<NewMovement>.Instance.ridingRocket))
		{
			val += MonoSingleton<NewMovement>.Instance.ridingRocket.rb.velocity;
		}
		if ((Object)(object)MonoSingleton<PlayerMovementParenting>.Instance != (Object)null)
		{
			Vector3 val2 = MonoSingleton<PlayerMovementParenting>.Instance.currentDelta * 60f;
			val += val2;
		}
		return val;
	}

	private void Update()
	{
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Expected O, but got Unknown
		//IL_00a6: 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_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: 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_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_0278: 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)
		InvokeCaller.Update();
		if (forbiddenScene)
		{
			return;
		}
		if (TimeStop)
		{
			if (!Object.op_Implicit((Object)(object)Dummy))
			{
				Dummy = new GameObject("Player Dummy");
				Rigidbody val = Dummy.AddComponent<Rigidbody>();
				val.isKinematic = true;
				GameObject val2 = new GameObject("Head");
				val2.transform.parent = Dummy.transform;
				val2.transform.localPosition = ((Component)Player.transform.Find("Main Camera").Find("New Game Object")).transform.localPosition;
				val2.transform.localRotation = ((Component)Player.transform.Find("Main Camera").Find("New Game Object")).transform.localRotation;
				Dummy.transform.position = Player.transform.Find("New Game Object").position;
				Dummy.transform.rotation = Player.transform.Find("New Game Object").rotation;
			}
			typeof(PlayerTracker).GetField("target", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, Dummy.transform);
			typeof(PlayerTracker).GetField("player", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, Dummy.transform.GetChild(0));
			typeof(PlayerTracker).GetField("playerRb", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, Dummy.GetComponent<Rigidbody>());
		}
		else if (Object.op_Implicit((Object)(object)Dummy) && TimeSince.op_Implicit(timeSinceLastTimestop) > 1f)
		{
			if (Vector3.Distance(Dummy.transform.position, Player.transform.position) > 1f)
			{
				Transform transform = Dummy.transform;
				transform.position -= Vector3.Normalize(Dummy.transform.position - Player.transform.position) * (200f * playerDeltaTime);
				return;
			}
			typeof(PlayerTracker).GetField("target", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, Player.transform.Find("Main Camera").Find("New Game Object"));
			typeof(PlayerTracker).GetField("player", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, ((Component)Player.transform.Find("New Game Object")).transform);
			typeof(PlayerTracker).GetField("playerRb", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(MonoSingleton<PlayerTracker>.Instance, Player.GetComponent<Rigidbody>());
			Object.DestroyImmediate((Object)(object)((Component)Dummy.transform.GetChild(0)).gameObject);
			Object.DestroyImmediate((Object)(object)Dummy);
			Dummy = null;
		}
	}

	private void LateUpdate()
	{
		if ((Object)(object)Player == (Object)null || forbiddenScene)
		{
			return;
		}
		if (cybergrind && cybergrindWave != MonoSingleton<EndlessGrid>.Instance.currentWave)
		{
			Playerstopper.Instance.timeArm.GetComponent<TimeArm>().timeLeft = TimestopperProgress.MaxTime;
			cybergrindWave = MonoSingleton<EndlessGrid>.Instance.currentWave;
		}
		PreventNull();
		if (MonoSingleton<NewMovement>.Instance.dead && TimeStop)
		{
			StartTime(0f);
		}
		if (TimeStop)
		{
			HandleHitstop();
			HandleMenuPause();
			time += Time.unscaledDeltaTime;
			if (time > Time.maximumDeltaTime)
			{
				time = Time.maximumDeltaTime;
			}
			while (time >= Time.fixedDeltaTime)
			{
				time -= Time.fixedDeltaTime;
				FakeFixedUpdate();
			}
		}
	}
}
public class InvokeCaller
{
	public static HashSet<MonoBehaviour> targets = new HashSet<MonoBehaviour>();

	public static HashSet<InvokeCaller> invokers = new HashSet<InvokeCaller>();

	private MonoBehaviour mono;

	private MethodInfo method;

	private float time;

	public static void Update()
	{
		InvokeCaller[] array = invokers.ToArray();
		foreach (InvokeCaller invokeCaller in array)
		{
			invokeCaller.Iterate();
		}
	}

	public static void ClearDestroyed()
	{
		targets.RemoveWhere((MonoBehaviour item) => (Object)(object)item == (Object)null);
		invokers.RemoveWhere((InvokeCaller ic) => (Object)(object)ic.mono == (Object)null);
	}

	public static void ClearMonos()
	{
		targets.Clear();
	}

	public static void RegisterMonos(IEnumerable<MonoBehaviour> values)
	{
		foreach (MonoBehaviour value in values)
		{
			targets.Add(value);
		}
	}

	public static void UnRegisterMonos(IEnumerable<MonoBehaviour> values)
	{
		foreach (MonoBehaviour value in values)
		{
			targets.Remove(value);
		}
	}

	private InvokeCaller(MonoBehaviour instance, string methodName, float delay)
	{
		time = delay;
		mono = instance;
		try
		{
			method = ((object)mono).GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod);
		}
		catch
		{
			method = null;
		}
	}

	private void Iterate()
	{
		time -= Timestopper.playerDeltaTime;
		if (time < 0f)
		{
			if ((Object)(object)mono != (Object)null)
			{
				method?.Invoke(mono, null);
			}
			invokers.Remove(this);
		}
	}

	public static bool Add(MonoBehaviour instance, string methodName, float delay)
	{
		if (targets.Contains(instance))
		{
			invokers.Add(new InvokeCaller(instance, methodName, delay));
			return false;
		}
		return true;
	}
}
public class AudioPitcher : MonoBehaviour
{
	private static HashSet<GameObject> gos = new HashSet<GameObject>();

	private AudioSource audio;

	private bool useOriginal;

	private float originalPitch = 1f;

	private float localScale = 1f;

	public static HashSet<GameObject> HashedGameObjects => gos;

	private bool music
	{
		get
		{
			if (!Object.op_Implicit((Object)(object)audio) || !Object.op_Implicit((Object)(object)audio.clip))
			{
				return false;
			}
			return audio.spatialBlend == 0f && audio.clip.length > 10f;
		}
	}

	public static void AddAP(GameObject go)
	{
		if (gos.Add(go))
		{
			go.AddComponent<AudioPitcher>();
		}
	}

	private void Awake()
	{
		audio = ((Component)this).GetComponent<AudioSource>();
		originalPitch = audio.pitch;
	}

	public void LateUpdate()
	{
		if (!Object.op_Implicit((Object)(object)audio))
		{
			return;
		}
		if (Timestopper.realTimeScale == 1f && !useOriginal)
		{
			audio.pitch = originalPitch;
			useOriginal = true;
		}
		else
		{
			if (!(Timestopper.realTimeScale < 1f))
			{
				return;
			}
			if (useOriginal)
			{
				originalPitch = audio.pitch;
				localScale = 1f;
				useOriginal = false;
			}
			if (!music)
			{
				if (Timestopper.TimeStop)
				{
					audio.pitch = originalPitch * localScale;
					if (localScale > 0f)
					{
						localScale = Mathf.Max(localScale - Timestopper.playerDeltaTime * Timestopper.affectSpeed.value, 0f);
					}
				}
				else
				{
					audio.pitch = originalPitch * Mathf.Max(Timestopper.realTimeScale, localScale);
				}
			}
			else
			{
				audio.pitch = Timestopper.realTimeScale * (1f - Timestopper.stoppedMusicPitch.value) + Timestopper.stoppedMusicPitch.value;
				MonoSingleton<MusicManager>.Instance.volume = Timestopper.realTimeScale * (1f - Timestopper.stoppedMusicVolume.value) + Timestopper.stoppedMusicVolume.value;
			}
		}
	}
}
public class TerminalExcluder : MonoBehaviour
{
	public bool done = true;

	public void OverrideInfoMenu()
	{
		//IL_0289: 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_0176: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Component)((Component)this).transform.Find("Canvas")).GetComponent<CanvasExcluder>() == (Object)null)
		{
			((Component)((Component)this).transform.Find("Canvas")).gameObject.AddComponent<CanvasExcluder>();
		}
		GameObject gameObject = ((Component)((Component)this).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject;
		GameObject gameObject2 = ((Component)gameObject.transform.Find("Arm Info (Gold)")).gameObject;
		((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Image>().sprite = ((Component)gameObject2.transform.Find("Panel/Back Button")).GetComponent<Image>().sprite;
		((TMP_Text)((Component)gameObject2.transform.Find("Panel/Description")).GetComponent<TextMeshProUGUI>()).text = "A Godfist that <color=#FFFF43>stops</color> time.\r\n\r\nRecharges very slow, but <color=#FF4343>parrying</color> helps it recharge faster.\r\n\r\nCan be <color=#FFFF24>upgraded</color> through terminals.\r\n" + TimestopperProgress.UpgradeText;
		if (TimestopperProgress.UpgradeCount < Timestopper.maxUpgrades.value)
		{
			if ((float)GameProgressSaver.GetMoney() > TimestopperProgress.UpgradeCost)
			{
				((TMP_Text)((Component)gameObject2.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = (int)TimestopperProgress.UpgradeCost + " <color=#FF4343>P</color>";
				((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = false;
				((Selectable)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = true;
				((Graphic)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Image>()).color = Color.white;
			}
			else
			{
				((TMP_Text)((Component)gameObject2.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = "<color=#FF4343>" + (int)TimestopperProgress.UpgradeCost + " P</color>";
				((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = true;
				((Selectable)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = false;
				((Graphic)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Image>()).color = Color.red;
			}
		}
		else
		{
			((TMP_Text)((Component)gameObject2.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = "<color=#FFEE43>MAX</color>";
			((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = true;
			((Selectable)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = false;
			((Graphic)((Component)gameObject2.transform.Find("Panel/Purchase Button")).GetComponent<Image>()).color = Color.gray;
		}
	}

	public void OnTriggerStay(Collider col)
	{
		if (((Object)((Component)col).gameObject).name == "Player" && Timestopper.TimeStop)
		{
			((Component)((Component)this).transform.Find("Canvas")).gameObject.SetActive(false);
		}
	}
}
public class CanvasExcluder : MonoBehaviour
{
	private void OnEnable()
	{
		((Component)((Component)this).transform.parent).GetComponent<TerminalExcluder>()?.OverrideInfoMenu();
	}
}
public class Grayscaler : MonoBehaviour
{
	private static readonly int MyCustomDepth = Shader.PropertyToID("_MyCustomDepth");

	private GameObject GrayscaleCube;

	public static Grayscaler Instance;

	public RenderTexture depth;

	public Camera depthCamera;

	public Camera mainCamera;

	public Material grayscaleMaterial;

	public float grayscaleBubbleExpansion = 0f;

	public float intensityControl = 0f;

	public void Awake()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		//IL_0067: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Expected O, but got Unknown
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: 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)
		Instance = this;
		mainCamera = ((Component)this).GetComponent<Camera>();
		depth = new RenderTexture(mainCamera.pixelWidth, mainCamera.pixelHeight, 24, (RenderTextureFormat)14);
		depth.Create();
		GameObject val = new GameObject("Depth Camera");
		val.transform.parent = ((Component)this).transform;
		val.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
		depthCamera = val.AddComponent<Camera>();
		depthCamera.CopyFrom(mainCamera);
		((Behaviour)depthCamera).enabled = false;
		depthCamera.targetTexture = depth;
		depthCamera.depthTextureMode = (DepthTextureMode)1;
		depthCamera.aspect = mainCamera.aspect;
		depthCamera.SetReplacementShader(Timestopper.depthShader, "RenderType");
		grayscaleMaterial = new Material(Timestopper.grayscaleShader);
		GrayscaleCube = GameObject.CreatePrimitive((PrimitiveType)3);
		Object.Destroy((Object)(object)GrayscaleCube.GetComponent<BoxCollider>());
		((Object)GrayscaleCube).name = "Grayscale Cube";
		GrayscaleCube.transform.SetParent(((Component)this).transform);
		GrayscaleCube.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
		GrayscaleCube.transform.localPosition = Vector3.forward * 0.61f;
		GrayscaleCube.transform.localScale = new Vector3(50f, 50f, 1f);
		((Renderer)GrayscaleCube.GetComponent<MeshRenderer>()).SetMaterials(new List<Material> { grayscaleMaterial });
	}

	public void LateUpdate()
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Expected O, but got Unknown
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: 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_02d2: Unknown result type (might be due to invalid IL or missing references)
		depthCamera.fieldOfView = mainCamera.fieldOfView;
		depthCamera.aspect = mainCamera.aspect;
		if (((Texture)depth).width != mainCamera.pixelWidth || ((Texture)depth).height != mainCamera.pixelHeight)
		{
			depth.Release();
			depth = new RenderTexture(mainCamera.pixelWidth, mainCamera.pixelHeight, 24, (RenderTextureFormat)14);
			depth.Create();
			depthCamera.targetTexture = depth;
		}
		depthCamera.Render();
		Shader.SetGlobalTexture("_MyCustomDepth", (Texture)(object)depth);
		grayscaleMaterial.SetFloat("_DoExpansion", (float)(Timestopper.bubbleEffect.value ? 1 : 0));
		if (Timestopper.TimeStop)
		{
			if (intensityControl < 1f)
			{
				intensityControl += Timestopper.playerDeltaTime * Timestopper.stopSpeed.value;
			}
			if (intensityControl > 1f)
			{
				intensityControl = 1f;
			}
		}
		else
		{
			if (intensityControl > 0f)
			{
				intensityControl -= Timestopper.playerDeltaTime * Timestopper.stopSpeed.value;
			}
			if (intensityControl < 0f)
			{
				intensityControl = 0f;
			}
		}
		grayscaleMaterial.SetFloat("_AllIntensity", Timestopper.overallEffectIntensity.value * intensityControl);
		grayscaleMaterial.SetFloat("_Intensity", Timestopper.grayscaleIntensity.value);
		grayscaleMaterial.SetFloat("_Smoothness", Timestopper.bubbleSmoothness.value);
		grayscaleMaterial.SetFloat("_SmoothnessInvert", Timestopper.colorInversionArea.value);
		grayscaleMaterial.SetFloat("_NoDepthDistance", Timestopper.skyTransitionTreshold.value);
		grayscaleMaterial.SetFloat("_Distance", grayscaleBubbleExpansion);
		if (grayscaleBubbleExpansion < 20f)
		{
			grayscaleBubbleExpansion += Timestopper.playerDeltaTime * Timestopper.bubbleDistance.value;
		}
		grayscaleMaterial.SetFloat("_Progression", Timestopper.bubbleProgression.value);
		grayscaleMaterial.SetVector("_ColorSpace", new Vector4(Timestopper.grayscaleColorSpace.value.r, Timestopper.grayscaleColorSpace.value.g, Timestopper.grayscaleColorSpace.value.b, Timestopper.grayscaleColorSpaceIntensity.value));
	}
}
public class TerminalUpdater : MonoBehaviour
{
	public int wid;

	private IEnumerator DelayedActivator(GameObject O, float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		O.SetActive(true);
	}

	public void OnTriggerEnter(Collider col)
	{
		if (!((Object)(object)((Component)col).gameObject.GetComponent<ShopZone>() != (Object)null))
		{
			return;
		}
		if ((Object)(object)((Component)col).gameObject.GetComponent<TerminalExcluder>() == (Object)null)
		{
			GameObject val = Timestopper.UpdateTerminal(((Component)col).gameObject.GetComponent<ShopZone>());
			if ((Object)(object)val != (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedActivator(val, 1f));
			}
		}
		if (((Behaviour)((Component)col).gameObject.GetComponent<TerminalExcluder>()).enabled && !((Object)(object)((Component)col).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window") == (Object)null))
		{
			GameObject gameObject = ((Component)((Component)col).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject;
			GameObject gameObject2 = ((Component)gameObject.transform.Find("Variation Screen/Variations/Arm Panel (Gold)")).gameObject;
			gameObject2.GetComponent<ShopButton>().failure = false;
			if (Timestopper.TimeStop)
			{
				((Behaviour)((Component)col).gameObject.GetComponent<ShopZone>()).enabled = false;
				return;
			}
			((Behaviour)((Component)col).gameObject.GetComponent<ShopZone>()).enabled = true;
			Timestopper.LatestTerminal = ((Component)col).gameObject;
		}
	}
}
public class TimeArmPickup : MonoBehaviour
{
	public UltrakillEvent onPickup;

	public void OnCollisionEnter(Collision col)
	{
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		Timestopper.Log("Armitem Has Collided With " + ((Object)col.gameObject).name, extensive: true);
		if ((Object)(object)col.gameObject.GetComponent<Playerstopper>() != (Object)null)
		{
			TimestopperProgress.GiveArm();
			TimeArm.Instance.animator.Play("Pickup");
			MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage($"<color=#FFFF23>TIMESTOPPER</color>: Use \"<color=#FF4223>{Timestopper.stopKey.value}</color>\" to stop and start time at will.", "", "", 2, false, false, true);
			UltrakillEvent obj = onPickup;
			if (obj != null)
			{
				obj.Invoke("");
			}
			((Behaviour)this).enabled = false;
		}
	}
}
public class PrivateInsideTimer
{
	private float time;

	private bool scaled;

	public Action done;

	public bool SetTimer(float _time, bool _scaled, bool force = false)
	{
		if (time <= 0f || force)
		{
			time = _time;
			scaled = _scaled;
			return true;
		}
		return false;
	}

	public void Update()
	{
		if (time != 0f)
		{
			if (scaled)
			{
				time -= Time.deltaTime;
			}
			else
			{
				time -= Time.unscaledDeltaTime;
			}
			if (time < 0f)
			{
				time = 0f;
				done();
			}
		}
	}
}
public class PrivateTimer : MonoBehaviour
{
	private float time;

	private bool scaled;

	public Action done;

	public bool SetTimer(float _time, bool _scaled, bool force = false)
	{
		if (time <= 0f || force)
		{
			time = _time;
			scaled = _scaled;
			return true;
		}
		return false;
	}

	public bool SetScaled(bool _scaled)
	{
		if (scaled == _scaled)
		{
			scaled = _scaled;
			return true;
		}
		return false;
	}

	private void Update()
	{
		if (time != 0f)
		{
			if (scaled)
			{
				time -= Time.deltaTime;
			}
			else
			{
				time -= Time.unscaledDeltaTime;
			}
			if (time < 0f)
			{
				time = 0f;
				done();
			}
		}
	}
}
public class RigidbodyStopper : MonoBehaviour
{
	private static HashSet<RigidbodyStopper> instances = new HashSet<RigidbodyStopper>();

	private static HashSet<GameObject> gos = new HashSet<GameObject>();

	public float localScale = 1f;

	private bool gravity;

	private bool frozen;

	private bool byDio;

	private bool isCoin;

	private bool isRocket;

	private bool isNail;

	private bool isLandmine;

	private bool isChainsaw;

	private Coin coin;

	private SphereCollider sc;

	private BoxCollider bc;

	public EnemyIdentifier eid;

	private Grenade grenade;

	private GameObject freezeEffect;

	public Vector3 unscaledVelocity = new Vector3(0f, 0f, 0f);

	public Vector3 unscaledAngularVelocity = new Vector3(0f, 0f, 0f);

	public Rigidbody R;

	private float time;

	public static HashSet<GameObject> HashedGameObjects => gos;

	public static void FreezeAll()
	{
		foreach (RigidbodyStopper instance in instances)
		{
			instance.Freeze();
		}
	}

	public static void AddRBS(GameObject go)
	{
		if (gos.Add(go))
		{
			go.AddComponent<RigidbodyStopper>();
		}
	}

	public void Freeze()
	{
		//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_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		isCoin = Object.op_Implicit((Object)(object)coin);
		if (isLandmine)
		{
			((Component)((Component)this).transform.Find("Trigger")).gameObject.SetActive(false);
		}
		if (!Object.op_Implicit((Object)(object)R))
		{
			R = ((Component)this).gameObject.GetComponent<Rigidbody>();
		}
		if (Object.op_Implicit((Object)(object)R))
		{
			if (!R.isKinematic)
			{
				unscaledVelocity = R.velocity;
				unscaledAngularVelocity = R.angularVelocity;
				if (R.useGravity)
				{
					R.useGravity = false;
					gravity = true;
				}
				frozen = true;
			}
			if (Timestopper.realTimeScale == 0f)
			{
				byDio = true;
			}
		}
		else
		{
			((Behaviour)this).enabled = false;
		}
	}

	private void UnFreeze()
	{
		//IL_0098: 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)
		if (isLandmine)
		{
			((Component)((Component)this).transform.Find("Trigger")).gameObject.SetActive(true);
		}
		if (isChainsaw)
		{
			R.isKinematic = false;
		}
		if (!Object.op_Implicit((Object)(object)R))
		{
			R = ((Component)this).gameObject.GetComponent<Rigidbody>();
		}
		if (Object.op_Implicit((Object)(object)R))
		{
			if (!R.isKinematic)
			{
				localScale = 1f;
				R.velocity = unscaledVelocity;
				R.angularVelocity = unscaledAngularVelocity;
				if (gravity)
				{
					R.useGravity = true;
				}
				gravity = false;
				frozen = false;
			}
		}
		else
		{
			((Behaviour)this).enabled = false;
		}
	}

	private void Awake()
	{
		Transform obj = ((Component)this).transform.Find("FreezeEffect");
		freezeEffect = ((obj != null) ? ((Component)obj).gameObject : null);
		grenade = ((Component)this).GetComponent<Grenade>();
		isChainsaw = Object.op_Implicit((Object)(object)((Component)this).GetComponent<Chainsaw>());
		coin = ((Component)this).GetComponent<Coin>();
		sc = ((Component)this).gameObject.GetComponent<SphereCollider>();
		bc = ((Component)this).gameObject.GetComponent<BoxCollider>();
		eid = ((Component)this).GetComponent<EnemyIdentifier>();
		if (((Component)this).transform.IsChildOf(Timestopper.Player.transform) || (Object)(object)((Component)this).transform == (Object)(object)Timestopper.Player.transform)
		{
			((Behaviour)this).enabled = false;
			return;
		}
		if ((Object)(object)((Component)this).GetComponent<Nail>() != (Object)null)
		{
			if ((((Component)this).GetComponent<Nail>().sawblade || ((Component)this).GetComponent<Nail>().chainsaw) && (Object)(object)((Component)this).GetComponent<FixedUpdateCaller>() == (Object)null)
			{
				((Component)this).gameObject.AddComponent<FixedUpdateCaller>();
			}
			isNail = true;
		}
		if ((Object)(object)((Component)this).GetComponent<Landmine>() != (Object)null)
		{
			isLandmine = true;
		}
		if ((Object)(object)((Component)this).gameObject.GetComponent<Coin>() != (Object)null)
		{
			isCoin = true;
		}
		if ((Object)(object)((Component)this).GetComponent<Chainsaw>() != (Object)null && (Object)(object)((Component)this).GetComponent<FixedUpdateCaller>() == (Object)null)
		{
			((Component)this).gameObject.AddComponent<FixedUpdateCaller>();
		}
		if ((Object)(object)((Component)this).gameObject.GetComponent<Grenade>() != (Object)null)
		{
			isRocket = ((Component)this).gameObject.GetComponent<Grenade>().rocket;
		}
		R = ((Component)this).gameObject.GetComponent<Rigidbody>();
		instances.Add(this);
		if (Timestopper.TimeStop)
		{
			Freeze();
		}
	}

	public void OnDestroy()
	{
		instances.Remove(this);
		gos.Remove(((Component)this).gameObject);
	}

	public void Update()
	{
		if (Timestopper.TimeStop)
		{
			if ((Object)(object)R != (Object)null && R.isKinematic)
			{
				localScale = 0.5f;
			}
			if (!frozen)
			{
				Freeze();
			}
			time += Time.unscaledDeltaTime;
			if (time > Time.maximumDeltaTime)
			{
				time = Time.maximumDeltaTime;
			}
			while (time >= Time.fixedDeltaTime)
			{
				time -= Time.fixedDeltaTime;
				FakeFixedUpdate();
			}
		}
		else if (frozen)
		{
			UnFreeze();
		}
	}

	public void FakeFixedUpdate()
	{
		//IL_0047: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: 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_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0278: 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_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0310: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_032c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0331: Unknown result type (might be due to invalid IL or missing references)
		//IL_0336: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)eid) && eid.hooked && ((List<EnemyType>)AccessTools.Field(typeof(HookArm), "lightEnemies").GetValue(MonoSingleton<HookArm>.Instance)).Contains(eid.enemyType))
		{
			R.isKinematic = false;
			localScale = 1f;
			unscaledVelocity = R.velocity;
			return;
		}
		if (isCoin)
		{
			((Collider)sc).enabled = true;
			((Collider)bc).enabled = true;
			((MonoBehaviour)coin).Invoke("StartCheckingSpeed", 0f);
			isCoin = false;
		}
		if (Timestopper.TimeStop && Object.op_Implicit((Object)(object)R))
		{
			if (Object.op_Implicit((Object)(object)((Component)this).transform.parent) && ((Object)((Component)this).transform.parent).name == "GibZone" && localScale == 0f && Object.op_Implicit((Object)(object)R))
			{
				return;
			}
			if (isChainsaw && localScale == 0f)
			{
				R.isKinematic = true;
			}
			if (R.isKinematic || !((Component)this).gameObject.activeInHierarchy)
			{
				unscaledVelocity = Vector3.zero;
				unscaledAngularVelocity = Vector3.zero;
				return;
			}
			if (isRocket)
			{
				R.isKinematic = !grenade.frozen;
				grenade.rideable = true;
				((object)grenade).GetType().GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(grenade, null);
				R.isKinematic = false;
			}
			if (R.isKinematic)
			{
				return;
			}
			R.useGravity = false;
			unscaledVelocity += R.GetAccumulatedForce(Time.fixedDeltaTime) * Time.fixedDeltaTime;
			R.AddForce(-R.GetAccumulatedForce(Time.fixedDeltaTime));
			if (gravity)
			{
				unscaledVelocity += R.velocity - (unscaledVelocity - Physics.gravity * Time.fixedDeltaTime) * localScale;
			}
			else
			{
				unscaledVelocity += R.velocity - unscaledVelocity * localScale;
			}
			unscaledAngularVelocity += R.angularVelocity - unscaledAngularVelocity * localScale;
			R.velocity = unscaledVelocity * localScale;
			R.angularVelocity = unscaledAngularVelocity * localScale;
			if (!isRocket || !Object.op_Implicit((Object)(object)MonoSingleton<WeaponCharges>.Instance) || !MonoSingleton<WeaponCharges>.Instance.rocketFrozen)
			{
				if (isNail)
				{
					localScale -= Timestopper.playerDeltaTime / Timestopper.stopSpeed.value * 32f;
				}
				else if (byDio)
				{
					localScale -= Timestopper.playerDeltaTime / Timestopper.affectSpeed.value;
				}
				else
				{
					localScale -= Timestopper.playerDeltaTime / Timestopper.stopSpeed.value;
				}
				if (localScale < 0f)
				{
					localScale = 0f;
				}
				return;
			}
			MonoSingleton<WeaponCharges>.Instance.rocketFrozen = false;
			grenade.rideable = true;
			MethodInfo method = ((object)grenade).GetType().GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (method != null)
			{
				method.Invoke(grenade, null);
			}
			freez