#define DEBUG using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Reiko888.CLARA.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Video; [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: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: AssemblyCompany("Reiko888.CLARA")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c76f19e7a62e5405e879dca1625d673779764d58")] [assembly: AssemblyProduct("Blood Witch")] [assembly: AssemblyTitle("Reiko888.CLARA")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 CLARA { public class ClaraAI : EnemyAI { private enum State { Searching, Stalking, Chasing, Diving } public AudioSource diggingSFX; public AudioClip[] diggingClips; public AudioSource StepsSFX; public GameObject exitMound; public GameObject cosmeticMoundPrefab; private List activeMounds = new List(); private List cosmeticMounds = new List(); private Vector3 emergenceMoundPosition; private Quaternion emergenceMoundRotation; private bool shouldSpawnMoundAfterTransition = false; public AISearchRoutine searchForPlayers; private int numberOfMounds; private int numberOfCosmeticMounds; private int claraHP; private float checkLineOfSightInterval = 0f; private float noticePlayerTimer = 0f; private Vector3 ambushNodePosition; private float ambushTimer = 0f; private float diggingSpeed; private float chaseSpeed; private const float LINE_OF_SIGHT_DISTANCE = 120f; private bool hasLOS; private Vector3 lastPosition; public float chaseTimer = 0f; private float timeSinceHittingPlayer = 0f; public int damagePerHit; public AudioClip attackSFX; private string lastLogState = ""; private int lastTargetPlayerId = -1; private bool isAmbushing = false; public AudioClip[] undergroundTauntLines; public AudioClip[] aboveTauntLines; public AudioClip[] emergeSFX; private float voiceTimer = 0f; private float emergenceTransitionTimer = 0f; private bool isEmergingAnimationPlaying = false; private Vector3 lastPlayerPos; public GameObject fakeClara; private GameObject fakeClaraInstance; private Transform fakeClaraHeadBone; public GameObject dirtTrailParticles; public GameObject emergenceParticles; public AudioClip[] drillClips; private bool isPeeking = false; private float peekTimer = 0f; private float chaseLockOnTimer = 0f; private float lostPlayerTimer = 0f; private GameObject diveTargetMound; private float diveTimer = 0f; private float attackSFXTimer = 0f; private float stalkSequenceTimer; private float fakeClaraDeactivateTimer = 0f; private bool localMeshesDisabled = false; private float stalkShakeTimer = 0f; private Vector3 peekingMoundPosition; private bool emergeFromExistingMound = false; private Vector3 lastFrameStalkPosition; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { if (Plugin.Logger != null) { Plugin.Logger.LogInfo((object)text); } else { Debug.Log((object)("CLARA: " + text)); } } public override void Start() { ((EnemyAI)this).Start(); numberOfMounds = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Number of usable mounds").Value; numberOfCosmeticMounds = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Number of jumpscare mounds").Value; claraHP = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("CLARA Hp").Value; diggingSpeed = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Digging speed").Value; chaseSpeed = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Chase speed").Value; damagePerHit = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Damage per hit").Value; stalkSequenceTimer = ((AssetBundleLoader)(object)ContentHandler.Instance.claraAssets).GetConfig("Stalk timer").Value; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).EnableEnemyMesh(false, false, true); if (((NetworkBehaviour)this).IsServer) { SpawnAllMounds(); } if (!RoundManager.Instance.hasInitializedLevelRandomSeed) { RoundManager.Instance.InitializeRandomNumberGenerators(); } base.enemyHP = claraHP; if ((Object)(object)diggingSFX != (Object)null && diggingClips != null && diggingClips.Length != 0) { diggingSFX.clip = diggingClips[0]; diggingSFX.loop = true; diggingSFX.Play(); } if ((Object)(object)fakeClara != (Object)null) { fakeClaraInstance = Object.Instantiate(fakeClara); fakeClaraInstance.SetActive(false); AudioSource componentInChildren = fakeClaraInstance.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.clip != (Object)null) { componentInChildren.clip.LoadAudioData(); } } if ((Object)(object)dirtTrailParticles != (Object)null) { dirtTrailParticles.SetActive(false); } if ((Object)(object)emergenceParticles != (Object)null) { emergenceParticles.SetActive(false); } LogIfDebugBuild("Clara spawned. Starting in searching."); } public void SyncStateSafely(int newStateIndex) { if (((NetworkBehaviour)this).IsServer) { SyncStateSafelyClientRpc(newStateIndex); } else { SyncStateSafelyServerRpc(newStateIndex); } } [ServerRpc(RequireOwnership = false)] private void SyncStateSafelyServerRpc(int newStateIndex) { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3603477563u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, newStateIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3603477563u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncStateSafelyClientRpc(newStateIndex); } } } [ClientRpc] private void SyncStateSafelyClientRpc(int newStateIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0123: 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_014d: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3966759624u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, newStateIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3966759624u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; base.currentBehaviourStateIndex = newStateIndex; if (newStateIndex == 0) { base.inSpecialAnimation = false; Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)this).transform.position, default(NavMeshHit), 3f, base.agent.areaMask); if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).enabled) { base.agent.Warp(navMeshPosition); } ((Component)this).transform.position = navMeshPosition; if (((NetworkBehaviour)this).IsServer) { if (searchForPlayers != null) { searchForPlayers.inProgress = false; } ((EnemyAI)this).SyncPositionToClients(); } } if (newStateIndex == 1) { if (currentBehaviourStateIndex != 1) { stalkSequenceTimer = 10f; isAmbushing = false; base.inSpecialAnimation = false; emergeFromExistingMound = false; if ((Object)(object)dirtTrailParticles != (Object)null) { dirtTrailParticles.SetActive(true); ParticleSystem[] componentsInChildren = dirtTrailParticles.GetComponentsInChildren(true); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val3 in array) { val3.Play(); } } } } else if ((Object)(object)dirtTrailParticles != (Object)null) { dirtTrailParticles.SetActive(false); } if ((Object)(object)diggingSFX != (Object)null) { if (newStateIndex == 2 || newStateIndex == 3) { diggingSFX.Stop(); } else if (!diggingSFX.isPlaying && diggingClips != null && diggingClips.Length != 0) { diggingSFX.clip = diggingClips[0]; diggingSFX.loop = true; diggingSFX.Play(); } } if (newStateIndex != 2 && newStateIndex != 3 && (Object)(object)base.creatureSFX != (Object)null && base.creatureSFX.isPlaying) { base.creatureSFX.Stop(); } } public override void DoAIInterval() { //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (StartOfRound.Instance.livingPlayers == 0 || base.isEnemyDead || base.stunNormalizedTimer > 0f) { return; } switch ((State)base.currentBehaviourStateIndex) { case State.Searching: isAmbushing = false; isEmergingAnimationPlaying = false; base.agent.speed = diggingSpeed; if ((Object)(object)base.targetPlayer != (Object)null) { base.targetPlayer = null; base.movingTowardsTargetPlayer = false; } if ((Object)(object)base.targetPlayer == (Object)null) { if (searchForPlayers != null && !searchForPlayers.inProgress && ((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } } else if (searchForPlayers != null && searchForPlayers.inProgress && ((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } break; case State.Stalking: if (searchForPlayers != null && searchForPlayers.inProgress && ((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } if ((Object)(object)base.targetPlayer != (Object)null && !isAmbushing) { base.agent.speed = diggingSpeed; ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); } break; case State.Chasing: isAmbushing = false; if (searchForPlayers != null && searchForPlayers.inProgress && ((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } if (isEmergingAnimationPlaying) { break; } base.agent.speed = chaseSpeed; if (((NetworkBehaviour)this).IsOwner || ((NetworkBehaviour)this).IsServer) { base.agent.stoppingDistance = 0f; PlayerControllerB targetPlayer = base.targetPlayer; bool flag = (Object)(object)base.targetPlayer == (Object)null || base.targetPlayer.isPlayerDead || !base.targetPlayer.isInsideFactory; base.addPlayerVelocityToDestination = 1f; bool flag2 = chaseLockOnTimer <= 0f; bool flag3 = ((EnemyAI)this).TargetClosestPlayer(1.5f, flag2, 70f, false, false, true); if (!flag3 && (Object)(object)targetPlayer != (Object)null && !flag) { base.targetPlayer = targetPlayer; } if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); if ((Object)(object)base.targetPlayer != (Object)(object)targetPlayer) { ((EnemyAI)this).ChangeOwnershipOfEnemy(base.targetPlayer.actualClientId); } } bool flag4 = false; if ((Object)(object)base.targetPlayer == (Object)null || base.targetPlayer.isPlayerDead || !base.targetPlayer.isInsideFactory) { flag4 = true; } else if (chaseLockOnTimer <= 0f) { if (flag3) { lostPlayerTimer = 0f; } else { lostPlayerTimer += base.AIIntervalTime; if (lostPlayerTimer > 2.5f) { flag4 = true; } } } else { lostPlayerTimer = 0f; } if (flag4) { LogIfDebugBuild("[C.L.A.R.A] Target escaped factory or broke line of sight. Diving back to floor."); if (((NetworkBehaviour)this).IsServer) { EndChaseAndStartDiving(); } else if (((NetworkBehaviour)this).IsOwner) { RequestEndChaseServerRpc(); } } } else if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); } break; case State.Diving: isAmbushing = false; base.agent.speed = chaseSpeed; base.agent.SetDestination(ambushNodePosition); if (((NetworkBehaviour)this).IsServer) { PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(60f, 60, -1); if ((Object)(object)val != (Object)null) { LogIfDebugBuild("[C.L.A.R.A] Saw player " + val.playerUsername + ", restarting chase"); base.targetPlayer = val; ((EnemyAI)this).ChangeOwnershipOfEnemy(base.targetPlayer.actualClientId); chaseLockOnTimer = 10f; lostPlayerTimer = 0f; SyncStateSafely(2); } } break; } if ((Object)(object)base.targetPlayer != (Object)null && base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3) { Vector3 val2 = (((Object)(object)base.targetPlayer.gameplayCamera != (Object)null) ? ((Component)base.targetPlayer.gameplayCamera).transform.position : (((Component)base.targetPlayer).transform.position + Vector3.up * 1.5f)); if (((EnemyAI)this).CheckLineOfSightForPosition(val2, 120f, 60, -1f, (Transform)null)) { hasLOS = true; lastPosition = ((Component)base.targetPlayer).transform.position; if (base.currentBehaviourStateIndex == 0) { LogIfDebugBuild("[C.L.A.R.A] Line of sight gained on player: " + base.targetPlayer.playerUsername + ". Stalking target."); SyncStateSafely(1); } } else { if (hasLOS) { LogIfDebugBuild("[C.L.A.R.A] Lost target."); } hasLOS = false; } } SyncTargetPlayer(); } public override void Update() { //IL_006b: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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_0280: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0d18: Unknown result type (might be due to invalid IL or missing references) //IL_0d1e: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_0a1c: Unknown result type (might be due to invalid IL or missing references) //IL_0a38: Unknown result type (might be due to invalid IL or missing references) //IL_0a44: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b3a: Unknown result type (might be due to invalid IL or missing references) //IL_0b5f: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0b67: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { return; } if (((NetworkBehaviour)this).IsServer) { UpdateClaraOwnership(); if (base.currentBehaviourStateIndex == 2 && (Object)(object)base.targetPlayer != (Object)null && (base.targetPlayer.isPlayerDead || !base.targetPlayer.isInsideFactory || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 100f)) { LogIfDebugBuild("[C.L.A.R.A] Ending chase."); EndChaseAndStartDiving(); } } bool flag = base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3; if (flag && localMeshesDisabled) { ((EnemyAI)this).EnableEnemyMesh(true, false, false); localMeshesDisabled = false; } else if (!flag && !localMeshesDisabled) { ((EnemyAI)this).EnableEnemyMesh(false, false, true); localMeshesDisabled = true; } ScanNodeProperties componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.SetActive(base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3); } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetBool("isStunned", true); } } else if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetBool("isStunned", false); } if (isAmbushing || (base.inSpecialAnimation && base.currentBehaviourStateIndex != 3) || (base.currentBehaviourStateIndex == 3 && base.inSpecialAnimation)) { if (((Component)this).transform.position != ambushNodePosition) { ((Component)this).transform.position = ambushNodePosition; } if (isEmergingAnimationPlaying) { emergenceTransitionTimer -= Time.deltaTime; if (shouldSpawnMoundAfterTransition && emergenceTransitionTimer <= 0.5f && (Object)(object)exitMound != (Object)null) { GameObject item = Object.Instantiate(exitMound, emergenceMoundPosition, emergenceMoundRotation); activeMounds.Add(item); shouldSpawnMoundAfterTransition = false; } if (emergenceTransitionTimer <= 0f) { isEmergingAnimationPlaying = false; base.inSpecialAnimation = false; base.agent.speed = chaseSpeed; ambushNodePosition = Vector3.zero; if ((Object)(object)emergenceParticles != (Object)null) { emergenceParticles.SetActive(true); ParticleSystem[] componentsInChildren = emergenceParticles.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { val.Play(); } } if ((Object)(object)GameNetworkManager.Instance != (Object)null) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && !localPlayerController.isPlayerDead && localPlayerController.isPlayerControlled) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position); if (num <= 20f && (Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } } LogIfDebugBuild("[C.L.A.R.A] Emerged successfully."); } } } if (isPeeking) { peekTimer -= Time.deltaTime; if (peekTimer <= 0f) { isPeeking = false; if ((Object)(object)fakeClaraInstance != (Object)null) { Animator component = fakeClaraInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetBool("isPeeking", false); } } fakeClaraDeactivateTimer = 1f; if (((NetworkBehaviour)this).IsServer && base.currentBehaviourStateIndex == 0) { Transform closestNode = GetClosestNode(peekingMoundPosition); if ((Object)(object)closestNode != (Object)null) { LogIfDebugBuild("[Clara Event] Jumpscare completed. CLARA teleporting."); StopPeekingAndWarpClientRpc(closestNode.position); } } } } if (fakeClaraDeactivateTimer > 0f) { fakeClaraDeactivateTimer -= Time.deltaTime; if (fakeClaraDeactivateTimer <= 0f && (Object)(object)fakeClaraInstance != (Object)null) { fakeClaraInstance.SetActive(false); } } if (base.currentBehaviourStateIndex == 2 && chaseLockOnTimer > 0f) { chaseLockOnTimer -= Time.deltaTime; } if (base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3) { if (attackSFXTimer > 0f) { attackSFXTimer -= Time.deltaTime; if ((Object)(object)base.creatureSFX != (Object)null && base.creatureSFX.isPlaying) { base.creatureSFX.Stop(); } } else if ((Object)(object)base.creatureSFX != (Object)null && drillClips != null && drillClips.Length != 0 && !base.creatureSFX.isPlaying && !isEmergingAnimationPlaying) { base.creatureSFX.clip = drillClips[0]; base.creatureSFX.loop = true; base.creatureSFX.Play(); } } else if ((Object)(object)base.creatureSFX != (Object)null && base.creatureSFX.isPlaying) { base.creatureSFX.Stop(); } if ((Object)(object)StepsSFX != (Object)null) { StepsSFX.mute = base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3; } if ((Object)(object)base.targetPlayer != (Object)null && base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3) { bool flag2 = Vector3.Distance(((Component)base.targetPlayer).transform.position, lastPlayerPos) > 0.01f; lastPlayerPos = ((Component)base.targetPlayer).transform.position; if ((Object)(object)diggingSFX != (Object)null) { if (flag2) { if (!diggingSFX.isPlaying) { diggingSFX.Play(); } } else if (diggingSFX.isPlaying) { diggingSFX.Pause(); } } } timeSinceHittingPlayer += Time.deltaTime; switch ((State)base.currentBehaviourStateIndex) { case State.Searching: if (checkLineOfSightInterval > 0.05f) { checkLineOfSightInterval = 0f; PlayerControllerB val2 = ((EnemyAI)this).CheckLineOfSightForPlayer(60f, 15, -1); if ((Object)(object)val2 != (Object)null) { noticePlayerTimer += 0.05f; if (noticePlayerTimer > 0.2f && ((NetworkBehaviour)this).IsServer) { base.targetPlayer = val2; SyncStateSafely(1); } } else { noticePlayerTimer = Mathf.Max(0f, noticePlayerTimer - Time.deltaTime); } } else { checkLineOfSightInterval += Time.deltaTime; } break; case State.Stalking: if ((Object)(object)GameNetworkManager.Instance != (Object)null) { PlayerControllerB localPlayerController2 = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController2 != (Object)null && !localPlayerController2.isPlayerDead && localPlayerController2.isPlayerControlled) { float num3 = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController2).transform.position); if (num3 <= 15f) { float num4 = Vector3.Distance(((Component)this).transform.position, lastFrameStalkPosition); if (num4 > 0.01f) { stalkShakeTimer -= Time.deltaTime; if (stalkShakeTimer <= 0f) { if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } stalkShakeTimer = 0.35f; } } } } } lastFrameStalkPosition = ((Component)this).transform.position; if (!((NetworkBehaviour)this).IsServer) { break; } if ((Object)(object)base.targetPlayer == (Object)null || !base.targetPlayer.isPlayerControlled || base.targetPlayer.isPlayerDead || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 50f) { isAmbushing = false; base.inSpecialAnimation = false; base.targetPlayer = null; SyncStateSafely(0); } else if (!isAmbushing) { GameObject closestFloorMound = GetClosestFloorMound(((Component)this).transform.position); if ((Object)(object)closestFloorMound != (Object)null && Vector3.Distance(((Component)this).transform.position, closestFloorMound.transform.position) < 10f) { emergeFromExistingMound = true; BeginAmbushSequence(closestFloorMound.transform.position, base.targetPlayer.actualClientId); break; } stalkSequenceTimer -= Time.deltaTime; voiceTimer -= Time.deltaTime; if (voiceTimer <= 0f && undergroundTauntLines != null && undergroundTauntLines.Length != 0) { int clipIndex2 = RoundManager.Instance.AnomalyRandom.Next(0, undergroundTauntLines.Length); PlayUndergroundTauntClientRpc(clipIndex2); voiceTimer = (float)RoundManager.Instance.AnomalyRandom.NextDouble() * 8f + 12f; } if (stalkSequenceTimer <= 0f) { Transform closestNode2 = GetClosestNode(((Component)this).transform.position); Vector3 targetNodePos = (((Object)(object)closestNode2 != (Object)null) ? closestNode2.position : ((Component)this).transform.position); BeginAmbushSequence(targetNodePos, base.targetPlayer.actualClientId); } } else { ambushTimer += Time.deltaTime; if (ambushTimer >= 3f) { TriggerEmergenceServerRpc(); } } break; case State.Chasing: if (((NetworkBehaviour)this).IsServer) { voiceTimer -= Time.deltaTime; if (voiceTimer <= 0f && aboveTauntLines != null && aboveTauntLines.Length != 0) { int clipIndex = RoundManager.Instance.AnomalyRandom.Next(0, aboveTauntLines.Length); PlayAboveTauntClientRpc(clipIndex); voiceTimer = (float)RoundManager.Instance.AnomalyRandom.NextDouble() * 8f + 12f; } } break; case State.Diving: if (base.inSpecialAnimation) { diveTimer -= Time.deltaTime; if (diveTimer <= 0f) { base.inSpecialAnimation = false; ((EnemyAI)this).EnableEnemyMesh(false, false, true); base.targetPlayer = null; base.movingTowardsTargetPlayer = false; ambushNodePosition = Vector3.zero; isAmbushing = false; if ((Object)(object)base.creatureSFX != (Object)null && base.creatureSFX.isPlaying) { base.creatureSFX.Stop(); } if (((NetworkBehaviour)this).IsServer) { SyncStateSafely(0); } } } else if (((NetworkBehaviour)this).IsServer) { float num2 = Vector3.Distance(((Component)this).transform.position, ambushNodePosition); if (num2 <= 1.5f) { TriggerDiveSequenceClientRpc(); } } break; } SyncTargetPlayer(); } private void UpdateClaraOwnership() { if (!base.isEnemyDead) { ulong num = 0uL; if ((Object)(object)base.targetPlayer != (Object)null) { num = base.targetPlayer.actualClientId; } if (((NetworkBehaviour)this).NetworkObject.OwnerClientId != num) { ((EnemyAI)this).ChangeOwnershipOfEnemy(num); } } } private void SyncTargetPlayer() { int num = (((Object)(object)base.targetPlayer != (Object)null) ? ((int)base.targetPlayer.actualClientId) : (-1)); if (num != lastTargetPlayerId) { lastTargetPlayerId = num; if (((NetworkBehaviour)this).IsServer) { SyncTargetClientRpc(num); } else if (((NetworkBehaviour)this).IsOwner) { SyncTargetServerRpc(num); } } } private void SpawnMounds(List availableNodes, out List positions, out List rotations) { //IL_0069: 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_018a: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01e5: 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_01ef: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) positions = new List(); rotations = new List(); List list = new List(); List list2 = new List(availableNodes); while (list.Count < numberOfMounds && list2.Count > 0) { int index = RoundManager.Instance.AnomalyRandom.Next(0, list2.Count); GameObject val = list2[index]; list2.RemoveAt(index); bool flag = false; foreach (GameObject item3 in list) { if (Vector3.Distance(val.transform.position, item3.transform.position) < 15f) { flag = true; break; } } if (!flag) { list.Add(val); availableNodes.Remove(val); } } while (list.Count < numberOfMounds && availableNodes.Count > 0) { int index2 = RoundManager.Instance.AnomalyRandom.Next(0, availableNodes.Count); GameObject item = availableNodes[index2]; list.Add(item); availableNodes.RemoveAt(index2); } int mask = LayerMask.GetMask(new string[4] { "Room", "Default", "Railings", "MiscLevelGeometry" }); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < list.Count; i++) { Vector3 val2 = list[i].transform.position; Quaternion item2 = list[i].transform.rotation; if (Physics.Raycast(val2 + Vector3.up * 1.5f, Vector3.down, ref val3, 5f, mask, (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val3)).point; item2 = Quaternion.FromToRotation(Vector3.up, ((RaycastHit)(ref val3)).normal); float num = (float)RoundManager.Instance.AnomalyRandom.NextDouble() * 360f; item2 *= Quaternion.AngleAxis(num, Vector3.up); } positions.Add(val2); rotations.Add(item2); } } private void SpawnCosmeticMounds(List remainingNodes, out List positions, out List rotations) { //IL_008d: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_0207: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: 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_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) positions = new List(); rotations = new List(); if (remainingNodes == null || remainingNodes.Count == 0) { return; } int num = Mathf.Min(numberOfCosmeticMounds, remainingNodes.Count); GameObject val = (((Object)(object)cosmeticMoundPrefab != (Object)null) ? cosmeticMoundPrefab : exitMound); int mask = LayerMask.GetMask(new string[4] { "Room", "Railings", "MiscLevelGeometry", "Default" }); Vector3[] obj = new Vector3[9] { Vector3.up, Vector3.forward, Vector3.back, Vector3.left, Vector3.right, default(Vector3), default(Vector3), default(Vector3), default(Vector3) }; Vector3 val2 = Vector3.up + Vector3.forward; obj[5] = ((Vector3)(ref val2)).normalized; val2 = Vector3.up + Vector3.back; obj[6] = ((Vector3)(ref val2)).normalized; val2 = Vector3.up + Vector3.left; obj[7] = ((Vector3)(ref val2)).normalized; val2 = Vector3.up + Vector3.right; obj[8] = ((Vector3)(ref val2)).normalized; Vector3[] collection = (Vector3[])(object)obj; RaycastHit val5 = default(RaycastHit); RaycastHit val11 = default(RaycastHit); for (int i = 0; i < num; i++) { int index = RoundManager.Instance.AnomalyRandom.Next(0, remainingNodes.Count); GameObject val3 = remainingNodes[index]; remainingNodes.RemoveAt(index); Vector3 position = val3.transform.position; bool flag = false; for (float num2 = 2f; num2 <= 15f; num2 += 3f) { List list = new List(collection); while (list.Count > 0) { int index2 = RoundManager.Instance.AnomalyRandom.Next(0, list.Count); Vector3 val4 = list[index2]; list.RemoveAt(index2); if (!Physics.Raycast(position, val4, ref val5, num2, mask, (QueryTriggerInteraction)1)) { continue; } bool flag2 = Mathf.Abs(((RaycastHit)(ref val5)).normal.y) < 0.1f; bool flag3 = ((RaycastHit)(ref val5)).normal.y < -0.9f; if (!flag2 && !flag3) { continue; } Quaternion val6 = Quaternion.FromToRotation(Vector3.up, ((RaycastHit)(ref val5)).normal); float num3 = (float)RoundManager.Instance.AnomalyRandom.NextDouble() * 360f; val6 *= Quaternion.AngleAxis(num3, Vector3.up); Vector3 item = ((RaycastHit)(ref val5)).point; Quaternion item2 = val6; bool flag4 = false; BoxCollider componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Vector3 size = componentInChildren.size; Vector3 val7 = val6 * Vector3.right; Vector3 val8 = val6 * Vector3.forward; Vector3[] array = (Vector3[])(object)new Vector3[13] { Vector3.zero, val7 * 0.2f, -val7 * 0.2f, val8 * 0.2f, -val8 * 0.2f, val7 * 0.4f, -val7 * 0.4f, val8 * 0.4f, -val8 * 0.4f, (val7 + val8) * 0.3f, (val7 - val8) * 0.3f, (-val7 + val8) * 0.3f, (-val7 - val8) * 0.3f }; Vector3[] array2 = array; foreach (Vector3 val9 in array2) { Vector3 val10 = ((RaycastHit)(ref val5)).point + val9 + ((RaycastHit)(ref val5)).normal * 0.5f; if (!Physics.Raycast(val10, -((RaycastHit)(ref val5)).normal, ref val11, 1f, mask, (QueryTriggerInteraction)1)) { continue; } Vector3 point = ((RaycastHit)(ref val11)).point; Quaternion val12 = Quaternion.FromToRotation(Vector3.up, ((RaycastHit)(ref val11)).normal); val12 *= Quaternion.AngleAxis(num3, Vector3.up); Vector3 val13 = point + ((RaycastHit)(ref val11)).normal * (size.y / 2f + 0.05f); Vector3 val14 = size / 2f; if (Physics.CheckBox(val13, val14, val12, mask, (QueryTriggerInteraction)1)) { continue; } float num4 = size.x / 2f; float num5 = size.z / 2f; Vector3[] array3 = (Vector3[])(object)new Vector3[4] { val12 * new Vector3(num4, 0f, num5), val12 * new Vector3(0f - num4, 0f, num5), val12 * new Vector3(num4, 0f, 0f - num5), val12 * new Vector3(0f - num4, 0f, 0f - num5) }; bool flag5 = true; Vector3[] array4 = array3; foreach (Vector3 val15 in array4) { Vector3 val16 = point + val15; Vector3 val17 = val16 + ((RaycastHit)(ref val11)).normal * 0.1f; if (!Physics.Raycast(val17, -((RaycastHit)(ref val11)).normal, 0.2f, mask, (QueryTriggerInteraction)1)) { flag5 = false; break; } } if (flag5) { item = point; item2 = val12; flag4 = true; break; } } } else { flag4 = true; } if (!flag4) { continue; } positions.Add(item); rotations.Add(item2); flag = true; break; } if (flag) { break; } } } } private void BeginAmbushSequence(Vector3 targetNodePos, ulong targetClientId) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) ambushNodePosition = targetNodePos; ambushTimer = 0f; isAmbushing = true; base.inSpecialAnimation = true; StopPeeking(); if (targetClientId < (ulong)StartOfRound.Instance.allPlayerScripts.Length) { base.targetPlayer = StartOfRound.Instance.allPlayerScripts[targetClientId]; } base.agent.Warp(RoundManager.Instance.GetNavMeshPosition(ambushNodePosition, default(NavMeshHit), 3f, base.agent.areaMask)); SyncAmbushStateClientRpc(isAmbushing, ambushNodePosition); SyncStateSafely(1); } [ClientRpc] private void SyncAmbushStateClientRpc(bool ambushing, Vector3 nodePos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_013a: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(996859016u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ambushing, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref nodePos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 996859016u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isAmbushing = ambushing; ambushNodePosition = nodePos; if (!((NetworkBehaviour)this).IsServer && (Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).enabled) { base.agent.Warp(RoundManager.Instance.GetNavMeshPosition(nodePos, default(NavMeshHit), 3f, base.agent.areaMask)); } } } [ServerRpc(RequireOwnership = false)] public void SyncTargetServerRpc(int playerClientId) { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(398899260u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerClientId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 398899260u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncTargetClientRpc(playerClientId); } } } [ClientRpc] public void SyncTargetClientRpc(int playerClientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3928459202u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerClientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3928459202u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerClientId < 0) { base.targetPlayer = null; } else if (playerClientId < StartOfRound.Instance.allPlayerScripts.Length) { base.targetPlayer = StartOfRound.Instance.allPlayerScripts[playerClientId]; } } } [ServerRpc(RequireOwnership = false)] public void RequestEndChaseServerRpc() { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(675243889u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 675243889u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EndChaseAndStartDiving(); } } } [ClientRpc] private void PlayAboveTauntClientRpc(int clipIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3278017721u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, clipIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3278017721u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (aboveTauntLines != null && clipIndex >= 0 && clipIndex < aboveTauntLines.Length) { base.creatureVoice.PlayOneShot(aboveTauntLines[clipIndex]); } } } [ClientRpc] private void PlayUndergroundTauntClientRpc(int clipIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1898981370u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, clipIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1898981370u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (undergroundTauntLines != null && clipIndex >= 0 && clipIndex < undergroundTauntLines.Length) { base.creatureVoice.PlayOneShot(undergroundTauntLines[clipIndex]); } } } public override void OnCollideWithPlayer(Collider other) { //IL_005c: 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) ((EnemyAI)this).OnCollideWithPlayer(other); if (base.currentBehaviourStateIndex == 2 && timeSinceHittingPlayer > 0.75f) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceHittingPlayer = 0f; val.DamagePlayer(damagePerHit, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); HitPlayerServerRpc((int)val.playerClientId); } } } [ServerRpc(RequireOwnership = false)] private void HitPlayerServerRpc(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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1970364661u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1970364661u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitPlayerClientRpc(playerId); } } } [ClientRpc] private void HitPlayerClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1405740449u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1405740449u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger("HitPlayer"); } if ((Object)(object)base.creatureVoice != (Object)null && (Object)(object)attackSFX != (Object)null) { base.creatureVoice.PlayOneShot(attackSFX); } attackSFXTimer = 1f; if ((Object)(object)base.creatureSFX != (Object)null) { base.creatureSFX.Stop(); } } } [ServerRpc(RequireOwnership = false)] private void TriggerEmergenceServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1054798166u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1054798166u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TriggerEmergenceClientRpc(ambushNodePosition, emergeFromExistingMound); } } } [ClientRpc] private void TriggerEmergenceClientRpc(Vector3 spawnPos, bool fromExistingMound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_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) //IL_014f: 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_01bf: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01b2: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1342887811u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref spawnPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref fromExistingMound, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1342887811u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val3 = spawnPos; Quaternion val4 = Quaternion.identity; int num = LayerMask.GetMask(new string[3] { "Room", "Colliders", "Map" }); if (num == 0 && (Object)(object)StartOfRound.Instance != (Object)null) { num = StartOfRound.Instance.collidersAndRoomMask; } RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(spawnPos + Vector3.up * 1.5f, Vector3.down, ref val5, 5f, num, (QueryTriggerInteraction)1)) { val3 = ((RaycastHit)(ref val5)).point; val4 = Quaternion.FromToRotation(Vector3.up, ((RaycastHit)(ref val5)).normal); float num2 = (float)RoundManager.Instance.AnomalyRandom.NextDouble() * 360f; val4 *= Quaternion.AngleAxis(num2, Vector3.up); } shouldSpawnMoundAfterTransition = !fromExistingMound; emergenceMoundPosition = val3; emergenceMoundRotation = val4; if ((Object)(object)emergenceParticles != (Object)null) { emergenceParticles.transform.position = val3; } if ((Object)(object)dirtTrailParticles != (Object)null) { dirtTrailParticles.SetActive(false); } ((EnemyAI)this).EnableEnemyMesh(true, false, false); if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger("isEmerging"); } isAmbushing = false; isEmergingAnimationPlaying = true; base.inSpecialAnimation = true; emergenceTransitionTimer = 1f; chaseLockOnTimer = 10f; lostPlayerTimer = 0f; StopPeeking(); if (!((NetworkBehaviour)this).IsServer && (Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).enabled) { base.agent.Warp(RoundManager.Instance.GetNavMeshPosition(val3, default(NavMeshHit), 3f, base.agent.areaMask)); } SyncAmbushStateClientRpc(ambushing: false, spawnPos); if (base.currentBehaviourStateIndex != 2) { SyncStateSafely(2); } } } [ServerRpc(RequireOwnership = false)] public void RequestPeekingServerRpc(Vector3 position, Quaternion rotation) { //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_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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3573204189u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3573204189u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.isEnemyDead && base.currentBehaviourStateIndex == 0) { TriggerPeekingClientRpc(position, rotation); } } } [ClientRpc] private void TriggerPeekingClientRpc(Vector3 position, Quaternion rotation) { //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_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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(73537988u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 73537988u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)fakeClaraInstance != (Object)null && !isAmbushing && base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3) { peekingMoundPosition = position; fakeClaraInstance.transform.position = position; fakeClaraInstance.transform.rotation = rotation; fakeClaraInstance.SetActive(true); isPeeking = true; peekTimer = 5f; fakeClaraHeadBone = FindChildRecursive(fakeClaraInstance.transform, "CC_Base_NeckTwist01"); Animator component = fakeClaraInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetBool("isPeeking", true); } LogIfDebugBuild($"[C.L.A.R.A] Jumpscare peeking triggered at: {position}"); } } private void StopPeeking() { isPeeking = false; if ((Object)(object)fakeClaraInstance != (Object)null) { Animator component = fakeClaraInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetBool("isPeeking", false); } fakeClaraDeactivateTimer = 1f; } } [ClientRpc] private void StopPeekingAndWarpClientRpc(Vector3 warpPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3560281727u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref warpPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3560281727u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopPeeking(); Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(warpPosition, default(NavMeshHit), 3f, base.agent.areaMask); if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).enabled) { base.agent.Warp(navMeshPosition); } ((Component)this).transform.position = navMeshPosition; if (((NetworkBehaviour)this).IsServer) { base.serverPosition = navMeshPosition; ((EnemyAI)this).SyncPositionToClients(); } } } private Transform FindChildRecursive(Transform parent, string name) { if (((Object)parent).name == name) { return parent; } for (int i = 0; i < parent.childCount; i++) { Transform val = FindChildRecursive(parent.GetChild(i), name); if ((Object)(object)val != (Object)null) { return val; } } return null; } private PlayerControllerB GetClosestActivePlayer(Vector3 position) { //IL_0068: 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) PlayerControllerB result = null; float num = float.MaxValue; if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.allPlayerScripts != null) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && !val.isPlayerDead) { float num2 = Vector3.Distance(position, ((Component)val).transform.position); if (num2 < num) { num = num2; result = val; } } } } return result; } public virtual void LateUpdate() { //IL_003a: 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_0076: 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_008b: 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_00af: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0133: Unknown result type (might be due to invalid IL or missing references) if (!isPeeking || !((Object)(object)fakeClaraHeadBone != (Object)null) || !((Object)(object)fakeClaraInstance != (Object)null)) { return; } PlayerControllerB closestActivePlayer = GetClosestActivePlayer(fakeClaraInstance.transform.position); if (!((Object)(object)closestActivePlayer != (Object)null) || !((Object)(object)closestActivePlayer.gameplayCamera != (Object)null)) { return; } Vector3 position = ((Component)closestActivePlayer.gameplayCamera).transform.position; Vector3 val = position - fakeClaraHeadBone.position; if (val != Vector3.zero && Vector3.Angle(fakeClaraInstance.transform.forward, val) <= 90f) { Vector3 val2 = Vector3.ProjectOnPlane(val, fakeClaraInstance.transform.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; if (normalized != Vector3.zero) { Quaternion val3 = Quaternion.LookRotation(normalized, fakeClaraInstance.transform.up); fakeClaraHeadBone.rotation = Quaternion.Slerp(fakeClaraHeadBone.rotation, val3, 10f * Time.deltaTime); } } } private GameObject GetClosestFloorMound(Vector3 position) { //IL_0054: 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) if (activeMounds == null || activeMounds.Count == 0) { return null; } GameObject result = null; float num = float.MaxValue; foreach (GameObject activeMound in activeMounds) { if (!((Object)(object)activeMound == (Object)null)) { float num2 = Vector3.Distance(position, activeMound.transform.position); if (num2 < num) { num = num2; result = activeMound; } } } return result; } private void EndChaseAndStartDiving() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { GameObject closestFloorMound = GetClosestFloorMound(((Component)this).transform.position); if ((Object)(object)closestFloorMound != (Object)null) { base.targetPlayer = null; base.movingTowardsTargetPlayer = false; SyncDiveStateClientRpc(closestFloorMound.transform.position); SyncStateSafely(3); } else { base.targetPlayer = null; base.movingTowardsTargetPlayer = false; SyncStateSafely(0); } } } [ClientRpc] private void SyncDiveStateClientRpc(Vector3 moundPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1962733474u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moundPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1962733474u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ambushNodePosition = moundPos; base.targetPlayer = null; base.movingTowardsTargetPlayer = false; } } } [ClientRpc] private void TriggerDiveSequenceClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(874450850u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 874450850u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogIfDebugBuild("[CLARA] Arrived at dive mound. Triggering dive animation."); base.inSpecialAnimation = true; diveTimer = 1.5f; if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger("isDiving"); } if ((Object)(object)diggingSFX != (Object)null && diggingClips != null && diggingClips.Length != 0) { diggingSFX.clip = diggingClips[0]; diggingSFX.loop = true; diggingSFX.Play(); } } } public override void FinishedCurrentSearchRoutine() { ((EnemyAI)this).FinishedCurrentSearchRoutine(); if (searchForPlayers != null) { searchForPlayers.searchWidth = Mathf.Clamp(searchForPlayers.searchWidth + 10f, 1f, 100f); } } private Transform GetClosestNode(Vector3 pos) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (base.allAINodes == null || base.allAINodes.Length == 0) { return null; } Transform result = null; float num = float.MaxValue; GameObject[] allAINodes = base.allAINodes; foreach (GameObject val in allAINodes) { if (!((Object)(object)val == (Object)null)) { float num2 = Vector3.Distance(pos, val.transform.position); if (num2 < num) { num = num2; result = val.transform; } } } return result; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.isEnemyDead || (base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3)) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { base.enemyHP -= force; if ((Object)(object)base.enemyType.hitBodySFX != (Object)null) { base.creatureVoice.PlayOneShot(base.enemyType.hitBodySFX); } if (base.enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger("isHit"); } } } public override void KillEnemy(bool destroy = false) { //IL_0157: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead) { return; } if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Stop(); } if ((Object)(object)base.creatureSFX != (Object)null) { base.creatureSFX.Stop(); } if ((Object)(object)diggingSFX != (Object)null) { diggingSFX.Stop(); } if ((Object)(object)StepsSFX != (Object)null) { StepsSFX.Stop(); } StopPeeking(); if ((Object)(object)base.enemyType.deathSFX != (Object)null) { base.dieSFX = base.enemyType.deathSFX; } ((EnemyAI)this).KillEnemy(destroy); if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger("hasDied"); } if (base.skinnedMeshRenderers == null) { return; } SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer val in skinnedMeshRenderers) { if (!((Object)(object)val != (Object)null) || ((Renderer)val).materials == null) { continue; } Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { if ((Object)(object)val2 != (Object)null) { val2.SetColor("_EmissiveColor", Color.black); val2.SetFloat("_EmissiveIntensity", 0f); val2.DisableKeyword("_EMISSIVE"); } } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null) { if (base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); if (!base.isEnemyDead && base.enemyType.canBeStunned && setToStunned && base.postStunInvincibilityTimer <= 0f && (Object)(object)base.enemyType.stunSFX != (Object)null) { base.creatureVoice.PlayOneShot(base.enemyType.stunSFX); } } } private void SpawnAllMounds() { //IL_0053: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).GetAINodes(); List list = new List(base.allAINodes); SpawnMounds(list, out List positions, out List rotations); SpawnCosmeticMounds(list, out List positions2, out List rotations2); activeMounds.Clear(); cosmeticMounds.Clear(); for (int i = 0; i < positions.Count; i++) { GameObject item = Object.Instantiate(exitMound, positions[i], rotations[i]); activeMounds.Add(item); } GameObject val = (((Object)(object)cosmeticMoundPrefab != (Object)null) ? cosmeticMoundPrefab : exitMound); for (int j = 0; j < positions2.Count; j++) { GameObject val2 = Object.Instantiate(val, positions2[j], rotations2[j]); cosmeticMounds.Add(val2); SphereCollider val3 = val2.AddComponent(); if ((Object)(object)val3 != (Object)null) { ((Collider)val3).isTrigger = true; val3.radius = 4f; } CosmeticMoundTrigger cosmeticMoundTrigger = val2.AddComponent(); if ((Object)(object)cosmeticMoundTrigger != (Object)null) { cosmeticMoundTrigger.clara = this; } } SyncSpawnedMoundsClientRpc(positions.ToArray(), rotations.ToArray(), positions2.ToArray(), rotations2.ToArray()); } [ClientRpc] private void SyncSpawnedMoundsClientRpc(Vector3[] usablePositions, Quaternion[] usableRotations, Vector3[] cosmeticPositions, Quaternion[] cosmeticRotations) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024f: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3505657845u, val2, (RpcDelivery)0); bool flag = usablePositions != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(usablePositions); } bool flag2 = usableRotations != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(usableRotations); } bool flag3 = cosmeticPositions != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(cosmeticPositions); } bool flag4 = cosmeticRotations != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag4, default(ForPrimitives)); if (flag4) { ((FastBufferWriter)(ref val)).WriteValueSafe(cosmeticRotations); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3505657845u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { return; } activeMounds.Clear(); cosmeticMounds.Clear(); for (int i = 0; i < usablePositions.Length; i++) { GameObject item = Object.Instantiate(exitMound, usablePositions[i], usableRotations[i]); activeMounds.Add(item); } GameObject val3 = (((Object)(object)cosmeticMoundPrefab != (Object)null) ? cosmeticMoundPrefab : exitMound); for (int j = 0; j < cosmeticPositions.Length; j++) { GameObject val4 = Object.Instantiate(val3, cosmeticPositions[j], cosmeticRotations[j]); cosmeticMounds.Add(val4); SphereCollider val5 = val4.AddComponent(); if ((Object)(object)val5 != (Object)null) { ((Collider)val5).isTrigger = true; val5.radius = 4f; } CosmeticMoundTrigger cosmeticMoundTrigger = val4.AddComponent(); if ((Object)(object)cosmeticMoundTrigger != (Object)null) { cosmeticMoundTrigger.clara = this; } } } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); if (activeMounds != null) { foreach (GameObject activeMound in activeMounds) { if ((Object)(object)activeMound != (Object)null) { Object.Destroy((Object)(object)activeMound); } } } if (cosmeticMounds != null) { foreach (GameObject cosmeticMound in cosmeticMounds) { if ((Object)(object)cosmeticMound != (Object)null) { Object.Destroy((Object)(object)cosmeticMound); } } } if ((Object)(object)fakeClaraInstance != (Object)null) { Object.Destroy((Object)(object)fakeClaraInstance); } } 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 //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3603477563u, new RpcReceiveHandler(__rpc_handler_3603477563), "SyncStateSafelyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3966759624u, new RpcReceiveHandler(__rpc_handler_3966759624), "SyncStateSafelyClientRpc"); ((NetworkBehaviour)this).__registerRpc(996859016u, new RpcReceiveHandler(__rpc_handler_996859016), "SyncAmbushStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(398899260u, new RpcReceiveHandler(__rpc_handler_398899260), "SyncTargetServerRpc"); ((NetworkBehaviour)this).__registerRpc(3928459202u, new RpcReceiveHandler(__rpc_handler_3928459202), "SyncTargetClientRpc"); ((NetworkBehaviour)this).__registerRpc(675243889u, new RpcReceiveHandler(__rpc_handler_675243889), "RequestEndChaseServerRpc"); ((NetworkBehaviour)this).__registerRpc(3278017721u, new RpcReceiveHandler(__rpc_handler_3278017721), "PlayAboveTauntClientRpc"); ((NetworkBehaviour)this).__registerRpc(1898981370u, new RpcReceiveHandler(__rpc_handler_1898981370), "PlayUndergroundTauntClientRpc"); ((NetworkBehaviour)this).__registerRpc(1970364661u, new RpcReceiveHandler(__rpc_handler_1970364661), "HitPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1405740449u, new RpcReceiveHandler(__rpc_handler_1405740449), "HitPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1054798166u, new RpcReceiveHandler(__rpc_handler_1054798166), "TriggerEmergenceServerRpc"); ((NetworkBehaviour)this).__registerRpc(1342887811u, new RpcReceiveHandler(__rpc_handler_1342887811), "TriggerEmergenceClientRpc"); ((NetworkBehaviour)this).__registerRpc(3573204189u, new RpcReceiveHandler(__rpc_handler_3573204189), "RequestPeekingServerRpc"); ((NetworkBehaviour)this).__registerRpc(73537988u, new RpcReceiveHandler(__rpc_handler_73537988), "TriggerPeekingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3560281727u, new RpcReceiveHandler(__rpc_handler_3560281727), "StopPeekingAndWarpClientRpc"); ((NetworkBehaviour)this).__registerRpc(1962733474u, new RpcReceiveHandler(__rpc_handler_1962733474), "SyncDiveStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(874450850u, new RpcReceiveHandler(__rpc_handler_874450850), "TriggerDiveSequenceClientRpc"); ((NetworkBehaviour)this).__registerRpc(3505657845u, new RpcReceiveHandler(__rpc_handler_3505657845), "SyncSpawnedMoundsClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3603477563(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int newStateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newStateIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncStateSafelyServerRpc(newStateIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3966759624(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int newStateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newStateIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncStateSafelyClientRpc(newStateIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_996859016(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool ambushing = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ambushing, default(ForPrimitives)); Vector3 nodePos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref nodePos); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncAmbushStateClientRpc(ambushing, nodePos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_398899260(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerClientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncTargetServerRpc(playerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3928459202(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerClientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncTargetClientRpc(playerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_675243889(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).RequestEndChaseServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3278017721(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int clipIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).PlayAboveTauntClientRpc(clipIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1898981370(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int clipIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).PlayUndergroundTauntClientRpc(clipIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1970364661(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).HitPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1405740449(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).HitPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1054798166(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).TriggerEmergenceServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1342887811(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: 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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); bool fromExistingMound = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fromExistingMound, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).TriggerEmergenceClientRpc(spawnPos, fromExistingMound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3573204189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).RequestPeekingServerRpc(position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_73537988(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).TriggerPeekingClientRpc(position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3560281727(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 warpPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref warpPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).StopPeekingAndWarpClientRpc(warpPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1962733474(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 moundPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moundPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncDiveStateClientRpc(moundPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_874450850(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).TriggerDiveSequenceClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3505657845(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); Vector3[] usablePositions = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref usablePositions); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Quaternion[] usableRotations = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref usableRotations); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); Vector3[] cosmeticPositions = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref cosmeticPositions); } bool flag4 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag4, default(ForPrimitives)); Quaternion[] cosmeticRotations = null; if (flag4) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref cosmeticRotations); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaraAI)(object)target).SyncSpawnedMoundsClientRpc(usablePositions, usableRotations, cosmeticPositions, cosmeticRotations); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ClaraAI"; } } public class CosmeticMoundTrigger : MonoBehaviour { public ClaraAI clara; private void OnTriggerEnter(Collider other) { //IL_00e0: 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_009c: 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) if ((Object)(object)clara == (Object)null || ((EnemyAI)clara).isEnemyDead) { return; } PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null) || !component.isPlayerControlled) { return; } if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.AnomalyRandom != null) { if (RoundManager.Instance.AnomalyRandom.Next(0, 100) < 30) { clara.RequestPeekingServerRpc(((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.rotation); } } else if (Random.Range(0, 100) < 30) { clara.RequestPeekingServerRpc(((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.rotation); } } } internal class ClaraContentHandler : ContentHandler { public class CLARAAssets : AssetBundleLoader { [LoadFromBundle("CLARA.prefab")] public GameObject CLARA { get; private set; } = null; public CLARAAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } internal CLARAAssets? claraAssets; public ClaraContentHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent("clara", ref claraAssets, false); } } [BepInPlugin("reiko888.CLARA", "C.L.A.R.A", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { public const string modGUID = "reiko888.CLARA"; public const string modName = "C.L.A.R.A"; public const string modVersion = "1.0.0"; public static Plugin Instance = null; internal static ManualLogSource Logger = null; internal static readonly Harmony harmony = new Harmony("reiko888.CLARA"); internal static DuskMod mod = null; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Logger = ((BaseUnityPlugin)this).Logger; AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "clara_container"); mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); mod.RegisterContentHandlers(); harmony.PatchAll(Assembly.GetExecutingAssembly()); Logger.LogInfo((object)"Plugin C.L.A.R.A is loaded!"); } } public class CLARATerminalAssets : MonoBehaviour { public VideoClip bestiaryVideo; } [HarmonyPatch(typeof(Terminal))] internal class TerminalVideoInjectorPatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void InjectVideo(Terminal __instance) { if ((Object)(object)ContentHandler.Instance.claraAssets.CLARA == (Object)null) { return; } CLARATerminalAssets component = ContentHandler.Instance.claraAssets.CLARA.GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.bestiaryVideo == (Object)null) { return; } foreach (TerminalNode enemyFile in __instance.enemyFiles) { if ((Object)(object)enemyFile != (Object)null && ((Object)enemyFile).name == "C.L.A.R.ABestiaryNode") { enemyFile.displayVideo = component.bestiaryVideo; return; } } Plugin.Logger.LogWarning((object)"Could not find a TerminalNode named 'CLARABestiaryNode' in the Bestiary."); } } public static class PluginInfo { public const string PLUGIN_GUID = "Reiko888.CLARA"; public const string PLUGIN_NAME = "Blood Witch"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace Reiko888.CLARA.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }