using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using STSharedAudioLib; using Steamworks; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] public class BowlingBombProp : GrabbableObject, IHittable { private static ManualLogSource Logger; public AudioClip explodeSFX; bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit == (Object)(object)StartOfRound.Instance.localPlayerController) || ((Object)(object)playerWhoHit == (Object)null && ((NetworkBehaviour)this).IsOwner)) { Logger.LogDebug((object)$"IHittable.Hit() called on {this} #{((NetworkBehaviour)this).NetworkObjectId} by {GameNetworkManager.Instance.localPlayerController}"); DestroyBombLocal(); DestroyBombServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } return true; } [ServerRpc(RequireOwnership = false)] private void DestroyBombServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4117872948u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4117872948u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyBombClientRpc(playerID); } } } [ClientRpc] private void DestroyBombClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1666011554u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1666011554u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { DestroyBombLocal(); } } } private void DestroyBombLocal() { //IL_0026: 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) Logger.LogDebug((object)$"DestroyBombLocal(): {this} #{((NetworkBehaviour)this).NetworkObjectId}"); Landmine.SpawnExplosion(((Component)this).transform.position, (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null, 3f, 6f, 25, 4f, (GameObject)null, false); CrashBandicootCratesManagerScript.PlayNoiseAtLocation(((Component)this).transform.position, explodeSFX, audibleNoise: true, 25f, 1f); CrashBandicootCratesManagerScript.DestroyItem((GrabbableObject)(object)this); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4117872948u, new RpcReceiveHandler(__rpc_handler_4117872948), "DestroyBombServerRpc"); ((NetworkBehaviour)this).__registerRpc(1666011554u, new RpcReceiveHandler(__rpc_handler_1666011554), "DestroyBombClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4117872948(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BowlingBombProp)(object)target).DestroyBombServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1666011554(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BowlingBombProp)(object)target).DestroyBombClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BowlingBombProp"; } } public class ColorGemProp : GrabbableObject, IInventoryMergeable { private static ManualLogSource Logger; public AudioSource audioSource; public AudioClip mergeSFX; public Material[] gemMaterials; public override void Start() { ((GrabbableObject)this).Start(); SetRandomGemMaterial(); } private void SetRandomGemMaterial() { if (!((Object)(object)base.mainObjectRenderer == (Object)null)) { ((Renderer)base.mainObjectRenderer).material = gemMaterials[new Random(CrashBandicootCratesManagerScript.GetRandomSeed(2025125)).Next(0, gemMaterials.Length)]; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (((NetworkBehaviour)this).IsOwner) { CrashBandicootCratesManagerScript.MergeItem((GrabbableObject)(object)this, removeDestroyedScrapValue: true, muteDestroyedItem: false); } } bool IInventoryMergeable.CanOtherMergeWithThis(GrabbableObject itemRequestingMerge) { return false; } GrabbableObject IInventoryMergeable.GetMergeItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { if (mergeWith.scrapValue > base.scrapValue) { return itemRequestingMerge; } return mergeWith; } GrabbableObject IInventoryMergeable.GetMergeItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { if (mergeWith.scrapValue > base.scrapValue) { return mergeWith; } return itemRequestingMerge; } bool IInventoryMergeable.CanThisMergeWithOther(GrabbableObject mergeWith) { if ((Object)(object)mergeWith == (Object)null || (Object)(object)mergeWith.itemProperties == (Object)null) { return false; } if ((Object)(object)mergeWith.itemProperties == (Object)(object)base.itemProperties) { return true; } return false; } void IInventoryMergeable.MergeWithOther(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot) { if (!((Object)(object)mergeWith == (Object)null) && !((Object)(object)mergeWith.itemProperties != (Object)(object)base.itemProperties)) { ColorGemProp component = ((Component)mergeWith).GetComponent(); if (!((Object)(object)component == (Object)null)) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} executing merge code with {component} #{((NetworkBehaviour)component).NetworkObjectId}"); OnMergeWithGem(component); } } } private void OnMergeWithGem(ColorGemProp other) { int num = 1; if ((Object)(object)other != (Object)null && ((GrabbableObject)other).scrapValue > 20) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)$"scrapValue = {base.scrapValue} && other.scrapValue = {((GrabbableObject)other).scrapValue}"); } int num2 = 0; int num3 = ((GrabbableObject)other).scrapValue; while (num3 > 20) { num3 /= 2; num2++; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"dividedValue: {num3} // stackOf: {num2}"); } } Logger.LogDebug((object)$"scrapValue = {((GrabbableObject)other).scrapValue} translated to stackOf = {num2}"); num = num2; } int num4 = 0; while (num4 < num) { ((GrabbableObject)this).SetScrapValue(base.scrapValue *= 2); num4++; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"timesMultiplied: {num4} // scrapValue: {base.scrapValue}"); } } Logger.LogDebug((object)$"set own value to {base.scrapValue}"); CrashBandicootCratesManagerScript.PlayNoise(audioSource, mergeSFX, audibleNoise: true, 5f, 0.25f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ColorGemProp"; } } public class CrateGrabbableObject : GrabbableObject, IHittable { private static ManualLogSource Logger; [Space(3f)] [Header("LCCrashBandicootCratesMod")] [Tooltip("The static data every instance of this crate determines its data from at runtime.")] public CrateData crateData; [Space(3f)] [Header("Audiovisual")] [Tooltip("The main AudioSource that all AudioClips from this crate get played from.")] public AudioSource audioSource; private float noiseTimer; private int nextRandomSpecialSFX; [Space] [Tooltip("Particles that are played upon destroying this crate.")] public ParticleSystem particlesBreak; [Tooltip("The static color the particlesBreak will have.\nIf left empty, will automatically use the default crate-breaking particles.")] public Color particlesBreakColor = Color.white; [Tooltip("Particles that are played on walking into, bouncing off of, attacking, or on destroying this crate, based on the particlesPlayBy booleans in this crate's crateData.")] public ParticleSystem particlesSpecial; [Tooltip("The static color the particlesSpecial will have.")] public Color particlesSpecialColor = Color.white; [Space(3f)] [Header("Colliders")] [Tooltip("Whether this crate's collider will block player movement and some sounds and enemy vision.")] public bool collideWithCrate = true; [Tooltip("A value to override collideWithCrate at runtime to enable or disable collisions that block player movement.\nIf empty, this value will be ignored. If \"true\" or as long as this value starts with \"t\", collision will be enabled. If not empty but also not starting with \"t\", collision will be disabled.")] public string collideOverrideCrate; [Tooltip("A value to override at runtime whether to enable or disable the check that lets players bounce off this crate.\nIf empty, this value will be ignored. If \"true\" or as long as this value starts with \"t\", bouncing will be enabled. If not empty but also not starting with \"t\", bouncing will be disabled.")] public string collideOverrideBounce; [Tooltip("The Collider that blocks player movement that's affected by collideWithCrate and collideOverrideCrate.")] public BoxCollider colliderCrate; [Tooltip("Blocks enemy movement if colliderCrate blocks player movement as well.")] public NavMeshObstacle colliderEnemies; [Tooltip("The Collider that checks whether players are bouncing off of this crate.")] public BoxCollider colliderBounce; [Tooltip("The top of the crate that players need to be above to bounce off this crate, and where to spawn items from.")] public Transform topOfCrate; private Coroutine checkDistanceCoroutine; [Space(3f)] [Header("Interactions")] [Tooltip("How strong players bounce off this crate, and how strong it will try to bounce other crates off of itself.")] public float bounceForce = 20f; private bool bouncedOffCrate; private float bounceCeiling = -1f; [Space] [Tooltip("A sort of HP for this crate that determines how many hits it has taken so far by being walked into, jumped off of, and attacked.\nUpdated by this crate's own changeSpecialIntPer integers.")] public int specialInt; [Tooltip("This crate will be destroyed if this is not -1 and specialInt has met or surpassed this number.")] public int destroyUponSpecialInt = 1; [HideInInspector] public bool destroyed; [Space] [Tooltip("If true, adds the specified interaction's changeSpecialInt to specialInt.\nIf false, snaps specialInt to whatever changeSpecialInt is set to for that interaction.")] public bool changeSpecialIntAddOrSnap = true; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time walking into the crate.\nIf addOrSnap is true and this is 0, or false and this is -99, walking into this crate will not change specialInt.")] public int changeSpecialIntPerWalkInto; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time the crate is bounced off of.\nIf addOrSnap is true and this is 0, or false and this is -99, bouncing off of this crate will not change specialInt.")] public int changeSpecialIntPerJumpOnto = 1; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time the crate is attacked.\nIf addOrSnap is true and this is 0, or false and this is -99, attacking this crate will not change specialInt.")] public int changeSpecialIntPerAttack = 99; [Space(3f)] [Header("Events")] [Tooltip("Custom events to call on Start(), for example if this crate has special functionality that should determine the rest of its lifetime.")] public InteractEvent invokeEventOnStart; [Tooltip("Custom events to call when this crate is walked into, for example if the player who walks into this crate's collision is affected.")] public InteractEvent invokeEventByWalkingInto; [Tooltip("Custom events to call when this crate is bounced off of, for example if this crate affects the player who bounced off of it.")] public InteractEvent invokeEventByJumpingOnto; [Tooltip("Custom events to call when this crate is attacked, for example if attacking this crate uniquely changes its own state.")] public InteractEvent invokeEventByAttacking; [Tooltip("Custom events to call when this crate's timer runs out, for example if this crate should switch to different materials or spawnPrefabs.")] public InteractEvent invokeEventOnTimerEnd; [Tooltip("Custom events to call when this crate is destroyed, for example if this crate has custom data that should be removed.")] public InteractEvent invokeEventOnDestroy; [Space(3f)] [Header("Contents")] [Tooltip("What GameObject to spawn at the time of walking into, bouncing off of, or attacking this crate.")] public GameObject spawnPrefab; [Tooltip("How many of the spawnPrefab are left to spawn, based on this crate's crateData's spawnPer integers.")] public int spawnAmountLeft = 1; public Coroutine spawnContentsCoroutine; private Coroutine queuedSpawnCoroutine; public Coroutine destroyCoroutine; [Space(3f)] [Header("Timers")] [Tooltip("A timer that will count down in real-time seconds, regardless of the game's in-game time.\nKeep at -1 to disable this timer.")] public float timerStartTime = -1f; private float timer; private bool timerActive; private float timerCooldown; private int timersEnded; [Tooltip("The text component that this crate's timer value will be printed to, if this crate's crateData's timerVisible is true.\nIf left empty, the default timer object will be used.")] public TextMeshPro timerText; private float timerPrintInterval; public override void Start() { ((GrabbableObject)this).Start(); CrashBandicootCratesManagerScript.AddCrate(this); EnableColliders(setEnabledTo: true); InitializeValues(); } public void InitializeValues() { ((MonoBehaviour)this).StartCoroutine(WaitForLocalPlayerToCallOnStart()); } private IEnumerator WaitForLocalPlayerToCallOnStart() { bool foundLocalPlayer = false; float waitTime = 0f; float waitIntervals = 0.5f; while (!foundLocalPlayer && waitTime < 20f && (!((Object)(object)GameNetworkManager.Instance != (Object)null) || !((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null))) { yield return (object)new WaitForSeconds(waitIntervals); waitTime += waitIntervals; } InitializeOnStartFunctionality(); } private void InitializeOnStartFunctionality() { if (destroyed) { return; } if ((Object)(object)crateData == (Object)null) { crateData = ScriptableObject.CreateInstance(); } if (((NetworkBehaviour)this).IsServer) { StartInteractionCooldown(); if (crateData.audioPlayRandomized) { RandomizeNextRandomSpecialSFX(StartOfRound.Instance.localPlayerController, 0, crateData.audioSpecialSFX.Length); } } if ((Object)(object)audioSource != (Object)null) { audioSource.loop = !crateData.audioPlayOneShot; } if ((Object)(object)particlesBreak == (Object)null) { particlesBreak = Object.Instantiate(CrashBandicootCratesManagerScript.allAssets.allParticles[0], ((Component)this).transform, false).GetComponent(); } if ((Object)(object)timerText == (Object)null && crateData.timerVisible) { GameObject val = Object.Instantiate(CrashBandicootCratesManagerScript.allAssets.timerObject, ((Component)this).transform, false); timerText = val.GetComponentInChildren(); } if (((UnityEventBase)invokeEventOnStart).GetPersistentEventCount() != 0 && (crateData.canInvokeBeforeGameStart || ((Object)(object)GameNetworkManager.Instance != (Object)null && GameNetworkManager.Instance.gameHasStarted))) { ((UnityEvent)(object)invokeEventOnStart).Invoke(GameNetworkManager.Instance.localPlayerController); } } public override void Update() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (destroyed) { return; } if (!crateData.audioPlayOneShot && crateData.noiseAudible) { if ((Object)(object)audioSource != (Object)null && audioSource.isPlaying) { noiseTimer += Time.deltaTime; if (noiseTimer >= crateData.noiseInterval) { noiseTimer = 0f; RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, crateData.noiseRange, crateData.noiseLoudness, 0, base.isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); } } else { noiseTimer = 0f; } } if (timerCooldown > 0f) { timerCooldown -= Time.deltaTime; } else if (timerStartTime != -1f && timerActive) { if (timer > 0f) { timer -= Time.deltaTime; } else { TimerEnd(); } } if (!crateData.timerVisible) { return; } if (timer > 0f) { timerPrintInterval -= Time.deltaTime; if (timerPrintInterval <= 0f) { timerPrintInterval = 0.04f; TimerPrint(); } } else if ((Object)(object)timerText != (Object)null && ((Behaviour)timerText).enabled) { TimerVisibility(setTo: false); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); Logger.LogDebug((object)$"#{((NetworkBehaviour)this).NetworkObjectId}: EquipItem()"); GrabCrate(); } public void GrabCrate() { StopCheckDistanceCoroutine(); EnableColliders(setEnabledTo: false); bouncedOffCrate = false; } public override void PlayDropSFX() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) if (base.deactivated || destroyed || !base.hasBeenHeld || (bouncedOffCrate && base.fallTime < 0.5f)) { return; } if (StartOfRound.Instance.currentLevelID == 3 && (Object)(object)((Component)this).GetComponentInParent() != (Object)null) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} likely placed on company desk, overriding colliders"); collideOverrideCrate = "false"; collideOverrideBounce = "false"; } StartCheckDistanceCoroutine(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position + Vector3.up * 0.25f, Vector3.down, ref val, 0.5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { CrateGrabbableObject componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && (componentInParent.crateData.crateType == CrateType.Arrow || (bounceForce > 0f && componentInParent.bounceForce >= bounceForce * crateData.bounceMultiplierThreshold))) { Logger.LogDebug((object)$"#{((NetworkBehaviour)this).NetworkObjectId} hit #{((NetworkBehaviour)componentInParent).NetworkObjectId} with force {componentInParent.bounceForce}"); StartBounceOffCrate(componentInParent); return; } } base.hasHitGround = true; bouncedOffCrate = false; float num; if (bounceCeiling != -1f) { num = bounceCeiling; bounceCeiling = -1f; } else { num = Mathf.Abs(((Component)this).transform.parent.TransformPoint(base.startFallingPosition).y - ((Component)this).transform.parent.TransformPoint(base.targetFloorPosition).y); } if (num >= 1f) { PlaySFX(base.itemProperties.dropSFX, overrideOneShot: true); } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} | fallDistance: {num}"); if (ThisFallToTriggerIsLargestPassedOne(num, crateData.fallToTriggerWalkInto, crateData.fallToTriggerJumpOnto, crateData.fallToTriggerAttack)) { WalkIntoCrate(); } else if (ThisFallToTriggerIsLargestPassedOne(num, crateData.fallToTriggerJumpOnto, crateData.fallToTriggerWalkInto, crateData.fallToTriggerAttack)) { JumpOntoCrate(); } else if (ThisFallToTriggerIsLargestPassedOne(num, crateData.fallToTriggerAttack, crateData.fallToTriggerWalkInto, crateData.fallToTriggerJumpOnto)) { AttackCrate(); } } private bool ThisFallToTriggerIsLargestPassedOne(float fallDistance, float thisTrigger, float firstOtherTrigger, float secondOtherTrigger) { if (thisTrigger == -1f) { return false; } if (fallDistance < thisTrigger) { return false; } if (firstOtherTrigger == -1f || firstOtherTrigger <= thisTrigger || fallDistance <= firstOtherTrigger) { if (secondOtherTrigger != -1f && !(secondOtherTrigger <= thisTrigger)) { return fallDistance <= secondOtherTrigger; } return true; } return false; } private void StartCheckDistanceCoroutine() { if (checkDistanceCoroutine == null) { checkDistanceCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckDistance()); } } private void StopCheckDistanceCoroutine() { if (checkDistanceCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(checkDistanceCoroutine); checkDistanceCoroutine = null; } } private IEnumerator CheckDistance() { bool playerInRange = true; while (playerInRange) { yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null || !StartOfRound.Instance.localPlayerController.isPlayerControlled) { playerInRange = false; } if (Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) >= 0.75f) { playerInRange = false; } } checkDistanceCoroutine = null; EnableColliders(setEnabledTo: true); } private void StartBounceOffCrate(CrateGrabbableObject hitCrate) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)hitCrate == (Object)null) && !((Object)(object)hitCrate.crateData == (Object)null)) { CrashBandicootCratesManagerScript.PlayNoise(hitCrate.audioSource, hitCrate.crateData.audioBounceSFX, hitCrate.crateData.noiseAudible, hitCrate.crateData.noiseRange, hitCrate.crateData.noiseLoudness); bouncedOffCrate = true; base.hasHitGround = false; base.reachedFloorTarget = false; base.fallTime = 0f; base.startFallingPosition = base.targetFloorPosition - Vector3.down; ((Component)this).transform.localEulerAngles = new Vector3(0f, (float)base.floorYRot, 0f); RaycastHit val = default(RaycastHit); if (Physics.Raycast(topOfCrate.position, Vector3.up, ref val, hitCrate.bounceForce / crateData.bounceDividerStrength, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { bounceCeiling = ((RaycastHit)(ref val)).distance; } else { bounceCeiling = hitCrate.bounceForce / crateData.bounceDividerStrength; } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} bounceOffCrate {bouncedOffCrate} // bounceCeiling {bounceCeiling}"); } } public override void FallWithCurve() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (!bouncedOffCrate) { ((GrabbableObject)this).FallWithCurve(); return; } base.fallTime += Time.deltaTime / crateData.bounceTime; ((Component)this).transform.localPosition = Vector3.Lerp(base.targetFloorPosition, new Vector3(base.targetFloorPosition.x, base.targetFloorPosition.y + bounceCeiling, base.targetFloorPosition.z), crateData.bounceCurve.Evaluate(base.fallTime)); } public void WalkIntoCrate(PlayerControllerB playerWalkedInto = null) { if (((Component)this).gameObject.layer != 5 && !(base.currentUseCooldown >= 0f) && CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(playerWalkedInto, this)) { StartInteractionCooldown(); Logger.LogDebug((object)$"WalkIntoCrate({playerWalkedInto})"); if (((UnityEventBase)invokeEventByWalkingInto).GetPersistentEventCount() != 0) { ((UnityEvent)(object)invokeEventByWalkingInto).Invoke(playerWalkedInto); } if (crateData.audioPlayByWalkingInto) { PlayAudioSpecialSFX(overrideForcePlay: false, 0); } if (crateData.particlesPlayByWalkingInto) { PlayParticles(particlesSpecial, 0); } UpdateSpecialInt(changeSpecialIntPerWalkInto, ((Object)(object)playerWalkedInto != (Object)null && crateData.contentLostByWalkingInto) || ((Object)(object)playerWalkedInto == (Object)null && crateData.contentLostByNonPlayer), (Object)(object)playerWalkedInto == (Object)null); DoSpawnCheck(crateData.spawnPerWalkingInto, playerWalkedInto); } } public void JumpOntoCrate(PlayerControllerB playerJumpedOnto = null) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerJumpedOnto == (Object)null || ((Component)playerJumpedOnto).transform.position.y >= topOfCrate.position.y) { PerformJumpOntoLogic(playerJumpedOnto); } } private void PerformJumpOntoLogic(PlayerControllerB playerJumpedOnto = null) { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) if (((Component)this).gameObject.layer == 5 || base.currentUseCooldown >= 0f || !CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(playerJumpedOnto, this)) { return; } StartInteractionCooldown(); Logger.LogDebug((object)$"PerformJumpOntoLogic({playerJumpedOnto})"); if (((UnityEventBase)invokeEventByJumpingOnto).GetPersistentEventCount() != 0) { ((UnityEvent)(object)invokeEventByJumpingOnto).Invoke(playerJumpedOnto); } if (crateData.audioPlayByJumpingOnto) { PlayAudioSpecialSFX(overrideForcePlay: false, 1); } if (crateData.particlesPlayByJumpingOnto) { PlayParticles(particlesSpecial, 1); } if (bounceForce > 0f && (Object)(object)playerJumpedOnto != (Object)null) { playerJumpedOnto.ResetFallGravity(); float num = bounceForce; if ((Object)(object)IngamePlayerSettings.Instance != (Object)null && (Object)(object)IngamePlayerSettings.Instance.playerInput != (Object)null && (Object)(object)IngamePlayerSettings.Instance.playerInput.actions != (Object)null && IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false) != null && IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).IsPressed()) { num *= 1.5f; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"big bounce! {bounceForce} to {num}"); } } playerJumpedOnto.externalForceAutoFade += Vector3.up * num; PlaySFX(crateData.audioBounceSFX, overrideOneShot: true, overrideForcePlay: false, 3); } UpdateSpecialInt(changeSpecialIntPerJumpOnto, ((Object)(object)playerJumpedOnto != (Object)null && crateData.contentLostByJumpingOnto) || ((Object)(object)playerJumpedOnto == (Object)null && crateData.contentLostByNonPlayer), (Object)(object)playerJumpedOnto == (Object)null); DoSpawnCheck(crateData.spawnPerJumpingOnto, playerJumpedOnto); } public void AttackCrate(PlayerControllerB playerAttacked = null) { if (((Component)this).gameObject.layer != 5 && !(base.currentUseCooldown >= 0f) && CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(playerAttacked, this)) { StartInteractionCooldown(); Logger.LogDebug((object)$"AttackCrate({playerAttacked})"); if (((UnityEventBase)invokeEventByAttacking).GetPersistentEventCount() != 0) { ((UnityEvent)(object)invokeEventByAttacking).Invoke(playerAttacked); } if (crateData.audioPlayByAttacking) { PlayAudioSpecialSFX(overrideForcePlay: false, 2); } if (crateData.particlesPlayByAttacking) { PlayParticles(particlesSpecial, 2); } UpdateSpecialInt(changeSpecialIntPerAttack, ((Object)(object)playerAttacked != (Object)null && crateData.contentLostByAttacking) || ((Object)(object)playerAttacked == (Object)null && crateData.contentLostByNonPlayer), (Object)(object)playerAttacked == (Object)null); DoSpawnCheck(crateData.spawnPerAttacking, playerAttacked); } } private void StartInteractionCooldown() { base.currentUseCooldown = base.useCooldown; if (base.useCooldown >= 1f) { ((MonoBehaviour)this).StartCoroutine(SyncUseCooldownOnDelay()); } } private IEnumerator SyncUseCooldownOnDelay() { yield return null; SyncUseCooldownServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [ServerRpc(RequireOwnership = false)] private void SyncUseCooldownServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2775958166u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2775958166u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncUseCooldownClientRpc(playerID); } } } [ClientRpc] private void SyncUseCooldownClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(248081063u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 248081063u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { base.currentUseCooldown = base.useCooldown; } } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (base.deactivated || destroyed) { return false; } AttackCrate(playerWhoHit); return true; } public void TimerStart(bool sync = false) { if (!destroyed && timerStartTime != -1f && (!(timer > timerStartTime * 0.025f) || !(timer < timerStartTime * 0.975f))) { timer = timerStartTime; timerActive = true; if (sync) { TimerStartServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } } [ServerRpc(RequireOwnership = false)] private void TimerStartServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1280396780u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1280396780u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TimerStartClientRpc(playerID); } } } [ClientRpc] private void TimerStartClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2860483368u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2860483368u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { TimerStart(); } } } public void TimerVisibility(bool setTo) { if (!((Object)(object)timerText == (Object)null) && !((Object)(object)crateData == (Object)null) && (!setTo || (!destroyed && crateData.timerVisible))) { ((Behaviour)timerText).enabled = setTo; } } public void TimerSetCooldown(float cooldown, bool addOrSnap = true) { if (addOrSnap) { timerCooldown += cooldown; } else { timerCooldown = cooldown; } } private void TimerPrint() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)timerText == (Object)null) && !((Object)(object)crateData == (Object)null) && crateData.timerVisible) { if (!((Behaviour)timerText).enabled) { TimerVisibility(setTo: true); } ((TMP_Text)timerText).text = TimeSpan.FromSeconds(timer).ToString("m\\:ss\\:ff"); if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.audioListener != (Object)null) { timerText.transform.parent.LookAt(((Component)StartOfRound.Instance.audioListener).transform.position); } else { timerText.transform.localEulerAngles = Vector3.zero; } } } public void TimerEnd() { if (!destroyed && !((Object)(object)crateData == (Object)null) && !(timer > 0f)) { timerActive = false; if (crateData.timerRepeats != -1) { timersEnded++; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: TimerEnd() // timersEnded? {timersEnded}"); } TimerVisibility(setTo: false); if (((UnityEventBase)invokeEventOnTimerEnd).GetPersistentEventCount() != 0) { ((UnityEvent)(object)invokeEventOnTimerEnd).Invoke((PlayerControllerB)null); } if (crateData.audioPlayOnTimerEnd) { PlayAudioSpecialSFX(); } if (crateData.particlesPlayOnTimerEnd) { PlayParticles(particlesSpecial); } if (crateData.timerRepeats == -1 || timersEnded <= crateData.timerRepeats) { TimerStart(); } else { timerStartTime = -1f; } } } public void EnableColliders(bool setEnabledTo) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: EnableColliders({setEnabledTo})"); if (setEnabledTo) { if ((Object)(object)base.playerHeldBy != (Object)null || destroyed) { Logger.LogDebug((object)$"#{((NetworkBehaviour)this).NetworkObjectId} trying to turn colliders on while held {(Object)(object)base.playerHeldBy != (Object)null} or destroyed {destroyed}, returning;"); return; } if ((Object)(object)((Component)this).GetComponentInParent() != (Object)null || (Object)(object)((Component)this).GetComponentInParent() != (Object)null) { Logger.LogDebug((object)$"WARNING!!! {this} #{((NetworkBehaviour)this).NetworkObjectId} dropped inside vehicle or elevator! returning"); return; } GrabbableVehicle componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerDriving != (Object)null && (Object)(object)componentInParent.playerDriving == (Object)(object)StartOfRound.Instance.localPlayerController) { Logger.LogDebug((object)$"not turning colliders of {this} #{((NetworkBehaviour)this).NetworkObjectId} on while local player is driving, returning"); return; } } if ((Object)(object)colliderCrate != (Object)null) { if (!string.IsNullOrEmpty(collideOverrideCrate)) { bool enabled = collideOverrideCrate[0].ToString().ToLower() == "t"; ((Collider)colliderCrate).enabled = enabled; Logger.LogDebug((object)$"{colliderCrate} enabled overriden by {collideOverrideCrate} to {((Collider)colliderCrate).enabled}"); } else { ((Collider)colliderCrate).enabled = setEnabledTo; } ((Collider)colliderCrate).isTrigger = !collideWithCrate; } if ((Object)(object)colliderEnemies != (Object)null) { ((Behaviour)colliderEnemies).enabled = (Object)(object)colliderCrate != (Object)null && ((Collider)colliderCrate).enabled && !((Collider)colliderCrate).isTrigger; } base.grabbableToEnemies = ((Object)(object)colliderEnemies == (Object)null || !((Behaviour)colliderEnemies).enabled) && !base.isHeld; if ((Object)(object)colliderBounce != (Object)null) { if (!string.IsNullOrEmpty(collideOverrideBounce)) { bool enabled2 = collideOverrideBounce[0].ToString().ToLower() == "t"; ((Collider)colliderBounce).enabled = enabled2; Logger.LogDebug((object)$"{colliderBounce} enabled overriden by {collideOverrideBounce} to {((Collider)colliderBounce).enabled}"); } else { ((Collider)colliderBounce).enabled = setEnabledTo; } } } public void PlayAudioSpecialSFX(bool overrideForcePlay = false, int interactionType = -1) { if (!((Object)(object)crateData == (Object)null) && crateData.audioSpecialSFX != null && crateData.audioSpecialSFX.Length != 0) { AudioClip clipToPlay = crateData.audioSpecialSFX[0]; if (crateData.audioPlayRandomized && nextRandomSpecialSFX >= 0 && nextRandomSpecialSFX < crateData.audioSpecialSFX.Length) { clipToPlay = crateData.audioSpecialSFX[nextRandomSpecialSFX]; } PlaySFX(clipToPlay, overrideOneShot: false, overrideForcePlay, interactionType); } } public void PlaySFX(AudioClip clipToPlay, bool overrideOneShot = false, bool overrideForcePlay = false, int interactionType = -1) { if ((Object)(object)clipToPlay == (Object)null) { return; } AudioSource component = audioSource; if ((Object)(object)component == (Object)null) { component = ((Component)this).GetComponent(); if ((Object)(object)component == (Object)null) { return; } } if (crateData.audioPlayOneShot || overrideOneShot) { CrashBandicootCratesManagerScript.PlayNoise(component, clipToPlay, ((NetworkBehaviour)this).IsOwner && crateData.noiseAudible, crateData.noiseRange, crateData.noiseLoudness); } else if (!crateData.audioPlayToggle || overrideForcePlay) { component.clip = clipToPlay; component.time = 0f; component.Play(); } else if (!component.isPlaying) { component.clip = clipToPlay; component.time = 0f; component.Play(); } else if (component.isPlaying) { component.Stop(); } if (interactionType != -1) { int nextSpecialSFX = -1; if (component.isPlaying && crateData.audioPlayRandomized && interactionType >= 0 && interactionType <= 2) { nextSpecialSFX = (nextRandomSpecialSFX = Random.Range(0, crateData.audioSpecialSFX.Length)); Logger.LogDebug((object)$"SENDER set nextRandomSpecialSFX to {nextRandomSpecialSFX}"); } SyncSFXOrParticlesServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, interactionType, isSFX: true, nextSpecialSFX); } } public void PlayParticles(ParticleSystem particlesToPlay, int interactionType = -1) { //IL_000a: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)particlesToPlay == (Object)null)) { Color white = Color.white; if ((Object)(object)particlesToPlay == (Object)(object)particlesBreak) { white = particlesBreakColor; } else if ((Object)(object)particlesToPlay == (Object)(object)particlesSpecial) { white = particlesSpecialColor; } ParticleSystemRenderer component = ((Component)particlesToPlay).GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).material.color = white; } particlesToPlay.Play(); if (interactionType != -1) { SyncSFXOrParticlesServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, interactionType, isSFX: false); } } } public void StopSFX(bool sync = false) { audioSource.Stop(); if (sync) { SyncSFXOrParticlesServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, 4); } } public void StopParticles(bool sync = false) { particlesSpecial.Stop(); if (sync) { SyncSFXOrParticlesServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, 5); } } [ServerRpc(RequireOwnership = false)] private void SyncSFXOrParticlesServerRpc(int playerID, int interactionType, bool isSFX = true, int nextSpecialSFX = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1924210047u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, interactionType); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isSFX, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, nextSpecialSFX); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1924210047u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (interactionType != -1) { SyncSFXOrParticlesClientRpc(playerID, interactionType, isSFX, nextSpecialSFX); } } } [ClientRpc] private void SyncSFXOrParticlesClientRpc(int playerID, int interactionType, bool isSFX = true, int nextSpecialSFX = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(957576429u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, interactionType); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isSFX, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, nextSpecialSFX); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 957576429u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { return; } switch (interactionType) { case 0: if (isSFX && crateData.audioPlayByWalkingInto) { PlayAudioSpecialSFX(); } else if (!isSFX && crateData.particlesPlayByWalkingInto) { PlayParticles(particlesSpecial); } break; case 1: if (isSFX && crateData.audioPlayByJumpingOnto) { PlayAudioSpecialSFX(); } else if (!isSFX && crateData.particlesPlayByJumpingOnto) { PlayParticles(particlesSpecial); } break; case 2: if (isSFX && crateData.audioPlayByAttacking) { PlayAudioSpecialSFX(); } else if (!isSFX && crateData.particlesPlayByAttacking) { PlayParticles(particlesSpecial); } break; case 3: PlaySFX(crateData.audioBounceSFX, overrideOneShot: true); break; case 4: StopSFX(); break; case 5: StopParticles(); break; } if (crateData.audioPlayRandomized && nextSpecialSFX != -1) { nextRandomSpecialSFX = nextSpecialSFX; Logger.LogDebug((object)$"RECEIVER set nextRandomSpecialSFX to {nextRandomSpecialSFX}"); } } public void SetCrateOnMapRadar(bool add) { if (add) { CrashBandicootCratesManagerScript.AddCrateToMapRadar(this, base.itemProperties.itemName); } else { CrashBandicootCratesManagerScript.EraseCrateFromMapRadar(this); } for (int i = 0; i < ((Component)this).transform.childCount; i++) { Transform child = ((Component)this).transform.GetChild(i); if ((Object)(object)child != (Object)null && ((Component)child).gameObject.layer == LayerMask.NameToLayer("MapRadar")) { ((Component)child).gameObject.SetActive(add); } } } public void RandomizeSpecialInt(int maxExclusive) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocallyUnsafe(this)) { RandomizeNumber(0f, maxExclusive, 0); } } public void RandomizeSpecialInt(PlayerControllerB interactingPlayer, int minInclusive, int maxExclusive, int useRandomSeed = -1) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(interactingPlayer, this)) { RandomizeNumber(minInclusive, maxExclusive, 0, interactingPlayer, useRandomSeed); } } public void RandomizeTimerStartTime(float offset) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocallyUnsafe(this)) { RandomizeNumber(crateData.timerRandomMedian - offset, crateData.timerRandomMedian + offset, 1); } } public void RandomizeTimerStartTime(PlayerControllerB interactingPlayer, float minInclusive, float maxExclusive, int useRandomSeed = -1) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(interactingPlayer, this)) { RandomizeNumber(minInclusive, maxExclusive, 1, interactingPlayer, useRandomSeed); } } public void RandomizeNextRandomSpecialSFX() { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocallyUnsafe(this)) { RandomizeNumber(0f, crateData.audioSpecialSFX.Length, 2); } } public void RandomizeNextRandomSpecialSFX(PlayerControllerB interactingPlayer, int minInclusive, int maxExclusive, int useRandomSeed = -1) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(interactingPlayer, this)) { RandomizeNumber(minInclusive, maxExclusive, 2, interactingPlayer, useRandomSeed); } } private void RandomizeNumber(float minInclusive, float maxExclusive, int switchCase, PlayerControllerB interactingPlayer = null, int useRandomSeed = -1) { float num = 0f; num = ((useRandomSeed != -1) ? Mathf.Lerp(minInclusive, maxExclusive, (float)new Random(useRandomSeed).NextDouble()) : Random.Range(minInclusive, maxExclusive)); if ((Object)(object)interactingPlayer == (Object)null) { interactingPlayer = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)interactingPlayer == (Object)null) { interactingPlayer = StartOfRound.Instance.allPlayerScripts[0]; } } RandomizeNumberLocal(num, switchCase); RandomizeNumberServerRpc(num, (int)interactingPlayer.playerClientId, switchCase); } [ServerRpc(RequireOwnership = false)] private void RandomizeNumberServerRpc(float randomNr, int playerID, int switchCase) { //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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2287666682u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref randomNr, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, switchCase); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2287666682u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RandomizeNumberClientRpc(randomNr, playerID, switchCase); } } } [ClientRpc] private void RandomizeNumberClientRpc(float randomNr, int playerID, int switchCase) { //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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(861825487u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref randomNr, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, switchCase); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 861825487u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { RandomizeNumberLocal(randomNr, switchCase); } } } private void RandomizeNumberLocal(float randomNr, int switchCase) { switch (switchCase) { case 0: UpdateSpecialIntLocal((int)randomNr, destroyLosesContent: false, null, overrideSnapToChange: true); break; case 1: timerStartTime = randomNr; TimerStart(); break; case 2: nextRandomSpecialSFX = (int)randomNr; break; } Logger.LogDebug((object)$"RandomizeIntLocal(): randomNr {randomNr} | switchCase {switchCase}"); } public void UpdateSpecialInt(int change, bool destroyLosesContent, bool syncRequiresOwnerShip = false) { if ((!changeSpecialIntAddOrSnap || (change != 0 && (specialInt != 0 || change >= 0))) && (changeSpecialIntAddOrSnap || change != -99) && (!syncRequiresOwnerShip || ((NetworkBehaviour)this).IsOwner)) { UpdateSpecialIntLocal(change, destroyLosesContent, GameNetworkManager.Instance.localPlayerController); UpdateSpecialIntServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, change, destroyLosesContent); } } [ServerRpc(RequireOwnership = false)] private void UpdateSpecialIntServerRpc(int playerID, int change, bool destroyLosesContent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1635305508u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, change); ((FastBufferWriter)(ref val)).WriteValueSafe(ref destroyLosesContent, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1635305508u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UpdateSpecialIntClientRpc(playerID, change, destroyLosesContent); } } } [ClientRpc] private void UpdateSpecialIntClientRpc(int playerID, int change, bool destroyLosesContent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(118164457u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, change); ((FastBufferWriter)(ref val)).WriteValueSafe(ref destroyLosesContent, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 118164457u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { UpdateSpecialIntLocal(change, destroyLosesContent, CrashBandicootCratesManagerScript.GetPlayerByID(playerID)); } } } public void UpdateSpecialIntLocalDirect(int change) { UpdateSpecialIntLocal(change, crateData.contentLostByNonPlayer); } public void UpdateSpecialIntLocalSwitchCase(int switchCase) { switch (switchCase) { case 1: UpdateSpecialIntLocal(changeSpecialIntPerWalkInto, crateData.contentLostByNonPlayer); break; case 2: UpdateSpecialIntLocal(changeSpecialIntPerJumpOnto, crateData.contentLostByNonPlayer); break; case 3: UpdateSpecialIntLocal(changeSpecialIntPerAttack, crateData.contentLostByNonPlayer); break; } } public void UpdateSpecialIntLocal(int change, bool destroyLosesContent, PlayerControllerB interactingPlayer = null, bool overrideSnapToChange = false) { if (crateData.changeCountInBetween) { int num = ((overrideSnapToChange || !changeSpecialIntAddOrSnap) ? change : (specialInt + change)); while (specialInt != num) { if (num > specialInt) { specialInt++; } else if (num < specialInt) { specialInt--; } if (specialInt < 0) { specialInt = 0; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"moved to: {specialInt}"); } CheckMaterialSwitch(); CheckSpawnPrefabSwitch(); } } else { if (overrideSnapToChange || !changeSpecialIntAddOrSnap) { specialInt = change; } else { specialInt += change; } if (specialInt < 0) { specialInt = 0; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"snapped to: {specialInt}"); } CheckMaterialSwitch(); CheckSpawnPrefabSwitch(); } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} specialInt: {specialInt} / destroyLosesContent? {destroyLosesContent}"); } if (destroyUponSpecialInt != -1 && specialInt >= destroyUponSpecialInt) { ((MonoBehaviour)this).StartCoroutine(DestroyCrateLocal(destroyLosesContent, overrideEffects: false, shouldDoEffects: false, interactingPlayer)); } } private void CheckMaterialSwitch() { if (crateData.switchMatOnSpecialInt != null && crateData.switchMatOnSpecialInt.Length != 0 && specialInt >= 0 && specialInt < crateData.switchMatOnSpecialInt.Length) { for (int i = 0; i < crateData.switchMatIndex.Length; i++) { SwitchMatTo(crateData.switchMatOnSpecialInt[specialInt], crateData.switchMatIndex[i]); } } } private void SwitchMatTo(Material changeToMat, int matIndex = 2) { Material[] materials = ((Renderer)base.mainObjectRenderer).materials; if (matIndex >= materials.Length) { Logger.LogDebug((object)$"SwitchMatTo() out of bounds: length = {materials.Length} | index = {matIndex}"); return; } materials[matIndex] = changeToMat; if (!((Object)(object)materials[matIndex] == (Object)null) || crateData.changeSwitchToNull) { ((Renderer)base.mainObjectRenderer).materials = materials; } } private void CheckSpawnPrefabSwitch() { if (crateData.switchSpawnPrefabOnSpecialInt != null && crateData.switchSpawnPrefabOnSpecialInt.Length != 0 && specialInt >= 0 && specialInt < crateData.switchSpawnPrefabOnSpecialInt.Length && ((Object)(object)crateData.switchSpawnPrefabOnSpecialInt[specialInt] != (Object)null || crateData.changeSwitchToNull)) { spawnPrefab = crateData.switchSpawnPrefabOnSpecialInt[specialInt]; if ((Object)(object)spawnPrefab != (Object)null && spawnAmountLeft <= 0) { spawnAmountLeft = 1; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: spawnPrefab on specialInt {specialInt} = {spawnPrefab} (spawnAmountLeft? {spawnAmountLeft})"); } } } public void DestroyCrate(bool destroyContents, bool overrideEffects = false, bool shouldDoEffects = false, PlayerControllerB interactingPlayer = null) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(interactingPlayer, this)) { ((MonoBehaviour)this).StartCoroutine(DestroyCrateLocal(destroyContents, overrideEffects, shouldDoEffects, GameNetworkManager.Instance.localPlayerController)); DestroyCrateServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, destroyContents, overrideEffects, shouldDoEffects); } } [ServerRpc(RequireOwnership = false)] private void DestroyCrateServerRpc(int playerID, bool destroyContents, bool overrideEffects, bool shouldDoEffects) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2919731071u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref destroyContents, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref overrideEffects, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shouldDoEffects, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2919731071u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyCrateClientRpc(playerID, destroyContents, overrideEffects, shouldDoEffects); } } } [ClientRpc] private void DestroyCrateClientRpc(int playerID, bool destroyContents, bool overrideEffects, bool shouldDoEffects) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2644684432u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref destroyContents, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref overrideEffects, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shouldDoEffects, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2644684432u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { destroyCoroutine = ((MonoBehaviour)this).StartCoroutine(DestroyCrateLocal(destroyContents, overrideEffects, shouldDoEffects, CrashBandicootCratesManagerScript.GetPlayerByID(playerID))); } } } private IEnumerator DestroyCrateLocal(bool destroyContent, bool overrideEffects = false, bool shouldDoEffects = false, PlayerControllerB interactingPlayer = null) { if (destroyed) { yield break; } if (((UnityEventBase)invokeEventOnDestroy).GetPersistentEventCount() != 0) { ((UnityEvent)(object)invokeEventOnDestroy).Invoke(interactingPlayer); } yield return (object)new WaitForEndOfFrame(); destroyed = true; base.itemUsedUp = true; if (destroyContent) { spawnAmountLeft = -1; } if (((NetworkBehaviour)this).IsServer) { DoSpawnCheck(crateData.spawnOnDestroy, interactingPlayer); } EnableColliders(setEnabledTo: false); if (overrideEffects) { if (shouldDoEffects) { PlaySFX(crateData.audioBreakSFX, overrideOneShot: true); PlayParticles(particlesBreak); if (crateData.audioPlayOnDestroy) { PlayAudioSpecialSFX(overrideForcePlay: true); } if (crateData.particlesPlayOnDestroy) { PlayParticles(particlesSpecial); } } } else { PlaySFX(crateData.audioBreakSFX, overrideOneShot: true); PlayParticles(particlesBreak); if (crateData.audioPlayOnDestroy) { PlayAudioSpecialSFX(overrideForcePlay: true); } if (crateData.particlesPlayOnDestroy) { PlayParticles(particlesSpecial); } } timerStartTime = -1f; TimerVisibility(setTo: false); audioSource.loop = false; CrashBandicootCratesManagerScript.RemoveCrate(this); destroyCoroutine = null; } public void QueueSpawnCheck(PlayerControllerB interactingPlayer, GameObject queueSpawnPrefab, int queueSpawnAmountLeft = 1, int spawnAmountPerThisInteraction = -1) { if (!((NetworkBehaviour)this).IsServer) { bool flag = true; int num = CrashBandicootCratesManagerScript.GetIndexOfChildTransform(spawnPrefab, ((Component)this).gameObject); if (num == -1) { flag = false; num = CrashBandicootCratesManagerScript.GetIndexOfBonusObject(spawnPrefab); } Logger.LogDebug((object)$"CLIENT sending QueueSpawnCheck() from player {interactingPlayer} with indexToSend {num}, isChildTransform {flag}, queueSpawnAmountLeft {queueSpawnAmountLeft}, and spawnAmountPerThisInteraction {spawnAmountPerThisInteraction}"); SendQueueToHostServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, num, flag, queueSpawnAmountLeft, spawnAmountPerThisInteraction); } else { if (queuedSpawnCoroutine != null) { Logger.LogInfo((object)$"!!!stopping queuedSpawnCoroutine!!! ({this} #{((NetworkBehaviour)this).NetworkObjectId})"); ((MonoBehaviour)this).StopCoroutine(queuedSpawnCoroutine); } queuedSpawnCoroutine = ((MonoBehaviour)this).StartCoroutine(DoSpawnCheckOnceComplete(interactingPlayer, queueSpawnPrefab, queueSpawnAmountLeft, spawnAmountPerThisInteraction)); } } private IEnumerator DoSpawnCheckOnceComplete(PlayerControllerB interactingPlayer, GameObject queueSpawnPrefab, int queueSpawnAmountLeft = 1, int spawnAmountPerThisInteraction = -1) { Logger.LogDebug((object)$"queueing up new DoSpawnCheck({interactingPlayer}, {queueSpawnPrefab}, {queueSpawnAmountLeft}, {spawnAmountPerThisInteraction})"); yield return (object)new WaitForEndOfFrame(); if (spawnContentsCoroutine != null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogInfo((object)"queue waiting"); } yield return (object)new WaitUntil((Func)(() => spawnContentsCoroutine == null)); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogInfo((object)"queue continuing"); } } spawnPrefab = queueSpawnPrefab; spawnAmountLeft = queueSpawnAmountLeft; DoSpawnCheck(spawnAmountPerThisInteraction, interactingPlayer); queuedSpawnCoroutine = null; } [ServerRpc(RequireOwnership = false)] private void SendQueueToHostServerRpc(int playerID, int prefabID, bool isChild, int spawnTotal, int spawnAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3863705522u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, prefabID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isChild, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, spawnTotal); BytePacker.WriteValueBitPacked(val, spawnAmount); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3863705522u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerByID = CrashBandicootCratesManagerScript.GetPlayerByID(playerID); GameObject val3 = (isChild ? ((Component)((Component)this).transform.GetChild(prefabID)).gameObject : CrashBandicootCratesManagerScript.allAssets.allBonusObjects[prefabID]); Logger.LogDebug((object)$"SERVER receiving queue for DoSpawnCheck() from client [{playerID}] {playerByID} with objectToSpawn {val3}, spawnTotal {spawnTotal}, and spawnAmount {spawnAmount}"); QueueSpawnCheck(playerByID, val3, spawnTotal, spawnAmount); } } } public void DoSpawnCheck(int switchCase) { switch (switchCase) { case 1: DoSpawnCheck(crateData.spawnPerWalkingInto, GameNetworkManager.Instance.localPlayerController); break; case 2: DoSpawnCheck(changeSpecialIntPerJumpOnto, GameNetworkManager.Instance.localPlayerController); break; case 3: DoSpawnCheck(changeSpecialIntPerAttack, GameNetworkManager.Instance.localPlayerController); break; } } public void DoSpawnCheck(int spawnPerThisInteraction, PlayerControllerB interactingPlayer) { if (spawnAmountLeft > 0 && (Object)(object)spawnPrefab != (Object)null && spawnPerThisInteraction != 0) { int spawnedByID = -1; if ((Object)(object)interactingPlayer != (Object)null) { spawnedByID = (int)interactingPlayer.playerClientId; } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} spawning {spawnPrefab}"); SpawnContentsServerRpc(spawnPerThisInteraction, spawnedByID); } } [ServerRpc(RequireOwnership = false)] private void SpawnContentsServerRpc(int amountToSpawnRequested, int spawnedByID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2306729523u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, amountToSpawnRequested); BytePacker.WriteValueBitPacked(val, spawnedByID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2306729523u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)spawnPrefab == (Object)null) { Logger.LogWarning((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SERVER tried spawning null spawnPrefab"); return; } if (spawnAmountLeft <= 0) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SERVER-side tried spawning from empty crate, returning"); return; } if (amountToSpawnRequested == -1) { amountToSpawnRequested = spawnAmountLeft; } Logger.LogDebug((object)$"spawnContentsCoroutine AMOUNT {amountToSpawnRequested}"); if (spawnContentsCoroutine != null) { Logger.LogDebug((object)"spawnContentsCoroutine INTERRUPT"); ((MonoBehaviour)this).StopCoroutine(spawnContentsCoroutine); } Logger.LogDebug((object)"spawnContentsCoroutine START"); spawnContentsCoroutine = ((MonoBehaviour)this).StartCoroutine(SpawnContentOnServer(amountToSpawnRequested, spawnedByID)); } private IEnumerator SpawnContentOnServer(int amountToSpawnRequested, int spawnedByID) { for (int i = 0; i < amountToSpawnRequested; i++) { if (spawnAmountLeft <= 0) { break; } spawnAmountLeft--; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} spawnPrefab: {spawnPrefab} & spawnAmountLeft: {spawnAmountLeft}"); Vector3 spawnPos = topOfCrate.position + Vector3.up * 0.5f; NetworkObject component = spawnPrefab.GetComponent(); PlayerControllerB playerByID = CrashBandicootCratesManagerScript.GetPlayerByID(spawnedByID); if ((Object)(object)component == (Object)null) { bool flag = true; int num = CrashBandicootCratesManagerScript.GetIndexOfChildTransform(spawnPrefab, ((Component)this).gameObject); if (num == -1) { flag = false; num = CrashBandicootCratesManagerScript.GetIndexOfBonusObject(spawnPrefab); } if (num != -1) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: SERVER instantiating indexToSend [{num}] isChildTransform? {flag}"); CrashBandicootCratesManagerScript.SpawnLocalObject(CrashBandicootCratesManagerScript.GetObjectFromChildrenOrAllAssets(num, flag, ((Component)this).transform), playerByID, spawnPos, this, null, 10f); SpawnContentLocalClientRpc(num, flag, spawnedByID, spawnAmountLeft); } } else { CrashBandicootCratesManagerScript.SpawnNetworkObject(spawnPrefab, playerByID, spawnPos, this); } yield return (object)new WaitForSeconds(0.1f); } Logger.LogDebug((object)"spawnContentsCoroutine FINISH"); SyncSpawnAmountClientRpc(spawnAmountLeft); spawnContentsCoroutine = null; } [ClientRpc] private void SpawnContentLocalClientRpc(int prefabID, bool isChild, int spawnedByID, int hostSpawnAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1610815108u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, prefabID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isChild, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, spawnedByID); BytePacker.WriteValueBitPacked(val, hostSpawnAmount); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1610815108u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { spawnAmountLeft = hostSpawnAmount; Logger.LogDebug((object)$"Spawn LOCAL: {this} #{((NetworkBehaviour)this).NetworkObjectId} spawnAmountLeft: {spawnAmountLeft}"); Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: CLIENT instantiating prefabID [{prefabID}] isChild? {isChild}"); GameObject objectFromChildrenOrAllAssets = CrashBandicootCratesManagerScript.GetObjectFromChildrenOrAllAssets(prefabID, isChild, ((Component)this).transform); if ((Object)(object)objectFromChildrenOrAllAssets == (Object)null) { Logger.LogWarning((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} CLIENT tried instantiating null objectToSpawn"); } else { CrashBandicootCratesManagerScript.SpawnLocalObject(objectFromChildrenOrAllAssets, CrashBandicootCratesManagerScript.GetPlayerByID(spawnedByID), topOfCrate.position + Vector3.up * 0.5f, this, null, 10f); } } } [ClientRpc] private void SyncSpawnAmountClientRpc(int hostSpawnAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3046748010u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hostSpawnAmount); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3046748010u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { spawnAmountLeft = hostSpawnAmount; Logger.LogDebug((object)$"Spawn NETWORK: {this} #{((NetworkBehaviour)this).NetworkObjectId} spawnAmountLeft: {spawnAmountLeft}"); } } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1293327924u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1293327924u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Logger.LogDebug((object)$"syncing crate {this} #{((NetworkBehaviour)this).NetworkObjectId} at {((Component)this).transform.position}"); int indexOfBonusObject = CrashBandicootCratesManagerScript.GetIndexOfBonusObject(spawnPrefab); int hostMatLength = -1; if ((Object)(object)base.mainObjectRenderer != (Object)null && ((Renderer)base.mainObjectRenderer).materials != null) { hostMatLength = ((Renderer)base.mainObjectRenderer).materials.Length; } int hostModdedIndex = -1; if ((Object)(object)crateData != (Object)null && crateData.crateType == CrateType.Modded) { hostModdedIndex = CreateACrate.GetRuntimeParametersIndex(base.itemProperties); } int hostAudioIndex = -1; bool hostAudioPlaying = false; float hostAudioTime = 0f; if ((Object)(object)audioSource != (Object)null && !crateData.audioPlayOneShot && audioSource.isPlaying) { hostAudioPlaying = true; hostAudioTime = audioSource.time; for (int i = 0; i < crateData.audioSpecialSFX.Length; i++) { AudioClip val3 = crateData.audioSpecialSFX[i]; if ((Object)(object)val3 != (Object)null && (Object)(object)val3 == (Object)(object)audioSource.clip) { hostAudioIndex = i; break; } } } bool flag = false; float hostParticlesTime = 0f; if ((Object)(object)particlesSpecial != (Object)null) { MainModule main = particlesSpecial.main; if (((MainModule)(ref main)).loop && particlesSpecial.isPlaying) { flag = true; if (flag) { hostParticlesTime = particlesSpecial.time; } } } float hostInteractionCooldown = 0f; if (base.useCooldown >= 1f) { hostInteractionCooldown = base.currentUseCooldown; } SyncUponJoinClientRpc(playerID, destroyed, specialInt, spawnAmountLeft, indexOfBonusObject, hostInteractionCooldown, collideOverrideCrate, collideOverrideBounce, hostMatLength, bounceForce, destroyUponSpecialInt, timer, timerActive, timerStartTime, timerCooldown, timersEnded, hostAudioPlaying, hostAudioTime, hostAudioIndex, nextRandomSpecialSFX, flag, hostParticlesTime, hostModdedIndex); } [ClientRpc] private void SyncUponJoinClientRpc(int playerID, bool hostDestroyed, int hostSpecialInt, int hostSpawnAmountLeft, int hostSpawnPrefab, float hostInteractionCooldown, string hostCollideOverrideCrate, string hostCollideOverrideBounce, int hostMatLength, float hostBounceForce, int hostDestroyUponSpecialInt, float hostTimer, bool hostTimerActive, float hostStartTime, float hostTimerCooldown, int hostTimersEnded, bool hostAudioPlaying, float hostAudioTime, int hostAudioIndex, int hostNextIndex, bool hostParticlesPlaying, float hostParticlesTime, int hostModdedIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0211: 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_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1558390661u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostDestroyed, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostSpecialInt); BytePacker.WriteValueBitPacked(val, hostSpawnAmountLeft); BytePacker.WriteValueBitPacked(val, hostSpawnPrefab); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostInteractionCooldown, default(ForPrimitives)); bool flag = hostCollideOverrideCrate != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(hostCollideOverrideCrate, false); } bool flag2 = hostCollideOverrideBounce != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(hostCollideOverrideBounce, false); } BytePacker.WriteValueBitPacked(val, hostMatLength); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostBounceForce, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostDestroyUponSpecialInt); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostTimer, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostTimerActive, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostStartTime, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostTimerCooldown, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostTimersEnded); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostAudioPlaying, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostAudioTime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostAudioIndex); BytePacker.WriteValueBitPacked(val, hostNextIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostParticlesPlaying, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostParticlesTime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostModdedIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1558390661u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { return; } if (hostDestroyed) { ((MonoBehaviour)this).StartCoroutine(DestroyCrateLocal(destroyContent: true, overrideEffects: true)); return; } if (hostModdedIndex != -1 && (Object)(object)crateData != (Object)null && crateData.crateType == CrateType.Modded) { CreateACrate.SetCrateModdedToNewRandom(this, -1, CreateACrate.GetRuntimeParameters(hostModdedIndex)); } if (hostMatLength > 0) { Material[] array = (Material[])(object)new Material[hostMatLength]; for (int i = 0; i < array.Length; i++) { if (i < ((Renderer)base.mainObjectRenderer).materials.Length) { array[i] = ((Renderer)base.mainObjectRenderer).materials[i]; } } ((Renderer)base.mainObjectRenderer).materials = array; } UpdateSpecialIntLocal(hostSpecialInt, destroyLosesContent: false, null, overrideSnapToChange: true); spawnAmountLeft = hostSpawnAmountLeft; if (hostSpawnPrefab != -1) { spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[hostSpawnPrefab]; } base.currentUseCooldown = hostInteractionCooldown; bounceForce = hostBounceForce; collideOverrideCrate = hostCollideOverrideCrate; collideOverrideBounce = hostCollideOverrideBounce; EnableColliders((Object)(object)base.playerHeldBy == (Object)null); destroyUponSpecialInt = hostDestroyUponSpecialInt; timer = hostTimer; timerActive = hostTimerActive; timersEnded = hostTimersEnded; timerStartTime = hostStartTime; timerCooldown = hostTimerCooldown; nextRandomSpecialSFX = hostNextIndex; if (hostAudioPlaying && (Object)(object)audioSource != (Object)null) { audioSource.clip = crateData.audioSpecialSFX[hostAudioIndex]; audioSource.time = hostAudioTime; audioSource.Play(); } if (hostParticlesPlaying && (Object)(object)particlesSpecial != (Object)null) { particlesSpecial.time = hostParticlesTime; particlesSpecial.Play(); } Logger.LogDebug((object)$"Locally received data for {this} #{((NetworkBehaviour)this).NetworkObjectId}: specialInt = {specialInt} | spawnAmountLeft = {spawnAmountLeft} | spawnPrefab = {spawnPrefab} | collideOverrideCrate = {collideOverrideCrate} | collideOverrideBounce = {collideOverrideBounce} | Length = {hostMatLength} | destroyUponSpecialInt = {destroyUponSpecialInt} | hostModdedIndex = {hostModdedIndex}"); } public override int GetItemDataToSave() { if ((Object)(object)crateData == (Object)null || (Object)(object)base.itemProperties == (Object)null || !base.itemProperties.saveItemVariable) { return 0; } if (crateData.crateType == CrateType.Outline) { return specialInt; } if (crateData.crateType == CrateType.Question) { return CrashBandicootCratesManagerScript.GetIndexOfBonusObject(spawnPrefab); } if (crateData.crateType == CrateType.Tnt) { return specialInt; } if (crateData.crateType == CrateType.Modded) { return CreateACrate.GetRuntimeParametersIndex(base.itemProperties); } return Mathf.Max(0, spawnAmountLeft); } public override void LoadItemSaveData(int saveData) { if ((Object)(object)crateData == (Object)null || (Object)(object)base.itemProperties == (Object)null || !base.itemProperties.saveItemVariable) { return; } if (crateData.crateType == CrateType.Outline && saveData == 1) { CrateInvokableEvents componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Logger.LogDebug((object)$"Invoking event on {this} #{((NetworkBehaviour)this).NetworkObjectId}"); componentInChildren.OutlineRevealInvisible(StartOfRound.Instance.allPlayerScripts[0]); return; } } if (crateData.crateType == CrateType.Question && saveData != -1) { spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[saveData]; spawnAmountLeft = 1; destroyUponSpecialInt = 1; } else if (crateData.crateType == CrateType.Tnt && saveData != -1) { changeSpecialIntAddOrSnap = false; UpdateSpecialIntLocal(saveData, destroyLosesContent: false); changeSpecialIntAddOrSnap = true; } else if (crateData.crateType == CrateType.Modded) { CreateACrate.SetCrateModdedToNewRandom(this, -1, CreateACrate.GetRuntimeParameters(saveData)); spawnAmountLeft = 0; } else { spawnAmountLeft = saveData; } } private void OnDisable() { CrashBandicootCratesManagerScript.RemoveCrate(this); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2775958166u, new RpcReceiveHandler(__rpc_handler_2775958166), "SyncUseCooldownServerRpc"); ((NetworkBehaviour)this).__registerRpc(248081063u, new RpcReceiveHandler(__rpc_handler_248081063), "SyncUseCooldownClientRpc"); ((NetworkBehaviour)this).__registerRpc(1280396780u, new RpcReceiveHandler(__rpc_handler_1280396780), "TimerStartServerRpc"); ((NetworkBehaviour)this).__registerRpc(2860483368u, new RpcReceiveHandler(__rpc_handler_2860483368), "TimerStartClientRpc"); ((NetworkBehaviour)this).__registerRpc(1924210047u, new RpcReceiveHandler(__rpc_handler_1924210047), "SyncSFXOrParticlesServerRpc"); ((NetworkBehaviour)this).__registerRpc(957576429u, new RpcReceiveHandler(__rpc_handler_957576429), "SyncSFXOrParticlesClientRpc"); ((NetworkBehaviour)this).__registerRpc(2287666682u, new RpcReceiveHandler(__rpc_handler_2287666682), "RandomizeNumberServerRpc"); ((NetworkBehaviour)this).__registerRpc(861825487u, new RpcReceiveHandler(__rpc_handler_861825487), "RandomizeNumberClientRpc"); ((NetworkBehaviour)this).__registerRpc(1635305508u, new RpcReceiveHandler(__rpc_handler_1635305508), "UpdateSpecialIntServerRpc"); ((NetworkBehaviour)this).__registerRpc(118164457u, new RpcReceiveHandler(__rpc_handler_118164457), "UpdateSpecialIntClientRpc"); ((NetworkBehaviour)this).__registerRpc(2919731071u, new RpcReceiveHandler(__rpc_handler_2919731071), "DestroyCrateServerRpc"); ((NetworkBehaviour)this).__registerRpc(2644684432u, new RpcReceiveHandler(__rpc_handler_2644684432), "DestroyCrateClientRpc"); ((NetworkBehaviour)this).__registerRpc(3863705522u, new RpcReceiveHandler(__rpc_handler_3863705522), "SendQueueToHostServerRpc"); ((NetworkBehaviour)this).__registerRpc(2306729523u, new RpcReceiveHandler(__rpc_handler_2306729523), "SpawnContentsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1610815108u, new RpcReceiveHandler(__rpc_handler_1610815108), "SpawnContentLocalClientRpc"); ((NetworkBehaviour)this).__registerRpc(3046748010u, new RpcReceiveHandler(__rpc_handler_3046748010), "SyncSpawnAmountClientRpc"); ((NetworkBehaviour)this).__registerRpc(1293327924u, new RpcReceiveHandler(__rpc_handler_1293327924), "SyncUponJoinServerRpc"); ((NetworkBehaviour)this).__registerRpc(1558390661u, new RpcReceiveHandler(__rpc_handler_1558390661), "SyncUponJoinClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2775958166(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncUseCooldownServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_248081063(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncUseCooldownClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1280396780(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).TimerStartServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2860483368(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).TimerStartClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1924210047(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int interactionType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref interactionType); bool isSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isSFX, default(ForPrimitives)); int nextSpecialSFX = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nextSpecialSFX); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncSFXOrParticlesServerRpc(playerID, interactionType, isSFX, nextSpecialSFX); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_957576429(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int interactionType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref interactionType); bool isSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isSFX, default(ForPrimitives)); int nextSpecialSFX = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nextSpecialSFX); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncSFXOrParticlesClientRpc(playerID, interactionType, isSFX, nextSpecialSFX); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2287666682(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float randomNr = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref randomNr, default(ForPrimitives)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int switchCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref switchCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).RandomizeNumberServerRpc(randomNr, playerID, switchCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_861825487(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float randomNr = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref randomNr, default(ForPrimitives)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int switchCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref switchCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).RandomizeNumberClientRpc(randomNr, playerID, switchCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1635305508(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int change = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref change); bool destroyLosesContent = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyLosesContent, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).UpdateSpecialIntServerRpc(playerID, change, destroyLosesContent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_118164457(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int change = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref change); bool destroyLosesContent = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyLosesContent, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).UpdateSpecialIntClientRpc(playerID, change, destroyLosesContent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2919731071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool destroyContents = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyContents, default(ForPrimitives)); bool overrideEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overrideEffects, default(ForPrimitives)); bool shouldDoEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shouldDoEffects, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).DestroyCrateServerRpc(playerID, destroyContents, overrideEffects, shouldDoEffects); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2644684432(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool destroyContents = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyContents, default(ForPrimitives)); bool overrideEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overrideEffects, default(ForPrimitives)); bool shouldDoEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shouldDoEffects, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).DestroyCrateClientRpc(playerID, destroyContents, overrideEffects, shouldDoEffects); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3863705522(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int prefabID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref prefabID); bool isChild = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isChild, default(ForPrimitives)); int spawnTotal = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnTotal); int spawnAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SendQueueToHostServerRpc(playerID, prefabID, isChild, spawnTotal, spawnAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2306729523(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amountToSpawnRequested = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amountToSpawnRequested); int spawnedByID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnedByID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SpawnContentsServerRpc(amountToSpawnRequested, spawnedByID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1610815108(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int prefabID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref prefabID); bool isChild = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isChild, default(ForPrimitives)); int spawnedByID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnedByID); int hostSpawnAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpawnAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SpawnContentLocalClientRpc(prefabID, isChild, spawnedByID, hostSpawnAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3046748010(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hostSpawnAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpawnAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncSpawnAmountClientRpc(hostSpawnAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1293327924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1558390661(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool hostDestroyed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostDestroyed, default(ForPrimitives)); int hostSpecialInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpecialInt); int hostSpawnAmountLeft = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpawnAmountLeft); int hostSpawnPrefab = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpawnPrefab); float hostInteractionCooldown = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostInteractionCooldown, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string hostCollideOverrideCrate = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostCollideOverrideCrate, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string hostCollideOverrideBounce = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostCollideOverrideBounce, false); } int hostMatLength = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostMatLength); float hostBounceForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostBounceForce, default(ForPrimitives)); int hostDestroyUponSpecialInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostDestroyUponSpecialInt); float hostTimer = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostTimer, default(ForPrimitives)); bool hostTimerActive = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostTimerActive, default(ForPrimitives)); float hostStartTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostStartTime, default(ForPrimitives)); float hostTimerCooldown = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostTimerCooldown, default(ForPrimitives)); int hostTimersEnded = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostTimersEnded); bool hostAudioPlaying = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostAudioPlaying, default(ForPrimitives)); float hostAudioTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostAudioTime, default(ForPrimitives)); int hostAudioIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostAudioIndex); int hostNextIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostNextIndex); bool hostParticlesPlaying = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostParticlesPlaying, default(ForPrimitives)); float hostParticlesTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostParticlesTime, default(ForPrimitives)); int hostModdedIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostModdedIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateGrabbableObject)(object)target).SyncUponJoinClientRpc(playerID, hostDestroyed, hostSpecialInt, hostSpawnAmountLeft, hostSpawnPrefab, hostInteractionCooldown, hostCollideOverrideCrate, hostCollideOverrideBounce, hostMatLength, hostBounceForce, hostDestroyUponSpecialInt, hostTimer, hostTimerActive, hostStartTime, hostTimerCooldown, hostTimersEnded, hostAudioPlaying, hostAudioTime, hostAudioIndex, hostNextIndex, hostParticlesPlaying, hostParticlesTime, hostModdedIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CrateGrabbableObject"; } } public class CrystalProp : GrabbableObject { private static ManualLogSource Logger; private int spawnedInLevel; public Item crateItemProperties; public override void Start() { ((GrabbableObject)this).Start(); if (((NetworkBehaviour)this).IsServer && !base.isInShipRoom) { RemoveCrateSpawnChanceFromLevel(StartOfRound.Instance.currentLevelID); } } public override int GetItemDataToSave() { if (InvalidLevel(spawnedInLevel)) { return -1; } return spawnedInLevel; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); RemoveCrateSpawnChanceFromLevel(saveData); } private bool InvalidLevel(int checkID) { if ((Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.levels == null) { return true; } if (checkID < 0 || checkID >= StartOfRound.Instance.levels.Length) { return true; } return false; } private void RemoveCrateSpawnChanceFromLevel(int levelID) { if (InvalidLevel(levelID)) { return; } spawnedInLevel = levelID; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} // spawnedInLevel = {spawnedInLevel}"); SelectableLevel val = StartOfRound.Instance.levels[spawnedInLevel]; if ((Object)(object)val == (Object)null || val.spawnableScrap == null || val.spawnableScrap.Count == 0) { return; } for (int i = 0; i < val.spawnableScrap.Count; i++) { SpawnableItemWithRarity val2 = val.spawnableScrap[i]; if (val2 != null) { Item spawnableItem = val2.spawnableItem; if (!((Object)(object)spawnableItem == (Object)null) && !((Object)(object)spawnableItem != (Object)(object)crateItemProperties)) { val2.rarity = 0; Logger.LogDebug((object)$"found {spawnableItem} at [{i}]: set rarity of {val2} to {val2.rarity}"); } } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "CrystalProp"; } } public class FakeCrashProp : GrabbableObject, IInventoryMergeable { private static ManualLogSource Logger; public Animator animator; public AudioSource eatAudio; public AudioClip happySFX; public AudioClip eatSFX; public AudioClip screamSFX; private float eatTimer; private bool ateLocalItem; public override void Update() { ((GrabbableObject)this).Update(); if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { eatTimer -= Time.deltaTime; if (eatTimer <= 0f) { eatTimer = Random.Range(3.33f, 7.77f); LookForItemToEat(); } } else { eatTimer = 0.5f; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (ateLocalItem && ((NetworkBehaviour)this).IsOwner) { string[] array = new string[1] { "He ate your items." }; HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(array, true, base.itemProperties); } } private void LookForItemToEat() { if (((NetworkBehaviour)this).IsOwner) { CrashBandicootCratesManagerScript.MergeItem((GrabbableObject)(object)this, removeDestroyedScrapValue: true, muteDestroyedItem: true); } } private void MoveToItemSlot(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot) { CrashBandicootCratesManagerScript.ReplaceItemInSlot((GrabbableObject)(object)this, playerMerging, mergeWith, otherInSlot); CrashBandicootCratesManagerScript.PlayNoise(eatAudio, happySFX, audibleNoise: true, 7f, 0.25f); CrashBandicootCratesManagerScript.PlayNoise(eatAudio, eatSFX, audibleNoise: true, 7f, 0.25f); DoNewPose(); } private void DoNewPose() { if (!((Object)(object)animator == (Object)null)) { animator.SetTrigger($"Pose{new Random(CrashBandicootCratesManagerScript.GetRandomSeed(1229)).Next(0, 6)}"); } } bool IInventoryMergeable.CanThisMergeWithOther(GrabbableObject mergeWith) { return true; } bool IInventoryMergeable.CanOtherMergeWithThis(GrabbableObject itemRequestingMerge) { return false; } GrabbableObject IInventoryMergeable.GetMergeItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { return itemRequestingMerge; } GrabbableObject IInventoryMergeable.GetMergeItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { return mergeWith; } void IInventoryMergeable.MergeWithOther(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot) { if ((Object)(object)playerMerging == (Object)(object)StartOfRound.Instance.localPlayerController) { ateLocalItem = true; } MoveToItemSlot(mergeWith, playerMerging, otherInSlot); EatEnemy(mergeWith); EatCorpse(mergeWith); } private void EatEnemy(GrabbableObject mergeWith) { if ((Object)(object)mergeWith == (Object)null) { return; } EnemyAI component = ((Component)mergeWith).GetComponent(); if ((Object)(object)component == (Object)null) { return; } Logger.LogDebug((object)$"{this} {((NetworkBehaviour)this).NetworkObjectId} says: \"I MUST CONSUME!!! EATING: ENEMY {component} #{((NetworkBehaviour)component).NetworkObjectId}!!!\""); component.CancelSpecialAnimationWithPlayer(); component.EnableEnemyMesh(false, true, false); AudioSource[] componentsInChildren = ((Component)component).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].volume = 0f; } if (!((NetworkBehaviour)this).IsServer) { return; } EnemyType enemyType = component.enemyType; if ((Object)(object)enemyType != (Object)null && (Object)(object)RoundManager.Instance != (Object)null && !component.removedPowerLevel) { if (enemyType.isDaytimeEnemy) { RoundManager.Instance.currentDaytimeEnemyPower = Mathf.Max(RoundManager.Instance.currentDaytimeEnemyPower - enemyType.PowerLevel, 0f); return; } if (enemyType.isOutsideEnemy) { RoundManager.Instance.currentOutsideEnemyPower = Mathf.Max(RoundManager.Instance.currentOutsideEnemyPower - enemyType.PowerLevel, 0f); return; } RoundManager.Instance.cannotSpawnMoreInsideEnemies = false; RoundManager.Instance.currentEnemyPower = Mathf.Max(RoundManager.Instance.currentEnemyPower - enemyType.PowerLevel, 0f); if (RoundManager.Instance.SpawnedEnemies != null && RoundManager.Instance.SpawnedEnemies.Contains(component)) { RoundManager.Instance.SpawnedEnemies.Remove(component); } } DestroyGameObjectOnCondition destroyGameObjectOnCondition = ((Component)component).gameObject.AddComponent(); destroyGameObjectOnCondition.destroyAfterTime = 1f; destroyGameObjectOnCondition.destroyGameObject = ((Component)component).gameObject; } private void EatCorpse(GrabbableObject mergeWith) { if ((Object)(object)mergeWith == (Object)null) { return; } RagdollGrabbableObject component = ((Component)mergeWith).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.ragdoll == (Object)null)) { GameObject gameObject = ((Component)component.ragdoll).gameObject; Logger.LogDebug((object)$"{this} {((NetworkBehaviour)this).NetworkObjectId} says: \"I MUST CONSUME!!! EATING: CORPSE {component} #{((NetworkBehaviour)component).NetworkObjectId}!!!\""); SkinnedMeshRenderer component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Renderer)component2).enabled = false; } AudioSource[] componentsInChildren = gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].volume = 0f; } if (((NetworkBehaviour)this).IsServer) { DestroyGameObjectOnCondition destroyGameObjectOnCondition = gameObject.gameObject.AddComponent(); destroyGameObjectOnCondition.destroyAfterTime = 1f; destroyGameObjectOnCondition.destroyGameObject = gameObject.gameObject; } } } public override void ReactToSellingItemOnCounter() { ((GrabbableObject)this).ReactToSellingItemOnCounter(); CrashBandicootCratesManagerScript.PlayNoise(eatAudio, screamSFX); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "FakeCrashProp"; } } public class FruitBazookaProp : GrabbableObject, IInventoryMergeable { private static ManualLogSource Logger; [Space(3f)] public Transform projectileOrigin; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); CrashBandicootCratesManagerScript.MergeItem((GrabbableObject)(object)this, removeDestroyedScrapValue: true, muteDestroyedItem: true, 0f, randomizeOrder: false); } bool IInventoryMergeable.CanThisMergeWithOther(GrabbableObject mergeWith) { if ((Object)(object)mergeWith == (Object)null) { return false; } if (ProjectileValid(((Component)mergeWith).gameObject) != -1) { return true; } return false; } bool IInventoryMergeable.CanOtherMergeWithThis(GrabbableObject itemRequestingMerge) { return false; } GrabbableObject IInventoryMergeable.GetMergeItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { return itemRequestingMerge; } GrabbableObject IInventoryMergeable.GetMergeItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { if ((Object)(object)mergeWith == (Object)null) { return null; } WumpaFruitProp component = ((Component)mergeWith).GetComponent(); if ((Object)(object)component != (Object)null && component.stackOf > 1) { return null; } return mergeWith; } void IInventoryMergeable.MergeWithOther(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot) { if ((Object)(object)mergeWith == (Object)null) { return; } int num = ProjectileValid(((Component)mergeWith).gameObject); if (num == -1) { return; } WumpaFruitProp component = ((Component)mergeWith).GetComponent(); if ((Object)(object)component != (Object)null && component.stackOf > 1) { int changeScrapValue = -4; if ((Object)(object)((GrabbableObject)component).itemProperties != (Object)null && (Object)(object)RoundManager.Instance != (Object)null) { changeScrapValue = (int)Mathf.Lerp((float)((GrabbableObject)component).itemProperties.minValue * RoundManager.Instance.scrapValueMultiplier, (float)((GrabbableObject)component).itemProperties.maxValue * RoundManager.Instance.scrapValueMultiplier, 0.5f) * -1; } component.UpdateStack(-1, addOrSnap: true, changeScrapValue, playerMerging); } ShootProjectile(num, playerMerging); } private int ProjectileValid(GameObject fromObject) { ProjectileAmmo component = fromObject.GetComponent(); if ((Object)(object)component == (Object)null) { return -1; } int projectileIndex = component.GetProjectileIndex(); if (projectileIndex < 0 || projectileIndex >= CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count) { return -1; } return projectileIndex; } private void ShootProjectile(int projectileIndex, PlayerControllerB playerMerging) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerMerging != (Object)null && (Object)(object)playerMerging == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ShootProjectileLocal(CrashBandicootCratesManagerScript.allAssets.allProjectiles[projectileIndex], playerMerging, projectileOrigin.position, projectileOrigin.forward); ShootProjectileServerRpc((int)playerMerging.playerClientId, projectileIndex, projectileOrigin.position, projectileOrigin.forward); } } [ServerRpc(RequireOwnership = false)] private void ShootProjectileServerRpc(int playerID, int projectileIndex, Vector3 start, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3967920948u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, projectileIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref start); ((FastBufferWriter)(ref val)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3967920948u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootProjectileClientRpc(playerID, projectileIndex, start, direction); } } } [ClientRpc] private void ShootProjectileClientRpc(int playerID, int projectileIndex, Vector3 start, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(184964274u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, projectileIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref start); ((FastBufferWriter)(ref val)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 184964274u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { ShootProjectileLocal(CrashBandicootCratesManagerScript.allAssets.allProjectiles[projectileIndex], CrashBandicootCratesManagerScript.GetPlayerByID(playerID), start, direction); } } } private void ShootProjectileLocal(GameObject projectile, PlayerControllerB firedBy, Vector3 start, Vector3 direction) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)projectile == (Object)null) && !((Object)(object)projectile.GetComponent() == (Object)null)) { Projectile component = CrashBandicootCratesManagerScript.SpawnLocalObject(projectile, firedBy, start).GetComponent(); if ((Object)(object)component != (Object)null) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: ShootProjectileLocal({projectile}, {firedBy}, {start}, {direction})"); component.CreateProjectile(direction, firedBy); firedBy.externalForceAutoFade += ((Component)firedBy).transform.forward * -3.33f; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3967920948u, new RpcReceiveHandler(__rpc_handler_3967920948), "ShootProjectileServerRpc"); ((NetworkBehaviour)this).__registerRpc(184964274u, new RpcReceiveHandler(__rpc_handler_184964274), "ShootProjectileClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3967920948(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int projectileIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref projectileIndex); Vector3 start = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref start); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((FruitBazookaProp)(object)target).ShootProjectileServerRpc(playerID, projectileIndex, start, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_184964274(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int projectileIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref projectileIndex); Vector3 start = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref start); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((FruitBazookaProp)(object)target).ShootProjectileClientRpc(playerID, projectileIndex, start, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FruitBazookaProp"; } } public class GrabbableVehicle : GrabbableObject, ICrateSpawnableObject, IHittable { public enum GrabbableVehicleState { GrabbableObject, VehicleController, Deactivated } private static ManualLogSource Logger; [Space(3f)] [Header("KART")] public GrabbableVehicleState currentState; [Space(3f)] [Header("Audiovisual")] public AudioSource kartAudioSource; public AudioClip honkSFX; public AudioClip jumpSmallSFX; public AudioClip jumpBigSFX; public AudioClip impactPlayer; public AudioClip[] impactSmallSFX; public AudioClip[] impactBigSFX; private float noiseTimer; [Space] public AudioSource engineAudioIdle; public AudioSource engineAudioDrive; [Space] public MeshRenderer playerPictureContainer; public Material[] randomDecals; public Texture2D[] numberDecals; public MeshRenderer setDecalOf; [Space] public string[] drivingControls; private bool setTooltips; private PlayerControllerB useDecalOf; [Space(3f)] [Header("General")] public Rigidbody carRigidBody; public Transform steeringWheelAnimContainer; [Space] public WheelCollider wheelColliderFrontLeft; public WheelCollider wheelColliderFrontRight; public WheelCollider wheelColliderBackLeft; public WheelCollider wheelColliderBackRight; public WheelCollider[] otherWheels; [Space] public WheelCollider[] steerableWheels; [Space] public Transform wheelTransformFrontLeft; public Transform wheelTransformFrontRight; public Transform wheelTransformBackLeft; public Transform wheelTransformBackRight; [Space] public BoxCollider sittingPlayerCollider; public BoxCollider passengerPlayerCollider; [Space] public PlayerControllerB playerDriving; private PlayerControllerB passengerPlayer; private GrabbableObject passengerItem; private bool localPlayerDriving; private RaycastHit wheelHit; private int wheelHitMask; [Space(3f)] [Header("Parameters")] public float movementSpeed; public float speedForwardMax; public float speedForwardMin; public float speedBackwardMax; public float speedBackwardMin; public float acceleration; public float steerPower; public float steeringWheelTurnSpeed; public float stability; public float straightenSpeed; public float jumpForceMax; public float jumpForceMin; [Space] public float syncSpeedMultiplier; public float syncRotationSpeed; private Vector2 moveInputVector; private float steeringInput; private float steeringAnimValue; private float steeringWheelAnimFloat; private bool inputtingForward; private bool inputtingBackward; private bool inputtingTurning; private float EngineRPM; [Space(3f)] [Header("Interactions")] private float syncCarPositionInterval; private Vector3 syncedPosition; private Quaternion syncedRotation; private bool interactablesOnCooldown; private float stateTimer; private float timeLastJump; private float timeLastImpact; [Space] public InteractTrigger sitTrigger; public InteractTrigger dismountTrigger; public InteractTrigger placeItemTrigger; public InteractTrigger passengerTrigger; public Transform sitTriggerTransform; public Transform dismountTriggerTransform; public Transform placeItemTriggerTransform; [Space(3f)] [Header("Overrides")] public MeshRenderer[] overrideEnableItemMeshes; public Collider[] overrideEnableItemMeshesColliders; public Collider[] overrideOnPlayerControlChangeColliders; [Space(3f)] [Header("DEBUG")] public bool debugCar; public override void Start() { //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) Logger.LogInfo((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} Start()!"); CrashBandicootCratesManagerScript.AddKart(this); List list = new List(); Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { string[] array = new string[8] { "Player", "LineOfSight", "PhysicsObject", "PlaceableShipObjects", "Props", "ScanNode", "Triggers", "PlayerRagdoll" }; string[] array2 = new string[6] { "LineOfSight", "PhysicsObject", "PlaceableShipObjects", "Props", "ScanNode", "Triggers" }; val.excludeLayers = LayerMask.op_Implicit(CrashBandicootCratesManagerScript.GetLayerMask(val.isTrigger ? array2 : array)); SetColliderCollision(val, setTo: true); if (((Component)val).tag != "DoNotSet") { list.Add(val); } } } base.propColliders = list.ToArray(); SetColliderCollision((Collider)(object)sittingPlayerCollider, setTo: false); SetColliderCollision((Collider)(object)passengerPlayerCollider, setTo: false); string[] allStrings = new string[7] { "Default", "Room", "Colliders", "Terrain", "Railing", "Vehicle", "InteractableObject" }; wheelHitMask = CrashBandicootCratesManagerScript.GetLayerMask(allStrings); base.originalScale = ((Component)this).transform.localScale; MeshRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Renderer)componentsInChildren2[i]).renderingLayerMask = 1u; } SkinnedMeshRenderer[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren3.Length; i++) { ((Renderer)componentsInChildren3[i]).renderingLayerMask = 1u; } SetUpTrigger(sitTrigger); SetUpTrigger(dismountTrigger); SetUpTrigger(placeItemTrigger); SetUpTrigger(passengerTrigger); SetTriggerInteractables(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); EnableCollidersItemMeshes(enable: false); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); ((GrabbableObject)this).EnableItemMeshes(true); EnableCollidersItemMeshes(enable: true); } public override void EnableItemMeshes(bool enable) { for (int i = 0; i < overrideEnableItemMeshes.Length; i++) { ((Renderer)overrideEnableItemMeshes[i]).enabled = enable; } } private void EnableCollidersItemMeshes(bool enable) { for (int i = 0; i < overrideEnableItemMeshesColliders.Length; i++) { SetColliderCollision(overrideEnableItemMeshesColliders[i], enable); } } private void EnableCollidersControlChange(bool enable) { for (int i = 0; i < overrideOnPlayerControlChangeColliders.Length; i++) { SetColliderCollision(overrideOnPlayerControlChangeColliders[i], enable); } } private void SetUpTrigger(InteractTrigger trigger) { trigger.hoverIcon = StartOfRound.Instance.allPlayerScripts[0].grabItemIcon; ((Component)trigger).transform.SetParent((Transform)null); } private void SetTriggerToTransform(InteractTrigger setTrigger, Transform toTransform) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ((Component)setTrigger).transform.position = toTransform.position; ((Component)setTrigger).transform.rotation = toTransform.rotation; } private void SetTriggerInteractables() { Logger.LogDebug((object)"SetTriggerInteractables()"); base.currentUseCooldown = 0f; interactablesOnCooldown = false; sitTrigger.interactable = currentState != GrabbableVehicleState.Deactivated && (Object)(object)playerDriving == (Object)null; dismountTrigger.interactable = currentState != GrabbableVehicleState.Deactivated && (Object)(object)playerDriving != (Object)null && localPlayerDriving; placeItemTrigger.interactable = currentState != GrabbableVehicleState.Deactivated && ((Object)(object)playerDriving == (Object)null || !localPlayerDriving); passengerTrigger.interactable = currentState != GrabbableVehicleState.Deactivated && ((Object)(object)playerDriving == (Object)null || !localPlayerDriving); } private void SetTriggersOnCooldown() { Logger.LogDebug((object)"SetTriggersOnCooldown()"); base.currentUseCooldown = base.useCooldown; interactablesOnCooldown = true; sitTrigger.interactable = false; dismountTrigger.interactable = false; placeItemTrigger.interactable = false; } private void RemoveAllTriggers() { Object.Destroy((Object)(object)((Component)sitTrigger).gameObject); Object.Destroy((Object)(object)((Component)dismountTrigger).gameObject); Object.Destroy((Object)(object)((Component)placeItemTrigger).gameObject); Object.Destroy((Object)(object)((Component)passengerTrigger).gameObject); } private void SetColliderCollision(InteractTrigger thisTrigger, bool setTo) { if (!((Object)(object)thisTrigger == (Object)null)) { SetColliderCollision(((Component)thisTrigger).GetComponent(), setTo); } } private void SetColliderCollision(Collider thisCollider, bool setTo) { if ((Object)(object)thisCollider == (Object)null) { return; } thisCollider.enabled = setTo; MeshRenderer component = ((Component)thisCollider).GetComponent(); if ((Object)(object)component != (Object)null) { if (debugCar) { ((Renderer)component).enabled = thisCollider.enabled; } else { ((Renderer)component).enabled = false; } } } public override void Update() { if (!base.deactivated && !((Object)(object)StartOfRound.Instance == (Object)null) && !((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)) { DoGlobalUpdate(); switch (currentState) { case GrabbableVehicleState.GrabbableObject: DoUpdateGrabbableObject(); break; case GrabbableVehicleState.VehicleController: DoUpdateVehicleController(); break; case GrabbableVehicleState.Deactivated: DoUpdateDeactivated(); break; } } } private void DoGlobalUpdate() { if (base.currentUseCooldown > 0f) { base.currentUseCooldown -= Time.deltaTime; } else if (interactablesOnCooldown) { SetTriggerInteractables(); } if (stateTimer > 0f) { stateTimer -= Time.deltaTime; } else { stateTimer = 1f; if ((Object)(object)CrashBandicootCratesManagerScript.Instance != (Object)null && CrashBandicootCratesManagerScript.Instance.allCurrentVehicles != null && CrashBandicootCratesManagerScript.Instance.allCurrentVehicles.Count > 0) { stateTimer = 0.33f * (float)CrashBandicootCratesManagerScript.Instance.allCurrentVehicles.Count; } DoCurrentStateCheck(); } SetTriggerToTransform(sitTrigger, sitTriggerTransform); SetTriggerToTransform(dismountTrigger, dismountTriggerTransform); SetTriggerToTransform(placeItemTrigger, placeItemTriggerTransform); SetTriggerToTransform(passengerTrigger, placeItemTriggerTransform); if (((NetworkBehaviour)this).IsOwner) { if (!base.wasOwnerLastFrame) { base.wasOwnerLastFrame = true; } } else if (base.wasOwnerLastFrame) { base.wasOwnerLastFrame = false; } DoAudioCheck(); } private void DoUpdateGrabbableObject() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) syncedPosition = ((Component)this).transform.position; if ((Object)(object)passengerPlayer != (Object)null && (Object)(object)passengerPlayer == (Object)(object)StartOfRound.Instance.localPlayerController) { TryStopBeingPassenger(teleportPlayer: true); } if ((Object)(object)passengerItem != (Object)null) { TryDroppingItem(); } if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy == (Object)null && (Object)(object)base.parentObject == (Object)null) { if ((base.isInShipRoom && !StartOfRound.Instance.shipHasLanded) || (StartOfRound.Instance.currentLevelID == 3 && (Object)(object)((Component)this).GetComponentInParent() != (Object)null)) { SwitchState(GrabbableVehicleState.Deactivated); } else { SwitchState(GrabbableVehicleState.VehicleController); } } } private void DoUpdateVehicleController() { SetCarEffects(); if (((NetworkBehaviour)this).IsServer) { if ((Object)(object)playerDriving != (Object)null && !playerDriving.isPlayerControlled && !playerDriving.isPlayerDead) { TryStopDrivingVehicle(playerDriving); return; } if ((Object)(object)passengerPlayer != (Object)null && !passengerPlayer.isPlayerControlled && !passengerPlayer.isPlayerDead) { TryStopBeingPassenger(passengerPlayer); return; } } if (!((NetworkBehaviour)this).IsOwner) { return; } if ((Object)(object)base.playerHeldBy != (Object)null) { SwitchState(GrabbableVehicleState.GrabbableObject); return; } if ((Object)(object)base.parentObject != (Object)null || (base.isInShipRoom && !StartOfRound.Instance.shipHasLanded)) { SwitchState(GrabbableVehicleState.Deactivated); return; } EngineRPM = (wheelColliderFrontLeft.rpm + wheelColliderFrontRight.rpm) / 5f; SyncCarPhysicsToOtherClients(); if ((Object)(object)playerDriving == (Object)null) { wheelColliderFrontLeft.motorTorque = 0f; wheelColliderFrontRight.motorTorque = 0f; wheelColliderBackLeft.motorTorque = 0f; wheelColliderBackRight.motorTorque = 0f; wheelColliderFrontLeft.brakeTorque = 2000f; wheelColliderFrontRight.brakeTorque = 2000f; wheelColliderBackLeft.brakeTorque = 2000f; wheelColliderBackRight.brakeTorque = 2000f; return; } GetVehicleInput(); if (inputtingTurning) { for (int i = 0; i < steerableWheels.Length; i++) { steerableWheels[i].steerAngle = steerPower * steeringInput; } } else { for (int j = 0; j < steerableWheels.Length; j++) { steerableWheels[j].steerAngle = 0f; } } if (inputtingForward) { wheelColliderFrontLeft.motorTorque = Mathf.Clamp(Mathf.MoveTowards(wheelColliderFrontLeft.motorTorque, movementSpeed, acceleration * Time.deltaTime), speedForwardMin, speedForwardMax); wheelColliderFrontRight.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackLeft.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackRight.motorTorque = wheelColliderFrontLeft.motorTorque; for (int k = 0; k < otherWheels.Length; k++) { otherWheels[k].motorTorque = wheelColliderFrontLeft.motorTorque; } } else if (inputtingBackward) { wheelColliderFrontLeft.motorTorque = Mathf.Clamp(Mathf.MoveTowards(0f - wheelColliderFrontLeft.motorTorque / 4f, movementSpeed, acceleration * Time.deltaTime), speedBackwardMin, speedBackwardMax); wheelColliderFrontRight.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackLeft.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackRight.motorTorque = wheelColliderFrontLeft.motorTorque; for (int l = 0; l < otherWheels.Length; l++) { otherWheels[l].motorTorque = wheelColliderFrontLeft.motorTorque; } } else { wheelColliderFrontLeft.motorTorque = Mathf.Clamp(Mathf.MoveTowards(0f, movementSpeed, acceleration / 3f * Time.deltaTime), speedBackwardMax, speedForwardMax); if (wheelColliderFrontLeft.motorTorque < 0.25f) { wheelColliderFrontLeft.motorTorque = 0f; } wheelColliderFrontRight.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackLeft.motorTorque = wheelColliderFrontLeft.motorTorque; wheelColliderBackRight.motorTorque = wheelColliderFrontLeft.motorTorque; for (int m = 0; m < otherWheels.Length; m++) { otherWheels[m].motorTorque = wheelColliderFrontLeft.motorTorque; } } if (inputtingForward == inputtingBackward) { float brakeTorque = ((inputtingForward && inputtingBackward) ? 100f : 1f); wheelColliderFrontLeft.brakeTorque = brakeTorque; wheelColliderFrontRight.brakeTorque = wheelColliderFrontLeft.brakeTorque; wheelColliderBackLeft.brakeTorque = wheelColliderFrontLeft.brakeTorque; wheelColliderBackRight.brakeTorque = wheelColliderFrontLeft.brakeTorque; for (int n = 0; n < otherWheels.Length; n++) { otherWheels[n].brakeTorque = wheelColliderFrontLeft.brakeTorque; } } else { wheelColliderFrontLeft.brakeTorque = 0f; wheelColliderFrontRight.brakeTorque = 0f; wheelColliderBackLeft.brakeTorque = 0f; wheelColliderBackRight.brakeTorque = 0f; for (int num = 0; num < otherWheels.Length; num++) { otherWheels[num].brakeTorque = 0f; } } } private void DoUpdateDeactivated() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) syncedPosition = ((Component)this).transform.position; carRigidBody.isKinematic = true; if (StartOfRound.Instance.currentLevelID == 3) { DepositItemsDesk componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { Logger.LogInfo((object)$"Kart {this} {((NetworkBehaviour)this).NetworkObjectId} placed on company desk, deactivating"); base.deactivated = true; SnapKartToPosition(((Component)componentInParent.deskObjectsContainer).transform.position); return; } } ((Component)this).transform.localPosition = base.targetFloorPosition; if ((Object)(object)passengerPlayer != (Object)null && (Object)(object)passengerPlayer == (Object)(object)StartOfRound.Instance.localPlayerController) { TryStopBeingPassenger(teleportPlayer: true); } if ((Object)(object)passengerItem != (Object)null) { TryDroppingItem(); } if (((NetworkBehaviour)this).IsOwner) { if ((Object)(object)base.playerHeldBy != (Object)null) { SwitchState(GrabbableVehicleState.GrabbableObject); } else if (StartOfRound.Instance.shipHasLanded && !((Object)(object)base.parentObject != (Object)null)) { SwitchState(GrabbableVehicleState.VehicleController); } } } private void FixedUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) Vector3 angularVelocity = carRigidBody.angularVelocity; Vector3 val = Vector3.Cross(Quaternion.AngleAxis(((Vector3)(ref angularVelocity)).magnitude * 57.29578f * stability / straightenSpeed, carRigidBody.angularVelocity) * ((Component)this).transform.up, Vector3.up); carRigidBody.AddTorque(val * straightenSpeed * straightenSpeed); if (!((NetworkBehaviour)this).IsOwner) { carRigidBody.isKinematic = true; Vector3 val2 = Vector3.Lerp(((Component)this).transform.position, syncedPosition, Time.fixedDeltaTime * syncSpeedMultiplier); carRigidBody.MovePosition(val2); carRigidBody.MoveRotation(Quaternion.Lerp(((Component)this).transform.rotation, syncedRotation, syncRotationSpeed)); } } public override void LateUpdate() { ((GrabbableObject)this).LateUpdate(); if (localPlayerDriving && !setTooltips) { setTooltips = true; HUDManager.Instance.ChangeControlTipMultiple(drivingControls, false, (Item)null); } } private void DoCurrentStateCheck() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = StartOfRound.Instance.shipBounds.bounds; base.isInElevator = ((Bounds)(ref bounds)).Contains(((Component)this).transform.position); bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; base.isInShipRoom = ((Bounds)(ref bounds)).Contains(((Component)this).transform.position); base.isInFactory = ((Component)this).transform.position.y < -80f; if (!base.isInShipRoom) { base.reachedFloorTarget = false; } if (base.isInShipRoom && !base.reachedFloorTarget && (Object)(object)base.parentObject == (Object)null && currentState == GrabbableVehicleState.Deactivated && Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.down, ref wheelHit, 80f, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { float distance = ((RaycastHit)(ref wheelHit)).distance; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"hitDistance = {distance}"); } if (distance > 1f) { ((Component)this).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); base.targetFloorPosition = ((Component)this).transform.parent.InverseTransformPoint(((RaycastHit)(ref wheelHit)).point + Vector3.up * 0.55f); ((Component)this).transform.localEulerAngles = Vector3.zero; base.reachedFloorTarget = true; } } if ((Object)(object)base.playerHeldBy == (Object)null && StartOfRound.Instance.inShipPhase) { bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (!((Bounds)(ref bounds)).Contains(((Component)this).transform.position)) { SnapKartToPosition(StartOfRound.Instance.middleOfShipNode.position); } } DoBackCushionCheck(); } private void DoBackCushionCheck() { if (currentState == GrabbableVehicleState.Deactivated || currentState == GrabbableVehicleState.GrabbableObject || (Object)(object)passengerPlayer != (Object)null || (Object)(object)passengerItem != (Object)null) { SetColliderCollision(placeItemTrigger, setTo: false); SetColliderCollision(passengerTrigger, setTo: false); if ((Object)(object)passengerPlayer != (Object)null && (!passengerPlayer.isPlayerControlled || (Object)(object)((Component)passengerPlayer).transform.parent != (Object)(object)passengerTrigger.overridePlayerParent)) { SetPassengerPlayer(null, teleportPlayerOff: true); } if ((Object)(object)passengerItem != (Object)null) { bool flag = false; if (passengerItem.isHeld || passengerItem.deactivated || passengerItem.isHeldByEnemy) { flag = true; } if (!flag) { RagdollGrabbableObject component = ((Component)passengerItem).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.ragdoll != (Object)null && (Object)(object)component.ragdoll.attachedTo == (Object)null) { flag = true; } } if (flag) { SetPassengerItem(null); } } } else { bool flag2 = (Object)(object)StartOfRound.Instance.localPlayerController.currentlyHeldObjectServer != (Object)null; SetColliderCollision(placeItemTrigger, !flag2); SetColliderCollision(passengerTrigger, flag2); } OnPassengerChange(); } private void DoAudioCheck() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) int num = 0; if ((Object)(object)wheelColliderFrontLeft != (Object)null && wheelColliderFrontLeft.isGrounded) { num++; } if ((Object)(object)wheelColliderFrontRight != (Object)null && wheelColliderFrontRight.isGrounded) { num++; } if ((Object)(object)wheelColliderBackLeft != (Object)null && wheelColliderBackLeft.isGrounded) { num++; } if ((Object)(object)wheelColliderBackRight != (Object)null && wheelColliderBackRight.isGrounded) { num++; } Vector3 velocity = carRigidBody.velocity; float targetVolume = Mathf.Clamp(((Vector3)(ref velocity)).magnitude * Mathf.Abs(EngineRPM) * 0.00025f, 0f, 1f); SetAudioSourcePlaying(engineAudioDrive, targetVolume, 1.1f - (float)num * 0.1f, 0.1f); if (((NetworkBehaviour)this).IsOwner && engineAudioDrive.isPlaying) { noiseTimer += Time.deltaTime; if (noiseTimer > 1f) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, engineAudioDrive.maxDistance * 0.9f, engineAudioDrive.volume, 0, false, 0); noiseTimer = 0f; } } else { noiseTimer = 0f; } SetAudioSourcePlaying(engineAudioIdle, 1f - engineAudioDrive.volume, 1f, 0.25f); } private void SetAudioSourcePlaying(AudioSource sourceToPlay, float targetVolume, float targetPitch, float threshold) { sourceToPlay.volume = Mathf.Lerp(sourceToPlay.volume, targetVolume, 0.25f); sourceToPlay.pitch = Mathf.Lerp(sourceToPlay.pitch, targetPitch, 0.1f); if (sourceToPlay.volume <= threshold && sourceToPlay.isPlaying) { sourceToPlay.Stop(); } else if (sourceToPlay.volume > threshold && !sourceToPlay.isPlaying) { sourceToPlay.Play(); } } private void GetVehicleInput() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)CrashBandicootCratesManagerScript.Instance != (Object)null && (Object)(object)CrashBandicootCratesManagerScript.Instance.escapeMenu != (Object)null && !CrashBandicootCratesManagerScript.Instance.escapeMenu.isMenuOpen) { moveInputVector = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); } steeringInput = Mathf.Clamp(steeringInput + moveInputVector.x * steeringWheelTurnSpeed * Time.deltaTime, -3f, 3f); steeringAnimValue = moveInputVector.x; inputtingTurning = moveInputVector.x > 0.1f || moveInputVector.x < -0.1f; inputtingForward = moveInputVector.y > 0.1f; inputtingBackward = moveInputVector.y < -0.1f; if (!inputtingTurning) { float num = ((steeringInput > 0f) ? (-1f) : 1f); steeringInput = Mathf.Clamp(steeringInput + num * steeringWheelTurnSpeed * Time.deltaTime, -3f, 3f); } } private void SetCarEffects() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerDriving == (Object)null) { steeringAnimValue = 0f; EngineRPM = 0f; inputtingTurning = false; } float num = steeringAnimValue; if (!inputtingTurning && (steeringWheelAnimFloat > 0.1f || steeringWheelAnimFloat < -0.1f)) { num = ((steeringWheelAnimFloat > 0f) ? (-1f) : 1f); } _ = steeringWheelAnimFloat; steeringWheelAnimFloat = Mathf.Clamp(steeringWheelAnimFloat + num * steeringWheelTurnSpeed * Time.deltaTime / 6f, -0.99f, 0.99f); if (steeringAnimValue != 0f) { steeringWheelAnimContainer.Rotate(Vector3.back, steeringAnimValue * steeringWheelTurnSpeed / 8f * Time.deltaTime * 60f, (Space)1); if ((Object)(object)playerDriving != (Object)null) { playerDriving.playerBodyAnimator.SetFloat("animationSpeed", playerDriving.playerBodyAnimator.GetFloat("animationSpeed") + steeringAnimValue * steeringWheelTurnSpeed / 4500f * Time.deltaTime * 60f); } } MatchWheelPositions(calculateHeight: true); } private void MatchWheelPositions(bool calculateHeight) { //IL_000c: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) wheelTransformFrontLeft.localEulerAngles = new Vector3(wheelTransformFrontLeft.localEulerAngles.x, steeringWheelAnimFloat * 25f, 0f); MatchWheelTransformToCollider(wheelTransformFrontLeft, wheelColliderFrontLeft, calculateHeight); wheelTransformFrontRight.localEulerAngles = new Vector3(wheelTransformFrontRight.localEulerAngles.x, steeringWheelAnimFloat * 25f, 0f); MatchWheelTransformToCollider(wheelTransformFrontRight, wheelColliderFrontRight, calculateHeight); MatchWheelTransformToCollider(wheelTransformBackLeft, wheelColliderBackLeft, calculateHeight); MatchWheelTransformToCollider(wheelTransformBackRight, wheelColliderBackRight, calculateHeight); } private void MatchWheelTransformToCollider(Transform wheelTransform, WheelCollider wheelCollider, bool calculateWheelHeight) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)wheelCollider).transform.position; if (!calculateWheelHeight || Vector3.Angle(((Component)this).transform.up, Vector3.up) > 75f) { wheelTransform.position = position; } else if (Physics.Raycast(position, -((Component)wheelCollider).transform.up, ref wheelHit, wheelCollider.suspensionDistance + wheelCollider.radius, wheelHitMask)) { wheelTransform.position = ((RaycastHit)(ref wheelHit)).point + ((Component)wheelCollider).transform.up * wheelCollider.radius; } else { wheelTransform.position = position - ((Component)wheelCollider).transform.up * wheelCollider.suspensionDistance; } wheelTransform.position += ((Component)this).transform.up * 0.25f; wheelTransform.Rotate(Vector3.right, EngineRPM * Time.deltaTime * 0.66f, (Space)1); } public void DoCollisionImpact(Collider collider, KartCollisionEvents impactScript) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = carRigidBody.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (!((NetworkBehaviour)this).IsOwner || currentState != GrabbableVehicleState.VehicleController || !(Time.realtimeSinceStartup - timeLastImpact > 0.33f) || magnitude < 1f) { return; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)$"DoCollisionImpact() on {((Object)impactScript).name} \"{impactScript.collisionType}\" with {collider}: magnitude = {magnitude}"); } Vector3 val = Vector3.Normalize(carRigidBody.velocity); if (magnitude > 5f && impactScript.collisionType == KartCollisionEvents.KartCollisionType.Driver && (Object)(object)playerDriving != (Object)null && !playerDriving.isPlayerDead) { int num = (int)(magnitude / 1f); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"hitDriver: {playerDriving} // hitDirection {val} // hitForce: {num}"); } DamagePlayerInKartServerRpc((int)playerDriving.playerClientId, num, val, magnitude * 1.75f); timeLastImpact = Time.realtimeSinceStartup; } else if (magnitude > 5f && impactScript.collisionType == KartCollisionEvents.KartCollisionType.Passenger && (Object)(object)passengerPlayer != (Object)null && !passengerPlayer.isPlayerDead) { int num2 = (int)(magnitude / 1f); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"hitPassenger: {passengerPlayer} // hitDirection {val} // hitForce: {num2}"); } DamagePlayerInKartServerRpc((int)passengerPlayer.playerClientId, num2, val, magnitude * 2.25f); timeLastImpact = Time.realtimeSinceStartup; } else { if (impactScript.collisionType != KartCollisionEvents.KartCollisionType.General) { return; } if (magnitude > 10f && (Object)(object)playerDriving != (Object)null && !playerDriving.isPlayerDead) { int num3 = (int)(magnitude / 5f); if (playerDriving.criticallyInjured) { num3 *= 2; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"passToDriver: {playerDriving} // hitDirection {val} // hitForce: {num3}"); } DamagePlayerInKartServerRpc((int)playerDriving.playerClientId, num3, val, magnitude * 2.9f); } if (magnitude > 10f && (Object)(object)passengerPlayer != (Object)null && !passengerPlayer.isPlayerDead) { int num4 = (int)(magnitude / 5f); if (passengerPlayer.criticallyInjured) { num4 *= 2; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"passToPassenger: {passengerPlayer} // hitDirection {val} // hitForce: {num4}"); } DamagePlayerInKartServerRpc((int)passengerPlayer.playerClientId, num4, val, magnitude * 2.5f); } if (magnitude > 2.5f) { Vector3 impactPosition = ((Component)kartAudioSource).transform.position; if ((Object)(object)collider != (Object)null) { impactPosition = Vector3.Lerp(((Component)this).transform.position, ((Component)collider).transform.position, 0.33f); } PlayImpactNoise(impactPosition); timeLastImpact = Time.realtimeSinceStartup; } } } public void DoTriggerEnter(Collider collider, KartCollisionEvents impactScript) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = carRigidBody.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (!((NetworkBehaviour)this).IsOwner || currentState != GrabbableVehicleState.VehicleController || !(Time.realtimeSinceStartup - timeLastImpact > 0.33f) || magnitude < 1f) { return; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogInfo((object)$"DoTriggerEnter() on {((Object)impactScript).name} \"{impactScript.collisionType}\" with {collider}: magnitude = {magnitude}"); } Vector3 val = ((Component)collider).transform.position - ((Component)this).transform.position; PlayerControllerB componentInParent = ((Component)collider).GetComponentInParent(); if (magnitude > 12.5f && (Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent != (Object)(object)playerDriving && (Object)(object)componentInParent != (Object)(object)passengerPlayer && !componentInParent.isPlayerDead) { int num = (int)(magnitude / 0.5f); int num2 = 0; if ((Object)(object)passengerPlayer != (Object)null) { num2 = (int)(magnitude / 1.5f); } num += num2; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"hitPlayer: {componentInParent} // hitDirection {val} // bonusForce: {num2} // hitForce: {num}"); } DamagePlayerInKartServerRpc((int)componentInParent.playerClientId, num, val, magnitude * 3.33f); timeLastImpact = Time.realtimeSinceStartup; return; } EnemyAICollisionDetect component = ((Component)collider).GetComponent(); if (magnitude > 10f && (Object)(object)component != (Object)null && (Object)(object)component.mainScript != (Object)null && !component.mainScript.isEnemyDead) { int num3 = (int)(magnitude / 5f); int num4 = 0; if ((Object)(object)passengerPlayer != (Object)null) { num4 = (int)(magnitude / 8f); } num3 += num4; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"hitEnemy: {component} // hitDirection {val} // bonusForce: {num4} // hitForce: {num3}"); } component.mainScript.HitEnemyOnLocalClient(num3, val, playerDriving, true, -1); int overrideImpact = (((int)component.mainScript.enemyType.EnemySize != 0) ? 1 : 0); PlayImpactNoise(((Component)component).transform.position, overrideImpact); timeLastImpact = Time.realtimeSinceStartup; return; } DoorLock component2 = ((Component)collider).GetComponent(); if ((Object)(object)component2 != (Object)null && !component2.isDoorOpened && ((Object)(object)playerDriving != (Object)null || magnitude > 5f) && (!component2.isLocked || ((Object)(object)passengerPlayer != (Object)null && magnitude > 10f))) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"hitDoor: {component2} // isLocked: {component2.isLocked} // playerDriving: {playerDriving} // passengerPlayer: {passengerPlayer}"); } if (component2.isLocked) { component2.UnlockDoorSyncWithServer(); } ((Component)component2).GetComponent().TriggerAnimationNonPlayer(magnitude > 10f, true, false); component2.OpenDoorAsEnemyServerRpc(); timeLastImpact = Time.realtimeSinceStartup; } } [ServerRpc(RequireOwnership = false)] private void DamagePlayerInKartServerRpc(int playerID, int hitForce, Vector3 hitDirection, float physicsForce) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2279990507u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, hitForce); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hitDirection); ((FastBufferWriter)(ref val)).WriteValueSafe(ref physicsForce, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2279990507u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerInKartClientRpc(playerID, hitForce, hitDirection, physicsForce); } } } [ClientRpc] private void DamagePlayerInKartClientRpc(int playerID, int hitForce, Vector3 hitDirection, float physicsForce) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2832958537u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, hitForce); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hitDirection); ((FastBufferWriter)(ref val)).WriteValueSafe(ref physicsForce, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2832958537u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID < 0 || playerID >= StartOfRound.Instance.allPlayerScripts.Length) { return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)val3 == (Object)null) { return; } Vector3 val4 = Vector3.Normalize(hitDirection) * physicsForce; Vector3 val5 = Vector3.ClampMagnitude(val4, 75f); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)$"normal: {((Vector3)(ref val4)).magnitude} // clamped: {((Vector3)(ref val5)).magnitude}"); } Vector3 position = val3.lowerSpine.position; bool flag = true; if ((Object)(object)val3 != (Object)null && (((Vector3)(ref val5)).magnitude > 55f || ((Object)(object)val3 != (Object)(object)playerDriving && (Object)(object)val3 != (Object)(object)passengerPlayer))) { if (val3.health > 20) { CrashBandicootCratesManagerScript.PlayNoise(val3.movementAudio, impactPlayer); } else { flag = false; CrashBandicootCratesManagerScript.PlayNoiseAtLocation(position, impactPlayer); } if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { val3.externalForceAutoFade += val5 + Vector3.up * 5f; } } if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{val3.health} - {hitForce} = {val3.health - hitForce} (is {val3.health - hitForce <= 0} and {val3.health <= 20}) to create: {val3.health - hitForce <= 0 && val3.health <= 20}"); } if (val3.health - hitForce <= 0 && val3.health <= 20) { hitForce = 100; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"locally getting hit with hitForce: {hitForce}"); } GameNetworkManager.Instance.localPlayerController.DamagePlayer(hitForce, true, true, (CauseOfDeath)16, 0, false, val5 + Vector3.up * 5f); } if (flag) { PlayImpactNoiseLocal(position, hitForce > 15); } else { CrashBandicootCratesManagerScript.PlayNoise(kartAudioSource, impactBigSFX[Random.Range(0, impactBigSFX.Length)]); } } private void PlayImpactNoise(Vector3 impactPosition, int overrideImpact = -1) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) bool flag = false; if (overrideImpact == -1) { Vector3 velocity = carRigidBody.velocity; flag = ((Vector3)(ref velocity)).magnitude > 12.5f; } else { flag = overrideImpact == 1; } PlayImpactNoiseLocal(impactPosition, flag); PlayImpactNoiseServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, impactPosition, flag); } [ServerRpc(RequireOwnership = false)] private void PlayImpactNoiseServerRpc(int playerID, Vector3 impactPosition, bool bigImpact) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2782987135u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref impactPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref bigImpact, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2782987135u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayImpactNoiseClientRpc(playerID, impactPosition, bigImpact); } } } [ClientRpc] private void PlayImpactNoiseClientRpc(int playerID, Vector3 impactPosition, bool bigImpact) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(544063796u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref impactPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref bigImpact, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 544063796u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { PlayImpactNoiseLocal(impactPosition, bigImpact); } } } private void PlayImpactNoiseLocal(Vector3 impactPosition, bool bigImpact) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) AudioClip val = null; val = ((!bigImpact) ? impactSmallSFX[Random.Range(0, impactSmallSFX.Length)] : impactBigSFX[Random.Range(0, impactBigSFX.Length)]); float noiseRange = (bigImpact ? 20f : 8f); float noiseLoudness = (bigImpact ? 1f : 0.33f); CrashBandicootCratesManagerScript.PlayNoiseAtLocation(impactPosition, val, bigImpact, noiseRange, noiseLoudness); } public void TryDrivingVehicle(PlayerControllerB interactingPlayer) { if ((Object)(object)interactingPlayer == (Object)null) { interactingPlayer = StartOfRound.Instance.localPlayerController; } if ((Object)(object)playerDriving != (Object)null) { interactingPlayer.CancelSpecialTriggerAnimations(); return; } interactingPlayer.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); interactingPlayer.playerBodyAnimator.SetInteger("SA_CarAnim", 1); int num = (int)interactingPlayer.playerClientId; SetPlayerDrivingLocal(num); SetNewPlayerDrivingServerRpc(num, takeControl: true); } public void TryStopDrivingVehicle(bool teleportPlayer) { TryStopDrivingVehicle(StartOfRound.Instance.localPlayerController, teleportPlayer); } public void TryStopDrivingVehicle(PlayerControllerB interactingPlayer, bool teleportPlayer = false) { if (!((Object)(object)playerDriving == (Object)null) && !((Object)(object)playerDriving != (Object)(object)interactingPlayer)) { interactingPlayer.playerBodyAnimator.SetInteger("SA_CarAnim", 0); int num = (int)interactingPlayer.playerClientId; StopPlayerDrivingLocal(num, teleportPlayer); SetNewPlayerDrivingServerRpc(num, takeControl: false); } } [ServerRpc(RequireOwnership = false)] private void SetNewPlayerDrivingServerRpc(int drivingPlayerID, bool takeControl) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1834321297u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, drivingPlayerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref takeControl, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1834321297u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (drivingPlayerID < 0 || drivingPlayerID >= StartOfRound.Instance.allPlayerScripts.Length) { return; } if (!takeControl) { StopPlayerDrivingClientRpc(drivingPlayerID); return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[drivingPlayerID]; if (!((Object)(object)val3 == (Object)null) && !val3.isPlayerDead && val3.isPlayerControlled) { if ((Object)(object)playerDriving == (Object)null || (Object)(object)playerDriving == (Object)(object)val3) { ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(val3.actualClientId); SetPlayerDrivingClientRpc(drivingPlayerID); } else if ((Object)(object)playerDriving != (Object)(object)val3) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SERVER DECISION: kick {val3} because {playerDriving} is in control"); StopPlayerDrivingClientRpc(drivingPlayerID); } } } [ClientRpc] private void SetPlayerDrivingClientRpc(int newPlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2137477751u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, newPlayerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2137477751u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (newPlayerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { SetPlayerDrivingLocal(newPlayerID); } } } private void SetPlayerDrivingLocal(int newPlayerID) { if (newPlayerID >= 0 && newPlayerID < StartOfRound.Instance.allPlayerScripts.Length) { playerDriving = StartOfRound.Instance.allPlayerScripts[newPlayerID]; playerDriving.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); OnPlayerControlChange(); Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} locally set in control: {playerDriving} // localPlayerDriving? {localPlayerDriving}"); } } [ClientRpc] private void StopPlayerDrivingClientRpc(int removedPlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3538969789u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, removedPlayerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3538969789u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (removedPlayerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { StopPlayerDrivingLocal(removedPlayerID); } } } private void StopPlayerDrivingLocal(int removedPlayerID, bool teleportPlayer = false) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (removedPlayerID < 0 || removedPlayerID >= StartOfRound.Instance.allPlayerScripts.Length) { return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[removedPlayerID]; if ((Object)(object)playerDriving == (Object)(object)val) { playerDriving = null; } val.CancelSpecialTriggerAnimations(); if (localPlayerDriving) { HUDManager.Instance.ClearControlTips(); StartOfRound.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); if (teleportPlayer) { StartOfRound.Instance.localPlayerController.TeleportPlayer(ChooseExitTeleportLocation(sitTriggerTransform.position), false, 0f, false, true); StartOfRound.Instance.localPlayerController.externalForceAutoFade = Vector3.zero; } } OnPlayerControlChange(); } private Vector3 ChooseExitTeleportLocation(Vector3 pos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6] { ((Component)this).transform.up, ((Component)this).transform.up * -1f, ((Component)this).transform.right, ((Component)this).transform.right * -1f, ((Component)this).transform.forward, ((Component)this).transform.forward * -1f }; for (int i = 0; i < array.Length; i++) { Vector3 val = pos + array[i]; Vector3 val2 = pos - array[i] * 2f; Vector3 val3 = pos - array[i]; if (!Physics.Linecast(val, val2, wheelHitMask, (QueryTriggerInteraction)1) && Physics.Linecast(val2, val2 - Vector3.up * 5f, wheelHitMask, (QueryTriggerInteraction)1)) { Logger.LogDebug((object)$"ChooseExitTeleportLocation(): [{i}] = {val3}"); return val3; } } return pos + Vector3.up * 2f; } private void OnPlayerControlChange() { setTooltips = false; localPlayerDriving = (Object)(object)playerDriving != (Object)null && (Object)(object)playerDriving == (Object)(object)StartOfRound.Instance.localPlayerController; if (localPlayerDriving) { IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed += TryJumping; HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(drivingControls, false, (Item)null); } else { IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed -= TryJumping; } SetColliderCollision((Collider)(object)sittingPlayerCollider, (Object)(object)playerDriving != (Object)null); SetTriggersOnCooldown(); base.grabbable = (Object)(object)playerDriving == (Object)null; Logger.LogDebug((object)$"playerDriving = {playerDriving} & localPlayerDriving? {localPlayerDriving}"); if ((Object)(object)passengerItem != (Object)null) { CrateGrabbableObject component = ((Component)passengerItem).GetComponent(); if ((Object)(object)component != (Object)null) { bool flag = (Object)(object)playerDriving == (Object)null || (Object)(object)playerDriving != (Object)(object)StartOfRound.Instance.localPlayerController; Logger.LogDebug((object)$"Crate {component} #{((NetworkBehaviour)component).NetworkObjectId} on back cushion during control change, locally setting its colliders to {flag}"); component.EnableColliders(flag); } } EnableCollidersControlChange((Object)(object)playerDriving == (Object)null); } public void TryBecomingPassenger(PlayerControllerB interactingPlayer) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)interactingPlayer == (Object)null) { interactingPlayer = StartOfRound.Instance.localPlayerController; } if ((Object)(object)passengerPlayer != (Object)null) { interactingPlayer.CancelSpecialTriggerAnimations(); return; } interactingPlayer.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); interactingPlayer.playerBodyAnimator.SetInteger("SA_CarAnim", 0); SetNewPassengerObjectLocal(((NetworkBehaviour)interactingPlayer).NetworkObject, interactingPlayer); SetNewPassengerObjectServerRpc((int)interactingPlayer.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)interactingPlayer).NetworkObject)); } public void TryStopBeingPassenger(bool teleportPlayer) { TryStopBeingPassenger(StartOfRound.Instance.localPlayerController, teleportPlayer); } public void TryStopBeingPassenger(PlayerControllerB interactingPlayer, bool teleportPlayer = false) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)passengerPlayer == (Object)null) && !((Object)(object)interactingPlayer != (Object)(object)passengerPlayer)) { SetNewPassengerObjectLocal(((NetworkBehaviour)this).NetworkObject, interactingPlayer, teleportPlayer); SetNewPassengerObjectServerRpc((int)interactingPlayer.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject)); } } public void TryPlacingItem(PlayerControllerB interactingPlayer) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)interactingPlayer == (Object)null) && !((Object)(object)interactingPlayer != (Object)(object)StartOfRound.Instance.localPlayerController) && !((Object)(object)interactingPlayer.currentlyHeldObjectServer == (Object)null) && !((Object)(object)passengerItem != (Object)null) && !((Object)(object)passengerPlayer != (Object)null)) { GrabbableObject currentlyHeldObjectServer = interactingPlayer.currentlyHeldObjectServer; SetNewPassengerObjectLocal(((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject, interactingPlayer); SetNewPassengerObjectServerRpc((int)interactingPlayer.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject)); } } private void TryDroppingItem() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)passengerItem == (Object)null)) { Logger.LogDebug((object)$"TryDroppingItem(): {passengerItem} // parent? {((Component)passengerItem).transform.parent}"); if ((Object)(object)((Component)passengerItem).transform.parent == (Object)(object)((Component)this).transform) { ((Component)passengerItem).transform.SetParent((Transform)null, true); passengerItem.parentObject = null; } passengerItem.hasHitGround = false; passengerItem.reachedFloorTarget = false; passengerItem.fallTime = 0f; CrashBandicootCratesManagerScript.CalculateTargetFloorPosition(passengerItem, ((Component)passengerItem).transform.position + Vector3.up * 1.5f, base.playerHeldBy); SetPassengerItem(null); } } [ServerRpc(RequireOwnership = false)] private void SetNewPassengerObjectServerRpc(int playerID, NetworkObjectReference objectNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4139413594u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4139413594u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetNewPassengerObjectClientRpc(playerID, objectNOR); } } } [ClientRpc] private void SetNewPassengerObjectClientRpc(int playerID, NetworkObjectReference objectNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1996327425u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1996327425u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { NetworkObject netObj = default(NetworkObject); if (((NetworkObjectReference)(ref objectNOR)).TryGet(ref netObj, (NetworkManager)null)) { SetNewPassengerObjectLocal(netObj, CrashBandicootCratesManagerScript.GetPlayerByID(playerID)); } else { Logger.LogError((object)"SetNewPassengerObjectClientRpc: failed to get NetworkObject"); } } } private void SetNewPassengerObjectLocal(NetworkObject netObj, PlayerControllerB interactingPlayer, bool teleportPlayer = false) { if ((Object)(object)netObj == (Object)null) { return; } if ((Object)(object)netObj == (Object)(object)((NetworkBehaviour)this).NetworkObject) { Logger.LogDebug((object)$"SetNewPassengerObjectLocal on {this} #{((NetworkBehaviour)this).NetworkObjectId} given self, interpreting as removing passenger"); SetPassengerPlayer(null, teleportPlayer); SetPassengerItem(null); } else if ((Object)(object)passengerItem == (Object)null && (Object)(object)passengerPlayer == (Object)null) { PlayerControllerB component = ((Component)netObj).GetComponent(); GrabbableObject component2 = ((Component)netObj).GetComponent(); if ((Object)(object)component != (Object)null) { SetPassengerPlayer(component); } else if ((Object)(object)component2 != (Object)null) { ReplicatePlaceObject(component2, interactingPlayer); SetPassengerItem(component2); } } OnPassengerChange(); } private void ReplicatePlaceObject(GrabbableObject item, PlayerControllerB player) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item != (Object)null && (Object)(object)item.itemProperties != (Object)null && (Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)StartOfRound.Instance.localPlayerController) { player.DiscardHeldObject(true, ((NetworkBehaviour)this).NetworkObject, ((Component)this).transform.InverseTransformPoint(((Component)placeItemTrigger).transform.position + ((Component)this).transform.up * item.itemProperties.verticalOffset), true); } } private void SetPassengerPlayer(PlayerControllerB setTo, bool teleportPlayerOff = false) { if ((Object)(object)setTo == (Object)null && (Object)(object)passengerPlayer != (Object)null && (Object)(object)passengerPlayer == (Object)(object)StartOfRound.Instance.localPlayerController) { passengerPlayer.CancelSpecialTriggerAnimations(); StartOfRound.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } if ((Object)(object)setTo != (Object)null && (Object)(object)passengerPlayer == (Object)null) { StartOfRound.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); if ((Object)(object)passengerPlayer == (Object)(object)StartOfRound.Instance.localPlayerController) { HUDManager.Instance.ClearControlTips(); } } passengerPlayer = setTo; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} set passenger PLAYER: {passengerPlayer}"); } private void SetPassengerItem(GrabbableObject setTo) { if ((Object)(object)setTo == (Object)null && (Object)(object)passengerItem != (Object)null) { RagdollGrabbableObject component = ((Component)passengerItem).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.ragdoll != (Object)null) { if (passengerItem.isHeld || passengerItem.isHeldByEnemy || (Object)(object)passengerItem.parentObject != (Object)null) { component.heldByEnemy = Object.op_Implicit((Object)(object)((Component)passengerItem.parentObject).GetComponentInParent()); component.ragdoll.attachedTo = ((Component)component).transform; } else { component.heldByEnemy = false; component.ragdoll.attachedTo = null; component.ragdoll.attachedLimb = null; component.ragdoll.matchPositionExactly = false; } } } if ((Object)(object)setTo != (Object)null && (Object)(object)passengerItem == (Object)null) { RagdollGrabbableObject component2 = ((Component)setTo).GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.ragdoll != (Object)null) { component2.heldByEnemy = true; component2.ragdoll.attachedTo = placeItemTriggerTransform; component2.ragdoll.attachedLimb = component2.ragdoll.bodyParts[5]; component2.ragdoll.matchPositionExactly = true; component2.ragdoll.canBeGrabbedBackByPlayers = true; } } passengerItem = setTo; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} set passenger ITEM: {passengerItem}"); } private void OnPassengerChange() { SetColliderCollision((Collider)(object)passengerPlayerCollider, (Object)(object)passengerPlayer != (Object)null); bool setTo = (Object)(object)passengerPlayer == (Object)null && (Object)(object)passengerItem == (Object)null; SetColliderCollision(placeItemTrigger, setTo); SetColliderCollision(passengerTrigger, setTo); } private void TryJumping(CallbackContext context) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (((CallbackContext)(ref context)).performed && CanJump()) { float num = Mathf.Clamp(Mathf.Abs(EngineRPM) * 2.5f, jumpForceMin, jumpForceMax); Logger.LogDebug((object)$"jumping with EngineRPM {EngineRPM} and upValue {num}"); carRigidBody.AddForce(Vector3.up * num, (ForceMode)1); playerDriving.playerBodyAnimator.SetTrigger("SA_JumpInCar"); DoJumpLocal(num); DoJumpServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, num); } } [ServerRpc(RequireOwnership = false)] private void DoJumpServerRpc(int playerID, float upValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3149007279u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref upValue, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3149007279u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoJumpClientRpc(playerID, upValue); } } } [ClientRpc] private void DoJumpClientRpc(int playerID, float upValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1321845789u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref upValue, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1321845789u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { DoJumpLocal(upValue); } } } private void DoJumpLocal(float upValue) { timeLastJump = Time.realtimeSinceStartup; AudioClip clip = ((upValue > (jumpForceMax + jumpForceMin) / 2f) ? jumpBigSFX : jumpSmallSFX); CrashBandicootCratesManagerScript.PlayNoise(kartAudioSource, clip); } private bool CanJump() { //IL_0063: 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) if (!((NetworkBehaviour)this).IsOwner || (Object)(object)playerDriving == (Object)null || Time.realtimeSinceStartup - timeLastJump < 0.65f) { return false; } if ((Object)(object)CrashBandicootCratesManagerScript.Instance == (Object)null || (Object)(object)CrashBandicootCratesManagerScript.Instance.escapeMenu == (Object)null || CrashBandicootCratesManagerScript.Instance.escapeMenu.isMenuOpen) { return false; } if (Vector3.Angle(((Component)this).transform.up, Vector3.up) > 55f) { return true; } int num = 0; int num2 = 0; if ((Object)(object)wheelColliderFrontLeft != (Object)null) { num++; if (wheelColliderFrontLeft.isGrounded) { num2++; } } if ((Object)(object)wheelColliderFrontRight != (Object)null) { num++; if (wheelColliderFrontRight.isGrounded) { num2++; } } if ((Object)(object)wheelColliderBackLeft != (Object)null) { num++; if (wheelColliderBackLeft.isGrounded) { num2++; } } if ((Object)(object)wheelColliderBackRight != (Object)null) { num++; if (wheelColliderBackRight.isGrounded) { num2++; } } for (int i = 0; i < otherWheels.Length; i++) { if ((Object)(object)otherWheels[i] != (Object)null) { num++; if (otherWheels[i].isGrounded) { num2++; } } } if (num2 >= num / 3) { return true; } return false; } private void SwitchState(GrabbableVehicleState switchTo) { if (((NetworkBehaviour)this).IsOwner) { SwitchStateLocal((int)switchTo); SwitchStateServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, (int)switchTo); } } [ServerRpc(RequireOwnership = false)] private void SwitchStateServerRpc(int playerID, int newState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1886338404u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, newState); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1886338404u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchStateClientRpc(playerID, newState); } } } [ClientRpc] private void SwitchStateClientRpc(int playerID, int newState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1300613181u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, newState); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1300613181u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { SwitchStateLocal(newState); } } } private void SwitchStateLocal(int newState) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) currentState = (GrabbableVehicleState)newState; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SwitchStateLocal(): {newState} translates to {currentState.ToString()}"); carRigidBody.isKinematic = currentState != GrabbableVehicleState.VehicleController || !((NetworkBehaviour)this).IsOwner; stateTimer = 0f; switch (currentState) { case GrabbableVehicleState.GrabbableObject: if ((Object)(object)playerDriving != (Object)null && localPlayerDriving) { TryStopDrivingVehicle(teleportPlayer: true); } EngineRPM = 0f; steeringAnimValue = 0f; MatchWheelPositions(calculateHeight: false); break; case GrabbableVehicleState.VehicleController: syncedPosition = ((Component)this).transform.position; CrashBandicootCratesManagerScript.PlayNoise(kartAudioSource, honkSFX, audibleNoise: true, 5f, 0.1f); SetTriggerInteractables(); break; case GrabbableVehicleState.Deactivated: if ((Object)(object)playerDriving != (Object)null && localPlayerDriving) { TryStopDrivingVehicle(teleportPlayer: true); } EngineRPM = 0f; steeringAnimValue = 0f; base.reachedFloorTarget = false; MatchWheelPositions(calculateHeight: false); SetTriggerInteractables(); break; } } private void SyncCarPhysicsToOtherClients() { //IL_0026: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { return; } carRigidBody.isKinematic = false; if (syncCarPositionInterval > 0.15f) { if (Vector3.Distance(syncedPosition, ((Component)this).transform.position) > 0.06f || syncCarPositionInterval > 10f) { syncCarPositionInterval = 0f; syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.rotation; SyncCarPositionServerRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles, moveInputVector.x, EngineRPM); } else if (Vector3.Angle(((Component)this).transform.forward, syncedRotation * Vector3.forward) > 2f) { syncCarPositionInterval = 0f; syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.rotation; SyncCarPositionServerRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles, moveInputVector.x, EngineRPM); } } else { syncCarPositionInterval += Time.deltaTime; } } [ServerRpc(RequireOwnership = false)] private void SyncCarPositionServerRpc(Vector3 carPosition, Vector3 carRotation, float steerInput, float rpm) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(265980989u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref carPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val)).WriteValueSafe(ref steerInput, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rpm, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 265980989u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncCarPositionClientRpc(carPosition, carRotation, steerInput, rpm); } } } [ClientRpc] private void SyncCarPositionClientRpc(Vector3 carPosition, Vector3 carRotation, float steerInput, float rpm) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3771064464u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref carPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val)).WriteValueSafe(ref steerInput, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rpm, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3771064464u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { carRigidBody.isKinematic = false; syncedPosition = carPosition; syncedRotation = Quaternion.Euler(carRotation); steeringAnimValue = steerInput; inputtingTurning = steerInput > 0.1f || steeringInput < -0.1f; EngineRPM = rpm; } } } private void SnapKartToPosition(Vector3 toPosition, Vector3 toRotation = default(Vector3)) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) carRigidBody.isKinematic = true; ((Component)this).transform.position = toPosition; if (toRotation == default(Vector3)) { toRotation = Vector3.zero; } ((Component)this).transform.rotation = Quaternion.Euler(toRotation); if (((NetworkBehaviour)this).IsOwner && currentState == GrabbableVehicleState.VehicleController) { carRigidBody.isKinematic = false; } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2802568201u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2802568201u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int playerDecalID = -1; if ((Object)(object)useDecalOf != (Object)null) { playerDecalID = (int)useDecalOf.playerClientId; } SyncUponJoinClientRpc(playerID, (int)currentState, ((Component)this).transform.position, ((Component)this).transform.eulerAngles, GetRandomDecal(), playerDecalID); } } [ClientRpc] private void SyncUponJoinClientRpc(int playerID, int stateIndex, Vector3 serverPosition, Vector3 serverRotation, int kartDecalID, int playerDecalID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2983969444u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, stateIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref serverPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref serverRotation); BytePacker.WriteValueBitPacked(val, kartDecalID); BytePacker.WriteValueBitPacked(val, playerDecalID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2983969444u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { syncedPosition = serverPosition; syncedRotation = Quaternion.Euler(serverRotation); SnapKartToPosition(syncedPosition, ((Quaternion)(ref syncedRotation)).eulerAngles); SwitchStateLocal(stateIndex); FillDecalWithSteamProfile(CrashBandicootCratesManagerScript.GetPlayerByID(playerDecalID)); SetRandomDecals(kartDecalID); } } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (currentState == GrabbableVehicleState.VehicleController) { carRigidBody.AddForce(hitDirection * (float)force * 10f + Vector3.up * 25f, (ForceMode)1); return true; } return false; } void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { FillDecalWithSteamProfile(spawnedByPlayer); SetRandomDecals(); } private void SetRandomDecals(int useIndex = -1) { int num = useIndex; if (num == -1) { num = new Random(CrashBandicootCratesManagerScript.GetRandomSeed()).Next(0, randomDecals.Length); } Material val = randomDecals[num]; Logger.LogDebug((object)$"decalIndex [{num}] : {val}"); ((Renderer)setDecalOf).material = val; } private int GetRandomDecal() { if ((Object)(object)setDecalOf == (Object)null || (Object)(object)((Renderer)setDecalOf).material == (Object)null || randomDecals == null || randomDecals.Length == 0) { return 0; } for (int i = 0; i < randomDecals.Length; i++) { if ((Object)(object)randomDecals[i] != (Object)null && ((Object)randomDecals[i]).name == ((Object)((Renderer)setDecalOf).material).name.Replace(" (Instance)", "")) { return i; } } return 0; } private async void FillDecalWithSteamProfile(PlayerControllerB spawnedByPlayer) { useDecalOf = spawnedByPlayer; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} FillDecalWithSteamProfile({useDecalOf})"); if (GameNetworkManager.Instance.disableSteam || !SteamClient.IsValid) { int num; if ((Object)(object)useDecalOf != (Object)null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"Decal condition 1"); } num = (int)useDecalOf.playerClientId % 4; } else { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"Decal condition 2"); } num = new Random(CrashBandicootCratesManagerScript.GetRandomSeed()).Next(0, numberDecals.Length); } ((Renderer)playerPictureContainer).material.mainTexture = (Texture)(object)numberDecals[num]; } else { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"Decal condition 3"); } Material material = ((Renderer)playerPictureContainer).material; material.mainTexture = (Texture)(object)HUDManager.GetTextureFromImage(await SteamFriends.GetLargeAvatarAsync(SteamId.op_Implicit(useDecalOf.playerSteamId))); } } private void OnDisable() { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} OnDisable()"); if ((Object)(object)playerDriving != (Object)null && localPlayerDriving) { TryStopDrivingVehicle(playerDriving); } RemoveAllTriggers(); CrashBandicootCratesManagerScript.RemoveKart(this); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2279990507u, new RpcReceiveHandler(__rpc_handler_2279990507), "DamagePlayerInKartServerRpc"); ((NetworkBehaviour)this).__registerRpc(2832958537u, new RpcReceiveHandler(__rpc_handler_2832958537), "DamagePlayerInKartClientRpc"); ((NetworkBehaviour)this).__registerRpc(2782987135u, new RpcReceiveHandler(__rpc_handler_2782987135), "PlayImpactNoiseServerRpc"); ((NetworkBehaviour)this).__registerRpc(544063796u, new RpcReceiveHandler(__rpc_handler_544063796), "PlayImpactNoiseClientRpc"); ((NetworkBehaviour)this).__registerRpc(1834321297u, new RpcReceiveHandler(__rpc_handler_1834321297), "SetNewPlayerDrivingServerRpc"); ((NetworkBehaviour)this).__registerRpc(2137477751u, new RpcReceiveHandler(__rpc_handler_2137477751), "SetPlayerDrivingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3538969789u, new RpcReceiveHandler(__rpc_handler_3538969789), "StopPlayerDrivingClientRpc"); ((NetworkBehaviour)this).__registerRpc(4139413594u, new RpcReceiveHandler(__rpc_handler_4139413594), "SetNewPassengerObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(1996327425u, new RpcReceiveHandler(__rpc_handler_1996327425), "SetNewPassengerObjectClientRpc"); ((NetworkBehaviour)this).__registerRpc(3149007279u, new RpcReceiveHandler(__rpc_handler_3149007279), "DoJumpServerRpc"); ((NetworkBehaviour)this).__registerRpc(1321845789u, new RpcReceiveHandler(__rpc_handler_1321845789), "DoJumpClientRpc"); ((NetworkBehaviour)this).__registerRpc(1886338404u, new RpcReceiveHandler(__rpc_handler_1886338404), "SwitchStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(1300613181u, new RpcReceiveHandler(__rpc_handler_1300613181), "SwitchStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(265980989u, new RpcReceiveHandler(__rpc_handler_265980989), "SyncCarPositionServerRpc"); ((NetworkBehaviour)this).__registerRpc(3771064464u, new RpcReceiveHandler(__rpc_handler_3771064464), "SyncCarPositionClientRpc"); ((NetworkBehaviour)this).__registerRpc(2802568201u, new RpcReceiveHandler(__rpc_handler_2802568201), "SyncUponJoinServerRpc"); ((NetworkBehaviour)this).__registerRpc(2983969444u, new RpcReceiveHandler(__rpc_handler_2983969444), "SyncUponJoinClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2279990507(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int hitForce = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitForce); Vector3 hitDirection = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitDirection); float physicsForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref physicsForce, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).DamagePlayerInKartServerRpc(playerID, hitForce, hitDirection, physicsForce); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2832958537(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int hitForce = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitForce); Vector3 hitDirection = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitDirection); float physicsForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref physicsForce, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).DamagePlayerInKartClientRpc(playerID, hitForce, hitDirection, physicsForce); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2782987135(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 impactPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref impactPosition); bool bigImpact = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bigImpact, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).PlayImpactNoiseServerRpc(playerID, impactPosition, bigImpact); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_544063796(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 impactPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref impactPosition); bool bigImpact = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bigImpact, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).PlayImpactNoiseClientRpc(playerID, impactPosition, bigImpact); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1834321297(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int drivingPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref drivingPlayerID); bool takeControl = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref takeControl, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SetNewPlayerDrivingServerRpc(drivingPlayerID, takeControl); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2137477751(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerDrivingClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerDrivingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SetPlayerDrivingClientRpc(playerDrivingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3538969789(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int removedPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref removedPlayerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).StopPlayerDrivingClientRpc(removedPlayerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4139413594(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference objectNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SetNewPassengerObjectServerRpc(playerID, objectNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1996327425(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference objectNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SetNewPassengerObjectClientRpc(playerID, objectNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3149007279(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); float upValue = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref upValue, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).DoJumpServerRpc(playerID, upValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1321845789(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); float upValue = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref upValue, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).DoJumpClientRpc(playerID, upValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1886338404(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int newState = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newState); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SwitchStateServerRpc(playerID, newState); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1300613181(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int newState = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newState); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SwitchStateClientRpc(playerID, newState); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_265980989(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 carPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carPosition); Vector3 carRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); float steerInput = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref steerInput, default(ForPrimitives)); float rpm = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rpm, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SyncCarPositionServerRpc(carPosition, carRotation, steerInput, rpm); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3771064464(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 carPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carPosition); Vector3 carRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); float steerInput = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref steerInput, default(ForPrimitives)); float rpm = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rpm, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SyncCarPositionClientRpc(carPosition, carRotation, steerInput, rpm); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2802568201(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2983969444(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int stateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateIndex); Vector3 serverPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref serverPosition); Vector3 serverRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref serverRotation); int kartDecalID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref kartDecalID); int playerDecalID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerDecalID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableVehicle)(object)target).SyncUponJoinClientRpc(playerID, stateIndex, serverPosition, serverRotation, kartDecalID, playerDecalID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GrabbableVehicle"; } } public class WumpaFruitProp : GrabbableObject, IInventoryMergeable { private static ManualLogSource Logger; public int stackOf; public ScanNodeProperties scanNode; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (((NetworkBehaviour)this).IsOwner) { CrashBandicootCratesManagerScript.MergeItem((GrabbableObject)(object)this, removeDestroyedScrapValue: false, muteDestroyedItem: true); if (stackOf > 1) { string[] array = new string[1] { $"Stack of {stackOf} {base.itemProperties.itemName}s" }; HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(array, true, base.itemProperties); } } } bool IInventoryMergeable.CanOtherMergeWithThis(GrabbableObject itemRequestingMerge) { if ((Object)(object)itemRequestingMerge == (Object)null || (Object)(object)itemRequestingMerge.itemProperties == (Object)null) { return false; } if ((Object)(object)itemRequestingMerge.itemProperties == (Object)(object)base.itemProperties) { return true; } return false; } bool IInventoryMergeable.CanThisMergeWithOther(GrabbableObject mergeWith) { return false; } void IInventoryMergeable.MergeWithOther(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot) { WumpaFruitProp component = ((Component)mergeWith).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)playerMerging == (Object)null)) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} executing merge code with {mergeWith} #{((NetworkBehaviour)mergeWith).NetworkObjectId}"); component.UpdateStack(stackOf, addOrSnap: true, base.scrapValue, playerMerging); } } GrabbableObject IInventoryMergeable.GetMergeItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { return itemRequestingMerge; } GrabbableObject IInventoryMergeable.GetMergeItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { return itemRequestingMerge; } public void UpdateStack(int changeStack, bool addOrSnap, int changeScrapValue = 0, PlayerControllerB inPlayerInventory = null) { if (addOrSnap) { stackOf += changeStack; } else { stackOf = changeStack; } ((GrabbableObject)this).SetScrapValue(Mathf.Max(1, base.scrapValue + changeScrapValue)); UpdateScanNode(); Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: UpdateStack() to {stackOf} with value {base.scrapValue}"); if (stackOf >= 100) { Logger.LogDebug((object)$"locally found {this} #{((NetworkBehaviour)this).NetworkObjectId} to have a stackOf {stackOf}, trying to spawn oneUp"); SpawnOneUp(inPlayerInventory); } } private void SpawnOneUp(PlayerControllerB player) { if ((Object)(object)player == (Object)null) { player = base.playerHeldBy; if ((Object)(object)player == (Object)null) { Logger.LogError((object)$"SpawnOneUp() on {this} #{((NetworkBehaviour)this).NetworkObjectId} failed to find proper player to merge item out of, returning!"); return; } } UpdateStack(-100, addOrSnap: true, (int)((float)base.scrapValue * -0.9f)); if (stackOf <= 0) { CrashBandicootCratesManagerScript.DestroyItem((GrabbableObject)(object)this); } if (((NetworkBehaviour)this).IsServer) { SpawnOneUpClientRpc((int)player.playerClientId); } } [ClientRpc] private void SpawnOneUpClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(60997305u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 60997305u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Logger.LogDebug((object)"SpawnOneUpClientRpc()"); if (playerID < 0 || playerID >= StartOfRound.Instance.allPlayerScripts.Length) { Logger.LogError((object)$"playerID [{playerID}] outside array bounds!"); return; } PlayerControllerB playerByID = CrashBandicootCratesManagerScript.GetPlayerByID(playerID); CrashBandicootCratesManagerScript.SpawnLocalObject(CrashBandicootCratesManagerScript.allAssets.allBonusObjects[1], playerByID, playerByID.serverItemHolder.position, null, null, 3.33f); } } private void UpdateScanNode() { if (!((Object)(object)scanNode == (Object)null)) { if (stackOf > 1) { scanNode.headerText = $"{stackOf} {base.itemProperties.itemName}"; } else { scanNode.headerText = base.itemProperties.itemName; } } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2292038240u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2292038240u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.deactivated || stackOf > 1) { SyncUponJoinClientRpc(playerID, base.deactivated, stackOf); } } } [ClientRpc] private void SyncUponJoinClientRpc(int playerID, bool hostDeactivated, int hostStackOf) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2274452113u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hostDeactivated, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hostStackOf); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2274452113u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { Logger.LogDebug((object)$"Locally received data for {((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId}: stackOf = {stackOf} & deactived = {base.deactivated}"); if (hostDeactivated) { CrashBandicootCratesManagerScript.DestroyItem((GrabbableObject)(object)this); } else { UpdateStack(hostStackOf, addOrSnap: false); } } } public override int GetItemDataToSave() { return stackOf; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); UpdateStack(saveData, addOrSnap: false); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(60997305u, new RpcReceiveHandler(__rpc_handler_60997305), "SpawnOneUpClientRpc"); ((NetworkBehaviour)this).__registerRpc(2292038240u, new RpcReceiveHandler(__rpc_handler_2292038240), "SyncUponJoinServerRpc"); ((NetworkBehaviour)this).__registerRpc(2274452113u, new RpcReceiveHandler(__rpc_handler_2274452113), "SyncUponJoinClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_60997305(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((WumpaFruitProp)(object)target).SpawnOneUpClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2292038240(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((WumpaFruitProp)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2274452113(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool hostDeactivated = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostDeactivated, default(ForPrimitives)); int hostStackOf = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostStackOf); target.__rpc_exec_stage = (__RpcExecStage)1; ((WumpaFruitProp)(object)target).SyncUponJoinClientRpc(playerID, hostDeactivated, hostStackOf); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "WumpaFruitProp"; } } public class CrashBandicootCratesManagerScript : NetworkBehaviour { [HarmonyPatch] public class CrashBandicootCratesMiscellaneousPatches { [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public static void FillEndGameStatsPrefix() { Logger.LogDebug((object)"Starting FillEndGameStats Prefix"); if ((Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.livingPlayers == StartOfRound.Instance.connectedPlayersAmount + 1) { return; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (i < playerOneUps.Length && !((Object)(object)val == (Object)null) && val.isPlayerDead && playerOneUps[i] > 0) { StartOfRound.Instance.allPlayersDead = false; break; } } Logger.LogDebug((object)$"Finished FillEndGameStats Postfix with allPlayersDead {StartOfRound.Instance.allPlayersDead}"); } [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public static void FillEndGameStatsPostfix() { Logger.LogDebug((object)$"Starting FillEndGameStats Postfix with livingPlayers {StartOfRound.Instance.livingPlayers}"); if ((Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.livingPlayers == StartOfRound.Instance.connectedPlayersAmount + 1) { return; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (i < playerOneUps.Length && !((Object)(object)val == (Object)null) && val.isPlayerDead && playerOneUps[i] > 0) { StartOfRound instance = StartOfRound.Instance; instance.livingPlayers++; playerOneUps[i]--; HUDManager.Instance.statsUIElements.playerStates[i].sprite = Instance.oneUpSprite; Logger.LogDebug((object)$"removing {val.playerUsername}'s oneUp to remaining: {playerOneUps[i]}"); } } Logger.LogDebug((object)$"Finished FillEndGameStats Postfix with livingPlayers {StartOfRound.Instance.livingPlayers}"); } [HarmonyPostfix] [HarmonyPatch(typeof(Landmine), "SpawnExplosion")] public static void SpawnExplosionPostfix(Vector3 explosionPosition, float damageRange, float physicsForce) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null) { return; } if (logDetail) { Logger.LogDebug((object)$"I: {explosionPosition}"); } if (Instance.allCurrentCrates != null || Instance.allCurrentCrates.Count != 0) { if (logDetail) { Logger.LogDebug((object)$"II: {Instance.allCurrentCrates.Count}"); } foreach (CrateGrabbableObject allCurrentCrate in Instance.allCurrentCrates) { if (logDetail) { Logger.LogDebug((object)"III"); } if ((Object)(object)allCurrentCrate == (Object)null || !((NetworkBehaviour)allCurrentCrate).IsOwner || ((GrabbableObject)allCurrentCrate).deactivated || allCurrentCrate.destroyed || ((GrabbableObject)allCurrentCrate).isPocketed) { if (logDetail) { Logger.LogDebug((object)"IV"); } continue; } if (logDetail) { Logger.LogDebug((object)"V"); } Vector3 position = allCurrentCrate.topOfCrate.position; float num = Vector3.Distance(explosionPosition, position); if (logDetail) { Logger.LogDebug((object)$"VI: {num}"); } if (num > damageRange || num < 0.1f) { if (logDetail) { Logger.LogDebug((object)"VII"); } continue; } if (logDetail) { Logger.LogDebug((object)"VIII"); } if (!Physics.Linecast(explosionPosition + Vector3.up * 0.25f, position, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { if (logDetail) { Logger.LogDebug((object)"IX"); } Logger.LogDebug((object)$"Explosion at {explosionPosition} attacking crate {allCurrentCrate} #{((NetworkBehaviour)allCurrentCrate).NetworkObjectId}!"); if (logDetail) { Logger.LogDebug((object)"X"); } allCurrentCrate.AttackCrate(); } if (logDetail) { Logger.LogDebug((object)"XI"); } } } if (Instance.allCurrentVehicles != null && Instance.allCurrentVehicles.Count != 0) { if (logDetail) { Logger.LogDebug((object)$"XII: {Instance.allCurrentVehicles.Count}"); } foreach (GrabbableVehicle allCurrentVehicle in Instance.allCurrentVehicles) { if (logDetail) { Logger.LogDebug((object)"XIII"); } if ((Object)(object)allCurrentVehicle == (Object)null || !((NetworkBehaviour)allCurrentVehicle).IsOwner || ((GrabbableObject)allCurrentVehicle).deactivated) { if (logDetail) { Logger.LogDebug((object)"XIV"); } continue; } if (logDetail) { Logger.LogDebug((object)"XV"); } Vector3 position2 = ((Component)allCurrentVehicle).transform.position; float num2 = Vector3.Distance(explosionPosition, position2); if (logDetail) { Logger.LogDebug((object)$"XVI: {num2}"); } if (num2 > damageRange * 2f || num2 < 0.1f) { if (logDetail) { Logger.LogDebug((object)"XVII"); } continue; } if (logDetail) { Logger.LogDebug((object)"XVIII"); } if (!Physics.Linecast(explosionPosition + Vector3.up * 0.25f, position2, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { if (logDetail) { Logger.LogDebug((object)"XIX"); } Logger.LogDebug((object)$"Explosion at {explosionPosition} attacking KART {allCurrentVehicle} #{((NetworkBehaviour)allCurrentVehicle).NetworkObjectId}!"); if (logDetail) { Logger.LogDebug((object)"XX"); } allCurrentVehicle.carRigidBody.AddExplosionForce(physicsForce * 20f, explosionPosition, 12f, 15f, (ForceMode)1); } if (logDetail) { Logger.LogDebug((object)"XXI"); } } } Logger.LogDebug((object)"XXII"); } [HarmonyPrefix] [HarmonyPatch(typeof(ShipTeleporter), "TeleportPlayerOutWithInverseTeleporter")] public static void Prefix(int playerObj, ref Vector3 teleportPos, out CrateGrabbableObject __state) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) CrateGrabbableObject crateGrabbableObject = (__state = GetCheckpointPosIfValid()); if ((Object)(object)__state != (Object)null) { Vector3 rightNextToCrate = GetRightNextToCrate(((Component)crateGrabbableObject).transform.position, playerObj); Logger.LogDebug((object)$"Found valid checkpoint pos {rightNextToCrate}"); teleportPos = rightNextToCrate; } } [HarmonyPostfix] [HarmonyPatch(typeof(ShipTeleporter), "TeleportPlayerOutWithInverseTeleporter")] public static void Postfix(int playerObj, CrateGrabbableObject __state) { if ((Object)(object)__state == (Object)null) { Logger.LogDebug((object)"PLAYER teleport failed to find checkpoint last state"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; val.isInElevator = ((GrabbableObject)__state).isInElevator; val.isInHangarShipRoom = ((GrabbableObject)__state).isInShipRoom; val.isInsideFactory = ((GrabbableObject)__state).isInFactory; AudioReverbPresets val2 = Object.FindAnyObjectByType(); if (!((Object)(object)val2 != (Object)null)) { return; } int num = -1; if (val.isInHangarShipRoom) { num = 3; } else { EntranceTeleport[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (EntranceTeleport val3 in array) { if (val.isInsideFactory == val3.isEntranceToBuilding) { num = val3.audioReverbPreset; break; } } } if (num == -1) { Logger.LogDebug((object)"failed to find preset"); } else { val2.audioPresets[num].ChangeAudioReverbForPlayer(val); } } [HarmonyPrefix] [HarmonyPatch(typeof(ShipTeleporter), "teleportBodyOut")] public static void teleportBodyOutPrefix(int playerObj, ref Vector3 teleportPosition) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0072: Unknown result type (might be due to invalid IL or missing references) Logger.LogDebug((object)$"!!! starting checkpoint intercept for BODY #{playerObj}"); CrateGrabbableObject checkpointPosIfValid = GetCheckpointPosIfValid(); if ((Object)(object)checkpointPosIfValid != (Object)null) { Vector3 val = ((Component)checkpointPosIfValid).transform.position + Vector3.up + Vector3.up * ((float)playerObj * 0.1f); Logger.LogDebug((object)$"Found valid checkpoint pos {val}"); teleportPosition = val; } } private static CrateGrabbableObject GetCheckpointPosIfValid() { Logger.LogDebug((object)"starting GetCheckpointPosIfValid"); ManualCameraRenderer mapScreen = StartOfRound.Instance.mapScreen; if (mapScreen.targetTransformIndex < 0 || mapScreen.targetTransformIndex >= mapScreen.radarTargets.Count || mapScreen.radarTargets[mapScreen.targetTransformIndex] == null) { Logger.LogDebug((object)"null"); return null; } CrateGrabbableObject component = ((Component)mapScreen.radarTargets[mapScreen.targetTransformIndex].transform).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.crateData.crateType == CrateType.Checkpoint && component.specialInt == 1) { return component; } return null; } private static Vector3 GetRightNextToCrate(Vector3 cratePos, int playerID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_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_0093: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) Vector3 result = cratePos; Vector3[] array = OrderDirections(playerID % 4); for (int i = 0; i < array.Length; i++) { Vector3 val = cratePos + Vector3.up * 0.25f; Vector3 val2 = val + array[i]; if (logDetail) { Logger.LogDebug((object)$"[{i}]: {val2}"); } if (!Physics.Linecast(val, val2, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { if (logDetail) { Logger.LogDebug((object)"Success!"); } result = val2; break; } } return result; } private static Vector3[] OrderDirections(int startAt) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0081: Unknown result type (might be due to invalid IL or missing references) if (logDetail) { Logger.LogDebug((object)"STARTING ORDERDIRECTIONS()!!"); } Vector3[] array = (Vector3[])(object)new Vector3[4]; Vector3[] array2 = (Vector3[])(object)new Vector3[4] { Vector3.forward, Vector3.right, Vector3.back, Vector3.left }; int num = startAt; for (int i = 0; i < array.Length; i++) { array[i] = array2[num]; if (logDetail) { Logger.LogDebug((object)$"index: {num} | dir: {array2[num]}"); } num = (num + 1) % array2.Length; } return array; } } private static ManualLogSource Logger; public static CrashBandicootCratesManagerScript Instance; public static CrashBandicootCratesAllAssets allAssets; public static bool logDetail; public static float pauseTimeCooldown = 0f; private static float setGlobalTime = -1f; public List allCurrentCrates; public List allCurrentProjectiles; public List allCurrentVehicles; [Space] public Sprite oneUpSprite; public static int[] playerOneUps; [Space] public GameObject floatPosTemplate; public CauseOfDeath[] invalidAkuDeaths; [Space] public AudioSource tempAudioSource; public AudioSource tempAudioSource2; [HideInInspector] public QuickMenuManager escapeMenu; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; logDetail = Application.isEditor; ((Component)this).transform.SetParent(Plugin.SearchForObject("SimonTendoManagers", ((Component)StartOfRound.Instance).transform.parent).transform); ((Object)((Component)this).gameObject).name = "LCCrashBandicootCratesMod"; allCurrentCrates = new List(); allCurrentProjectiles = new List(); allCurrentVehicles = new List(); escapeMenu = Object.FindAnyObjectByType(); } private void Update() { if (pauseTimeCooldown > 0f) { if (setGlobalTime == -1f) { setGlobalTime = TimeOfDay.Instance.globalTime; Logger.LogDebug((object)$"{this} pause START set TimeOfDay.globalTime to {TimeOfDay.Instance.globalTime} after registering {setGlobalTime}"); } TimeOfDay.Instance.globalTime = setGlobalTime; pauseTimeCooldown -= Time.deltaTime; } else if (setGlobalTime != -1f) { TimeOfDay.Instance.globalTime = setGlobalTime; setGlobalTime = -1f; Logger.LogDebug((object)$"{this} pause END set TimeOfDay.globalTime to {TimeOfDay.Instance.globalTime} and reset registered to {setGlobalTime}"); } } public void SetTimeSpeedCooldown(float cooldown, bool addOrSnap = true) { if (addOrSnap) { pauseTimeCooldown += cooldown; } else { pauseTimeCooldown = cooldown; } if (logDetail) { Logger.LogDebug((object)$"SetTimeSpeedCooldown({cooldown}, {addOrSnap}): set to {pauseTimeCooldown}"); } } public static void SetUpVariables() { playerOneUps = new int[StartOfRound.Instance.allPlayerScripts.Length]; Logger.LogDebug((object)$"SetUpVariables(): playerOneUps.Length = {playerOneUps.Length}"); AkuAkuProp.localAku = null; for (int i = 0; i < playerOneUps.Length; i++) { Transform playerGlobalHead = StartOfRound.Instance.allPlayerScripts[i].playerGlobalHead; Object.Instantiate(Instance.floatPosTemplate, playerGlobalHead); } } public static void AddCrate(CrateGrabbableObject crate) { if ((Object)(object)crate != (Object)null && !crate.destroyed && (Object)(object)Instance != (Object)null && Instance.allCurrentCrates != null && !Instance.allCurrentCrates.Contains(crate)) { Logger.LogDebug((object)$"adding CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId} at index [{Instance.allCurrentCrates.Count}]"); Instance.allCurrentCrates.Add(crate); } } public static void RemoveCrate(CrateGrabbableObject crate) { if ((Object)(object)crate != (Object)null && (Object)(object)Instance != (Object)null && Instance.allCurrentCrates != null && Instance.allCurrentCrates.Contains(crate)) { Logger.LogDebug((object)$"removing CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); Instance.allCurrentCrates.Remove(crate); DestroyItem((GrabbableObject)(object)crate, removeScrapValue: true, muteAudio: false); EraseCrateFromMapRadar(crate); } } public static void AddCrateToMapRadar(CrateGrabbableObject crate, string radarName) { if (!((Object)(object)crate == (Object)null) && !((Object)(object)StartOfRound.Instance == (Object)null) && !((Object)(object)StartOfRound.Instance.mapScreen == (Object)null)) { StartOfRound.Instance.mapScreen.AddTransformAsTargetToRadar(((Component)crate).transform, radarName, true); StartOfRound.Instance.mapScreen.SyncOrderOfRadarBoostersInList(); } } public static void EraseCrateFromMapRadar(CrateGrabbableObject crate) { if ((Object)(object)crate == (Object)null || (Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.mapScreen == (Object)null || StartOfRound.Instance.mapScreen.radarTargets == null) { return; } for (int num = StartOfRound.Instance.mapScreen.radarTargets.Count - 1; num >= 0; num--) { TransformAndName val = StartOfRound.Instance.mapScreen.radarTargets[num]; if (val != null && (Object)(object)val.transform == (Object)(object)((Component)crate).transform) { StartOfRound.Instance.mapScreen.RemoveTargetFromRadar(((Component)crate).transform); break; } } } public static void AddProjectile(Projectile projectile) { if ((Object)(object)projectile != (Object)null && (Object)(object)Instance != (Object)null && Instance.allCurrentProjectiles != null && !Instance.allCurrentProjectiles.Contains(projectile)) { Logger.LogDebug((object)$"adding PROJECTILE {projectile} at index [{Instance.allCurrentProjectiles.Count}]"); Instance.allCurrentProjectiles.Add(projectile); } } public static void RemoveProjectile(Projectile projectile, Vector3 syncedPosition, PlayerControllerB firedBy, int destroyCase) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)projectile != (Object)null) || !((Object)(object)Instance != (Object)null) || Instance.allCurrentProjectiles == null || !Instance.allCurrentProjectiles.Contains(projectile)) { return; } int num = -1; for (int i = 0; i < Instance.allCurrentProjectiles.Count; i++) { Projectile projectile2 = Instance.allCurrentProjectiles[i]; if ((Object)(object)projectile2 != (Object)null && (Object)(object)projectile2 == (Object)(object)projectile) { num = i; break; } } if (num != -1) { Logger.LogDebug((object)$"removing PROJECTILE {projectile} at index [{num}]"); Instance.RemoveProjectileLocal(num, syncedPosition, firedBy, destroyCase); Instance.RemoveProjectileServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, num, syncedPosition, (int)firedBy.playerClientId, destroyCase); } } [ServerRpc(RequireOwnership = false)] private void RemoveProjectileServerRpc(int playerID, int projectileAtIndex, Vector3 syncedPosition, int firedBy, int destroyCase) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2514490711u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, projectileAtIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref syncedPosition); BytePacker.WriteValueBitPacked(val, firedBy); BytePacker.WriteValueBitPacked(val, destroyCase); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2514490711u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveProjectileClientRpc(playerID, projectileAtIndex, syncedPosition, firedBy, destroyCase); } } } [ClientRpc] private void RemoveProjectileClientRpc(int playerID, int projectileAtIndex, Vector3 syncedPosition, int firedBy, int destroyCase) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3095207497u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, projectileAtIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref syncedPosition); BytePacker.WriteValueBitPacked(val, firedBy); BytePacker.WriteValueBitPacked(val, destroyCase); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3095207497u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { RemoveProjectileLocal(projectileAtIndex, syncedPosition, GetPlayerByID(firedBy), destroyCase); } } } private void RemoveProjectileLocal(int projectileAtIndex, Vector3 syncedPosition, PlayerControllerB firedBy, int destroyCase) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (projectileAtIndex >= 0 && projectileAtIndex < allCurrentProjectiles.Count) { Projectile projectile = allCurrentProjectiles[projectileAtIndex]; allCurrentProjectiles.Remove(projectile); projectile.DoImpactAndDestroy(syncedPosition, firedBy, destroyCase); } } public static void AddKart(GrabbableVehicle kart) { if ((Object)(object)kart != (Object)null && (Object)(object)Instance != (Object)null && Instance.allCurrentVehicles != null && !Instance.allCurrentVehicles.Contains(kart)) { Logger.LogDebug((object)$"adding KART {kart} #{((NetworkBehaviour)kart).NetworkObjectId} at index [{Instance.allCurrentVehicles.Count}]"); Instance.allCurrentVehicles.Add(kart); } } public static void RemoveKart(GrabbableVehicle kart) { if ((Object)(object)kart != (Object)null && (Object)(object)Instance != (Object)null && Instance.allCurrentVehicles != null && Instance.allCurrentVehicles.Contains(kart)) { Logger.LogDebug((object)$"removing KART {kart} #{((NetworkBehaviour)kart).NetworkObjectId}"); Instance.allCurrentVehicles.Remove(kart); } } public static int GetIndexOfBonusObject(GameObject bonusObject) { int result = -1; if ((Object)(object)bonusObject != (Object)null) { for (int i = 0; i < allAssets.allBonusObjects.Count; i++) { if ((Object)(object)allAssets.allBonusObjects[i] == (Object)(object)bonusObject) { result = i; break; } } } return result; } public static int GetIndexOfChildTransform(GameObject getIndexOf, GameObject onObject) { int result = -1; if ((Object)(object)getIndexOf != (Object)null && (Object)(object)onObject != (Object)null) { for (int i = 0; i < onObject.transform.childCount; i++) { if ((Object)(object)((Component)onObject.transform.GetChild(i)).gameObject == (Object)(object)getIndexOf) { result = i; break; } } } return result; } public static int GetIndexOfProjectile(GameObject projectile) { int result = -1; if ((Object)(object)projectile != (Object)null) { for (int i = 0; i < allAssets.allProjectiles.Count; i++) { if ((Object)(object)allAssets.allProjectiles[i] == (Object)(object)projectile) { result = i; break; } } } return result; } public static void PlayNoise(AudioSource source, AudioClip clip, bool audibleNoise = false, float noiseRange = 15f, float noiseLoudness = 0.5f) { //IL_003e: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null || (Object)(object)clip == (Object)null) { return; } source.PlayOneShot(clip); WalkieTalkie.TransmitOneShotAudio(source, clip, noiseLoudness); if (audibleNoise && (Object)(object)RoundManager.Instance != (Object)null) { RoundManager instance = RoundManager.Instance; Vector3 position = ((Component)source).transform.position; int num; if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.hangarDoorsClosed && (Object)(object)StartOfRound.Instance.shipInnerRoomBounds != (Object)null) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; num = (((Bounds)(ref bounds)).Contains(((Component)source).transform.position) ? 1 : 0); } else { num = 0; } instance.PlayAudibleNoise(position, noiseRange, noiseLoudness, 0, (byte)num != 0, 0); } } public static void PlayNoiseAtLocation(Vector3 location, AudioClip clip, bool audibleNoise = false, float noiseRange = 15f, float noiseLoudness = 0.5f) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)clip == (Object)null) && !((Object)(object)Instance == (Object)null)) { AudioSource val = null; if ((Object)(object)Instance.tempAudioSource != (Object)null && !Instance.tempAudioSource.isPlaying) { val = Instance.tempAudioSource; } else if ((Object)(object)Instance.tempAudioSource2 != (Object)null) { val = Instance.tempAudioSource2; } if (!((Object)(object)val == (Object)null)) { Instance.tempAudioSource.Stop(); ((Component)Instance.tempAudioSource).transform.position = location; Instance.tempAudioSource.maxDistance = noiseRange * 1.25f; Instance.tempAudioSource.volume = noiseLoudness * 1.25f; PlayNoise(Instance.tempAudioSource, clip, audibleNoise, noiseRange, noiseLoudness); } } } public static int GetRandomSeed(int backUpSeed = -1, int additionalOffset = -1) { int num = 12345; if (backUpSeed != -1) { num = backUpSeed; } if ((Object)(object)StartOfRound.Instance != (Object)null) { num = StartOfRound.Instance.randomMapSeed; } if ((Object)(object)TimeOfDay.Instance != (Object)null) { num += TimeOfDay.Instance.hour; } if (additionalOffset != -1) { num += additionalOffset; } return num; } public static int GetLayerMask(string[] allStrings) { int num = 0; for (int i = 0; i < allStrings.Length; i++) { num |= 1 << LayerMask.NameToLayer(allStrings[i]); } return num; } public static void AddMetalItem(GrabbableObject metalItem) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 if (metalItem.itemProperties.isConductiveMetal && (Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.currentLevel != (Object)null && (int)StartOfRound.Instance.currentLevel.currentWeather == 2) { StormyWeather val = Object.FindAnyObjectByType(); if ((Object)(object)val != (Object)null) { Logger.LogDebug((object)$"adding {metalItem} #{((NetworkBehaviour)metalItem).NetworkObjectId} to {val}'s metalObjects"); val.metalObjects.Add(metalItem); } } } public static void MergeItem(GrabbableObject itemRequestingMerge, bool removeDestroyedScrapValue, bool muteDestroyedItem, float startingDelay = 0.25f, bool randomizeOrder = true, bool includeBeltItem = true) { if ((Object)(object)Instance != (Object)null && (Object)(object)itemRequestingMerge != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(Instance.MergeOnDelay(itemRequestingMerge, itemRequestingMerge.playerHeldBy, removeDestroyedScrapValue, muteDestroyedItem, startingDelay, randomizeOrder, includeBeltItem)); } } private IEnumerator MergeOnDelay(GrabbableObject itemRequestingMerge, PlayerControllerB playerMerging, bool removeDestroyedScrapValue, bool muteDestroyedItem, float startingDelay, bool randomizeOrder, bool includeBeltItem) { if ((Object)(object)playerMerging == (Object)null || (Object)(object)itemRequestingMerge == (Object)null) { Logger.LogDebug((object)$"MergeItem() - A: null playerMerging ({playerMerging}) or null itemRequestingMerge ({itemRequestingMerge}), breaking"); yield break; } IInventoryMergeable requestingMergeable = ((Component)itemRequestingMerge).GetComponent(); if (requestingMergeable == null) { Logger.LogDebug((object)"MergeItem() - B: null IInventoryMergeable, breaking"); yield break; } Logger.LogDebug((object)$"MergeItem() - C: playerMerging ({playerMerging}) // itemRequestingMerge ({itemRequestingMerge})"); playerMerging.activatingItem = true; startingDelay = Mathf.Max(0.05f, startingDelay); yield return (object)new WaitForSeconds(startingDelay); GrabbableObject val = null; bool flag = Random.Range(0, 2) == 0; if (logDetail) { Logger.LogDebug((object)$"leftToRight? {flag} // includeBeltItem? {includeBeltItem}"); } if (!randomizeOrder || flag) { for (int i = 0; i < playerMerging.ItemSlots.Length; i++) { GrabbableObject val2 = playerMerging.ItemSlots[i]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2 == (Object)(object)itemRequestingMerge)) { IInventoryMergeable component = ((Component)val2).GetComponent(); if (component != null && component.CanOtherMergeWithThis(itemRequestingMerge)) { val = val2; Logger.LogDebug((object)$"OTHER {((Object)val2).name} #{((NetworkBehaviour)val2).NetworkObjectId} found NORMAL {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId}"); break; } if (requestingMergeable.CanThisMergeWithOther(val2)) { val = val2; Logger.LogDebug((object)$"SELF {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId} found NORMAL {((Object)val2).name} #{((NetworkBehaviour)val2).NetworkObjectId}"); break; } } } } else { for (int num = playerMerging.ItemSlots.Length - 1; num >= 0; num--) { GrabbableObject val3 = playerMerging.ItemSlots[num]; if (!((Object)(object)val3 == (Object)null) && !((Object)(object)val3 == (Object)(object)itemRequestingMerge)) { IInventoryMergeable component2 = ((Component)val3).GetComponent(); if (component2 != null && component2.CanOtherMergeWithThis(itemRequestingMerge)) { val = val3; Logger.LogDebug((object)$"OTHER {((Object)val3).name} #{((NetworkBehaviour)val3).NetworkObjectId} found NORMAL {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId}"); break; } if (requestingMergeable.CanThisMergeWithOther(val3)) { val = val3; Logger.LogDebug((object)$"SELF {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId} found NORMAL {((Object)val3).name} #{((NetworkBehaviour)val3).NetworkObjectId}"); break; } } } } if ((Object)(object)val == (Object)null && includeBeltItem) { GrabbableObject itemOnlySlot = playerMerging.ItemOnlySlot; if ((Object)(object)itemOnlySlot != (Object)null && (Object)(object)itemOnlySlot != (Object)(object)itemRequestingMerge) { IInventoryMergeable component3 = ((Component)itemOnlySlot).GetComponent(); if (component3 != null && component3.CanOtherMergeWithThis(itemRequestingMerge)) { val = itemOnlySlot; Logger.LogDebug((object)$"OTHER {((Object)itemOnlySlot).name} #{((NetworkBehaviour)itemOnlySlot).NetworkObjectId} found BELT {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId}"); } else if (requestingMergeable.CanThisMergeWithOther(itemOnlySlot)) { val = itemOnlySlot; Logger.LogDebug((object)$"SELF {((Object)itemRequestingMerge).name} #{((NetworkBehaviour)this).NetworkObjectId} found BELT {((Object)itemOnlySlot).name} #{((NetworkBehaviour)itemOnlySlot).NetworkObjectId}"); } } } if ((Object)(object)val != (Object)null) { MergeTwoItems(itemRequestingMerge, val, playerMerging, removeDestroyedScrapValue, muteDestroyedItem); MergeTwoItemsServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)itemRequestingMerge).NetworkObject), NetworkObjectReference.op_Implicit(((NetworkBehaviour)val).NetworkObject), (int)playerMerging.playerClientId, removeDestroyedScrapValue, muteDestroyedItem); _ = (Object)(object)playerMerging == (Object)(object)StartOfRound.Instance.localPlayerController; yield return (object)new WaitForSeconds(Mathf.Max(0.05f, 0.5f - startingDelay)); } playerMerging.activatingItem = false; } [ServerRpc(RequireOwnership = false)] private void MergeTwoItemsServerRpc(NetworkObjectReference itemRequestingMergeNOR, NetworkObjectReference mergeWithNOR, int playerID, bool removeDestroyedScrapValue, bool muteDestroyedItem) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4081374449u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemRequestingMergeNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref mergeWithNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref removeDestroyedScrapValue, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref muteDestroyedItem, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4081374449u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MergeTwoItemsClientRpc(itemRequestingMergeNOR, mergeWithNOR, playerID, removeDestroyedScrapValue, muteDestroyedItem); } } } [ClientRpc] private void MergeTwoItemsClientRpc(NetworkObjectReference itemRequestingMergeNOR, NetworkObjectReference mergeWithNOR, int playerID, bool removeDestroyedScrapValue, bool muteDestroyedItem) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1279888070u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemRequestingMergeNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref mergeWithNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref removeDestroyedScrapValue, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref muteDestroyedItem, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1279888070u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId) { return; } NetworkObject val3 = default(NetworkObject); NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref itemRequestingMergeNOR)).TryGet(ref val3, (NetworkManager)null) && ((NetworkObjectReference)(ref mergeWithNOR)).TryGet(ref val4, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); GrabbableObject component2 = ((Component)val4).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component2 == (Object)null) { Logger.LogError((object)$"Failed to get script from: requesting? {(Object)(object)component == (Object)null} / with? {(Object)(object)component2 == (Object)null}"); } else { MergeTwoItems(component, component2, StartOfRound.Instance.allPlayerScripts[playerID], removeDestroyedScrapValue, muteDestroyedItem); } } else { Logger.LogError((object)"MergeTwoItemsClientRpc(): Failed to get networkobject of either item"); } } private void MergeTwoItems(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith, PlayerControllerB playerMerging, bool removeDestroyedScrapValue, bool muteDestroyedItem) { if (!((Object)(object)itemRequestingMerge == (Object)null) && !((Object)(object)mergeWith == (Object)null) && !((Object)(object)playerMerging == (Object)null)) { Logger.LogDebug((object)$"merging #{((NetworkBehaviour)itemRequestingMerge).NetworkObjectId} with #{((NetworkBehaviour)mergeWith).NetworkObjectId} on player {playerMerging}"); int removedFromSlot = DestroyItem(GetItemToDestroy(itemRequestingMerge, mergeWith), removeDestroyedScrapValue, muteDestroyedItem); GrabbableObject itemThatInvokesEvent = GetItemThatInvokesEvent(itemRequestingMerge, mergeWith); GrabbableObject mergeWith2 = (((Object)(object)itemThatInvokesEvent == (Object)(object)itemRequestingMerge) ? mergeWith : itemRequestingMerge); InvokeMergeItemEvent(itemThatInvokesEvent, mergeWith2, playerMerging, removedFromSlot); } } private static GrabbableObject GetItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { if ((Object)(object)itemRequestingMerge == (Object)null || (Object)(object)mergeWith == (Object)null) { return null; } IInventoryMergeable component = ((Component)itemRequestingMerge).GetComponent(); if (component != null) { return component.GetMergeItemToDestroy(itemRequestingMerge, mergeWith); } return ((Component)mergeWith).GetComponent()?.GetMergeItemToDestroy(itemRequestingMerge, mergeWith); } private static GrabbableObject GetItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith) { if ((Object)(object)itemRequestingMerge == (Object)null || (Object)(object)mergeWith == (Object)null) { return null; } IInventoryMergeable component = ((Component)itemRequestingMerge).GetComponent(); if (component != null) { return component.GetMergeItemThatInvokesEvent(itemRequestingMerge, mergeWith); } return ((Component)mergeWith).GetComponent()?.GetMergeItemThatInvokesEvent(itemRequestingMerge, mergeWith); } private static void InvokeMergeItemEvent(GrabbableObject itemThatInvokesEvent, GrabbableObject mergeWith, PlayerControllerB playerMerging, int removedFromSlot) { if (logDetail) { Logger.LogInfo((object)$"InvokeMergeItemEvent() // ({itemThatInvokesEvent} #{((NetworkBehaviour)itemThatInvokesEvent).NetworkObjectId}) + ({mergeWith} #{((NetworkBehaviour)mergeWith).NetworkObjectId}) on {playerMerging}"); } if (!((Object)(object)itemThatInvokesEvent == (Object)null) && !((Object)(object)mergeWith == (Object)null) && !((Object)(object)playerMerging == (Object)null)) { ((Component)itemThatInvokesEvent).GetComponent()?.MergeWithOther(mergeWith, playerMerging, removedFromSlot); } } public static GameObject SpawnLocalObject(GameObject spawnPrefab, PlayerControllerB spawnedBy, Vector3 spawnPos, CrateGrabbableObject spawnedFromCrate = null, Transform onParent = null, float destroyAfterTime = -1f) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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) if ((Object)(object)spawnPrefab == (Object)null) { return null; } if ((Object)(object)spawnPrefab.GetComponent() != (Object)null) { if (logDetail) { Logger.LogInfo((object)$"SpawnLocalObject() called with NetworkObject {spawnPrefab}, passing it to SpawnNetworkObject()"); } return SpawnNetworkObject(spawnPrefab, spawnedBy, spawnPos, spawnedFromCrate, destroyAfterTime); } if (logDetail) { Logger.LogDebug((object)$"SpawnLocalObject() LOCALLY spawning ({spawnPrefab}) by player ({spawnedBy}) at position {spawnPos} from crate ({spawnedFromCrate}) on parent ({onParent}) with destroyAfterTime of ({destroyAfterTime})"); } GameObject val = Object.Instantiate(spawnPrefab, spawnPos, Quaternion.identity, onParent); if ((Object)(object)val == (Object)null) { return null; } val.GetComponent()?.OnSpawnObject(spawnedFromCrate, spawnedBy); if (destroyAfterTime > 0f) { AddDestroyConditionToObject(val, destroyAfterTime); } return val; } public static GameObject SpawnNetworkObject(GameObject spawnPrefab, PlayerControllerB spawnedBy, Vector3 spawnPos, CrateGrabbableObject spawnedFromCrate = null, float destroyAfterTime = -1f) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer || (Object)(object)spawnPrefab == (Object)null) { return null; } GameObject val = Object.Instantiate(spawnPrefab, spawnPos, Quaternion.identity); NetworkObject component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)$"SpawnNetworkObject() given spawnPrefab {spawnPrefab} without NetworkObject, destroying it, please use SpawnLocalObject() instead"); Object.Destroy((Object)(object)val); return null; } ((MonoBehaviour)Instance).StartCoroutine(Instance.SpawnNetworkObjectOnServer(component, spawnedBy, spawnPos, spawnedFromCrate, destroyAfterTime)); return val; } private IEnumerator SpawnNetworkObjectOnServer(NetworkObject netObj, PlayerControllerB spawnedBy, Vector3 spawnPos, CrateGrabbableObject spawnedFromCrate, float destroyAfterTime) { //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) if ((Object)(object)netObj == (Object)null) { Logger.LogWarning((object)"SpawnNetworkObjectOnServer() NULL netObj, breaking"); yield break; } if (logDetail) { Logger.LogDebug((object)$"SpawnNetworkObject() SERVER spawning ({netObj}) by player ({spawnedBy}) at position {spawnPos} from crate ({spawnedFromCrate}) with destroyAfterTime of ({destroyAfterTime})"); } netObj.Spawn(false); yield return (object)new WaitForEndOfFrame(); GrabbableObject component = ((Component)netObj).GetComponent(); int num = 0; if ((Object)(object)component != (Object)null) { if ((Object)(object)component.itemProperties != (Object)null && component.itemProperties.isScrap && component.itemProperties.minValue > 0 && component.itemProperties.maxValue > 0 && (Object)(object)RoundManager.Instance != (Object)null) { num = (int)((float)Random.Range(component.itemProperties.minValue, component.itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier); } OnSpawnGrabbableObject(component, num, spawnedBy, spawnPos, spawnedFromCrate); } ((Component)netObj).GetComponent()?.OnSpawnObject(spawnedFromCrate, spawnedBy); NetworkObject networkObject = ((NetworkBehaviour)this).NetworkObject; if ((Object)(object)spawnedFromCrate != (Object)null) { networkObject = ((NetworkBehaviour)spawnedFromCrate).NetworkObject; } if (destroyAfterTime > 0f && (Object)(object)netObj != (Object)(object)((NetworkBehaviour)this).NetworkObject) { AddDestroyConditionToObject(((Component)netObj).gameObject, destroyAfterTime); } int spawnedByID = -1; if ((Object)(object)spawnedBy != (Object)null) { spawnedByID = (int)spawnedBy.playerClientId; } SpawnNetworkObjectClientRpc(NetworkObjectReference.op_Implicit(netObj), spawnedByID, spawnPos, NetworkObjectReference.op_Implicit(networkObject), num, destroyAfterTime); } [ClientRpc] private void SpawnNetworkObjectClientRpc(NetworkObjectReference objectNOR, int spawnedByID, Vector3 spawnPos, NetworkObjectReference netObjRef, int intValue = 0, float destroyAfterTime = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2001109830u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, spawnedByID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref spawnPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, intValue); ((FastBufferWriter)(ref val)).WriteValueSafe(ref destroyAfterTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2001109830u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { return; } CrateGrabbableObject spawnedFromCrate = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { if ((Object)(object)val3 != (Object)(object)((NetworkBehaviour)this).NetworkObject) { spawnedFromCrate = ((Component)val3).GetComponent(); } else if (logDetail) { Logger.LogDebug((object)"got own NetworkObject, likely not from crate"); } } else { Logger.LogWarning((object)"Failed to get NetworkObject of GrabbableObject on SpawnNetworkObjectClientRpc()"); } ((MonoBehaviour)this).StartCoroutine(SpawnNetworkObjectOnClient(objectNOR, spawnPos, GetPlayerByID(spawnedByID), spawnedFromCrate, intValue, destroyAfterTime)); } private IEnumerator SpawnNetworkObjectOnClient(NetworkObjectReference prefabNOR, Vector3 spawnPos, PlayerControllerB spawnedBy, CrateGrabbableObject spawnedFromCrate, int intValue, float destroyAfterTime) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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) NetworkObject netObj = null; float startTime = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - startTime < 8f && !((NetworkObjectReference)(ref prefabNOR)).TryGet(ref netObj, (NetworkManager)null)) { yield return (object)new WaitForSeconds(0.03f); } if ((Object)(object)netObj == (Object)null) { Logger.LogWarning((object)"SpawnNetworkObjectOnClient() NULL netObj, breaking"); yield break; } if (logDetail) { Logger.LogDebug((object)$"SpawnNetworkObject() CLIENT spawned ({netObj}) by player ({spawnedBy}) at position {spawnPos} from crate ({spawnedFromCrate}) with destroyAfterTime of ({destroyAfterTime})"); } yield return (object)new WaitForEndOfFrame(); GameObject gameObject = ((Component)netObj).gameObject; ((Component)netObj).GetComponent()?.OnSpawnObject(spawnedFromCrate, spawnedBy); GrabbableObject componentInChildren = gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { OnSpawnGrabbableObject(componentInChildren, intValue, spawnedBy, spawnPos, spawnedFromCrate); } if (destroyAfterTime > 0f) { AddDestroyConditionToObject(gameObject, destroyAfterTime); } } public static void OnSpawnGrabbableObject(GrabbableObject spawnedItem, int spawnedScrapValue, PlayerControllerB spawnedBy, Vector3 spawnPos, CrateGrabbableObject spawnedFromCrate = null) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)spawnedItem == (Object)null || (Object)(object)spawnedItem.itemProperties == (Object)null) { return; } Logger.LogDebug((object)$"SpawnGrabbableObject() got GrabbableObject {spawnedItem} #{((NetworkBehaviour)spawnedItem).NetworkObjectId}"); spawnedItem.hasHitGround = false; spawnedItem.reachedFloorTarget = false; spawnedItem.fallTime = 0f; spawnedItem.isInFactory = ((Object)(object)spawnedFromCrate != (Object)null && ((GrabbableObject)spawnedFromCrate).isInFactory) || spawnPos.y < -80f; HoarderBugAI.grabbableObjectsInMap.Add(((Component)spawnedItem).gameObject); if (spawnedItem.itemProperties.isScrap) { Logger.LogDebug((object)$"setting value of ITEM {spawnedItem} #{((NetworkBehaviour)spawnedItem).NetworkObjectId} to {spawnedScrapValue}"); spawnedItem.SetScrapValue(spawnedScrapValue); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)spawnedScrapValue; if ((Object)(object)spawnedFromCrate != (Object)null && (Object)(object)spawnedFromCrate.crateData != (Object)null && spawnedFromCrate.crateData.valueDecreasePercentage > 0f) { int num = Mathf.Max(1, (int)((float)spawnedScrapValue * spawnedFromCrate.crateData.valueDecreasePercentage)); int num2 = Mathf.Max(1, ((GrabbableObject)spawnedFromCrate).scrapValue - num); Logger.LogDebug((object)$"setting value of CRATE {spawnedFromCrate} #{((NetworkBehaviour)spawnedFromCrate).NetworkObjectId} to {num2} after subtracting {num}"); ((GrabbableObject)spawnedFromCrate).SetScrapValue(num2); RoundManager instance2 = RoundManager.Instance; instance2.totalScrapValueInLevel -= (float)num; } } if (spawnedItem.itemProperties.isConductiveMetal) { AddMetalItem(spawnedItem); } int num3 = spawnedScrapValue + (int)((NetworkBehaviour)spawnedItem).NetworkObjectId; if ((Object)(object)spawnedFromCrate != (Object)null) { num3 += (int)((NetworkBehaviour)spawnedFromCrate).NetworkObjectId; } CalculateTargetFloorPosition(spawnedItem, spawnPos, spawnedBy, num3); } public static void CalculateTargetFloorPosition(GrabbableObject spawnedItem, Vector3 spawnPos, PlayerControllerB spawnedBy, int randomSeed = -1) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) if (logDetail) { Logger.LogInfo((object)$"CalculateTargetFloorPosition() // {spawnedItem}"); } if ((Object)(object)spawnedItem == (Object)null) { return; } if (logDetail) { Logger.LogDebug((object)$"A: {spawnPos} | {((Component)spawnedItem).transform.parent}"); } Vector3 itemFloorPosition = default(Vector3); NetworkObject physicsRegionOfDroppedObject = spawnedItem.GetPhysicsRegionOfDroppedObject(spawnedBy, ref itemFloorPosition, false); if (logDetail) { Logger.LogDebug((object)"B"); } Bounds bounds; if ((Object)(object)physicsRegionOfDroppedObject == (Object)null) { if (logDetail) { Logger.LogDebug((object)"C"); } itemFloorPosition = spawnedItem.GetItemFloorPosition(spawnPos); if (logDetail) { Logger.LogDebug((object)$"D: {itemFloorPosition}"); } bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(itemFloorPosition)) { ((Component)spawnedItem).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); } else { ((Component)spawnedItem).transform.SetParent(StartOfRound.Instance.propsContainer, true); } if (logDetail) { Logger.LogDebug((object)$"E: {((Component)spawnedItem).transform.parent}"); } } else { if (logDetail) { Logger.LogDebug((object)"F"); } PlayerPhysicsRegion componentInChildren = ((Component)physicsRegionOfDroppedObject).GetComponentInChildren(); if (logDetail) { Logger.LogDebug((object)"G"); } if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.physicsTransform != (Object)null) { ((Component)spawnedItem).transform.SetParent(componentInChildren.physicsTransform, true); if (logDetail) { Logger.LogDebug((object)$"H: {((Component)spawnedItem).transform.parent}"); } } else { ((Component)spawnedItem).transform.SetParent(((Component)physicsRegionOfDroppedObject).transform, true); if (logDetail) { Logger.LogDebug((object)$"I: {((Component)spawnedItem).transform.parent}"); } } if (logDetail) { Logger.LogDebug((object)"J"); } } if (logDetail) { Logger.LogDebug((object)"K"); } float num = 0f; float num2 = 0f; if (randomSeed != -1) { Random random = new Random(randomSeed); num = Mathf.Lerp(-0.33f, 0.33f, (float)random.NextDouble()); num2 = Mathf.Lerp(-0.33f, 0.33f, (float)random.NextDouble()); } if (logDetail) { Logger.LogDebug((object)$"L: {randomSeed} -> ({num}, 0.0f, {num2})"); } if ((Object)(object)physicsRegionOfDroppedObject == (Object)null) { spawnedItem.startFallingPosition = ((Component)spawnedItem).transform.parent.InverseTransformPoint(spawnPos); spawnedItem.targetFloorPosition = ((Component)spawnedItem).transform.parent.InverseTransformPoint(itemFloorPosition); spawnedItem.targetFloorPosition += new Vector3(num, 0f, num2); if (logDetail) { Logger.LogDebug((object)$"M: {spawnedItem.startFallingPosition} | {spawnedItem.targetFloorPosition}"); } } else { spawnedItem.startFallingPosition = ((Component)spawnedItem).transform.parent.InverseTransformPoint(spawnPos); spawnedItem.targetFloorPosition = itemFloorPosition; spawnedItem.targetFloorPosition += new Vector3(num, 0f, num2); if (logDetail) { Logger.LogDebug((object)$"N: {spawnedItem.startFallingPosition} | {spawnedItem.targetFloorPosition}"); } } if (logDetail) { Logger.LogDebug((object)"O"); } bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; bool flag = ((Bounds)(ref bounds)).Contains(((Component)spawnedItem).transform.parent.TransformPoint(spawnedItem.targetFloorPosition)); if (logDetail) { Logger.LogDebug((object)$"P: {flag}"); } bool flag2 = (Object)(object)((Component)spawnedItem).transform.parent == (Object)(object)StartOfRound.Instance.elevatorTransform; if (logDetail) { Logger.LogDebug((object)$"Q: {flag2}"); } EnemyAI.SetItemInElevatorNonPlayer(flag, flag2, spawnedItem); if (logDetail) { Logger.LogDebug((object)$"R: {spawnedBy}"); } if ((Object)(object)spawnedBy != (Object)null) { if (logDetail) { Logger.LogDebug((object)$"S: {spawnedBy}"); } if (flag) { if (logDetail) { Logger.LogDebug((object)$"T: {RoundManager.Instance.valueOfFoundScrapItems}"); } RoundManager instance = RoundManager.Instance; instance.valueOfFoundScrapItems += spawnedItem.scrapValue; if (logDetail) { Logger.LogDebug((object)$"U: {RoundManager.Instance.valueOfFoundScrapItems}"); } } } if (logDetail) { Logger.LogDebug((object)"V"); } } [ClientRpc] public void SpawnEnemyFromCrateClientRpc(NetworkObjectReference enemyNOR, Vector3 spawnPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_018a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2610954057u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemyNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref spawnPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2610954057u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref enemyNOR)).TryGet(ref val3, (NetworkManager)null)) { EnemyAI component = ((Component)val3).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.enemyType == (Object)null) { Logger.LogError((object)"SpawnEnemyFromCrateClientRpc(): Failed to get EnemyAI"); return; } Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (((Bounds)(ref bounds)).Contains(spawnPos + Vector3.up)) { Logger.LogDebug((object)"enemy in ship room, enabling mesh"); component.isInsidePlayerShip = true; component.EnableEnemyMesh(component.isInsidePlayerShip, false, false); } if (component.enemyType.enemyName == "Tulip Snake" && spawnPos.y < -80f) { Logger.LogDebug((object)"tulip snake is inside, setting inside nodes"); component.SetEnemyOutside(false); } Logger.LogDebug((object)$"SpawnEnemyFromCrateClientRpc(): EnemyAI {component} = isInsidePlayerShip? {component.isInsidePlayerShip} // isOutside? {component.isOutside}"); } else { Logger.LogError((object)"SpawnEnemyFromCrateClientRpc(): Failed to get NetworkObject"); } } public static int DestroyItem(GrabbableObject item, bool removeScrapValue = true, bool muteAudio = true) { if (logDetail) { Logger.LogInfo((object)$"DestroyItem() // {item}"); } if ((Object)(object)item == (Object)null || (Object)(object)item.itemProperties == (Object)null) { return -1; } int num = -1; if (logDetail) { Logger.LogDebug((object)"1"); } item.deactivated = true; item.scrapPersistedThroughRounds = true; item.itemUsedUp = true; item.isHeld = false; item.isPocketed = false; item.heldByPlayerOnServer = false; item.isHeldByEnemy = false; item.isBeingUsed = false; item.grabbable = false; item.grabbableToEnemies = false; item.hasHitGround = false; item.reachedFloorTarget = false; item.parentObject = null; item.fallTime = 0f; if (logDetail) { Logger.LogDebug((object)"2"); } if ((Object)(object)item.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)item.radarIcon).gameObject); } if (logDetail) { Logger.LogDebug((object)"3"); } MeshRenderer[] componentsInChildren = ((Component)item).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).enabled = false; } if (logDetail) { Logger.LogDebug((object)"4"); } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)item).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { ((Renderer)componentsInChildren2[j]).enabled = false; } if (logDetail) { Logger.LogDebug((object)"5"); } Collider[] componentsInChildren3 = ((Component)item).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren3.Length; k++) { componentsInChildren3[k].enabled = false; } if (logDetail) { Logger.LogDebug((object)$"6: {muteAudio}"); } if (muteAudio) { AudioSource[] componentsInChildren4 = ((Component)item).GetComponentsInChildren(); for (int l = 0; l < componentsInChildren4.Length; l++) { componentsInChildren4[l].volume = 0f; } } if (logDetail) { Logger.LogDebug((object)"7"); } if ((Object)(object)item.playerHeldBy != (Object)null) { PlayerControllerB playerHeldBy = item.playerHeldBy; if (logDetail) { Logger.LogDebug((object)$"8: {playerHeldBy}"); } for (int m = 0; m < playerHeldBy.ItemSlots.Length; m++) { GrabbableObject val = playerHeldBy.ItemSlots[m]; if (!((Object)(object)val == (Object)null) && (Object)(object)val == (Object)(object)item) { num = m; break; } } if (num == -1 && (Object)(object)playerHeldBy.ItemOnlySlot == (Object)(object)item) { num = 50; } if (logDetail) { Logger.LogDebug((object)$"9: {num}"); } if (num != -1) { if (logDetail) { Logger.LogDebug((object)"10"); } if (playerHeldBy.currentItemSlot == num) { if (logDetail) { Logger.LogDebug((object)"11"); } playerHeldBy.twoHanded = false; playerHeldBy.twoHandedAnimation = false; playerHeldBy.currentlyHeldObject = null; playerHeldBy.currentlyHeldObjectServer = null; playerHeldBy.equippedUsableItemQE = false; playerHeldBy.IsInspectingItem = false; playerHeldBy.isHoldingObject = false; playerHeldBy.playerBodyAnimator.SetBool("cancelHolding", true); playerHeldBy.playerBodyAnimator.SetTrigger("Throw"); playerHeldBy.playerBodyAnimator.SetBool("Grab", false); if ((Object)(object)playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { if (logDetail) { Logger.LogDebug((object)"12"); } ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; HUDManager.Instance.ClearControlTips(); } try { playerHeldBy.playerBodyAnimator.SetBool(item.itemProperties.grabAnim, false); } catch { if (logDetail) { Logger.LogDebug((object)"13"); } } } if (logDetail) { Logger.LogDebug((object)"14"); } if ((Object)(object)playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { if (num == 50) { ((Behaviour)HUDManager.Instance.itemOnlySlotIcon).enabled = false; } else { ((Behaviour)HUDManager.Instance.itemSlotIcons[num]).enabled = false; } } UpdatePlayerWeight(playerHeldBy, item.itemProperties, add: false); if (num == 50) { playerHeldBy.ItemOnlySlot = null; } else { playerHeldBy.ItemSlots[num] = null; } } if (logDetail) { Logger.LogDebug((object)"15"); } item.DiscardItem(); playerHeldBy.activatingItem = true; } if (logDetail) { Logger.LogDebug((object)"16"); } if (removeScrapValue && item.itemProperties.isScrap && !item.scrapPersistedThroughRounds && !StartOfRound.Instance.inShipPhase) { if (logDetail) { Logger.LogDebug((object)$"17 - A: {RoundManager.Instance.totalScrapValueInLevel}"); } RoundManager.Instance.totalScrapValueInLevel = Mathf.Max(RoundManager.Instance.totalScrapValueInLevel - (float)item.scrapValue, 0f); if (logDetail) { Logger.LogDebug((object)$"17 - B: {RoundManager.Instance.totalScrapValueInLevel}"); } if (item.hasBeenHeld) { if (logDetail) { Logger.LogDebug((object)$"18 - A: {RoundManager.Instance.valueOfFoundScrapItems}"); } RoundManager.Instance.valueOfFoundScrapItems = Mathf.Max(RoundManager.Instance.valueOfFoundScrapItems - item.scrapValue, 0); if (logDetail) { Logger.LogDebug((object)$"18 - B: {RoundManager.Instance.valueOfFoundScrapItems}"); } } if (item.isInShipRoom) { if (logDetail) { Logger.LogDebug((object)$"19 - A: {RoundManager.Instance.scrapCollectedInLevel}"); } RoundManager.Instance.scrapCollectedInLevel = Mathf.Max(RoundManager.Instance.scrapCollectedInLevel - item.scrapValue, 0); if (logDetail) { Logger.LogDebug((object)$"19 - B: {RoundManager.Instance.scrapCollectedInLevel}"); } } if (logDetail) { Logger.LogDebug((object)"20"); } } if (RoundManager.Instance.scrapDroppedInShip.Contains(item)) { if (logDetail) { Logger.LogDebug((object)"21"); } RoundManager.Instance.scrapDroppedInShip.Remove(item); } if (logDetail) { Logger.LogDebug((object)"22"); } if (item.isInShipRoom) { if (logDetail) { Logger.LogDebug((object)$"23: {StartOfRound.Instance.currentShipItemCount}"); } StartOfRound.Instance.currentShipItemCount = Mathf.Max(StartOfRound.Instance.currentShipItemCount - 1, 0); if (logDetail) { Logger.LogDebug((object)$"24: {StartOfRound.Instance.currentShipItemCount}"); } } if (logDetail) { Logger.LogDebug((object)"25"); } if (HoarderBugAI.grabbableObjectsInMap.Contains(((Component)item).gameObject)) { HoarderBugAI.grabbableObjectsInMap.Remove(((Component)item).gameObject); } if (logDetail) { Logger.LogDebug((object)"26"); } return num; } public static void AddDestroyConditionToObject(GameObject addToObject, float destroyAfterLifetime = 10f, string[] destroyOnTriggers = null, string[] destroyOnColliders = null) { if (!((Object)(object)addToObject == (Object)null)) { DestroyGameObjectOnCondition destroyGameObjectOnCondition = addToObject.GetComponentInChildren(); if ((Object)(object)destroyGameObjectOnCondition == (Object)null) { destroyGameObjectOnCondition = addToObject.AddComponent(); } destroyGameObjectOnCondition.destroyGameObject = addToObject; destroyGameObjectOnCondition.destroyAfterTime = destroyAfterLifetime; if (destroyOnTriggers != null) { destroyGameObjectOnCondition.destroyUponTriggerLayers = destroyOnTriggers; } if (destroyOnColliders != null) { destroyGameObjectOnCondition.destroyUponColliderLayers = destroyOnColliders; } } } public static void UpdatePlayerWeight(PlayerControllerB player, Item useItemWeight, bool add) { if (!((Object)(object)player == (Object)null) && !((Object)(object)useItemWeight == (Object)null) && !((Object)(object)StartOfRound.Instance == (Object)null)) { UpdatePlayerWeight(player, useItemWeight.weight - 1f, add); } } public static void UpdatePlayerWeight(PlayerControllerB player, float updateChange, bool add) { if (!((Object)(object)player == (Object)null) && !((Object)(object)StartOfRound.Instance == (Object)null)) { player.carryWeight = (add ? (player.carryWeight + updateChange) : (player.carryWeight - updateChange)); player.carryWeight = Mathf.Clamp(player.carryWeight, 1f, 10f); StartOfRound.Instance.SendChangedWeightEvent(); } } public static void ReplaceItemInSlot(GrabbableObject itemToMove, PlayerControllerB inventoryOf, GrabbableObject itemToReplace = null, int replaceInSlot = -1) { if ((Object)(object)itemToMove == (Object)null || (Object)(object)itemToMove.itemProperties == (Object)null || (Object)(object)inventoryOf == (Object)null) { return; } int num = -1; int num2 = replaceInSlot; for (int i = 0; i < inventoryOf.ItemSlots.Length; i++) { if (!((Object)(object)inventoryOf.ItemSlots[i] == (Object)null)) { if ((Object)(object)inventoryOf.ItemSlots[i] == (Object)(object)itemToMove) { num = i; } else if (num2 == -1 && (Object)(object)itemToReplace != (Object)null && (Object)(object)inventoryOf.ItemSlots[i] == (Object)(object)itemToReplace) { num2 = i; } } } if (num == -1 && (Object)(object)inventoryOf.ItemOnlySlot == (Object)(object)itemToMove) { num = 50; } if (num2 == -1 && (Object)(object)itemToReplace != (Object)null && (Object)(object)inventoryOf.ItemOnlySlot == (Object)(object)itemToReplace) { num2 = 50; } if (num == -1 || num2 == -1) { return; } if (SlotValid(inventoryOf, num)) { if (num == 50) { inventoryOf.ItemOnlySlot = null; } else { inventoryOf.ItemSlots[num] = null; } } if (SlotValid(inventoryOf, num2)) { if (num2 == 50) { if ((Object)(object)inventoryOf.ItemOnlySlot != (Object)null) { DestroyItem(inventoryOf.ItemOnlySlot); } inventoryOf.ItemOnlySlot = itemToMove; } else { if ((Object)(object)inventoryOf.ItemSlots[num2] != (Object)null) { DestroyItem(inventoryOf.ItemSlots[num2]); } inventoryOf.ItemSlots[num2] = itemToMove; } } if (num == inventoryOf.currentItemSlot) { itemToMove.PocketItem(); inventoryOf.currentlyHeldObject = null; inventoryOf.currentlyHeldObjectServer = null; inventoryOf.isHoldingObject = false; inventoryOf.equippedUsableItemQE = false; inventoryOf.twoHanded = false; inventoryOf.twoHandedAnimation = false; inventoryOf.playerBodyAnimator.SetBool("Grab", false); if (!string.IsNullOrEmpty(itemToMove.itemProperties.grabAnim)) { inventoryOf.playerBodyAnimator.SetBool(itemToMove.itemProperties.grabAnim, false); } inventoryOf.playerBodyAnimator.SetBool("cancelHolding", true); if ((Object)(object)inventoryOf == (Object)(object)StartOfRound.Instance.localPlayerController) { HUDManager.Instance.ClearControlTips(); ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; } } if (inventoryOf.currentItemSlot == num2) { inventoryOf.equippedUsableItemQE = false; itemToMove.EquipItem(); inventoryOf.currentlyHeldObject = itemToMove; inventoryOf.currentlyHeldObjectServer = itemToMove; inventoryOf.isHoldingObject = true; inventoryOf.twoHanded = itemToMove.itemProperties.twoHanded; inventoryOf.twoHandedAnimation = itemToMove.itemProperties.twoHandedAnimation; inventoryOf.playerBodyAnimator.SetBool("Grab", true); if (!string.IsNullOrEmpty(itemToMove.itemProperties.grabAnim)) { inventoryOf.playerBodyAnimator.SetBool(itemToMove.itemProperties.grabAnim, true); } inventoryOf.playerBodyAnimator.SetBool("cancelHolding", false); if ((Object)(object)inventoryOf == (Object)(object)StartOfRound.Instance.localPlayerController) { ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = itemToMove.itemProperties.twoHanded; } } if (!((Object)(object)inventoryOf == (Object)(object)StartOfRound.Instance.localPlayerController)) { return; } if (SlotValid(inventoryOf, num)) { if (num == 50) { ((Behaviour)HUDManager.Instance.itemOnlySlotIcon).enabled = false; } else { ((Behaviour)HUDManager.Instance.itemSlotIcons[num]).enabled = false; } } if (SlotValid(inventoryOf, num2)) { if (num2 == 50) { ((Behaviour)HUDManager.Instance.itemOnlySlotIcon).enabled = true; HUDManager.Instance.itemOnlySlotIcon.sprite = itemToMove.itemProperties.itemIcon; } else { ((Behaviour)HUDManager.Instance.itemSlotIcons[num2]).enabled = true; HUDManager.Instance.itemSlotIcons[num2].sprite = itemToMove.itemProperties.itemIcon; } } } public static bool SlotValid(PlayerControllerB player, int slotIndex) { if (slotIndex == 50) { return true; } if (slotIndex < 0 || slotIndex >= player.ItemSlots.Length) { return false; } return true; } public static PlayerControllerB GetPlayerByID(int playerID) { PlayerControllerB result = null; if (playerID >= 0 && playerID < StartOfRound.Instance.allPlayerScripts.Length) { result = StartOfRound.Instance.allPlayerScripts[playerID]; } return result; } public static GameObject GetObjectFromChildrenOrAllAssets(int prefabID, bool isChild, Transform ofTransform = null) { if (isChild) { if ((Object)(object)ofTransform != (Object)null && prefabID >= 0 && prefabID < ofTransform.childCount) { return ((Component)ofTransform.GetChild(prefabID)).gameObject; } } else if (prefabID >= 0 && prefabID < allAssets.allBonusObjects.Count) { return allAssets.allBonusObjects[prefabID]; } return null; } public static bool CanInteractionOnCrateHappenLocally(PlayerControllerB player, CrateGrabbableObject crate) { if ((Object)(object)crate == (Object)null || (Object)(object)StartOfRound.Instance == (Object)null) { return false; } if ((Object)(object)player == (Object)null && ((NetworkBehaviour)crate).IsOwner) { return true; } if ((Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)StartOfRound.Instance.localPlayerController) { return true; } return false; } public static bool CanInteractionOnCrateHappenLocallyUnsafe(CrateGrabbableObject crate) { if ((Object)(object)crate == (Object)null) { return false; } if (((GrabbableObject)crate).currentUseCooldown > 0f) { return true; } return false; } public static void SyncUponJoin() { int playerID = (int)GameNetworkManager.Instance.localPlayerController.playerClientId; Instance.SyncUponJoinServerRpc(playerID); CrateGrabbableObject[] array = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { array[i].SyncUponJoinServerRpc(playerID); } WumpaFruitProp[] array2 = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array2.Length; i++) { array2[i].SyncUponJoinServerRpc(playerID); } AkuAkuProp[] array3 = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array3.Length; i++) { array3[i].SyncUponJoinServerRpc(playerID); } GrabbableVehicle[] array4 = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array4.Length; i++) { array4[i].SyncUponJoinServerRpc(playerID); } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1570998846u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1570998846u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Logger.LogDebug((object)$"Host received SyncUponJoin for player with ID {playerID}"); if (playerID >= 0 && playerID < playerOneUps.Length) { playerOneUps[playerID] = 0; } SyncUponJoinClientRpc(playerID, playerOneUps); } } [ClientRpc] private void SyncUponJoinClientRpc(int playerID, int[] hostPlayerOneUps) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(804760852u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); bool flag = hostPlayerOneUps != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(hostPlayerOneUps, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 804760852u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; playerOneUps = hostPlayerOneUps; Logger.LogDebug((object)$"Locally received data for {((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId}: playerOneUps.Length = {playerOneUps.Length}"); for (int i = 0; i < playerOneUps.Length; i++) { int num = playerOneUps[i]; if (num > 0) { Logger.LogDebug((object)$"[{i}]: oneUps = {num}"); } } } [ClientRpc] public void ChangeOneUpClientRpc(int playerID, int change) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2215639836u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, change); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2215639836u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID >= 0 && playerID < playerOneUps.Length) { playerOneUps[playerID] += change; Logger.LogDebug((object)$"set OneUpLevel of player #{playerID} {StartOfRound.Instance.allPlayerScripts[playerID].playerUsername} to {playerOneUps[playerID]}"); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2514490711u, new RpcReceiveHandler(__rpc_handler_2514490711), "RemoveProjectileServerRpc"); ((NetworkBehaviour)this).__registerRpc(3095207497u, new RpcReceiveHandler(__rpc_handler_3095207497), "RemoveProjectileClientRpc"); ((NetworkBehaviour)this).__registerRpc(4081374449u, new RpcReceiveHandler(__rpc_handler_4081374449), "MergeTwoItemsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1279888070u, new RpcReceiveHandler(__rpc_handler_1279888070), "MergeTwoItemsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2001109830u, new RpcReceiveHandler(__rpc_handler_2001109830), "SpawnNetworkObjectClientRpc"); ((NetworkBehaviour)this).__registerRpc(2610954057u, new RpcReceiveHandler(__rpc_handler_2610954057), "SpawnEnemyFromCrateClientRpc"); ((NetworkBehaviour)this).__registerRpc(1570998846u, new RpcReceiveHandler(__rpc_handler_1570998846), "SyncUponJoinServerRpc"); ((NetworkBehaviour)this).__registerRpc(804760852u, new RpcReceiveHandler(__rpc_handler_804760852), "SyncUponJoinClientRpc"); ((NetworkBehaviour)this).__registerRpc(2215639836u, new RpcReceiveHandler(__rpc_handler_2215639836), "ChangeOneUpClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2514490711(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int projectileAtIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref projectileAtIndex); Vector3 syncedPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref syncedPosition); int firedBy = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref firedBy); int destroyCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref destroyCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).RemoveProjectileServerRpc(playerID, projectileAtIndex, syncedPosition, firedBy, destroyCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3095207497(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int projectileAtIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref projectileAtIndex); Vector3 syncedPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref syncedPosition); int firedBy = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref firedBy); int destroyCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref destroyCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).RemoveProjectileClientRpc(playerID, projectileAtIndex, syncedPosition, firedBy, destroyCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4081374449(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRequestingMergeNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRequestingMergeNOR, default(ForNetworkSerializable)); NetworkObjectReference mergeWithNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mergeWithNOR, default(ForNetworkSerializable)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool removeDestroyedScrapValue = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref removeDestroyedScrapValue, default(ForPrimitives)); bool muteDestroyedItem = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref muteDestroyedItem, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).MergeTwoItemsServerRpc(itemRequestingMergeNOR, mergeWithNOR, playerID, removeDestroyedScrapValue, muteDestroyedItem); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1279888070(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRequestingMergeNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRequestingMergeNOR, default(ForNetworkSerializable)); NetworkObjectReference mergeWithNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mergeWithNOR, default(ForNetworkSerializable)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool removeDestroyedScrapValue = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref removeDestroyedScrapValue, default(ForPrimitives)); bool muteDestroyedItem = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref muteDestroyedItem, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).MergeTwoItemsClientRpc(itemRequestingMergeNOR, mergeWithNOR, playerID, removeDestroyedScrapValue, muteDestroyedItem); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2001109830(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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference objectNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectNOR, default(ForNetworkSerializable)); int spawnedByID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnedByID); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int intValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref intValue); float destroyAfterTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyAfterTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).SpawnNetworkObjectClientRpc(objectNOR, spawnedByID, spawnPos, netObjRef, intValue, destroyAfterTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2610954057(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyNOR, default(ForNetworkSerializable)); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).SpawnEnemyFromCrateClientRpc(enemyNOR, spawnPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1570998846(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_804760852(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] hostPlayerOneUps = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostPlayerOneUps, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).SyncUponJoinClientRpc(playerID, hostPlayerOneUps); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2215639836(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int change = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref change); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrashBandicootCratesManagerScript)(object)target).ChangeOneUpClientRpc(playerID, change); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CrashBandicootCratesManagerScript"; } } public class AkuAkuProp : NetworkBehaviour, ICrateSpawnableObject { [HarmonyPatch(typeof(EnemyAI), "MeetsStandardPlayerCollisionConditions")] public class EnemyAIPatch { [HarmonyPostfix] public static void OnPlayerCollision(EnemyAI __instance, ref PlayerControllerB __result) { if (__instance.enemyType.canDie && !__instance.isEnemyDead && (Object)(object)__result != (Object)null) { AkuAkuProp akuAkuProp = PlayerHasAku(__result, useLocalAku: true); if ((Object)(object)akuAkuProp != (Object)null && akuAkuProp.level == 3) { __result = null; __instance.KillEnemyServerRpc(false); akuAkuProp.PlayKillSFXServerRpc(); } } } } [HarmonyPatch(typeof(PlayerControllerB))] public class PlayerPatch { [HarmonyPrefix] [HarmonyPatch("DamagePlayer")] public static bool DamagePlayerPrefix(PlayerControllerB __instance, CauseOfDeath causeOfDeath) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return AkuPreventsDamage(__instance, causeOfDeath); } [HarmonyPrefix] [HarmonyPatch("KillPlayer")] public static bool KillPlayerPrefix(PlayerControllerB __instance, CauseOfDeath causeOfDeath) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return AkuPreventsDamage(__instance, causeOfDeath); } private unsafe static bool AkuPreventsDamage(PlayerControllerB __instance, CauseOfDeath causeOfDeath) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) { Logger.LogDebug((object)$"PreventDamage on {__instance} not for local player"); return true; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)("causeOfDeath: " + ((object)(*(CauseOfDeath*)(&causeOfDeath))/*cast due to .constrained prefix*/).ToString())); } for (int i = 0; i < CrashBandicootCratesManagerScript.Instance.invalidAkuDeaths.Length; i++) { CauseOfDeath val = CrashBandicootCratesManagerScript.Instance.invalidAkuDeaths[i]; if (causeOfDeath == val) { Logger.LogDebug((object)("causeOfDeath " + ((object)(*(CauseOfDeath*)(&causeOfDeath))/*cast due to .constrained prefix*/).ToString() + " invalid for Aku Aku to prevent damage")); return true; } } AkuAkuProp akuAkuProp = PlayerHasAku(__instance, useLocalAku: true); if ((Object)(object)akuAkuProp != (Object)null && akuAkuProp.level != 3) { int level = akuAkuProp.level; akuAkuProp.ChangeAkuLevel(level - 1); akuAkuProp.ChangeAkuLevelServerRpc(level - 1, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } return (Object)(object)akuAkuProp == (Object)null; } } private static ManualLogSource Logger; [Header("General")] public GameObject akuData; public float invincibilityTime; public float cooldownOnProtection; public float[] lerpSpeeds = new float[4]; private Transform lerpToPos; private float lerpSpeed; public static AkuAkuProp localAku; private int level; private float startedInvincibilityAt; private bool onLocalPlayer; private PlayerControllerB spawnedBy; private Coroutine protectCoroutine; private Coroutine destroyCoroutine; private float checkParentInterval; private float checkParentTimer; [Space(3f)] [Header("Audiovisual")] public Light levelTwoLight; [Space] public AudioSource levelThreeMusic; public AudioClip spawnSFX; public AudioClip takeHitSFX; public AudioClip loseInvincibilitySFX; public AudioClip killSFX; private void Start() { lerpSpeed = lerpSpeeds[0]; if ((Object)(object)levelTwoLight != (Object)null) { ((Behaviour)levelTwoLight).enabled = false; levelTwoLight.intensity = 25f; levelTwoLight.range = 50f; levelTwoLight.shadows = (LightShadows)0; } else { Logger.LogWarning((object)$"please add light to {((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId}!"); } } private void Update() { //IL_00db: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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) if (!((Object)(object)lerpToPos != (Object)null)) { return; } if (checkParentTimer >= checkParentInterval) { checkParentTimer = 0f; ReparentAku(); } else { checkParentTimer += Time.deltaTime; } if (!spawnedBy.isPlayerControlled) { ChangeAkuLevel(0); return; } if (level == 3) { ((Component)this).transform.Rotate(0f, 500f * Time.deltaTime, 0f, (Space)1); spawnedBy.sprintMeter = 1f; if (onLocalPlayer && Time.realtimeSinceStartup - startedInvincibilityAt > invincibilityTime) { ChangeAkuLevel(1); ChangeAkuLevelServerRpc(1, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } else { ((Component)this).transform.eulerAngles = lerpToPos.eulerAngles; } if (onLocalPlayer && spawnedBy.teleportedLastFrame) { ((Component)this).transform.position = lerpToPos.position; } else { ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, lerpToPos.position, lerpSpeed); } } void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { Logger.LogDebug((object)$"{((Object)this).name} spawned on client from crate {spawnedFromCrate} by player {spawnedByPlayer}"); CrashBandicootCratesManagerScript.PlayNoise(levelThreeMusic, spawnSFX, audibleNoise: true, 15f, 0.66f); if ((Object)(object)spawnedByPlayer != (Object)null) { spawnedBy = spawnedByPlayer; onLocalPlayer = (Object)(object)spawnedBy == (Object)(object)GameNetworkManager.Instance.localPlayerController; Logger.LogDebug((object)$"onLocalPlayer? {onLocalPlayer}"); AkuAkuProp[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (AkuAkuProp akuAkuProp in array) { if (!((Object)(object)akuAkuProp == (Object)null) && !((Object)(object)akuAkuProp == (Object)(object)this) && !((Object)(object)akuAkuProp.spawnedBy == (Object)null) && (Object)(object)akuAkuProp.spawnedBy == (Object)(object)spawnedBy) { Logger.LogDebug((object)("found other Aku on player " + spawnedBy.playerUsername)); akuAkuProp.ChangeAkuLevel(akuAkuProp.level + 1); DestroyAku(); return; } } GetInitialValues(1); } else { DestroyAku(); } } private void GetInitialValues(int setLevelFromHere) { Transform val = spawnedBy.playerGlobalHead.Find("AkuFloatPos(Clone)"); if ((Object)(object)val != (Object)null) { lerpToPos = val; if (onLocalPlayer) { localAku = this; Logger.LogDebug((object)$"set localAku to {localAku} #{((NetworkBehaviour)localAku).NetworkObjectId}"); } ChangeAkuLevel(setLevelFromHere); int num = 0; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled) { num++; } } checkParentInterval = num; Logger.LogDebug((object)$"initialized with checkParentInterval {checkParentInterval}"); } else { Logger.LogWarning((object)$"Aku #{((NetworkBehaviour)this).NetworkObjectId} failed to find floatPosTemplate on player {spawnedBy.playerUsername}"); DestroyAku(); } } [ServerRpc(RequireOwnership = false)] public void ChangeAkuLevelServerRpc(int snapTo, int sentByID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2448394004u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, snapTo); BytePacker.WriteValueBitPacked(val, sentByID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2448394004u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ChangeAkuLevelClientRpc(snapTo, sentByID); } } } [ClientRpc] public void ChangeAkuLevelClientRpc(int snapTo, int sentByID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4089673511u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, snapTo); BytePacker.WriteValueBitPacked(val, sentByID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4089673511u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sentByID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { ChangeAkuLevel(snapTo); } } } private void ChangeAkuLevel(int snapTo) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (level < 3 && snapTo < level) { CrashBandicootCratesManagerScript.PlayNoise(levelThreeMusic, takeHitSFX); ExplosionSpawner explosionSpawner = null; if ((Object)(object)akuData != (Object)null) { explosionSpawner = akuData.GetComponentInChildren(); } if ((Object)(object)explosionSpawner != (Object)null) { StunGrenadeItem.StunExplosion(((Component)this).transform.position, explosionSpawner.stunAffectAudio, explosionSpawner.stunSeverityMultiplier, explosionSpawner.stunEnemyTime, explosionSpawner.stunDistanceRolloff, false, (PlayerControllerB)null, spawnedBy, 0f); } if ((Object)(object)spawnedBy != (Object)null && onLocalPlayer && (Object)(object)spawnedBy.inAnimationWithEnemy != (Object)null && !spawnedBy.inAnimationWithEnemy.isEnemyDead && spawnedBy.inAnimationWithEnemy.enemyType.canDie) { spawnedBy.inAnimationWithEnemy.KillEnemyServerRpc(false); PlayKillSFXServerRpc(); } ProtectLocalPlayer(); } if (level == 3 && snapTo < 3) { SetPlayerInvincible(setTo: false); } level = Mathf.Clamp(snapTo, 0, 3); ((Behaviour)levelTwoLight).enabled = level >= 2; lerpSpeed = lerpSpeeds[level]; switch (level) { case 0: DestroyAku(); break; case 3: SetPlayerInvincible(setTo: true); break; } Logger.LogDebug((object)$"set level {level} & lerpSpeed {lerpSpeed}"); } public void SetPlayerInvincible(bool setTo) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) Logger.LogDebug((object)$"SetPlayerInvincible({setTo}) on {spawnedBy.playerUsername}"); if (setTo) { if (protectCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(protectCoroutine); protectCoroutine = null; } StartOfRound.Instance.allowLocalPlayerDeath = true; ((Component)this).transform.eulerAngles = Vector3.zero; startedInvincibilityAt = Time.realtimeSinceStartup; if (!levelThreeMusic.isPlaying) { levelThreeMusic.Play(); } } else { levelThreeMusic.Stop(); CrashBandicootCratesManagerScript.PlayNoise(levelThreeMusic, loseInvincibilitySFX); } } [ServerRpc(RequireOwnership = false)] private void PlayKillSFXServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4045653367u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4045653367u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayKillSFXClientRpc(); } } } [ClientRpc] private void PlayKillSFXClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2385211784u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2385211784u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CrashBandicootCratesManagerScript.PlayNoise(levelThreeMusic, killSFX); } } } private void ReparentAku() { if ((Object)(object)((Component)this).transform.parent != (Object)(object)((Component)spawnedBy).transform.parent) { Logger.LogDebug((object)$"Caught parent-discrepancy between {((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId} and {spawnedBy.playerUsername}. Reparenting to {((Component)spawnedBy).transform.parent}"); ((Component)this).transform.SetParent(((Component)spawnedBy).transform.parent, true); } } public void ProtectLocalPlayer() { if (onLocalPlayer) { if (protectCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(protectCoroutine); protectCoroutine = null; } protectCoroutine = ((MonoBehaviour)this).StartCoroutine(LocalInvincibilityCooldown()); } } private IEnumerator LocalInvincibilityCooldown() { StartOfRound.Instance.allowLocalPlayerDeath = false; Logger.LogDebug((object)$"{((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId} set allowLocalPlayerDeath: {StartOfRound.Instance.allowLocalPlayerDeath}"); yield return (object)new WaitForSeconds(cooldownOnProtection); StartOfRound.Instance.allowLocalPlayerDeath = true; Logger.LogDebug((object)$"{((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId} set allowLocalPlayerDeath: {StartOfRound.Instance.allowLocalPlayerDeath}"); protectCoroutine = null; } public void DestroyAku() { if (destroyCoroutine == null) { destroyCoroutine = ((MonoBehaviour)this).StartCoroutine(DestroyAfterDelay()); } } private IEnumerator DestroyAfterDelay() { if ((Object)(object)localAku == (Object)(object)this) { localAku = null; } spawnedBy = null; lerpToPos = null; ((Behaviour)levelTwoLight).enabled = false; if (level == 3) { levelThreeMusic.Stop(); } ((Renderer)((Component)this).GetComponent()).enabled = false; yield return (object)new WaitForSeconds(5f); if (((NetworkBehaviour)this).IsServer) { ((Component)this).GetComponent().Despawn(true); } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2446797479u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2446797479u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; int hostPlayerSpawnedBy = -1; if ((Object)(object)spawnedBy != (Object)null) { hostPlayerSpawnedBy = (int)spawnedBy.playerClientId; } SyncUponJoinClientRpc(playerID, level, hostPlayerSpawnedBy); } } [ClientRpc] private void SyncUponJoinClientRpc(int playerID, int hostLevel, int hostPlayerSpawnedBy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(605865894u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, hostLevel); BytePacker.WriteValueBitPacked(val, hostPlayerSpawnedBy); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 605865894u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { if (hostPlayerSpawnedBy == -1) { DestroyAku(); return; } spawnedBy = StartOfRound.Instance.allPlayerScripts[hostPlayerSpawnedBy]; GetInitialValues(hostLevel); Logger.LogDebug((object)$"Locally received data for {((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId}: spawnedBy = {spawnedBy.playerUsername} | level = {level}"); } } private static AkuAkuProp PlayerHasAku(PlayerControllerB playerProtected, bool useLocalAku = false) { if (useLocalAku && (Object)(object)localAku != (Object)null && !localAku.spawnedBy.isPlayerDead && localAku.spawnedBy.AllowPlayerDeath()) { Logger.LogDebug((object)$"PlayerDamagePrevention USED LOCAL {((Object)localAku).name} #{((NetworkBehaviour)localAku).NetworkObjectId} with level {localAku.level} on {playerProtected.playerUsername}"); return localAku; } if ((Object)(object)playerProtected == (Object)null || !((NetworkBehaviour)playerProtected).IsOwner || playerProtected.isPlayerDead || !playerProtected.AllowPlayerDeath()) { return null; } AkuAkuProp[] array = Object.FindObjectsByType((FindObjectsSortMode)0); if (array == null || array.Length == 0) { return null; } AkuAkuProp[] array2 = array; foreach (AkuAkuProp akuAkuProp in array2) { if (!((Object)(object)akuAkuProp == (Object)null) && !((Object)(object)akuAkuProp.spawnedBy == (Object)null) && (Object)(object)akuAkuProp.spawnedBy == (Object)(object)playerProtected) { Logger.LogDebug((object)$"PlayerDamagePrevention FOUND NEW {((Object)akuAkuProp).name} #{((NetworkBehaviour)akuAkuProp).NetworkObjectId} with level {akuAkuProp.level} on {playerProtected.playerUsername}"); return akuAkuProp; } } return null; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2448394004u, new RpcReceiveHandler(__rpc_handler_2448394004), "ChangeAkuLevelServerRpc"); ((NetworkBehaviour)this).__registerRpc(4089673511u, new RpcReceiveHandler(__rpc_handler_4089673511), "ChangeAkuLevelClientRpc"); ((NetworkBehaviour)this).__registerRpc(4045653367u, new RpcReceiveHandler(__rpc_handler_4045653367), "PlayKillSFXServerRpc"); ((NetworkBehaviour)this).__registerRpc(2385211784u, new RpcReceiveHandler(__rpc_handler_2385211784), "PlayKillSFXClientRpc"); ((NetworkBehaviour)this).__registerRpc(2446797479u, new RpcReceiveHandler(__rpc_handler_2446797479), "SyncUponJoinServerRpc"); ((NetworkBehaviour)this).__registerRpc(605865894u, new RpcReceiveHandler(__rpc_handler_605865894), "SyncUponJoinClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2448394004(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int snapTo = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref snapTo); int sentByID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sentByID); target.__rpc_exec_stage = (__RpcExecStage)1; ((AkuAkuProp)(object)target).ChangeAkuLevelServerRpc(snapTo, sentByID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4089673511(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int snapTo = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref snapTo); int sentByID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sentByID); target.__rpc_exec_stage = (__RpcExecStage)1; ((AkuAkuProp)(object)target).ChangeAkuLevelClientRpc(snapTo, sentByID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4045653367(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; ((AkuAkuProp)(object)target).PlayKillSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2385211784(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; ((AkuAkuProp)(object)target).PlayKillSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2446797479(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((AkuAkuProp)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_605865894(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int hostLevel = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostLevel); int hostPlayerSpawnedBy = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostPlayerSpawnedBy); target.__rpc_exec_stage = (__RpcExecStage)1; ((AkuAkuProp)(object)target).SyncUponJoinClientRpc(playerID, hostLevel, hostPlayerSpawnedBy); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AkuAkuProp"; } } public class EnemySpawner : MonoBehaviour, ICrateSpawnableObject { private static ManualLogSource Logger; public EnemyType enemyToSpawn; [Range(-1f, 3f)] public int minimumPowerLevel = -1; [Space] public bool forceSpawn; private CrateGrabbableObject crate; [Space(3f)] [Header("OnSpawnSucceeded")] public GameObject spawnObjectSuccess; public int spawnCountSuccess = 10; [Space] [Header("OnSpawnFailed")] public GameObject spawnObjectFail; public int spawnCountFail; void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { Logger.LogDebug((object)$"{((Object)this).name} instantiated on client from crate {spawnedFromCrate} by player {spawnedByPlayer}"); crate = spawnedFromCrate; DetermineSpecialForceSpawnConditions(); DoEnemySpawn(); } private void DetermineSpecialForceSpawnConditions() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 if ((Object)(object)crate != (Object)null && (Object)(object)crate.crateData != (Object)null && crate.crateData.crateType == CrateType.Slot) { forceSpawn = true; } if ((Object)(object)TimeOfDay.Instance != (Object)null && (int)TimeOfDay.Instance.currentLevelWeather == 5) { forceSpawn = true; } } private void DoEnemySpawn() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)RoundManager.Instance == (Object)null || !((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogInfo((object)$"one: DoEnemySpawn() on {this}"); } if ((Object)(object)enemyToSpawn != (Object)null) { SpawnSetEnemy(); return; } StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || instance.inShipPhase || instance.shipIsLeaving || !instance.shipHasLanded || (Object)(object)instance.currentLevel == (Object)null || !instance.currentLevel.spawnEnemiesAndScrap || (Object)(object)RoundManager.Instance == (Object)null || !RoundManager.Instance.bakedNavMesh) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)"two: fail 1"); } EnemySpawnFailed(); return; } List list = new List(); if (((Component)this).transform.position.y < -80f) { if (instance.currentLevel.Enemies != null && instance.currentLevel.Enemies.Count != 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"three: inside"); } for (int i = 0; i < instance.currentLevel.Enemies.Count; i++) { SpawnableEnemyWithRarity val = instance.currentLevel.Enemies[i]; if (val == null || (Object)(object)val.enemyType == (Object)null) { continue; } EnemyType enemyType = val.enemyType; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"four: {enemyType}"); } if (CanEnemySpawn(enemyType)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"five: adding enemy INSIDE"); } list.Add(enemyType); } } } if (instance.currentLevel.DaytimeEnemies != null && instance.currentLevel.DaytimeEnemies.Count != 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"six: tulip"); } for (int j = 0; j < instance.currentLevel.DaytimeEnemies.Count; j++) { SpawnableEnemyWithRarity val2 = instance.currentLevel.DaytimeEnemies[j]; if (val2 == null || (Object)(object)val2.enemyType == (Object)null) { continue; } EnemyType enemyType2 = val2.enemyType; if (!((Object)(object)enemyType2 != (Object)null) || !(enemyType2.enemyName == "Tulip Snake")) { continue; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"seven: {enemyType2}"); } if (CanEnemySpawn(enemyType2, countPosition: false)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"eight: adding enemy TULIP"); } list.Add(enemyType2); } } } } else { if (instance.currentLevel.Enemies != null && instance.currentLevel.Enemies.Count != 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"nine: inside"); } for (int k = 0; k < instance.currentLevel.Enemies.Count; k++) { SpawnableEnemyWithRarity val3 = instance.currentLevel.Enemies[k]; if (val3 == null || (Object)(object)val3.enemyType == (Object)null) { continue; } EnemyType enemyType3 = val3.enemyType; if ((!((Object)(object)enemyType3 != (Object)null) || !(enemyType3.enemyName == "Masked")) && !(enemyType3.enemyName == "Maneater") && !(enemyType3.enemyName == "Girl")) { continue; } if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"ten: {enemyType3}"); } if (CanEnemySpawn(enemyType3, countPosition: false)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"eleven: adding enemy SPECIAL"); } list.Add(enemyType3); } } } if (instance.currentLevel.OutsideEnemies != null && instance.currentLevel.OutsideEnemies.Count != 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"twelve: outside"); } for (int l = 0; l < instance.currentLevel.OutsideEnemies.Count; l++) { SpawnableEnemyWithRarity val4 = instance.currentLevel.OutsideEnemies[l]; if (val4 == null || (Object)(object)val4.enemyType == (Object)null) { continue; } EnemyType enemyType4 = val4.enemyType; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"thirteen: {enemyType4}"); } if (CanEnemySpawn(enemyType4)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"fourteen: adding enemy OUTSIDE"); } list.Add(enemyType4); } } } if (instance.currentLevel.DaytimeEnemies != null && instance.currentLevel.DaytimeEnemies.Count > 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"fifteen: daytime"); } for (int m = 0; m < instance.currentLevel.DaytimeEnemies.Count; m++) { SpawnableEnemyWithRarity val5 = instance.currentLevel.DaytimeEnemies[m]; if (val5 == null || (Object)(object)val5.enemyType == (Object)null) { continue; } EnemyType enemyType5 = val5.enemyType; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"sixteen: {enemyType5}"); } if (CanEnemySpawn(enemyType5)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"seventeen: adding enemy DAYTIME"); } list.Add(enemyType5); } } } } if (list == null || list.Count == 0) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)"eighteen: fail 3"); } EnemySpawnFailed(); return; } enemyToSpawn = list[Random.Range(0, list.Count)]; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"nineteen: picked Enemy: {enemyToSpawn}"); } if ((Object)(object)enemyToSpawn == (Object)null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)"twenty: fail 5"); } EnemySpawnFailed(); return; } Vector3 spawnPosition = GetSpawnPosition(); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"twenty-one: {RoundManager.Instance.GotNavMeshPositionResult} = {spawnPosition}"); } if ((Object)(object)enemyToSpawn != (Object)null && RoundManager.Instance.GotNavMeshPositionResult) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"twenty-two"); } EnemySpawnSucceeded(spawnPosition); } else { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)"twenty-three: fail 6"); } EnemySpawnFailed(); } } private void SpawnSetEnemy() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Vector3 spawnPosition = GetSpawnPosition(); if (RoundManager.Instance.GotNavMeshPositionResult && CanEnemySpawn(enemyToSpawn)) { EnemySpawnSucceeded(spawnPosition); } else { EnemySpawnFailed(); } } private bool CanEnemySpawn(EnemyType enemy, bool countPosition = true) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 if ((Object)(object)enemy == (Object)null || (Object)(object)enemy.enemyPrefab == (Object)null) { return false; } if (enemy.spawningDisabled) { return false; } if (countPosition) { if (enemy.isOutsideEnemy || enemy.isDaytimeEnemy) { if (((Component)this).transform.position.y < -80f) { return false; } } else if (((Component)this).transform.position.y >= -80f) { return false; } } if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.shipInnerRoomBounds != (Object)null) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (((Bounds)(ref bounds)).Contains(((Component)this).transform.position) && (int)enemy.SizeLimit == 1) { return false; } } if (forceSpawn) { return true; } if (enemy.numberSpawned + 1 > enemy.MaxCount) { return false; } if (enemy.isOutsideEnemy) { if (RoundManager.Instance.currentOutsideEnemyPower + enemy.PowerLevel > RoundManager.Instance.currentMaxOutsidePower) { return false; } } else if (enemy.isDaytimeEnemy) { if (TimeOfDay.Instance.normalizedTimeOfDay > enemy.normalizedTimeInDayToLeave) { return false; } if (RoundManager.Instance.currentDaytimeEnemyPower + enemy.PowerLevel > (float)StartOfRound.Instance.currentLevel.maxDaytimeEnemyPowerCount) { return false; } } else if (RoundManager.Instance.currentEnemyPower + enemy.PowerLevel > RoundManager.Instance.currentMaxInsidePower) { return false; } if (enemy.requireNestObjectsToSpawn) { bool flag = false; EnemyAINestSpawnObject[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (EnemyAINestSpawnObject val in array) { if ((Object)(object)val != (Object)null && (Object)(object)val.enemyType != (Object)null && (Object)(object)val.enemyType == (Object)(object)enemy) { flag = true; break; } } if (!flag) { return false; } } if (minimumPowerLevel != -1 && enemy.PowerLevel < (float)minimumPowerLevel) { return false; } return true; } private Vector3 GetSpawnPosition() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) return RoundManager.Instance.GetNavMeshPosition(((Component)this).transform.position, default(NavMeshHit), 3f, RoundManager.Instance.GetLayermaskForEnemySizeLimit(enemyToSpawn, false, -1)); } private void EnemySpawnFailed() { if (!((Object)(object)RoundManager.Instance == (Object)null) && ((NetworkBehaviour)RoundManager.Instance).IsServer && (Object)(object)crate != (Object)null && (Object)(object)spawnObjectFail != (Object)null && spawnCountFail > 0) { Logger.LogDebug((object)$"EnemySpawnFailed() on {crate} #{((NetworkBehaviour)crate).NetworkObjectId}: FAIL // spawnPrefab = {spawnObjectFail} & spawnAmountLeft = {spawnCountFail}"); crate.QueueSpawnCheck(StartOfRound.Instance.localPlayerController, spawnObjectFail, spawnCountFail); } } private void EnemySpawnSucceeded(Vector3 spawnPos) { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)RoundManager.Instance == (Object)null || !((NetworkBehaviour)RoundManager.Instance).IsServer || (Object)(object)enemyToSpawn == (Object)null) { return; } if ((Object)(object)crate != (Object)null && (Object)(object)spawnObjectSuccess != (Object)null && spawnCountSuccess > 0) { Logger.LogDebug((object)$"EnemySpawnSucceeded() on {crate} #{((NetworkBehaviour)crate).NetworkObjectId}: SUCCESS // spawnPrefab = {spawnObjectSuccess} & spawnAmountLeft = {spawnCountSuccess}"); crate.QueueSpawnCheck(StartOfRound.Instance.localPlayerController, spawnObjectSuccess, spawnCountSuccess); } Logger.LogDebug((object)$"spawning enemy {enemyToSpawn.enemyName} at {spawnPos}"); NetworkObjectReference spawnedEnemy = RoundManager.Instance.SpawnEnemyGameObject(spawnPos, ((Component)this).transform.eulerAngles.y, -1, enemyToSpawn); EnemyType obj = enemyToSpawn; obj.numberSpawned++; if (enemyToSpawn.isOutsideEnemy) { RoundManager instance = RoundManager.Instance; instance.currentOutsideEnemyPower += enemyToSpawn.PowerLevel; } else if (enemyToSpawn.isDaytimeEnemy) { RoundManager instance2 = RoundManager.Instance; instance2.currentDaytimeEnemyPower += enemyToSpawn.PowerLevel; } else { RoundManager instance3 = RoundManager.Instance; instance3.currentEnemyPower += enemyToSpawn.PowerLevel; if (RoundManager.Instance.currentEnemyPower == RoundManager.Instance.currentMaxInsidePower) { RoundManager.Instance.cannotSpawnMoreInsideEnemies = true; } } ((MonoBehaviour)this).StartCoroutine(SucceedSpawnCoroutine(spawnPos, spawnedEnemy)); } private IEnumerator SucceedSpawnCoroutine(Vector3 spawnPos, NetworkObjectReference spawnedEnemy) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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) yield return (object)new WaitForSeconds(0.25f); CrashBandicootCratesManagerScript.Instance.SpawnEnemyFromCrateClientRpc(spawnedEnemy, spawnPos); } } public class ExplosionSpawner : MonoBehaviour, ICrateSpawnableObject { private static ManualLogSource Logger; private bool exploded; [Header("Explosions")] public bool explosiveCrate; public float explosionKillRange = 2.5f; public float explosionDamageRange = 5f; [Range(0f, 100f)] public int explosionNonLethalDamage = 50; public float explosionPhysicsForce; [Space(3f)] [Header("Stuns")] public bool stunCrate; public bool stunAffectAudio; public float stunSeverityMultiplier = 0.75f; public float stunEnemyTime = 5f; public float stunDistanceRolloff = 1f; void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { Logger.LogDebug((object)$"{((Object)this).name}.OnSpawnObject() spawned on client from crate \"{spawnedFromCrate}\" by player \"{spawnedByPlayer}\""); SpawnExplosive(spawnedFromCrate, spawnedByPlayer); } public void SpawnExplosive(CrateGrabbableObject crate = null, PlayerControllerB player = null) { //IL_001e: 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) if (!exploded) { exploded = true; if (explosiveCrate) { Landmine.SpawnExplosion(((Component)this).transform.position, (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null, explosionKillRange, explosionDamageRange, explosionNonLethalDamage, explosionPhysicsForce, (GameObject)null, false); } if (stunCrate) { StunGrenadeItem.StunExplosion(((Component)this).transform.position, stunAffectAudio, stunSeverityMultiplier, stunEnemyTime, stunDistanceRolloff, (Object)(object)crate != (Object)null && ((GrabbableObject)crate).isHeld, ((Object)(object)crate != (Object)null) ? ((GrabbableObject)crate).playerHeldBy : null, player, 0f); } } } } public class OneUpProp : MonoBehaviour, ICrateSpawnableObject { public PlayerControllerB spawnedBy; public AudioSource clipSource; public AudioClip clip; private void Update() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)spawnedBy != (Object)null) { ((Component)this).transform.Rotate(0f, 750f * Time.deltaTime, 0f, (Space)1); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, spawnedBy.playerEye.position + Vector3.up + ((Component)spawnedBy).transform.forward * 0.25f, 0.3f); } } void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { Plugin.Logger.LogDebug((object)$"{((Object)this).name} spawned on client from crate {spawnedFromCrate} by player {spawnedByPlayer}"); spawnedBy = spawnedByPlayer; if ((Object)(object)spawnedBy == (Object)null) { ((Renderer)((Component)this).GetComponent()).enabled = false; return; } CrashBandicootCratesManagerScript.PlayNoise(clipSource, clip, audibleNoise: true, 20f, 1f); if ((Object)(object)StartOfRound.Instance != (Object)null && ((NetworkBehaviour)StartOfRound.Instance).IsServer) { CrashBandicootCratesManagerScript.Instance.ChangeOneUpClientRpc((int)spawnedBy.playerClientId, 1); } } } public class PauseClockManager : MonoBehaviour, ICrateSpawnableObject { private static ManualLogSource Logger; public float stopTimeFor = 3f; void ICrateSpawnableObject.OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer) { if (stopTimeFor <= 0f) { return; } Logger.LogDebug((object)$"{((Object)this).name} spawned on client from crate {spawnedFromCrate} by player {spawnedByPlayer}"); foreach (CrateGrabbableObject allCurrentCrate in CrashBandicootCratesManagerScript.Instance.allCurrentCrates) { if ((Object)(object)allCurrentCrate != (Object)null && (Object)(object)allCurrentCrate.crateData != (Object)null && allCurrentCrate.timerStartTime != -1f) { allCurrentCrate.TimerSetCooldown(stopTimeFor); } } if (!((Object)(object)TimeOfDay.Instance == (Object)null) && !((Object)(object)CrashBandicootCratesManagerScript.Instance == (Object)null)) { CrashBandicootCratesManagerScript.Instance.SetTimeSpeedCooldown(stopTimeFor); } } } public class ProjectileBasic : Projectile { } public class ProjectileWumpa : Projectile { [HarmonyPatch(typeof(ShowerTrigger))] public class NewShowerTrigger { [HarmonyPostfix] [HarmonyPatch("AddPlayerToShower")] public static void CleanPlayerBodyShower(PlayerControllerB playerScript) { CleanPlayerOfWumpaSplatters(playerScript); } } [HarmonyPatch(typeof(PlayerControllerB))] public class NewPlayerControllerB { [HarmonyPostfix] [HarmonyPatch("KillPlayerClientRpc")] public static void CleanPlayerBodyDeath(PlayerControllerB __instance) { if (__instance.isPlayerDead) { CleanPlayerOfWumpaSplatters(__instance); } } } private static ManualLogSource Logger; private static List splatteredOnPlayers = new List(); [Space] public Material splatterMat; public override void SpawnOnDestroy(Vector3 syncedPosition, PlayerControllerB interactingPlayer) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) List list = new List(); DestroyGameObjectOnCondition componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { list.AddRange(componentInChildren.destroyUponTriggerLayers); list.AddRange(componentInChildren.destroyUponColliderLayers); } else { list.AddRange(new string[7] { "Enemies", "Default", "Room", "Colliders", "Terrain", "Vehicle", "Railing" }); } RaycastHit hitInfo = default(RaycastHit); if (Physics.Raycast(syncedPosition + travelingDirection * -1f, travelingDirection, ref hitInfo, 2f, CrashBandicootCratesManagerScript.GetLayerMask(list.ToArray()), (QueryTriggerInteraction)2)) { DecalHit(hitInfo, interactingPlayer); } } private void DecalHit(RaycastHit hitInfo, PlayerControllerB interactingPlayer) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected I4, but got Unknown float num = 0.25f; PlayerControllerB componentInParent = ((Component)((RaycastHit)(ref hitInfo)).collider).GetComponentInParent(); EnemyAI componentInParent2 = ((Component)((RaycastHit)(ref hitInfo)).collider).GetComponentInParent(); Logger.LogDebug((object)$"hitPlayer = {componentInParent} // hitEnemy = {componentInParent2}"); if ((Object)(object)componentInParent != (Object)null || (Object)(object)componentInParent2 != (Object)null) { spawnedObjectLifetime = -1f; } GameObject val = CrashBandicootCratesManagerScript.SpawnLocalObject(spawnOnDestroy, interactingPlayer, ((RaycastHit)(ref hitInfo)).point + travelingDirection * (num / 2f), null, ((Component)((RaycastHit)(ref hitInfo)).collider).transform, spawnedObjectLifetime); Logger.LogDebug((object)$"{val} stuck to {val.transform.parent}"); val.transform.LookAt(((RaycastHit)(ref hitInfo)).point + travelingDirection); DecalProjector component = val.GetComponent(); component.decalLayerMask = (DecalLayerEnum)1; if ((Object)(object)splatterMat != (Object)null) { component.material = splatterMat; } if ((Object)(object)componentInParent != (Object)null) { int num2 = (int)componentInParent.playerClientId; if (!splatteredOnPlayers.Contains(num2)) { Logger.LogInfo((object)$"adding playerID {num2} to splatteredOnPlayers"); splatteredOnPlayers.Add(num2); } switch (num2) { case 0: component.decalLayerMask = (DecalLayerEnum)16; break; case 1: component.decalLayerMask = (DecalLayerEnum)32; break; case 2: component.decalLayerMask = (DecalLayerEnum)64; break; case 3: component.decalLayerMask = (DecalLayerEnum)128; break; } } else if ((Object)(object)componentInParent2 != (Object)null && (Object)(object)componentInParent2.enemyType != (Object)null) { EnemySize enemySize = componentInParent2.enemyType.EnemySize; switch ((int)enemySize) { case 0: num = 1.25f; break; case 2: num = 2f; break; case 1: num = 3.33f; break; } if (!componentInParent2.isOutside) { num /= 2f; } } else { num = 0.75f; } component.size = new Vector3(1f, 1f, num); } public static void CleanPlayerOfWumpaSplatters(PlayerControllerB player) { if ((Object)(object)player == (Object)null || splatteredOnPlayers == null || splatteredOnPlayers.Count == 0) { return; } int num = (int)player.playerClientId; if (!splatteredOnPlayers.Contains(num)) { return; } Logger.LogInfo((object)$"cleaning playerID {num} of splatteredOnPlayers"); splatteredOnPlayers.Remove(num); DestroyGameObjectOnCondition[] componentsInChildren = ((Component)player).GetComponentsInChildren(); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } foreach (DestroyGameObjectOnCondition destroyGameObjectOnCondition in componentsInChildren) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogWarning((object)$"found: {destroyGameObjectOnCondition}"); } if ((Object)(object)destroyGameObjectOnCondition != (Object)null && ((Object)((Component)destroyGameObjectOnCondition).gameObject).name.Contains("WumpaProjectileSplatter")) { CrashBandicootCratesManagerScript.AddDestroyConditionToObject(((Component)destroyGameObjectOnCondition).gameObject, Random.Range(0.5f, 4f)); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogError((object)$"washing off {destroyGameObjectOnCondition} in {destroyGameObjectOnCondition.destroyAfterTime} seconds"); } } } } } public class CrateCollisionEvents : MonoBehaviour { private static ManualLogSource Logger; public InteractEvent onTriggerEnterEvent; public InteractEvent onTriggerStayEvent; [Space] public bool playerMustBeGrounded; public bool playerMustBeAlive; public bool playerMustBeUnoccupied; [Space] public bool enemyCanInvokeEvent; public bool enemyMustBeAlive = true; public bool enemyMustBeKillable; public bool enemyMustBeStunnable; private void OnTriggerEnter(Collider other) { PlayerControllerB val = MeetsStandardPlayerCollisionConditions(other); if ((Object)(object)val != (Object)null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)(((Object)this).name + " Enter() successful: " + val.playerUsername)); } ((UnityEvent)(object)onTriggerEnterEvent).Invoke(val); return; } EnemyAI val2 = MeetsEnemyCollisionConditions(other); if ((Object)(object)val2 != (Object)null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{((Object)this).name} Enter() successful (enemy): {val2.enemyType.enemyName} #{val2.thisEnemyIndex}"); } ((UnityEvent)(object)onTriggerEnterEvent).Invoke((PlayerControllerB)null); } } private void OnTriggerStay(Collider other) { PlayerControllerB val = MeetsStandardPlayerCollisionConditions(other); if ((Object)(object)val != (Object)null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)(((Object)this).name + " Stay() successful: " + val.playerUsername)); } ((UnityEvent)(object)onTriggerStayEvent).Invoke(val); } } private PlayerControllerB MeetsStandardPlayerCollisionConditions(Collider other) { PlayerControllerB component = ((Component)other).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return null; } if (playerMustBeAlive && (component.isPlayerDead || !component.isPlayerControlled)) { return null; } if (playerMustBeGrounded && !component.thisController.isGrounded) { return null; } if (playerMustBeUnoccupied && (component.inSpecialInteractAnimation || (Object)(object)component.inAnimationWithEnemy != (Object)null || component.isClimbingLadder || component.inVehicleAnimation)) { return null; } return component; } private EnemyAI MeetsEnemyCollisionConditions(Collider other) { if (!enemyCanInvokeEvent) { return null; } EnemyAICollisionDetect component = ((Component)other).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.mainScript == (Object)null || (Object)(object)component.mainScript.enemyType == (Object)null) { return null; } if (enemyMustBeAlive && component.mainScript.isEnemyDead) { return null; } if (enemyMustBeKillable && !component.mainScript.enemyType.canDie) { return null; } if (enemyMustBeStunnable && !component.mainScript.enemyType.canBeStunned) { return null; } return component.mainScript; } } public class CrateInvokableEvents : NetworkBehaviour { private static ManualLogSource Logger; public CrateGrabbableObject mainObject; private ModdedCrateEvents modObject; private void Start() { if ((Object)(object)mainObject == (Object)null) { mainObject = ((Component)this).GetComponentInParent(); if ((Object)(object)mainObject == (Object)null) { Object.Destroy((Object)(object)this); } } } public void QuestionMarkStartEvent() { if ((Object)(object)mainObject != (Object)null && ((NetworkBehaviour)mainObject).IsServer) { int num = 101; SyncQuestionContentClientRpc(Random.Range(1, num)); } } [ClientRpc] private void SyncQuestionContentClientRpc(int randomNr) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3477164852u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, randomNr); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3477164852u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Logger.LogDebug((object)$"?: {randomNr}"); if (randomNr < 10) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[0]; mainObject.spawnAmountLeft = 1; mainObject.destroyUponSpecialInt = 1; } else if (randomNr < 25) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[0]; mainObject.spawnAmountLeft = 5; mainObject.destroyUponSpecialInt = 5; } else if (randomNr < 50) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[0]; mainObject.spawnAmountLeft = 10; mainObject.destroyUponSpecialInt = 10; } else if (randomNr < 55) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[0]; mainObject.spawnAmountLeft = 25; mainObject.destroyUponSpecialInt = 25; } else if (randomNr < 75) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[1]; mainObject.spawnAmountLeft = 1; mainObject.destroyUponSpecialInt = 1; } else if (randomNr < 90) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[2]; mainObject.spawnAmountLeft = 1; mainObject.destroyUponSpecialInt = 1; } else if (randomNr < 100) { mainObject.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.allBonusObjects[10]; mainObject.spawnAmountLeft = 1; mainObject.destroyUponSpecialInt = 1; } Logger.LogDebug((object)$"{((Object)mainObject).name} #{((NetworkBehaviour)mainObject).NetworkObjectId}? spawnPrefab: {mainObject.spawnPrefab} | spawnAmountLeft: {mainObject.spawnAmountLeft} | destroyUponSpecialInt: {mainObject.destroyUponSpecialInt}"); } } public void CheckpointJumpTeleportEvent(PlayerControllerB triggeredBy) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)mainObject != (Object)null) || mainObject.specialInt != 1 || triggeredBy.shipTeleporterId > 0) { return; } ShipTeleporter[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (ShipTeleporter val in array) { if (!val.isInverseTeleporter && val.buttonTrigger.interactable) { TeleportPlayerServerRpc((int)triggeredBy.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)val).NetworkObject)); break; } } } [ServerRpc(RequireOwnership = false)] private void TeleportPlayerServerRpc(int teleportPlayerID, NetworkObjectReference teleNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2553834546u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, teleportPlayerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref teleNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2553834546u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerClientRpc(teleportPlayerID, teleNOR); } } } [ClientRpc] private void TeleportPlayerClientRpc(int teleportPlayerID, NetworkObjectReference teleNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(542688263u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, teleportPlayerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref teleNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 542688263u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref teleNOR)).TryGet(ref val3, (NetworkManager)null)) { ShipTeleporter component = ((Component)val3).GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)"Failed to get script of shipTeleporter!"); return; } CrashBandicootCratesManagerScript.PlayNoise(component.shipTeleporterAudio, component.teleporterSpinSFX); component.teleporterAnimator.SetTrigger("useTeleporter"); ((MonoBehaviour)this).StartCoroutine(TeleportPlayerCoroutine(StartOfRound.Instance.allPlayerScripts[teleportPlayerID], component.teleporterPosition)); } else { Logger.LogWarning((object)"Failed to get netObj of shipTeleporter!"); } } private IEnumerator TeleportPlayerCoroutine(PlayerControllerB teleportedPlayer, Transform teleportPos) { yield return (object)new WaitForEndOfFrame(); CrashBandicootCratesManagerScript.PlayNoise(mainObject.audioSource, mainObject.crateData.audioSpecialSFX[0], mainObject.crateData.noiseAudible, mainObject.crateData.noiseRange, mainObject.crateData.noiseLoudness); teleportedPlayer.shipTeleporterId = 3; if ((Object)(object)teleportedPlayer.deadBody != (Object)null) { if ((Object)(object)teleportedPlayer.deadBody.beamUpParticle == (Object)null) { yield break; } teleportedPlayer.deadBody.beamUpParticle.Play(); } else { teleportedPlayer.beamUpParticle.Play(); } yield return (object)new WaitForSeconds(3f); bool flag = false; if ((Object)(object)teleportedPlayer.deadBody != (Object)null) { if ((Object)(object)teleportedPlayer.deadBody.grabBodyObject == (Object)null || !teleportedPlayer.deadBody.grabBodyObject.isHeldByEnemy) { flag = true; teleportedPlayer.deadBody.attachedTo = null; teleportedPlayer.deadBody.attachedLimb = null; teleportedPlayer.deadBody.secondaryAttachedLimb = null; teleportedPlayer.deadBody.secondaryAttachedTo = null; teleportedPlayer.deadBody.SetRagdollPositionSafely(teleportPos.position, true); ((Component)teleportedPlayer.deadBody).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); if ((Object)(object)teleportedPlayer.deadBody.grabBodyObject != (Object)null && teleportedPlayer.deadBody.grabBodyObject.isHeld && (Object)(object)teleportedPlayer.deadBody.grabBodyObject.playerHeldBy != (Object)null) { teleportedPlayer.deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); } } } else { flag = true; teleportedPlayer.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); AudioReverbPresets val = Object.FindAnyObjectByType(); if ((Object)(object)val != (Object)null) { val.audioPresets[3].ChangeAudioReverbForPlayer(teleportedPlayer); } teleportedPlayer.isInElevator = true; teleportedPlayer.isInHangarShipRoom = true; teleportedPlayer.isInsideFactory = false; teleportedPlayer.averageVelocity = 0f; teleportedPlayer.velocityLastFrame = Vector3.zero; teleportedPlayer.TeleportPlayer(teleportPos.position, true, 160f, false, true); } teleportedPlayer.shipTeleporterId = -1; if (flag) { CrashBandicootCratesManagerScript.PlayNoise(teleportedPlayer.movementAudio, mainObject.crateData.audioSpecialSFX[1], audibleNoise: true, 10f, 1f); } } public void CheckpointAddOrRemoveCrate(PlayerControllerB playerHit) { PlayerControllerB val = playerHit; if ((Object)(object)val == (Object)null) { if (!((NetworkBehaviour)mainObject).IsOwner) { return; } val = GameNetworkManager.Instance.localPlayerController; } bool add = mainObject.specialInt == 0; int playerID = (int)val.playerClientId; AddOrRemoveCrateLocal(add, playerID); AddOrRemoveCrateServerRpc(playerID, add); } [ServerRpc(RequireOwnership = false)] private void AddOrRemoveCrateServerRpc(int playerID, bool add) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3451619276u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref add, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3451619276u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AddOrRemoveCrateClientRpc(playerID, add); } } } [ClientRpc] private void AddOrRemoveCrateClientRpc(int playerID, bool add) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(367384006u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref add, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 367384006u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { AddOrRemoveCrateLocal(add, playerID); } } } private void AddOrRemoveCrateLocal(bool add, int playerID) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (add) { StartOfRound.Instance.mapScreen.AddTransformAsTargetToRadar(((Component)mainObject).transform, "Checkpoint", true); StartOfRound.Instance.mapScreen.SyncOrderOfRadarBoostersInList(); } else { StartOfRound.Instance.mapScreen.RemoveTargetFromRadar(((Component)mainObject).transform); } mainObject.changeSpecialIntPerWalkInto = (add ? 1 : 0); mainObject.UpdateSpecialIntLocal(mainObject.changeSpecialIntPerWalkInto, destroyLosesContent: false, CrashBandicootCratesManagerScript.GetPlayerByID(playerID)); mainObject.PlaySFX(add ? mainObject.crateData.audioSpecialSFX[1] : mainObject.crateData.audioSpecialSFX[2]); mainObject.particlesBreakColor = (add ? CrashBandicootCratesManagerScript.allAssets.allCrateColors[3] : CrashBandicootCratesManagerScript.allAssets.allCrateColors[2]); ((Component)((Component)mainObject).transform.Find("MapDot")).gameObject.SetActive(add); Logger.LogDebug((object)$"AddOrRemoveClientRpc({add}) for {((Object)mainObject).name} #{((NetworkBehaviour)mainObject).NetworkObjectId} (specialInt: {mainObject.specialInt})"); } public void ExclamationMarkActivateEvent(PlayerControllerB player) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(player, mainObject)) { TerminalAccessibleObject[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (TerminalAccessibleObject val in array) { Logger.LogDebug((object)$"found {val}"); val.CallFunctionFromTerminal(); } } } public void ExclamationMarkTimerEndEvent() { mainObject.PlaySFX(mainObject.crateData.audioSpecialSFX[1]); } public void OutlineStartEvent() { Logger.LogDebug((object)$"OutlineStartEvent() on {mainObject} #{((NetworkBehaviour)mainObject).NetworkObjectId}"); ((MonoBehaviour)this).StartCoroutine(RetagOutlineMapObjectAfterDelay()); } private IEnumerator RetagOutlineMapObjectAfterDelay() { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)"I"); } yield return (object)new WaitForSeconds(1f); TerminalAccessibleObject component = ((Component)this).GetComponent(); if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"II: {component}"); } if (!((Object)(object)component != (Object)null)) { yield break; } GameObject mapRadarObject = component.mapRadarObject; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"III: {mapRadarObject}"); } if ((Object)(object)mapRadarObject != (Object)null) { Logger.LogDebug((object)$"retagging {mapRadarObject} from {component} #{((NetworkBehaviour)component).NetworkObjectId}"); mapRadarObject.tag = "Untagged"; for (int i = 0; i < mapRadarObject.transform.childCount; i++) { ((Component)mapRadarObject.transform.GetChild(i)).gameObject.SetActive(false); } } } public void OutlineRevealInvisible(PlayerControllerB playerWhoSent) { PlayerControllerB val = playerWhoSent; if ((Object)(object)val == (Object)null) { if (!((NetworkBehaviour)mainObject).IsOwner) { return; } val = GameNetworkManager.Instance.localPlayerController; } _ = mainObject.specialInt; int playerID = (int)val.playerClientId; RevealInvisibleLocal(); RevealInvisibleServerRpc(playerID); } [ServerRpc(RequireOwnership = false)] private void RevealInvisibleServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2364715009u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2364715009u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RevealInvisibleClientRpc(playerID); } } } [ClientRpc] private void RevealInvisibleClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1224020355u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1224020355u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { RevealInvisibleLocal(); } } } private void RevealInvisibleLocal() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (mainObject.specialInt == 0 && !mainObject.destroyed) { mainObject.spawnAmountLeft = 20; mainObject.changeSpecialIntPerAttack = 1; ((Renderer)((GrabbableObject)mainObject).mainObjectRenderer).materials = (Material[])(object)new Material[3]; mainObject.collideOverrideCrate = null; mainObject.collideOverrideBounce = null; mainObject.particlesBreakColor = CrashBandicootCratesManagerScript.allAssets.allCrateColors[0]; mainObject.EnableColliders((Object)(object)((GrabbableObject)mainObject).playerHeldBy == (Object)null); mainObject.PlaySFX(mainObject.crateData.audioSpecialSFX[0]); mainObject.UpdateSpecialIntLocal(mainObject.changeSpecialIntPerJumpOnto, destroyLosesContent: false); } } private IEnumerator WaitForScrapValueSyncToRandomizeModded() { float num = 15f; if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.shipHasLanded) { num = 0.1f; } yield return (object)new WaitForSeconds(num); RollForRandomModdedCrateClientRpc(Random.Range(0, 251127)); } [ClientRpc] private void RollForRandomModdedCrateClientRpc(int serverSeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(294366648u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, serverSeed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 294366648u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CreateACrate.SetCrateModdedToNewRandom(mainObject, serverSeed); } } } public void SlotTimerEndEvent() { if (((NetworkBehaviour)mainObject).IsServer && mainObject.specialInt == mainObject.crateData.switchSpawnPrefabOnSpecialInt.Length) { SlotResetTimerClientRpc(); } } [ClientRpc] private void SlotResetTimerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1923240234u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1923240234u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; mainObject.UpdateSpecialIntLocal(0, destroyLosesContent: false, null, overrideSnapToChange: true); mainObject.TimerStart(); } } } public void TimeStartEvent(PlayerControllerB interactingPlayer) { if (((NetworkBehaviour)mainObject).IsServer) { int useRandomSeed = Random.Range(0, 1000); mainObject.RandomizeSpecialInt(interactingPlayer, 1, 4, useRandomSeed); PauseClockManager component = mainObject.spawnPrefab.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.stopTimeFor = mainObject.specialInt; Logger.LogDebug((object)$"{mainObject} #{((NetworkBehaviour)mainObject).NetworkObjectId}: SERVER stopTimeFor = {component.stopTimeFor}"); TimePauseDurationSyncClientRpc(mainObject.specialInt); } } } [ClientRpc] private void TimePauseDurationSyncClientRpc(int hostSpecialInt) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3066910326u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hostSpecialInt); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3066910326u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)mainObject).IsServer) { PauseClockManager component = mainObject.spawnPrefab.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.stopTimeFor = mainObject.specialInt; Logger.LogDebug((object)$"{mainObject} #{((NetworkBehaviour)mainObject).NetworkObjectId}: CLIENT stopTimeFor = {component.stopTimeFor}"); } } } public void DetonatorDestroyEvent(PlayerControllerB playerInteracting) { if (!((Object)(object)CrashBandicootCratesManagerScript.Instance == (Object)null) && CrashBandicootCratesManagerScript.Instance.allCurrentCrates != null && CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(playerInteracting, mainObject)) { ((MonoBehaviour)this).StartCoroutine(DetonateAllCratesOnDelay(playerInteracting)); } } private IEnumerator DetonateAllCratesOnDelay(PlayerControllerB interactingPlayer) { List list = new List(); for (int i = 0; i < CrashBandicootCratesManagerScript.Instance.allCurrentCrates.Count; i++) { CrateGrabbableObject crateGrabbableObject = CrashBandicootCratesManagerScript.Instance.allCurrentCrates[i]; if (!((Object)(object)crateGrabbableObject == (Object)null) && !((Object)(object)crateGrabbableObject == (Object)(object)mainObject) && !crateGrabbableObject.destroyed && !((Object)(object)crateGrabbableObject.spawnPrefab == (Object)null) && ((Object)(object)crateGrabbableObject.spawnPrefab.GetComponent() != (Object)null || (Object)(object)crateGrabbableObject.spawnPrefab.GetComponent() != (Object)null)) { list.Add(crateGrabbableObject); } } foreach (CrateGrabbableObject explodingCrate in list) { yield return null; if ((Object)(object)explodingCrate != (Object)null && !explodingCrate.destroyed) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"DETONATE - A: {explodingCrate}"); } explodingCrate.DestroyCrate(destroyContents: false, overrideEffects: false, shouldDoEffects: false, interactingPlayer); } } BowlingBombProp[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (BowlingBombProp bowlingBomb in array) { yield return null; if (!((Object)(object)bowlingBomb != (Object)null) || ((GrabbableObject)bowlingBomb).deactivated) { continue; } IHittable component = ((Component)bowlingBomb).GetComponent(); if (component != null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"DETONATE - B: {bowlingBomb}"); } component.Hit(1, Vector3.zero, interactingPlayer, true, -1); } } Landmine[] array2 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (Landmine landmine in array2) { yield return null; if (!((Object)(object)landmine != (Object)null) || landmine.hasExploded) { continue; } IHittable component2 = ((Component)landmine).GetComponent(); if (component2 != null) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"DETONATE - C: {landmine}"); } component2.Hit(1, Vector3.zero, interactingPlayer, true, -1); } } } public void KeyDestroyEvent(PlayerControllerB interactingPlayer) { if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(interactingPlayer, mainObject)) { ((MonoBehaviour)this).StartCoroutine(UnlockAndOpenAllDoors(interactingPlayer)); } } private IEnumerator UnlockAndOpenAllDoors(PlayerControllerB interactingPlayer) { DoorLock[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (DoorLock val in array) { if (!((Object)(object)val == (Object)null)) { if (val.isLocked) { val.UnlockDoorSyncWithServer(); } if (!val.isDoorOpened) { val.OpenOrCloseDoor(interactingPlayer); yield return null; } } } TerminalAccessibleObject[] array2 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (TerminalAccessibleObject val2 in array2) { if (val2.isBigDoor && !val2.isDoorOpen) { val2.CallFunctionFromTerminal(); yield return null; } } } public void ModdedRandomize() { modObject = ((Component)this).gameObject.GetComponent(); if ((Object)(object)modObject == (Object)null) { Logger.LogError((object)$"{this} received call for ModdedRandomize but did not have ModdedCrateEvents! call this function on a template CrateModded and nothing else"); } if (((NetworkBehaviour)mainObject).IsServer && (Object)(object)mainObject.crateData == (Object)(object)CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent().crateData) { ((MonoBehaviour)this).StartCoroutine(WaitForScrapValueSyncToRandomizeModded()); } } private bool CanModdedEventHappen() { if ((Object)(object)mainObject == (Object)null || (Object)(object)modObject == (Object)null) { return false; } if ((Object)(object)mainObject.crateData == (Object)(object)CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent().crateData) { return false; } return true; } public void ModdedStartEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallOnStartEvent(mainObject, interactingPlayer); } } public void ModdedWalkIntoEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallByWalkingIntoEvent(mainObject, interactingPlayer); } } public void ModdedJumpOntoEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallByJumpingOntoEvent(mainObject, interactingPlayer); } } public void ModdedAttackEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallByAttackingEvent(mainObject, interactingPlayer); } } public void ModdedTimerEndEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallOnTimerEndEvent(mainObject, interactingPlayer); } } public void ModdedDestroyEvent(PlayerControllerB interactingPlayer) { if (CanModdedEventHappen()) { modObject.CallOnDestroyEvent(mainObject, interactingPlayer); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3477164852u, new RpcReceiveHandler(__rpc_handler_3477164852), "SyncQuestionContentClientRpc"); ((NetworkBehaviour)this).__registerRpc(2553834546u, new RpcReceiveHandler(__rpc_handler_2553834546), "TeleportPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(542688263u, new RpcReceiveHandler(__rpc_handler_542688263), "TeleportPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3451619276u, new RpcReceiveHandler(__rpc_handler_3451619276), "AddOrRemoveCrateServerRpc"); ((NetworkBehaviour)this).__registerRpc(367384006u, new RpcReceiveHandler(__rpc_handler_367384006), "AddOrRemoveCrateClientRpc"); ((NetworkBehaviour)this).__registerRpc(2364715009u, new RpcReceiveHandler(__rpc_handler_2364715009), "RevealInvisibleServerRpc"); ((NetworkBehaviour)this).__registerRpc(1224020355u, new RpcReceiveHandler(__rpc_handler_1224020355), "RevealInvisibleClientRpc"); ((NetworkBehaviour)this).__registerRpc(294366648u, new RpcReceiveHandler(__rpc_handler_294366648), "RollForRandomModdedCrateClientRpc"); ((NetworkBehaviour)this).__registerRpc(1923240234u, new RpcReceiveHandler(__rpc_handler_1923240234), "SlotResetTimerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3066910326u, new RpcReceiveHandler(__rpc_handler_3066910326), "TimePauseDurationSyncClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3477164852(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int randomNr = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomNr); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).SyncQuestionContentClientRpc(randomNr); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2553834546(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int teleportPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref teleportPlayerID); NetworkObjectReference teleNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).TeleportPlayerServerRpc(teleportPlayerID, teleNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_542688263(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int teleportPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref teleportPlayerID); NetworkObjectReference teleNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).TeleportPlayerClientRpc(teleportPlayerID, teleNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3451619276(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool add = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref add, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).AddOrRemoveCrateServerRpc(playerID, add); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_367384006(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool add = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref add, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).AddOrRemoveCrateClientRpc(playerID, add); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2364715009(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).RevealInvisibleServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1224020355(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).RevealInvisibleClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_294366648(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int serverSeed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverSeed); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).RollForRandomModdedCrateClientRpc(serverSeed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1923240234(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; ((CrateInvokableEvents)(object)target).SlotResetTimerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3066910326(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hostSpecialInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSpecialInt); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrateInvokableEvents)(object)target).TimePauseDurationSyncClientRpc(hostSpecialInt); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CrateInvokableEvents"; } } public class CreateACrate { private static ManualLogSource Logger; private static Dictionary> levelWithCrateRarity = new Dictionary>(); private static List registeredCustomCrates = new List(); private static string moddedMoonKeyName = "Modded"; public static ModdedCrateRuntimeParameters MakeModdedCrateRuntimeParameters(CrateData crateData, Item itemProperties, string scanName = null, Material[] newMaterials = null, Mesh newMesh = null, Vector3 crateScale = default(Vector3), GameObject newBreakParticles = null, Color breakParticleColor = default(Color), GameObject specialParticles = null, Color specialParticleColor = default(Color), bool collide = true, string overrideCollide = null, string overrideBounce = null, float useCooldown = 0.25f, float bounceForce = 20f, int startingInt = 0, int destroyUpon = 1, bool addOrSnap = true, int walkChangesInt = 0, int jumpChangesInt = 1, int attackChangesInt = 99, UnityAction startEvent = null, UnityAction walkIntoEvent = null, UnityAction jumpOntoEvent = null, UnityAction attackEvent = null, UnityAction timerEndEvent = null, UnityAction destroyEvent = null, GameObject newSpawnPrefab = null, int spawnAmount = 1, float timerDuration = -1f, GameObject timerObject = null) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)crateData == (Object)null) { Logger.LogWarning((object)"Please pass CrateData to MakeModdedCrateRuntimeParameters()"); return null; } if ((Object)(object)itemProperties == (Object)null) { Logger.LogWarning((object)"Please pass an Item to MakeModdedCrateRuntimeParameters()"); return null; } ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = ScriptableObject.CreateInstance(); ((Object)moddedCrateRuntimeParameters).name = "ModdedCrateRuntimeParameters " + itemProperties.itemName; if (string.IsNullOrEmpty(((Object)crateData).name)) { ((Object)crateData).name = "CrateData " + itemProperties.itemName; } if (string.IsNullOrEmpty(((Object)itemProperties).name)) { ((Object)itemProperties).name = "Item " + itemProperties.itemName; } moddedCrateRuntimeParameters.crateData = crateData; moddedCrateRuntimeParameters.crateItemProperties = itemProperties; moddedCrateRuntimeParameters.scanNodeName = ((scanName != null) ? scanName : itemProperties.itemName); moddedCrateRuntimeParameters.crateScale = ((crateScale != default(Vector3)) ? crateScale : Vector3.one); moddedCrateRuntimeParameters.crateMaterials = newMaterials; moddedCrateRuntimeParameters.crateMesh = newMesh; moddedCrateRuntimeParameters.breakParticles = newBreakParticles; moddedCrateRuntimeParameters.breakParticleColor = ((breakParticleColor != default(Color)) ? breakParticleColor : CrashBandicootCratesManagerScript.allAssets.allCrateColors[0]); moddedCrateRuntimeParameters.specialParticles = specialParticles; moddedCrateRuntimeParameters.specialParticleColor = ((specialParticleColor != default(Color)) ? specialParticleColor : Color.white); moddedCrateRuntimeParameters.collideWithCrate = collide; moddedCrateRuntimeParameters.collideOverrideCrate = overrideCollide; moddedCrateRuntimeParameters.collideOverrideBounce = overrideBounce; moddedCrateRuntimeParameters.interactionCooldown = useCooldown; moddedCrateRuntimeParameters.bounceForce = bounceForce; moddedCrateRuntimeParameters.specialInt = startingInt; moddedCrateRuntimeParameters.destroyUponSpecialInt = destroyUpon; moddedCrateRuntimeParameters.changeSpecialIntAddOrSnap = addOrSnap; moddedCrateRuntimeParameters.changeSpecialIntPerWalkInto = walkChangesInt; moddedCrateRuntimeParameters.changeSpecialIntPerJumpOnto = jumpChangesInt; moddedCrateRuntimeParameters.changeSpecialIntPerAttack = attackChangesInt; moddedCrateRuntimeParameters.eventStart = startEvent; moddedCrateRuntimeParameters.eventWalkInto = walkIntoEvent; moddedCrateRuntimeParameters.eventJumpOnto = jumpOntoEvent; moddedCrateRuntimeParameters.eventAttack = attackEvent; moddedCrateRuntimeParameters.eventTimerEnd = timerEndEvent; moddedCrateRuntimeParameters.eventDestroy = destroyEvent; moddedCrateRuntimeParameters.spawnPrefab = newSpawnPrefab; moddedCrateRuntimeParameters.spawnAmountLeft = spawnAmount; moddedCrateRuntimeParameters.timerStartTime = timerDuration; moddedCrateRuntimeParameters.timerText = timerObject; return moddedCrateRuntimeParameters; } public static CrateData MakeCrateData(AudioClip breakSFX = null, AudioClip bounceSFX = null, AudioClip[] specialSFX = null, bool audioOneShot = true, bool audioToggle = true, bool audioRandomized = false, bool noiseAudible = true, float noiseLoudness = 0.5f, float noiseRange = 10f, float noiseInterval = 2f, Material[] switchMats = null, int[] matIndeces = null, float bounceThreshold = 2f, float bounceDivider = 10f, float bounceTime = 1f, AnimationCurve bounceCurve = null, float fallTriggersWalk = -1f, float fallTriggersJump = -1f, float fallTriggersAttack = -1f, bool walkPlaySFX = false, bool jumpPlaySFX = false, bool attackPlaySFX = false, bool timerPlaySFX = false, bool destroyPlaySFX = false, bool walkPlayParticle = false, bool jumpPlayParticle = false, bool attackPlayParticle = false, bool timerPlayParticle = false, bool destroyPlayParticle = false, GameObject[] switchPrefabsOnInt = null, bool switchToNull = false, bool countInBetween = false, float valueDecrease = 0.5f, int walkSpawnAmount = -1, int jumpSpawnAmount = -1, int attackSpawnAmount = -1, int destroySpawnAmount = -1, bool walkLosesContent = false, bool jumpLosesContent = false, bool attackLosesContent = false, bool otherLosesContent = true, int timerRepeats = 0, bool timerVisible = true, float timerMedian = 45f) { CrateData crateData = ScriptableObject.CreateInstance(); CrateData crateData2 = CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent().crateData; crateData.crateType = CrateType.Modded; crateData.audioBreakSFX = (((Object)(object)breakSFX != (Object)null) ? breakSFX : crateData2.audioBreakSFX); crateData.audioBounceSFX = (((Object)(object)bounceSFX != (Object)null) ? bounceSFX : crateData2.audioBounceSFX); crateData.audioSpecialSFX = ((specialSFX != null) ? specialSFX : crateData2.audioSpecialSFX); crateData.audioPlayOneShot = audioOneShot; crateData.audioPlayToggle = audioToggle; crateData.audioPlayRandomized = audioRandomized; crateData.noiseAudible = noiseAudible; crateData.noiseLoudness = noiseLoudness; crateData.noiseRange = noiseRange; crateData.noiseInterval = noiseInterval; crateData.switchMatOnSpecialInt = ((switchMats != null) ? switchMats : crateData2.switchMatOnSpecialInt); crateData.switchMatIndex = ((matIndeces != null) ? matIndeces : crateData2.switchMatIndex); crateData.bounceMultiplierThreshold = bounceThreshold; crateData.bounceDividerStrength = bounceDivider; crateData.bounceTime = bounceTime; crateData.bounceCurve = ((bounceCurve != null) ? bounceCurve : crateData2.bounceCurve); crateData.fallToTriggerWalkInto = fallTriggersWalk; crateData.fallToTriggerJumpOnto = fallTriggersJump; crateData.fallToTriggerAttack = fallTriggersAttack; crateData.audioPlayByWalkingInto = walkPlaySFX; crateData.audioPlayByJumpingOnto = jumpPlaySFX; crateData.audioPlayByAttacking = attackPlaySFX; crateData.audioPlayOnTimerEnd = timerPlaySFX; crateData.audioPlayOnDestroy = destroyPlaySFX; crateData.particlesPlayByWalkingInto = walkPlayParticle; crateData.particlesPlayByJumpingOnto = jumpPlayParticle; crateData.particlesPlayByAttacking = attackPlayParticle; crateData.particlesPlayOnTimerEnd = timerPlayParticle; crateData.particlesPlayOnDestroy = destroyPlayParticle; crateData.canInvokeBeforeGameStart = false; crateData.switchSpawnPrefabOnSpecialInt = switchPrefabsOnInt; crateData.changeSwitchToNull = switchToNull; crateData.changeCountInBetween = countInBetween; crateData.valueDecreasePercentage = valueDecrease; crateData.spawnPerWalkingInto = walkSpawnAmount; crateData.spawnPerJumpingOnto = jumpSpawnAmount; crateData.spawnPerAttacking = attackSpawnAmount; crateData.spawnOnDestroy = destroySpawnAmount; crateData.contentLostByWalkingInto = walkLosesContent; crateData.contentLostByJumpingOnto = jumpLosesContent; crateData.contentLostByAttacking = attackLosesContent; crateData.contentLostByNonPlayer = otherLosesContent; crateData.timerRepeats = timerRepeats; crateData.timerVisible = timerVisible; crateData.timerRandomMedian = timerMedian; return crateData; } public static Item MakeItem(string crateName = "Modded Crate", bool twoHanded = true, bool twoHandedAnim = true, bool disableWallHands = false, bool grabBeforeStart = true, float weight = 1.1f, bool trigger = false, bool holdButtonUse = false, bool spawnsOnGround = true, bool conductive = false, int maxValue = 100, int minValue = 50, bool requireBattery = false, float batteryUsage = 0f, bool autoUsePower = false, Sprite crateIcon = null, string grabAnim = "HoldLung", AudioClip grabSFX = null, AudioClip dropSFX = null, AudioClip pocketSFX = null, bool defensiveWeapon = false, string[] tooltips = null, float verticalOffset = 0.01f, int floorOffset = 0, bool dropAhead = true, Vector3 restRotation = default(Vector3), Vector3 rotationOffset = default(Vector3), Vector3 positionOffset = default(Vector3), Mesh[] meshVariants = null, Material[] materialVariants = null, bool usableInAnimations = false, bool inspectable = false) { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) Item obj = ScriptableObject.CreateInstance(); Item itemProperties = CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent().itemProperties; obj.itemName = crateName; obj.twoHanded = twoHanded; obj.twoHandedAnimation = twoHandedAnim; obj.disableHandsOnWall = disableWallHands; obj.canBeGrabbedBeforeGameStart = grabBeforeStart; obj.weight = weight; obj.itemIsTrigger = trigger; obj.holdButtonUse = holdButtonUse; obj.itemSpawnsOnGround = spawnsOnGround; obj.isConductiveMetal = conductive; obj.isScrap = true; obj.maxValue = maxValue; obj.minValue = minValue; obj.spawnPrefab = CrashBandicootCratesManagerScript.allAssets.moddedCrate; obj.requiresBattery = requireBattery; obj.batteryUsage = batteryUsage; obj.automaticallySetUsingPower = autoUsePower; obj.itemIcon = (((Object)(object)crateIcon != (Object)null) ? crateIcon : itemProperties.itemIcon); obj.grabAnim = grabAnim; obj.grabSFX = (((Object)(object)grabSFX != (Object)null) ? grabSFX : itemProperties.grabSFX); obj.dropSFX = (((Object)(object)dropSFX != (Object)null) ? dropSFX : itemProperties.dropSFX); obj.pocketSFX = (((Object)(object)pocketSFX != (Object)null) ? pocketSFX : itemProperties.pocketSFX); obj.syncGrabFunction = false; obj.syncUseFunction = false; obj.syncDiscardFunction = false; obj.syncInteractLRFunction = false; obj.saveItemVariable = true; obj.isDefensiveWeapon = defensiveWeapon; obj.toolTips = tooltips; obj.verticalOffset = verticalOffset; obj.floorYOffset = floorOffset; obj.allowDroppingAheadOfPlayer = dropAhead; obj.restingRotation = (Vector3)((restRotation != default(Vector3)) ? restRotation : new Vector3(0f, 0f, 0f)); obj.rotationOffset = (Vector3)((rotationOffset != default(Vector3)) ? rotationOffset : new Vector3(180f, 270f, 130f)); obj.positionOffset = (Vector3)((positionOffset != default(Vector3)) ? positionOffset : new Vector3(0f, -0.15f, 0.45f)); obj.meshVariants = (Mesh[])((meshVariants != null) ? ((Array)meshVariants) : ((Array)new Mesh[0])); obj.materialVariants = (Material[])((materialVariants != null) ? ((Array)materialVariants) : ((Array)new Material[0])); obj.usableInSpecialAnimations = usableInAnimations; obj.canBeInspected = inspectable; return obj; } public static void RegisterCrateToAllLevelsWithRarity(ModdedCrateRuntimeParameters runtimeParameters, int rarity) { RegisterCrateToVanillaLevelsWithRarity(runtimeParameters, rarity); RegisterCrateToLevelWithRarity(moddedMoonKeyName, runtimeParameters, rarity); } public static void RegisterCrateToAllLevelsWithRarity(ModdedCrateRuntimeParameters runtimeParameters, int rarityExperimentation, int rarityAssurance, int rarityVow, int rarityOffense, int rarityMarch, int rarityAdamance, int rarityRend, int rarityDine, int rarityTitan, int rarityEmbrion, int rarityArtifice, int rarityModded) { RegisterCrateToVanillaLevelsWithRarity(runtimeParameters, rarityExperimentation, rarityAssurance, rarityVow, rarityOffense, rarityMarch, rarityAdamance, rarityRend, rarityDine, rarityTitan, rarityEmbrion, rarityArtifice); RegisterCrateToLevelWithRarity(moddedMoonKeyName, runtimeParameters, rarityModded); } public static void RegisterCrateToVanillaLevelsWithRarity(ModdedCrateRuntimeParameters runtimeParameters, int rarity) { string[] array = new string[11] { "41 Experimentation", "220 Assurance", "56 Vow", "61 March", "20 Adamance", "85 Rend", "7 Dine", "21 Offense", "8 Titan", "68 Artifice", "5 Embrion" }; for (int i = 0; i < array.Length; i++) { RegisterCrateToLevelWithRarity(array[i], runtimeParameters, rarity); } } public static void RegisterCrateToVanillaLevelsWithRarity(ModdedCrateRuntimeParameters runtimeParameters, int rarityExperimentation, int rarityAssurance, int rarityVow, int rarityOffense, int rarityMarch, int rarityAdamance, int rarityRend, int rarityDine, int rarityTitan, int rarityEmbrion, int rarityArtifice) { RegisterCrateToLevelWithRarity("41 Experimentation", runtimeParameters, rarityExperimentation); RegisterCrateToLevelWithRarity("220 Assurance", runtimeParameters, rarityAssurance); RegisterCrateToLevelWithRarity("56 Vow", runtimeParameters, rarityVow); RegisterCrateToLevelWithRarity("61 March", runtimeParameters, rarityMarch); RegisterCrateToLevelWithRarity("20 Adamance", runtimeParameters, rarityAdamance); RegisterCrateToLevelWithRarity("85 Rend", runtimeParameters, rarityRend); RegisterCrateToLevelWithRarity("7 Dine", runtimeParameters, rarityDine); RegisterCrateToLevelWithRarity("21 Offense", runtimeParameters, rarityOffense); RegisterCrateToLevelWithRarity("8 Titan", runtimeParameters, rarityTitan); RegisterCrateToLevelWithRarity("68 Artifice", runtimeParameters, rarityArtifice); RegisterCrateToLevelWithRarity("5 Embrion", runtimeParameters, rarityEmbrion); } public static void RegisterCrateToLevelWithRarity(string levelName, ModdedCrateRuntimeParameters runtimeParameters, int rarity) { if ((Object)(object)runtimeParameters == (Object)null) { Logger.LogWarning((object)"Please pass ModdedCrateRuntimeParameters to RegisterCrateToLevelWithRarity()"); return; } RegisterCrateToModdedCrates(runtimeParameters); if (levelWithCrateRarity.ContainsKey(levelName)) { if (!levelWithCrateRarity[levelName].ContainsKey(runtimeParameters)) { levelWithCrateRarity[levelName].Add(runtimeParameters, rarity); } } else { levelWithCrateRarity.Add(levelName, new Dictionary { { runtimeParameters, rarity } }); } } public static Projectile MakeProjectile(GameObject projectilePrefab, int projectilePower = 1, float projectileSpeed = 20f, float projectileLifetime = 5f, Vector3 projectileSpin = default(Vector3), GameObject impactPrefab = null, float impactObjectLifetime = 10f, int[] impactSpawnCases = null, AudioClip[] shootSFX = null, AudioClip impactSFX = null, bool audibleProjectile = true, float audibleRange = 10f, float audibleLoudness = 0.5f, Vector3 hitboxSize = default(Vector3), Vector3 collisionSize = default(Vector3), string[] collideWithTriggerLayers = null, string[] collideWithColliderLayers = null) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)projectilePrefab == (Object)null) { Logger.LogWarning((object)"Please pass a GameObject to MakeProjectile()"); return null; } if ((Object)(object)projectilePrefab.GetComponent() != (Object)null && (Object)(object)CrashBandicootCratesManagerScript.allAssets != (Object)null && CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs != null && !CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Contains(projectilePrefab)) { Logger.LogDebug((object)$"adding projectilePrefab {projectilePrefab} to allNetworkPrefabs"); CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Add(projectilePrefab); } Projectile projectile = projectilePrefab.GetComponent(); if ((Object)(object)projectile == (Object)null) { projectile = projectilePrefab.AddComponent(); } projectile.hitPower = projectilePower; projectile.travelingSpeed = projectileSpeed; projectile.lifetime = projectileLifetime; projectile.spinDirection = ((projectileSpin != default(Vector3)) ? projectileSpin : Vector3.right); projectile.spawnOnDestroy = impactPrefab; if ((Object)(object)impactPrefab != (Object)null && (Object)(object)impactPrefab.GetComponent() != (Object)null && (Object)(object)CrashBandicootCratesManagerScript.allAssets != (Object)null && CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs != null && !CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Contains(impactPrefab)) { Logger.LogDebug((object)$"adding impactPrefab {impactPrefab} to allNetworkPrefabs"); CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Add(impactPrefab); } projectile.spawnedObjectLifetime = impactObjectLifetime; projectile.spawnCases = ((impactSpawnCases != null) ? impactSpawnCases : new int[2] { 1, 2 }); projectile.audioSource = projectilePrefab.GetComponentInChildren(); if ((Object)(object)projectile.audioSource == (Object)null) { projectile.audioSource = projectilePrefab.AddComponent(); projectile.audioSource.playOnAwake = false; projectile.audioSource.spatialBlend = 1f; projectile.audioSource.rolloffMode = (AudioRolloffMode)1; projectile.audioSource.maxDistance = audibleRange; } projectile.fireSFX = (AudioClip[])((shootSFX != null) ? ((Array)shootSFX) : ((Array)new AudioClip[1] { CrashBandicootCratesManagerScript.allAssets.allAudioClips[8] })); projectile.hitSFX = (((Object)(object)impactSFX != (Object)null) ? impactSFX : CrashBandicootCratesManagerScript.allAssets.allAudioClips[19]); projectile.noiseAudible = audibleProjectile; projectile.noiseRange = audibleRange; projectile.noiseLoudness = audibleLoudness; projectilePrefab.layer = LayerMask.NameToLayer("Default"); BoxCollider val = projectilePrefab.GetComponent(); if ((Object)(object)val == (Object)null) { val = projectilePrefab.AddComponent(); } ((Collider)val).isTrigger = true; val.size = (Vector3)((hitboxSize != default(Vector3)) ? hitboxSize : new Vector3(1f, 1f, 1f)); Rigidbody val2 = projectilePrefab.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = projectilePrefab.AddComponent(); } val2.useGravity = false; val2.isKinematic = true; val2.collisionDetectionMode = (CollisionDetectionMode)1; if ((Object)(object)((Component)projectile.audioSource).GetComponent() == (Object)null) { ((Component)projectile.audioSource).gameObject.AddComponent().useReverb = true; } DestroyGameObjectOnCondition destroyGameObjectOnCondition = projectilePrefab.GetComponentInChildren(); if ((Object)(object)destroyGameObjectOnCondition != (Object)null && (Object)(object)((Component)destroyGameObjectOnCondition).gameObject == (Object)(object)projectilePrefab) { destroyGameObjectOnCondition = null; Object.Destroy((Object)(object)destroyGameObjectOnCondition); } if ((Object)(object)destroyGameObjectOnCondition == (Object)null) { GameObject val3 = new GameObject(((Object)projectilePrefab).name + "Collision"); val3.transform.SetParent(projectilePrefab.transform, false); val3.layer = LayerMask.NameToLayer("Triggers"); destroyGameObjectOnCondition = val3.AddComponent(); } destroyGameObjectOnCondition.destroyAfterTime = projectileLifetime; destroyGameObjectOnCondition.destroyUponTriggerLayers = ((collideWithTriggerLayers != null) ? collideWithTriggerLayers : new string[1] { "Enemies" }); destroyGameObjectOnCondition.destroyUponColliderLayers = ((collideWithColliderLayers != null) ? collideWithColliderLayers : new string[7] { "Default", "Room", "Colliders", "Terrain", "Vehicle", "Railing", "InteractableObject" }); destroyGameObjectOnCondition.destroyGameObject = projectilePrefab; BoxCollider val4 = ((Component)destroyGameObjectOnCondition).GetComponent(); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)destroyGameObjectOnCondition).gameObject.AddComponent(); } ((Collider)val4).isTrigger = true; val4.size = (Vector3)((collisionSize != default(Vector3)) ? collisionSize : new Vector3(hitboxSize.x / 2f, hitboxSize.y / 2f, hitboxSize.z / 2f)); Rigidbody val5 = ((Component)destroyGameObjectOnCondition).GetComponent(); if ((Object)(object)val5 == (Object)null) { val5 = ((Component)destroyGameObjectOnCondition).gameObject.AddComponent(); } val5.useGravity = false; val5.isKinematic = true; val5.collisionDetectionMode = (CollisionDetectionMode)1; return projectile; } public static void RegisterProjectile(Projectile projectileScript, GrabbableObject ammoItem) { if ((Object)(object)projectileScript == (Object)null) { Logger.LogWarning((object)"Please pass a Projectile to RegisterProjectile()"); } else if ((Object)(object)ammoItem == (Object)null) { Logger.LogWarning((object)"Please pass a GrabbableObject to RegisterProjectile()"); } else if (!CrashBandicootCratesManagerScript.allAssets.allProjectiles.Contains(((Component)projectileScript).gameObject)) { CrashBandicootCratesManagerScript.allAssets.allProjectiles.Add(((Component)projectileScript).gameObject); ProjectileAmmo projectileAmmo = ((Component)ammoItem).GetComponent(); if ((Object)(object)projectileAmmo == (Object)null) { projectileAmmo = ((Component)ammoItem).gameObject.AddComponent(); } projectileAmmo.ammoIndex = CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count - 1; } } internal static void SetCrateModdedToNewRandom(CrateGrabbableObject crate, int randomSeed, ModdedCrateRuntimeParameters useParameters = null) { Logger.LogDebug((object)$"SetCrateModdedToNewRandom({randomSeed}, {crate})"); if ((Object)(object)crate == (Object)null || levelWithCrateRarity == null || levelWithCrateRarity.Count == 0) { Logger.LogWarning((object)$"SetCrateModdedToNewRandom() - A: attempted to set crate ({crate}) without any modded crate entries, returning"); return; } if ((Object)(object)useParameters != (Object)null) { SetCrateModdedUsingRuntimeParameters(crate, useParameters); return; } Random random = new Random(randomSeed); ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = null; string text = string.Empty; if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.currentLevel != (Object)null) { text = StartOfRound.Instance.currentLevel.PlanetName; } if (string.IsNullOrEmpty(text)) { Logger.LogWarning((object)"SetCrateModdedToNewRandom() - B: did not find valid PlanetName, returning"); return; } Dictionary dictionary = null; if (levelWithCrateRarity.ContainsKey(text)) { Logger.LogDebug((object)("SetCrateModdedToNewRandom() - C: currentLevelName: " + text)); } else { if (!levelWithCrateRarity.ContainsKey(moddedMoonKeyName)) { Logger.LogWarning((object)"SetCrateModdedToNewRandom() - E: failed to find currentLevelName to use for Dictionary, returning"); return; } Logger.LogDebug((object)$"SetCrateModdedToNewRandom() - D: currentLevel.PlanetName not registered in Dictionary for {crate}, searching dictionary for \"{moddedMoonKeyName}\""); text = moddedMoonKeyName; } dictionary = levelWithCrateRarity[text]; int num = 0; foreach (KeyValuePair item in dictionary) { if (item.Equals(null) || (Object)(object)item.Key == (Object)null) { Logger.LogWarning((object)"SetCrateModdedToNewRandom() - F: current Entry null, continuing"); } else { num += item.Value; } } Logger.LogDebug((object)$"totalRarity: {num}"); int num2 = random.Next(0, num + 1); Logger.LogDebug((object)$"randomNr: {num2}"); int num3 = 0; foreach (KeyValuePair item2 in dictionary) { if (item2.Equals(null) || (Object)(object)item2.Key == (Object)null) { Logger.LogWarning((object)"SetCrateModdedToNewRandom() - G: current Entry null, continuing"); continue; } num3 += item2.Value; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"entry.Key = {item2.Key} && entry.Value = {item2.Value} && totalSoFar = {num3}"); } if (num3 < num2) { continue; } moddedCrateRuntimeParameters = item2.Key; Logger.LogDebug((object)$"found {((Object)moddedCrateRuntimeParameters).name} at {num3}"); break; } if ((Object)(object)moddedCrateRuntimeParameters == (Object)null) { Logger.LogWarning((object)"SetCrateModdedToNewRandom() - H: failed to find ModdedCrateRuntimeParameters after going through Dictionary, returning"); return; } int crateValue = -1; if (random != null) { float num4 = 0.4f; if ((Object)(object)RoundManager.Instance != (Object)null) { num4 = RoundManager.Instance.scrapValueMultiplier; } crateValue = random.Next((int)((float)moddedCrateRuntimeParameters.crateItemProperties.minValue * num4), (int)((float)moddedCrateRuntimeParameters.crateItemProperties.maxValue * num4)); } SetCrateModdedUsingRuntimeParameters(crate, moddedCrateRuntimeParameters, crateValue, random); } private static void SetCrateModdedUsingRuntimeParameters(CrateGrabbableObject moddedCrate, ModdedCrateRuntimeParameters runtimeParameters, int crateValue = -1, Random crateRandomizer = null) { //IL_007b: 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) //IL_0087: 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_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)moddedCrate == (Object)null || (Object)(object)runtimeParameters == (Object)null) { Logger.LogWarning((object)$"SetCrateModdedUsingRuntimeParameters() given null: moddedCrate? {(Object)(object)moddedCrate == (Object)null} || runtimeParameters {(Object)(object)runtimeParameters == (Object)null}"); return; } Logger.LogDebug((object)$"SetCrateModdedUsingRuntimeParameters(): {moddedCrate} && runtimeParameters {runtimeParameters}"); moddedCrate.crateData = runtimeParameters.crateData; ((GrabbableObject)moddedCrate).itemProperties = runtimeParameters.crateItemProperties; ((GrabbableObject)moddedCrate).useCooldown = runtimeParameters.interactionCooldown; moddedCrate.particlesBreakColor = runtimeParameters.breakParticleColor; moddedCrate.particlesSpecialColor = runtimeParameters.specialParticleColor; moddedCrate.collideWithCrate = runtimeParameters.collideWithCrate; moddedCrate.collideOverrideCrate = runtimeParameters.collideOverrideCrate; moddedCrate.collideOverrideBounce = runtimeParameters.collideOverrideBounce; moddedCrate.specialInt = runtimeParameters.specialInt; moddedCrate.destroyUponSpecialInt = runtimeParameters.destroyUponSpecialInt; moddedCrate.changeSpecialIntAddOrSnap = runtimeParameters.changeSpecialIntAddOrSnap; moddedCrate.changeSpecialIntPerWalkInto = runtimeParameters.changeSpecialIntPerWalkInto; moddedCrate.changeSpecialIntPerJumpOnto = runtimeParameters.changeSpecialIntPerJumpOnto; moddedCrate.changeSpecialIntPerAttack = runtimeParameters.changeSpecialIntPerAttack; moddedCrate.spawnAmountLeft = runtimeParameters.spawnAmountLeft; moddedCrate.timerStartTime = runtimeParameters.timerStartTime; if ((Object)(object)runtimeParameters.crateMesh != (Object)null) { MeshFilter component = ((Component)((GrabbableObject)moddedCrate).mainObjectRenderer).GetComponent(); if ((Object)(object)component != (Object)null) { component.mesh = runtimeParameters.crateMesh; } } if (runtimeParameters.crateMaterials != null && runtimeParameters.crateMaterials.Length != 0) { Material[] array = (Material[])(object)new Material[runtimeParameters.crateMaterials.Length]; for (int i = 0; i < array.Length; i++) { if ((Object)(object)runtimeParameters.crateMaterials[i] != (Object)null) { array[i] = runtimeParameters.crateMaterials[i]; } else { array[i] = ((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials[i]; } } ((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials = array; } if (!string.IsNullOrEmpty(runtimeParameters.scanNodeName)) { ScanNodeProperties componentInChildren = ((Component)moddedCrate).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.headerText = runtimeParameters.scanNodeName; } } if ((Object)(object)runtimeParameters.spawnPrefab != (Object)null) { moddedCrate.spawnPrefab = runtimeParameters.spawnPrefab; } if ((Object)(object)runtimeParameters.breakParticles != (Object)null) { GameObject val = Object.Instantiate(runtimeParameters.breakParticles, ((Component)moddedCrate).transform, false); moddedCrate.particlesBreak = val.GetComponent(); } if ((Object)(object)runtimeParameters.specialParticles != (Object)null) { GameObject val2 = Object.Instantiate(runtimeParameters.specialParticles, ((Component)moddedCrate).transform, false); moddedCrate.particlesSpecial = val2.GetComponent(); } if ((Object)(object)runtimeParameters.timerText != (Object)null) { GameObject val3 = Object.Instantiate(runtimeParameters.timerText, ((Component)moddedCrate).transform, false); moddedCrate.timerText = val3.GetComponentInChildren(); } if (runtimeParameters.crateScale != Vector3.one) { Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(((Component)moddedCrate).transform.localScale.x * runtimeParameters.crateScale.x, ((Component)moddedCrate).transform.localScale.y * runtimeParameters.crateScale.y, ((Component)moddedCrate).transform.localScale.z * runtimeParameters.crateScale.z); ((Component)moddedCrate).transform.localScale = val4; ((GrabbableObject)moddedCrate).originalScale = val4; } if (crateRandomizer != null && (Object)(object)((GrabbableObject)moddedCrate).mainObjectRenderer != (Object)null) { if (runtimeParameters.crateItemProperties.meshVariants != null && runtimeParameters.crateItemProperties.meshVariants.Length != 0) { ((Component)((GrabbableObject)moddedCrate).mainObjectRenderer).GetComponent().mesh = runtimeParameters.crateItemProperties.meshVariants[crateRandomizer.Next(0, runtimeParameters.crateItemProperties.meshVariants.Length)]; } if (runtimeParameters.crateItemProperties.materialVariants != null && runtimeParameters.crateItemProperties.materialVariants.Length != 0) { Material[] array2 = (Material[])(object)new Material[((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials.Length]; if (((Component)((GrabbableObject)moddedCrate).mainObjectRenderer).GetComponent().mesh.vertexCount == ((Component)((GrabbableObject)CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent()).mainObjectRenderer).GetComponent().mesh.vertexCount) { array2[0] = ((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials[0]; array2[1] = ((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials[1]; array2[2] = runtimeParameters.crateItemProperties.materialVariants[crateRandomizer.Next(0, runtimeParameters.crateItemProperties.materialVariants.Length)]; } else { for (int j = 0; j < array2.Length; j++) { array2[j] = runtimeParameters.crateItemProperties.materialVariants[crateRandomizer.Next(0, runtimeParameters.crateItemProperties.materialVariants.Length)]; } } ((Renderer)((GrabbableObject)moddedCrate).mainObjectRenderer).materials = array2; } } if (crateValue != -1) { RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel -= (float)((GrabbableObject)moddedCrate).scrapValue; ((GrabbableObject)moddedCrate).SetScrapValue(crateValue); RoundManager instance2 = RoundManager.Instance; instance2.totalScrapValueInLevel += (float)((GrabbableObject)moddedCrate).scrapValue; } ModdedCrateEvents componentInChildren2 = ((Component)moddedCrate).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { if (runtimeParameters.eventStart != null) { componentInChildren2.eventOnStart.AddListener(runtimeParameters.eventStart); } if (runtimeParameters.eventWalkInto != null) { componentInChildren2.eventByWalkInto.AddListener(runtimeParameters.eventWalkInto); } if (runtimeParameters.eventJumpOnto != null) { componentInChildren2.eventByJumpOnto.AddListener(runtimeParameters.eventJumpOnto); } if (runtimeParameters.eventAttack != null) { componentInChildren2.eventByAttack.AddListener(runtimeParameters.eventAttack); } if (runtimeParameters.eventTimerEnd != null) { componentInChildren2.eventOnTimerEnd.AddListener(runtimeParameters.eventTimerEnd); } if (runtimeParameters.eventDestroy != null) { componentInChildren2.eventOnDestroy.AddListener(runtimeParameters.eventDestroy); } } moddedCrate.InitializeValues(); } internal static Dictionary GetLevelWithCrateRaritiesDictionary(string planetName) { if (string.IsNullOrEmpty(planetName)) { return null; } if (levelWithCrateRarity == null || levelWithCrateRarity.Count == 0) { return null; } if (levelWithCrateRarity.ContainsKey(planetName)) { return levelWithCrateRarity[planetName]; } return null; } private static void RegisterCrateToModdedCrates(ModdedCrateRuntimeParameters runtimeParameters) { if ((Object)(object)runtimeParameters == (Object)null || registeredCustomCrates.Contains(runtimeParameters)) { return; } registeredCustomCrates.Add(runtimeParameters); Logger.LogDebug((object)$"registered {((Object)runtimeParameters).name} at index {registeredCustomCrates.Count - 1}"); if ((Object)(object)runtimeParameters.spawnPrefab != (Object)null && (Object)(object)runtimeParameters.spawnPrefab.GetComponentInChildren() != (Object)null && !CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Contains(runtimeParameters.spawnPrefab)) { Logger.LogDebug((object)$"adding NetworkPrefab {runtimeParameters.spawnPrefab}"); CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Add(runtimeParameters.spawnPrefab); AddSpawnPrefabItemPropertiesToAllAssets(runtimeParameters.spawnPrefab); } if (runtimeParameters.crateData.switchSpawnPrefabOnSpecialInt != null && runtimeParameters.crateData.switchSpawnPrefabOnSpecialInt.Length != 0) { GameObject[] switchSpawnPrefabOnSpecialInt = runtimeParameters.crateData.switchSpawnPrefabOnSpecialInt; foreach (GameObject val in switchSpawnPrefabOnSpecialInt) { if ((Object)(object)val != (Object)null && (Object)(object)val.GetComponentInChildren() != (Object)null && !CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Contains(val)) { Logger.LogDebug((object)$"adding special NetworkPrefab {val}"); CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Add(val); AddSpawnPrefabItemPropertiesToAllAssets(val); } } } if ((Object)(object)runtimeParameters.crateItemProperties != (Object)null && !CrashBandicootCratesManagerScript.allAssets.allItems.Contains(runtimeParameters.crateItemProperties)) { CrashBandicootCratesManagerScript.allAssets.allItems.Add(runtimeParameters.crateItemProperties); Logger.LogDebug((object)$"added Item {runtimeParameters.crateItemProperties}"); } } private static void AddSpawnPrefabItemPropertiesToAllAssets(GameObject spawnPrefab) { if (!((Object)(object)spawnPrefab == (Object)null)) { GrabbableObject component = spawnPrefab.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.itemProperties != (Object)null && !CrashBandicootCratesManagerScript.allAssets.allItems.Contains(component.itemProperties)) { CrashBandicootCratesManagerScript.allAssets.allItems.Add(component.itemProperties); Logger.LogDebug((object)$"added spawnPrefab Item {component.itemProperties}"); } } } public static ModdedCrateRuntimeParameters GetRuntimeParameters(Item withItemProperties) { if ((Object)(object)withItemProperties == (Object)null) { Logger.LogWarning((object)"Please pass an Item to GetRuntimeParameters()"); return null; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return null; } for (int i = 0; i < registeredCustomCrates.Count; i++) { ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = registeredCustomCrates[i]; if (!((Object)(object)moddedCrateRuntimeParameters == (Object)null) && !((Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)null) && !string.IsNullOrEmpty(moddedCrateRuntimeParameters.crateItemProperties.itemName) && (Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)(object)withItemProperties) { return moddedCrateRuntimeParameters; } } return null; } public static ModdedCrateRuntimeParameters GetRuntimeParameters(string withItemName) { if (string.IsNullOrEmpty(withItemName)) { Logger.LogWarning((object)"Please pass a string to GetRuntimeParameters()"); return null; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return null; } for (int i = 0; i < registeredCustomCrates.Count; i++) { ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = registeredCustomCrates[i]; if (!((Object)(object)moddedCrateRuntimeParameters == (Object)null) && !((Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)null) && !string.IsNullOrEmpty(moddedCrateRuntimeParameters.crateItemProperties.itemName) && moddedCrateRuntimeParameters.crateItemProperties.itemName == withItemName) { return moddedCrateRuntimeParameters; } } return null; } public static ModdedCrateRuntimeParameters GetRuntimeParameters(int atIndex) { if (atIndex < 0 || atIndex >= registeredCustomCrates.Count) { Logger.LogWarning((object)"Please pass a valid integer to GetRuntimeParameters()"); return null; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return null; } return registeredCustomCrates[atIndex]; } public static int GetRuntimeParametersIndex(ModdedCrateRuntimeParameters ofParameters) { if ((Object)(object)ofParameters == (Object)null) { Logger.LogWarning((object)"Please pass ModdedCrateRuntimeParameters to GetRuntimeParametersIndex()"); return -1; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return -1; } for (int i = 0; i < registeredCustomCrates.Count; i++) { ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = registeredCustomCrates[i]; if (!((Object)(object)moddedCrateRuntimeParameters == (Object)null) && (Object)(object)moddedCrateRuntimeParameters == (Object)(object)ofParameters) { return i; } } return -1; } public static int GetRuntimeParametersIndex(Item withItemProperties) { if ((Object)(object)withItemProperties == (Object)null) { Logger.LogWarning((object)"Please pass an Item to GetRuntimeParametersIndex()"); return -1; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return -1; } for (int i = 0; i < registeredCustomCrates.Count; i++) { ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = registeredCustomCrates[i]; if (!((Object)(object)moddedCrateRuntimeParameters == (Object)null) && !((Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)null) && (Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)(object)withItemProperties) { return i; } } return -1; } public static int GetRuntimeParametersIndex(string withItemName) { if (string.IsNullOrEmpty(withItemName)) { Logger.LogWarning((object)"Please pass a string to GetRuntimeParametersIndex()"); return -1; } if (registeredCustomCrates == null || registeredCustomCrates.Count == 0) { return -1; } for (int i = 0; i < registeredCustomCrates.Count; i++) { ModdedCrateRuntimeParameters moddedCrateRuntimeParameters = registeredCustomCrates[i]; if (!((Object)(object)moddedCrateRuntimeParameters == (Object)null) && !((Object)(object)moddedCrateRuntimeParameters.crateItemProperties == (Object)null) && !string.IsNullOrEmpty(moddedCrateRuntimeParameters.crateItemProperties.itemName) && moddedCrateRuntimeParameters.crateItemProperties.itemName == withItemName) { return i; } } return -1; } public static Projectile GetProjectile(GrabbableObject withAmmoItem) { if ((Object)(object)withAmmoItem == (Object)null) { Logger.LogWarning((object)"Please pass a GrabbableObject to GetProjectile()"); return null; } if ((Object)(object)CrashBandicootCratesManagerScript.allAssets == (Object)null || CrashBandicootCratesManagerScript.allAssets.allProjectiles == null || CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count == 0) { return null; } int projectileIndex = GetProjectileIndex(withAmmoItem); if (projectileIndex < 0 || projectileIndex >= CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count) { Logger.LogWarning((object)$"GetProjectile(): index [{projectileIndex}] is invalid"); return null; } GameObject val = CrashBandicootCratesManagerScript.allAssets.allProjectiles[projectileIndex]; if ((Object)(object)val == (Object)null) { Logger.LogWarning((object)$"GetProjectile(): GameObject at index [{projectileIndex}] is null"); return null; } Projectile component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)$"GetProjectile(): Projectile at index [{projectileIndex}] is null"); } return component; } public static Projectile GetProjectile(int atIndex) { if ((Object)(object)CrashBandicootCratesManagerScript.allAssets == (Object)null || CrashBandicootCratesManagerScript.allAssets.allProjectiles == null || CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count == 0) { return null; } if (atIndex < 0 || atIndex >= CrashBandicootCratesManagerScript.allAssets.allProjectiles.Count) { Logger.LogWarning((object)"Please pass a valid integer to GetProjectile()"); return null; } GameObject val = CrashBandicootCratesManagerScript.allAssets.allProjectiles[atIndex]; if ((Object)(object)val == (Object)null) { Logger.LogWarning((object)$"GetProjectile(): GameObject at index [{atIndex}] is null"); return null; } Projectile component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)$"GetProjectile(): Projectile at index [{atIndex}] is null"); } return component; } public static int GetProjectileIndex(GrabbableObject withAmmoItem) { if ((Object)(object)withAmmoItem == (Object)null) { Logger.LogWarning((object)"Please pass a GrabbableObject to GetProjectileIndex()"); return -1; } ProjectileAmmo componentInChildren = ((Component)withAmmoItem).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Logger.LogWarning((object)$"GetProjectileIndex(): GrabbableObject {withAmmoItem} was not given ProjectileAmmo component"); return -1; } return componentInChildren.ammoIndex; } } public class DestroyGameObjectOnCondition : MonoBehaviour { private static ManualLogSource Logger; [Header("Lifetime")] [Tooltip("Once this amount of time has passed, destroyGameObject will be destroyed.\nIDestroyOnCondition.destroyCase = 0")] public float destroyAfterTime = -1f; [Space(3f)] [Header("OnTriggerEnter")] [Tooltip("Once the Collider on this object enters a Trigger on one of these layers, destroyGameObject will be destroyed.\nIDestroyOnCondition.destroyCase = 1")] public string[] destroyUponTriggerLayers; [Tooltip("Once the Collider on this object hits a Collider on one of these layers, destroyGameObject will be destroyed.\nIDestroyOnCondition.destroyCase = 2")] public string[] destroyUponColliderLayers; [Space] public GameObject destroyGameObject; private void Update() { if (destroyAfterTime != -1f) { destroyAfterTime -= Time.deltaTime; if (destroyAfterTime <= 0f) { DoDestroyLogic(0); } } } private void OnTriggerEnter(Collider other) { if ((Object)(object)other == (Object)null) { return; } string text = LayerMask.LayerToName(((Component)other).gameObject.layer); bool flag = false; int destroyCase = -1; if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"{this} OnTriggerEnter(): {((Object)((Component)other).gameObject).name} // [layer = {text}] & trigger = {other.isTrigger}"); } if (other.isTrigger) { if (destroyUponTriggerLayers == null || destroyUponTriggerLayers.Length == 0) { return; } string[] array = destroyUponTriggerLayers; for (int i = 0; i < array.Length; i++) { if (array[i] == text) { flag = true; destroyCase = 1; } } } else { if (destroyUponColliderLayers == null || destroyUponColliderLayers.Length == 0) { return; } string[] array = destroyUponColliderLayers; for (int i = 0; i < array.Length; i++) { if (array[i] == text) { flag = true; destroyCase = 2; } } } if (flag) { DoDestroyLogic(destroyCase, ((Component)other).gameObject); } } private void DoDestroyLogic(int destroyCase, GameObject interactedWithObject = null) { Logger.LogDebug((object)$"{this}: DoDestroyLogic() with destroyCase ({destroyCase}) and interactedWithObject ({interactedWithObject}) and destroyAfterTime ({destroyAfterTime})"); if ((Object)(object)destroyGameObject == (Object)null) { Logger.LogWarning((object)$"assign destroyGameObject to {this}!! destroying self"); destroyGameObject = ((Component)this).gameObject; } IDestroyOnCondition component = destroyGameObject.GetComponent(); if (component != null) { Logger.LogDebug((object)$"calling OnDestroyConditionMet() on {component}"); component.OnDestroyConditionMet(destroyCase, interactedWithObject); return; } NetworkObject component2 = destroyGameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { if (GameNetworkManager.Instance.localPlayerController.isHostPlayerObject) { Logger.LogDebug((object)$"host despawning {destroyGameObject}"); component2.Despawn(true); } else { Logger.LogDebug((object)$"client skipping {destroyGameObject}"); } } else { Logger.LogDebug((object)$"destroying {destroyGameObject}"); Object.Destroy((Object)(object)destroyGameObject); } } } public interface ICrateSpawnableObject { void OnSpawnObject(CrateGrabbableObject spawnedFromCrate, PlayerControllerB spawnedByPlayer); } public interface IDestroyOnCondition { void OnDestroyConditionMet(int destroyCase, GameObject interactedWithObject); } public interface IInventoryMergeable { bool CanThisMergeWithOther(GrabbableObject mergeWith); bool CanOtherMergeWithThis(GrabbableObject itemRequestingMerge); void MergeWithOther(GrabbableObject mergeWith, PlayerControllerB playerMerging, int otherInSlot); GrabbableObject GetMergeItemToDestroy(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith); GrabbableObject GetMergeItemThatInvokesEvent(GrabbableObject itemRequestingMerge, GrabbableObject mergeWith); } public class KartCollisionEvents : MonoBehaviour { public enum KartCollisionType { General, Driver, Passenger, Damage } private static ManualLogSource Logger; public GrabbableVehicle mainScript; public KartCollisionType collisionType; private void OnTriggerEnter(Collider other) { if (!((Object)(object)other == (Object)null) && !((Object)(object)mainScript == (Object)null)) { if (collisionType == KartCollisionType.Damage) { mainScript.DoTriggerEnter(other, this); } else if (!other.isTrigger && (((Component)other).gameObject.layer == LayerMask.NameToLayer("Room") || ((Component)other).gameObject.layer == LayerMask.NameToLayer("Terrain"))) { mainScript.DoCollisionImpact(other, this); } } } } public class ModdedCrateEvents : NetworkBehaviour { private static ManualLogSource Logger; public UnityEvent eventOnStart = new UnityEvent(); public UnityEvent eventByWalkInto = new UnityEvent(); public UnityEvent eventByJumpOnto = new UnityEvent(); public UnityEvent eventByAttack = new UnityEvent(); public UnityEvent eventOnTimerEnd = new UnityEvent(); public UnityEvent eventOnDestroy = new UnityEvent(); internal void CallOnStartEvent(CrateGrabbableObject crate, PlayerControllerB player) { eventOnStart.Invoke(crate, player); } internal void CallByWalkingIntoEvent(CrateGrabbableObject crate, PlayerControllerB player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(player, crate)) { eventByWalkInto.Invoke(crate, player); CallEventServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)crate).NetworkObject), 2); } } internal void CallByJumpingOntoEvent(CrateGrabbableObject crate, PlayerControllerB player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(player, crate)) { eventByJumpOnto.Invoke(crate, player); CallEventServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)crate).NetworkObject), 3); } } internal void CallByAttackingEvent(CrateGrabbableObject crate, PlayerControllerB player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (CrashBandicootCratesManagerScript.CanInteractionOnCrateHappenLocally(player, crate)) { eventByAttack.Invoke(crate, player); CallEventServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)crate).NetworkObject), 4); } } internal void CallOnTimerEndEvent(CrateGrabbableObject crate, PlayerControllerB player) { eventOnTimerEnd.Invoke(crate, player); } internal void CallOnDestroyEvent(CrateGrabbableObject crate, PlayerControllerB player) { eventOnDestroy.Invoke(crate, player); } [ServerRpc(RequireOwnership = false)] private void CallEventServerRpc(int playerID, NetworkObjectReference crateNOR, int switchCase) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1223823937u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref crateNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, switchCase); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1223823937u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallEventClientRpc(playerID, crateNOR, switchCase); } } } [ClientRpc] private void CallEventClientRpc(int playerID, NetworkObjectReference crateNOR, int switchCase) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3013889041u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref crateNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, switchCase); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3013889041u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { return; } NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref crateNOR)).TryGet(ref val3, (NetworkManager)null)) { CrateGrabbableObject component = ((Component)val3).GetComponent(); PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)component == (Object)null || (Object)(object)val4 == (Object)null) { Logger.LogError((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} client failed to get CRATE? {(Object)(object)component == (Object)null} // PLAYER? {(Object)(object)val4 == (Object)null}"); return; } switch (switchCase) { case 1: eventOnStart.Invoke(component, val4); break; case 2: eventByWalkInto.Invoke(component, val4); break; case 3: eventByJumpOnto.Invoke(component, val4); break; case 4: eventByAttack.Invoke(component, val4); break; case 5: eventOnTimerEnd.Invoke(component, val4); break; case 6: eventOnDestroy.Invoke(component, val4); break; } } else { Logger.LogError((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} client failed to get NETWORKOBJECT"); } } public void EventOnStart(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventOnStart() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } public void EventByWalkInto(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventByWalkInto() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } public void EventByJumpOnto(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventByJumpOnto() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } public void EventByAttack(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventByAttack() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } public void EventOnTimerEnd(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventOnTimerEnd() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } public void EventOnDestroy(CrateGrabbableObject crate, PlayerControllerB player) { Logger.LogInfo((object)$"Calling EventOnDestroy() on PLAYER {GameNetworkManager.Instance.localPlayerController} for CRATE {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1223823937u, new RpcReceiveHandler(__rpc_handler_1223823937), "CallEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(3013889041u, new RpcReceiveHandler(__rpc_handler_3013889041), "CallEventClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1223823937(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference crateNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref crateNOR, default(ForNetworkSerializable)); int switchCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref switchCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((ModdedCrateEvents)(object)target).CallEventServerRpc(playerID, crateNOR, switchCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3013889041(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference crateNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref crateNOR, default(ForNetworkSerializable)); int switchCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref switchCase); target.__rpc_exec_stage = (__RpcExecStage)1; ((ModdedCrateEvents)(object)target).CallEventClientRpc(playerID, crateNOR, switchCase); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ModdedCrateEvents"; } } public abstract class Projectile : MonoBehaviour, IDestroyOnCondition { private static ManualLogSource Logger; [Header("Parameters")] public int hitPower = 1; public float travelingSpeed = 20f; public float lifetime = 5f; [HideInInspector] public Vector3 travelingDirection; public Vector3 spinDirection = Vector3.right; [Space(3f)] [Header("Spawning")] public GameObject spawnOnDestroy; public float spawnedObjectLifetime = 10f; [Tooltip("If destroyed by its DestroyGameObjectOnCondition, will take its destroyCase and only instantiate spawnOnDestroy if destroyCase is one of these values:\n-1 = Always spawn\n0 = Lifetime ended\n1 = Entering Trigger\n2 = Hitting Collider")] public int[] spawnCases = new int[2] { 1, 2 }; [Space(3f)] [Header("Audiovisual")] public AudioSource audioSource; public AudioClip[] fireSFX; public AudioClip hitSFX; [Space] public bool noiseAudible = true; public float noiseRange = 10f; public float noiseLoudness = 0.5f; private PlayerControllerB firedBy; private float timeLived; private bool destroyed; public virtual void CreateProjectile(Vector3 direction, PlayerControllerB player) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) AudioClip clip = null; if (fireSFX != null && fireSFX.Length != 0) { clip = fireSFX[Random.Range(0, fireSFX.Length)]; } CrashBandicootCratesManagerScript.PlayNoise(audioSource, clip, noiseAudible, noiseRange, noiseLoudness); travelingDirection = direction; ((Component)this).transform.forward = travelingDirection; firedBy = player; CrashBandicootCratesManagerScript.AddProjectile(this); CrashBandicootCratesManagerScript.AddDestroyConditionToObject(((Component)this).gameObject, lifetime); if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.shipInnerRoomBounds != (Object)null) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (((Bounds)(ref bounds)).Contains(((Component)this).transform.position)) { ((Component)this).transform.SetParent(StartOfRound.Instance.elevatorTransform); } } } public virtual void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) timeLived += Time.deltaTime; ((Component)this).transform.localPosition = ((Component)this).transform.localPosition + travelingDirection * Time.deltaTime * travelingSpeed; ((Component)this).transform.Rotate(spinDirection * travelingSpeed, (Space)1); } private void OnTriggerEnter(Collider other) { if (!((Object)(object)other == (Object)null) && !destroyed) { IHittable component = ((Component)other).GetComponent(); if (component != null) { CheckHittableConditions(component, ((Component)other).gameObject, 1); } } } void IDestroyOnCondition.OnDestroyConditionMet(int destroyCase, GameObject interactedWithObject) { if ((Object)(object)interactedWithObject != (Object)null) { IHittable componentInChildren = interactedWithObject.GetComponentInChildren(); if (componentInChildren != null) { CheckHittableConditions(componentInChildren, interactedWithObject, destroyCase); return; } } DestroyProjectile(firedBy, destroyCase); } private void CheckHittableConditions(IHittable hittable, GameObject other, int destroyCase = -1) { if (hittable == null || destroyed) { return; } PlayerControllerB component = other.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)firedBy && timeLived < 0.5f) { return; } EnemyAICollisionDetect component2 = other.GetComponent(); if (!((Object)(object)component2 != (Object)null) || (!component2.onlyCollideWhenGrounded && !(((Object)(object)component2.mainScript != (Object)null) & component2.mainScript.isEnemyDead))) { if ((Object)(object)component != (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController == (Object)(object)component) { HitHittableObject(hittable, destroyCase); } else if ((Object)(object)component == (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController == (Object)(object)firedBy) { HitHittableObject(hittable, destroyCase); } } } public virtual void HitHittableObject(IHittable hittable, int destroyCase) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (hittable != null) { Logger.LogDebug((object)$"{this} HIT {hittable}"); hittable.Hit(hitPower, travelingDirection * travelingSpeed, firedBy, true, -1); DestroyProjectile(StartOfRound.Instance.localPlayerController, destroyCase); } } private void DestroyProjectile(PlayerControllerB interactingPlayer, int destroyCase) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)interactingPlayer == (Object)(object)StartOfRound.Instance.localPlayerController) { CrashBandicootCratesManagerScript.RemoveProjectile(this, ((Component)this).transform.position, firedBy, destroyCase); } } public virtual void DoImpactAndDestroy(Vector3 syncedPosition, PlayerControllerB interactingPlayer, int destroyCase) { //IL_003f: 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) destroyed = true; int[] array = spawnCases; foreach (int num in array) { if (num == -1 || num == destroyCase) { Logger.LogDebug((object)$"{this} destroying by meeting spawnCase: {num} and spawning prefab \"{spawnOnDestroy}\""); CrashBandicootCratesManagerScript.PlayNoiseAtLocation(syncedPosition, hitSFX, noiseAudible, noiseRange, noiseLoudness); SpawnOnDestroy(syncedPosition, interactingPlayer); break; } } Object.Destroy((Object)(object)((Component)this).gameObject); } public virtual void SpawnOnDestroy(Vector3 syncedPosition, PlayerControllerB interactingPlayer) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)spawnOnDestroy != (Object)null)) { return; } Transform onParent = null; if (spawnedObjectLifetime > 0f) { if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.shipBounds != (Object)null) { Bounds bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(syncedPosition)) { onParent = StartOfRound.Instance.elevatorTransform; goto IL_0095; } } if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { onParent = RoundManager.Instance.mapPropsContainer.transform; } } goto IL_0095; IL_0095: CrashBandicootCratesManagerScript.SpawnLocalObject(spawnOnDestroy, interactingPlayer, syncedPosition, null, onParent, spawnedObjectLifetime); } } internal class Configs { private static ManualLogSource Logger; public static ConfigEntry rarityMultiplier; public static ConfigEntry loadingScreenMusic; public Configs(ConfigFile cfg) { rarityMultiplier = cfg.Bind("Customization", "Multiplier Rarity", 1f, "Set a custom multiplier for the spawn chance of Crash Bandicoot Crates.\nCannot be negative.\nLobby host's values are used."); loadingScreenMusic = cfg.Bind("Secret", "L O A D I N G", false, "Play classic loading music while entering a planet's atmosphere.\nRequires playing with LCSimonTendoPlaylistsMod."); } public static void DisplayConfigs() { if (rarityMultiplier.Value < 0f) { Logger.LogWarning((object)$"Config [Multiplier Rarity] is set to an invalid value of {rarityMultiplier.Value}. Resetting to default value."); rarityMultiplier.Value = 1f; } else { Logger.LogInfo((object)$"Config [Multiplier Rarity] is set to a value of {rarityMultiplier.Value}"); } if (loadingScreenMusic.Value) { Logger.LogInfo((object)"Config [L O A D I N G] is set to TRUE. Loading screen music will play if playing with LCSimonTendoPlaylistsMod."); } else { Logger.LogInfo((object)"Config [L O A D I N G] is set to TRUE. No loading screen songs will be added."); } } } [CreateAssetMenu(menuName = "LCCrashBandicootCratesMod/AllAssets")] public class CrashBandicootCratesAllAssets : ScriptableObject { [Space(3f)] [Header("NetworkPrefabs")] public List allNetworkPrefabs = new List(); [Space(3f)] [Header("AllItemsList")] public List allItems = new List(); [Space(3f)] [Header("SpawnableScrap")] public List allSpawnableScrap = new List(); [Space(3f)] [Header("BonusObjects")] public List allBonusObjects = new List(); [Space(3f)] [Header("Projectiles")] public List allProjectiles = new List(); [Space(3f)] [Header("Audiovisual")] public List allParticles = new List(); public List allCrateMaterials = new List(); public List allAudioClips = new List(); public List allCrateColors = new List(); [Space(3f)] [Header("Miscellaneous")] public GameObject timerObject; public GameObject moddedCrate; [Space(10f)] [Header("Mod Compatibility")] public AudioClip[] loadingMusicSongs; public int[] loadingMusicRarities; } [CreateAssetMenu(menuName = "LCCrashBandicootCratesMod/CrateData")] public class CrateData : ScriptableObject { [Header("General")] [Tooltip("A general signifier to determine what kind of crate this is, specifically for special interactions and Modded crates.")] public CrateType crateType; [Space(3f)] [Header("Audiovisual")] [Tooltip("The SFX to play once this crate is destroyed.")] public AudioClip audioBreakSFX; [Tooltip("The SFX to play once a player bounces off this crate, or if this crate bounces off another crate.")] public AudioClip audioBounceSFX; [Tooltip("Special SFX that are influenced by the audioPlayBy checkmarks.\nUnless audioPlayRandomized is true or custom-coded otherwise, crates will only look for the first AudioClip in this array.")] public AudioClip[] audioSpecialSFX = (AudioClip[])(object)new AudioClip[1]; [Tooltip("Whether SFX played from this crate will play a single time, or will loop.\nOnly has an effect on audioSpecialSFX.")] public bool audioPlayOneShot = true; [Tooltip("Set whether audioSpecialSFX played from this crate will toggle between playing and stopping when audioPlayBy is called, or if the next song will instantly start.\nHas no effect if audioPlayOneShot is true.")] public bool audioPlayToggle = true; [Tooltip("Whether or not the audioPlayBy booleans play random clips from audioSpecialSFX, or if they only call the first clip in the array.")] public bool audioPlayRandomized; [Tooltip("Whether SFX played from this crate are audible to enemies.\nHas an effect on all SFX played from this crate.")] public bool noiseAudible = true; [Tooltip("If noiseAudible is true, how loud SFX played from this crate are to enemies.\nHas an effect on all SFX played from this crate.")] public float noiseLoudness = 0.5f; [Tooltip("If noiseAudible is true, from how far away enemies can hear SFX played from this crate.\nHas an effect on all SFX played from this crate.")] public float noiseRange = 10f; [Tooltip("If audioPlayOneShot is false, noiseAudible is true, and this crate is playing sounds, set how long in a row a sound needs to be playing in order to be audible to enemies.")] public float noiseInterval = 2f; [Space] [Tooltip("Once this crate's specialInt matches an index of this array, switch to the Material at the index that specialInt matches with.")] public Material[] switchMatOnSpecialInt; [Tooltip("All indeces of this object's MeshRenderer.materials that are updated with the Materials from switchMatOnSpecialInt.\n0 is the rim, 1 is the top and bottom, and 2 is the face of the crate.")] public int[] switchMatIndex = new int[1] { 2 }; [Space(3f)] [Header("Interactions")] [Tooltip("How much stronger the bounceForce of a landed-on crate needs to be than this crate's bounceForce for this crate to bounce off.")] public float bounceMultiplierThreshold = 2f; [Tooltip("By how much to divide a crate's bounceForce when bouncing off of it to determine how many units high this crate will bounce.")] public float bounceDividerStrength = 10f; [Tooltip("How long in seconds this crate stays in the air when bounced off of another crate.")] public float bounceTime = 1f; [Tooltip("The vertical distance this crate follows when bounced off of another crate.")] public AnimationCurve bounceCurve; [Space] [Tooltip("Falling this distance calls WalkIntoCrate().\nIf this value is -1, falling will not call WalkIntoCrate(), no matter the fall distance.")] public float fallToTriggerWalkInto = -1f; [Tooltip("Falling this distance calls JumpOntoCrate().\nIf this value is -1, falling will not call JumpOntoCrate(), no matter the fall distance.")] public float fallToTriggerJumpOnto = -1f; [Tooltip("Falling this distance calls AttackCrate().\nIf this value is -1, falling will not call AttackCrate(), no matter the fall distance.")] public float fallToTriggerAttack = -1f; [Space] [Tooltip("Play audioSpecialSFX upon walking into this crate.")] public bool audioPlayByWalkingInto; [Tooltip("Play audioSpecialSFX upon jumping onto this crate.")] public bool audioPlayByJumpingOnto; [Tooltip("Play audioSpecialSFX upon attacking this crate.")] public bool audioPlayByAttacking; [Tooltip("Play audioSpecialSFX upon this crate's timer ending.")] public bool audioPlayOnTimerEnd; [Tooltip("Play audioSpecialSFX upon destroying this crate.")] public bool audioPlayOnDestroy; [Space] [Tooltip("Play the crate's particlesSpecial upon walking into this crate.")] public bool particlesPlayByWalkingInto; [Tooltip("Play the crate's particlesSpecial upon jumping onto this crate.")] public bool particlesPlayByJumpingOnto; [Tooltip("Play the crate's particlesSpecial upon attacking this crate.")] public bool particlesPlayByAttacking; [Tooltip("Play the crate's particlesSpecial upon this crate's timer ending.")] public bool particlesPlayOnTimerEnd; [Tooltip("Play the crate's particlesSpecial upon destroying this crate.")] public bool particlesPlayOnDestroy; [Space] [Tooltip("Set whether a match has to have started yet in order to call Start() events on this crate.\nLeave false as to not overwrite events from previous play sessions when starting a new play session.")] public bool canInvokeBeforeGameStart; [Space(3f)] [Header("Contents")] [Tooltip("Once this crate's specialInt matches an index of this array, switch to the spawnPrefab at the index that specialInt matches with.")] public GameObject[] switchSpawnPrefabOnSpecialInt; [Tooltip("Set to true to make it so empty entries of switchSpawnPrefabOnSpecialInt set this crate's spawnPrefab to null.\nKeep it at false so empty entries keep the spawnPrefab as-is.")] public bool changeSwitchToNull; [Tooltip("Set to true to make it so a changeSpecialIntPer interaction will also count the indeces of switchSpawnPrefab and switchMat that are between the old and the new value.\nLeave at false to only check the switch-indeces of the new value.")] public bool changeCountInBetween; [Space] [Tooltip("Determine what percentage of the scrapValue of this crate's spawned contents should be subtracted from this crate's scrapValue when spawning this crate's contents.\nHigher values mean larger decreases in the crate's scrapValue.")] [Range(0f, 1f)] public float valueDecreasePercentage = 0.5f; [Space] [Tooltip("Determine how many of this crate's spawnPrefabs spawn at a time per walking into it.\n-1 spawns all of its contents at the same time.")] public int spawnPerWalkingInto = -1; [Tooltip("Determine how many of this crate's spawnPrefabs spawn at a time per jumping onto it.\n-1 spawns all of its contents at the same time.")] public int spawnPerJumpingOnto = -1; [Tooltip("Determine how many of this crate's spawnPrefabs spawn at a time per attacking it.\n-1 spawns all of its contents at the same time.")] public int spawnPerAttacking = -1; [Tooltip("Determine how many of this crate's spawnPrefabs spawn at a time when it gets destroyed.\n-1 spawns all of its contents at the same time.")] public int spawnOnDestroy = -1; [Space] [Tooltip("Determine if this crate getting destroyed by being walked into instantly prevents any more of this crate's spawnPrefabs from spawning.")] public bool contentLostByWalkingInto; [Tooltip("Determine if this crate getting destroyed by being bounced off instantly prevents any more of this crate's spawnPrefabs from spawning.")] public bool contentLostByJumpingOnto; [Tooltip("Determine if this crate getting destroyed by being attacked instantly prevents any more of this crate's spawnPrefabs from spawning.")] public bool contentLostByAttacking; [Tooltip("Determine if this crate getting destroyed by falling or getting attacked by something other than a player instantly prevents any more of this crate's spawnPrefabs from spawning.")] public bool contentLostByNonPlayer = true; [Space(3f)] [Header("Timers")] [Tooltip("Set how many this crate's timers will reset to their starting values upon reaching zero before not restaring.\nLeave at 0 to not repeat, set to -1 to repeat indefinitely.")] public int timerRepeats; [Tooltip("Set whether a crate with an active timer should have that timer be visible.")] public bool timerVisible; [Tooltip("The middle point of time that this crate's timer can be if randomizing it using RandomizeTimerStartTime().\nThe argument passed to RandomizeTimerStartTime will return a value that is between this median minus the argument and this median plus the offset.")] public float timerRandomMedian = 45f; } public enum CrateType { None, AkuAku, Arrow, Bazooka, Bomb, Bounce, Carpet, Checkpoint, Cortex, Crystal, Detonator, Exclamation, Fake, Freeze, Gem, Iron, Jukebox, Kart, Key, Nitro, Normal, OneUp, Outline, Question, Relic, Slot, Time, Tnt, Modded } [CreateAssetMenu(menuName = "LCCrashBandicootCratesMod/LevelWithRarities")] public class LevelWithRarities : ScriptableObject { public int levelID; public SpawnableItemWithRarity[] spawnableItems; } [CreateAssetMenu(menuName = "LCCrashBandicootCratesMod/ModdedCrateRuntimeParameters")] public class ModdedCrateRuntimeParameters : ScriptableObject { [Header("General")] [Tooltip("The static data every instance of this crate determines its modded CrateGrabbableObject data from at runtime.\nCannot be empty.")] public CrateData crateData; [Tooltip("The static data every instance of this crate determines its vanilla GrabbableObject data from at runtime.\nCannot be empty.")] public Item crateItemProperties; [Space(3f)] [Header("Audiovisual")] [Tooltip("The headerText this crate's ScanNodeProperties will show when being pinged by a player scan.\nIf left empty, will show this crate's itemProperties.itemName.")] public string scanNodeName; [Tooltip("The relative size of this crate in comparison to the rest of this mod's crates.")] public Vector3 crateScale = new Vector3(1f, 1f, 1f); [Tooltip("Custom materials to display on this crate.\nIf left empty, will use the default basic Crate materials.\nIndex 0 in this array is the rim of the crate, index 1 is the top, and index 2 is the face of the crate, usually its signifying icon.")] public Material[] crateMaterials; [Tooltip("A new custom mesh to use on this crate.\nIf left empty, will use the default crate model.")] public Mesh crateMesh; [Tooltip("Particles that are played upon destroying this crate.\nIf left empty, will automatically use the default crate-breaking particles.")] public GameObject breakParticles; [Tooltip("The static color the breakParticles will have.")] public Color breakParticleColor = Color.white; [Tooltip("Particles that are played on walking into, bouncing off of, attacking, or on destroying this crate.")] public GameObject specialParticles; [Tooltip("The static color the specialParticles will have.")] public Color specialParticleColor = Color.white; [Space(3f)] [Header("Colliders")] [Tooltip("Whether this crate's collider will block player movement and some sounds and enemy vision.")] public bool collideWithCrate = true; [Tooltip("A value to override collideWithCrate at runtime to enable or disable collisions that block player movement.\nIf empty, this value will be ignored. If \"true\" or as long as this value starts with \"t\", collision will be enabled. If not empty but also not starting with \"t\", collision will be disabled.")] public string collideOverrideCrate; [Tooltip("A value to override at runtime whether to enable or disable the check that lets players bounce off this crate.\nIf empty, this value will be ignored. If \"true\" or as long as this value starts with \"t\", bouncing will be enabled. If not empty but also not starting with \"t\", bouncing will be disabled.")] public string collideOverrideBounce; [Space(3f)] [Header("Interactions")] [Tooltip("How much time crates are unresponsive to local interactions, to prevent players sending two interactions with one bounce, for example.")] public float interactionCooldown = 0.25f; [Space] [Tooltip("How strong players bounce off this crate, and how strong it will try to bounce other crates off of itself.")] public float bounceForce = 20f; [Space] [Tooltip("A sort of HP for this crate that determines how many hits it has taken so far by being walked into, bounced off of, and attacked.\nUpdated by this crate's own changeSpecialIntPer integers.")] public int specialInt; [Tooltip("This crate will be destroyed if this is not -1 and specialInt has met or surpassed this number.")] public int destroyUponSpecialInt = 1; [Space] [Tooltip("If true, adds the specified interaction's changeSpecialInt to specialInt.\nIf false, snaps specialInt to whatever changeSpecialInt is set to for that interaction.")] public bool changeSpecialIntAddOrSnap = true; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time walking into the crate.\nIf addOrSnap is true and this is 0, or false and this is -99, walking into this crate will not change specialInt.")] public int changeSpecialIntPerWalkInto; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time the crate is bounced off of.\nIf addOrSnap is true and this is 0, or false and this is -99, bouncing off of this crate will not change specialInt.")] public int changeSpecialIntPerJumpOnto = 1; [Tooltip("How much to change this crate's specialInt, or what value to snap this crate's specialInt to, per time the crate is attacked.\nIf addOrSnap is true and this is 0, or false and this is -99, attacking this crate will not change specialInt.")] public int changeSpecialIntPerAttack = 99; [Space(3f)] [Header("Events")] [Tooltip("Custom events to call on Start(), for example if this crate has special functionality that should determine the rest of its lifetime.")] public UnityAction eventStart; [Tooltip("Custom events to call when this crate is walked into, for example if the player who walks into this crate's collision is affected.")] public UnityAction eventWalkInto; [Tooltip("Custom events to call when this crate is bounced off of, for example if this crate affects the player who bounced off of it.")] public UnityAction eventJumpOnto; [Tooltip("Custom events to call when this crate is attacked, for example if attacking this crate uniquely changes its own state.")] public UnityAction eventAttack; [Tooltip("Custom events to call when this crate's timer runs out, for example if this crate should switch to different materials or spawnPrefabs.")] public UnityAction eventTimerEnd; [Tooltip("Custom events to call when this crate is destroyed, for example if this crate has custom data that should be removed.")] public UnityAction eventDestroy; [Space(3f)] [Header("Contents")] [Tooltip("What GameObject to spawn at the time of walking into, bouncing off of, or attacking this crate.")] public GameObject spawnPrefab; [Tooltip("How many of the spawnPrefab are left to spawn, based on this crate's crateData's spawnPer integers.")] public int spawnAmountLeft = 1; [Space(3f)] [Header("Timers")] [Tooltip("A timer that will count down in real-time seconds, regardless of the game's in-game time.\nKeep at -1 to disable this timer.")] public float timerStartTime = -1f; [Tooltip("A GameObject containing a TextMeshPro component in its children, that this crate's timer value will be printed to if this crate's crateData's timerVisible is true.\nIf left empty, the default timer object will be used.")] public GameObject timerText; } public class ProjectileAmmo : MonoBehaviour { public int ammoIndex; public int GetProjectileIndex() { return ammoIndex; } } public class ModCompatibility { private static ManualLogSource Logger; public static bool compatibleSimonTendoPlaylists; public static bool CheckForPlugin(string pluginName, bool printDebug = true, bool printNames = false) { foreach (PluginInfo value in Chainloader.PluginInfos.Values) { string name = value.Metadata.Name; if (printNames) { Logger.LogDebug((object)("* (" + name + ")")); } if (name == pluginName) { if (printDebug) { Logger.LogDebug((object)("Successfully found " + pluginName)); } return true; } } if (printDebug) { Logger.LogDebug((object)("Failed to find " + pluginName)); } return false; } public static void GetModCompatibility() { compatibleSimonTendoPlaylists = CheckForPlugin("LCSimonTendoPlaylistsMod"); } public static void LCSimonTendoPlaylistsMod() { if (Configs.loadingScreenMusic.Value && compatibleSimonTendoPlaylists && !((Object)(object)CrashBandicootCratesManagerScript.allAssets == (Object)null) && CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs != null && CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs.Length != 0 && CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs.Length == CrashBandicootCratesManagerScript.allAssets.loadingMusicRarities.Length) { AddLoadingScreenMusic(); } } private static void AddLoadingScreenMusic() { SharedAudioComponent genericPlaylistsContainer = GetGenericPlaylistsContainer(); if (!((Object)(object)genericPlaylistsContainer != (Object)null)) { return; } for (int i = 0; i < CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs.Length; i++) { if (!((Object)(object)CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs[i] == (Object)null) && CrashBandicootCratesManagerScript.allAssets.loadingMusicRarities[i] > 0) { SharedAudioMethods.AudioClipAddNew(CrashBandicootCratesManagerScript.allAssets.loadingMusicSongs[i], SharedAudioMethods.AudioListGetByName("LCSimonTendoPlaylistsMod - Loading Screen", genericPlaylistsContainer, false, true), true, CrashBandicootCratesManagerScript.allAssets.loadingMusicRarities[i], false); } } } private static SharedAudioComponent GetGenericPlaylistsContainer() { if ((Object)(object)StartOfRound.Instance == (Object)null) { return null; } Transform val = ((Component)StartOfRound.Instance).transform.parent.Find("SimonTendoManagers"); if ((Object)(object)val == (Object)null) { Logger.LogWarning((object)"failed to find: SimonTendoManagers"); return null; } Transform val2 = val.Find("LCSimonTendoPlaylistsMod"); if ((Object)(object)val2 == (Object)null) { Logger.LogWarning((object)"failed to find: LCSimonTendoPlaylistsMod"); return null; } SharedAudioComponent component = ((Component)val2).GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogError((object)"failed to find: SharedAudioComponent"); } return component; } } public class CrashBandicootCratesNetworkManagerPatch { [HarmonyPatch(typeof(NetworkManager))] public class NewNetworkManager { [HarmonyPostfix] [HarmonyPatch("SetSingleton")] public static void SetSingletonPostfix() { if ((Object)(object)networkPrefab != (Object)null || (Object)(object)NetworkManager.Singleton == (Object)null) { return; } networkPrefab = Plugin.assetBundle.LoadAsset("Assets/LCCrashBandicootCratesMod/Prefabs/ManagerObject.prefab"); for (int i = 0; i < CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs.Count; i++) { GameObject val = CrashBandicootCratesManagerScript.allAssets.allNetworkPrefabs[i]; if (!((Object)(object)val == (Object)null)) { if (CrashBandicootCratesManagerScript.logDetail) { Logger.LogDebug((object)$"Registering NetworkPrefab [{i}]: {val}"); } try { NetworkManager.Singleton.AddNetworkPrefab(val); } catch (Exception arg) { Logger.LogWarning((object)$"Error when adding NetworkPrefab {val} to NetworkManager:\n{arg}"); } } } } } private static ManualLogSource Logger; internal static GameObject networkPrefab; } public class CrashBandicootCratesPlayerControllerBPatch { [HarmonyPatch(typeof(PlayerControllerB))] public class NewPlayerControllerB { [HarmonyPostfix] [HarmonyPatch("ConnectClientToPlayerObject")] public static void ConnectClientToPlayerObjectPostfix(PlayerControllerB __instance) { //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown CrashBandicootCratesManagerScript.SetUpVariables(); if (!__instance.isHostPlayerObject) { CrashBandicootCratesManagerScript.SyncUponJoin(); } if (alreadyAddedToLevels) { return; } StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { return; } for (int i = 0; i < instance.levels.Length; i++) { SelectableLevel val = instance.levels[i]; if (val.spawnableScrap == null || !val.spawnEnemiesAndScrap || !val.planetHasTime) { continue; } foreach (LevelWithRarities item in CrashBandicootCratesManagerScript.allAssets.allSpawnableScrap) { int levelID = item.levelID; if (val.levelID <= 12 && levelID == val.levelID) { for (int j = 0; j < item.spawnableItems.Length; j++) { SpawnableItemWithRarity val2 = item.spawnableItems[j]; val.spawnableScrap.Add(new SpawnableItemWithRarity(val2.spawnableItem, (int)((float)val2.rarity * Configs.rarityMultiplier.Value))); } Logger.LogDebug((object)$"Added VANILLA items from {((Object)item).name} using rarityMultiplier {Configs.rarityMultiplier.Value} with levelID {levelID} to level {((Object)val).name} with ID {val.levelID}"); } else if (val.levelID > 12 && levelID == -1) { for (int k = 0; k < item.spawnableItems.Length; k++) { SpawnableItemWithRarity val3 = item.spawnableItems[k]; val.spawnableScrap.Add(new SpawnableItemWithRarity(val3.spawnableItem, (int)((float)val3.rarity * Configs.rarityMultiplier.Value))); } Logger.LogDebug((object)$"Added VANILLA items from {((Object)item).name} using rarityMultiplier {Configs.rarityMultiplier.Value} with levelID {levelID} to level {((Object)val).name} with ID {val.levelID}"); } } int num = 0; Dictionary levelWithCrateRaritiesDictionary = CreateACrate.GetLevelWithCrateRaritiesDictionary(val.PlanetName); if (levelWithCrateRaritiesDictionary == null) { levelWithCrateRaritiesDictionary = CreateACrate.GetLevelWithCrateRaritiesDictionary("Modded"); } if (levelWithCrateRaritiesDictionary != null && levelWithCrateRaritiesDictionary.Count > 0) { foreach (KeyValuePair item2 in levelWithCrateRaritiesDictionary) { if (!item2.Equals(null) && !((Object)(object)item2.Key == (Object)null) && item2.Value != 0) { num += item2.Value; } } } val.spawnableScrap.Add(new SpawnableItemWithRarity(((GrabbableObject)CrashBandicootCratesManagerScript.allAssets.moddedCrate.GetComponent()).itemProperties, num)); Logger.LogDebug((object)$"Added MODDED items from to level {((Object)val).name} with rarity {num}"); } alreadyAddedToLevels = true; } [HarmonyPrefix] [HarmonyPatch("GrabObject")] public static void GrabObjectPrefix(PlayerControllerB __instance) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.currentlyGrabbingObject == (Object)null)) { CrateGrabbableObject component = ((Component)__instance.currentlyGrabbingObject).GetComponent(); if (!((Object)(object)component == (Object)null)) { Logger.LogDebug((object)$"#{((NetworkBehaviour)component).NetworkObjectId}: GrabObject()"); component.GrabCrate(); } } } [HarmonyPostfix] [HarmonyPatch("SetObjectAsNoLongerHeld")] public static void SetObjectAsNoLongerHeldPostfix(PlayerControllerB __instance, GrabbableObject dropObject) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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) //IL_0194: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dropObject == (Object)null || dropObject.deactivated || (Object)(object)__instance == (Object)null || __instance.isPlayerDead) { return; } CrateGrabbableObject component = ((Component)dropObject).GetComponent(); if ((Object)(object)component == (Object)null || component.destroyed) { return; } CrateGrabbableObject crateGrabbableObject = null; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)dropObject).transform.parent.TransformPoint(dropObject.targetFloorPosition) + ((Component)__instance).transform.forward * 0.75f + Vector3.up * 1f, Vector3.down, ref val, 80f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { CrateGrabbableObject componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && ((GrabbableObject)componentInParent).reachedFloorTarget && ((GrabbableObject)componentInParent).hasHitGround && !componentInParent.destroyed && !((GrabbableObject)componentInParent).isHeld && !((GrabbableObject)componentInParent).isPocketed) { Logger.LogDebug((object)"found crate in check downward, moving on"); crateGrabbableObject = componentInParent; } } if (!((Object)(object)crateGrabbableObject == (Object)null)) { RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)crateGrabbableObject).transform.position, Vector3.up, ref val2, 2f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { Logger.LogDebug((object)"hit something in check upward, returning"); return; } Logger.LogInfo((object)$"SetObjectAsNoLongerHeldPostfix() found {component} #{((NetworkBehaviour)component).NetworkObjectId} could hit {crateGrabbableObject} #{((NetworkBehaviour)crateGrabbableObject).NetworkObjectId}, overwriting targetFloorPosition"); dropObject.targetFloorPosition = ((Component)dropObject).transform.parent.InverseTransformPoint(crateGrabbableObject.topOfCrate.position); } } } private static ManualLogSource Logger; private static bool alreadyAddedToLevels; } public class CrashBandicootCratesStartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound))] public class NewStartOfRound { [HarmonyPostfix] [HarmonyPatch("Awake")] public static void AwakePostfix(StartOfRound __instance) { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { Object.Instantiate(CrashBandicootCratesNetworkManagerPatch.networkPrefab).GetComponent().Spawn(false); } if (alreadyAddedData) { return; } if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.allItemsList == (Object)null || __instance.allItemsList.itemsList == null) { Logger.LogWarning((object)"Failed to find StartOfRound.allItemsList.itemsList!"); return; } foreach (Item allItem in CrashBandicootCratesManagerScript.allAssets.allItems) { if (!__instance.allItemsList.itemsList.Contains(allItem)) { Logger.LogDebug((object)$"Adding {allItem} to allItemsList"); __instance.allItemsList.itemsList.Add(allItem); } } alreadyAddedData = true; } [HarmonyPrefix] [HarmonyPatch("Start")] public static void StartPrefix() { ModCompatibility.LCSimonTendoPlaylistsMod(); } [HarmonyPostfix] [HarmonyPatch("GetBodiesInShip")] public static void GetBodiesInShipPostfix(StartOfRound __instance, ref int __result) { Logger.LogDebug((object)"intercepting GetBodiesInShip (on host?)"); DeadBodyInfo[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (DeadBodyInfo val in array) { if (val.isInShip && CrashBandicootCratesManagerScript.playerOneUps[val.playerObjectId] > 0) { Logger.LogDebug((object)("removing body insurance for " + StartOfRound.Instance.allPlayerScripts[val.playerObjectId].playerUsername + " since they have a oneUp")); __result--; } } } [HarmonyPostfix] [HarmonyPatch("EndPlayersFiredSequenceClientRpc")] public static void EndPlayersFiredSequenceClientRpcPostfix() { Logger.LogDebug((object)"Starting EndPlayersFiredSequenceClientRpc Postfix"); AkuAkuProp[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (AkuAkuProp akuAkuProp in array) { Logger.LogDebug((object)$"telling {akuAkuProp} #{((NetworkBehaviour)akuAkuProp).NetworkObjectId} to destroy after delay"); akuAkuProp.DestroyAku(); } for (int j = 0; j < CrashBandicootCratesManagerScript.playerOneUps.Length; j++) { CrashBandicootCratesManagerScript.playerOneUps[j] = 0; Logger.LogDebug((object)$"resetting oneUp at [{j}] to {CrashBandicootCratesManagerScript.playerOneUps[j]}"); } } } private static ManualLogSource Logger; public static bool alreadyAddedData; } [BepInPlugin("local.SimonTendo.LCCrashBandicootCratesMod", "LCCrashBandicootCratesMod", "1.0.8")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle assetBundle; public static Configs myConfig { get; internal set; } private void Awake() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin LCCrashBandicootCratesMod is loaded!"); assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "crashbundlecoot")); if ((Object)(object)assetBundle == (Object)null) { Logger.LogError((object)"Failed to load crashbundlecoot"); return; } CrashBandicootCratesManagerScript.allAssets = assetBundle.LoadAsset("Assets/LCCrashBandicootCratesMod/ScriptableObjects/AllAssets.asset"); if ((Object)(object)CrashBandicootCratesManagerScript.allAssets == (Object)null) { Logger.LogError((object)"Failed to load allassets"); return; } Logger.LogDebug((object)"Loaded LCCrashBandicootCratesMod AssetBundle and AllAssets"); SendLoggers(); ModCompatibility.GetModCompatibility(); new Harmony("LCCrashBandicootCratesMod").PatchAll(); myConfig = new Configs(((BaseUnityPlugin)this).Config); Configs.DisplayConfigs(); UnityNetcodePatcher(); } private static void SendLoggers() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); foreach (Type type in types) { FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType == typeof(ManualLogSource)) { fieldInfo.SetValue(type, Logger); } } } } public static GameObject SearchForObject(string name, Transform parentTransform = null) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown Logger.LogDebug((object)("Starting search for " + name)); GameObject[] array = Object.FindObjectsByType((FindObjectsSortMode)0); GameObject result; foreach (GameObject val in array) { if (((Object)val).name == name) { result = val; Logger.LogDebug((object)("Found existing " + ((Object)val).name + ", using as parent.")); return result; } } result = new GameObject(name); if ((Object)(object)parentTransform != (Object)null) { result.transform.SetParent(parentTransform, false); } Logger.LogDebug((object)("Did not find existing " + name + ", instantiating new " + ((Object)result).name)); return result; } private static void UnityNetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } } [CompilerGenerated] [EditorBrowsable(EditorBrowsableState.Never)] [GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)] internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { private struct MonoScriptData { public byte[] FilePathsData; public byte[] TypesData; public int TotalTypes; public int TotalFiles; public bool IsEditorOnly; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static MonoScriptData Get() { return new MonoScriptData { FilePathsData = new byte[3226] { 0, 0, 0, 1, 0, 0, 0, 76, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 66, 111, 119, 108, 105, 110, 103, 66, 111, 109, 98, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 67, 111, 108, 111, 114, 71, 101, 109, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 81, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 67, 114, 97, 116, 101, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 72, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 67, 114, 121, 115, 116, 97, 108, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 70, 97, 107, 101, 67, 114, 97, 115, 104, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 77, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 70, 114, 117, 105, 116, 66, 97, 122, 111, 111, 107, 97, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 77, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 86, 101, 104, 105, 99, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 92, 87, 117, 109, 112, 97, 70, 114, 117, 105, 116, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 87, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 97, 110, 97, 103, 101, 114, 83, 99, 114, 105, 112, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 82, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 65, 107, 117, 65, 107, 117, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 84, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 69, 110, 101, 109, 121, 83, 112, 97, 119, 110, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 69, 120, 112, 108, 111, 115, 105, 111, 110, 83, 112, 97, 119, 110, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 81, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 79, 110, 101, 85, 112, 80, 114, 111, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 89, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 80, 97, 117, 115, 101, 67, 108, 111, 99, 107, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 87, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 66, 97, 115, 105, 99, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 87, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 66, 111, 110, 117, 115, 79, 98, 106, 101, 99, 116, 115, 92, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 87, 117, 109, 112, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 67, 111, 108, 108, 105, 115, 105, 111, 110, 69, 118, 101, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 97, 116, 101, 73, 110, 118, 111, 107, 97, 98, 108, 101, 69, 118, 101, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 66, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 114, 101, 97, 116, 101, 65, 67, 114, 97, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 68, 101, 115, 116, 114, 111, 121, 71, 97, 109, 101, 79, 98, 106, 101, 99, 116, 79, 110, 67, 111, 110, 100, 105, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 73, 110, 116, 101, 114, 102, 97, 99, 101, 115, 92, 73, 67, 114, 97, 116, 101, 83, 112, 97, 119, 110, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 84, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 73, 110, 116, 101, 114, 102, 97, 99, 101, 115, 92, 73, 68, 101, 115, 116, 114, 111, 121, 79, 110, 67, 111, 110, 100, 105, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 84, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 73, 110, 116, 101, 114, 102, 97, 99, 101, 115, 92, 73, 73, 110, 118, 101, 110, 116, 111, 114, 121, 77, 101, 114, 103, 101, 97, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 75, 97, 114, 116, 67, 111, 108, 108, 105, 115, 105, 111, 110, 69, 118, 101, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 71, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 77, 111, 100, 100, 101, 100, 67, 114, 97, 116, 101, 69, 118, 101, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 64, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 67, 111, 110, 102, 105, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 68, 97, 116, 97, 67, 111, 110, 116, 97, 105, 110, 101, 114, 115, 92, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 65, 108, 108, 65, 115, 115, 101, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 68, 97, 116, 97, 67, 111, 110, 116, 97, 105, 110, 101, 114, 115, 92, 67, 114, 97, 116, 101, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 81, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 68, 97, 116, 97, 67, 111, 110, 116, 97, 105, 110, 101, 114, 115, 92, 76, 101, 118, 101, 108, 87, 105, 116, 104, 82, 97, 114, 105, 116, 105, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 92, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 68, 97, 116, 97, 67, 111, 110, 116, 97, 105, 110, 101, 114, 115, 92, 77, 111, 100, 100, 101, 100, 67, 114, 97, 116, 101, 82, 117, 110, 116, 105, 109, 101, 80, 97, 114, 97, 109, 101, 116, 101, 114, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 78, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 68, 97, 116, 97, 67, 111, 110, 116, 97, 105, 110, 101, 114, 115, 92, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 65, 109, 109, 111, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 65, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 77, 111, 100, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 96, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 80, 97, 116, 99, 104, 101, 115, 92, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 78, 101, 116, 119, 111, 114, 107, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 99, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 80, 97, 116, 99, 104, 101, 115, 92, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 80, 97, 116, 99, 104, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 94, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 80, 97, 116, 99, 104, 101, 115, 92, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 83, 116, 97, 114, 116, 79, 102, 82, 111, 117, 110, 100, 80, 97, 116, 99, 104, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 92, 80, 108, 117, 103, 105, 110, 46, 99, 115 }, TypesData = new byte[1295] { 0, 0, 0, 0, 16, 124, 66, 111, 119, 108, 105, 110, 103, 66, 111, 109, 98, 80, 114, 111, 112, 0, 0, 0, 0, 13, 124, 67, 111, 108, 111, 114, 71, 101, 109, 80, 114, 111, 112, 0, 0, 0, 0, 21, 124, 67, 114, 97, 116, 101, 71, 114, 97, 98, 98, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 0, 0, 0, 0, 12, 124, 67, 114, 121, 115, 116, 97, 108, 80, 114, 111, 112, 0, 0, 0, 0, 14, 124, 70, 97, 107, 101, 67, 114, 97, 115, 104, 80, 114, 111, 112, 0, 0, 0, 0, 17, 124, 70, 114, 117, 105, 116, 66, 97, 122, 111, 111, 107, 97, 80, 114, 111, 112, 0, 0, 0, 0, 17, 124, 71, 114, 97, 98, 98, 97, 98, 108, 101, 86, 101, 104, 105, 99, 108, 101, 0, 0, 0, 0, 15, 124, 87, 117, 109, 112, 97, 70, 114, 117, 105, 116, 80, 114, 111, 112, 0, 0, 0, 0, 34, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 97, 110, 97, 103, 101, 114, 83, 99, 114, 105, 112, 116, 0, 0, 0, 0, 74, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 97, 110, 97, 103, 101, 114, 83, 99, 114, 105, 112, 116, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 77, 105, 115, 99, 101, 108, 108, 97, 110, 101, 111, 117, 115, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 11, 124, 65, 107, 117, 65, 107, 117, 80, 114, 111, 112, 0, 0, 0, 0, 23, 65, 107, 117, 65, 107, 117, 80, 114, 111, 112, 124, 69, 110, 101, 109, 121, 65, 73, 80, 97, 116, 99, 104, 0, 0, 0, 0, 22, 65, 107, 117, 65, 107, 117, 80, 114, 111, 112, 124, 80, 108, 97, 121, 101, 114, 80, 97, 116, 99, 104, 0, 0, 0, 0, 13, 124, 69, 110, 101, 109, 121, 83, 112, 97, 119, 110, 101, 114, 0, 0, 0, 0, 17, 124, 69, 120, 112, 108, 111, 115, 105, 111, 110, 83, 112, 97, 119, 110, 101, 114, 0, 0, 0, 0, 10, 124, 79, 110, 101, 85, 112, 80, 114, 111, 112, 0, 0, 0, 0, 18, 124, 80, 97, 117, 115, 101, 67, 108, 111, 99, 107, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 16, 124, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 66, 97, 115, 105, 99, 0, 0, 0, 0, 16, 124, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 87, 117, 109, 112, 97, 0, 0, 0, 0, 32, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 87, 117, 109, 112, 97, 124, 78, 101, 119, 83, 104, 111, 119, 101, 114, 84, 114, 105, 103, 103, 101, 114, 0, 0, 0, 0, 36, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 87, 117, 109, 112, 97, 124, 78, 101, 119, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 0, 0, 0, 0, 21, 124, 67, 114, 97, 116, 101, 67, 111, 108, 108, 105, 115, 105, 111, 110, 69, 118, 101, 110, 116, 115, 0, 0, 0, 0, 21, 124, 67, 114, 97, 116, 101, 73, 110, 118, 111, 107, 97, 98, 108, 101, 69, 118, 101, 110, 116, 115, 0, 0, 0, 0, 13, 124, 67, 114, 101, 97, 116, 101, 65, 67, 114, 97, 116, 101, 0, 0, 0, 0, 29, 124, 68, 101, 115, 116, 114, 111, 121, 71, 97, 109, 101, 79, 98, 106, 101, 99, 116, 79, 110, 67, 111, 110, 100, 105, 116, 105, 111, 110, 0, 0, 0, 0, 22, 124, 73, 67, 114, 97, 116, 101, 83, 112, 97, 119, 110, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 0, 0, 0, 0, 20, 124, 73, 68, 101, 115, 116, 114, 111, 121, 79, 110, 67, 111, 110, 100, 105, 116, 105, 111, 110, 0, 0, 0, 0, 20, 124, 73, 73, 110, 118, 101, 110, 116, 111, 114, 121, 77, 101, 114, 103, 101, 97, 98, 108, 101, 0, 0, 0, 0, 20, 124, 75, 97, 114, 116, 67, 111, 108, 108, 105, 115, 105, 111, 110, 69, 118, 101, 110, 116, 115, 0, 0, 0, 0, 18, 124, 77, 111, 100, 100, 101, 100, 67, 114, 97, 116, 101, 69, 118, 101, 110, 116, 115, 0, 0, 0, 0, 11, 124, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 0, 0, 0, 0, 8, 124, 67, 111, 110, 102, 105, 103, 115, 0, 0, 0, 0, 30, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 65, 108, 108, 65, 115, 115, 101, 116, 115, 0, 0, 0, 0, 10, 124, 67, 114, 97, 116, 101, 68, 97, 116, 97, 0, 0, 0, 0, 18, 124, 76, 101, 118, 101, 108, 87, 105, 116, 104, 82, 97, 114, 105, 116, 105, 101, 115, 0, 0, 0, 0, 29, 124, 77, 111, 100, 100, 101, 100, 67, 114, 97, 116, 101, 82, 117, 110, 116, 105, 109, 101, 80, 97, 114, 97, 109, 101, 116, 101, 114, 115, 0, 0, 0, 0, 15, 124, 80, 114, 111, 106, 101, 99, 116, 105, 108, 101, 65, 109, 109, 111, 0, 0, 0, 0, 17, 124, 77, 111, 100, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 0, 0, 0, 0, 40, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 78, 101, 116, 119, 111, 114, 107, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 0, 0, 0, 0, 57, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 78, 101, 116, 119, 111, 114, 107, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 124, 78, 101, 119, 78, 101, 116, 119, 111, 114, 107, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 43, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 80, 97, 116, 99, 104, 0, 0, 0, 0, 63, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 80, 97, 116, 99, 104, 124, 78, 101, 119, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 0, 0, 0, 0, 38, 124, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 83, 116, 97, 114, 116, 79, 102, 82, 111, 117, 110, 100, 80, 97, 116, 99, 104, 0, 0, 0, 0, 53, 67, 114, 97, 115, 104, 66, 97, 110, 100, 105, 99, 111, 111, 116, 67, 114, 97, 116, 101, 115, 83, 116, 97, 114, 116, 79, 102, 82, 111, 117, 110, 100, 80, 97, 116, 99, 104, 124, 78, 101, 119, 83, 116, 97, 114, 116, 79, 102, 82, 111, 117, 110, 100, 0, 0, 0, 0, 7, 124, 80, 108, 117, 103, 105, 110 }, TotalFiles = 37, TotalTypes = 45, IsEditorOnly = false }; } } namespace __GEN; internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } }