Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of JPOGStegosaurus v1.0.5
plugins/JPOGStegosaurus.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
#define DEBUG using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using JPOGStegosaurus.Configuration; using JPOGStegosaurus.NetcodePatcher; using Microsoft.CodeAnalysis; using Unity.Collections; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("JPOGStegosaurus")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.5.0")] [assembly: AssemblyInformationalVersion("1.0.5+f27b4009feccbf6adc9943c8d027acb3f7d80c11")] [assembly: AssemblyProduct("JPOGStegosaurus")] [assembly: AssemblyTitle("JPOGStegosaurus")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.5.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; } } } namespace JPOGStegosaurus { internal class JPOGStegosaurusAI : EnemyAI, IVisibleThreat { private enum State { Roaming, AttackEnemy, ChasingTarget, RunningAway, Stunned, SpecialAttack, Idling } [CompilerGenerated] private sealed class <>c__DisplayClass130_0 { public PlayerControllerB killPlayer; } [CompilerGenerated] private sealed class <>c__DisplayClass130_1 { public float startTime; public <>c__DisplayClass130_0 CS$<>8__locals1; internal bool <KillPlayer>b__0() { return (Object)(object)CS$<>8__locals1.killPlayer.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 2f; } } [CompilerGenerated] private sealed class <BeginSpecialTailAnimation>d__103 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginSpecialTailAnimation>d__103(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_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Beginning Special tail attack animation!"); <>4__this.DoAnimationClientRpc("tailFrontalAttack"); <>2__current = (object)new WaitForSeconds(5.7f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Special tail attack complete!"); <>4__this.inSpecialTailAttack = false; <>4__this.tailHitPlayerIds.Clear(); 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 <BeginSpecialTailAttack>d__99 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginSpecialTailAttack>d__99(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; } else { <>1__state = -1; if (<>4__this.CheckIfInAttackAnimation()) { goto IL_0099; } <>4__this.inSpecialTailAttack = true; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.BeginSpecialTailAnimation()); } if (<>4__this.inSpecialTailAttack) { <>4__this.CheckIfTailAttackHitPlayersClientRpc(); <>4__this.CheckIfTailAttackHitEntitiesClientRpc(); <>2__current = null; <>1__state = 1; return true; } goto IL_0099; IL_0099: ((Component)<>4__this).transform.rotation = Quaternion.Euler(0f, 0f, 0f); <>4__this.readyToChaseFromSpecialAttack = 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 <BeginSpecialTailAttackOnEntity>d__102 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginSpecialTailAttackOnEntity>d__102(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((EnemyAI)<>4__this).agent.speed = 0f; <>4__this.SetWalkingAnimtionServerRpc(((EnemyAI)<>4__this).agent.speed); if (!<>4__this.CheckIfInAttackAnimation()) { <>4__this.inSpecialTailAttack = true; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.BeginSpecialTailAnimation()); <>2__current = (object)new WaitForSeconds(5.5f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; ((EnemyAI)<>4__this).agent.speed = 3f; <>4__this.SetWalkingAnimtionServerRpc(((EnemyAI)<>4__this).agent.speed); 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 <BeginStompAnimation>d__105 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginStompAnimation>d__105(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.DoAnimationClientRpc("stompAttack"); <>2__current = (object)new WaitForSeconds(2.2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inStompAttack = 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 <BeginStompAttack>d__104 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginStompAttack>d__104(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!<>4__this.CheckIfInAttackAnimation()) { <>4__this.inStompAttack = true; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.BeginStompAnimation()); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; goto IL_00b7; case 2: { <>1__state = -1; goto IL_00b7; } IL_00b7: if (<>4__this.inStompAttack) { <>4__this.CheckIfStompAttackHitPlayersClientRpc(); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 2; return true; } if ((Object)(object)<>4__this.targetEntiy != (Object)null) { <>4__this.targetEntiy.HitEnemy(5, (PlayerControllerB)null, true, -1); <>4__this.targetEntiy = null; } break; } <>4__this.stompHitPlayerIds.Clear(); 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 <BeginStunAnimation>d__61 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginStunAnimation>d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.DoAnimationClientRpc("stunEnemy"); <>2__current = (object)new WaitForSeconds(2.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inStunAnimation = 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 <BeginTailAttack>d__106 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginTailAttack>d__106(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!<>4__this.CheckIfInAttackAnimation()) { <>4__this.inTailAttack = true; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.BeginTailAttackAnimation()); <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; goto IL_00b7; case 2: { <>1__state = -1; goto IL_00b7; } IL_00b7: if (<>4__this.inTailAttack) { <>4__this.CheckIfTailAttackHitPlayersClientRpc(); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 2; return true; } break; } <>4__this.tailHitPlayerIds.Clear(); 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 <BeginTailAttackAnimation>d__107 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BeginTailAttackAnimation>d__107(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.DoAnimationClientRpc("tailAttack"); <>2__current = (object)new WaitForSeconds(2.8f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inTailAttack = 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 <KillPlayer>d__130 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ulong playerId; public CauseOfDeath causeOfDeath; public JPOGStegosaurusAI <>4__this; private <>c__DisplayClass130_0 <>8__1; private <>c__DisplayClass130_1 <>8__2; private Quaternion <rotateTo>5__3; private Quaternion <rotateFrom>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillPlayer>d__130(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>8__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Invalid comparison between Unknown and I4 //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_012f: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass130_0(); <>4__this.LogIfDebugBuild("JPOGStegosaurus: begin Killing hit player(s)"); <>8__1.killPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)<>8__1.killPlayer == (Object)null || <>8__1.killPlayer.isPlayerDead) { <>4__this.LogIfDebugBuild($"JPOGStegosaurus: Player [{playerId}] is not valid or already dead."); return false; } if (!((EnemyAI)<>4__this).isEnemyDead) { <>8__2 = new <>c__DisplayClass130_1(); <>8__2.CS$<>8__locals1 = <>8__1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Stegosaurus is still alive, killing player Continues"); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)<>8__2.CS$<>8__locals1.killPlayer) { <>8__2.CS$<>8__locals1.killPlayer.KillPlayer(Vector3.zero, true, causeOfDeath, 0, default(Vector3), false); } <>8__2.startTime = Time.timeSinceLevelLoad; <>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)<>8__2.CS$<>8__locals1.killPlayer.deadBody != (Object)null || Time.timeSinceLevelLoad - <>8__2.startTime > 2f)); <>1__state = 1; return true; } break; case 1: <>1__state = -1; if ((Object)(object)<>8__2.CS$<>8__locals1.killPlayer.deadBody == (Object)null) { <>4__this.LogIfDebugBuild("JPOGStegosaurus: Player body was not spawned or found withing 2 seconds"); <>8__2.CS$<>8__locals1.killPlayer.inAnimationWithEnemy = null; return false; } if ((int)<>8__2.CS$<>8__locals1.killPlayer.deadBody.causeOfDeath == 14) { <>4__this.PinBodyToSpikeServerRpc(playerId); } <>8__2.startTime = Time.timeSinceLevelLoad; <rotateTo>5__3 = Quaternion.Euler(new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(((Component)<>4__this).transform.position + Vector3.up * 0.6f, 25f, 6), 0f)); <rotateFrom>5__4 = ((Component)<>4__this).transform.rotation; goto IL_02dc; case 2: { <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsOwner) { ((Component)<>4__this).transform.rotation = Quaternion.RotateTowards(<rotateFrom>5__4, <rotateTo>5__3, 60f * Time.deltaTime); } goto IL_02dc; } IL_02dc: if (Time.timeSinceLevelLoad - <>8__2.startTime < 2f) { <>2__current = null; <>1__state = 2; return true; } <>8__2 = null; 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 <PlayScratchIdle>d__119 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PlayScratchIdle>d__119(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_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Beginning scratch idle"); <>4__this.DoAnimationClientRpc("scratch"); <>2__current = (object)new WaitForSeconds(4.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inRandomIdleAnimation = false; <>4__this.isDoneIdling = 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 <PlayStretchIdle>d__120 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PlayStretchIdle>d__120(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_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Beginning stretch idle"); <>4__this.DoAnimationClientRpc("stretch"); <>2__current = (object)new WaitForSeconds(4.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inRandomIdleAnimation = false; <>4__this.isDoneIdling = 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 <PlayTailShowIdle>d__118 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PlayTailShowIdle>d__118(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_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Beginning tailshow idle"); <>4__this.DoAnimationClientRpc("tailShow"); <>2__current = (object)new WaitForSeconds(3.8f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.inRandomIdleAnimation = false; <>4__this.isDoneIdling = 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 <RoamingStateCoroutine>d__121 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RoamingStateCoroutine>d__121(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Roaming State Coroutine started"); <>2__current = (object)new WaitForSeconds(<>4__this.timeToIdle); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.LogIfDebugBuild("JPOGStegosaurus: Roaming State Coroutine Ended, entering idling state"); ((EnemyAI)<>4__this).SwitchToBehaviourClientRpc(6); 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 <SwingAttack>d__80 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SwingAttack>d__80(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((EnemyAI)<>4__this).SwitchToBehaviourClientRpc(1); <>4__this.StalkPos = ((Component)((EnemyAI)<>4__this).targetPlayer).transform.position; ((EnemyAI)<>4__this).SetDestinationToPosition(<>4__this.StalkPos, false); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (((EnemyAI)<>4__this).isEnemyDead) { return false; } <>4__this.DoAnimationClientRpc("swingAttack"); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.SwingAttackHitClientRpc(); if (((EnemyAI)<>4__this).currentBehaviourStateIndex != 1) { return false; } ((EnemyAI)<>4__this).SwitchToBehaviourClientRpc(1); 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 <checkAggroAndAttackAreas>d__73 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JPOGStegosaurusAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <checkAggroAndAttackAreas>d__73(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (!((EnemyAI)<>4__this).isEnemyDead) { <>4__this.CheckForPlayersInAggroAreaServerRpc(); <>4__this.CheckForPlayersInAttackAreaBackServerRpc(); <>4__this.CheckForPlayersInAttackAreaFrontServerRpc(); <>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(); } } public Transform turnCompass = null; public Transform aggroArea = null; private List<DeadBodyInfo> spikedBodies = new List<DeadBodyInfo>(); public AudioSource tailSFX = null; public Transform tailSpike1 = null; public Transform tailSpike2 = null; public Transform tailSpike3 = null; public Transform tailSpike4 = null; public Transform tailHitBox = null; public Transform stompHitbox = null; public Transform attackAreaFront = null; public Transform attackAreaBack = null; private float timeSinceHittingLocalPlayer; private float timeSinceNewRandPos; private Vector3 positionRandomness; private Vector3 StalkPos; private Random enemyRandom = null; private bool isDeadAnimationDone; private float irritationLevel = 0f; private float irritationMaxLevel; private float irritationIncrementAmount; private float irritationDecrementAmount; private float irritationDecrementinterval; private float lastIrritationDecreaseTime; private State previousState = State.Idling; private bool inRandomIdleAnimation = false; private bool isDoneIdling = false; private float timeToIdle = 30f; private bool inTailAttack; private List<ulong> tailHitPlayerIds = new List<ulong>(); private List<ulong> stompHitPlayerIds = new List<ulong>(); private float lastIrritationIncrementTime; private float irritationIncrementInterval; private bool inStompAttack; private float roamingStartTime; private float movementCheckInterval = 5f; private Vector3 lastPosition; private float movingThreshold = 0.1f; private bool inStunAnimation = false; private bool inSpecialTailAttack; private float stopChaseHeight = 7f; private bool isStunned = false; private bool readyToChaseFromSpecialAttack = false; private Quaternion originalRotation; private bool specialAttackCanHitPlayer = false; private bool specialAttackHasHitPlayer = false; private EnemyAI? targetEntiy; ThreatType IVisibleThreat.type => (ThreatType)3; int IVisibleThreat.SendSpecialBehaviour(int id) { return 0; } int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition) { int num = 0; num = ((base.enemyHP >= 2) ? 5 : 3); if (base.creatureAnimator.GetBool("StartedChase")) { num += 3; } return num; } int IVisibleThreat.GetInterestLevel() { return 0; } Transform IVisibleThreat.GetThreatLookTransform() { return base.eye; } Transform IVisibleThreat.GetThreatTransform() { return ((Component)this).transform; } Vector3 IVisibleThreat.GetThreatVelocity() { //IL_001a: 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_0012: 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_0022: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { return base.agent.velocity; } return Vector3.zero; } float IVisibleThreat.GetVisibility() { if (base.isEnemyDead) { return 0f; } if (base.creatureAnimator.GetBool("StartedChase")) { return 1f; } return 0.75f; } [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //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_008a: Unknown result type (might be due to invalid IL or missing references) AssignConfigVariables(); LogIfDebugBuild("JPOGStegosaurus Spawned"); ((EnemyAI)this).Start(); ((MonoBehaviour)this).StartCoroutine(checkAggroAndAttackAreas()); timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; ((EnemyAI)this).SwitchToBehaviourServerRpc(0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { ((EnemyAI)this).Update(); if (base.isEnemyDead) { if (!isDeadAnimationDone) { LogIfDebugBuild("Stopping enemy voice with janky code."); isDeadAnimationDone = true; base.creatureVoice.Stop(); base.creatureVoice.PlayOneShot(base.dieSFX); } } else if (base.enemyHP > 0 || base.isEnemyDead) { timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if (timeSinceNewRandPos >= movementCheckInterval && !inStunAnimation) { timeSinceNewRandPos = 0f; CheckMovementServerRpc(); } if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2 || currentBehaviourStateIndex == 4 || currentBehaviourStateIndex == 5)) { LookAtTargetServerRpc(); } if (base.stunNormalizedTimer > 0f) { isStunned = true; } else { isStunned = false; } } } [ServerRpc(RequireOwnership = false)] private void PlayStunnedAnimationServerRpc() { //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(3641107333u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3641107333u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; inStunAnimation = true; ((MonoBehaviour)this).StartCoroutine(BeginStunAnimation()); } } } [IteratorStateMachine(typeof(<BeginStunAnimation>d__61))] private IEnumerator BeginStunAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginStunAnimation>d__61(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] private void CheckMovementServerRpc() { //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_00cd: 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_00d3: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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(680955357u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 680955357u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 position = ((Component)this).transform.position; if (Vector3.Distance(position, lastPosition) < movingThreshold) { LogIfDebugBuild("JPOGStegosaurus: Not moving, navigating to a new position."); ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).StartSearch(position, (AISearchRoutine)null); } lastPosition = position; } } public override void DoAIInterval() { //IL_009b: 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_00c8: 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) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: StateChangeHelperServerRpc(State.Roaming); if (irritationLevel == irritationMaxLevel) { ((EnemyAI)this).SwitchToBehaviourServerRpc(2); } break; case 1: StateChangeHelperServerRpc(State.AttackEnemy); if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { LogIfDebugBuild("JPOGStegosaurus: Stop Target Player"); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 2: StateChangeHelperServerRpc(State.ChasingTarget); ChasePlayerServerRpc(); if ((Object)(object)base.targetPlayer == (Object)null) { irritationLevel = irritationMaxLevel / 100f * 20f; ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else if (irritationLevel >= 20f) { DecreaseIrritationServerRpc(); } else if (irritationLevel < irritationMaxLevel / 100f * 20f) { LogIfDebugBuild("JPOGStegosaurus: Irritation Level below 20, stopping chase"); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 3: StateChangeHelperServerRpc(State.RunningAway); break; case 6: StateChangeHelperServerRpc(State.Idling); if (!inRandomIdleAnimation) { LogIfDebugBuild("JPOGStegosaurus: playing random idle animation"); PlayRandomIdleAnimationClientRpc(); } if (isDoneIdling) { LogIfDebugBuild("JPOGStegosaurus: done playing random idle animation"); isDoneIdling = false; if (irritationLevel == irritationMaxLevel) { ((EnemyAI)this).SwitchToBehaviourServerRpc(2); } else { ((EnemyAI)this).SwitchToBehaviourServerRpc(0); } } break; case 4: StateChangeHelperServerRpc(State.Stunned); if (!isStunned) { LogIfDebugBuild("JPOGStegosaurus: Is No longer stunned attempting to chase the target!"); if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).SwitchToBehaviourServerRpc(2); break; } irritationLevel = irritationMaxLevel / 100f * 50f; ((EnemyAI)this).SwitchToBehaviourServerRpc(0); } else if (isStunned && !inStunAnimation) { LogIfDebugBuild("JPOGStegosaurus: Is stunned and not in a stun animation, begining stun animation Coroutine"); PlayStunnedAnimationServerRpc(); } break; case 5: StateChangeHelperServerRpc(State.SpecialAttack); if (!specialAttackCanHitPlayer) { ((EnemyAI)this).SwitchToBehaviourServerRpc(2); } else if (readyToChaseFromSpecialAttack) { LogIfDebugBuild($"JPOGStegosaurus: special attack is done = [{readyToChaseFromSpecialAttack}] checking if the target is still !null "); if (specialAttackHasHitPlayer) { readyToChaseFromSpecialAttack = false; specialAttackHasHitPlayer = false; irritationLevel = irritationMaxLevel / 100f * 40f; specialAttackCanHitPlayer = false; ((EnemyAI)this).SwitchToBehaviourServerRpc(0); } else if ((Object)(object)base.targetPlayer != (Object)null) { readyToChaseFromSpecialAttack = false; specialAttackHasHitPlayer = false; specialAttackCanHitPlayer = false; ((EnemyAI)this).SwitchToBehaviourServerRpc(2); } else { irritationLevel = irritationMaxLevel / 100f * 40f; specialAttackCanHitPlayer = false; ((EnemyAI)this).SwitchToBehaviourServerRpc(0); } } else if (!CheckIfInAttackAnimation()) { LogIfDebugBuild($"JPOGStegosaurus: special attack is done = [{readyToChaseFromSpecialAttack}] starting the special attack"); if ((Object)(object)base.targetPlayer != (Object)null) { LookAtTargetServerRpc(); PerformSpecialTailAttackServerRpc(); } } break; default: LogIfDebugBuild("JPOGStegosaurus: This Behavior State doesn't exist!"); break; } } [ServerRpc(RequireOwnership = false)] private void CheckIfSpecialAttackCanHitPlayerServerRpc() { //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(2887578632u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2887578632u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckIfSpecialAttackCanHitPlayer(); } } } private void CheckIfSpecialAttackCanHitPlayer() { //IL_001a: 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) if (!((Object)(object)base.targetPlayer == (Object)null)) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position); if (num <= 10f) { specialAttackCanHitPlayer = true; } else { specialAttackCanHitPlayer = false; } } } [ServerRpc(RequireOwnership = false)] private void ChasePlayerServerRpc() { //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_01dc: 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(2766208683u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2766208683u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; bool flag = false; if ((Object)(object)base.targetPlayer != (Object)null && !CheckIfPlayerIsTargetable(base.targetPlayer)) { LogIfDebugBuild("Current target player " + ((Object)base.targetPlayer).name + " is no longer targetable."); base.targetPlayer = null; } if ((Object)(object)base.targetPlayer == (Object)null) { flag = ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 100f, false, false, true); if ((Object)(object)base.targetPlayer != (Object)null) { if (flag && CheckIfPlayerIsTargetable(base.targetPlayer)) { LogIfDebugBuild("New target found: " + ((Object)base.targetPlayer).name + ". Chasing."); } else { LogIfDebugBuild("New found target [" + ((Object)base.targetPlayer).name + "] was not valid, setting targetPlayer to null"); base.targetPlayer = null; } } } if ((Object)(object)base.targetPlayer != (Object)null) { ChasePlayerClientRpc(((Component)base.targetPlayer).transform.position); } else if (!flag || (Object)(object)base.targetPlayer == (Object)null) { irritationLevel = irritationMaxLevel / 100f * 20f; LogIfDebugBuild("No valid target found."); } } [ClientRpc] private void ChasePlayerClientRpc(Vector3 targetPosition) { //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_00d5: 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(2890294529u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2890294529u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).SetDestinationToPosition(targetPosition, false); } } } private bool CheckIfPlayerIsTargetable(PlayerControllerB player) { bool result = false; if ((Object)(object)player != (Object)null) { if (player.isInHangarShipRoom || player.isClimbingLadder || player.isPlayerDead || player.inVehicleAnimation) { LogIfDebugBuild($"JPOGStegosaurus: player[{player.actualClientId}] is not targetable"); result = false; } else { LogIfDebugBuild($"JPOGStegosaurus: player[{player.actualClientId}] is targetable"); result = true; } } return result; } private bool CheckHeightDifference() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) bool result = false; if ((Object)(object)base.targetPlayer != (Object)null) { float num = Mathf.Abs(((Component)this).transform.position.y - ((Component)base.targetPlayer).transform.position.y); if (num < stopChaseHeight) { result = true; } else { LogIfDebugBuild("JPOGStegosaurus: TargetPlayer is too high to reach!"); } } return result; } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0054: 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) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f, false, false, true); range = senseRange; } return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } private bool TargetClosestPlayerInAnyCase() { //IL_001f: 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) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; 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]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private void StickingInFrontOfPlayer() { //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) //IL_00a5: 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_00c9: 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_00d3: 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) //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_00eb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner && timeSinceNewRandPos > 0.7f) { timeSinceNewRandPos = 0f; if (enemyRandom.Next(0, 5) == 0) { ((MonoBehaviour)this).StartCoroutine(SwingAttack()); } else { positionRandomness = new Vector3((float)enemyRandom.Next(-2, 2), 0f, (float)enemyRandom.Next(-2, 2)); StalkPos = ((Component)base.targetPlayer).transform.position - Vector3.Scale(new Vector3(-5f, 0f, -5f), ((Component)base.targetPlayer).transform.forward) + positionRandomness; } ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } [IteratorStateMachine(typeof(<checkAggroAndAttackAreas>d__73))] private IEnumerator checkAggroAndAttackAreas() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <checkAggroAndAttackAreas>d__73(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] private void CheckForEntitiesInAggroRangeServerRpc() { //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(2733064149u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2733064149u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForEntitiesInAggroRangeClientRpc(); } } } [ClientRpc] private void CheckForEntitiesInAggroRangeClientRpc() { //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(30543906u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 30543906u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForEntitiesInAggroRange(); } } } private void CheckForEntitiesInAggroRange() { //IL_00e6: 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) if ((Object)(object)targetEntiy != (Object)null || base.currentBehaviourStateIndex != 0) { return; } foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { LogIfDebugBuild("JPOGStegosaurus: own type = [" + ((Object)base.enemyType).name + "] entity enemy type = [" + ((Object)spawnedEnemy.enemyType).name + "]"); if (((Object)base.enemyType).name.Equals(((Object)spawnedEnemy.enemyType).name) || spawnedEnemy.isEnemyDead || !spawnedEnemy.enemyType.canDie) { LogIfDebugBuild("JPOGStegosaurus: entity is a stegosaurus, already dead or cannot die"); continue; } float num = Vector3.Distance(((Component)spawnedEnemy).transform.position, ((Component)this).transform.position); LogIfDebugBuild($"JPOGStegosaurus: [{((Object)spawnedEnemy.enemyType).name}] distance = [{num}]"); if (num <= 10f) { targetEntiy = spawnedEnemy; LookAtTargetEntityServerRpc(); ((EnemyAI)this).SwitchToBehaviourServerRpc(5); } } } [ServerRpc(RequireOwnership = false)] private void LookAtTargetEntityServerRpc() { //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(2295700574u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2295700574u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LookAtTargetEntityClientRpc(); } } } [ClientRpc] private void LookAtTargetEntityClientRpc() { //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(1440074249u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1440074249u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LookAtTargetEntity(); } } } private void LookAtTargetEntity() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetEntiy != (Object)null) { turnCompass.LookAt(((Component)targetEntiy).transform.position); } } [IteratorStateMachine(typeof(<SwingAttack>d__80))] private IEnumerator SwingAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SwingAttack>d__80(0) { <>4__this = this }; } public override void OnCollideWithPlayer(Collider other) { //IL_004c: 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) if (!(timeSinceHittingLocalPlayer < 1f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { LogIfDebugBuild("JPOGStegosaurus: Collision with Player!"); timeSinceHittingLocalPlayer = 0f; val.DamagePlayer(20, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy) { if (base.isEnemyDead || (Object)(object)collidedEnemy == (Object)null || collidedEnemy.isEnemyDead || !collidedEnemy.enemyType.canDie) { return; } ((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy); if ((Object)(object)collidedEnemy.enemyType != (Object)(object)base.enemyType) { LogIfDebugBuild("JPOGStegosaurus: Collision with [" + collidedEnemy.enemyType.enemyName + "]!"); if (!base.inSpecialAnimation && !inStompAttack && !inSpecialTailAttack) { targetEntiy = collidedEnemy; LookAtTargetEntityServerRpc(); ((MonoBehaviour)this).StartCoroutine(BeginStompAttack()); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !base.isEnemyDead) { ((MonoBehaviour)this).StopCoroutine(checkAggroAndAttackAreas()); base.agent.speed = 0f; SetWalkingAnimtionClientRpc(base.agent.speed); SetWalkingAnimtionServerRpc(base.agent.speed); DoAnimationClientRpc("stopTail"); ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else if ((Object)(object)playerWhoHit != (Object)null && base.currentBehaviourStateIndex != 2) { irritationLevel = irritationMaxLevel; base.targetPlayer = playerWhoHit; ((EnemyAI)this).SwitchToBehaviourServerRpc(5); } } } [ServerRpc(RequireOwnership = false)] private void PerformSpecialTailAttackServerRpc() { //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_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) 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(2863341794u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2863341794u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; readyToChaseFromSpecialAttack = false; originalRotation = ((Component)this).transform.rotation; ((MonoBehaviour)this).StartCoroutine(BeginSpecialTailAttack()); } } } [ServerRpc(RequireOwnership = false)] public void LookAtTargetServerRpc() { //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(3034550381u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3034550381u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LookAtTargetClientRpc(); } } } [ClientRpc] public void LookAtTargetClientRpc() { //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_00eb: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_010f: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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) 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(251069385u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 251069385u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)base.targetPlayer != (Object)null) { Vector3 position = ((Component)base.targetPlayer.gameplayCamera).transform.position; Vector3 val3 = position - ((Component)this).transform.position; val3.y = 0f; Quaternion val4 = Quaternion.LookRotation(val3); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val4, 4f * Time.deltaTime); turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB? setStunnedByPlayer = null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); ((EnemyAI)this).SwitchToBehaviourServerRpc(4); if ((Object)(object)setStunnedByPlayer != (Object)null) { irritationLevel = irritationMaxLevel; base.targetPlayer = setStunnedByPlayer; } } [ServerRpc(RequireOwnership = false)] private void CheckForPlayersInAggroAreaServerRpc() { //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(964536497u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 964536497u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForPlayersInAggroAreaClientRpc(); } } } [ClientRpc] private void CheckForPlayersInAggroAreaClientRpc() { //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(726981742u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 726981742u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForPlayersInAggroArea(); } } } private void CheckForPlayersInAggroArea() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) int num = 8; Collider[] array = Physics.OverlapBox(aggroArea.position, aggroArea.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel) { LogIfDebugBuild($"JPOGStegosaurus: player: [{val2.actualClientId}] was in the Aggro Area "); IncreaseIrritationServerRpc(); if (irritationLevel == irritationMaxLevel) { base.targetPlayer = val2; break; } } } } [ServerRpc(RequireOwnership = false)] private void CheckForPlayersInAttackAreaFrontServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2127433461u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2127433461u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if (CheckForPlayersInAttackAreaFront() && (!inStompAttack || !inTailAttack) && currentBehaviourStateIndex == 2) { ((MonoBehaviour)this).StartCoroutine(BeginStompAttack()); } } } private bool CheckForPlayersInAttackAreaFront() { //IL_000b: 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_001b: Unknown result type (might be due to invalid IL or missing references) bool result = false; int num = 8; Collider[] array = Physics.OverlapBox(attackAreaFront.position, attackAreaFront.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel) { LogIfDebugBuild($"JPOGStegosaurus: player: [{val2.actualClientId}] was in Frontal Attack Area "); IncreaseIrritationServerRpc(); } } result = true; } return result; } [ServerRpc(RequireOwnership = false)] private void CheckForPlayersInAttackAreaBackServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2525905385u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2525905385u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (CheckForPlayersInAttackAreaBack()) { LogIfDebugBuild("JPOGStegosaurus: player was in Back attack area, Calling Coroutine to begin tail attack!"); if (!inStompAttack || !inTailAttack) { ((MonoBehaviour)this).StartCoroutine(BeginTailAttack()); } IncreaseIrritationServerRpc(); } } private bool CheckForPlayersInAttackAreaBack() { //IL_000b: 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_001b: Unknown result type (might be due to invalid IL or missing references) bool result = false; int num = 8; Collider[] array = Physics.OverlapBox(attackAreaBack.position, attackAreaBack.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel) { LogIfDebugBuild($"JPOGStegosaurus: player: [{val2.actualClientId}] was in Back Attack Area "); IncreaseIrritationServerRpc(); } } result = true; } return result; } [ClientRpc] private void CheckIfStompAttackHitPlayersClientRpc() { //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(1998934567u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1998934567u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckIfStompAttackHitPlayers(); } } } private void KillPlayerByStomp(ulong playerId) { ((MonoBehaviour)this).StartCoroutine(KillPlayer(playerId, (CauseOfDeath)8)); } private void CheckIfStompAttackHitPlayers() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) int num = 8; Collider[] array = Physics.OverlapBox(stompHitbox.position, stompHitbox.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && CheckIfPlayerIsTargetable(val2)) { LogIfDebugBuild($"JPOGStegosaurus: Player[{val2.actualClientId}] was hit by stomp attack"); stompHitPlayerIds.Add(val2.actualClientId); KillPlayerByStomp(val2.actualClientId); LogIfDebugBuild($"JPOGStegosaurus: Checking if player[{val2.actualClientId}] has not yet been hit"); } else { LogIfDebugBuild("JPOGStegosaurus: PlayerControllerB is null or player does not meet collision conditions"); } } } private bool CheckIfInAttackAnimation() { bool result = true; if (!inSpecialTailAttack && !inStompAttack && !inTailAttack) { result = false; } return result; } [IteratorStateMachine(typeof(<BeginSpecialTailAttack>d__99))] private IEnumerator BeginSpecialTailAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginSpecialTailAttack>d__99(0) { <>4__this = this }; } [ClientRpc] private void CheckIfTailAttackHitEntitiesClientRpc() { //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(3564157189u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3564157189u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckIfTailAttackHitEntities(); } } } private void CheckIfTailAttackHitEntities() { //IL_0060: 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) foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)base.enemyType).name.Equals(((Object)spawnedEnemy.enemyType).name) && !spawnedEnemy.isEnemyDead && !spawnedEnemy.enemyType.canDie) { float num = Vector3.Distance(((Component)spawnedEnemy).transform.position, ((Component)tailSpike1).transform.position); if (num < 5f) { LogIfDebugBuild($"JPOGStegosaurus: entity enemy type = [{((Object)spawnedEnemy.enemyType).name}] will be hit. disatance = [{num}]"); DamageEntity(spawnedEnemy); } } } } [IteratorStateMachine(typeof(<BeginSpecialTailAttackOnEntity>d__102))] private IEnumerator BeginSpecialTailAttackOnEntity() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginSpecialTailAttackOnEntity>d__102(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<BeginSpecialTailAnimation>d__103))] private IEnumerator BeginSpecialTailAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginSpecialTailAnimation>d__103(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<BeginStompAttack>d__104))] private IEnumerator BeginStompAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginStompAttack>d__104(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<BeginStompAnimation>d__105))] private IEnumerator BeginStompAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginStompAnimation>d__105(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<BeginTailAttack>d__106))] private IEnumerator BeginTailAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginTailAttack>d__106(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<BeginTailAttackAnimation>d__107))] private IEnumerator BeginTailAttackAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BeginTailAttackAnimation>d__107(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] private void CheckIfTailAttackHitPlayersServerRpc() { //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(1744835590u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1744835590u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckIfTailAttackHitPlayersClientRpc(); } } } [ClientRpc] private void CheckIfTailAttackHitPlayersClientRpc() { //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(585527103u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 585527103u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckIfTailAttackHitPlayers(); } } } private void CheckIfTailAttackHitPlayers() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) int num = 8; Collider[] array = Physics.OverlapBox(tailHitBox.position, tailHitBox.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && CheckIfPlayerIsTargetable(val2)) { LogIfDebugBuild($"JPOGStegosaurus: Checking if player[{val2.actualClientId}] has not yet been hit"); if (!tailHitPlayerIds.Contains(val2.actualClientId)) { LogIfDebugBuild($"JPOGStegosaurus: Player[{val2.actualClientId}] was hit by tail attack "); tailHitPlayerIds.Add(val2.actualClientId); KillPlayerByTail(val2.actualClientId); } else { LogIfDebugBuild($"JPOGStegosaurus: Player[{val2.actualClientId}] has already been hit"); } } else { LogIfDebugBuild("JPOGStegosaurus: PlayerControllerB is null or player does not meet collision conditions"); } } } [ServerRpc(RequireOwnership = false)] private void CheckIdleTimeServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2485712900u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2485712900u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogIfDebugBuild($"JPOGStegosaurus: Checking if It's idling time. current time - roaming start time = [{Time.time - roamingStartTime}] || timeToIdle = [{timeToIdle}]"); if (Time.time - roamingStartTime >= timeToIdle && isDoneIdling) { LogIfDebugBuild($"JPOGStegosaurus: started roaming at [{roamingStartTime}] time roaming, time to idle = [{timeToIdle}]. Switching to idle state."); ((EnemyAI)this).SwitchToBehaviourServerRpc(6); } } } [ServerRpc(RequireOwnership = false)] private void IncreaseIrritationServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(224280285u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 224280285u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; LogIfDebugBuild($"JPOGStegosaurus: Checking time before increasing irritation. actual time = [{Time.time}] || lastIrritationIncrementTime = [{lastIrritationIncrementTime}] || irritationIncrementInterval = [{irritationIncrementInterval}]"); if (Time.time - lastIrritationIncrementTime >= irritationIncrementInterval && currentBehaviourStateIndex != 2) { irritationLevel = Mathf.Clamp(irritationLevel + irritationIncrementAmount, 0f, irritationMaxLevel); lastIrritationIncrementTime = Time.time; LogIfDebugBuild($"JPOGStegosaurus: IrritationLevel increased to = [{irritationLevel}]"); } } } [ServerRpc(RequireOwnership = false)] private void DecreaseIrritationServerRpc() { //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 compar