Decompiled source of SpeedrunMod v1.0.2

CrewBattleSkipper.dll

Decompiled 11 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using Reptile;
using Reptile.Phone;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("CrewBattleSkipper")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A speedrunning mod for BRC that makes it more fun.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6fcca975f0fef4fdd2abbfa7afc038c1b3ec857c")]
[assembly: AssemblyProduct("CrewBattleSkipper")]
[assembly: AssemblyTitle("CrewBattleSkipper")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CrewBattleSkipper
{
	[BepInPlugin("CrewBattleSkipper", "CrewBattleSkipper", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private GameObject _mod;

		private void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			_mod = new GameObject();
			_mod.AddComponent<SkipCrewBattle>();
			Object.DontDestroyOnLoad((Object)(object)_mod);
		}
	}
	public class SkipCrewBattle : MonoBehaviour
	{
		public float timer;

		public ScoreEncounter scoreEncounter;

		public GameObject scoreEncounterGO;

		public Player player;

		private WallrunLineAbility wallrunLineAbility;

		private readonly string configFilePath = Path.Combine(Paths.ConfigPath, "SpeedrunMod.cfg");

		private readonly string zipSpeedOutputPath = Path.Combine(Paths.ConfigPath, "zipStorageValue.txt");

		public bool zipStorageOverride;

		public float zipStorageValue1;

		public float zipStorageValue2;

		public string numToDisplay;

		private string currentLevel;

		public bool speedrunMode;

		private ObjectiveID currentObjective = (ObjectiveID)(-1);

		private ObjectiveID prevObjective = (ObjectiveID)(-1);

		private void ReadConfigFile()
		{
			string[] array = File.ReadAllLines(configFilePath);
			if (array.Length >= 2)
			{
				if (bool.TryParse(array[0].Split(new char[1] { '=' })[1].Trim(), out speedrunMode) && bool.TryParse(array[1].Split(new char[1] { '=' })[1].Trim(), out zipStorageOverride))
				{
					Debug.Log((object)$"Speedrun Mode: {speedrunMode}");
					Debug.Log((object)$"Zip Storage Override: {zipStorageOverride}");
					if (array.Length >= 4)
					{
						if (float.TryParse(array[2].Split(new char[1] { '=' })[1].Trim(), out zipStorageValue1) && float.TryParse(array[3].Split(new char[1] { '=' })[1].Trim(), out zipStorageValue2))
						{
							Debug.Log((object)$"Zip Storage Value 1: {zipStorageValue1}");
							Debug.Log((object)$"Zip Storage Value 2: {zipStorageValue2}");
							if (speedrunMode)
							{
								if (zipStorageValue1 > 122f)
								{
									zipStorageValue1 = 122f;
								}
								if (zipStorageValue2 > 148f)
								{
									zipStorageValue2 = 148f;
								}
							}
						}
						else
						{
							Debug.Log((object)"Error parsing zip storage values");
						}
					}
					else
					{
						Debug.Log((object)"Insufficient data in the config file.");
					}
				}
				else
				{
					Debug.Log((object)"Error parsing boolean values from the first two lines.");
				}
			}
			else
			{
				Debug.Log((object)"Config file does not have enough lines.");
			}
		}

		public void Awake()
		{
			if (!File.Exists(configFilePath))
			{
				File.WriteAllText(configFilePath, "speedrunMode=false\nzipStorageOverride=false\nzipStorageValue1=0.0\nzipStorageValue2=0.0");
				ReadConfigFile();
			}
			else
			{
				ReadConfigFile();
			}
			if (!File.Exists(zipSpeedOutputPath) && speedrunMode)
			{
				File.Create(zipSpeedOutputPath).Close();
			}
		}

		public void FixedUpdate()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_006d: 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_0926: Unknown result type (might be due to invalid IL or missing references)
			//IL_092b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0940: Unknown result type (might be due to invalid IL or missing references)
			//IL_0945: Unknown result type (might be due to invalid IL or missing references)
			//IL_094b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0951: Invalid comparison between Unknown and I4
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Invalid comparison between Unknown and I4
			//IL_0954: Unknown result type (might be due to invalid IL or missing references)
			//IL_095a: Invalid comparison between Unknown and I4
			//IL_0982: Unknown result type (might be due to invalid IL or missing references)
			//IL_0988: Invalid comparison between Unknown and I4
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Core.Instance.BaseModule != (Object)null && (Object)(object)player == (Object)null)
			{
				player = WorldHandler.instance.GetCurrentPlayer();
			}
			else if ((Object)(object)player != (Object)null)
			{
				wallrunLineAbility = (WallrunLineAbility)typeof(Player).GetField("wallrunAbility", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(player);
				Scene activeScene = SceneManager.GetActiveScene();
				currentLevel = ((Scene)(ref activeScene)).name;
			}
			if ((Object)(object)scoreEncounterGO == (Object)null && (Object)(object)player != (Object)null && !Core.Instance.BaseModule.IsLoading && ((Behaviour)player).isActiveAndEnabled)
			{
				if (currentLevel != "tower")
				{
					scoreEncounterGO = GameObject.Find("CrewBattle_ScoreEncounter");
				}
				else
				{
					scoreEncounterGO = GameObject.Find("ScoreEncounter_CrewBattle");
				}
			}
			if ((Object)(object)scoreEncounter == (Object)null && (Object)(object)player != (Object)null && (Object)(object)scoreEncounterGO != (Object)null && !Core.Instance.BaseModule.IsLoading)
			{
				scoreEncounter = scoreEncounterGO.GetComponent<ScoreEncounter>();
			}
			if ((Object)(object)scoreEncounter != (Object)null && !Core.Instance.BaseModule.IsLoading)
			{
				if (scoreEncounter.targetScoreName == "FRANKS" && currentLevel == "downhill")
				{
					GraffitiAppEntry unlockable = WorldHandler.instance.graffitiArtInfo.FindByTitle("Vom'B").unlockable;
					GraffitiAppEntry unlockable2 = WorldHandler.instance.graffitiArtInfo.FindByTitle("Zona Leste").unlockable;
					GraffitiAppEntry unlockable3 = WorldHandler.instance.graffitiArtInfo.FindByTitle("Jd Vila Formosa").unlockable;
					Core.Instance.SaveManager.CurrentSaveSlot.GetUnlockableDataByUid(((AUnlockable)unlockable).Uid).IsUnlocked = true;
					Core.Instance.SaveManager.CurrentSaveSlot.GetUnlockableDataByUid(((AUnlockable)unlockable2).Uid).IsUnlocked = true;
					Core.Instance.SaveManager.CurrentSaveSlot.GetUnlockableDataByUid(((AUnlockable)unlockable3).Uid).IsUnlocked = true;
					if ((float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) > 0f)
					{
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999999);
						typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 0f);
					}
					if ((int)typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 9999999 && (float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 0f)
					{
						typeof(Player).GetField("wallrunAbility", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(player);
						FieldInfo field = typeof(WallrunLineAbility).GetField("lastSpeed", BindingFlags.Instance | BindingFlags.NonPublic);
						if (!zipStorageOverride)
						{
							float num = (float)(new Random().NextDouble() * 3.0 + 103.0);
							num = (float)Math.Round(num, 2);
							field.SetValue(wallrunLineAbility, num);
							numToDisplay = num.ToString();
						}
						else
						{
							field.SetValue(wallrunLineAbility, zipStorageValue1);
							numToDisplay = zipStorageValue1.ToString();
						}
						player.AddBoostCharge(80f);
						Debug.Log((object)"Skipping!");
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999998);
					}
				}
				else if (scoreEncounter.targetScoreName == "ECLIPSE" && currentLevel == "tower")
				{
					if ((float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) > 0f)
					{
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999999);
						typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 0f);
					}
					if ((int)typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 9999999 && (float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 0f)
					{
						player.AddBoostCharge(80f);
						Debug.Log((object)"Skipped!");
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999998);
					}
				}
				else if (scoreEncounter.targetScoreName == "DOT EXE" && currentLevel == "Mall")
				{
					if ((float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) > 0f)
					{
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999999);
						typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 0f);
					}
					if ((int)typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 9999999 && (float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 0f)
					{
						typeof(Player).GetField("wallrunAbility", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(player);
						FieldInfo field2 = typeof(WallrunLineAbility).GetField("lastSpeed", BindingFlags.Instance | BindingFlags.NonPublic);
						if (!zipStorageOverride)
						{
							float num2 = (float)(new Random().NextDouble() * 6.400000000000006 + 140.6);
							num2 = (float)Math.Round(num2, 2);
							field2.SetValue(wallrunLineAbility, num2);
							numToDisplay = num2.ToString();
						}
						else
						{
							field2.SetValue(wallrunLineAbility, zipStorageValue2);
							numToDisplay = zipStorageValue2.ToString();
						}
						player.AddBoostCharge(80f);
						Debug.Log((object)"Skipping!");
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999998);
					}
				}
				else if (scoreEncounter.targetScoreName == "DEVIL THEORY" && currentLevel == "pyramid")
				{
					if ((float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) > 0f)
					{
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999999);
						typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 0f);
					}
					if ((int)typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 9999999 && (float)typeof(ScoreEncounter).GetField("timeLimitTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scoreEncounter) == 0f)
					{
						player.AddBoostCharge(80f);
						WorldHandler.instance.PlaceCurrentPlayerAt(new Vector3(-8.817884f, 90f, -16.14907f), ((Component)player).transform.rotation, false);
						Debug.Log((object)"Skipped!");
						typeof(ScoreEncounter).GetField("teammatesScore", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(scoreEncounter, 9999998);
					}
				}
			}
			if (speedrunMode)
			{
				prevObjective = currentObjective;
				currentObjective = Core.Instance.SaveManager.CurrentSaveSlot.CurrentStoryObjective;
				if ((int)currentObjective == 4 && (int)prevObjective == 3)
				{
					File.WriteAllText(zipSpeedOutputPath, "Dream 1: " + numToDisplay);
				}
				if ((int)currentObjective == 15 && (int)prevObjective == 8)
				{
					File.WriteAllText(zipSpeedOutputPath, "Dream 3: " + numToDisplay);
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "CrewBattleSkipper";

		public const string PLUGIN_NAME = "CrewBattleSkipper";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}

CutsceneSkipPlus.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Reptile;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CutsceneSkipPlus")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CutsceneSkipPlus")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a00dbf8f-8372-4f49-9379-17e60e900c24")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CutsceneSkipPlus;

internal class PatchCutscenes : MonoBehaviour
{
	[HarmonyPatch(typeof(SequenceHandler), "UpdateSequenceHandler")]
	public static class UpdateSequenceHandler_Patch
	{
		public static void Prefix(SequenceHandler __instance)
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			if (GetFieldValue(__instance, "sequence") != null && GetFieldValue(__instance, "sequence").ToString().Split(new char[1] { ' ' })[0] != "ChangeOutfitSequence")
			{
				SetFieldValue(__instance, "skipFadeDuration", 0f);
				SetFieldValue(__instance, "skipStartTimer", 1.5f);
				if (GetFieldValue(__instance, "skipTextActiveState").ToString() == "NOT_SKIPPABLE")
				{
					SetFieldValue(__instance, "skipTextActiveState", GetFieldValue((object)new SequenceHandler(), "skipTextActiveState"));
				}
			}
		}
	}

	private static BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("CutsceneSkipPlus");
		val.PatchAll();
	}

	private static object GetFieldValue(object classObject, string field)
	{
		return classObject.GetType().GetField(field, bindingFlags).GetValue(classObject);
	}

	private static void SetFieldValue(object classObject, string field, object value)
	{
		classObject.GetType().GetField(field, bindingFlags).SetValue(classObject, value);
	}
}
[BepInPlugin("ninjacookie.brc.cutsceneskipplus", "CutsceneSkipPlus", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public const string pluginGuid = "ninjacookie.brc.cutsceneskipplus";

	public const string pluginName = "CutsceneSkipPlus";

	public const string pluginVersion = "1.0.0";

	private GameObject _mod;

	private void Awake()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		_mod = new GameObject();
		_mod.AddComponent<PatchCutscenes>();
		Object.DontDestroyOnLoad((Object)(object)_mod);
	}
}

SaveRemover.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using BepInEx;
using HarmonyLib;
using Reptile;
using Reptile.Phone;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SaveRemover")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SaveRemover")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("256a36ee-ef03-453c-bb32-0266e662a82a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SaveRemover;

internal class EasyAccess : MonoBehaviour
{
	public static EasyAccess Instance;

	public Core core;

	public BaseModule baseModule;

	public SaveManager saveManager;

	public WorldHandler worldHandler;

	public Player player;

	public MoveStyle moveStyle = (MoveStyle)0;

	public int curAnim = 0;

	public Animator animator;

	public Phone phone;

	public GameplayCamera gameplayCamera;

	public Camera camera;

	public GameInput gameInput;

	private BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

	public EasyAccess()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		Instance = this;
	}

	private void Update()
	{
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Expected O, but got Unknown
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Expected O, but got Unknown
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Expected O, but got Unknown
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Expected O, but got Unknown
		//IL_024c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Expected O, but got Unknown
		if ((Object)(object)core == (Object)null)
		{
			core = Core.Instance;
		}
		if ((Object)(object)baseModule == (Object)null && (Object)(object)core != (Object)null)
		{
			baseModule = core.BaseModule;
		}
		if (saveManager == null && (Object)(object)core != (Object)null)
		{
			saveManager = core.SaveManager;
		}
		if ((Object)(object)worldHandler == (Object)null)
		{
			worldHandler = WorldHandler.instance;
		}
		if ((Object)(object)player == (Object)null && (Object)(object)worldHandler != (Object)null)
		{
			player = worldHandler.GetCurrentPlayer();
		}
		if ((Object)(object)player != (Object)null)
		{
			moveStyle = (MoveStyle)GetFieldValue(player, "moveStyle");
			curAnim = (int)GetFieldValue(player, "curAnim");
		}
		if ((Object)(object)animator == (Object)null && (Object)(object)player != (Object)null)
		{
			animator = (Animator)GetFieldValue(player, "anim");
		}
		if ((Object)(object)phone == (Object)null && (Object)(object)player != (Object)null)
		{
			phone = (Phone)GetFieldValue(player, "phone");
		}
		if ((Object)(object)gameplayCamera == (Object)null && (Object)(object)player != (Object)null)
		{
			gameplayCamera = (GameplayCamera)GetFieldValue(player, "cam");
		}
		if ((Object)(object)camera == (Object)null && (Object)(object)gameplayCamera != (Object)null)
		{
			camera = (Camera)GetFieldValue(gameplayCamera, "cam");
		}
		if (gameInput == null && (Object)(object)player != (Object)null)
		{
			gameInput = (GameInput)GetFieldValue(GetFieldValue(player, "playerInput"), "gameInput");
		}
	}

	public FieldInfo GetField(object classObject, string field)
	{
		return classObject.GetType().GetField(field, bindingFlags);
	}

	public object GetFieldValue(object classObject, string field)
	{
		return classObject.GetType().GetField(field, bindingFlags).GetValue(classObject);
	}

	public void SetFieldValue(object classObject, string field, object value)
	{
		classObject.GetType().GetField(field, bindingFlags).SetValue(classObject, value);
	}

	public void InvokeMethod(object classObject, string method, object[] objects = null)
	{
		classObject.GetType().GetMethod(method, bindingFlags).Invoke(classObject, objects);
	}

	public MethodInfo GetMethod(object classObject, string method)
	{
		return classObject.GetType().GetMethod(method, bindingFlags);
	}
}
internal class Patcher : MonoBehaviour
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("ninjacookie.brc.saveremover");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(SaveManager), "SaveCurrentSaveSlotImmediate")]
public static class SaveCurrentSaveSlotImmediate_Patch
{
	public static bool Prefix()
	{
		if (SaveRemover.Instance.saving)
		{
			SaveRemover.Instance.saving = false;
			SaveRemover.Instance.timeShow = 2f;
			return true;
		}
		return false;
	}
}
[HarmonyPatch(typeof(SaveManager), "SaveCurrentSaveSlot")]
public static class SaveCurrentSaveSlot_Patch
{
	public static bool Prefix()
	{
		return false;
	}
}
[HarmonyPatch(typeof(SaveManager), "SaveCurrentSaveSlotBackup")]
public static class SaveCurrentSaveSlotBackup_Patch
{
	public static bool Prefix()
	{
		return false;
	}
}
[HarmonyPatch(typeof(SplashScreen), "OnCoreInitialized")]
public static class OnCoreInitialized_Patch
{
	public static void Postfix(SplashScreen __instance)
	{
		EasyAccess.Instance.InvokeMethod(__instance, "LoginUser");
	}
}
[HarmonyPatch(typeof(SplashScreen), "StartAnimation")]
public static class StartAnimation_Patch
{
	public static bool Prefix()
	{
		if (SaveRemover.Instance.loading)
		{
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(BaseModule), "LoadMainMenuAfterLogin")]
public static class LoadMainMenuAfterLogin_Patch
{
	public static bool Prefix(BaseModule __instance)
	{
		return true;
	}
}
[BepInPlugin("ninjacookie.brc.saveremover", "Save Remover", "0.0.1")]
public class Plugin : BaseUnityPlugin
{
	public const string pluginGuid = "ninjacookie.brc.saveremover";

	public const string pluginName = "Save Remover";

	public const string pluginVersion = "0.0.1";

	private GameObject _mod;

	private void Awake()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		_mod = new GameObject();
		_mod.AddComponent<EasyAccess>();
		_mod.AddComponent<Patcher>();
		_mod.AddComponent<SaveRemover>();
		Object.DontDestroyOnLoad((Object)(object)_mod);
	}
}
internal class SaveRemover : MonoBehaviour
{
	private EasyAccess ea = EasyAccess.Instance;

	public static SaveRemover Instance;

	private GameObject loadingScreen;

	private BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

	public bool readyToLoad = false;

	public bool loading = false;

	public bool saving = false;

	public float timeShow = 0f;

	private bool showSaved = false;

	private bool showLoading = false;

	public SaveRemover()
	{
		Instance = this;
	}

	private void Update()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Invalid comparison between Unknown and I4
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		Scene activeScene;
		if ((Object)(object)Core.Instance != (Object)null && (Object)(object)Core.Instance.BaseModule != (Object)null)
		{
			if ((int)Core.Instance.BaseModule.CurrentStage != -1 && (Object)(object)ea.player != (Object)null)
			{
				if (Input.GetKeyDown((KeyCode)122))
				{
					loading = true;
					Core.Instance.BaseModule.GoBackToIntro();
				}
				if (Input.GetKeyDown((KeyCode)48))
				{
					saving = true;
					Core.Instance.SaveManager.SaveCurrentSaveSlotImmediate();
				}
			}
			if (!loading)
			{
				goto IL_0108;
			}
			activeScene = SceneManager.GetActiveScene();
			if (!(((Scene)(ref activeScene)).name == "Bootstrap"))
			{
				activeScene = SceneManager.GetActiveScene();
				if (!(((Scene)(ref activeScene)).name == "core"))
				{
					activeScene = SceneManager.GetActiveScene();
					if (!(((Scene)(ref activeScene)).name == "intro"))
					{
						goto IL_0108;
					}
				}
			}
			showLoading = true;
		}
		goto IL_0179;
		IL_0179:
		if (timeShow > 0f)
		{
			showSaved = true;
			timeShow -= Time.deltaTime;
		}
		else if (timeShow != -1f && timeShow <= 0f)
		{
			showSaved = false;
			timeShow = -1f;
		}
		return;
		IL_0108:
		if (showLoading)
		{
			activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "Bootstrap")
			{
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name != "core")
				{
					activeScene = SceneManager.GetActiveScene();
					if (((Scene)(ref activeScene)).name != "intro")
					{
						loading = false;
						showLoading = false;
					}
				}
			}
		}
		goto IL_0179;
	}

	private void OnGUI()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		if (showLoading)
		{
			CreateText(10, 5, 800, 300, 200, new Color(1f, 1f, 1f, 1f), "Loading...");
		}
		else if (showSaved)
		{
			CreateText(10, 5, 800, 300, 200, new Color(1f, 1f, 1f, 1f), "Saved");
		}
	}

	private void CreateText(int x, int y, int width, int height, int size, Color color, string text, bool backdrop = true)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		GUIStyle val = new GUIStyle(GUI.skin.label);
		val.fontSize = size;
		val.fontStyle = (FontStyle)1;
		val.alignment = (TextAnchor)0;
		if (backdrop)
		{
			string text2 = text;
			if (text2.Contains("<") && text2.Contains(">"))
			{
				text2 = Regex.Replace(text2, "<([^>]+)>", "").Replace("<", "").Replace(">", "");
			}
			GUI.color = new Color(0f, 0f, 0f, color.a);
			GUI.Label(new Rect((float)(x + 2), (float)(y + 2), (float)width, (float)height), text2, val);
		}
		GUI.color = color;
		GUI.Label(new Rect((float)x, (float)y, (float)width, (float)height), text, val);
	}
}