using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using BlackMesa.Compatibility; using BlackMesa.Components; using BlackMesa.Interfaces; using BlackMesa.NetcodePatcher; using BlackMesa.Patches; using BlackMesa.Utilities; using DunGen; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using LCVR; using LCVR.Physics.Interactions; using Microsoft.CodeAnalysis; using PathfindingLib.API.SmartPathfinding; using Unity.Netcode; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.VFX; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [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("LCVR")] [assembly: IgnoresAccessChecksTo("LCVR.Preload")] [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.Interaction.Toolkit")] [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("BlackMesa")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A Black Mesa mod for Lethal Company ")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+75837a7c198f5436f1586147ad3696d952a8e695")] [assembly: AssemblyProduct("BlackMesa")] [assembly: AssemblyTitle("BlackMesa")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class BarnacleGrabTrigger : MonoBehaviour { public Barnacle barnacle; private void OnTriggerStay(Collider other) { PlayerControllerB player = default(PlayerControllerB); if (((Component)other).TryGetComponent(ref player)) { barnacle.TryGrabPlayerOrHeldItem(player); } GrabbableObject item = default(GrabbableObject); if (((Component)other).TryGetComponent(ref item)) { barnacle.GrabItem(item); } EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((Component)other).TryGetComponent(ref val)) { barnacle.GrabEnemy(val.mainScript); } } } public class RigidbodyGravity : MonoBehaviour { public Vector3 gravity = Vector3.down * 15.9f; private Rigidbody rigidBody; private void Start() { rigidBody = ((Component)this).GetComponent(); rigidBody.useGravity = false; } private void FixedUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) rigidBody.AddForce(gravity, (ForceMode)5); } } namespace BlackMesa { public class AcidWater : MonoBehaviour { public int DamageAmount; public float DamageTickRate; private float TimeSincePlayerDamaged; private void OnTriggerStay(Collider other) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (((Component)other).gameObject.CompareTag("Player")) { if (TimeSincePlayerDamaged < DamageTickRate) { TimeSincePlayerDamaged += Time.deltaTime; } else if ((Object)(object)component != (Object)null) { TimeSincePlayerDamaged = 0f; component.DamagePlayer(DamageAmount, true, true, (CauseOfDeath)9, 0, false, default(Vector3)); } } } } public class BlackMesaTV : NetworkBehaviour { public bool tvOn; private bool wasTvOnLastFrame; public MeshRenderer tvMesh; public VideoPlayer video; [Space(5f)] public VideoClip[] tvClips; public AudioClip[] tvAudioClips; [Space(5f)] private float currentClipTime; private int currentClip; public Material tvOnMaterial; public Material tvOffMaterial; public AudioClip switchTVOn; public AudioClip switchTVOff; public AudioSource tvSFX; private float timeSinceTurningOffTV; public Light tvLight; public void TurnTVOnOff(bool on) { Debug.Log((object)"TurnTVOnOff"); tvOn = on; if (on) { tvSFX.clip = tvAudioClips[currentClip]; tvSFX.time = currentClipTime; tvSFX.Play(); tvSFX.PlayOneShot(switchTVOn); WalkieTalkie.TransmitOneShotAudio(tvSFX, switchTVOn, 1f); } else { tvSFX.Stop(); tvSFX.PlayOneShot(switchTVOff); WalkieTalkie.TransmitOneShotAudio(tvSFX, switchTVOff, 1f); } } public void SwitchTVLocalClient() { Debug.Log((object)"SwitchTVLocalClient"); if (tvOn) { TurnOffTVServerRpc(); } else { TurnOnTVServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void TurnOnTVServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3283880837u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3283880837u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"TurnOnTVServerRpc"); timeSinceTurningOffTV = 0f; if (timeSinceTurningOffTV > 7f) { TurnOnTVAndSyncClientRpc(currentClip, currentClipTime); } else { TurnOnTVClientRpc(); } } } [ClientRpc] public void TurnOnTVClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(695285450u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 695285450u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"TurnOnTVClientRpc"); TurnTVOnOff(on: true); } } } [ClientRpc] public void TurnOnTVAndSyncClientRpc(int clipIndex, float clipTime) { //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_0071: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3721177157u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clipIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clipTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3721177157u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"TurnOnTVAndSyncClientRpc"); currentClip = clipIndex; currentClipTime = clipTime; TurnTVOnOff(on: true); } } } [ServerRpc(RequireOwnership = false)] public void TurnOffTVServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2933561972u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2933561972u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TurnOffTVClientRpc(); } } } [ClientRpc] public void TurnOffTVClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1766435624u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1766435624u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"TurnOffTVClientRpc"); TurnTVOnOff(on: false); } } } [ServerRpc(RequireOwnership = false)] public void SyncTVServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2492773695u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2492773695u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncTVClientRpc(currentClip, currentClipTime, tvOn); } } } [ClientRpc] public void SyncTVClientRpc(int clipIndex, float clipTime, bool isOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2381994938u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clipIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clipTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2381994938u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncTimeAndClipWithClients(clipIndex, clipTime, isOn); } } } private void SyncTimeAndClipWithClients(int clipIndex, float clipTime, bool isOn) { currentClip = clipIndex; currentClipTime = clipTime; tvOn = isOn; } private void OnEnable() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Debug.Log((object)"OnEnable"); video.loopPointReached += new EventHandler(TVFinishedClip); } private void OnDisable() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Debug.Log((object)"OnDisable"); video.loopPointReached -= new EventHandler(TVFinishedClip); } private void TVFinishedClip(VideoPlayer source) { if (tvOn && !GameNetworkManager.Instance.localPlayerController.isInsideFactory) { currentClip = (currentClip + 1) % tvClips.Length; video.clip = tvClips[currentClip]; video.Play(); tvSFX.clip = tvAudioClips[currentClip]; tvSFX.time = 0f; tvSFX.Play(); } } private void Update() { if (NetworkManager.Singleton.ShutdownInProgress || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } if (!tvOn) { Debug.Log((object)"TV is off"); if (wasTvOnLastFrame) { wasTvOnLastFrame = false; SetTVScreenMaterial(on: false); currentClipTime = (float)video.time; video.Stop(); } if (((NetworkBehaviour)this).IsServer && !tvOn) { timeSinceTurningOffTV += Time.deltaTime; } currentClipTime += Time.deltaTime; if ((double)currentClipTime > tvClips[currentClip].length) { currentClip = (currentClip + 1) % tvClips.Length; currentClipTime = 0f; if (tvOn) { tvSFX.clip = tvAudioClips[currentClip]; tvSFX.Play(); } } } else { if (!wasTvOnLastFrame) { Debug.Log((object)"TV is on"); wasTvOnLastFrame = true; SetTVScreenMaterial(on: true); video.clip = tvClips[currentClip]; video.time = currentClipTime; video.Play(); } currentClipTime = (float)video.time; } } private void SetTVScreenMaterial(bool on) { Material[] sharedMaterials = ((Renderer)tvMesh).sharedMaterials; if (on) { sharedMaterials[1] = tvOnMaterial; } else { sharedMaterials[1] = tvOffMaterial; } ((Renderer)tvMesh).sharedMaterials = sharedMaterials; ((Behaviour)tvLight).enabled = on; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3283880837u, new RpcReceiveHandler(__rpc_handler_3283880837), "TurnOnTVServerRpc"); ((NetworkBehaviour)this).__registerRpc(695285450u, new RpcReceiveHandler(__rpc_handler_695285450), "TurnOnTVClientRpc"); ((NetworkBehaviour)this).__registerRpc(3721177157u, new RpcReceiveHandler(__rpc_handler_3721177157), "TurnOnTVAndSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(2933561972u, new RpcReceiveHandler(__rpc_handler_2933561972), "TurnOffTVServerRpc"); ((NetworkBehaviour)this).__registerRpc(1766435624u, new RpcReceiveHandler(__rpc_handler_1766435624), "TurnOffTVClientRpc"); ((NetworkBehaviour)this).__registerRpc(2492773695u, new RpcReceiveHandler(__rpc_handler_2492773695), "SyncTVServerRpc"); ((NetworkBehaviour)this).__registerRpc(2381994938u, new RpcReceiveHandler(__rpc_handler_2381994938), "SyncTVClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3283880837(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; ((BlackMesaTV)(object)target).TurnOnTVServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_695285450(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; ((BlackMesaTV)(object)target).TurnOnTVClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3721177157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: 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); float clipTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BlackMesaTV)(object)target).TurnOnTVAndSyncClientRpc(clipIndex, clipTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2933561972(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; ((BlackMesaTV)(object)target).TurnOffTVServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1766435624(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; ((BlackMesaTV)(object)target).TurnOffTVClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2492773695(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; ((BlackMesaTV)(object)target).SyncTVServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2381994938(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int clipIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex); float clipTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipTime, default(ForPrimitives)); bool isOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isOn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BlackMesaTV)(object)target).SyncTVClientRpc(clipIndex, clipTime, isOn); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BlackMesaTV"; } } public class ContainmentDoor : MonoBehaviour { public InteractTrigger triggerScript; private StartOfRound playersManager; public Animator shipDoorsAnimator; public bool buttonsEnabled = true; public float doorPower = 1f; public float doorPowerDuration = 10f; public bool overheated; public bool doorsOpenedInGameOverAnimation; public GameObject hydraulicsDisplay; private bool hydraulicsScreenDisplayed = true; public void Update() { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } SetScreenDisplay(); if (StartOfRound.Instance.hangarDoorsClosed && StartOfRound.Instance.shipHasLanded) { overheated = false; triggerScript.interactable = true; if (doorPower > 0f) { doorPower = Mathf.Clamp(doorPower - Time.deltaTime / doorPowerDuration, 0f, 1f); } else if (NetworkManager.Singleton.IsServer) { PlayDoorAnimation(closed: false); StartOfRound.Instance.SetShipDoorsOverheatServerRpc(); } } else { doorPower = Mathf.Clamp(doorPower + Time.deltaTime / (doorPowerDuration * 0.22f), 0f, 1f); if (overheated && doorPower >= 1f) { overheated = false; triggerScript.interactable = true; } } } private void SetScreenDisplay() { bool flag = true; if (hydraulicsScreenDisplayed != flag) { hydraulicsScreenDisplayed = flag; hydraulicsDisplay.SetActive(flag); } } public void PlayDoorAnimation(bool closed) { if (buttonsEnabled) { shipDoorsAnimator.SetBool("Closed", closed); } } public void SetDoorClosed() { playersManager.SetShipDoorsClosed(true); } public void SetDoorOpen() { playersManager.SetShipDoorsClosed(false); } public void SetDoorButtonsEnabled(bool doorButtonsEnabled) { buttonsEnabled = true; } private void Start() { playersManager = Object.FindObjectOfType(); } } public class Crowbar : GrabbableObject { public AudioSource knifeAudio; private List objectsHitByKnifeList = new List(); public PlayerControllerB previousPlayerHeldBy; private RaycastHit[] objectsHitByKnife; public int knifeHitForce; public AudioClip[] hitSFX; public AudioClip[] swingSFX; private int knifeMask = 11012424; private float timeAtLastDamageDealt; public ParticleSystem bloodParticle; public override void ItemActivate(bool used, bool buttonDown = true) { RoundManager.PlayRandomClip(knifeAudio, swingSFX, true, 1f, 0, 1000); if ((Object)(object)base.playerHeldBy != (Object)null) { previousPlayerHeldBy = base.playerHeldBy; if (((NetworkBehaviour)base.playerHeldBy).IsOwner) { base.playerHeldBy.playerBodyAnimator.SetTrigger("UseHeldItem1"); } } if (((NetworkBehaviour)this).IsOwner) { HitKnife(); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); } public void HitKnife(bool cancel = false) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_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_01e0: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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) if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called."); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByKnife = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * 0.1f, 0.6f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 2f, knifeMask, (QueryTriggerInteraction)2); objectsHitByKnifeList = objectsHitByKnife.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); IHittable val2 = default(IHittable); for (int i = 0; i < objectsHitByKnifeList.Count; i++) { RaycastHit val = objectsHitByKnifeList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByKnifeList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByKnifeList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByKnifeList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByKnifeList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; RaycastHit val3 = objectsHitByKnifeList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val3)).point, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { if (Time.realtimeSinceStartup - timeAtLastDamageDealt > 5f) { timeAtLastDamageDealt = Time.realtimeSinceStartup; val2.Hit(knifeHitForce, forward, previousPlayerHeldBy, true, 5); bloodParticle.Play(true); } flag2 = true; } catch (Exception arg) { Debug.Log((object)$"Exception caught when hitting object with shovel from player #{previousPlayerHeldBy.playerClientId}: {arg}"); } continue; } } flag = true; val = objectsHitByKnifeList[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; break; } } } } if (flag) { RoundManager.PlayRandomClip(knifeAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { knifeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(knifeAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } HitShovelServerRpc(num); } } [ServerRpc] public void HitShovelServerRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(550859015u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 550859015u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitShovelClientRpc(hitSurfaceID); } } [ClientRpc] public void HitShovelClientRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3289785206u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3289785206u, val, (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).IsOwner) { RoundManager.PlayRandomClip(knifeAudio, hitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { HitSurfaceWithKnife(hitSurfaceID); } } } private void HitSurfaceWithKnife(int hitSurfaceID) { knifeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(knifeAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(550859015u, new RpcReceiveHandler(__rpc_handler_550859015), "HitShovelServerRpc"); ((NetworkBehaviour)this).__registerRpc(3289785206u, new RpcReceiveHandler(__rpc_handler_3289785206), "HitShovelClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_550859015(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Crowbar)(object)target).HitShovelServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3289785206(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Crowbar)(object)target).HitShovelClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Crowbar"; } } public class DamageZone : MonoBehaviour { public int DamageAmount; public float DamageTickRate; public CauseOfDeath cause; private float TimeSincePlayerDamaged; private void OnTriggerStay(Collider other) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (((Component)other).gameObject.CompareTag("Player")) { if (TimeSincePlayerDamaged < DamageTickRate) { TimeSincePlayerDamaged += Time.deltaTime; } else if ((Object)(object)component != (Object)null) { TimeSincePlayerDamaged = 0f; component.DamagePlayer(DamageAmount, true, true, cause, 0, false, default(Vector3)); } } } } internal interface INightVisionCamera { Camera Camera { get; } Light NightVisionLight { get; } } public class InstructionManual : GrabbableObject { public int currentPage = 1; public Animator clipboardAnimator; public AudioClip[] turnPageSFX; public AudioSource thisAudio; public override void PocketItem() { if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; base.isBeingUsed = false; } ((GrabbableObject)this).PocketItem(); } public override void ItemInteractLeftRight(bool right) { int num = currentPage; ((GrabbableObject)this).RequireCooldown(); if (right) { currentPage = Mathf.Clamp(currentPage + 1, 1, 4); } else { currentPage = Mathf.Clamp(currentPage - 1, 1, 4); } if (currentPage != num) { RoundManager.PlayRandomClip(thisAudio, turnPageSFX, true, 1f, 0, 1000); } clipboardAnimator.SetInteger("page", currentPage); } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } base.isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.DisplayTip("To read the manual:", "Press Z to inspect closely. Press Q and E to flip the pages.", false, true, "LCTip_UseManual"); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "InstructionManual"; } } internal class Laser : MonoBehaviour { private LineRenderer lr; private void Start() { lr = ((Component)this).GetComponent(); } private void LateUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) lr.SetPosition(0, ((Component)this).transform.position); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val)) { if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider)) { lr.SetPosition(1, ((RaycastHit)(ref val)).point); } } else { lr.SetPosition(1, ((Component)this).transform.position + ((Component)this).transform.forward * 5000f); } } } [BepInPlugin("Plastered_Crab.BlackMesaInterior", "Black Mesa Interior", "3.4.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency("Zaggy1024.PathfindingLib", "2.0.0")] public class BlackMesaInterior : BaseUnityPlugin { public const string GUID = "Plastered_Crab.BlackMesaInterior"; public const string NAME = "Black Mesa Interior"; public const string VERSION = "3.4.1"; public static BlackMesaInterior Instance; private readonly Harmony harmony = new Harmony("Plastered_Crab.BlackMesaInterior"); internal static ManualLogSource Logger; internal static AssetBundle Bundle; internal static GameObject GenerationRulesPrefab; internal static List PrefabsWithAudioSources = new List(); private void Awake() { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; harmony.PatchAll(typeof(PatchStartOfRound)); harmony.PatchAll(typeof(PatchRoundManager)); harmony.PatchAll(typeof(PatchNetworkManager)); harmony.PatchAll(typeof(PatchDungeonGenerator)); harmony.PatchAll(typeof(PatchLungProp)); harmony.PatchAll(typeof(PatchPlayerControllerB)); harmony.PatchAll(typeof(PatchDeadBodyInfo)); harmony.PatchAll(typeof(PatchMenuManager)); harmony.PatchAll(typeof(PatchAnimator)); harmony.PatchAll(typeof(PatchEnemyAI)); Bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Assets", "blackmesascriptassets")); GenerationRulesPrefab = Bundle.LoadAsset("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/GenerationRules.prefab"); } internal static bool IsBlackMesaInterior(DungeonFlow flow) { if ((Object)(object)flow == (Object)null) { return false; } return ((Object)flow).name == "Black Mesa"; } internal static void BatchAllTileModels(Dungeon dungeon) { int num = 0; foreach (Tile allTile in dungeon.AllTiles) { if (!((Object)(object)allTile == (Object)null)) { Transform val = ((Component)allTile).transform.Find("Models"); if (!((Object)(object)val == (Object)null)) { StaticBatchingUtility.Combine(((Component)val).gameObject); num++; } } } Logger.LogInfo((object)$"Marked {num} tiles to be static-batched."); } } public class RadiationWarningZone : MonoBehaviour { private void OnTriggerEnter(Collider radiationZone) { if (((Component)radiationZone).gameObject.CompareTag("Player") && !((Object)(object)radiationZone == (Object)null) && !((Object)(object)((Component)radiationZone).gameObject.GetComponent() != (Object)(object)StartOfRound.Instance.localPlayerController)) { Debug.Log((object)"Entered Radiation Warning Zone"); HUDManager.Instance.RadiationWarningHUD(); HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", true); } } private void OnTriggerExit(Collider radiationZone) { if (((Component)radiationZone).gameObject.CompareTag("Player") && !((Object)(object)radiationZone == (Object)null)) { ((Component)radiationZone).gameObject.GetComponent(); Debug.Log((object)"Exited Radiation Warning Zone"); HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); } } } public class SecurityCamera : NetworkBehaviour, INightVisionCamera { [SerializeField] private Camera camera; [SerializeField] private Light nightVisionLight; public Camera Camera => camera; public Light NightVisionLight => nightVisionLight; private void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown camera.targetTexture = new RenderTexture(camera.targetTexture); SecurityCameraManager.Instance.AssignSecurityCameraFeed(this); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SecurityCamera"; } } internal class SecurityCameraManager : MonoBehaviour { internal static SecurityCameraManager Instance; internal List securityCameras = new List(); internal List handheldTVCameras = new List(); public MeshRenderer handheldTVTerminal; public List handheldTVMaterialIndices; public List handheldTVTerminalScreenColliders; public MeshRenderer securityFeedTerminal; public Material securityFeedMaterial; public List securityCameraMaterialIndices; public List securityFeedTerminalScreenColliders; public int camerasToRenderPerFrame = 2; private int currentHandheldTVIndex; private int currentSecurityCameraIndex; private Camera[] allOtherCameras = Array.Empty(); private Plane[][] allOtherCamerasFrustums = Array.Empty(); private bool allOtherCameraFrustumsUpdated; private List allControlledCameras = new List(); private List allControlledCameraScreenBounds = new List(); private List allControlledCameraScreenRenderers = new List(); private List allControlledCamerasShouldRenderFlags = new List(); private int nextCameraToRender; private float cameraRenderCountRemainder; private HashSet nightVisionCameraSet = new HashSet(); private List nightVisionLights = new List(); private const float ActiveTerminalDistance = 15f; private const float ActiveTerminalDistanceSqr = 225f; private const float ActiveHandheldDistance = 5f; private const float ActiveHandheldDistanceSqr = 25f; private void AddCamera(INightVisionCamera nightVisionCamera, Bounds screenBounds, params Renderer[] screenRenderers) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) nightVisionCameraSet.Add(nightVisionCamera.Camera); nightVisionLights.Add(nightVisionCamera.NightVisionLight); allControlledCameras.Add(nightVisionCamera.Camera); allControlledCameraScreenBounds.Add(screenBounds); allControlledCameraScreenRenderers.Add(screenRenderers); allControlledCamerasShouldRenderFlags.Add(item: false); ((Component)nightVisionCamera.Camera).GetComponent().hasPersistentHistory = true; } public void AssignSecurityCameraFeed(SecurityCamera securityCamera) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (currentSecurityCameraIndex < securityCameraMaterialIndices.Count) { int index = securityCameraMaterialIndices[currentSecurityCameraIndex]; Material material = new Material(securityFeedMaterial) { mainTexture = (Texture)(object)securityCamera.Camera.targetTexture }; ((Renderer)(object)securityFeedTerminal).SetMaterial(index, material); Debug.Log((object)"Added security camera to nightvision camera list"); securityCameras.Add(securityCamera); AddCamera(securityCamera, ((Collider)securityFeedTerminalScreenColliders[currentSecurityCameraIndex]).bounds); currentSecurityCameraIndex++; } } public void AssignHandheldTVFeed(HandheldTVCamera handheldTVCamera, Material material) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (currentHandheldTVIndex < handheldTVMaterialIndices.Count) { Material[] sharedMaterials = ((Renderer)handheldTVTerminal).sharedMaterials; int num = handheldTVMaterialIndices[currentHandheldTVIndex]; sharedMaterials[num] = material; ((Renderer)handheldTVTerminal).sharedMaterials = sharedMaterials; Debug.Log((object)"Added handheld TV to nightvision camera list"); handheldTVCameras.Add(handheldTVCamera); AddCamera(handheldTVCamera, ((Collider)handheldTVTerminalScreenColliders[currentHandheldTVIndex]).bounds, (Renderer)((GrabbableObject)handheldTVCamera).mainObjectRenderer); currentHandheldTVIndex++; } } public void Awake() { Instance = this; } public void OnEnable() { RenderPipelineManager.beginCameraRendering += UpdateVisibleLights; } private void GetCameraFrustums() { if (allOtherCameraFrustumsUpdated) { return; } allOtherCameraFrustumsUpdated = true; if (allOtherCameras.Length != Camera.allCamerasCount) { allOtherCameras = (Camera[])(object)new Camera[Camera.allCamerasCount]; allOtherCamerasFrustums = new Plane[allOtherCameras.Length][]; for (int i = 0; i < allOtherCamerasFrustums.Length; i++) { allOtherCamerasFrustums[i] = (Plane[])(object)new Plane[6]; } } Camera.GetAllCameras(allOtherCameras); for (int j = 0; j < allOtherCameras.Length; j++) { GeometryUtility.CalculateFrustumPlanes(allOtherCameras[j], allOtherCamerasFrustums[j]); } } public bool IsBoundingBoxVisibleOnOtherCameras(Bounds bounds, float activeDistanceSqr) { //IL_002a: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < allOtherCameras.Length; i++) { Camera val = allOtherCameras[i]; if (((uint)val.cullingMask & (true ? 1u : 0u)) != 0 && val != null && !nightVisionCameraSet.Contains(val)) { Vector3 val2 = ((Bounds)(ref bounds)).center - ((Component)val).transform.position; if (!(((Vector3)(ref val2)).sqrMagnitude > activeDistanceSqr) && GeometryUtility.TestPlanesAABB(allOtherCamerasFrustums[i], bounds)) { return true; } } } return false; } private bool ShouldRenderCamera(int cameraIndex) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (cameraIndex < 0 || cameraIndex >= allControlledCameras.Count) { return false; } Camera val = allControlledCameras[cameraIndex]; if ((Object)(object)val == (Object)null) { return false; } if (!((Component)val).gameObject.activeInHierarchy) { return false; } Bounds bounds = allControlledCameraScreenBounds[cameraIndex]; GetCameraFrustums(); if (IsBoundingBoxVisibleOnOtherCameras(bounds, 225f)) { return true; } Renderer[] array = allControlledCameraScreenRenderers[cameraIndex]; foreach (Renderer val2 in array) { if (val2.isVisible && IsBoundingBoxVisibleOnOtherCameras(val2.bounds, 25f)) { return true; } } return false; } private void LateUpdate() { if (allControlledCameras.Count == 0) { return; } allOtherCameraFrustumsUpdated = false; int count = allControlledCameras.Count; for (int i = 0; i < count; i++) { Camera val = allControlledCameras[i]; if (!((Object)(object)val == (Object)null)) { ((Behaviour)val).enabled = false; allControlledCamerasShouldRenderFlags[i] = false; } } int num = 0; for (int j = 0; j < count; j++) { if (ShouldRenderCamera(j)) { allControlledCamerasShouldRenderFlags[j] = true; num++; } } float num2 = (float)camerasToRenderPerFrame * (float)num / (float)count; cameraRenderCountRemainder += num2; int num3 = (nextCameraToRender + allControlledCameras.Count - 1) % allControlledCameras.Count; while (cameraRenderCountRemainder >= 0f) { if (allControlledCamerasShouldRenderFlags[nextCameraToRender]) { ((Behaviour)allControlledCameras[nextCameraToRender]).enabled = true; cameraRenderCountRemainder -= 1f; } nextCameraToRender = (nextCameraToRender + 1) % allControlledCameras.Count; if (nextCameraToRender == num3) { break; } } PlayerControllerB val2 = GameNetworkManager.Instance?.localPlayerController; if ((Object)(object)val2 != (Object)null) { if ((Object)(object)val2.spectatedPlayerScript != (Object)null) { val2 = val2.spectatedPlayerScript; } if (val2.currentlyHeldObjectServer is HandheldTVCamera handheldTVCamera && (Object)(object)handheldTVCamera.Camera != (Object)null) { ((Behaviour)handheldTVCamera.Camera).enabled = true; } } SetNightVisionVisible(visible: true); } public void UpdateVisibleLights(ScriptableRenderContext _, Camera camera) { SetNightVisionVisible(nightVisionCameraSet.Contains(camera)); } private void SetNightVisionVisible(bool visible) { foreach (Light nightVisionLight in nightVisionLights) { if (!((Object)(object)nightVisionLight == (Object)null)) { ((Behaviour)nightVisionLight).enabled = visible; } } } public void OnDisable() { RenderPipelineManager.beginCameraRendering -= UpdateVisibleLights; } } public static class PluginInfo { public const string PLUGIN_GUID = "BlackMesa"; public const string PLUGIN_NAME = "BlackMesa"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace BlackMesa.Utilities { internal static class BetterExplosion { private struct PlayerHit { private int damage; internal void RegisterHit(int damage) { if (damage > this.damage || damage == -1) { BlackMesaInterior.Logger.LogInfo((object)$"Register player damage {damage}"); this.damage = damage; } } internal readonly void DoHit(Vector3 explosionPosition, PlayerControllerB player) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (damage != 0 && !((Object)(object)player == (Object)null)) { Vector3 val = Vector3.Normalize(((Component)player.gameplayCamera).transform.position - explosionPosition) * 80f / Vector3.Distance(((Component)player.gameplayCamera).transform.position, explosionPosition); BlackMesaInterior.Logger.LogInfo((object)$"Hit {player} for {damage}"); if (damage == -1) { player.KillPlayer(val, true, (CauseOfDeath)3, 0, default(Vector3), false); } else { player.DamagePlayer(damage, true, true, (CauseOfDeath)3, 0, false, val); } } } } private struct EnemyHit { private int damage; private float distance; internal void RegisterHit(int damage, float distance) { if (damage > this.damage) { this.damage = damage; } if (distance < this.distance) { this.distance = distance; } } internal readonly void DoHit(Vector3 explosionPosition, EnemyAI enemy) { //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) if (damage != 0 && !((Object)(object)enemy == (Object)null)) { BlackMesaInterior.Logger.LogInfo((object)$"Hit {enemy} for {damage}"); enemy.HitEnemyOnLocalClient(damage, default(Vector3), (PlayerControllerB)null, false, -1); enemy.HitFromExplosion(distance); } } } private static readonly SequentialElementMap playerHits = new SequentialElementMap(() => default(PlayerHit), (PlayerControllerB player) => (int)player.playerClientId, 4); private static readonly SequentialElementMap enemyHits = new SequentialElementMap(() => default(EnemyHit), (EnemyAI enemy) => enemy.thisEnemyIndex, 4); private const int playersLayer = 3; private const int roomLayer = 8; private const int collidersLayer = 11; private const int enemiesLayer = 19; private const int mapHazardsLayer = 21; private const int dealDamageToLayers = 2621448; public static int GetEnemyDamage(int nonLethalDamage) { return (nonLethalDamage + 10) / 20; } public static void SpawnExplosion(Vector3 explosionPosition, float killRange, float damageRange, int nonLethalDamage) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_009e: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) int enemyDamage = GetEnemyDamage(nonLethalDamage); Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f)).SetActive(true); float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, explosionPosition); HUDManager.Instance.ShakeCamera((ScreenShakeType)(num < 14f)); Collider[] array = Physics.OverlapSphere(explosionPosition, damageRange + 5f, 2621448, (QueryTriggerInteraction)2); playerHits.Clear(); enemyHits.Clear(); Collider[] array2 = array; RaycastHit val3 = default(RaycastHit); PlayerControllerB val4 = default(PlayerControllerB); EnemyAICollisionDetect val5 = default(EnemyAICollisionDetect); Landmine val6 = default(Landmine); IHittable val7 = default(IHittable); foreach (Collider val in array2) { Vector3 val2 = val.ClosestPoint(explosionPosition); float num2 = Vector3.Distance(explosionPosition, val2); if (Physics.Linecast(explosionPosition, val2, ref val3, 256, (QueryTriggerInteraction)1)) { BlackMesaInterior.Logger.LogDebug((object)$"Explosion target {val} blocked by collision"); continue; } int layer = ((Component)val).gameObject.layer; BlackMesaInterior.Logger.LogDebug((object)$"Explosion trying to hit {val} on layer {layer} with distance {num2} (damage {damageRange}, kill {killRange})"); if (layer == 3 && ((Component)val).TryGetComponent(ref val4)) { if (((NetworkBehaviour)val4).IsOwner) { if (num2 <= killRange) { playerHits[val4].RegisterHit(-1); } else if (num2 <= damageRange) { playerHits[val4].RegisterHit(nonLethalDamage); } } } else if (layer == 19 && ((Component)val).TryGetComponent(ref val5)) { if (((NetworkBehaviour)val5.mainScript).IsOwner && num2 < damageRange * 0.75f) { enemyHits[val5.mainScript].RegisterHit(enemyDamage, num2); } } else if (layer == 21 && ((Component)val).TryGetComponent(ref val6) && ((NetworkBehaviour)val6).IsOwner) { if (num2 < damageRange) { ((MonoBehaviour)val6).StartCoroutine(val6.TriggerOtherMineDelayed(val6)); } } else if (((Component)val).TryGetComponent(ref val7)) { val7.Hit(enemyDamage, Vector3.Normalize(val2 - explosionPosition), (PlayerControllerB)null, false, -1); } } foreach (var (player, playerHit) in playerHits) { playerHit.DoHit(explosionPosition, player); } foreach (var (enemy, enemyHit) in enemyHits) { enemyHit.DoHit(explosionPosition, enemy); } array2 = Physics.OverlapSphere(explosionPosition, 10f, -2049); Rigidbody val8 = default(Rigidbody); for (int i = 0; i < array2.Length; i++) { if (((Component)array2[i]).TryGetComponent(ref val8)) { val8.AddExplosionForce(70f, explosionPosition, 10f); } } } public static void DeadlySphereCastExplosion(Vector3 position, Vector3 direction, float radius, float range, int enemyDamage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0062: 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) RaycastHit[] array = Physics.SphereCastAll(new Ray(position, direction), radius, range, 524296, (QueryTriggerInteraction)1); Dictionary dictionary = new Dictionary(); RaycastHit[] array2 = array; RaycastHit val2 = default(RaycastHit); PlayerControllerB val3 = default(PlayerControllerB); EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val2, 256, (QueryTriggerInteraction)1)) { continue; } float value; if (((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val3)) { if (((NetworkBehaviour)val3).IsOwner) { val3.KillPlayer(direction, true, (CauseOfDeath)3, 0, default(Vector3), false); } } else if (((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val4) && ((NetworkBehaviour)val4.mainScript).IsOwner && (!dictionary.TryGetValue(val4.mainScript, out value) || !(((RaycastHit)(ref val)).distance > value))) { dictionary[val4.mainScript] = ((RaycastHit)(ref val)).distance; } } foreach (var (val6, num2) in dictionary) { val6.HitEnemy(enemyDamage, (PlayerControllerB)null, false, -1); val6.HitFromExplosion(num2); } } } public static class Extensions { public static string GetPath(this Transform transform) { StringBuilder stringBuilder = new StringBuilder(((Object)transform).name); while ((Object)(object)transform.parent != (Object)null) { transform = transform.parent; stringBuilder.Insert(0, '/'); stringBuilder.Insert(0, ((Object)transform).name); } return stringBuilder.ToString(); } public static void SetMaterial(this Renderer renderer, int index, Material material) { Material[] sharedMaterials = renderer.sharedMaterials; sharedMaterials[index] = material; renderer.sharedMaterials = sharedMaterials; } public static int IntHash(this Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return (int)position.x ^ (int)position.y ^ (int)position.z; } } public class SequentialElementMap : IEnumerable<(K key, V value)>, IEnumerable { private readonly Func constructor; private readonly Func indexGetter; private (K key, V value)[] backingArray; public ref V this[K key] => ref GetItem(key); public int Count => backingArray.Length; public SequentialElementMap(Func elementConstructor, Func keyIndexGetter, int capacity) { constructor = elementConstructor; indexGetter = keyIndexGetter; backingArray = new(K, V)[capacity]; Clear(); } private void EnsureSize(int size) { if (backingArray.Length < size) { int num = backingArray.Length; int num2; for (num2 = num; num2 < size; num2 *= 2) { } Array.Resize(ref backingArray, num2); for (int i = num; i < num2; i++) { backingArray[i].value = constructor(); } } } public ref V GetItem(K key) { int num = indexGetter(key); EnsureSize(num + 1); ref(K key, V value) reference = ref backingArray[num]; reference.key = key; return ref reference.value; } public void Clear() { for (int i = 0; i < backingArray.Length; i++) { ref(K key, V value) reference = ref backingArray[i]; reference.key = default(K); reference.value = constructor(); } } public IEnumerator<(K key, V value)> GetEnumerator() { return ((IEnumerable<(K, V)>)backingArray).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return backingArray.GetEnumerator(); } } } namespace BlackMesa.Scriptables { [CreateAssetMenu(menuName = "Black Mesa/FixPluginTypesSerialization Check")] public class FixPluginTypesSerializationCheck : ScriptableObject { public SerializableClass buh; public bool IsWorking => buh?.IsWorking ?? false; } [Serializable] public class SerializableClass { public bool IsWorking; } } namespace BlackMesa.Patches { [HarmonyPatch(typeof(Animator))] internal static class PatchAnimator { [HarmonyPostfix] [HarmonyPatch("SetTriggerString")] private static void SetTriggerStringPostfix(Animator __instance) { AnimatorCuller.OnAnimationTriggered(__instance); } [HarmonyPostfix] [HarmonyPatch("SetTriggerID")] private static void SetTriggerIDPostfix(Animator __instance) { AnimatorCuller.OnAnimationTriggered(__instance); } [HarmonyPostfix] [HarmonyPatch("SetBoolString")] private static void SetBoolStringPostfix(Animator __instance) { AnimatorCuller.OnAnimationTriggered(__instance); } [HarmonyPostfix] [HarmonyPatch("SetBoolID")] private static void SetBoolIDPostfix(Animator __instance) { AnimatorCuller.OnAnimationTriggered(__instance); } } [HarmonyPatch(typeof(DeadBodyInfo))] internal static class PatchDeadBodyInfo { [HarmonyPostfix] [HarmonyPatch("SetRagdollPositionSafely")] private static void SetRagdollPositionSafelyPostfix(DeadBodyInfo __instance) { Barnacle.OnPlayerTeleported(__instance.playerScript); } } [HarmonyPatch(typeof(DungeonGenerator))] internal class PatchDungeonGenerator { private static Dictionary originalGenerationAttempts = new Dictionary(); private static bool IsGenerating(GenerationStatus status) { //IL_0000: 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_0005: Invalid comparison between Unknown and I4 //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if ((int)status != 0) { if ((int)status != 8) { if ((int)status == 9) { return false; } return true; } return false; } return false; } [HarmonyPrefix] [HarmonyPatch("ChangeStatus")] private static void GenerateNewFloorPrefix(DungeonGenerator __instance, GenerationStatus status) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) int value; if (IsGenerating(status)) { if (!originalGenerationAttempts.ContainsKey(__instance) && BlackMesaInterior.IsBlackMesaInterior(__instance.DungeonFlow)) { originalGenerationAttempts[__instance] = __instance.MaxAttemptCount; __instance.MaxAttemptCount *= 5; } } else if (originalGenerationAttempts.Remove(__instance, out value)) { __instance.MaxAttemptCount = value; } } } [HarmonyPatch(typeof(EnemyAI))] internal static class PatchEnemyAI { internal static HashSet AllEnemies = new HashSet(); [HarmonyPostfix] [HarmonyPatch("Start")] private static void StartPostfix(EnemyAI __instance) { AllEnemies.Add(__instance); } [HarmonyPostfix] [HarmonyPatch("OnDestroy")] private static void OnDestroyPostfix(EnemyAI __instance) { AllEnemies.Remove(__instance); } } [HarmonyPatch(typeof(LungProp))] internal class PatchLungProp { [HarmonyTranspiler] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static IEnumerable DisconnectFromMachineryTranspiler(IEnumerable instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(true, (CodeMatch[])(object)new CodeMatch[2] { new CodeMatch((OpCode?)OpCodes.Ldc_I4_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)typeof(RoundManager).GetMethod("SwitchPower", new Type[1] { typeof(bool) }), (string)null) }); if (val.IsInvalid) { BlackMesaInterior.Logger.LogError((object)"Failed to patch DisconnectFromMachinery()"); return instructions; } val.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Call, (object)typeof(LungPropDisconnectedHandler).GetMethod("TriggerAllEvents", BindingFlags.Static | BindingFlags.NonPublic)) }); return val.Instructions(); } } [HarmonyPatch(typeof(MenuManager))] internal static class PatchMenuManager { [HarmonyPrefix] [HarmonyPatch("Start")] private static void StartPostfix() { LightSwitcher.CacheVanillaLightSounds(); } } internal static class PatchNetworkManager { private static List networkPrefabs = new List(); internal static void AddNetworkPrefab(GameObject prefab) { if ((Object)(object)NetworkManager.Singleton != (Object)null) { NetworkManager.Singleton.AddNetworkPrefab(prefab); } else { networkPrefabs.Add(prefab); } } [HarmonyPostfix] [HarmonyPatch(typeof(NetworkConfig), "InitializePrefabs")] private static void InitializePrefabsPostfix(NetworkConfig __instance) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown NetworkPrefabs prefabs = __instance.Prefabs; foreach (GameObject networkPrefab in networkPrefabs) { NetworkPrefab val = new NetworkPrefab { Prefab = networkPrefab }; prefabs.Add(val); } networkPrefabs = new List(); } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PatchPlayerControllerB { private static HashSet lockedPlayers = new HashSet(); internal static void SetPlayerPositionLocked(PlayerControllerB player, bool locked) { if (locked) { lockedPlayers.Add(player); } else { lockedPlayers.Remove(player); } player.disableMoveInput = locked; } [HarmonyPrefix] [HarmonyPatch("LateUpdate")] private static void LateUpdatePrefix(PlayerControllerB __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (lockedPlayers.Contains(__instance)) { ((Component)__instance).transform.localPosition = Vector3.zero; __instance.fallValue = 0f; __instance.fallValueUncapped = 0f; } } [HarmonyPostfix] [HarmonyPatch("SpawnDeadBody")] private static void SpawnDeadBodyPostfix(PlayerControllerB __instance) { Barnacle.OnRagdollSpawnedForPlayer(__instance); } [HarmonyPostfix] [HarmonyPatch("TeleportPlayer")] private static void TeleportPlayerPostfix(PlayerControllerB __instance) { Barnacle.OnPlayerTeleported(__instance); } } internal static class PatchRoundManager { [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "SetLevelObjectVariables")] private static void SetLevelObjectVariablesPostfix(RoundManager __instance) { if (BlackMesaInterior.IsBlackMesaInterior(__instance.dungeonGenerator.Generator.DungeonFlow)) { BlackMesaInterior.BatchAllTileModels(__instance.dungeonGenerator.Generator.CurrentDungeon); } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "SpawnSyncedProps")] private static void SpawnSyncedPropsPostfix(RoundManager __instance) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if (BlackMesaInterior.IsBlackMesaInterior(__instance.dungeonGenerator?.Generator.DungeonFlow)) { return; } List spawnedSyncedObjects = __instance.spawnedSyncedObjects; List list = new List(); List list2 = new List(); foreach (GameObject item2 in spawnedSyncedObjects) { GrabbableObject component = item2.GetComponent(); if (component != null && !((Object)(object)item2.GetComponentInChildren() == (Object)null) && component.itemProperties.isScrap && component.scrapValue == 0) { int item = (int)((float)__instance.AnomalyRandom.Next(component.itemProperties.minValue, component.itemProperties.maxValue) * __instance.scrapValueMultiplier); list.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component).NetworkObject)); list2.Add(item); } } __instance.SyncScrapValuesClientRpc(list.ToArray(), list2.ToArray()); } } [HarmonyPatch(typeof(StartOfRound))] public sealed class PatchStartOfRound { [HarmonyPostfix] [HarmonyPatch("Awake")] private static void AwakePostfix() { Object.Instantiate(BlackMesaInterior.GenerationRulesPrefab); } [HarmonyPostfix] [HarmonyPatch("ShipLeave")] private static void ShipLeavePostFix() { HandheldTVCamera[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { array[i].ShipIsLeaving(); } } [HarmonyPostfix] [HarmonyPatch("ShipHasLeft")] private static void ShipHasLeftPostFix() { HandheldTVCamera[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { array[i].ExplodeClientRPC(); } } } } namespace BlackMesa.Interfaces { public interface IDumbEnemy : IHittable { void Stun(float time); void Kill(bool destroy); } } namespace BlackMesa.Generation { public class ConnectionRules : MonoBehaviour { public DoorwayTagRule[] doorwayTagRules; private TileConnectionRule rule; private Dictionary doorwayTagRuleLookup = new Dictionary(); private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) rule = new TileConnectionRule(new TileConnectionDelegate(CanTilesConnect), 0); doorwayTagRuleLookup.Clear(); DoorwayTagRule[] array = doorwayTagRules; for (int i = 0; i < array.Length; i++) { DoorwayTagRule doorwayTagRule = array[i]; doorwayTagRuleLookup.Add(doorwayTagRule.Pair, doorwayTagRule.result); } DoorwayPairFinder.CustomConnectionRules.Add(rule); } private void OnDisable() { DoorwayPairFinder.CustomConnectionRules.Remove(rule); rule = null; } private ConnectionResult CanTilesConnect(ProposedConnection connection) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (doorwayTagRuleLookup.TryGetValue(new DoorwayTagPair(((ProposedConnection)(ref connection)).PreviousDoorway.DoorwayComponent, ((ProposedConnection)(ref connection)).NextDoorway.DoorwayComponent), out var value)) { return value; } return (ConnectionResult)2; } } public class DoorwayInfo : MonoBehaviour { public DoorwayTag doorwayTag; } [CreateAssetMenu(menuName = "Black Mesa/Generation/Doorway Tag")] public class DoorwayTag : ScriptableObject { } public struct DoorwayTagPair : IEquatable { public DoorwayTag tagA; public DoorwayTag tagB; public DoorwayTagPair(DoorwayTag tagA, DoorwayTag tagB) { this.tagA = tagA; this.tagB = tagB; } public DoorwayTagPair(Doorway doorwayA, Doorway doorwayB) { DoorwayInfo doorwayInfo = default(DoorwayInfo); this = new DoorwayTagPair(((Component)doorwayA).TryGetComponent(ref doorwayInfo) ? doorwayInfo.doorwayTag : null, ((Component)doorwayB).TryGetComponent(ref doorwayInfo) ? doorwayInfo.doorwayTag : null); } public readonly bool Equals(DoorwayTagPair other) { if ((Object)(object)tagA == (Object)(object)other.tagA) { return (Object)(object)tagB == (Object)(object)other.tagB; } return false; } public override readonly bool Equals(object other) { if (other is DoorwayTagPair other2) { return Equals(other2); } return false; } public override readonly int GetHashCode() { return HashCode.Combine(((Object)(object)tagA != (Object)null) ? ((object)tagA).GetHashCode() : 0, ((Object)(object)tagB != (Object)null) ? ((object)tagB).GetHashCode() : 0); } } [Serializable] public struct DoorwayTagRule : IEquatable { public DoorwayTag tagA; public DoorwayTag tagB; public ConnectionResult result; public readonly DoorwayTagPair Pair => new DoorwayTagPair(tagA, tagB); public readonly bool Equals(DoorwayTagPair other) { if ((Object)(object)tagA == (Object)(object)other.tagA) { return (Object)(object)tagB == (Object)(object)other.tagB; } return false; } public override readonly bool Equals(object other) { if (other is DoorwayTagPair other2) { return Equals(other2); } return false; } public override readonly int GetHashCode() { return HashCode.Combine(((object)tagA).GetHashCode(), ((object)tagB).GetHashCode()); } } } namespace BlackMesa.Components { public class AnimatorCuller : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Animator animator; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: { <>1__state = -1; AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash != 0 && ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f) { return false; } AnimatorStateInfo nextAnimatorStateInfo = animator.GetNextAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref nextAnimatorStateInfo)).fullPathHash != 0 && ((AnimatorStateInfo)(ref nextAnimatorStateInfo)).normalizedTime < 1f) { return false; } ((Behaviour)animator).enabled = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Dictionary cullers = new Dictionary(); private Animator animator; private void OnEnable() { animator = ((Component)this).GetComponent(); animator.keepAnimatorStateOnDisable = true; cullers.Add(animator, this); } public void CompleteAnimationAndDisableAnimator() { ((MonoBehaviour)this).StartCoroutine(DisableAtEndOfFrame(animator)); } [IteratorStateMachine(typeof(d__4))] private static IEnumerator DisableAtEndOfFrame(Animator animator) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { animator = animator }; } internal static void OnAnimationTriggered(Animator animator) { if (cullers.TryGetValue(animator, out var value) && !((Object)(object)value == (Object)null)) { value.EnableAnimator(); } } public void EnableAnimator() { ((Behaviour)animator).enabled = true; } private void OnDisable() { cullers.Remove(animator); } } public class Barnacle : NetworkBehaviour, IDumbEnemy, IHittable { private enum State { Extending, Idle, Pulling, Eating, Flinching, Dead } [CompilerGenerated] private sealed class d__91 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Barnacle <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__91(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown int num = <>1__state; Barnacle barnacle = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; barnacle.SetState(State.Pulling); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; if (barnacle.state == State.Pulling) { barnacle.animator.CrossFadeInFixedTime("Pulling", 0.25f); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__132 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Barnacle <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__132(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown int num = <>1__state; Barnacle barnacle = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; barnacle.SetState(State.Dead); barnacle.sounds.PlayFlinchSound(); barnacle.PlayFlinchAnimation(); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; barnacle.animator.CrossFadeInFixedTime($"Death {animationRandomizer.Next(2) + 1}", 0.25f); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; case 2: <>1__state = -1; barnacle.DropGrabbedObjectsOnClient(); barnacle.sounds.PlayDeathSound(); <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 3; return true; case 3: <>1__state = -1; barnacle.PlayPukeEffect(); break; case 4: { <>1__state = -1; int index = barnacle.eatenItems.Count - 1; if ((Object)(object)barnacle.eatenItems[index] != (Object)null) { barnacle.DropItem(barnacle.eatenItems[index]); } barnacle.eatenItems.RemoveAt(index); break; } } if (barnacle.eatenItems.Count > 0) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 4; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__131 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Barnacle <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__131(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; Barnacle barnacle = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(barnacle.pukeTravelTime); <>1__state = 1; return true; case 1: <>1__state = -1; barnacle.sounds.PlaySplashSound(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Random animationRandomizer = new Random(); private static readonly HashSet barnacles = new HashSet(); public Animator animator; public BarnacleSounds sounds; [Header("Tongue")] public Rigidbody[] tongueSegments; [Header("Tongue Raycast")] public Transform raycastOrigin; public LayerMask tongueCastMask; public float maxLength; public float tongueGroundDistance; [Header("Tongue Speed")] public float defaultTongueRetractSpeed; public float defaultTongueDropSpeed; [Header("Grabbing")] public Transform dummyObject; public Transform holder; public float holderPositionScale; [Header("Pulling")] public float eatDistance; [Header("Eating/Dropping")] public Transform itemStash; public Transform mouthAttachment; public VisualEffect pukeEffect; public AnimationCurve idleSoundTimeCurve; private const float gravity = 15.9f; private float tongueRetractSpeed; private float tongueDropSpeed; private Transform tongueParentTransform; private Vector3 retractedTongueLocalPosition; private State state = State.Idle; private float flinchTimeLeft; private CapsuleCollider[] tongueSegmentColliders; private float[] tongueSegmentMouthOffsets; private float targetTongueOffset; private float currentTongueOffset; private float eatingTongueOffset; private int firstEnabledSegment; private Transform dummyObjectParent; private Rigidbody dummyObjectBody; private Joint dummyObjectJoint; private Joint holderJoint; private float defaultAngularDrag; private GrabbableObject grabbedItem; private PlayerControllerB grabbedPlayer; private Transform grabbedPlayerPreviousParent; private DeadBodyInfo grabbedBody; private EnemyAI grabbedEnemy; private bool centeringHolderPosition; private Vector3 centeredHolderLocalPosition; private bool centeringDummyObjectRotation; private float idleSoundTime = -1f; private float pukeTravelTime = 2f; private readonly List eatenItems = new List(); internal bool HasGrabbedObject { get { if (grabbedItem == null && grabbedPlayer == null && grabbedBody == null) { return grabbedEnemy != null; } return true; } } internal bool CanGrab { get { if (!HasGrabbedObject) { if (state != 0) { return state == State.Idle; } return true; } return false; } } internal bool IsDead => state == State.Dead; private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Rigidbody val = tongueSegments[0]; tongueParentTransform = ((Component)val).transform.parent; retractedTongueLocalPosition = ((Component)val).transform.localPosition; tongueRetractSpeed = defaultTongueRetractSpeed; tongueDropSpeed = defaultTongueDropSpeed; tongueSegmentColliders = (CapsuleCollider[])(object)new CapsuleCollider[tongueSegments.Length]; tongueSegmentMouthOffsets = new float[tongueSegments.Length]; float num = 0f; int num2 = tongueSegments.Length; while (num2-- > 0) { tongueSegmentColliders[num2] = ((Component)tongueSegments[num2]).GetComponent(); float num3 = num; Vector3 val2 = ((Component)tongueSegments[num2]).transform.TransformVector(new Vector3(0f, 0f, tongueSegmentColliders[num2].height)); num = num3 + ((Vector3)(ref val2)).magnitude; tongueSegmentMouthOffsets[num2] = num; } dummyObjectParent = dummyObject.parent; dummyObjectBody = ((Component)dummyObject).GetComponent(); dummyObjectJoint = ((Component)dummyObjectBody).GetComponent(); holderJoint = ((Component)holder).GetComponent(); defaultAngularDrag = dummyObjectBody.angularDrag; ((Component)tongueParentTransform).gameObject.SetActive(false); } private void Start() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) animator.CrossFadeInFixedTime("Extending", 0.25f); DropTongue(); barnacles.Add(this); ((Component)tongueParentTransform).gameObject.SetActive(true); for (int i = 1; i < tongueSegments.Length; i++) { tongueSegments[i].isKinematic = false; RigidbodyGravity component = ((Component)tongueSegments[i]).GetComponent(); if ((Object)(object)component != (Object)null) { component.gravity = Vector3.down * 15.9f; } } pukeEffect.SetFloat("Gravity", 15.9f); } public void Stun(float duration) { StunServerRpc(duration); } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (IsDead) { return false; } if (force <= 0) { return false; } StartDyingServerRpc(); return true; } public void Kill(bool destroy) { if (destroy && ((NetworkBehaviour)this).IsOwner) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } StartDyingServerRpc(); } private void SetIdleSoundTimer() { if (((NetworkBehaviour)this).IsOwner) { idleSoundTime = idleSoundTimeCurve.Evaluate((float)animationRandomizer.NextDouble()); } } private void DisableHolderPhysics() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) dummyObjectBody.isKinematic = true; dummyObjectBody.centerOfMass = Vector3.zero; dummyObjectBody.angularDrag = defaultAngularDrag; dummyObjectBody.interpolation = (RigidbodyInterpolation)0; } private void EnableHolderPhysics() { dummyObjectBody.isKinematic = false; dummyObjectBody.interpolation = (RigidbodyInterpolation)1; } private void SetState(State newState) { if (newState != state) { state = newState; } } private void DropTongue() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) dummyObject.SetParent(dummyObjectParent, false); dummyObject.position = ((Component)this).transform.position; dummyObjectJoint.connectedBody = null; DisableHolderPhysics(); float distance = maxLength; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(raycastOrigin.position, 0.1f, Vector3.down, ref val, maxLength, LayerMask.op_Implicit(tongueCastMask), (QueryTriggerInteraction)1)) { distance = ((RaycastHit)(ref val)).distance; } targetTongueOffset = distance - tongueGroundDistance; ((Component)sounds.groundAudioSource).transform.position = ((RaycastHit)(ref val)).point; pukeTravelTime = Mathf.Sqrt(2f * Vector3.Distance(((Component)pukeEffect).transform.position, ((RaycastHit)(ref val)).point) / 15.9f); SetState(State.Extending); animator.CrossFadeInFixedTime("Extending", 0.5f); } private bool CanGrabPlayer(PlayerControllerB player) { if (!((NetworkBehaviour)player).IsOwner) { return false; } if (player.isPlayerDead) { return false; } return true; } private bool CanGrabItem(GrabbableObject item) { if (item.itemProperties.twoHandedAnimation && !(item is RagdollGrabbableObject)) { return false; } return true; } private bool CanGrabEnemy(EnemyAI enemy) { if (!((NetworkBehaviour)enemy).IsOwner) { return false; } if (!(enemy is MaskedPlayerEnemy) && !(enemy is FlowerSnakeEnemy) && !(enemy is CentipedeAI)) { return false; } return true; } public void TryGrabPlayerOrHeldItem(PlayerControllerB player) { //IL_0101: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) if (!CanGrab || !CanGrabPlayer(player)) { return; } foreach (EnemyAI allEnemy in PatchEnemyAI.AllEnemies) { if (!allEnemy.isEnemyDead) { FlowerSnakeEnemy val = (FlowerSnakeEnemy)(object)((allEnemy is FlowerSnakeEnemy) ? allEnemy : null); if (val != null && (Object)(object)val.clingingToPlayer == (Object)(object)player && val.clingPosition == 4) { GrabEnemy((EnemyAI)(object)val); return; } CentipedeAI val2 = (CentipedeAI)(object)((allEnemy is CentipedeAI) ? allEnemy : null); if (val2 != null && (Object)(object)val2.clingingToPlayer == (Object)(object)player) { GrabEnemy((EnemyAI)(object)val2); return; } } } GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer != (Object)null && ((NetworkBehaviour)currentlyHeldObjectServer).IsOwner && CanGrabItem(currentlyHeldObjectServer)) { Transform transform = ((Component)player.gameplayCamera).transform; Transform transform2 = ((Component)tongueSegments[0]).transform; float num = float.PositiveInfinity; Rigidbody[] array = tongueSegments; Vector3 val4; foreach (Rigidbody val3 in array) { val4 = transform.position - ((Component)val3).transform.position; float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude; if (sqrMagnitude < num) { transform2 = ((Component)val3).transform; num = sqrMagnitude; } } val4 = transform2.position - transform.position; Vector3 normalized = ((Vector3)(ref val4)).normalized; if (Vector3.Dot(transform.forward, normalized) >= 0.45f) { GrabItem(currentlyHeldObjectServer); return; } } GrabPlayer(player); } private int GetNearestSegmentToPosition(Vector3 position) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) float num = float.PositiveInfinity; int result = tongueSegments.Length - 1; for (int i = 0; i < tongueSegments.Length; i++) { CapsuleCollider val = tongueSegmentColliders[i]; Vector3 val2 = ((Component)val).transform.TransformPoint(val.center); Vector3 val3 = position - val2; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = i; } } return result; } private Vector3 GetColliderCenter(Collider collider) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) BoxCollider val = (BoxCollider)(object)((collider is BoxCollider) ? collider : null); if (val != null) { return val.center; } SphereCollider val2 = (SphereCollider)(object)((collider is SphereCollider) ? collider : null); if (val2 != null) { return val2.center; } CapsuleCollider val3 = (CapsuleCollider)(object)((collider is CapsuleCollider) ? collider : null); if (val3 != null) { return val3.center; } CharacterController val4 = (CharacterController)(object)((collider is CharacterController) ? collider : null); if (val4 != null) { return val4.center; } return Vector3.zero; } private void GetAttachmentPosition(Vector3 rootPosition, Vector3 hitPosition, Collider collider, out Rigidbody attachSegment, out Vector3 attachPosition, out Vector3 holderPosition, out Vector3 centerOfMass, out float tongueOffset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_006b: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) int nearestSegmentToPosition = GetNearestSegmentToPosition(hitPosition); attachSegment = tongueSegments[nearestSegmentToPosition]; attachPosition = ((Collider)tongueSegmentColliders[nearestSegmentToPosition]).ClosestPoint(hitPosition); Vector3 val = rootPosition - hitPosition; if ((Object)(object)collider != (Object)null) { Vector3 val2 = collider.ClosestPoint(attachPosition); val2 = Vector3.Lerp(hitPosition, val2, holderPositionScale); val = rootPosition - val2; } holderPosition = attachPosition + val; centerOfMass = attachPosition; if ((Object)(object)collider != (Object)null) { centerOfMass = ((Component)collider).transform.TransformPoint(GetColliderCenter(collider)) - rootPosition + holderPosition; } Vector3 position = ((Component)attachSegment).transform.position; Vector3 right = ((Component)attachSegment).transform.right; tongueOffset = tongueSegmentMouthOffsets[nearestSegmentToPosition] + Vector3.Dot(attachPosition - position, right); } private void DisableAllPhysics() { DisableHolderPhysics(); Rigidbody[] array = tongueSegments; for (int i = 0; i < array.Length; i++) { array[i].isKinematic = true; } } private static void SetCenterOfMassToWorldPosition(Rigidbody rigidBody, Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 centerOfMass = ((Component)rigidBody).transform.InverseTransformPoint(position); rigidBody.centerOfMass = centerOfMass; } private static void RemoveItemFromPlayerInventory(PlayerControllerB player, GrabbableObject item) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) player.SetSpecialGrabAnimationBool(false, item); player.playerBodyAnimator.SetBool("cancelHolding", true); int num = Array.IndexOf(player.ItemSlots, item); if (num >= 0) { ((Behaviour)HUDManager.Instance.itemSlotIcons[num]).enabled = false; } else if ((Object)(object)player.ItemOnlySlot == (Object)(object)item) { ((Behaviour)HUDManager.Instance.itemOnlySlotIcon).enabled = false; } ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; player.SetObjectAsNoLongerHeld(player.isInElevator, player.isInHangarShipRoom, Vector3.zero, item, -1); item.DiscardItemOnClient(); player.currentlyHeldObjectServer = null; } internal void GrabItem(GrabbableObject item) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)item).IsOwner) { GrabItemOnClient(item); GrabItemServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)item)); } } [ServerRpc(RequireOwnership = false)] private void GrabItemServerRpc(NetworkBehaviourReference itemReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2766935663u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2766935663u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GrabItemClientRpc(itemReference); } } } [ClientRpc] private void GrabItemClientRpc(NetworkBehaviourReference itemReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2443724762u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2443724762u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GrabbableObject item = default(GrabbableObject); if (!((NetworkBehaviourReference)(ref itemReference)).TryGet(ref item, (NetworkManager)null)) { BlackMesaInterior.Logger.LogError((object)"GrabItemClientRpc called with invalid item reference."); } else { GrabItemOnClient(item); } } } private void GrabItemOnClient(GrabbableObject item) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00ca: Unknown result type (might be due to invalid IL or missing references) if (CanGrab && CanGrabItem(item)) { PlayerControllerB playerHeldBy = item.playerHeldBy; if (playerHeldBy != null) { RemoveItemFromPlayerInventory(playerHeldBy, item); } Transform val = item.parentObject ?? ((Component)item).transform; Collider component = ((Component)item).GetComponent(); GetAttachmentPosition(val.position, ((Component)item).transform.position, component, out var attachSegment, out var attachPosition, out var holderPosition, out var centerOfMass, out eatingTongueOffset); eatingTongueOffset += eatDistance; dummyObject.SetPositionAndRotation(attachPosition, Quaternion.identity); dummyObjectJoint.connectedBody = attachSegment; SetCenterOfMassToWorldPosition(dummyObjectBody, centerOfMass); dummyObjectBody.angularDrag = defaultAngularDrag; holder.SetPositionAndRotation(holderPosition, val.rotation); centeredHolderLocalPosition = Vector3.zero; EnableHolderPhysics(); item.parentObject = holder; grabbedItem = item; item.EnablePhysics(false); RagdollGrabbableObject val2 = (RagdollGrabbableObject)(object)((item is RagdollGrabbableObject) ? item : null); if (val2 != null) { val2.heldByEnemy = true; } sounds.PlayGrabItemSound(); BeginPulling(); } } private void GrabPlayer(PlayerControllerB player) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (CanGrabPlayer(player)) { GrabPlayerOnClient(player); GrabPlayerServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)player)); } } [ServerRpc(RequireOwnership = false)] private void GrabPlayerServerRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(680926189u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 680926189u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GrabPlayerClientRpc(playerReference); } } } [ClientRpc] private void GrabPlayerClientRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1744697427u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1744697427u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player = default(PlayerControllerB); if (!((NetworkBehaviourReference)(ref playerReference)).TryGet(ref player, (NetworkManager)null)) { BlackMesaInterior.Logger.LogError((object)"GrabPlayerClientRpc called with invalid player reference."); } else { GrabPlayerOnClient(player); } } } public void GrabPlayerOnClient(PlayerControllerB player) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (CanGrab) { grabbedPlayerPreviousParent = ((Component)player).transform.parent; Vector3 position = ((Component)player).transform.position; Vector3 position2 = ((Component)player.gameplayCamera).transform.position; GetAttachmentPosition(position, position2, player.playerCollider, out var attachSegment, out var attachPosition, out var holderPosition, out var centerOfMass, out eatingTongueOffset); eatingTongueOffset += eatDistance; dummyObject.SetPositionAndRotation(attachPosition, Quaternion.identity); dummyObjectJoint.connectedBody = attachSegment; SetCenterOfMassToWorldPosition(dummyObjectBody, centerOfMass); dummyObjectBody.angularDrag = 5f; holder.SetPositionAndRotation(holderPosition, ((Component)grabbedPlayerPreviousParent).transform.rotation); centeredHolderLocalPosition = position - position2; EnableHolderPhysics(); grabbedPlayer = player; ((Component)grabbedPlayer).transform.SetParent(holder, false); PatchPlayerControllerB.SetPlayerPositionLocked(player, locked: true); sounds.PlayGrabPlayerSound(); BeginPulling(); } } public void GrabEnemy(EnemyAI enemy) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (CanGrabEnemy(enemy)) { GrabEnemyOnClient(enemy); GrabEnemyServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)enemy)); } } [ServerRpc(RequireOwnership = false)] private void GrabEnemyServerRpc(NetworkBehaviourReference enemyReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3702737731u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3702737731u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GrabEnemyClientRpc(enemyReference); } } } [ClientRpc] private void GrabEnemyClientRpc(NetworkBehaviourReference enemyReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3783497581u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3783497581u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; EnemyAI enemy = default(EnemyAI); if (!((NetworkBehaviourReference)(ref enemyReference)).TryGet(ref enemy, (NetworkManager)null)) { BlackMesaInterior.Logger.LogError((object)"GrabEnemyClientRpc called with invalid enemy reference."); } else { GrabEnemyOnClient(enemy); } } } private static Vector3 GetEnemyAttachmentPoint(EnemyAI enemy) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (enemy is MaskedPlayerEnemy) { return enemy.eye.position; } return ((Component)enemy).transform.position; } private static Collider GetEnemyCollider(EnemyAI enemy) { EnemyAICollisionDetect componentInChildren = ((Component)enemy).GetComponentInChildren(); if (componentInChildren == null) { return null; } return ((Component)componentInChildren).GetComponent(); } private static void SetEnemyGrabbedAnimations(EnemyAI enemy) { MaskedPlayerEnemy val = (MaskedPlayerEnemy)(object)((enemy is MaskedPlayerEnemy) ? enemy : null); if (val != null) { ((EnemyAI)val).creatureAnimator.SetBool("HandsOut", false); ((EnemyAI)val).creatureAnimator.SetBool("IsMoving", false); ((EnemyAI)val).creatureAnimator.SetBool("Running", false); ((EnemyAI)val).CancelSpecialAnimationWithPlayer(); return; } FlowerSnakeEnemy val2 = (FlowerSnakeEnemy)(object)((enemy is FlowerSnakeEnemy) ? enemy : null); if (val2 != null) { val2.StopClingingOnLocalClient(false); return; } CentipedeAI val3 = (CentipedeAI)(object)((enemy is CentipedeAI) ? enemy : null); if (val3 != null && (Object)(object)val3.clingingToPlayer != (Object)null) { val3.StopClingingToPlayer(false); } } private void GrabEnemyOnClient(EnemyAI enemy) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if (CanGrab && ((Component)enemy).gameObject.activeInHierarchy) { Vector3 position = ((Component)enemy).transform.position; Vector3 enemyAttachmentPoint = GetEnemyAttachmentPoint(enemy); Collider enemyCollider = GetEnemyCollider(enemy); GetAttachmentPosition(position, enemyAttachmentPoint, enemyCollider, out var attachSegment, out var attachPosition, out var holderPosition, out var centerOfMass, out eatingTongueOffset); eatingTongueOffset += eatDistance; dummyObject.SetPositionAndRotation(attachPosition, Quaternion.identity); dummyObjectJoint.connectedBody = attachSegment; SetCenterOfMassToWorldPosition(dummyObjectBody, centerOfMass); dummyObjectBody.angularDrag = defaultAngularDrag; holder.SetPositionAndRotation(holderPosition, ((Component)enemy).transform.rotation); centeredHolderLocalPosition = position - enemyAttachmentPoint; EnableHolderPhysics(); grabbedEnemy = enemy; ((Component)enemy).gameObject.AddComponent().target = holder; grabbedEnemy.SetClientCalculatingAI(false); ((Behaviour)grabbedEnemy).enabled = false; SetEnemyGrabbedAnimations(grabbedEnemy); sounds.PlayGrabItemSound(); BeginPulling(); } } public void BeginPulling() { sounds.PlayContactSound(); ((MonoBehaviour)this).StartCoroutine(BeginPullingCoroutine()); } [IteratorStateMachine(typeof(d__91))] private IEnumerator BeginPullingCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__91(0) { <>4__this = this }; } public void YankTongue(float distance) { if (!IsDead && state == State.Pulling) { targetTongueOffset = currentTongueOffset - distance; } } public void SetTargetTongueOffset(float distance) { if (!IsDead) { targetTongueOffset = distance; } } private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (centeringHolderPosition) { holder.localPosition = Vector3.Lerp(holder.localPosition, centeredHolderLocalPosition, Time.deltaTime); } if (centeringDummyObjectRotation) { dummyObject.rotation = Quaternion.Lerp(dummyObject.rotation, Quaternion.identity, 4f * Time.deltaTime); } if (state == State.Flinching) { flinchTimeLeft -= Time.deltaTime; if (flinchTimeLeft <= 0f) { DropTongue(); } } if (((NetworkBehaviour)this).IsOwner && state == State.Idle) { idleSoundTime -= Time.deltaTime; if (idleSoundTime <= 0f) { sounds.PlayIdleSoundServerRpc(); SetIdleSoundTimer(); } } } private int GetFirstSegmentBelowMouth() { float num = currentTongueOffset + 1f; for (int i = 0; i < tongueSegments.Length; i++) { if (tongueSegmentMouthOffsets[i] < num) { return i; } } return tongueSegments.Length; } private void UpdateDisabledSegments() { int firstSegmentBelowMouth = GetFirstSegmentBelowMouth(); if (firstSegmentBelowMouth < firstEnabledSegment) { while (firstEnabledSegment-- > firstSegmentBelowMouth) { tongueSegments[firstEnabledSegment].detectCollisions = true; } firstEnabledSegment++; } else if (firstEnabledSegment < firstSegmentBelowMouth) { while (firstEnabledSegment < firstSegmentBelowMouth) { tongueSegments[firstEnabledSegment].detectCollisions = false; firstEnabledSegment++; } } } private void FixedUpdate() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e1: Unknown result type (might be due to invalid IL or missing references) if (state == State.Extending && targetTongueOffset == currentTongueOffset) { EnterIdleState(); return; } if (currentTongueOffset < targetTongueOffset) { currentTongueOffset += tongueDropSpeed * Time.fixedDeltaTime; currentTongueOffset = Math.Min(currentTongueOffset, targetTongueOffset); } else { currentTongueOffset -= tongueRetractSpeed * Time.fixedDeltaTime; currentTongueOffset = Math.Max(currentTongueOffset, targetTongueOffset); } if (state == State.Pulling && HasGrabbedObject && currentTongueOffset < eatingTongueOffset) { BeginEatingGrabbedObject(); } Vector3 val = tongueParentTransform.TransformPoint(retractedTongueLocalPosition) + Vector3.down * currentTongueOffset; tongueSegments[0].MovePosition(val); UpdateDisabledSegments(); } private void EnterIdleState() { if (state == State.Extending) { animator.CrossFadeInFixedTime("Idle", 0.25f); SetState(State.Idle); } } public void BeginEatingGrabbedObject() { if (((NetworkBehaviour)this).IsOwner) { BeginEatingGrabbedObjectClientRpc(); } } [ClientRpc] private void BeginEatingGrabbedObjectClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(250788057u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 250788057u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (state != State.Pulling) { return; } if ((Object)(object)grabbedPlayer != (Object)null || (Object)(object)grabbedBody != (Object)null) { StartHumanoidEatingAnimation(); } else if ((Object)(object)grabbedEnemy != (Object)null) { if (grabbedEnemy is MaskedPlayerEnemy) { StartHumanoidEatingAnimation(); } else { StartFastEatingAnimation(); } } else { if (!((Object)(object)grabbedItem != (Object)null)) { StunOnClient(0.25f); return; } StartFastEatingAnimation(); } targetTongueOffset = eatingTongueOffset; centeringHolderPosition = true; SetState(State.Eating); } private void StartFastEatingAnimation() { animator.CrossFadeInFixedTime("Eat Item", 0.25f); } private void StartHumanoidEatingAnimation() { animator.CrossFadeInFixedTime("Begin Attacking Humanoid", 0.25f); } public void AttachHolderToMouth() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) DisableHolderPhysics(); dummyObjectJoint.connectedBody = null; dummyObject.SetParent(mouthAttachment, true); dummyObject.localPosition = Vector3.zero; if ((Object)(object)grabbedItem == (Object)null) { centeringDummyObjectRotation = true; } } public void BiteGrabbedHumanoid(int damage) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)grabbedPlayer == (Object)null) { SwallowGrabbedHumanoid(); } else if (((NetworkBehaviour)grabbedPlayer).IsOwner && !IsDead) { if (grabbedPlayer.criticallyInjured || grabbedPlayer.isPlayerDead || !grabbedPlayer.AllowPlayerDeath()) { grabbedPlayer.DamagePlayer(0, true, true, (CauseOfDeath)8, 0, false, default(Vector3)); SwallowGrabbedHumanoid(); } else { grabbedPlayer.DamagePlayer(damage, true, true, (CauseOfDeath)8, 0, false, default(Vector3)); } } } private void SwallowGrabbedHumanoid() { SwallowGrabbedHumanoidOnClient(); SwallowGrabbedHumanoidServerRpc(); } [ServerRpc(RequireOwnership = false)] private void SwallowGrabbedHumanoidServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1792072386u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1792072386u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SwallowGrabbedHumanoidClientRpc(); } } } [ClientRpc] private void SwallowGrabbedHumanoidClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2206754031u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2206754031u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SwallowGrabbedHumanoidOnClient(); } } } private void SwallowGrabbedHumanoidOnClient() { animator.SetTrigger("Swallow Humanoid"); } public void CrushTarget() { if ((Object)(object)grabbedPlayer != (Object)null && ((NetworkBehaviour)grabbedPlayer).IsOwner) { KillPlayerServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void KillPlayerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1628460489u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1628460489u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (grabbedPlayer.isPlayerDead || !grabbedPlayer.AllowPlayerDeath()) { DropPlayerWithoutKillingClientRpc(); } else { KillPlayerClientRpc(); } } } [ClientRpc] private void KillPlayerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(571696211u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 571696211u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grabbedPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3), false); } } } [ClientRpc] private void DropPlayerWithoutKillingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2283464221u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2283464221u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DropPlayer(); grabbedPlayer = null; } } } public static void OnRagdollSpawnedForPlayer(PlayerControllerB player) { foreach (Barnacle barnacle in barnacles) { if ((Object)(object)barnacle.grabbedPlayer == (Object)(object)player) { barnacle.AttachRagdoll(); } } } private void AttachRagdoll() { //IL_00e3: 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_00f3: 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) if ((Object)(object)grabbedPlayer == (Object)null) { return; } if ((Object)(object)grabbedPlayer.deadBody == (Object)null) { BlackMesaInterior.Logger.LogWarning((object)string.Format("{0}: Grabbed player {1} has no ragdoll.", "Barnacle.AttachRagdoll()", grabbedPlayer)); return; } Transform val = ((Component)grabbedPlayer.deadBody).transform.Find("spine.001/spine.002/spine.003/spine.004"); if ((Object)(object)val == (Object)null) { grabbedPlayer.deadBody.DeactivateBody(false); return; } Rigidbody connectedBody = default(Rigidbody); if (!((Component)val).TryGetComponent(ref connectedBody)) { BlackMesaInterior.Logger.LogWarning((object)string.Format("{0}: {1}'s ragdoll's head has no rigidbody.", "Barnacle.AttachRagdoll()", grabbedPlayer)); return; } Rigidbody[] bodyParts = grabbedPlayer.deadBody.bodyParts; for (int i = 0; i < bodyParts.Length; i++) { bodyParts[i].detectCollisions = false; } PatchPlayerControllerB.SetPlayerPositionLocked(grabbedPlayer, locked: false); grabbedPlayerPreviousParent = null; holder.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); centeredHolderLocalPosition = Vector3.zero; holderJoint.connectedBody = connectedBody; grabbedBody = grabbedPlayer.deadBody; grabbedPlayer = null; } public void SwallowGrabbedObject() { //IL_00fc: 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) centeringHolderPosition = false; centeringDummyObjectRotation = false; if ((Object)(object)grabbedItem != (Object)null) { grabbedItem.parentObject = itemStash; grabbedItem.EnableItemMeshes(false); GrabbableObject obj = grabbedItem; RagdollGrabbableObject val = (RagdollGrabbableObject)(object)((obj is RagdollGrabbableObject) ? obj : null); if (val != null) { val.ragdoll.DeactivateBody(false); } else { eatenItems.Add(grabbedItem); } grabbedItem = null; } if ((Object)(object)grabbedEnemy != (Object)null) { if (((NetworkBehaviour)grabbedEnemy).IsOwner) { grabbedEnemy.KillEnemyOnOwnerClient(true); } DropEnemy(); ((Component)grabbedEnemy).gameObject.SetActive(false); grabbedEnemy = null; } if (!((Object)(object)grabbedBody != (Object)null)) { return; } grabbedBody.DeactivateBody(false); GrabbableObject grabBodyObject = grabbedBody.grabBodyObject; if (grabBodyObject != null) { PlayerControllerB playerHeldBy = grabBodyObject.playerHeldBy; if (playerHeldBy != null) { if ((Object)(object)playerHeldBy.currentlyHeldObjectServer == (Object)(object)grabBodyObject) { playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } for (int i = 0; i < playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)playerHeldBy.ItemSlots[i] == (Object)(object)grabBodyObject) { playerHeldBy.ItemSlots[i] = null; } } grabBodyObject.EnablePhysics(false); } } dummyObjectJoint.connectedBody = null; grabbedBody = null; } public void SpitChewedGuts() { sounds.PlayPukeSound(); PlayPukeEffect(); } private void DropItem(GrabbableObject item) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Vector3 val = item.parentObject.position; if ((Object)(object)((Component)item).transform.parent != (Object)null) { val = ((Component)item).transform.parent.InverseTransformPoint(val); } item.startFallingPosition = val; item.parentObject = null; item.EnableItemMeshes(true); item.EnablePhysics(true); item.FallToGround(true, false, default(Vector3)); } private void DropPlayer() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)grabbedPlayer == (Object)null)) { PatchPlayerControllerB.SetPlayerPositionLocked(grabbedPlayer, locked: false); Vector3 position = ((Component)grabbedPlayer).transform.position; ((Component)grabbedPlayer).transform.SetParent(grabbedPlayerPreviousParent, false); ((Component)grabbedPlayer).transform.position = position; ResetHolder(); } } private void DropRagdoll() { if (!((Object)(object)grabbedBody == (Object)null)) { Rigidbody[] bodyParts = grabbedBody.bodyParts; for (int i = 0; i < bodyParts.Length; i++) { bodyParts[i].detectCollisions = true; } holderJoint.connectedBody = null; } } private void DropEnemy() { if (!((Object)(object)grabbedEnemy == (Object)null)) { Object.Destroy((Object)(object)((Component)grabbedEnemy).GetComponent()); grabbedEnemy.SetClientCalculatingAI(true); ((Behaviour)grabbedEnemy).enabled = true; ResetHolder(); } } public static void OnPlayerTeleported(PlayerControllerB player) { foreach (Barnacle barnacle in barnacles) { if (player.isPlayerDead) { if ((Object)(object)player.deadBody != (Object)null && (Object)(object)barnacle.grabbedBody == (Object)(object)player.deadBody) { barnacle.DropRagdoll(); barnacle.grabbedBody = null; } } else if ((Object)(object)player == (Object)(object)barnacle.grabbedPlayer) { barnacle.DropPlayer(); barnacle.grabbedPlayer = null; } } } private void ResetHolder() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) DisableHolderPhysics(); dummyObjectJoint.connectedBody = null; dummyObject.position = ((Component)this).transform.position; dummyObject.rotation = Quaternion.identity; } [ServerRpc(RequireOwnership = false)] private void StunServerRpc(float duration) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3820318742u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref duration, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3820318742u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StunClientRpc(duration); } } } [ClientRpc] private void StunClientRpc(float duration) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3690272858u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref duration, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3690272858u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StunOnClient(duration); } } } private void PlayFlinchAnimation() { animator.CrossFadeInFixedTime($"Flinch {animationRandomizer.Next(2) + 1}", 0.125f); } private void StunOnClient(float duration) { SetState(State.Flinching); flinchTimeLeft = duration; animator.ResetTrigger("Swallow Humanoid"); animator.ResetTrigger("Finish Eating"); PlayFlinchAnimation(); sounds.PlayFlinchSound(); DropGrabbedObjectsOnClient(); } private void DropGrabbedObjectsOnClient() { if ((Object)(object)grabbedItem != (Object)null) { DropItem(grabbedItem); ResetHolder(); } grabbedItem = null; DropPlayer(); grabbedPlayer = null; DropRagdoll(); grabbedBody = null; DropEnemy(); grabbedEnemy = null; } [ServerRpc(RequireOwnership = false)] private void StartDyingServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3667224108u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3667224108u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartDyingClientRpc(); } } } [ClientRpc] private void StartDyingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1869264898u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1869264898u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(Die()); } } } public void PlayPukeEffect() { pukeEffect.Reinit(); pukeEffect.Play(); ((MonoBehaviour)this).StartCoroutine(PlayPukeSoundsCoroutine()); } [IteratorStateMachine(typeof(d__131))] private IEnumerator PlayPukeSoundsCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__131(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__132))] private IEnumerator Die() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__132(0) { <>4__this = this }; } public override void OnDestroy() { DropGrabbedObjectsOnClient(); foreach (GrabbableObject eatenItem in eatenItems) { if (!((Object)(object)eatenItem == (Object)null)) { DropItem(eatenItem); } } eatenItems.Clear(); barnacles.Remove(this); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //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 ((NetworkBehaviour)this).__registerRpc(2766935663u, new RpcReceiveHandler(__rpc_handler_2766935663), "GrabItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2443724762u, new RpcReceiveHandler(__rpc_handler_2443724762), "GrabItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(680926189u, new RpcReceiveHandler(__rpc_handler_680926189), "GrabPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1744697427u, new RpcReceiveHandler(__rpc_handler_1744697427), "GrabPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3702737731u, new RpcReceiveHandler(__rpc_handler_3702737731), "GrabEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3783497581u, new RpcReceiveHandler(__rpc_handler_3783497581), "GrabEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(250788057u, new RpcReceiveHandler(__rpc_handler_250788057), "BeginEatingGrabbedObjectClientRpc"); ((NetworkBehaviour)this).__registerRpc(1792072386u, new RpcReceiveHandler(__rpc_handler_1792072386), "SwallowGrabbedHumanoidServerRpc"); ((NetworkBehaviour)this).__registerRpc(2206754031u, new RpcReceiveHandler(__rpc_handler_2206754031), "SwallowGrabbedHumanoidClientRpc"); ((NetworkBehaviour)this).__registerRpc(1628460489u, new RpcReceiveHandler(__rpc_handler_1628460489), "KillPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(571696211u, new RpcReceiveHandler(__rpc_handler_571696211), "KillPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2283464221u, new RpcReceiveHandler(__rpc_handler_2283464221), "DropPlayerWithoutKillingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3820318742u, new RpcReceiveHandler(__rpc_handler_3820318742), "StunServerRpc"); ((NetworkBehaviour)this).__registerRpc(3690272858u, new RpcReceiveHandler(__rpc_handler_3690272858), "StunClientRpc"); ((NetworkBehaviour)this).__registerRpc(3667224108u, new RpcReceiveHandler(__rpc_handler_3667224108), "StartDyingServerRpc"); ((NetworkBehaviour)this).__registerRpc(1869264898u, new RpcReceiveHandler(__rpc_handler_1869264898), "StartDyingClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2766935663(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference itemReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabItemServerRpc(itemReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2443724762(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference itemReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabItemClientRpc(itemReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_680926189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabPlayerServerRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1744697427(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabPlayerClientRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3702737731(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference enemyReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabEnemyServerRpc(enemyReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3783497581(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference enemyReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).GrabEnemyClientRpc(enemyReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_250788057(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; ((Barnacle)(object)target).BeginEatingGrabbedObjectClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1792072386(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; ((Barnacle)(object)target).SwallowGrabbedHumanoidServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2206754031(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; ((Barnacle)(object)target).SwallowGrabbedHumanoidClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1628460489(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; ((Barnacle)(object)target).KillPlayerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_571696211(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; ((Barnacle)(object)target).KillPlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2283464221(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; ((Barnacle)(object)target).DropPlayerWithoutKillingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3820318742(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float duration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref duration, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).StunServerRpc(duration); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3690272858(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float duration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref duration, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barnacle)(object)target).StunClientRpc(duration); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3667224108(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; ((Barnacle)(object)target).StartDyingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1869264898(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; ((Barnacle)(object)target).StartDyingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Barnacle"; } } public class BarnacleSounds : NetworkBehaviour { private static readonly Random soundRandomizer = new Random(); [Header("Components")] public AudioSource mouthAudioSource; public AudioSource attachmentAudioSource; public AudioSource groundAudioSource; [Header("Clips")] public AudioClip[] idleSounds; public AudioClip[] flinchSounds; public AudioClip[] contactSounds; public AudioClip[] pullSounds; public AudioClip[] grabPlayerSounds; public AudioClip[] grabItemSounds; public AudioClip[] bigBiteSounds; public AudioClip[] smallBiteSounds; public AudioClip[] digestSounds; public AudioClip[] deathSounds; public AudioClip[] pukeSounds; public AudioClip[] splashSoundsA; public AudioClip[] splashSoundsB; private AudioClip GetRandomClip(AudioClip[] clips) { if (clips.Length == 0) { return null; } int num = soundRandomizer.Next(clips.Length); return clips[num]; } internal void PlayRandomSound(AudioSource source, AudioClip[] clips) { if (!((Object)(object)source == (Object)null)) { source.clip = GetRandomClip(clips); if ((Object)(object)source.clip == (Object)null) { source.Stop(); } else { source.Play(); } } } internal void PlayRandomSoundOneShot(AudioSource source, AudioClip[] clips) { if (!((Object)(object)source == (Object)null)) { AudioClip randomClip = GetRandomClip(clips); if (!((Object)(object)randomClip == (Object)null)) { source.PlayOneShot(randomClip); } } } [ServerRpc] internal void PlayIdleSoundServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1853027936u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1853027936u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayIdleSoundClientRpc(soundRandomizer.Next(idleSounds.Length)); } } [ClientRpc] private void PlayIdleSoundClientRpc(int index) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2879485040u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2879485040u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (index >= 0 && index < idleSounds.Length) { mouthAudioSource.clip = idleSounds[index]; mouthAudioSource.Play(); } } } internal void PlayContactSound() { PlayRandomSound(attachmentAudioSource, contactSounds); } internal void PlayGrabItemSound() { PlayRandomSoundOneShot(attachmentAudioSource, grabItemSounds); } internal void PlayGrabPlayerSound() { PlayRandomSoundOneShot(mouthAudioSource, grabPlayerSounds); } internal void PlayYankSound() { PlayRandomSound(mouthAudioSource, pullSounds); } public void PlayBigBiteSound() { PlayRandomSound(mouthAudioSource, bigBiteSounds); } public void PlaySmallBiteSound() { PlayRandomSound(mouthAudioSource, smallBiteSounds); } public void PlayDigestSound() { PlayRandomSound(mouthAudioSource, digestSounds); } public void PlayFlinchSound() { PlayRandomSound(mouthAudioSource, flinchSounds); } public void PlayPukeSound() { PlayRandomSound(mouthAudioSource, pukeSounds); } internal void PlaySplashSound() { PlayRandomSound(groundAudioSource, splashSoundsA); PlayRandomSoundOneShot(groundAudioSource, splashSoundsB); } internal void PlayDeathSound() { PlayRandomSound(mouthAudioSource, deathSounds); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1853027936u, new RpcReceiveHandler(__rpc_handler_1853027936), "PlayIdleSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(2879485040u, new RpcReceiveHandler(__rpc_handler_2879485040), "PlayIdleSoundClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1853027936(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((BarnacleSounds)(object)target).PlayIdleSoundServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2879485040(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((BarnacleSounds)(object)target).PlayIdleSoundClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BarnacleSounds"; } } public class BlastDoorEffects : MonoBehaviour { public AudioSource[] effectAudioSources = Array.Empty(); public ParticleSystem[] effectSparks = Array.Empty(); public AudioSource slamAudioSource; public AudioSource announcementAudioSource; private Random random; private void Start() { random = new Random(((Object)this).GetInstanceID()); } public void StartEffects() { AudioSource[] array = effectAudioSources; foreach (AudioSource val in array) { val.time = (float)(random.NextDouble() * (double)val.clip.length); val.Play(); } ParticleSystem[] array2 = effectSparks; for (int i = 0; i < array2.Length; i++) { array2[i].Play(); } } public void EndEffects() { AudioSource[] array = effectAudioSources; for (int i = 0; i < array.Length; i++) { array[i].Stop(); } ParticleSystem[] array2 = effectSparks; for (int i = 0; i < array2.Length; i++) { array2[i].Stop(); } } public void PlaySlam() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) slamAudioSource.Play(); if (!((Object)(object)StartOfRound.Instance.audioListener == (Object)null)) { float num = Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, ((Component)slamAudioSource).transform.position); if (num < 6f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 12f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } } } public void PlayAnnouncement() { announcementAudioSource.Play(); } } internal class ChangeMaterialsEvent : MonoBehaviour { public Renderer renderer; public Material[] materialsToUse; private Material[] originalMaterials; public void ReplaceMaterials() { originalMaterials = renderer.sharedMaterials; renderer.sharedMaterials = materialsToUse; } public void RestoreOriginalMaterials() { if (originalMaterials != null) { renderer.sharedMaterials = originalMaterials; originalMaterials = null; } } } public class ChargingStation : StationBase { public float batterySyncInterval = 0.25f; public float batteryChargePerSecond = 0.2f; private GrabbableObject itemBeingCharged; private float lastBatterySync; protected override void Start() { base.Start(); } protected override void UpdateInteractabilityWithCapacity() { GrabbableObject currentlyHeldObjectServer = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null || !currentlyHeldObjectServer.itemProperties.requiresBattery) { triggerScript.disabledHoverTip = "Use to charge item batteries"; triggerScript.interactable = false; } else if (currentlyHeldObjectServer.insertedBattery.charge >= 1f) { triggerScript.disabledHoverTip = "Battery is full"; triggerScript.interactable = false; } else { triggerScript.interactable = true; } } protected override void OnActivatedByPlayer(PlayerControllerB player, ref float capacityInterpolationDelay) { if (isActiveOnLocalClient) { capacityInterpolationDelay = batterySyncInterval; } itemBeingCharged = player.currentlyHeldObjectServer; } protected override TickResult DoActiveTick() { TickResult result = TickResult.Continue; if (!itemBeingCharged.itemProperties.requiresBattery) { return TickResult.Deactivate; } Battery insertedBattery = itemBeingCharged.insertedBattery; float val = batteryChargePerSecond * Time.deltaTime; val = Math.Min(val, remainingCapacity); float num = insertedBattery.charge + val; if (num >= 1f) { num = 1f; result = TickResult.Deactivate; } _ = insertedBattery.charge; SetBatteryChargeOnLocalClient(itemBeingCharged, num); if (Time.time - lastBatterySync >= batterySyncInterval) { SyncBatteryCharge(); } ConsumeCapacity(val); return result; } protected override void OnActiveTickingEnded() { SyncBatteryCharge(); } private void SyncBatteryCharge() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) lastBatterySync = Time.time; SyncBatteryChargeServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)itemBeingCharged), itemBeingCharged.insertedBattery.charge); } [ServerRpc(RequireOwnership = false)] private void SyncBatteryChargeServerRpc(NetworkBehaviourReference item, float charge) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: 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_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3218380902u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref item, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref charge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3218380902u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncBatteryChargeClientRpc(item, charge); } } } [ClientRpc] private void SyncBatteryChargeClientRpc(NetworkBehaviourReference item, float charge) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3452870845u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref item, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref charge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3452870845u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabbableObject item2 = default(GrabbableObject); if (!isActiveOnLocalClient && ((NetworkBehaviourReference)(ref item)).TryGet(ref item2, (NetworkManager)null)) { SetBatteryChargeOnLocalClient(item2, charge); } } } private void SetBatteryChargeOnLocalClient(GrabbableObject item, float charge) { item.insertedBattery.charge = charge; item.insertedBattery.empty = charge <= 0f; item.ChargeBatteries(); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3218380902u, new RpcReceiveHandler(__rpc_handler_3218380902), "SyncBatteryChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3452870845u, new RpcReceiveHandler(__rpc_handler_3452870845), "SyncBatteryChargeClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3218380902(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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference item = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref item, default(ForNetworkSerializable)); float charge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref charge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChargingStation)(object)target).SyncBatteryChargeServerRpc(item, charge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3452870845(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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference item = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref item, default(ForNetworkSerializable)); float charge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref charge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChargingStation)(object)target).SyncBatteryChargeClientRpc(item, charge); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ChargingStation"; } } [Serializable] public class DiffusionProfileMapping { public Material material; public string diffusionProfileName; } [CreateAssetMenu(menuName = "Black Mesa/Diffusion Profile Mappings")] public class DiffusionProfileMappings : MonoBehaviour { public DiffusionProfileMapping[] mappings; private void Start() { if (mappings == null) { BlackMesaInterior.Logger.LogError((object)$"Diffusion profile mappings were missing\n{new StackTrace()}"); return; } DiffusionProfileSettings[] value = ((VolumeParameter)(object)HDRenderPipelineGlobalSettings.instance.GetOrCreateDiffusionProfileList().diffusionProfiles).value; foreach (DiffusionProfileSettings val in value) { if ((Object)(object)val == (Object)null) { continue; } float num = BitConverter.Int32BitsToSingle((int)val.profile.hash); for (int j = 0; j < mappings.Length; j++) { DiffusionProfileMapping diffusionProfileMapping = mappings[j]; if (diffusionProfileMapping.diffusionProfileName == ((Object)val).name) { diffusionProfileMapping.material.SetFloat("_DiffusionProfileHash", num); } } } } } public sealed class DummyEnemyAI : EnemyAI { public Object targetObject; private IDumbEnemy target; public override void Awake() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown base.thisNetworkObject = ((NetworkBehaviour)this).NetworkObject; base.skinnedMeshRenderers = Array.Empty(); base.meshRenderers = Array.Empty(); base.overlapColliders = (Collider[])(object)new Collider[1]; base.allAINodes = Array.Empty(); base.path1 = new NavMeshPath(); ((Behaviour)this).enabled = false; target = (IDumbEnemy)targetObject; } public override void Start() { } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((IHittable)target).Hit(force, Vector3.zero, playerWhoHit, playHitSFX, hitID); } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null) { if (!setToStunned) { setToStunTime = 0f; } target.Stun(setToStunTime); } public override void OnCollideWithPlayer(Collider other) { } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { } public override void Update() { } public override void KillEnemy(bool destroy = false) { target.Kill(destroy); } public override void EnableEnemyMesh(bool enable, bool overrideDoNotSet = false, bool tamperWithMeshes = false) { } public override void DoAIInterval() { } public override void OnDestroy() { RoundManager.Instance.SpawnedEnemies.Remove((EnemyAI)(object)this); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { ((EnemyAI)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DummyEnemyAI"; } } public class ElevatorCallButton : NetworkBehaviour { public ElevatorController controller; public ElevatorController.Position position; public Animator animator; public AudioSource audioSource; public AudioClip pressedSound; public void PushButton() { PushButtonOnClient(); PushButtonServerRpc(StartOfRound.Instance.localPlayerController.actualClientId); } [Rpc(/*Could not decode attribute arguments.*/)] private void PushButtonServerRpc(ulong sendingClientID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2960103837u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, sendingClientID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2960103837u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PushButtonClientRpc(RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Not(sendingClientID, (RpcTargetUse)0))); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PushButtonClientRpc(RpcParams rpcParams) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2077940660u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2077940660u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PushButtonOnClient(); } } } private void PushButtonOnClient() { audioSource.PlayOneShot(pressedSound); animator.SetTrigger("Press"); controller.CallElevator(position); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2960103837u, new RpcReceiveHandler(__rpc_handler_2960103837), "PushButtonServerRpc"); ((NetworkBehaviour)this).__registerRpc(2077940660u, new RpcReceiveHandler(__rpc_handler_2077940660), "PushButtonClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2960103837(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) { ulong sendingClientID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref sendingClientID); target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorCallButton)(object)target).PushButtonServerRpc(sendingClientID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2077940660(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorCallButton)(object)target).PushButtonClientRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ElevatorCallButton"; } } public class ElevatorController : NetworkBehaviour, IElevator { public enum Position { Bottom, Top } public Animator animator; public PlayerPhysicsRegion physicsRegion; public AudioSource elevatorAudio; public AudioClip elevatorTravelSFX; public AudioClip elevatorReachTopSFX; public AudioClip elevatorReachBottomSFX; public AudioSource jingleSource; public float jingleFadeTime; public float jingleVolume = 1f; public AudioSource dingSource; public Transform insideNavPoint; public Transform bottomNavPoint; public Transform topNavPoint; public Collider insideCollider; public GameObject[] vrButtons; internal Position targetFloor; internal bool doorsOpen = true; private ElevatorFloor bottomFloor; private ElevatorFloor topFloor; private const int goDownAnimTime = 265; private const int goUpAnimTime = 303; private const int avgTransitAnimTime = 253; private const float speed = 0.4f; public Transform InsideButtonNavMeshNode => insideNavPoint; public ElevatorFloor ClosestFloor => GetClosestFloor(); public bool DoorsAreOpen => doorsOpen; public ElevatorFloor TargetFloor { get { if (targetFloor != 0) { return topFloor; } return bottomFloor; } } private void Start() { jingleSource.volume = 0f; jingleSource.Play(); jingleSource.Pause(); LCVRCompatibility.AddElevatorButtonInteractions(vrButtons); } private void CreateFloors() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown if (bottomFloor == null || topFloor == null) { bottomFloor = new ElevatorFloor((IElevator)(object)this, bottomNavPoint); topFloor = new ElevatorFloor((IElevator)(object)this, topNavPoint); } } private void OnEnable() { CreateFloors(); SmartPathfinding.RegisterElevatorFloor(bottomFloor); SmartPathfinding.RegisterElevatorFloor(topFloor); } private void OnDisable() { SmartPathfinding.UnregisterElevatorFloor(bottomFloor); SmartPathfinding.UnregisterElevatorFloor(topFloor); } public void CallElevator(Position position) { if (((NetworkBehaviour)this).IsOwner) { CallElevatorServerRpc(position); } } [ServerRpc] private void CallElevatorServerRpc(Position position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2621090151u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position, default(ForEnums)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2621090151u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallElevatorClientRpc(position); } } [ClientRpc] private void CallElevatorClientRpc(Position position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(757007144u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position, default(ForEnums)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 757007144u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; animator.SetInteger("Floor", (int)position); } } } public void SetTargetFloor(Position position) { doorsOpen = false; targetFloor = position; jingleSource.UnPause(); } public void SetDoorsOpen() { doorsOpen = true; } public void ShakeCamera(ScreenShakeType type) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)StartOfRound.Instance.localPlayerController.physicsParent != (Object)(object)physicsRegion.physicsTransform)) { HUDManager.Instance.ShakeCamera(type); } } public void PlayElevatorTravelSFX() { elevatorAudio.PlayOneShot(elevatorTravelSFX); } public void PlayElevatorReachTopSFX() { elevatorAudio.PlayOneShot(elevatorReachTopSFX); } public void PlayElevatorReachBottomSFX() { elevatorAudio.PlayOneShot(elevatorReachBottomSFX); } public void PlayDingSFX() { dingSource.Play(); } private void Update() { if (jingleSource.isPlaying) { int num = ((!doorsOpen) ? 1 : (-1)); float volume = jingleSource.volume; volume += (float)num * Time.deltaTime / jingleFadeTime * jingleVolume; jingleSource.volume = Mathf.Clamp(volume, 0f, jingleVolume); if (jingleSource.volume <= 0f) { jingleSource.Pause(); } } } private ElevatorFloor GetClosestFloor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Vector3 position = insideNavPoint.position; Vector3 val = bottomNavPoint.position - position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; val = topNavPoint.position - position; float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < sqrMagnitude2) { return bottomFloor; } return topFloor; } private static float GetAnimationSeconds(int animTime) { return (float)animTime / 60f / 0.4f; } public float TimeToCompleteCurrentMovement() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) float y = topNavPoint.position.y; float y2 = bottomNavPoint.position.y; float num = Math.Abs(y - y2); float num2 = ((targetFloor == Position.Bottom) ? y2 : y); float num3 = Math.Abs(insideNavPoint.position.y - num2); return GetAnimationSeconds(253) * num3 / num; } public float TimeFromFloorToFloor(ElevatorFloor a, ElevatorFloor b) { if (a == b) { return 0f; } if (a == bottomFloor) { return GetAnimationSeconds(303); } return GetAnimationSeconds(265); } public void GoToFloor(ElevatorFloor floor) { CallElevator((floor != bottomFloor) ? Position.Top : Position.Bottom); } public bool IsInsideElevator(Vector3 point) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return insideCollider.ClosestPoint(point) == point; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2621090151u, new RpcReceiveHandler(__rpc_handler_2621090151), "CallElevatorServerRpc"); ((NetworkBehaviour)this).__registerRpc(757007144u, new RpcReceiveHandler(__rpc_handler_757007144), "CallElevatorClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2621090151(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Position position = default(Position); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorController)(object)target).CallElevatorServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_757007144(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Position position = default(Position); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorController)(object)target).CallElevatorClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ElevatorController"; } } public class ElevatorInsideButton : NetworkBehaviour { public ElevatorController controller; public AudioSource audioSource; public AudioClip pressedSound; public AudioClip disabledSound; public void PushButton() { PushButtonOnClient(); PushButtonServerRpc(StartOfRound.Instance.localPlayerController.actualClientId); } [Rpc(/*Could not decode attribute arguments.*/)] private void PushButtonServerRpc(ulong sendingClientID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3574409330u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, sendingClientID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3574409330u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PushButtonClientRpc(RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Not(sendingClientID, (RpcTargetUse)0))); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PushButtonClientRpc(RpcParams rpcParams) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1347903093u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1347903093u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PushButtonOnClient(); } } } private void PushButtonOnClient() { if (!controller.doorsOpen) { audioSource.PlayOneShot(disabledSound); return; } audioSource.PlayOneShot(pressedSound); ElevatorController elevatorController = controller; elevatorController.CallElevator(controller.targetFloor switch { ElevatorController.Position.Bottom => ElevatorController.Position.Top, ElevatorController.Position.Top => ElevatorController.Position.Bottom, _ => throw new InvalidOperationException(), }); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3574409330u, new RpcReceiveHandler(__rpc_handler_3574409330), "PushButtonServerRpc"); ((NetworkBehaviour)this).__registerRpc(1347903093u, new RpcReceiveHandler(__rpc_handler_1347903093), "PushButtonClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3574409330(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) { ulong sendingClientID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref sendingClientID); target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorInsideButton)(object)target).PushButtonServerRpc(sendingClientID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1347903093(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((ElevatorInsideButton)(object)target).PushButtonClientRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ElevatorInsideButton"; } } public class HandheldTVCamera : WalkieTalkie, INightVisionCamera { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HandheldTVCamera <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown int num = <>1__state; HandheldTVCamera handheldTVCamera = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; case 1: <>1__state = -1; handheldTVCamera.PlayExplosionWarningSound(); handheldTVCamera.PlayExplosionWarningSoundClientRpc(); <>2__current = (object)new WaitForSeconds(handheldTVCamera.HandheldExplosionDelay); <>1__state = 2; return true; case 2: <>1__state = -1; handheldTVCamera.ExplodeClientRPC(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Camera securityCamera; public Light nightVisionLight; public AudioClip HandheldExplosionWarning; public float HandheldExplosionDelay = 5f; private bool hasExploded; public Camera Camera => securityCamera; public Light NightVisionLight => nightVisionLight; public override void Start() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown ((WalkieTalkie)this).Start(); securityCamera.targetTexture = new RenderTexture(securityCamera.targetTexture); base.onMaterial = new Material(base.onMaterial) { mainTexture = (Texture)(object)securityCamera.targetTexture }; SecurityCameraManager.Instance.AssignHandheldTVFeed(this, base.onMaterial); } public void ShipIsLeaving() { if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(ExplodeAfterDelay()); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator ExplodeAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } [ClientRpc] public void PlayExplosionWarningSoundClientRpc() { //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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1964363742u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1964363742u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { PlayExplosionWarningSound(); } } } public void PlayExplosionWarningSound() { base.thisAudio.PlayOneShot(HandheldExplosionWarning); } [ClientRpc] public void ExplodeClientRPC() { //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_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4288225865u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4288225865u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!hasExploded) { hasExploded = true; BetterExplosion.SpawnExplosion(((Component)this).transform.position, 0.5f, 2f, 20); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { int num = Array.IndexOf(((GrabbableObject)this).playerHeldBy.ItemSlots, (GrabbableObject)(object)this); ((GrabbableObject)this).playerHeldBy.DestroyItemInSlot(num); } else if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } public override void Update() { ((WalkieTalkie)this).Update(); ((Component)Camera).gameObject.SetActive(((GrabbableObject)this).isBeingUsed); } public override void LateUpdate() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) ((GrabbableObject)this).LateUpdate(); if (((GrabbableObject)this).isPocketed && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 1f, 0f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0f, 90f, 90f); Transform lowerSpine = ((GrabbableObject)this).playerHeldBy.lowerSpine; ((Component)this).transform.position = lowerSpine.position + val; ((Component)this).transform.rotation = lowerSpine.rotation * Quaternion.Euler(val2); } } protected override void __initializeVariables() { ((WalkieTalkie)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1964363742u, new RpcReceiveHandler(__rpc_handler_1964363742), "PlayExplosionWarningSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(4288225865u, new RpcReceiveHandler(__rpc_handler_4288225865), "ExplodeClientRPC"); ((WalkieTalkie)this).__initializeRpcs(); } private static void __rpc_handler_1964363742(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; ((HandheldTVCamera)(object)target).PlayExplosionWarningSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4288225865(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; ((HandheldTVCamera)(object)target).ExplodeClientRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HandheldTVCamera"; } } public class HealingStation : StationBase { public float healthSyncInterval; public float healthPerSecond = 10f; private int maximumPlayerHealth; private float healthRemainder; private float lastHealthSync; protected override void Start() { base.Start(); maximumPlayerHealth = GameNetworkManager.Instance.localPlayerController.health; if (healthSyncInterval == 0f) { healthSyncInterval = capacitySyncInterval; } } protected override void UpdateInteractabilityWithCapacity() { if (GameNetworkManager.Instance.localPlayerController.health >= maximumPlayerHealth) { triggerScript.disabledHoverTip = "Already full health"; triggerScript.interactable = false; } else { triggerScript.interactable = true; } } protected override void OnActivatedByPlayer(PlayerControllerB player, ref float capacityInterpolationDelay) { if (isActiveOnLocalClient) { capacityInterpolationDelay = 1f / healthPerSecond; } healthRemainder = 0f; } protected override TickResult DoActiveTick() { TickResult result = TickResult.Continue; float val = healthPerSecond * Time.deltaTime + healthRemainder; val = Math.Min(val, remainingCapacity); int health = playerInteracting.health; healthRemainder = val % 1f; PlayerControllerB obj = playerInteracting; obj.health += (int)val; if (playerInteracting.health >= maximumPlayerHealth) { playerInteracting.health = maximumPlayerHealth; result = TickResult.Deactivate; } int num = playerInteracting.health - health; if (num > 0) { HUDManager.Instance.UpdateHealthUI(playerInteracting.health, false); if (playerInteracting.health >= 10) { playerInteracting.MakeCriticallyInjured(false); } if (Time.time - lastHealthSync >= healthSyncInterval) { UpdatePlayerHealth(); } } ConsumeCapacity(num); return result; } protected override void OnActiveTickingEnded() { UpdatePlayerHealth(); } private void UpdatePlayerHealth() { UpdatePlayerHealthServerRpc((int)playerInteracting.playerClientId, playerInteracting.health, playerInteracting.health >= maximumPlayerHealth); lastHealthSync = Time.time; } [ServerRpc(RequireOwnership = false)] private void UpdatePlayerHealthServerRpc(int playerID, int health, bool fullyHealed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00b1: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2166540083u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, health); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fullyHealed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2166540083u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UpdatePlayerHealthClientRpc(playerID, health, fullyHealed); } } } [ClientRpc] private void UpdatePlayerHealthClientRpc(int playerID, int health, bool fullyHealed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00b1: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(963848832u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, health); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fullyHealed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 963848832u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isActiveOnLocalClient) { StartOfRound.Instance.allPlayerScripts[playerID].DamageOnOtherClients(0, health); if (fullyHealed) { StopActiveAudioOnClient(); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2166540083u, new RpcReceiveHandler(__rpc_handler_2166540083), "UpdatePlayerHealthServerRpc"); ((NetworkBehaviour)this).__registerRpc(963848832u, new RpcReceiveHandler(__rpc_handler_963848832), "UpdatePlayerHealthClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2166540083(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int health = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref health); bool fullyHealed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fullyHealed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HealingStation)(object)target).UpdatePlayerHealthServerRpc(playerID, health, fullyHealed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_963848832(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int health = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref health); bool fullyHealed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fullyHealed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HealingStation)(object)target).UpdatePlayerHealthClientRpc(playerID, health, fullyHealed); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HealingStation"; } } public class LightController : MonoBehaviour { private class LightSwitcherGroup { internal List lights = new List(); internal bool wasOn; internal float timeOffset; internal float flickerSpeed = 1f; internal bool playedFlickerSound; } private enum State { Idle, TurningOff, TurningOn, Flickering } internal static LightController instance; public AnimationCurve flickeringLightEnabledAnimation; public int groupCount; public float flickerTime = 0.37f; private Random random; private LightSwitcherGroup[] lightSwitcherGroups; private State state = State.TurningOn; private float animationTime; private void Awake() { instance = this; } private void Start() { PopulateLightGroupsAfterDungeonGeneration(); } private DungeonGenerator FindDungeonGenerator(out GameObject root) { Dungeon dungeon = ((Component)this).GetComponentInParent().Dungeon; root = ((Component)dungeon).gameObject; RuntimeDungeon[] array = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0); foreach (RuntimeDungeon val in array) { if (val.Generator != null && (Object)(object)val.Generator.CurrentDungeon == (Object)(object)dungeon) { root = val.Root; return val.Generator; } } return null; } private void PopulateLightGroupsAfterDungeonGeneration() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown GameObject root; DungeonGenerator val = FindDungeonGenerator(out root); if (val == null || (int)val.Status == 8) { PopulateLightGroups(root); return; } val.OnGenerationStatusChanged += (GenerationStatusDelegate)delegate(DungeonGenerator _, GenerationStatus status) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 if ((int)status == 8) { PopulateLightGroups(root); } }; } private void PopulateLightGroups(GameObject root) { if (lightSwitcherGroups != null) { return; } random = new Random(StartOfRound.Instance.randomMapSeed); List list = new List(); root.GetComponentsInChildren(list); list.Sort((LightSwitcher a, LightSwitcher b) => ((Object)a).GetInstanceID().CompareTo(((Object)b).GetInstanceID())); lightSwitcherGroups = new LightSwitcherGroup[groupCount]; int num = list.Count / groupCount; for (int i = 0; i < groupCount; i++) { List list2 = new List(); for (int j = 0; j < num; j++) { int index = random.Next(0, list.Count); list2.Add(list[index]); list.RemoveAt(index); } lightSwitcherGroups[i] = new LightSwitcherGroup { lights = list2, timeOffset = (float)random.NextDouble() * 0.2f }; } lightSwitcherGroups[^1].lights.AddRange(list); } public void EnableLights() { animationTime = 0f; state = State.TurningOn; } public void DisableLights() { animationTime = 0f; state = State.TurningOff; } public void FlickerLights() { if (lightSwitcherGroups != null) { LightSwitcherGroup[] array = lightSwitcherGroups; foreach (LightSwitcherGroup obj in array) { obj.flickerSpeed = 0.6f + (float)random.NextDouble() * 0.8f; obj.playedFlickerSound = false; } animationTime = 0f; state = State.Flickering; } } private void Update() { if (lightSwitcherGroups == null || state == State.Idle) { return; } animationTime += Time.deltaTime; bool flag = true; for (int i = 0; i < lightSwitcherGroups.Length; i++) { LightSwitcherGroup lightSwitcherGroup = lightSwitcherGroups[i]; bool flag2 = lightSwitcherGroup.wasOn; bool sound = true; float num = animationTime - lightSwitcherGroup.timeOffset; bool flag3 = false; if (state == State.TurningOn) { flag2 = num >= 0f; flag3 = flag2; } else if (state == State.TurningOff) { flag2 = num < 0f; flag3 = !flag2; } else if (state == State.Flickering) { float num2 = Mathf.Min((animationTime - lightSwitcherGroup.timeOffset) / flickerTime * lightSwitcherGroup.flickerSpeed, 1f); if (num2 >= 0f) { if (!lightSwitcherGroup.playedFlickerSound) { foreach (LightSwitcher light in lightSwitcherGroup.lights) { light.PlayFlickerSound(); } lightSwitcherGroup.playedFlickerSound = true; } flag2 = flickeringLightEnabledAnimation.Evaluate(num2) > 0.5f; } flag3 = num2 >= 1f; sound = false; } if (!flag3) { flag = false; } if (flag2 == lightSwitcherGroup.wasOn) { continue; } foreach (LightSwitcher light2 in lightSwitcherGroup.lights) { light2.SwitchLight(flag2, sound); } lightSwitcherGroup.wasOn = flag2; } if (flag) { state = State.Idle; } } } public class LightSwitcher : MonoBehaviour { [Serializable] public struct LightMaterialReference { public Renderer renderer; public int index; public Material onMaterial; public Material offMaterial; } private static AudioClip vanillaOnSound; private static AudioClip vanillaOffSound; private static AudioClip vanillaFlickerSound; public Light[] lights = Array.Empty(); public LightMaterialReference[] materialReferences = Array.Empty(); public AudioSource audioSource; public bool useVanillaAudio; public AudioClip onSound; public AudioClip offSound; public AudioClip flickerSound; internal static void CacheVanillaLightSounds() { if ((Object)(object)vanillaOnSound != (Object)null) { return; } AudioClip[] array = Resources.FindObjectsOfTypeAll(); foreach (AudioClip val in array) { if ((Object)(object)vanillaOnSound == (Object)null && ((Object)val).name == "LightOn") { vanillaOnSound = val; } else if ((Object)(object)vanillaOffSound == (Object)null && ((Object)val).name == "LightOff") { vanillaOffSound = val; } else if ((Object)(object)vanillaFlickerSound == (Object)null && ((Object)val).name == "LightFlicker") { vanillaFlickerSound = val; } } } private void Start() { if (useVanillaAudio) { onSound = vanillaOnSound; offSound = vanillaOffSound; flickerSound = vanillaFlickerSound; } } internal void SwitchLight(bool on, bool sound) { Light[] array = lights; foreach (Light val in array) { if (!((Object)(object)val == (Object)null)) { ((Component)val).gameObject.SetActive(on); } } LightMaterialReference[] array2 = materialReferences; for (int i = 0; i < array2.Length; i++) { LightMaterialReference lightMaterialReference = array2[i]; if (!((Object)(object)lightMaterialReference.renderer == (Object)null)) { Material[] sharedMaterials = lightMaterialReference.renderer.sharedMaterials; if (lightMaterialReference.index >= sharedMaterials.Length) { Debug.LogWarning((object)$"{this} references a material index that is out of bounds ({lightMaterialReference.index})"); continue; } sharedMaterials[lightMaterialReference.index] = (on ? lightMaterialReference.onMaterial : lightMaterialReference.offMaterial); lightMaterialReference.renderer.sharedMaterials = sharedMaterials; } } if (sound) { AudioClip val2 = (on ? onSound : offSound); if ((Object)(object)val2 != (Object)null) { audioSource.PlayOneShot(val2); } } } internal void PlayFlickerSound() { if (!((Object)(object)audioSource == (Object)null) && !((Object)(object)flickerSound == (Object)null)) { audioSource.pitch = Random.Range(0.6f, 1.4f); audioSource.PlayOneShot(flickerSound); } } } public class LockPosition : MonoBehaviour { internal Transform target; private void LateUpdate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = target.position; ((Component)this).transform.rotation = target.rotation; } } public class LungPropDisconnectedHandler : MonoBehaviour { public UnityEvent Event = new UnityEvent(); internal void TriggerEvent() { Event.Invoke(); } internal static void TriggerAllEvents() { LungPropDisconnectedHandler[] array = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { array[i].TriggerEvent(); } } } public class PlayerTriggerRegion : MonoBehaviour { public UnityEvent onStay; private void OnTriggerStay(Collider other) { PlayerControllerB val = default(PlayerControllerB); if (((Component)other).CompareTag("Player") && ((Component)other).TryGetComponent(ref val)) { onStay.Invoke(val); } } } internal class PlayParticleAnimationEvent : MonoBehaviour { public ParticleSystem particleSystemA; public void PlayParticleSystemA() { particleSystemA.Play(); } public void StopParticleSystemA() { particleSystemA.Stop(); } } public class PushRegion : MonoBehaviour { public PushRegion oppositePushRegion; private Vector3 lastPosition; private List playersToPush = new List(); private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) lastPosition = ((Component)this).transform.position; } private void FixedUpdate() { playersToPush.Clear(); } private void OnTriggerStay(Collider other) { PlayerControllerB item = default(PlayerControllerB); if (((Component)other).CompareTag("Player") && ((Component)other).TryGetComponent(ref item)) { playersToPush.Add(item); } } private void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 val = position - lastPosition; if (val == Vector3.zero) { return; } int num = 0; while (num < playersToPush.Count) { PlayerControllerB val2 = playersToPush[num]; Transform transform = ((Component)val2).transform; transform.position += val; if ((Object)(object)oppositePushRegion != (Object)null && oppositePushRegion.playersToPush.Contains(val2)) { val2.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3), false); playersToPush.RemoveAt(num); } else { num++; } } lastPosition = position; } } public class ReassignInteractTriggerForDoorLock : MonoBehaviour { public DoorLock doorToTrigger; public InteractTrigger interactTrigger; private void Start() { doorToTrigger.doorTrigger = interactTrigger; } } public class SetRandomYawOnSpawn : MonoBehaviour { private void Start() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(StartOfRound.Instance.randomMapSeed + ((Component)this).transform.position.IntHash()); ((Component)this).transform.rotation = Quaternion.Euler(0f, (float)random.NextDouble() * 360f, 0f); } } internal class SpawnVanillaItem : MonoBehaviour { public string itemName; private void Awake() { Item itemByName = GetItemByName(itemName); if ((Object)(object)itemByName == (Object)null) { BlackMesaInterior.Logger.LogError((object)(((Component)this).transform.GetPath() + " did not find its item by name " + itemName + ".")); return; } SpawnSyncedObject val = ((Component)this).GetComponent(); if (val == null) { val = ((Component)this).gameObject.AddComponent(); } val.spawnPrefab = itemByName.spawnPrefab; } private Item GetItemByName(string name) { foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == name) { return items; } } return null; } } public abstract class StationBase : NetworkBehaviour { protected enum AnimationState { None, Active, Exiting } [Flags] protected enum AnimationFlags { None = 0, PlayedStartupAudio = 2, PlayedActiveAudio = 4, StoppedSpecialAnimation = 8, StartedSpecialAnimation = 0x10, StoppedActiveAudio = 0x20 } private struct CapacityCheckpoint { internal float time; internal float capacity; public CapacityCheckpoint(float time, float capacity) { this.time = time; this.capacity = capacity; } } protected enum TickResult { Continue, Deactivate } public InteractTrigger triggerScript; public AudioSource startupAudio; public AudioSource activeAudio; public AudioSource depletedAudio; public Animator animator; public Renderer renderer; public float emissiveMultiplier = 1f; public int[] emissiveMaterialIndices; public float maxCapacity = 100f; public float startupAudioTime = 0.25f; public float activeDelayTime = 0.5f; public float activeAudioStartTime = 0.75f; public float activeAudioEndTime = 0.4f; public float activeEndTime = 0.65f; public bool stopActiveAudioInstantly; public float capacitySyncInterval = 0.25f; private Material[] materials; private Color[] materialEmissives; private float prevEmissiveMultiplier; private int emissiveColorPropertyID = Shader.PropertyToID("_EmissiveColor"); protected bool isActiveOnLocalClient; protected float remainingCapacity; private float prevRemainingCapacity = -1f; private float lastCapacitySync; private float timeUntilActive; private float timeUntilInactive; protected PlayerControllerB playerInteracting; protected AnimationState state; protected float stateStartTime; protected AnimationFlags stateFlags; private InputAction interactAction; private CapacityCheckpoint prevCapacityCheckpoint; private Queue capacityInterpolationQueue = new Queue(); private float capacityInterpolationDelay; private bool addedInitialCheckpoint; protected virtual void Start() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) remainingCapacity = maxCapacity; interactAction = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Interact", false); prevCapacityCheckpoint = new CapacityCheckpoint(Time.time, remainingCapacity); materials = (Material[])(object)new Material[emissiveMaterialIndices.Length]; materialEmissives = (Color[])(object)new Color[emissiveMaterialIndices.Length]; for (int i = 0; i < emissiveMaterialIndices.Length; i++) { Material val = renderer.materials[emissiveMaterialIndices[i]]; materials[i] = val; materialEmissives[i] = val.GetColor(emissiveColorPropertyID); } } private void SetAnimationState(AnimationState state) { if (this.state != state) { this.state = state; stateStartTime = Time.time; if (state == AnimationState.None) { stateFlags = AnimationFlags.None; } } } public void SetActivatedByLocalPlayer() { isActiveOnLocalClient = true; SetActivatedByPlayer(GameNetworkManager.Instance.localPlayerController); } public void SetActivatedByOtherClient(PlayerControllerB player) { if (!((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isActiveOnLocalClient = false; SetActivatedByPlayer(player); } } private void SetActivatedByPlayer(PlayerControllerB player) { timeUntilActive = activeDelayTime; timeUntilInactive = float.PositiveInfinity; playerInteracting = player; capacityInterpolationDelay = capacitySyncInterval; OnActivatedByPlayer(player, ref capacityInterpolationDelay); SetAnimationState(AnimationState.Active); addedInitialCheckpoint = false; } protected abstract void OnActivatedByPlayer(PlayerControllerB player, ref float capacityInterpolationDelay); private bool HasFinishedActivating() { return timeUntilActive <= 0f; } private void Update() { UpdateInteractability(); timeUntilActive -= Time.deltaTime; if (state != 0 && !addedInitialCheckpoint && HasFinishedActivating()) { capacityInterpolationQueue.Enqueue(new CapacityCheckpoint(Time.time, remainingCapacity)); addedInitialCheckpoint = true; } TickIfActive(); switch (state) { case AnimationState.Active: DoActiveAnimationTick(); break; case AnimationState.Exiting: DoExitingAnimationTick(); break; } AnimateCapacity(); } private void UpdateInteractability() { if (remainingCapacity <= 0f) { triggerScript.disabledHoverTip = "Depleted"; triggerScript.interactable = false; } else { UpdateInteractabilityWithCapacity(); } } protected abstract void UpdateInteractabilityWithCapacity(); private void TickIfActive() { if (!isActiveOnLocalClient || !HasFinishedActivating()) { return; } bool flag = false; if (timeUntilInactive == float.PositiveInfinity) { if (!interactAction.IsPressed()) { timeUntilInactive = activeEndTime; StartExitingAnimationServerRpc(); } } else { timeUntilInactive -= Time.deltaTime; if (timeUntilInactive < 0f) { flag = true; } } if (DoActiveTick() == TickResult.Deactivate) { flag = true; StartExitingAnimationServerRpc(); } if (remainingCapacity == 0f) { flag = true; StartExitingAnimationServerRpc(); } bool flag2 = prevRemainingCapacity != remainingCapacity; bool flag3 = false; if (flag2) { prevRemainingCapacity = remainingCapacity; UpdateCapacityAnimation(); if (Time.time - lastCapacitySync >= capacitySyncInterval) { SyncCapacity(); flag3 = true; } } if (flag) { isActiveOnLocalClient = false; if (flag2 && !flag3) { SyncCapacity(); } OnActiveTickingEnded(); } } protected abstract TickResult DoActiveTick(); protected abstract void OnActiveTickingEnded(); protected void ConsumeCapacity(float amount) { if (amount > remainingCapacity) { throw new ArgumentOutOfRangeException("amount", $"Capacity to consume {amount:.4} was greater than remaining capacity {remainingCapacity:.4}"); } remainingCapacity -= amount; } private void SyncCapacity() { UpdateCapacityServerRpc(remainingCapacity); lastCapacitySync = Time.time; } [ServerRpc(RequireOwnership = false)] private void UpdateCapacityServerRpc(float capacity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2858899650u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref capacity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2858899650u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { capacity = Math.Min(capacity, remainingCapacity); } UpdateCapacityClientRpc(capacity); } } [ClientRpc] private void UpdateCapacityClientRpc(float capacity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3741989835u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref capacity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3741989835u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!isActiveOnLocalClient) { remainingCapacity = capacity; UpdateCapacityAnimation(); } } } private void UpdateCapacityAnimation() { prevRemainingCapacity = remainingCapacity; capacityInterpolationQueue.Enqueue(new CapacityCheckpoint(Time.time, remainingCapacity)); if (remainingCapacity <= 0f) { StopActiveAudioOnClient(immediate: true); depletedAudio.Play(); animator.SetTrigger("Shuttered"); } else { animator.ResetTrigger("Shuttered"); } } private float GetUsedCapacityFraction(float remainingCapacity) { return 1f - Math.Min(remainingCapacity / maxCapacity, 1f); } private void AnimateCapacity() { float num = Time.time - capacityInterpolationDelay; CapacityCheckpoint result; while (capacityInterpolationQueue.TryPeek(out result) && result.time <= num) { prevCapacityCheckpoint = capacityInterpolationQueue.Dequeue(); } if (!capacityInterpolationQueue.TryPeek(out var result2)) { animator.SetFloat("UsedCapacity", GetUsedCapacityFraction(prevCapacityCheckpoint.capacity)); return; } float num2 = Mathf.Clamp01((num - prevCapacityCheckpoint.time) / (result2.time - prevCapacityCheckpoint.time)); float usedCapacityFraction = GetUsedCapacityFraction(Mathf.Lerp(prevCapacityCheckpoint.capacity, result2.capacity, num2)); animator.SetFloat("UsedCapacity", usedCapacityFraction); } private void DoActiveAnimationTick() { float num = Time.time - stateStartTime; if (!stateFlags.HasFlag(AnimationFlags.PlayedStartupAudio) && num >= startupAudioTime) { startupAudio.Play(); stateFlags |= AnimationFlags.PlayedStartupAudio; } if (!stateFlags.HasFlag(AnimationFlags.PlayedActiveAudio) && num >= activeAudioStartTime) { if (!stopActiveAudioInstantly) { activeAudio.loop = true; } activeAudio.Play(); stateFlags |= AnimationFlags.PlayedActiveAudio; } if (!(num < 1f) && !stateFlags.HasFlag(AnimationFlags.StoppedSpecialAnimation)) { playerInteracting.playerBodyAnimator.speed = 0f; stateFlags |= AnimationFlags.StoppedSpecialAnimation; } } [ServerRpc(RequireOwnership = false)] internal void StartExitingAnimationServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3659585685u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3659585685u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartExitingAnimationClientRpc(); } } } [ClientRpc] internal void StartExitingAnimationClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3762329546u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3762329546u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetAnimationState(AnimationState.Exiting); } } } protected void StopActiveAudioOnClient(bool immediate = false) { if (immediate || stopActiveAudioInstantly) { activeAudio.Stop(); } else { activeAudio.loop = false; } stateFlags |= AnimationFlags.StoppedActiveAudio; } private void DoExitingAnimationTick() { float num = Time.time - stateStartTime; if (!stateFlags.HasFlag(AnimationFlags.StartedSpecialAnimation)) { playerInteracting.playerBodyAnimator.speed = 1f; stateFlags |= AnimationFlags.StartedSpecialAnimation; } if (!stateFlags.HasFlag(AnimationFlags.StoppedActiveAudio) && num >= activeAudioEndTime) { StopActiveAudioOnClient(); } if (!(num < 1f)) { triggerScript.StopSpecialAnimation(); SetAnimationState(AnimationState.None); } } private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (emissiveMultiplier != prevEmissiveMultiplier) { for (int i = 0; i < materials.Length; i++) { materials[i].SetColor(emissiveColorPropertyID, materialEmissives[i] * emissiveMultiplier); } prevEmissiveMultiplier = emissiveMultiplier; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2858899650u, new RpcReceiveHandler(__rpc_handler_2858899650), "UpdateCapacityServerRpc"); ((NetworkBehaviour)this).__registerRpc(3741989835u, new RpcReceiveHandler(__rpc_handler_3741989835), "UpdateCapacityClientRpc"); ((NetworkBehaviour)this).__registerRpc(3659585685u, new RpcReceiveHandler(__rpc_handler_3659585685), "StartExitingAnimationServerRpc"); ((NetworkBehaviour)this).__registerRpc(3762329546u, new RpcReceiveHandler(__rpc_handler_3762329546), "StartExitingAnimationClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2858899650(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float capacity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref capacity, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StationBase)(object)target).UpdateCapacityServerRpc(capacity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3741989835(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float capacity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref capacity, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StationBase)(object)target).UpdateCapacityClientRpc(capacity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3659585685(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; ((StationBase)(object)target).StartExitingAnimationServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3762329546(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; ((StationBase)(object)target).StartExitingAnimationClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "StationBase"; } } internal class Tripmine : NetworkBehaviour { private struct ExplosionOrigin { public Vector3 position; public Vector3 direction; public ExplosionOrigin(Vector3 position, Vector3 direction) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) this.position = position; this.direction = direction; } } public static Lazy RaycastLayers = new Lazy(() => LayerMask.GetMask(new string[1] { "Room" })); public LineRenderer laserRenderer; public BoxCollider laserCollider; public TerminalAccessibleObject terminalObject; public AudioSource toggleAudio; public AudioClip deactivationClip; public AudioClip activationClip; public float explosionOriginOffset; public float killRadius; public float hurtRadius; public int nonLethalDamage; public float sphereCastRange; public float sphereCastRadius; private bool hasExplodedOnClient; private bool activated = true; private void Start() { SetupLaserAndCollider(); PlaceTerminalAccessibleObjectOnFloor(); } public void SetupLaserAndCollider() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(((Component)this).transform.position, -((Component)this).transform.up, ref val, float.PositiveInfinity, RaycastLayers.Value, (QueryTriggerInteraction)1)) { BlackMesaInterior.Logger.LogWarning((object)$"{this} at {((Component)this).transform.position} failed its raycast, disabling."); ((Component)this).gameObject.SetActive(false); return; } float num = ((RaycastHit)(ref val)).distance / ((Component)this).transform.lossyScale.y; float num2 = num / 2f; Vector3[] array = (Vector3[])(object)new Vector3[2] { ((Component)this).transform.position, ((RaycastHit)(ref val)).point }; Matrix4x4 worldToLocalMatrix = ((Component)laserRenderer).transform.worldToLocalMatrix; for (int i = 0; i < array.Length; i++) { array[i] = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(array[i]); } laserRenderer.SetPositions(array); laserCollider.size = new Vector3(laserCollider.size.x, num, laserCollider.size.z); laserCollider.center = new Vector3(0f, 0f - num2, 0f); } public void PlaceTerminalAccessibleObjectOnFloor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position - ((Component)this).transform.up * 0.2f; RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, -((Component)this).transform.forward, ref val2, 3f, RaycastLayers.Value)) { ((Component)terminalObject).transform.position = val; } else { ((Component)terminalObject).transform.position = ((RaycastHit)(ref val2)).point; } } private bool TryGetPlayerForCollider(Collider collider, out PlayerControllerB player) { player = null; if (((Component)collider).CompareTag("Player") && ((Component)collider).TryGetComponent(ref player)) { return true; } if (((Component)collider).tag.StartsWith("PlayerBody")) { player = ((Component)collider).GetComponentInParent(); return (Object)(object)player != (Object)null; } return false; } private void OnTriggerStay(Collider other) { if (activated && !hasExplodedOnClient) { NetworkBehaviour val = null; if (TryGetPlayerForCollider(other, out var player) && !player.isPlayerDead) { val = (NetworkBehaviour)(object)player; } else if (((Component)other).tag.StartsWith("PlayerRagdoll")) { val = (NetworkBehaviour)(object)((Component)other).GetComponent()?.grabBodyObject; } else if (((Component)other).CompareTag("PhysicsProp")) { val = (NetworkBehaviour)(object)((Component)other).GetComponent(); } if (!((Object)(object)val == (Object)null) && val.IsOwner) { Explode(); TriggerExplosionServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void TriggerExplosionServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(535128068u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 535128068u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TriggerExplosionClientRpc(); } } } [ClientRpc] public void TriggerExplosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1183756170u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1183756170u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Explode(); } } } private ExplosionOrigin GetExplosionOrigin() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 val = -((Component)this).transform.up; return new ExplosionOrigin(position + val * explosionOriginOffset, val); } private void Explode() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!hasExplodedOnClient) { hasExplodedOnClient = true; ExplosionOrigin explosionOrigin = GetExplosionOrigin(); BetterExplosion.SpawnExplosion(explosionOrigin.position, killRadius, hurtRadius, nonLethalDamage); BetterExplosion.DeadlySphereCastExplosion(explosionOrigin.position, explosionOrigin.direction, sphereCastRadius, sphereCastRange, BetterExplosion.GetEnemyDamage(nonLethalDamage)); ((Component)this).gameObject.SetActive(false); Object.Destroy((Object)(object)terminalObject); } } public void SetActivated(bool activated) { SetActivatedOnLocalClient(activated); SetActivatedServerRpc(activated); } [ServerRpc(RequireOwnership = false)] private void SetActivatedServerRpc(bool activated) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2536999585u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref activated, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2536999585u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetActivatedClientRpc(activated); } } } [ClientRpc] private void SetActivatedClientRpc(bool activated) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(360401534u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref activated, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 360401534u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetActivatedOnLocalClient(activated); } } } private void SetActivatedOnLocalClient(bool activated) { if (this.activated != activated) { this.activated = activated; ((Renderer)laserRenderer).enabled = activated; PlayToggleAudio(); } } private void PlayToggleAudio() { if (!((Object)(object)toggleAudio == (Object)null)) { if (activated && (Object)(object)activationClip != (Object)null) { toggleAudio.PlayOneShot(activationClip); } if (!activated && (Object)(object)deactivationClip != (Object)null) { toggleAudio.PlayOneShot(deactivationClip); } } } [MethodImpl(MethodImplOptions.NoInlining)] private void OnDrawGizmosSelected() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_008e: 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_00a3: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f6: 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_0105: 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_0117: Unknown result type (might be due to invalid IL or missing references) DrawingScope val = default(DrawingScope); try { ExplosionOrigin explosionOrigin = GetExplosionOrigin(); Handles.color = Color.red; Handles.DrawWireDisc(explosionOrigin.position, ((Component)this).transform.forward, killRadius); Vector3 val2 = explosionOrigin.position - ((Component)this).transform.up * sphereCastRange; Handles.DrawWireArc(explosionOrigin.position, ((Component)this).transform.forward, ((Component)this).transform.right, 180f, sphereCastRadius); Handles.DrawLine(explosionOrigin.position - ((Component)this).transform.right * sphereCastRadius, val2 - ((Component)this).transform.right * sphereCastRadius); Handles.DrawLine(explosionOrigin.position + ((Component)this).transform.right * sphereCastRadius, val2 + ((Component)this).transform.right * sphereCastRadius); Handles.DrawWireArc(val2, ((Component)this).transform.forward, ((Component)this).transform.right, -180f, sphereCastRadius); } finally { ((IDisposable)(DrawingScope)(ref val)).Dispose(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(535128068u, new RpcReceiveHandler(__rpc_handler_535128068), "TriggerExplosionServerRpc"); ((NetworkBehaviour)this).__registerRpc(1183756170u, new RpcReceiveHandler(__rpc_handler_1183756170), "TriggerExplosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(2536999585u, new RpcReceiveHandler(__rpc_handler_2536999585), "SetActivatedServerRpc"); ((NetworkBehaviour)this).__registerRpc(360401534u, new RpcReceiveHandler(__rpc_handler_360401534), "SetActivatedClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_535128068(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; ((Tripmine)(object)target).TriggerExplosionServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1183756170(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; ((Tripmine)(object)target).TriggerExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2536999585(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool activatedServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref activatedServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Tripmine)(object)target).SetActivatedServerRpc(activatedServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_360401534(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool activatedClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref activatedClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Tripmine)(object)target).SetActivatedClientRpc(activatedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Tripmine"; } } } namespace BlackMesa.Compatibility { internal static class LCVRCompatibility { internal static void AddElevatorButtonInteractions(GameObject[] buttons) { if (Chainloader.PluginInfos.ContainsKey("io.daxcess.lcvr")) { AddElevatorButtonInteractionsImpl(buttons); } } [MethodImpl(MethodImplOptions.NoInlining)] private static void AddElevatorButtonInteractionsImpl(GameObject[] buttons) { if (!Plugin.Config.DisableElevatorButtonInteraction.Value) { for (int i = 0; i < buttons.Length; i++) { buttons[i].AddComponent(); } } } } } 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 BlackMesa.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }