Decompiled source of Mind Control v1.0.2

BepInEx/plugins/mindcontrol.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("mindcontrol")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("mindcontrol")]
[assembly: AssemblyTitle("mindcontrol")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace mindcontrol;

[BepInPlugin("mindcontrol", "mindcontrol", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private ConfigEntry<string> enemytocontrol;

	public int ind = 0;

	private void Awake()
	{
		enemytocontrol = ((BaseUnityPlugin)this).Config.Bind<string>("ULTRAKILL Mindcontrol Mod", "enemytocontrol", "", "the enemy to control, resets on game start and when n is pressed");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin mindcontrol is loaded!");
		enemytocontrol.Value = "";
	}

	private void Update()
	{
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		int num = GameObject.Find("Debug Gore Zone").transform.childCount - 1;
		if (Input.GetKeyDown("m"))
		{
			if (ind <= num)
			{
				Object.Destroy((Object)(object)GameObject.Find("Debug Gore Zone/Gore Zone"));
				Object.Destroy((Object)(object)GameObject.Find("Debug Gore Zone/Gib Zone"));
				enemytocontrol.Value = "Debug Gore Zone/" + ((Object)GameObject.Find("Debug Gore Zone").transform.GetChild(ind)).name;
				ind++;
			}
			if (ind > num)
			{
				ind = 0;
				enemytocontrol.Value = "Debug Gore Zone/" + ((Object)GameObject.Find("Debug Gore Zone").transform.GetChild(ind)).name;
			}
		}
		if (Input.GetKeyDown("n"))
		{
			enemytocontrol.Value = "";
		}
		if (Object.op_Implicit((Object)(object)GameObject.Find(enemytocontrol.Value)))
		{
			if (Object.op_Implicit((Object)(object)GameObject.Find(enemytocontrol.Value + "/GroundCheck")))
			{
				Object.Destroy((Object)(object)GameObject.Find(enemytocontrol.Value + "/GroundCheck"));
			}
			if (Object.op_Implicit((Object)(object)GameObject.Find(enemytocontrol.Value).GetComponent<CapsuleCollider>()))
			{
				Object.Destroy((Object)(object)GameObject.Find(enemytocontrol.Value).GetComponent<CapsuleCollider>());
			}
			if (Object.op_Implicit((Object)(object)GameObject.Find(enemytocontrol.Value).GetComponent<EnemyIdentifier>()))
			{
				int hp = (int)GameObject.Find(enemytocontrol.Value).GetComponent<EnemyIdentifier>().health;
				GameObject.Find("Player").GetComponent<NewMovement>().hp = hp;
				GameObject.Find(enemytocontrol.Value).GetComponent<EnemyIdentifier>().ignorePlayer = true;
				GameObject.Find(enemytocontrol.Value).GetComponent<EnemyIdentifier>().attackEnemies = true;
			}
			GameObject.Find(enemytocontrol.Value).transform.position = GameObject.Find("Player").transform.position;
			Object.Destroy((Object)(object)GameObject.Find("Player/Main Camera/Guns"));
			Object.Destroy((Object)(object)GameObject.Find("Player/Main Camera/Punch"));
			((Component)Camera.main).transform.position = GameObject.Find("Player").transform.position + new Vector3(0f, 7f, -7f);
		}
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "mindcontrol";

	public const string PLUGIN_NAME = "mindcontrol";

	public const string PLUGIN_VERSION = "1.0.0";
}