using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib;
using BoneLib.BoneMenu;
using CodeModTestByProd;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow.AI;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Core), "Chain Killing NPCs", "1.0.0", "Prodiacy", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonAdditionalDependencies(new string[] { "BoneLib" })]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CKNPCS")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CKNPCS")]
[assembly: AssemblyTitle("CKNPCS")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 CodeModTestByProd
{
public class Core : MelonMod
{
private int ChainRadius = 5;
private bool EnableChainKilling;
public override void OnInitializeMelon()
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
Page obj = Page.Root.CreatePage("Chain Killing NPCs", Color.red, 0, true);
obj.CreateBool("Enable Chain Killing", Color.red, false, (Action<bool>)delegate(bool v)
{
EnableChainKilling = v;
});
obj.CreateInt("Chain Radius", Color.red, 5, 1, 1, 20, (Action<int>)delegate(int v)
{
ChainRadius = v;
});
Hooking.OnNPCBrainDie += delegate(AIBrain brain)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
if (EnableChainKilling)
{
if ((Object)(object)brain == (Object)null || (Object)(object)((Component)brain).transform == (Object)null)
{
MelonLogger.Msg("Unable To chain kill cause brain is null or its transform is.");
}
else if ((Object)(object)brain != (Object)null && (Object)(object)((Component)brain).transform != (Object)null)
{
Collider[] array = Il2CppArrayBase<Collider>.op_Implicit((Il2CppArrayBase<Collider>)(object)Physics.OverlapSphere(((Component)brain).transform.position, (float)ChainRadius));
for (int i = 0; i < array.Length; i++)
{
AIBrain componentInParent = ((Component)array[i]).GetComponentInParent<AIBrain>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent != (Object)(object)brain)
{
Extensions.DealDamage(componentInParent, 100000000f);
}
}
}
}
};
}
}
}