Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Black Mesa Half Life Moon Interior v3.2.3
BlackMesa.dll
Decompiled 7 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.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.Scriptables; using BlackMesa.Utilities; using DunGen; using DunGen.Graph; using DunGenPlus; using GameNetcodeStuff; using HarmonyLib; using LCVR; using LCVR.Physics.Interactions; using LethalLevelLoader; using Microsoft.CodeAnalysis; using PathfindingLib.API.SmartPathfinding; using Unity.Netcode; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.Audio; 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("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("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [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+884efa240e5b7b9a0dcf981951b7796b5480711a")] [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<PlayerControllerB>(ref player)) { barnacle.TryGrabPlayerOrHeldItem(player); } GrabbableObject item = default(GrabbableObject); if (((Component)other).TryGetComponent<GrabbableObject>(ref item)) { barnacle.GrabItem(item); } EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((Component)other).TryGetComponent<EnemyAICollisionDetect>(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>(); 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<PlayerControllerB>(); 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<float>(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<float>(ref clipTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(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<float>(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<float>(ref clipTime, default(ForPrimitives)); bool isOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(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<StartOfRound>(); } } public class Crowbar : GrabbableObject { public AudioSource knifeAudio; private List<RaycastHit> objectsHitByKnifeList = new List<RaycastHit>(); 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<IHittable>(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<RoundManager>().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<PlayerControllerB>(); 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<LineRenderer>(); } 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.2.3")] [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.2.3"; public static BlackMesaInterior Instance; private readonly Harmony harmony = new Harmony("Plastered_Crab.BlackMesaInterior"); internal static ManualLogSource Logger; internal static DungeonFlow BlackMesaFlow; internal static AssetBundle Assets; internal static GameObject GenerationRulesPrefab; internal static List<GameObject> PrefabsWithAudioSources = new List<GameObject>(); private void Awake() { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; Assets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "blackmesainterior")); if ((Object)(object)Assets == (Object)null) { if (!Application.isEditor) { Logger.LogError((object)"Failed to load interior dungeon assets."); return; } Logger.LogWarning((object)"Failed to load interior dungeon assets, attempting to continue by loading resources by path."); } else { Logger.LogInfo((object)"Interior assets loaded successfully."); } FixPluginTypesSerializationCheck fixPluginTypesSerializationCheck = BlackMesaInterior.LoadAsset<FixPluginTypesSerializationCheck>("Assets/LethalCompany/Mods/BlackMesaInterior/FixPluginTypesSerializationCheck.asset"); if ((Object)(object)fixPluginTypesSerializationCheck == (Object)null) { Logger.LogError((object)"FixPluginTypesSerialization checker was not loaded."); return; } if (!fixPluginTypesSerializationCheck.IsWorking) { Logger.LogError((object)"FixPluginTypesSerialization is not working, please copy its config from someone that has no errors during FixPluginTypesSerialization startup."); return; } ExtendedMod val = BlackMesaInterior.LoadAsset<ExtendedMod>("Assets/LethalCompany/Mods/BlackMesaInterior/BlackMesaInteriorMod.asset"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"Failed to load the interior assets. Stopping."); return; } if (val.ExtendedDungeonFlows.Count < 1) { Logger.LogError((object)"The extended mod has no dungeon flow."); return; } DunGenExtender val2 = BlackMesaInterior.LoadAsset<DunGenExtender>("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/DunGenPlus/DunGenExtender.asset"); if ((Object)(object)val2 == (Object)null) { Logger.LogError((object)"Failed to find DunGenPlus configuration. Stopping."); return; } API.AddDunGenExtender(val2); GenerationRulesPrefab = BlackMesaInterior.LoadAsset<GameObject>("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/GenerationRules.prefab"); if ((Object)(object)GenerationRulesPrefab == (Object)null) { Logger.LogError((object)"Failed to find generation rules prefab. Stopping."); return; } BlackMesaFlow = val.ExtendedDungeonFlows[0].DungeonFlow; PatchedContent.RegisterExtendedMod(val); Logger.LogInfo((object)"Loaded and registered interior assets."); 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)); BlackMesaInterior.LoadAsset<DiffusionProfileMappings>("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Diffusion Profile Mappings.asset").Apply(); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Hazards/Barnacle/Barnacle.prefab"); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Hazards/Laser Tripmine/Tripmine.prefab"); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Props/OfficeElevator/OfficeElevator.prefab"); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Props/HandheldTV.prefab"); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Props/Healing Station.prefab"); RegisterNetworkPrefab("Assets/LethalCompany/Mods/BlackMesaInterior/DunGen Stuff/Prefabs/Props/HEV Station.prefab"); } internal static T LoadAsset<T>(string path) where T : Object { if ((Object)(object)Assets != (Object)null) { return Assets.LoadAsset<T>(path); } if (!Application.isEditor) { return default(T); } try { return TryToLoadAssetDirectlyInEditor<T>(path); } catch (FileNotFoundException) { Logger.LogError((object)"Editor assembly is not present."); return default(T); } } [MethodImpl(MethodImplOptions.NoInlining)] private static T TryToLoadAssetDirectlyInEditor<T>(string path) where T : Object { return AssetDatabase.LoadAssetAtPath<T>(path); } private static void RegisterNetworkPrefab(string path) { GameObject val = BlackMesaInterior.LoadAsset<GameObject>(path); if ((Object)(object)val == (Object)null) { Logger.LogError((object)("The prefab \"" + path + "\" was not found.")); return; } NetworkObject val2 = default(NetworkObject); if (!val.TryGetComponent<NetworkObject>(ref val2)) { Logger.LogError((object)$"The prefab {val} from path \"{path}\" has no NetworkObject."); return; } PatchNetworkManager.AddNetworkPrefab(val); PrefabsWithAudioSources.Add(val); } private static List<AudioMixerGroup> GetVanillaAudioMixerGroups() { HashSet<string> hashSet = new HashSet<string>(); List<AudioMixerGroup> list = new List<AudioMixerGroup>(); AudioMixer[] array = Resources.FindObjectsOfTypeAll<AudioMixer>(); foreach (AudioMixer val in array) { if (!hashSet.Contains(((Object)val).name)) { hashSet.Add(((Object)val).name); AudioMixerGroup[] array2 = val.FindMatchingGroups(""); foreach (AudioMixerGroup item in array2) { list.Add(item); } } } return list; } internal static void FixAudioSources() { List<AudioMixerGroup> vanillaAudioMixerGroups = GetVanillaAudioMixerGroups(); foreach (GameObject prefabsWithAudioSource in PrefabsWithAudioSources) { AudioSource[] componentsInChildren = prefabsWithAudioSource.GetComponentsInChildren<AudioSource>(); foreach (AudioSource val in componentsInChildren) { if ((Object)(object)val.outputAudioMixerGroup == (Object)null) { Logger.LogWarning((object)$"{val} on the prefab {prefabsWithAudioSource} has a null output."); continue; } AudioMixerGroup val2 = null; foreach (AudioMixerGroup item in vanillaAudioMixerGroups) { if (((Object)item).name == ((Object)val.outputAudioMixerGroup).name) { val2 = item; break; } } if (!((Object)(object)val2 == (Object)null)) { val.outputAudioMixerGroup = val2; } } } } 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<PlayerControllerB>() != (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<PlayerControllerB>(); 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<SecurityCamera> securityCameras = new List<SecurityCamera>(); internal List<HandheldTVCamera> handheldTVCameras = new List<HandheldTVCamera>(); public MeshRenderer handheldTVTerminal; public List<int> handheldTVMaterialIndices; public List<BoxCollider> handheldTVTerminalScreenColliders; public MeshRenderer securityFeedTerminal; public Material securityFeedMaterial; public List<int> securityCameraMaterialIndices; public List<BoxCollider> securityFeedTerminalScreenColliders; public int camerasToRenderPerFrame = 2; private int currentHandheldTVIndex; private int currentSecurityCameraIndex; private Camera[] allOtherCameras = Array.Empty<Camera>(); private Plane[][] allOtherCamerasFrustums = Array.Empty<Plane[]>(); private bool allOtherCameraFrustumsUpdated; private List<Camera> allControlledCameras = new List<Camera>(); private List<Bounds> allControlledCameraScreenBounds = new List<Bounds>(); private List<Renderer[]> allControlledCameraScreenRenderers = new List<Renderer[]>(); private List<bool> allControlledCamerasShouldRenderFlags = new List<bool>(); private int nextCameraToRender; private float cameraRenderCountRemainder; private HashSet<Camera> nightVisionCameraSet = new HashSet<Camera>(); private List<Light> nightVisionLights = new List<Light>(); 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<HDAdditionalCameraData>().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_009d: 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)); } 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<PlayerControllerB, PlayerHit> playerHits = new SequentialElementMap<PlayerControllerB, PlayerHit>(() => default(PlayerHit), (PlayerControllerB player) => (int)player.playerClientId, 4); private static readonly SequentialElementMap<EnemyAI, EnemyHit> enemyHits = new SequentialElementMap<EnemyAI, EnemyHit>(() => 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<GameObject>(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<PlayerControllerB>(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<EnemyAICollisionDetect>(ref val5)) { if (((NetworkBehaviour)val5.mainScript).IsOwner && num2 < damageRange * 0.75f) { enemyHits[val5.mainScript].RegisterHit(enemyDamage, num2); } } else if (layer == 21 && ((Component)val).TryGetComponent<Landmine>(ref val6) && ((NetworkBehaviour)val6).IsOwner) { if (num2 < damageRange) { ((MonoBehaviour)val6).StartCoroutine(val6.TriggerOtherMineDelayed(val6)); } } else if (((Component)val).TryGetComponent<IHittable>(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<Rigidbody>(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<EnemyAI, float> dictionary = new Dictionary<EnemyAI, float>(); 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<PlayerControllerB>(ref val3)) { if (((NetworkBehaviour)val3).IsOwner) { val3.KillPlayer(direction, true, (CauseOfDeath)3, 0, default(Vector3)); } } else if (((Component)((RaycastHit)(ref val)).collider).TryGetComponent<EnemyAICollisionDetect>(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<K, V> : IEnumerable<(K key, V value)>, IEnumerable { private readonly Func<V> constructor; private readonly Func<K, int> indexGetter; private (K key, V value)[] backingArray; public ref V this[K key] => ref GetItem(key); public int Count => backingArray.Length; public SequentialElementMap(Func<V> elementConstructor, Func<K, int> 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/Diffusion Profile Mappings")] public class DiffusionProfileMappings : ScriptableObject { public DiffusionProfileMapping[] mappings; internal void Apply() { if (mappings == null) { BlackMesaInterior.Logger.LogError((object)$"Diffusion profile mappings were missing\n{new StackTrace()}"); return; } DiffusionProfileSettings[] value = ((VolumeParameter<DiffusionProfileSettings[]>)(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); } } } } } [Serializable] public class DiffusionProfileMapping { public Material material; public string diffusionProfileName; } [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 int? originalGenerationAttempts; [HarmonyPrefix] [HarmonyPatch("Generate")] private static void GenerateNewFloorPrefix(DungeonGenerator __instance) { if (!((Object)(object)__instance.DungeonFlow != (Object)(object)BlackMesaInterior.BlackMesaFlow)) { originalGenerationAttempts = __instance.MaxAttemptCount; __instance.MaxAttemptCount *= 5; } } [HarmonyPostfix] [HarmonyPatch("Generate")] private static void GenerateNewFloorPostfix(DungeonGenerator __instance) { if (originalGenerationAttempts.HasValue) { __instance.MaxAttemptCount = originalGenerationAttempts.Value; originalGenerationAttempts = null; } } } [HarmonyPatch(typeof(EnemyAI))] internal static class PatchEnemyAI { internal static HashSet<EnemyAI> AllEnemies = new HashSet<EnemyAI>(); [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<CodeInstruction> DisconnectFromMachineryTranspiler(IEnumerable<CodeInstruction> 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() { BlackMesaInterior.FixAudioSources(); LightSwitcher.CacheVanillaLightSounds(); } } internal static class PatchNetworkManager { private static List<GameObject> networkPrefabs = new List<GameObject>(); 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<GameObject>(); } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PatchPlayerControllerB { private static HashSet<PlayerControllerB> lockedPlayers = new HashSet<PlayerControllerB>(); 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 ((Object)(object)__instance.dungeonGenerator.Generator.DungeonFlow == (Object)(object)BlackMesaInterior.BlackMesaFlow) { BlackMesaInterior.BatchAllTileModels(__instance.dungeonGenerator.Generator.CurrentDungeon); if ((Object)(object)LightController.instance != (Object)null) { LightController.instance.PopulateLightGroups(); } } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "SpawnSyncedProps")] private static void SpawnSyncedPropsPostfix(RoundManager __instance) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.dungeonGenerator?.Generator.DungeonFlow != (Object)(object)BlackMesaInterior.BlackMesaFlow) { return; } List<GameObject> spawnedSyncedObjects = __instance.spawnedSyncedObjects; List<NetworkObjectReference> list = new List<NetworkObjectReference>(); List<int> list2 = new List<int>(); foreach (GameObject item2 in spawnedSyncedObjects) { GrabbableObject component = item2.GetComponent<GrabbableObject>(); if (component != null && !((Object)(object)item2.GetComponentInChildren<ScanNodeProperties>() == (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<GameObject>(BlackMesaInterior.GenerationRulesPrefab); } [HarmonyPostfix] [HarmonyPatch("ShipLeave")] private static void ShipLeavePostFix() { HandheldTVCamera[] array = Object.FindObjectsByType<HandheldTVCamera>((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<HandheldTVCamera>((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<DoorwayTagPair, ConnectionResult> doorwayTagRuleLookup = new Dictionary<DoorwayTagPair, ConnectionResult>(); 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 CanTilesConnectDelegate(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(Tile tileA, Tile tileB, Doorway doorwayA, Doorway doorwayB) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (doorwayTagRuleLookup.TryGetValue(new DoorwayTagPair(doorwayA, doorwayB), 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<DoorwayTagPair> { 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<DoorwayInfo>(ref doorwayInfo) ? doorwayInfo.doorwayTag : null, ((Component)doorwayB).TryGetComponent<DoorwayInfo>(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<DoorwayTagPair> { 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 <DisableAtEndOfFrame>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Animator animator; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DisableAtEndOfFrame>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<Animator, AnimatorCuller> cullers = new Dictiona