Decompiled source of Spiner v1.0.5
SpinerVisual.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using LethalLib.Modules; using Microsoft.CodeAnalysis; using SpinerVisual.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; [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("SpinerVisual")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SpinerVisual")] [assembly: AssemblyTitle("SpinerVisual")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 Spiner { public class SpinerAI : EnemyAI, INoiseListener { public enum SpinerEvent { None, Kidnap, Death, Creep, Detection, Transport, Spin, Roam, Runaway } private enum State { Runaway, Patrol, Stalking, Kidnapping, Transport } [CompilerGenerated] private sealed class <ExitRunawayAfterDelay>d__102 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpinerAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ExitRunawayAfterDelay>d__102(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.ChangeState(State.Patrol); 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(); } } [SerializeField] private AudioSource walkAudioSource = null; [SerializeField] private AudioSource sfxAudioSource = null; [SerializeField] private AudioClip kidnappingSound = null; [SerializeField] private AudioClip moveSound = null; [SerializeField] private AudioClip creepSound = null; [SerializeField] private AudioClip transportSound = null; [SerializeField] private AudioClip runawaySound = null; [SerializeField] private AudioClip detectionSound = null; [SerializeField] private AudioClip deathSound = null; [SerializeField] private AudioClip deathSound2 = null; [SerializeField] private AudioClip deathSound3 = null; [SerializeField] private AudioClip roamingSound = null; [SerializeField] private AudioClip roamingSound2 = null; [SerializeField] private AudioClip roamingSound3 = null; [SerializeField] private AudioClip roamingSound4 = null; [SerializeField] private AudioClip roamingSound5 = null; [SerializeField] private AudioClip roamingSound6 = null; [SerializeField] private AudioClip roamingSound7 = null; public string animStalk = "Stalk"; public string animWalk = "Walk"; public string animAttack = "Attack"; public string animGrab = "Grab"; public string animHurt = "Hurt"; public string animHurt2 = "Hurt2"; public string animHurt3 = "Hurt3"; public string animDeath = "Death"; public string animDeath2 = "Death2"; public string animSpin = "Spin"; public string animSpinTest = "Spintest"; private int spinerBehaviourStateIndex; [SerializeField] public Transform kidnapCarryPoint = null; private Random randomGenerator = new Random(); private bool isRunawayActive = false; private bool isPatrolActive = false; private bool isStalkingActive = false; private bool isKidnappingActive = false; private bool isTransportActive = false; private State previousState = State.Patrol; public float[] playerStealthMeters = new float[4]; public PlayerControllerB chasingPlayer = null; private int stalkingTargetId = -1; private int kidnappingTargetId = -1; private int transportingTargetId = -1; private Vector3 lastLoggedDestination = Vector3.zero; private bool overrideSpeed = false; private bool enableRpcLogging = true; private float transportReleaseTimer = 0f; private const float transportReleaseDelay = 15f; private bool hasReceivedDamageRecently = false; private bool isAvoidingThreat = false; private Vector3 currentAvoidPoint; private int hurtAnimIndex = 0; private int _cfgMaxHP; private float _cfgRoamVolume; private bool _cfgDarkMode; private float _cfgDarkReviveDelay; private float _cfgDarkKillTime; private bool _cfgApplied; private bool _feignDeathActive; private float _feignDeathTimer; private bool _phase2Lethal; private bool _killTimerActive; private float _kidnapKillTimer; private float stalkingMeter = 0f; private float stalkingMeterMax = 15f; private float stalkingMeterIncrement = 1f; private float stalkingMeterDecrement = 0.5f; private const float losCorridorOffset1 = 0.25f; private const float losCorridorOffset2 = 0.5f; private const float losLogInterval = 0.5f; private float _nextLosLogTime_ISee = 0f; private AudioClip _lastClip = null; private float _lastTime; private const float Phase2Pitch = 0.5f; private const float Phase2VolMult = 1f; private float nextLosAvgTime = 0f; private int losSum = 0; private int losCount = 0; private int losScore = 5; private bool stalkingMovementActive = false; private Vector3 stalkingMoveTarget = Vector3.zero; private int stalkingMoveMode = 0; private float _stalkMoveStartTime = 0f; private float _nextStalkMoveDbgTime = 0f; private const float stalkingMeterAbortThreshold = -3f; private float lastLoggedStalkingSecond = -1f; private float kidnappingTimeout = 5f; private float kidnappingTimer = 0f; private string _currentAnimState = ""; private bool _phase2AudioTintApplied = false; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); _feignDeathActive = false; _killTimerActive = false; _phase2Lethal = false; _feignDeathTimer = 0f; _kidnapKillTimer = 0f; if (((NetworkBehaviour)this).IsServer) { string runtimeConfigJson = SpinerPlugin.GetRuntimeConfigJson(); ApplyRuntimeConfigClientRpc(runtimeConfigJson); _cfgMaxHP = SpinerPlugin.MaxHP.Value; _cfgRoamVolume = SpinerPlugin.RoamVolume.Value; _cfgDarkMode = SpinerPlugin.DarkMode.Value; _cfgDarkReviveDelay = SpinerPlugin.DarkReviveDelay.Value; _cfgDarkKillTime = SpinerPlugin.DarkKillTime.Value; _cfgApplied = true; ApplyLocalConfig(); } else { _cfgApplied = false; } } private void ApplyLocalConfig() { if (!_cfgApplied) { _cfgMaxHP = SpinerPlugin.MaxHP.Value; _cfgRoamVolume = SpinerPlugin.RoamVolume.Value; _cfgDarkMode = SpinerPlugin.DarkMode.Value; _cfgDarkReviveDelay = SpinerPlugin.DarkReviveDelay.Value; _cfgDarkKillTime = SpinerPlugin.DarkKillTime.Value; _cfgApplied = true; } base.enemyHP = _cfgMaxHP; } public override void Start() { ((EnemyAI)this).Start(); if (!base.agent.isOnNavMesh) { LogCriticalReferences(); } if ((Object)(object)base.creatureAnimator == (Object)null) { base.creatureAnimator = ((Component)this).GetComponent<Animator>(); if (!((Object)(object)base.creatureAnimator == (Object)null)) { } } playerStealthMeters = new float[StartOfRound.Instance.allPlayerScripts.Length]; randomGenerator = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); spinerBehaviourStateIndex = 1; } public override void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) if (base.agent.destination != lastLoggedDestination) { lastLoggedDestination = base.agent.destination; } ((EnemyAI)this).Update(); TickFeignDeath(); if (base.isEnemyDead) { return; } Vector3 val2; switch ((State)spinerBehaviourStateIndex) { case State.Runaway: if (previousState != 0) { previousState = State.Runaway; } break; case State.Patrol: { if (previousState != State.Patrol) { previousState = State.Patrol; } List<GameObject> allAlivePlayerObjects = GetAllAlivePlayerObjects(); GameObject val3 = ((EnemyAI)this).CheckLineOfSight(allAlivePlayerObjects, 45f, 50, 3f, base.eye, (int[])null); if (!((Object)(object)val3 != (Object)null)) { break; } PlayerControllerB component = val3.GetComponent<PlayerControllerB>(); int num = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, component); if (num >= 0) { if (((NetworkBehaviour)this).IsServer) { BeginSpinerStalkClientRpc(num); } else { BeginSpinerStalkServerRpc(num); } } break; } case State.Stalking: if (previousState != State.Stalking) { previousState = State.Stalking; } break; case State.Kidnapping: if (previousState != State.Kidnapping) { previousState = State.Kidnapping; } break; case State.Transport: { if (previousState != State.Transport) { previousState = State.Transport; } List<GameObject> list = new List<GameObject>(); list.AddRange(GetAllAlivePlayerObjects(base.inSpecialAnimationWithPlayer)); list.AddRange(GetAllAliveEnemyObjects()); if (!isAvoidingThreat) { GameObject val = ((EnemyAI)this).CheckLineOfSight(list, 45f, 12, 2f, base.eye, (int[])null); if ((Object)(object)val != (Object)null) { Vector3 position = ((Component)this).transform.position; val2 = val.transform.position - ((Component)this).transform.position; currentAvoidPoint = position - ((Vector3)(ref val2)).normalized * 5f; currentAvoidPoint.y = ((Component)this).transform.position.y; ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SetDestinationToPosition(currentAvoidPoint, true); isAvoidingThreat = true; } } else if (Vector3.Distance(((Component)this).transform.position, currentAvoidPoint) < 2f) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); isAvoidingThreat = false; } break; } } val2 = base.agent.velocity; float magnitude = ((Vector3)(ref val2)).magnitude; bool flag = magnitude > 0.5f; AnimatorStateInfo currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); string text = (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("walk") ? "walk" : "other"); bool flag2 = base.creatureAnimator.IsInTransition(0); SetAnimation(flag ? "Walk" : "Idle"); if (flag) { if (!walkAudioSource.isPlaying) { walkAudioSource.volume = 0.75f; walkAudioSource.Play(); } } else if (walkAudioSource.isPlaying) { walkAudioSource.Stop(); } } private List<GameObject> GetAllAlivePlayerObjects(PlayerControllerB? exclude = null) { List<GameObject> list = new List<GameObject>(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && !val.isPlayerDead && (Object)(object)val != (Object)(object)exclude) { list.Add(((Component)val).gameObject); } } return list; } private List<GameObject> GetAllAliveEnemyObjects() { List<GameObject> list = new List<GameObject>(); EnemyAICollisionDetect[] array = Object.FindObjectsOfType<EnemyAICollisionDetect>(); foreach (EnemyAICollisionDetect val in array) { if ((Object)(object)val != (Object)null && (Object)(object)val.mainScript != (Object)null && (Object)(object)val.mainScript != (Object)(object)this && !val.mainScript.isEnemyDead) { list.Add(((Component)val).gameObject); } } return list; } public override void DoAIInterval() { if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (((NetworkBehaviour)this).IsServer && StartOfRound.Instance.shipIsLeaving && spinerBehaviourStateIndex != 0) { BeginSpinerRunawayServerRpc(); return; } if (((NetworkBehaviour)this).IsServer && hasReceivedDamageRecently && spinerBehaviourStateIndex != 0) { hasReceivedDamageRecently = false; BeginSpinerRunawayServerRpc(); } ((EnemyAI)this).DoAIInterval(); switch ((State)spinerBehaviourStateIndex) { case State.Patrol: if (!isPatrolActive) { StartPatrol(); } break; case State.Runaway: if (!isRunawayActive) { StartRunaway(); } break; case State.Stalking: if (!isStalkingActive) { if (stalkingTargetId != -1) { StartStalking(stalkingTargetId); } else { ChangeState(State.Patrol); } } else { LookAtPlayer(); StalkingBehavior(); } break; case State.Kidnapping: if (!isKidnappingActive) { if (kidnappingTargetId != -1) { StartKidnapping(kidnappingTargetId); } else { ChangeState(State.Patrol); } } else { PerformKidnapping(); } break; case State.Transport: if (!isTransportActive) { if (transportingTargetId != -1) { StartTransport(transportingTargetId); } else { ChangeState(State.Patrol); } } else { PerformTransport(); } break; } } private void ResetAllFlags() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) isRunawayActive = false; isPatrolActive = false; isStalkingActive = false; isKidnappingActive = false; isTransportActive = false; stalkingMovementActive = false; stalkingMoveTarget = Vector3.zero; stalkingMoveMode = 0; _stalkMoveStartTime = 0f; overrideSpeed = false; base.agent.ResetPath(); base.agent.velocity = Vector3.zero; base.agent.isStopped = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; transportReleaseTimer = 0f; } private void UpdateSpeed() { if (!overrideSpeed) { switch ((State)spinerBehaviourStateIndex) { case State.Patrol: base.agent.speed = 1f; break; case State.Runaway: base.agent.speed = 6f; break; case State.Stalking: base.agent.speed = 2f; break; case State.Kidnapping: base.agent.speed = 6f; break; case State.Transport: base.agent.speed = 2f; break; } } } private void ChangeState(State newState, int playerId = -1) { if (spinerBehaviourStateIndex != (int)newState) { if (newState == State.Runaway && (Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) { ReleaseTransportedPlayer(); } switch ((State)spinerBehaviourStateIndex) { case State.Runaway: StopRunaway(); break; case State.Patrol: StopPatrol(); break; case State.Stalking: StopStalking(); break; case State.Kidnapping: StopKidnapping(); break; case State.Transport: StopTransport(); break; } ResetAllFlags(); spinerBehaviourStateIndex = (int)newState; UpdateSpeed(); switch (newState) { case State.Patrol: TriggerFx(SpinerEvent.Roam); StartPatrol(); break; case State.Stalking: TriggerFx(SpinerEvent.Creep); StartStalking(playerId); break; case State.Kidnapping: TriggerFx(SpinerEvent.Kidnap); StartKidnapping(playerId); break; case State.Transport: TriggerFx(SpinerEvent.Transport); StartTransport(playerId); break; case State.Runaway: TriggerFx(SpinerEvent.Runaway); StartRunaway(); break; } } } private void LogRPC(string direction, string rpcName) { if (enableRpcLogging) { string text = "[RPC] " + direction + " ▶ " + rpcName + " | " + $"OwnerClientId={((NetworkBehaviour)this).OwnerClientId} | " + $"IsHost={((NetworkBehaviour)this).IsHost}, IsServer={((NetworkBehaviour)this).IsServer}, IsClient={((NetworkBehaviour)this).IsClient}, IsOwner={((NetworkBehaviour)this).IsOwner} | " + $"CurrentState={(State)spinerBehaviourStateIndex}"; } } 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 (base.enemyHP <= 0 && !base.isEnemyDead && ((NetworkBehaviour)this).IsOwner) { SpinerPlugin.LogInfo("[Combat] Enemy HP reached 0 → Killing enemy."); ((EnemyAI)this).KillEnemyOnOwnerClient(false); return; } if (!base.isEnemyDead) { string[] array = new string[3] { "Hurt", "Hurt2", "Hurt3" }; string animation = array[hurtAnimIndex]; SetAnimation(animation); hurtAnimIndex = (hurtAnimIndex + 1) % array.Length; } if (((NetworkBehaviour)this).IsServer) { hasReceivedDamageRecently = true; } } public override void KillEnemy(bool destroy = false) { ChangeState(State.Patrol); if (_cfgDarkMode && !_feignDeathActive && !_phase2Lethal && !destroy) { StartFeignDeath(); return; } ((EnemyAI)this).KillEnemy(false); SetAnimation("Death2"); } private void StartFeignDeath() { base.isEnemyDead = true; _feignDeathActive = true; _feignDeathTimer = _cfgDarkReviveDelay; SetAnimation("Death"); TriggerFx(SpinerEvent.Death); ((Behaviour)base.agent).enabled = false; ((EnemyAI)this).CancelSpecialAnimationWithPlayer(); } private void TickFeignDeath() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) if (!_feignDeathActive) { return; } _feignDeathTimer -= Time.deltaTime; if (_feignDeathTimer > 0f) { return; } _feignDeathActive = false; _phase2Lethal = true; base.isEnemyDead = false; if ((Object)(object)base.agent != (Object)null) { ((Behaviour)base.agent).enabled = true; if (!base.agent.isOnNavMesh) { base.agent.Warp(((Component)this).transform.position); } } base.enemyHP = _cfgMaxHP; SetAnimation("Resurrect"); ChangeState(State.Runaway); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (val.material.HasProperty("_Color")) { val.material.color = Color.Lerp(val.material.color, Color.black, 0.7f); } if (val.material.HasProperty("_EmissionColor")) { val.material.SetColor("_EmissionColor", val.material.GetColor("_EmissionColor") * 0.5f); } } } private void StartRunaway() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (!isRunawayActive) { stalkingTargetId = -1; kidnappingTargetId = -1; transportingTargetId = -1; isRunawayActive = true; UpdateSpeed(); Transform val = ((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)this).transform.position, false, 0, false, 50, false); if ((Object)(object)val != (Object)null) { ((EnemyAI)this).SetDestinationToPosition(val.position, true); } else { Vector3 val2 = ((Component)this).transform.position + Random.insideUnitSphere * 10f; val2.y = ((Component)this).transform.position.y; ((EnemyAI)this).SetDestinationToPosition(val2, true); } ((MonoBehaviour)this).StartCoroutine(ExitRunawayAfterDelay()); } } private void StopRunaway() { if (isRunawayActive) { isRunawayActive = false; } } public void StartPatrol() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (!isPatrolActive) { stalkingTargetId = -1; kidnappingTargetId = -1; transportingTargetId = -1; isPatrolActive = true; UpdateSpeed(); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } public void StopPatrol() { if (isPatrolActive) { ((EnemyAI)this).StopSearch(base.currentSearch, true); isPatrolActive = false; } } private void StartStalking(int playerId) { stalkingTargetId = playerId; if (!isStalkingActive) { isStalkingActive = true; chasingPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; LookAtPlayer(); UpdateSpeed(); StalkingBehavior(); } } private void StopStalking() { if (isStalkingActive) { isStalkingActive = false; ResetRotation(); } } private void StartKidnapping(int playerId) { kidnappingTargetId = playerId; if (!isKidnappingActive) { isKidnappingActive = true; UpdateSpeed(); PerformKidnapping(); } } private void StopKidnapping() { if (isKidnappingActive) { isKidnappingActive = false; } } private void StartTransport(int playerId) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.inSpecialAnimationWithPlayer == (Object)null && playerId >= 0 && playerId < StartOfRound.Instance.allPlayerScripts.Length) { base.inSpecialAnimationWithPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; } transportingTargetId = playerId; if (isTransportActive) { return; } isTransportActive = true; kidnapCarryPoint = ((Component)this).transform.Find("KidnapCarryPoint"); if ((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null && (Object)(object)kidnapCarryPoint != (Object)null) { ((Component)base.inSpecialAnimationWithPlayer).transform.SetParent(kidnapCarryPoint); ((Component)base.inSpecialAnimationWithPlayer).transform.localPosition = Vector3.zero; ((Component)base.inSpecialAnimationWithPlayer).transform.localRotation = Quaternion.identity; base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = true; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = (EnemyAI)(object)this; base.inSpecialAnimationWithPlayer.snapToServerPosition = true; if ((Object)(object)base.inSpecialAnimationWithPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { InputAction val = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false); if (val != null) { val.Disable(); } } } UpdateSpeed(); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } private void StopTransport() { if (isTransportActive) { isTransportActive = false; ((EnemyAI)this).StopSearch(base.currentSearch, true); } } [IteratorStateMachine(typeof(<ExitRunawayAfterDelay>d__102))] private IEnumerator ExitRunawayAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ExitRunawayAfterDelay>d__102(0) { <>4__this = this }; } private void StalkingBehavior() { //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) int num = ISeeMyTarget(); bool flag = MyTargetSeesMe(); bool inLosThisFrame = num > 0; UpdateStalkingMeter(inLosThisFrame); losSum += num; losCount++; if (Time.time >= nextLosAvgTime) { nextLosAvgTime = Time.time + 0.5f; float num2 = ((losCount > 0) ? ((float)losSum / (float)losCount) : 0f); losScore = Mathf.Clamp(Mathf.RoundToInt(num2), 0, 5); losSum = 0; losCount = 0; } if (losScore == 0) { if (stalkingMovementActive && stalkingMoveMode == 2) { HandleStalkingMovement(wantMove: true, stalkingMoveTarget); return; } if (!stalkingMovementActive || stalkingMoveMode != 1) { Vector3 approachPos = GetApproachPos(); if (approachPos == Vector3.zero) { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); return; } stalkingMoveTarget = approachPos; stalkingMoveMode = 1; } HandleStalkingMovement(wantMove: true, stalkingMoveTarget); } else if (losScore == 1) { if (flag) { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); return; } if (stalkingMovementActive && stalkingMoveMode == 2) { HandleStalkingMovement(wantMove: true, stalkingMoveTarget); return; } if (!stalkingMovementActive || stalkingMoveMode != 1) { Vector3 approachPos2 = GetApproachPos(); if (approachPos2 == Vector3.zero) { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); return; } stalkingMoveTarget = approachPos2; stalkingMoveMode = 1; } HandleStalkingMovement(wantMove: true, stalkingMoveTarget); } else if (losScore == 2) { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); } else if (flag) { if (!stalkingMovementActive || stalkingMoveMode != 2) { Vector3 hidePos = GetHidePos(); if (hidePos == Vector3.zero) { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); return; } stalkingMoveTarget = hidePos; stalkingMoveMode = 2; } HandleStalkingMovement(wantMove: true, stalkingMoveTarget); } else { stalkingMoveMode = 0; HandleStalkingMovement(wantMove: false, Vector3.zero, stopNow: true); } } private void HandleStalkingMovement(bool wantMove, Vector3 wantedTarget, bool stopNow = false) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Invalid comparison between Unknown and I4 //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) if (stopNow || !wantMove) { base.agent.ResetPath(); base.agent.velocity = Vector3.zero; base.agent.isStopped = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; stalkingMovementActive = false; stalkingMoveTarget = Vector3.zero; stalkingMoveMode = 0; _stalkMoveStartTime = 0f; } else { if (wantedTarget == Vector3.zero) { return; } if (!stalkingMovementActive) { base.agent.speed = 4f; NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(((Component)this).transform.position, ref val, 2f, -1)) { stalkingMoveTarget = Vector3.zero; return; } Vector3 position = ((NavMeshHit)(ref val)).position; NavMeshPath val2 = new NavMeshPath(); if (!NavMesh.CalculatePath(position, wantedTarget, -1, val2) || (int)val2.status > 0) { stalkingMoveTarget = Vector3.zero; return; } stalkingMoveTarget = wantedTarget; if (!((EnemyAI)this).SetDestinationToPosition(stalkingMoveTarget, true)) { stalkingMovementActive = false; stalkingMoveTarget = Vector3.zero; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; stalkingMoveMode = 0; _stalkMoveStartTime = 0f; } else { base.moveTowardsDestination = true; base.movingTowardsTargetPlayer = false; stalkingMovementActive = true; _stalkMoveStartTime = Time.time; } return; } float num = 1f; float num2 = Vector3.Distance(((Component)this).transform.position, stalkingMoveTarget); if (num2 <= num) { base.agent.ResetPath(); base.agent.velocity = Vector3.zero; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; stalkingMovementActive = false; stalkingMoveTarget = Vector3.zero; stalkingMoveMode = 0; _stalkMoveStartTime = 0f; return; } float num3 = 5f; if (_stalkMoveStartTime > 0f && Time.time - _stalkMoveStartTime >= num3) { base.agent.ResetPath(); base.agent.velocity = Vector3.zero; base.agent.isStopped = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; stalkingMovementActive = false; stalkingMoveTarget = Vector3.zero; stalkingMoveMode = 0; _stalkMoveStartTime = 0f; } } } private void LookAtPlayer() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)chasingPlayer == (Object)null)) { Vector3 val = ((Component)chasingPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; Quaternion rotation = Quaternion.LookRotation(val); ((Component)this).transform.rotation = rotation; } } private void ResetRotation() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.rotation = Quaternion.identity; } private void UpdateStalkingMeter(bool inLosThisFrame) { float num = stalkingMeter; if (inLosThisFrame) { stalkingMeter = Mathf.Min(stalkingMeter + stalkingMeterIncrement * Time.deltaTime, stalkingMeterMax); } else { stalkingMeter = Mathf.Max(stalkingMeter - stalkingMeterDecrement * Time.deltaTime, -3f); } float num2 = Mathf.Floor(stalkingMeter); if (num2 != lastLoggedStalkingSecond) { lastLoggedStalkingSecond = num2; } if (stalkingMeter <= 0f && num > 0f) { lastLoggedStalkingSecond = -1f; } if (stalkingMeter >= stalkingMeterMax) { stalkingMeter = 0f; lastLoggedStalkingSecond = -1f; if (((NetworkBehaviour)this).IsServer) { BeginSpinerKidnapClientRpc(stalkingTargetId); } else { BeginSpinerKidnapServerRpc(stalkingTargetId); } } if (stalkingMeter <= -3f) { stalkingMeter = 0f; lastLoggedStalkingSecond = -1f; if (((NetworkBehaviour)this).IsServer) { BeginSpinerPatrolClientRpc(); } else { BeginSpinerPatrolServerRpc(); } } } private int ISeeMyTarget() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chasingPlayer == (Object)null) { return 0; } Vector3 position = base.eye.position; Vector3 val = ((Component)chasingPlayer).transform.position + Vector3.up * 1f; float num = Vector3.Distance(position, val); if (num > 50f) { return 0; } Vector3 val2 = val - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num2 = Vector3.Angle(base.eye.forward, normalized); if (num2 > 70f) { return 0; } val2 = Vector3.Cross(Vector3.up, normalized); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.0001f) { val3 = base.eye.right; } Vector3 val4 = position; Vector3 val5 = position - val3 * 0.25f; Vector3 val6 = position - val3 * 0.5f; Vector3 val7 = position + val3 * 0.25f; Vector3 val8 = position + val3 * 0.5f; Vector3 val9 = val4 + normalized * num; Vector3 val10 = val5 + normalized * num; Vector3 val11 = val6 + normalized * num; Vector3 val12 = val7 + normalized * num; Vector3 val13 = val8 + normalized * num; int collidersAndRoomMaskAndDefault = StartOfRound.Instance.collidersAndRoomMaskAndDefault; bool flag = !Physics.Linecast(val4, val9, collidersAndRoomMaskAndDefault); bool flag2 = !Physics.Linecast(val5, val10, collidersAndRoomMaskAndDefault); bool flag3 = !Physics.Linecast(val6, val11, collidersAndRoomMaskAndDefault); bool flag4 = !Physics.Linecast(val7, val12, collidersAndRoomMaskAndDefault); bool flag5 = !Physics.Linecast(val8, val13, collidersAndRoomMaskAndDefault); int num3 = 0; if (flag) { num3++; } if (flag2) { num3++; } if (flag3) { num3++; } if (flag4) { num3++; } if (flag5) { num3++; } bool flag6 = num3 == 0; bool flag7 = !flag6; if (Time.time >= _nextLosLogTime_ISee) { _nextLosLogTime_ISee = Time.time + 0.5f; string arg = $"C:{(flag ? 1 : 0)} " + $"L:{(flag2 ? 1 : 0)}{(flag3 ? 1 : 0)} " + $"R:{(flag4 ? 1 : 0)}{(flag5 ? 1 : 0)}"; SpinerPlugin.LogInfo($"[ISeeMyTarget] LOS={flag7} | score={num3}/5 | {arg}"); } return num3; } private bool MyTargetSeesMe() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chasingPlayer == (Object)null) { return false; } Transform transform = ((Component)chasingPlayer.gameplayCamera).transform; Vector3 position = base.eye.position; Vector3 position2 = transform.position; float num = Vector3.Distance(position2, position); if (num > 50f) { return false; } Vector3 val = position - position2; Vector3 normalized = ((Vector3)(ref val)).normalized; float num2 = Vector3.Angle(transform.forward, normalized); if (num2 > 70f) { return false; } bool flag = Physics.Linecast(position2, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault); return !flag; } private Vector3 GetApproachPos() { //IL_0025: 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) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chasingPlayer == (Object)null) { return Vector3.zero; } Vector3 enemyPos = ((Component)this).transform.position; Transform p = ((Component)chasingPlayer).transform; float num = 2f; float radius = 2.5f; int samples = 15; float navSnap = 2.5f; Vector3 behindCenter = p.position - p.forward * num; NavMeshPath path = new NavMeshPath(); Vector3 val = TryCone(120f); if (val == Vector3.zero) { val = TryCone(180f); } if (val == Vector3.zero) { SpinerPlugin.LogInfo("[GetApproachPos] FAIL no pathComplete candidates (120->180)"); } return val; Vector3 TryCone(float angleDeg) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00ac: 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_00cf: Invalid comparison between Unknown and I4 //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = -p.forward; Vector3 normalized = ((Vector3)(ref val2)).normalized; NavMeshHit val5 = default(NavMeshHit); for (int i = 0; i < samples; i++) { float num2 = ((samples == 1) ? 0.5f : ((float)i / (float)(samples - 1))); float num3 = Mathf.Lerp((0f - angleDeg) * 0.5f, angleDeg * 0.5f, num2); Vector3 val3 = Quaternion.Euler(0f, num3, 0f) * normalized; Vector3 val4 = behindCenter + val3 * radius; if (NavMesh.SamplePosition(val4, ref val5, navSnap, -1) && NavMesh.CalculatePath(enemyPos, ((NavMeshHit)(ref val5)).position, -1, path) && (int)path.status <= 0) { SpinerPlugin.LogInfo($"[GetApproachPos] PICK pos={((NavMeshHit)(ref val5)).position} | cone={angleDeg} | pathComplete"); return ((NavMeshHit)(ref val5)).position; } } return Vector3.zero; } } private Vector3 GetHidePos() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Invalid comparison between Unknown and I4 //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Invalid comparison between Unknown and I4 //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Invalid comparison between Unknown and I4 //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chasingPlayer == (Object)null) { return Vector3.zero; } SpinerPlugin.LogInfo("[SubState] ENTER HIDE"); Vector3 enemyPos = ((Component)this).transform.position; Vector3 position = ((Component)chasingPlayer).transform.position; Vector3 val = position - enemyPos; Vector3 dirToPlayer = ((Vector3)(ref val)).normalized; List<Vector3> possibleNodes = new List<Vector3>(); AddNodes(-60f, 60f, 6f, 15); AddNodes(-90f, -60f, 8f, 6); AddNodes(60f, 90f, 8f, 6); AddNodes(-120f, -90f, 10f, 6); AddNodes(90f, 120f, 10f, 6); SpinerPlugin.LogInfo($"[GetHidePos] {possibleNodes.Count} candidate nodes generated."); NavMeshPath val2 = new NavMeshPath(); foreach (Vector3 item in possibleNodes) { float num = Vector3.Distance(item, position); val = position - item; if (!Physics.Raycast(item, ((Vector3)(ref val)).normalized, num, StartOfRound.Instance.collidersRoomDefaultAndFoliage) || !NavMesh.CalculatePath(enemyPos, item, -1, val2) || (int)val2.status != 0) { continue; } SpinerPlugin.LogInfo($"[GetHidePos] PICK node={item} | pathComplete"); return item; } SpinerPlugin.LogInfo("[GetHidePos] No valid hiding spot found! Searching for alternative escape..."); Vector3 val3 = -dirToPlayer; Vector3 val4 = enemyPos + val3 * 6f; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(val4, ref val5, 3f, -1) && NavMesh.CalculatePath(enemyPos, ((NavMeshHit)(ref val5)).position, -1, val2) && (int)val2.status == 0) { return ((NavMeshHit)(ref val5)).position; } Vector3 val6 = enemyPos - dirToPlayer * 5f; NavMeshHit val7 = default(NavMeshHit); if (NavMesh.SamplePosition(val6, ref val7, 3f, -1) && NavMesh.CalculatePath(enemyPos, ((NavMeshHit)(ref val7)).position, -1, val2) && (int)val2.status == 0) { return ((NavMeshHit)(ref val7)).position; } return Vector3.zero; void AddNodes(float angleMin, float angleMax, float radius, int samples) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val10 = default(NavMeshHit); for (int i = 0; i < samples; i++) { float num2 = ((samples == 1) ? 0.5f : ((float)i / (float)(samples - 1))); float num3 = Mathf.Lerp(angleMin, angleMax, num2); Vector3 val8 = Quaternion.Euler(0f, num3, 0f) * -dirToPlayer; Vector3 val9 = enemyPos + val8 * radius; if (NavMesh.SamplePosition(val9, ref val10, 2f, -1)) { bool flag = false; for (int j = 0; j < possibleNodes.Count; j++) { Vector3 val11 = possibleNodes[j] - ((NavMeshHit)(ref val10)).position; if (((Vector3)(ref val11)).sqrMagnitude < 0.25f) { flag = true; break; } } if (!flag) { possibleNodes.Add(((NavMeshHit)(ref val10)).position); } } } } } private void PerformKidnapping() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chasingPlayer == (Object)null) { ChangeState(State.Runaway); return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)chasingPlayer).transform.position); if (num > 50f || !chasingPlayer.isPlayerControlled || chasingPlayer.isPlayerDead) { kidnappingTimer += Time.deltaTime; if (kidnappingTimer >= kidnappingTimeout) { kidnappingTimer = 0f; ChangeState(State.Runaway); return; } } else { kidnappingTimer = 0f; } ((EnemyAI)this).SetDestinationToPosition(((Component)chasingPlayer).transform.position, true); } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!((NetworkBehaviour)this).IsServer || base.isEnemyDead || spinerBehaviourStateIndex != 3 || isTransportActive || (Object)(object)base.inSpecialAnimationWithPlayer != (Object)null || spinerBehaviourStateIndex == 4) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val == (Object)null)) { base.inSpecialAnimationWithPlayer = val; kidnappingTargetId = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val); SetAnimation("Grab"); if (_phase2Lethal && !_killTimerActive) { _killTimerActive = true; _kidnapKillTimer = _cfgDarkKillTime; } if (((NetworkBehaviour)this).IsServer) { BeginSpinerTransportClientRpc(kidnappingTargetId); } else { BeginSpinerTransportServerRpc(kidnappingTargetId); } } } private void PerformTransport() { //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead) { ReleaseTransportedPlayer(); return; } if ((Object)(object)base.inSpecialAnimationWithPlayer == (Object)null || base.inSpecialAnimationWithPlayer.isPlayerDead || !((Component)base.inSpecialAnimationWithPlayer).gameObject.activeInHierarchy || (Object)(object)base.inSpecialAnimationWithPlayer.inAnimationWithEnemy != (Object)(object)this) { ReleaseTransportedPlayer(); ChangeState(State.Runaway); return; } if (_phase2Lethal) { if (!((NetworkBehaviour)this).IsServer) { return; } if (_killTimerActive && (Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) { _kidnapKillTimer -= Time.deltaTime; if (_kidnapKillTimer % 1f > (_kidnapKillTimer - Time.deltaTime) % 1f && _kidnapKillTimer <= 0f) { _killTimerActive = false; SetAnimation("Spin"); PlayerControllerB inSpecialAnimationWithPlayer = base.inSpecialAnimationWithPlayer; if ((Object)(object)inSpecialAnimationWithPlayer != (Object)null && !inSpecialAnimationWithPlayer.isPlayerDead) { ReleaseTransportedPlayer(); if (((NetworkBehaviour)this).IsServer) { KillCapturedClientRpc(inSpecialAnimationWithPlayer.playerClientId, 17); } if (((NetworkBehaviour)inSpecialAnimationWithPlayer).IsOwner) { inSpecialAnimationWithPlayer.KillPlayer(Vector3.up * 14f, true, (CauseOfDeath)17, 7, Vector3.zero); } ChangeState(State.Patrol); } return; } } float num = Vector3.Distance(((Component)base.inSpecialAnimationWithPlayer).transform.position, kidnapCarryPoint.position); if (num > 4f) { ReleaseTransportedPlayer(); ChangeState(State.Runaway); } return; } int num2 = StartOfRound.Instance.allPlayerScripts.Count((PlayerControllerB p) => (Object)(object)p != (Object)null && p.isPlayerControlled && !p.isPlayerDead && (Object)(object)p != (Object)(object)base.inSpecialAnimationWithPlayer); if (num2 <= 0) { transportReleaseTimer += Time.deltaTime; if (transportReleaseTimer >= 15f) { ReleaseTransportedPlayer(); ChangeState(State.Runaway); return; } } else if (transportReleaseTimer > 0f) { transportReleaseTimer = 0f; } float num3 = Vector3.Distance(((Component)base.inSpecialAnimationWithPlayer).transform.position, kidnapCarryPoint.position); if (num3 > 2.5f) { ReleaseTransportedPlayer(); ChangeState(State.Runaway); } } private void ReleaseTransportedPlayer() { transportReleaseTimer = 0f; StopLethalTimer(); if (!((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null)) { return; } base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = false; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = null; base.inSpecialAnimationWithPlayer.snapToServerPosition = false; if ((Object)(object)base.inSpecialAnimationWithPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { InputAction val = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false); if (val != null) { val.Enable(); } } ((Component)base.inSpecialAnimationWithPlayer).transform.SetParent((Transform)null); base.inSpecialAnimationWithPlayer = null; } private void StopLethalTimer() { _killTimerActive = false; _kidnapKillTimer = 0f; } [ClientRpc] private void ApplyRuntimeConfigClientRpc(string json) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4228702990u, val, (RpcDelivery)0); bool flag = json != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(json, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4228702990u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpinerPlugin.SpinerRuntimeConfig spinerRuntimeConfig = JsonUtility.FromJson<SpinerPlugin.SpinerRuntimeConfig>(json); _cfgMaxHP = spinerRuntimeConfig.maxHP; _cfgRoamVolume = spinerRuntimeConfig.roamVolume; _cfgDarkMode = spinerRuntimeConfig.darkMode; _cfgDarkReviveDelay = spinerRuntimeConfig.darkReviveDelay; _cfgDarkKillTime = spinerRuntimeConfig.darkKillTime; _cfgApplied = true; ApplyLocalConfig(); } } [ClientRpc] private void KillCapturedClientRpc(ulong targetId, int cause, ClientRpcParams rpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1601466477u, rpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, targetId); BytePacker.WriteValueBitPacked(val, cause); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1601466477u, rpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && localPlayerController.playerClientId == targetId && !localPlayerController.isPlayerDead) { localPlayerController.KillPlayer(Vector3.up * 14f, true, (CauseOfDeath)cause, 7, Vector3.zero); } } } [ServerRpc(RequireOwnership = false)] private void BeginSpinerPatrolServerRpc() { //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(4149237383u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4149237383u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Server", "BeginSpinerPatrolServerRpc"); ChangeState(State.Patrol); BeginSpinerPatrolClientRpc(); } } } [ClientRpc] private void BeginSpinerPatrolClientRpc() { //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(1689745625u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1689745625u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Client", "BeginSpinerPatrolClientRpc"); ChangeState(State.Patrol); } } } [ServerRpc(RequireOwnership = false)] private void BeginSpinerStalkServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1741744632u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1741744632u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Server", "BeginSpinerStalkServerRpc"); ChangeState(State.Stalking, playerId); BeginSpinerStalkClientRpc(playerId); } } } [ClientRpc] private void BeginSpinerStalkClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3777187886u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3777187886u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Client", "BeginSpinerStalkClientRpc"); ChangeState(State.Stalking, playerId); } } } [ServerRpc(RequireOwnership = false)] private void BeginSpinerKidnapServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3037181123u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3037181123u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Server", "BeginSpinerKidnapServerRpc"); ChangeState(State.Kidnapping, playerId); BeginSpinerKidnapClientRpc(playerId); } } } [ClientRpc] private void BeginSpinerKidnapClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2547517339u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2547517339u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Client", "BeginSpinerKidnapClientRpc"); ChangeState(State.Kidnapping, playerId); } } } [ServerRpc(RequireOwnership = false)] private void BeginSpinerTransportServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(276269701u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 276269701u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Server", "BeginSpinerTransportServerRpc"); ChangeState(State.Transport, playerId); BeginSpinerTransportClientRpc(playerId); } } } [ClientRpc] private void BeginSpinerTransportClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2242719271u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2242719271u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Client", "BeginSpinerTransportClientRpc"); ChangeState(State.Transport, playerId); } } } [ServerRpc(RequireOwnership = false)] private void BeginSpinerRunawayServerRpc() { //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(1984957057u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1984957057u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Server", "BeginSpinerRunawayServerRpc"); ChangeState(State.Runaway); BeginSpinerRunawayClientRpc(); } } } [ClientRpc] private void BeginSpinerRunawayClientRpc() { //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(2415105479u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2415105479u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogRPC("Client", "BeginSpinerRunawayClientRpc"); ChangeState(State.Runaway); } } } private void LogCriticalReferences() { } public void SetAnimation(string animType) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //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) if ((Object)(object)base.creatureAnimator == (Object)null || string.IsNullOrEmpty(animType)) { return; } float num; if (!((Object)(object)base.agent != (Object)null)) { num = -1f; } else { Vector3 velocity = base.agent.velocity; num = ((Vector3)(ref velocity)).magnitude; } float num2 = num; AnimatorStateInfo currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); switch (animType) { case "Walk": if (!(_currentAnimState == "Walk")) { base.creatureAnimator.SetBool(animWalk, true); _currentAnimState = "Walk"; } return; case "Idle": if (!(_currentAnimState == "Idle")) { base.creatureAnimator.SetBool(animWalk, false); _currentAnimState = "Idle"; } return; case "Death": if (!(_currentAnimState == "Death")) { base.creatureAnimator.SetBool(animWalk, false); base.creatureAnimator.SetBool(animDeath, true); _currentAnimState = "Death"; } return; case "Resurrect": if (!(_currentAnimState == "Resurrect")) { base.creatureAnimator.SetBool(animWalk, false); base.creatureAnimator.SetBool(animDeath, false); _currentAnimState = "Resurrect"; } return; case "Death2": if (!(_currentAnimState == "Death2")) { base.creatureAnimator.SetBool(animWalk, false); base.creatureAnimator.SetBool(animDeath2, true); _currentAnimState = "Death2"; } return; } base.creatureAnimator.SetBool(animWalk, false); _currentAnimState = animType; if (1 == 0) { } string text = animType switch { "Stalk" => animStalk, "Attack" => animAttack, "Grab" => animGrab, "Hurt" => animHurt, "Hurt2" => animHurt2, "Hurt3" => animHurt3, "Spin" => animSpin, "SpinTest" => animSpinTest, _ => null, }; if (1 == 0) { } string text2 = text; if (!string.IsNullOrEmpty(text2)) { base.creatureAnimator.ResetTrigger(text2); base.creatureAnimator.SetTrigger(text2); } } private void TriggerFx(SpinerEvent fx) { AudioClip val = null; AudioSource val2 = sfxAudioSource; switch (fx) { default: return; case SpinerEvent.Kidnap: val = kidnappingSound; break; case SpinerEvent.Death: val = deathSound; break; case SpinerEvent.Creep: val = creepSound; break; case SpinerEvent.Transport: val = transportSound; break; case SpinerEvent.Detection: val = detectionSound; break; case SpinerEvent.Runaway: val = runawaySound; break; case SpinerEvent.Roam: { AudioClip[] array = (AudioClip[])(object)new AudioClip[3] { roamingSound, roamingSound2, roamingSound3 }; int num = Mathf.Abs((((Object)this).GetInstanceID() + Time.frameCount) % array.Length); val = array[num]; break; } case SpinerEvent.Spin: return; } if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { if (_phase2Lethal && !_phase2AudioTintApplied) { val2.pitch = 0.5f; _phase2AudioTintApplied = true; } if (!((Object)(object)val == (Object)(object)_lastClip) || !(Time.time - _lastTime < 0.05f)) { float num2 = (_phase2Lethal ? 1f : 1f); val2.PlayOneShot(val, num2); _lastClip = val; _lastTime = Time.time; } } } public override void OnDestroy() { if ((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) { ReleaseTransportedPlayer(); } ((EnemyAI)this).OnDestroy(); } private void OnDisable() { if ((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) { ReleaseTransportedPlayer(); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4228702990u, new RpcReceiveHandler(__rpc_handler_4228702990), "ApplyRuntimeConfigClientRpc"); ((NetworkBehaviour)this).__registerRpc(1601466477u, new RpcReceiveHandler(__rpc_handler_1601466477), "KillCapturedClientRpc"); ((NetworkBehaviour)this).__registerRpc(4149237383u, new RpcReceiveHandler(__rpc_handler_4149237383), "BeginSpinerPatrolServerRpc"); ((NetworkBehaviour)this).__registerRpc(1689745625u, new RpcReceiveHandler(__rpc_handler_1689745625), "BeginSpinerPatrolClientRpc"); ((NetworkBehaviour)this).__registerRpc(1741744632u, new RpcReceiveHandler(__rpc_handler_1741744632), "BeginSpinerStalkServerRpc"); ((NetworkBehaviour)this).__registerRpc(3777187886u, new RpcReceiveHandler(__rpc_handler_3777187886), "BeginSpinerStalkClientRpc"); ((NetworkBehaviour)this).__registerRpc(3037181123u, new RpcReceiveHandler(__rpc_handler_30371