using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using On; using On.GameNetcodeStuff; using SolidLib.Components; using SolidLib.Components.Sound; using Surfaced; using Surfaced.Configuration; using Surfaced.NetcodePatcher; using Surfaced.Patches; using Unity.Mathematics; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Surfaced")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Adds Aquatic themed content.")] [assembly: AssemblyFileVersion("1.7.1.0")] [assembly: AssemblyInformationalVersion("1.7.1+50a72f1a3430711130f27dcf822263002913d773")] [assembly: AssemblyProduct("Surfaced")] [assembly: AssemblyTitle("Surfaced")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.7.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] 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; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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; } } } public class Bertha : NetworkBehaviour, IHittable { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Bertha <>4__this; public PlayerControllerB playerWhoCollided; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown int num = <>1__state; Bertha bertha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(Plugin.BoundConfig.BerthaTimer.Value); <>1__state = 1; return true; case 1: <>1__state = -1; bertha.Detonate(playerWhoCollided); bertha.BoomLight.SetActive(true); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; ((Component)((Component)((Component)bertha).transform.parent).transform.Find("BigBertha")).gameObject.SetActive(false); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: { <>1__state = -1; bertha.BoomLight.SetActive(false); Collider[] componentsInChildren = ((Component)bertha).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { val.enabled = false; } <>2__current = (object)new WaitForSeconds(10f); <>1__state = 4; return true; } case 4: <>1__state = -1; if (((NetworkBehaviour)bertha).IsServer) { ((NetworkBehaviour)bertha).NetworkObject.Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Bertha <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown int num = <>1__state; Bertha bertha = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; bertha.PingAudio.PlayOneShot(bertha.mineBeep, 0.1f); bertha.mineAudio.pitch = (float)bertha.random.NextDouble() * 0.2f + 0.9f; } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds((float)bertha.random.Next(20, 40)); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public bool hasExploded; public GameObject BoomLight; public ParticleSystem explosionParticle; public AudioSource mineAudio; public AudioSource FarAudio; public AudioSource PingAudio; public AudioClip mineDetonate; public AudioClip mineTrigger; public AudioClip mineBeep; public AudioClip BerthaBoom; private Random random; private void Start() { random = new Random(StartOfRound.Instance.randomMapSeed + 23); ((MonoBehaviour)this).StartCoroutine(StartIdleAnimation()); } [IteratorStateMachine(typeof(d__12))] private IEnumerator StartIdleAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } private void OnTriggerEnter(Collider other) { if (hasExploded) { return; } if (((Component)other).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && !component.isPlayerDead && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController) { TriggerMineOnLocalClientByExiting(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, component)); } } else if ((((Component)other).tag.StartsWith("PlayerRagdoll") || ((Component)other).CompareTag("PhysicsProp")) && !((Object)(object)((Component)other).GetComponent() == (Object)null) && !((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !((Object)(object)((Component)other).GetComponent() == (Object)null) && ((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { TriggerMineOnLocalClientByExiting(-1); } } private void TriggerMineOnLocalClientByExiting(int playerIndex) { if (!hasExploded) { hasExploded = true; ExplodeMineServerRpc(playerIndex); } } [ServerRpc(RequireOwnership = false)] public void ExplodeMineServerRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1478796614u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1478796614u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ExplodeMineClientRpc(playerIndex); } } } [ClientRpc] public void ExplodeMineClientRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(355455692u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 355455692u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hasExploded = true; SetOffMineAnimation((playerIndex <= -1) ? null : StartOfRound.Instance.allPlayerScripts[playerIndex]); } } } public void SetOffMineAnimation(PlayerControllerB playerWhoCollided = null) { mineAudio.PlayOneShot(mineTrigger, 1f); HUDManager.Instance.ShakeCamera((ScreenShakeType)2); ((MonoBehaviour)this).StartCoroutine(DetonateDelay(playerWhoCollided)); } [IteratorStateMachine(typeof(d__18))] private IEnumerator DetonateDelay(PlayerControllerB playerWhoCollided) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, playerWhoCollided = playerWhoCollided }; } public void Detonate(PlayerControllerB playerWhoCollided = null) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) mineAudio.pitch = (float)random.NextDouble() * 0.14f + 0.93f; mineAudio.PlayOneShot(mineDetonate, 2f); FarAudio.PlayOneShot(BerthaBoom, 1f); HUDManager.Instance.ShakeCamera((ScreenShakeType)3); CreateExplosion(((Component)this).transform.position + Vector3.up, 33, 6, (CauseOfDeath)3, playerWhoCollided); } public void CreateExplosion(Vector3 explosionPosition, int damage = 20, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) float value = Plugin.BoundConfig.Range1.Value; float value2 = Plugin.BoundConfig.Range2.Value; float value3 = Plugin.BoundConfig.Range3.Value; int num = 0; explosionParticle.Play(); num = ((!Plugin.BoundConfig.KillEnemies.Value) ? StartOfRound.Instance.collidersRoomMaskDefaultAndPlayers : (StartOfRound.Instance.collidersRoomMaskDefaultAndPlayers | LayerMask.GetMask(new string[1] { "Enemies" }))); Collider[] array = Physics.OverlapSphere(explosionPosition, value3, num, (QueryTriggerInteraction)2); List list = new List(); Collider[] array2 = array; foreach (Collider val in array2) { float num2 = Vector3.Distance(explosionPosition, ((Component)val).transform.position); Vector3 val2; if (((Component)val).gameObject.layer == 3) { PlayerControllerB component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController) { list.Add(component); val2 = ((Component)component).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (num2 <= value) { normalized *= 500f; component.DamagePlayer(999, true, true, causeOfDeath, 6, false, normalized); HUDManager.Instance.ShakeCamera((ScreenShakeType)3); continue; } if (num2 <= value2 && MineHasLineOfSight(((Component)component.gameplayCamera).transform.position)) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); normalized *= 400f; component.DamagePlayer(999, true, true, causeOfDeath, 6, false, normalized); continue; } if (num2 <= value3 && MineHasLineOfSight(((Component)component.gameplayCamera).transform.position)) { normalized *= (float)Plugin.BoundConfig.Knockbackmultiplier.Value; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); float num3 = 1f - Mathf.Clamp01(num2 / value3); component.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 6, false, normalized); if (!component.isPlayerDead) { component.externalForces += normalized; } continue; } } } if (((Component)val).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner && num2 <= value2 && MineHasLineOfSight(((Component)val).transform.position)) { EnemyAI mainScript = componentInChildren.mainScript; val2 = default(Vector3); mainScript.HitEnemyOnLocalClient(enemyHitForce, val2, attacker, false, -1); } } else if (((Component)val).gameObject.layer == 21) { Landmine componentInChildren2 = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && !componentInChildren2.hasExploded && num2 <= value3 && MineHasLineOfSight(((Component)val).transform.position)) { ((MonoBehaviour)componentInChildren2).StartCoroutine(componentInChildren2.TriggerOtherMineDelayed(componentInChildren2)); } } } Seamine[] array3 = Object.FindObjectsByType((FindObjectsSortMode)1); Seamine[] array4 = array3; foreach (Seamine seamine in array4) { float num4 = Vector3.Distance(explosionPosition, ((Component)seamine).transform.position); if (!seamine.hasExploded && num4 <= value2) { seamine.SetOffMineAnimation(); } } Collider[] array5 = Physics.OverlapSphere(explosionPosition, value3, StartOfRound.Instance.collidersAndRoomMaskAndDefault); Collider[] array6 = array5; foreach (Collider val3 in array6) { Rigidbody component2 = ((Component)val3).GetComponent(); if (component2 != null) { component2.AddExplosionForce(1000f, explosionPosition, value3); } } } public bool MineHasLineOfSight(Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); return !Physics.Linecast(((Component)this).transform.position, pos, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1); } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if ((Object)(object)playerWhoHit != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return false; } ExplodeMineServerRpc(((Object)(object)playerWhoHit != (Object)null) ? Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerWhoHit) : (-1)); return true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1478796614u, new RpcReceiveHandler(__rpc_handler_1478796614), "ExplodeMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(355455692u, new RpcReceiveHandler(__rpc_handler_355455692), "ExplodeMineClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1478796614(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((Bertha)(object)target).ExplodeMineServerRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_355455692(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((Bertha)(object)target).ExplodeMineClientRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Bertha"; } } public class Seamine : NetworkBehaviour, IHittable { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Seamine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown int num = <>1__state; Seamine seamine = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; seamine.Detonate(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; if (((NetworkBehaviour)seamine).IsServer) { Object.Destroy((Object)(object)((Component)((Component)seamine).transform.parent).gameObject); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Seamine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown int num = <>1__state; Seamine seamine = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; seamine.mineAudio.PlayOneShot(seamine.mineBeep, 0.1f); seamine.mineAudio.pitch = Random.Range(0.9f, 1.1f); } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds((float)Random.Range(Plugin.BoundConfig.SeamineSoundMin.Value, Plugin.BoundConfig.SeamineSoundMax.Value)); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Landmine mine; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!mine.hasExploded) { mine.mineAudio.pitch = Random.Range(0.75f, 1.07f); mine.hasExploded = true; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; mine.SetOffMineAnimation(); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private bool mineActivated = true; public bool hasExploded; public ParticleSystem explosionParticle; public AudioSource mineAudio; public AudioSource mineFarAudio; public AudioClip mineDetonate; public AudioClip mineTrigger; public AudioClip mineBeep; public AudioClip mineDetonateFar; private bool sendingExplosionRPC; private RaycastHit hit; private void Start() { ((MonoBehaviour)this).StartCoroutine(StartIdleAnimation()); } [IteratorStateMachine(typeof(d__12))] private IEnumerator StartIdleAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } private void OnTriggerEnter(Collider other) { if (hasExploded || !mineActivated) { return; } if (((Component)other).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && !component.isPlayerDead && !((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { TriggerMineOnLocalClientByExiting(); } } else { if (!((Component)other).tag.StartsWith("PlayerRagdoll") && !((Component)other).CompareTag("PhysicsProp")) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return; } TriggerMineOnLocalClientByExiting(); } } private void TriggerMineOnLocalClientByExiting() { if (!hasExploded) { SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void ExplodeMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(711067059u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 711067059u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ExplodeMineClientRpc(); } } } [ClientRpc] public void ExplodeMineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3889305919u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3889305919u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingExplosionRPC) { sendingExplosionRPC = false; } else { SetOffMineAnimation(); } } } public void SetOffMineAnimation() { hasExploded = true; mineAudio.PlayOneShot(mineTrigger, 1f); ((MonoBehaviour)this).StartCoroutine(DetonateDelay()); } [IteratorStateMachine(typeof(d__18))] private IEnumerator DetonateDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__19))] private IEnumerator TriggerOtherMineDelayed(Landmine mine) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { mine = mine }; } public void Detonate() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate, 1f); CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, 100, 5.7f, 6f, 6, (CauseOfDeath)3); } public void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val2 = null; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } Vector3 val3; if (((Component)array[i]).gameObject.layer == 3) { val2 = ((Component)array[i]).gameObject.GetComponent(); if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner) { float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)); val3 = ((Component)val2).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; ((Component)val2).GetComponent().AddForce(normalized * 500f); Vector3 val4 = Vector3.Normalize((((Component)val2).transform.position + Vector3.up * 0.75f - ((Component)this).transform.position) * 100f) * 30f; val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, val4); } } else if (((Component)array[i]).gameObject.layer == 21) { Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f) { ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { EnemyAI mainScript = componentInChildren2.mainScript; val3 = default(Vector3); mainScript.HitEnemyOnLocalClient(enemyHitForce, val3, attacker, false, -1); } } } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); for (int j = 0; j < array.Length; j++) { Rigidbody component = ((Component)array[j]).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(70f, explosionPosition, 10f); } } } public bool MineHasLineOfSight(Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return !Physics.Linecast(((Component)this).transform.position, pos, ref hit, 256); } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); return true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(711067059u, new RpcReceiveHandler(__rpc_handler_711067059), "ExplodeMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3889305919u, new RpcReceiveHandler(__rpc_handler_3889305919), "ExplodeMineClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_711067059(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Seamine)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3889305919(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Seamine)(object)target).ExplodeMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Seamine"; } } namespace Scary { internal class ScaryAI : EnemyAI { private enum State { MovingToPlayer, Teleporting } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ScaryAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown int num = <>1__state; ScaryAI scaryAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if ((Object)(object)((EnemyAI)scaryAI).targetPlayer != (Object)null) { Vector3 val = Vector3.Normalize(((Component)((EnemyAI)scaryAI).targetPlayer.gameplayCamera).transform.position - ((Component)scaryAI).transform.position); float num2 = Vector3.Distance(((Component)((EnemyAI)scaryAI).targetPlayer).transform.position, ((Component)scaryAI).transform.position); if (num2 < 5f && Vector3.Dot(val, ((Component)((EnemyAI)scaryAI).targetPlayer.gameplayCamera).transform.forward) < -0.9f) { scaryAI.inactivityTimer = 0f; Plugin.Logger.LogInfo((object)"JUMPSCARE"); scaryAI.jumpscaring = true; ((EnemyAI)scaryAI).creatureSFX.volume = 0.4f; ((EnemyAI)scaryAI).creatureSFX.pitch = 1f; ((EnemyAI)scaryAI).creatureSFX.maxDistance = 25f; scaryAI.NetworkAudioSource.PlayOneShot(scaryAI.ScareSoundClip); <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; } } break; case 1: <>1__state = -1; ((EnemyAI)scaryAI).creatureSFX.volume = 0.4f; ((EnemyAI)scaryAI).creatureSFX.pitch = 1f; ((EnemyAI)scaryAI).creatureSFX.maxDistance = 25f; scaryAI.NetworkAudioSource.PlayOneShot(scaryAI.PoofSoundClip); scaryAI.EmitPSClientRpc(); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 2; return true; case 2: <>1__state = -1; ((EnemyAI)scaryAI).SwitchToBehaviourClientRpc(1); scaryAI.jumpscaring = false; break; } scaryAI.PerformTeleportCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform turnCompass; private float timeSinceHittingLocalPlayer; private float timeSinceLastProximitySound; private Random enemyRandom; private Coroutine? PerformTeleportCoroutine; private NavMeshAgent agent; public AudioClip PoofSoundClip; public AudioClip ScareSoundClip; public NetworkAudioSource NetworkAudioSource; public ParticleSystem Poofps; private bool jumpscaring; private Vector3 lastPosition; private float inactivityTimer; [Header("SoundSets")] [SerializeField] private SoundSet LureSoundSet; private UniqueRandomizer LureRandomizer; [SerializeField] private Transform movementSource; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown ((EnemyAI)this).Start(); Plugin.Logger.LogInfo((object)"IMPENDING DOOM APPROACHES..."); LureRandomizer = new UniqueRandomizer(LureSoundSet); timeSinceHittingLocalPlayer = 0f; timeSinceLastProximitySound = 0f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); base.currentBehaviourStateIndex = 0; agent = ((Component)this).GetComponent(); } public void PlayLureSound() { int nextStableRandomIndex = LureRandomizer.GetNextStableRandomIndex(); base.creatureSFX.volume = 0.6f; base.creatureSFX.pitch = 1f; base.creatureSFX.maxDistance = 25f; NetworkAudioSource.PlayOneShot(LureSoundSet.GetAudioClip(nextStableRandomIndex)); } public override void Update() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); timeSinceHittingLocalPlayer += Time.deltaTime; if (!jumpscaring) { timeSinceLastProximitySound += Time.deltaTime; } int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if ((Object)(object)base.targetPlayer != (Object)null && currentBehaviourStateIndex == 0) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } if (((NetworkBehaviour)this).IsHost && (Object)(object)base.targetPlayer != (Object)null) { float num = Vector3.Distance(((Component)base.targetPlayer).transform.position, ((Component)this).transform.position); if (num > 5f && !jumpscaring) { CheckInactivity(); } } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { switch (base.currentBehaviourStateIndex) { case 0: agent.speed = (jumpscaring ? 0f : 9f); MoveToClosestPlayer(); break; case 1: agent.speed = 0f; TeleportToRandomNode(); break; } } } private void MoveToClosestPlayer() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (TargetClosestPlayerInAnyCase() && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 3f) { if (timeSinceLastProximitySound >= (float)enemyRandom.Next(Plugin.BoundConfig.ScarySoundMin.Value, Plugin.BoundConfig.ScarySoundMax.Value)) { PlayLureSound(); timeSinceLastProximitySound = 0f; } if (PerformTeleportCoroutine == null) { PerformTeleportCoroutine = ((MonoBehaviour)this).StartCoroutine(PerformTeleportIfFacingPlayer()); } } else { ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false); } } [IteratorStateMachine(typeof(d__23))] private IEnumerator PerformTeleportIfFacingPlayer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { <>4__this = this }; } private void TeleportToRandomNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Vector3 randomAINodePosition = GetRandomAINodePosition(); if (randomAINodePosition != Vector3.zero) { agent.Warp(randomAINodePosition); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } private Vector3 GetRandomAINodePosition() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) GameObject[] insideAINodes = RoundManager.Instance.insideAINodes; List list = new List(); GameObject[] array = insideAINodes; foreach (GameObject val in array) { list.Add(val.transform.position); } if (list.Count == 0) { return Vector3.zero; } Vector3 val2 = list[Random.Range(0, list.Count)]; return RoundManager.Instance.GetRandomNavMeshPositionInRadius(val2, 3f, default(NavMeshHit)); } private void CheckInactivity() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(((Component)this).transform.position, lastPosition) < 0.01f) { inactivityTimer += Time.deltaTime; if (inactivityTimer >= 3f) { TeleportToRandomNode(); inactivityTimer = 0f; } } else { inactivityTimer = 0f; lastPosition = ((Component)this).transform.position; } } private bool TargetClosestPlayerInAnyCase() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } return (Object)(object)base.targetPlayer != (Object)null; } [ClientRpc] public void EmitPSClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2066374292u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2066374292u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Poofps.Play(); } } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2066374292u, new RpcReceiveHandler(__rpc_handler_2066374292), "EmitPSClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2066374292(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((ScaryAI)(object)target).EmitPSClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ScaryAI"; } } } namespace Surfaced { public class SurfacedHandler : ContentHandler { public class BellCrabAssets : AssetBundleLoader { public BellCrabAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class BigBerthaAssets : AssetBundleLoader { public BigBerthaAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class BruceAssets : AssetBundleLoader { public BruceAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class HorseAssets : AssetBundleLoader { public HorseAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class NemoAssets : AssetBundleLoader { public NemoAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class RodrigoAssets : AssetBundleLoader { public RodrigoAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class ScaryAssets : AssetBundleLoader { public ScaryAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SeamineAssets : AssetBundleLoader { public SeamineAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class ShrimpAssets : AssetBundleLoader { public ShrimpAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class UrchinAssets : AssetBundleLoader { public UrchinAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public BigBerthaAssets? BigBertha; public BruceAssets? Bruce; public HorseAssets? Horse; public NemoAssets? Nemo; public RodrigoAssets? Rodrigo; public ScaryAssets? Scary; public SeamineAssets? Seamine; public ShrimpAssets? Shrimp; public UrchinAssets? Urchin; public BellCrabAssets? BellCrab; public SurfacedHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent("bellcrabassets", ref BellCrab, false); ((ContentHandler)this).RegisterContent("berthaassets", ref BigBertha, false); ((ContentHandler)this).RegisterContent("bruceassets", ref Bruce, false); ((ContentHandler)this).RegisterContent("horseassets", ref Horse, false); ((ContentHandler)this).RegisterContent("nemoassets", ref Nemo, false); ((ContentHandler)this).RegisterContent("rodrigoassets", ref Rodrigo, false); ((ContentHandler)this).RegisterContent("scaryassets", ref Scary, false); ((ContentHandler)this).RegisterContent("seamineassets", ref Seamine, false); ((ContentHandler)this).RegisterContent("shrimpassets", ref Shrimp, false); ((ContentHandler)this).RegisterContent("urchinassets", ref Urchin, false); } } internal class BellCrabAI : EnemyAI { private enum State { Idle, Running, Grabbed, Death } [CompilerGenerated] private sealed class <>c__DisplayClass48_0 { public NetworkObject netObj; internal bool b__0() { return netObj.IsSpawned; } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BellCrabAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; if (((EnemyAI)bellCrabAI).currentBehaviourStateIndex == 0) { ((EnemyAI)bellCrabAI).creatureAnimator.SetTrigger("Peak"); } break; } if (!((EnemyAI)bellCrabAI).isEnemyDead) { <>2__current = (object)new WaitForSeconds((float)bellCrabAI.BellCrabRandom.NextDouble() * 10f + 10f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__61 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NavMeshAgent agent; public LineRenderer line; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!((Behaviour)agent).enabled) { return false; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: { <>1__state = -1; line.SetPosition(0, ((Component)agent).transform.position); line.positionCount = agent.path.corners.Length; for (int i = 1; i < agent.path.corners.Length; i++) { line.SetPosition(i, agent.path.corners[i]); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int playerID; public BellCrabAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: { <>1__state = -1; PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[playerID]; bellCrabAI.DropCrabOnLocalClient(player); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__49 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject go; public Quaternion rotation; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = 0.25f; break; case 2: <>1__state = -1; break; } if (5__2 > 0f) { 5__2 -= Time.deltaTime; go.transform.rotation = rotation; <>2__current = null; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BellCrabAI <>4__this; public int playerID; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.12f); <>1__state = 1; return true; case 1: { <>1__state = -1; if (bellCrabAI.recentlyDamaged) { return false; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)bellCrabAI.playerHoldingCrab != (Object)null) { bellCrabAI.playerHoldingCrab.twoHanded = false; bellCrabAI.playerHoldingCrab = null; bellCrabAI.playerHoldingCrab.isHoldingObject = false; } if ((Object)(object)val != (Object)null) { val.inAnimationWithEnemy = (EnemyAI)(object)bellCrabAI; bellCrabAI.isAttached = true; ((Behaviour)((EnemyAI)bellCrabAI).agent).enabled = false; ((EnemyAI)bellCrabAI).agent.speed = 0f; bellCrabAI.Interact_Script.interactable = false; bellCrabAI.SetScanNodeType(EnemyNodeType); HUDManager.Instance.AttemptScanNewCreature(bellCrabAI.creatureID); bellCrabAI.playerHoldingCrab = val; bellCrabAI.playerHoldingCrab.twoHanded = true; bellCrabAI.playerHoldingCrab.isGrabbingObjectAnimation = true; bellCrabAI.playerHoldingCrab.isHoldingObject = true; bellCrabAI.playerHoldingCrab.hoveringOverTrigger = null; bellCrabAI.playerHoldingCrab.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); ((EnemyAI)bellCrabAI).SwitchToBehaviourStateOnLocalClient(2); ((EnemyAI)bellCrabAI).creatureAnimator.SetInteger("State", 2); bellCrabAI.PlayGrabbedSFX(); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__53 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BellCrabAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; bellCrabAI.recentlyDamaged = true; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; bellCrabAI.recentlyDamaged = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__42 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BellCrabAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__42(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown int num = <>1__state; BellCrabAI CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => ((EnemyAI)CS$<>8__locals0).currentBehaviourStateIndex == 0)); <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)CS$<>8__locals0).creatureSFX.Stop(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabbableObject grabbableObject; public int value; private <>c__DisplayClass48_0 <>8__1; public BellCrabAI <>4__this; public Quaternion rotation; public Vector3 spawnPosition; public Vector3 targetPosition; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass48_0(); <>8__1.netObj = ((NetworkBehaviour)grabbableObject).NetworkObject; <>2__current = (object)new WaitUntil((Func)(() => <>8__1.netObj.IsSpawned)); <>1__state = 1; return true; case 1: { <>1__state = -1; grabbableObject.SetScrapValue(value); if (<>8__1.netObj.AutoObjectParentSync && ((NetworkBehaviour)bellCrabAI).IsServer) { ((Component)<>8__1.netObj).transform.SetParent(StartOfRound.Instance.propsContainer, true); } else if (!<>8__1.netObj.AutoObjectParentSync) { ((Component)<>8__1.netObj).transform.SetParent(StartOfRound.Instance.propsContainer, true); } ((MonoBehaviour)bellCrabAI).StartCoroutine(bellCrabAI.ForceRotationForABit(((Component)<>8__1.netObj).gameObject, rotation)); ScanNodeProperties componentInChildren = ((Component)grabbableObject).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.scrapValue = value; componentInChildren.subText = $"Value: ${value}"; grabbableObject.scrapValue = value; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; } case 2: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 3; return true; case 3: { <>1__state = -1; RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)grabbableObject.scrapValue; grabbableObject.startFallingPosition = StartOfRound.Instance.propsContainer.InverseTransformPoint(spawnPosition); grabbableObject.targetFloorPosition = StartOfRound.Instance.propsContainer.InverseTransformPoint(targetPosition); grabbableObject.InitializeAfterPositioning(); grabbableObject.EnableItemMeshes(true); grabbableObject.EnablePhysics(true); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BellCrabAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; BellCrabAI bellCrabAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 1; return true; case 1: <>1__state = -1; ((NetworkBehaviour)bellCrabAI).NetworkObject.Despawn(true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public InteractTrigger Interact_Script; [NonSerialized] public bool isAttached; [NonSerialized] public PlayerControllerB? playerHoldingCrab; public float BellCrabRunSpeed = 18f; private Random BellCrabRandom; private Random ScanNodeRandom; public AudioClip DeathSoundClip; public AudioClip BellLandSoundClip; public AudioClip[] SnipSoundClips; public AudioClip ScuttleSoundClip; public AudioClip PopInSoundClip; public AudioClip PopOutSoundClip; public AudioClip GrabbedSoundClip; public AudioClip PickupSoundClip; public ScanNodeProperties ScanNode; public NetworkTransform NetTransform; private Coroutine? recentlyDamagedCoroutine; private bool recentlyDamaged; private bool testBuild; private LineRenderer line; private int creatureID; private static int EnemyNodeType = 1; private static int ScrapNodeType = 2; public override void Start() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); creatureID = ScanNode.creatureScanID; ScanNode.creatureScanID = -1; isAttached = false; ((Behaviour)base.agent).enabled = true; FindNextWanderPoint(); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); base.creatureAnimator.SetInteger("State", 1); ((Component)this).transform.localScale = new Vector3(1f, 1f, 1f); ((UnityEvent)(object)Interact_Script.onInteract).AddListener((UnityAction)TriggerInteract); base.agent.speed = BellCrabRunSpeed; base.agent.acceleration = 100f; BellCrabRandom = new Random(StartOfRound.Instance.randomMapSeed); ScanNodeRandom = new Random(StartOfRound.Instance.randomMapSeed); ((MonoBehaviour)this).StartCoroutine(DoPeakingCoroutine()); SetScanNodeType(ScrapNodeType); Interact_Script.hoverTip = "Grab : [E]"; if (testBuild) { line = ((Component)this).gameObject.AddComponent(); line.widthMultiplier = 0.2f; } } public void SetScanNodeType(int type) { ScanNode.nodeType = type; if (type == ScrapNodeType) { ScanNode.headerText = "Brass bell"; ScanNode.scrapValue = ScanNodeRandom.Next((int)(120f * RoundManager.Instance.scrapValueMultiplier), (int)(200f * RoundManager.Instance.scrapValueMultiplier)); ScanNode.subText = "Value: " + ScanNode.scrapValue; } else { ScanNode.headerText = "Bell Crab"; ScanNode.subText = ""; } } private void FindNextWanderPoint() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) bool flag = false; for (int i = 0; i < 4; i++) { flag = ((EnemyAI)this).SetDestinationToPosition(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, 30f, default(NavMeshHit)), true); if (flag) { break; } } if (!flag) { ((EnemyAI)this).SetDestinationToPosition(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, 30f, default(NavMeshHit)), false); } } public void TriggerInteract(PlayerControllerB player) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (base.currentBehaviourStateIndex == 0 && Physics.Raycast(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, player.grabDistance, player.interactableObjectsMask)) { player.SetHoverTipAndCurrentInteractTrigger(); Interact_Script.interactable = false; Interact_Script.hasTriggered = true; if (!isAttached && (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) { PickupCrabServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player)); } } } [ServerRpc(RequireOwnership = false)] public void PickupCrabServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(487414722u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 487414722u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PickupCrabClientRpc(playerID); } } } [ClientRpc] public void PickupCrabClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1614733662u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1614733662u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(PickupCrabDelay(playerID)); } } } [IteratorStateMachine(typeof(d__30))] public IEnumerator PickupCrabDelay(int playerID) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, playerID = playerID }; } [ServerRpc(RequireOwnership = false)] public void DropCrabServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(510543919u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 510543919u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropCrabClientRpc(playerID); FindNextWanderPoint(); } } } [ClientRpc] public void DropCrabClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(887584623u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 887584623u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartOfRound.Instance.allPlayerScripts[playerID].inAnimationWithEnemy = null; ((MonoBehaviour)this).StartCoroutine(DropCrabDelay(playerID)); } } } public void DropCrabOnLocalClient(PlayerControllerB? player = null) { if ((Object)(object)player == (Object)null) { player = playerHoldingCrab; } if (isAttached || (Object)(object)player != (Object)null) { PlayDropBellSFX(); } if ((Object)(object)player != (Object)null) { player.SetHoverTipAndCurrentInteractTrigger(); } isAttached = false; ((Behaviour)base.agent).enabled = true; base.agent.speed = BellCrabRunSpeed; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)player) { HUDManager.Instance.ClearControlTips(); } if ((Object)(object)player != (Object)null) { player.twoHanded = false; player.inAnimationWithEnemy = null; player.isHoldingObject = false; player.isGrabbingObjectAnimation = false; } Interact_Script.interactable = false; playerHoldingCrab = null; if (base.enemyHP > 0) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); base.creatureAnimator.SetInteger("State", 1); return; } ((Behaviour)base.agent).enabled = false; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(3); base.creatureAnimator.SetTrigger("Death"); base.creatureAnimator.SetInteger("State", 3); } [IteratorStateMachine(typeof(d__34))] public IEnumerator DropCrabDelay(int playerID) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { <>4__this = this, playerID = playerID }; } public void snipPlayer() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerHoldingCrab != (Object)null) { playerHoldingCrab.DamagePlayer(Plugin.BoundConfig.BellCrabDamageValue.Value, true, true, (CauseOfDeath)17, 0, false, default(Vector3)); playerHoldingCrab.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); PlayCreatureSound(SnipSoundClips[BellCrabRandom.Next(0, SnipSoundClips.Length)]); } } [IteratorStateMachine(typeof(d__36))] public IEnumerator DoPeakingCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } public void PlayPopInSFX() { PlayCreatureSound(PopInSoundClip); base.agent.speed = 0f; Interact_Script.hasTriggered = false; SetScanNodeType(ScrapNodeType); } public void PlayPopOutSFX() { PlayCreatureSound(PopOutSoundClip); SetScanNodeType(EnemyNodeType); } public void PlayDeathSFX() { base.creatureSFX.Stop(); base.creatureSFX.PlayOneShot(DeathSoundClip); } public void PlayDropBellSFX() { base.creatureSFX.PlayOneShot(BellLandSoundClip); } public void PlayFootstepSFX() { if ((Object)(object)base.creatureSFX.clip != (Object)(object)ScuttleSoundClip || !base.creatureSFX.isPlaying) { PlayCreatureSound(ScuttleSoundClip, loop: true); ((MonoBehaviour)this).StartCoroutine(StopScuttleSound()); } } [IteratorStateMachine(typeof(d__42))] public IEnumerator StopScuttleSound() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__42(0) { <>4__this = this }; } public void PlayGrabbedSFX() { base.creatureSFX.PlayOneShot(PickupSoundClip); base.creatureSFX.PlayOneShot(GrabbedSoundClip); } public void PlayCreatureSound(AudioClip clip, bool loop = false) { base.creatureSFX.loop = loop; base.creatureSFX.clip = clip; base.creatureSFX.Play(); } public void spawnCrabScrap() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (base.enemyHP <= 0) { HideEnemyGameObject(); } if (((NetworkBehaviour)this).IsServer && base.enemyHP <= 0) { SpawnScrap(((Registry)(object)LethalContent.Items)[SurfacedItemKeys.BellCrab].Item, ((Component)this).transform.position); ((MonoBehaviour)this).StartCoroutine(delayDestroy()); } } public NetworkObjectReference SpawnScrap(Item? item, Vector3 position, bool defaultRotation = true, int valueIncrease = 0, Quaternion rotation = default(Quaternion)) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)item == (Object)null) { return default(NetworkObjectReference); } Vector3 val = position; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(position + Vector3.up * 1f, Vector3.down, ref val2, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point + Vector3.up * item.verticalOffset; } GameObject val3 = Object.Instantiate(item.spawnPrefab, val, Quaternion.identity, (Transform)null); GrabbableObject component = val3.GetComponent(); NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; networkObject.Spawn(false); int value = (int)((float)Random.Range(item.minValue, item.maxValue) * RoundManager.Instance.scrapValueMultiplier) + valueIncrease; SyncScanNodeParentRotationsAndFallRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)component), position, val, defaultRotation ? Quaternion.Euler(item.restingRotation) : rotation, value); return new NetworkObjectReference(val3); } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncScanNodeParentRotationsAndFallRpc(NetworkBehaviourReference grabbableObjectReference, Vector3 spawnPosition, Vector3 targetPosition, Quaternion rotation, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { DeferLocal = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2558664506u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref grabbableObjectReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref spawnPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2558664506u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(SyncScanNodeParentRotationsAndFall((GrabbableObject)NetworkBehaviourReference.op_Implicit(grabbableObjectReference), spawnPosition, targetPosition, rotation, value)); } } } [IteratorStateMachine(typeof(d__48))] private IEnumerator SyncScanNodeParentRotationsAndFall(GrabbableObject grabbableObject, Vector3 spawnPosition, Vector3 targetPosition, Quaternion rotation, int value) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this, grabbableObject = grabbableObject, spawnPosition = spawnPosition, targetPosition = targetPosition, rotation = rotation, value = value }; } [IteratorStateMachine(typeof(d__49))] private IEnumerator ForceRotationForABit(GameObject go, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__49(0) { go = go, rotation = rotation }; } public void HideEnemyGameObject() { ((Component)((Component)this).transform.Find("BellCrab")).gameObject.SetActive(false); } [IteratorStateMachine(typeof(d__51))] public IEnumerator delayDestroy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { <>4__this = this }; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.enemyHP > 1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, true, hitID); } else { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false, hitID); } base.enemyHP -= force; Interact_Script.interactable = false; if ((Object)(object)playerWhoHit != (Object)null) { HUDManager.Instance.AttemptScanNewCreature(creatureID); } if (isAttached && (Object)(object)playerHoldingCrab != (Object)null && ((NetworkBehaviour)this).IsOwner) { DropCrabClientRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerHoldingCrab)); } if (base.enemyHP > 0) { if (base.currentBehaviourStateIndex == 0) { base.creatureAnimator.SetTrigger("PopOut"); } ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); base.creatureAnimator.SetInteger("State", 1); if (recentlyDamagedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(recentlyDamagedCoroutine); } recentlyDamagedCoroutine = ((MonoBehaviour)this).StartCoroutine(RecentlyDamagedCooldown()); } else if (base.currentBehaviourStateIndex == 2) { ((MonoBehaviour)this).StartCoroutine(DropCrabDelay(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerHoldingCrab))); } else { ((Behaviour)base.agent).enabled = false; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(3); base.creatureAnimator.SetTrigger("Death"); base.creatureAnimator.SetInteger("State", 3); } } [IteratorStateMachine(typeof(d__53))] public IEnumerator RecentlyDamagedCooldown() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__53(0) { <>4__this = this }; } private bool HasReachedDestination() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = base.agent.velocity; if ((double)((Vector3)(ref velocity)).magnitude <= 0.01) { return true; } return false; } [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public void AnimationEventCanRun() { base.agent.speed = BellCrabRunSpeed; } public override void Update() { //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.currentBehaviourStateIndex == 2 && (Object)(object)playerHoldingCrab == (Object)null) { playerHoldingCrab = (from x in StartOfRound.Instance.allPlayerScripts where ((NetworkBehaviour)x).IsSpawned && x.isPlayerControlled && !x.isPlayerDead select x into player select new { Player = player, Distance = Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) } into x orderby x.Distance select x).FirstOrDefault().Player; } else if (base.currentBehaviourStateIndex == 2 && ((Object)(object)playerHoldingCrab.inAnimationWithEnemy != (Object)(object)this || !isAttached)) { playerHoldingCrab.inAnimationWithEnemy = (EnemyAI)(object)this; isAttached = true; } if (base.isEnemyDead) { return; } if ((Object)(object)playerHoldingCrab != (Object)null) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); base.creatureAnimator.SetInteger("State", 2); if (playerHoldingCrab.isPlayerDead && ((NetworkBehaviour)this).IsHost) { DropCrabServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerHoldingCrab)); } } if (!isAttached && base.currentBehaviourStateIndex == 1) { PlayerControllerB val = FindClosestPlayer(20f); if ((Object)(object)val != (Object)null) { ((Component)this).transform.rotation = Quaternion.LookRotation(Vector3.Normalize(((Component)this).transform.position - ((Component)val).transform.position), Vector3.up); } } if ((Object)(object)playerHoldingCrab != (Object)null && isAttached && playerHoldingCrab.health > 0) { playerHoldingCrab.playerBodyAnimator.SetLayerWeight(playerHoldingCrab.playerBodyAnimator.GetLayerIndex("HoldingItemsBothHands"), 1f); ((Component)this).transform.position = ((Component)playerHoldingCrab.bodyParts[5]).transform.position; Transform transform = ((Component)this).transform; transform.position += ((Component)this).transform.forward * 0.7f; ((Component)this).transform.rotation = ((Component)playerHoldingCrab).transform.rotation; } } [ServerRpc(RequireOwnership = false)] public void HandleGoingFromRunningToIdleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(789925258u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 789925258u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HandleGoingFromRunningToIdleClientRpc(); } } } [ClientRpc] public void HandleGoingFromRunningToIdleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2496658613u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2496658613u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Component)this).transform.rotation = Quaternion.identity; base.creatureAnimator.SetTrigger("PopIn"); Interact_Script.interactable = true; Interact_Script.hoverTip = "Grab : [E]"; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); ScanNode.creatureScanID = -1; base.creatureAnimator.SetInteger("State", 0); FindNextWanderPoint(); } } } public override void DoAIInterval() { if (testBuild) { ((MonoBehaviour)this).StartCoroutine(DrawPath(line, base.agent)); } ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || !((NetworkBehaviour)this).IsHost) { return; } switch (base.currentBehaviourStateIndex) { case 1: if (HasReachedDestination() && !recentlyDamaged) { HandleGoingFromRunningToIdleServerRpc(); } break; case 0: case 2: break; } } [IteratorStateMachine(typeof(d__61))] public static IEnumerator DrawPath(LineRenderer line, NavMeshAgent agent) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__61(0) { line = line, agent = agent }; } public PlayerControllerB FindClosestPlayer(float maxDistance = 10f) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB result = null; float num = float.MaxValue; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (num2 < num && num2 <= maxDistance) { num = num2; result = val; } } return result; } [ClientRpc] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4015559398u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4015559398u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationName); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(487414722u, new RpcReceiveHandler(__rpc_handler_487414722), "PickupCrabServerRpc"); ((NetworkBehaviour)this).__registerRpc(1614733662u, new RpcReceiveHandler(__rpc_handler_1614733662), "PickupCrabClientRpc"); ((NetworkBehaviour)this).__registerRpc(510543919u, new RpcReceiveHandler(__rpc_handler_510543919), "DropCrabServerRpc"); ((NetworkBehaviour)this).__registerRpc(887584623u, new RpcReceiveHandler(__rpc_handler_887584623), "DropCrabClientRpc"); ((NetworkBehaviour)this).__registerRpc(2558664506u, new RpcReceiveHandler(__rpc_handler_2558664506), "SyncScanNodeParentRotationsAndFallRpc"); ((NetworkBehaviour)this).__registerRpc(789925258u, new RpcReceiveHandler(__rpc_handler_789925258), "HandleGoingFromRunningToIdleServerRpc"); ((NetworkBehaviour)this).__registerRpc(2496658613u, new RpcReceiveHandler(__rpc_handler_2496658613), "HandleGoingFromRunningToIdleClientRpc"); ((NetworkBehaviour)this).__registerRpc(4015559398u, new RpcReceiveHandler(__rpc_handler_4015559398), "DoAnimationClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_487414722(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).PickupCrabServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1614733662(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).PickupCrabClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_510543919(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).DropCrabServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_887584623(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).DropCrabClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2558664506(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference grabbableObjectReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableObjectReference, default(ForNetworkSerializable)); Vector3 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); Vector3 targetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).SyncScanNodeParentRotationsAndFallRpc(grabbableObjectReference, spawnPosition, targetPosition, rotation, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_789925258(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).HandleGoingFromRunningToIdleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2496658613(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).HandleGoingFromRunningToIdleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4015559398(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((BellCrabAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BellCrabAI"; } } public class BruceAI : EnemyAI { private enum Detection { None, Small, Medium, BIG } private enum State { Roaming, Chasing, Biting } [CompilerGenerated] private sealed class <>c__DisplayClass43_0 { public PlayerControllerB killPlayer; public float startTime; internal bool b__0() { if (!((Object)(object)killPlayer.deadBody != (Object)null)) { return Time.timeSinceLevelLoad - startTime > 2f; } return true; } } [CompilerGenerated] private sealed class d__35 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BruceAI <>4__this; private Collider 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BruceAI bruceAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; 5__2 = ((Component)bruceAI.attackArea).GetComponent(); if ((Object)(object)5__2 == (Object)null) { return false; } int nextStableRandomIndex = bruceAI.biteRandomizer.GetNextStableRandomIndex(); ((EnemyAI)bruceAI).creatureSFX.volume = 1f; ((EnemyAI)bruceAI).creatureSFX.pitch = 1f; ((EnemyAI)bruceAI).creatureSFX.maxDistance = 30f; bruceAI.NetworkAudioSource.PlayOneShot(bruceAI.biteSet.GetAudioClip(nextStableRandomIndex)); bruceAI.DoAnimationClientRpc("Bite"); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } case 1: <>1__state = -1; 5__3 = 0.4f; 5__4 = Time.time; goto IL_01a6; case 2: <>1__state = -1; goto IL_01a6; case 3: { <>1__state = -1; if ((Object)(object)((EnemyAI)bruceAI).targetPlayer == (Object)null) { if (bruceAI.TargetClosestPlayerThatSmells()) { ((EnemyAI)bruceAI).SwitchToBehaviourClientRpc(1); } else { ((EnemyAI)bruceAI).SwitchToBehaviourClientRpc(0); } } else { ((EnemyAI)bruceAI).SwitchToBehaviourClientRpc(1); } Plugin.Logger.LogInfo((object)"Finish Bite"); return false; } IL_01a6: if (Time.time - 5__4 < 5__3) { if (((EnemyAI)bruceAI).stunNormalizedTimer > 0f) { return false; } Bounds bounds = 5__2.bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = 5__2.bounds; Collider[] array = Physics.OverlapBox(center, ((Bounds)(ref bounds)).extents, ((Component)5__2).transform.rotation); bool flag = false; Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { flag = true; component.inAnimationWithEnemy = (EnemyAI)(object)bruceAI; bruceAI.KillPlayerServerRpc((int)component.playerClientId); ((EnemyAI)bruceAI).targetPlayer = null; break; } } if (flag) { return false; } <>2__current = null; <>1__state = 2; return true; } <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__43 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BruceAI <>4__this; public int playerId; private <>c__DisplayClass43_0 <>8__1; private Quaternion 5__2; private Quaternion 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BruceAI bruceAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass43_0(); if (((NetworkBehaviour)bruceAI).IsOwner) { ((EnemyAI)bruceAI).agent.speed = Mathf.Clamp(((EnemyAI)bruceAI).agent.speed, 12f, 0f); } ((EnemyAI)bruceAI).creatureVoice.pitch = Random.Range(0.96f, 1.04f); <>8__1.killPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; bruceAI.inKillAnimation = true; if (!((EnemyAI)bruceAI).isEnemyDead) { ((EnemyAI)bruceAI).creatureAnimator.SetTrigger("FlingKill"); } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)<>8__1.killPlayer) { <>8__1.killPlayer.KillPlayer(<>8__1.killPlayer.velocityLastFrame, true, (CauseOfDeath)6, 7, default(Vector3), false); } <>8__1.startTime = Time.timeSinceLevelLoad; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)<>8__1.killPlayer.deadBody != (Object)null || Time.timeSinceLevelLoad - <>8__1.startTime > 2f)); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>8__1.killPlayer.deadBody == (Object)null) { Plugin.Logger.LogInfo((object)"Bruce: Player body was not spawned or found within 2 seconds."); <>8__1.killPlayer.inAnimationWithEnemy = null; bruceAI.inKillAnimation = false; ((EnemyAI)bruceAI).SwitchToBehaviourStateOnLocalClient(0); return false; } bruceAI.TakeBodyInMouth(<>8__1.killPlayer.deadBody); <>8__1.startTime = Time.timeSinceLevelLoad; 5__2 = Quaternion.Euler(new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(((Component)bruceAI).transform.position + Vector3.up * 0.6f, 25f, 6), 0f)); 5__3 = ((Component)bruceAI).transform.rotation; goto IL_024f; case 2: <>1__state = -1; if (((NetworkBehaviour)bruceAI).IsOwner) { ((Component)bruceAI).transform.rotation = Quaternion.RotateTowards(5__3, 5__2, 60f * Time.deltaTime); } goto IL_024f; case 3: { <>1__state = -1; bruceAI.DropCarriedBody(); bruceAI.inKillAnimation = false; ((EnemyAI)bruceAI).SwitchToBehaviourState(0); return false; } IL_024f: if (Time.timeSinceLevelLoad - <>8__1.startTime < 2f) { <>2__current = null; <>1__state = 2; return true; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform attackArea; private Vector3 StalkPos; public Random enemyRandom; private bool isDeadAnimationDone; [SerializeField] private Transform jawTransform; private DeadBodyInfo carryingBody; private Vector3 wanderTarget; private float biteDistance = 9f; private float wanderRadius = 25f; private Bounds SmellTargetShipBounds; private Bounds WanderPaddedShipBounds; [SerializeField] private AudioSource MovementAudioSource; [SerializeField] private NetworkAudioSource NetworkAudioSource; [SerializeField] private Collider bruceSaddleCollider; private bool inKillAnimation; private float roamingCooldown = 10f; private float lastRoamingTime; [Header("SoundSets")] [SerializeField] private SoundSet swimSet; [SerializeField] private SoundSet biteSet; private UniqueRandomizer swimRandomizer; private UniqueRandomizer biteRandomizer; [SerializeField] private Material bruceMaterial; [SerializeField] private Material blahajMaterial; private Coroutine killPlayerCoroutine; public override void Start() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown ((EnemyAI)this).Start(); ((Renderer)base.skinnedMeshRenderers[0]).material = (Plugin.BoundConfig.BruceBlahaj.Value ? blahajMaterial : bruceMaterial); WanderPaddedShipBounds = StartOfRound.Instance.shipBounds.bounds; ((Bounds)(ref WanderPaddedShipBounds)).Expand(10f); SmellTargetShipBounds = StartOfRound.Instance.shipBounds.bounds; Vector3 extents = ((Bounds)(ref SmellTargetShipBounds)).extents; ((Bounds)(ref SmellTargetShipBounds)).extents = new Vector3(extents.x, extents.y + 6f, extents.z); Vector3 center = ((Bounds)(ref SmellTargetShipBounds)).center; ((Bounds)(ref SmellTargetShipBounds)).center = new Vector3(center.x, center.y + 2f, center.z); base.agent.areaMask = 877; swimRandomizer = new UniqueRandomizer(swimSet); biteRandomizer = new UniqueRandomizer(biteSet); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; } public void PlaySwimSound() { int nextStableRandomIndex = swimRandomizer.GetNextStableRandomIndex(); MovementAudioSource.volume = 0.4f; MovementAudioSource.pitch = Random.Range(0.9f, 1.1f); MovementAudioSource.maxDistance = 30f; MovementAudioSource.PlayOneShot(swimSet.GetAudioClip(nextStableRandomIndex)); WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, swimSet.GetAudioClip(nextStableRandomIndex), 0.4f); } public override void AnimationEventA() { ((EnemyAI)this).AnimationEventA(); PlaySwimSound(); } public override void Update() { //IL_0017: 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) ((EnemyAI)this).Update(); Animator creatureAnimator = base.creatureAnimator; Vector3 velocity = base.agent.velocity; creatureAnimator.SetFloat("Speed", ((Vector3)(ref velocity)).magnitude); if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } public override void DoAIInterval() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (!((NetworkBehaviour)this).IsHost || base.isEnemyDead || StartOfRound.Instance.allPlayersDead || base.stunNormalizedTimer > 0f) { return; } switch (base.currentBehaviourStateIndex) { case 0: { base.agent.speed = 4f; base.agent.angularSpeed = 300f; base.agent.acceleration = 6f; PickleOnStickItem pickleStick; if (TargetClosestPlayerThatSmells()) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } else if (IsThereAPlayerHoldingPickleStick(out pickleStick)) { if (!((Object)(object)pickleStick == (Object)null)) { SetDestinationNotAllowedInShip(RoundManager.Instance.GetNavMeshPosition(pickleStick.pickleTransform.position + Vector3.down, default(NavMeshHit), 5f, -1)); } } else if (Time.time - lastRoamingTime > roamingCooldown) { Wander(); lastRoamingTime = Time.time; } break; } case 1: base.agent.speed = 5f; base.agent.angularSpeed = 50f; base.agent.acceleration = 10f; if (!TargetClosestPlayerThatSmells()) { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); Wander(); } else { PositionAroundPlayer(); } break; case 2: base.agent.speed = 5.3f; PositionAroundPlayer(); break; } } private bool IsThereAPlayerHoldingPickleStick(out PickleOnStickItem pickleStick) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; float num = float.MaxValue; PickleOnStickItem pickleOnStickItem = null; for (int i = 0; i < allPlayerScripts.Length; i++) { PickleOnStickItem pickleOnStickItem2 = allPlayerScripts[i].currentlyHeldObjectServer as PickleOnStickItem; if (!((Object)(object)pickleOnStickItem2 == (Object)null)) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)allPlayerScripts[i]).transform.position); if (num2 < num && num2 < Plugin.BoundConfig.BrucePickleRange.Value) { num = num2; pickleOnStickItem = pickleOnStickItem2; } } } pickleStick = pickleOnStickItem; return (Object)(object)pickleStick != (Object)null; } public bool TargetClosestPlayerThatSmells(float bufferDistance = 1.5f) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; PlayerControllerB targetPlayer = base.targetPlayer; base.targetPlayer = null; Detection detection = Detection.None; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; NavMeshHit val2 = default(NavMeshHit); for (int i = 0; i < allPlayerScripts.Length; i++) { int health = allPlayerScripts[i].health; Detection detectionLevel = GetDetectionLevel(health); if (detectionLevel == Detection.None || !((EnemyAI)this).PlayerIsTargetable(allPlayerScripts[i], false, false, true) || ((Bounds)(ref SmellTargetShipBounds)).Contains(((Component)allPlayerScripts[i]).transform.position)) { continue; } float detectionRadius = GetDetectionRadius(detectionLevel); base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)allPlayerScripts[i]).transform.position); if (!(base.tempDist <= detectionRadius) || (detectionLevel <= detection && (detectionLevel != detection || !(base.tempDist < base.mostOptimalDistance)))) { continue; } NavMeshPath val = new NavMeshPath(); if (NavMesh.SamplePosition(((Component)allPlayerScripts[i]).transform.position, ref val2, 3.5f, -1)) { base.agent.CalculatePath(((NavMeshHit)(ref val2)).position, val); if ((int)val.status == 0) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = allPlayerScripts[i]; detection = detectionLevel; } } } if ((Object)(object)base.targetPlayer != (Object)null && bufferDistance > 0f && (Object)(object)targetPlayer != (Object)null && Mathf.Abs(base.mostOptimalDistance - Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position)) < bufferDistance) { base.targetPlayer = targetPlayer; } return (Object)(object)base.targetPlayer != (Object)null; } private Detection GetDetectionLevel(int health) { if (health <= Plugin.BoundConfig.BruceBigRangeHealthThreshold.Value) { return Detection.BIG; } if (health <= Plugin.BoundConfig.BruceMediumRangeHealthThreshold.Value) { return Detection.Medium; } if (health <= Plugin.BoundConfig.BruceSmallRangeHealthThreshold.Value) { return Detection.Small; } return Detection.None; } private float GetDetectionRadius(Detection detection) { return detection switch { Detection.Small => Plugin.BoundConfig.BruceSmallRange.Value, Detection.Medium => Plugin.BoundConfig.BruceMediumRange.Value, Detection.BIG => Plugin.BoundConfig.BruceBigRange.Value, _ => 0f, }; } private void PositionAroundPlayer() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.targetPlayer == (Object)null || !((NetworkBehaviour)this).IsOwner) { return; } if (!((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, true)) { NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)base.targetPlayer).transform.position, ref val, 3.5f, -1)) { ((EnemyAI)this).SetDestinationToPosition(((NavMeshHit)(ref val)).position, true); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false); } } float num = Vector3.Distance(attackArea.position, ((Component)base.targetPlayer).transform.position); if (num <= biteDistance && base.currentBehaviourStateIndex != 2 && math.dot(float3.op_Implicit(((Component)this).transform.forward), float3.op_Implicit(((Component)base.targetPlayer).transform.forward)) < -0.85f) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); ((MonoBehaviour)this).StartCoroutine(BiteAttackCoroutine()); } } [IteratorStateMachine(typeof(d__35))] private IEnumerator BiteAttackCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__35(0) { <>4__this = this }; } [ClientRpc] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3127106653u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3127106653u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationName); } } private void TakeBodyInMouth(DeadBodyInfo body) { carryingBody = body; carryingBody.attachedTo = jawTransform; carryingBody.attachedLimb = body.bodyParts[5]; carryingBody.matchPositionExactly = true; } private void DropCarriedBody() { if (!((Object)(object)carryingBody == (Object)null)) { carryingBody.speedMultiplier = 12f; carryingBody.attachedTo = null; carryingBody.attachedLimb = null; carryingBody.matchPositionExactly = false; carryingBody = null; } } [ServerRpc(RequireOwnership = false)] public void KillPlayerServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3092199161u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3092199161u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!inKillAnimation) { inKillAnimation = true; KillPlayerClientRpc(playerId); } else { CancelKillAnimationWithPlayerClientRpc(playerId); } } } [ClientRpc] public void CancelKillAnimationWithPlayerClientRpc(int playerObjectId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3969554071u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObjectId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3969554071u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartOfRound.Instance.allPlayerScripts[playerObjectId].inAnimationWithEnemy = null; } } } [ClientRpc] public void KillPlayerClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(945219238u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 945219238u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (killPlayerCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killPlayerCoroutine); } killPlayerCoroutine = ((MonoBehaviour)this).StartCoroutine(KillPlayer(playerId)); } } [IteratorStateMachine(typeof(d__43))] private IEnumerator KillPlayer(int playerId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__43(0) { <>4__this = this, playerId = playerId }; } private void Wander() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i <= 3; i++) { wanderTarget = RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, wanderRadius, default(NavMeshHit)); SetDestinationNotAllowedInShip(wanderTarget); } } private void SetDestinationNotAllowedInShip(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!((Bounds)(ref WanderPaddedShipBounds)).Contains(position)) { ((EnemyAI)this).SetDestinationToPosition(position, false); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3127106653u, new RpcReceiveHandler(__rpc_handler_3127106653), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(3092199161u, new RpcReceiveHandler(__rpc_handler_3092199161), "KillPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3969554071u, new RpcReceiveHandler(__rpc_handler_3969554071), "CancelKillAnimationWithPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(945219238u, new RpcReceiveHandler(__rpc_handler_945219238), "KillPlayerClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3127106653(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((BruceAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3092199161(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((BruceAI)(object)target).KillPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3969554071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObjectId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId); target.__rpc_exec_stage = (__RpcExecStage)1; ((BruceAI)(object)target).CancelKillAnimationWithPlayerClientRpc(playerObjectId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_945219238(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((BruceAI)(object)target).KillPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BruceAI"; } } [ExecuteAlways] public class DebugGizmos : MonoBehaviour { public float arrowHeadLength = 0.25f; public float arrowHeadAngle = 20f; public float arrowLineLength = 1f; private void OnDrawGizmos() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.forward * arrowLineLength; Gizmos.color = Color.green; Gizmos.DrawRay(((Component)this).transform.position, val); Vector3 val2 = Quaternion.LookRotation(val) * Quaternion.Euler(0f, 180f + arrowHeadAngle, 0f) * new Vector3(0f, 0f, 1f); Vector3 val3 = Quaternion.LookRotation(val) * Quaternion.Euler(0f, 180f - arrowHeadAngle, 0f) * new Vector3(0f, 0f, 1f); Gizmos.DrawRay(((Component)this).transform.position + val, val2 * arrowHeadLength); Gizmos.DrawRay(((Component)this).transform.position + val, val3 * arrowHeadLength); } } [Serializable] public class VanillaMaterial { public string MaterialName; public int MaterialSlot; } internal class GrabbableExtended : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); string text = "Material.003_0"; int num = 1; ((Renderer)base.mainObjectRenderer).materials[num] = FindMaterialByName("Material.003"); } public Material FindMaterialByName(string materialName) { Material[] array = Resources.LoadAll(""); Material[] array2 = array; foreach (Material val in array2) { if (((Object)val).name == materialName) { return val; } } Debug.LogWarning((object)("Material '" + materialName + "' not found.")); return null; } [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GrabbableExtended"; } } public class HorseAI : ExtendedEnemyAI { private enum State { Wander, RunAway } [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HorseAI <>4__this; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; HorseAI horseAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0.5f; 5__3 = Time.time; break; case 1: <>1__state = -1; break; } if (Time.time - 5__3 < 5__2) { ((Vector3)(ref horseAI.pushDirection)).Normalize(); Transform transform = ((Component)horseAI).transform; transform.position += horseAI.pushDirection * Time.deltaTime * 5f; <>2__current = null; <>1__state = 1; return true; } horseAI.isPushing = false; horseAI.pushCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float timeSinceNewRandPos; private Vector3 wanderTarget; public int launchForceIndex; [NonSerialized] public float[] launchForcesPerLevel = new float[3] { 20f, 30f, 40f }; [Header("Velocity Stuff")] private Vector3 agentLocalVelocity; private Vector3 previousPosition; private float velZ; public Transform animationHolder; private static readonly int colorID = Shader.PropertyToID("_TailColor"); [SerializeField] private NetworkAudioSource NetworkAudioSource; [SerializeField] private AudioClip HorsePushClip; [SerializeField] private AudioClip HorseLaunchClip; [SerializeField] private AudioClip HorseHitClip; [SerializeField] private AudioClip HorseWalkClip; [SerializeField] private Color[] launchColors = Array.Empty(); public InteractTrigger Interact_Script; private bool isPushing; private Vector3 pushDirection; private const float pushDuration = 0.5f; public bool isLaunching; public PlayerControllerB? launchingPlayerController; private float launchPower; public float launchTimer; private const float launchDuration = 4f; private Vector3 flatForwardVector; private Coroutine? pushCoroutine; public override void Start() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); SurfacedPatches.playersBeingLaunched[this] = new List(); ((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[1].SetColor(colorID, launchColors[launchForceIndex]); ((EnemyAI)this).currentBehaviourStateIndex = 0; Interact_Script.cooldownTime = 0.7f; ((UnityEvent)(object)Interact_Script.onInteract).AddListener((UnityAction)TriggerInteract); Interact_Script.hoverTip = "Push : [E]"; } public override void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!((EnemyAI)this).isEnemyDead) { AlignToGround(); SetPowerBasedOnState(); agentLocalVelocity = animationHolder.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / 2f); velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime); ((EnemyAI)this).creatureAnimator.SetFloat("MoveZ", Mathf.Clamp(velZ, 0f, 1f)); previousPosition = ((Component)this).transform.position; timeSinceNewRandPos += Time.deltaTime; if (isPushing && pushCoroutine == null) { pushCoroutine = ((MonoBehaviour)this).StartCoroutine(HandlePush()); } if (isLaunching && (Object)(object)launchingPlayerController != (Object)null) { HandleLaunch(); } if (((EnemyAI)this).currentBehaviourStateIndex == 1 && (Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { RunAwayFromPlayer(); } } } private void SetPowerBasedOnState() { switch ((State)((EnemyAI)this).currentBehaviourStateIndex) { case State.Wander: launchPower = launchForcesPerLevel[launchForceIndex]; break; case State.RunAway: launchPower = launchForcesPerLevel[launchForceIndex]; break; } } public void TriggerInteract(PlayerControllerB player) { if (!((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)(object)player)) { NetworkAudioSource.PlayOneShot(HorsePushClip); ((EnemyAI)this).creatureSFX.pitch = Random.Range(0.8f, 1.2f); PushHorseServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player)); } } [IteratorStateMachine(typeof(d__31))] private IEnumerator HandlePush() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] private void PushHorseServerRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3437439891u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3437439891u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PushHorseClientRpc(playerIndex); } } } [ClientRpc] private void PushHorseClientRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1027229712u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1027229712u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerIndex]; Vector3 val4 = new Vector3(((Component)val3.gameplayCamera).transform.forward.x, 0f, ((Component)val3.gameplayCamera).transform.forward.z); pushDirection = ((Vector3)(ref val4)).normalized; isPushing = true; } } } private void HandleLaunch() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)launchingPlayerController == (Object)null) && launchTimer < 4f) { Vector3 val = Vector3.up * 3f + flatForwardVector; Vector3 val2 = Vector3.Lerp(val * launchPower, Vector3.zero, launchTimer / 4f); PlayerControllerB? obj = launchingPlayerController; obj.externalForces += val2; launchTimer += Time.deltaTime; } } private void AlignToGround() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val, 1f)) { Vector3 normal = ((RaycastHit)(ref val)).normal; Vector3 val2 = Vector3.ProjectOnPlane(((Component)this).transform.forward, normal); Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion val3 = Quaternion.LookRotation(normalized, normal); animationHolder.rotation = Quaternion.Slerp(animationHolder.rotation, val3, Time.deltaTime * 5f); } } public void AnimationEventFloatA(float value) { ((EnemyAI)this).agent.speed = value; } public override void AnimationEventA() { ((EnemyAI)this).creatureSFX.volume = 0.5f; ((EnemyAI)this).creatureSFX.PlayOneShot(HorseWalkClip); } public void LaunchAnimationEvent() { } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: Wander(); if (FoundClosestPlayerInRange(10f)) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: RunAwayFromPlayer(); break; } } private void Wander() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (timeSinceNewRandPos > 2f) { timeSinceNewRandPos = 0f; wanderTarget = new Vector3((float)Random.Range(-10, 10), 0f, (float)Random.Range(-10, 10)); ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position + wanderTarget, false); } } private void RunAwayFromPlayer() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { Vector3 val = ((Component)this).transform.position - ((Component)((EnemyAI)this).targetPlayer).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Component)this).transform.position + normalized * 10f; ((EnemyAI)this).SetDestinationToPosition(val2, false); } } private bool FoundClosestPlayerInRange(float range) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(range, true, 70f, false, false, true); if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < range; } return false; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) launchForceIndex = (launchForceIndex + 1) % launchForcesPerLevel.Length; ((EnemyAI)this).creatureAnimator.SetTrigger("HitEnemy"); ((EnemyAI)this).creatureSFX.volume = 0.9f; ((EnemyAI)this).creatureSFX.PlayOneShot(HorseHitClip); ((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[1].SetColor(colorID, launchColors[launchForceIndex]); } public override void OnCollideWithPlayer(Collider other) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController && Vector3.Distance(((Component)this).transform.position, ((Component)component).transform.position) <= 2f && !isLaunching) { NetworkAudioSource.PlayOneShot(HorseLaunchClip); launchingPlayerController = component; SurfacedPatches.playersBeingLaunched[this].Add(component); isLaunching = true; Vector3 val = new Vector3(((Component)this).transform.forward.x, 0f, ((Component)this).transform.forward.z); flatForwardVector = ((Vector3)(ref val)).normalized; } } protected override void __initializeVariables() { ((ExtendedEnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3437439891u, new RpcReceiveHandler(__rpc_handler_3437439891), "PushHorseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1027229712u, new RpcReceiveHandler(__rpc_handler_1027229712), "PushHorseClientRpc"); ((ExtendedEnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3437439891(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((HorseAI)(object)target).PushHorseServerRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1027229712(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((HorseAI)(object)target).PushHorseClientRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HorseAI"; } } public class MantisshrimpAI : EnemyAI { private enum State { Wander, Warn, Attack } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MantisshrimpAI <>4__this; public PlayerControllerB playerControllerB; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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) int num = <>1__state; MantisshrimpAI mantisshrimpAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; mantisshrimpAI.DoAnimationClientRpc("Punch"); mantisshrimpAI.NetworkAudioSource.PlayOneShot(mantisshrimpAI.hitsfx); mantisshrimpAI.EmitPSClientRpc(); float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)mantisshrimpAI).transform.position); if (num2 < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } else if (num2 < 24f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } case 1: { <>1__state = -1; if (((EnemyAI)mantisshrimpAI).isEnemyDead) { return false; } Vector3 val = ((Component)playerControllerB).transform.position - ((Component)mantisshrimpAI).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; ((Component)playerControllerB).GetComponent().AddForce(normalized * 500f); Vector3 val2 = Vector3.Normalize((((Component)playerControllerB).transform.position + Vector3.up * 0.75f - ((Component)mantisshrimpAI).transform.position) * 100f) * 150f; PlayerControllerB obj = playerControllerB; val = default(Vector3); obj.KillPlayer(val2, true, (CauseOfDeath)13, 6, val, false); ((EnemyAI)mantisshrimpAI).SwitchToBehaviourClientRpc(0); mantisshrimpAI.DoAnimationBoolClientRpc("IsWarning", value: false); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MantisshrimpAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; MantisshrimpAI mantisshrimpAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: { <>1__state = -1; float num2 = Vector3.Distance(((Component)((EnemyAI)mantisshrimpAI).targetPlayer).transform.position, ((Component)mantisshrimpAI).transform.position); if (num2 < 2f && ((EnemyAI)mantisshrimpAI).targetPlayer.performingEmote && math.dot(float3.op_Implicit(((Component)mantisshrimpAI).transform.forward), float3.op_Implicit(((Component)((EnemyAI)mantisshrimpAI).targetPlayer).transform.forward)) < -0.85f) { mantisshrimpAI.timeSinceHittingLocalPlayer = 0f; ((EnemyAI)mantisshrimpAI).SwitchToBehaviourClientRpc(2); ((MonoBehaviour)mantisshrimpAI).StartCoroutine(mantisshrimpAI.PerformAttack(((EnemyAI)mantisshrimpAI).targetPlayer)); } mantisshrimpAI.PerformNoEmotesAllowedCoroutine = null; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform turnCompass; private float timeSinceHittingLocalPlayer; private float timeSinceNewRandPos; private Vector3 wanderTarget; private Random enemyRandom; private bool isDeadAnimationDone; [Header("Velocity Stuff")] private Vector3 agentLocalVelocity; private Vector3 previousPosition; private float velZ; private float timeInWarnState; private float timeTillBackoff = 30f; public Transform animationHolder; [Header("Other shiat")] public NetworkAudioSource NetworkAudioSource; public AudioSource MovementAudioSource; public AudioClip warnsfx; public AudioClip hitsfx; public AudioClip parrysfx; public ParticleSystem StarBlastPS; public ParticleSystem SparkBlastPS; private bool isInitialSpawn = true; private Coroutine? PerformNoEmotesAllowedCoroutine; [Header("SoundSets")] [SerializeField] private SoundSet footStepSet; private UniqueRandomizer stepRandomizer; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); stepRandomizer = new UniqueRandomizer(footStepSet); timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; if (((NetworkBehaviour)this).IsOwner && isInitialSpawn) { NetworkObject val2 = default(NetworkObject); for (int i = 0; i < Plugin.BoundConfig.MantisGroupSize.Value; i++) { NetworkObjectReference val = RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)this).transform.position, 4f, default(NavMeshHit), new Random(), -1, -1f), ((Component)this).transform.rotation.y, -1, base.enemyType); ((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null); MantisshrimpAI component = ((Component)val2).gameObject.GetComponent(); component.isInitialSpawn = false; } } } public void PlayFootstepSound() { int nextStableRandomIndex = stepRandomizer.GetNextStableRandomIndex(); MovementAudioSource.volume = 0.4f; MovementAudioSource.pitch = Random.Range(0.9f, 1.1f); MovementAudioSource.PlayOneShot(footStepSet.GetAudioClip(nextStableRandomIndex)); WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, footStepSet.GetAudioClip(nextStableRandomIndex), 0.4f); } public override void AnimationEventA() { ((EnemyAI)this).AnimationEventA(); PlayFootstepSound(); } public override void Update() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.currentBehaviourStateIndex == 1) { timeInWarnState += Time.deltaTime; } else { timeInWarnState = 0f; } if (timeInWarnState > timeTillBackoff) { Transform transform = ((Component)this).transform; transform.position += ((Component)this).transform.forward * -0.3f * Time.deltaTime; } agentLocalVelocity = animationHolder.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / (Time.deltaTime * 2f)); velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime); base.creatureAnimator.SetFloat("MoveZ", Mathf.Clamp(velZ, 0f, 1f)); previousPosition = ((Component)this).transform.position; timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if ((Object)(object)base.targetPlayer != (Object)null && currentBehaviourStateIndex == 1) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 3f; Wander(); if (FoundClosestPlayerInRange(7f, 3f)) { if (!base.creatureVoice.isPlaying) { base.creatureSFX.volume = 0.7f; base.creatureSFX.pitch = Random.Range(0.8f, 1.2f); base.creatureSFX.maxDistance = 25f; NetworkAudioSource.PlayOneShot(warnsfx); } ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: base.agent.speed = 0f; Warn(); break; case 2: base.agent.speed = 0f; break; } } private void Wander() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (timeSinceNewRandPos > 2f) { timeSinceNewRandPos = 0f; wanderTarget = new Vector3((float)enemyRandom.Next(-10, 10), 0f, (float)enemyRandom.Next(-10, 10)); ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position + wanderTarget, false); } } [IteratorStateMachine(typeof(d__31))] private IEnumerator PerformNoEmotesAllowedAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this }; } private void Warn() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer != (Object)null)) { return; } if (base.targetPlayer.performingEmote && PerformNoEmotesAllowedCoroutine == null) { PerformNoEmotesAllowedCoroutine = ((MonoBehaviour)this).StartCoroutine(PerformNoEmotesAllowedAttack()); } if (!base.creatureAnimator.GetBool("IsWarning")) { DoAnimationBoolClientRpc("IsWarning", value: true); } if (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 10f) { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); if (base.creatureAnimator.GetBool("IsWarning")) { DoAnimationBoolClientRpc("IsWarning", value: false); } } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB targetPlayer = base.targetPlayer; ((EnemyAI)this).TargetClosestPlayer(5f, true, 70f, false, false, true); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(5f, false, 70f, false, false, true); range = senseRange; } if ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer != (Object)(object)base.targetPlayer) { timeInWarnState = 0f; } if ((Object)(object)base.targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } return false; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if ((Object)(object)playerWhoHit != (Object)null) { float num = Vector3.Distance(((Component)playerWhoHit).transform.position, ((Component)this).transform.position); if (num < 4f) { timeSinceHittingLocalPlayer = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); ((MonoBehaviour)this).StartCoroutine(PerformAttack(playerWhoHit)); } else { DoAnimationClientRpc("Punch"); base.creatureSFX.volume = 2f; NetworkAudioSource.PlayOneShot(parrysfx); EmitPSClientRpc(); } } } public override void OnCollideWithPlayer(Collider other) { if (base.currentBehaviourStateIndex == 1 && timeSinceHittingLocalPlayer > 1f) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceHittingLocalPlayer = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); ((MonoBehaviour)this).StartCoroutine(PerformAttack(val)); } } } [IteratorStateMachine(typeof(d__36))] private IEnumerator PerformAttack(PlayerControllerB playerControllerB) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this, playerControllerB = playerControllerB }; } [ClientRpc] public void EmitPSClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(285005414u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 285005414u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StarBlastPS.Emit(1); SparkBlastPS.Play(); } } } [ClientRpc] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(622706592u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 622706592u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationName); } } [ClientRpc] public void DoAnimationBoolClientRpc(string animationName, bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(511873081u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 511873081u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetBool(animationName, value); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(285005414u, new RpcReceiveHandler(__rpc_handler_285005414), "EmitPSClientRpc"); ((NetworkBehaviour)this).__registerRpc(622706592u, new RpcReceiveHandler(__rpc_handler_622706592), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(511873081u, new RpcReceiveHandler(__rpc_handler_511873081), "DoAnimationBoolClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_285005414(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MantisshrimpAI)(object)target).EmitPSClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_622706592(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MantisshrimpAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_511873081(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MantisshrimpAI)(object)target).DoAnimationBoolClientRpc(animationName, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MantisshrimpAI"; } } public class NemoAI : EnemyAI { private enum State { Roaming, Follow } public enum PositiveEffect { IncreaseMovementSpeed, HealPlayer, NoFallDamage, IncreaseJumpHeight, StaminaRefill, IncreaseReach } public enum NegativeEffect { DecreaseJumpHeight, MassiveSpeedIncrease, SlipperyHands, StaminaEmpty, Drunk, SensitivityDecrease, StopMoving, Choked } [CompilerGenerated] private sealed class <>c__DisplayClass34_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 30f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass48_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 30f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass49_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 30f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass50_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass51_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass52_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 45f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass53_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 60f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass54_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass55_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 0.2f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass56_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass57_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 15f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass58_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass59_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass60_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 10f; } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass61_0 { public float timeWhenBuffStarted; internal bool b__0() { if (!StartOfRound.Instance.shipIsLeaving) { return Time.time >= timeWhenBuffStarted + 0.5f; } return true; } } [CompilerGenerated] private sealed class d__54 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__54(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass54_0 CS$<>8__locals0 = new <>c__DisplayClass54_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("CHOKED", "Nothing.", false, false, "LC_Tip1"); } CS$<>8__locals0.timeWhenBuffStarted = Time.time; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.Choked); <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.Choked); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__57 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__57(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass57_0 CS$<>8__locals0 = new <>c__DisplayClass57_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Weak Legs", "Looks like you skipped leg day", false, false, "LC_Tip1"); } PlayerControllerB obj2 = playerModified; obj2.jumpForce -= 4f; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.DecreaseJumpHeight); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 15f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.DecreaseJumpHeight); PlayerControllerB obj = playerModified; obj.jumpForce += 4f; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__59 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__59(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass59_0 CS$<>8__locals0 = new <>c__DisplayClass59_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Bad Trip", "Duuuuude... I can smell colors...", false, false, "LC_Tip1"); } playerModified.drunkness = 100f; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.Drunk); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.Drunk); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass34_0 CS$<>8__locals0 = new <>c__DisplayClass34_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("The Final Doot", "You monster ;(", false, false, "LC_Tip1"); } playerModified.DamagePlayer(19, false, false, (CauseOfDeath)0, 0, false, default(Vector3)); PlayerControllerB obj3 = playerModified; obj3.jumpForce += 8f; PlayerControllerB obj4 = playerModified; obj4.movementSpeed += 10f; playerModified.sprintMeter = 1f; CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 30f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; PlayerControllerB obj = playerModified; obj.jumpForce -= 8f; PlayerControllerB obj2 = playerModified; obj2.movementSpeed -= 10f; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__50 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass50_0 CS$<>8__locals0 = new <>c__DisplayClass50_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Right as Rain", "You're feeling well", false, false, "LC_Tip1"); } playerModified.DamagePlayer(-90, false, false, (CauseOfDeath)0, 0, false, default(Vector3)); CS$<>8__locals0.timeWhenBuffStarted = Time.time; nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.HealPlayer); <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.HealPlayer); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass48_0 CS$<>8__locals0 = new <>c__DisplayClass48_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Spring Loaded", "Jump like a kangaroo", false, false, "LC_Tip1"); } PlayerControllerB obj2 = playerModified; obj2.jumpForce += 8f; nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.IncreaseJumpHeight); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 30f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; PlayerControllerB obj = playerModified; obj.jumpForce -= 8f; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.IncreaseJumpHeight); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__49 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass49_0 CS$<>8__locals0 = new <>c__DisplayClass49_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("In a hurry!", "Don't want to be late for the next quota", false, false, "LC_Tip1"); } PlayerControllerB obj2 = playerModified; obj2.movementSpeed += 8f; CS$<>8__locals0.timeWhenBuffStarted = Time.time; nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.IncreaseMovementSpeed); <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 30f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.IncreaseMovementSpeed); PlayerControllerB obj = playerModified; obj.movementSpeed -= 8f; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__53 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass53_0 CS$<>8__locals0 = new <>c__DisplayClass53_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Long arms", "Reach for the moon!", false, false, "LC_Tip1"); } PlayerControllerB obj2 = playerModified; obj2.grabDistance += 7f; nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.IncreaseReach); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 60f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.IncreaseReach); PlayerControllerB obj = playerModified; obj.grabDistance -= 7f; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__55 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass55_0 CS$<>8__locals0 = new <>c__DisplayClass55_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Like a flash", "Blink and you'll miss it", false, false, "LC_Tip1"); } PlayerControllerB obj2 = playerModified; obj2.movementSpeed += 200f; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.MassiveSpeedIncrease); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 0.2f)); <>1__state = 1; return true; } case 1: { <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.MassiveSpeedIncrease); PlayerControllerB obj = playerModified; obj.movementSpeed -= 200f; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__52 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass52_0 CS$<>8__locals0 = new <>c__DisplayClass52_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Light as a feather", "No fall damage", false, false, "LC_Tip1"); } nemoAI.playerNoFallDamageList.Add(playerModified); nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.NoFallDamage); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 45f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.NoFallDamage); nemoAI.playerNoFallDamageList.Remove(playerModified); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__60 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__60(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass60_0 CS$<>8__locals0 = new <>c__DisplayClass60_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Neck Pain", "You should really see a chiropractor", false, false, "LC_Tip1"); } playerModified.disableLookInput = true; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.SensitivityDecrease); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.SensitivityDecrease); playerModified.disableLookInput = false; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__56 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__56(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass56_0 CS$<>8__locals0 = new <>c__DisplayClass56_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Slippery Hands", "Woops! Butterfingers...", false, false, "LC_Tip1"); } playerModified.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.SlipperyHands); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.SlipperyHands); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__58 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__58(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass58_0 CS$<>8__locals0 = new <>c__DisplayClass58_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Out of Breath", "You got the wind knocked out of you", false, false, "LC_Tip1"); } playerModified.sprintMeter = 0f; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.StaminaEmpty); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.StaminaEmpty); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass51_0 CS$<>8__locals0 = new <>c__DisplayClass51_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("Deep Breath", "Lungs oxygenated", false, false, "LC_Tip1"); } playerModified.sprintMeter = 1f; nemoAI.clownfishPositiveEffects[playerModified].Add(PositiveEffect.StaminaRefill); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 10f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishPositiveEffects[playerModified].Remove(PositiveEffect.StaminaRefill); nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__61 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass61_0 CS$<>8__locals0 = new <>c__DisplayClass61_0(); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerModified) { HUDManager.Instance.DisplayTip("JINX!", "You jinxed it", false, false, "LC_Tip1"); } playerModified.disableMoveInput = true; nemoAI.clownfishNegativeEffects[playerModified].Add(NegativeEffect.StopMoving); CS$<>8__locals0.timeWhenBuffStarted = Time.time; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving || Time.time >= CS$<>8__locals0.timeWhenBuffStarted + 0.5f)); <>1__state = 1; return true; } case 1: <>1__state = -1; nemoAI.clownfishNegativeEffects[playerModified].Remove(NegativeEffect.StopMoving); playerModified.disableMoveInput = false; nemoAI.clownfishPlayerData[playerModified] = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__46 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public NegativeEffect effect; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: { <>1__state = -1; int num2 = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerModified); switch (effect) { case NegativeEffect.DecreaseJumpHeight: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoDecreaseJumpHeight(playerModified)); break; case NegativeEffect.MassiveSpeedIncrease: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoMassiveSpeedIncrease(playerModified)); break; case NegativeEffect.SlipperyHands: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoSlipperyHands(playerModified)); break; case NegativeEffect.StaminaEmpty: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoStaminaEmpty(playerModified)); break; case NegativeEffect.Drunk: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoDrunk(playerModified)); break; case NegativeEffect.SensitivityDecrease: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoSensitivityDecrease(playerModified)); break; case NegativeEffect.StopMoving: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoStopMoving(playerModified)); break; case NegativeEffect.Choked: ((EnemyAI)nemoAI).creatureAnimator.SetTrigger("Choke"); ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoChoked(playerModified)); break; } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__43 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerModified; public PositiveEffect effect; public NemoAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; NemoAI nemoAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: { <>1__state = -1; int num2 = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerModified); switch (effect) { case PositiveEffect.IncreaseMovementSpeed: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoIncreaseMovementSpeed(playerModified)); break; case PositiveEffect.IncreaseJumpHeight: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoIncreaseJumpHeight(playerModified)); break; case PositiveEffect.StaminaRefill: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoStaminaRefill(playerModified)); break; case PositiveEffect.HealPlayer: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoHealPlayer(playerModified)); break; case PositiveEffect.NoFallDamage: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoNoFallDamage(playerModified)); break; case PositiveEffect.IncreaseReach: ((MonoBehaviour)nemoAI).StartCoroutine(nemoAI.DoIncreaseReach(playerModified)); break; } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private List positiveEffects = new List { PositiveEffect.IncreaseMovementSpeed, PositiveEffect.HealPlayer, PositiveEffect.NoFallDamage, PositiveEffect.IncreaseJumpHeight, PositiveEffect.StaminaRefill, PositiveEffect.IncreaseReach }; private List negativeEffects = new List { NegativeEffect.DecreaseJumpHeight, NegativeEffect.MassiveSpeedIncrease, NegativeEffect.SlipperyHands, NegativeEffect.StaminaEmpty, NegativeEffect.Drunk, NegativeEffect.SensitivityDecrease, NegativeEffect.StopMoving, NegativeEffect.Choked }; private Dictionary clownfishPlayerData = new Dictionary(); private float timeSinceLastBoost; private Vector3 wanderTarget; private float wanderRadius = 25f; private float lastRoamingTime; private PlayerControllerB playerToFollow; private List playerNoFallDamageList = new List(); public InteractTrigger Interact_Script; public ParticleSystem ConfettiPS; public NetworkAudioSource NetworkAudioSource; public AudioClip SqueezeSoundClip; public AudioClip DeathSoundClip; public AudioClip ClownHorn1SoundClip; public AudioClip ChokeSoundClip; public AudioClip SqueakSoundClip; private Dictionary> clownfishNegativeEffects = new Dictionary>(); private Dictionary> clownfishPositiveEffects = new Dictionary>(); public override void Start() { ((EnemyAI)this).Start(); Interact_Script.interactable = Plugin.BoundConfig.SqueezeEnable.Value; base.enemyHP = Plugin.BoundConfig.ClownHornHealth.Value; base.currentBehaviourStateIndex = 0; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB key in allPlayerScripts) { if (!clownfishPlayerData.ContainsKey(key)) { clownfishPlayerData.Add(key, value: false); } if (!clownfishNegativeEffects.ContainsKey(key)) { clownfishNegativeEffects.Add(key, new List()); } if (!clownfishPositiveEffects.ContainsKey(key)) { clownfishPositiveEffects.Add(key, new List()); } } Random random = new Random(StartOfRound.Instance.randomMapSeed); if ((Object)(object)base.agent == (Object)null) { base.agent = ((Component)this).GetComponent(); } timeSinceLastBoost = random.Next(Plugin.BoundConfig.BuffTimerMin.Value, Plugin.BoundConfig.BuffTimerMax.Value); ((UnityEvent)(object)Interact_Script.onInteract).AddListener((UnityAction)TriggerInteract); Interact_Script.hoverTip = "Squeeze : [Hold E]"; } public override void Update() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { return; } foreach (PlayerControllerB playerNoFallDamage in playerNoFallDamageList) { playerNoFallDamage.fallValueUncapped = 0f; } Animator creatureAnimator = base.creatureAnimator; Vector3 velocity = base.agent.velocity; creatureAnimator.SetFloat("MoveZ", ((Vector3)(ref velocity)).magnitude); if (!((NetworkBehaviour)this).IsHost) { return; } lastRoamingTime -= Time.deltaTime; timeSinceLastBoost -= Time.deltaTime; if (base.currentBehaviourStateIndex == 0) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerDead && val.isPlayerControlled) { DetectPlayer(val); } } } if (!(timeSinceLastBoost <= 0f)) { return; } timeSinceLastBoost = Random.Range(Plugin.BoundConfig.BuffTimerMin.Value, Plugin.BoundConfig.BuffTimerMax.Value); int positiveIndex = Random.Range(0, positiveEffects.Count); int negativeIndex = Random.Range(0, negativeEffects.Count); int randomChance = Random.Range(1, 101); PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts2) { if (Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position) <= 15f && !clownfishPlayerData[val2]) { ExecuteNegativeOrPositiveEffectServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val2), positiveIndex, negativeIndex, randomChance); } } } public void TriggerInteract(PlayerControllerB player) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (Physics.Raycast(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, player.grabDistance, player.interactableObjectsMask)) { player.SetHoverTipAndCurrentInteractTrigger(); if (player.playerSteamId == 76561198342974015L) { MinzySqueezeFishServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player)); Vector3 val = ((Component)player).transform.position - ((Component)this).transform.position; player.DamagePlayer(999, true, true, (CauseOfDeath)10, 6, false, ((Vector3)(ref val)).normalized * 200f); } else { Interact_Script.interactable = false; Interact_Script.hasTriggered = true; SqueezeFishServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void MinzySqueezeFishServerRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3413805928u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3413805928u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; MinzySqueezeFishClientRpc(playerIndex); } } } [ClientRpc] public void MinzySqueezeFishClientRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3217175429u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3217175429u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; MinzySqueezeFish(playerIndex); } } } public void MinzySqueezeFish(int playerIndex) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerIndex]; ((Component)ConfettiPS).gameObject.transform.position = ((Component)val).transform.position; ConfettiPS.Play(); base.creatureSFX.PlayOneShot(SqueezeSoundClip); } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.enemyHP > 1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, true, hitID); } else { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false, hitID); } base.enemyHP -= force; if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } public void DeathConfettiAnimationEvent() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) ((Component)ConfettiPS).gameObject.transform.position = ((Component)this).transform.position; ConfettiPS.Play(); base.creatureSFX.PlayOneShot(DeathSoundClip); Interact_Script.interactable = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) <= 15f) { ((MonoBehaviour)this).StartCoroutine(DoFishDeathBoost(val)); } } } public void HonkHornAnimationEvent() { base.creatureSFX.PlayOneShot(ClownHorn1SoundClip); } public void ChokeAnimationEvent() { base.creatureSFX.PlayOneShot(ChokeSoundClip); } public void SqueezeAnimationEvent() { base.creatureSFX.PlayOneShot(SqueezeSoundClip); } [ServerRpc(RequireOwnership = false)] public void SqueezeFishServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3199865881u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3199865881u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } public override void KillEnemy(bool destroy = false) { FishDeath(); ((EnemyAI)this).KillEnemy(destroy); } public void FishDeath() { base.creatureAnimator.SetTrigger("Death"); } [IteratorStateMachine(typeof(d__34))] private IEnumerator DoFishDeathBoost(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { <>4__this = this, playerModified = playerModified }; } [ServerRpc(RequireOwnership = false)] private void ExecuteNegativeOrPositiveEffectServerRpc(int playerIndex, int positiveIndex, int negativeIndex, int randomChance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3375272596u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); BytePacker.WriteValueBitPacked(val2, positiveIndex); BytePacker.WriteValueBitPacked(val2, negativeIndex); BytePacker.WriteValueBitPacked(val2, randomChance); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3375272596u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExecuteNegativeOrPositiveEffectClientRpc(playerIndex, positiveIndex, negativeIndex, randomChance); } } } [ClientRpc] private void ExecuteNegativeOrPositiveEffectClientRpc(int playerIndex, int positiveIndex, int negativeIndex, int randomChance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3179090900u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); BytePacker.WriteValueBitPacked(val2, positiveIndex); BytePacker.WriteValueBitPacked(val2, negativeIndex); BytePacker.WriteValueBitPacked(val2, randomChance); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3179090900u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerFromArray = GetPlayerFromArray(playerIndex); clownfishPlayerData[playerFromArray] = true; PositiveEffect effect = positiveEffects[positiveIndex]; NegativeEffect effect2 = negativeEffects[negativeIndex]; if (randomChance <= Plugin.BoundConfig.DebuffChance.Value) { ExecuteNegativeEffect(effect2, playerFromArray); } else { ExecutePositiveEffect(effect, playerFromArray); } } } public override void DoAIInterval() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0152: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 3f; if (lastRoamingTime <= 0f) { Roam(); lastRoamingTime = 10f; } break; case 1: base.agent.speed = 12f; if ((Object)(object)playerToFollow == (Object)null || playerToFollow.isPlayerDead) { playerToFollow = null; ((EnemyAI)this).SwitchToBehaviourServerRpc(0); } else if (base.isOutside && playerToFollow.isInsideFactory) { GoThroughEntrance(playerToFollow); } else if (!base.isOutside && !playerToFollow.isInsideFactory) { GoThroughEntrance(playerToFollow); } else if (((base.isOutside && !playerToFollow.isInsideFactory) || (!base.isOutside && playerToFollow.isInsideFactory)) && !((EnemyAI)this).SetDestinationToPosition(((Component)playerToFollow).transform.position, true) && playerToFollow.thisController.isGrounded && Vector3.Distance(((Component)playerToFollow).transform.position, ((Component)this).transform.position) >= 10f) { base.agent.Warp(((Component)playerToFollow).transform.position); } break; } } public void GoThroughEntrance(PlayerControllerB playerToFollow) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) base.agent.Warp(((Component)playerToFollow).transform.position); SetEnemyOutsideServerRpc(!base.isOutside); } [ServerRpc(RequireOwnership = false)] private void SetEnemyOutsideServerRpc(bool setOutside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3725977499u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOutside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3725977499u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetEnemyOutsideClientRpc(setOutside); } } } [ClientRpc] public void SetEnemyOutsideClientRpc(bool setOutisde) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1959893463u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOutisde, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1959893463u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).SetEnemyOutside(setOutisde); } } } private void Roam() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) wanderTarget = RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, wanderRadius, default(NavMeshHit)); ((EnemyAI)this).SetDestinationToPosition(wanderTarget, false); } private void DetectPlayer(PlayerControllerB player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(((Component)this).transform.position, ((Component)player).transform.position) <= 20f && base.currentBehaviourStateIndex == 0) { playerToFollow = player; NetworkAudioSource.PlayOneShot(SqueakSoundClip); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } [IteratorStateMachine(typeof(d__43))] public IEnumerator ExecutePositiveEffectDelay(PositiveEffect effect, PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__43(0) { <>4__this = this, effect = effect, playerModified = playerModified }; } private void ExecutePositiveEffect(PositiveEffect effect, PlayerControllerB playerModified) { base.creatureAnimator.SetTrigger("BlowHorn"); ((MonoBehaviour)this).StartCoroutine(ExecutePositiveEffectDelay(effect, playerModified)); } private void ExecuteNegativeEffect(NegativeEffect effect, PlayerControllerB playerModified) { base.creatureAnimator.SetTrigger("Choke"); ((MonoBehaviour)this).StartCoroutine(ExecuteNegativeEffectDelay(effect, playerModified)); } [IteratorStateMachine(typeof(d__46))] public IEnumerator ExecuteNegativeEffectDelay(NegativeEffect effect, PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(0) { <>4__this = this, effect = effect, playerModified = playerModified }; } private PlayerControllerB GetPlayerFromArray(int index) { return StartOfRound.Instance.allPlayerScripts[index]; } [IteratorStateMachine(typeof(d__48))] private IEnumerator DoIncreaseJumpHeight(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__49))] private IEnumerator DoIncreaseMovementSpeed(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__49(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__50))] private IEnumerator DoHealPlayer(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__50(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__51))] private IEnumerator DoStaminaRefill(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__52))] private IEnumerator DoNoFallDamage(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__52(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__53))] private IEnumerator DoIncreaseReach(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__53(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__54))] private IEnumerator DoChoked(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__54(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__55))] private IEnumerator DoMassiveSpeedIncrease(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__55(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__56))] private IEnumerator DoSlipperyHands(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__56(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__57))] private IEnumerator DoDecreaseJumpHeight(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__57(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__58))] private IEnumerator DoStaminaEmpty(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__58(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__59))] private IEnumerator DoDrunk(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__59(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__60))] private IEnumerator DoSensitivityDecrease(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__60(0) { <>4__this = this, playerModified = playerModified }; } [IteratorStateMachine(typeof(d__61))] private IEnumerator DoStopMoving(PlayerControllerB playerModified) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__61(0) { <>4__this = this, playerModified = playerModified }; } public void OnDisable() { foreach (PlayerControllerB key in clownfishPlayerData.Keys) { if (!clownfishPlayerData[key]) { continue; } List list = clownfishNegativeEffects[key]; List list2 = clownfishPositiveEffects[key]; foreach (NegativeEffect item in list) { switch (item) { case NegativeEffect.DecreaseJumpHeight: key.jumpForce += 4f; break; case NegativeEffect.SensitivityDecrease: key.disableLookInput = false; break; case NegativeEffect.StopMoving: key.disableMoveInput = false; break; } list.Remove(item); } foreach (PositiveEffect item2 in list2) { switch (item2) { case PositiveEffect.IncreaseMovementSpeed: key.movementSpeed -= 8f; break; case PositiveEffect.IncreaseJumpHeight: key.jumpForce -= 8f; break; case PositiveEffect.IncreaseReach: key.grabDistance -= 7f; break; } list2.Remove(item2); } clownfishPlayerData[key] = false; } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3413805928u, new RpcReceiveHandler(__rpc_handler_3413805928), "MinzySqueezeFishServerRpc"); ((NetworkBehaviour)this).__registerRpc(3217175429u, new RpcReceiveHandler(__rpc_handler_3217175429), "MinzySqueezeFishClientRpc"); ((NetworkBehaviour)this).__registerRpc(3199865881u, new RpcReceiveHandler(__rpc_handler_3199865881), "SqueezeFishServerRpc"); ((NetworkBehaviour)this).__registerRpc(3375272596u, new RpcReceiveHandler(__rpc_handler_3375272596), "ExecuteNegativeOrPositiveEffectServerRpc"); ((NetworkBehaviour)this).__registerRpc(3179090900u, new RpcReceiveHandler(__rpc_handler_3179090900), "ExecuteNegativeOrPositiveEffectClientRpc"); ((NetworkBehaviour)this).__registerRpc(3725977499u, new RpcReceiveHandler(__rpc_handler_3725977499), "SetEnemyOutsideServerRpc"); ((NetworkBehaviour)this).__registerRpc(1959893463u, new RpcReceiveHandler(__rpc_handler_1959893463), "SetEnemyOutsideClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3413805928(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).MinzySqueezeFishServerRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3217175429(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).MinzySqueezeFishClientRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3199865881(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).SqueezeFishServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3375272596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); int positiveIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref positiveIndex); int negativeIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref negativeIndex); int randomChance = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomChance); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).ExecuteNegativeOrPositiveEffectServerRpc(playerIndex, positiveIndex, negativeIndex, randomChance); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3179090900(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); int positiveIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref positiveIndex); int negativeIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref negativeIndex); int randomChance = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomChance); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).ExecuteNegativeOrPositiveEffectClientRpc(playerIndex, positiveIndex, negativeIndex, randomChance); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3725977499(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enemyOutsideServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyOutsideServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).SetEnemyOutsideServerRpc(enemyOutsideServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1959893463(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enemyOutsideClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyOutsideClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NemoAI)(object)target).SetEnemyOutsideClientRpc(enemyOutsideClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "NemoAI"; } } public class PickleOnStickItem : GrabbableObject { public Transform pickleTransform; protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PickleOnStickItem"; } } [BepInPlugin("Surfaced", "Surfaced", "1.7.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger = null; public static Harmony _harmony = new Harmony("Surfaced"); internal static PluginConfig BoundConfig { get; private set; } = null; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; SurfacedPatches.Init(); _harmony.PatchAll(typeof(PlayerControllerBPatches)); AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "surfacedassets"); DuskMod val2 = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); val2.RegisterContentHandlers(); BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); Logger.LogInfo((object)"Surfaced Enemies is loaded!!"); } } public class RodrigoPlush : GrabbableObject { public List PrefabsToSpawn = new List(); public List AudioClips = new List(); public AudioSource AudioSource; public float Cooldown; private float cooldownTimer; private int bigBerthaIndex = 2; private Random random; public Animator plushanimator; [NonSerialized] public static List spawnedPrefabs = new List(); public override void Start() { ((GrabbableObject)this).Start(); plushanimator = ((Component)this).GetComponentInChildren(); random = new Random(StartOfRound.Instance.randomMapSeed + 23); cooldownTimer = Cooldown; } public override void Update() { ((GrabbableObject)this).Update(); if (cooldownTimer > 0f) { cooldownTimer -= Time.deltaTime; } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); AudioSource.PlayOneShot(AudioClips[random.Next(0, AudioClips.Count)]); plushanimator.SetTrigger("Squeeze"); if ((Object)(object)base.playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController || (base.playerHeldBy.playerSteamId != 76561199094139351L && base.playerHeldBy.playerSteamId != 76561198086325047L && base.playerHeldBy.playerSteamId != 76561198984467725L && base.playerHeldBy.playerSteamId != 76561198164429786L && base.playerHeldBy.playerSteamId != 76561198298676562L && base.playerHeldBy.playerSteamId != 76561198298676562L && base.playerHeldBy.playerSteamId != 76561198077184650L && base.playerHeldBy.playerSteamId != 76561198298343090L && base.playerHeldBy.playerSteamId != 76561198399127090L && (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || StartOfRound.Instance.shipIsLeaving || cooldownTimer > 0f || !GameNetworkManager.Instance.localPlayerController.thisController.isGrounded))) { return; } if (base.playerHeldBy.playerSteamId == 76561198164429786L) { Plugin.Logger.LogInfo((object)"Rodrigo spawning big berthas"); for (int i = 0; i < 10; i++) { SpawnPrefabServerRpc(bigBerthaIndex); } cooldownTimer = 0f; } else if (PrefabsToSpawn.Count > 0) { int gameObjectToSpawnIndex = random.Next(0, PrefabsToSpawn.Count); SpawnPrefabServerRpc(gameObjectToSpawnIndex); cooldownTimer = Cooldown; } } [ServerRpc(RequireOwnership = false)] private void SpawnPrefabServerRpc(int gameObjectToSpawnIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(585615421u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, gameObjectToSpawnIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 585615421u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = PrefabsToSpawn[gameObjectToSpawnIndex]; NetworkObject component = val3.GetComponent(); EnemyAI component2 = val3.GetComponent(); Vector3 position = ((Component)base.playerHeldBy).transform.position; if ((Object)(object)component2 != (Object)null) { NavMeshHit val4 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)base.playerHeldBy).transform.position, ref val4, 5f, -1)) { position = ((NavMeshHit)(ref val4)).position; } RoundManager.Instance.SpawnEnemyGameObject(position, 0f, -1, component2.enemyType); return; } NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)base.playerHeldBy).transform.position, ref val5, 5f * ((base.playerHeldBy.playerSteamId == 76561198298676562L || base.playerHeldBy.playerSteamId == 76561198164429786L) ? 4f : 1f), -1)) { position = ((NavMeshHit)(ref val5)).position; } if ((Object)(object)component != (Object)null) { GameObject val6 = Object.Instantiate(val3, position, Quaternion.identity); val6.GetComponent().Spawn(false); spawnedPrefabs.Add(val6.GetComponent()); } else { InstantiateObjectForEveryoneClientRpc(gameObjectToSpawnIndex, position); } } [ClientRpc] private void InstantiateObjectForEveryoneClientRpc(int gameObjectIndex, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3203945455u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, gameObjectIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3203945455u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = PrefabsToSpawn[gameObjectIndex]; Object.Instantiate(val3, position, Quaternion.identity, StartOfRound.Instance.propsContainer); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(585615421u, new RpcReceiveHandler(__rpc_handler_585615421), "SpawnPrefabServerRpc"); ((NetworkBehaviour)this).__registerRpc(3203945455u, new RpcReceiveHandler(__rpc_handler_3203945455), "InstantiateObjectForEveryoneClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_585615421(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int gameObjectToSpawnIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref gameObjectToSpawnIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((RodrigoPlush)(object)target).SpawnPrefabServerRpc(gameObjectToSpawnIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3203945455(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int gameObjectIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref gameObjectIndex); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((RodrigoPlush)(object)target).InstantiateObjectForEveryoneClientRpc(gameObjectIndex, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RodrigoPlush"; } } public class SquishableItem : GrabbableObject { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SquishableItem <>4__this; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown int num = <>1__state; SquishableItem squishableItem = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; 5__3 = 0f; 5__4 = 100f; goto IL_00bf; case 1: <>1__state = -1; goto IL_00bf; case 2: <>1__state = -1; 5__2 = 0f; break; case 3: { <>1__state = -1; break; } IL_00bf: if (5__2 < squishableItem.duration) { float num2 = 5__2 / squishableItem.duration; float num3 = Mathf.SmoothStep(0f, 1f, num2); float num4 = Mathf.Lerp(5__3, 5__4, num3); squishableItem.skinnedMeshRenderer.SetBlendShapeWeight(squishableItem.squishBlendShapeIndex, num4); 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } squishableItem.skinnedMeshRenderer.SetBlendShapeWeight(squishableItem.squishBlendShapeIndex, 5__4); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; } if (5__2 < squishableItem.duration) { float num5 = 5__2 / squishableItem.duration; float num6 = Mathf.SmoothStep(0f, 1f, num5); float num7 = Mathf.Lerp(5__4, 5__3, num6); squishableItem.skinnedMeshRenderer.SetBlendShapeWeight(squishableItem.squishBlendShapeIndex, num7); 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 3; return true; } squishableItem.skinnedMeshRenderer.SetBlendShapeWeight(squishableItem.squishBlendShapeIndex, 5__3); squishableItem.squishCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public SkinnedMeshRenderer skinnedMeshRenderer; public int squishBlendShapeIndex; public float duration = 0.01f; [SerializeField] private AudioSource squishSource; private Coroutine squishCoroutine; public override void Start() { ((GrabbableObject)this).Start(); squishSource = ((Component)this).GetComponent(); } public override void ItemActivate(bool used, bool buttonDown = true) { if (squishCoroutine == null) { squishSource.pitch = 1.2f; squishSource.volume = 0.6f; squishSource.PlayOneShot(SSoundManager.GetAudioClipFromNameRegistrar("Squeeze")); squishCoroutine = ((MonoBehaviour)this).StartCoroutine(SquishBlendShapeCoroutine()); } } [IteratorStateMachine(typeof(d__7))] private IEnumerator SquishBlendShapeCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SquishableItem"; } } internal class UrchinAI : EnemyAI { private enum State { Move, NoMove, Death } [CompilerGenerated] private sealed class d__41 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UrchinAI <>4__this; private float 5__2; private Vector3 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__41(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; UrchinAI urchinAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; 5__2 = 0f; 5__3 = ((Component)urchinAI).transform.localScale; float num2 = 0f; break; } case 1: <>1__state = -1; break; } if (5__2 <= 2f) { 5__2 += Time.deltaTime; float num2 = urchinAI.DeathCurve.Evaluate(5__2); ((Component)urchinAI).transform.localScale = 5__3 * num2; <>2__current = null; <>1__state = 1; return true; } if (((NetworkBehaviour)urchinAI).IsServer) { ((NetworkBehaviour)urchinAI).NetworkObject.Despawn(true); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__46 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UrchinAI <>4__this; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; UrchinAI urchinAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < urchinAI.animationDuration) { 5__2 += Time.deltaTime; float num2 = urchinAI.StabCurve.Evaluate(5__2 / urchinAI.animationDuration); float num3 = Mathf.Lerp(0.3f, -1f, num2); ((Renderer)urchinAI.urchin[0]).material.SetFloat("_StabbingScale", num3); ((Renderer)urchinAI.urchin[1]).material.SetFloat("_StabbingScale", num3); ((Renderer)urchinAI.urchin[2]).material.SetFloat("_StabbingScale", num3); <>2__current = null; <>1__state = 1; return true; } ((Renderer)urchinAI.urchin[0]).material.SetFloat("_StabbingScale", 0.3f); ((Renderer)urchinAI.urchin[1]).material.SetFloat("_StabbingScale", 0.3f); ((Renderer)urchinAI.urchin[2]).material.SetFloat("_StabbingScale", 0.3f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__47 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UrchinAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; UrchinAI urchinAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (!((EnemyAI)urchinAI).isEnemyDead && currentUrchinCount + 1 < ((EnemyAI)urchinAI).enemyType.MaxCount) { if (((Component)urchinAI).transform.localScale.x >= urchinAI.MaxGrowthSize) { ((Component)urchinAI).transform.localScale = urchinAI.initialSpawnScale; Vector3 randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)urchinAI).transform.position, 8f, default(NavMeshHit), new Random(), -1, -1f); for (int i = 0; i < 4; i++) { if (!((Bounds)(ref urchinAI.PaddedShipBounds)).Contains(randomNavMeshPositionInBoxPredictable) || i == 3) { RoundManager.Instance.SpawnEnemyGameObject(randomNavMeshPositionInBoxPredictable, ((Component)urchinAI).transform.rotation.y, -1, ((EnemyAI)urchinAI).enemyType); urchinAI.ResetEnemyHPServerRpc(); urchinAI.SyncTransformScaleClientRpc(((Component)urchinAI).transform.localScale); ((EnemyAI)urchinAI).creatureSFX.PlayOneShot(urchinAI.MitosisSoundClip, 1f); ((EnemyAI)urchinAI).creatureSFX.pitch = Random.Range(0.9f, 1.1f); break; } } } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float timeSinceHittingLocalPlayer; private float timeSinceIdle; private float timeSinceMoving; private int wanderRadius = 25; private Vector3 wanderTarget; private static int currentUrchinCount; private float nextPlayTime; private float footstepPlayInterval = 0.3f; private float animationDuration = 0.5f; public Material Material; public NetworkAudioSource NetworkAudioSource; public AnimationCurve StabCurve; public AnimationCurve DeathCurve; public MeshRenderer[] urchin; private Random enemyRandom; private float maxGrowth; private float minGrowth; private float growthrate; private Bounds PaddedShipBounds; private Vector3 initialSpawnScale = new Vector3(2f, 2f, 2f); private float MaxGrowthSize = 6f; private float progressToMaxGrowth; private Coroutine? deathAnimationCoroutine; private List deadBodiesAttached; private Dictionary upgradesByHealth = new Dictionary { { 0, false }, { 1, false }, { 2, false }, { 3, false }, { 4, false } }; [Header("Other shiat")] public AudioClip FootstepSoundClip; public AudioClip PrickSoundClip; public AudioClip MitosisSoundClip; public AudioClip DeathSoundClip; private static readonly int ColorProperty = Shader.PropertyToID("_BaseColor"); public Gradient UrchinColorGradient = new Gradient(); private static Random UrchinColorRandom = null; public override void Start() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); maxGrowth = Plugin.BoundConfig.UrchinMaxGrowth.Value; minGrowth = Plugin.BoundConfig.UrchinMinGrowth.Value; growthrate = Plugin.BoundConfig.UrchinGrowthRate.Value; ((Renderer)base.meshRenderers[0]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(0f)); ((Renderer)base.meshRenderers[1]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(0f)); ((Renderer)base.meshRenderers[2]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(0f)); PaddedShipBounds = StartOfRound.Instance.shipBounds.bounds; ((Bounds)(ref PaddedShipBounds)).Expand(Plugin.BoundConfig.UrchinShipPadding.Value); base.agent.areaMask = 637; base.AIIntervalTime = 0.2f; ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); for (int i = 0; i < urchin.Length; i++) { ((Renderer)urchin[i]).material = new Material(Material); } timeSinceHittingLocalPlayer = 0f; timeSinceIdle = 25f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); ((EnemyAI)this).SwitchToBehaviourState(1); ((Component)this).transform.localScale = initialSpawnScale; MaxGrowthSize = (float)enemyRandom.NextDouble() * (maxGrowth - minGrowth) + minGrowth; currentUrchinCount++; if (((NetworkBehaviour)this).IsHost) { if (UrchinColorRandom == null) { UrchinColorRandom = new Random(StartOfRound.Instance.randomMapSeed); } ((MonoBehaviour)this).StartCoroutine(CheckScaleToSpawnBabies()); UrchinColorSyncClientRpc((float)UrchinColorRandom.NextDouble()); } } [ClientRpc] public void UrchinColorSyncClientRpc(float urchinColor) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(391237029u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref urchinColor, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 391237029u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Renderer)base.meshRenderers[0]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(urchinColor)); ((Renderer)base.meshRenderers[1]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(urchinColor)); ((Renderer)base.meshRenderers[2]).materials[0].SetColor(ColorProperty, UrchinColorGradient.Evaluate(urchinColor)); } } } public override void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); timeSinceHittingLocalPlayer += Time.deltaTime; if (((Component)this).transform.localScale.x < MaxGrowthSize && base.currentBehaviourStateIndex != 2) { float num = growthrate * Time.deltaTime; num *= (float)enemyRandom.NextDouble() * 0.29999995f + 0.85f; Transform transform = ((Component)this).transform; transform.localScale += new Vector3(num, num, num); progressToMaxGrowth = (((Component)this).transform.localScale.x - 1f) / (MaxGrowthSize - 1f); float num2 = progressToMaxGrowth; if (num2 >= 0.8f) { if (num2 < 1f && !upgradesByHealth[4]) { upgradesByHealth[4] = true; } } else if (!(num2 >= 0.6f)) { if (!(num2 >= 0.4f)) { if (!(num2 >= 0.2f)) { if (num2 >= 0f && !upgradesByHealth[0]) { upgradesByHealth[0] = true; } } else if (!upgradesByHealth[1]) { upgradesByHealth[1] = true; } } else if (!upgradesByHealth[2]) { upgradesByHealth[2] = true; } } else if (!upgradesByHealth[3]) { upgradesByHealth[3] = true; } } switch (base.currentBehaviourStateIndex) { case 0: timeSinceMoving += Time.deltaTime; break; case 1: timeSinceIdle += Time.deltaTime; break; case 2: if (deathAnimationCoroutine == null) { deathAnimationCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateDeath()); if (((NetworkBehaviour)this).IsHost) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } break; } } public void OnTriggerStay(Collider other) { DeadBodyInfo component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (deadBodiesAttached == null || !deadBodiesAttached.Contains(component))) { StickBodyToSpikes(component); } } private void StickBodyToSpikes(DeadBodyInfo body) { if (deadBodiesAttached == null) { deadBodiesAttached = new List(); } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!((NetworkBehaviour)this).IsHost || base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: PlayFootstepSound(); base.agent.speed = 0.7f; if (timeSinceMoving > 30f) { timeSinceMoving = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: base.agent.speed = 0f; if (timeSinceIdle > 25f) { timeSinceIdle = 0f; Wander(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 2: base.agent.speed = 0f; break; } } private void PlayFootstepSound() { if (Time.time >= nextPlayTime) { base.creatureSFX.PlayOneShot(FootstepSoundClip, 0.1f); base.creatureSFX.pitch = Random.Range(0.9f, 1.1f); nextPlayTime = Time.time + footstepPlayInterval; } } private void Wander() { //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; allPlayerScripts = allPlayerScripts.OrderBy((PlayerControllerB x) => Vector3.Distance(((Component)this).transform.position, ((Component)x).transform.position)).ToArray(); NavMeshHit val = default(NavMeshHit); for (int i = 0; i < allPlayerScripts.Length; i++) { if (!((Object)(object)allPlayerScripts[i] != (Object)null)) { continue; } bool flag = false; flag = ((!Plugin.BoundConfig.UrchinAggressive.Value) ? (Random.Range(0f, 1f) <= 0.25f) : (Random.Range(0f, 1f) <= 0.75f)); if (!(!allPlayerScripts[i].isInsideFactory && ((EnemyAI)this).PlayerIsTargetable(allPlayerScripts[i], false, false, true) && flag)) { continue; } for (int j = 0; j <= 4; j++) { if (NavMesh.SamplePosition(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)allPlayerScripts[i]).transform.position, math.max((float)wanderRadius, Plugin.BoundConfig.UrchinShipPadding.Value + 5f), default(NavMeshHit)), ref val, (float)wanderRadius, -1)) { wanderTarget = ((NavMeshHit)(ref val)).position; if (!((Bounds)(ref PaddedShipBounds)).Contains(wanderTarget) && ((EnemyAI)this).SetDestinationToPosition(wanderTarget, true)) { return; } } } } NavMeshHit val2 = default(NavMeshHit); for (int k = 0; k <= 10; k++) { if (NavMesh.SamplePosition(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, (float)wanderRadius, default(NavMeshHit)), ref val2, (float)(wanderRadius * 5), -1)) { wanderTarget = ((NavMeshHit)(ref val2)).position; if (!((Bounds)(ref PaddedShipBounds)).Contains(wanderTarget)) { ((EnemyAI)this).SetDestinationToPosition(wanderTarget, false); break; } } } } [IteratorStateMachine(typeof(d__41))] private IEnumerator AnimateDeath() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__41(0) { <>4__this = this }; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (base.enemyHP > 1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, true, hitID); } else { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false, hitID); } base.enemyHP -= force; if (base.enemyHP > 0 || base.currentBehaviourStateIndex == 2) { return; } if ((double)((Component)this).transform.localScale.x > 3.0 && currentUrchinCount < base.enemyType.MaxCount) { if (((NetworkBehaviour)this).IsHost) { ((Component)this).transform.localScale = new Vector3(2f, 2f, 2f); RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)this).transform.position, 4f, default(NavMeshHit), new Random(), -1, 1f), ((Component)this).transform.rotation.y, -1, base.enemyType); SyncTransformScaleClientRpc(((Component)this).transform.localScale); base.creatureSFX.volume = 1f; base.creatureSFX.pitch = Random.Range(0.9f, 1.1f); NetworkAudioSource.PlayOneShot(MitosisSoundClip); } base.enemyHP = 2; upgradesByHealth[0] = false; upgradesByHealth[1] = false; upgradesByHealth[2] = false; upgradesByHealth[3] = false; upgradesByHealth[4] = false; } else { base.creatureSFX.volume = 0.5f; base.creatureSFX.pitch = Random.Range(0.9f, 1.1f); NetworkAudioSource.PlayOneShot(DeathSoundClip); if (((NetworkBehaviour)this).IsHost) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } } public override void OnCollideWithPlayer(Collider other) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer > 1f && base.currentBehaviourStateIndex != 2) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, true); if ((Object)(object)val != (Object)null) { timeSinceHittingLocalPlayer = 0f; UrchinAttackServerRpc(); float x = ((Component)this).transform.localScale.x; float num = Mathf.Lerp(5f, 15f, (x - 1f) / 4f); int num2 = Mathf.RoundToInt(num); val.DamagePlayer(num2, true, true, (CauseOfDeath)14, 0, false, default(Vector3)); } } } [ServerRpc(RequireOwnership = false)] public void UrchinAttackServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(280795300u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 280795300u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UrchinAttackClientRpc(); } } } [ClientRpc] public void UrchinAttackClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2984103314u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2984103314u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(AnimateStabThing()); base.creatureSFX.volume = 1f; base.creatureSFX.pitch = Random.Range(0.9f, 1.1f); base.creatureSFX.maxDistance = 20f; base.creatureSFX.PlayOneShot(PrickSoundClip); } } } [IteratorStateMachine(typeof(d__46))] private IEnumerator AnimateStabThing() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__47))] private IEnumerator CheckScaleToSpawnBabies() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__47(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] private void ResetEnemyHPServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2873937163u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2873937163u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ResetEnemyHPClientRpc(); } } } [ClientRpc] private void ResetEnemyHPClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1109473221u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1109473221u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.enemyHP = 2; } } } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); currentUrchinCount--; } [ClientRpc] private void SyncTransformScaleClientRpc(Vector3 vector) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4247450671u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vector); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4247450671u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Component)this).transform.localScale = vector; } } } public EntranceTeleport FindMainEntrance(bool getOutsideEntrance = false) { EntranceTeleport[] array = Object.FindObjectsOfType(false); for (int i = 0; i < array.Length; i++) { if (array[i].entranceId != 0) { continue; } if (!getOutsideEntrance) { if (!array[i].isEntranceToBuilding) { return array[i]; } } else if (array[i].isEntranceToBuilding) { return array[i]; } } return null; } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(391237029u, new RpcReceiveHandler(__rpc_handler_391237029), "UrchinColorSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(280795300u, new RpcReceiveHandler(__rpc_handler_280795300), "UrchinAttackServerRpc"); ((NetworkBehaviour)this).__registerRpc(2984103314u, new RpcReceiveHandler(__rpc_handler_2984103314), "UrchinAttackClientRpc"); ((NetworkBehaviour)this).__registerRpc(2873937163u, new RpcReceiveHandler(__rpc_handler_2873937163), "ResetEnemyHPServerRpc"); ((NetworkBehaviour)this).__registerRpc(1109473221u, new RpcReceiveHandler(__rpc_handler_1109473221), "ResetEnemyHPClientRpc"); ((NetworkBehaviour)this).__registerRpc(4247450671u, new RpcReceiveHandler(__rpc_handler_4247450671), "SyncTransformScaleClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_391237029(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float urchinColor = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref urchinColor, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).UrchinColorSyncClientRpc(urchinColor); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_280795300(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).UrchinAttackServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2984103314(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).UrchinAttackClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2873937163(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).ResetEnemyHPServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1109473221(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).ResetEnemyHPClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4247450671(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vector = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vector); target.__rpc_exec_stage = (__RpcExecStage)1; ((UrchinAI)(object)target).SyncTransformScaleClientRpc(vector); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "UrchinAI"; } } public static class PluginInfo { public const string PLUGIN_GUID = "Surfaced"; public const string PLUGIN_NAME = "Surfaced"; public const string PLUGIN_VERSION = "1.7.1"; } [GeneratedCode("DawnLib", "0.9.21")] public static class SurfacedEnemyKeys { public static NamespacedKey BellCrab = NamespacedKey.From("surfaced", "bellcrab"); public static NamespacedKey Bruce = NamespacedKey.From("surfaced", "bruce"); public static NamespacedKey Horse = NamespacedKey.From("surfaced", "horse"); public static NamespacedKey MantisShrimp = NamespacedKey.From("surfaced", "mantis_shrimp"); public static NamespacedKey Nemo = NamespacedKey.From("surfaced", "nemo"); public static NamespacedKey Scary = NamespacedKey.From("surfaced", "scary"); public static NamespacedKey Urchin = NamespacedKey.From("surfaced", "urchin"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(SurfacedEnemyKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.9.21")] public static class SurfacedItemKeys { public static NamespacedKey BellCrab = NamespacedKey.From("surfaced", "bell_crab"); public static NamespacedKey Blahuce = NamespacedKey.From("surfaced", "blahuce"); public static NamespacedKey PickleOnAStick = NamespacedKey.From("surfaced", "pickle_on_a_stick"); public static NamespacedKey Rodriguez = NamespacedKey.From("surfaced", "rodriguez"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(SurfacedItemKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.9.21")] public static class SurfacedMapObjectKeys { public static NamespacedKey BigBertha = NamespacedKey.From("surfaced", "big_bertha"); public static NamespacedKey OldSeamine = NamespacedKey.From("surfaced", "old_seamine"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(SurfacedMapObjectKeys).GetField(name)?.GetValue(null)); } } } namespace Surfaced.Patches { public static class SurfacedPatches { [CompilerGenerated] private static class <>O { public static hook_PlayerHitGroundEffects <0>__PlayerControllerB_PlayerHitGroundEffects; public static hook_LateUpdate <1>__OnSprayPaintItem_LateUpdate; public static hook_UnloadSceneObjectsEarly <2>__OnRoundManager_UnloadSceneObjectsEarly; } public static Dictionary> playersBeingLaunched = new Dictionary>(); public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_PlayerHitGroundEffects; if (obj == null) { hook_PlayerHitGroundEffects val = PlayerControllerB_PlayerHitGroundEffects; <>O.<0>__PlayerControllerB_PlayerHitGroundEffects = val; obj = (object)val; } PlayerControllerB.PlayerHitGroundEffects += (hook_PlayerHitGroundEffects)obj; object obj2 = <>O.<1>__OnSprayPaintItem_LateUpdate; if (obj2 == null) { hook_LateUpdate val2 = OnSprayPaintItem_LateUpdate; <>O.<1>__OnSprayPaintItem_LateUpdate = val2; obj2 = (object)val2; } SprayPaintItem.LateUpdate += (hook_LateUpdate)obj2; object obj3 = <>O.<2>__OnRoundManager_UnloadSceneObjectsEarly; if (obj3 == null) { hook_UnloadSceneObjectsEarly val3 = OnRoundManager_UnloadSceneObjectsEarly; <>O.<2>__OnRoundManager_UnloadSceneObjectsEarly = val3; obj3 = (object)val3; } RoundManager.UnloadSceneObjectsEarly += (hook_UnloadSceneObjectsEarly)obj3; } private static void OnRoundManager_UnloadSceneObjectsEarly(orig_UnloadSceneObjectsEarly orig, RoundManager self) { orig.Invoke(self); foreach (NetworkObject spawnedPrefab in RodrigoPlush.spawnedPrefabs) { if (spawnedPrefab != null) { spawnedPrefab.Despawn(true); } } } private static void OnSprayPaintItem_LateUpdate(orig_LateUpdate orig, SprayPaintItem self) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!((Object)(object)((GrabbableObject)self).playerHeldBy != (Object)null) || !self.isSpraying || !self.isWeedKillerSprayBottle) { return; } Vector3 val = ((Component)((GrabbableObject)self).playerHeldBy.gameplayCamera).transform.position - ((Component)((GrabbableObject)self).playerHeldBy.gameplayCamera).transform.forward * 0.7f; int num = 1 << LayerMask.NameToLayer("Enemies"); RaycastHit[] array = Physics.RaycastAll(val, ((Component)((GrabbableObject)self).playerHeldBy.gameplayCamera).transform.forward, ((GrabbableObject)self).playerHeldBy.grabDistance, num); bool flag = false; RaycastHit val2 = default(RaycastHit); RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if (((Component)((RaycastHit)(ref val3)).collider).gameObject.layer == LayerMask.NameToLayer("Enemies") && ((Component)((RaycastHit)(ref val3)).collider).gameObject.CompareTag("Enemy")) { flag = true; val2 = val3; break; } } if (flag) { GameObject gameObject = ((Component)TryFindRoot(((Component)((RaycastHit)(ref val2)).collider).gameObject.transform)).gameObject; EnemyAI val4 = default(EnemyAI); if (gameObject.CompareTag("Enemy") && gameObject.layer == LayerMask.NameToLayer("Enemies") && gameObject.TryGetComponent(ref val4) && val4 is UrchinAI) { Transform transform = gameObject.transform; transform.localScale += Vector3.one * 5f * Time.deltaTime; } } } private static void PlayerControllerB_PlayerHitGroundEffects(orig_PlayerHitGroundEffects orig, PlayerControllerB self) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (playersBeingLaunched.Keys.Count > 0) { foreach (HorseAI key in playersBeingLaunched.Keys) { if (playersBeingLaunched[key].Contains(self)) { key.isLaunching = false; key.launchingPlayerController = null; key.launchTimer = 0f; playersBeingLaunched[key].Remove(self); self.ResetFallGravity(); switch (key.launchForceIndex) { case 0: Plugin.Logger.LogInfo((object)"Horse launched with low power"); break; case 1: Plugin.Logger.LogInfo((object)"Horse launched with medium power"); self.DamagePlayer(10, true, false, (CauseOfDeath)2, 0, false, default(Vector3)); break; case 2: Plugin.Logger.LogInfo((object)"Horse launched with high power"); self.DamagePlayer(20, true, false, (CauseOfDeath)2, 0, false, default(Vector3)); break; } Plugin.Logger.LogInfo((object)"Player being launched removed from horse list"); } } } orig.Invoke(self); } public static Transform? TryFindRoot(Transform child) { if ((Object)(object)((Component)child).GetComponent() != (Object)null) { return child; } NetworkObject componentInParent = ((Component)child).GetComponentInParent(); if (componentInParent == null) { return null; } return ((Component)componentInParent).transform; } } [HarmonyPatch(typeof(PlayerControllerB))] internal static class PlayerControllerBPatches { [HarmonyPatch("Discard_performed")] [HarmonyPrefix] public static bool Discard_performed(PlayerControllerB __instance) { if ((Object)(object)__instance.inAnimationWithEnemy != (Object)null && __instance.inAnimationWithEnemy is BellCrabAI) { BellCrabAI bellCrabAI = __instance.inAnimationWithEnemy as BellCrabAI; if (bellCrabAI.isAttached && (Object)(object)bellCrabAI.playerHoldingCrab != (Object)null && (Object)(object)bellCrabAI.playerHoldingCrab == (Object)(object)GameNetworkManager.Instance.localPlayerController) { bellCrabAI.DropCrabServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, GameNetworkManager.Instance.localPlayerController)); return false; } } return true; } } } namespace Surfaced.Configuration { public class PluginConfig { public ConfigEntry BruceSmallRangeHealthThreshold; public ConfigEntry BruceSmallRange; public ConfigEntry BruceMediumRangeHealthThreshold; public ConfigEntry BruceMediumRange; public ConfigEntry BruceBigRangeHealthThreshold; public ConfigEntry BruceBigRange; public ConfigEntry BrucePickleRange; public ConfigEntry BruceBlahaj; public ConfigEntry MantisGroupSize; public ConfigEntry UrchinGrowthRate; public ConfigEntry UrchinMaxGrowth; public ConfigEntry UrchinMinGrowth; public ConfigEntry UrchinAggressive; public ConfigEntry UrchinShipPadding; public ConfigEntry BellCrabDamageValue; public ConfigEntry BuffTimerMin; public ConfigEntry BuffTimerMax; public ConfigEntry DebuffChance; public ConfigEntry SeamineSoundMin; public ConfigEntry SeamineSoundMax; public ConfigEntry ScarySoundMin; public ConfigEntry ScarySoundMax; public ConfigEntry ClownHornHealth; public ConfigEntry SqueezeEnable; public ConfigEntry KillEnemies; public ConfigEntry Range1; public ConfigEntry Range2; public ConfigEntry Range3; public ConfigEntry Knockbackmultiplier; public ConfigEntry BerthaTimer; public PluginConfig(ConfigFile cfg) { BruceSmallRangeHealthThreshold = cfg.Bind("Bruce Option", "Small Range, Health Threshold", 80, "The small range will be activated if a player's health is below the number in this config."); BruceSmallRange = cfg.Bind("Bruce Option", "Small Detection Range", 60f, "How far Bruce will chase a player if their health is under the Small range threshold"); BruceMediumRangeHealthThreshold = cfg.Bind("Bruce Option", "Medium Range, Health Threshold", 50, "The Medium range will be activated if a player's health is below the number in this config."); BruceMediumRange = cfg.Bind("Bruce Option", "Medium Detection Range", 80f, "How far Bruce will chase a player if their health is under the Medium range threshold"); BruceBigRangeHealthThreshold = cfg.Bind("Bruce Option", "Big Range, Health Threshold", 20, "The Big range will be activated if a player's health is below the number in this config."); BruceBigRange = cfg.Bind("Bruce Option", "Big Detection Range", 120f, "How far Bruce will chase a player if their health is under the Big range threshold"); BrucePickleRange = cfg.Bind("Bruce Option", "Bruce Pickle Range", 16f, "How far Bruce will follow a pickle on a stick"); BruceBlahaj = cfg.Bind("Bruce Option", "Bruce Blahajified", false, "Make bruce blahajified"); MantisGroupSize = cfg.Bind("Mantis Shrimp Options", "Mantis Shrimp Spawn Group Size", 1, "The number of Mantis Shrimp that spawn along side the first one. This number + 1 = Total Shrimp."); SeamineSoundMin = cfg.Bind("Seamine Options", "Seamine Sound Minimum Time", 10, "The min amount of seconds before a Seamine beeps."); SeamineSoundMax = cfg.Bind("Seamine Options", "Seamine Sound Maximum Time", 15, "The max amount of seconds before a Seamine beeps."); Range1 = cfg.Bind("Big Bertha Options", "Instakill through walls radius", 17f, "The distance at which the explosion will kill you even though walls."); Range2 = cfg.Bind("Big Bertha Options", "Instakill Line of sight radius", 45f, "The distance at which the explosion will kill you if you have line of sight with the bomb."); Range3 = cfg.Bind("Big Bertha Options", "Knockback Radius", 95f, "The distance at which the explosion will knock you back if you have line of sight with the bomb."); KillEnemies = cfg.Bind("Big Bertha Options", "Kill Enemies", true, "Should the explosion kill enemies?"); Knockbackmultiplier = cfg.Bind("Big Bertha Options", "Knockback force", 750, "Force of the knockback from the explosion, if this number is too high, it will send players through the map."); BerthaTimer = cfg.Bind("Big Bertha Options", "Bertha Timer", 5f, "How many seconds it takes for a bertha to explode"); UrchinGrowthRate = cfg.Bind("Urchin Options", "Urchin Growth Rate", 0.025f, "Growth per second. Default value results in a split every 2 minutes. Double it for 1 minute. Halve it for 4 minutes. Default:0.025"); UrchinMaxGrowth = cfg.Bind("Urchin Options", "Urchin Max Growth", 7f, "Urchin Maximum Size to reach before splitting."); UrchinMinGrowth = cfg.Bind("Urchin Options", "Urchin Min Growth", 4f, "Urchin Minimum Size to reach before splitting."); UrchinShipPadding = cfg.Bind("Urchin Options", "Urchin Ship Bounds in Meters", 2f, "Expands the Ship Bounds Urchins consider when picking a destination. Urchins are not allowed to pick a destination within the ship bounds. Will NOT prevent them from pathing thru to get to their destination or pushing each other inside the bounds. Expanding this should lessen the speed at which they swarm the ship. Default:2.0"); UrchinAggressive = cfg.Bind("Urchin Options", "Urchin Aggressive", true, "If True, Urchins will be more aggressive and target players more leading to more clumping behaviour."); BellCrabDamageValue = cfg.Bind("Bell Crab Options", "Bell Crab Damage Value", 10, "The amount of damage you will take when a Bell Crab snips you."); ClownHornHealth = cfg.Bind("Clown Horn Fish Options", "ClownHornFish Health", 2, "How many hits it takes to kill the Doot doot fish."); SqueezeEnable = cfg.Bind("Clown Horn Fish Options", "Enable Squeeze", true, "Enable the ability to squeeze the Clownhorn fish"); BuffTimerMin = cfg.Bind("Clown Horn Fish Options", "ClownHornFish Min Timer", 20, "How many seconds, minimum it takes for the clownfish to buff"); BuffTimerMax = cfg.Bind("Clown Horn Fish Options", "ClownHornFish Max Timer", 60, "How many seconds, maximum it takes for the clownfish to buff"); DebuffChance = cfg.Bind("Clown Horn Fish Options", "ClownHornFish Debuff chance", 15, "Chance for the clownhorn fish to give a debuff, goes from 0 to 100"); ScarySoundMin = cfg.Bind("Super Scary Mode Options", "Scary Minimum sound time", 10, "The min amount of seconds before Scary spooks."); ScarySoundMax = cfg.Bind("Super Scary Mode Options", "Scary Maximum sound time", 30, "The max amount of seconds before a Scary spooks."); ClearUnusedEntries(cfg); } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary dictionary = (Dictionary)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace Surfaced.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }