Decompiled source of DeadBotMode v1.0.4

plugins/DeadBotMode.dll

Decompiled 10 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DeadBotMode")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("13.0.0.0")]
[assembly: AssemblyInformationalVersion("13.0.0")]
[assembly: AssemblyProduct("DeadBotMode Mod")]
[assembly: AssemblyTitle("DeadBotMode")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("13.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 DeadBotMode
{
	[BepInPlugin("com.deadbot.mode", "DeadBot Mode GOD", "13.0.0")]
	public class DeadBotMode : BaseUnityPlugin
	{
		private GameObject robotPlayer;

		private Camera cam;

		private float mouseX;

		private float mouseY;

		private float sensitivity = 3f;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"DeadBot Mode GOD erfolgreich geladen!");
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)107))
			{
				SpawnRobot();
			}
			if ((Object)(object)robotPlayer != (Object)null)
			{
				HandleMovement();
				HandleMouseLook();
			}
		}

		private void SpawnRobot()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)robotPlayer != (Object)null))
			{
				robotPlayer = new GameObject("DeadBot");
				robotPlayer.transform.position = Vector3.zero;
				Rigidbody obj = robotPlayer.AddComponent<Rigidbody>();
				obj.mass = 1f;
				obj.freezeRotation = true;
				cam = Camera.main;
				if ((Object)(object)cam != (Object)null)
				{
					((Component)cam).transform.parent = robotPlayer.transform;
					((Component)cam).transform.localPosition = new Vector3(0f, 0.5f, -1.5f);
				}
			}
		}

		private void HandleMovement()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody component = robotPlayer.GetComponent<Rigidbody>();
			if (!((Object)(object)component == (Object)null))
			{
				float axis = Input.GetAxis("Vertical");
				float axis2 = Input.GetAxis("Horizontal");
				component.AddForce(robotPlayer.transform.forward * axis * 10f);
				robotPlayer.transform.Rotate(0f, axis2 * 120f * Time.deltaTime, 0f);
				if (Input.GetKeyDown((KeyCode)32))
				{
					component.AddForce(Vector3.up * 5f, (ForceMode)1);
				}
			}
		}

		private void HandleMouseLook()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			float num = Input.GetAxis("Mouse X") * sensitivity;
			float num2 = Input.GetAxis("Mouse Y") * sensitivity;
			mouseX += num;
			mouseY -= num2;
			mouseY = Mathf.Clamp(mouseY, -60f, 60f);
			robotPlayer.transform.rotation = Quaternion.Euler(0f, mouseX, 0f);
			if ((Object)(object)cam != (Object)null)
			{
				((Component)cam).transform.localRotation = Quaternion.Euler(mouseY, 0f, 0f);
			}
		}
	}
}