Decompiled source of Ganimedes v2.6.0
Ganimedes/Ganimedes.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using Ganimedes.Configuration; using Ganimedes.NetcodePatcher; using Ganimedes.Patches; using HarmonyLib; using LethalLib; using LethalLib.Modules; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Ganimedes")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Ganimedes")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9c26ac22-c3d0-4403-a753-4338b8909d96")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace Ganimedes { [Serializable] public class Config : SyncedInstance<Config> { public int routeCost; public float mp3Volume; public bool mp3CustomSongs; public bool mp3CustomSongsDirectory; public bool mp3DefaultSongsChanges; public bool mp3BoomboxVanilla; public bool mp3song1; public bool mp3song2; public bool mp3song3; public bool mp3song4; public bool mp3song5; public bool mp3song6; public bool mp3song7; public bool mp3song8; public bool mp3song9; public bool mp3song10; public Config(ConfigFile cfg) { InitInstance(this); routeCost = cfg.Bind<int>("General", "RouteCost", 2000, "Price to go to Ganimedes").Value; mp3Volume = (float)(cfg.Bind<double>("Mp3 player", "Volume", 70.0, "Change the volume of the Mp3 Player (0-100)").Value / 100.0); if (mp3Volume > 1f) { mp3Volume = 1f; } if (mp3Volume < 0f) { mp3Volume = 0f; } mp3CustomSongs = cfg.Bind<bool>("Mp3 player", "CustomSongs", true, "Enable it to search songs to add to the Mp3 player (the default folder is 'BepInEx\\Plugins\\Ganimedes\\CustomSongs')").Value; mp3CustomSongsDirectory = cfg.Bind<bool>("Mp3 player", "CustomSongsBoomboxDirectory", false, "Enable it to use the same directory that Custom Boombox Music for custom songs ('BepInEx\\Custom Songs\\Boombox Music')").Value; mp3DefaultSongsChanges = cfg.Bind<bool>("Mp3 player", "DefaultSongsChanges", true, "Enable it to eliminate the default songs marked as false").Value; mp3BoomboxVanilla = cfg.Bind<bool>("Mp3 player", "BoomboxVanilla", false, "Enable it to add the vanilla boombox music to the Mp3 player (automatically true if the mp3 player is empty)").Value; mp3song1 = cfg.Bind<bool>("Mp3 player", "Enable Super Battle Train - Waterflame song", true, "Desactivate it to eliminate 'Super Battle Train - Waterflame' song of the Mp3 player").Value; mp3song2 = cfg.Bind<bool>("Mp3 player", "Enable Payphone - Maroon 5 song", true, "Desactivate it to eliminate 'Payphone - Maroon 5' song of the Mp3 player").Value; mp3song3 = cfg.Bind<bool>("Mp3 player", "Enable Im good (Blue) - David Guetta, Bebe Rexha song", true, "Desactivate it to eliminate 'I'm good (Blue) - David Guetta, Bebe Rexha' song of the Mp3 player").Value; mp3song4 = cfg.Bind<bool>("Mp3 player", "Enable Pandoras Music Box - Nox Arcana song", true, "Desactivate it to eliminate 'Pandora's Music Box - Nox Arcana' song of the Mp3 player").Value; mp3song5 = cfg.Bind<bool>("Mp3 player", "Enable Lovumba - Daddy Yankee song", true, "Desactivate it to eliminate 'Lovumba - Daddy Yankee' song of the Mp3 player").Value; mp3song6 = cfg.Bind<bool>("Mp3 player", "Enable Splashing Around - The Green Orbs song", true, "Desactivate it to eliminate 'Splashing Around - The Green Orbs' song of the Mp3 player").Value; mp3song7 = cfg.Bind<bool>("Mp3 player", "Enable Rosas - La Oreja de Van Gogh song", true, "Desactivate it to eliminate 'Rosas - La Oreja de Van Gogh' song of the Mp3 player").Value; mp3song8 = cfg.Bind<bool>("Mp3 player", "Enable Hikaru Nara - Goose House song", true, "Desactivate it to eliminate 'Hikaru Nara - Goose House' song of the Mp3 player").Value; mp3song9 = cfg.Bind<bool>("Mp3 player", "Enable Quevedo - Bizarrap Music Sessions #52 song", true, "Desactivate it to eliminate 'Quevedo - Bizarrap Music Sessions #52' song of the Mp3 player").Value; mp3song10 = cfg.Bind<bool>("Mp3 player", "Enable Numb - Linkin Park song", true, "Desactivate it to eliminate 'Numb - Linkin Park' song of the Mp3 player").Value; } public static void RequestSync() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SyncedInstance<Config>.IsClient) { return; } FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(SyncedInstance<Config>.IntSize, (Allocator)2, -1); try { SyncedInstance<Config>.MessageManager.SendNamedMessage("Ganimedes_OnRequestConfigSync", 0uL, val, (NetworkDelivery)3); } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } public static void OnRequestSync(ulong clientId, FastBufferReader _) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!SyncedInstance<Config>.IsHost) { return; } Plugin.logger.LogInfo((object)$"Config sync request received from client: {clientId}"); byte[] array = SyncedInstance<Config>.SerializeToBytes(SyncedInstance<Config>.Instance); int num = array.Length; FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(num + SyncedInstance<Config>.IntSize, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0); SyncedInstance<Config>.MessageManager.SendNamedMessage("Ganimedes_OnReceiveConfigSync", clientId, val, (NetworkDelivery)3); } catch (Exception arg) { Plugin.logger.LogInfo((object)$"Error occurred syncing config with client: {clientId}\n{arg}"); } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } public static void OnReceiveSync(ulong _, FastBufferReader reader) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!((FastBufferReader)(ref reader)).TryBeginRead(SyncedInstance<Config>.IntSize)) { Plugin.logger.LogError((object)"Config sync error: Could not begin reading buffer."); return; } int num = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives)); if (!((FastBufferReader)(ref reader)).TryBeginRead(num)) { Plugin.logger.LogError((object)"Config sync error: Host could not sync."); return; } byte[] data = new byte[num]; ((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0); SyncedInstance<Config>.SyncInstance(data); Plugin.logger.LogInfo((object)"Successfully synced config with host."); } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] public static void InitializeLocalPlayer() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown if (SyncedInstance<Config>.IsHost) { SyncedInstance<Config>.MessageManager.RegisterNamedMessageHandler("Ganimedes_OnRequestConfigSync", new HandleNamedMessageDelegate(OnRequestSync)); SyncedInstance<Config>.Synced = true; } else { SyncedInstance<Config>.Synced = false; SyncedInstance<Config>.MessageManager.RegisterNamedMessageHandler("Ganimedes_OnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveSync)); RequestSync(); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")] public static void PlayerLeave() { SyncedInstance<Config>.RevertSync(); } } internal class PickableItem : GrabbableObject, IHittable { private GameObject objectInPresent; public ParticleSystem PoofParticle; public AudioSource presentAudio; public AudioClip openGiftAudio; public List<SpawnableItemWithRarity> spawnableItems; private PlayerControllerB previousPlayerHeldBy; private bool hasUsedGift; private int objectInPresentValue; public override void Start() { ((GrabbableObject)this).Start(); Random random = new Random(StartOfRound.Instance.randomMapSeed + (int)base.targetFloorPosition.x + (int)base.targetFloorPosition.y + (int)((NetworkBehaviour)this).NetworkObjectId); if (!((NetworkBehaviour)this).IsServer) { return; } int num = 0; for (int i = 0; i < spawnableItems.Count; i++) { num += spawnableItems[i].rarity; } int num2 = random.Next(1, num + 1); int num3 = 0; for (int j = 0; j < spawnableItems.Count; j++) { num3 += spawnableItems[j].rarity; if (num3 >= num2) { Item val = ((!spawnableItems[j].spawnableItem.itemName.Equals("Gold bar")) ? spawnableItems[j].spawnableItem : StartOfRound.Instance.allItemsList.itemsList.ElementAt(35)); objectInPresent = val.spawnPrefab; objectInPresentValue = (int)((float)random.Next(val.minValue, val.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier); break; } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; } [ServerRpc(RequireOwnership = false)] public void OpenGiftBoxServerRpc() { //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Invalid comparison between Unknown and I4 //IL_0104: 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) //IL_0113: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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(2018229708u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2018229708u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 == null || !networkManager2.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost)) { ServerRpcParams val3 = default(ServerRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(2878544999u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val4, 2878544999u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager2.IsServer && !networkManager2.IsHost)) { return; } GameObject val5 = null; int num = 0; Vector3 val6 = Vector3.zero; if ((Object)(object)objectInPresent == (Object)null) { Debug.LogError((object)"Error: There is no object in gift box!"); } else { Transform val7 = ((((!((Object)(object)base.playerHeldBy != (Object)null) || !base.playerHeldBy.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); val6 = ((Component)this).transform.position + Vector3.up * 0.25f; val5 = Object.Instantiate<GameObject>(objectInPresent, val6, Quaternion.identity, val7); GrabbableObject component = val5.GetComponent<GrabbableObject>(); component.startFallingPosition = val6; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component)); component.targetFloorPosition = component.GetItemFloorPosition(((Component)this).transform.position); if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, component); } num = objectInPresentValue; component.SetScrapValue(num); ((NetworkBehaviour)component).NetworkObject.Spawn(false); } if ((Object)(object)val5 != (Object)null) { OpenGiftBoxClientRpc(NetworkObjectReference.op_Implicit(val5.GetComponent<NetworkObject>()), num, val6); } OpenGiftBoxNoPresentClientRpc(); } private IEnumerator SetObjectToHitGroundSFX(GrabbableObject gObject) { yield return (object)new WaitForEndOfFrame(); Debug.Log((object)("Setting " + gObject.itemProperties.itemName + " hit ground to false")); gObject.reachedFloorTarget = false; gObject.hasHitGround = false; gObject.fallTime = 0f; } [ClientRpc] public void OpenGiftBoxNoPresentClientRpc() { //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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Invalid comparison between Unknown and I4 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_0100: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1094256915u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1094256915u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(3328558740u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 3328558740u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { PoofParticle.Play(); presentAudio.PlayOneShot(openGiftAudio); WalkieTalkie.TransmitOneShotAudio(presentAudio, openGiftAudio, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)presentAudio).transform.position, 8f, 0.5f, 0, base.isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); DestroyObject(); } } } [ClientRpc] public void OpenGiftBoxClientRpc(NetworkObjectReference netObjectRef, int presentValue, Vector3 startFallingPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Invalid comparison between Unknown and I4 //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0235: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(463077100u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, presentValue); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startFallingPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 463077100u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 == null || !networkManager2.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(1252354594u, val3, (RpcDelivery)0); ((FastBufferWriter)(ref val4)).WriteValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val4, presentValue); ((FastBufferWriter)(ref val4)).WriteValueSafe(ref startFallingPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1252354594u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { PoofParticle.Play(); presentAudio.PlayOneShot(openGiftAudio); WalkieTalkie.TransmitOneShotAudio(presentAudio, openGiftAudio, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)presentAudio).transform.position, 8f, 0.5f, 0, base.isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); DestroyObject(); if (!((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(waitForGiftPresentToSpawnOnClient(netObjectRef, presentValue, startFallingPos)); } } } private IEnumerator waitForGiftPresentToSpawnOnClient(NetworkObjectReference netObjectRef, int presentValue, Vector3 startFallingPos) { //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_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) NetworkObject netObject = null; float startTime = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - startTime < 8f && !((NetworkObjectReference)(ref netObjectRef)).TryGet(ref netObject, (NetworkManager)null)) { yield return (object)new WaitForSeconds(0.03f); } if ((Object)(object)netObject == (Object)null) { Debug.Log((object)"No network object found"); yield break; } yield return (object)new WaitForEndOfFrame(); GrabbableObject component = ((Component)netObject).GetComponent<GrabbableObject>(); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel -= (float)base.scrapValue; RoundManager instance2 = RoundManager.Instance; instance2.totalScrapValueInLevel += (float)component.scrapValue; component.SetScrapValue(presentValue); component.startFallingPosition = startFallingPos; component.fallTime = 0f; component.hasHitGround = false; component.reachedFloorTarget = false; if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, component); } if (!netObject.IsSpawned) { netObject.Spawn(false); } } public override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal string __getTypeName() { return "PickableItem"; } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (force > 1) { hasUsedGift = true; OpenGiftBoxServerRpc(); } return true; } public virtual void DestroyObject() { base.grabbable = false; base.grabbableToEnemies = false; base.deactivated = true; if ((Object)(object)base.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<MeshRenderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } Collider[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren<Collider>(); for (int j = 0; j < componentsInChildren2.Length; j++) { Object.Destroy((Object)(object)componentsInChildren2[j]); } } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PickableItem() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2018229708u, new RpcReceiveHandler(__rpc_handler_2018229708)); NetworkManager.__rpc_func_table.Add(1094256915u, new RpcReceiveHandler(__rpc_handler_1094256915)); NetworkManager.__rpc_func_table.Add(463077100u, new RpcReceiveHandler(__rpc_handler_463077100)); } private static void __rpc_handler_2018229708(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; ((PickableItem)(object)target).OpenGiftBoxServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1094256915(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)2; ((PickableItem)(object)target).OpenGiftBoxNoPresentClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_463077100(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); int presentValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref presentValue); Vector3 startFallingPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startFallingPos); target.__rpc_exec_stage = (__RpcExecStage)2; ((PickableItem)(object)target).OpenGiftBoxClientRpc(netObjectRef, presentValue, startFallingPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PickableItem"; } } internal class CustomGiftBoxItem : GrabbableObject { private GameObject objectInPresent; public ParticleSystem PoofParticle; public AudioSource presentAudio; public AudioClip openGiftAudio; public List<SpawnableItemWithRarity> spawnableItems; public InteractTrigger trigger; public DoorLock doorLock; private PlayerControllerB previousPlayerHeldBy; private bool hasUsedGift; private int objectInPresentValue; public override void Start() { ((GrabbableObject)this).Start(); Random random = new Random(StartOfRound.Instance.randomMapSeed + (int)base.targetFloorPosition.x + (int)base.targetFloorPosition.y + (int)((NetworkBehaviour)this).NetworkObjectId); if (!((NetworkBehaviour)this).IsServer) { return; } int num = 0; for (int i = 0; i < spawnableItems.Count; i++) { num += spawnableItems[i].rarity; } int num2 = random.Next(1, num + 1); int num3 = 0; for (int j = 0; j < spawnableItems.Count; j++) { num3 += spawnableItems[j].rarity; if (num3 >= num2) { Item val = ((!spawnableItems[j].spawnableItem.itemName.Equals("Gold bar")) ? spawnableItems[j].spawnableItem : StartOfRound.Instance.allItemsList.itemsList.ElementAt(35)); objectInPresent = val.spawnPrefab; objectInPresentValue = (int)((float)random.Next(val.minValue + 25, val.maxValue + 35) * RoundManager.Instance.scrapValueMultiplier); break; } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; } public override void ItemActivate(bool used, bool buttonDown = true) { if (Object.op_Implicit((Object)(object)doorLock)) { if (!doorLock.isLocked) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)base.playerHeldBy == (Object)null) && !hasUsedGift) { hasUsedGift = true; base.playerHeldBy.activatingItem = true; OpenGiftBoxServerRpc(); } } } else { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)base.playerHeldBy == (Object)null) && !hasUsedGift) { hasUsedGift = true; base.playerHeldBy.activatingItem = true; OpenGiftBoxServerRpc(); } } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); base.playerHeldBy.activatingItem = false; } [ServerRpc(RequireOwnership = false)] public void OpenGiftBoxServerRpc() { //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Invalid comparison between Unknown and I4 //IL_0104: 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) //IL_0113: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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(3074326675u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3074326675u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 == null || !networkManager2.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost)) { ServerRpcParams val3 = default(ServerRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(2878544999u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val4, 2878544999u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager2.IsServer && !networkManager2.IsHost)) { return; } GameObject val5 = null; int num = 0; Vector3 val6 = Vector3.zero; if ((Object)(object)objectInPresent == (Object)null) { Debug.LogError((object)"Error: There is no object in gift box!"); } else { Transform val7 = ((((!((Object)(object)base.playerHeldBy != (Object)null) || !base.playerHeldBy.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); val6 = ((Component)this).transform.position + Vector3.up * 0.25f; val5 = Object.Instantiate<GameObject>(objectInPresent, val6, Quaternion.identity, val7); GrabbableObject component = val5.GetComponent<GrabbableObject>(); component.startFallingPosition = val6; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component)); component.targetFloorPosition = component.GetItemFloorPosition(((Component)this).transform.position); if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, component); } num = objectInPresentValue; component.SetScrapValue(num); ((NetworkBehaviour)component).NetworkObject.Spawn(false); } if ((Object)(object)val5 != (Object)null) { OpenGiftBoxClientRpc(NetworkObjectReference.op_Implicit(val5.GetComponent<NetworkObject>()), num, val6); } OpenGiftBoxNoPresentClientRpc(); } private IEnumerator SetObjectToHitGroundSFX(GrabbableObject gObject) { yield return (object)new WaitForEndOfFrame(); Debug.Log((object)("Setting " + gObject.itemProperties.itemName + " hit ground to false")); gObject.reachedFloorTarget = false; gObject.hasHitGround = false; gObject.fallTime = 0f; } [ClientRpc] public void OpenGiftBoxNoPresentClientRpc() { //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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Invalid comparison between Unknown and I4 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_0100: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2409335217u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2409335217u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 == null || !networkManager2.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(3328558740u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 3328558740u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { PoofParticle.Play(); presentAudio.PlayOneShot(openGiftAudio); WalkieTalkie.TransmitOneShotAudio(presentAudio, openGiftAudio, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)presentAudio).transform.position, 8f, 0.5f, 0, base.isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy); } } } [ClientRpc] public void OpenGiftBoxClientRpc(NetworkObjectReference netObjectRef, int presentValue, Vector3 startFallingPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Invalid comparison between Unknown and I4 //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2346037595u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, presentValue); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startFallingPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2346037595u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 == null || !networkManager2.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(1252354594u, val3, (RpcDelivery)0); ((FastBufferWriter)(ref val4)).WriteValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val4, presentValue); ((FastBufferWriter)(ref val4)).WriteValueSafe(ref startFallingPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1252354594u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { PoofParticle.Play(); presentAudio.PlayOneShot(openGiftAudio); WalkieTalkie.TransmitOneShotAudio(presentAudio, openGiftAudio, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)presentAudio).transform.position, 8f, 0.5f, 0, base.isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy); } if (!((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(waitForGiftPresentToSpawnOnClient(netObjectRef, presentValue, startFallingPos)); } } } private IEnumerator waitForGiftPresentToSpawnOnClient(NetworkObjectReference netObjectRef, int presentValue, Vector3 startFallingPos) { //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_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) NetworkObject netObject = null; float startTime = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - startTime < 8f && !((NetworkObjectReference)(ref netObjectRef)).TryGet(ref netObject, (NetworkManager)null)) { yield return (object)new WaitForSeconds(0.03f); } if ((Object)(object)netObject == (Object)null) { Debug.Log((object)"No network object found"); yield break; } yield return (object)new WaitForEndOfFrame(); GrabbableObject component = ((Component)netObject).GetComponent<GrabbableObject>(); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel -= (float)base.scrapValue; RoundManager instance2 = RoundManager.Instance; instance2.totalScrapValueInLevel += (float)component.scrapValue; component.SetScrapValue(presentValue); component.startFallingPosition = startFallingPos; component.fallTime = 0f; component.hasHitGround = false; component.reachedFloorTarget = false; if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, component); } if (!netObject.IsSpawned) { netObject.Spawn(false); } } public override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal string __getTypeName() { return "CustomGiftBoxItem"; } public override void Update() { ((GrabbableObject)this).Update(); if (!Object.op_Implicit((Object)(object)doorLock) || !doorLock.isLocked) { return; } if (!doorLock.isPickingLock) { if (Object.op_Implicit((Object)(object)trigger)) { GrabbableObject currentlyHeldObjectServer = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer; KeyItem val = null; if ((Object)(object)base.playerHeldBy != (Object)null) { bool flag = (Object)(object)currentlyHeldObjectServer != (Object)null && ((Component)currentlyHeldObjectServer).TryGetComponent<KeyItem>(ref val); trigger.disabledHoverTip = (flag ? "Unlock chest : [ LMB ]" : "Locked"); return; } LockPicker val2 = null; bool flag2 = (Object)(object)currentlyHeldObjectServer != (Object)null && (((Component)currentlyHeldObjectServer).TryGetComponent<KeyItem>(ref val) || ((Component)currentlyHeldObjectServer).TryGetComponent<LockPicker>(ref val2)); trigger.disabledHoverTip = (flag2 ? "Unlock chest : [ LMB ]" : "Locked"); base.grabbable = true; base.grabbableToEnemies = true; } } else { if (doorLock.playersPickingDoor > 0) { doorLock.playerPickingLockProgress = Mathf.Clamp(doorLock.playerPickingLockProgress + (float)doorLock.playersPickingDoor * 0.85f * Time.deltaTime, 1f, 3.5f); } trigger.timeToHoldSpeedMultiplier = Mathf.Clamp((float)doorLock.playersPickingDoor * 0.85f, 1f, 3.5f); DoorLock obj = doorLock; obj.lockPickTimeLeft -= Time.deltaTime; trigger.disabledHoverTip = $"Picking lock: {(int)doorLock.lockPickTimeLeft} sec."; if (((NetworkBehaviour)this).IsServer && doorLock.lockPickTimeLeft < 0f) { UnlockChest(); UnlockChestServerRpc(); } } } public void UnlockChest() { doorLock.doorLockSFX.Stop(); doorLock.doorLockSFX.PlayOneShot(doorLock.unlockSFX); if (doorLock.isLocked) { ((Component)trigger).gameObject.SetActive(false); doorLock.isPickingLock = false; base.grabbable = true; base.grabbableToEnemies = true; doorLock.isLocked = false; Debug.Log((object)"Unlocking chest"); } } public void UnlockChestSyncWithServer() { if (doorLock.isLocked) { UnlockChest(); UnlockChestServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void UnlockChestServerRpc() { //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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_00f8: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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(1509870645u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1509870645u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost)) { ServerRpcParams val3 = default(ServerRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(184554516u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val4, 184554516u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost)) { UnlockChestClientRpc(); } } } [ClientRpc] public void UnlockChestClientRpc() { //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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_00f8: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3101790943u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3101790943u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(1778576778u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1778576778u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { UnlockChest(); } } } public void TryPickingLock() { if (doorLock.isLocked) { HUDManager.Instance.holdFillAmount = doorLock.playerPickingLockProgress; if (!doorLock.localPlayerPickingLock) { doorLock.localPlayerPickingLock = true; PlayerPickLockServerRpc(); } } } public void StopPickingLock() { if (doorLock.localPlayerPickingLock) { doorLock.localPlayerPickingLock = false; if (doorLock.playersPickingDoor == 1) { doorLock.playerPickingLockProgress = Mathf.Clamp(doorLock.playerPickingLockProgress - 1f, 0f, 45f); } PlayerStopPickingLockServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void PlayerStopPickingLockServerRpc() { //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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_00f8: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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(990236973u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 990236973u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost)) { ServerRpcParams val3 = default(ServerRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(3458026102u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val4, 3458026102u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost)) { PlayerStopPickingLockClientRpc(); } } } [ClientRpc] public void PlayerStopPickingLockClientRpc() { //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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Invalid comparison between Unknown and I4 //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2465752461u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2465752461u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(3319502281u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 3319502281u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { doorLock.doorLockSFX.Stop(); doorLock.playersPickingDoor = Mathf.Clamp(doorLock.playersPickingDoor - 1, 0, 4); } } } [ServerRpc(RequireOwnership = false)] public void PlayerPickLockServerRpc() { //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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_00f8: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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(2530714241u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2530714241u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost)) { ServerRpcParams val3 = default(ServerRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(2269869251u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val4, 2269869251u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost)) { PlayerPickLockClientRpc(); } } } [ClientRpc] public void PlayerPickLockClientRpc() { //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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Invalid comparison between Unknown and I4 //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(928987699u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 928987699u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager; if (networkManager2 != null && networkManager2.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(1721192172u, val3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1721192172u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost)) { doorLock.doorLockSFX.clip = doorLock.pickingLockSFX; doorLock.doorLockSFX.Play(); doorLock.playersPickingDoor = Mathf.Clamp(doorLock.playersPickingDoor + 1, 0, 4); } } } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_CustomGiftBoxItem() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3074326675u, new RpcReceiveHandler(__rpc_handler_3074326675)); NetworkManager.__rpc_func_table.Add(2409335217u, new RpcReceiveHandler(__rpc_handler_2409335217)); NetworkManager.__rpc_func_table.Add(2346037595u, new RpcReceiveHandler(__rpc_handler_2346037595)); NetworkManager.__rpc_func_table.Add(1509870645u, new RpcReceiveHandler(__rpc_handler_1509870645)); NetworkManager.__rpc_func_table.Add(3101790943u, new RpcReceiveHandler(__rpc_handler_3101790943)); NetworkManager.__rpc_func_table.Add(990236973u, new RpcReceiveHandler(__rpc_handler_990236973)); NetworkManager.__rpc_func_table.Add(2465752461u, new RpcReceiveHandler(__rpc_handler_2465752461)); NetworkManager.__rpc_func_table.Add(2530714241u, new RpcReceiveHandler(__rpc_handler_2530714241)); NetworkManager.__rpc_func_table.Add(928987699u, new RpcReceiveHandler(__rpc_handler_928987699)); } private static void __rpc_handler_3074326675(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; ((CustomGiftBoxItem)(object)target).OpenGiftBoxServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2409335217(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)2; ((CustomGiftBoxItem)(object)target).OpenGiftBoxNoPresentClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2346037595(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable)); int presentValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref presentValue); Vector3 startFallingPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startFallingPos); target.__rpc_exec_stage = (__RpcExecStage)2; ((CustomGiftBoxItem)(object)target).OpenGiftBoxClientRpc(netObjectRef, presentValue, startFallingPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1509870645(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; ((CustomGiftBoxItem)(object)target).UnlockChestServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3101790943(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)2; ((CustomGiftBoxItem)(object)target).UnlockChestClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_990236973(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; ((CustomGiftBoxItem)(object)target).PlayerStopPickingLockServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2465752461(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)2; ((CustomGiftBoxItem)(object)target).PlayerStopPickingLockClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2530714241(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; ((CustomGiftBoxItem)(object)target).PlayerPickLockServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_928987699(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)2; ((CustomGiftBoxItem)(object)target).PlayerPickLockClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CustomGiftBoxItem"; } } [BepInPlugin("Boniato.Ganimedes", "Ganimedes", "2.6.0")] public class GanimedesBase : BaseUnityPlugin { private const string modGUID = "Boniato.Ganimedes"; private const string modName = "Ganimedes"; private const string modVersion = "2.6.0"; private readonly Harmony harmony = new Harmony("Boniato.Ganimedes"); internal static GanimedesBase instance; internal static ManualLogSource mls; public static Config cfg { get; internal set; } private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } mls = Logger.CreateLogSource("Boniato.Ganimedes"); 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); } } } cfg = new Config(((BaseUnityPlugin)this).Config); harmony.PatchAll(typeof(Config)); harmony.PatchAll(typeof(RouteCostPatch)); harmony.PatchAll(typeof(BoomboxPatches)); harmony.PatchAll(typeof(LockPickerPatch)); harmony.PatchAll(typeof(DoorLockPatch)); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ganimedesscrap"); AssetBundle val = AssetBundle.LoadFromFile(text); List<Item> list = new List<Item> { val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/bronzebar/BronzeBar.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/silverbar/SilverBar.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/sapphire/Sapphire.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/emerald/Emerald.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/ruby/Ruby.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/diamond/Diamond.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/ganimediteore/GanimediteOre.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/ganimedite/Ganimedite.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/ganimedite/PureGanimedite.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/pickaxe/Pickaxe.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/chest/Chest.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/greatchest/GreatChest.asset"), val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/cursedgoldbar/CursedGoldBar.asset") }; Item val2 = val.LoadAsset<Item>("Assets/Scenes/Ganimedes/items/scraps/mp3/MP3.asset"); GameObject spawnPrefab = val2.spawnPrefab; Utilities.FixMixerGroups(spawnPrefab); spawnPrefab.GetComponent<AudioSource>().volume = cfg.mp3Volume; List<AudioClip> list2 = new List<AudioClip>(); if (cfg.mp3CustomSongs) { CustomSongs(list2); } AudioClip[] musicAudios = spawnPrefab.GetComponent<BoomboxItem>().musicAudios; if (cfg.mp3DefaultSongsChanges) { if (cfg.mp3song1) { list2.Add(musicAudios[0]); } if (cfg.mp3song2) { list2.Add(musicAudios[1]); } if (cfg.mp3song3) { list2.Add(musicAudios[2]); } if (cfg.mp3song4) { list2.Add(musicAudios[3]); } if (cfg.mp3song5) { list2.Add(musicAudios[4]); } if (cfg.mp3song6) { list2.Add(musicAudios[5]); } if (cfg.mp3song7) { list2.Add(musicAudios[6]); } if (cfg.mp3song8) { list2.Add(musicAudios[7]); } if (cfg.mp3song9) { list2.Add(musicAudios[8]); } if (cfg.mp3song10) { list2.Add(musicAudios[9]); } } else { for (int k = 0; k < musicAudios.Count(); k++) { list2.Add(musicAudios[k]); } } if (list2.Count == 0 || cfg.mp3BoomboxVanilla) { list2.Add(val.LoadAsset<AudioClip>("Assets/Scenes/Ganimedes/items/scraps/mp3/boomboxmusic/BoomboxMusic1.ogg")); list2.Add(val.LoadAsset<AudioClip>("Assets/Scenes/Ganimedes/items/scraps/mp3/boomboxmusic/BoomboxMusic2.ogg")); list2.Add(val.LoadAsset<AudioClip>("Assets/Scenes/Ganimedes/items/scraps/mp3/boomboxmusic/BoomboxMusic3.ogg")); list2.Add(val.LoadAsset<AudioClip>("Assets/Scenes/Ganimedes/items/scraps/mp3/boomboxmusic/BoomboxMusic4.ogg")); list2.Add(val.LoadAsset<AudioClip>("Assets/Scenes/Ganimedes/items/scraps/mp3/boomboxmusic/BoomboxMusic5Zedfox.ogg")); } spawnPrefab.GetComponent<BoomboxItem>().musicAudios = list2.ToArray(); NetworkPrefabs.RegisterNetworkPrefab(spawnPrefab); Items.RegisterScrap(val2, 0, (LevelTypes)1); foreach (Item item in list) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab); Utilities.FixMixerGroups(item.spawnPrefab); Items.RegisterScrap(item, 0, (LevelTypes)1); } mls.LogInfo((object)"------- Ganimedes plugin loaded -------"); } public static void CustomSongs(List<AudioClip> songsList) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) string text = (cfg.mp3CustomSongsDirectory ? Path.Combine(Paths.BepInExRootPath, "Custom Songs", "Boombox Music") : Path.Combine(Paths.BepInExRootPath, "plugins", "Ganimedes", "CustomSongs")); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); mls.LogInfo((object)("Created directory at " + text)); } string[] files = Directory.GetFiles(text); if (files.Length == 0) { mls.LogWarning((object)"No songs found"); return; } for (int i = 0; i < files.Length; i++) { AudioType audioType = GetAudioType(files[i]); if ((int)audioType > 0) { UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(files[i], audioType); audioClip.SendWebRequest(); while (!audioClip.isDone && audioClip.error == null) { Thread.Sleep(50); } if (audioClip.error != null) { mls.LogWarning((object)("Error loading song: " + text)); } else { songsList.Add(DownloadHandlerAudioClip.GetContent(audioClip)); } } } } public static AudioType GetAudioType(string path) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) string text = Path.GetExtension(path).ToLower(); switch (text) { case ".wav": return (AudioType)20; case ".ogg": return (AudioType)14; case ".mp3": return (AudioType)13; default: mls.LogError((object)("Error loading song. Unsupported extension type: " + text)); return (AudioType)0; } } } [Serializable] public class SyncedInstance<T> { [NonSerialized] protected static int IntSize = 4; internal static CustomMessagingManager MessageManager => NetworkManager.Singleton.CustomMessagingManager; internal static bool IsClient => NetworkManager.Singleton.IsClient; internal static bool IsHost => NetworkManager.Singleton.IsHost; public static T Default { get; private set; } public static T Instance { get; private set; } public static bool Synced { get; internal set; } protected void InitInstance(T instance) { Default = instance; Instance = instance; IntSize = 4; } internal static void SyncInstance(byte[] data) { Instance = DeserializeFromBytes(data); Synced = true; } internal static void RevertSync() { Instance = Default; Synced = false; } public static byte[] SerializeToBytes(T val) { BinaryFormatter binaryFormatter = new BinaryFormatter(); using MemoryStream memoryStream = new MemoryStream(); try { binaryFormatter.Serialize(memoryStream, val); return memoryStream.ToArray(); } catch (Exception arg) { Plugin.logger.LogError((object)$"Error serializing instance: {arg}"); return null; } } public static T DeserializeFromBytes(byte[] data) { BinaryFormatter binaryFormatter = new BinaryFormatter(); using MemoryStream serializationStream = new MemoryStream(data); try { return (T)binaryFormatter.Deserialize(serializationStream); } catch (Exception arg) { Plugin.logger.LogError((object)$"Error deserializing instance: {arg}"); return default(T); } } } } namespace Ganimedes.Patches { [HarmonyPatch] public class BoomboxPatches { private static Dictionary<BoomboxItem, bool> seedSyncDictionary = new Dictionary<BoomboxItem, bool>(); private static FieldInfo playersManagerField = AccessTools.Field(typeof(BoomboxItem), "playersManager"); [HarmonyPatch(typeof(BoomboxItem), "StartMusic")] [HarmonyPrefix] public static void StartMusicPatch(BoomboxItem __instance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown StartOfRound val = (StartOfRound)playersManagerField.GetValue(__instance); if ((!seedSyncDictionary.TryGetValue(__instance, out var value) || !value) && val != null && val.randomMapSeed > 0) { int seed = val.randomMapSeed - 10; __instance.musicRandomizer = new Random(seed); seedSyncDictionary[__instance] = true; } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyPrefix] public static void OnPlayerConnectedPatch(StartOfRound __instance) { forceReinitialize(seedSyncDictionary); } [HarmonyPatch(typeof(StartOfRound), "openingDoorsSequence")] [HarmonyPrefix] public static void openingDoorsSequencePatch(StartOfRound __instance) { forceReinitialize(seedSyncDictionary); } private static void forceReinitialize(Dictionary<BoomboxItem, bool> seedSyncDictionary) { foreach (BoomboxItem item in seedSyncDictionary.Keys.ToList()) { seedSyncDictionary[item] = false; } } } [HarmonyPatch(typeof(DoorLock))] internal class DoorLockPatch { [HarmonyPatch("Update")] [HarmonyPrefix] public static bool UpdatePatched(DoorLock __instance) { CustomGiftBoxItem componentInParent = ((Component)__instance).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if ((Object)(object)componentInParent != (Object)null) { return false; } return true; } [HarmonyPatch("UnlockDoorSyncWithServer")] [HarmonyPrefix] public static bool UnlockDoorSyncWithServerPatched(DoorLock __instance) { CustomGiftBoxItem componentInParent = ((Component)__instance).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if ((Object)(object)componentInParent != (Object)null) { componentInParent.UnlockChestSyncWithServer(); return false; } return true; } [HarmonyPatch("LockDoor")] [HarmonyPrefix] public static bool LockDoorPatched(DoorLock __instance) { CustomGiftBoxItem componentInParent = ((Component)__instance).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if ((Object)(object)componentInParent != (Object)null) { return false; } return true; } } [HarmonyPatch(typeof(LockPicker))] internal class LockPickerPatch { [HarmonyPatch("ItemActivate")] [HarmonyPrefix] public static bool ItemActivatePatched(LockPicker __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) //IL_0031: 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) __instance.ray = new Ray(((Component)((GrabbableObject)__instance).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)__instance).playerHeldBy.gameplayCamera).transform.forward); if (Physics.Raycast(__instance.ray, ref __instance.hit, 3f, 2816)) { DoorLock component = ((Component)((RaycastHit)(ref __instance.hit)).transform).GetComponent<DoorLock>(); CustomGiftBoxItem componentInParent = ((Component)component).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)((GrabbableObject)componentInParent).playerHeldBy)) { return false; } } return true; } [HarmonyPatch("GetLockPickerDoorPosition")] [HarmonyPrefix] public static bool GetLockPickerDoorPositionPatched(ref Vector3 __result, DoorLock doorScript, LockPicker __instance) { //IL_0027: 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) CustomGiftBoxItem componentInParent = ((Component)doorScript).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if ((Object)(object)componentInParent != (Object)null) { __instance.placeOnLockPicker1 = true; __result = doorScript.lockPickerPosition.localPosition; return false; } return true; } [HarmonyPatch("PlaceOnDoor")] [HarmonyPrefix] public static bool PlaceOnDoorPatched(DoorLock doorScript, LockPicker __instance) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!__instance.isOnDoor) { CustomGiftBoxItem componentInParent = ((Component)doorScript).gameObject.GetComponentInParent<CustomGiftBoxItem>(); if (Object.op_Implicit((Object)(object)componentInParent)) { ((GrabbableObject)componentInParent).grabbable = false; ((GrabbableObject)componentInParent).grabbableToEnemies = false; ((Component)__instance).transform.localScale = componentInParent.doorLock.lockPickerPosition.localScale; } } return true; } } } namespace Ganimedes.Custom { internal class CursedItem : GrabbableObject { private bool spawned = false; private NetworkManager networkManager; public override void Start() { ((GrabbableObject)this).Start(); networkManager = ((NetworkBehaviour)this).NetworkManager; } public override void Update() { ((GrabbableObject)this).Update(); if (!((Object)(object)base.playerHeldBy != (Object)null) || spawned) { return; } spawned = true; if (base.playerHeldBy.isInsideFactory) { if (networkManager.IsServer || networkManager.IsHost) { spawnDressGirl(); } else if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)this).StartCoroutine(HauntClient()); } } } private void spawnDressGirl() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) DressGirlAI val = RoundManager.Instance.SpawnedEnemies.OfType<DressGirlAI>().FirstOrDefault(); if ((Object)(object)val == (Object)null) { int num = -1; List<SpawnableEnemyWithRarity> enemies = StartOfRound.Instance.currentLevel.Enemies; for (int i = 0; i < enemies.Count; i++) { if (enemies[i].enemyType.enemyName == "Girl") { num = i; break; } } RoundManager.Instance.SpawnEnemyOnServer(((Component)this).transform.position, 0f, num); } ((MonoBehaviour)this).StartCoroutine(HauntPlayer()); } private IEnumerator HauntPlayer() { yield return (object)new WaitForSeconds(0.1f); DressGirlAI dressGirl = RoundManager.Instance.SpawnedEnemies.OfType<DressGirlAI>().FirstOrDefault(); if ((Object)(object)dressGirl != (Object)null) { dressGirl.hauntingPlayer = base.playerHeldBy; ((EnemyAI)dressGirl).ChangeOwnershipOfEnemy(dressGirl.hauntingPlayer.actualClientId); dressGirl.hauntingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)dressGirl.hauntingPlayer; if (dressGirl.switchHauntedPlayerCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dressGirl.switchHauntedPlayerCoroutine); } dressGirl.switchHauntedPlayerCoroutine = ((MonoBehaviour)this).StartCoroutine(dressGirl.setSwitchingHauntingPlayer()); if (dressGirl.hauntingLocalPlayer) { HauntClient(); } } } private IEnumerator HauntClient() { yield return (object)new WaitForSeconds(0.2f); DressGirlAI dressGirl = RoundManager.Instance.SpawnedEnemies.OfType<DressGirlAI>().FirstOrDefault(); if ((Object)(object)dressGirl != (Object)null) { dressGirl.timesStared = 3; dressGirl.TryFindingHauntPosition(true, true); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "CursedItem"; } } internal class OutsideScrapManager : NetworkBehaviour { public List<OutsideScrapSpawn> spawns; public int MIN_NUM_OF_SCRAPS; public int MAX_NUM_OF_SCRAPS; private void Start() { if (((NetworkBehaviour)this).NetworkManager.IsHost || ((NetworkBehaviour)this).NetworkManager.IsServer) { selectSpawns(); } } public void selectSpawns() { Random random = new Random(StartOfRound.Instance.randomMapSeed); ArrayList arrayList = new ArrayList(); for (int i = 0; i < random.Next(MIN_NUM_OF_SCRAPS, MAX_NUM_OF_SCRAPS + 1); i++) { int num = random.Next(0, spawns.Count); while (arrayList.Contains(num)) { num = random.Next(0, spawns.Count); } arrayList.Add(num); spawns[num].spawnSyncWithServer(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "OutsideScrapManager"; } } internal class OutsideScrapSpawn : NetworkBehaviour { public List<SpawnableItemWithRarity> spawnableItems; private Random random; private int value; private Vector3 vector; private NetworkObject ItemNet; public void Start() { NetworkObject component = ((Component)this).GetComponent<NetworkObject>(); if (!component.IsSpawned) { component.Spawn(false); } } private void spawn() { //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09b0: Unknown result type (might be due to invalid IL or missing references) //IL_09d1: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) random = new Random(StartOfRound.Instance.randomMapSeed + (int)((NetworkBehaviour)this).NetworkObjectId); int num = 0; for (int i = 0; i < spawnableItems.Count; i++) { num += spawnableItems[i].rarity; } int num2 = random.Next(1, num + 1); int num3 = 0; for (int j = 0; j < spawnableItems.Count; j++) { num3 += spawnableItems[j].rarity; if (num3 >= num2) { bool flag = false; bool flag2 = true; Item val; switch (spawnableItems[j].spawnableItem.itemName) { case "Homemade flashbang": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(61); break; case "Gold bar": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(35); break; case "Gift": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(62); break; case "Rubber Ducky": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(48); break; case "Pill bottle": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(44); break; case "Mug": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(40); break; case "Plastic fish": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(33); break; case "Jar of pickles": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(43); break; case "Laser pointer": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(34); break; case "Magnifying glass": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(37); break; case "Airhorn": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(16); break; case "Painting": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(32); break; case "Cash register": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(22); break; case "Jetpack": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(3); break; case "Key": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(4); flag = true; flag2 = false; break; case "Pro-flashlight": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(8); flag2 = false; break; case "Kitchen knife": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(67); break; case "Ammo": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(59); break; case "Shotgun": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(58); break; case "Shovel": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(9); flag2 = false; break; case "TZP-Inhalant": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(12); flag2 = false; break; case "Zap gun": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(14); flag2 = false; break; case "Extension ladder": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(11); flag2 = false; break; case "Radar-booster": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(56); flag2 = false; break; case "Easter egg": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(68); break; case "Perfume bottle": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(41); break; case "Red soda": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(49); break; case "Spray paint": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(60); flag2 = false; break; case "Toy train": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(76); break; case "Soccer ball": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(70); break; case "Toilet paper": val = StartOfRound.Instance.allItemsList.itemsList.ElementAt(74); break; default: val = spawnableItems[j].spawnableItem; break; } GameObject spawnPrefab = val.spawnPrefab; if (flag) { value = 3; } else { value = (int)((float)random.Next(val.minValue + 25, val.maxValue + 35) * RoundManager.Instance.scrapValueMultiplier); } Transform val2 = ((!flag2) ? RoundManager.Instance.playersManager.propsContainer : RoundManager.Instance.spawnedScrapContainer); vector = ((Component)this).transform.position; GameObject val3 = Object.Instantiate<GameObject>(spawnPrefab, vector, Quaternion.identity, val2); GrabbableObject component = val3.GetComponent<GrabbableObject>(); ((Component)component).transform.position = component.GetItemFloorPosition(vector); component.SetScrapValue(value); ItemNet = ((NetworkBehaviour)component).NetworkObject; ItemNet.Spawn(false); break; } } }