using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using QFSW.QC;
using TeamMonumental;
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("EnableQuantumConsoleSubterrorMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EnableQuantumConsoleSubterrorMod")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4397269e-8bdf-43ee-bdb1-24d9d6aff359")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EnableQuantumConsoleSubterrorMod;
[BepInPlugin("enablequantum", "Enable Quantum Console", "1.0.0")]
public class EnableQuantumConsole : BaseUnityPlugin
{
public const string pluginGuid = "enablequantum";
public const string pluginName = "Enable Quantum Console";
public const string pluginVersion = "1.0.0";
public float sprintSpeedSet;
public float walkSpeedSet;
public static EnableQuantumConsole instance { get; private set; }
public void Awake()
{
instance = this;
Harmony.CreateAndPatchAll(typeof(EnableQuantumConsole), (string)null);
}
[HarmonyPatch(typeof(GameNetworkManager), "Update")]
[HarmonyPostfix]
public static void Update()
{
if (Object.op_Implicit((Object)(object)Object.FindAnyObjectByType<QuantumConsole>((FindObjectsInactive)1)) && !((Component)Object.FindAnyObjectByType<QuantumConsole>((FindObjectsInactive)1)).gameObject.activeSelf)
{
((Component)Object.FindAnyObjectByType<QuantumConsole>((FindObjectsInactive)1)).gameObject.SetActive(true);
}
}
[HarmonyPatch(typeof(PlayerMovement), "Awake")]
[HarmonyPostfix]
public static void PlayerMovementAwakePatch(object __instance)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerMovement), "_runningMaxSpeed");
if (fieldInfo != null)
{
instance.sprintSpeedSet = (float)fieldInfo.GetValue(__instance);
}
FieldInfo fieldInfo2 = AccessTools.Field(typeof(PlayerMovement), "_walkingMaxSpeed");
if (fieldInfo2 != null)
{
instance.walkSpeedSet = (float)fieldInfo2.GetValue(__instance);
}
}
[HarmonyPatch(typeof(PlayerMovement), "Update")]
[HarmonyPostfix]
public static void PlayerMovementUpdatePatch(object __instance)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerMovement), "_runningMaxSpeed");
if (fieldInfo != null)
{
fieldInfo.SetValue(__instance, instance.sprintSpeedSet);
}
FieldInfo fieldInfo2 = AccessTools.Field(typeof(PlayerMovement), "_walkingMaxSpeed");
if (fieldInfo2 != null)
{
fieldInfo2.SetValue(__instance, instance.walkSpeedSet);
}
}
[HarmonyPatch(typeof(QuantumConsole), "Update")]
[HarmonyPostfix]
public static void QuantumConsoleUpdatePatch(object __instance)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(QuantumConsole), "_maxLogSize");
if (fieldInfo != null)
{
fieldInfo.SetValue(__instance, 100000000);
}
}
}
[CommandPrefix(".eqc.cheats.")]
public class CheatCommands
{
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Sets the player sprint speed")]
public static void SetSprintSpeed(float speed)
{
EnableQuantumConsole.instance.sprintSpeedSet = speed;
}
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Logs the player sprint speed")]
public static void SprintSpeed()
{
Debug.Log((object)EnableQuantumConsole.instance.sprintSpeedSet);
}
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Sets the player walk speed")]
public static void SetWalkSpeed(float speed)
{
EnableQuantumConsole.instance.walkSpeedSet = speed;
}
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Logs the player walk speed")]
public static void WalkSpeed()
{
Debug.Log((object)EnableQuantumConsole.instance.walkSpeedSet);
}
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Same as quick start except it doesnt automatically feed the monster on use")]
public static void QuickStart(int destination = 0, Weather weather = 0)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
LobbyStartButton val = Object.FindObjectOfType<LobbyStartButton>();
if ((Object)(object)val == (Object)null)
{
LogHelper.LogError("CourseCommands", "Command failed! Cannot find LobbyStartButton.");
return;
}
val.TryStartGame();
DestinationCommands.SetWeather(destination, weather);
DestinationCommands.Select(destination);
((MonoBehaviour)val).StartCoroutine(Delay());
LogHelper.LogInfo("CourseCommands", "Command Success! Quickly starting game.");
static IEnumerator Delay()
{
yield return (object)new WaitForSeconds(1f);
CourseCommands.ToggleDock();
}
}
}
[CommandPrefix(".eqc.achievements.")]
public class AddedAchievementCommands
{
[Command(/*Could not decode attribute arguments.*/)]
[CommandDescription("Grants the user all achievements.")]
public static void GrantAll()
{
foreach (Achievement registeredAchievement in Achievements.RegisteredAchievements)
{
registeredAchievement.GrantAchievement();
}
}
}