using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using LethalLib.Modules; using Microsoft.CodeAnalysis; 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.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("mujun")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("mujun")] [assembly: AssemblyTitle("mujun")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace mujun { public class mujunAI : EnemyAI { public float laughTimer; private const float MovementSpeed = 2f; private const float RotationSpeed = 2f; public override void OnCollideWithPlayer(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).OnCollideWithPlayer(other); if (!base.isEnemyDead) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val == (Object)null)) { val.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 1); } } } public override void Update() { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); laughTimer -= Time.deltaTime; if ((double)laughTimer <= 0.0) { laughTimer = Random.Range(6f, 7f); if (base.enemyType.audioClips.Length != 0) { base.creatureVoice.PlayOneShot(base.enemyType.audioClips[Random.Range(0, base.enemyType.audioClips.Length)]); } } if (!HasValidTarget()) { base.targetPlayer = ((EnemyAI)this).GetClosestPlayer(false, false, false); if (base.debugEnemyAI && (Object)(object)base.targetPlayer != (Object)null) { Debug.Log((object)("Found new target: " + base.targetPlayer.playerUsername)); } } if (!HasValidTarget()) { if (base.debugEnemyAI) { Debug.Log((object)"Failed to find new target"); } } else { Vector3 val = base.targetPlayer.playerGlobalHead.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Transform transform = ((Component)this).transform; transform.position += normalized * (Time.deltaTime * 2f); } } private bool HasValidTarget() { return (Object)(object)base.targetPlayer != (Object)null && base.targetPlayer.isInsideFactory && !base.targetPlayer.isPlayerDead; } } [BepInPlugin("mujun", "mujun", "1.0.0")] public class mujunPlugin : BaseUnityPlugin { private void Awake() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (Utility.IsNullOrWhiteSpace(directoryName)) { return; } AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "mujunmob")); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load custom assets"); return; } EnemyType val2 = val.LoadAsset("mujunenemy"); TerminalNode val3 = val.LoadAsset("mujun TN"); TerminalKeyword val4 = val.LoadAsset("mujunl TK"); NetworkPrefabs.RegisterNetworkPrefab(val2.enemyPrefab); Enemies.RegisterEnemy(val2, 0, (LevelTypes)(-1), (SpawnType)0, val3, val4); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin mujun is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "mujun"; public const string PLUGIN_NAME = "mujun"; public const string PLUGIN_VERSION = "1.0.0"; } }