Decompiled source of OneHitKO v1.0.1

OneHitKO.dll

Decompiled 37 minutes 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("crazystupidshit")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("crazystupidshit")]
[assembly: AssemblyTitle("crazystupidshit")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.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 OneHitKO
{
	[HarmonyPatch]
	public static class Patches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(NewMovement), "Awake")]
		public static void LogOnPlayerCreation(NewMovement __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Instance.log.LogInfo((object)$"Player created at {((Component)__instance).transform.position}");
		}
	}
	[BepInPlugin("Lotus.ultrakill.OneHitKO", "OneHitKO", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin Instance;

		private PluginConfigurator config;

		private BoolField enabler;

		private IntField hp;

		public ManualLogSource log => ((BaseUnityPlugin)this).Logger;

		public void Awake()
		{
			Instance = this;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"You only have one shot.");
			SceneManager.sceneLoaded += delegate
			{
			};
			createConfig();
		}

		public void createConfig()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			config = PluginConfigurator.Create("OneHitKO", "OneHitKO_GUID");
			enabler = new BoolField(config.rootPanel, "Enabled", "enabler", true);
			hp = new IntField(config.rootPanel, "Hp", "hp", 1, 1, 50);
		}

		public void Update()
		{
			if (enabler.value && MonoSingleton<NewMovement>.Instance?.hp > hp.value)
			{
				MonoSingleton<NewMovement>.Instance.hp = hp.value;
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}