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 Unity.Netcode; 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("outboom")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("outboom")] [assembly: AssemblyTitle("outboom")] [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 outboom { public class outboomAI : EnemyAI { public float laughTimer; public Transform turnCompass; public Transform attackArea; private const float MovementSpeed = 2f; private const float RotationSpeed = 2f; private float timeSinceHittingLocalPlayer; private float timeSinceHittingLocalPlayer2; private float timeSinceHittingLocalPlayer3; private float timeSinceNewRandPos; public override void Start() { ((EnemyAI)this).Start(); Debug.Log((object)"Toilet Leech Spawned"); base.currentBehaviourStateIndex = 0; } public virtual void EvtFlush() { Debug.Log((object)"정상작동"); ((EnemyAI)this).SwitchToBehaviourState(0); } public override void Update() { //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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 (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; timeSinceHittingLocalPlayer2 += Time.deltaTime; timeSinceHittingLocalPlayer3 += Time.deltaTime; 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); if (base.currentBehaviourStateIndex == 1 && !(timeSinceHittingLocalPlayer2 < 0.3f)) { base.creatureSFX.PlayOneShot(base.enemyType.stunSFX); timeSinceHittingLocalPlayer2 = 0f; Debug.Log((object)"소리 정상작동중!"); } } } [ClientRpc] public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); switch (base.currentBehaviourStateIndex) { case 0: Debug.Log((object)"소리남"); ((EnemyAI)this).SwitchToBehaviourState(0); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); ((EnemyAI)this).SwitchToBehaviourServerRpc(0); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); timeSinceHittingLocalPlayer = 0f; break; case 1: if (base.currentBehaviourStateIndex == 1 && !(timeSinceHittingLocalPlayer < 0.1f)) { Debug.Log((object)"소리남2"); ((EnemyAI)this).SwitchToBehaviourState(1); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).SwitchToBehaviourServerRpc(1); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); base.currentBehaviourStateIndex = 0; } break; case 2: break; } } private bool HasValidTarget() { return (Object)(object)base.targetPlayer != (Object)null && base.targetPlayer.isInsideFactory && !base.targetPlayer.isPlayerDead; } public override void OnCollideWithPlayer(Collider other) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!(timeSinceHittingLocalPlayer3 < 1f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); timeSinceHittingLocalPlayer3 = 0f; val.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } [BepInPlugin("outboom", "outboom", "1.0.5")] public class outboomPlugin : BaseUnityPlugin { private void Awake() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (Utility.IsNullOrWhiteSpace(directoryName)) { return; } AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "outboommob")); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load custom assets"); return; } EnemyType val2 = val.LoadAsset("outboomenemy"); TerminalNode val3 = val.LoadAsset("outboom TN"); TerminalKeyword val4 = val.LoadAsset("outboom TK"); NetworkPrefabs.RegisterNetworkPrefab(val2.enemyPrefab); Enemies.RegisterEnemy(val2, 0, (LevelTypes)(-1), (SpawnType)2, 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 outboom is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "outboom"; public const string PLUGIN_NAME = "outboom"; public const string PLUGIN_VERSION = "1.0.5"; } }