Decompiled source of NPC Health Controller v1.0.0

NPC_Health_Controller.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib.BoneMenu;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow.AI;
using MelonLoader;
using Microsoft.CodeAnalysis;
using NPC_Health_Controller;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(ModMain), "NPC Health Controller", "1.0.0", "Prodiacy", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("NPC_Health_Controller")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NPC_Health_Controller")]
[assembly: AssemblyTitle("NPC_Health_Controller")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 NPC_Health_Controller
{
	public class ModMain : MelonMod
	{
		private bool sethealth = false;

		private int Health = 100;

		public override void OnInitializeMelon()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			((MelonBase)this).LoggerInstance.Msg("Initialized.");
			Page val = Page.Root.CreatePage("NPC Health Controller", Color.red, 0, true);
			val.CreateBool("Enable Custom Health", Color.red, false, (Action<bool>)delegate(bool value)
			{
				sethealth = value;
			});
			val.CreateInt("Health", Color.red, Health, 5, 0, int.MaxValue, (Action<int>)delegate(int value)
			{
				Health = value;
			});
			val.CreateFunction("Set Health", Color.red, (Action)delegate
			{
				SetHealth();
			});
		}

		private void SetHealth()
		{
			AIBrain[] array = Il2CppArrayBase<AIBrain>.op_Implicit(Object.FindObjectsOfType<AIBrain>());
			if (array.Length != 0)
			{
				AIBrain[] array2 = array;
				foreach (AIBrain val in array2)
				{
					val.behaviour.health.cur_hp = Health;
				}
			}
		}
	}
}