Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SellBodiesFixed v1.14.0
BepInEx/plugins/SellBodies/SellBodies.dll
Decompiled 7 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using CleaningCompany.Misc; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalLib.Modules; using Microsoft.CodeAnalysis; using SellBodies; using SellBodies.Monos; using SellBodies.NetcodePatcher; using SellBodies.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SellBodies")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7e3e8591e5c1890c640772b6081bb007dc9fe690")] [assembly: AssemblyProduct("SellBodies")] [assembly: AssemblyTitle("SellBodies")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class GameBoyCartridgeScript : GrabbableObject { public Material cartrigeMat; public VideoClip videoClip; public string URL; public bool isURLCartridge = false; private bool isEnteringURL = false; private string urlInput = ""; public override void Start() { ((GrabbableObject)this).Start(); base.scrapValue = 378; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && (Object)(object)base.playerHeldBy != (Object)null && isURLCartridge && !isEnteringURL) { OpenURLInput(); } } private void OnGUI() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Invalid comparison between Unknown and I4 //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Invalid comparison between Unknown and I4 if (isEnteringURL) { float num = 500f; float num2 = 30f; float num3 = ((float)Screen.width - num) / 2f; float num4 = ((float)Screen.height - num2) / 2f; GUI.Box(new Rect(num3 - 10f, num4 - 40f, num + 20f, num2 + 60f), "Insert URL"); GUI.SetNextControlName("URLField"); urlInput = GUI.TextField(new Rect(num3, num4, num, num2), urlInput); GUI.FocusControl("URLField"); if (Event.current.isKey && (int)Event.current.keyCode == 13 && urlInput.Length > 0) { URL = urlInput; CloseURLInput(); } else if (Event.current.isKey && (int)Event.current.keyCode == 27) { CloseURLInput(); } } } private void OpenURLInput() { isEnteringURL = true; urlInput = URL ?? ""; base.playerHeldBy.isTypingChat = true; base.playerHeldBy.disableLookInput = true; Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; } private void CloseURLInput() { isEnteringURL = false; urlInput = ""; if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.isTypingChat = false; base.playerHeldBy.disableLookInput = false; } Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "GameBoyCartridgeScript"; } } public class GameBoyInput : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction LoadCartridgeKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction VolumeUpKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction VolumeDownKey { get; set; } } public class GameBoyScript : GrabbableObject { [CompilerGenerated] private sealed class <ResolveAndPlay>d__39 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string url; public GameBoyScript <>4__this; private string <directUrl>5__1; private string <videoId>5__2; private string <visitorData>5__3; private UnityWebRequest <initReq>5__4; private string <initJson>5__5; private Match <vdMatch>5__6; private UnityWebRequest <retryReq>5__7; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ResolveAndPlay>d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 1: try { } finally { <>m__Finally1(); } break; case -4: case 2: try { } finally { <>m__Finally2(); } break; } <directUrl>5__1 = null; <videoId>5__2 = null; <visitorData>5__3 = null; <initReq>5__4 = null; <initJson>5__5 = null; <vdMatch>5__6 = null; <retryReq>5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Invalid comparison between Unknown and I4 try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isResolvingURL = true; <directUrl>5__1 = url; if (IsYouTubeURL(url)) { <videoId>5__2 = ExtractYouTubeVideoId(url); if (<videoId>5__2 == null) { Debug.LogError((object)("[GameBoy] Could not extract YouTube video ID from: " + url)); <>4__this.audio.PlayOneShot(<>4__this.errorSFX); <>4__this.isResolvingURL = false; return false; } <visitorData>5__3 = ""; <initReq>5__4 = CreateYouTubeRequest(<videoId>5__2, null); <>1__state = -3; <>2__current = <initReq>5__4.SendWebRequest(); <>1__state = 1; return true; } goto IL_02bf; case 1: { <>1__state = -3; DownloadHandler downloadHandler = <initReq>5__4.downloadHandler; <initJson>5__5 = ((downloadHandler != null) ? downloadHandler.text : null) ?? ""; <vdMatch>5__6 = Regex.Match(<initJson>5__5, "\"visitorData\"\\s*:\\s*\"([^\"]+)\""); if (<vdMatch>5__6.Success) { <visitorData>5__3 = <vdMatch>5__6.Groups[1].Value; } <directUrl>5__1 = ExtractStreamURL(<initJson>5__5); <initJson>5__5 = null; <vdMatch>5__6 = null; <>m__Finally1(); <initReq>5__4 = null; if (<directUrl>5__1 == null && !string.IsNullOrEmpty(<visitorData>5__3)) { <retryReq>5__7 = CreateYouTubeRequest(<videoId>5__2, <visitorData>5__3); <>1__state = -4; <>2__current = <retryReq>5__7.SendWebRequest(); <>1__state = 2; return true; } goto IL_025b; } case 2: <>1__state = -4; if ((int)<retryReq>5__7.result == 1) { <directUrl>5__1 = ExtractStreamURL(<retryReq>5__7.downloadHandler.text); } <>m__Finally2(); <retryReq>5__7 = null; goto IL_025b; case 3: { <>1__state = -1; break; } IL_02bf: <>4__this.isResolvingURL = false; if (!<>4__this.hasCartrige || (Object)(object)<>4__this.insertedCartridge == (Object)null || !<>4__this.insertedCartridge.isURLCartridge) { return false; } <>4__this.gameboyVideoPlayer.url = <directUrl>5__1; <>4__this.gameboyVideoPlayer.frame = 0L; <>4__this.gameboyVideoPlayer.Prepare(); break; IL_025b: if (<directUrl>5__1 == null) { Debug.LogError((object)("[GameBoy] Could not resolve YouTube video: " + <videoId>5__2)); <>4__this.audio.PlayOneShot(<>4__this.errorSFX); <>4__this.isResolvingURL = false; return false; } <videoId>5__2 = null; <visitorData>5__3 = null; goto IL_02bf; } if (!<>4__this.gameboyVideoPlayer.isPrepared) { if (!<>4__this.hasCartrige || (Object)(object)<>4__this.insertedCartridge == (Object)null) { return false; } <>2__current = null; <>1__state = 3; return true; } <>4__this.gameboyVideoPlayer.Play(); <>4__this.gameboyBackground.SetActive(true); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<initReq>5__4 != null) { ((IDisposable)<initReq>5__4).Dispose(); } } private void <>m__Finally2() { <>1__state = -1; if (<retryReq>5__7 != null) { ((IDisposable)<retryReq>5__7).Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private GameBoyCartridgeScript insertedCartridge; public GameObject gameboyCartrige; public GameObject gameboyBackground; public Material gameboyCartrigeMat; public VideoPlayer gameboyVideoPlayer; public VideoClip gameboyVideoClip; public string gameboyURL; public AudioClip errorSFX; public AudioClip useButtonSFX; public AudioClip dropSFX; public AudioClip grabSFX; public AudioSource audio; private bool hasCartrige = false; private bool isResolvingURL = false; private const string YT_API_URL = "https://www.youtube.com/youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w&hl=en"; private const string YT_USER_AGENT = "com.google.android.apps.youtube.vr.oculus/1.60.19 (Linux; U; Android 12L; Quest 3 Build/SQ3A.220605.009.A1) gzip"; private const string YT_SOCS_COOKIE = "SOCS=CAISEwgDEgk4MTM4MzYzNTIaAmVuIAEaBgiApPzGBg"; public override void Start() { ((GrabbableObject)this).Start(); if (!hasCartrige) { gameboyCartrige.SetActive(false); gameboyBackground.SetActive(false); } } public override void Update() { ((GrabbableObject)this).Update(); if ((Object)(object)base.playerHeldBy != (Object)null && !base.isPocketed && !base.playerHeldBy.isGrabbingObjectAnimation && !base.playerHeldBy.isTypingChat && !base.playerHeldBy.inTerminalMenu && !base.playerHeldBy.inSpecialInteractAnimation && (Object)(object)base.playerHeldBy.hoveringOverTrigger == (Object)null) { SetupKeyCallbacks(); } else { StopKeyCallbacks(); } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); base.playerHeldBy.equippedUsableItemQE = true; } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; } public override void DiscardItem() { base.playerHeldBy.equippedUsableItemQE = false; ((GrabbableObject)this).DiscardItem(); } public override void PocketItem() { base.playerHeldBy.equippedUsableItemQE = false; ((GrabbableObject)this).PocketItem(); } public void SetupKeyCallbacks() { Plugin.InputActionsInstance.LoadCartridgeKey.performed += LoadCartridge; Plugin.InputActionsInstance.VolumeUpKey.performed += VolumeUp; Plugin.InputActionsInstance.VolumeDownKey.performed += VolumeDown; } public void StopKeyCallbacks() { Plugin.InputActionsInstance.LoadCartridgeKey.performed -= LoadCartridge; Plugin.InputActionsInstance.VolumeUpKey.performed -= VolumeUp; Plugin.InputActionsInstance.VolumeDownKey.performed -= VolumeDown; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown || (Object)(object)base.playerHeldBy == (Object)null || !hasCartrige) { return; } if (gameboyVideoPlayer.isPlaying) { gameboyBackground.SetActive(false); gameboyVideoPlayer.Pause(); } else if (gameboyVideoPlayer.frame > 0) { gameboyBackground.SetActive(true); gameboyVideoPlayer.Play(); } else if (insertedCartridge.isURLCartridge) { if (string.IsNullOrEmpty(gameboyURL)) { audio.PlayOneShot(errorSFX); } else if (!isResolvingURL) { ((MonoBehaviour)this).StartCoroutine(ResolveAndPlay(gameboyURL)); } } else { gameboyVideoPlayer.clip = gameboyVideoClip; gameboyVideoPlayer.frame = 0L; gameboyVideoPlayer.Play(); gameboyBackground.SetActive(true); } } public void VolumeUp(CallbackContext VolumeUpContext) { if (((CallbackContext)(ref VolumeUpContext)).performed && !((Object)(object)base.playerHeldBy == (Object)null)) { audio.volume = Mathf.Clamp(audio.volume + 0.1f, 0f, 1f); VolumeUpServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void VolumeUpServerRpc() { //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(3339650937u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3339650937u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; VolumeUpClientRpc(); } } } [ClientRpc] private void VolumeUpClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2270917584u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2270917584u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { audio.volume = Mathf.Clamp(audio.volume + 0.1f, 0f, 1f); } } } public void VolumeDown(CallbackContext VolumeDownContext) { if (((CallbackContext)(ref VolumeDownContext)).performed && !((Object)(object)base.playerHeldBy == (Object)null)) { audio.volume = Mathf.Clamp(audio.volume - 0.1f, 0f, 1f); VolumeDownServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void VolumeDownServerRpc() { //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(4122763183u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4122763183u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; VolumeDownClientRpc(); } } } [ClientRpc] private void VolumeDownClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3345779665u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3345779665u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { audio.volume = Mathf.Clamp(audio.volume - 0.1f, 0f, 1f); } } } public void LoadCartridge(CallbackContext LoadCartridgeContext) { if (!((CallbackContext)(ref LoadCartridgeContext)).performed || (Object)(object)base.playerHeldBy == (Object)null) { return; } if (!hasCartrige) { int cartrigeInventorySlot = getCartrigeInventorySlot(); if (cartrigeInventorySlot != -1) { GameBoyCartridgeScript component = ((Component)base.playerHeldBy.ItemSlots[cartrigeInventorySlot]).GetComponent<GameBoyCartridgeScript>(); gameboyURL = ""; if (Object.op_Implicit((Object)(object)component)) { gameboyURL = component.URL; } ExecuteLoadCartridge(cartrigeInventorySlot, gameboyURL); LoadCartridgeServerRpc(cartrigeInventorySlot, gameboyURL); } } else { ExecuteUnloadCartridge(); UnloadCartridgeServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void LoadCartridgeServerRpc(int cartrigeIndex, string url) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) 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(1533229157u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, cartrigeIndex); bool flag = url != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(url, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1533229157u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LoadCartridgeClientRpc(cartrigeIndex, url); } } [ClientRpc] private void LoadCartridgeClientRpc(int cartrigeIndex, string url) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) 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(647930691u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, cartrigeIndex); bool flag = url != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(url, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 647930691u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { ExecuteLoadCartridge(cartrigeIndex, url); } } } private void ExecuteLoadCartridge(int cartrigeIndex, string url = "") { if (!((Object)(object)base.playerHeldBy == (Object)null)) { GameBoyCartridgeScript gameBoyCartridgeScript = (insertedCartridge = ((Component)base.playerHeldBy.ItemSlots[cartrigeIndex]).GetComponent<GameBoyCartridgeScript>()); gameboyCartrigeMat = gameBoyCartridgeScript.cartrigeMat; if (gameBoyCartridgeScript.isURLCartridge) { gameboyVideoPlayer.source = (VideoSource)1; gameboyURL = url; } else { gameboyVideoPlayer.source = (VideoSource)0; gameboyVideoClip = gameBoyCartridgeScript.videoClip; gameboyURL = ""; } MeshRenderer[] componentsInChildren = gameboyCartrige.GetComponentsInChildren<MeshRenderer>(); MeshRenderer[] array = componentsInChildren; foreach (MeshRenderer val in array) { ((Renderer)val).material = gameboyCartrigeMat; } if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)HUDManager.Instance.itemSlotIcons[cartrigeIndex]).enabled = false; } base.playerHeldBy.ItemSlots[cartrigeIndex] = null; ((Component)insertedCartridge).gameObject.SetActive(false); gameboyCartrige.SetActive(true); hasCartrige = true; } } [ServerRpc(RequireOwnership = false)] private void UnloadCartridgeServerRpc() { //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(1580896611u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1580896611u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UnloadCartridgeClientRpc(); } } } [ClientRpc] private void UnloadCartridgeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(258506789u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 258506789u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { ExecuteUnloadCartridge(); } } } private void ExecuteUnloadCartridge() { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } gameboyCartrige.SetActive(false); gameboyBackground.SetActive(false); ((Component)insertedCartridge).gameObject.SetActive(true); gameboyVideoPlayer.Stop(); int freeInventorySlot = GetFreeInventorySlot(); if (freeInventorySlot != -1) { base.playerHeldBy.ItemSlots[freeInventorySlot] = (GrabbableObject)(object)insertedCartridge; if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)HUDManager.Instance.itemSlotIcons[freeInventorySlot]).enabled = true; } } else { DropItem((GrabbableObject)(object)insertedCartridge); } insertedCartridge = null; hasCartrige = false; } [IteratorStateMachine(typeof(<ResolveAndPlay>d__39))] private IEnumerator ResolveAndPlay(string url) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ResolveAndPlay>d__39(0) { <>4__this = this, url = url }; } private static UnityWebRequest CreateYouTubeRequest(string videoId, string visitorData) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown string text = (string.IsNullOrEmpty(visitorData) ? "" : (",\"visitorData\":\"" + visitorData + "\"")); string s = "{\"videoId\":\"" + videoId + "\",\"context\":{\"client\":{\"clientName\":\"ANDROID_VR\",\"clientVersion\":\"1.60.19\",\"deviceMake\":\"Meta\",\"deviceModel\":\"Quest 3\",\"osName\":\"Android\",\"osVersion\":\"12L\",\"platform\":\"MOBILE\",\"hl\":\"en\",\"gl\":\"US\"" + text + "}},\"contentCheckOk\":true,\"racyCheckOk\":true}"; UnityWebRequest val = new UnityWebRequest("https://www.youtube.com/youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w&hl=en", "POST"); val.uploadHandler = (UploadHandler)new UploadHandlerRaw(Encoding.UTF8.GetBytes(s)); val.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); val.SetRequestHeader("Content-Type", "application/json"); val.SetRequestHeader("User-Agent", "com.google.android.apps.youtube.vr.oculus/1.60.19 (Linux; U; Android 12L; Quest 3 Build/SQ3A.220605.009.A1) gzip"); val.SetRequestHeader("Cookie", "SOCS=CAISEwgDEgk4MTM4MzYzNTIaAmVuIAEaBgiApPzGBg"); val.timeout = 15; return val; } private static bool IsYouTubeURL(string url) { return url.Contains("youtube.com") || url.Contains("youtu.be"); } private static string ExtractYouTubeVideoId(string url) { Match match = Regex.Match(url, "[?&]v=([a-zA-Z0-9_-]{11})"); if (match.Success) { return match.Groups[1].Value; } match = Regex.Match(url, "youtu\\.be/([a-zA-Z0-9_-]{11})"); if (match.Success) { return match.Groups[1].Value; } match = Regex.Match(url, "youtube\\.com/embed/([a-zA-Z0-9_-]{11})"); if (match.Success) { return match.Groups[1].Value; } return null; } private static string ExtractStreamURL(string json) { MatchCollection matchCollection = Regex.Matches(json, "\"url\"\\s*:\\s*\"(https://[^\"]*googlevideo\\.com/videoplayback[^\"]+)\""); string text = null; int num = int.MaxValue; foreach (Match item in matchCollection) { string str = item.Groups[1].Value.Replace("\\u0026", "&"); str = Regex.Unescape(str); if (str.Contains("mime=video%2Fmp4") || str.Contains("mime=video/mp4")) { Match match2 = Regex.Match(str, "itag=(\\d+)"); int num2 = (match2.Success ? int.Parse(match2.Groups[1].Value) : 0) switch { 22 => 1, 18 => 0, _ => 2, }; if (num2 < num) { text = str; num = num2; } } } if (text != null) { return text; } if (matchCollection.Count > 0) { string str2 = matchCollection[0].Groups[1].Value.Replace("\\u0026", "&"); return Regex.Unescape(str2); } return null; } public int getCartrigeInventorySlot() { for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)base.playerHeldBy.ItemSlots[i] != (Object)null) { GameBoyCartridgeScript component = ((Component)base.playerHeldBy.ItemSlots[i]).GetComponent<GameBoyCartridgeScript>(); if ((Object)(object)component != (Object)null) { return i; } } } return -1; } public int GetFreeInventorySlot() { for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)base.playerHeldBy.ItemSlots[i] == (Object)null) { return i; } } return -1; } private void DropItem(GrabbableObject item) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)item == (Object)null) && !((Object)(object)base.playerHeldBy == (Object)null)) { item.parentObject = null; item.heldByPlayerOnServer = false; if (base.playerHeldBy.isInElevator) { ((Component)item).transform.SetParent(base.playerHeldBy.playersManager.elevatorTransform, true); } else { ((Component)item).transform.SetParent(base.playerHeldBy.playersManager.propsContainer, true); } base.playerHeldBy.SetItemInElevator(base.playerHeldBy.isInHangarShipRoom, base.playerHeldBy.isInElevator, item); item.EnablePhysics(true); item.EnableItemMeshes(true); ((Component)item).transform.localScale = item.originalScale; item.isHeld = false; item.isPocketed = false; item.startFallingPosition = ((Component)item).transform.parent.InverseTransformPoint(((Component)this).transform.position - Vector3.downVector); item.FallToGround(true, false, default(Vector3)); item.fallTime = Random.Range(-0.3f, 0.05f); item.DiscardItem(); item.playerHeldBy = null; } } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3339650937u, new RpcReceiveHandler(__rpc_handler_3339650937), "VolumeUpServerRpc"); ((NetworkBehaviour)this).__registerRpc(2270917584u, new RpcReceiveHandler(__rpc_handler_2270917584), "VolumeUpClientRpc"); ((NetworkBehaviour)this).__registerRpc(4122763183u, new RpcReceiveHandler(__rpc_handler_4122763183), "VolumeDownServerRpc"); ((NetworkBehaviour)this).__registerRpc(3345779665u, new RpcReceiveHandler(__rpc_handler_3345779665), "VolumeDownClientRpc"); ((NetworkBehaviour)this).__registerRpc(1533229157u, new RpcReceiveHandler(__rpc_handler_1533229157), "LoadCartridgeServerRpc"); ((NetworkBehaviour)this).__registerRpc(647930691u, new RpcReceiveHandler(__rpc_handler_647930691), "LoadCartridgeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1580896611u, new RpcReceiveHandler(__rpc_handler_1580896611), "UnloadCartridgeServerRpc"); ((NetworkBehaviour)this).__registerRpc(258506789u, new RpcReceiveHandler(__rpc_handler_258506789), "UnloadCartridgeClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3339650937(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; ((GameBoyScript)(object)target).VolumeUpServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2270917584(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; ((GameBoyScript)(object)target).VolumeUpClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4122763183(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; ((GameBoyScript)(object)target).VolumeDownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3345779665(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; ((GameBoyScript)(object)target).VolumeDownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1533229157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int cartrigeIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref cartrigeIndex); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string url = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref url, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((GameBoyScript)(object)target).LoadCartridgeServerRpc(cartrigeIndex, url); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_647930691(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int cartrigeIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref cartrigeIndex); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string url = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref url, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((GameBoyScript)(object)target).LoadCartridgeClientRpc(cartrigeIndex, url); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1580896611(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; ((GameBoyScript)(object)target).UnloadCartridgeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_258506789(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; ((GameBoyScript)(object)target).UnloadCartridgeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GameBoyScript"; } } namespace SellBodies { [BepInPlugin("Entity378.sellbodies", "Sell Bodies", "1.14.0")] [BepInDependency("evaisa.lethallib", "0.16.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("Entity378.sellbodies"); private const string GUID = "Entity378.sellbodies"; private const string NAME = "Sell Bodies"; private const string VERSION = "1.14.0"; private static string bodiesRoot = "Assets/LethalCompany/SellBodies/Items/"; private static string mainRoot = "Assets/LethalCompany/SellBodies/"; public Dictionary<string, Item> BodySpawns = new Dictionary<string, Item>(); public List<string> VanillaBody = new List<string> { "Flowerman", "Crawler", "Hoarding bug", "Centipede", "Bunker Spider", "Puffer", "Jester", "Blob", "Girl", "Spring", "Nutcracker", "Masked", "Butler", "MouthDog", "Earth Leviathan", "ForestGiant", "Baboon hawk", "RadMech", "Red Locust Bees", "Docile Locust Bees", "Manticoil", "Tulip Snake", "Clay Surgeon", "Bush Wolf", "Maneater", "GiantKiwi", "Stingray", "Cadaver Growths", "Cadaver Bloom", "Feiopar" }; public List<string> BlackListed = new List<string>(); private AssetBundle bundle; public static Plugin instance; public static GameObject ConfettiPrefab = new GameObject(); public Item Gameboy; public Item GameboyCartridgeRITN; public Item GameboyCartridgeRDA; public Item GameboyCartridgeURL; public static GameBoyInput InputActionsInstance = new GameBoyInput(); public static PluginConfig cfg { get; private set; } private void Awake() { instance = this; cfg = new PluginConfig(((BaseUnityPlugin)this).Config); cfg.InitBindings(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sellbodies"); bundle = AssetBundle.LoadFromFile(text); ConfettiPrefab = bundle.LoadAsset<GameObject>(mainRoot + "KillEffects/ConfettiParticle.prefab"); AudioClip clip = bundle.LoadAsset<AudioClip>(mainRoot + "KillEffects/Cheer.ogg"); AudioClip clip2 = bundle.LoadAsset<AudioClip>(mainRoot + "KillEffects/Yippee.ogg"); if (cfg.YIPPEE) { ConfettiPrefab.AddComponent<AudioSource>().clip = clip2; } else { ConfettiPrefab.AddComponent<AudioSource>().clip = clip; } ConfettiPrefab.GetComponent<AudioSource>().playOnAwake = true; Gameboy = bundle.LoadAsset<Item>(mainRoot + "Gameboy/Gameboy.asset"); GameboyCartridgeRITN = bundle.LoadAsset<Item>(mainRoot + "Gameboy/CartridgeRITN/CartridgeRITN.asset"); GameboyCartridgeRDA = bundle.LoadAsset<Item>(mainRoot + "Gameboy/CartridgeRDA/CartridgeRDA.asset"); GameboyCartridgeURL = bundle.LoadAsset<Item>(mainRoot + "Gameboy/CartridgeURL/CartridgeURL.asset"); Utilities.FixMixerGroups(Gameboy.spawnPrefab); Utilities.FixMixerGroups(GameboyCartridgeRITN.spawnPrefab); Utilities.FixMixerGroups(GameboyCartridgeRDA.spawnPrefab); Utilities.FixMixerGroups(GameboyCartridgeURL.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(Gameboy.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(GameboyCartridgeRITN.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(GameboyCartridgeRDA.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(GameboyCartridgeURL.spawnPrefab); Items.RegisterShopItem(Gameboy, 20); Items.RegisterItem(GameboyCartridgeRITN); Items.RegisterItem(GameboyCartridgeRDA); Items.RegisterItem(GameboyCartridgeURL); ApplyConfig(); RegisterDefaultBodies(); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sell Bodies is patched!"); } private void ApplyConfig() { BlackListed.Clear(); string[] array = cfg.BLACKLISTED.Split(','); string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); if (text2.Length > 0) { BlackListed.Add(text2); } } } private void RegisterDefaultBodies() { RegisterBody("Hoarding bug", bodiesRoot + "HoarderingBugBody.asset", cfg.HOARDER_MIN, cfg.HOARDER_MAX, cfg.HOARDER_WEIGHT, cfg.HOARDER_TWOHANDED, cfg.HOARDER); RegisterBody("Bunker Spider", bodiesRoot + "BunkerSpiderBody.asset", cfg.SPIDER_MIN, cfg.SPIDER_MAX, cfg.SPIDER_WEIGHT, cfg.SPIDER_TWOHANDED, cfg.SPIDER); RegisterBody("Crawler", bodiesRoot + "CrawlerBody.asset", cfg.THUMPER_MIN, cfg.THUMPER_MAX, cfg.THUMPER_WEIGHT, cfg.THUMPER_TWOHANDED, cfg.THUMPER); RegisterBody("Centipede", bodiesRoot + "CentipedeBody.asset", cfg.CENTIPEDE_MIN, cfg.CENTIPEDE_MAX, cfg.CENTIPEDE_WEIGHT, cfg.CENTIPEDE_TWOHANDED, cfg.CENTIPEDE); RegisterBody("Nutcracker", bodiesRoot + "NutcrackerBody.asset", cfg.NUTCRACKER_MIN, cfg.NUTCRACKER_MAX, cfg.NUTCRACKER_WEIGHT, cfg.NUTCRACKER_TWOHANDED, cfg.NUTCRACKER); RegisterBody("Flowerman", bodiesRoot + "FlowerManBody.asset", cfg.BRACKEN_MIN, cfg.BRACKEN_MAX, cfg.BRACKEN_WEIGHT, cfg.BRACKEN_TWOHANDED, cfg.BRACKEN); RegisterBody("Baboon hawk", bodiesRoot + "BaboonHawkBody.asset", cfg.BABOON_MIN, cfg.BABOON_MAX, cfg.BABOON_WEIGHT, cfg.BABOON_TWOHANDED, cfg.BABOON); RegisterBody("MouthDog", bodiesRoot + "MouthDogBody.asset", cfg.MOUTHDOG_MIN, cfg.MOUTHDOG_MAX, cfg.MOUTHDOG_WEIGHT, cfg.MOUTHDOG_TWOHANDED, cfg.MOUTHDOG); RegisterBody("Spring", bodiesRoot + "SpringBody.asset", cfg.COILHEAD_MIN, cfg.COILHEAD_MAX, cfg.COILHEAD_WEIGHT, cfg.COILHEAD_TWOHANDED, cfg.COILHEAD); RegisterBody("Girl", bodiesRoot + "GirlBody.asset", cfg.GHOSTGIRL_MIN, cfg.GHOSTGIRL_MAX, cfg.GHOSTGIRL_WEIGHT, cfg.GHOSTGIRL_TWOHANDED, cfg.GHOSTGIRL); RegisterBody("ForestGiant", bodiesRoot + "ForestGiantBody.asset", cfg.FORESTKEEPER_MIN, cfg.FORESTKEEPER_MAX, cfg.FORESTKEEPER_WEIGHT, cfg.FORESTKEEPER_TWOHANDED, cfg.FORESTKEEPER); RegisterBody("Jester", bodiesRoot + "JesterBody.asset", cfg.JESTER_MIN, cfg.JESTER_MAX, cfg.JESTER_WEIGHT, cfg.JESTER_TWOHANDED, cfg.JESTER); RegisterBody("Blob", bodiesRoot + "BlobBody.asset", cfg.HYGRODORE_MIN, cfg.HYGRODORE_MAX, cfg.HYGRODORE_WEIGHT, cfg.HYGRODORE_TWOHANDED, cfg.HYGRODORE); RegisterBody("Puffer", bodiesRoot + "PufferBody.asset", cfg.SPORELIZARD_MIN, cfg.SPORELIZARD_MAX, cfg.SPORELIZARD_WEIGHT, cfg.SPORELIZARD_TWOHANDED, cfg.SPORELIZARD); RegisterBody("Manticoil", bodiesRoot + "ManticoilBody.asset", cfg.MANTICOIL_MIN, cfg.MANTICOIL_MAX, cfg.MANTICOIL_WEIGHT, cfg.MANTICOIL_TWOHANDED, cfg.MANTICOIL); RegisterBody("RadMech", bodiesRoot + "RadMechBody.asset", cfg.RADMECH_MIN, cfg.RADMECH_MAX, cfg.RADMECH_WEIGHT, cfg.RADMECH_TWOHANDED, cfg.RADMECH); RegisterBody("Tulip Snake", bodiesRoot + "TulipSnakeBody.asset", cfg.TULIPSNAKE_MIN, cfg.TULIPSNAKE_MAX, cfg.TULIPSNAKE_WEIGHT, cfg.TULIPSNAKE_TWOHANDED, cfg.TULIPSNAKE); RegisterBody("Clay Surgeon", bodiesRoot + "ClaySurgeonBody.asset", cfg.CLAYSURGEON_MIN, cfg.CLAYSURGEON_MAX, cfg.CLAYSURGEON_WEIGHT, cfg.CLAYSURGEON_TWOHANDED, cfg.CLAYSURGEON); RegisterBody("Bush Wolf", bodiesRoot + "BushWolfBody.asset", cfg.BUSHWOLF_MIN, cfg.BUSHWOLF_MAX, cfg.BUSHWOLF_WEIGHT, cfg.BUSHWOLF_TWOHANDED, cfg.BUSHWOLF); RegisterBody("Maneater", bodiesRoot + "CaveDwellerBody.asset", cfg.MANEATER_MIN, cfg.MANEATER_MAX, cfg.MANEATER_WEIGHT, cfg.MANEATER_TWOHANDED, cfg.MANEATER); RegisterBody("Stingray", bodiesRoot + "StingrayBody.asset", cfg.STINGRAY_MIN, cfg.STINGRAY_MAX, cfg.STINGRAY_WEIGHT, cfg.STINGRAY_TWOHANDED, cfg.STINGRAY); RegisterBody("Cadaver Bloom", bodiesRoot + "CadaverBody.asset", cfg.CADAVER_MIN, cfg.CADAVER_MAX, cfg.CADAVER_WEIGHT, cfg.CADAVER_TWOHANDED, cfg.CADAVER); RegisterBody("Feiopar", bodiesRoot + "PumaBody.asset", cfg.PUMA_MIN, cfg.PUMA_MAX, cfg.PUMA_WEIGHT, cfg.PUMA_TWOHANDED, cfg.PUMA); RegisterBody("ModdedEnemyPowerLevel1", bodiesRoot + "ModdedEnemyPowerLevel1Body.asset", cfg.MODDEDENEMYPOWERLEVEL1_MIN, cfg.MODDEDENEMYPOWERLEVEL1_MAX, cfg.MODDEDENEMYPOWERLEVEL1_WEIGHT, cfg.MODDEDENEMYPOWERLEVEL1_TWOHANDED, cfg.MODDEDENEMY); RegisterBody("ModdedEnemyPowerLevel2", bodiesRoot + "ModdedEnemyPowerLevel2Body.asset", cfg.MODDEDENEMYPOWERLEVEL2_MIN, cfg.MODDEDENEMYPOWERLEVEL2_MAX, cfg.MODDEDENEMYPOWERLEVEL2_WEIGHT, cfg.MODDEDENEMYPOWERLEVEL2_TWOHANDED, cfg.MODDEDENEMY); RegisterBody("ModdedEnemyPowerLevel3", bodiesRoot + "ModdedEnemyPowerLevel3Body.asset", cfg.MODDEDENEMYPOWERLEVEL3_MIN, cfg.MODDEDENEMYPOWERLEVEL3_MAX, cfg.MODDEDENEMYPOWERLEVEL3_WEIGHT, cfg.MODDEDENEMYPOWERLEVEL3_TWOHANDED, cfg.MODDEDENEMY); } public void RegisterBody(string enemyName, string assetPath, int minValue, int maxValue, float weight, bool twoHanded, bool enabled = true) { if (string.IsNullOrWhiteSpace(enemyName) || string.IsNullOrWhiteSpace(assetPath)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Invalid body definition provided. Skipping."); return; } Item val = bundle.LoadAsset<Item>(assetPath); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Could not load body asset at path: " + assetPath)); return; } Utilities.FixMixerGroups(val.spawnPrefab); val.spawnPrefab.AddComponent<BodySyncer>(); val.twoHanded = twoHanded; val.maxValue = maxValue; val.minValue = minValue; val.weight = weight; NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Items.RegisterItem(val); if (enabled && !BlackListed.Contains(enemyName)) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Set " + enemyName + " to drop " + val.itemName)); BodySpawns[enemyName] = val; } else { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Disregarding " + val.itemName + " - disabled in config")); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "SellBodies"; public const string PLUGIN_NAME = "SellBodies"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace SellBodies.Patches { [HarmonyPatch(typeof(GrabbableObject))] internal class GrabbableObjectPatch { [HarmonyPostfix] [HarmonyPatch("LateUpdate")] private static void LateUpdatePatch(ref GrabbableObject __instance) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) SyncScript component = ((Component)__instance).GetComponent<SyncScript>(); if ((Object)(object)component != (Object)null) { GrabbableObject component2 = ((Component)__instance).GetComponent<GrabbableObject>(); if (component.justSpawned && component2.hasHitGround) { ((Component)component2).gameObject.transform.rotation = component.spawnRotation; component.justSpawned = false; } } } } [HarmonyPatch(typeof(StartOfRound))] internal class ItemsPatcher { public static Item tragedyMask; public static Item comedyMask; public static Item shotgun; [HarmonyPostfix] [HarmonyPatch("Awake")] private static void PatchAwake(StartOfRound __instance) { try { tragedyMask = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "TragedyMask"); comedyMask = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "ComedyMask"); shotgun = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "Shotgun"); shotgun.spawnPrefab.AddComponent<ShotgunSyncer>(); tragedyMask.spawnPrefab.AddComponent<MaskSyncer>(); comedyMask.spawnPrefab.AddComponent<MaskSyncer>(); } catch { Debug.LogError((object)"ItemScripts not applied correctly"); } } } [HarmonyPatch(typeof(EnemyAI))] internal class KillEnemyPatcher { [CompilerGenerated] private sealed class <MoveOldBody>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; private Vector3 <newBodyPos>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <MoveOldBody>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(Plugin.cfg.BODY_SPAWN_DELAY); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)__instance != (Object)null) { <newBodyPos>5__1 = new Vector3(-10000f, -10000f, -10000f); ((Component)__instance).transform.position = <newBodyPos>5__1; __instance.SyncPositionToClients(); } else { Debug.LogError((object)"__instance is null in MoveOldBody() inside KillEnemy()"); } 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(); } } [HarmonyPostfix] [HarmonyPatch("KillEnemy")] private static void MoveBody(EnemyAI __instance) { if ((Object)(object)__instance != (Object)null) { string enemyName = __instance.enemyType.enemyName; if (Plugin.instance.BodySpawns.ContainsKey(enemyName)) { ((MonoBehaviour)__instance).StartCoroutine(MoveOldBody(__instance)); } else if (Plugin.cfg.MODDEDENEMY && !Plugin.instance.VanillaBody.Contains(enemyName) && !Plugin.instance.BlackListed.Contains(enemyName)) { ((MonoBehaviour)__instance).StartCoroutine(MoveOldBody(__instance)); } if (Plugin.cfg.CONFETTI) { SpawnConfetti(__instance); } } } [IteratorStateMachine(typeof(<MoveOldBody>d__1))] private static IEnumerator MoveOldBody(EnemyAI __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <MoveOldBody>d__1(0) { __instance = __instance }; } private static void SpawnConfetti(EnemyAI __instance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)null) { Object.Instantiate<GameObject>(Plugin.ConfettiPrefab, ((Component)__instance).transform.position, Quaternion.Euler(0f, 0f, 0f)).SetActive(true); } else { Debug.LogError((object)"__instance is null in SpawnConfetti() inside KillEnemy()"); } } } [HarmonyPatch(typeof(EnemyAI))] internal class KillEnemyServerRpcPatcher { [CompilerGenerated] private sealed class <SpawnEE>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; public string name; public Vector3 propBodyPos; public Quaternion propBodyRot; private Vector3 <spawnPos>5__1; private Item[] <cartridges>5__2; private Item <picked>5__3; private GameObject <gameObjectCreated>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnEE>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <cartridges>5__2 = null; <picked>5__3 = null; <gameObjectCreated>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0022: 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_003b: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawnPos>5__1 = propBodyPos + new Vector3(0f, 1f, 0f); <>2__current = (object)new WaitForSeconds(Plugin.cfg.BODY_SPAWN_DELAY); <>1__state = 1; return true; case 1: <>1__state = -1; <cartridges>5__2 = (Item[])(object)new Item[3] { Plugin.instance.GameboyCartridgeURL, Plugin.instance.GameboyCartridgeRDA, Plugin.instance.GameboyCartridgeRITN }; <picked>5__3 = <cartridges>5__2[Random.Range(0, <cartridges>5__2.Length)]; <gameObjectCreated>5__4 = Object.Instantiate<GameObject>(<picked>5__3.spawnPrefab, <spawnPos>5__1, propBodyRot); <gameObjectCreated>5__4.GetComponent<NetworkObject>().Spawn(false); if (name == "Blob") { ((Component)__instance).GetComponent<NetworkObject>().Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SpawnGenericBody>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; public string name; public Vector3 propBodyPos; public Quaternion propBodyRot; private Vector3 <spawnPos>5__1; private GameObject <gameObjectCreated>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnGenericBody>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <gameObjectCreated>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0022: 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_003b: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0086: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawnPos>5__1 = propBodyPos + new Vector3(0f, 1f, 0f); <>2__current = (object)new WaitForSeconds(Plugin.cfg.BODY_SPAWN_DELAY); <>1__state = 1; return true; case 1: <>1__state = -1; <gameObjectCreated>5__2 = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns[name].spawnPrefab, <spawnPos>5__1, propBodyRot); <gameObjectCreated>5__2.GetComponent<NetworkObject>().Spawn(false); if (name == "Blob") { ((Component)__instance).GetComponent<NetworkObject>().Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SpawnMask>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; public Vector3 propBodyPos; public Quaternion propBodyRot; private MaskedPlayerEnemy <masked>5__1; private Item <maskToSpawn>5__2; private Vector3 <spawnPos>5__3; private GameObject <gameObjectCreated>5__4; private int <randomMask>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnMask>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <masked>5__1 = null; <maskToSpawn>5__2 = null; <gameObjectCreated>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <masked>5__1 = ((Component)__instance).GetComponent<MaskedPlayerEnemy>(); <maskToSpawn>5__2 = (<masked>5__1.maskTypes[0].activeSelf ? ItemsPatcher.comedyMask : ItemsPatcher.tragedyMask); if ((Object)(object)<maskToSpawn>5__2 != (Object)(object)ItemsPatcher.comedyMask && (Object)(object)<maskToSpawn>5__2 != (Object)(object)ItemsPatcher.tragedyMask) { <randomMask>5__5 = Random.Range(0, 2); if (<randomMask>5__5 == 0) { <maskToSpawn>5__2 = ItemsPatcher.tragedyMask; } else { <maskToSpawn>5__2 = ItemsPatcher.comedyMask; } } <spawnPos>5__3 = propBodyPos + new Vector3(0f, 2.5f, 0f); <gameObjectCreated>5__4 = Object.Instantiate<GameObject>(<maskToSpawn>5__2.spawnPrefab, <spawnPos>5__3, propBodyRot); <gameObjectCreated>5__4.GetComponent<NetworkObject>().Spawn(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(); } } [CompilerGenerated] private sealed class <SpawnModdedBody>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; public Vector3 propBodyPos; public Quaternion propBodyRot; private Vector3 <spawnPos>5__1; private GameObject <gameObjectCreated>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnModdedBody>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <gameObjectCreated>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0022: 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_003b: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawnPos>5__1 = propBodyPos + new Vector3(0f, 2f, 0f); <>2__current = (object)new WaitForSeconds(Plugin.cfg.BODY_SPAWN_DELAY); <>1__state = 1; return true; case 1: <>1__state = -1; if (((Component)__instance).GetComponent<EnemyAI>().enemyType.PowerLevel <= 1f) { <gameObjectCreated>5__2 = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns["ModdedEnemyPowerLevel1"].spawnPrefab, <spawnPos>5__1, propBodyRot); } else if (((Component)__instance).GetComponent<EnemyAI>().enemyType.PowerLevel == 2f) { <gameObjectCreated>5__2 = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns["ModdedEnemyPowerLevel2"].spawnPrefab, <spawnPos>5__1, propBodyRot); } else { <gameObjectCreated>5__2 = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns["ModdedEnemyPowerLevel3"].spawnPrefab, <spawnPos>5__1, propBodyRot); } <gameObjectCreated>5__2.GetComponent<NetworkObject>().Spawn(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(); } } [CompilerGenerated] private sealed class <SpawnNutcrackerBody>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI __instance; public string name; public Vector3 propBodyPos; public Quaternion propBodyRot; private Vector3 <spawnPos>5__1; private List<Item> <itemsList>5__2; private GameObject <gameObjectCreated>5__3; private List<Item>.Enumerator <>s__4; private Item <item>5__5; private string <itemName>5__6; private GameObject <shotgunItem>5__7; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnNutcrackerBody>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <itemsList>5__2 = null; <gameObjectCreated>5__3 = null; <>s__4 = default(List<Item>.Enumerator); <item>5__5 = null; <itemName>5__6 = null; <shotgunItem>5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawnPos>5__1 = propBodyPos + new Vector3(0f, 1f, 0f); publicShotgunPrice = ((GrabbableObject)((Component)__instance).GetComponent<NutcrackerEnemyAI>().gun).scrapValue; ((Component)((Component)__instance).GetComponent<NutcrackerEnemyAI>().gun).GetComponent<NetworkObject>().Despawn(true); <itemsList>5__2 = StartOfRound.Instance.allItemsList.itemsList; <>s__4 = <itemsList>5__2.GetEnumerator(); try { while (<>s__4.MoveNext()) { <item>5__5 = <>s__4.Current; <itemName>5__6 = <item>5__5.itemName; if (<itemName>5__6 == "Shotgun") { <shotgunItem>5__7 = Object.Instantiate<GameObject>(<item>5__5.spawnPrefab, <spawnPos>5__1, propBodyRot); <shotgunItem>5__7.GetComponent<NetworkObject>().Spawn(false); break; } <itemName>5__6 = null; <item>5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>s__4 = default(List<Item>.Enumerator); <>2__current = (object)new WaitForSeconds(Plugin.cfg.BODY_SPAWN_DELAY); <>1__state = 1; return true; case 1: <>1__state = -1; <gameObjectCreated>5__3 = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns[name].spawnPrefab, <spawnPos>5__1, propBodyRot); <gameObjectCreated>5__3.GetComponent<NetworkObject>().Spawn(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(); } } public static int publicShotgunPrice = 60; private static ulong currentEnemy = 9999999uL; [HarmonyPrefix] [HarmonyPatch("KillEnemyServerRpc")] private static void SpawnScrapBody(EnemyAI __instance) { //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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if (currentEnemy == ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId || !((NetworkBehaviour)__instance).IsHost || Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInChildren<PlayerControllerB>())) { return; } currentEnemy = ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId; string enemyName = __instance.enemyType.enemyName; Vector3 position = ((Component)__instance).transform.position; Quaternion rotation = ((Component)__instance).transform.rotation; if (Random.Range(0, 150) == 78) { ((MonoBehaviour)__instance).StartCoroutine(SpawnEE(__instance, enemyName, position, rotation)); } else if (Plugin.instance.BodySpawns.ContainsKey(enemyName)) { if (enemyName == "Nutcracker") { ((MonoBehaviour)__instance).StartCoroutine(SpawnNutcrackerBody(__instance, enemyName, position, rotation)); } else { ((MonoBehaviour)__instance).StartCoroutine(SpawnGenericBody(__instance, enemyName, position, rotation)); } } else if (enemyName == "Masked" && Plugin.cfg.MASKED) { ((MonoBehaviour)__instance).StartCoroutine(SpawnMask(__instance, position, rotation)); } else if (Plugin.cfg.MODDEDENEMY && !Plugin.instance.VanillaBody.Contains(enemyName) && !Plugin.instance.BlackListed.Contains(enemyName)) { ((MonoBehaviour)__instance).StartCoroutine(SpawnModdedBody(__instance, position, rotation)); } } [IteratorStateMachine(typeof(<SpawnGenericBody>d__3))] private static IEnumerator SpawnGenericBody(EnemyAI __instance, string name, Vector3 propBodyPos, Quaternion propBodyRot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnGenericBody>d__3(0) { __instance = __instance, name = name, propBodyPos = propBodyPos, propBodyRot = propBodyRot }; } [IteratorStateMachine(typeof(<SpawnNutcrackerBody>d__4))] private static IEnumerator SpawnNutcrackerBody(EnemyAI __instance, string name, Vector3 propBodyPos, Quaternion propBodyRot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnNutcrackerBody>d__4(0) { __instance = __instance, name = name, propBodyPos = propBodyPos, propBodyRot = propBodyRot }; } [IteratorStateMachine(typeof(<SpawnMask>d__5))] private static IEnumerator SpawnMask(EnemyAI __instance, Vector3 propBodyPos, Quaternion propBodyRot) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnMask>d__5(0) { __instance = __instance, propBodyPos = propBodyPos, propBodyRot = propBodyRot }; } [IteratorStateMachine(typeof(<SpawnModdedBody>d__6))] private static IEnumerator SpawnModdedBody(EnemyAI __instance, Vector3 propBodyPos, Quaternion propBodyRot) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnModdedBody>d__6(0) { __instance = __instance, propBodyPos = propBodyPos, propBodyRot = propBodyRot }; } [IteratorStateMachine(typeof(<SpawnEE>d__7))] private static IEnumerator SpawnEE(EnemyAI __instance, string name, Vector3 propBodyPos, Quaternion propBodyRot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnEE>d__7(0) { __instance = __instance, name = name, propBodyPos = propBodyPos, propBodyRot = propBodyRot }; } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class KillMaskedPatcher { [HarmonyPostfix] [HarmonyPatch("KillEnemy")] private static void DropMaskOnDeath(MaskedPlayerEnemy __instance) { if (!Plugin.cfg.MASKED || !((Object)(object)__instance != (Object)null)) { return; } try { if ((Object)(object)__instance.mimickingPlayer != (Object)null && __instance.mimickingPlayer.isPlayerDead) { DeadBodyInfo deadBody = __instance.mimickingPlayer.deadBody; ((Component)((Component)deadBody).transform.Find("spine.001/spine.002/spine.003/spine.004/HeadMask")).gameObject.SetActive(false); } ((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/spine.004/HeadMaskComedy")).gameObject.SetActive(false); ((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/spine.004/HeadMaskTragedy")).gameObject.SetActive(false); } catch { Debug.LogError((object)"Tried to remove mask from masked error"); } } } } namespace SellBodies.Monos { internal class BodySyncer : SyncScript { public override void OnNetworkSpawn() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); prop = (GrabbableObject)(object)((Component)this).GetComponent<PhysicsProp>(); Quaternion rotation = ((Component)this).transform.rotation; spawnRotation = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f); ((Component)this).transform.rotation = spawnRotation; if (!((NetworkBehaviour)this).IsHost && !((NetworkBehaviour)this).IsServer) { return; } int num = Random.Range(prop.itemProperties.minValue, prop.itemProperties.maxValue); int price; if (Plugin.cfg.MULTIPLIER) { float num2 = 1f; float num3 = 1f; float mULTIPLIER_VALUE = Plugin.cfg.MULTIPLIER_VALUE; if (Plugin.cfg.ENEMY_MULTIPLIER) { SelectableLevel currentLevel = StartOfRound.Instance.currentLevel; int num4 = currentLevel.maxEnemyPowerCount + currentLevel.maxOutsideEnemyPowerCount; num2 = 1f + (float)(num4 - 10) / 100f; } if (Plugin.cfg.VANILLA_MULTIPLIER) { float scrapValueMultiplier = RoundManager.Instance.scrapValueMultiplier; num3 = scrapValueMultiplier * 2.5f; } float num5 = num2 * num3 * mULTIPLIER_VALUE; price = (int)((float)num * num5); } else { price = num; } SyncDetailsClientRpc(price); Debug.Log((object)"End of OnNetworkSpawn body override"); } [ClientRpc] private void SyncDetailsClientRpc(int price) { //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(2771853362u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, price); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2771853362u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)prop != (Object)null) { prop.scrapValue = price; prop.itemProperties.creditsWorth = price; ((Component)prop).GetComponentInChildren<ScanNodeProperties>().subText = $"Value: ${price}"; Debug.Log((object)"Successfully synced body values"); } else { Debug.LogError((object)"Failed to resolve network reference!"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2771853362u, new RpcReceiveHandler(__rpc_handler_2771853362), "SyncDetailsClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2771853362(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 price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); target.__rpc_exec_stage = (__RpcExecStage)1; ((BodySyncer)(object)target).SyncDetailsClientRpc(price); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BodySyncer"; } } internal class MaskSyncer : SyncScript { public override void OnNetworkSpawn() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); prop = (GrabbableObject)(object)((Component)this).GetComponent<HauntedMaskItem>(); Quaternion rotation = ((Component)this).transform.rotation; spawnRotation = Quaternion.Euler(270f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f); ((Component)this).transform.rotation = spawnRotation; if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { int price = Random.Range(prop.itemProperties.minValue, prop.itemProperties.maxValue); SyncDetailsClientRpc(price); Debug.Log((object)"End of OnNetworkSpawn mask override"); } } [ClientRpc] private void SyncDetailsClientRpc(int price) { //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(2962681150u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, price); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2962681150u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)prop != (Object)null) { prop.scrapValue = price; prop.itemProperties.creditsWorth = price; ((Component)prop).GetComponentInChildren<ScanNodeProperties>().subText = $"Value: ${price}"; RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)price; Debug.Log((object)"Successfully synced mask values"); } else { Debug.LogError((object)"Failed to resolve network reference!"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2962681150u, new RpcReceiveHandler(__rpc_handler_2962681150), "SyncDetailsClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2962681150(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 price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); target.__rpc_exec_stage = (__RpcExecStage)1; ((MaskSyncer)(object)target).SyncDetailsClientRpc(price); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MaskSyncer"; } } internal class ShotgunSyncer : SyncScript { public override void OnNetworkSpawn() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); prop = (GrabbableObject)(object)((Component)this).GetComponent<ShotgunItem>(); Quaternion rotation = ((Component)this).transform.rotation; spawnRotation = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 90f); ((Component)this).transform.rotation = spawnRotation; if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { int price = 60; if (Plugin.cfg.SHOTGUN_PRICE && KillEnemyServerRpcPatcher.publicShotgunPrice != 0) { price = KillEnemyServerRpcPatcher.publicShotgunPrice; } int ammo = 2; SyncDetailsClientRpc(price, ammo); Debug.Log((object)"End of OnNetworkSpawn shotgun override"); } } [ClientRpc] private void SyncDetailsClientRpc(int price, int ammo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) 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(2037725870u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, price); BytePacker.WriteValueBitPacked(val2, ammo); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2037725870u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)prop != (Object)null) { ((Component)prop).GetComponent<ShotgunItem>().shellsLoaded = ammo; prop.scrapValue = price; prop.itemProperties.creditsWorth = price; ((Component)prop).GetComponentInChildren<ScanNodeProperties>().subText = $"Value: ${price}"; RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)price; Debug.Log((object)"Successfully synced shotgun values"); } else { Debug.LogError((object)"Failed to resolve network reference!"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2037725870u, new RpcReceiveHandler(__rpc_handler_2037725870), "SyncDetailsClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2037725870(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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); int ammo = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ammo); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShotgunSyncer)(object)target).SyncDetailsClientRpc(price, ammo); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ShotgunSyncer"; } } public abstract class SyncScript : NetworkBehaviour { public GrabbableObject prop; public bool justSpawned = true; public Quaternion spawnRotation; protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SyncScript"; } } } namespace CleaningCompany.Misc { public class PluginConfig { private readonly ConfigFile configFile; public bool SPIDER { get; set; } public bool THUMPER { get; set; } public bool NUTCRACKER { get; set; } public bool CENTIPEDE { get; set; } public bool HOARDER { get; set; } public bool BRACKEN { get; set; } public bool MOUTHDOG { get; set; } public bool BABOON { get; set; } public bool COILHEAD { get; set; } public bool GHOSTGIRL { get; set; } public bool FORESTKEEPER { get; set; } public bool JESTER { get; set; } public bool HYGRODORE { get; set; } public bool SPORELIZARD { get; set; } public bool MANTICOIL { get; set; } public bool RADMECH { get; set; } public bool TULIPSNAKE { get; set; } public bool CLAYSURGEON { get; set; } public bool BUSHWOLF { get; set; } public bool MANEATER { get; set; } public bool STINGRAY { get; set; } public bool CADAVER { get; set; } public bool PUMA { get; set; } public bool MASKED { get; set; } public bool MODDEDENEMY { get; set; } public bool SPIDER_TWOHANDED { get; set; } public bool THUMPER_TWOHANDED { get; set; } public bool NUTCRACKER_TWOHANDED { get; set; } public bool CENTIPEDE_TWOHANDED { get; set; } public bool HOARDER_TWOHANDED { get; set; } public bool BRACKEN_TWOHANDED { get; set; } public bool MOUTHDOG_TWOHANDED { get; set; } public bool BABOON_TWOHANDED { get; set; } public bool COILHEAD_TWOHANDED { get; set; } public bool GHOSTGIRL_TWOHANDED { get; set; } public bool FORESTKEEPER_TWOHANDED { get; set; } public bool JESTER_TWOHANDED { get; set; } public bool HYGRODORE_TWOHANDED { get; set; } public bool SPORELIZARD_TWOHANDED { get; set; } public bool MANTICOIL_TWOHANDED { get; set; } public bool RADMECH_TWOHANDED { get; set; } public bool TULIPSNAKE_TWOHANDED { get; set; } public bool CLAYSURGEON_TWOHANDED { get; set; } public bool BUSHWOLF_TWOHANDED { get; set; } public bool MANEATER_TWOHANDED { get; set; } public bool STINGRAY_TWOHANDED { get; set; } public bool CADAVER_TWOHANDED { get; set; } public bool PUMA_TWOHANDED { get; set; } public bool MODDEDENEMYPOWERLEVEL1_TWOHANDED { get; set; } public bool MODDEDENEMYPOWERLEVEL2_TWOHANDED { get; set; } public bool MODDEDENEMYPOWERLEVEL3_TWOHANDED { get; set; } public int SPIDER_MIN { get; set; } public int THUMPER_MIN { get; set; } public int NUTCRACKER_MIN { get; set; } public int CENTIPEDE_MIN { get; set; } public int HOARDER_MIN { get; set; } public int BRACKEN_MIN { get; set; } public int MOUTHDOG_MIN { get; set; } public int BABOON_MIN { get; set; } public int COILHEAD_MIN { get; set; } public int GHOSTGIRL_MIN { get; set; } public int FORESTKEEPER_MIN { get; set; } public int JESTER_MIN { get; set; } public int HYGRODORE_MIN { get; set; } public int SPORELIZARD_MIN { get; set; } public int MANTICOIL_MIN { get; set; } public int RADMECH_MIN { get; set; } public int TULIPSNAKE_MIN { get; set; } public int CLAYSURGEON_MIN { get; set; } public int BUSHWOLF_MIN { get; set; } public int MANEATER_MIN { get; set; } public int STINGRAY_MIN { get; set; } public int CADAVER_MIN { get; set; } public int PUMA_MIN { get; set; } public int MODDEDENEMYPOWERLEVEL1_MIN { get; set; } public int MODDEDENEMYPOWERLEVEL2_MIN { get; set; } public int MODDEDENEMYPOWERLEVEL3_MIN { get; set; } public int NUTCRACKER_MAX { get; set; } public int SPIDER_MAX { get; set; } public int THUMPER_MAX { get; set; } public int CENTIPEDE_MAX { get; set; } public int HOARDER_MAX { get; set; } public int BRACKEN_MAX { get; set; } public int MOUTHDOG_MAX { get; set; } public int BABOON_MAX { get; set; } public int COILHEAD_MAX { get; set; } public int GHOSTGIRL_MAX { get; set; } public int FORESTKEEPER_MAX { get; s