Decompiled source of MisideItems v0.0.5
BepInEx/plugins/MisideItems.dll
Decompiled 2 weeks 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using MisideItems.NetcodePatcher; using MisideItems.itemSlop; using MisideItems.itemSlop.cartofingotsSlop; using MisideItems.scriptSlop; using OpenBodyCams; using OpenBodyCams.API; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MisideItems")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: AssemblyInformationalVersion("0.0.1")] [assembly: AssemblyProduct("MisideItems")] [assembly: AssemblyTitle("MisideItems")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.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; } } } namespace MisideItems { internal sealed class ConfigManager { private readonly Dictionary<string, ConfigEntry<float>> volumeConfigs; internal ConfigManager(ConfigFile config) { volumeConfigs = new Dictionary<string, ConfigEntry<float>>(); volumeConfigs["BackroomsLamp"] = config.Bind<float>("_BackroomsLampFurniture Settings", "Volume", 0.2f, "Controls the volume of the Backrooms Lamp ambient audio. E.g. 0.1 = 10% volume"); volumeConfigs["BedsideClock"] = config.Bind<float>("BedsideClock Settings", "Volume", 0.3f, "Controls the volume of the Bedside Clock ambient audio. E.g. 0.1 = 10% volume"); volumeConfigs["GlitchedChair"] = config.Bind<float>("GlitchedChair Settings", "Volume", 0.5f, "Controls the volume of the GlitchedChair ambient audio. E.g. 0.1 = 10% volume"); volumeConfigs["FancyClock"] = config.Bind<float>("FancyClock Settings", "Volume", 0.6f, "Controls the volume of the FancyClock ambient audio. E.g. 0.1 = 10% volume"); volumeConfigs["PinkRecorder"] = config.Bind<float>("PinkRecorder Settings", "Volume", 1f, "Controls the volume of the PinkRecorder audio. E.g. 0.1 = 10% volume"); } internal bool TryGetVolume(string id, out ConfigEntry<float> entry) { return volumeConfigs.TryGetValue(id, out entry); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MrHat.MisideItems", "MisideItems", "0.0.5")] public class Plugin : BaseUnityPlugin { internal const string modGUID = "MrHat.MisideItems"; internal const string modName = "MisideItems"; internal const string modVersion = "0.0.5"; internal static Harmony _harmony; internal static ManualLogSource mls; private InputAction toggleConsolePowerAction; private InputAction ejectConsoleCartridgeAction; internal static Plugin Instance { get; private set; } internal static ConfigManager Configs { get; private set; } private void Awake() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown Instance = this; mls = Logger.CreateLogSource("MrHat.MisideItems"); _harmony = new Harmony("MrHat.MisideItems"); Configs = new ConfigManager(((BaseUnityPlugin)this).Config); _harmony.PatchAll(typeof(chairSlop)); _harmony.PatchAll(typeof(CartCrouchBlock)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "MisideItems"; public const string PLUGIN_NAME = "MisideItems"; public const string PLUGIN_VERSION = "0.0.1"; } } namespace MisideItems.scriptSlop { public class AnimationEventOneShotSound : MonoBehaviour { [SerializeField] private AudioClip clip; [SerializeField] private float volume = 1f; [SerializeField] private bool randomPitch; [SerializeField] private float minPitch = 0.95f; [SerializeField] private float maxPitch = 1.05f; private AudioSource audioSource; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)audioSource == (Object)null) { audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); } audioSource.playOnAwake = false; audioSource.loop = false; } public void Play() { if (!((Object)(object)clip == (Object)null)) { if (randomPitch) { audioSource.pitch = Random.Range(minPitch, maxPitch); } else { audioSource.pitch = 1f; } audioSource.PlayOneShot(clip, volume); } } } public class CartIngotVisualDropper : MonoBehaviour { [SerializeField] private GameObject[] ingotsInDropOrder; private int currentIndex; public bool HasIngotsRemaining() { return currentIndex < ingotsInDropOrder.Length; } public int GetRemainingCount() { return ingotsInDropOrder.Length - currentIndex; } public int GetTotalCount() { return ingotsInDropOrder.Length; } public void DropNextIngot() { if (currentIndex < ingotsInDropOrder.Length) { GameObject val = ingotsInDropOrder[currentIndex]; currentIndex++; if ((Object)(object)val != (Object)null) { val.SetActive(false); } } } public void SetRemainingCount(int remaining) { int num = ingotsInDropOrder.Length; remaining = Mathf.Clamp(remaining, 0, num); currentIndex = num - remaining; for (int i = 0; i < num; i++) { if ((Object)(object)ingotsInDropOrder[i] != (Object)null) { ingotsInDropOrder[i].SetActive(i >= currentIndex); } } } } public class DigitalClockDisplay : MonoBehaviour { [CompilerGenerated] private sealed class <Tick>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DigitalClockDisplay <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Tick>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; <>4__this.UpdateTime(); break; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [SerializeField] private Sprite[] numberSprites; [SerializeField] private Image hourTens; [SerializeField] private Image hourOnes; [SerializeField] private Image minuteTens; [SerializeField] private Image minuteOnes; private Coroutine tickRoutine; private void OnEnable() { UpdateTime(); tickRoutine = ((MonoBehaviour)this).StartCoroutine(Tick()); } private void OnDisable() { if (tickRoutine != null) { ((MonoBehaviour)this).StopCoroutine(tickRoutine); } } [IteratorStateMachine(typeof(<Tick>d__8))] private IEnumerator Tick() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Tick>d__8(0) { <>4__this = this }; } private void UpdateTime() { DateTime now = DateTime.Now; int hour = now.Hour; int minute = now.Minute; hourTens.sprite = numberSprites[hour / 10]; hourOnes.sprite = numberSprites[hour % 10]; minuteTens.sprite = numberSprites[minute / 10]; minuteOnes.sprite = numberSprites[minute % 10]; } } public class EjectSound : MonoBehaviour { private Animator animator; private AudioSource audioSource; public AudioClip ejectSound; private bool hasEjected; private void Awake() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); } internal void PlayEject() { if (!hasEjected) { hasEjected = true; if ((Object)(object)animator != (Object)null) { animator.SetTrigger("Eject"); } if ((Object)(object)audioSource != (Object)null && (Object)(object)ejectSound != (Object)null) { audioSource.clip = ejectSound; audioSource.Play(); } } } public void OnEjectAnimationFinished() { ((Component)this).gameObject.SetActive(false); } } public class OpenCloseSound : MonoBehaviour { [CompilerGenerated] private sealed class <PlayRoutine>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool open; public OpenCloseSound <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PlayRoutine>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isBusy = true; if (open) { <>4__this.animator.SetTrigger("Open"); if ((Object)(object)<>4__this.openSound != (Object)null) { <>4__this.audioSource.clip = <>4__this.openSound; <>4__this.audioSource.Play(); } } else { <>4__this.animator.SetTrigger("Close"); if ((Object)(object)<>4__this.closeSound != (Object)null) { <>4__this.audioSource.clip = <>4__this.closeSound; <>4__this.audioSource.Play(); } } <>2__current = (object)new WaitForSeconds(<>4__this.cooldownSeconds); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.isBusy = 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(); } } [SerializeField] private float cooldownSeconds = 2f; private Animator animator; private AudioSource audioSource; public AudioClip openSound; public AudioClip closeSound; private bool isBusy; private void Awake() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); } internal void PlayOpen() { if (!isBusy) { ((MonoBehaviour)this).StartCoroutine(PlayRoutine(open: true)); } } internal void PlayClose() { if (!isBusy) { ((MonoBehaviour)this).StartCoroutine(PlayRoutine(open: false)); } } [IteratorStateMachine(typeof(<PlayRoutine>d__9))] private IEnumerator PlayRoutine(bool open) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PlayRoutine>d__9(0) { <>4__this = this, open = open }; } internal bool IsAnimating() { return isBusy; } public bool IsPlaying() { return (Object)(object)audioSource != (Object)null && audioSource.isPlaying; } } public class RandomMaterialSet : MonoBehaviour { [SerializeField] private Material[] possibleMaterials; private MeshRenderer meshRenderer; public int MaterialCount => (possibleMaterials != null) ? possibleMaterials.Length : 0; private void Awake() { meshRenderer = ((Component)this).GetComponent<MeshRenderer>(); } public void ApplyMaterialIndex(int index) { if (!((Object)(object)meshRenderer == (Object)null) && possibleMaterials != null && index >= 0 && index < possibleMaterials.Length) { ((Renderer)meshRenderer).material = possibleMaterials[index]; } } } public class RandomSoundPlayer : MonoBehaviour { [SerializeField] private AudioClip[] possibleClips; private AudioSource audioSource; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); } public float PlayRandom() { if ((Object)(object)audioSource == (Object)null) { return 0f; } if (possibleClips == null || possibleClips.Length == 0) { return 0f; } int num = Random.Range(0, possibleClips.Length); AudioClip val = possibleClips[num]; audioSource.clip = val; audioSource.Play(); return val.length; } public void Stop() { if (!((Object)(object)audioSource == (Object)null)) { audioSource.Stop(); audioSource.clip = null; } } public bool IsPlaying() { return (Object)(object)audioSource != (Object)null && audioSource.isPlaying; } } public class RandomSpriteTexture : MonoBehaviour { [SerializeField] private Sprite[] possibleSprites; private SpriteRenderer spriteRenderer; public int SpriteCount => (possibleSprites != null) ? possibleSprites.Length : 0; private void Awake() { spriteRenderer = ((Component)this).GetComponent<SpriteRenderer>(); } public void ApplySpriteIndex(int index) { if (index >= 0 && possibleSprites != null && index < possibleSprites.Length) { spriteRenderer.sprite = possibleSprites[index]; } } } public class ToggleSound : MonoBehaviour { public AudioClip onSound; public AudioClip offSound; private AudioSource audioSource; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); } public void PlayOn() { if (!((Object)(object)audioSource == (Object)null) && !((Object)(object)onSound == (Object)null)) { audioSource.PlayOneShot(onSound); } } public void PlayOff() { if (!((Object)(object)audioSource == (Object)null) && !((Object)(object)offSound == (Object)null)) { audioSource.PlayOneShot(offSound); } } } public sealed class AudioVolumeController : MonoBehaviour { [SerializeField] private string volumeConfigId; private AudioSource audioSource; private ConfigEntry<float> entry; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); if (!((Object)(object)audioSource == (Object)null) && Plugin.Configs.TryGetVolume(volumeConfigId, out entry)) { Apply(); entry.SettingChanged += delegate { Apply(); }; } } private void Apply() { float num = entry.Value; if (num < 0f) { num = 0f; } if (num > 1f) { num = 1f; } audioSource.volume = num; } } } namespace MisideItems.itemSlop { [HarmonyPatch(typeof(GrabbableObject), "OnHitGround")] public static class chairSlop { private class DropState { public bool HasTriggered; } private static readonly ConditionalWeakTable<GrabbableObject, DropState> dropStates = new ConditionalWeakTable<GrabbableObject, DropState>(); private static void Postfix(GrabbableObject __instance) { if (!__instance.hasBeenHeld || __instance.isHeld || __instance.isHeldByEnemy) { return; } DropState orCreateValue = dropStates.GetOrCreateValue(__instance); if (orCreateValue.HasTriggered) { return; } orCreateValue.HasTriggered = true; Transform val = ((Component)__instance).transform.Find("SofaChair/Particle System"); if (!((Object)(object)val == (Object)null)) { GameObject gameObject = ((Component)val).gameObject; if (!gameObject.activeSelf) { gameObject.SetActive(true); } } } } } namespace MisideItems.itemSlop.wifephotoSlop { public class PhysicsPropWifePhotosItem : GrabbableObject { private int selectedMaterialIndex = -1; private RandomMaterialSet materialTarget; public override void Start() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Start(); materialTarget = ((Component)this).GetComponentInChildren<RandomMaterialSet>(true); if (((NetworkBehaviour)this).IsServer && selectedMaterialIndex == -1 && (Object)(object)materialTarget != (Object)null && materialTarget.MaterialCount > 0) { selectedMaterialIndex = Random.Range(0, materialTarget.MaterialCount); } if (((NetworkBehaviour)this).IsClient) { RequestMaterialIndexServerRpc(); } else { ApplyMaterial(); } } [ServerRpc(RequireOwnership = false)] private void RequestMaterialIndexServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3822294145u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3822294145u, rpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SendMaterialIndexClientRpc(selectedMaterialIndex); } } } [ClientRpc] private void SendMaterialIndexClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(301039772u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 301039772u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; selectedMaterialIndex = index; ApplyMaterial(); } } } private void ApplyMaterial() { if (!((Object)(object)materialTarget == (Object)null)) { materialTarget.ApplyMaterialIndex(selectedMaterialIndex); } } 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(3822294145u, new RpcReceiveHandler(__rpc_handler_3822294145), "RequestMaterialIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(301039772u, new RpcReceiveHandler(__rpc_handler_301039772), "SendMaterialIndexClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3822294145(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropWifePhotosItem)(object)target).RequestMaterialIndexServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_301039772(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropWifePhotosItem)(object)target).SendMaterialIndexClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PhysicsPropWifePhotosItem"; } } } namespace MisideItems.itemSlop.remotetvSlop { public class PhysicsPropRemoteTVItem : GrabbableObject { private AudioSource audioSource; private Animator animator; private GameObject terminalObject; private Terminal terminal; private int activationCount; private bool terminalStateCached; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); Transform val = ((Component)this).transform.Find("RemoteTV"); audioSource = ((Component)val).GetComponent<AudioSource>(); animator = ((Component)val).GetComponent<Animator>(); terminal = (terminalObject = GameObject.Find("Environment/HangarShip/Terminal")).GetComponent<Terminal>(); ((GrabbableObject)this).SetControlTipsForItem(); } public override void SetControlTipsForItem() { if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.itemProperties == (Object)null) && base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length != 0) { PlayerControllerB val = StartOfRound.Instance?.localPlayerController; if ((Object)(object)val == (Object)null || !val.isInHangarShipRoom) { base.itemProperties.toolTips[0] = ""; } else { base.itemProperties.toolTips[0] = ((activationCount >= 3) ? "" : "Use Remote : [LMB]"); } ((GrabbableObject)this).SetControlTipsForItem(); } } public override void ItemActivate(bool used, bool buttonDown = true) { if (!buttonDown || activationCount >= 3) { return; } StartOfRound instance = StartOfRound.Instance; if (!((Object)(object)instance == (Object)null) && !instance.newGameIsLoading && !instance.shipIsLeaving) { PlayerControllerB localPlayerController = instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && localPlayerController.isInHangarShipRoom) { PerformToggle(); } } } private void PerformToggle() { if (activationCount < 3 && !((Object)(object)terminalObject == (Object)null)) { activationCount++; if ((Object)(object)audioSource != (Object)null) { audioSource.Play(); } if ((Object)(object)animator != (Object)null) { animator.SetTrigger("isClicked"); } terminalObject.SetActive(!terminalObject.activeSelf); ((GrabbableObject)this).SetControlTipsForItem(); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)terminalObject != (Object)null && !terminalObject.activeSelf) { terminalObject.SetActive(true); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropRemoteTVItem"; } } } namespace MisideItems.itemSlop.pumpkinSlop { public class PhysicsPropPumpkinItem : GrabbableObject { private ParticleSystem particleClick; private AudioSource particleClickAudio; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)particleClick == (Object)null || (Object)(object)particleClickAudio == (Object)null) { Transform val = ((Component)this).transform.Find("Pumpkin 2/Particle Click"); if (!((Object)(object)val == (Object)null)) { particleClick = ((Component)val).GetComponent<ParticleSystem>(); particleClickAudio = ((Component)val).GetComponent<AudioSource>(); } } } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown) { if ((Object)(object)particleClick != (Object)null) { particleClick.Play(); } if ((Object)(object)particleClickAudio != (Object)null) { particleClickAudio.Stop(); particleClickAudio.Play(); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropPumpkinItem"; } } } namespace MisideItems.itemSlop.pinkrecorderSlop { public class PhysicsPropPinkRecorderItem : GrabbableObject { [CompilerGenerated] private sealed class <AutoTurnOff>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public int token; public PhysicsPropPinkRecorderItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AutoTurnOff>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.isOn) { return false; } if (token != <>4__this.playToken) { return false; } if ((Object)(object)<>4__this.openCloseSound != (Object)null && <>4__this.openCloseSound.IsAnimating()) { return false; } <>4__this.openCloseSound?.PlayClose(); <>4__this.isOn = false; ((GrabbableObject)<>4__this).SetControlTipsForItem(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <DelayedPlayAndAutoOff>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public int token; public PhysicsPropPinkRecorderItem <>4__this; private float <duration>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayedPlayAndAutoOff>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.isOn) { return false; } if (token != <>4__this.playToken) { return false; } <duration>5__1 = <>4__this.randomSoundPlayer.PlayRandom(); if (<duration>5__1 <= 0f) { return false; } ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.AutoTurnOff(<duration>5__1, token)); 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 RandomSoundPlayer randomSoundPlayer; private OpenCloseSound openCloseSound; private int playToken; private bool isOn; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)randomSoundPlayer == (Object)null) { randomSoundPlayer = ((Component)this).GetComponentInChildren<RandomSoundPlayer>(); } if ((Object)(object)openCloseSound == (Object)null) { openCloseSound = ((Component)this).GetComponentInChildren<OpenCloseSound>(); } } public override void SetControlTipsForItem() { UpdateTooltip(); ((GrabbableObject)this).SetControlTipsForItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && !((Object)(object)openCloseSound == (Object)null) && !((Object)(object)randomSoundPlayer == (Object)null) && !openCloseSound.IsAnimating()) { if (isOn) { openCloseSound.PlayClose(); randomSoundPlayer.Stop(); isOn = false; ((GrabbableObject)this).SetControlTipsForItem(); playToken++; } else { openCloseSound.PlayOpen(); isOn = true; ((GrabbableObject)this).SetControlTipsForItem(); playToken++; ((MonoBehaviour)this).StartCoroutine(DelayedPlayAndAutoOff(0.5f, playToken)); } } } [IteratorStateMachine(typeof(<AutoTurnOff>d__7))] private IEnumerator AutoTurnOff(float delay, int token) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AutoTurnOff>d__7(0) { <>4__this = this, delay = delay, token = token }; } [IteratorStateMachine(typeof(<DelayedPlayAndAutoOff>d__8))] private IEnumerator DelayedPlayAndAutoOff(float delay, int token) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayedPlayAndAutoOff>d__8(0) { <>4__this = this, delay = delay, token = token }; } private void UpdateTooltip() { if (!((Object)(object)base.itemProperties == (Object)null) && base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length != 0) { base.itemProperties.toolTips[0] = (isOn ? "Turn off : [LMB]" : "Turn on : [LMB]"); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropPinkRecorderItem"; } } } namespace MisideItems.itemSlop.flashSlop { public class PhysicsPropFlashMitaItem : GrabbableObject { private int selectedSpriteIndex = -1; private RandomSpriteTexture spriteTarget; public override void Start() { ((GrabbableObject)this).Start(); spriteTarget = ((Component)this).GetComponentInChildren<RandomSpriteTexture>(true); if ((Object)(object)spriteTarget != (Object)null) { ((Component)spriteTarget).gameObject.SetActive(false); } if (((NetworkBehaviour)this).IsServer && selectedSpriteIndex == -1 && (Object)(object)spriteTarget != (Object)null && spriteTarget.SpriteCount > 0) { selectedSpriteIndex = Random.Range(0, spriteTarget.SpriteCount); } } public override void EquipItem() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).EquipItem(); if (!((Object)(object)spriteTarget == (Object)null)) { ((Component)spriteTarget).gameObject.SetActive(true); if (((NetworkBehaviour)this).IsClient) { RequestSpriteIndexServerRpc(); } else { ApplySprite(); } } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)spriteTarget != (Object)null) { ((Component)spriteTarget).gameObject.SetActive(false); } } [ServerRpc(RequireOwnership = false)] private void RequestSpriteIndexServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3675666405u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3675666405u, rpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SendSpriteIndexClientRpc(selectedSpriteIndex); } } } [ClientRpc] private void SendSpriteIndexClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3038770411u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3038770411u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; selectedSpriteIndex = index; ApplySprite(); } } } private void ApplySprite() { if (!((Object)(object)spriteTarget == (Object)null)) { spriteTarget.ApplySpriteIndex(selectedSpriteIndex); } } 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(3675666405u, new RpcReceiveHandler(__rpc_handler_3675666405), "RequestSpriteIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(3038770411u, new RpcReceiveHandler(__rpc_handler_3038770411), "SendSpriteIndexClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3675666405(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropFlashMitaItem)(object)target).RequestSpriteIndexServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3038770411(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropFlashMitaItem)(object)target).SendSpriteIndexClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PhysicsPropFlashMitaItem"; } } } namespace MisideItems.itemSlop.fancyclockSlop { public class PhysicsPropFancyClockItem : GrabbableObject { private bool hasBroken; private Animator[] animators; private AudioSource tableClockAudio; private AudioSource tickAudio; public override void Start() { ((GrabbableObject)this).Start(); animators = ((Component)this).GetComponentsInChildren<Animator>(true); Transform val = ((Component)this).transform.Find("TableClocks"); if ((Object)(object)val != (Object)null) { tableClockAudio = ((Component)val).GetComponent<AudioSource>(); } Transform val2 = ((Component)this).transform.Find("TickAudio"); if ((Object)(object)val2 != (Object)null) { tickAudio = ((Component)val2).GetComponent<AudioSource>(); } } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (hasBroken) { return; } hasBroken = true; if ((Object)(object)tableClockAudio != (Object)null) { tableClockAudio.Play(); } if ((Object)(object)tickAudio != (Object)null) { tickAudio.Stop(); ((Behaviour)tickAudio).enabled = false; } if (animators == null) { return; } for (int i = 0; i < animators.Length; i++) { if ((Object)(object)animators[i] != (Object)null) { ((Behaviour)animators[i]).enabled = false; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropFancyClockItem"; } } } namespace MisideItems.itemSlop.digitalclockSlop { public class PhysicsPropDigitalClockItem : GrabbableObject { [CompilerGenerated] private sealed class <HourCheck>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PhysicsPropDigitalClockItem <>4__this; private DateTime <now>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HourCheck>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } <now>5__1 = DateTime.Now; if (<now>5__1.Minute == 0 && <now>5__1.Second == 0 && <now>5__1.Hour != <>4__this.lastPlayedHour) { <>4__this.lastPlayedHour = <now>5__1.Hour; AudioSource hourChimeAudio = <>4__this.hourChimeAudio; if (hourChimeAudio != null) { hourChimeAudio.Play(); } } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } 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 GameObject canvasRoot; private DigitalClockDisplay clockDisplay; private AudioSource hourChimeAudio; private Coroutine hourCheckRoutine; private int lastPlayedHour = -1; public override void Start() { ((GrabbableObject)this).Start(); Transform obj = ((Component)this).transform.Find("DigitalClock/DigitalTime"); canvasRoot = ((obj != null) ? ((Component)obj).gameObject : null); clockDisplay = ((Component)this).GetComponentInChildren<DigitalClockDisplay>(true); hourChimeAudio = ((Component)this).GetComponentInChildren<AudioSource>(true); if ((Object)(object)canvasRoot != (Object)null) { canvasRoot.SetActive(false); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)canvasRoot != (Object)null) { canvasRoot.SetActive(true); } if ((Object)(object)clockDisplay != (Object)null) { ((Behaviour)clockDisplay).enabled = true; } if (hourCheckRoutine == null) { hourCheckRoutine = ((MonoBehaviour)this).StartCoroutine(HourCheck()); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)canvasRoot != (Object)null) { canvasRoot.SetActive(false); } if ((Object)(object)clockDisplay != (Object)null) { ((Behaviour)clockDisplay).enabled = false; } if (hourCheckRoutine != null) { ((MonoBehaviour)this).StopCoroutine(hourCheckRoutine); hourCheckRoutine = null; } } [IteratorStateMachine(typeof(<HourCheck>d__8))] private IEnumerator HourCheck() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HourCheck>d__8(0) { <>4__this = this }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropDigitalClockItem"; } } } namespace MisideItems.itemSlop.consoleSlop { public class PhysicsPropConsoleItem : GrabbableObject { [CompilerGenerated] private sealed class <KillLocalNextFrame>d__43 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public PhysicsPropConsoleItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillLocalNextFrame>d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)player == (Object)null) { return false; } if (!((NetworkBehaviour)player).IsOwner) { return false; } if (player.isPlayerDead) { return false; } player.KillPlayer(Vector3.up * 14f, true, (CauseOfDeath)0, 1, default(Vector3)); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SetBodyCamAfterDelay>d__37 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool active; public PhysicsPropConsoleItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetBodyCamAfterDelay>d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.bodyCamToggleDelaySeconds); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.screenBodyCam != (Object)null) { ((Behaviour)<>4__this.screenBodyCam).enabled = active; } <>4__this.bodyCamDelayRoutine = null; 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 OpenCloseSound lid; private bool isOpen; private OpenCloseSound powerButton; private bool isPoweredOn; private BodyCamComponent screenBodyCam; private MeshRenderer screenRenderer; private bool screenInitialized; private int lockedTargetPlayerIndex = -1; private bool targetChosen; private Coroutine bodyCamDelayRoutine; [SerializeField] private float bodyCamToggleDelaySeconds = 0.1f; private bool screenEventsHooked; private static FieldInfo bodyCamCurrentPlayerField; private static FieldInfo bodyCamMonitorOnMaterialField; private Animator cartridgeAnimator; private bool cartridgeEjected; private InputAction togglePowerAction; private InputAction ejectCartridgeAction; public override void EquipItem() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown ((GrabbableObject)this).EquipItem(); if (((NetworkBehaviour)this).IsOwner) { togglePowerAction = new InputAction("ToggleConsolePower", (InputActionType)1, "<Keyboard>/r", (string)null, (string)null, (string)null); ejectCartridgeAction = new InputAction("EjectConsoleCartridge", (InputActionType)1, "<Keyboard>/e", (string)null, (string)null, (string)null); togglePowerAction.performed += delegate { TryTogglePowerFromHotkey(); }; ejectCartridgeAction.performed += delegate { TryEjectCartridge(); }; togglePowerAction.Enable(); ejectCartridgeAction.Enable(); lid = ((Component)((Component)this).transform.Find("Console")).GetComponent<OpenCloseSound>(); powerButton = ((Component)((Component)this).transform.Find("Console/ConsoleCup/Button")).GetComponent<OpenCloseSound>(); cartridgeAnimator = ((Component)((Component)this).transform.Find("Console/Cartridge")).GetComponent<Animator>(); SetupScreenWork(); EnsureTooltipSize(); ((GrabbableObject)this).SetControlTipsForItem(); } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); InputAction obj = togglePowerAction; if (obj != null) { obj.Disable(); } InputAction obj2 = ejectCartridgeAction; if (obj2 != null) { obj2.Disable(); } InputAction obj3 = togglePowerAction; if (obj3 != null) { obj3.Dispose(); } InputAction obj4 = ejectCartridgeAction; if (obj4 != null) { obj4.Dispose(); } togglePowerAction = null; ejectCartridgeAction = null; } private void EnsureTooltipSize() { if ((Object)(object)base.itemProperties == (Object)null || (base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length >= 3)) { return; } string[] array = new string[3]; if (base.itemProperties.toolTips != null) { for (int i = 0; i < base.itemProperties.toolTips.Length; i++) { array[i] = base.itemProperties.toolTips[i]; } for (int j = 0; j < array.Length; j++) { ref string reference = ref array[j]; if (reference == null) { reference = ""; } } } base.itemProperties.toolTips = array; } public override void SetControlTipsForItem() { if (((NetworkBehaviour)this).IsOwner) { UpdateTooltip(); ((GrabbableObject)this).SetControlTipsForItem(); } } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown) { TryUseServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void TryUseServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(394168566u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 394168566u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TryUseClientRpc(); } } } [ClientRpc] private void TryUseClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2477809503u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2477809503u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PerformOpenCloseLogic(); } } } private void PerformOpenCloseLogic() { if ((Object)(object)lid == (Object)null || lid.IsAnimating()) { return; } if (isOpen) { if (cartridgeEjected) { return; } if (isPoweredOn) { isPoweredOn = false; powerButton.PlayClose(); ApplyScreenPower(); SetBodyCamActiveDelayed(active: false); } lid.PlayClose(); isOpen = false; } else { lid.PlayOpen(); isOpen = true; ApplyScreenPower(); } ((GrabbableObject)this).SetControlTipsForItem(); } public void TryTogglePowerFromHotkey() { if (!cartridgeEjected && isOpen && !((Object)(object)powerButton == (Object)null) && !powerButton.IsAnimating() && !powerButton.IsPlaying()) { TogglePowerServerRpc(); } } private void UpdateTooltip() { if (!((Object)(object)base.itemProperties == (Object)null) && base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length >= 3) { base.itemProperties.toolTips[0] = (cartridgeEjected ? "" : (isOpen ? "Close : [LMB]" : "Open : [LMB]")); base.itemProperties.toolTips[1] = ((!isOpen || cartridgeEjected) ? "" : (isPoweredOn ? "Turn off : [R]" : "Turn on : [R]")); base.itemProperties.toolTips[2] = ((isPoweredOn && !cartridgeEjected) ? "Eject player cartridge : [E]" : ""); } } private void SetupScreenWork() { Transform val = ((Component)this).transform.Find("Console/ConsoleCup/Button/ScreenWork"); if ((Object)(object)val == (Object)null) { return; } screenRenderer = ((Component)val).GetComponent<MeshRenderer>(); if ((Object)(object)screenRenderer == (Object)null) { return; } screenBodyCam = ((Component)val).GetComponent<BodyCamComponent>(); if ((Object)(object)screenBodyCam == (Object)null) { screenBodyCam = BodyCam.CreateBodyCam(((Component)val).gameObject, (Renderer)(object)screenRenderer, 0, (ManualCameraRenderer)null); screenBodyCam.SetTargetToPlayer((PlayerControllerB)null); screenBodyCam.SetScreenPowered(false); } ((Behaviour)screenBodyCam).enabled = true; screenBodyCam.ForceEnableCamera = true; screenBodyCam.Framerate = 24f; if (!screenEventsHooked) { screenBodyCam.OnScreenPowerChanged += delegate { FixBodyCamMaterial(); }; screenBodyCam.OnBlankedSet += delegate { FixBodyCamMaterial(); }; screenEventsHooked = true; } if (bodyCamCurrentPlayerField == null) { bodyCamCurrentPlayerField = typeof(BodyCamComponent).GetField("currentPlayer", BindingFlags.Instance | BindingFlags.NonPublic); if (bodyCamCurrentPlayerField == null) { Plugin.mls.LogError((object)"OpenBodyCams currentPlayer field not found"); } } if (bodyCamMonitorOnMaterialField == null) { bodyCamMonitorOnMaterialField = typeof(BodyCamComponent).GetField("MonitorOnMaterial", BindingFlags.Instance | BindingFlags.NonPublic); } screenInitialized = true; } private int ChooseRandomPlayerIndex() { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null) { return -1; } List<int> list = new List<int>(); for (int i = 0; i < array.Length; i++) { PlayerControllerB val = array[i]; if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && !val.isPlayerDead) { list.Add(i); } } if (list.Count == 0) { return -1; } return list[Random.Range(0, list.Count)]; } private PlayerControllerB ResolveLockedTarget() { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null) { return null; } if (lockedTargetPlayerIndex < 0 || lockedTargetPlayerIndex >= array.Length) { return null; } return array[lockedTargetPlayerIndex]; } private int ChooseRandomTargetIndex() { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null || array.Length == 0) { return -1; } List<int> list = new List<int>(); for (int i = 0; i < array.Length; i++) { PlayerControllerB val = array[i]; if (!((Object)(object)val == (Object)null) && !val.isPlayerDead) { list.Add(i); } } if (list.Count == 0) { return -1; } return list[Random.Range(0, list.Count)]; } private void ApplyScreenPower() { if (!screenInitialized || (Object)(object)screenBodyCam == (Object)null) { return; } if (isPoweredOn && lockedTargetPlayerIndex >= 0) { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array != null && lockedTargetPlayerIndex < array.Length) { PlayerControllerB val = array[lockedTargetPlayerIndex]; if ((Object)(object)val != (Object)null) { screenBodyCam.SetTargetToPlayer(val); } } } screenBodyCam.SetScreenPowered(isPoweredOn); } private void FixBodyCamMaterial() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)screenBodyCam == (Object)null) && !(bodyCamMonitorOnMaterialField == null)) { object? value = bodyCamMonitorOnMaterialField.GetValue(screenBodyCam); Material val = (Material)((value is Material) ? value : null); if (!((Object)(object)val == (Object)null)) { val.SetColor("_EmissiveColor", new Color(0.25f, 0.25f, 0.25f)); val.SetFloat("_EmissiveIntensity", 0.25f); val.SetFloat("_AlbedoAffectEmissive", 0f); } } } private void ForcePowerOff() { if (isPoweredOn) { isPoweredOn = false; if ((Object)(object)powerButton != (Object)null) { powerButton.PlayClose(); } ApplyScreenPower(); } } public void TryEjectCartridge() { if (isOpen && isPoweredOn && !cartridgeEjected && !((Object)(object)cartridgeAnimator == (Object)null)) { EjectCartridgeServerRpc(lockedTargetPlayerIndex); } } private void SetBodyCamActiveDelayed(bool active) { if (bodyCamDelayRoutine != null) { ((MonoBehaviour)this).StopCoroutine(bodyCamDelayRoutine); } bodyCamDelayRoutine = ((MonoBehaviour)this).StartCoroutine(SetBodyCamAfterDelay(active)); } [IteratorStateMachine(typeof(<SetBodyCamAfterDelay>d__37))] private IEnumerator SetBodyCamAfterDelay(bool active) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetBodyCamAfterDelay>d__37(0) { <>4__this = this, active = active }; } [ServerRpc(RequireOwnership = false)] private void TogglePowerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1552753204u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1552753204u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isPoweredOn = !isPoweredOn; if (isPoweredOn && !targetChosen) { lockedTargetPlayerIndex = ChooseRandomPlayerIndex(); targetChosen = true; } TogglePowerClientRpc(isPoweredOn, lockedTargetPlayerIndex); } } [ClientRpc] private void TogglePowerClientRpc(bool poweredOn, int targetIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3062190208u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref poweredOn, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, targetIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3062190208u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isPoweredOn = poweredOn; lockedTargetPlayerIndex = targetIndex; if ((Object)(object)powerButton != (Object)null) { if (isPoweredOn) { powerButton.PlayOpen(); } else { powerButton.PlayClose(); } } if (isPoweredOn) { SetBodyCamActiveDelayed(active: true); } else { SetBodyCamActiveDelayed(active: false); } ApplyScreenPower(); ((GrabbableObject)this).SetControlTipsForItem(); } [ServerRpc(RequireOwnership = false)] private void EjectCartridgeServerRpc(int targetPlayerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(151630751u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, targetPlayerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 151630751u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!cartridgeEjected) { cartridgeEjected = true; isPoweredOn = false; PlayerControllerB val3 = null; PlayerControllerB[] array = (((Object)(object)StartOfRound.Instance == (Object)null) ? null : StartOfRound.Instance.allPlayerScripts); if (array != null && targetPlayerIndex >= 0 && targetPlayerIndex < array.Length) { val3 = array[targetPlayerIndex]; } if ((Object)(object)val3 != (Object)null && !val3.isPlayerDead) { ClientRpcParams val4 = default(ClientRpcParams); val4.Send = new ClientRpcSendParams { TargetClientIds = new ulong[1] { ((NetworkBehaviour)val3).OwnerClientId } }; ClientRpcParams clientRpcParams = val4; KillTargetClientRpc(targetPlayerIndex, clientRpcParams); } EjectCartridgeClientRpc(targetPlayerIndex); } } [ClientRpc] private void EjectCartridgeClientRpc(int targetPlayerIndex) { //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(1099260146u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, targetPlayerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1099260146u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; cartridgeEjected = true; ForcePowerOff(); isPoweredOn = false; if ((Object)(object)screenBodyCam != (Object)null) { screenBodyCam.SetScreenPowered(false); } SetBodyCamActiveDelayed(active: false); if ((Object)(object)cartridgeAnimator != (Object)null) { ((Behaviour)cartridgeAnimator).enabled = true; cartridgeAnimator.SetTrigger("Eject"); } ((GrabbableObject)this).SetControlTipsForItem(); } } [ClientRpc] private void KillTargetClientRpc(int targetPlayerIndex, ClientRpcParams clientRpcParams) { //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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(947208389u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, targetPlayerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 947208389u, clientRpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; if (allPlayerScripts != null && targetPlayerIndex >= 0 && targetPlayerIndex < allPlayerScripts.Length) { PlayerControllerB val2 = allPlayerScripts[targetPlayerIndex]; if (!((Object)(object)val2 == (Object)null) && ((NetworkBehaviour)val2).IsOwner && !val2.isPlayerDead) { ((MonoBehaviour)this).StartCoroutine(KillLocalNextFrame(val2)); } } } [IteratorStateMachine(typeof(<KillLocalNextFrame>d__43))] private IEnumerator KillLocalNextFrame(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <KillLocalNextFrame>d__43(0) { <>4__this = this, player = player }; } 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 //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(394168566u, new RpcReceiveHandler(__rpc_handler_394168566), "TryUseServerRpc"); ((NetworkBehaviour)this).__registerRpc(2477809503u, new RpcReceiveHandler(__rpc_handler_2477809503), "TryUseClientRpc"); ((NetworkBehaviour)this).__registerRpc(1552753204u, new RpcReceiveHandler(__rpc_handler_1552753204), "TogglePowerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3062190208u, new RpcReceiveHandler(__rpc_handler_3062190208), "TogglePowerClientRpc"); ((NetworkBehaviour)this).__registerRpc(151630751u, new RpcReceiveHandler(__rpc_handler_151630751), "EjectCartridgeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1099260146u, new RpcReceiveHandler(__rpc_handler_1099260146), "EjectCartridgeClientRpc"); ((NetworkBehaviour)this).__registerRpc(947208389u, new RpcReceiveHandler(__rpc_handler_947208389), "KillTargetClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_394168566(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; ((PhysicsPropConsoleItem)(object)target).TryUseServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2477809503(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; ((PhysicsPropConsoleItem)(object)target).TryUseClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1552753204(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; ((PhysicsPropConsoleItem)(object)target).TogglePowerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3062190208(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) { bool poweredOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref poweredOn, default(ForPrimitives)); int targetIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref targetIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropConsoleItem)(object)target).TogglePowerClientRpc(poweredOn, targetIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_151630751(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 targetPlayerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref targetPlayerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropConsoleItem)(object)target).EjectCartridgeServerRpc(targetPlayerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1099260146(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 targetPlayerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref targetPlayerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropConsoleItem)(object)target).EjectCartridgeClientRpc(targetPlayerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_947208389(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int targetPlayerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref targetPlayerIndex); ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropConsoleItem)(object)target).KillTargetClientRpc(targetPlayerIndex, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PhysicsPropConsoleItem"; } } } namespace MisideItems.itemSlop.coffeeSlop { public class PhysicsPropCoffeePackItem : GrabbableObject { private OpenCloseSound cap; private bool isOpen; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); cap = ((Component)this).GetComponentInChildren<OpenCloseSound>(); } public override void SetControlTipsForItem() { UpdateTooltip(); ((GrabbableObject)this).SetControlTipsForItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && !((Object)(object)cap == (Object)null) && !cap.IsAnimating()) { if (isOpen) { cap.PlayClose(); } else { cap.PlayOpen(); } isOpen = !isOpen; ((GrabbableObject)this).SetControlTipsForItem(); } } private void UpdateTooltip() { if (!((Object)(object)base.itemProperties == (Object)null) && base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length != 0) { base.itemProperties.toolTips[0] = (isOpen ? "Close : [LMB]" : "Open : [LMB]"); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropCoffeePackItem"; } } } namespace MisideItems.itemSlop.chibiSlop { public class PhysicsPropChibiMitaItem : GrabbableObject { private ParticleSystem heartParticles; private AudioSource heartAudio; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)heartParticles == (Object)null || (Object)(object)heartAudio == (Object)null) { Transform val = ((Component)this).transform.Find("ChibiMita/Particle Heart"); if ((Object)(object)val != (Object)null) { heartParticles = ((Component)val).GetComponent<ParticleSystem>(); heartAudio = ((Component)val).GetComponent<AudioSource>(); } } } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown) { if ((Object)(object)heartParticles != (Object)null) { heartParticles.Play(); } if ((Object)(object)heartAudio != (Object)null) { heartAudio.Play(); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhysicsPropChibiMitaItem"; } } } namespace MisideItems.itemSlop.cartridgeSlop { public class PhysicsPropCartridgeItem : GrabbableObject { private string selectedPlayerName; private GameObject canvasRoot; private Text nameText; public override void Start() { ((GrabbableObject)this).Start(); canvasRoot = ((Component)((Component)this).transform.Find("Catridge/CanvasCatridge")).gameObject; nameText = ((Component)((Component)this).transform.Find("Catridge/CanvasCatridge/Frame/TextName")).GetComponent<Text>(); if (((NetworkBehaviour)this).IsServer && string.IsNullOrEmpty(selectedPlayerName)) { SelectRandomPlayerName(); } } public override void EquipItem() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).EquipItem(); if ((Object)(object)canvasRoot != (Object)null) { canvasRoot.SetActive(true); } if (((NetworkBehaviour)this).IsClient) { RequestNameServerRpc(); } else { ApplyName(); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)canvasRoot != (Object)null) { canvasRoot.SetActive(false); } } [ServerRpc(RequireOwnership = false)] private void RequestNameServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2092427923u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2092427923u, rpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SendNameClientRpc(selectedPlayerName); } } } [ClientRpc] private void SendNameClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3626835900u, val, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3626835900u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; selectedPlayerName = name; ApplyName(); } } private void ApplyName() { if (!((Object)(object)nameText == (Object)null)) { nameText.text = selectedPlayerName; } } private void SelectRandomPlayerName() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; if (allPlayerScripts == null || allPlayerScripts.Length == 0) { return; } List<PlayerControllerB> list = new List<PlayerControllerB>(); PlayerControllerB[] array = allPlayerScripts; foreach (PlayerControllerB val in array) { if ((Object)(object)val != (Object)null && val.isPlayerControlled) { list.Add(val); } } if (list.Count != 0) { selectedPlayerName = list[Random.Range(0, list.Count)].playerUsername; } } 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(2092427923u, new RpcReceiveHandler(__rpc_handler_2092427923), "RequestNameServerRpc"); ((NetworkBehaviour)this).__registerRpc(3626835900u, new RpcReceiveHandler(__rpc_handler_3626835900), "SendNameClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2092427923(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropCartridgeItem)(object)target).RequestNameServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3626835900(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string name = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PhysicsPropCartridgeItem)(object)target).SendNameClientRpc(name); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PhysicsPropCartridgeItem"; } } } namespace MisideItems.itemSlop.cartofingotsSlop { public class IngotSpawn : MonoBehaviour { private PhysicsPropCartOfIngotsItem cartItem; private void Awake() { cartItem = ((Component)this).GetComponentInParent<PhysicsPropCartOfIngotsItem>(); } public void OnIngotThrown() { if (!((Object)(object)cartItem == (Object)null)) { cartItem.OnIngotThrown(); } } } internal class PhysicsPropCartOfIngotsItem : GrabbableObject { [CompilerGenerated] private sealed class <DropCooldownRoutine>d__25 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PhysicsPropCartOfIngotsItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DropCooldownRoutine>d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.dropOnCooldown = true; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.dropOnCooldown = false; <>4__this.dropHandledThisPress = false; <>4__this.dropCooldownCoroutine = null; <>4__this.UpdateCartWeightAndCarry(); <>4__this.UpdateCartScrapValue(); ((GrabbableObject)<>4__this).SetControlTipsForItem(); 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 Animator cartAnimator; private AudioSource cartAudio; private bool wasWalking; private static FieldInfo isWalkingField; private CartIngotVisualDropper ingotDropper; private bool dropOnCooldown; private Coroutine dropCooldownCoroutine; private bool dropHandledThisPress; private const float BaseCartWeight = 9.03f; private const float WeightPerIngot = 0.73f; private float lastAppliedItemWeight = -1f; private int baseScrapValue = -1; private int previousScrapValue; [SerializeField] private Transform dropSpawnPoint; private Item goldIngotItem; private const string GoldIngotKey = "misideitems:iron_ingot"; private int lastRemovedIngotValue; public override void Start() { ((GrabbableObject)this).Start(); CacheReflection(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null && base.playerHeldBy.isCrouching) { base.playerHeldBy.isCrouching = false; base.playerHeldBy.playerBodyAnimator.SetBool("crouching", false); base.playerHeldBy.playerBodyAnimator.Play("Idle1", 0); } Transform val = ((Component)this).transform.Find("CartPivot"); Transform val2 = ((Component)this).transform.Find("CartPivot/Cart"); cartAnimator = ((Component)val).GetComponent<Animator>(); cartAudio = ((Component)val2).GetComponent<AudioSource>(); ingotDropper = ((Component)val).GetComponent<CartIngotVisualDropper>(); if (baseScrapValue < 0) { baseScrapValue = base.scrapValue; } lastAppliedItemWeight = -1f; UpdateCartWeightAndCarry(); EnsureTooltipSize(); ((GrabbableObject)this).SetControlTipsForItem(); if ((Object)(object)cartAudio != (Object)null) { cartAudio.loop = true; cartAudio.Stop(); } wasWalking = false; ((MonoBehaviour)this).CancelInvoke("PollWalking"); ((MonoBehaviour)this).InvokeRepeating("PollWalking", 0.1f, 0.1f); } private void EnsureTooltipSize() { if ((Object)(object)base.itemProperties == (Object)null || (base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length >= 2)) { return; } string[] array = new string[2]; if (base.itemProperties.toolTips != null) { for (int i = 0; i < base.itemProperties.toolTips.Length && i < array.Length; i++) { array[i] = base.itemProperties.toolTips[i]; } } for (int j = 0; j < array.Length; j++) { ref string reference = ref array[j]; if (reference == null) { reference = ""; } } base.itemProperties.toolTips = array; } public override void SetControlTipsForItem() { if (((NetworkBehaviour)this).IsOwner && !dropOnCooldown) { UpdateTooltip(); ((GrabbableObject)this).SetControlTipsForItem(); } } private void UpdateTooltip() { if ((Object)(object)base.itemProperties == (Object)null || base.itemProperties.toolTips == null || base.itemProperties.toolTips.Length < 2) { return; } if ((Object)(object)ingotDropper == (Object)null) { base.itemProperties.toolTips[0] = ""; base.itemProperties.toolTips[1] = ""; return; } int remainingCount = ingotDropper.GetRemainingCount(); int totalCount = ingotDropper.GetTotalCount(); string text = $"[{remainingCount:00}/{totalCount:00}] ingots remaining"; if (remainingCount > 0) { base.itemProperties.toolTips[0] = "Remove \"iron\" ingot : [LMB]"; base.itemProperties.toolTips[1] = text; } else { base.itemProperties.toolTips[0] = text; base.itemProperties.toolTips[1] = ""; } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); ((MonoBehaviour)this).CancelInvoke("PollWalking"); StopAudio(); wasWalking = false; lastAppliedItemWeight = -1f; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)cartAnimator != (Object)null) { cartAnimator.SetBool("IsMoving", false); cartAnimator.Play("Idle", 0); } ((MonoBehaviour)this).CancelInvoke("PollWalking"); StopAudio(); wasWalking = false; lastAppliedItemWeight = -1f; } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && !dropOnCooldown && !dropHandledThisPress && !((Object)(object)cartAnimator == (Object)null) && !((Object)(object)ingotDropper == (Object)null) && ingotDropper.HasIngotsRemaining()) { dropHandledThisPress = true; cartAnimator.ResetTrigger("IsDropping"); cartAnimator.SetTrigger("IsDropping"); wasWalking = false; StopAudio(); if (dropCooldownCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dropCooldownCoroutine); } dropCooldownCoroutine = ((MonoBehaviour)this).StartCoroutine(DropCooldownRoutine()); } } [IteratorStateMachine(typeof(<DropCooldownRoutine>d__25))] private IEnumerator DropCooldownRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DropCooldownRoutine>d__25(0) { <>4__this = this }; } private void CacheReflection() { if (isWalkingField == null) { isWalkingField = typeof(PlayerControllerB).GetField("isWalking", BindingFlags.Instance | BindingFlags.NonPublic); } } private void PollWalking() { if (!((Object)(object)base.playerHeldBy == (Object)null)) { bool flag = isWalkingField != null &