Decompiled source of UkCheats v1.0.0

UKCheats.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using PluginConfig.API;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
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("UKCheats")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UKCheats")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7f198f5e-62ec-42f4-85db-83f3276ea11f")]
[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 UKCheats;

[BepInPlugin("swish.ultrakill.cheats", "UK Cheats", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Main : BaseUnityPlugin
{
	public const string pluginGuid = "swish.ultrakill.cheats";

	public const string pluginName = "UK Cheats";

	public const string pluginVersion = "1.0.0";

	private NewMovement movementController;

	private WeaponCharges weaponCharges;

	private StatsManager statsManager;

	private bool isThisScene = false;

	private bool isInfHealth;

	private bool isInfDash;

	private bool isInstantRecharge;

	private PluginConfigurator config;

	public void Awake()
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Expected O, but got Unknown
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Expected O, but got Unknown
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Expected O, but got Unknown
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Expected O, but got Unknown
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.LogInfo((object)"UkCheats is started!");
		config = PluginConfigurator.Create("Uk Cheats", "swish_ultrakill_cheats");
		ButtonField val = new ButtonField(config.rootPanel, "Auto P-Rank level", "swish_ultrakill_cheats_ezprank");
		BoolField val2 = new BoolField(config.rootPanel, "Infinite Health", "swish_ultrakill_cheats_infhealth", false);
		BoolField val3 = new BoolField(config.rootPanel, "Infinite Dash", "swish_ultrakill_cheats_infDash", false);
		BoolField val4 = new BoolField(config.rootPanel, "Instant Recharge", "swish_ultrakill_cheats_instantRecharge", false);
		val.onClick += new OnClick(EzPRankCheat);
		val2.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
		{
			isInfHealth = e.value;
		};
		val3.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
		{
			isInfDash = e.value;
		};
		val4.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
		{
			isInstantRecharge = e.value;
		};
	}

	public void Start()
	{
		SceneManager.sceneLoaded += OnSceneLoaded;
	}

	public void OnDisable()
	{
		SceneManager.sceneLoaded -= OnSceneLoaded;
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)("[UkCheats] Scene loaded: " + ((Scene)(ref scene)).name + " | Load Mode: " + ((object)(LoadSceneMode)(ref mode)).ToString()));
		isThisScene = false;
	}

	public void Update()
	{
		if ((Object)(object)movementController != (Object)null || (Object)(object)weaponCharges != (Object)null || (Object)(object)statsManager != (Object)null)
		{
			if ((float)movementController.hp < 100f && isInfHealth)
			{
				movementController.FullHeal(true);
				movementController.ForceAntiHP(0f, false, false, true, false);
			}
			else if (movementController.boostCharge < 300f && isInfDash)
			{
				movementController.FullStamina();
			}
			else if (isInstantRecharge)
			{
				weaponCharges.MaxCharges();
			}
		}
		else
		{
			FindMovementController();
			FindWeaponCharges();
			FindStatsManager();
		}
	}

	private void EzPRankCheat()
	{
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		FinalRoom val = FindFinalRoom();
		if ((Object)(object)val == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)"[UkCheats] FinalRoom not found!");
			return;
		}
		statsManager.StopTimer();
		statsManager.seconds = Random.Range((float)statsManager.timeRanks[3] - 5f, (float)statsManager.timeRanks[3]);
		statsManager.kills = statsManager.killRanks[3];
		statsManager.stylePoints = Random.Range(statsManager.styleRanks[3], statsManager.styleRanks[3] + 10000);
		((Component)val).transform.parent = null;
		((Component)val).gameObject.SetActive(true);
		((Component)val).GetComponentInChildren<FinalDoor>().OpenDoors();
		if ((Object)(object)movementController != (Object)null)
		{
			((Component)movementController).transform.position = val.dropPoint.position;
		}
		((BaseUnityPlugin)this).Logger.LogInfo((object)"[UkCheats] OMG U SO SKILLED, GO TOUCH GRASS BROO!!! Nah, im joking XD");
	}

	private void FindMovementController()
	{
		movementController = Object.FindFirstObjectByType<NewMovement>();
		if (!isThisScene)
		{
			if ((Object)(object)movementController != (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"[UkCheats] NewMovement founded");
				isThisScene = true;
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"[UkCheats] NewMovement not found");
				isThisScene = true;
			}
		}
	}

	private void FindWeaponCharges()
	{
		weaponCharges = Object.FindFirstObjectByType<WeaponCharges>();
		if (!isThisScene)
		{
			if ((Object)(object)weaponCharges != (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"[UkCheats] WeaponCharges founded");
				isThisScene = true;
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"[UkCheats] WeaponCharges not found!");
				isThisScene = true;
			}
		}
	}

	private void FindStatsManager()
	{
		statsManager = Object.FindFirstObjectByType<StatsManager>();
		if (!isThisScene)
		{
			if ((Object)(object)statsManager != (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"[UkCheats] StatsManager founded");
				isThisScene = true;
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"[UkCheats] StatsManager not found!");
				isThisScene = true;
			}
		}
	}

	private FinalRoom FindFinalRoom()
	{
		FinalRoom[] array = Resources.FindObjectsOfTypeAll<FinalRoom>();
		return (array.Length != 0) ? array[0] : null;
	}
}