Decompiled source of The Timestopper v1.0.5

The Timestopper.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
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 Sandbox.Arm;
using TMPro;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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 = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace The_Timestopper;

public enum TProgress
{
	hasArm,
	equippedArm,
	firstWarning,
	upgradeCount,
	maxTime,
	upgradeText,
	upgradeCost
}
[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 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 object ArmStatus(TProgress id)
	{
		TimestopperProgress timestopperProgress = Read();
		return id switch
		{
			TProgress.hasArm => timestopperProgress.hasArm, 
			TProgress.equippedArm => timestopperProgress.equippedArm, 
			TProgress.firstWarning => timestopperProgress.firstWarning, 
			TProgress.upgradeCount => timestopperProgress.upgradeCount, 
			TProgress.maxTime => timestopperProgress.maxTime, 
			TProgress.upgradeText => "<align=\"center\"><color=#FFFF42>" + GenerateTextBar('▮', timestopperProgress.upgradeCount) + "</color>", 
			TProgress.upgradeCost => 150000 + timestopperProgress.upgradeCount * 66000, 
			_ => null, 
		};
	}

	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 ForceDownngradeArm()
	{
		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 AceptWarning()
	{
		TimestopperProgress timestopperProgress = Read();
		timestopperProgress.firstWarning = true;
		Write(timestopperProgress);
	}

	public static void GiveArm()
	{
		TimestopperProgress timestopperProgress = Read();
		timestopperProgress.hasArm = true;
		timestopperProgress.equippedArm = true;
		((Component)Timestopper.Player.transform.Find("Main Camera/Punch/Arm Gold")).gameObject.SetActive(true);
		((Component)Timestopper.Player.transform.Find("Main Camera/Punch/Arm Gold/Timestopper")).gameObject.SetActive(true);
		((Component)Timestopper.Player.transform.Find("Main Camera/Punch/Arm Gold")).gameObject.GetComponent<Animator>().Play("Pickup");
		Timestopper.mls.LogInfo((object)"Received Golden Arm");
		Write(timestopperProgress);
	}

	public static void ChangeEquipmentStatus()
	{
		Timestopper.mls.LogWarning((object)"Dum dum gumgineashi");
		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!");
		}
	}

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

	public static TimestopperProgress Read()
	{
		try
		{
			string path = Path.Combine(GameProgressSaver.SavePath, "timestopper.state");
			if (File.Exists(path))
			{
				inst = JsonUtility.FromJson<TimestopperProgress>(File.ReadAllText(path));
				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.0.5")]
public class Timestopper : BaseUnityPlugin
{
	public enum SoundTypeA
	{
		None,
		Classic,
		Alternate,
		Za_Warudo
	}

	public enum SoundTypeB
	{
		None,
		Classic,
		Alternate,
		Ambience
	}

	public enum SoundTypeC
	{
		None,
		Classic,
		Alternate
	}

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

		public static IntValueChangeEventDelegate <>9__96_1;

		public static Action <>9__105_0;

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

		internal void <OnSceneLoaded>b__105_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.0.5";

	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 slappShader;

	public static Camera HUDCamera;

	public static RenderTexture HUDRender;

	public static AudioClip[] TimestopSounds = (AudioClip[])(object)new AudioClip[4];

	public static AudioClip[] StoppedTimeAmbiences = (AudioClip[])(object)new AudioClip[4];

	public static AudioClip[] TimestartSounds = (AudioClip[])(object)new AudioClip[4];

	public static Texture2D armGoldLogo;

	public static Texture2D armGoldText;

	public static Texture2D armGoldColor;

	public static Texture2D newRoomColor;

	public static GameObject armGoldObj;

	public static GameObject newRoomObj;

	public static GameObject newRoom;

	public static Animator armGoldAnimator = new Animator();

	public static RuntimeAnimatorController armGoldAC;

	public AssetBundle bundle;

	private GameObject[] TimeHUD = (GameObject[])(object)new GameObject[3];

	public static GameObject Player;

	public static GameObject LatestTerminal;

	public static GameObject TheCube;

	public static GameObject MenuCanvas;

	public static bool TimeStop = false;

	public static bool StopTimeStop = false;

	public static float TimeLeft = 0f;

	public static float StoppedTimeAmount = 0f;

	public static Color TimeColor = new Color(1f, 1f, 0f, 1f);

	public static bool terminalUpdate = false;

	public static bool LoadDone = false;

	public static bool LoadStarted = false;

	public static float realTimeScale = 1f;

	public static bool fixedCall = false;

	public static bool parryWindow = false;

	public static bool firstLoad = true;

	public static bool cybergrind = false;

	public static int cybergrindWave = 0;

	public static bool UnscaleTimeSince = false;

	public static PrivateInsideTimer messageTimer = new PrivateInsideTimer();

	private GameObject currentLevelInfo;

	public static BlindEnemies BlindCheat = new BlindEnemies();

	private IEnumerator timeStopper;

	private IEnumerator timeStarter;

	public static bool Compatability_JukeBox = false;

	public static KeyCodeField stopKey;

	public static EnumField<SoundTypeA> stopSound;

	public static EnumField<SoundTypeB> stoppedSound;

	public static EnumField<SoundTypeC> startSound;

	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 FloatField grayscaleAmount;

	public static BoolField exclusiveGrayscale;

	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 blindScale;

	public static FloatField refillMultiplier;

	public static FloatField bonusTimeForParry;

	public static FloatField antiHpMultiplier;

	public static ColorField timeJuiceColorNormal;

	public static ColorField timeJuiceColorInsufficient;

	public static ColorField timeJuiceColorUsing;

	public static ColorField timeJuiceColorNoCooldown;

	private PluginConfigurator config;

	public static bool frameLaterer = false;

	private bool menuOpenLastFrame;

	private float time;

	[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 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);
			}
		}
	}

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

	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_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Expected O, but got Unknown
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Expected O, but got Unknown
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Expected O, but got Unknown
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Expected O, but got Unknown
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Expected O, but got Unknown
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Expected O, but got Unknown
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Expected O, but got Unknown
		//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Expected O, but got Unknown
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Expected O, but got Unknown
		//IL_030c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Expected O, but got Unknown
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c5: Expected O, but got Unknown
		//IL_0413: Unknown result type (might be due to invalid IL or missing references)
		//IL_041d: Expected O, but got Unknown
		//IL_0437: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Expected O, but got Unknown
		//IL_0457: Unknown result type (might be due to invalid IL or missing references)
		//IL_045c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0468: Expected O, but got Unknown
		//IL_0478: Unknown result type (might be due to invalid IL or missing references)
		//IL_0490: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ce: Expected O, but got Unknown
		//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Expected O, but got Unknown
		//IL_052f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0534: Unknown result type (might be due to invalid IL or missing references)
		//IL_053e: Expected O, but got Unknown
		//IL_0567: Unknown result type (might be due to invalid IL or missing references)
		//IL_056c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Expected O, but got Unknown
		//IL_0586: Unknown result type (might be due to invalid IL or missing references)
		//IL_059e: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e5: Expected O, but got Unknown
		//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ea: Expected O, but got Unknown
		//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fb: Expected O, but got Unknown
		//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0600: Expected O, but got Unknown
		//IL_0600: Unknown result type (might be due to invalid IL or missing references)
		//IL_0615: Expected O, but got Unknown
		//IL_0610: Unknown result type (might be due to invalid IL or missing references)
		//IL_061a: Expected O, but got Unknown
		//IL_061a: Unknown result type (might be due to invalid IL or missing references)
		//IL_062f: Expected O, but got Unknown
		//IL_062a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0634: Expected O, but got Unknown
		//IL_0648: Expected O, but got Unknown
		//IL_0643: Unknown result type (might be due to invalid IL or missing references)
		//IL_064d: Expected O, but got Unknown
		//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f4: 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);
		if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
		{
			Log("Linux OS detected, grayscale effects are turned off by default!", extensive: true, 3);
			grayscale = new BoolField(config.rootPanel, "Grayscale Effect", "doGrayscale", false);
		}
		else
		{
			grayscale = new BoolField(config.rootPanel, "Grayscale Effect", "doGrayscale", true);
		}
		ConfigDivision grayscaleOptions = new ConfigDivision(config.rootPanel, "grayscaleOptions")
		{
			interactable = grayscale.value
		};
		grayscale.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
		{
			((ConfigField)grayscaleOptions).interactable = e.value;
			if (e.value)
			{
				((MonoBehaviour)Instance).StartCoroutine(InitializeShaders());
			}
		};
		exclusiveGrayscale = new BoolField((ConfigPanel)(object)grayscaleOptions, "Exclusive Grayscale", "exclusivegrayscale", true);
		grayscaleAmount = new FloatField((ConfigPanel)(object)grayscaleOptions, "Grayscale Amount", "grayscaleamount", 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);
		stopSound = new EnumField<SoundTypeA>(config.rootPanel, "Timestop Sound", "timestopprofile", SoundTypeA.Classic);
		stoppedSound = new EnumField<SoundTypeB>(config.rootPanel, "Stopped Time Ambience", "ambienceprofile", SoundTypeB.Classic);
		startSound = new EnumField<SoundTypeC>(config.rootPanel, "Timestart Sound", "timestartprofile", SoundTypeC.Classic);
		new ConfigSpace(config.rootPanel, 4f);
		new ConfigHeader(config.rootPanel, "-- GAMEPLAY --", 24);
		maxUpgrades = new IntField(config.rootPanel, "Maximum Number of Upgrades", "maxupgrades", 10);
		maxUpgrades.minimumValue = 1;
		IntField obj = maxUpgrades;
		object obj2 = <>c.<>9__96_1;
		if (obj2 == null)
		{
			IntValueChangeEventDelegate val = delegate(IntValueChangeEvent e)
			{
				if (e.value < 1)
				{
					e.value = 1;
					maxUpgrades.value = 1;
				}
			};
			<>c.<>9__96_1 = val;
			obj2 = (object)val;
		}
		obj.onValueChange += (IntValueChangeEventDelegate)obj2;
		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 val2 = new ConfigPanel(config.rootPanel, "ADVANCED", "advancedoptions");
		new ConfigSpace(config.rootPanel, 8f);
		extensiveLogging = new BoolField(val2, "Extensive Logging", "extensivelogging", false);
		forceDowngrade = new BoolField(val2, "Force Downgrade Arm", "forcedowngrade", true);
		lowerTreshold = new FloatField(val2, "Min Time Juice to Stop Time", "lowertreshold", 2f);
		blindScale = new FloatField(val2, "Blinding TimeScale", "blindscale", 0.2f);
		antiHpMultiplier = new FloatField(val2, "Hard Damage Buildup Multiplier", "antihpmultiplier", 30f);
	}

	public IEnumerator LoadBundle()
	{
		LoadDone = false;
		LoadStarted = true;
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string[] manifestResourceNames = executingAssembly.GetManifestResourceNames();
		Log("Scanning embedded resources: " + string.Join(", ", manifestResourceNames), extensive: true);
		using (Stream stream = executingAssembly.GetManifestResourceStream("The_Timestopper.timestopper_assets_all.bundle"))
		{
			if ((Object)(object)bundle == (Object)null)
			{
				bundle = AssetBundle.LoadFromStream(stream);
			}
			else
			{
				Log("Bundle is already loaded!", extensive: true);
			}
			if ((Object)(object)bundle == (Object)null)
			{
				Log("AssetBundle failed to load!", extensive: true, 3);
				yield break;
			}
			Log(">Loading bundle asyncroniously:", extensive: true);
			Log(">All assets in bundle:", extensive: true);
			string[] allAssetNames = bundle.GetAllAssetNames();
			foreach (string text in allAssetNames)
			{
				Log("-->" + text, extensive: true);
			}
			grayscaleShader = bundle.LoadAsset<Shader>("Assets/BundledAssets/Grayscale.shader");
			if ((Object)(object)grayscaleShader == (Object)null || !grayscaleShader.isSupported)
			{
				Log("Failed to load Grayscale shader", extensive: true, 3);
			}
			slappShader = bundle.LoadAsset<Shader>("Assets/BundledAssets/Slapp.shader");
			if ((Object)(object)slappShader == (Object)null)
			{
				Log("Failed to load Slapp shader", extensive: true, 3);
			}
			TimestopSounds[1] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeStop-Classic.mp3");
			if ((Object)(object)TimestopSounds[1] == (Object)null)
			{
				Log("Failed to load TimeStop-Classic", extensive: true, 3);
			}
			TimestopSounds[2] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeStop-Alternate.mp3");
			if ((Object)(object)TimestopSounds[2] == (Object)null)
			{
				Log("Failed to load TimeStop-Alternate", extensive: true, 3);
			}
			TimestopSounds[3] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeStop-ZaWarudo.mp3");
			if ((Object)(object)TimestopSounds[3] == (Object)null)
			{
				Log("Failed to load TimeStop-ZaWarudo", extensive: true, 3);
			}
			StoppedTimeAmbiences[1] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeJuice-Classic.mp3");
			if ((Object)(object)StoppedTimeAmbiences[1] == (Object)null)
			{
				Log("Failed to load TimeJuice-Classic", extensive: true, 3);
			}
			StoppedTimeAmbiences[2] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeJuice-Alternate.mp3");
			if ((Object)(object)StoppedTimeAmbiences[2] == (Object)null)
			{
				Log("Failed to load TimeJuice-Alternate", extensive: true, 3);
			}
			StoppedTimeAmbiences[3] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeJuice-Ambience.mp3");
			if ((Object)(object)StoppedTimeAmbiences[3] == (Object)null)
			{
				Log("Failed to load TimeJuice-Ambience", extensive: true, 3);
			}
			TimestartSounds[1] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeStart-Classic.mp3");
			if ((Object)(object)TimestartSounds[1] == (Object)null)
			{
				Log("Failed to load TimeStart-Classic", extensive: true, 3);
			}
			TimestartSounds[2] = bundle.LoadAsset<AudioClip>("Assets/BundledAssets/Audio/TimeStart-Alternate.mp3");
			if ((Object)(object)TimestartSounds[2] == (Object)null)
			{
				Log("Failed to load TimeStart-Alternate", extensive: true, 3);
			}
			armGoldLogo = bundle.LoadAsset<Texture2D>("Assets/BundledAssets/Timestopper.png");
			if ((Object)(object)armGoldLogo == (Object)null)
			{
				Log("Failed to load Timestopper logo", extensive: true, 3);
			}
			if (config != null)
			{
				config.icon = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 512f, 512f), new Vector2(256f, 256f));
			}
			armGoldColor = bundle.LoadAsset<Texture2D>("Assets/BundledAssets/GoldArmColor.png");
			if ((Object)(object)armGoldColor == (Object)null)
			{
				Log("Failed to load Gold Arm Model", extensive: true, 3);
			}
			armGoldText = bundle.LoadAsset<Texture2D>("Assets/BundledAssets/TextmodeV1Arm4.png");
			if ((Object)(object)armGoldText == (Object)null)
			{
				Log("Failed to load Gold Arm Textmode", extensive: true, 3);
			}
			armGoldObj = bundle.LoadAsset<GameObject>("Assets/BundledAssets/gold arm model.fbx");
			if ((Object)(object)armGoldObj == (Object)null)
			{
				Log("Failed to load Gold Arm Model", extensive: true, 3);
			}
			armGoldAC = bundle.LoadAsset<RuntimeAnimatorController>("Assets/BundledAssets/AC.controller");
			if ((Object)(object)armGoldAC == (Object)null)
			{
				Log("Failed to load AC controller", extensive: true, 3);
			}
			yield return null;
			Log("Asset extraction status:", extensive: true);
		}
		Log("      >:Bundle extraction done!", extensive: true);
		TimeColor = timeJuiceColorNormal.value;
		TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
		LoadDone = true;
		LoadStarted = false;
	}

	public IEnumerator InitializeShaders()
	{
		if (!grayscale.value)
		{
			Log("Shader loading interrupted because grayscale effect is off!", extensive: false, 3);
			yield break;
		}
		if ((Object)(object)grayscaleShader == (Object)null)
		{
			Log("Shader loading interrupted because grayscale shader is null!", extensive: false, 3);
			yield break;
		}
		if (!grayscaleShader.isSupported)
		{
			Log("Shader loading interrupted because grayscale shader is not supported!", extensive: false, 3);
			yield break;
		}
		Log("Shaders are initializing...");
		do
		{
			if ((Object)(object)Player == (Object)null)
			{
				yield return null;
			}
			Camera component = ((Component)Player.transform.Find("Main Camera/Virtual Camera")).GetComponent<Camera>();
			if ((Object)(object)((Component)component).gameObject.GetComponent<Grayscaler>() == (Object)null)
			{
				((Component)component).gameObject.AddComponent<Grayscaler>();
			}
			((Component)component).gameObject.GetComponent<Grayscaler>().Initialize();
		}
		while ((Object)(object)Player == (Object)null);
		Log("Shaders have loaded into the player!", extensive: true);
	}

	public static GameObject UpdateTerminal(ShopZone ShopComp)
	{
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0488: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0539: 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 ((bool)TimestopperProgress.ArmStatus(TProgress.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.ArmStatus(TProgress.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, 512f, 512f), new Vector2(256f, 256f));
			((Component)gameObject3.transform.Find("Weapon Icon")).GetComponent<Image>().sprite = sprite;
			((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" + (string)TimestopperProgress.ArmStatus(TProgress.upgradeText);
			Sprite sprite2 = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 512f, 512f), new Vector2(256f, 256f));
			((Component)gameObject4.transform.Find("Panel/Icon Inset/Icon")).GetComponent<Image>().sprite = sprite2;
			if (!(bool)TimestopperProgress.ArmStatus(TProgress.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 obj = Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Enemies/Enemies Panel/Icon")).gameObject, val.transform.Find("Title"));
				Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Canvas/Background/Main Panel/Enemies/Enemies Panel/Icon")).gameObject, val.transform.Find("Title")).transform.localPosition = new Vector3(-37.1206f, -0.0031f, 0f);
				obj.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.AceptWarning;
				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 == (Object)null)
		{
			Player = ((Component)MonoSingleton<NewMovement>.Instance).gameObject;
			if ((Object)(object)Player == (Object)null)
			{
				return;
			}
			if ((Object)(object)Playerstopper.Instance == (Object)null)
			{
				Player.AddComponent<Playerstopper>();
			}
		}
		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);
		TimeHUD[0] = 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"));
		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;
		((Graphic)((Component)TimeHUD[0].transform.Find("Image/Image (1)")).gameObject.GetComponent<Image>()).color = TimeColor;
		Sprite sprite = Sprite.Create(armGoldLogo, new Rect(0f, 0f, 512f, 512f), new Vector2(256f, 256f));
		((Component)TimeHUD[0].transform.Find("Icon")).gameObject.GetComponent<Image>().sprite = sprite;
		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"));
		((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";
		Log("Golden Time Alt HUD created successfully.", extensive: true);
		TextMeshProUGUI[] array = Object.FindObjectsOfType<TextMeshProUGUI>(true);
		foreach (TextMeshProUGUI val in array)
		{
			if ((Object)(object)((TMP_Text)val).fontSharedMaterial != (Object)null)
			{
				((TMP_Text)val).fontMaterial = new Material(((TMP_Text)val).fontSharedMaterial);
				((Graphic)val).SetMaterialDirty();
			}
		}
	}

	public static void ResetGoldArm()
	{
		TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
		StartTime(0f);
	}

	public GameObject FindRootGameObject(string name)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		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 void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Expected O, but got Unknown
		//IL_0420: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0461: Unknown result type (might be due to invalid IL or missing references)
		//IL_0483: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0648: Unknown result type (might be due to invalid IL or missing references)
		//IL_0667: Unknown result type (might be due to invalid IL or missing references)
		//IL_0686: Unknown result type (might be due to invalid IL or missing references)
		//IL_0690: Unknown result type (might be due to invalid IL or missing references)
		//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_0732: Unknown result type (might be due to invalid IL or missing references)
		//IL_0737: Unknown result type (might be due to invalid IL or missing references)
		//IL_0747: Expected O, but got Unknown
		//IL_0770: Unknown result type (might be due to invalid IL or missing references)
		//IL_077a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0799: Unknown result type (might be due to invalid IL or missing references)
		//IL_07be: Unknown result type (might be due to invalid IL or missing references)
		//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0817: Unknown result type (might be due to invalid IL or missing references)
		//IL_0928: Unknown result type (might be due to invalid IL or missing references)
		//IL_093c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0941: Unknown result type (might be due to invalid IL or missing references)
		Log("scene name: " + ((Scene)(ref scene)).name, extensive: true, 1);
		Log(TimestopperProgress.ToString(), extensive: true);
		if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902")
		{
			mls.LogWarning((object)"main menu loaded");
			GameObject obj = Object.Instantiate<GameObject>(((Component)FindRootGameObject("Canvas").transform.Find("Main Menu (1)/V1/Knuckleblaster")).gameObject, FindRootGameObject("Canvas").transform.Find("Main Menu (1)/V1"));
			obj.GetComponent<Image>().sprite = Sprite.Create(armGoldText, new Rect(0f, 0f, (float)((Texture)armGoldText).width, (float)((Texture)armGoldText).height), Vector2.zero);
			((Object)obj).name = "Timestopper";
			obj.transform.localPosition = Vector3.zero;
			obj.transform.localScale = Vector3.one * 0.93f;
			obj.SetActive((bool)TimestopperProgress.ArmStatus(TProgress.hasArm));
			GameObject obj2 = Object.Instantiate<GameObject>(((Component)FindRootGameObject("Canvas").transform.Find("Difficulty Select (1)/Info Background/V1/Knuckleblaster")).gameObject, FindRootGameObject("Canvas").transform.Find("Difficulty Select (1)/Info Background/V1"));
			obj2.GetComponent<Image>().sprite = Sprite.Create(armGoldText, new Rect(0f, 0f, (float)((Texture)armGoldText).width, (float)((Texture)armGoldText).height), Vector2.zero);
			((Graphic)obj2.GetComponent<Image>()).color = new Color(0.125f, 0.125f, 0.125f, 1f);
			obj2.transform.localPosition = Vector3.zero;
			obj2.transform.localScale = Vector3.one * 0.93f;
			obj2.SetActive((bool)TimestopperProgress.ArmStatus(TProgress.hasArm));
		}
		TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
		TextMeshProUGUI[] array = Object.FindObjectsOfType<TextMeshProUGUI>(true);
		foreach (TextMeshProUGUI val in array)
		{
			if ((Object)(object)((TMP_Text)val).fontSharedMaterial != (Object)null)
			{
				((TMP_Text)val).fontMaterial = new Material(((TMP_Text)val).fontSharedMaterial);
				((Graphic)val).SetMaterialDirty();
			}
		}
		if (((Scene)(ref scene)).name != "b3e7f2f8052488a45b35549efb98d902" && ((Scene)(ref scene)).name != "Bootstrap" && LoadDone && ((Scene)(ref scene)).name != "241a6a8caec7a13438a5ee786040de32" && ((Scene)(ref scene)).name != "4c18368dae54f154da2ae65baf0e630e" && ((Scene)(ref scene)).name != "d8e7c3bbb0c2f3940aa7c51dc5849781")
		{
			if ((Object)(object)Playerstopper.Instance == (Object)null)
			{
				((Component)MonoSingleton<NewMovement>.Instance).gameObject.GetComponent<Playerstopper>();
			}
			if (forceDowngrade.value)
			{
				TimestopperProgress.ForceDownngradeArm();
			}
			((MonoBehaviour)this).StartCoroutine(LoadHUD());
			if (grayscale.value)
			{
				((MonoBehaviour)this).StartCoroutine(InitializeShaders());
			}
			StatsManager.checkpointRestart += ResetGoldArm;
			if (firstLoad && !(bool)TimestopperProgress.ArmStatus(TProgress.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);
			}
			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 obj3 = Object.Instantiate<GameObject>(GameObject.Find("Crossroads -> Forward Hall"), GameObject.Find("Stairway Down").transform);
			((Object)obj3).name = "Stairway Down -> Gold Arm Hall";
			obj3.transform.position = new Vector3(-14.6292f, -25.0312f, 590.2311f);
			obj3.transform.eulerAngles = new Vector3(0f, 270f, 0f);
			((Renderer)((Component)obj3.transform.GetChild(0)).GetComponent<MeshRenderer>()).materials[1].color = Color.yellow;
			((Renderer)((Component)obj3.transform.GetChild(0)).GetComponent<MeshRenderer>()).materials[2].color = Color.yellow;
			((Renderer)((Component)obj3.transform.GetChild(1)).GetComponent<MeshRenderer>()).materials[1].color = Color.yellow;
			((Renderer)((Component)obj3.transform.GetChild(1)).GetComponent<MeshRenderer>()).materials[2].color = Color.yellow;
			obj3.GetComponent<Door>().Close(false);
			obj3.GetComponent<Door>().Lock();
			obj3.GetComponent<Door>().activatedRooms = (GameObject[])(object)new GameObject[0];
			GameObject val2 = Object.Instantiate<GameObject>(((Component)GameObject.Find("First Section").transform.Find("Opening Halls Geometry/Opening Nonstuff/Forward Hall/Floor/AltarFloor/Altar (Red)")).gameObject, GameObject.Find("Stairway Down").transform);
			((Object)val2).name = "Altar (Blue Book) Variant";
			((Component)val2.transform.Find("Altars/Altar_Sulfur")).gameObject.SetActive(false);
			((Component)val2.transform.Find("Altars/Altar_Mercury")).gameObject.SetActive(true);
			Object.Destroy((Object)(object)((Component)val2.transform.Find("Cube")).GetComponent<ItemPlaceZone>());
			ItemPlaceZone val3 = ((Component)val2.transform.Find("Cube")).gameObject.AddComponent<ItemPlaceZone>();
			val3.acceptedItemType = (ItemType)1;
			((MonoBehaviour)val3).Invoke("Awake", 0f);
			((MonoBehaviour)val3).Invoke("Start", 0f);
			((Behaviour)val3).enabled = true;
			val3.altarElements = (InstantiateObject[])(object)new InstantiateObject[3]
			{
				((Component)val2.transform.Find("Altars/Altar_Mercury/Mercury_Raise")).GetComponent<InstantiateObject>(),
				((Component)val2.transform.Find("Altars/Altar_Salt/Salt_Raise")).GetComponent<InstantiateObject>(),
				((Component)val2.transform.Find("Altars/Altar_Sulfur/Sulfur_Raise")).GetComponent<InstantiateObject>()
			};
			val2.transform.Find("Cube").localEulerAngles = new Vector3(0f, 0f, 0f);
			val2.transform.position = new Vector3(-10.0146f, -24.9875f, 590.0158f);
			val2.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			new GameObject();
			TheCube = Object.Instantiate<GameObject>(GameObject.CreatePrimitive((PrimitiveType)3));
			((Object)TheCube).name = "Gold Arm Item";
			TheCube.AddComponent<Rigidbody>();
			TheCube.AddComponent<GoldArmItem>();
			((Renderer)TheCube.GetComponent<MeshRenderer>()).enabled = false;
			TheCube.transform.position = val2.transform.position + new Vector3(0f, 2f, 0f);
			GameObject obj4 = Object.Instantiate<GameObject>(armGoldObj, TheCube.transform);
			((Renderer)obj4.GetComponentInChildren<SkinnedMeshRenderer>()).material = new Material(FindShader("ULTRAKILL/Master"))
			{
				mainTexture = (Texture)(object)armGoldColor
			};
			obj4.GetComponentInChildren<SkinnedMeshRenderer>().updateWhenOffscreen = true;
			((Renderer)((Component)obj4.transform.GetChild(1)).GetComponentInChildren<SkinnedMeshRenderer>()).rayTracingMode = (RayTracingMode)3;
			obj4.transform.localScale = Vector3.one * 5f;
			obj4.transform.localPosition = new Vector3(0f, 1f, 0f);
			obj4.transform.GetChild(0).localPosition = new Vector3(0f, 0f, 0f);
			obj4.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			TheCube.transform.GetChild(0).GetChild(0).GetChild(0)
				.GetChild(0)
				.localEulerAngles = new Vector3(0f, 0f, 50f);
			TheCube.SetActive(false);
			val3.activateOnSuccess = (GameObject[])(object)new GameObject[1] { TheCube };
			val3.activateOnFailure = (GameObject[])(object)new GameObject[0];
			val3.deactivateOnSuccess = (GameObject[])(object)new GameObject[0];
			val3.arenaStatuses = (ArenaStatus[])(object)new ArenaStatus[0];
			val3.doors = (Door[])(object)new Door[0];
			val3.reverseArenaStatuses = (ArenaStatus[])(object)new ArenaStatus[0];
			val3.reverseDoors = (Door[])(object)new Door[0];
			val3.elementChangeEffect = ((Component)val2.transform.Find("Variant/Altars/ChangeEffect")).GetComponent<ParticleSystem>();
			Log("Added The Arm Cube", 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 obj5 = Object.FindObjectOfType(type);
				Component val4 = (Component)(object)((obj5 is Component) ? obj5 : 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)
	{
		if (((Scene)(ref scene)).name != "b3e7f2f8052488a45b35549efb98d902" && ((Scene)(ref scene)).name != "Bootstrap" && LoadDone && ((Scene)(ref scene)).name != "241a6a8caec7a13438a5ee786040de32" && realTimeScale < 1f)
		{
			StartTime(0f, preventStyle: true);
		}
	}

	private bool ConfirmLevel(string LayerName)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: 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)
	{
		((MonoBehaviour)this).StopCoroutine(timeStarter);
		StoppedTimeAmount = 0f;
		if (filterMusic.value)
		{
			MonoSingleton<MusicManager>.Instance.FilterMusic();
		}
		Physics.simulationMode = (SimulationMode)2;
		Rigidbody[] array = Object.FindObjectsOfType<Rigidbody>();
		for (int i = 0; i < array.Length; i++)
		{
			GameObject gameObject = ((Component)array[i]).gameObject;
			if ((Object)(object)((Component)Playerstopper.Instance).gameObject != (Object)(object)gameObject)
			{
				if ((Object)(object)gameObject.GetComponent<RigidbodyStopper>() == (Object)null)
				{
					gameObject.AddComponent<RigidbodyStopper>();
				}
				((Behaviour)gameObject.GetComponent<RigidbodyStopper>()).enabled = true;
				gameObject.GetComponent<RigidbodyStopper>().Freeze();
			}
		}
		AudioSource[] array2 = Object.FindObjectsOfType<AudioSource>();
		foreach (AudioSource val in array2)
		{
			if ((Object)(object)((Component)val).gameObject.GetComponent<Audiopitcher>() == (Object)null && !((Component)val).gameObject.transform.IsChildOf(Player.transform) && !((Object)(object)((Component)val).gameObject == (Object)(object)Player))
			{
				((Component)val).gameObject.AddComponent<Audiopitcher>();
			}
		}
		Animator[] array3 = Object.FindObjectsOfType<Animator>();
		foreach (Animator val2 in array3)
		{
			if (((Component)val2).gameObject.transform.IsChildOf(Player.transform) && (int)val2.updateMode == 0)
			{
				val2.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)
	{
		((MonoBehaviour)this).StopCoroutine(timeStopper);
		if (filterMusic.value)
		{
			MonoSingleton<MusicManager>.Instance.UnfilterMusic();
		}
		Physics.simulationMode = (SimulationMode)0;
		Animator[] array = Object.FindObjectsOfType<Animator>();
		foreach (Animator val in array)
		{
			if (((Component)val).gameObject.transform.IsChildOf(Player.transform) && (int)val.updateMode == 2)
			{
				val.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)
	{
		Instance.timeStopper = Instance.CStopTime(time);
		((MonoBehaviour)Instance).StartCoroutine(Instance.timeStopper);
		TimeStop = true;
	}

	public static void StartTime(float time, bool preventStyle = false)
	{
		Instance.timeStarter = Instance.CStartTime(time, preventStyle);
		((MonoBehaviour)Instance).StartCoroutine(Instance.timeStarter);
		TimeStop = false;
	}

	public void UpdateTimeJuice()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		if (TimeStop)
		{
			TimeLeft -= playerDeltaTime * (1f - realTimeScale);
			StoppedTimeAmount += playerDeltaTime * (1f - realTimeScale);
			if (TimeLeft < 0f)
			{
				TimeLeft = 0f;
			}
			TimeColor = timeJuiceColorUsing.value;
		}
		else
		{
			if (realTimeScale <= 0.3f)
			{
				Player.GetComponent<NewMovement>().walking = false;
			}
			TimeLeft += Time.deltaTime * refillMultiplier.value;
			if (TimeLeft > (float)TimestopperProgress.ArmStatus(TProgress.maxTime))
			{
				TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
			}
			if (TimeLeft < lowerTreshold.value)
			{
				TimeColor = timeJuiceColorInsufficient.value;
			}
			else
			{
				TimeColor = timeJuiceColorNormal.value;
			}
		}
		if (NoWeaponCooldown.NoCooldown)
		{
			TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
			TimeColor = timeJuiceColorNoCooldown.value;
		}
	}

	public void UpdateHUD()
	{
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: 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_0344: Unknown result type (might be due to invalid IL or missing references)
		if (TimeHUD == null || (Object)(object)TimeHUD[0] == (Object)null || (Object)(object)TimeHUD[1] == (Object)null || (Object)(object)TimeHUD[2] == (Object)null)
		{
			return;
		}
		Color color = ((Graphic)((Component)TimeHUD[0].transform.Find("Image/Image (1)")).gameObject.GetComponent<Image>()).color;
		float fillAmount = ((Component)TimeHUD[0].transform.Find("Image")).gameObject.GetComponent<Image>().fillAmount;
		((Behaviour)((Component)TimeHUD[0].transform.Find("Image")).gameObject.GetComponent<Image>()).enabled = true;
		((Behaviour)((Component)TimeHUD[0].transform.Find("Image/Image (1)")).gameObject.GetComponent<Image>()).enabled = true;
		((Graphic)((Component)TimeHUD[0].transform.Find("Image/Image (1)")).gameObject.GetComponent<Image>()).color = (color * 5f + TimeColor) * Time.unscaledDeltaTime / (6f * Time.unscaledDeltaTime);
		((Component)TimeHUD[0].transform.Find("Image")).gameObject.GetComponent<Image>().fillAmount = (fillAmount * 8f + TimeLeft / (float)TimestopperProgress.ArmStatus(TProgress.maxTime)) * Time.unscaledDeltaTime / (9f * Time.unscaledDeltaTime);
		if ((bool)TimestopperProgress.ArmStatus(TProgress.equippedArm))
		{
			if (((Component)TimeHUD[1].transform.Find("Text (TMP)")).gameObject.activeInHierarchy)
			{
				TimeHUD[1].SetActive(true);
				((TMP_Text)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).text = TimeLeft.ToString().Substring(0, Math.Min(4, TimeLeft.ToString().Length));
				((Graphic)((Component)TimeHUD[1].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).color = (color * 5f + TimeColor) * Time.unscaledDeltaTime / (6f * Time.unscaledDeltaTime);
				return;
			}
			if (((Component)TimeHUD[2].transform.Find("Text (TMP)")).gameObject.activeInHierarchy)
			{
				TimeHUD[2].SetActive(true);
				((TMP_Text)((Component)TimeHUD[2].transform.Find("Text (TMP)")).GetComponent<TextMeshProUGUI>()).text = TimeLeft.ToString().Substring(0, Math.Min(4, TimeLeft.ToString().Length));
				return;
			}
			TimeHUD[0].SetActive(Time.timeSinceLevelLoad > 2.3f);
			if (HudController.Instance.weaponIcon.activeSelf)
			{
				TimeHUD[0].transform.localPosition = new Vector3(0f, 124.5f, 0f);
				((Component)HudController.Instance.speedometer).gameObject.transform.localPosition = new Vector3(-520f, 406f, 45f);
			}
			else
			{
				TimeHUD[0].transform.localPosition = new Vector3(0f, 24f, 0f);
				((Component)HudController.Instance.speedometer).gameObject.transform.localPosition = new Vector3(-520f, 6f, 45f);
			}
		}
		else
		{
			if (HudController.Instance.weaponIcon.activeSelf)
			{
				((Component)HudController.Instance.speedometer).gameObject.transform.localPosition = new Vector3(-520f, 342f, 45f);
			}
			else
			{
				((Component)HudController.Instance.speedometer).gameObject.transform.localPosition = new Vector3(-520f, -58f, 45f);
			}
			((Component)TimeHUD[0].transform.Find("Image")).gameObject.GetComponent<Image>().fillAmount = 0f;
			TimeHUD[0].SetActive(false);
			TimeHUD[1].SetActive(false);
			TimeHUD[2].SetActive(false);
		}
	}

	private void HandleHitstop()
	{
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		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);
			((GameObject)((value is GameObject) ? value : null)).SetActive(false);
			{
				foreach (Transform item in ((Component)Player.transform.Find("Main Camera/New Game Object")).transform)
				{
					Object.Destroy((Object)(object)((Component)item).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));
			}
		}
	}

	private void LateUpdate()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		Scene activeScene = SceneManager.GetActiveScene();
		if (((Scene)(ref activeScene)).name == "b3e7f2f8052488a45b35549efb98d902")
		{
			return;
		}
		activeScene = SceneManager.GetActiveScene();
		if (((Scene)(ref activeScene)).name == "Bootstrap")
		{
			return;
		}
		activeScene = SceneManager.GetActiveScene();
		if (((Scene)(ref activeScene)).name == "241a6a8caec7a13438a5ee786040de32")
		{
			return;
		}
		activeScene = SceneManager.GetActiveScene();
		if (((Scene)(ref activeScene)).name == "4c18368dae54f154da2ae65baf0e630e")
		{
			return;
		}
		activeScene = SceneManager.GetActiveScene();
		if (((Scene)(ref activeScene)).name == "d8e7c3bbb0c2f3940aa7c51dc5849781")
		{
			return;
		}
		if (cybergrind && cybergrindWave != MonoSingleton<EndlessGrid>.Instance.currentWave)
		{
			TimeLeft = (float)TimestopperProgress.ArmStatus(TProgress.maxTime);
			cybergrindWave = MonoSingleton<EndlessGrid>.Instance.currentWave;
		}
		PreventNull();
		UpdateTimeJuice();
		UpdateHUD();
		if (MonoSingleton<NewMovement>.Instance.dead && TimeStop)
		{
			StartTime(0f);
		}
		if (!TimeStop)
		{
			return;
		}
		Rigidbody[] array = Object.FindObjectsOfType<Rigidbody>();
		foreach (Rigidbody val in array)
		{
			if ((Object)(object)((Component)val).gameObject.GetComponent<RigidbodyStopper>() == (Object)null && (Object)(object)((Component)val).gameObject != (Object)(object)((Component)MonoSingleton<NewMovement>.Instance).gameObject)
			{
				((Component)val).gameObject.AddComponent<RigidbodyStopper>();
				((Component)val).gameObject.GetComponent<RigidbodyStopper>().Freeze();
			}
		}
		HandleHitstop();
		HandleMenuPause();
		time += Time.unscaledDeltaTime;
		if (time > Time.maximumDeltaTime)
		{
			time = Time.maximumDeltaTime;
		}
		while (time >= Time.fixedDeltaTime)
		{
			time -= Time.fixedDeltaTime;
			FakeFixedUpdate();
		}
	}
}
public class Audiopitcher : MonoBehaviour
{
	private AudioSource audio;

	private float originalPitch = 1f;

	private bool awake = true;

	private bool music
	{
		get
		{
			if (!audio.loop || audio.spatialBlend != 0f)
			{
				return (Object)(object)audio == (Object)(object)MonoSingleton<MusicManager>.Instance.targetTheme;
			}
			return true;
		}
	}

	public void LateUpdate()
	{
		if (!((Object)(object)((Component)this).GetComponent<AudioSource>() == (Object)null))
		{
			if (awake)
			{
				audio = ((Component)this).GetComponent<AudioSource>();
				originalPitch = audio.pitch;
				awake = false;
			}
			if (Timestopper.realTimeScale == 1f)
			{
				audio.pitch = originalPitch;
				originalPitch = audio.pitch;
			}
			else if (!music)
			{
				audio.pitch = originalPitch * Timestopper.realTimeScale;
			}
			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_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: 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)((Component)this).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject.transform.Find("Arm Info (Gold)")).gameObject;
		((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Image>().sprite = ((Component)gameObject.transform.Find("Panel/Back Button")).GetComponent<Image>().sprite;
		((TMP_Text)((Component)gameObject.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" + (string)TimestopperProgress.ArmStatus(TProgress.upgradeText);
		if ((int)TimestopperProgress.ArmStatus(TProgress.upgradeCount) < Timestopper.maxUpgrades.value)
		{
			if (GameProgressSaver.GetMoney() > (int)TimestopperProgress.ArmStatus(TProgress.upgradeCost))
			{
				((TMP_Text)((Component)gameObject.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = TimestopperProgress.ArmStatus(TProgress.upgradeCost).ToString() + " <color=#FF4343>P</color>";
				((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = false;
				((Selectable)((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = true;
				((Graphic)((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Image>()).color = Color.white;
			}
			else
			{
				((TMP_Text)((Component)gameObject.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = "<color=#FF4343>" + TimestopperProgress.ArmStatus(TProgress.upgradeCost).ToString() + " P</color>";
				((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = true;
				((Selectable)((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = false;
				((Graphic)((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Image>()).color = Color.red;
			}
		}
		else
		{
			((TMP_Text)((Component)gameObject.transform.Find("Panel/Purchase Button/Text")).GetComponent<TextMeshProUGUI>()).text = "<color=#FFEE43>MAX</color>";
			((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<ShopButton>().failure = true;
			((Selectable)((Component)gameObject.transform.Find("Panel/Purchase Button")).GetComponent<Button>()).interactable = false;
			((Graphic)((Component)gameObject.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 RenderTexture R = new RenderTexture(Screen.width, Screen.height, 32);

	private RenderTexture T = new RenderTexture(Screen.width, Screen.height, 32);

	private Camera camera;

	private Material _material;

	private Material _slapper;

	public float Grayscale;

	public void Initialize()
	{
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Expected O, but got Unknown
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Expected O, but got Unknown
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		if (!Timestopper.grayscaleShader.isSupported || (Object)(object)Timestopper.grayscaleShader == (Object)null)
		{
			Timestopper.Log("Grayscale shaders attempted initialization but was either null or unsupported!", extensive: false, 3);
			return;
		}
		if (!Timestopper.slappShader.isSupported || (Object)(object)Timestopper.slappShader == (Object)null)
		{
			Timestopper.Log("Image slapper shaders attempted initialization but was either null or unsupported!", extensive: false, 3);
			return;
		}
		if (!R.IsCreated())
		{
			R.Create();
		}
		if (!T.IsCreated())
		{
			T.Create();
		}
		_material = new Material(Timestopper.grayscaleShader);
		_slapper = new Material(Timestopper.slappShader);
		camera = Object.Instantiate<GameObject>(new GameObject(), ((Component)this).transform.parent).AddComponent<Camera>();
		((Behaviour)((Component)((Component)this).transform.parent.Find("HUD Camera")).gameObject.GetComponent<Camera>()).enabled = false;
		((Object)((Component)camera).gameObject).name = "New Camera by Galvin";
	}

	private void LateUpdate()
	{
		if ((Object)(object)Timestopper.grayscaleShader != (Object)null && !Timestopper.grayscaleShader.isSupported)
		{
			Timestopper.Log("grayscaler attempted grayscale but the shader was unsupported, turning geayscale effect off!", extensive: false, 3);
			Timestopper.grayscale.value = false;
			((Behaviour)((Component)((Component)this).transform.parent.Find("HUD Camera")).gameObject.GetComponent<Camera>()).enabled = true;
		}
	}

	private void OnRenderImage(RenderTexture source, RenderTexture destination)
	{
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Expected O, but got Unknown
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Expected O, but got Unknown
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)_material != (Object)null && (Object)(object)_slapper != (Object)null)
		{
			if (Timestopper.exclusiveGrayscale.value)
			{
				Grayscale = 1f - Timestopper.realTimeScale;
			}
			else
			{
				Grayscale = 1f - Time.timeScale;
			}
			RenderTexture active = RenderTexture.active;
			RenderTexture.active = R;
			GL.Clear(true, true, Color.clear);
			RenderTexture.active = active;
			_material.SetFloat("_Grayscale", Grayscale * Timestopper.grayscaleAmount.value);
			camera.CopyFrom(((Component)((Component)this).transform.parent.Find("HUD Camera")).gameObject.GetComponent<Camera>());
			camera.targetTexture = R;
			camera.Render();
			_slapper.SetTexture("_SlappedTex", (Texture)(object)R);
			Graphics.Blit((Texture)(object)source, T, _material);
			Graphics.Blit((Texture)(object)T, destination, _slapper);
		}
		else
		{
			if ((Object)(object)Timestopper.grayscaleShader != (Object)null)
			{
				_material = new Material(Timestopper.grayscaleShader);
			}
			if ((Object)(object)Timestopper.slappShader != (Object)null)
			{
				_slapper = new Material(Timestopper.slappShader);
			}
		}
	}
}
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))
		{
			((Component)((Component)((Component)col).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject.transform.Find("Variation Screen/Variations/Arm Panel (Gold)")).gameObject.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 GoldArmItem : MonoBehaviour
{
	public void OnCollisionEnter(Collision col)
	{
		//IL_0047: 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)col.gameObject).name == "Player")
		{
			TimestopperProgress.GiveArm();
			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);
			((Component)this).gameObject.SetActive(false);
			((Component)((Component)this).gameObject.transform.GetChild(0)).gameObject.SetActive(false);
			((Behaviour)this).enabled = false;
		}
	}

	public void Update()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		((Component)((Component)this).gameObject.transform.GetChild(0).GetChild(0).GetChild(0)
			.GetChild(0)
			.GetChild(1)
			.GetChild(0)
			.GetChild(0)).gameObject.transform.localEulerAngles = new Vector3(Time.timeSinceLevelLoad * 360f * 4f, 0f, -90f);
	}
}
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
{
	public float localScale = 1f;

	private bool gravity;

	private bool frozen;

	private bool byDio;

	private bool isCoin;

	private bool isRocket;

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

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

	public Rigidbody R;

	private float time;

	public void Freeze()
	{
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Component)this).GetComponent<Landmine>() != (Object)null)
		{
			((Component)((Component)this).transform.Find("Trigger")).gameObject.SetActive(false);
		}
		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>();
		if ((Object)(object)((Component)this).gameObject.GetComponent<Coin>() != (Object)null)
		{
			isCoin = true;
		}
		if ((Object)(object)R != (Object)null)
		{
			if (!R.isKinematic)
			{
				unscaledVelocity = R.velocity;
				unscaledAngularVelocity = R.angularVelocity;
				if (R.useGravity)
				{
					R.useGravity = false;
					gravity = true;
				}
				frozen = true;
			}
			if ((Object)(object)((Component)this).GetComponent<Nail>() != (Object)null && (((Component)this).GetComponent<Nail>().sawblade || ((Component)this).GetComponent<Nail>().chainsaw) && (Object)(object)((Component)this).GetComponent<FixedUpdateCaller>() == (Object)null)
			{
				((Component)this).gameObject.AddComponent<FixedUpdateCaller>();
			}
			if (Timestopper.realTimeScale == 0f)
			{
				byDio = true;
			}
		}
		else
		{
			((Behaviour)this).enabled = false;
		}
	}

	private void UnFreeze()
	{
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Component)this).GetComponent<Landmine>() != (Object)null)
		{
			((Component)((Component)this).transform.Find("Trigger")).gameObject.SetActive(true);
		}
		if ((Object)(object)((Component)this).GetComponent<Chainsaw>() != (Object)null)
		{
			R.isKinematic = false;
		}
		if ((Object)(object)R != (Object)null)
		{
			if (!R.isKinematic)
			{
				localScale = 1f;
				R.velocity = unscaledVelocity;
				R.angularVelocity = unscaledAngularVelocity;
				if (gravity)
				{
					R.useGravity = true;
				}
				gravity = false;
				frozen = false;
			}
		}
		else
		{
			R = ((Component)this).gameObject.GetComponent<Rigidbody>();
		}
	}

	public void Update()
	{
		if (Timestopper.TimeStop)
		{
			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_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: 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_0259: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Component)this).GetComponent<EnemyIdentifier>() != (Object)null && ((Component)this).GetComponent<EnemyIdentifier>().hooked && ((List<EnemyType>)AccessTools.Field(typeof(HookArm), "lightEnemies").GetValue(MonoSingleton<HookArm>.Instance)).Contains(((Component)this).GetComponent<EnemyIdentifier>().enemyType))
		{
			R.isKinematic = false;
			localScale = 1f;
			unscaledVelocity = R.velocity;
			return;
		}
		if (isCoin)
		{
			((Collider)((Component)this).gameObject.GetComponent<SphereCollider>()).enabled = true;
			((Collider)((Component)this).gameObject.GetComponent<BoxCollider>()).enabled = true;
			((MonoBehaviour)((Component)this).gameObject.GetComponent<Coin>()).Invoke("StartCheckingSpeed", 0f);
			isCoin = false;
		}
		if (Timestopper.TimeStop && (Object)(object)R != (Object)null)
		{
			if ((Object)(object)((Component)this).GetComponent<Chainsaw>() != (Object)null && localScale == 0f)
			{
				R.isKinematic = true;
			}
			if (R.isKinematic || !((Component)this).gameObject.activeInHierarchy)
			{
				return;
			}
			if (isRocket)
			{
				R.isKinematic = !((Component)this).GetComponent<Grenade>().frozen;
				((Component)this).GetComponent<Grenade>().rideable = true;
				((object)((Component)this).GetComponent<Grenade>()).GetType().GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(((Component)this).GetComponent<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 (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;
			((Component)this).GetComponent<Grenade>().rideable = true;
			((object)((Component)this).gameObject.GetComponent<Grenade>()).GetType().GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Invoke(((Component)this).gameObject.GetComponent<Grenade>(), null);
			((Component)((Component)this).transform.Find("FreezeEffect")).gameObject.SetActive(true);
			MonoSingleton<WeaponCharges>.Instance.rocketFrozen = true;
			if (localScale < 1f)
			{
				localScale += Timestopper.playerDeltaTime / Timestopper.stopSpeed.value;
			}
			if (localScale > 1f)
			{
				localScale = 1f;
			}
		}
		else if (frozen && (Object)(object)R != (Object)null)
		{
			UnFreeze();
		}
	}
}
public class FixedUpdateCaller : MonoBehaviour
{
	private float time;

	public void Update()
	{
		if (!Timestopper.TimeStop)
		{
			return;
		}
		time += Timestopper.playerDeltaTime;
		Timestopper.UnscaleTimeSince = true;
		Timestopper.fixedCall = true;
		if (time > Time.maximumDeltaTime)
		{
			time = Time.maximumDeltaTime;
		}
		while (time >= Time.fixedDeltaTime)
		{
			time -= Time.fixedDeltaTime;
			if ((Object)(object)((Component)this).gameObject.GetComponent<Nailgun>() != (Object)null)
			{
				ScaleNFade[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<ScaleNFade>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					Object.Destroy((Object)(object)((Component)componentsInChildren[i]).gameObject);
				}
			}
			Component[] components = ((Component)this).gameObject.GetComponents(typeof(MonoBehaviour));
			foreach (Component val in components)
			{
				((object)val).GetType().GetMethod("FixedUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(val, null);
			}
		}
		Timestopper.UnscaleTimeSince = true;
		Timestopper.fixedCall = false;
	}
}
public class Playerstopper : MonoBehaviour
{
	public static Playerstopper Instance;

	public GameObject GoldArm;

	public AudioSource audio;

	public float UnscaledDebug;

	public float JumpCooldown;

	public GameObject TheCube;

	public bool frameLaterer;

	public PrivateInsideTimer NotJumpingTimer = new PrivateInsideTimer();

	public PrivateInsideTimer JumpReadyTimer = new PrivateInsideTimer();

	private NewMovement movement;

	public IEnumerator LoadGoldArm()
	{
		yield return Timestopper.armGoldObj;
		yield return ((Component)this).transform.Find("Main Camera/Punch");
		GameObject val = Object.Instantiate<GameObject>(Timestopper.armGoldObj, ((Component)this).transform.Find("Main Camera/Punch"));
		Timestopper.Log("Loaded gold arm: " + (object)val, extensive: true);
		((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).material = new Material(Timestopper.FindShader("ULTRAKILL/Master"))
		{
			mainTexture = (Texture)(object)Timestopper.armGoldColor
		};
		((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).material.EnableKeyword("VERTEX_LIGHTING");
		((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).material.EnableKeyword("_FOG_ON");
		val.GetComponentInChildren<SkinnedMeshRenderer>().updateWhenOffscreen = true;
		((Object)val).name = "Arm Gold";
		val.layer = 13;
		foreach (Transform item in val.transform)
		{
			((Component)item).gameObject.layer = 13;
		}
		val.AddComponent<Animator>();
		val.GetComponent<Animator>().runtimeAnimatorController = Timestopper.armGoldAC;
		val.transform.localEulerAngles = new Vector3(0f, 250f, 12f);
		val.transform.localScale = new Vector3(10f, 10f, 10f);
		val.transform.localPosition = new Vector3(-0.6029f, -1.04f, -1.2945f);
		val.AddComponent<WalkingBob>();
		((Component)val.transform.GetChild(1)).gameObject.SetActive(false);
		Timestopper.Log("Golden Arm created successfully.", extensive: true);
	}

	public void FixedUpdateFix(Transform target)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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);
		}
	}

	public void Awake()
	{
		Instance = this;
		FixedUpdateFix(((Component)this).transform);
		((MonoBehaviour)this).StartCoroutine(LoadGoldArm());
		if ((Object)(object)GameObject.Find("GameController").GetComponent<FixedUpdateCaller>() == (Object)null)
		{
			GameObject.Find("GameController").gameObject.AddComponent<FixedUpdateCaller>();
		}
		movement = ((Component)this).gameObject.GetComponent<NewMovement>();
		PrivateInsideTimer jumpReadyTimer = JumpReadyTimer;
		jumpReadyTimer.done = (Action)Delegate.Combine(jumpReadyTimer.done, (Action)delegate
		{
			((MonoBehaviour)movement).StartCoroutine("JumpReady");
		});
		PrivateInsideTimer notJumpingTimer = NotJumpingTimer;
		notJumpingTimer.done = (Action)Delegate.Combine(notJumpingTimer.done, (Action)delegate
		{
			((MonoBehaviour)movement).StartCoroutine("NotJumping");
		});
	}

	public GameObject FindRootGameObject(string name)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		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 void PlayRespectiveSound(bool istimestopped)
	{
		if ((Object)(object)audio == (Object)null)
		{
			audio = ((Component)((Component)this).transform.Find("Main Camera")).gameObject.AddComponent<AudioSource>();
			audio.clip = Timestopper.StoppedTimeAmbiences[(int)Timestopper.stoppedSound.value];
		}
		if (istimestopped == Timestopper.TimeStop)
		{
			return;
		}
		if (istimestopped)
		{
			if ((Object)(object)Timestopper.TimestopSounds[(int)Timestopper.stopSound.value] != (Object)null)
			{
				audio.PlayOneShot(Timestopper.TimestopSounds[(int)Timestopper.stopSound.value]);
			}
			if ((Object)(object)Timestopper.StoppedTimeAmbiences[(int)Timestopper.stoppedSound.value] != (Object)null)
			{
				audio.clip = Timestopper.StoppedTimeAmbiences[(int)Timestopper.stoppedSound.value];
				audio.Play();
				audio.loop = true;
			}
		}
		else
		{
			audio.Stop();
			if ((Object)(object)Timestopper.TimestartSounds[(int)Timestopper.startSound.value] != (Object)null)
			{
				audio.PlayOneShot(Timestopper.TimestartSounds[(int)Timestopper.startSound.value]);
			}
		}
	}

	private void Update()
	{
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		if (Time.timeSinceLevelLoad < 0.2f)
		{
			return;
		}
		JumpReadyTimer.Update();
		NotJumpingTimer.Update();
		if (Timestopper.specialMode.value && UnityInput.Current.GetKeyDown((KeyCode)106))
		{
			GameProgressSaver.AddMoney((int)TimestopperProgress.ArmStatus(TProgress.upgradeCost));
			Timestopper.Log("MONEY MONEY MONEY");
		}
		if ((Object)(object)GoldArm == (Object)null)
		{
			GoldArm = ((Component)((Component)this).transform.Find("Main Camera/Punch/Arm Gold")).gameObject;
		}
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(0f, 250f - 32f * MonoSingleton<FistControl>.Instance.fistCooldown, 12f + 16f * MonoSingleton<FistControl>.Instance.fistCooldown);
		GoldArm.transform.localEulerAngles = (val * Timestopper.playerDeltaTime * 20f + GoldArm.transform.localEulerAngles) / (1f + Timestopper.playerDeltaTime * 20f);
		if ((UnityInput.Current.GetKeyDown(Timestopper.stopKey.value) && (bool)TimestopperProgress.ArmStatus(TProgress.equippedArm)) || (Timestopper.TimeStop && Timestopper.TimeLeft <= 0f) || (movement.dead && Timestopper.TimeStop))
		{
			if (MonoSingleton<OptionsManager>.Instance.paused)
			{
				return;
			}
			if (!Timestopper.TimeStop && !MonoSingleton<FistControl>.Instance.shopping && Timestopper.TimeLeft > Timestopper.lowerTreshold.value)
			{
				PlayRespectiveSound(istimestopped: true);
				Timestopper.StopTime(Timestopper.stopSpeed.value);
				((Component)GoldArm.transform.GetChild(1)).gameObject.SetActive(true);
				GoldArm.GetComponent<Animator>().Play("Stop");
				FixedUpdateFix(((Component)this).transform);
				Timestopper.Log("Time stops!", extensive: true);
			}
			else
			{
				PlayRespectiveSound(istimestopped: false);
				Timestopper.StartTime(Timestopper.startSpeed.value);
				((Component)GoldArm.transform.GetChild(1)).gameObject.SetActive(true);
				GoldArm.GetComponent<Animator>().Play("Release");
				Timestopper.BlindCheat.Disable();
				Timest