using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Xml.Serialization; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using STSharedAudioLib; using TMPro; using Unity.AI.Navigation; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [CreateAssetMenu(menuName = "New Donk City/AllAssets")] internal class AllAssets : ScriptableObject { [Header("Netcode")] public GameObject[] allNetworkPrefabs; [Space(3f)] [Header("Scrap")] public Item[] allGrabbableObjects; [Space(3f)] [Header("Terminal")] public TerminalKeyword[] allTerminalKeywords; public TerminalNode[] allTerminalNodes; [Space(3f)] [Header("Spawnables")] public List allItems; public List allEnemies; public List allOutsideEnemies; public List allDaytimeEnemies; public IndoorMapHazard[] allIndoorHazards; [Space(3f)] [Header("SelectableLevel Parameters")] public int baseMinScrap; public int baseMaxScrap; [Space] public float baseSizeMultiplier; } public class CrossModEasterEggs { private static ManualLogSource Logger; public static bool compatibilityPlaylistsMod; public static bool compatibilityCrashBandicootCrates; public static bool compatibilityLethalLevelLoader; public static void LCPlaylistsModCompatibility() { if (compatibilityPlaylistsMod) { AddLoadingScreenMusic(); } } private static void AddLoadingScreenMusic() { SharedAudioComponent genericPlaylistsContainer = GetGenericPlaylistsContainer(); if ((Object)(object)genericPlaylistsContainer != (Object)null) { SharedAudioMethods.AudioClipAddNew(Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ModCompatibility/LCSimonTendoPlaylistsMod/LoadingScreenMusic.ogg"), SharedAudioMethods.AudioListGetByName("LCSimonTendoPlaylistsMod - Loading Screen", genericPlaylistsContainer, false, true), true, 250, 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 static void LCCrashBandicootCratesMod() { if (compatibilityCrashBandicootCrates) { CreateCoinCrate(); } } public static void CreateCoinCrate() { //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_0060: 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_0069: 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_00db: 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) //IL_0122: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) Item val = CreateACrate.MakeItem("Coin Crate", true, true, false, true, 1.1f, false, false, true, true, 160, 10, false, 0f, false, Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ModCompatibility/LCCrashBandicootCratesMod/CoinCrateIcon.png"), "HoldLung", (AudioClip)null, (AudioClip)null, (AudioClip)null, false, new string[2] { "Thank you for playing:", "LCNewDonkCityMod" }, 0.01f, 0, true, default(Vector3), default(Vector3), default(Vector3), (Mesh[])null, (Material[])null, false, false); CrateData obj = CreateACrate.MakeCrateData((AudioClip)null, (AudioClip)null, (AudioClip[])null, true, true, false, true, 0.5f, 10f, 2f, (Material[])null, (int[])null, 2f, 10f, 1f, (AnimationCurve)null, -1f, -1f, -1f, false, false, false, false, false, false, false, false, false, false, (GameObject[])null, false, false, 0f, -1, -1, -1, -1, false, false, false, true, 0, true, 45f); Vector3 val2 = default(Vector3); ModdedCrateRuntimeParameters val3 = CreateACrate.MakeModdedCrateRuntimeParameters(obj, val, (string)null, (Material[])(object)new Material[3] { Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ModCompatibility/LCCrashBandicootCratesMod/CoinCrateRimMat.mat"), Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ModCompatibility/LCCrashBandicootCratesMod/CoinCrateTopMat.mat"), Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ModCompatibility/LCCrashBandicootCratesMod/CoinCrateMat.mat") }, (Mesh)null, val2, (GameObject)null, default(Color), (GameObject)null, default(Color), true, (string)null, (string)null, 0.25f, 20f, 0, 1, true, 0, 0, 1, (UnityAction)CoinCrateEventStart, (UnityAction)null, (UnityAction)CoinCrateEventJump, (UnityAction)null, (UnityAction)null, (UnityAction)null, (GameObject)null, 0, -1f, (GameObject)null); CreateACrate.RegisterCrateToAllLevelsWithRarity(val3, 1, 1, 3, 3, 3, 5, 7, 1, 9, 7, 9, 3); CreateACrate.RegisterCrateToLevelWithRarity("New Donk City", val3, 32); } public static void CoinCrateEventStart(CrateGrabbableObject crate, PlayerControllerB player) { if (!((Object)(object)crate == (Object)null)) { Logger.LogDebug((object)$"CoinCrateEvent(): START on {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); ((Component)crate).gameObject.AddComponent().spawnCoinVisualAt = ((Component)crate).transform; } } public static void CoinCrateEventJump(CrateGrabbableObject crate, PlayerControllerB player) { if ((Object)(object)crate == (Object)null || (Object)(object)player == (Object)null) { return; } Logger.LogDebug((object)$"CoinCrateEvent(): JUMP on {crate} #{((NetworkBehaviour)crate).NetworkObjectId}"); CoinContainer component = ((Component)crate).GetComponent(); if (!((Object)(object)component == (Object)null) && ((GrabbableObject)crate).scrapValue > 0) { GenericManager.AddCollectedCoins(component, player); ((GrabbableObject)crate).SetScrapValue(((GrabbableObject)crate).scrapValue - 1); if (((GrabbableObject)crate).scrapValue <= 0) { crate.UpdateSpecialIntLocal(1, false, player, true); } } } } public class LLLCompatibilityFixer : MonoBehaviour { public static void SpawnFrameDelaySceneFixer(NetworkSceneManager sceneManager) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("NDCLLLFix").AddComponent().DelayAddingSceneToBuild(sceneManager); } public void DelayAddingSceneToBuild(NetworkSceneManager sceneManager) { ((MonoBehaviour)this).StartCoroutine(AddSceneOnDelay(sceneManager)); } private IEnumerator AddSceneOnDelay(NetworkSceneManager sceneManager) { Plugin.Logger.LogWarning((object)"Adding scene to build on frame delay!!"); yield return (object)new WaitForEndOfFrame(); SceneManagerPatches.AddSceneToBuild(sceneManager); } } public class AestheticsManager : NetworkBehaviour { private static ManualLogSource Logger; public static AestheticsManager Instance; public Aesthetic[] allLevelAesthetics; [HideInInspector] public Aesthetic todaysAesthetics; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NewDonkCityManager.Instance.onHitGroundEvent.AddListener((UnityAction)CheckStartOfSong); } private void Update() { DoSpecialAestheticChecks(); } public void OnSceneLoad() { DetermineTodaysSkybox(); } public void DetermineTodaysSkybox() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (allLevelAesthetics == null || allLevelAesthetics.Length == 0) { return; } todaysAesthetics = null; for (int i = 0; i < allLevelAesthetics.Length; i++) { Aesthetic aesthetic = allLevelAesthetics[i]; if (!((Object)(object)aesthetic == (Object)null) && aesthetic.activateOnWeather.Contains(StartOfRound.Instance.currentLevel.currentWeather)) { todaysAesthetics = aesthetic; break; } } if ((Object)(object)todaysAesthetics == (Object)null) { return; } Logger.LogInfo((object)todaysAesthetics); for (int j = 0; j < allLevelAesthetics.Length; j++) { Aesthetic aesthetic2 = allLevelAesthetics[j]; if (!((Object)(object)aesthetic2 == (Object)null)) { aesthetic2.ToggleAestheticSpecificPrefabs(setTo: false); } } todaysAesthetics.ToggleAestheticSpecificPrefabs(setTo: true); for (int k = 0; k < allLevelAesthetics.Length; k++) { Aesthetic aesthetic3 = allLevelAesthetics[k]; if (!((Object)(object)aesthetic3 == (Object)null)) { aesthetic3.DestroyUnusedAestheticSpecificPrefabs(); } } NewDonkCityManager.Instance.skyboxAnimator.SetBool("Initialized", true); if (!string.IsNullOrEmpty(todaysAesthetics.skyboxAnimatorTrigger)) { NewDonkCityManager.Instance.skyboxAnimator.SetTrigger(todaysAesthetics.skyboxAnimatorTrigger); } if (!todaysAesthetics.rebakeNavMesh) { return; } GameObject val = GameObject.FindGameObjectWithTag("OutsideLevelNavMesh"); if ((Object)(object)val != (Object)null) { NavMeshSurface component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.BuildNavMesh(); } } } private void CheckStartOfSong(Collider colliderHit) { if (!((Object)(object)colliderHit == (Object)null) && !((Object)(object)todaysAesthetics == (Object)null) && todaysAesthetics.backgroundMusic != null && todaysAesthetics.backgroundMusic.Length != 0 && !((Object)(object)todaysAesthetics.backgroundMusic[0].globalAudio == (Object)null) && !todaysAesthetics.backgroundMusic[0].globalAudio.isPlaying && !((Object)(object)((Component)colliderHit).gameObject.GetComponentInParent() == (Object)null)) { Logger.LogDebug((object)"LOCALLY met conditions to start song"); StartTodaysSongLocal(); StartTodaysSongServerRpc(NewDonkCityManager.localPlayerID); } } [ServerRpc(RequireOwnership = false)] private void StartTodaysSongServerRpc(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(113678267u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 113678267u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartTodaysSongClientRpc(playerID); } } } [ClientRpc] private void StartTodaysSongClientRpc(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(3169010161u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3169010161u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { Logger.LogDebug((object)"RECEIVED met conditions to start song"); StartTodaysSongLocal(); } } } private void StartTodaysSongLocal() { if (!((Object)(object)todaysAesthetics == (Object)null) && todaysAesthetics.backgroundMusic != null && todaysAesthetics.backgroundMusic.Length != 0 && !((Object)(object)todaysAesthetics.backgroundMusic[0].globalAudio == (Object)null) && !todaysAesthetics.backgroundMusic[0].globalAudio.isPlaying) { todaysAesthetics.ToggleAestheticSpecificSong(setTo: true); todaysAesthetics.ToggleParticles(setTo: true); ((MonoBehaviour)this).StartCoroutine(IncreaseSongVolumeDuringIntro()); if ((Object)(object)FestivalManager.Instance != (Object)null) { FestivalManager.Instance.StartFestival(todaysAesthetics); } NewDonkCityManager.Instance.onHitGroundEvent.RemoveListener((UnityAction)CheckStartOfSong); } } private IEnumerator IncreaseSongVolumeDuringIntro() { if (!((Object)(object)SongsManager.Instance == (Object)null) && !((Object)(object)todaysAesthetics == (Object)null)) { string introVolumeMultiplierKey = "SceneBGM Intro Multiplier"; float multiplierValue = 2.5f; float startingAddition = multiplierValue - 1f; SongsManager.Instance.SetGlobalVolumeMultiplier(introVolumeMultiplierKey, multiplierValue); yield return (object)new WaitForSeconds(todaysAesthetics.introMusicTime); while (multiplierValue > 1f) { yield return null; multiplierValue -= startingAddition / todaysAesthetics.introMusicFade * Time.deltaTime; SongsManager.Instance.SetGlobalVolumeMultiplier(introVolumeMultiplierKey, multiplierValue); } SongsManager.Instance.RemoveGlobalVolumeMultiplier(introVolumeMultiplierKey); } } private void DoSpecialAestheticChecks() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)NewDonkCityManager.Instance == (Object)null) && (Object)(object)todaysAesthetics != (Object)null) { if ((Object)(object)todaysAesthetics.outsideFog != (Object)null && ((Behaviour)todaysAesthetics.outsideFog).enabled == NewDonkCityManager.Instance.localCameraInFactory) { todaysAesthetics.ToggleFogObject(ofOutsideFog: true, !((Behaviour)todaysAesthetics.outsideFog).enabled); } else if ((Object)(object)todaysAesthetics.insideFog != (Object)null && ((Behaviour)todaysAesthetics.insideFog).enabled == !NewDonkCityManager.Instance.localCameraInFactory) { todaysAesthetics.ToggleFogObject(ofOutsideFog: false, !((Behaviour)todaysAesthetics.insideFog).enabled); } if ((Object)(object)todaysAesthetics.outdoorParticles != (Object)null && todaysAesthetics.outdoorParticles.isPlaying && !NewDonkCityManager.Instance.localCameraInFactory) { ((Component)todaysAesthetics.outdoorParticles).transform.position = NewDonkCityManager.Instance.localCameraPosition; } } } 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(113678267u, new RpcReceiveHandler(__rpc_handler_113678267), "StartTodaysSongServerRpc"); ((NetworkBehaviour)this).__registerRpc(3169010161u, new RpcReceiveHandler(__rpc_handler_3169010161), "StartTodaysSongClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_113678267(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; ((AestheticsManager)(object)target).StartTodaysSongServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3169010161(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; ((AestheticsManager)(object)target).StartTodaysSongClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AestheticsManager"; } } public class ConditionalsManager : MonoBehaviour { public enum SpecialScript { None, CheckScripts, SubConditionals, TimeOfDay, RoundManager } public enum ComparisonType { Equals, NotEquals, GreaterThan, SmallerThan } private static ManualLogSource Logger; public Transform conditionsContainer; private List allConditions; private float conditionalTimer; private int conditionalIndex; public void OnLoadDelay() { allConditions = new List(); ((Component)conditionsContainer).GetComponentsInChildren(false, allConditions); } private void Update() { if (NewDonkCityManager.localPlayerServer && allConditions != null && allConditions.Count != 0 && MoonManager.loadedMoonSaveData) { conditionalTimer -= Time.deltaTime; if (conditionalTimer <= 0f) { CheckConditionals(); } } } private void CheckConditionals() { conditionalTimer = 0.5f; conditionalIndex++; if (conditionalIndex >= allConditions.Count) { conditionalIndex = 0; } ((MonoBehaviour)this).StartCoroutine(CheckConditionalOnDelay(allConditions[conditionalIndex])); } private LoadedDataState CheckConditionalInstant(Conditional toCheck) { if ((Object)(object)toCheck == (Object)null) { Logger.LogWarning((object)$"null conditional {toCheck}, removing"); return new LoadedDataState(successful: false); } Behaviour[] array = null; switch (toCheck.useValuesOf) { default: Logger.LogDebug((object)$"automatically spawning from conditional {toCheck}"); return new LoadedDataState(successful: true, true); case SpecialScript.CheckScripts: if (toCheck.checkComponents != null && toCheck.checkFields != null && toCheck.fieldValuesToMeet != null && toCheck.compareBy != null && toCheck.checkComponents.Length == toCheck.checkFields.Length && toCheck.checkComponents.Length == toCheck.fieldValuesToMeet.Length && toCheck.checkComponents.Length == toCheck.compareBy.Length) { array = toCheck.checkComponents; break; } Logger.LogWarning((object)$"conditional {toCheck} with type {toCheck.useValuesOf} should have as many scripts to check as fields to check, removing (null: scripts? {toCheck.checkComponents == null} // fields? {toCheck.checkFields == null} // values? {toCheck.fieldValuesToMeet == null} // comparisons? {toCheck.compareBy == null})"); return new LoadedDataState(successful: false); case SpecialScript.SubConditionals: if (toCheck.checkSubConditions == null || toCheck.checkSubConditions.Length == 0) { Logger.LogWarning((object)$"conditional {toCheck} with type {toCheck.useValuesOf} should conditionals to check, removing (null? {toCheck.checkSubConditions == null})"); return new LoadedDataState(successful: false); } break; case SpecialScript.TimeOfDay: array = FillArrayWithScriptSingle((Behaviour)(object)TimeOfDay.Instance, toCheck.checkFields.Length); break; case SpecialScript.RoundManager: array = FillArrayWithScriptSingle((Behaviour)(object)RoundManager.Instance, toCheck.checkFields.Length); break; } bool flag = false; if (toCheck.useValuesOf == SpecialScript.SubConditionals) { for (int i = 0; i < toCheck.checkSubConditions.Length; i++) { if ((Object)(object)toCheck.checkSubConditions[i] == (Object)null) { continue; } LoadedDataState loadedDataState = CheckConditionalInstant(toCheck.checkSubConditions[i]); if (loadedDataState == null || !loadedDataState.loadSuccessful) { continue; } if ((bool)loadedDataState.loadedValue) { flag = true; if (!toCheck.andOr) { break; } } else if (toCheck.andOr) { flag = false; break; } } } else { if (array == null || array.Length == 0) { Logger.LogWarning((object)"invalid normal behaviour that needs checking, removing"); return new LoadedDataState(successful: false); } for (int j = 0; j < array.Length; j++) { if ((Object)(object)array[j] == (Object)null || string.IsNullOrEmpty(toCheck.checkFields[j]) || string.IsNullOrEmpty(toCheck.fieldValuesToMeet[j])) { continue; } string fieldValue = GetFieldValue(array[j], toCheck.checkFields[j]); if (string.IsNullOrEmpty(fieldValue)) { continue; } if (CompareFieldValue(fieldValue, toCheck, j)) { flag = true; if (!toCheck.andOr) { break; } } else if (toCheck.andOr) { flag = false; break; } } } if (flag) { if (Application.isEditor && toCheck.removeUponSucceedingCondition) { Logger.LogDebug((object)$"conditional {toCheck} succeeded - instant"); } return new LoadedDataState(successful: true, true); } if (Application.isEditor && toCheck.removeUponFailingCondition) { Logger.LogDebug((object)$"conditional {toCheck} failed - instant"); } return new LoadedDataState(successful: true, false); } private IEnumerator CheckConditionalOnDelay(Conditional toCheck) { if ((Object)(object)toCheck == (Object)null) { Logger.LogWarning((object)$"null conditional {toCheck}, removing"); FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: false)); yield break; } Behaviour[] checkBehaviour = null; switch (toCheck.useValuesOf) { default: Logger.LogDebug((object)$"automatically spawning from conditional {toCheck}"); FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: true, true)); yield break; case SpecialScript.CheckScripts: if (toCheck.checkComponents != null && toCheck.checkFields != null && toCheck.fieldValuesToMeet != null && toCheck.compareBy != null && toCheck.checkComponents.Length == toCheck.checkFields.Length && toCheck.checkComponents.Length == toCheck.fieldValuesToMeet.Length && toCheck.checkComponents.Length == toCheck.compareBy.Length) { checkBehaviour = toCheck.checkComponents; break; } Logger.LogWarning((object)$"conditional {toCheck} with type {toCheck.useValuesOf} should have as many scripts to check as fields to check, removing (null: scripts? {toCheck.checkComponents == null} // fields? {toCheck.checkFields == null} // values? {toCheck.fieldValuesToMeet == null} // comparisons? {toCheck.compareBy == null})"); FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: false)); yield break; case SpecialScript.SubConditionals: if (toCheck.checkSubConditions == null || toCheck.checkSubConditions.Length == 0) { Logger.LogWarning((object)$"conditional {toCheck} with type {toCheck.useValuesOf} should conditionals to check, removing (null? {toCheck.checkSubConditions == null})"); FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: false)); yield break; } break; case SpecialScript.TimeOfDay: checkBehaviour = FillArrayWithScriptSingle((Behaviour)(object)TimeOfDay.Instance, toCheck.checkFields.Length); break; case SpecialScript.RoundManager: checkBehaviour = FillArrayWithScriptSingle((Behaviour)(object)RoundManager.Instance, toCheck.checkFields.Length); break; } bool metAllConditions = false; if (toCheck.useValuesOf == SpecialScript.SubConditionals) { for (int i = 0; i < toCheck.checkSubConditions.Length; i++) { yield return null; if ((Object)(object)toCheck.checkSubConditions[i] == (Object)null) { continue; } LoadedDataState loadedDataState = CheckConditionalInstant(toCheck.checkSubConditions[i]); if (loadedDataState == null || !loadedDataState.loadSuccessful) { continue; } if ((bool)loadedDataState.loadedValue) { metAllConditions = true; if (!toCheck.andOr) { break; } } else if (toCheck.andOr) { metAllConditions = false; break; } } } else { if (checkBehaviour == null || checkBehaviour.Length == 0) { Logger.LogWarning((object)"invalid normal behaviour that needs checking, removing"); FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: false)); yield break; } for (int i = 0; i < checkBehaviour.Length; i++) { yield return null; if ((Object)(object)checkBehaviour[i] == (Object)null || string.IsNullOrEmpty(toCheck.checkFields[i]) || string.IsNullOrEmpty(toCheck.fieldValuesToMeet[i])) { continue; } string fieldValue = GetFieldValue(checkBehaviour[i], toCheck.checkFields[i]); if (string.IsNullOrEmpty(fieldValue)) { continue; } if (CompareFieldValue(fieldValue, toCheck, i)) { metAllConditions = true; if (!toCheck.andOr) { break; } } else if (toCheck.andOr) { metAllConditions = false; break; } } } if (metAllConditions) { if (Application.isEditor && toCheck.removeUponSucceedingCondition) { Logger.LogDebug((object)$"conditional {toCheck} succeeded - delayed"); } FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: true, true)); } else { if (Application.isEditor && toCheck.removeUponFailingCondition) { Logger.LogDebug((object)$"conditional {toCheck} failed - delayed"); } FinalizeConditionalCheckAndRemove(new LoadedDataState(successful: true, false)); } } private void FinalizeConditionalCheckAndRemove(LoadedDataState comparisonResult) { if (comparisonResult == null || comparisonResult.loadedValue == null) { return; } bool flag = false; if ((bool)comparisonResult.loadedValue) { allConditions[conditionalIndex].invokeOnSucceeding.Invoke(); if (allConditions[conditionalIndex].removeUponSucceedingCondition) { flag = true; } } else { allConditions[conditionalIndex].invokeOnFailing.Invoke(); if (allConditions[conditionalIndex].removeUponFailingCondition) { flag = true; } } if (!comparisonResult.loadSuccessful) { flag = true; } if (flag) { allConditions.RemoveAt(conditionalIndex); } } private Behaviour[] FillArrayWithScriptSingle(Behaviour fillWith, int length) { if ((Object)(object)fillWith == (Object)null || length == 0) { return null; } Behaviour[] array = (Behaviour[])(object)new Behaviour[length]; for (int i = 0; i < array.Length; i++) { array[i] = fillWith; } return array; } private Behaviour[] FillArrayWithScriptMultiple(Behaviour[] fillWith) { if (fillWith == null || fillWith.Length == 0) { return null; } Behaviour[] array = (Behaviour[])(object)new Behaviour[fillWith.Length]; for (int i = 0; i < array.Length; i++) { array[i] = fillWith[i]; } return array; } private string GetFieldValue(Behaviour checkScript, string checkField) { if ((Object)(object)checkScript == (Object)null || string.IsNullOrEmpty(checkField)) { return null; } try { object value = ((object)checkScript).GetType().GetField(checkField, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetValue(checkScript); if (value == null) { return "null"; } return value.ToString(); } catch (Exception arg) { Logger.LogError((object)$"error when trying to read value {checkField} from script {checkScript}:\n{arg}"); return null; } } private bool CompareFieldValue(string fieldValue, Conditional condition, int comparisonIndex) { if (string.IsNullOrEmpty(fieldValue) || (Object)(object)condition == (Object)null || comparisonIndex < 0 || comparisonIndex >= condition.compareBy.Length) { return false; } switch (condition.compareBy[comparisonIndex]) { default: return fieldValue == condition.fieldValuesToMeet[comparisonIndex]; case ComparisonType.NotEquals: return fieldValue != condition.fieldValuesToMeet[comparisonIndex]; case ComparisonType.GreaterThan: { if (!float.TryParse(fieldValue, out var result3) || !float.TryParse(condition.fieldValuesToMeet[comparisonIndex], out var result4)) { Logger.LogWarning((object)"error when parsing GreaterThan"); return false; } return result3 > result4; } case ComparisonType.SmallerThan: { if (!float.TryParse(fieldValue, out var result) || !float.TryParse(condition.fieldValuesToMeet[comparisonIndex], out var result2)) { Logger.LogWarning((object)"error when parsing SmallerThan"); return false; } return result < result2; } } } } public class FestivalManager : NetworkBehaviour { private static ManualLogSource Logger; public static FestivalManager Instance; public Aesthetic activateOnAesthetics; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public void StartFestival(Aesthetic todaysAesthetics) { if ((Object)(object)activateOnAesthetics == (Object)null && (Object)(object)todaysAesthetics == (Object)null) { _ = (Object)(object)activateOnAesthetics != (Object)(object)todaysAesthetics; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "FestivalManager"; } } public class GenericManager : NetworkBehaviour { private static ManualLogSource Logger; public static GenericManager Instance; [Header("Audio")] public AudioSource[] tempAudioSources; [Space(3f)] [Header("Coins")] public GameObject[] staticCoinVisuals; public AudioClip[] collectCoinSFX; private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; GameObject val = new GameObject("LCNewDonkCityMod"); val.transform.SetParent(Plugin.SearchForObject("SimonTendoManagers", ((Component)StartOfRound.Instance).transform.parent).transform); ((Component)this).transform.SetParent(val.transform, true); } public void SyncPreLevelGenerate() { if (((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer) { Logger.LogDebug((object)$"SyncPreLevelGenerate - SERVER: {Plugin.ndcSelectableLevel.minScrap} // {Plugin.ndcSelectableLevel.maxScrap} // {Plugin.ndcSelectableLevel.factorySizeMultiplier}"); SyncPreLevelGenerateClientRpc(Plugin.ndcSelectableLevel.minScrap, Plugin.ndcSelectableLevel.maxScrap, Plugin.ndcSelectableLevel.factorySizeMultiplier); } } [ClientRpc] private void SyncPreLevelGenerateClientRpc(int serverMinScrap, int serverMaxScrap, float serverFactorySize) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3996748794u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, serverMinScrap); BytePacker.WriteValueBitPacked(val, serverMaxScrap); ((FastBufferWriter)(ref val)).WriteValueSafe(ref serverFactorySize, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3996748794u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { Plugin.ndcSelectableLevel.minScrap = serverMinScrap; Plugin.ndcSelectableLevel.maxScrap = serverMaxScrap; Plugin.ndcSelectableLevel.factorySizeMultiplier = serverFactorySize; Logger.LogDebug((object)$"SyncPreLevelGenerate - CLIENT: {Plugin.ndcSelectableLevel.minScrap} // {Plugin.ndcSelectableLevel.maxScrap} // {Plugin.ndcSelectableLevel.factorySizeMultiplier}"); } } } public static void PlaySFXAtLocation(Vector3 position, AudioClip clip, bool audible = true, float audibleRange = 10f, float audibleLoudness = 0.75f, float dopplerEffect = 1f, float pitchOffset = 0f, bool isMonoSound = false, int audibleID = 0, bool transmitWalkie = true) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || Instance.tempAudioSources == null || Instance.tempAudioSources.Length == 0 || (Object)(object)clip == (Object)null) { return; } AudioSource val = null; for (int i = 0; i < Instance.tempAudioSources.Length; i++) { if ((Object)(object)Instance.tempAudioSources[i] != (Object)null && (!Instance.tempAudioSources[i].isPlaying || i == Instance.tempAudioSources.Length - 1)) { val = Instance.tempAudioSources[i]; break; } } val.Stop(); ((Component)val).transform.position = position; val.volume = audibleLoudness * 1.25f; val.maxDistance = audibleRange * 1.25f; val.dopplerLevel = dopplerEffect; val.pitch = 1f + Random.Range(pitchOffset * -1f, pitchOffset); val.spatialBlend = (isMonoSound ? 0f : 1f); PlaySFX(val, clip, audible, audibleRange, audibleLoudness, audibleID, transmitWalkie); } public static void PlaySFX(AudioSource source, AudioClip clip, bool audible = true, float audibleRange = 10f, float audibleLoudness = 0.75f, int audibleID = 0, bool transmitWalkie = true) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) if ((Object)(object)source == (Object)null || (Object)(object)clip == (Object)null) { return; } source.PlayOneShot(clip); if (transmitWalkie) { WalkieTalkie.TransmitOneShotAudio(source, clip, audibleLoudness); } if (audible) { int num; if ((Object)(object)StartOfRound.Instance != (Object)null && (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; } bool flag = (byte)num != 0; RoundManager.Instance.PlayAudibleNoise(((Component)source).transform.position, audibleRange, audibleLoudness, 0, flag, audibleID); } } public static void PlaySFXSynced(Vector3 position, AudioClip clip, bool audible = true, float audibleRange = 10f, float audibleLoudness = 0.75f, float dopplerEffect = 1f, float pitchOffset = 0f, bool isMonoSound = false, bool isMonoSynced = false, int audibleID = 0, bool transmitWalkie = true) { //IL_006a: 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) if ((Object)(object)Instance == (Object)null || (Object)(object)SoundManager.Instance == (Object)null || SoundManager.Instance.syncedAudioClips == null || SoundManager.Instance.syncedAudioClips.Length == 0) { return; } int num = -1; for (int i = 0; i < SoundManager.Instance.syncedAudioClips.Length; i++) { if ((Object)(object)SoundManager.Instance.syncedAudioClips[i] == (Object)(object)clip) { num = i; break; } } if (num != -1) { PlaySFXAtLocation(position, SoundManager.Instance.syncedAudioClips[num], audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound, audibleID, transmitWalkie); Instance.PlaySFXSyncedServerRpc(NewDonkCityManager.localPlayerID, position, num, audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound && isMonoSynced, audibleID, transmitWalkie); } } [ServerRpc(RequireOwnership = false)] private void PlaySFXSyncedServerRpc(int playerID, Vector3 position, int clipIndex, bool audible, float audibleRange, float audibleLoudness, float dopplerEffect, float pitchOffset, bool isMonoSound, int audibleID, bool transmitWalkie) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_008b: 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_00bf: 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_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_016d: 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_01b9: 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(2751274751u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val, clipIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audible, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audibleRange, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audibleLoudness, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dopplerEffect, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pitchOffset, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isMonoSound, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, audibleID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref transmitWalkie, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2751274751u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlaySFXSyncedClientRpc(playerID, position, clipIndex, audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound, audibleID, transmitWalkie); } } } [ClientRpc] private void PlaySFXSyncedClientRpc(int playerID, Vector3 position, int clipIndex, bool audible, float audibleRange, float audibleLoudness, float dopplerEffect, float pitchOffset, bool isMonoSound, int audibleID, bool transmitWalkie) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_008b: 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_00bf: 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_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_016d: 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_01f9: 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(4019402321u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val, clipIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audible, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audibleRange, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref audibleLoudness, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dopplerEffect, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pitchOffset, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isMonoSound, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, audibleID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref transmitWalkie, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4019402321u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID && !((Object)(object)SoundManager.Instance == (Object)null) && SoundManager.Instance.syncedAudioClips != null && SoundManager.Instance.syncedAudioClips.Length != 0 && clipIndex >= 0 && clipIndex < SoundManager.Instance.syncedAudioClips.Length) { PlaySFXAtLocation(position, SoundManager.Instance.syncedAudioClips[clipIndex], audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound, audibleID, transmitWalkie); } } } public static void AddCollectedCoins(CoinContainer coinContainer, PlayerControllerB collectedBy) { //IL_0033: 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)Instance == (Object)null || (Object)(object)coinContainer == (Object)null) { return; } Logger.LogDebug((object)$"AddCollectedCoins(): {coinContainer} at {((Component)coinContainer).transform.position} with ${coinContainer.worthAmount} and visual {(Object)(object)coinContainer.spawnCoinVisualAt != (Object)null} by {collectedBy}"); PropsManager.SaveCollectedCoinIntoMemory(GameNetworkManager.Instance.saveFileNum, ((Component)coinContainer).transform.position, (int)coinContainer.collectType); if ((Object)(object)coinContainer.spawnCoinVisualAt == (Object)null) { UpdateCoinCount(coinContainer.worthAmount); if (coinContainer.destroyOnCollect) { Object.Destroy((Object)(object)((Component)coinContainer).gameObject); } } else { ((MonoBehaviour)Instance).StartCoroutine(Instance.SpawnCoinsCoroutine(coinContainer, collectedBy)); } } private IEnumerator SpawnCoinsCoroutine(CoinContainer coinContainer, PlayerControllerB collectedBy) { int currentAmount = 0; while (currentAmount < coinContainer.worthAmount) { currentAmount++; UpdateCoinCount(1); SpawnStaticCoinVisual(coinContainer.spawnCoinVisualAt, coinContainer.visualUsesRotation, coinContainer.coinIndex, collectedBy); yield return (object)new WaitForSeconds(0.2f); } if (coinContainer.destroyOnCollect) { Object.Destroy((Object)(object)((Component)coinContainer).gameObject); } } private static void UpdateCoinCount(int add) { if ((Object)(object)RoundManager.Instance != (Object)null) { RoundManager instance = RoundManager.Instance; instance.scrapCollectedInLevel += add; RoundManager instance2 = RoundManager.Instance; instance2.valueOfFoundScrapItems += add; } if ((Object)(object)TimeOfDay.Instance != (Object)null) { TimeOfDay instance3 = TimeOfDay.Instance; instance3.quotaFulfilled += add; TimeOfDay.Instance.UpdateProfitQuotaCurrentTime(); } } private static void SpawnStaticCoinVisual(Transform spawnCoinFromPoint, bool useTransformRotation, int coinIndex, PlayerControllerB collectedBy) { //IL_0047: 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_004f: 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) if (!((Object)(object)Instance == (Object)null) && Instance.staticCoinVisuals != null && Instance.staticCoinVisuals.Length != 0 && coinIndex >= 0 && coinIndex < Instance.staticCoinVisuals.Length && !((Object)(object)Object.Instantiate(Instance.staticCoinVisuals[coinIndex], spawnCoinFromPoint.position, useTransformRotation ? spawnCoinFromPoint.rotation : Quaternion.identity) == (Object)null)) { bool flag = (Object)(object)collectedBy != (Object)null && (Object)(object)collectedBy == (Object)(object)NewDonkCityManager.localPlayer; PlaySFXAtLocation(spawnCoinFromPoint.position, Instance.collectCoinSFX[coinIndex], audible: true, 15f, 0.4f, flag ? 0f : 1f, 0f, flag); } } public static void SetLevelWeather(int weatherIndex) { if (Application.isEditor && !((Object)(object)Instance == (Object)null) && ((NetworkBehaviour)Instance).IsServer && !((Object)(object)StartOfRound.Instance == (Object)null) && StartOfRound.Instance.inShipPhase) { Instance.SetLevelWeatherClientRpc(weatherIndex); } } [ClientRpc] private void SetLevelWeatherClientRpc(int weatherIndex) { //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_00d9: 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(3358364691u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, weatherIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3358364691u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; try { Plugin.ndcSelectableLevel.currentWeather = (LevelWeatherType)weatherIndex; StartOfRound.Instance.SetMapScreenInfoToCurrentLevel(); } catch { Logger.LogDebug((object)$"weatherIndex {weatherIndex} failed"); } } 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 ((NetworkBehaviour)this).__registerRpc(3996748794u, new RpcReceiveHandler(__rpc_handler_3996748794), "SyncPreLevelGenerateClientRpc"); ((NetworkBehaviour)this).__registerRpc(2751274751u, new RpcReceiveHandler(__rpc_handler_2751274751), "PlaySFXSyncedServerRpc"); ((NetworkBehaviour)this).__registerRpc(4019402321u, new RpcReceiveHandler(__rpc_handler_4019402321), "PlaySFXSyncedClientRpc"); ((NetworkBehaviour)this).__registerRpc(3358364691u, new RpcReceiveHandler(__rpc_handler_3358364691), "SetLevelWeatherClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3996748794(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 serverMinScrap = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverMinScrap); int serverMaxScrap = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverMaxScrap); float serverFactorySize = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref serverFactorySize, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GenericManager)(object)target).SyncPreLevelGenerateClientRpc(serverMinScrap, serverMaxScrap, serverFactorySize); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2751274751(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_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_0071: 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_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_00a7: 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_00c2: 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_00dd: 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_00ec: 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_010b: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); int clipIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex); bool audible = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audible, default(ForPrimitives)); float audibleRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audibleRange, default(ForPrimitives)); float audibleLoudness = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audibleLoudness, default(ForPrimitives)); float dopplerEffect = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dopplerEffect, default(ForPrimitives)); float pitchOffset = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitchOffset, default(ForPrimitives)); bool isMonoSound = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isMonoSound, default(ForPrimitives)); int audibleID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audibleID); bool transmitWalkie = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref transmitWalkie, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GenericManager)(object)target).PlaySFXSyncedServerRpc(playerID, position, clipIndex, audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound, audibleID, transmitWalkie); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4019402321(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_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_0071: 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_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_00a7: 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_00c2: 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_00dd: 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_00ec: 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_010b: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); int clipIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex); bool audible = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audible, default(ForPrimitives)); float audibleRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audibleRange, default(ForPrimitives)); float audibleLoudness = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audibleLoudness, default(ForPrimitives)); float dopplerEffect = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dopplerEffect, default(ForPrimitives)); float pitchOffset = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitchOffset, default(ForPrimitives)); bool isMonoSound = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isMonoSound, default(ForPrimitives)); int audibleID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audibleID); bool transmitWalkie = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref transmitWalkie, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GenericManager)(object)target).PlaySFXSyncedClientRpc(playerID, position, clipIndex, audible, audibleRange, audibleLoudness, dopplerEffect, pitchOffset, isMonoSound, audibleID, transmitWalkie); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3358364691(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 levelWeatherClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref levelWeatherClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((GenericManager)(object)target).SetLevelWeatherClientRpc(levelWeatherClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GenericManager"; } } public class MoonManager : NetworkBehaviour { public static MoonManager Instance; private static ManualLogSource Logger; public GameObject spawnPrefabMoon; public GameObject spawnPrefabShard; [Space(3f)] public AudioClip[] spawnSFX; public AudioClip correctSolutionSFX; [Space(3f)] public Transform dataContainerMoons; public Transform dataContainerShards; private List allMoons; private List allShards; [Space(3f)] public Odyssey moonDisplay; [HideInInspector] public static bool loadedMoonSaveData; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; loadedMoonSaveData = false; } public void OnSceneLoad() { SetUpMoonArrays(); } private void SetUpMoonArrays() { Transform val = null; MoonData moonData = null; if ((Object)(object)dataContainerMoons != (Object)null && dataContainerMoons.childCount > 0) { allMoons = new List(); for (int i = 0; i < dataContainerMoons.childCount; i++) { val = dataContainerMoons.GetChild(i); if (!((Object)(object)val == (Object)null)) { moonData = ((Component)val).GetComponent(); if (Application.isEditor) { Logger.LogDebug((object)$"m{i}: {moonData}"); } if ((Object)(object)moonData != (Object)null) { allMoons.Add(moonData); } } } } if (!((Object)(object)dataContainerShards != (Object)null) || dataContainerShards.childCount <= 0) { return; } allShards = new List(); for (int j = 0; j < dataContainerShards.childCount; j++) { val = dataContainerShards.GetChild(j); if (!((Object)(object)val == (Object)null)) { moonData = ((Component)val).GetComponent(); if (Application.isEditor) { Logger.LogDebug((object)$"s{j}: {moonData}"); } if ((Object)(object)moonData != (Object)null) { allShards.Add(moonData); } } } } public static bool SpawnMoon(MoonData fromData) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fromData == (Object)null || fromData.collected || (Object)(object)fromData.spawnedMoon != (Object)null || (Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer) { return false; } Transform val = (((Object)(object)fromData.overrideMoonParent != (Object)null) ? ((Component)fromData.overrideMoonParent).transform : ((Component)fromData).transform); GameObject overrideSpawnPrefab = Instance.spawnPrefabMoon; _ = fromData.moonValue; bool flag = false; int sfxCase = 0; if (fromData.shardsToCollect != -1) { return false; } if ((Object)(object)fromData.mainMoon != (Object)null) { overrideSpawnPrefab = Instance.spawnPrefabShard; sfxCase = 1; } else if ((Object)(object)fromData.overrideSpawnPrefab != (Object)null) { overrideSpawnPrefab = fromData.overrideSpawnPrefab; flag = true; } if (fromData.overrideSpawnSfx != -1 && fromData.overrideSpawnSfx >= 0 && fromData.overrideSpawnSfx < Instance.spawnSFX.Length) { sfxCase = fromData.overrideSpawnSfx; } if ((Object)(object)overrideSpawnPrefab == (Object)null || (Object)(object)val == (Object)null) { return false; } GameObject val2 = Object.Instantiate(overrideSpawnPrefab, val.position, val.rotation); if ((Object)(object)val2 == (Object)null) { return false; } GrabbableObject component = val2.GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.itemProperties == (Object)null) { Object.Destroy((Object)(object)val2); return false; } PowerMoon component2 = val2.GetComponent(); if ((Object)(object)component2 != (Object)null) { fromData.spawnedMoon = component2; component2.ID = GetMoonOrShardID(fromData); } ((NetworkBehaviour)component).NetworkObject.Spawn(false); float sfxRange = ((fromData.overrideSfxRange != -1f) ? fromData.overrideSfxRange : 25f); Transform parentObject = (((Object)(object)fromData.overrideMoonParent != (Object)null) ? ((Component)fromData.overrideMoonParent).transform : null); Vector3 moverPosition = (Vector3)(((Object)(object)fromData.moveMoonOnSpawn != (Object)null) ? ((Component)fromData.moveMoonOnSpawn).transform.position : default(Vector3)); if (flag && (Object)(object)component.itemProperties != (Object)null && (Object)(object)RoundManager.Instance != (Object)null) { Random.Range((float)component.itemProperties.minValue * RoundManager.Instance.scrapValueMultiplier, (float)component.itemProperties.maxValue * RoundManager.Instance.scrapValueMultiplier); } Instance.SpawnItemClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component2).NetworkObject), fromData.moonValue, val.position, (Object)(object)fromData.overrideMoonParent != (Object)null, sfxRange, sfxCase, fromData.shardGroupTooltip, moverPosition); Instance.SpawnItemLocal((GrabbableObject)(object)component2, fromData.moonValue, val.position, parentObject, sfxRange, sfxCase, fromData.shardGroupTooltip, fromData.moveMoonOnSpawn); return true; } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference itemNOR, int moonValue, Vector3 targetPos, bool searchLocalNetworkParent, float sfxRange, int sfxCase, string shardTooltip, Vector3 moverPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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(3692726653u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, moonValue); ((FastBufferWriter)(ref val)).WriteValueSafe(ref targetPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchLocalNetworkParent, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref sfxRange, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, sfxCase); bool flag = shardTooltip != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(shardTooltip, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref moverPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3692726653u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(GetItemOnClientDelayed(itemNOR, toSpawn: true, moonValue, targetPos, searchLocalNetworkParent, sfxRange, sfxCase, shardTooltip, moverPosition)); } } } private IEnumerator GetItemOnClientDelayed(NetworkObjectReference itemNOR, bool toSpawn, int moonValue = -1, Vector3 targetPos = default(Vector3), bool searchLocalNetworkParent = false, float sfxRange = -1f, int sfxCase = 0, string shardTooltip = null, Vector3 moverPosition = default(Vector3)) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) float timeWaited = 0f; float maxTime = 5f; float waitIntervals = 0.25f; bool success = false; GrabbableObject itemScript = null; NetworkObject val = default(NetworkObject); while (timeWaited < maxTime && !success) { if (((NetworkObjectReference)(ref itemNOR)).TryGet(ref val, (NetworkManager)null)) { itemScript = (GrabbableObject)(object)((Component)val).GetComponent(); } if ((Object)(object)itemScript != (Object)null) { success = true; continue; } yield return (object)new WaitForSeconds(waitIntervals); timeWaited += waitIntervals; } if ((Object)(object)itemScript == (Object)null) { yield break; } if (toSpawn) { Transform val2 = null; if (searchLocalNetworkParent) { GameObject val3 = NewDonkCityManager.SearchPhysicsComponentAtPosition(targetPos, "Local NetworkObject", 5f, logResults: true); if ((Object)(object)val3 != (Object)null) { val2 = val3.transform; } } MoveToPoint moveOnSpawn = null; if ((Object)(object)val2 != (Object)null && moverPosition != default(Vector3)) { GameObject val4 = NewDonkCityManager.SearchPhysicsComponentAtPosition(moverPosition, "Move To Point", 5f, logResults: true); if ((Object)(object)val4 != (Object)null) { moveOnSpawn = val4.GetComponent(); } } SpawnItemLocal(itemScript, moonValue, targetPos, val2, sfxRange, sfxCase, shardTooltip, moveOnSpawn); } else { DespawnItemLocal(itemScript); } } private void SpawnItemLocal(GrabbableObject item, int moonValue, Vector3 targetPos, Transform parentObject, float sfxRange, int sfxCase, string shardTooltip, MoveToPoint moveOnSpawn) { //IL_0089: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item == (Object)null || (Object)(object)item.itemProperties == (Object)null) { return; } item.fallTime = 1f; item.reachedFloorTarget = true; item.hasHitGround = true; ((Component)item).transform.SetParent(parentObject); if (item.itemProperties.isScrap) { item.SetScrapValue(moonValue); } PowerMoon powerMoon = item as PowerMoon; if ((Object)(object)powerMoon != (Object)null) { powerMoon.overrideSpawnPos = (((Object)(object)((Component)powerMoon).transform.parent != (Object)null) ? ((Component)powerMoon).transform.parent.InverseTransformPoint(parentObject.position) : targetPos); powerMoon.DoMoonSpawnAnimation(); powerMoon.InitializeShardOnSpawn(shardTooltip); if ((Object)(object)powerMoon.spawnSFX != (Object)null && spawnSFX != null && sfxCase >= 0 && sfxCase < spawnSFX.Length) { powerMoon.spawnSFX.minDistance = Mathf.Max(0f, sfxRange - 0.1f); powerMoon.spawnSFX.maxDistance = Mathf.Max(sfxRange, powerMoon.spawnSFX.minDistance + 0.1f); GenericManager.PlaySFX(powerMoon.spawnSFX, spawnSFX[sfxCase], audible: true, sfxRange * 0.75f); } if ((Object)(object)moveOnSpawn != (Object)null && (Object)(object)((Component)item).transform.parent != (Object)null) { moveOnSpawn.StartMovingObjectToPointNoSync(((Component)((Component)item).transform.parent).gameObject); } } if (HoarderBugAI.grabbableObjectsInMap != null && !HoarderBugAI.grabbableObjectsInMap.Contains(((Component)item).gameObject)) { HoarderBugAI.grabbableObjectsInMap.Add(((Component)item).gameObject); } if (item.itemProperties.isConductiveMetal) { StormyWeather stormWeather = NewDonkCityManager.GetStormWeather(); if ((Object)(object)stormWeather != (Object)null && stormWeather.metalObjects != null && !stormWeather.metalObjects.Contains(item)) { stormWeather.metalObjects.Add(item); } } } public static int GetMoonOrShardID(MoonData fromData) { if ((Object)(object)Instance == (Object)null || Instance.allMoons == null || Instance.allMoons.Count == 0 || Instance.allShards == null || Instance.allShards.Count == 0) { return -1; } MoonData moonData = null; for (int i = 0; i < Instance.allMoons.Count; i++) { moonData = Instance.allMoons[i]; if (!((Object)(object)moonData == (Object)null) && !((Object)(object)moonData != (Object)(object)fromData)) { Logger.LogDebug((object)$"got ID {i} for MOON {fromData}"); return i; } } for (int j = 0; j < Instance.allShards.Count; j++) { moonData = Instance.allShards[j]; if (!((Object)(object)moonData == (Object)null) && !((Object)(object)moonData != (Object)(object)fromData)) { Logger.LogDebug((object)$"got ID {j} for SHARD {fromData}"); return j; } } return -1; } public static MoonData GetMoonOrShard(int fromID, bool isMoon = true) { if ((Object)(object)Instance == (Object)null || fromID < 0) { return null; } if (isMoon) { if (Instance.allMoons == null || Instance.allMoons.Count == 0 || fromID >= Instance.allMoons.Count) { return null; } return Instance.allMoons[fromID]; } if (Instance.allShards == null || Instance.allShards.Count == 0 || fromID >= Instance.allShards.Count) { return null; } return Instance.allShards[fromID]; } public static void SetMoonIDCollected(PowerMoon moon, bool setTo = true) { if ((Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer || (Object)(object)moon == (Object)null || moon.ID < 0 || ((GrabbableObject)moon).deactivated) { return; } if (moon.isShard) { if (Instance.allShards != null && Instance.allShards.Count != 0 && moon.ID < Instance.allShards.Count && setTo != Instance.allShards[moon.ID].collected) { Instance.allShards[moon.ID].collected = setTo; Logger.LogDebug((object)$"set SHARD {Instance.allShards[moon.ID]} at ID {moon.ID} to {Instance.allShards[moon.ID].collected}"); } } else if (Instance.allMoons != null && Instance.allMoons.Count != 0 && moon.ID < Instance.allMoons.Count && setTo != Instance.allMoons[moon.ID].collected) { Instance.allMoons[moon.ID].collected = setTo; Logger.LogDebug((object)$"set MOON {Instance.allMoons[moon.ID]} at ID {moon.ID} to {Instance.allMoons[moon.ID].collected}"); } } public static void DespawnMoon(MoonData fromData) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Instance == (Object)null) && ((NetworkBehaviour)Instance).IsServer && !((Object)(object)fromData == (Object)null) && !fromData.collected && !((Object)(object)fromData.spawnedMoon == (Object)null) && !((Object)(object)((NetworkBehaviour)fromData.spawnedMoon).NetworkObject == (Object)null) && ((NetworkBehaviour)fromData.spawnedMoon).NetworkObject.IsSpawned) { PowerMoon spawnedMoon = fromData.spawnedMoon; fromData.spawnedMoon = null; Instance.DespawnItemClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)spawnedMoon).NetworkObject)); Instance.DespawnItemLocal((GrabbableObject)(object)spawnedMoon); } } [ClientRpc] private void DespawnItemClientRpc(NetworkObjectReference moonNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0108: 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(3161010376u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moonNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3161010376u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(GetItemOnClientDelayed(moonNOR, toSpawn: false)); } } } private void DespawnItemLocal(GrabbableObject item) { NewDonkCityManager.DestroyItem(item, ((NetworkBehaviour)item).NetworkObject); } public void OnLoadDelay() { LoadSavedData(); } public static void CheckShardsCollected(PowerMoon shard) { //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer || Instance.allMoons == null || Instance.allMoons.Count == 0 || (Object)(object)shard == (Object)null || !shard.isShard || shard.ID < 0 || shard.ID >= Instance.allMoons.Count || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.allPlayerScripts == null) { return; } MoonData moonData = Instance.allShards[shard.ID]; if ((Object)(object)moonData == (Object)null || (moonData.shardsToCollect == -1 && (Object)(object)moonData.mainMoon == (Object)null)) { return; } MoonData moonData2 = null; if ((Object)(object)moonData.mainMoon != (Object)null) { moonData2 = moonData.mainMoon; } else if (moonData.shardsToCollect != -1) { moonData2 = moonData; } if ((Object)(object)moonData2 == (Object)null) { return; } List list = new List(); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if ((Object)(object)val == (Object)null || !val.isPlayerControlled || val.ItemSlots == null) { continue; } for (int j = 0; j < val.ItemSlots.Length; j++) { GrabbableObject val2 = val.ItemSlots[j]; if ((Object)(object)val2 == (Object)null) { continue; } PowerMoon powerMoon = val2 as PowerMoon; if ((Object)(object)powerMoon == (Object)null || !powerMoon.isShard || ((GrabbableObject)powerMoon).deactivated) { continue; } MoonData moonDataForShard = GetMoonDataForShard(powerMoon); if (!((Object)(object)moonDataForShard == (Object)null) && !((Object)(object)moonDataForShard != (Object)(object)moonData2)) { list.Add(powerMoon); if (Application.isEditor) { Logger.LogDebug((object)$"found shard {powerMoon} #{list.Count} for moon {moonData2}"); } } } } if (list != null && list.Count >= moonData2.shardsToCollect) { Vector3 position = ((Component)shard).transform.position; GenericManager.PlaySFXAtLocation(position, Instance.correctSolutionSFX, audible: false, 15f, 0.6f, 0f); MoonManager instance = Instance; MoonManager instance2 = Instance; GrabbableObject[] shardsForMoon = (GrabbableObject[])(object)list.ToArray(); ((MonoBehaviour)instance).StartCoroutine(instance2.SpawnMoonAndDestroyShards(shardsForMoon, moonData2, position)); } } private IEnumerator SpawnMoonAndDestroyShards(GrabbableObject[] shardsForMoon, MoonData moonData, Vector3 startPos) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(0.75f); DestroyShardsServer(shardsForMoon, moonData, startPos); yield return (object)new WaitForSeconds(0.1f); moonData.shardsToCollect = -1; SpawnMoon(moonData); } private void DestroyShardsServer(GrabbableObject[] items, MoonData setMoonParentObject, Vector3 setParentObjectPosition) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) if (!((Object)(object)Instance == (Object)null) && ((NetworkBehaviour)Instance).IsServer && items != null && items.Length != 0) { NewDonkCityManager.DestroyItemMultiple(items, despawnNetworkObjects: true, printDebug: true); NetworkObjectReference[] array = (NetworkObjectReference[])(object)new NetworkObjectReference[items.Length]; for (int i = 0; i < items.Length; i++) { array[i] = NetworkObjectReference.op_Implicit(((NetworkBehaviour)items[i]).NetworkObject); } Instance.DestroyShardsClientRpc(array, GetMoonOrShardID(setMoonParentObject), setParentObjectPosition); if ((Object)(object)setMoonParentObject != (Object)null && (Object)(object)setMoonParentObject.overrideMoonParent != (Object)null) { ((Component)setMoonParentObject.overrideMoonParent).transform.position = setParentObjectPosition; } } } [ClientRpc] private void DestroyShardsClientRpc(NetworkObjectReference[] itemNORs, int setMoonParentObject, Vector3 setParentObjectPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_00e1: 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: 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) 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(4179404541u, val2, (RpcDelivery)0); bool flag = itemNORs != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(itemNORs, default(ForNetworkSerializable)); } BytePacker.WriteValueBitPacked(val, setMoonParentObject); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setParentObjectPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4179404541u, 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; } GrabbableObject[] array = (GrabbableObject[])(object)new GrabbableObject[itemNORs.Length]; NetworkObject val3 = null; for (int i = 0; i < itemNORs.Length; i++) { if (((NetworkObjectReference)(ref itemNORs[i])).TryGet(ref val3, (NetworkManager)null)) { array[i] = ((Component)val3).GetComponent(); } } NewDonkCityManager.DestroyItemMultiple(array); if ((Object)(object)Instance != (Object)null && Instance.allMoons != null && Instance.allMoons.Count != 0 && setMoonParentObject >= 0 && setMoonParentObject < Instance.allMoons.Count) { MoonData moonData = Instance.allMoons[setMoonParentObject]; if ((Object)(object)moonData != (Object)null && (Object)(object)moonData.overrideMoonParent != (Object)null) { ((Component)moonData.overrideMoonParent).transform.position = setParentObjectPosition; } } } private static MoonData GetMoonDataForShard(PowerMoon shard) { if ((Object)(object)shard == (Object)null || Instance.allShards == null || Instance.allShards.Count == 0 || shard.ID < 0 || shard.ID >= Instance.allShards.Count || (Object)(object)Instance.allShards[shard.ID].mainMoon == (Object)null) { return null; } return Instance.allShards[shard.ID].mainMoon; } public void OnDayEnd() { SaveSavedData(); } private void SaveSavedData() { if (!((NetworkBehaviour)this).IsServer || allMoons == null || allMoons.Count == 0) { return; } bool flag = true; for (int i = 0; i < allMoons.Count; i++) { if (!((Object)(object)allMoons[i] == (Object)null)) { if ((Object)(object)allMoons[i].saveScript != (Object)null) { allMoons[i].saveScript.SaveData(allMoons[i].collected ? 1 : 0); } if (!allMoons[i].collected) { flag = false; } } } if (flag) { NewDonkCityManager.SetParameterScrapSpawn(1.75f, 1.5f); NewDonkCityManager.SetParameterSizeMultiplier(1.2f); } } private void LoadSavedData() { if (((NetworkBehaviour)this).IsServer && allMoons != null && allMoons.Count != 0) { ((MonoBehaviour)this).StartCoroutine(LoadSavedDataCoroutine()); } } private IEnumerator LoadSavedDataCoroutine() { int moonsCollected = 0; bool collectedAllMoons = true; for (int i = 0; i < Instance.allMoons.Count; i++) { yield return null; if ((Object)(object)Instance.allMoons[i] == (Object)null || (Object)(object)Instance.allMoons[i].saveScript == (Object)null) { continue; } LoadedDataState loadedDataState = Instance.allMoons[i].saveScript.RetrieveData(); Instance.allMoons[i].collected = ((loadedDataState != null && loadedDataState.loadSuccessful && (int)loadedDataState.loadedValue == 1) ? true : false); if (Instance.allMoons[i].collected) { moonsCollected += GetMoonCountTowardTotal(Instance.allMoons[i]); if (Instance.allMoons[i].onAlreadyCollected != null && ((UnityEventBase)Instance.allMoons[i].onAlreadyCollected).GetPersistentEventCount() != 0) { Instance.allMoons[i].onAlreadyCollected.Invoke(); OnAlreadyCollectedClientRpc(i); } } else { collectedAllMoons = false; } } if ((Object)(object)moonDisplay != (Object)null) { moonDisplay.SetCollectedMoonsDisplay(moonsCollected, collectedAllMoons); UpdateMoonDisplayOnShipClientRpc(moonsCollected, collectedAllMoons); } loadedMoonSaveData = true; } private int GetMoonCountTowardTotal(MoonData fromData) { if ((Object)(object)fromData == (Object)null) { return 0; } GameObject overrideSpawnPrefab = Instance.spawnPrefabMoon; if ((Object)(object)fromData.mainMoon != (Object)null) { overrideSpawnPrefab = Instance.spawnPrefabShard; } else if ((Object)(object)fromData.overrideSpawnPrefab != (Object)null) { overrideSpawnPrefab = fromData.overrideSpawnPrefab; } if ((Object)(object)overrideSpawnPrefab == (Object)null) { return 0; } PowerMoon component = overrideSpawnPrefab.GetComponent(); if ((Object)(object)component == (Object)null) { return 0; } return component.countTowardsTotal; } [ClientRpc] private void OnAlreadyCollectedClientRpc(int moonID) { //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(3656971199u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, moonID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3656971199u, 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 && allMoons != null && moonID >= 0 && moonID < allMoons.Count) { MoonData moonData = allMoons[moonID]; if (!((Object)(object)moonData == (Object)null)) { moonData.collected = true; moonData.onAlreadyCollected.Invoke(); } } } [ClientRpc] private void UpdateMoonDisplayOnShipClientRpc(int serverCollected, bool serverComplete) { //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(1978534493u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, serverCollected); ((FastBufferWriter)(ref val)).WriteValueSafe(ref serverComplete, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1978534493u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer && (Object)(object)moonDisplay != (Object)null) { moonDisplay.SetCollectedMoonsDisplay(serverCollected, serverComplete); } } } 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 ((NetworkBehaviour)this).__registerRpc(3692726653u, new RpcReceiveHandler(__rpc_handler_3692726653), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(3161010376u, new RpcReceiveHandler(__rpc_handler_3161010376), "DespawnItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(4179404541u, new RpcReceiveHandler(__rpc_handler_4179404541), "DestroyShardsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3656971199u, new RpcReceiveHandler(__rpc_handler_3656971199), "OnAlreadyCollectedClientRpc"); ((NetworkBehaviour)this).__registerRpc(1978534493u, new RpcReceiveHandler(__rpc_handler_1978534493), "UpdateMoonDisplayOnShipClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3692726653(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_007f: 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_008e: 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_00ad: 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_00f1: 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_010d: 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 = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); int moonValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref moonValue); Vector3 targetPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPos); bool searchLocalNetworkParent = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchLocalNetworkParent, default(ForPrimitives)); float sfxRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref sfxRange, default(ForPrimitives)); int sfxCase = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sfxCase); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string shardTooltip = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref shardTooltip, false); } Vector3 moverPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moverPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoonManager)(object)target).SpawnItemClientRpc(itemNOR, moonValue, targetPos, searchLocalNetworkParent, sfxRange, sfxCase, shardTooltip, moverPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3161010376(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference moonNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moonNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoonManager)(object)target).DespawnItemClientRpc(moonNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4179404541(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_0068: 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_009b: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] itemNORs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNORs, default(ForNetworkSerializable)); } int setMoonParentObject = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setMoonParentObject); Vector3 setParentObjectPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setParentObjectPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoonManager)(object)target).DestroyShardsClientRpc(itemNORs, setMoonParentObject, setParentObjectPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3656971199(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 moonID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref moonID); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoonManager)(object)target).OnAlreadyCollectedClientRpc(moonID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1978534493(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 serverCollected = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverCollected); bool serverComplete = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref serverComplete, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoonManager)(object)target).UpdateMoonDisplayOnShipClientRpc(serverCollected, serverComplete); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MoonManager"; } } public class NewDonkCityManager : MonoBehaviour { private static ManualLogSource Logger; public static NewDonkCityManager Instance; [Space] [Header("Scene Objects")] public List entrancesToSetUp = new List(); public Animator skyboxAnimator; public Transform destroyPropsHeight; [HideInInspector] public UnityEvent onHitGroundEvent = new UnityEvent(); [HideInInspector] public UnityEvent onHitCeilingEvent = new UnityEvent(); public static PlayerControllerB localPlayer; public static int localPlayerID; public static bool localPlayerServer; private bool newHitGroundLocal; private float lastPlayerVelocityY; [Space(3f)] [Header("Misc")] public AnimationCurve BGMVolumeScale; private const string BGMDictionaryKey = "NewDonkCityManager SetVolumeMutiplierBGM"; public LayerMask ndcHitMask; public MeshRenderer spectateEnemiesCeiling; private Collider[] ndcHitResults = (Collider[])(object)new Collider[50]; [Space] public AnimationCurve[] sharedAnimCurves; public const string searchableKeyCoinContainer = "Coin Container"; public const string searchableKeyBounceSurface = "BounceSurface"; public const string searchableKeyMoveToPoint = "Move To Point"; public const string searchableKeyHitbox = "Hitbox"; public const string searchableKeyHittableSpawner = "Hittable Spawner"; public const string searchableKeyLocalNetworkObject = "Local NetworkObject"; public const string searchableKeyEventMessenger = "Event Messenger"; public static QuickMenuManager escapeMenu; public static AudioSource eclipseMusic; private static string tempBarPrint; [HideInInspector] public Vector3 localCameraPosition; [HideInInspector] public bool localCameraInFactory; [HideInInspector] public bool localCameraInShip; private PlayerControllerB tempPlayer; public static float normalizedTimeFloodHits; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; SubscribeToGeneralEvents(); } private void Start() { ((MonoBehaviour)this).StartCoroutine(SetUpOnSceneLoad()); } private void Update() { if ((Object)(object)localPlayer == (Object)null) { GetLocalPlayerControllerB(); return; } CheckHitGround(); CheckHitCeiling(); GetLocalCameraInside(); } public void SubscribeToGeneralEvents() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown onHitGroundEvent.AddListener((UnityAction)GetGroundEventContainer); onHitCeilingEvent.AddListener((UnityAction)GetCeilingEventContainer); if ((Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.onTimeSync != null) { TimeOfDay.Instance.onTimeSync.AddListener(new UnityAction(SetVolumeMultiplierBGM)); } } private void GetGroundEventContainer(Collider hitCollider) { if (!((Object)(object)hitCollider == (Object)null)) { LocalPlayerHitSurface component = ((Component)hitCollider).GetComponent(); if (!((Object)(object)component == (Object)null) && component.isFloor) { component.LocallyHitThisSurface(); } } } private void GetCeilingEventContainer(Collider hitCollider) { if (!((Object)(object)hitCollider == (Object)null)) { LocalPlayerHitSurface component = ((Component)hitCollider).GetComponent(); if (!((Object)(object)component == (Object)null) && !component.isFloor) { component.LocallyHitThisSurface(); } } } public static void GetLocalPlayerControllerB() { if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController != (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController.thisController != (Object)null) { localPlayer = StartOfRound.Instance.localPlayerController; localPlayerID = (int)localPlayer.playerClientId; localPlayerServer = localPlayer.isHostPlayerObject; Logger.LogInfo((object)$"NewDonkCityManager got localPlayer {localPlayer} with localPlayerID {localPlayerID} and localPlayerServer {localPlayerServer}"); } } private void CheckHitGround() { //IL_0044: 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) if (localPlayer.isPlayerControlled && newHitGroundLocal != localPlayer.thisController.isGrounded) { newHitGroundLocal = localPlayer.thisController.isGrounded; if (newHitGroundLocal) { CallHitGroundEvent(); } } } public bool CallHitGroundEvent(Vector3 direction = default(Vector3)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0016: Unknown result type (might be due to invalid IL or missing references) if (direction == default(Vector3)) { direction = Vector3.down; } Collider hitCollider = GetHitCollider(3.33f, direction); if ((Object)(object)hitCollider != (Object)null) { onHitGroundEvent.Invoke(hitCollider); return true; } return false; } private void CheckHitCeiling() { //IL_0061: 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_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) if (localPlayer.isPlayerControlled && !localPlayer.thisController.isGrounded) { if (lastPlayerVelocityY > 5f && localPlayer.thisController.velocity.y <= 2.5f) { CallHitCeilingEvent(); } lastPlayerVelocityY = localPlayer.thisController.velocity.y; } } public bool CallHitCeilingEvent(Vector3 direction = default(Vector3)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0016: Unknown result type (might be due to invalid IL or missing references) if (direction == default(Vector3)) { direction = Vector3.up; } Collider hitCollider = GetHitCollider(0.5f, direction); if ((Object)(object)hitCollider != (Object)null) { onHitCeilingEvent.Invoke(hitCollider); return true; } return false; } private Collider GetHitCollider(float verticalDistance, Vector3 direction) { //IL_0009: 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_001f: 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_0049: 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_0062: 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_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_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_00b6: 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) //IL_00e1: 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_010a: 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_0114: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01d0: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[9] { Vector3.zero, ((Component)localPlayer).transform.forward * localPlayer.thisController.radius, ((Component)localPlayer).transform.forward * localPlayer.thisController.radius, ((Component)localPlayer).transform.right * localPlayer.thisController.radius, ((Component)localPlayer).transform.right * localPlayer.thisController.radius, ((Component)localPlayer).transform.forward * (localPlayer.thisController.radius * 0.33f) + ((Component)localPlayer).transform.right * (localPlayer.thisController.radius * 0.33f), ((Component)localPlayer).transform.forward * (localPlayer.thisController.radius * 0.33f) + ((Component)localPlayer).transform.right * (localPlayer.thisController.radius * -0.33f), ((Component)localPlayer).transform.forward * (localPlayer.thisController.radius * -0.33f) + ((Component)localPlayer).transform.right * (localPlayer.thisController.radius * 0.33f), ((Component)localPlayer).transform.forward * (localPlayer.thisController.radius * -0.33f) + ((Component)localPlayer).transform.right * (localPlayer.thisController.radius * -0.33f) }; RaycastHit val = default(RaycastHit); for (int i = 0; i < array.Length; i++) { if (Physics.Raycast(localPlayer.playerEye.position + array[i], direction, ref val, Mathf.Abs(verticalDistance), LayerMask.op_Implicit(ndcHitMask), (QueryTriggerInteraction)1) && !((Object)(object)((RaycastHit)(ref val)).collider == (Object)null)) { return ((RaycastHit)(ref val)).collider; } } return null; } private void SetVolumeMultiplierBGM() { if (BGMVolumeScale != null && !((Object)(object)SongsManager.Instance == (Object)null)) { SongsManager.Instance.SetGlobalVolumeMultiplier("NewDonkCityManager SetVolumeMutiplierBGM", BGMVolumeScale.Evaluate(TimeOfDay.Instance.normalizedTimeOfDay)); } } private IEnumerator SetUpOnSceneLoad() { yield return (object)new WaitUntil((Func)(() => (Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.currentDayTimeStarted)); yield return null; OnSceneLoad(); yield return (object)new WaitForSeconds(2f); OnDelay(); } private void OnSceneLoad() { escapeMenu = Object.FindObjectOfType(); EclipseWeather val = Object.FindObjectOfType(false); if ((Object)(object)val != (Object)null) { eclipseMusic = ((Component)val).GetComponentInChildren(); } if ((Object)(object)PropsManager.Instance != (Object)null) { PropsManager.Instance.OnSceneLoadServer(); } } private void OnDelay() { GiveEntrancesAudio(); SyncPropsOnStart(); if ((Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.onTimeSync != null) { SetVolumeMultiplierBGM(); } } private void GiveEntrancesAudio() { EntranceTeleport[] array = Object.FindObjectsByType((FindObjectsSortMode)0); List list = new List(); foreach (EntranceTeleport val in array) { if ((Object)(object)val == (Object)null || val.doorAudios == null || val.doorAudios.Length == 0 || entrancesToSetUp.Contains(val)) { continue; } AudioClip[] doorAudios = val.doorAudios; foreach (AudioClip val2 in doorAudios) { if (!list.Contains(val2)) { list.Add(val2); if (Application.isEditor) { Logger.LogDebug((object)$"entrance {val} adding clip {val2}"); } } } } for (int k = 0; k < entrancesToSetUp.Count; k++) { EntranceTeleport val3 = entrancesToSetUp[k]; if (!((Object)(object)val3 == (Object)null) && list != null && list.Count > 0) { val3.doorAudios = list.ToArray(); } } } public static void ReceiveAssetReceiverAssets(IAssetReceiver script, AudioClip[] assets, int switchCase, bool checkBox) { if (script != null && assets != null && assets.Length != 0 && switchCase == 0) { AddSoundsToSoundManager(script, assets, checkBox); } } private static void AddSoundsToSoundManager(IAssetReceiver script, AudioClip[] clips, bool allowDuplicates) { if ((Object)(object)SoundManager.Instance == (Object)null || SoundManager.Instance.syncedAudioClips == null) { return; } List list = new List(); List list2 = SoundManager.Instance.syncedAudioClips.ToList(); for (int i = 0; i < clips.Length; i++) { if (allowDuplicates || !list2.Contains(clips[i])) { if (Application.isEditor) { Logger.LogDebug((object)$"ADDING {clips[i]} to {SoundManager.Instance} at index {list2.Count}"); } list.Add(list2.Count); list2.Add(clips[i]); continue; } for (int j = 0; j < SoundManager.Instance.syncedAudioClips.Length; j++) { if ((Object)(object)clips[i] == (Object)(object)SoundManager.Instance.syncedAudioClips[j]) { if (Application.isEditor) { Logger.LogDebug((object)$"FOUND {clips[i]} on {SoundManager.Instance} at index {j}"); } list.Add(j); break; } } } SoundManager.Instance.syncedAudioClips = list2.ToArray(); script.ReceiveIntegers(list.ToArray()); } private void SyncPropsOnStart() { if (!((Object)(object)PropsManager.Instance == (Object)null)) { PropsManager.Instance.OnLoadDelayServer(); PropsManager.Instance.SetSitAnimations(); PropsManager.Instance.RemoveAlreadyCollectedCoins(); } } public static GameObject SearchPhysicsComponentAtPosition(Vector3 scriptPosition, string searchForKey, float searchDistance = 5f, bool logResults = false) { //IL_005d: 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_00dd: 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) if ((Object)(object)Instance == (Object)null || Instance.ndcHitResults == null) { if (logResults && Application.isEditor) { Logger.LogDebug((object)"SearchPhysicsComponentAtPosition(): fail 1"); } return null; } for (int i = 0; i < Instance.ndcHitResults.Length; i++) { Instance.ndcHitResults[i] = null; } if (Physics.OverlapSphereNonAlloc(scriptPosition, searchDistance, Instance.ndcHitResults, LayerMask.op_Implicit(Instance.ndcHitMask), (QueryTriggerInteraction)2) == 0) { if (logResults && Application.isEditor) { Logger.LogDebug((object)"SearchPhysicsComponentAtPosition(): fail 2"); } return null; } float num = 999f; float num2 = 1000f; GameObject val = null; IPhysicsSearchable[] array = null; for (int j = 0; j < Instance.ndcHitResults.Length; j++) { if ((Object)(object)Instance.ndcHitResults[j] == (Object)null) { continue; } num2 = Vector3.Distance(((Component)Instance.ndcHitResults[j]).transform.position, scriptPosition); if (num2 < num) { array = ((Component)Instance.ndcHitResults[j]).GetComponents(); if (array == null || array.Length == 0) { continue; } for (int k = 0; k < array.Length; k++) { if (array[k] != null && array[k].keyName == searchForKey) { num = num2; val = ((Component)Instance.ndcHitResults[j]).gameObject; } } } if (num == 0f && (Object)(object)val != (Object)null) { break; } } if (logResults && Application.isEditor) { Logger.LogInfo((object)$"SearchPhysicsComponentAtPosition(): {val}"); } return val; } public static void SearchPhysicsComponentAtPositionAndCallEvent(Vector3 scriptPosition, string searchForKey, PlayerControllerB calledBy, int specialID, GameObject linkedObject, float searchDistance, bool logResults) { //IL_005d: 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_00db: 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) if ((Object)(object)Instance == (Object)null || Instance.ndcHitResults == null) { if (logResults && Application.isEditor) { Logger.LogDebug((object)"SearchPhysicsComponentAtPositionAndCallEvent(): fail 1"); } return; } for (int i = 0; i < Instance.ndcHitResults.Length; i++) { Instance.ndcHitResults[i] = null; } if (Physics.OverlapSphereNonAlloc(scriptPosition, searchDistance, Instance.ndcHitResults, LayerMask.op_Implicit(Instance.ndcHitMask), (QueryTriggerInteraction)2) == 0) { if (logResults && Application.isEditor) { Logger.LogDebug((object)"SearchPhysicsComponentAtPositionAndCallEvent(): fail 2"); } return; } float num = 999f; float num2 = 1000f; IPhysicsSearchable physicsSearchable = null; IPhysicsSearchable[] array = null; for (int j = 0; j < Instance.ndcHitResults.Length; j++) { if ((Object)(object)Instance.ndcHitResults[j] == (Object)null) { continue; } num2 = Vector3.Distance(((Component)Instance.ndcHitResults[j]).transform.position, scriptPosition); if (num2 < num) { array = ((Component)Instance.ndcHitResults[j]).GetComponents(); if (array == null || array.Length == 0) { continue; } for (int k = 0; k < array.Length; k++) { if (array[k] != null && array[k].keyName == searchForKey) { num = num2; physicsSearchable = array[k]; } } } if (num == 0f && physicsSearchable != null) { break; } } if (logResults && Application.isEditor) { Logger.LogInfo((object)$"SearchPhysicsComponentAtPositionAndCallEvent(): {physicsSearchable}"); } physicsSearchable?.CallNetworkedMonoBehaviourEvent(calledBy, specialID, linkedObject); } public static float GetTotalLengthOfMoveToPoint(MoveToPoint startingPoint) { float num = 0f; if ((Object)(object)startingPoint == (Object)null) { return num; } List list = new List(); MoveToPoint moveToPoint = startingPoint; bool flag = false; while (!flag && !((Object)(object)moveToPoint == (Object)null)) { num += moveToPoint.delayBeforeMoving + moveToPoint.moveOverTime; list.Add(moveToPoint); MoveToPoint nextPoint = GetNextPoint(moveToPoint, list); if ((Object)(object)nextPoint != (Object)null) { moveToPoint = nextPoint; } else { flag = true; } } return num; } private static MoveToPoint GetNextPoint(MoveToPoint fromPoint, List pointsHad) { if ((Object)(object)fromPoint == (Object)null || (Object)(object)fromPoint.passOntoNextPoint == (Object)null || pointsHad == null || pointsHad.Contains(fromPoint.passOntoNextPoint)) { return null; } return fromPoint.passOntoNextPoint; } public static PlayerControllerB GetPlayerWithID(int playerID) { if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.allPlayerScripts != null && playerID >= 0 && playerID < StartOfRound.Instance.allPlayerScripts.Length) { return StartOfRound.Instance.allPlayerScripts[playerID]; } return null; } public static int GetIDWithPlayer(PlayerControllerB player) { if ((Object)(object)player != (Object)null) { return (int)player.playerClientId; } return -1; } public static void DestroyItemMultiple(GrabbableObject[] items, bool despawnNetworkObjects = false, bool printDebug = false) { if (items == null || items.Length == 0) { return; } for (int num = items.Length - 1; num >= 0; num--) { if (!((Object)(object)items[num] == (Object)null)) { DestroyItem(items[num], (despawnNetworkObjects && (Object)(object)((NetworkBehaviour)items[num]).NetworkObject != (Object)null && ((NetworkBehaviour)items[num]).NetworkObject.IsSpawned) ? ((NetworkBehaviour)items[num]).NetworkObject : null, printDebug); } } } public static void DestroyItem(GrabbableObject item, NetworkObject despawnNetworkObject = null, bool printDebug = false) { if (printDebug && Application.isEditor) { Logger.LogInfo((object)$"DestroyItem(): {item}"); } if ((Object)(object)item == (Object)null) { return; } if (printDebug && Application.isEditor) { Logger.LogDebug((object)$"playerHeldBy = {item.playerHeldBy}"); } if ((Object)(object)item.playerHeldBy != (Object)null) { if ((Object)(object)item.playerHeldBy.currentlyHeldObjectServer == (Object)(object)item) { if (printDebug && Application.isEditor) { Logger.LogDebug((object)"DestroyObjectInHand()"); } item.DestroyObjectInHand(item.playerHeldBy); return; } int num = -1; if ((Object)(object)item.playerHeldBy.ItemOnlySlot == (Object)(object)item) { num = 50; } else { for (int i = 0; i < item.playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)item.playerHeldBy.ItemSlots[i] == (Object)(object)item) { num = i; break; } } } if (printDebug && Application.isEditor) { Logger.LogDebug((object)$"removeFromSlot: {num}"); } if (num != -1) { if (num == 50) { item.playerHeldBy.ItemOnlySlot = null; } else { item.playerHeldBy.ItemSlots[num] = null; } if ((Object)(object)item.playerHeldBy == (Object)(object)localPlayer) { if (num == 50) { ((Behaviour)HUDManager.Instance.itemOnlySlotIcon).enabled = false; } else { ((Behaviour)HUDManager.Instance.itemSlotIcons[num]).enabled = false; } } } item.playerHeldBy.carryWeight = Mathf.Clamp(item.playerHeldBy.carryWeight - (item.itemProperties.weight - 1f), 1f, 10f); StartOfRound.Instance.SendChangedWeightEvent(); item.playerHeldBy = null; } item.deactivated = true; item.itemUsedUp = true; item.isHeld = false; item.isHeldByEnemy = false; item.isPocketed = false; item.isBeingUsed = false; item.fallTime = 1f; item.hasHitGround = true; item.reachedFloorTarget = true; item.grabbable = false; item.grabbableToEnemies = false; item.parentObject = null; Renderer[] componentsInChildren = ((Component)item).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { Object.Destroy((Object)(object)componentsInChildren[j]); } Collider[] componentsInChildren2 = ((Component)item).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren2.Length; k++) { Object.Destroy((Object)(object)componentsInChildren2[k]); } AudioSource[] componentsInChildren3 = ((Component)item).GetComponentsInChildren(); for (int l = 0; l < componentsInChildren3.Length; l++) { Object.Destroy((Object)(object)componentsInChildren3[l]); } if (HoarderBugAI.grabbableObjectsInMap != null && HoarderBugAI.grabbableObjectsInMap.Contains(((Component)item).gameObject)) { HoarderBugAI.grabbableObjectsInMap.Remove(((Component)item).gameObject); } if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.scrapDroppedInShip != null && RoundManager.Instance.scrapDroppedInShip.Contains(item)) { RoundManager.Instance.scrapDroppedInShip.Remove(item); } StormyWeather stormWeather = GetStormWeather(); if ((Object)(object)stormWeather != (Object)null && stormWeather.metalObjects != null && stormWeather.metalObjects.Contains(item)) { stormWeather.metalObjects.Remove(item); } if ((Object)(object)item.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)item.radarIcon).gameObject); } if ((Object)(object)despawnNetworkObject != (Object)null && (Object)(object)Instance != (Object)null && localPlayerServer) { if (printDebug && Application.isEditor) { Logger.LogDebug((object)$"NetworkObject: {despawnNetworkObject}"); } ((MonoBehaviour)Instance).StartCoroutine(Instance.DespawnNetworkObjectOnDelay(despawnNetworkObject, 3.33f)); } } private IEnumerator DespawnNetworkObjectOnDelay(NetworkObject netObj, float delay) { if (localPlayerServer && !((Object)(object)netObj == (Object)null)) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)netObj != (Object)null) { netObj.Despawn(true); } } } public static void AddForceToPlayerBody(PlayerControllerB player, Vector3 force, bool addToExistingForce = true, bool resetFallValue = true) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //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_0030: 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_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_0046: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)localPlayer)) { if (resetFallValue) { player.ResetFallGravity(); } if (addToExistingForce) { player.externalForceAutoFade += new Vector3(force.x, force.y, force.z); } else { player.externalForceAutoFade = new Vector3(force.x, force.y, force.z); } } } public static AnimationCurve GetAnimationCurve(int atIndex) { if ((Object)(object)Instance == (Object)null || Instance.sharedAnimCurves == null || Instance.sharedAnimCurves.Length == 0 || atIndex < 0 || atIndex >= Instance.sharedAnimCurves.Length) { return null; } return Instance.sharedAnimCurves[atIndex]; } public static bool GetAnimationCurveNonAlloc(int atIndex) { if ((Object)(object)Instance == (Object)null || Instance.sharedAnimCurves == null || Instance.sharedAnimCurves.Length == 0 || atIndex < 0 || atIndex >= Instance.sharedAnimCurves.Length) { return false; } return true; } public static string PrintPercentageAsBar(float currentValue, float maxValue, int progressAmounts = 10) { tempBarPrint = string.Empty; for (int i = 0; i < 100; i += 100 / progressAmounts) { if ((float)i < 100f * currentValue / maxValue) { tempBarPrint += "|"; } else { tempBarPrint += " "; } } return "[" + tempBarPrint + "]"; } public static StormyWeather GetStormWeather() { StormyWeather val = null; if ((Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.effects != null) { for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++) { if (TimeOfDay.Instance.effects[i] != null && (Object)(object)TimeOfDay.Instance.effects[i].effectPermanentObject != (Object)null) { val = TimeOfDay.Instance.effects[i].effectPermanentObject.GetComponent(); if ((Object)(object)val != (Object)null) { break; } } } } return val; } public static Vector3 GetForwardToPosition(Transform fromTransform, Vector3 toPosition, bool matchX = false, bool matchY = false, bool matchZ = false) { //IL_0009: 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_004f: 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_0065: 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_007c: 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_0082: 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_00a6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fromTransform == (Object)null) { return Vector3.zero; } if ((Object)(object)RoundManager.Instance == (Object)null || (Object)(object)RoundManager.Instance.tempTransform == (Object)null) { return fromTransform.forward; } RoundManager.Instance.tempTransform.position = new Vector3(matchX ? toPosition.x : fromTransform.position.x, matchY ? toPosition.y : fromTransform.position.y, matchZ ? toPosition.z : fromTransform.position.z); RoundManager.Instance.tempTransform.LookAt(toPosition); return RoundManager.Instance.tempTransform.forward; } public static Vector3 GetRotationToPosition(Transform fromTransform, Vector3 toPosition, bool matchX = false, bool matchY = false, bool matchZ = false) { //IL_0009: 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_004f: 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_0065: 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_007c: 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_0082: 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_00a6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fromTransform == (Object)null) { return Vector3.zero; } if ((Object)(object)RoundManager.Instance == (Object)null || (Object)(object)RoundManager.Instance.tempTransform == (Object)null) { return fromTransform.forward; } RoundManager.Instance.tempTransform.position = new Vector3(matchX ? toPosition.x : fromTransform.position.x, matchY ? toPosition.y : fromTransform.position.y, matchZ ? toPosition.z : fromTransform.position.z); RoundManager.Instance.tempTransform.LookAt(toPosition); return RoundManager.Instance.tempTransform.eulerAngles; } private void GetLocalCameraInside() { //IL_008e: 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_00be: 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_00c7: 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) tempPlayer = localPlayer; if (!tempPlayer.isPlayerControlled) { tempPlayer = tempPlayer.spectatedPlayerScript; } if ((Object)(object)tempPlayer != (Object)null && tempPlayer.isPlayerControlled) { localCameraPosition = ((Component)tempPlayer).transform.position; localCameraInFactory = tempPlayer.isInsideFactory; localCameraInShip = tempPlayer.isInHangarShipRoom; } else { localCameraPosition = ((Component)StartOfRound.Instance.activeCamera).transform.position; localCameraInFactory = localCameraPosition.y <= -80f; Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; localCameraInShip = ((Bounds)(ref bounds)).Contains(localCameraPosition); } if ((Object)(object)spectateEnemiesCeiling != (Object)null && ((Renderer)spectateEnemiesCeiling).enabled != localCameraInFactory) { ((Renderer)spectateEnemiesCeiling).enabled = localCameraInFactory; } } public static void SetParameterScrapSpawn(float multiplierMin = 1f, float multiplierMax = 1f, bool mustBeServer = true) { if (!mustBeServer || localPlayerServer) { Plugin.ndcSelectableLevel.minScrap = (int)((float)Plugin.ndcAllAssets.baseMinScrap * multiplierMin); Plugin.ndcSelectableLevel.maxScrap = (int)((float)Plugin.ndcAllAssets.baseMaxScrap * multiplierMax); if (Application.isEditor) { Logger.LogDebug((object)$"SetParameterScrapSpawn({multiplierMin}, {multiplierMax}): {Plugin.ndcSelectableLevel.minScrap} --> {Plugin.ndcSelectableLevel.maxScrap}"); } } } public static void SetParameterSizeMultiplier(float multiplier = 1f, bool mustbeServer = true) { if (!mustbeServer || localPlayerServer) { Plugin.ndcSelectableLevel.factorySizeMultiplier = Plugin.ndcAllAssets.baseSizeMultiplier * multiplier; if (Application.isEditor) { Logger.LogDebug((object)$"SetParameterSizeMultiplier({multiplier}): {Plugin.ndcSelectableLevel.factorySizeMultiplier}"); } } } private void OnDisable() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown ((UnityEventBase)onHitGroundEvent).RemoveAllListeners(); ((UnityEventBase)onHitCeilingEvent).RemoveAllListeners(); if ((Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.onTimeSync != null) { TimeOfDay.Instance.onTimeSync.RemoveListener(new UnityAction(SetVolumeMultiplierBGM)); } if ((Object)(object)SongsManager.Instance != (Object)null) { SongsManager.Instance.RemoveGlobalVolumeMultiplier("NewDonkCityManager SetVolumeMutiplierBGM"); } } } public class NPCManager : NetworkBehaviour { private static ManualLogSource Logger; public static NPCManager Instance; [Header("Spawning")] public NPCData[] allNPC; public MaterialArray[] allNPCMaterials; private List spawnedNPCs; private float greetPlayerTimer; private int greetIdPlayer; private int greetIdNPC; public Transform nodesContainer; private List allActiveNodes; private float syncNpcTimer; private List syncNpcIndeces; private List syncNpcPositions; private List syncNpcRotations; [Space(3f)] [Header("Audiovisual")] public AudioSource ambience; public AnimationCurve ambienceVolumeNpcCount; private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public void OnLoadDelay() { SpawnNPCsAtStartOfDay(); } private void SpawnNPCsAtStartOfDay() { if (((NetworkBehaviour)this).IsServer && !((Object)(object)AestheticsManager.Instance == (Object)null) && !((Object)(object)AestheticsManager.Instance.todaysAesthetics == (Object)null) && AestheticsManager.Instance.todaysAesthetics.maxSpawnCountNPC > 0) { allActiveNodes = ((Component)nodesContainer).GetComponentsInChildren(false).ToList(); if (allActiveNodes != null && allActiveNodes.Count != 0) { ((MonoBehaviour)this).StartCoroutine(SpawnNPCs()); } } } private IEnumerator SpawnNPCs() { List unoccupiedNodes = new List(); unoccupiedNodes.AddRange(allActiveNodes); if (unoccupiedNodes == null || unoccupiedNodes.Count == 0) { yield break; } spawnedNPCs = new List(); syncNpcIndeces = new List(); syncNpcPositions = new List(); syncNpcRotations = new List(); for (int i = 0; i < allNPC.Length; i++) { NPCData nPCData = allNPC[i]; if (!((Object)(object)nPCData == (Object)null)) { nPCData.numberSpawned = 0; } } if (Application.isEditor) { Logger.LogDebug((object)$"start spawning NPCs: {AestheticsManager.Instance.todaysAesthetics.maxSpawnCountNPC}"); } int j = unoccupiedNodes.Count - 1; while (j >= 0 && unoccupiedNodes.Count > 0 && spawnedNPCs.Count < AestheticsManager.Instance.todaysAesthetics.maxSpawnCountNPC) { NPCNode thisNode = unoccupiedNodes[j]; if (!((Object)(object)thisNode == (Object)null) && !((Object)(object)thisNode.spawnNPC == (Object)null)) { yield return (object)new WaitForSeconds(0.15f); SpawnNPCAtLocation(thisNode, thisNode.spawnNPC, thisNode.spawnNPCMaterial); unoccupiedNodes.Remove(thisNode); } j--; } int attempts = 0; while (spawnedNPCs.Count < AestheticsManager.Instance.todaysAesthetics.maxSpawnCountNPC && unoccupiedNodes.Count > 0 && attempts < 99) { yield return (object)new WaitForSeconds(0.15f); attempts++; NPCNode nPCNode = unoccupiedNodes[Random.Range(0, unoccupiedNodes.Count)]; SpawnNPCAtLocation(nPCNode); unoccupiedNodes.Remove(nPCNode); } if (spawnedNPCs.Count > 0 && (Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.onHourChanged != null) { TimeOfDay.Instance.onHourChanged.AddListener(new UnityAction(TellNPCsToLeaveStopNode)); } GetGreetingTimer(); } private void SpawnNPCAtLocation(NPCNode node, NPCData npcToSpawn = null, MaterialArray npcMaterials = null) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0083: 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_0099: 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_0076: 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_011d: 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_0139: 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) if (!((NetworkBehaviour)this).IsServer || (Object)(object)RoundManager.Instance == (Object)null) { return; } if ((Object)(object)npcToSpawn == (Object)null) { npcToSpawn = GetRandomNPC(); } if ((Object)(object)npcToSpawn == (Object)null || (Object)(object)npcToSpawn.npcEnemyType == (Object)null) { return; } Vector3 position = node.aiNode.position; if (NavMesh.SamplePosition(position, ref RoundManager.Instance.navHit, 10f, 11613)) { position = ((NavMeshHit)(ref RoundManager.Instance.navHit)).position; } NetworkObjectReference npcNOR = RoundManager.Instance.SpawnEnemyGameObject(position, ((Component)node).transform.rotation.y, 0, npcToSpawn.npcEnemyType); NetworkObject val = default(NetworkObject); if (!((NetworkObjectReference)(ref npcNOR)).TryGet(ref val, (NetworkManager)null)) { return; } NPCEnemyAI component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)((EnemyAI)component).enemyType == (Object)null)) { npcToSpawn.numberSpawned++; RoundManager instance = RoundManager.Instance; instance.currentDaytimeEnemyPower += ((EnemyAI)component).enemyType.PowerLevel; int nPCMaterialArray = GetNPCMaterialArray(npcToSpawn, npcMaterials); int nPCNodeAnimation = GetNPCNodeAnimation(node); OnLocalSpawnNPC(component, ((Component)node.aiNode).transform.position, ((Component)node).transform.eulerAngles, nPCNodeAnimation, nPCMaterialArray, node); SyncSpawnNPCAtLocationClientRpc(npcNOR, ((Component)node.aiNode).transform.position, ((Component)node).transform.eulerAngles, nPCNodeAnimation, nPCMaterialArray); if ((Object)(object)node.usesInteractable != (Object)null) { NPCReserveInteractable(node.usesInteractable, component, setReservedTo: true); } SetNPCTargetNode(component, node); } } private NPCData GetRandomNPC() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (allNPC == null || allNPC.Length == 0) { return null; } int num = 0; for (int i = 0; i < allNPC.Length; i++) { NPCData nPCData = allNPC[i]; if (!((Object)(object)nPCData == (Object)null) && nPCData.numberSpawned < nPCData.maxSpawnCount && (nPCData.cannotSpawnIn == null || nPCData.cannotSpawnIn.Count <= 0 || !((Object)(object)TimeOfDay.Instance != (Object)null) || !nPCData.cannotSpawnIn.Contains(TimeOfDay.Instance.currentLevelWeather))) { num += nPCData.chanceToSpawn; } } int num2 = Random.Range(0, num); int num3 = 0; for (int j = 0; j < allNPC.Length; j++) { NPCData nPCData2 = allNPC[j]; if (!((Object)(object)nPCData2 == (Object)null)) { if (nPCData2.numberSpawned < nPCData2.maxSpawnCount) { num3 += nPCData2.chanceToSpawn; } if (num3 > num2) { return nPCData2; } } } return null; } private int GetNPCMaterialArray(NPCData data, MaterialArray randomArray = null) { if ((Object)(object)data == (Object)null || data.randomMats == null || data.randomMats.Length == 0) { return 0; } if ((Object)(object)randomArray == (Object)null) { randomArray = data.randomMats[Random.Range(0, data.randomMats.Length)]; } if ((Object)(object)randomArray == (Object)null || randomArray.materials == null || randomArray.materials.Length == 0) { return 0; } for (int i = 0; i < allNPCMaterials.Length; i++) { if ((Object)(object)allNPCMaterials[i] == (Object)(object)randomArray) { return i; } } return 0; } [ClientRpc] private void SyncSpawnNPCAtLocationClientRpc(NetworkObjectReference npcNOR, Vector3 spawnPos, Vector3 spawnRot, int animIndex, int randomMatIndex) { //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_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_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) //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) 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(4177991691u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref npcNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref spawnPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref spawnRot); BytePacker.WriteValueBitPacked(val, animIndex); BytePacker.WriteValueBitPacked(val, randomMatIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4177991691u, 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 (!((NetworkBehaviour)this).IsServer && ((NetworkObjectReference)(ref npcNOR)).TryGet(ref val3, (NetworkManager)null)) { NPCEnemyAI component = ((Component)val3).GetComponent(); if (!((Object)(object)component == (Object)null)) { OnLocalSpawnNPC(component, spawnPos, spawnRot, animIndex, randomMatIndex); } } } private void OnLocalSpawnNPC(NPCEnemyAI npc, Vector3 spawnPos, Vector3 spawnRot, int animIndex, int randomMatIndex, NPCNode interactWithNode = null) { //IL_004b: 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) if (!((Object)(object)npc == (Object)null)) { if (spawnedNPCs == null || spawnedNPCs.Count == 0) { spawnedNPCs = new List(); } spawnedNPCs.Add(npc); ((EnemyAI)npc).previousBehaviourStateIndex = spawnedNPCs.Count - 1; SyncNPCTransformLocal(npc, spawnPos, spawnRot, snapTo: true); SyncNPCAnimationLocal(npc, animIndex); SkinnedMeshRenderer componentInChildren = ((Component)npc).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && randomMatIndex >= 0 && randomMatIndex < allNPCMaterials.Length) { ((Renderer)componentInChildren).materials = allNPCMaterials[randomMatIndex].materials; } if ((Object)(object)interactWithNode != (Object)null) { NodeInteractWithNPC(npc, interactWithNode); } } } private void SetNPCTargetNode(NPCEnemyAI npc, NPCNode node) { if (((NetworkBehaviour)this).IsServer && !((Object)(object)npc == (Object)null) && !((Object)(object)node == (Object)null)) { ((EnemyAI)npc).favoriteSpot = ((EnemyAI)npc).targetNode; ((EnemyAI)npc).targetNode = ((Component)node).transform; } } private void TellNPCsToLeaveStopNode() { if (spawnedNPCs == null && spawnedNPCs.Count == 0) { return; } for (int i = 0; i < spawnedNPCs.Count; i++) { NPCEnemyAI nPCEnemyAI = spawnedNPCs[i]; if ((Object)(object)nPCEnemyAI == (Object)null) { continue; } NPCAnimation currentBehaviourStateIndex = (NPCAnimation)((EnemyAI)nPCEnemyAI).currentBehaviourStateIndex; if (currentBehaviourStateIndex.ToString().Contains("Walking")) { continue; } currentBehaviourStateIndex = (NPCAnimation)((EnemyAI)nPCEnemyAI).currentBehaviourStateIndex; if (currentBehaviourStateIndex.ToString().Contains("Cheer")) { continue; } NPCNode nPCNode = null; bool nodeLocksNPC = false; if ((Object)(object)((EnemyAI)nPCEnemyAI).targetNode != (Object)null) { nPCNode = ((Component)((EnemyAI)nPCEnemyAI).targetNode).GetComponent(); if ((Object)(object)nPCNode != (Object)null) { nodeLocksNPC = nPCNode.lockNPC; } } if (GetConditionToLeave(forExit: false, 2, nodeLocksNPC)) { if ((Object)(object)nPCNode == (Object)null) { nPCNode = allActiveNodes[Random.Range(0, allActiveNodes.Count)]; } SearchNewDestinationForNPC(nPCEnemyAI, nPCNode, forceSearchNonExit: false, NPCAnimation.Walking1, wasOccupyingNode: true); } } } private bool GetConditionToLeave(bool forExit = true, int randomOneIn = 0, bool nodeLocksNPC = false) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 if (!nodeLocksNPC && !forExit && randomOneIn > 0 && Random.Range(0, randomOneIn) == 0) { return true; } if (forExit && Random.Range(0, 128) == 0) { return true; } if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.currentOutsideEnemyPower > 0f) { return true; } if ((Object)(object)TimeOfDay.Instance != (Object)null) { if ((int)TimeOfDay.Instance.currentLevelWeather == 4 && TimeOfDay.Instance.normalizedTimeOfDay > 0.45f) { return true; } if ((Object)(object)TimeOfDay.Instance.MeteorWeather != (Object)null && TimeOfDay.Instance.MeteorWeather.meteorsEnabled) { return true; } } return false; } public void NodeInteractWithNPC(NPCEnemyAI npc, NPCNode node) { if (!((NetworkBehaviour)this).IsServer || (Object)(object)npc == (Object)null || (Object)(object)node == (Object)null || node.animationStrings == null || node.animationStrings.Count == 0) { return; } if (node.isExit && ((EnemyAI)npc).daytimeEnemyLeaving) { if (Application.isEditor) { Logger.LogWarning((object)$"Despawn: A (isExit? {node.isExit} // daytimeEnemyLeaving? {((EnemyAI)npc).daytimeEnemyLeaving})"); } DespawnNPC(npc); return; } NPCAnimation nPCAnimation = (NPCAnimation)GetNPCNodeAnimation(node); if ((nPCAnimation.ToString().Contains("Idle") || nPCAnimation.ToString().Contains("Sitting")) && !NodeInteractionStop(npc, node)) { nPCAnimation = NPCAnimation.Walking1; } if (nPCAnimation == NPCAnimation.Walking1) { NodeInteractionGo(npc, node); } SyncNPCAnimation(npc, nPCAnimation); } private void NodeInteractionGo(NPCEnemyAI npc, NPCNode node) { if (!((Object)(object)npc == (Object)null) && !((Object)(object)node == (Object)null)) { SearchNewDestinationForNPC(npc, node); } } private bool NodeInteractionStop(NPCEnemyAI npc, NPCNode node) { //IL_0031: 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) if ((Object)(object)npc == (Object)null || (Object)(object)node == (Object)null) { return false; } if (IsNodeOccupied(node, npc, checkInteractable: true, checkDistance: true)) { return false; } ((EnemyAI)npc).moveTowardsDestination = false; SyncNPCTransform(npc, node.aiNode.position, ((Component)node).transform.eulerAngles, snapTo: true, clearFromQueue: true); if ((Object)(object)node.usesInteractable != (Object)null && !node.usesInteractable.isPlayingSpecialAnimation && node.usesInteractable.interactable) { NPCReserveInteractable(node.usesInteractable, npc, setReservedTo: true); } return true; } private int GetNPCNodeAnimation(NPCNode node) { if ((Object)(object)node == (Object)null || node.animationStrings == null || node.animationStrings.Count == 0) { return 1; } int num = -1; int num2 = 0; while (num == -1 && num2 < 5) { num2++; num = RollForAnimationString(node.animationStrings.ToArray()); } if (num == -1) { return 1; } return num; } private int RollForAnimationString(NPCAnimation[] animStrings) { if (animStrings == null || animStrings.Length == 0) { return -1; } return (int)animStrings[Random.Range(0, animStrings.Length)]; } private bool IsNodeOccupied(NPCNode node, NPCEnemyAI npc, bool checkInteractable, bool checkDistance) { //IL_00f3: 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) if ((Object)(object)node == (Object)null || (Object)(object)npc == (Object)null) { return false; } if (checkInteractable && (Object)(object)node.usesInteractable != (Object)null && (node.usesInteractable.isPlayingSpecialAnimation || !node.usesInteractable.interactable)) { if (((EnemyAI)npc).nodesTempArray != null && ((EnemyAI)npc).nodesTempArray.Length == 1 && (Object)(object)((EnemyAI)npc).nodesTempArray[0] == (Object)(object)((Component)node.usesInteractable).gameObject) { return false; } return true; } if (checkDistance && node.animationStrings != null && node.animationStrings.Count > 0 && (node.animationStrings.Contains(NPCAnimation.Idle1) || node.animationStrings.Contains(NPCAnimation.Sitting1))) { if (spawnedNPCs == null || spawnedNPCs.Count == 0) { return true; } for (int i = 0; i < spawnedNPCs.Count; i++) { NPCEnemyAI nPCEnemyAI = spawnedNPCs[i]; if (!((Object)(object)nPCEnemyAI == (Object)null) && (!((Object)(object)npc != (Object)null) || !((Object)(object)npc == (Object)(object)nPCEnemyAI)) && Vector3.Distance(((EnemyAI)nPCEnemyAI).serverPosition, node.aiNode.position) < 0.25f) { return true; } } } return false; } public void SyncNPCAnimation(NPCEnemyAI npc, NPCAnimation anim) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !((Object)(object)npc == (Object)null) && ((NetworkBehaviour)npc).IsSpawned && ((EnemyAI)npc).currentBehaviourStateIndex != (int)anim) { SyncNPCAnimationLocal(npc, (int)anim); SyncNPCAnimationClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)npc).NetworkObject), (int)anim); } } [ClientRpc] private void SyncNPCAnimationClientRpc(NetworkObjectReference npcNOR, int animIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2022914645u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref npcNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, animIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2022914645u, 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 (!((NetworkBehaviour)this).IsServer && ((NetworkObjectReference)(ref npcNOR)).TryGet(ref val3, (NetworkManager)null)) { NPCEnemyAI component = ((Component)val3).GetComponent(); if (!((Object)(object)component == (Object)null)) { SyncNPCAnimationLocal(component, animIndex); } } } public void SyncNPCAnimationLocal(NPCEnemyAI npc, int animIndex) { //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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Invalid comparison between Unknown and I4 if ((Object)(object)npc == (Object)null || animIndex == -1) { return; } NPCAnimation anim = (NPCAnimation)animIndex; string text = anim.ToString(); AnimatorControllerParameter val = null; for (int i = 0; i < ((EnemyAI)npc).creatureAnimator.parameterCount; i++) { AnimatorControllerParameter parameter = ((EnemyAI)npc).creatureAnimator.GetParameter(i); if (parameter != null && parameter.name == text) { val = parameter; break; } } if (val == null) { return; } AnimatorControllerParameterType type = val.type; if ((int)type != 4) { if ((int)type == 9) { ((EnemyAI)npc).creatureAnimator.SetTrigger(text); } } else { for (int j = 0; j < ((EnemyAI)npc).creatureAnimator.parameterCount; j++) { AnimatorControllerParameter parameter2 = ((EnemyAI)npc).creatureAnimator.GetParameter(j); if (parameter2 != null && (int)parameter2.type == 4) { ((EnemyAI)npc).creatureAnimator.SetBool(parameter2.name, false); } } ((EnemyAI)npc).creatureAnimator.SetBool(text, true); ((EnemyAI)npc).currentBehaviourStateIndex = animIndex; } switch (GetAnimDisableUpdateCase(anim)) { case 0: ((EnemyAI)npc).timeSinceSpawn = 5f; break; case 1: ((EnemyAI)npc).timeSinceSpawn = 0f; ((EnemyAI)npc).updateDestinationInterval = ((EnemyAI)npc).AIIntervalTime; ((Behaviour)npc).enabled = true; break; } } private int GetAnimDisableUpdateCase(NPCAnimation anim) { if (anim.ToString().StartsWith("Walking")) { return 1; } if (anim.ToString().StartsWith("Idle") || anim.ToString().StartsWith("Sitting") || anim.ToString().StartsWith("Cheer")) { return 0; } return -1; } public void QueueUpNewNpcToSync(NPCEnemyAI npc, Vector3 pos, Vector3 rot) { //IL_0041: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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) if (!((NetworkBehaviour)this).IsServer || (Object)(object)npc == (Object)null || spawnedNPCs == null || spawnedNPCs.Count == 0 || syncNpcIndeces == null || syncNpcPositions == null || syncNpcRotations == null) { return; } SyncNPCTransformLocal(npc, pos, rot, snapTo: false); if (!syncNpcIndeces.Contains(((EnemyAI)npc).previousBehaviourStateIndex)) { syncNpcIndeces.Add(((EnemyAI)npc).previousBehaviourStateIndex); syncNpcPositions.Add(pos); syncNpcRotations.Add(rot); return; } int num = -1; for (int i = 0; i < syncNpcIndeces.Count; i++) { if (((EnemyAI)npc).previousBehaviourStateIndex == syncNpcIndeces[i]) { num = i; break; } } if (num != -1) { syncNpcPositions[num] = pos; syncNpcRotations[num] = rot; } } private void RemoveQueuedUpNpc(NPCEnemyAI npc) { if (!((NetworkBehaviour)this).IsServer || (Object)(object)npc == (Object)null || spawnedNPCs == null || spawnedNPCs.Count == 0 || syncNpcIndeces == null || syncNpcIndeces.Count == 0 || syncNpcPositions == null || syncNpcPositions.Count == 0 || syncNpcRotations == null || syncNpcRotations.Count == 0) { return; } int num = -1; for (int i = 0; i < syncNpcIndeces.Count; i++) { if (syncNpcIndeces[i] == ((EnemyAI)npc).previousBehaviourStateIndex) { num = i; break; } } if (num != -1) { syncNpcIndeces.RemoveAt(num); syncNpcPositions.RemoveAt(num); syncNpcRotations.RemoveAt(num); } } private void SendQueuedNPCsToSync() { if (((NetworkBehaviour)this).IsServer && syncNpcIndeces != null && syncNpcIndeces.Count != 0 && syncNpcPositions != null && syncNpcPositions.Count != 0 && syncNpcRotations != null && syncNpcRotations.Count != 0) { ReceiveQueuedNPCsToSyncClientRpc(syncNpcIndeces.ToArray(), syncNpcPositions.ToArray(), syncNpcRotations.ToArray()); syncNpcIndeces.Clear(); syncNpcPositions.Clear(); syncNpcRotations.Clear(); } } [ClientRpc] private void ReceiveQueuedNPCsToSyncClientRpc(int[] npcIndeces, Vector3[] npcPositions, Vector3[] npcRotations) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_01db: 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) 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(839027760u, val2, (RpcDelivery)0); bool flag = npcIndeces != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(npcIndeces, default(ForPrimitives)); } bool flag2 = npcPositions != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(npcPositions); } bool flag3 = npcRotations != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(npcRotations); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 839027760u, 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 || spawnedNPCs == null || spawnedNPCs.Count == 0 || npcIndeces == null || npcIndeces.Length == 0 || npcPositions == null || npcPositions.Length == 0 || npcRotations == null || npcRotations.Length == 0) { return; } NPCEnemyAI nPCEnemyAI = null; for (int i = 0; i < npcIndeces.Length; i++) { nPCEnemyAI = GetNpcWithIndex(npcIndeces[i]); if (!((Object)(object)nPCEnemyAI == (Object)null)) { SyncNPCTransformLocal(nPCEnemyAI, npcPositions[i], npcRotations[i], snapTo: false); } } } public void SyncNPCTransform(NPCEnemyAI npc, Vector3 pos, Vector3 rot, bool snapTo, bool clearFromQueue) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !((Object)(object)npc == (Object)null) && ((NetworkBehaviour)npc).IsSpawned) { if (clearFromQueue) { RemoveQueuedUpNpc(npc); } SyncNPCTransformLocal(npc, pos, rot, snapTo); SyncNPCTransformClientRpc(((EnemyAI)npc).previousBehaviourStateIndex, pos, rot, snapTo); } } [ClientRpc] private void SyncNPCTransformClientRpc(int npcIndex, Vector3 pos, Vector3 rot, bool snapTo) { //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_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_013a: 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) 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(3095846809u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, npcIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rot); ((FastBufferWriter)(ref val)).WriteValueSafe(ref snapTo, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3095846809u, 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 && spawnedNPCs != null && spawnedNPCs.Count != 0) { NPCEnemyAI npcWithIndex = GetNpcWithIndex(npcIndex); if (!((Object)(object)npcWithIndex == (Object)null)) { SyncNPCTransformLocal(npcWithIndex, pos, rot, snapTo); } } } private void SyncNPCTransformLocal(NPCEnemyAI npc, Vector3 pos, Vector3 rot, bool snapTo) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) if (!((Object)(object)npc == (Object)null)) { if (snapTo) { ((Component)npc).transform.position = pos; ((Component)npc).transform.eulerAngles = rot; } ((EnemyAI)npc).serverPosition = pos; ((EnemyAI)npc).serverRotation = rot; ((EnemyAI)npc).previousYRotation = ((EnemyAI)npc).targetYRotation; ((EnemyAI)npc).targetYRotation = rot.y; } } public void SearchNewDestinationForNPC(NPCEnemyAI npc, NPCNode node, bool forceSearchNonExit = false, NPCAnimation immediatelyStartAnimation = NPCAnimation.None, bool wasOccupyingNode = false) { //IL_0148: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)node == (Object)null || node.destinationNodes == null || node.destinationNodes.Count == 0) { if (Application.isEditor) { Logger.LogWarning((object)$"Despawn: B (node? {node})"); } DespawnNPC(npc); return; } if (GetConditionToLeave() && !((EnemyAI)npc).daytimeEnemyLeaving && !forceSearchNonExit) { TellNPCToGoToExit(npc, node, immediatelyStartAnimation, wasOccupyingNode); return; } List list = new List(); for (int i = 0; i < node.destinationNodes.Count; i++) { NPCNode nPCNode = node.destinationNodes[i]; if (!((Object)(object)nPCNode == (Object)null)) { list.Add(nPCNode); } } if (list == null || list.Count == 0) { if (Application.isEditor) { Logger.LogWarning((object)$"Despawn: C (null? {list == null})"); } DespawnNPC(npc); return; } NPCNode nPCNode2 = list[Random.Range(0, list.Count)]; if (IsNodeOccupied(nPCNode2, npc, checkInteractable: true, checkDistance: true)) { nPCNode2 = list[Random.Range(0, list.Count)]; } if ((Object)(object)nPCNode2 == (Object)null || (Object)(object)nPCNode2 == (Object)(object)node) { nPCNode2 = allActiveNodes[Random.Range(0, allActiveNodes.Count)]; } SetDestinationForNPC(npc, ((Component)nPCNode2).transform.position, immediatelyStartAnimation, wasOccupyingNode); SetNPCTargetNode(npc, nPCNode2); } private void TellNPCToGoToExit(NPCEnemyAI npc, NPCNode node, NPCAnimation immediatelyStartAnimation = NPCAnimation.None, bool wasOccupyingNode = false) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null || (Object)(object)node == (Object)null || node.destinationNodes == null || node.destinationNodes.Count == 0) { return; } for (int i = 0; i < node.destinationNodes.Count; i++) { NPCNode nPCNode = node.destinationNodes[i]; if (!((Object)(object)nPCNode == (Object)null) && nPCNode.isExit) { ((EnemyAI)npc).daytimeEnemyLeaving = true; SetDestinationForNPC(npc, ((Component)nPCNode).transform.position, immediatelyStartAnimation, wasOccupyingNode); return; } } SearchNewDestinationForNPC(npc, node, forceSearchNonExit: true, immediatelyStartAnimation, wasOccupyingNode); } private void SetDestinationForNPC(NPCEnemyAI npc, Vector3 destinationPosition, NPCAnimation immediatelyStartAnimation = NPCAnimation.None, bool wasOccupyingNode = false) { //IL_00e6: 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_00da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } if (wasOccupyingNode && (Object)(object)((EnemyAI)npc).targetNode != (Object)null) { NPCNode component = ((Component)((EnemyAI)npc).targetNode).GetComponent(); if ((Object)(object)component != (Object)null) { InteractTrigger usesInteractable = component.usesInteractable; if ((Object)(object)usesInteractable != (Object)null) { NPCReserveInteractable(usesInteractable, npc, setReservedTo: false); } } } SyncNPCAnimation(npc, immediatelyStartAnimation); if ((Object)(object)((EnemyAI)npc).agent != (Object)null && !((EnemyAI)npc).agent.isOnNavMesh && (Object)(object)RoundManager.Instance != (Object)null) { if (Application.isEditor) { Logger.LogWarning((object)$"!!INTERCEPTING: {npc} #{((EnemyAI)npc).previousBehaviourStateIndex}"); } if (NavMesh.SamplePosition(((Component)npc).transform.position, ref RoundManager.Instance.navHit, 10f, 11613)) { ((EnemyAI)npc).agent.Warp(((NavMeshHit)(ref RoundManager.Instance.navHit)).position); } } ((EnemyAI)npc).SetDestinationToPosition(destinationPosition, false); npc.CustomOwnerSyncPosition(forceSync: true, moveTowardDestination: true, rotateTowardDestination: true); } private void NPCReserveInteractable(InteractTrigger interactTrigger, NPCEnemyAI reservedBy, bool setReservedTo) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !((Object)(object)interactTrigger == (Object)null) && ((NetworkBehaviour)interactTrigger).IsSpawned && !((Object)(object)reservedBy == (Object)null)) { ((EnemyAI)reservedBy).nodesTempArray = (GameObject[])(object)((!setReservedTo) ? null : new GameObject[1] { ((Component)interactTrigger).gameObject }); NPCReserveInteractableLocal(interactTrigger, setReservedTo); NPCReserveInteractableClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)interactTrigger).NetworkObject), setReservedTo, ((Object)((Component)interactTrigger).gameObject).name); } } [ClientRpc] private void NPCReserveInteractableClientRpc(NetworkObjectReference interactNOR, bool setReservedTo, string objectName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_00be: 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_0135: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1315646012u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref interactNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setReservedTo, default(ForPrimitives)); bool flag = objectName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(objectName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1315646012u, 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; } NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref interactNOR)).TryGet(ref val3, (NetworkManager)null)) { InteractTrigger[] componentsInChildren = ((Component)val3).GetComponentsInChildren(); if (componentsInChildren == null || componentsInChildren.Length == 0) { Logger.LogWarning((object)"Failed to get InteractTrigger from NPCReserveInteractableClientRpc()"); return; } InteractTrigger val4 = null; for (int i = 0; i < componentsInChildren.Length; i++) { if (!((Object)(object)componentsInChildren[i] == (Object)null) && ((Object)((Component)componentsInChildren[i]).gameObject).name == objectName) { val4 = componentsInChildren[i]; break; } } if ((Object)(object)val4 == (Object)null) { Logger.LogWarning((object)"Failed to get InteractTrigger from NPCReserveInteractableClientRpc()"); } else { NPCReserveInteractableLocal(val4, setReservedTo); } } else { Logger.LogWarning((object)"Failed to get NetworkObject from NPCReserveInteractableClientRpc()"); } } private void NPCReserveInteractableLocal(InteractTrigger interactTrigger, bool setReservedTo) { if (!((Object)(object)interactTrigger == (Object)null)) { interactTrigger.interactable = !setReservedTo; } } public void DespawnNPC(NPCEnemyAI npc) { if (!((NetworkBehaviour)this).IsServer || (Object)(object)npc == (Object)null || (Object)(object)((EnemyAI)npc).enemyType == (Object)null) { return; } NetworkObject component = ((Component)npc).GetComponent(); if (!((Object)(object)component == (Object)null)) { RoundManager instance = RoundManager.Instance; instance.currentDaytimeEnemyPower -= ((EnemyAI)npc).enemyType.PowerLevel; DespawnNpcAtIndexClientRpc(((EnemyAI)npc).previousBehaviourStateIndex); if (Application.isEditor) { Logger.LogDebug((object)$"SERVER removing npc {npc} #{((NetworkBehaviour)npc).NetworkObjectId} [{((EnemyAI)npc).previousBehaviourStateIndex}]"); } spawnedNPCs.Remove(npc); component.Despawn(true); } } [ClientRpc] private void DespawnNpcAtIndexClientRpc(int npcIndex) { //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(1679276842u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, npcIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1679276842u, 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 || spawnedNPCs == null || spawnedNPCs.Count == 0 || npcIndex < 0 || npcIndex >= spawnedNPCs.Count) { return; } NPCEnemyAI npcWithIndex = GetNpcWithIndex(npcIndex); if (!((Object)(object)npcWithIndex == (Object)null) && spawnedNPCs.Contains(npcWithIndex)) { if (Application.isEditor) { Logger.LogDebug((object)$"CLIENT removing npc {npcWithIndex} #{((NetworkBehaviour)npcWithIndex).NetworkObjectId} [{((EnemyAI)npcWithIndex).previousBehaviourStateIndex}]"); } spawnedNPCs.Remove(npcWithIndex); } } private NPCEnemyAI GetNpcWithIndex(int npcIndex) { if (spawnedNPCs == null || spawnedNPCs.Count == 0) { return null; } for (int i = 0; i < spawnedNPCs.Count; i++) { if (!((Object)(object)spawnedNPCs[i] == (Object)null) && ((EnemyAI)spawnedNPCs[i]).previousBehaviourStateIndex == npcIndex) { return spawnedNPCs[i]; } } return null; } private void OnDisable() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown if ((Object)(object)TimeOfDay.Instance != (Object)null && TimeOfDay.Instance.onHourChanged != null) { TimeOfDay.Instance.onHourChanged.RemoveListener(new UnityAction(TellNPCsToLeaveStopNode)); } } private void Update() { if (spawnedNPCs == null || spawnedNPCs.Count == 0) { return; } if ((Object)(object)NewDonkCityManager.Instance != (Object)null && ambience.isPlaying) { if (NewDonkCityManager.Instance.localCameraInFactory) { ambience.volume = 0f; } else if (NewDonkCityManager.Instance.localCameraInShip) { ambience.volume = ambienceVolumeNpcCount.Evaluate((float)spawnedNPCs.Count) * 0.5f; } else { ambience.volume = ambienceVolumeNpcCount.Evaluate((float)spawnedNPCs.Count); } } if (((NetworkBehaviour)this).IsServer) { if (syncNpcTimer > 0f) { syncNpcTimer -= Time.deltaTime; } else { syncNpcTimer = 1f; SendQueuedNPCsToSync(); } if (greetPlayerTimer > 0f) { greetPlayerTimer -= Time.deltaTime; return; } GetGreetingTimer(); DoPlayerGreetCheck(); } } private void DoPlayerGreetCheck() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_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) GetGreetingNPC(); NPCEnemyAI nPCEnemyAI = spawnedNPCs[greetIdNPC]; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(greetIdPlayer); if ((Object)(object)nPCEnemyAI == (Object)null || (Object)(object)playerWithID == (Object)null) { return; } NPCAnimation currentBehaviourStateIndex = (NPCAnimation)((EnemyAI)nPCEnemyAI).currentBehaviourStateIndex; if (currentBehaviourStateIndex.ToString().Contains("Walking")) { ((EnemyAI)nPCEnemyAI).tempDist = Vector3.Distance(((EnemyAI)nPCEnemyAI).eye.position, playerWithID.playerEye.position); ((EnemyAI)nPCEnemyAI).pathDistance = Vector3.Angle(((EnemyAI)nPCEnemyAI).eye.forward, playerWithID.playerEye.position - ((EnemyAI)nPCEnemyAI).eye.position); if (((EnemyAI)nPCEnemyAI).tempDist > 2f && ((EnemyAI)nPCEnemyAI).tempDist < 20f && ((EnemyAI)nPCEnemyAI).pathDistance < 40f) { SyncNPCAnimation(nPCEnemyAI, NPCAnimation.Greeting); } ((EnemyAI)nPCEnemyAI).tempDist = 0f; ((EnemyAI)nPCEnemyAI).pathDistance = 0f; } } private void GetGreetingNPC() { bool flag = false; int num = 0; while (!flag && num < 3) { greetIdNPC++; num++; if (greetIdNPC >= spawnedNPCs.Count) { greetIdNPC = 0; GetGreetingPlayer(); } flag = (Object)(object)spawnedNPCs[greetIdNPC] != (Object)null; } } private void GetGreetingPlayer() { bool flag = false; int num = 0; while (!flag && num < 4) { greetIdPlayer++; num++; if (greetIdPlayer >= StartOfRound.Instance.allPlayerScripts.Length) { greetIdPlayer = 0; } PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(greetIdPlayer); flag = (Object)(object)playerWithID != (Object)null && (playerWithID.isPlayerControlled || playerWithID.isPlayerDead); } } private void GetGreetingTimer() { greetPlayerTimer = 15f; if (spawnedNPCs != null && spawnedNPCs.Count != 0) { float num = 0.5f; if ((Object)(object)AestheticsManager.Instance != (Object)null && (Object)(object)AestheticsManager.Instance.todaysAesthetics != (Object)null) { num = 1f - (float)spawnedNPCs.Count / Mathf.Max(10f, (float)AestheticsManager.Instance.todaysAesthetics.maxSpawnCountNPC); } greetPlayerTimer = Mathf.Lerp(0.1f, greetPlayerTimer, num); } } 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(4177991691u, new RpcReceiveHandler(__rpc_handler_4177991691), "SyncSpawnNPCAtLocationClientRpc"); ((NetworkBehaviour)this).__registerRpc(2022914645u, new RpcReceiveHandler(__rpc_handler_2022914645), "SyncNPCAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(839027760u, new RpcReceiveHandler(__rpc_handler_839027760), "ReceiveQueuedNPCsToSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(3095846809u, new RpcReceiveHandler(__rpc_handler_3095846809), "SyncNPCTransformClientRpc"); ((NetworkBehaviour)this).__registerRpc(1315646012u, new RpcReceiveHandler(__rpc_handler_1315646012), "NPCReserveInteractableClientRpc"); ((NetworkBehaviour)this).__registerRpc(1679276842u, new RpcReceiveHandler(__rpc_handler_1679276842), "DespawnNpcAtIndexClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4177991691(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_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_0083: 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_008b: 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) { NetworkObjectReference npcNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref npcNOR, default(ForNetworkSerializable)); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); Vector3 spawnRot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnRot); int animIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref animIndex); int randomMatIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomMatIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).SyncSpawnNPCAtLocationClientRpc(npcNOR, spawnPos, spawnRot, animIndex, randomMatIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2022914645(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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 npcNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref npcNOR, default(ForNetworkSerializable)); int animIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref animIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).SyncNPCAnimationClientRpc(npcNOR, animIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_839027760(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_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) //IL_0058: 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_00ab: 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_00dc: 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 = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] npcIndeces = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref npcIndeces, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Vector3[] npcPositions = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref npcPositions); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); Vector3[] npcRotations = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref npcRotations); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).ReceiveQueuedNPCsToSyncClientRpc(npcIndeces, npcPositions, npcRotations); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3095846809(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_007a: 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 npcIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref npcIndex); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 rot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); bool snapTo = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref snapTo, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).SyncNPCTransformClientRpc(npcIndex, pos, rot, snapTo); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1315646012(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_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) //IL_0097: 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_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference interactNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref interactNOR, default(ForNetworkSerializable)); bool setReservedTo = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setReservedTo, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string objectName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).NPCReserveInteractableClientRpc(interactNOR, setReservedTo, objectName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1679276842(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 npcIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref npcIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).DespawnNpcAtIndexClientRpc(npcIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NPCManager"; } } public class PropsManager : NetworkBehaviour { private static ManualLogSource Logger; public static PropsManager Instance; [Tooltip("OnSceneLoad()\nHappens as soon as the ship doors open and meshes and collision need to be ready.\n\nOnLoadDelay()\nHappens after a few seconds to alleviate everything happening all at once, to ensure the LODs are ready, and start their functionality at the same time.\n\nOnDayEnd()\nHappens at the end of the day at the moment the ship doors close.")] public List sendTimedEvents = new List(); [Space(3f)] [Header("RandomSitAnimation")] public SitAnimationData[] allSitAnimData; public RandomSitAnimation[] setSitAnimations; [Space(3f)] [Header("Dynamic Trackables")] public List allRcCars = new List(); public Transform[] generalBoundsContainers; private static Dictionary> coinsPerSaveFile = new Dictionary>(); [Space(3f)] [Header("SnapPlayerToPosition")] public GameObject[] snapPlayerPrefabs; [Space(3f)] [Header("PumaTree")] public GameObject pumaTreeTerrainCheck; public Transform pumaTreeTerrainContainer; public static void LoadSaveDataOnModAwake() { LoadSavedData(); } private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public void OnSceneLoadServer() { if (((NetworkBehaviour)this).IsServer) { OnSceneLoadSync(); OnSceneLoadClientRpc(); } } [ClientRpc] private void OnSceneLoadClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(472444438u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 472444438u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { OnSceneLoadSync(); } } } private void OnSceneLoadSync() { SendTimedEvent(sendOnSceneLoad: true); } public void OnLoadDelayServer() { if (((NetworkBehaviour)this).IsServer) { OnLoadDelaySync(); OnLoadDelayClientRpc(); } } [ClientRpc] private void OnLoadDelayClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1888003283u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1888003283u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { OnLoadDelaySync(); } } } private void OnLoadDelaySync() { SendTimedEvent(sendOnSceneLoad: false, sendOnLoadDelay: true); } public void OnDayEndServer() { if (((NetworkBehaviour)this).IsServer) { OnDayEndSync(); OnDayEndClientRpc(); } } [ClientRpc] private void OnDayEndClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2379826364u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2379826364u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { OnDayEndSync(); } } } private void OnDayEndSync() { SendTimedEvent(sendOnSceneLoad: false, sendOnLoadDelay: false, sendOnDayEnd: true); } private void SendTimedEvent(bool sendOnSceneLoad = false, bool sendOnLoadDelay = false, bool sendOnDayEnd = false) { if ((!sendOnSceneLoad && !sendOnLoadDelay && !sendOnDayEnd) || sendTimedEvents == null || sendTimedEvents.Count == 0) { return; } for (int i = 0; i < sendTimedEvents.Count; i++) { LoadEvents loadEvents = sendTimedEvents[i]; if ((Object)(object)loadEvents == (Object)null || (!loadEvents.onSceneLoad && !loadEvents.onLoadDelay && !loadEvents.onDayEnd)) { continue; } if (sendOnSceneLoad && loadEvents.onSceneLoad) { if (Application.isEditor) { Logger.LogDebug((object)$"SendTimedEvent(): {loadEvents} // OnSceneLoad()"); } ((Component)loadEvents).gameObject.SendMessage("OnSceneLoad"); } if (sendOnLoadDelay && loadEvents.onLoadDelay) { if (Application.isEditor) { Logger.LogDebug((object)$"SendTimedEvent(): {loadEvents} // OnLoadDelay()"); } ((Component)loadEvents).gameObject.SendMessage("OnLoadDelay"); } if (sendOnDayEnd && loadEvents.onDayEnd) { if (Application.isEditor) { Logger.LogDebug((object)$"SendTimedEvent(): {loadEvents} // OnDayEnd()"); } ((Component)loadEvents).gameObject.SendMessage("OnDayEnd"); } } } public static GameObject SpawnGenericPlayerMover(Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion), Transform parent = null, Vector3 playerOffset = default(Vector3), int prefabIndex = 0, bool spawnNetObj = true) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00cd: 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) if ((Object)(object)Instance == (Object)null || Instance.snapPlayerPrefabs == null || Instance.snapPlayerPrefabs.Length == 0 || prefabIndex < 0 || prefabIndex >= Instance.snapPlayerPrefabs.Length) { return null; } GameObject val = Instance.snapPlayerPrefabs[prefabIndex]; if ((Object)(object)val == (Object)null) { return null; } if (spawnNetObj && !NewDonkCityManager.localPlayerServer && (Object)(object)val.GetComponent() != (Object)null) { return null; } GameObject val2 = Object.Instantiate(Instance.snapPlayerPrefabs[prefabIndex], position, rotation, parent); if ((Object)(object)val2 == (Object)null) { return null; } if (playerOffset != default(Vector3)) { SnapPlayerToPosition componentInChildren = val2.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Component)componentInChildren).gameObject != (Object)(object)val2) { ((Component)componentInChildren).transform.position = val2.transform.TransformPoint(playerOffset); } } if (spawnNetObj && NewDonkCityManager.localPlayerServer) { NetworkObject component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(false); } } return val2; } public void SetSitAnimations() { //IL_00a0: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (setSitAnimations == null || setSitAnimations.Length == 0) { return; } Random random = new Random(StartOfRound.Instance.randomMapSeed); for (int i = 0; i < setSitAnimations.Length; i++) { RandomSitAnimation randomSitAnimation = setSitAnimations[i]; if (!((Object)(object)randomSitAnimation == (Object)null)) { InteractTrigger component = ((Component)randomSitAnimation).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.playerPositionNode == (Object)null)) { SitAnimationData sitAnimationData = allSitAnimData[random.Next(0, allSitAnimData.Length)]; component.animationString = sitAnimationData.animationString; component.setVehicleAnimation = sitAnimationData.isVehicleAnimation; component.playerPositionNode.position = new Vector3(component.playerPositionNode.position.x + sitAnimationData.playerPositionOffset.x, component.playerPositionNode.position.y + sitAnimationData.playerPositionOffset.y, component.playerPositionNode.position.z + sitAnimationData.playerPositionOffset.z); Object.Destroy((Object)(object)randomSitAnimation); } } } setSitAnimations = null; } public static void CallMonoBehaviourNetworkEvent(PlayerControllerB calledBy, Vector3 scriptPosition, string searchableKey, int specialID = 0, GameObject linkedObject = null, float searchDistance = 5f, bool logResults = false) { //IL_0034: 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_0085: 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_0061: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || (Object)(object)calledBy == (Object)null || string.IsNullOrEmpty(searchableKey)) { return; } if ((Object)(object)linkedObject == (Object)null) { Instance.CallMonoBehaviourNetworkEventServerRpc(NewDonkCityManager.GetIDWithPlayer(calledBy), scriptPosition, searchableKey, specialID, searchDistance, logResults); return; } NetworkObject component = linkedObject.GetComponent(); if ((Object)(object)component != (Object)null) { Instance.CallMonoBehaviourNetworkEventServerRpc(NewDonkCityManager.GetIDWithPlayer(calledBy), scriptPosition, searchableKey, specialID, NetworkObjectReference.op_Implicit(component), searchDistance, logResults); } else { Instance.CallMonoBehaviourNetworkEventServerRpc(NewDonkCityManager.GetIDWithPlayer(calledBy), scriptPosition, searchableKey, specialID, linkedObject.transform.position, searchDistance, logResults); } } [ServerRpc(RequireOwnership = false)] private void CallMonoBehaviourNetworkEventServerRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_00a2: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_00e2: 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_00fd: 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_0117: 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(2175486060u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2175486060u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, searchDistance, logResults); } } [ServerRpc(RequireOwnership = false)] private void CallMonoBehaviourNetworkEventServerRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, NetworkObjectReference linkedNOR, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_00a2: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_00c9: 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) //IL_00e8: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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(4192764044u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref linkedNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4192764044u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, linkedNOR, searchDistance, logResults); } } [ServerRpc(RequireOwnership = false)] private void CallMonoBehaviourNetworkEventServerRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, Vector3 linkedObjectPosition, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_00a2: 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_0169: 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_0174: 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_00ef: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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(327432112u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref linkedObjectPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 327432112u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, linkedObjectPosition, searchDistance, logResults); } } [ClientRpc] private void CallMonoBehaviourNetworkEventClientRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_00a2: 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_015c: 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_00e2: 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_00fd: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) 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(476252384u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 476252384u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { NewDonkCityManager.SearchPhysicsComponentAtPositionAndCallEvent(scriptPosition, searchableKey, NewDonkCityManager.GetPlayerWithID(playerID), specialID, null, searchDistance, logResults); } } } [ClientRpc] private void CallMonoBehaviourNetworkEventClientRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, NetworkObjectReference linkedNOR, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_00a2: 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_0177: 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_00e2: 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_00fd: 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_0118: 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) //IL_0132: 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) 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(2200375413u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref linkedNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2200375413u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { GameObject linkedObject = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref linkedNOR)).TryGet(ref val3, (NetworkManager)null)) { linkedObject = ((Component)val3).gameObject; } NewDonkCityManager.SearchPhysicsComponentAtPositionAndCallEvent(scriptPosition, searchableKey, NewDonkCityManager.GetPlayerWithID(playerID), specialID, linkedObject, searchDistance, logResults); } } [ClientRpc] private void CallMonoBehaviourNetworkEventClientRpc(int playerID, Vector3 scriptPosition, string searchableKey, int specialID, Vector3 linkedObjectPosition, float searchDistance, bool logResults) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_00a2: 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_0169: 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_00ef: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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(3141859278u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPosition); bool flag = searchableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(searchableKey, false); } BytePacker.WriteValueBitPacked(val, specialID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref linkedObjectPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref searchDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref logResults, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3141859278u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { NewDonkCityManager.SearchPhysicsComponentAtPositionAndCallEvent(scriptPosition, searchableKey, NewDonkCityManager.GetPlayerWithID(playerID), specialID, NewDonkCityManager.SearchPhysicsComponentAtPosition(linkedObjectPosition, "Local NetworkObject", searchDistance, logResults), searchDistance, logResults); } } } public static void SaveCollectedCoinIntoMemory(int saveFileNum, Vector3 coinPosition, int collectType) { //IL_005c: 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_0048: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer || collectType == 0) { return; } if (coinsPerSaveFile.ContainsKey(saveFileNum)) { if (!coinsPerSaveFile[saveFileNum].ContainsKey(coinPosition)) { coinsPerSaveFile[saveFileNum].Add(coinPosition, collectType); } } else { coinsPerSaveFile.Add(saveFileNum, new Dictionary { { coinPosition, collectType } }); } } public void RemoveAlreadyCollectedCoins() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer || coinsPerSaveFile == null || coinsPerSaveFile.Count == 0) { return; } List list = new List(); if (coinsPerSaveFile.TryGetValue(GameNetworkManager.Instance.saveFileNum, out var value) && value != null && value.Count != 0) { for (int i = 0; i < value.Count; i++) { list.Add(value.ElementAt(i).Key); } RemoveAlreadyCollectedCoinsClientRpc(list.ToArray()); ((MonoBehaviour)this).StartCoroutine(RemoveAlreadyCollectedCoinsLocal(list.ToArray())); } } [ClientRpc] private void RemoveAlreadyCollectedCoinsClientRpc(Vector3[] hostCoinPositions) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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) 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(3129072356u, val2, (RpcDelivery)0); bool flag = hostCoinPositions != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(hostCoinPositions); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3129072356u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer && hostCoinPositions != null && hostCoinPositions.Length != 0) { ((MonoBehaviour)this).StartCoroutine(RemoveAlreadyCollectedCoinsLocal(hostCoinPositions)); } } } private IEnumerator RemoveAlreadyCollectedCoinsLocal(Vector3[] coinPositions) { if (coinPositions == null || coinPositions.Length == 0) { yield break; } for (int i = 0; i < coinPositions.Length; i++) { yield return (object)new WaitForSeconds(0.1f); GameObject val = NewDonkCityManager.SearchPhysicsComponentAtPosition(coinPositions[i], "Coin Container", 0.25f); if ((Object)(object)val == (Object)null) { continue; } CoinContainer component = val.GetComponent(); if ((Object)(object)component != (Object)null && component.collectType != CoinContainer.CollectableType.EveryDay) { component.SetCollected(setTo: true); if (component.destroyOnCollect) { Object.Destroy((Object)(object)((Component)component).gameObject); } else if ((Object)(object)component.playAnimationOn != (Object)null) { component.playAnimationOn.SetTrigger("CollectCoin"); } } } } public static void RemoveCollectTypesFromDictionary(CoinContainer.CollectableType[] types, int saveFileNum, bool deleteFromSaveData = true) { //IL_008f: 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_0097: 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) if (types == null || types.Length == 0 || coinsPerSaveFile == null || coinsPerSaveFile.Count == 0 || !coinsPerSaveFile.TryGetValue(saveFileNum, out var value)) { return; } for (int i = 0; i < types.Length; i++) { int num = (int)types[i]; if (Application.isEditor) { Logger.LogInfo((object)$"server removing from dictionary {types[i]} ({num})"); } for (int num2 = value.Count - 1; num2 >= 0; num2--) { KeyValuePair keyValuePair = value.ElementAt(num2); if (!keyValuePair.Equals(null) && keyValuePair.Value == num) { Vector3 key = keyValuePair.Key; value.Remove(key); if (deleteFromSaveData) { SaveDataManager.DeleteSavedData(saveFileNum, SaveDataManager.SaveKey.CoinContainerCollected, key); } } } } } public void MoveToPointAndSync(GameObject objectToMove, MoveToPoint movingScript, string nonNetworkedMoveableKey = null) { //IL_004c: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)objectToMove == (Object)null) && !((Object)(object)movingScript == (Object)null)) { NetworkObject componentInChildren = objectToMove.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { MoveToPointAndSyncServerRpc(NewDonkCityManager.localPlayerID, NetworkObjectReference.op_Implicit(componentInChildren), ((Component)movingScript).transform.position); } else { MoveToPointAndSyncServerRpc(NewDonkCityManager.localPlayerID, objectToMove.transform.position, nonNetworkedMoveableKey, ((Component)movingScript).transform.position); } } } [ServerRpc(RequireOwnership = false)] private void MoveToPointAndSyncServerRpc(int playerID, Vector3 moveablePos, string moveableKey, Vector3 scriptPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_00a2: 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_0126: 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_012f: 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) 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(1717435498u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moveablePos); bool flag = moveableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(moveableKey, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1717435498u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MoveToPointAndSyncClientRpc(playerID, moveablePos, moveableKey, scriptPos); } } [ClientRpc] private void MoveToPointAndSyncClientRpc(int playerID, Vector3 moveablePos, string moveableKey, Vector3 scriptPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_00a2: 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_0126: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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(297344416u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moveablePos); bool flag = moveableKey != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(moveableKey, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 297344416u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == NewDonkCityManager.localPlayerID) { return; } GameObject val3 = NewDonkCityManager.SearchPhysicsComponentAtPosition(moveablePos, moveableKey); if ((Object)(object)val3 == (Object)null) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get objectToMove"); return; } GameObject val4 = NewDonkCityManager.SearchPhysicsComponentAtPosition(scriptPos, "Move To Point"); if ((Object)(object)val4 == (Object)null) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get IPhysicsSearchable"); return; } MoveToPoint component = val4.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get MoveToPoint"); } else { component.StartMovingObjectToPointNoSync(val3); } } [ServerRpc(RequireOwnership = false)] private void MoveToPointAndSyncServerRpc(int playerID, NetworkObjectReference moveableNOR, Vector3 scriptPos) { //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_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) //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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4209595197u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moveableNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4209595197u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MoveToPointAndSyncClientRpc(playerID, moveableNOR, scriptPos); } } } [ClientRpc] private void MoveToPointAndSyncClientRpc(int playerID, NetworkObjectReference moveableNOR, Vector3 scriptPos) { //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_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_0120: 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(315515101u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moveableNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scriptPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 315515101u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == NewDonkCityManager.localPlayerID) { return; } NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref moveableNOR)).TryGet(ref val3, (NetworkManager)null)) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get NetworkObject"); return; } GameObject val4 = NewDonkCityManager.SearchPhysicsComponentAtPosition(scriptPos, "Move To Point"); if ((Object)(object)val4 == (Object)null) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get IPhysicsSearchable"); return; } MoveToPoint component = val4.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)"MoveToPointAndSyncClientRpc failed to get MoveToPoint"); } else { component.StartMovingObjectToPointNoSync(((Component)val3).gameObject); } } public static void ReceiveJoyConInput(float input, bool forwardBackward, JoyCon sentFrom) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Instance == (Object)null) && !((Object)(object)sentFrom == (Object)null) && ((NetworkBehaviour)sentFrom).IsSpawned) { Instance.ServerReceiveJoyConInputServerRpc(input, forwardBackward, NetworkObjectReference.op_Implicit(((NetworkBehaviour)sentFrom).NetworkObject)); } } [ServerRpc(RequireOwnership = false)] private void ServerReceiveJoyConInputServerRpc(float input, bool forwardBackward, NetworkObjectReference jcNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00b3: 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_00cd: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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(2616117231u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref input, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref forwardBackward, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref jcNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2616117231u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (allRcCars == null || allRcCars.Count == 0 || !((NetworkObjectReference)(ref jcNOR)).TryGet(ref val3, (NetworkManager)null)) { return; } JoyCon component = ((Component)val3).GetComponent(); if ((Object)(object)component == (Object)null) { return; } Logger.LogDebug((object)$"ServerReceiveJoyConInput(): {input} // {forwardBackward} // {component} #{((NetworkBehaviour)component).NetworkObjectId}"); RcCar rcCar = null; rcCar = ((!((Object)(object)component.lastSentTo != (Object)null)) ? DecideCarToLinkJoyConTo(((Component)component).transform.position) : component.lastSentTo); if (!((Object)(object)rcCar == (Object)null)) { if (input == 0f) { component.lastSentTo = null; } Vector2 zero = Vector2.zero; if (forwardBackward) { zero.y = input; } else { zero.x = input; } rcCar.ReceiveNewInput(zero, ((NetworkBehaviour)component).NetworkObjectId); } } public static RcCar DecideCarToLinkJoyConTo(Vector3 pos) { //IL_009c: 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_00a5: 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_0078: 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_00b9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || Instance.allRcCars == null || Instance.allRcCars.Count == 0) { return null; } RcCar result = null; float num = -1f; float num2 = -1f; for (int i = 0; i < Instance.allRcCars.Count; i++) { RcCar rcCar = Instance.allRcCars[i]; if ((Object)(object)rcCar == (Object)null) { continue; } if ((Object)(object)rcCar.playerMustBeInBounds == (Object)null) { float num3 = Vector3.Distance(((Component)rcCar).transform.position, pos); if (num == -1f || num3 < num) { num = num3; result = rcCar; } continue; } Bounds bounds = rcCar.playerMustBeInBounds.bounds; if (((Bounds)(ref bounds)).Contains(pos)) { float num4 = Vector3.Distance(((Component)rcCar).transform.position, pos); if (num2 == -1f || num4 < num) { num2 = num4; result = rcCar; } } } return result; } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); } public void OnDayEnd() { SaveSavedData(); } private static void SaveSavedData() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || !((NetworkBehaviour)Instance).IsServer) { return; } for (int i = 0; i < coinsPerSaveFile.Count; i++) { int key = coinsPerSaveFile.ElementAt(i).Key; if (coinsPerSaveFile.TryGetValue(key, out var value)) { if (value == null || value.Count == 0) { break; } for (int j = 0; j < value.Count; j++) { KeyValuePair keyValuePair = value.ElementAt(j); SaveDataManager.SetDataToSave(key, SaveDataManager.SaveKey.CoinContainerCollected, keyValuePair.Key, keyValuePair.Value); } } } } private static void LoadSavedData() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (SaveDataManager.GetSavedDataMultiple(SaveDataManager.SaveKey.CoinContainerCollected)) { for (int i = 0; i < SaveDataManager.tempSavedDataStates.Count; i++) { SaveCollectedCoinIntoMemory(SaveDataManager.tempSavedFileNums[i], SaveDataManager.tempSavedPositions[i], SaveDataManager.tempSavedDataStates[i]); } SaveDataManager.WipeTempSaveData(); } } 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 //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 ((NetworkBehaviour)this).__registerRpc(472444438u, new RpcReceiveHandler(__rpc_handler_472444438), "OnSceneLoadClientRpc"); ((NetworkBehaviour)this).__registerRpc(1888003283u, new RpcReceiveHandler(__rpc_handler_1888003283), "OnLoadDelayClientRpc"); ((NetworkBehaviour)this).__registerRpc(2379826364u, new RpcReceiveHandler(__rpc_handler_2379826364), "OnDayEndClientRpc"); ((NetworkBehaviour)this).__registerRpc(2175486060u, new RpcReceiveHandler(__rpc_handler_2175486060), "CallMonoBehaviourNetworkEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(4192764044u, new RpcReceiveHandler(__rpc_handler_4192764044), "CallMonoBehaviourNetworkEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(327432112u, new RpcReceiveHandler(__rpc_handler_327432112), "CallMonoBehaviourNetworkEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(476252384u, new RpcReceiveHandler(__rpc_handler_476252384), "CallMonoBehaviourNetworkEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(2200375413u, new RpcReceiveHandler(__rpc_handler_2200375413), "CallMonoBehaviourNetworkEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(3141859278u, new RpcReceiveHandler(__rpc_handler_3141859278), "CallMonoBehaviourNetworkEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(3129072356u, new RpcReceiveHandler(__rpc_handler_3129072356), "RemoveAlreadyCollectedCoinsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1717435498u, new RpcReceiveHandler(__rpc_handler_1717435498), "MoveToPointAndSyncServerRpc"); ((NetworkBehaviour)this).__registerRpc(297344416u, new RpcReceiveHandler(__rpc_handler_297344416), "MoveToPointAndSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(4209595197u, new RpcReceiveHandler(__rpc_handler_4209595197), "MoveToPointAndSyncServerRpc"); ((NetworkBehaviour)this).__registerRpc(315515101u, new RpcReceiveHandler(__rpc_handler_315515101), "MoveToPointAndSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(2616117231u, new RpcReceiveHandler(__rpc_handler_2616117231), "ServerReceiveJoyConInputServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_472444438(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; ((PropsManager)(object)target).OnSceneLoadClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1888003283(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; ((PropsManager)(object)target).OnLoadDelayClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2379826364(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; ((PropsManager)(object)target).OnDayEndClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2175486060(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_0075: 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_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_00be: 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_00ec: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventServerRpc(playerID, scriptPosition, searchableKey, specialID, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4192764044(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_0075: 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_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_00c4: 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_00d9: 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_010b: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); NetworkObjectReference linkedNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref linkedNOR, default(ForNetworkSerializable)); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventServerRpc(playerID, scriptPosition, searchableKey, specialID, linkedNOR, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_327432112(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_0075: 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_00a1: 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_00bc: 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_00da: 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_00fd: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); Vector3 linkedObjectPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref linkedObjectPosition); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventServerRpc(playerID, scriptPosition, searchableKey, specialID, linkedObjectPosition, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_476252384(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_0075: 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_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_00be: 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_00ec: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2200375413(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_0075: 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_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_00c4: 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_00d9: 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_010b: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); NetworkObjectReference linkedNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref linkedNOR, default(ForNetworkSerializable)); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, linkedNOR, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3141859278(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_0075: 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_00a1: 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_00bc: 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_00da: 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_00fd: 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 scriptPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPosition); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string searchableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchableKey, false); } int specialID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialID); Vector3 linkedObjectPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref linkedObjectPosition); float searchDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref searchDistance, default(ForPrimitives)); bool logResults = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref logResults, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).CallMonoBehaviourNetworkEventClientRpc(playerID, scriptPosition, searchableKey, specialID, linkedObjectPosition, searchDistance, logResults); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3129072356(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_0060: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); Vector3[] hostCoinPositions = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref hostCoinPositions); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).RemoveAlreadyCollectedCoinsClientRpc(hostCoinPositions); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1717435498(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_0088: 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_009f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 moveablePos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveablePos); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string moveableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveableKey, false); } Vector3 scriptPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).MoveToPointAndSyncServerRpc(playerID, moveablePos, moveableKey, scriptPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_297344416(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_0088: 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_009f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); Vector3 moveablePos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveablePos); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string moveableKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveableKey, false); } Vector3 scriptPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).MoveToPointAndSyncClientRpc(playerID, moveablePos, moveableKey, scriptPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4209595197(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_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference moveableNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveableNOR, default(ForNetworkSerializable)); Vector3 scriptPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).MoveToPointAndSyncServerRpc(playerID, moveableNOR, scriptPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_315515101(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_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference moveableNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moveableNOR, default(ForNetworkSerializable)); Vector3 scriptPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).MoveToPointAndSyncClientRpc(playerID, moveableNOR, scriptPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2616117231(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_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) //IL_007a: 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_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float input = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref input, default(ForPrimitives)); bool forwardBackward = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forwardBackward, default(ForPrimitives)); NetworkObjectReference jcNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref jcNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PropsManager)(object)target).ServerReceiveJoyConInputServerRpc(input, forwardBackward, jcNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PropsManager"; } } public class SaveDataManager { public enum SaveKey { CoinContainerCollected, MoonDataCollected, PlantedSeedDaysGrown, PlantedSeedTimesSprayed, ChallengeDoorTimer } [Serializable] public class DataToSave { public int[] fileNumber; public int[] saveType; public Vector3[] positions; public int[] dataState; } public class SaveData { private DataToSave data = new DataToSave { fileNumber = saveFileNums.ToArray(), saveType = saveDataTypes.ToArray(), positions = saveablePositions.ToArray(), dataState = savedStates.ToArray() }; public void Save() { Logger.LogInfo((object)"Saving LCNewDonkCityMod SaveData..."); XmlSerializer xmlSerializer = new XmlSerializer(typeof(DataToSave)); using FileStream stream = new FileStream(Path.Combine(GetSaveDataFolder(), "LCNewDonkCityMod.xml"), FileMode.Create); xmlSerializer.Serialize(stream, data); } public void Load() { string path = Path.Combine(GetSaveDataFolder(), "LCNewDonkCityMod.xml"); if (File.Exists(path)) { DataToSave obj = (DataToSave)new XmlSerializer(typeof(DataToSave)).Deserialize(new FileStream(path, FileMode.Open)); saveFileNums = obj.fileNumber.ToList(); saveDataTypes = obj.saveType.ToList(); saveablePositions = obj.positions.ToList(); savedStates = obj.dataState.ToList(); if (saveFileNums.Count == saveDataTypes.Count && saveFileNums.Count == saveablePositions.Count && saveFileNums.Count == savedStates.Count) { Logger.LogInfo((object)"Loaded LCNewDonkCityMod SaveData"); return; } Logger.LogError((object)"Error while loading LCNewDonkCityMod SaveData"); WipeSaveFile(); } else { Logger.LogInfo((object)"No LCNewDonkCityMod SaveData exists yet"); } } } private static ManualLogSource Logger; public static SaveData saveFile; private static List saveFileNums = new List(); private static List saveDataTypes = new List(); private static List saveablePositions = new List(); private static List savedStates = new List(); public static List tempSavedFileNums; public static List tempSavedPositions; public static List tempSavedDataStates; public static SaveKey[] allKeys = new SaveKey[5] { SaveKey.CoinContainerCollected, SaveKey.MoonDataCollected, SaveKey.PlantedSeedDaysGrown, SaveKey.PlantedSeedTimesSprayed, SaveKey.ChallengeDoorTimer }; public static void SetDataToSave(int fileNum, SaveKey saveKey, Vector3 scriptPosition, int saveDataState) { //IL_00e5: 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_003d: 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_0094: Unknown result type (might be due to invalid IL or missing references) if (saveFileNums != null && saveFileNums.Contains(fileNum) && saveDataTypes != null && saveDataTypes.Contains((int)saveKey) && saveablePositions != null && saveablePositions.Contains(scriptPosition)) { int dataIndex = GetDataIndex(fileNum, saveKey, scriptPosition); if (dataIndex != -1) { savedStates[dataIndex] = saveDataState; Logger.LogDebug((object)$"OVERWRITING at index [{saveFileNums.Count}]: {fileNum} - {(int)saveKey} - {scriptPosition} - {saveDataState}"); return; } } Logger.LogDebug((object)$"SAVING at index [{saveFileNums.Count}]: {fileNum} - {(int)saveKey} - {scriptPosition} - {saveDataState}"); saveFileNums.Add(fileNum); saveDataTypes.Add((int)saveKey); saveablePositions.Add(scriptPosition); savedStates.Add(saveDataState); } public static LoadedDataState GetSavedDataSingle(int fileNum, SaveKey saveKey, Vector3 scriptPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) int dataIndex = GetDataIndex(fileNum, saveKey, scriptPosition); if (dataIndex == -1) { Logger.LogDebug((object)"failed at GetSaveDataSingle()"); return new LoadedDataState(successful: false); } Logger.LogDebug((object)$"returning {savedStates[dataIndex]} at [{dataIndex}]"); return new LoadedDataState(successful: true, savedStates[dataIndex]); } public static bool GetSavedDataMultiple(int fileNum) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if (saveFileNums == null || saveFileNums.Count == 0 || saveDataTypes == null || saveablePositions == null || savedStates == null) { Logger.LogDebug((object)"no multiple SaveData to retrieve"); return false; } tempSavedFileNums = new List(); tempSavedDataStates = new List(); tempSavedPositions = new List(); for (int i = 0; i < saveFileNums.Count; i++) { if (i >= saveDataTypes.Count || i >= saveablePositions.Count || i >= savedStates.Count) { Logger.LogError((object)"overflowed when trying to GetSaveDataMultiple()"); break; } if (saveFileNums[i] == fileNum) { tempSavedFileNums.Add(saveFileNums[i]); tempSavedDataStates.Add(savedStates[i]); tempSavedPositions.Add(saveablePositions[i]); } } if (tempSavedFileNums.Count == 0 || tempSavedDataStates.Count == 0 || tempSavedPositions.Count == 0) { Logger.LogWarning((object)$"empty array when trying to GetSavedDataMultiple by saveFileNum {fileNum}"); return false; } if (Application.isEditor) { Logger.LogDebug((object)$"found {tempSavedDataStates.Count} save data using saveFileNum {fileNum}"); } return true; } public static bool GetSavedDataMultiple(SaveKey saveKey) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if (saveDataTypes == null || saveDataTypes.Count == 0 || saveFileNums == null || saveablePositions == null || savedStates == null) { Logger.LogDebug((object)"no multiple SaveData to retrieve"); return false; } tempSavedFileNums = new List(); tempSavedDataStates = new List(); tempSavedPositions = new List(); for (int i = 0; i < saveDataTypes.Count; i++) { if (i >= saveFileNums.Count || i >= saveablePositions.Count || i >= savedStates.Count) { Logger.LogError((object)"overflowed when trying to GetSaveDataMultiple()"); break; } if (saveDataTypes[i] == (int)saveKey) { tempSavedFileNums.Add(saveFileNums[i]); tempSavedDataStates.Add(savedStates[i]); tempSavedPositions.Add(saveablePositions[i]); } } if (tempSavedFileNums.Count == 0 || tempSavedDataStates.Count == 0 || tempSavedPositions.Count == 0) { Logger.LogWarning((object)$"empty array when trying to GetSavedDataMultiple by key {saveKey}"); return false; } if (Application.isEditor) { Logger.LogDebug((object)$"found {tempSavedDataStates.Count} save data using key {saveKey}"); } return true; } public static void WipeTempSaveData() { tempSavedFileNums.Clear(); tempSavedFileNums = null; tempSavedDataStates.Clear(); tempSavedDataStates = null; tempSavedPositions.Clear(); tempSavedPositions = null; } public static void DeleteSavedData(int fileNum, SaveKey saveKey, Vector3 scriptPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) int dataIndex = GetDataIndex(fileNum, saveKey, scriptPosition); if (dataIndex == -1) { Logger.LogInfo((object)"failed to get dataIndex at DeleteSaveData()"); } else { WipeSaveData(dataIndex); } } public static void DeleteSavedData(int fileNum, SaveKey saveKey) { if (!GetSavedDataMultiple(saveKey)) { return; } for (int i = 0; i < tempSavedFileNums.Count; i++) { int dataIndex = GetDataIndex(fileNum, saveKey); if (dataIndex != -1) { WipeSaveData(dataIndex); } } } public static void DeleteSavedData(int fileNum) { if (!GetSavedDataMultiple(fileNum)) { return; } for (int i = 0; i < tempSavedFileNums.Count; i++) { int dataIndex = GetDataIndex(tempSavedFileNums[i]); if (dataIndex != -1) { WipeSaveData(dataIndex); } } } private static void WipeSaveData(int dataIndex) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (dataIndex >= 0 && dataIndex < saveDataTypes.Count) { Logger.LogDebug((object)$"removing saveData at index {dataIndex}, which holds data: {saveFileNums[dataIndex]} - {saveDataTypes[dataIndex]} - {saveablePositions[dataIndex]} - {savedStates[dataIndex]}"); saveFileNums.RemoveAt(dataIndex); saveDataTypes.RemoveAt(dataIndex); saveablePositions.RemoveAt(dataIndex); savedStates.RemoveAt(dataIndex); } } private static void WipeSaveFile() { for (int i = 0; i < 3; i++) { Plugin.DeleteSaveDataFull(i); } } private static int GetDataIndex(int fileNum, SaveKey saveKey, Vector3 scriptPosition) { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (savedStates == null || savedStates.Count == 0 || saveFileNums == null || saveablePositions == null || saveDataTypes == null) { if (Application.isEditor) { Logger.LogInfo((object)"null list when trying to GetDataIndex()"); } return -1; } int num = -1; for (int i = 0; i < savedStates.Count; i++) { if (i >= saveFileNums.Count || i >= saveablePositions.Count || i >= saveDataTypes.Count) { Logger.LogError((object)$"[{i}] overflowed save data list... nums? {saveFileNums.Count} // positions? {saveablePositions.Count} // types? {i >= saveDataTypes.Count}"); break; } if (saveFileNums[i] == fileNum && saveDataTypes[i] == (int)saveKey && saveablePositions[i] == scriptPosition) { num = i; break; } } if (num == -1) { Logger.LogWarning((object)$"failed to find data index with parameters: {fileNum} - {(int)saveKey} - {scriptPosition}"); return -1; } return num; } private static int GetDataIndex(int fileNum, SaveKey saveKey) { if (savedStates == null || savedStates.Count == 0 || saveFileNums == null || saveDataTypes == null) { if (Application.isEditor) { Logger.LogInfo((object)"null list when trying to GetDataIndex()"); } return -1; } int num = -1; for (int i = 0; i < savedStates.Count; i++) { if (i >= saveFileNums.Count || i >= saveDataTypes.Count) { Logger.LogError((object)$"[{i}] overflowed save data list... nums? {saveFileNums.Count} // types? {i >= saveDataTypes.Count}"); break; } if (saveFileNums[i] == fileNum && saveDataTypes[i] == (int)saveKey) { num = i; break; } } if (num == -1) { Logger.LogWarning((object)$"failed to find data index with parameters: {fileNum} - {(int)saveKey}"); return -1; } return num; } private static int GetDataIndex(int fileNum) { if (saveFileNums == null || saveFileNums.Count == 0) { if (Application.isEditor) { Logger.LogInfo((object)"null list when trying to GetDataIndex()"); } return -1; } int num = -1; for (int i = 0; i < savedStates.Count; i++) { if (i >= saveFileNums.Count) { Logger.LogError((object)$"[{i}] overflowed save data list... nums? {saveFileNums.Count}"); break; } if (saveFileNums[i] == fileNum) { num = i; break; } } if (num == -1) { Logger.LogWarning((object)$"failed to find data index with parameters: {fileNum}"); return -1; } return num; } public static string GetSaveDataFolder() { string text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData", "LocalLow", "ZeekerssRBLX", "Lethal Company"); if (!Directory.Exists(text)) { Logger.LogDebug((object)"couldn't find vanillaSaveFolder, returning assembly folder"); return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } string text2 = Path.Combine(text, "SimonTendo"); if (!Directory.Exists(text2)) { Logger.LogDebug((object)"No customSaveFolder existed yet, trying to create new one"); Directory.CreateDirectory(text2); } Logger.LogDebug((object)"Successfully found SaveData folder"); return text2; } } public class SongsManager : MonoBehaviour { private static ManualLogSource Logger; public static SongsManager Instance; private Dictionary currentlyPlayingSongs = new Dictionary(); private int checkDictionaryIndex; private Dictionary globalSongVolumeMultipliers = new Dictionary(); private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } private void Update() { if (currentlyPlayingSongs != null && currentlyPlayingSongs.Count != 0) { CheckCurrentlyPlayingSong(); } } private void CheckCurrentlyPlayingSong() { if (checkDictionaryIndex >= currentlyPlayingSongs.Count) { checkDictionaryIndex = 0; } KeyValuePair keyValuePair = currentlyPlayingSongs.ElementAt(checkDictionaryIndex); AudioSource key = keyValuePair.Key; Song value = keyValuePair.Value; checkDictionaryIndex++; if ((Object)(object)key != (Object)null && !key.isPlaying) { StopSong(value, key); return; } if (value.loopPoints != null && value.loopPoints.Length != 0) { CheckSongLoopPoints(value, key); } if (!value.customSetVolume) { CheckSongVolume(value, key); } } private void CheckSongLoopPoints(Song songToCheck, AudioSource audioSource) { if ((Object)(object)songToCheck == (Object)null || (Object)(object)audioSource == (Object)null || songToCheck.loopPoints == null || songToCheck.loopPoints.Length == 0) { return; } if (songToCheck.currentLoopIndex == -1) { if (songToCheck.introPoint != -1f) { if (audioSource.time >= songToCheck.introPoint) { UpdateSongIndex(songToCheck, 0); } } else if (audioSource.time >= songToCheck.loopPoints[0].x) { UpdateSongIndex(songToCheck, 0); } } else if (!songToCheck.ignoreNextLoopPoint) { if (songToCheck.currentLoopIndex < songToCheck.loopPoints.Length && audioSource.time >= songToCheck.loopPoints[songToCheck.currentLoopIndex].y) { LoopInSong(songToCheck, audioSource); } } else if (songToCheck.currentLoopIndex + 1 < songToCheck.loopPoints.Length && audioSource.time >= songToCheck.loopPoints[songToCheck.currentLoopIndex + 1].x) { UpdateSongIndex(songToCheck, songToCheck.currentLoopIndex + 1); SongShouldIgnoreNextLoop(songToCheck, setToIgnoreNextLoop: false); } } private void CheckSongVolume(Song songToCheck, AudioSource audioSource, bool snapToVolume = false) { if ((Object)(object)songToCheck == (Object)null || (Object)(object)audioSource == (Object)null || (Object)(object)NewDonkCityManager.Instance == (Object)null) { return; } float num = 0f; num = (NewDonkCityManager.Instance.localCameraInFactory ? songToCheck.volumeFactory : ((!NewDonkCityManager.Instance.localCameraInShip) ? songToCheck.volumeOutside : songToCheck.volumeHangarRoom)); if (songToCheck.affectedByGlobalMultiplier && globalSongVolumeMultipliers.Count > 0) { for (int i = 0; i < globalSongVolumeMultipliers.Count; i++) { num *= globalSongVolumeMultipliers.ElementAt(i).Value; } } if ((Object)(object)NewDonkCityManager.localPlayer != (Object)null && NewDonkCityManager.localPlayer.isPlayerDead) { num *= songToCheck.volumeDeadMultiplier; } if ((Object)(object)NewDonkCityManager.escapeMenu != (Object)null && NewDonkCityManager.escapeMenu.isMenuOpen) { num *= 0.5f; } if (!StartOfRound.Instance.shipDoorsEnabled) { num = 0.05f; } if (snapToVolume) { audioSource.volume = num; } else { audioSource.volume = Mathf.Lerp(audioSource.volume, num, 7.5f * Time.deltaTime); } if (num <= 0f && audioSource.volume < 0.1f) { audioSource.volume = 0f; } if (!(audioSource.volume > 0f) || !songToCheck.muteVanillaMusic) { return; } if ((Object)(object)TimeOfDay.Instance != (Object)null && (Object)(object)TimeOfDay.Instance.TimeOfDayMusic != (Object)null) { TimeOfDay.Instance.TimeOfDayMusic.volume = 0f; if (TimeOfDay.Instance.TimeOfDayMusic.isPlaying) { TimeOfDay.Instance.TimeOfDayMusic.Stop(); } } if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.musicSource != (Object)null) { SoundManager.Instance.musicSource.volume = 0f; if (SoundManager.Instance.musicSource.isPlaying) { SoundManager.Instance.musicSource.Stop(); } } if ((Object)(object)NewDonkCityManager.eclipseMusic != (Object)null && NewDonkCityManager.eclipseMusic.isPlaying) { NewDonkCityManager.eclipseMusic.Stop(); } } public void PlaySong(Song songToPlay, AudioSource playOnSource) { if (!((Object)(object)songToPlay == (Object)null) && !((Object)(object)playOnSource == (Object)null) && !currentlyPlayingSongs.ContainsKey(playOnSource)) { if (Application.isEditor) { Logger.LogDebug((object)$"PlaySong(): adding Key {playOnSource} with Value {songToPlay}"); } playOnSource.clip = songToPlay.songClip; playOnSource.Play(); songToPlay.currentLoopIndex = -1; currentlyPlayingSongs.Add(playOnSource, songToPlay); } } public void LoopInSong(Song songToLoop, AudioSource loopOnSource) { if (!((Object)(object)songToLoop == (Object)null) && songToLoop.currentLoopIndex != -1 && !((Object)(object)loopOnSource == (Object)null) && currentlyPlayingSongs.ContainsKey(loopOnSource)) { float num = songToLoop.loopPoints[songToLoop.currentLoopIndex].y - songToLoop.loopPoints[songToLoop.currentLoopIndex].x; loopOnSource.time -= num; if (Application.isEditor) { Logger.LogDebug((object)$"LoopInSong(): looping Song {songToLoop} on AudioSource {loopOnSource} on Update()!!"); } } } public void JumpInSong(Song songToJump, AudioSource jumpOnSource, int jumpToIndex = -99, bool jumpToStartOfLoop = true) { if ((Object)(object)songToJump == (Object)null || songToJump.loopPoints == null || songToJump.loopPoints.Length == 0 || (Object)(object)jumpOnSource == (Object)null || !currentlyPlayingSongs.ContainsKey(jumpOnSource)) { return; } if (jumpToIndex == -99) { jumpToIndex = songToJump.currentLoopIndex + 1; } if (Application.isEditor) { Logger.LogDebug((object)$"JumpInSong(): jumping in Song {songToJump} on AudioSource {jumpOnSource} to index {jumpToIndex}"); } UpdateSongIndex(songToJump, jumpToIndex); if (songToJump.currentLoopIndex == -1) { if (jumpToStartOfLoop) { jumpOnSource.time = 0f; } else if (songToJump.introPoint != -1f) { jumpOnSource.time = songToJump.introPoint; } else { jumpOnSource.time = songToJump.loopPoints[0].x; } } else if (songToJump.currentLoopIndex == songToJump.loopPoints.Length) { if (!jumpToStartOfLoop) { StopSong(songToJump, jumpOnSource); return; } if (songToJump.outroPoint != -1f) { jumpOnSource.time = songToJump.outroPoint; } else { jumpOnSource.time = songToJump.loopPoints[songToJump.loopPoints.Length - 1].y; } } else if (songToJump.currentLoopIndex < songToJump.loopPoints.Length) { if (jumpToStartOfLoop) { jumpOnSource.time = songToJump.loopPoints[songToJump.currentLoopIndex].x; } else { jumpOnSource.time = songToJump.loopPoints[songToJump.currentLoopIndex].y; } } if (!jumpToStartOfLoop) { SongShouldIgnoreNextLoop(songToJump, setToIgnoreNextLoop: true); } } public void JumpInSong(Song songToJump, AudioSource jumpOnSource, float jumpToTime, bool jumpToStartOfLoop = true) { if (!((Object)(object)songToJump == (Object)null) && !((Object)(object)jumpOnSource == (Object)null) && currentlyPlayingSongs.ContainsKey(jumpOnSource)) { if (jumpToTime == -99f) { jumpToTime = Mathf.Clamp(jumpToTime, 0f, songToJump.songClip.length); } if (Application.isEditor) { Logger.LogDebug((object)$"JumpInSong(): jumping in Song {songToJump} on AudioSource {jumpOnSource} to time {jumpToTime}"); } jumpOnSource.time = jumpToTime; UpdateSongIndex(jumpOnSource); if (!jumpToStartOfLoop) { SongShouldIgnoreNextLoop(songToJump, setToIgnoreNextLoop: true); } } } private void UpdateSongIndex(Song songToUpdate, int updateIndexTo) { if (!((Object)(object)songToUpdate == (Object)null) && updateIndexTo >= -1 && updateIndexTo <= songToUpdate.loopPoints.Length) { songToUpdate.currentLoopIndex = updateIndexTo; if (Application.isEditor) { Logger.LogDebug((object)$"UpdateSongIndex(): {songToUpdate} = {songToUpdate.currentLoopIndex}"); } } } private void UpdateSongIndex(AudioSource updateOnSource) { if ((Object)(object)updateOnSource == (Object)null || !currentlyPlayingSongs.ContainsKey(updateOnSource)) { return; } Song song = currentlyPlayingSongs[updateOnSource]; if ((Object)(object)song == (Object)null) { return; } if (song.introPoint != -1f && updateOnSource.time < song.introPoint) { UpdateSongIndex(song, -1); } else if (song.outroPoint != -1f && updateOnSource.time >= song.outroPoint) { int updateIndexTo = ((song.loopPoints != null && song.loopPoints.Length != 0) ? song.loopPoints.Length : 0); UpdateSongIndex(song, updateIndexTo); } else { if (song.loopPoints == null || song.loopPoints.Length == 0) { return; } int num = -99; for (int i = 0; i < song.loopPoints.Length; i++) { if (updateOnSource.time >= song.loopPoints[i].x && updateOnSource.time < song.loopPoints[i].y) { num = i; break; } } if (num == -99) { num = ((updateOnSource.time < song.loopPoints[0].x) ? (-1) : ((!(updateOnSource.time >= song.loopPoints[song.loopPoints.Length - 1].y)) ? song.currentLoopIndex : song.loopPoints.Length)); } UpdateSongIndex(song, num); } } public void SongShouldIgnoreNextLoop(Song songToUpdate, bool setToIgnoreNextLoop) { if (!((Object)(object)songToUpdate == (Object)null)) { songToUpdate.ignoreNextLoopPoint = setToIgnoreNextLoop; if (Application.isEditor) { Logger.LogDebug((object)$"SongShouldIgnoreNextLoop(): {songToUpdate} = {songToUpdate.ignoreNextLoopPoint}"); } } } public void JumpToOutro(Song songToFinish, AudioSource finishOnSource) { if (!((Object)(object)songToFinish == (Object)null) && !((Object)(object)finishOnSource == (Object)null) && currentlyPlayingSongs.ContainsKey(finishOnSource)) { if (Application.isEditor) { Logger.LogDebug((object)$"JumpToOutro(): jumping to end of song {songToFinish} on source {finishOnSource}"); } float jumpToTime = finishOnSource.time; if (songToFinish.outroPoint != -1f) { jumpToTime = songToFinish.outroPoint; } else if (songToFinish.loopPoints != null && songToFinish.loopPoints.Length != 0) { jumpToTime = songToFinish.loopPoints[songToFinish.loopPoints.Length - 1].y; } JumpInSong(songToFinish, finishOnSource, jumpToTime, jumpToStartOfLoop: false); } } public void StopSong(Song songToStop, AudioSource stopOnSource) { if (!((Object)(object)songToStop == (Object)null) && !((Object)(object)stopOnSource == (Object)null) && currentlyPlayingSongs.ContainsKey(stopOnSource)) { if (Application.isEditor) { Logger.LogDebug((object)$"StopSong(): removing Key {stopOnSource} with Value {songToStop}"); } stopOnSource.Stop(); stopOnSource.clip = null; UpdateSongIndex(songToStop, -1); SongShouldIgnoreNextLoop(songToStop, setToIgnoreNextLoop: false); currentlyPlayingSongs.Remove(stopOnSource); } } public void SetGlobalVolumeMultiplier(string multiplierKey, float multiplierValue) { if (!string.IsNullOrEmpty(multiplierKey)) { if (!globalSongVolumeMultipliers.ContainsKey(multiplierKey)) { globalSongVolumeMultipliers.Add(multiplierKey, multiplierValue); } else { globalSongVolumeMultipliers[multiplierKey] = multiplierValue; } } } public void RemoveGlobalVolumeMultiplier(string multiplierKey) { if (!string.IsNullOrEmpty(multiplierKey) && globalSongVolumeMultipliers.ContainsKey(multiplierKey)) { globalSongVolumeMultipliers.Remove(multiplierKey); } } } public class Conditional : MonoBehaviour { [Space(3f)] [Header("Conditions To Succeed")] [Tooltip("If true, all conditions must be true, otherwise it will instantly fail.\n\nIf false, it will instantly succeed upon meeting one condition.")] public bool andOr = true; [Space] [Tooltip("If set to None, it will always succeed.\n\nIf set to CheckScripts, it will use the array given in checkComponents.\n\nIf set to SubConditionals, it run the same check on the array given in checkSubConditions.\n\nIf set to another specific value, it will check fields on that one script.")] public ConditionalsManager.SpecialScript useValuesOf; public Behaviour[] checkComponents; [Space] public string[] checkFields; public ConditionalsManager.ComparisonType[] compareBy; [Tooltip("When comparing floats, make sure to type decimals behind a comma-sign.")] public string[] fieldValuesToMeet; [Space] [Tooltip("Check other Conditionals not in the conditionsContainer and run the same check with useValuesOf and checkComponents.\n\nMainly useful for combining AND with OR conditions.")] public Conditional[] checkSubConditions; [Space(3f)] [Header("Success")] [Tooltip("\"Succeeding\" is determined by the parameters under \"Conditions To Succeed\".")] public UnityEvent invokeOnSucceeding; [Tooltip("This means the condition will not be checked anymore for the rest of the day after after calling invokeOnSucceeding.")] public bool removeUponSucceedingCondition = true; [Space] [Header("Failure")] [Tooltip("\"Failing\" does not encapsulate errors when setting up this MonoBehaviour:\ncheckComponents, checkFields, fieldValuesToMeet, and compareBy should all have the same length to be correct.")] public UnityEvent invokeOnFailing; [Tooltip("This means the condition will not be checked anymore for the rest of the day after calling invokeOnFailing.")] public bool removeUponFailingCondition; } public class CustomDamagePlayerScript : MonoBehaviour { [Header("Damage")] [Range(1f, 100f)] public int damage = 25; public float cooldown = 1f; private Coroutine invincibilityCooldown; [Space(3f)] [Header("Death")] public int deathAnimation; public PlayGenericSound deathSFX; public int sfxIndex; public Vector3 deathForce; public CauseOfDeath deathCause; [Space(3f)] [Header("Misc")] public bool useFallDamage; public bool useExternalForce; public bool deathOnlyApplyForce; public bool deathOnlyPlaySFX = true; public void DamagePlayerLocal() { DoPlayerDamage(NewDonkCityManager.localPlayer); } public void DamagePlayerDynamic(PlayerControllerB playerToDamage) { DoPlayerDamage(playerToDamage); } public void DamagePlayerObject(GameObject playerObject) { if (!((Object)(object)playerObject == (Object)null)) { PlayerControllerB component = playerObject.GetComponent(); if (!((Object)(object)component == (Object)null) && component.isPlayerControlled) { DoPlayerDamage(component); } } } private void DoPlayerDamage(PlayerControllerB player) { //IL_0013: 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_0105: 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_0059: 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_0087: 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_00a6: 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_00ca: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_014d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || invincibilityCooldown != null) { return; } Vector3 val = player.externalForceAutoFade; if (!useExternalForce && (Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.tempTransform != (Object)null) { RoundManager.Instance.tempTransform.position = ((Component)this).transform.position; RoundManager.Instance.tempTransform.LookAt(player.lowerSpine.position); val = RoundManager.Instance.tempTransform.right * deathForce.x + RoundManager.Instance.tempTransform.up * deathForce.y + RoundManager.Instance.tempTransform.forward * deathForce.z; } Plugin.Logger.LogDebug((object)$"{this} damaging {player}"); player.DamagePlayer(damage, true, true, deathCause, deathAnimation, useFallDamage, val); if (!player.isPlayerDead) { if (cooldown > 0f) { invincibilityCooldown = ((MonoBehaviour)this).StartCoroutine(DamageBoostCooldown()); } if (!deathOnlyApplyForce) { player.externalForceAutoFade = val; } } if ((Object)(object)deathSFX != (Object)null && (player.isPlayerDead || !deathOnlyPlaySFX)) { deathSFX.PlaySyncedSFX(sfxIndex); } } private IEnumerator DamageBoostCooldown() { yield return (object)new WaitForSeconds(cooldown); invincibilityCooldown = null; } } public abstract class DogState : NetworkBehaviour { [HideInInspector] public DogAI mainScript; [HideInInspector] public bool stateActive; [Header("AI")] public float intervalTime = 0.5f; public DogState[] canSwitchTo; [Space(3f)] [Header("Agent")] public float agentSpeed = -1f; public float agentAngularSpeed = -1f; public float agentAcceleration = -1f; public float agentStoppingDistance = -1f; [Space] public bool agentAutoBraking = true; public bool overrideAutoBraking = true; public void Initialize(DogAI owner) { mainScript = owner; stateActive = false; OnInitializing(); } public virtual void OnInitializing() { } public virtual void OnStateEnter(GameObject[] relatedObjects) { stateActive = true; mainScript.SetAgentParameters(agentSpeed, agentAngularSpeed, agentAcceleration, agentStoppingDistance, agentAutoBraking, overrideAutoBraking); if (!Application.isEditor || relatedObjects == null || relatedObjects.Length == 0) { return; } for (int i = 0; i < relatedObjects.Length; i++) { if (!((Object)(object)relatedObjects[i] == (Object)null)) { Plugin.Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} locally entered with stateChangeObject #{i}: {relatedObjects[i]}"); } } } public virtual void OnStateExit() { stateActive = false; } public virtual void DoStateLogic() { if (stateActive && !WillSwitchOutOfState()) { SpecialStateBehaviour(); } } public virtual bool WillSwitchOutOfState() { if (canSwitchTo != null && canSwitchTo.Length != 0) { for (int i = 0; i < canSwitchTo.Length; i++) { if (!((Object)(object)canSwitchTo[i] == (Object)null) && mainScript.StoreStateChangeObjects(canSwitchTo[i].CheckStateEnterCondition(this))) { mainScript.SwitchState(canSwitchTo[i], mainScript.stateChangeObjects, $"E: this = {this}"); return true; } } } return false; } public virtual void SpecialStateBehaviour() { } public virtual GameObject[] CheckStateEnterCondition(DogState fromState) { return null; } public virtual void AnimationEvent(int switchCase) { } public virtual GrabbableObject VisibleThreatGetHeldObject() { return null; } public virtual int VisibleThreatGetThreatLevel(Vector3 seenByPosition) { return 0; } public virtual int VisibleThreatGetInterestLevel() { return 0; } public virtual float VisibleThreatGetVisibility() { return 0f; } public virtual void NoiseListenerDetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DogState"; } } public class DynamicMaterial : MonoBehaviour { public MeshRenderer[] setRenderers; private int indexRenderer; private Vector2 tempVector; private int initializationState = -1; [Space(3f)] [Header("Offset")] [Range(-1f, 1f)] public int updateOffsetX; public float overtimeOffsetX = 1f; [Range(-1f, 1f)] public int updateOffsetY; public float overtimeOffsetY = 1f; [Space] public float pauseAfterLooping; private float pausedTimer; [Space(3f)] [Header("Color")] public Color[] interpolationColors; private Vector4 previousColor; private Vector4 targetColor; public float overtimeColor = 1f; private float colorTimer; private int indexColor; [Space(3f)] [Header("Performance")] public bool allAtOnce; public bool updateInsideShip = true; public bool updateInsideFactory; public void OnLoadDelay() { initializationState = 0; DetermineNewIndexColor(); } private void Update() { if (initializationState == -1 || (!updateInsideShip && ((Object)(object)NewDonkCityManager.Instance == (Object)null || NewDonkCityManager.Instance.localCameraInShip)) || (!updateInsideFactory && ((Object)(object)NewDonkCityManager.Instance == (Object)null || NewDonkCityManager.Instance.localCameraInFactory))) { return; } if (initializationState == 0) { initializationState = 1; bool flag = false; if (setRenderers == null || setRenderers.Length == 0) { flag = true; } if (updateOffsetX == 0 && updateOffsetY == 0 && (interpolationColors == null || interpolationColors.Length < 2)) { flag = true; } if (flag) { Object.Destroy((Object)(object)this); return; } } DoRenderUpdate(); } private void DoRenderUpdate() { if (pausedTimer > 0f) { pausedTimer -= Time.deltaTime; return; } if (allAtOnce) { for (int i = 0; i < setRenderers.Length; i++) { UpdateMaterial(i); } } else { UpdateMaterial(indexRenderer); DetermineNewIndexRenderer(); } if (interpolationColors != null && interpolationColors.Length > 1) { colorTimer += Time.deltaTime; if (colorTimer >= overtimeColor) { DetermineNewIndexColor(); } } } private void UpdateMaterial(int index) { if (index >= 0 && index < setRenderers.Length && !((Object)(object)setRenderers[index] == (Object)null) && !((Object)(object)((Renderer)setRenderers[index]).material == (Object)null)) { if (updateOffsetX != 0 || updateOffsetY != 0) { MoveRendererMaterialToOffset(index); LoopOffsetWithinRange(index); } if (interpolationColors != null && interpolationColors.Length > 1) { MoveRendererColor(index); } } } private void MoveRendererMaterialToOffset(int index) { //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_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_0062: Unknown result type (might be due to invalid IL or missing references) tempVector = Vector2.zero; if (updateOffsetX != 0) { tempVector.x = Time.deltaTime / overtimeOffsetX; } if (updateOffsetY != 0) { tempVector.y = Time.deltaTime / overtimeOffsetY; } Material material = ((Renderer)setRenderers[index]).material; material.mainTextureOffset += tempVector; } private void LoopOffsetWithinRange(int index) { //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_0116: Unknown result type (might be due to invalid IL or missing references) tempVector = ((Renderer)setRenderers[index]).material.mainTextureOffset; if (updateOffsetX > 0 && tempVector.x > 1f) { tempVector.x -= 1f; pausedTimer = pauseAfterLooping; } else if (updateOffsetX < 0 && tempVector.x < -1f) { tempVector.x += 1f; pausedTimer = pauseAfterLooping; } if (updateOffsetY > 0 && tempVector.y > 1f) { tempVector.y -= 1f; pausedTimer = pauseAfterLooping; } else if (updateOffsetY < 0 && tempVector.y < -1f) { tempVector.y += 1f; pausedTimer = pauseAfterLooping; } ((Renderer)setRenderers[index]).material.mainTextureOffset = tempVector; } private void MoveRendererColor(int index) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) ((Renderer)setRenderers[index]).material.color = Color.Lerp(Color.op_Implicit(previousColor), Color.op_Implicit(targetColor), colorTimer / overtimeColor); } private void DetermineNewIndexRenderer() { indexRenderer++; if (indexRenderer >= setRenderers.Length) { indexRenderer = 0; } } private void DetermineNewIndexColor() { //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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (interpolationColors != null && interpolationColors.Length >= 2) { colorTimer = 0f; previousColor = Color.op_Implicit(interpolationColors[indexColor]); indexColor++; if (indexColor >= interpolationColors.Length) { indexColor = 0; } targetColor = Color.op_Implicit(interpolationColors[indexColor]); } } } public class EventMessenger : MonoBehaviour, IHittable, IPhysicsSearchable { private string keyName = "Event Messenger"; [Header("SIMPLE")] public UnityEvent eventDefault1 = new UnityEvent(); public UnityEvent eventDefault2 = new UnityEvent(); public UnityEvent eventDefault3 = new UnityEvent(); public UnityEvent eventDefault4 = new UnityEvent(); public UnityEvent eventDefault5 = new UnityEvent(); [Space(3f)] [Header("SCENE")] public UnityEvent eventOnLoadDelay = new UnityEvent(); public UnityEvent eventOnDayEnd = new UnityEvent(); [Space(3f)] [Header("PLAYERS")] public UnityEvent eventPlayerLocal = new UnityEvent(); public UnityEvent eventPlayerDynamic = new UnityEvent(); public UnityEvent eventPlayerHittable = new UnityEvent(); [Space] [Header("TRIGGERS")] public int collidersToCallEnter = -1; public UnityEvent eventObjectTriggerEnter = new UnityEvent(); public int collidersToCallExit = -1; public UnityEvent eventObjectTriggerExit = new UnityEvent(); [Space(3f)] [Header("Misc")] public bool onlyOnServer; public bool onlyOnNetworkOwner; public bool syncToAllClients; private int collidersEntered; string IPhysicsSearchable.keyName => keyName; public void InvokeEventDefault1() { if (CanCallEvent()) { eventDefault1.Invoke(); SyncEvent(1); } } public void InvokeEventDefault2() { if (CanCallEvent()) { eventDefault2.Invoke(); SyncEvent(2); } } public void InvokeEventDefault3() { if (CanCallEvent()) { eventDefault3.Invoke(); SyncEvent(3); } } public void InvokeEventDefault4() { if (CanCallEvent()) { eventDefault4.Invoke(); SyncEvent(4); } } public void InvokeEventDefault5() { if (CanCallEvent()) { eventDefault5.Invoke(); SyncEvent(5); } } public void InvokeEventOnLoadDelay() { if (CanCallEvent()) { eventOnLoadDelay.Invoke(); SyncEvent(6); } } public void InvokeEventOnDayEnd() { if (CanCallEvent()) { eventOnDayEnd.Invoke(); SyncEvent(7); } } public void InvokeEventPlayerLocal() { if (CanCallEvent(((Object)(object)NewDonkCityManager.localPlayer != (Object)null) ? ((Component)NewDonkCityManager.localPlayer).gameObject : null)) { eventPlayerLocal.Invoke(NewDonkCityManager.localPlayer); SyncEvent(8); } } public void InvokeEventPlayerDynamic(PlayerControllerB dynamicPlayer) { if (CanCallEvent(((Object)(object)dynamicPlayer != (Object)null) ? ((Component)dynamicPlayer).gameObject : null)) { eventPlayerDynamic.Invoke(dynamicPlayer); SyncEvent(9); } } private void InvokeEventPlayerHittable(PlayerControllerB playerWhoHit) { if (CanCallEvent(((Object)(object)playerWhoHit != (Object)null) ? ((Component)playerWhoHit).gameObject : null)) { eventPlayerHittable.Invoke(playerWhoHit); SyncEvent(10); } } private void InvokeEventTriggerEnter(GameObject objectEntered) { if (CanCallEvent(objectEntered)) { eventObjectTriggerEnter.Invoke(objectEntered); SyncEvent(11, objectEntered); } } private void InvokeEventTriggerExit(GameObject objectExited) { if (CanCallEvent(objectExited)) { eventObjectTriggerExit.Invoke(objectExited); SyncEvent(12, objectExited); } } public void OnLoadDelay() { InvokeEventOnLoadDelay(); } public void OnDayEnd() { InvokeEventOnDayEnd(); } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (eventPlayerHittable == null || ((UnityEventBase)eventPlayerHittable).GetPersistentEventCount() == 0) { return false; } InvokeEventPlayerHittable(playerWhoHit); return true; } private void OnTriggerEnter(Collider other) { if ((Object)(object)other == (Object)null) { return; } PlayerControllerB component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && !component.isPlayerControlled) { return; } EnemyAI component2 = ((Component)other).GetComponent(); if ((Object)(object)component2 != (Object)null && component2.isEnemyDead) { return; } EnemyAICollisionDetect component3 = ((Component)other).GetComponent(); if (!((Object)(object)component3 != (Object)null) || !((Object)(object)component3.mainScript != (Object)null) || !component3.mainScript.isEnemyDead) { collidersEntered++; if (collidersToCallEnter == -1 || collidersEntered >= collidersToCallEnter) { InvokeEventTriggerEnter(((Component)other).gameObject); } } } private void OnTriggerExit(Collider other) { if (!((Object)(object)other == (Object)null)) { collidersEntered--; if (collidersToCallExit == -1 || collidersEntered <= collidersToCallExit) { InvokeEventTriggerExit(((Component)other).gameObject); } } } private void SyncEvent(int methodID, GameObject linkedObject = null) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (syncToAllClients) { PropsManager.CallMonoBehaviourNetworkEvent(NewDonkCityManager.localPlayer, ((Component)this).transform.position, keyName, methodID, linkedObject); } } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { switch (specialID) { case 1: eventDefault1.Invoke(); break; case 2: eventDefault2.Invoke(); break; case 3: eventDefault3.Invoke(); break; case 4: eventDefault4.Invoke(); break; case 5: eventDefault5.Invoke(); break; case 6: eventOnLoadDelay.Invoke(); break; case 7: eventOnDayEnd.Invoke(); break; case 8: eventPlayerLocal.Invoke(NewDonkCityManager.localPlayer); break; case 9: eventPlayerDynamic.Invoke(calledBy); break; case 10: eventPlayerHittable.Invoke(calledBy); break; case 11: eventObjectTriggerEnter.Invoke(linkedObject); break; case 12: eventObjectTriggerExit.Invoke(linkedObject); break; } } private bool CanCallEvent(GameObject relatingToObject = null) { if (onlyOnServer && !NewDonkCityManager.localPlayerServer) { return false; } if (onlyOnNetworkOwner && (Object)(object)relatingToObject != (Object)null) { NetworkBehaviour componentInChildren = relatingToObject.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || (Object)(object)componentInChildren.NetworkObject == (Object)null || !componentInChildren.NetworkObject.IsOwner) { return false; } } return true; } } [RequireComponent(typeof(BoxCollider))] public class GeneralCollisionBounds : MonoBehaviour { public enum SpecificMoonTypes { ItemActivate, BehaviourTriggerEnter, BoomboxMusicians } public SpecificMoonTypes moonType; [Space(3f)] [Header("Specifics")] [Tooltip("Simply checks if a GrabbaleObject with ItemActivate with an Item with this name has been used inside the bounds.")] public string itemAssetName; [Tooltip("Simply checks if a MonoBehaviour that entered this trigger has a class name that matches this string.")] public string behaviourClassName; [HideInInspector] public BoxCollider colliderBounds; [HideInInspector] public bool moonSucceeded; private void Awake() { colliderBounds = ((Component)this).GetComponent(); } private void OnTriggerEnter(Collider other) { if (!((Object)(object)other == (Object)null) && !moonSucceeded) { CheckMonoBehaviourInTrigger(this, ((Component)other).gameObject); CheckBoomboxMusicians(this, ((Component)other).gameObject); } } private static void CheckItemActivatedInsideBounds(GeneralCollisionBounds forBounds, GrabbableObject itemActivated) { if (!((Object)(object)forBounds == (Object)null) && forBounds.moonType == SpecificMoonTypes.ItemActivate && !((Object)(object)itemActivated == (Object)null) && !((Object)(object)itemActivated.itemProperties == (Object)null) && !string.IsNullOrEmpty(forBounds.itemAssetName) && ((Object)itemActivated.itemProperties).name == forBounds.itemAssetName) { forBounds.moonSucceeded = true; } } private static void CheckMonoBehaviourInTrigger(GeneralCollisionBounds forBounds, GameObject onObject) { if ((Object)(object)forBounds == (Object)null || forBounds.moonType != SpecificMoonTypes.BehaviourTriggerEnter || (Object)(object)onObject == (Object)null) { return; } MonoBehaviour[] components = onObject.GetComponents(); if (components == null || components.Length == 0) { return; } for (int i = 0; i < components.Length; i++) { if (!((Object)(object)components[i] == (Object)null) && ((object)components[i]).GetType().ToString() == forBounds.behaviourClassName) { forBounds.moonSucceeded = true; break; } } } private static void CheckBoomboxMusicians(GeneralCollisionBounds forBounds, GameObject onObject) { if (!((Object)(object)forBounds == (Object)null) && forBounds.moonType == SpecificMoonTypes.BoomboxMusicians && !((Object)(object)onObject == (Object)null)) { BoomboxItem component = onObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((GrabbableObject)component).itemProperties != (Object)null && ((Object)((GrabbableObject)component).itemProperties).name == "Boombox" && component.isPlayingMusic) { forBounds.moonSucceeded = true; } } } public static void ItemActivatedInsideBounds(GrabbableObject item) { //IL_0116: 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_0125: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel || (Object)(object)NewDonkCityManager.Instance == (Object)null || (Object)(object)item == (Object)null || (Object)(object)PropsManager.Instance == (Object)null || !((NetworkBehaviour)PropsManager.Instance).IsServer || PropsManager.Instance.generalBoundsContainers == null || PropsManager.Instance.generalBoundsContainers.Length == 0) { return; } GeneralCollisionBounds generalCollisionBounds = null; bool flag = false; for (int i = 0; i < PropsManager.Instance.generalBoundsContainers.Length; i++) { if (flag) { break; } if ((Object)(object)PropsManager.Instance.generalBoundsContainers[i] == (Object)null || PropsManager.Instance.generalBoundsContainers[i].childCount == 0) { continue; } for (int j = 0; j < PropsManager.Instance.generalBoundsContainers[i].childCount; j++) { if (flag) { break; } if ((Object)(object)PropsManager.Instance.generalBoundsContainers[i].GetChild(j) == (Object)null) { continue; } generalCollisionBounds = ((Component)PropsManager.Instance.generalBoundsContainers[i].GetChild(j)).GetComponent(); if (!((Object)(object)generalCollisionBounds == (Object)null) && !((Object)(object)generalCollisionBounds.colliderBounds == (Object)null)) { Bounds bounds = ((Collider)generalCollisionBounds.colliderBounds).bounds; if (((Bounds)(ref bounds)).Contains(((Component)item).transform.position)) { flag = true; } } } } if (!((Object)(object)generalCollisionBounds == (Object)null) && !generalCollisionBounds.moonSucceeded) { CheckItemActivatedInsideBounds(generalCollisionBounds, item); CheckBoomboxMusicians(generalCollisionBounds, ((Component)item).gameObject); } } } public class GiveInteractableIcon : MonoBehaviour { private void Start() { InteractTrigger component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.allPlayerScripts != null && StartOfRound.Instance.allPlayerScripts.Length != 0 && (Object)(object)StartOfRound.Instance.allPlayerScripts[0] != (Object)null) { component.hoverIcon = StartOfRound.Instance.allPlayerScripts[0].grabItemIcon; } } } public interface IAssetReceiver { void SendAudioClips(); void ReceiveIntegers(int[] indeces); } public interface IHitboxMainScript { void HitboxTriggerEntered(Hitbox hitbox, Collider other); } public interface IPhysicsSearchable { string keyName { get; } void CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject); } [RequireComponent(typeof(Rigidbody))] public class KickableRigidbody : MonoBehaviour { private bool kicked; private float timeLastHit; [Header("Start")] public Rigidbody ownRigidbody; public float kickForce = 10f; public AudioClip kickSound; public float kickPitchOffset; [Space(3f)] [Header("Middle")] public Collider ownCollider; public float friction = 5f; [Range(0f, 1f)] public float bounciness = 0.5f; public PhysicMaterialCombine combineType = (PhysicMaterialCombine)3; [Space(3f)] [Header("End")] public float lifetime = 2.5f; private void Start() { kicked = false; if ((Object)(object)ownRigidbody == (Object)null) { ownRigidbody = ((Component)this).GetComponent(); } if ((Object)(object)ownCollider == (Object)null) { ownCollider = ((Component)this).GetComponent(); } if ((Object)(object)ownRigidbody != (Object)null) { ownRigidbody.isKinematic = true; } if ((Object)(object)ownCollider != (Object)null) { ownCollider.isTrigger = true; } } public void PlayerKickRigidbody(PlayerControllerB player) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && player.isPlayerControlled) { KickRigidbody(player.oldPlayerPosition); } } public void KickRigidbody(Vector3 position) { //IL_0030: 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_0041: 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_0051: 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_005b: 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_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_0093: 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_00a6: 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_0145: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ownRigidbody == (Object)null || kicked) { return; } kicked = true; ((Component)this).transform.SetParent((Transform)null); Vector3 val = Vector3.Normalize(((Component)this).transform.position - new Vector3(position.x, ((Component)this).transform.position.y, position.z)) * kickForce + Vector3.up * kickForce; ownRigidbody.isKinematic = false; ownRigidbody.AddForce(val, (ForceMode)2); ownRigidbody.AddTorque(val * 2f, (ForceMode)2); if ((Object)(object)ownCollider != (Object)null) { ownCollider.isTrigger = false; if ((Object)(object)ownCollider.material != (Object)null) { ownCollider.material.staticFriction = friction; ownCollider.material.dynamicFriction = friction; ownCollider.material.bounciness = bounciness; ownCollider.material.frictionCombine = combineType; ownCollider.material.bounceCombine = combineType; } } PlayKickSFX(); if (lifetime > 0f) { ((MonoBehaviour)this).StartCoroutine(DestroyAfterLifetime()); } } private IEnumerator DestroyAfterLifetime() { while (lifetime > 0f) { yield return null; if ((Object)(object)NewDonkCityManager.Instance != (Object)null && Object.op_Implicit((Object)(object)NewDonkCityManager.Instance.destroyPropsHeight) && NewDonkCityManager.Instance.destroyPropsHeight.position.y > ((Component)this).transform.position.y) { lifetime = 0f; break; } lifetime -= Time.deltaTime; } Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnCollisionEnter(Collision collision) { if (!kicked || Time.realtimeSinceStartup - timeLastHit < 0.25f) { return; } PlayKickSFX(); if (collision == null || !((Object)(object)collision.collider != (Object)null)) { return; } EnemyAICollisionDetect component = ((Component)collision.collider).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.mainScript != (Object)null && !component.mainScript.isEnemyDead) { NPCEnemyAI component2 = ((Component)component.mainScript).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.GetHurt(); } } } private void PlayKickSFX() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) timeLastHit = Time.realtimeSinceStartup; GenericManager.PlaySFXAtLocation(((Component)this).transform.position, kickSound, NewDonkCityManager.localPlayerServer, kickForce, 0.65f, kickPitchOffset); } } public class LoadedDataState { public bool loadSuccessful; public object loadedValue; public LoadedDataState(bool successful, object value = null) { loadSuccessful = successful; loadedValue = value; } } public class LoadEvents : MonoBehaviour { public bool onSceneLoad; public bool onLoadDelay; public bool onDayEnd; [Space(3f)] [Header("Start()")] public bool autoAddOnStart; public bool autoAddAllowDuplicate; private void Start() { if (autoAddOnStart) { AddEventsToManager(autoAddAllowDuplicate); } } public void AddEventsToManager(bool allowDuplicate = false) { if (!((Object)(object)PropsManager.Instance == (Object)null) && PropsManager.Instance.sendTimedEvents != null && (allowDuplicate || !PropsManager.Instance.sendTimedEvents.Contains(this))) { PropsManager.Instance.sendTimedEvents.Add(this); } } } public class LocalNetworkObject : MonoBehaviour, IPhysicsSearchable { private string keyName = "Local NetworkObject"; public GameObject serverSpawnPrefab; public Transform spawnPrefabParent; string IPhysicsSearchable.keyName => keyName; void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { } } public class LocalPlayerHitSurface : MonoBehaviour { public bool isFloor = true; public UnityEvent invokeOnHit = new UnityEvent(); public void LocallyHitThisSurface() { invokeOnHit.Invoke(); } } [CreateAssetMenu(menuName = "New Donk City/MaterialArray")] public class MaterialArray : ScriptableObject { public Material[] materials; } public class MoveToPointData : MonoBehaviour { [HideInInspector] public MoveToPoint movingTowards; [HideInInspector] public Coroutine movementCoroutine; [HideInInspector] public Animator coroutineAnimation; [HideInInspector] public AudioSource coroutineAudio; [HideInInspector] public ParticleSystem coroutineParticles; public void StoreMovementCoroutine(MoveToPoint destinationScript, Coroutine movement, Animator animator, AudioSource audio, ParticleSystem particles) { if ((Object)(object)movingTowards != (Object)null || movementCoroutine != null) { if (Application.isEditor) { Plugin.Logger.LogWarning((object)$"please do not store two coroutines on object {this}"); } } else if (!((Object)(object)destinationScript == (Object)null) && movement != null) { movingTowards = destinationScript; movementCoroutine = movement; coroutineAnimation = animator; coroutineAudio = audio; coroutineParticles = particles; } } public void StoreMovementCoroutineComponents(MoveToPoint matchScript, Animator animator, AudioSource audio, ParticleSystem particles) { if (!((Object)(object)matchScript == (Object)null) && !((Object)(object)movingTowards == (Object)null) && !((Object)(object)matchScript != (Object)(object)movingTowards)) { coroutineAnimation = animator; coroutineAudio = audio; coroutineParticles = particles; } } public void PauseMovementCoroutine() { if (!((Object)(object)movingTowards == (Object)null)) { movingTowards.SetPausedMovementTo(setTo: true, coroutineAnimation); } } public void UnpauseMovementCoroutine() { if (!((Object)(object)movingTowards == (Object)null)) { movingTowards.SetPausedMovementTo(setTo: false, coroutineAnimation); } } public void WipeMovementCoroutine() { if (!((Object)(object)movingTowards == (Object)null)) { WipeMovementCoroutineComponents(); } } public void WipeMovementCoroutineIfMatching(MoveToPoint matchScript) { if ((Object)(object)movingTowards == (Object)null || (Object)(object)matchScript == (Object)null) { return; } if ((Object)(object)movingTowards != (Object)(object)matchScript) { if (Application.isEditor) { Plugin.Logger.LogWarning((object)$"{this}: no match // {movingTowards} & {matchScript}"); } } else { WipeMovementCoroutineComponents(); } } public void WipeMovementCoroutineAndStop() { if (!((Object)(object)movingTowards == (Object)null) && movementCoroutine != null) { ((MonoBehaviour)movingTowards).StopCoroutine(movementCoroutine); WipeMovementCoroutineComponents(); } } private void WipeMovementCoroutineComponents() { movingTowards = null; movementCoroutine = null; coroutineAnimation = null; coroutineAudio = null; coroutineParticles = null; } } public enum NPCAnimation { None, Walking1, Walking2, Idle1, Idle2, Sitting1, Sitting2, Cheer1, Cheer2, Special1, Special2, Greeting, Damaged } [CreateAssetMenu(menuName = "New Donk City/NPCData")] public class NPCData : ScriptableObject { public EnemyType npcEnemyType; [Space(3f)] [Header("Spawning")] public int maxSpawnCount = 15; [HideInInspector] public int numberSpawned; [Range(0f, 100f)] public int chanceToSpawn = 50; public List cannotSpawnIn; [Space(3f)] [Header("Visuals")] public MaterialArray[] randomMats; } public class PlatformingChallenge : NetworkBehaviour { public GameObject spawnPrefab; public Transform spawnPosition; public MoonData moonToSpawn; private GameObject instantiatedObject; public void SpawnContainerAndSync() { if (((NetworkBehaviour)this).IsServer) { SpawnContainerClientRpc(); SpawnContainerLocally(); } } [ClientRpc] private void SpawnContainerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3481511365u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3481511365u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { SpawnContainerLocally(); } } } public void SpawnContainerLocally() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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) if ((Object)(object)instantiatedObject != (Object)null) { return; } instantiatedObject = new GameObject("PrefabContainer"); instantiatedObject.transform.SetParent(((Component)this).transform, true); Object.Instantiate(spawnPrefab, spawnPosition.position, spawnPosition.rotation, instantiatedObject.transform); if (!((NetworkBehaviour)this).IsServer) { return; } if ((Object)(object)moonToSpawn != (Object)null) { moonToSpawn.SpawnMoon(); } LocalNetworkObject[] componentsInChildren = instantiatedObject.GetComponentsInChildren(); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } foreach (LocalNetworkObject localNetworkObject in componentsInChildren) { if ((Object)(object)localNetworkObject == (Object)null || (Object)(object)localNetworkObject.serverSpawnPrefab == (Object)null) { continue; } Transform val = ((Component)localNetworkObject).transform; if ((Object)(object)localNetworkObject.spawnPrefabParent != (Object)null) { val = localNetworkObject.spawnPrefabParent; } GameObject val2 = Object.Instantiate(localNetworkObject.serverSpawnPrefab, val.position, val.rotation, val); if (!((Object)(object)val2 == (Object)null)) { NetworkObject componentInChildren = val2.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Object.Destroy((Object)(object)val2); } else { componentInChildren.Spawn(false); } } } } public void DestroyContainerAndSync() { if (((NetworkBehaviour)this).IsServer) { DestroyContainerClientRpc(); DestroyContainerLocally(); } } [ClientRpc] private void DestroyContainerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(155550210u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 155550210u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { DestroyContainerLocally(); } } } public void DestroyContainerLocally() { if ((Object)(object)instantiatedObject == (Object)null) { return; } if (((NetworkBehaviour)this).IsServer) { if ((Object)(object)moonToSpawn != (Object)null) { moonToSpawn.DespawnMoon(); } NetworkObject[] componentsInChildren = instantiatedObject.GetComponentsInChildren(); if (componentsInChildren != null && componentsInChildren.Length != 0) { for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Despawn(true); } } } Object.Destroy((Object)(object)instantiatedObject); } 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(3481511365u, new RpcReceiveHandler(__rpc_handler_3481511365), "SpawnContainerClientRpc"); ((NetworkBehaviour)this).__registerRpc(155550210u, new RpcReceiveHandler(__rpc_handler_155550210), "DestroyContainerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3481511365(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; ((PlatformingChallenge)(object)target).SpawnContainerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_155550210(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; ((PlatformingChallenge)(object)target).DestroyContainerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlatformingChallenge"; } } public class PlayGenericSound : MonoBehaviour, IAssetReceiver { public AudioClip[] clips; public bool addToSyncedClips; public Transform soundPosition; [Space(3f)] [Header("Parameters")] public bool sfxWalkieTransmit = true; [Space] public bool sfxAudible = true; public float sfxRange = 20f; [Range(0f, 1f)] public float sfxLoudness = 0.8f; [Range(0f, 1f)] public float sfxDoppler = 1f; [Range(-4f, 2f)] public float sfxPitch; public int sfxID; [Space] public bool sfxMono; public bool syncMono; public void PlayNonSourcedSFX(int sfxIndex) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (clips != null && clips.Length != 0 && sfxIndex >= 0 && sfxIndex < clips.Length) { GetSoundPosition(); GenericManager.PlaySFXAtLocation(soundPosition.position, clips[sfxIndex], sfxAudible, sfxRange, sfxLoudness, sfxDoppler, sfxPitch, sfxMono, sfxID, sfxWalkieTransmit); } } public void PlayFirstLocalMonoSFX(PlayerControllerB player) { PlayLocalMonoSFX(player, 0); } public void PlayLocalMonoSFX(PlayerControllerB player, int sfxIndex) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (clips != null && clips.Length != 0 && sfxIndex >= 0 && sfxIndex < clips.Length) { GetSoundPosition(); GenericManager.PlaySFXAtLocation(soundPosition.position, clips[sfxIndex], sfxAudible, sfxRange, sfxLoudness, sfxDoppler, sfxPitch, (Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)NewDonkCityManager.localPlayer, sfxID, sfxWalkieTransmit); } } public void PlaySyncedSFX(int sfxIndex) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (clips != null && clips.Length != 0 && sfxIndex >= 0 && sfxIndex < clips.Length) { GetSoundPosition(); GenericManager.PlaySFXSynced(soundPosition.position, clips[sfxIndex], sfxAudible, sfxRange, sfxLoudness, sfxDoppler, sfxPitch, sfxMono, syncMono, sfxID, sfxWalkieTransmit); } } public void PlaySyncedFirstLocalMonoSFX(PlayerControllerB player) { PlaySyncedLocalMonoSFX(player, 0); } public void PlaySyncedLocalMonoSFX(PlayerControllerB player, int sfxIndex) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (clips != null && clips.Length != 0 && sfxIndex >= 0 && sfxIndex < clips.Length) { GetSoundPosition(); GenericManager.PlaySFXSynced(soundPosition.position, clips[sfxIndex], sfxAudible, sfxRange, sfxLoudness, sfxDoppler, sfxPitch, (Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)NewDonkCityManager.localPlayer, isMonoSynced: false, sfxID, sfxWalkieTransmit); } } private void GetSoundPosition() { if ((Object)(object)soundPosition == (Object)null) { soundPosition = ((Component)this).transform; } } public void OnLoadDelay() { if (addToSyncedClips) { ((IAssetReceiver)this).SendAudioClips(); } } void IAssetReceiver.SendAudioClips() { NewDonkCityManager.ReceiveAssetReceiverAssets(this, clips, 0, checkBox: false); } void IAssetReceiver.ReceiveIntegers(int[] indeces) { } } public class PumaTree : MonoBehaviour { private void Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PropsManager.Instance != (Object)null) { Object.Instantiate(PropsManager.Instance.pumaTreeTerrainCheck, ((Component)this).transform.position, Quaternion.identity, PropsManager.Instance.pumaTreeTerrainContainer); } } } public class RotateObject : MonoBehaviour { private Vector3 rotation; private Space space = (Space)1; public void Initialize(Vector3 vector, Space type) { //IL_0001: 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) SetRotation(vector); SetSpace(type); } public void Initialize(float x, float y, float z, Space type) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) SetRotation(x, y, z); SetSpace(type); } public void SetRotation(float x, float y, float z) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) rotation = new Vector3(x, y, z); } public void SetRotation(Vector3 vector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) rotation = vector; } public void SetSpace(Space type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) space = type; } private void Update() { //IL_0007: 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_0017: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Rotate(rotation * Time.deltaTime, space); } } public class SaveableObject : MonoBehaviour { public SaveDataManager.SaveKey saveKey; public void SaveData(int saveDataState, int saveFileNum = -1) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) SaveDataManager.SetDataToSave(GetSaveFileNum(saveFileNum), saveKey, ((Component)this).transform.position, saveDataState); } public LoadedDataState RetrieveData(int saveFileNum = -1) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) return SaveDataManager.GetSavedDataSingle(GetSaveFileNum(saveFileNum), saveKey, ((Component)this).transform.position); } public void DeleteData(int saveFileNum = -1) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) SaveDataManager.DeleteSavedData(GetSaveFileNum(saveFileNum), saveKey, ((Component)this).transform.position); } private int GetSaveFileNum(int providedNum) { if (providedNum == -1 && (Object)(object)GameNetworkManager.Instance != (Object)null) { return GameNetworkManager.Instance.saveFileNum; } return providedNum; } } [CreateAssetMenu(menuName = "New Donk City/SitAnimationData")] public class SitAnimationData : ScriptableObject { public string animationString; public bool isVehicleAnimation; public Vector3 playerPositionOffset; } public class SnapPlayerToPosition : MonoBehaviour { private bool doPlayerMove; private PlayerControllerB movingPlayer; private int removePlayerInFrames; private bool startedRemovingPlayerCountdown; private GameObject mainObject; private NetworkObject despawnNetObj; private bool updateNormalOrLate; public void Initialize(PlayerControllerB setToMove, Transform snapToTransform = null, GameObject overrideMainObject = null, bool normalUpdate = true, NetworkObject spawnedObj = null) { //IL_0067: 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 ((Object)(object)setToMove == (Object)null) { return; } doPlayerMove = true; movingPlayer = setToMove; WriteToPlayerOnEnable(); if ((Object)(object)mainObject == (Object)null) { if ((Object)(object)overrideMainObject != (Object)null) { SetMainObject(overrideMainObject); } else { SetMainObject(((Component)this).gameObject); } } updateNormalOrLate = normalUpdate; if ((Object)(object)snapToTransform != (Object)null) { mainObject.transform.position = snapToTransform.position; mainObject.transform.rotation = snapToTransform.rotation; } despawnNetObj = spawnedObj; } private void WriteToPlayerOnEnable() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00d2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)movingPlayer == (Object)null) { return; } movingPlayer.teleportingThisFrame = false; movingPlayer.teleportedLastFrame = false; movingPlayer.teleportingThisFrame = false; movingPlayer.isSprinting = false; movingPlayer.isMovementHindered = 0; movingPlayer.hinderedMultiplier = 1f; movingPlayer.sourcesCausingSinking = 0; movingPlayer.sinkingValue = 0f; movingPlayer.isSinking = false; movingPlayer.isJumping = false; movingPlayer.isFallingFromJump = false; movingPlayer.isFallingNoJump = false; movingPlayer.statusEffectAudio.Stop(); movingPlayer.externalForces = Vector3.zero; movingPlayer.externalForceAutoFade = Vector3.zero; movingPlayer.isCrouching = false; movingPlayer.ResetFallGravity(); movingPlayer.enteringSpecialAnimation = true; movingPlayer.inSpecialInteractAnimation = true; if ((Object)(object)movingPlayer.playerBodyAnimator != (Object)null) { movingPlayer.playerBodyAnimator.SetBool("crouching", false); movingPlayer.playerBodyAnimator.SetBool("Walking", false); movingPlayer.playerBodyAnimator.SetBool("Sprinting", false); movingPlayer.playerBodyAnimator.SetBool("Sideways", false); movingPlayer.playerBodyAnimator.SetBool("hinderedMovement", false); movingPlayer.playerBodyAnimator.SetBool("Jumping", false); movingPlayer.playerBodyAnimator.SetBool("FallNoJump", false); movingPlayer.playerBodyAnimator.SetBool("Limp", false); } if ((Object)(object)movingPlayer.inAnimationWithEnemy != (Object)null) { RadMechAI component = ((Component)movingPlayer.inAnimationWithEnemy).GetComponent(); if ((Object)(object)component != (Object)null) { component.CancelTorchPlayerAnimation(); } else { movingPlayer.inAnimationWithEnemy.CancelSpecialAnimationWithPlayer(); } } movingPlayer.CancelSpecialTriggerAnimations(); } public void SetToDestroy(int destroyAfterAmountOfFrames = 0) { startedRemovingPlayerCountdown = true; removePlayerInFrames = destroyAfterAmountOfFrames; } private void Update() { if (updateNormalOrLate) { DoUpdate(); } } private void LateUpdate() { if (!updateNormalOrLate) { DoUpdate(); } } private void DoUpdate() { //IL_0092: 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_00ad: 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_00e3: 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_0103: Unknown result type (might be due to invalid IL or missing references) if (startedRemovingPlayerCountdown && removePlayerInFrames <= 0) { doPlayerMove = false; if ((Object)(object)movingPlayer != (Object)null) { movingPlayer.inSpecialInteractAnimation = false; } } if (!doPlayerMove) { DestroySelf(); return; } if ((Object)(object)movingPlayer == (Object)null || !movingPlayer.isPlayerControlled || movingPlayer.teleportingThisFrame) { SetToDestroy(); } else { movingPlayer.inSpecialInteractAnimation = true; movingPlayer.oldPlayerPosition = ((Component)movingPlayer).transform.position; ((Component)movingPlayer).transform.position = ((Component)this).transform.position; ((Component)movingPlayer).transform.rotation = ((Component)this).transform.rotation; ((Component)movingPlayer).transform.localScale = ((Component)this).transform.localScale; movingPlayer.serverPlayerPosition = ((Component)movingPlayer).transform.position; } if (startedRemovingPlayerCountdown) { removePlayerInFrames--; } } public void SetMainObject(GameObject newMainObject) { if ((Object)(object)newMainObject != (Object)null) { mainObject = newMainObject; } } public PlayerControllerB GetMovingPlayer() { return movingPlayer; } private void DestroySelf() { movingPlayer = null; if ((Object)(object)despawnNetObj != (Object)null) { if (despawnNetObj.IsSpawned && NewDonkCityManager.localPlayerServer) { despawnNetObj.Despawn(true); } } else { Object.Destroy((Object)(object)mainObject); } } } public class VolumeMultiplierTrigger : MonoBehaviour { [Header("Volume")] public AudioSource musicZoneOf; public float volumeMultiplier = 0.5f; public string dictionaryKey; [Space(3f)] [Header("Trigger")] public bool forceSetSize = true; public bool forceTrigger = true; public float overrideMaxDistance = -1f; private void Start() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (forceSetSize) { float num = 10f; if ((Object)(object)musicZoneOf != (Object)null) { num = musicZoneOf.maxDistance * 0.9f; } if (overrideMaxDistance != -1f) { num = overrideMaxDistance; } Collider component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { if (forceTrigger) { component.isTrigger = true; } if (component is BoxCollider) { Collider obj = ((component is BoxCollider) ? component : null); float num2 = num / 2f; ((BoxCollider)obj).size = new Vector3(num2, num2, num2); } else if (component is SphereCollider) { ((SphereCollider)((component is SphereCollider) ? component : null)).radius = num; } } else { SphereCollider val = ((Component)this).gameObject.AddComponent(); if (forceTrigger) { ((Collider)val).isTrigger = true; } val.radius = num; } } if (string.IsNullOrEmpty(dictionaryKey)) { dictionaryKey = $"{((Object)((Component)this).gameObject).name} #{((Object)((Component)this).gameObject).GetInstanceID()}"; } } private void OnTriggerEnter(Collider other) { if (!((Object)(object)other == (Object)null) && ((Component)other).CompareTag("Player") && (!((Object)(object)musicZoneOf != (Object)null) || musicZoneOf.isPlaying) && !((Object)(object)SongsManager.Instance == (Object)null) && !((Object)(object)NewDonkCityManager.localPlayer == (Object)null)) { PlayerControllerB component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)NewDonkCityManager.localPlayer) { SongsManager.Instance.SetGlobalVolumeMultiplier(dictionaryKey, volumeMultiplier); } } } private void OnTriggerExit(Collider other) { if (!((Object)(object)other == (Object)null) && ((Component)other).CompareTag("Player") && !((Object)(object)SongsManager.Instance == (Object)null) && !((Object)(object)NewDonkCityManager.localPlayer == (Object)null)) { PlayerControllerB component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)NewDonkCityManager.localPlayer) { SongsManager.Instance.RemoveGlobalVolumeMultiplier(dictionaryKey); } } } } public class Aesthetic : MonoBehaviour { private static ManualLogSource Logger; public List activateOnWeather = new List(); [Space] [Header("Visual")] public GameObject[] aestheticSpecificPrefabs; public LocalVolumetricFog outsideFog; public LocalVolumetricFog insideFog; public string skyboxAnimatorTrigger; public ParticleSystem outdoorParticles; [Space(3f)] [Header("Audio")] public SceneBGM[] backgroundMusic; public float introMusicTime = 5f; public float introMusicFade = 10f; [Space(3f)] [Header("Misc")] public int maxSpawnCountNPC; public bool rebakeNavMesh; public float pitchOffset; public void ToggleAestheticSpecificPrefabs(bool setTo) { GameObject[] array = aestheticSpecificPrefabs; foreach (GameObject val in array) { if (!((Object)(object)val == (Object)null)) { val.SetActive(setTo); } } } public void DestroyUnusedAestheticSpecificPrefabs() { GameObject[] array = aestheticSpecificPrefabs; foreach (GameObject val in array) { if (!((Object)(object)val == (Object)null) && !val.activeSelf) { Logger.LogDebug((object)$"!!! DestroyUnusedAestheticSpecificPrefabs(): {val} // active? {val.activeSelf}"); Object.Destroy((Object)(object)val); } } } public void ToggleAestheticSpecificSong(bool setTo) { if ((Object)(object)SongsManager.Instance == (Object)null || backgroundMusic == null || backgroundMusic.Length == 0) { return; } for (int i = 0; i < backgroundMusic.Length; i++) { if (!((Object)(object)backgroundMusic[i] == (Object)null)) { if (setTo) { backgroundMusic[i].StartSong(); } else { backgroundMusic[i].StopSong(); } } } } public void ToggleFogObject(bool ofOutsideFog, bool setTo) { LocalVolumetricFog val = (ofOutsideFog ? outsideFog : insideFog); if (!((Object)(object)val == (Object)null)) { ((Behaviour)val).enabled = setTo; } } public void ToggleParticles(bool setTo) { if ((Object)(object)outdoorParticles == (Object)null) { return; } if (setTo && !outdoorParticles.isPlaying) { if ((Object)(object)StartOfRound.Instance != (Object)null) { outdoorParticles.randomSeed = (uint)StartOfRound.Instance.randomMapSeed; } else { outdoorParticles.randomSeed = 1757u; } outdoorParticles.Play(); } else if (!setTo && outdoorParticles.isPlaying) { outdoorParticles.Stop(); } } } public class BounceSurface : MonoBehaviour, IPhysicsSearchable { public enum LaunchType { World, LocalPlayer, LocalObject } private static ManualLogSource Logger; private string keyName = "BounceSurface"; [Header("General")] [Tooltip("True = add to player force.\nFalse = overwrite player force.")] public bool addOrSnap = true; [Tooltip("X becomes right, and Z becomes forward, of:\nWorld = Scene's Global\nLocalPlayer = localPlayerController's Local\nLocalObject = MonoBehaviour's Local")] public LaunchType launchType = LaunchType.LocalPlayer; [Tooltip("Base force to bounce the player by, using the player's as x, the world's up as y, and the player's forward as z.")] public Vector3 bounceForce; [Space(3f)] [Header("Inputs")] [Tooltip("Determine if inputMultiplier will be added on top of bounceForce.")] public bool takeInputs = true; [Tooltip("Will add these values on top of the bounceForce if this input is pressed.")] public Vector3 inputMultiplier; [Space(3f)] [Header("Misc")] [Tooltip("Will call Animator Trigger \"BounceSurfaceInteract\" on this component")] public Animator playBounceAnimation; [Tooltip("Event will only be invoked locally on the player bouncing off this surface.")] public UnityEvent invokeOnBounce; string IPhysicsSearchable.keyName => keyName; public void BounceLocalPlayerOff() { //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_001b: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_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_01ae: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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_0241: 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_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_0130: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)NewDonkCityManager.localPlayer == (Object)null) { return; } PlayerControllerB localPlayer = NewDonkCityManager.localPlayer; Vector3 val = bounceForce; Vector2 zero = Vector2.zero; if ((Object)(object)IngamePlayerSettings.Instance != (Object)null && (Object)(object)IngamePlayerSettings.Instance.playerInput != (Object)null && (Object)(object)IngamePlayerSettings.Instance.playerInput.actions != (Object)null) { zero = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); if (Application.isEditor) { Logger.LogDebug((object)zero); } if (inputMultiplier.x > 1f) { val.x += zero.x * inputMultiplier.x; } if (inputMultiplier.y > 1f && IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).IsPressed()) { val.y += 1f * inputMultiplier.y; } if (inputMultiplier.z > 1f) { val.z += zero.y * inputMultiplier.z; } } Vector3 one = Vector3.one; one = (Vector3)(launchType switch { LaunchType.LocalPlayer => ((Component)localPlayer).transform.right * val.x + new Vector3(0f, val.y, 0f) + ((Component)localPlayer).transform.forward * val.z, LaunchType.LocalObject => ((Component)this).transform.right * val.x + ((Component)this).transform.up * val.y + ((Component)this).transform.forward * val.z, _ => val, }); if (Application.isEditor) { Logger.LogDebug((object)$"{this} locally bouncing player {localPlayer} with forward {((Component)localPlayer).transform.forward} and bounceForce {bounceForce} + inputMultiplier {inputMultiplier} locally (type: {launchType}) to create: forceToUse = {one}"); } NewDonkCityManager.AddForceToPlayerBody(localPlayer, one, addOrSnap); DoBounceAnimationAndSync(); invokeOnBounce.Invoke(NewDonkCityManager.localPlayer); } public void DoBounceAnimationAndSync() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)playBounceAnimation == (Object)null)) { DoBounceAnimationLocal(); PropsManager.CallMonoBehaviourNetworkEvent(NewDonkCityManager.localPlayer, ((Component)this).transform.position, keyName); } } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { DoBounceAnimationLocal(); } public void DoBounceAnimationLocal() { if (!((Object)(object)playBounceAnimation == (Object)null)) { playBounceAnimation.SetTrigger("BounceSurfaceInteract"); } } } public class ChallengeDoor : NetworkBehaviour { public float timeToUnlock; private float currentUnlockTime; [Space(3f)] private LockPicker placedLockpick; public InteractTrigger interactScript; public EntranceTeleport doorTeleport; public DoorLock lockPickInteractable; public Animator[] animateOnUnlock; [Space(3f)] public SaveableObject saveTimer; public SceneBGM insideMusic; private float checkHoldingObjectTimer; private void Update() { SetTriggerHoverTip(); if (!((Object)(object)placedLockpick != (Object)null)) { return; } currentUnlockTime -= Time.deltaTime; lockPickInteractable.lockPickTimeLeft = currentUnlockTime; if ((Object)(object)((Component)placedLockpick).transform.parent != (Object)(object)((Component)((NetworkBehaviour)this).NetworkObject).transform) { if (!lockPickInteractable.isLocked) { ChangePlacedLockPick(null, 0f); } else { ChangePlacedLockPick(null); } } } private void SetTriggerHoverTip() { if (checkHoldingObjectTimer > 0f) { checkHoldingObjectTimer -= Time.deltaTime; return; } if ((Object)(object)NewDonkCityManager.localPlayer != (Object)null && (Object)(object)NewDonkCityManager.localPlayer.hoveringOverTrigger != (Object)null && (Object)(object)NewDonkCityManager.localPlayer.hoveringOverTrigger == (Object)(object)interactScript) { checkHoldingObjectTimer = 0.5f; } else { checkHoldingObjectTimer = 3.33f; } if (currentUnlockTime <= 0f) { interactScript.interactable = true; interactScript.hoverTip = "Enter : [E]"; } else if ((Object)(object)placedLockpick != (Object)null) { interactScript.interactable = false; interactScript.disabledHoverTip = "Unlocking...\n" + NewDonkCityManager.PrintPercentageAsBar(timeToUnlock - currentUnlockTime, timeToUnlock, 20); } else if ((Object)(object)NewDonkCityManager.localPlayer != (Object)null && (Object)(object)NewDonkCityManager.localPlayer.currentlyHeldObjectServer != (Object)null && (Object)(object)((Component)NewDonkCityManager.localPlayer.currentlyHeldObjectServer).GetComponent() != (Object)null) { interactScript.interactable = true; interactScript.hoverTip = "Unlock : [E]"; } else { interactScript.interactable = false; interactScript.disabledHoverTip = "Locked tight"; } } public void OnLoadDelay() { if (!((NetworkBehaviour)this).IsServer) { return; } LoadedDataState loadedDataState = saveTimer.RetrieveData(); float num = -1f; if (loadedDataState == null || !loadedDataState.loadSuccessful) { num = timeToUnlock; } else { try { num = (int)loadedDataState.loadedValue; } catch (Exception arg) { Plugin.Logger.LogError((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: B\n\n{arg}"); } } SetUpDoorLocal(num); SetUpDoorClientRpc(num); } [ClientRpc] private void SetUpDoorClientRpc(float loadedValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(395898777u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref loadedValue, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 395898777u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { SetUpDoorLocal(loadedValue); } } } private void SetUpDoorLocal(float loadedValue) { currentUnlockTime = loadedValue; lockPickInteractable.maxTimeLeft = timeToUnlock; lockPickInteractable.lockPickTimeLeft = currentUnlockTime; if (currentUnlockTime > 0f) { lockPickInteractable.LockDoor(currentUnlockTime); return; } lockPickInteractable.UnlockDoor(); EffectsOnUnlockDoor(); } public void OnDayEnd() { if (((NetworkBehaviour)this).IsServer && currentUnlockTime < timeToUnlock) { int saveDataState = ((currentUnlockTime % 1f == 0f) ? ((int)currentUnlockTime) : ((int)(currentUnlockTime + 1f))); saveTimer.SaveData(saveDataState); } } public void InteractWithChallengeDoor(PlayerControllerB player) { if (!((Object)(object)player == (Object)null) && player.isPlayerControlled && !((Object)(object)player != (Object)(object)NewDonkCityManager.localPlayer)) { if (currentUnlockTime <= 0f) { InteractTeleport(player); } else { InteractUnlock(player); } } } private void InteractTeleport(PlayerControllerB player) { doorTeleport.TeleportPlayer(); if ((Object)(object)insideMusic != (Object)null && (Object)(object)insideMusic.globalAudio != (Object)null && !insideMusic.globalAudio.isPlaying) { ToggleInsideMusic(play: true); ToggleInsideMusicServerRpc(NewDonkCityManager.localPlayerID, play: true); } } [ServerRpc(RequireOwnership = false)] private void ToggleInsideMusicServerRpc(int playerID, bool play) { //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(215582195u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref play, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 215582195u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ToggleInsideMusicClientRpc(playerID, play); } } } [ClientRpc] private void ToggleInsideMusicClientRpc(int playerID, bool play) { //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(1968839569u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref play, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1968839569u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { ToggleInsideMusic(play); } } } private void ToggleInsideMusic(bool play) { if (!((Object)(object)insideMusic == (Object)null)) { if (play) { insideMusic.StartSong(); } else { insideMusic.StopSong(); } } } private void InteractUnlock(PlayerControllerB player) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player.currentlyHeldObjectServer == (Object)null)) { LockPicker component = ((Component)player.currentlyHeldObjectServer).GetComponent(); if (!((Object)(object)component == (Object)null)) { player.DiscardHeldObject(true, ((NetworkBehaviour)this).NetworkObject, component.GetLockPickerDoorPosition(lockPickInteractable), true); component.PlaceLockPickerServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject), component.placeOnLockPicker1); component.PlaceOnDoor(lockPickInteractable, component.placeOnLockPicker1); ChangePlacedLockPick(component, currentUnlockTime); PlaceLockPickServerRpc(NewDonkCityManager.localPlayerID, NetworkObjectReference.op_Implicit(((NetworkBehaviour)component).NetworkObject), currentUnlockTime); } } } [ServerRpc(RequireOwnership = false)] private void PlaceLockPickServerRpc(int playerID, NetworkObjectReference lockpickNOR, float placingPlayersTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3875578449u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lockpickNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref placingPlayersTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3875578449u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlaceLockPickClientRpc(playerID, lockpickNOR, placingPlayersTime); } } } [ClientRpc] private void PlaceLockPickClientRpc(int playerID, NetworkObjectReference lockpickNOR, float placingPlayersTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1878809149u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lockpickNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref placingPlayersTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1878809149u, 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 (playerID != NewDonkCityManager.localPlayerID && ((NetworkObjectReference)(ref lockpickNOR)).TryGet(ref val3, (NetworkManager)null)) { LockPicker componentInChildren = ((Component)val3).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { ChangePlacedLockPick(componentInChildren, placingPlayersTime); } } } private void ChangePlacedLockPick(LockPicker setTo, float overrideUnlockTime = -1f) { placedLockpick = setTo; if (overrideUnlockTime != -1f) { currentUnlockTime = overrideUnlockTime; } if ((Object)(object)placedLockpick == (Object)null && currentUnlockTime <= 0f) { EffectsOnUnlockDoor(); } } private void EffectsOnUnlockDoor() { if (animateOnUnlock == null || animateOnUnlock.Length == 0) { return; } for (int i = 0; i < animateOnUnlock.Length; i++) { if (!((Object)(object)animateOnUnlock[i] == (Object)null)) { animateOnUnlock[i].SetTrigger("ChallengeDoorUnlock"); } } } 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 ((NetworkBehaviour)this).__registerRpc(395898777u, new RpcReceiveHandler(__rpc_handler_395898777), "SetUpDoorClientRpc"); ((NetworkBehaviour)this).__registerRpc(215582195u, new RpcReceiveHandler(__rpc_handler_215582195), "ToggleInsideMusicServerRpc"); ((NetworkBehaviour)this).__registerRpc(1968839569u, new RpcReceiveHandler(__rpc_handler_1968839569), "ToggleInsideMusicClientRpc"); ((NetworkBehaviour)this).__registerRpc(3875578449u, new RpcReceiveHandler(__rpc_handler_3875578449), "PlaceLockPickServerRpc"); ((NetworkBehaviour)this).__registerRpc(1878809149u, new RpcReceiveHandler(__rpc_handler_1878809149), "PlaceLockPickClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_395898777(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float upDoorClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref upDoorClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChallengeDoor)(object)target).SetUpDoorClientRpc(upDoorClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_215582195(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 play = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref play, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChallengeDoor)(object)target).ToggleInsideMusicServerRpc(playerID, play); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1968839569(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 play = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref play, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChallengeDoor)(object)target).ToggleInsideMusicClientRpc(playerID, play); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3875578449(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference lockpickNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lockpickNOR, default(ForNetworkSerializable)); float placingPlayersTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref placingPlayersTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChallengeDoor)(object)target).PlaceLockPickServerRpc(playerID, lockpickNOR, placingPlayersTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1878809149(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference lockpickNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lockpickNOR, default(ForNetworkSerializable)); float placingPlayersTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref placingPlayersTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChallengeDoor)(object)target).PlaceLockPickClientRpc(playerID, lockpickNOR, placingPlayersTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ChallengeDoor"; } } public class CoinContainer : MonoBehaviour, IHittable, IPhysicsSearchable { public enum CollectableType { EveryDay, PerQuota, OnlyOnce } private string keyName = "Coin Container"; public int worthAmount = 1; private bool collected; [Space(3f)] [Header("Collection")] public bool collectByTouch; public bool collectByHittable; public bool destroyOnCollect; [Space] [Tooltip("Every Day = respawns daily\nPer Quota = gone until reaching quota\nOnly Once = gone until getting fired/starting new save")] public CollectableType collectType; [Space(3f)] [Header("Audioviual")] public bool rotateCoin; [Space] public Transform spawnCoinVisualAt; public int coinIndex; public bool visualUsesRotation = true; [Space] [Tooltip("Will call Animator Trigger \"CollectCoin\" on this component")] public Animator playAnimationOn; public AudioClip playSfxClip; [Space] public UnityEvent onCollect = new UnityEvent(); string IPhysicsSearchable.keyName => keyName; private void Start() { if (rotateCoin) { ((Component)this).gameObject.AddComponent().Initialize(0f, 120f, 0f, (Space)1); } } private void OnTriggerEnter(Collider other) { if (!collected && collectByTouch && !((Object)(object)other == (Object)null)) { PlayerControllerB component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component != (Object)(object)NewDonkCityManager.localPlayer)) { CollectCoin(); } } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (collected || !collectByHittable || (Object)(object)playerWhoHit == (Object)null || (Object)(object)playerWhoHit != (Object)(object)NewDonkCityManager.localPlayer) { return false; } CollectCoin(); return true; } public void CollectCoin() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!collected) { CollectCoinLocal(NewDonkCityManager.localPlayer); PropsManager.CallMonoBehaviourNetworkEvent(NewDonkCityManager.localPlayer, ((Component)this).transform.position, keyName); } } public void CollectCoinLocal(PlayerControllerB collectedBy) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!collected) { SetCollected(setTo: true); if ((Object)(object)playAnimationOn != (Object)null) { playAnimationOn.SetTrigger("CollectCoin"); } if ((Object)(object)playSfxClip != (Object)null) { bool isMonoSound = (Object)(object)collectedBy != (Object)null && (Object)(object)collectedBy == (Object)(object)NewDonkCityManager.localPlayer; GenericManager.PlaySFXAtLocation(((Component)this).transform.position, playSfxClip, audible: true, 15f, 0.4f, 0f, 0f, isMonoSound); } onCollect.Invoke(collectedBy); GenericManager.AddCollectedCoins(this, collectedBy); } } public void SetCollected(bool setTo) { collected = setTo; } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { CollectCoinLocal(calledBy); } } public class ColoredLetter : NetworkBehaviour, IHitboxMainScript { private static ManualLogSource Logger; [Header("Audiovisual")] public GameObject letterColorless; public GameObject letterFilled; [Space] public Transform letterAudio; public AudioClip letterSFX; public Animator letterAnimator; [Space] public List sprayColliders = new List(); [Space(3f)] [Header("In-Scene Objects")] public MoonData spawnShard; public Transform finalPos; public void FillInAtStartServer() { if (((NetworkBehaviour)this).IsServer) { FillInAtStartLocal(); FillInAtStartClientRpc(); } } [ClientRpc] private void FillInAtStartClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2224134425u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2224134425u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { FillInAtStartLocal(); } } } private void FillInAtStartLocal() { //IL_0022: 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) SetLetterActiveLocal(setToFilled: true, doAudioVisual: false); if ((Object)(object)finalPos != (Object)null) { ((Component)this).transform.position = finalPos.position; ((Component)this).transform.rotation = finalPos.rotation; } } private void SetLetterActiveServer(bool setToFilled, bool doAudioVisual) { if (((NetworkBehaviour)this).IsServer) { SetLetterActiveLocal(setToFilled, doAudioVisual); SetLetterActiveClientRpc(setToFilled, doAudioVisual); } } [ClientRpc] private void SetLetterActiveClientRpc(bool setToFilled, bool doAudioVisual) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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(1742141787u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setToFilled, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref doAudioVisual, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1742141787u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { SetLetterActiveLocal(setToFilled, doAudioVisual); } } } private void SetLetterActiveLocal(bool setToFilled, bool doAudioVisual) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) letterColorless.SetActive(!setToFilled); letterFilled.SetActive(setToFilled); if (!setToFilled) { return; } if (sprayColliders != null && sprayColliders.Count > 0) { for (int num = sprayColliders.Count - 1; num >= 0; num--) { DestroyHitboxAtIndex(num); } } if (doAudioVisual) { if ((Object)(object)letterAnimator != (Object)null) { letterAnimator.SetTrigger("SetToFilled"); } if ((Object)(object)letterAudio != (Object)null) { GenericManager.PlaySFXAtLocation(letterAudio.position, letterSFX, audible: true, 15f, 0.5f, 0f); } if ((Object)(object)spawnShard != (Object)null) { spawnShard.SpawnMoon(); } } } public static void LocalPlayerUseSprayPaint(SprayPaintItem item) { //IL_0088: 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) RaycastHit val = default(RaycastHit); if (!((Object)(object)StartOfRound.Instance == (Object)null) && !((Object)(object)StartOfRound.Instance.currentLevel == (Object)null) && !((Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel) && !((Object)(object)NewDonkCityManager.Instance == (Object)null) && !((Object)(object)item == (Object)null) && !item.isWeedKillerSprayBottle && item.isSpraying && !((Object)(object)((GrabbableObject)item).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)item).playerHeldBy != (Object)(object)NewDonkCityManager.localPlayer) && Physics.Raycast(((GrabbableObject)item).playerHeldBy.playerEye.position, ((GrabbableObject)item).playerHeldBy.playerEye.forward, ref val, 7f, 8192, (QueryTriggerInteraction)2) && !((Object)(object)((RaycastHit)(ref val)).collider == (Object)null)) { if (Application.isEditor) { Logger.LogDebug((object)("HIT COLLIDER: " + ((Object)((RaycastHit)(ref val)).collider).name)); } Hitbox component = ((Component)((RaycastHit)(ref val)).collider).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.mainObject != (Object)null && (Object)(object)component.mainObject.GetComponent() != (Object)null) { Logger.LogDebug((object)$"LocalPlayerUseSprayPaint(): {component}"); component.CallMainScript(); } } } void IHitboxMainScript.HitboxTriggerEntered(Hitbox hitbox, Collider other) { LoadedDataState hitboxIndex = GetHitboxIndex(hitbox); if (hitboxIndex != null && hitboxIndex.loadSuccessful) { int num = (int)hitboxIndex.loadedValue; if (Application.isEditor) { Logger.LogInfo((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: {hitbox} removing from front? index = {num} // remaining: {sprayColliders.Count - 1}"); } RemoveHitboxLocal(num); RemoveHitboxServerRpc(NewDonkCityManager.localPlayerID, num); } } private LoadedDataState GetHitboxIndex(Hitbox hitBox) { if ((Object)(object)hitBox == (Object)null || sprayColliders == null) { return new LoadedDataState(successful: false); } if (sprayColliders.Count > 0) { for (int i = 0; i < sprayColliders.Count; i++) { if ((Object)(object)sprayColliders[i] != (Object)null && (Object)(object)sprayColliders[i] == (Object)(object)hitBox) { return new LoadedDataState(successful: true, i); } } } return new LoadedDataState(successful: false); } [ServerRpc(RequireOwnership = false)] private void RemoveHitboxServerRpc(int playerID, int hitboxIndex) { //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(3445411182u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, hitboxIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3445411182u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveHitboxClientRpc(playerID, hitboxIndex); } } } [ClientRpc] private void RemoveHitboxClientRpc(int playerID, int hitboxIndex) { //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(291905323u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, hitboxIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 291905323u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { RemoveHitboxLocal(hitboxIndex); } } } private void RemoveHitboxLocal(int hitboxIndex) { if (sprayColliders != null) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: {hitboxIndex}"); if (sprayColliders.Count > 0 && hitboxIndex >= 0 && hitboxIndex < sprayColliders.Count) { DestroyHitboxAtIndex(hitboxIndex); } if (sprayColliders.Count == 0) { SetLetterActiveServer(setToFilled: true, doAudioVisual: true); } } } private void DestroyHitboxAtIndex(int index) { if (sprayColliders != null && sprayColliders.Count > 0 && index >= 0 && index < sprayColliders.Count) { Hitbox hitbox = sprayColliders[index]; if ((Object)(object)hitbox != (Object)null) { sprayColliders.Remove(hitbox); Object.Destroy((Object)(object)((Component)hitbox).gameObject); } } } 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 ((NetworkBehaviour)this).__registerRpc(2224134425u, new RpcReceiveHandler(__rpc_handler_2224134425), "FillInAtStartClientRpc"); ((NetworkBehaviour)this).__registerRpc(1742141787u, new RpcReceiveHandler(__rpc_handler_1742141787), "SetLetterActiveClientRpc"); ((NetworkBehaviour)this).__registerRpc(3445411182u, new RpcReceiveHandler(__rpc_handler_3445411182), "RemoveHitboxServerRpc"); ((NetworkBehaviour)this).__registerRpc(291905323u, new RpcReceiveHandler(__rpc_handler_291905323), "RemoveHitboxClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2224134425(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; ((ColoredLetter)(object)target).FillInAtStartClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1742141787(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_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setToFilled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setToFilled, default(ForPrimitives)); bool doAudioVisual = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doAudioVisual, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ColoredLetter)(object)target).SetLetterActiveClientRpc(setToFilled, doAudioVisual); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3445411182(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 hitboxIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitboxIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ColoredLetter)(object)target).RemoveHitboxServerRpc(playerID, hitboxIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_291905323(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 hitboxIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitboxIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ColoredLetter)(object)target).RemoveHitboxClientRpc(playerID, hitboxIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ColoredLetter"; } } public class DogAI : NetworkBehaviour, IVisibleThreat, INoiseListener { private static ManualLogSource Logger; [Header("DOG")] public DogState[] states; public DogState stateDefault; [HideInInspector] public DogState stateCurrent; [HideInInspector] public DogState statePrevious; [Space(3f)] public AudioClip[] barks; [Space(3f)] [Header("AI")] public NavMeshAgent agent; public Animator animator; public AudioSource sound; public Transform eye; public Transform turnCompass; private Transform lookAt; private float lookSpeed; private Vector3 syncedPosition; private Vector3 syncedRotation; private float syncDistance; private float syncDuration; [Space] [Tooltip("High values will make dogs with a high agent speed require a large distance to sync its and position, and will make it quickly move to its synced position.")] public Vector2 syncSpeedBoundaries; [HideInInspector] public Vector3 tempNum; private float animTimer; private Vector3 lastAnimPosition; [Space] public Transform mainLandWarpPoint; [HideInInspector] public GameObject[] stateChangeObjects = (GameObject[])(object)new GameObject[4]; private float aiTimer; private bool disableUpdate = true; ThreatType IVisibleThreat.type => (ThreatType)3; public void OnLoadDelay() { if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)agent).enabled = true; } disableUpdate = false; if (states == null || states.Length == 0) { return; } for (int i = 0; i < states.Length; i++) { if ((Object)(object)states[i] != (Object)null) { states[i].Initialize(this); } } } private void Update() { if (!disableUpdate) { GlobalUpdate(); if (((NetworkBehaviour)this).IsOwner) { OwnerUpdate(); } } } private void GlobalUpdate() { //IL_004f: 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_0066: 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_008c: 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_00c1: Unknown result type (might be due to invalid IL or missing references) if (animTimer > 0f) { animTimer -= Time.deltaTime; } else { animTimer = 0.25f; CheckAnimationOnInterval(); SyncDogTransformOwner(); } if (!((NetworkBehaviour)this).IsOwner) { ((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, syncedPosition, ref tempNum, syncDuration); ((Component)this).transform.eulerAngles = new Vector3(((Component)this).transform.eulerAngles.x, Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, syncedRotation.y, 5f * Time.deltaTime), ((Component)this).transform.eulerAngles.z); } } private void OwnerUpdate() { if (aiTimer > 0f) { aiTimer -= Time.deltaTime; } else { aiTimer = 1f; if ((Object)(object)stateCurrent != (Object)null) { aiTimer = Mathf.Max(0.1f, stateCurrent.intervalTime); } DoCustomAIInterval(); } if ((Object)(object)lookAt != (Object)null) { TurnDogTowards(lookAt, lookSpeed); } } private void DoCustomAIInterval() { if (!((NetworkBehaviour)this).IsOwner) { ((Behaviour)agent).enabled = false; return; } ((Behaviour)agent).enabled = true; if (states != null && states.Length != 0) { if ((Object)(object)stateCurrent == (Object)null || !stateCurrent.stateActive) { SwitchStateToDefault($"A: null? {(Object)(object)stateCurrent == (Object)null}"); } else { stateCurrent.DoStateLogic(); } } } private void CheckAnimationOnInterval() { //IL_000d: 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_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) AnimateDog("Walking", (AnimatorControllerParameterType)4, Vector3.Distance(((Component)this).transform.position, lastAnimPosition) > agent.speed * 0.1f); lastAnimPosition = ((Component)this).transform.position; } private void SyncDogTransformOwner() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0079: 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) if (((NetworkBehaviour)this).IsOwner && (Vector3.Distance(((Component)this).transform.position, syncedPosition) > syncDistance || Mathf.Abs(syncedRotation.y - ((Component)this).transform.eulerAngles.y) > 10f)) { syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.eulerAngles; SyncDogTransformServerRpc(syncedPosition, syncedRotation, syncDuration); } } private float GetLerpedAgentSpeed(bool normal) { if (!normal) { Mathf.Lerp(syncSpeedBoundaries.y, syncSpeedBoundaries.x, Mathf.InverseLerp(0f, 10f, agent.speed)); } return Mathf.Lerp(syncSpeedBoundaries.x, syncSpeedBoundaries.y, Mathf.InverseLerp(0f, 10f, agent.speed)); } [ServerRpc(RequireOwnership = false)] private void SyncDogTransformServerRpc(Vector3 ownerPos, Vector3 ownerRot, float ownerDur) { //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_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_00fc: 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(1118125158u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerRot); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerDur, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1118125158u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncDogTransformClientRpc(ownerPos, ownerRot, ownerDur); } } } [ClientRpc] private void SyncDogTransformClientRpc(Vector3 ownerPos, Vector3 ownerRot, float ownerDur) { //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_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_0105: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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(3301957554u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerRot); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerDur, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3301957554u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { syncedPosition = ownerPos; syncedRotation = ownerRot; syncDuration = ownerDur; } } } public void SwitchStateToDefault(string logDebug = null) { if (!((Object)(object)stateDefault == (Object)null)) { SwitchState(stateDefault, null, logDebug); } } public void SwitchState(DogState switchTo, GameObject[] relatedObjects = null, string logDebug = null) { //IL_00e5: 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) if (!((NetworkBehaviour)this).IsOwner || (Object)(object)switchTo == (Object)(object)stateCurrent || states == null || states.Length == 0) { return; } if (Application.isEditor && !string.IsNullOrEmpty(logDebug)) { Logger.LogInfo((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: SwitchState({switchTo}) // {logDebug}"); } int num = -1; for (int i = 0; i < states.Length; i++) { if (!((Object)(object)states[i] == (Object)null) && (Object)(object)states[i] == (Object)(object)switchTo) { num = i; break; } } if (num == -1) { return; } List list = new List(); List list2 = new List(); if (relatedObjects != null && relatedObjects.Length != 0) { for (int j = 0; j < relatedObjects.Length; j++) { if (!((Object)(object)relatedObjects[j] == (Object)null)) { NetworkObject component = relatedObjects[j].GetComponent(); if ((Object)(object)component != (Object)null) { list.Add(NetworkObjectReference.op_Implicit(component)); } LocalNetworkObject component2 = relatedObjects[j].GetComponent(); if ((Object)(object)component2 != (Object)null) { list2.Add(((Component)component2).transform.position); } } } } SwitchStateIndexServerRpc(NewDonkCityManager.localPlayerID, num, list.ToArray(), list2.ToArray()); SwitchStateLocal(num, relatedObjects); } [ServerRpc(RequireOwnership = false)] private void SwitchStateIndexServerRpc(int playerID, int newIndex, NetworkObjectReference[] objNORs, Vector3[] objPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_00a2: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_011e: 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(3357555847u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, newIndex); bool flag = objNORs != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(objNORs, default(ForNetworkSerializable)); } bool flag2 = objPos != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(objPos); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3357555847u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SwitchStateIndexClientRpc(playerID, newIndex, objNORs, objPos); } } [ClientRpc] private void SwitchStateIndexClientRpc(int playerID, int newIndex, NetworkObjectReference[] objNORs, Vector3[] objPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_00a2: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_011e: 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) 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(907648270u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, newIndex); bool flag = objNORs != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(objNORs, default(ForNetworkSerializable)); } bool flag2 = objPos != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(objPos); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 907648270u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == NewDonkCityManager.localPlayerID) { return; } List list = new List(); if (objNORs != null && objNORs.Length != 0) { NetworkObject val3 = default(NetworkObject); for (int i = 0; i < objNORs.Length; i++) { if (((NetworkObjectReference)(ref objNORs[i])).TryGet(ref val3, (NetworkManager)null)) { list.Add(((Component)val3).gameObject); } } } if (objPos != null && objPos.Length != 0) { for (int j = 0; j < objPos.Length; j++) { GameObject val4 = NewDonkCityManager.SearchPhysicsComponentAtPosition(objPos[j], "Local NetworkObject"); if ((Object)(object)val4 != (Object)null) { list.Add(val4); } } } SwitchStateLocal(newIndex, list.ToArray()); } private void SwitchStateLocal(int newIndex, GameObject[] relatedObjects) { if (states != null && states.Length != 0 && newIndex >= 0 && newIndex < states.Length && !((Object)(object)states[newIndex] == (Object)null)) { statePrevious = stateCurrent; stateCurrent = states[newIndex]; if ((Object)(object)statePrevious != (Object)null) { statePrevious.OnStateExit(); } stateCurrent.OnStateEnter(relatedObjects); aiTimer = stateCurrent.intervalTime; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SwitchStateLocal(): stateCurrent = {stateCurrent} & statePrevious = {statePrevious}"); WipeStateChangeObjects(); } } public bool StoreStateChangeObjects(GameObject[] objectsToStore) { if (stateChangeObjects == null || objectsToStore == null || objectsToStore.Length == 0) { return false; } bool result = false; for (int i = 0; i < objectsToStore.Length; i++) { if ((Object)(object)objectsToStore[i] == (Object)null) { continue; } for (int num = stateChangeObjects.Length - 1; num >= 0; num--) { if (num > 0) { stateChangeObjects[num] = stateChangeObjects[num - 1]; } else { stateChangeObjects[num] = objectsToStore[i]; result = true; } } } return result; } public void WipeStateChangeObjects() { if (stateChangeObjects != null) { for (int i = 0; i < stateChangeObjects.Length; i++) { stateChangeObjects[i] = null; } } } public void ChangeOwnership(PlayerControllerB newOwner) { if (((NetworkBehaviour)this).IsOwner && !((Object)(object)newOwner == (Object)null) && newOwner.actualClientId != ((NetworkBehaviour)this).OwnerClientId) { ChangeOwnershipServerRpc(NewDonkCityManager.GetIDWithPlayer(newOwner)); } } [ServerRpc(RequireOwnership = false)] private void ChangeOwnershipServerRpc(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(4014004868u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4014004868u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(playerID); if (!((Object)(object)playerWithID == (Object)null) && playerWithID.actualClientId != ((NetworkBehaviour)this).OwnerClientId) { ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(playerWithID.actualClientId); ChangeOwnershipClientRpc(playerID); } } } [ClientRpc] private void ChangeOwnershipClientRpc(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(2279488031u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2279488031u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)NewDonkCityManager.GetPlayerWithID(playerID) == (Object)(object)NewDonkCityManager.localPlayer) { ((Behaviour)agent).enabled = true; return; } ((Behaviour)agent).enabled = false; WipeStateChangeObjects(); } } public void SetTurnTowardsTarget(Transform newTarget, float newSpeed = 0.5f) { lookAt = newTarget; lookSpeed = newSpeed; } public void TurnDogTowards(Transform transformToLookAt, float lerpSpeed = 0.5f) { //IL_0022: 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_0042: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transformToLookAt == (Object)null)) { turnCompass.LookAt(transformToLookAt); ((Component)this).transform.eulerAngles = new Vector3(((Component)this).transform.eulerAngles.x, Mathf.Lerp(((Component)this).transform.eulerAngles.y, turnCompass.eulerAngles.y, lerpSpeed * Time.deltaTime * 60f), ((Component)this).transform.eulerAngles.z); } } public void SetAgentDestination(Vector3 newDestionation) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)agent == (Object)null) && ((NetworkBehaviour)this).IsOwner) { agent.destination = newDestionation; } } public void SetAgentParameters(float newSpeed = -1f, float newAngularSpeed = -1f, float newAcceleration = -1f, float newStoppingDistance = -1f, bool newAutoBraking = true, bool overrideAutoBraking = true) { if (!((Object)(object)agent == (Object)null)) { if (newSpeed == -1f) { newSpeed = agent.speed; } if (newAngularSpeed == -1f) { newAngularSpeed = agent.angularSpeed; } if (newAcceleration == -1f) { newAcceleration = agent.acceleration; } if (newStoppingDistance == -1f) { newStoppingDistance = agent.stoppingDistance; } if (!overrideAutoBraking) { newAutoBraking = agent.autoBraking; } agent.speed = newSpeed; agent.angularSpeed = newAngularSpeed; agent.acceleration = newAcceleration; agent.stoppingDistance = newStoppingDistance; agent.autoBraking = newAutoBraking; syncDistance = GetLerpedAgentSpeed(normal: true); syncDuration = GetLerpedAgentSpeed(normal: false); } } public void AnimateDog(string animString, AnimatorControllerParameterType parameterType = (AnimatorControllerParameterType)9, bool boolVal = true, float numVal = -1f, bool sync = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown AnimateDogLocal(animString, parameterType, boolVal, numVal); if (sync) { AnimateDogServerRpc(NewDonkCityManager.localPlayerID, animString, (int)parameterType, boolVal, numVal); } } [ServerRpc(RequireOwnership = false)] private void AnimateDogServerRpc(int playerID, string animString, int parameterIndex, bool boolVal, float numVal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014f: 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_00d5: 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_00f0: 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_010a: 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(3068242004u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); bool flag = animString != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animString, false); } BytePacker.WriteValueBitPacked(val, parameterIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref boolVal, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref numVal, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3068242004u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AnimateDogClientRpc(playerID, animString, parameterIndex, boolVal, numVal); } } [ClientRpc] private void AnimateDogClientRpc(int playerID, string animString, int parameterIndex, bool boolVal, float numVal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014f: 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_00d5: 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_00f0: 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_010a: 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(261682421u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); bool flag = animString != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animString, false); } BytePacker.WriteValueBitPacked(val, parameterIndex); ((FastBufferWriter)(ref val)).WriteValueSafe(ref boolVal, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref numVal, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 261682421u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { AnimateDogLocal(animString, (AnimatorControllerParameterType)parameterIndex, boolVal, numVal); } } } private void AnimateDogLocal(string animString, AnimatorControllerParameterType parameterType, bool boolVal, float numVal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown switch (parameterType - 1) { default: animator.SetTrigger(animString); break; case 3: animator.SetBool(animString, boolVal); break; case 0: animator.SetFloat(animString, numVal); break; case 2: animator.SetInteger(animString, (int)numVal); break; } } public void DogAnimationEvent1() { PassAnimEventAlong(1); } public void DogAnimationEvent2() { PassAnimEventAlong(2); } public void DogAnimationEvent3() { PassAnimEventAlong(3); } private void PassAnimEventAlong(int switchCase) { if (!((Object)(object)stateCurrent == (Object)null)) { stateCurrent.AnimationEvent(switchCase); } } public void Bark() { if (barks != null && barks.Length != 0) { GenericManager.PlaySFX(sound, barks[Random.Range(0, barks.Length)], audible: true, 15f, 0.25f, 20050421); } } public void WarpToMainLand() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) agent.Warp(mainLandWarpPoint.position); ((Component)this).transform.position = mainLandWarpPoint.position; ((Component)this).transform.rotation = mainLandWarpPoint.rotation; } Transform IVisibleThreat.GetThreatLookTransform() { return eye; } Transform IVisibleThreat.GetThreatTransform() { return ((Component)this).transform; } Vector3 IVisibleThreat.GetThreatVelocity() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return agent.velocity; } bool IVisibleThreat.IsThreatDead() { return false; } int IVisibleThreat.SendSpecialBehaviour(int id) { return 0; } GrabbableObject IVisibleThreat.GetHeldObject() { if ((Object)(object)stateCurrent == (Object)null) { return null; } return stateCurrent.VisibleThreatGetHeldObject(); } int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)stateCurrent == (Object)null) { return 0; } return stateCurrent.VisibleThreatGetThreatLevel(seenByPosition); } int IVisibleThreat.GetInterestLevel() { if ((Object)(object)stateCurrent == (Object)null) { return 0; } return stateCurrent.VisibleThreatGetInterestLevel(); } float IVisibleThreat.GetVisibility() { if ((Object)(object)stateCurrent == (Object)null) { return 0f; } return stateCurrent.VisibleThreatGetVisibility(); } void INoiseListener.DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)stateCurrent == (Object)null)) { stateCurrent.NoiseListenerDetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); } } 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 ((NetworkBehaviour)this).__registerRpc(1118125158u, new RpcReceiveHandler(__rpc_handler_1118125158), "SyncDogTransformServerRpc"); ((NetworkBehaviour)this).__registerRpc(3301957554u, new RpcReceiveHandler(__rpc_handler_3301957554), "SyncDogTransformClientRpc"); ((NetworkBehaviour)this).__registerRpc(3357555847u, new RpcReceiveHandler(__rpc_handler_3357555847), "SwitchStateIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(907648270u, new RpcReceiveHandler(__rpc_handler_907648270), "SwitchStateIndexClientRpc"); ((NetworkBehaviour)this).__registerRpc(4014004868u, new RpcReceiveHandler(__rpc_handler_4014004868), "ChangeOwnershipServerRpc"); ((NetworkBehaviour)this).__registerRpc(2279488031u, new RpcReceiveHandler(__rpc_handler_2279488031), "ChangeOwnershipClientRpc"); ((NetworkBehaviour)this).__registerRpc(3068242004u, new RpcReceiveHandler(__rpc_handler_3068242004), "AnimateDogServerRpc"); ((NetworkBehaviour)this).__registerRpc(261682421u, new RpcReceiveHandler(__rpc_handler_261682421), "AnimateDogClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1118125158(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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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) { Vector3 ownerPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerPos); Vector3 ownerRot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerRot); float ownerDur = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerDur, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).SyncDogTransformServerRpc(ownerPos, ownerRot, ownerDur); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3301957554(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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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) { Vector3 ownerPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerPos); Vector3 ownerRot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerRot); float ownerDur = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerDur, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).SyncDogTransformClientRpc(ownerPos, ownerRot, ownerDur); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3357555847(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_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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int newIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newIndex); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] objNORs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref objNORs, default(ForNetworkSerializable)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Vector3[] objPos = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref objPos); } target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).SwitchStateIndexServerRpc(playerID, newIndex, objNORs, objPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_907648270(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_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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int newIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newIndex); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] objNORs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref objNORs, default(ForNetworkSerializable)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Vector3[] objPos = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref objPos); } target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).SwitchStateIndexClientRpc(playerID, newIndex, objNORs, objPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4014004868(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; ((DogAI)(object)target).ChangeOwnershipServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2279488031(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; ((DogAI)(object)target).ChangeOwnershipClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3068242004(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_0068: 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_0087: 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_00a2: 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_00db: 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)); string animString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animString, false); } int parameterIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref parameterIndex); bool boolVal = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boolVal, default(ForPrimitives)); float numVal = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref numVal, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).AnimateDogServerRpc(playerID, animString, parameterIndex, boolVal, numVal); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_261682421(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_0068: 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_0087: 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_00a2: 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_00db: 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)); string animString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animString, false); } int parameterIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref parameterIndex); bool boolVal = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boolVal, default(ForPrimitives)); float numVal = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref numVal, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogAI)(object)target).AnimateDogClientRpc(playerID, animString, parameterIndex, boolVal, numVal); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DogAI"; } } public class DogDiggable : MonoBehaviour { public SphereCollider dogCollider; public EventMessenger syncedEvents; private bool alreadyDug; [Space(3f)] [Header("Spawnable")] public MoonData spawnMoon; public CoinContainer spawnCoins; public GameObject revealObject; [Space(3f)] [Header("Parameters")] public float sniffRadiusMultiplier = 1f; public int digChanceOneIn = 4; public void OnLoadDelay() { if ((Object)(object)revealObject != (Object)null) { revealObject.SetActive(false); } } private void OnTriggerEnter(Collider other) { if (alreadyDug || (Object)(object)other == (Object)null) { return; } DogAI component = ((Component)other).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.stateCurrent == (Object)null || (Object)(object)((Component)component.stateCurrent).GetComponent() == (Object)null || component.states == null || component.states.Length == 0) { return; } for (int i = 0; i < component.states.Length; i++) { if (!((Object)(object)component.states[i] == (Object)null)) { DogStateDigging component2 = ((Component)component.states[i]).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.EnteredDiggableArea(this); break; } } } } public void DogInteract() { if (!alreadyDug) { SetAlreadyDugStatus(setTo: true); } } private void SetAlreadyDugStatus(bool setTo) { if (setTo != alreadyDug) { if (setTo) { syncedEvents.InvokeEventDefault1(); } else { syncedEvents.InvokeEventDefault2(); } } } public void SetDugToTrue() { alreadyDug = true; ((Collider)dogCollider).enabled = false; SpawnOnDug(); } public void SetDugToFalse() { alreadyDug = false; ((Collider)dogCollider).enabled = true; } private void SpawnOnDug() { if ((Object)(object)spawnMoon != (Object)null) { if (NewDonkCityManager.localPlayerServer && !spawnMoon.SpawnMoonAndCheck() && (Object)(object)spawnCoins != (Object)null) { spawnCoins.CollectCoin(); } } else if ((Object)(object)spawnCoins != (Object)null) { spawnCoins.CollectCoinLocal(null); } else if ((Object)(object)revealObject != (Object)null) { revealObject.SetActive(true); } } } public class DogStateAttacking : DogState { [Header("Custom")] public Vector2 randomBarkTime; [Range(0f, 100f)] public int barkChance = 50; private float barkTimer; [Space(10f)] public float attackDistance = 10f; public float barkDistance = 25f; public float loseDistance = 33f; [Space] public int noticeWidth = 70; public float defendDistance = 2.5f; [Space(10f)] public Vector2 dodgeRadius; private EnemyAI attackingEnemy; private int timesAttacked; private PlayerControllerB protectingPlayer; private int playerStartingHP; private float timeLastAttacked; private Vector3 dodgePosition; private EnemyAI tempEnemy; private List unlistedEnemies; public override GameObject[] CheckStateEnterCondition(DogState fromState) { GameObject val = null; EnemyAI enemyInLineOfSight = GetEnemyInLineOfSight(); if ((Object)(object)enemyInLineOfSight != (Object)null) { val = ((Component)enemyInLineOfSight).gameObject; } if ((Object)(object)val == (Object)null) { return null; } GameObject val2 = null; DogStateFollowing component = ((Component)fromState).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.followingPlayer != (Object)null) { val2 = ((Component)component.followingPlayer).gameObject; } return (GameObject[])(object)new GameObject[2] { val, val2 }; } public override void OnStateEnter(GameObject[] relatedObjects) { base.OnStateEnter(relatedObjects); if (relatedObjects == null || relatedObjects.Length == 0) { return; } EnemyAI val = null; for (int i = 0; i < relatedObjects.Length; i++) { if ((Object)(object)relatedObjects[i] == (Object)null) { continue; } if ((Object)(object)val == (Object)null) { val = relatedObjects[i].GetComponent(); if ((Object)(object)val != (Object)null) { ChangeAttackingEnemy(val, canBeNull: true); } } if ((Object)(object)protectingPlayer == (Object)null) { PlayerControllerB component = relatedObjects[i].GetComponent(); if ((Object)(object)component != (Object)null) { protectingPlayer = component; playerStartingHP = protectingPlayer.health; } } } } public override void OnStateExit() { base.OnStateExit(); timesAttacked = 0; ChangeAttackingEnemy(null, canBeNull: true); protectingPlayer = null; mainScript.SetTurnTowardsTarget(null); } private EnemyAI GetEnemyInLineOfSight() { //IL_00d1: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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) if ((Object)(object)RoundManager.Instance == (Object)null || RoundManager.Instance.SpawnedEnemies == null || RoundManager.Instance.SpawnedEnemies.Count == 0) { return null; } for (int i = 0; i < RoundManager.Instance.SpawnedEnemies.Count; i++) { tempEnemy = RoundManager.Instance.SpawnedEnemies[i]; if (!((Object)(object)tempEnemy == (Object)null) && !tempEnemy.isEnemyDead && tempEnemy.isOutside && !((Object)(object)tempEnemy.enemyType == (Object)null) && (unlistedEnemies == null || unlistedEnemies.Count == 0 || !unlistedEnemies.Contains(tempEnemy))) { mainScript.tempNum.x = Vector3.Distance(mainScript.eye.position, ((Component)tempEnemy).transform.position); if (mainScript.tempNum.x < attackDistance) { return tempEnemy; } if (!(mainScript.tempNum.x > barkDistance) && !(Vector3.Angle(mainScript.eye.forward, ((Component)tempEnemy).transform.position - mainScript.eye.position) > (float)noticeWidth)) { return tempEnemy; } } } return null; } private void ChangeAttackingEnemy(EnemyAI enemy, bool canBeNull = false) { //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) barkTimer = -1f; dodgePosition = Vector3.zero; if (canBeNull || (Object)(object)enemy != (Object)null) { attackingEnemy = enemy; } } public override bool WillSwitchOutOfState() { //IL_0021: 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) if ((Object)(object)attackingEnemy == (Object)null || attackingEnemy.isEnemyDead || Vector3.Distance(((Component)this).transform.position, ((Component)attackingEnemy).transform.position) > loseDistance) { EnemyAI enemyInLineOfSight = GetEnemyInLineOfSight(); if ((Object)(object)enemyInLineOfSight != (Object)null) { ChangeAttackingEnemy(enemyInLineOfSight); return false; } if (mainScript.statePrevious is DogStateFollowing) { mainScript.WipeStateChangeObjects(); if ((Object)(object)protectingPlayer != (Object)null && protectingPlayer.isPlayerControlled) { mainScript.StoreStateChangeObjects((GameObject[])(object)new GameObject[1] { ((Component)protectingPlayer).gameObject }); } mainScript.SwitchState(mainScript.statePrevious, mainScript.stateChangeObjects, "F"); } else { mainScript.SwitchStateToDefault("B"); } return true; } return base.WillSwitchOutOfState(); } public override void SpecialStateBehaviour() { if (barkTimer == -1f) { barkTimer = Random.Range(randomBarkTime.x, randomBarkTime.y); } if (GetConditionToAttackEnemy()) { AttackEnemy(); } else { BarkAtEnemy(); } } private bool GetConditionToAttackEnemy() { //IL_008c: 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_0062: 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) if ((Object)(object)attackingEnemy == (Object)null) { return false; } if (barkTimer <= 0f) { return true; } if ((Object)(object)protectingPlayer != (Object)null) { if ((Object)(object)protectingPlayer.inAnimationWithEnemy != (Object)null) { return true; } if (protectingPlayer.health < playerStartingHP) { return true; } if (Vector3.Distance(((Component)attackingEnemy).transform.position, ((Component)protectingPlayer).transform.position) <= defendDistance) { return true; } } if (Vector3.Distance(((Component)this).transform.position, ((Component)attackingEnemy).transform.position) < attackDistance) { return true; } return false; } private void BarkAtEnemy() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) mainScript.SetAgentDestination(((Component)this).transform.position); barkTimer -= intervalTime; mainScript.SetTurnTowardsTarget(((Component)attackingEnemy).transform, 0.2f); if (Random.Range(1, 101) <= barkChance) { mainScript.AnimateDog("BarkAtEnemy", (AnimatorControllerParameterType)9, boolVal: true, -1f, sync: true); } } private void AttackEnemy() { //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) //IL_011c: 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_014d: 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_00e5: 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_0100: 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_01fa: 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) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attackingEnemy == (Object)null || (Object)(object)attackingEnemy.agent == (Object)null || (Object)(object)attackingEnemy.enemyType == (Object)null) { return; } if (!attackingEnemy.enemyType.canDie || (tempEnemy.enemyType.isDaytimeEnemy && tempEnemy.enemyType.PowerLevel <= 1f)) { UnlistEnemy(attackingEnemy); ChangeAttackingEnemy(null, canBeNull: true); return; } barkTimer = 0f; mainScript.SetTurnTowardsTarget(null); if (dodgePosition != Vector3.zero) { mainScript.SetAgentDestination(dodgePosition); mainScript.SetTurnTowardsTarget(((Component)attackingEnemy).transform); if (Vector3.Distance(((Component)this).transform.position, dodgePosition) < 1f) { dodgePosition = Vector3.zero; } return; } mainScript.SetAgentDestination(((Component)attackingEnemy).transform.position); mainScript.SetTurnTowardsTarget(null); if (Vector3.Distance(((Component)this).transform.position, ((Component)attackingEnemy).transform.position) < attackingEnemy.agent.radius + GetEnemyRadius(attackingEnemy) * 0.6f && Time.realtimeSinceStartup - timeLastAttacked > 2f) { timesAttacked++; timeLastAttacked = Time.realtimeSinceStartup; PlayerControllerB val = null; if ((Object)(object)protectingPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)protectingPlayer).transform.position) < defendDistance) { val = protectingPlayer; } attackingEnemy.HitEnemyOnLocalClient(1, ((Component)this).transform.forward, val, true, -1); SetRandomDodgePosition(); mainScript.AnimateDog("Jump", (AnimatorControllerParameterType)9, boolVal: true, -1f, sync: true); } } private float GetEnemyRadius(EnemyAI enemy) { //IL_0028: 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_0053: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)enemy == (Object)null || (Object)(object)enemy.agent == (Object)null) { return 1f; } float num = (((Component)enemy.agent).transform.localScale.x + ((Component)enemy.agent).transform.localScale.y + ((Component)enemy.agent).transform.localScale.z) / 3f; return enemy.agent.radius * num; } private void SetRandomDodgePosition() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0091: 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_00e1: 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) Vector3 toPosition = (((Object)(object)protectingPlayer != (Object)null) ? ((Component)protectingPlayer).transform.position : ((Component)this).transform.position); mainScript.tempNum = ((Component)this).transform.position + NewDonkCityManager.GetForwardToPosition(((Component)attackingEnemy).transform, toPosition, matchX: false, matchY: true) * Random.Range(dodgeRadius.x, dodgeRadius.y); if (NavMesh.SamplePosition(new Vector3(mainScript.tempNum.x, ((Component)this).transform.position.y, mainScript.tempNum.z), ref RoundManager.Instance.navHit, 10f, mainScript.agent.areaMask)) { dodgePosition = ((NavMeshHit)(ref RoundManager.Instance.navHit)).position; } } public override int VisibleThreatGetThreatLevel(Vector3 seenByPosition) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return (timesAttacked + 1) * ((!SeenByTargetEnemy(seenByPosition)) ? 1 : 3); } public override int VisibleThreatGetInterestLevel() { return (int)((float)timesAttacked / 2f); } public override float VisibleThreatGetVisibility() { return 0.5f + ((timesAttacked == 0) ? 0f : 0.5f); } private bool SeenByTargetEnemy(Vector3 seenByPosition) { //IL_00c6: 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_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)attackingEnemy == (Object)null) { return false; } if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.SpawnedEnemies != null && RoundManager.Instance.SpawnedEnemies.Count != 0) { for (int i = 0; i < RoundManager.Instance.SpawnedEnemies.Count; i++) { tempEnemy = RoundManager.Instance.SpawnedEnemies[i]; if (!((Object)(object)tempEnemy == (Object)null) && !((Object)(object)tempEnemy != (Object)(object)attackingEnemy) && !tempEnemy.isEnemyDead) { if ((Object)(object)tempEnemy.eye != (Object)null && tempEnemy.eye.position == seenByPosition) { return true; } if (((Component)tempEnemy).transform.position == seenByPosition) { return true; } } } } return false; } private void UnlistEnemy(EnemyAI enemy) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { UnlistEnemyLocal(enemy); UnlistEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject)); } } [ServerRpc(RequireOwnership = false)] private void UnlistEnemyServerRpc(NetworkObjectReference enemyNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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_00e2: 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(1127797845u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemyNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1127797845u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UnlistEnemyClientRpc(enemyNOR); } } } [ClientRpc] private void UnlistEnemyClientRpc(NetworkObjectReference enemyNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(3634480969u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemyNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3634480969u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkBehaviour)this).IsOwner && ((NetworkObjectReference)(ref enemyNOR)).TryGet(ref val3, (NetworkManager)null)) { UnlistEnemyLocal(((Component)val3).GetComponent()); } } } private void UnlistEnemyLocal(EnemyAI enemy) { if (unlistedEnemies == null) { unlistedEnemies = new List(); } if (!unlistedEnemies.Contains(enemy)) { unlistedEnemies.Add(enemy); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1127797845u, new RpcReceiveHandler(__rpc_handler_1127797845), "UnlistEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3634480969u, new RpcReceiveHandler(__rpc_handler_3634480969), "UnlistEnemyClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1127797845(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateAttacking)(object)target).UnlistEnemyServerRpc(enemyNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3634480969(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateAttacking)(object)target).UnlistEnemyClientRpc(enemyNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DogStateAttacking"; } } public class DogStateDigging : DogState { [Header("Custom")] public float sniffRadiusMultiplier = 1f; public Vector2 sniffTimeRange; private DogDiggable investigatingDigSpot; private GameObject lastAreaEntered; private Vector3 randomSniffSpot; private bool digUpNextSniff; private float sniffTimer; private PlayerControllerB diggingForPlayer; private bool digging; public void EnteredDiggableArea(DogDiggable digSpot) { if (((NetworkBehaviour)this).IsOwner && !((Object)(object)digSpot == (Object)null) && !((Object)(object)investigatingDigSpot != (Object)null)) { lastAreaEntered = ((Component)digSpot).gameObject; Plugin.Logger.LogDebug((object)$"{mainScript} #{((NetworkBehaviour)mainScript).NetworkObjectId}: EnteredDiggableArea() \"{((Object)lastAreaEntered).name}\""); } } public override GameObject[] CheckStateEnterCondition(DogState fromState) { if ((Object)(object)lastAreaEntered == (Object)null) { return null; } DogStateFollowing component = ((Component)fromState).GetComponent(); if ((Object)(object)component != (Object)null) { if (!((Object)(object)component.followingPlayer != (Object)null)) { return (GameObject[])(object)new GameObject[1] { lastAreaEntered }; } return (GameObject[])(object)new GameObject[2] { lastAreaEntered, ((Component)component.followingPlayer).gameObject }; } return null; } public override void OnStateEnter(GameObject[] relatedObjects) { base.OnStateEnter(relatedObjects); if (relatedObjects != null && relatedObjects.Length != 0) { for (int i = 0; i < relatedObjects.Length; i++) { if (!((Object)(object)relatedObjects[i] == (Object)null)) { if ((Object)(object)investigatingDigSpot == (Object)null) { investigatingDigSpot = relatedObjects[i].GetComponent(); } if ((Object)(object)diggingForPlayer == (Object)null) { diggingForPlayer = relatedObjects[i].GetComponent(); } } } } lastAreaEntered = null; randomSniffSpot.y = -999f; mainScript.AnimateDog("Sniffing", (AnimatorControllerParameterType)4); } public override void OnStateExit() { base.OnStateExit(); diggingForPlayer = null; mainScript.AnimateDog("Sniffing", (AnimatorControllerParameterType)4, boolVal: false); } public override void SpecialStateBehaviour() { //IL_00ce: 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) if (digging) { return; } if ((Object)(object)investigatingDigSpot == (Object)null) { if (mainScript.statePrevious is DogStateFollowing) { mainScript.WipeStateChangeObjects(); if ((Object)(object)diggingForPlayer != (Object)null && diggingForPlayer.isPlayerControlled) { mainScript.StoreStateChangeObjects((GameObject[])(object)new GameObject[1] { ((Component)diggingForPlayer).gameObject }); } mainScript.SwitchState(mainScript.statePrevious, mainScript.stateChangeObjects, "G"); } else { mainScript.SwitchStateToDefault("C"); } } else if (randomSniffSpot.y == -999f) { PickNewSniffSpot(); } else if (Vector3.Distance(((Component)mainScript).transform.position, randomSniffSpot) > 0.5f) { WalkToSniffSpot(); } else if (sniffTimer > 0f) { InvestigateAtSniffSpot(); } else { DigAtSniffSpot(); } } private void PickNewSniffSpot() { //IL_0032: 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_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_0124: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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) sniffTimer = Random.Range(sniffTimeRange.x, sniffTimeRange.y); mainScript.tempNum = ((Component)investigatingDigSpot).transform.position; if (Random.Range(0, investigatingDigSpot.digChanceOneIn) == 0) { digUpNextSniff = true; } else { digUpNextSniff = false; mainScript.tempNum.x = ((Component)investigatingDigSpot).transform.position.x + investigatingDigSpot.dogCollider.center.x; mainScript.tempNum.x += Random.Range(investigatingDigSpot.dogCollider.radius / 2f * investigatingDigSpot.sniffRadiusMultiplier * sniffRadiusMultiplier, investigatingDigSpot.dogCollider.radius / 2f * -1f * investigatingDigSpot.sniffRadiusMultiplier * sniffRadiusMultiplier); mainScript.tempNum.z = ((Component)investigatingDigSpot).transform.position.z + investigatingDigSpot.dogCollider.center.z; mainScript.tempNum.z += Random.Range(investigatingDigSpot.dogCollider.radius / 2f * investigatingDigSpot.sniffRadiusMultiplier * sniffRadiusMultiplier, investigatingDigSpot.dogCollider.radius / 2f * -1f * investigatingDigSpot.sniffRadiusMultiplier * sniffRadiusMultiplier); } investigatingDigSpot.digChanceOneIn--; if (NavMesh.SamplePosition(new Vector3(mainScript.tempNum.x, ((Component)investigatingDigSpot).transform.position.y, mainScript.tempNum.z), ref RoundManager.Instance.navHit, 10f, mainScript.agent.areaMask)) { randomSniffSpot = ((NavMeshHit)(ref RoundManager.Instance.navHit)).position; } } private void WalkToSniffSpot() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) mainScript.SetAgentDestination(randomSniffSpot); } private void InvestigateAtSniffSpot() { sniffTimer -= intervalTime; } private void DigAtSniffSpot() { randomSniffSpot.y = -999f; if (digUpNextSniff) { digging = true; mainScript.AnimateDog("DigAtSniffSpot", (AnimatorControllerParameterType)9, boolVal: true, -1f, sync: true); } } public override void AnimationEvent(int switchCase) { DigUp(); } private void DigUp() { if (((NetworkBehaviour)this).IsOwner && (Object)(object)investigatingDigSpot != (Object)null) { investigatingDigSpot.DogInteract(); investigatingDigSpot = null; } digging = false; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "DogStateDigging"; } } public class DogStateFollowing : DogState { [HideInInspector] public PlayerControllerB followingPlayer; [Header("Custom")] public float noticeDistance = 12.5f; [Range(0f, 90f)] public int noticeAngle = 40; public float followDistance = 50f; [Space(10f)] public Transform itemHolder; private GrabbableObject fetchingItem; private GrabbableObject focusingDroppedItem; private bool useItemRealtimePosition; private Vector3 itemFloorPosition; public override GameObject[] CheckStateEnterCondition(DogState fromState) { //IL_0066: 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_00e0: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)null) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[i].lowerSpine == (Object)null) && StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled) { mainScript.tempNum.x = Vector3.Distance(mainScript.eye.position, StartOfRound.Instance.allPlayerScripts[i].lowerSpine.position); if (mainScript.tempNum.x < 3.33f) { return (GameObject[])(object)new GameObject[1] { ((Component)StartOfRound.Instance.allPlayerScripts[i]).gameObject }; } if (!(mainScript.tempNum.x > noticeDistance) && !(Vector3.Angle(mainScript.eye.forward, StartOfRound.Instance.allPlayerScripts[i].lowerSpine.position - mainScript.eye.position) > (float)noticeAngle)) { return (GameObject[])(object)new GameObject[1] { ((Component)StartOfRound.Instance.allPlayerScripts[i]).gameObject }; } } } return null; } public override bool WillSwitchOutOfState() { //IL_0021: 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) if ((Object)(object)followingPlayer == (Object)null || !followingPlayer.isPlayerControlled || Vector3.Distance(((Component)this).transform.position, ((Component)followingPlayer).transform.position) > followDistance) { mainScript.SwitchStateToDefault("D"); return true; } return base.WillSwitchOutOfState(); } public override void SpecialStateBehaviour() { SetDestination(); FetchItem(); } private void SetDestination() { //IL_0049: 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 ((Object)(object)fetchingItem != (Object)null && (Object)(object)fetchingItem.parentObject != (Object)(object)itemHolder) { mainScript.SetAgentDestination(GetItemFloorPosition()); } else { mainScript.SetAgentDestination(((Component)followingPlayer).transform.position); } } private void FetchItem() { //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_008f: 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) if ((Object)(object)fetchingItem != (Object)null && !ItemIsGrabbable(fetchingItem, checkGrabbable: true, checkPosition: false, checkHeld: false)) { fetchingItem = null; mainScript.SetAgentParameters(-1f, -1f, -1f, agentStoppingDistance); } if ((Object)(object)fetchingItem == (Object)null) { if ((Object)(object)focusingDroppedItem != (Object)null) { if (!ItemIsGrabbable(focusingDroppedItem, checkGrabbable: true, checkPosition: true, checkHeld: true)) { focusingDroppedItem = null; } else if (Vector3.Distance(((Component)followingPlayer).transform.position, ((Component)focusingDroppedItem).transform.position) > 7.5f) { fetchingItem = focusingDroppedItem; focusingDroppedItem = null; mainScript.SetAgentParameters(-1f, -1f, -1f, 0f); SetItemFloorPosition(); } } if ((Object)(object)focusingDroppedItem == (Object)null) { focusingDroppedItem = followingPlayer.currentlyHeldObjectServer; } } else if ((Object)(object)fetchingItem.parentObject != (Object)(object)itemHolder) { if (Vector3.Distance(((Component)this).transform.position, GetItemFloorPosition()) < 1f) { GrabItem(fetchingItem); mainScript.SetAgentParameters(-1f, -1f, -1f, agentStoppingDistance); } } else if (Vector3.Distance(((Component)this).transform.position, ((Component)followingPlayer).transform.position) < agentStoppingDistance + 0.5f) { DropItem(); } } private bool ItemIsGrabbable(GrabbableObject item, bool checkGrabbable, bool checkPosition, bool checkHeld) { if ((Object)(object)item == (Object)null || item.deactivated || (Object)(object)item.itemProperties == (Object)null || item.itemProperties.twoHanded) { return false; } if ((Object)(object)item.parentObject != (Object)null) { return (Object)(object)item.parentObject == (Object)(object)itemHolder; } if (checkGrabbable && (!item.grabbable || !item.grabbableToEnemies)) { return false; } if (checkPosition && (item.isInShipRoom || item.isInFactory)) { return false; } if (checkHeld && (item.isHeld || item.isPocketed)) { return false; } return true; } private Vector3 GetItemFloorPosition() { //IL_0014: 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_002d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fetchingItem == (Object)null) { return ((Component)this).transform.position; } if (useItemRealtimePosition) { return ((Component)fetchingItem).transform.position; } return itemFloorPosition; } private void SetItemFloorPosition() { //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_0089: 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_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_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_00c2: 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) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) useItemRealtimePosition = false; if ((Object)(object)fetchingItem == (Object)null) { itemFloorPosition = ((Component)this).transform.position; return; } if ((Object)(object)((Component)fetchingItem).GetComponent() != (Object)null) { useItemRealtimePosition = true; return; } if ((Object)(object)((Component)fetchingItem).transform.parent != (Object)null) { itemFloorPosition = ((Component)fetchingItem).transform.parent.TransformPoint(fetchingItem.targetFloorPosition); } else { itemFloorPosition = ((Component)this).transform.position; } if ((Object)(object)fetchingItem.itemProperties != (Object)null) { itemFloorPosition -= Vector3.up * fetchingItem.itemProperties.verticalOffset; } } private void GrabItem(GrabbableObject item) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && !((Object)(object)item == (Object)null)) { GrabItemLocal(item); GrabItemServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); } } [ServerRpc(RequireOwnership = true)] private void GrabItemServerRpc(NetworkObjectReference itemNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(471879183u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 471879183u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabItemClientRpc(itemNOR); } } [ClientRpc] private void GrabItemClientRpc(NetworkObjectReference itemNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(2028507741u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2028507741u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkBehaviour)this).IsOwner && ((NetworkObjectReference)(ref itemNOR)).TryGet(ref val3, (NetworkManager)null)) { GrabItemLocal(((Component)val3).GetComponent()); } } } private void GrabItemLocal(GrabbableObject item) { if (!((Object)(object)item == (Object)null)) { item.grabbable = false; item.isHeld = true; item.isHeldByEnemy = true; item.isPocketed = false; item.hasHitGround = false; item.reachedFloorTarget = false; item.parentObject = itemHolder; item.fallTime = 0f; item.EnablePhysics(false); item.EnableItemMeshes(true); mainScript.AnimateDog("Jump", (AnimatorControllerParameterType)9); } } private void DropItem() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && !((Object)(object)fetchingItem == (Object)null)) { DropItemServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)fetchingItem).NetworkObject)); DropItemLocal(fetchingItem); } } [ServerRpc(RequireOwnership = true)] private void DropItemServerRpc(NetworkObjectReference itemNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(852817137u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 852817137u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropItemClientRpc(itemNOR); } } [ClientRpc] private void DropItemClientRpc(NetworkObjectReference itemNOR) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(2400958771u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2400958771u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkBehaviour)this).IsOwner && ((NetworkObjectReference)(ref itemNOR)).TryGet(ref val3, (NetworkManager)null)) { DropItemLocal(((Component)val3).GetComponent()); } } } private void DropItemLocal(GrabbableObject item) { //IL_0096: 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_00a7: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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)item.parentObject == (Object)null) && !((Object)(object)item.parentObject != (Object)(object)itemHolder)) { item.grabbable = true; item.isHeld = false; item.isHeldByEnemy = false; item.isPocketed = false; item.hasHitGround = false; item.reachedFloorTarget = false; item.parentObject = null; item.fallTime = 0f; item.EnablePhysics(true); item.EnableItemMeshes(true); ((Component)item).transform.SetParent((Transform)null); item.startFallingPosition = itemHolder.position; item.targetFloorPosition = new Vector3(itemHolder.position.x, ((Component)this).transform.position.y + item.itemProperties.verticalOffset, itemHolder.position.z); fetchingItem = null; } } public override void OnStateEnter(GameObject[] relatedObjects) { base.OnStateEnter(relatedObjects); if (relatedObjects != null && relatedObjects.Length != 0) { for (int i = 0; i < relatedObjects.Length; i++) { if (!((Object)(object)relatedObjects[i] == (Object)null)) { PlayerControllerB component = relatedObjects[i].GetComponent(); if ((Object)(object)component != (Object)null) { ChangeFollowingPlayer(component); break; } } } } if ((Object)(object)followingPlayer != (Object)null && (Object)(object)mainScript.statePrevious != (Object)null && (Object)(object)((Component)mainScript.statePrevious).GetComponent() != (Object)null) { mainScript.AnimateDog("NoticePlayer", (AnimatorControllerParameterType)9); ((MonoBehaviour)this).StartCoroutine(TurnToNewPlayer()); } } private IEnumerator TurnToNewPlayer() { mainScript.SetAgentParameters(0f); mainScript.SetTurnTowardsTarget(((Component)followingPlayer).transform, 0.33f); yield return (object)new WaitForSeconds(1f); mainScript.SetAgentParameters(agentSpeed); mainScript.SetTurnTowardsTarget(null); } public override void OnStateExit() { base.OnStateExit(); followingPlayer = null; DropItem(); focusingDroppedItem = null; SetItemFloorPosition(); } private void ChangeFollowingPlayer(PlayerControllerB player, bool canBeNull = false) { if (canBeNull || (Object)(object)player != (Object)null) { followingPlayer = player; } mainScript.ChangeOwnership(followingPlayer); } public override GrabbableObject VisibleThreatGetHeldObject() { if ((Object)(object)fetchingItem != (Object)null && (Object)(object)fetchingItem.parentObject == (Object)(object)itemHolder) { return fetchingItem; } return null; } public override int VisibleThreatGetInterestLevel() { if ((Object)(object)fetchingItem != (Object)null) { if ((Object)(object)fetchingItem.parentObject == (Object)(object)itemHolder) { return 3; } return 2; } return 1; } public override float VisibleThreatGetVisibility() { if ((Object)(object)fetchingItem != (Object)null && (Object)(object)fetchingItem.parentObject == (Object)(object)itemHolder) { return 0.75f; } return 0.25f; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //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 ((NetworkBehaviour)this).__registerRpc(471879183u, new RpcReceiveHandler(__rpc_handler_471879183), "GrabItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2028507741u, new RpcReceiveHandler(__rpc_handler_2028507741), "GrabItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(852817137u, new RpcReceiveHandler(__rpc_handler_852817137), "DropItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2400958771u, new RpcReceiveHandler(__rpc_handler_2400958771), "DropItemClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_471879183(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0091: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateFollowing)(object)target).GrabItemServerRpc(itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2028507741(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateFollowing)(object)target).GrabItemClientRpc(itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_852817137(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0091: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateFollowing)(object)target).DropItemServerRpc(itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2400958771(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DogStateFollowing)(object)target).DropItemClientRpc(itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DogStateFollowing"; } } public class DogStateIdle : DogState { [Header("Custom")] public Transform tempLookTransform; private float timeLastLooked; private bool looking; public override void OnInitializing() { base.OnInitializing(); Transform parent = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { parent = RoundManager.Instance.mapPropsContainer.transform; } else if ((Object)(object)mainScript != (Object)null && (Object)(object)((Component)mainScript).transform.parent != (Object)null) { parent = ((Component)mainScript).transform.parent; } tempLookTransform.SetParent(parent); } public override void SpecialStateBehaviour() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) mainScript.SetAgentDestination(((Component)this).transform.position); if (looking && Time.realtimeSinceStartup - timeLastLooked > 2f) { looking = false; mainScript.SetTurnTowardsTarget(null); } } public override void NoiseListenerDetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && noiseID != 20050421 && !(noiseLoudness * (float)Mathf.Max(timesPlayedInOneSpot, 1) < 0.4f) && !(Time.realtimeSinceStartup - timeLastLooked < 0.5f)) { tempLookTransform.position = noisePosition; looking = true; mainScript.SetTurnTowardsTarget(tempLookTransform, 0.1f); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "DogStateIdle"; } } public class FireHydrant : NetworkBehaviour, IHittable { private static ManualLogSource Logger; public Transform[] sprayFrom; private Coroutine sprayCoroutine; [Space(3f)] public Animator fireHydrantAnimator; public AudioSource spraySfxSource; public AudioClip spraySfxClip; public ParticleSystem[] sprayParticles; [Space] public CoinContainer spawnCoin; bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { Logger.LogDebug((object)$"{playerWhoHit} hit {this} #{((NetworkBehaviour)this).NetworkObjectId}"); if (sprayCoroutine != null) { return false; } DoSprayCoroutineLocal(playerWhoHit); if ((Object)(object)playerWhoHit != (Object)null) { if ((Object)(object)playerWhoHit == (Object)(object)NewDonkCityManager.localPlayer) { DoSprayCoroutineServerRpc(NewDonkCityManager.localPlayerID); } } else if (((NetworkBehaviour)this).IsServer) { DoSprayCoroutineClientRpc(-1); } return true; } [ServerRpc(RequireOwnership = false)] private void DoSprayCoroutineServerRpc(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(747305170u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 747305170u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DoSprayCoroutineClientRpc(playerID); } } } [ClientRpc] private void DoSprayCoroutineClientRpc(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(1138392552u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1138392552u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { DoSprayCoroutineLocal(NewDonkCityManager.GetPlayerWithID(playerID)); } } } private void DoSprayCoroutineLocal(PlayerControllerB hitBy) { if (sprayCoroutine == null) { sprayCoroutine = ((MonoBehaviour)this).StartCoroutine(SprayCoroutine(hitBy)); } } private IEnumerator SprayCoroutine(PlayerControllerB hitBy) { Logger.LogDebug((object)$"StartCoroutine on {this} #{((NetworkBehaviour)this).NetworkObjectId} with hitBy {hitBy}"); fireHydrantAnimator.SetTrigger("Spray"); GenericManager.PlaySFX(spraySfxSource, spraySfxClip, audible: true, 15f, 1f); SetParticles(setTo: true); spawnCoin.CollectCoinLocal(hitBy); float timeLeft = 3.33f; float stunInterval = 0.2f; while (timeLeft > 0f) { yield return null; timeLeft -= Time.deltaTime; stunInterval += Time.deltaTime; if (stunInterval >= 0.2f) { stunInterval = 0f; StunInRange(hitBy); } } spraySfxSource.Stop(); SetParticles(setTo: false); } private void SetParticles(bool setTo) { if (sprayParticles == null || sprayParticles.Length == 0) { return; } for (int i = 0; i < sprayParticles.Length; i++) { ParticleSystem val = sprayParticles[i]; if (!((Object)(object)val == (Object)null)) { if (setTo) { val.Play(); } else { val.Stop(); } } } } private void StunInRange(PlayerControllerB hitBy) { //IL_0026: 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_0032: 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_003d: 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 (sprayFrom == null || sprayFrom.Length == 0) { return; } float num = 7.5f; RaycastHit hitInfo = default(RaycastHit); for (int i = 0; i < sprayFrom.Length; i++) { Transform val = sprayFrom[i]; if (Physics.Linecast(val.position, val.position + val.forward * num, ref hitInfo, 1107822857, (QueryTriggerInteraction)2)) { StunHitObject(hitInfo, hitBy, val, num); } } } private void StunHitObject(RaycastHit hitInfo, PlayerControllerB hitBy, Transform hitOrigin, float hitDistance) { //IL_008b: 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) if (!((Object)(object)((RaycastHit)(ref hitInfo)).collider == (Object)null)) { float num = Mathf.Max(1f, hitDistance - ((RaycastHit)(ref hitInfo)).distance) * 2f; PlayerControllerB component = ((Component)((RaycastHit)(ref hitInfo)).collider).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)NewDonkCityManager.localPlayer) { HUDManager instance = HUDManager.Instance; instance.flashFilter += num * 0.1f; HUDManager.Instance.flashFilter = Mathf.Clamp(HUDManager.Instance.flashFilter, 0f, 1f); NewDonkCityManager.AddForceToPlayerBody(component, hitOrigin.forward * num, addToExistingForce: true, resetFallValue: false); } EnemyAICollisionDetect component2 = ((Component)((RaycastHit)(ref hitInfo)).collider).GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.mainScript != (Object)null && component2.mainScript.stunNormalizedTimer <= 0f) { component2.mainScript.SetEnemyStunned(true, num * 0.75f, hitBy); } } } 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(747305170u, new RpcReceiveHandler(__rpc_handler_747305170), "DoSprayCoroutineServerRpc"); ((NetworkBehaviour)this).__registerRpc(1138392552u, new RpcReceiveHandler(__rpc_handler_1138392552), "DoSprayCoroutineClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_747305170(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; ((FireHydrant)(object)target).DoSprayCoroutineServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1138392552(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; ((FireHydrant)(object)target).DoSprayCoroutineClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FireHydrant"; } } public class GroundLightRevealable : NetworkBehaviour { private static ManualLogSource Logger; [Header("Light")] public Light visibleLight; public Vector2 lightIntensityIdle; public float lightIntensityFull; public float idleSpeedMultiplier = 5f; public float increaseSpeedMultiplier = 10f; [Space(3f)] [Header("Misc")] public AudioSource revealingAudio; [Space(3f)] [Header("Spawnable")] public MoonData spawnMoon; public CoinContainer spawnCoins; private Dictionary playerLights; private float lastTotalLight; private float checkLocalShineTimer; private bool lightIncreasing; private bool shiningIntervalCurrent; private bool shiningIntervalPrevious; private void Awake() { ((Behaviour)visibleLight).enabled = false; } public void OnLoadDelay() { ((Behaviour)visibleLight).enabled = true; if (((NetworkBehaviour)this).IsServer) { playerLights = new Dictionary(); } } private void Update() { if (!((Component)this).gameObject.activeSelf || (Object)(object)visibleLight == (Object)null || !((Behaviour)visibleLight).enabled) { if ((Object)(object)revealingAudio != (Object)null && revealingAudio.isPlaying) { MoveAudioToTarget(0f, 1f); } return; } CheckLocalPlayerShiningSpot(); if (lastTotalLight > 0f) { IncreaseShiningLight(); } else { PingPongIdleLight(); } } private void CheckLocalPlayerShiningSpot() { //IL_00c7: 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_00fc: 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_0110: 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) //IL_013c: Unknown result type (might be due to invalid IL or missing references) if (checkLocalShineTimer > 0f) { checkLocalShineTimer -= Time.deltaTime; return; } if (shiningIntervalPrevious) { checkLocalShineTimer = 0.75f; } else { checkLocalShineTimer = 2.5f; } shiningIntervalCurrent = false; float num = 0f; GroundLightRevealable groundLightRevealable = null; if ((Object)(object)NewDonkCityManager.Instance != (Object)null && (Object)(object)NewDonkCityManager.localPlayer != (Object)null && (Object)(object)NewDonkCityManager.localPlayer.currentlyHeldObjectServer != (Object)null) { FlashlightItem component = ((Component)NewDonkCityManager.localPlayer.currentlyHeldObjectServer).GetComponent(); RaycastHit val = default(RaycastHit); if ((Object)(object)component != (Object)null && (Object)(object)component.flashlightBulb != (Object)null && ((Behaviour)component.flashlightBulb).enabled && Vector3.Distance(((Component)this).transform.position, ((Component)component).transform.position) < component.flashlightBulb.range / 2f && Physics.Raycast(NewDonkCityManager.localPlayer.playerEye.position + NewDonkCityManager.localPlayer.playerEye.forward, NewDonkCityManager.localPlayer.playerEye.forward, ref val, component.flashlightBulb.range / 5f, LayerMask.op_Implicit(NewDonkCityManager.Instance.ndcHitMask), (QueryTriggerInteraction)2) && (Object)(object)((RaycastHit)(ref val)).collider != (Object)null) { if (Application.isEditor) { Logger.LogDebug((object)("hitInfo.collider = " + ((Object)((RaycastHit)(ref val)).collider).name)); } groundLightRevealable = ((Component)((RaycastHit)(ref val)).collider).GetComponent(); } if ((Object)(object)groundLightRevealable != (Object)null && (Object)(object)groundLightRevealable == (Object)(object)this) { shiningIntervalCurrent = true; num = component.flashlightBulb.intensity / 100f * Mathf.Clamp(Mathf.InverseLerp(0f, 100f, component.flashlightBulb.spotAngle), 0f, 1f); } } if (shiningIntervalCurrent != shiningIntervalPrevious) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: locally changed to {shiningIntervalCurrent} with intensity {num}"); ChangePlayerShiningServerRpc(NewDonkCityManager.localPlayerID, num, shiningIntervalCurrent); } shiningIntervalPrevious = shiningIntervalCurrent; } private void IncreaseShiningLight() { lightIncreasing = true; Light obj = visibleLight; obj.intensity += Time.deltaTime * lastTotalLight * increaseSpeedMultiplier; MoveAudioToTarget(visibleLight.intensity / lightIntensityFull, 0.33f); if (!((NetworkBehaviour)this).IsServer || !(visibleLight.intensity >= lightIntensityFull)) { return; } if ((Object)(object)spawnMoon != (Object)null && spawnMoon.SpawnMoonAndCheck()) { if (Application.isEditor) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} succeeded"); } } else if ((Object)(object)spawnCoins != (Object)null) { spawnCoins.CollectCoin(); } ToggleLightLocal(setTo: false); ToggleLightClientRpc(setTo: false); } [ClientRpc] private void ToggleLightClientRpc(bool setTo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(1148816888u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setTo, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1148816888u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { ToggleLightLocal(setTo); } } } private void ToggleLightLocal(bool setTo) { if (!((Object)(object)visibleLight == (Object)null)) { ((Behaviour)visibleLight).enabled = setTo; } } private void PingPongIdleLight() { MoveAudioToTarget(0f, 0.05f); if (lightIncreasing) { if (visibleLight.intensity >= lightIntensityIdle.x - increaseSpeedMultiplier * 0.1f) { Light obj = visibleLight; obj.intensity += Time.deltaTime * idleSpeedMultiplier; } else { visibleLight.intensity = Mathf.Clamp(visibleLight.intensity + Time.deltaTime * increaseSpeedMultiplier, visibleLight.intensity, lightIntensityIdle.y); } if (visibleLight.intensity >= lightIntensityIdle.y) { lightIncreasing = false; } } else { if (visibleLight.intensity <= lightIntensityIdle.y + increaseSpeedMultiplier * 0.1f) { Light obj2 = visibleLight; obj2.intensity -= Time.deltaTime * idleSpeedMultiplier; } else { visibleLight.intensity = Mathf.Clamp(visibleLight.intensity - Time.deltaTime * increaseSpeedMultiplier, lightIntensityIdle.x, visibleLight.intensity); } if (visibleLight.intensity <= lightIntensityIdle.x) { lightIncreasing = true; } } } [ServerRpc(RequireOwnership = false)] private void ChangePlayerShiningServerRpc(int playerID, float playerLight, 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(706355506u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playerLight, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref add, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 706355506u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerLights != null) { if (add && !playerLights.ContainsKey(playerID)) { playerLights.Add(playerID, playerLight); } else if (!add && playerLights.ContainsKey(playerID)) { playerLights.Remove(playerID); } GetTotalLightIntensity(); ChangePlayerShiningClientRpc(lastTotalLight); } } private void GetTotalLightIntensity() { if (playerLights == null) { return; } lastTotalLight = 0f; if (playerLights.Count == 0) { return; } for (int i = 0; i < playerLights.Count; i++) { KeyValuePair keyValuePair = playerLights.ElementAt(i); if (!keyValuePair.Equals(null) && !(keyValuePair.Value <= 0f)) { lastTotalLight += keyValuePair.Value; } } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SERVER: {lastTotalLight}"); } [ClientRpc] private void ChangePlayerShiningClientRpc(float serverIntensity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(95411u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref serverIntensity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 95411u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { lastTotalLight = serverIntensity; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} CLIENT: {lastTotalLight}"); } } } private void MoveAudioToTarget(float targetVolume, float lerpSpeed) { if (!((Object)(object)revealingAudio == (Object)null)) { revealingAudio.volume = Mathf.Lerp(revealingAudio.volume, targetVolume, lerpSpeed * Time.deltaTime * 60f); if (targetVolume < revealingAudio.volume && revealingAudio.isPlaying && revealingAudio.volume <= 0.2f) { revealingAudio.Stop(); } if (targetVolume > revealingAudio.volume && !revealingAudio.isPlaying) { revealingAudio.Play(); } } } 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 ((NetworkBehaviour)this).__registerRpc(1148816888u, new RpcReceiveHandler(__rpc_handler_1148816888), "ToggleLightClientRpc"); ((NetworkBehaviour)this).__registerRpc(706355506u, new RpcReceiveHandler(__rpc_handler_706355506), "ChangePlayerShiningServerRpc"); ((NetworkBehaviour)this).__registerRpc(95411u, new RpcReceiveHandler(__rpc_handler_95411), "ChangePlayerShiningClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1148816888(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setTo = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setTo, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GroundLightRevealable)(object)target).ToggleLightClientRpc(setTo); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_706355506(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); float playerLight = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerLight, default(ForPrimitives)); bool add = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref add, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GroundLightRevealable)(object)target).ChangePlayerShiningServerRpc(playerID, playerLight, add); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_95411(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float serverIntensity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref serverIntensity, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GroundLightRevealable)(object)target).ChangePlayerShiningClientRpc(serverIntensity); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GroundLightRevealable"; } } public class Hitbox : MonoBehaviour, IPhysicsSearchable { public GameObject mainObject; private string keyName = "Hitbox"; string IPhysicsSearchable.keyName => keyName; private void OnTriggerEnter(Collider other) { CallMainScript(other); } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { Collider other = null; if ((Object)(object)linkedObject != (Object)null) { other = linkedObject.GetComponent(); } CallMainScript(other); } public void CallMainScript(Collider other = null) { if (!((Object)(object)mainObject == (Object)null)) { mainObject.GetComponent()?.HitboxTriggerEntered(this, other); } } } public class HittableSpawner : MonoBehaviour, IHittable, IPhysicsSearchable { private static ManualLogSource Logger; private string keyName = "Hittable Spawner"; public int health = 1; public Animator animator; [Space(3f)] public MoonData spawnMoon; public GameObject spawnPrefab; public EnemyType spawnEnemy; public CoinContainer spawnCoin; string IPhysicsSearchable.keyName => keyName; public void OnLoadDelay() { InitializeAnimator(); } private void InitializeAnimator() { if (!((Object)(object)animator == (Object)null)) { animator.SetInteger("Health", health); animator.SetTrigger("SetUp"); } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (health <= 0) { return false; } Logger.LogDebug((object)$"{this} Hit(): force = {force} && playerWhoHit = {playerWhoHit} && calledBy = {NewDonkCityManager.localPlayer}"); if ((Object)(object)playerWhoHit == (Object)null && NewDonkCityManager.localPlayerServer) { HitLocalAndSync(null, force); return true; } if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit == (Object)(object)NewDonkCityManager.localPlayer) { HitLocalAndSync(playerWhoHit, force); return true; } return false; } private void HitLocalAndSync(PlayerControllerB playerWhoHit, int force) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) int num = Hit(playerWhoHit, health - force); if (Application.isEditor) { Logger.LogDebug((object)$"{this}: C ({num})"); } PropsManager.CallMonoBehaviourNetworkEvent(NewDonkCityManager.localPlayer, ((Component)this).transform.position, "Hittable Spawner", num); } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { PlayerControllerB val = ((specialID > 0) ? calledBy : null); int num = Mathf.Abs(specialID); Logger.LogDebug((object)$"{this} CallNetworkedMonoBehaviourEvent(): force = {num} && playerWhoHit = {val} && calledBy = {calledBy}"); Hit(calledBy, specialID); } private int Hit(PlayerControllerB playerWhoHit, int newHealth) { if (Application.isEditor) { Logger.LogDebug((object)$"{this}: A ({health} --> {newHealth})"); } health = newHealth; if ((Object)(object)animator != (Object)null) { animator.SetInteger("Health", health); if (Application.isEditor) { Logger.LogDebug((object)string.Format("{0}: B ({1})", this, animator.GetInteger("Health"))); } } if (health <= 0 && (Object)(object)playerWhoHit != (Object)null && NewDonkCityManager.localPlayerServer) { ServerSpawnOnHealthDeplete(); } if (!((Object)(object)playerWhoHit != (Object)null)) { return health * -1; } return health; } private void ServerSpawnOnHealthDeplete() { //IL_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) bool flag = true; bool flag2 = true; bool flag3 = true; if ((Object)(object)spawnMoon != (Object)null && spawnMoon.SpawnMoonAndCheck()) { flag3 = false; flag = false; flag2 = false; } if (flag && (Object)(object)spawnPrefab != (Object)null) { flag3 = false; flag2 = false; SpawnNetworkPrefab(); } if (flag2 && (Object)(object)spawnEnemy != (Object)null && (Object)(object)RoundManager.Instance != (Object)null) { flag3 = false; RoundManager.Instance.SpawnEnemyGameObject(((Component)this).transform.position, ((Component)this).transform.rotation.y, 0, spawnEnemy); } if (flag3 && (Object)(object)spawnCoin != (Object)null) { spawnCoin.CollectCoin(); } } private void SpawnNetworkPrefab() { //IL_0022: 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) if ((Object)(object)spawnPrefab == (Object)null || !NewDonkCityManager.localPlayerServer) { return; } GameObject val = Object.Instantiate(spawnPrefab, ((Component)this).transform.position + Vector3.up, Quaternion.identity); if (!((Object)(object)val == (Object)null)) { NetworkObject component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val); } else { component.Spawn(false); } } } } public class JoyCon : GrabbableObject { private static ManualLogSource Logger; public bool controlsForwardBackward; [HideInInspector] public RcCar lastSentTo; private bool inputQ; private bool inputE; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = true; ResetInputsQE(); } } public override void PocketItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; ResetInputsQE(); } ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; ResetInputsQE(); } ((GrabbableObject)this).DiscardItem(); } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (right) { NewInputE(pressed: true); } else { NewInputQ(pressed: true); } } private void NewInputQ(bool pressed) { inputQ = pressed; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: NewInput - Q // isPressed? {inputQ}"); SendManagerNewInput(); } private void NewInputE(bool pressed) { inputE = pressed; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: NewInput - E // isPressed? {inputE}"); SendManagerNewInput(); } private void ResetInputsQE() { inputQ = false; inputE = false; SendManagerNewInput(); } public override void Update() { ((GrabbableObject)this).Update(); if (((NetworkBehaviour)this).IsOwner) { if (inputQ && !IngamePlayerSettings.Instance.playerInput.actions.FindAction("ItemSecondaryUse", false).IsPressed()) { NewInputQ(pressed: false); } if (inputE && !IngamePlayerSettings.Instance.playerInput.actions.FindAction("ItemTertiaryUse", false).IsPressed()) { NewInputE(pressed: false); } } } private void SendManagerNewInput() { float num = 0f; if (inputQ) { num -= 1f; } if (inputE) { num += 1f; } PropsManager.ReceiveJoyConInput(num, controlsForwardBackward, this); } private void OnDisable() { if (((NetworkBehaviour)this).IsOwner) { ResetInputsQE(); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "JoyCon"; } } public class JumpRope : NetworkBehaviour, IHitboxMainScript { private bool active; public Transform distancePoint; private Coroutine attemptingStartGameCoroutine; private NPCEnemyAI npcLeftRope; private InteractTrigger npcLeftNode; private NPCEnemyAI npcRightRope; private InteractTrigger npcRightNode; public void OnLoadDelay() { TryToStartGame(); } private void TryToStartGame() { if (((NetworkBehaviour)this).IsServer && !active && attemptingStartGameCoroutine == null) { attemptingStartGameCoroutine = ((MonoBehaviour)this).StartCoroutine(WaitForGameStartConditions()); } } private IEnumerator WaitForGameStartConditions() { bool success = false; while (!success) { yield return (object)new WaitForSeconds(1f); yield return null; if (!CheckIfNodeIsOccupied(npcLeftNode)) { continue; } yield return null; if (!CheckIfNodeIsOccupied(npcRightNode)) { continue; } bool sub = true; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { yield return null; if (!((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)null) && StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled && Vector3.Distance(distancePoint.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 5f) { sub = false; break; } } if (sub) { success = true; } } SetJumpRopeGameActive(setTo: true); attemptingStartGameCoroutine = null; } void IHitboxMainScript.HitboxTriggerEntered(Hitbox hitbox, Collider other) { if (!((Object)(object)hitbox == (Object)null) && !((Object)(object)other == (Object)null) && active) { SetJumpRopeGameActive(setTo: false); } } private void SetJumpRopeGameActive(bool setTo) { if (((NetworkBehaviour)this).IsServer && active != setTo) { SetJumpRopeGameActiveLocal(setTo); SetJumpRopeGameActiveClientRpc(setTo); } } [ClientRpc] private void SetJumpRopeGameActiveClientRpc(bool setTo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(3334711532u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setTo, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3334711532u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { SetJumpRopeGameActiveLocal(setTo); } } } private void SetJumpRopeGameActiveLocal(bool setTo) { active = setTo; if (active && (Object)(object)NPCManager.Instance != (Object)null) { if (CheckIfNodeIsOccupied(npcLeftNode)) { NPCManager.Instance.SyncNPCAnimationLocal(npcLeftRope, 9); } if (CheckIfNodeIsOccupied(npcRightNode)) { NPCManager.Instance.SyncNPCAnimationLocal(npcRightRope, 10); } } } private bool CheckIfNodeIsOccupied(InteractTrigger node) { if ((Object)(object)node == (Object)null) { return false; } return !node.interactable; } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); } 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 ((NetworkBehaviour)this).__registerRpc(3334711532u, new RpcReceiveHandler(__rpc_handler_3334711532), "SetJumpRopeGameActiveClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3334711532(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool jumpRopeGameActiveClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref jumpRopeGameActiveClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JumpRope)(object)target).SetJumpRopeGameActiveClientRpc(jumpRopeGameActiveClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JumpRope"; } } public class LaunchPole : NetworkBehaviour { [Header("Containers")] public Transform rotationContainer; public Transform pointPlayerTo; [Space(3f)] [Header("Functionality")] public Animator poleAnimator; public AudioClip launchSFX; public InteractTrigger interactTrigger; public BoxCollider interactionCollider; [Space] public float forwardLaunchPower; public float upLaunchPower; public int animCurveIndex; private float lastPullPower; private void Start() { DetermineSpeedMultiplier(); } private void Update() { if (!interactTrigger.interactable) { SetColliderYSize(); lastPullPower = 0f; } else if (interactTrigger.isBeingHeldByPlayer) { RotateTowardsTransform(((Component)NewDonkCityManager.localPlayer).transform); RotateTowardsTransform(pointPlayerTo, ((Component)NewDonkCityManager.localPlayer).transform, ((Component)NewDonkCityManager.localPlayer).transform); lastPullPower = HUDManager.Instance.holdFillAmount / interactTrigger.timeToHold; poleAnimator.SetFloat("LocalPullPower", lastPullPower); SetColliderYSize(); } else if (lastPullPower * interactTrigger.timeToHold > 0.15f) { PrepareToLaunchPlayer(NewDonkCityManager.localPlayer); } else if (lastPullPower > 0f) { lastPullPower -= Time.deltaTime; poleAnimator.SetFloat("LocalPullPower", lastPullPower); } } private void DetermineSpeedMultiplier() { //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) float num = Vector3.Angle(((Component)this).transform.up, Vector3.up); float num2 = 1f; float num3 = 45f; float num4 = 2.5f / num3 * num + num2; interactTrigger.timeToHoldSpeedMultiplier = Mathf.Clamp(num4, 1f, 10f); } private float DetermineUpPowerMultiplier() { //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) float num = Vector3.Angle(rotationContainer.right, Vector3.up); if (num > 90f) { num = Mathf.Abs(num - 180f); } return Mathf.InverseLerp(0f, 90f, num); } private void RotateTowardsTransform(Transform toTransform, Transform rotateTransform = null, Transform upTransform = null) { //IL_002d: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0073: 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 ((Object)(object)rotateTransform == (Object)null) { rotateTransform = rotationContainer; } if ((Object)(object)upTransform == (Object)null) { upTransform = ((Component)this).transform; } RoundManager.Instance.tempTransform.position = rotateTransform.position; RoundManager.Instance.tempTransform.LookAt(toTransform.position, upTransform.up); rotateTransform.localEulerAngles = new Vector3(rotateTransform.localEulerAngles.x, RoundManager.Instance.tempTransform.localEulerAngles.y, rotateTransform.localEulerAngles.z); } private void SetColliderYSize() { //IL_0032: 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_004d: Unknown result type (might be due to invalid IL or missing references) float num = 1.6f; if (interactTrigger.interactable && interactTrigger.isBeingHeldByPlayer) { num = 100f; } interactionCollider.size = new Vector3(interactionCollider.size.x, num, interactionCollider.size.z); } public void PrepareToLaunchPlayer(PlayerControllerB player) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)NewDonkCityManager.localPlayer)) { float launchPower = lastPullPower; DoLaunchFunctionalityLocal(player, launchPower); DoLaunchFunctionalityServerRpc(NewDonkCityManager.localPlayerID, launchPower); } } [ServerRpc(RequireOwnership = false)] private void DoLaunchFunctionalityServerRpc(int playerID, float launchPower) { //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(4154963709u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref launchPower, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4154963709u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DoLaunchFunctionalityClientRpc(playerID, launchPower); } } } [ClientRpc] private void DoLaunchFunctionalityClientRpc(int playerID, float launchPower) { //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(1082682871u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref launchPower, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1082682871u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { DoLaunchFunctionalityLocal(NewDonkCityManager.GetPlayerWithID(playerID), launchPower); } } } private void DoLaunchFunctionalityLocal(PlayerControllerB player, float launchPower) { //IL_0157: 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_00a4: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_010c: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { Plugin.Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} launching {player} with launchPower {launchPower}"); poleAnimator.SetTrigger("Launch"); ((MonoBehaviour)this).StartCoroutine(SetInteractableOnDelay(0.75f)); RotateTowardsTransform(((Component)player).transform); if ((Object)(object)player == (Object)(object)NewDonkCityManager.localPlayer && NewDonkCityManager.GetAnimationCurveNonAlloc(animCurveIndex)) { Vector3 force = rotationContainer.right * forwardLaunchPower * interactTrigger.timeToHold * NewDonkCityManager.Instance.sharedAnimCurves[animCurveIndex].Evaluate(launchPower) + Vector3.up * upLaunchPower * interactTrigger.timeToHold * NewDonkCityManager.Instance.sharedAnimCurves[animCurveIndex].Evaluate(launchPower) * DetermineUpPowerMultiplier(); NewDonkCityManager.AddForceToPlayerBody(player, force, addToExistingForce: false); } lastPullPower = 0f; poleAnimator.SetFloat("LocalPullPower", lastPullPower); GenericManager.PlaySFXAtLocation(((Component)pointPlayerTo).transform.position, launchSFX, audible: true, 25f * launchPower, launchPower, 0f); } } private IEnumerator SetInteractableOnDelay(float delay) { interactTrigger.interactable = false; yield return (object)new WaitForSeconds(delay); interactTrigger.interactable = true; } 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(4154963709u, new RpcReceiveHandler(__rpc_handler_4154963709), "DoLaunchFunctionalityServerRpc"); ((NetworkBehaviour)this).__registerRpc(1082682871u, new RpcReceiveHandler(__rpc_handler_1082682871), "DoLaunchFunctionalityClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4154963709(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 launchPower = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launchPower, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LaunchPole)(object)target).DoLaunchFunctionalityServerRpc(playerID, launchPower); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1082682871(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 launchPower = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launchPower, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LaunchPole)(object)target).DoLaunchFunctionalityClientRpc(playerID, launchPower); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "LaunchPole"; } } public class MoonData : MonoBehaviour { [HideInInspector] public bool collected; [Header("General")] public int moonValue; public SaveableObject saveScript; [Space(3f)] [Header("Moon Shards")] public int shardsToCollect = -1; public MoonData mainMoon; public string shardGroupTooltip; [Space(3f)] [Header("Misc")] public GameObject overrideSpawnPrefab; public int overrideSpawnSfx = -1; [Tooltip("Keep at -1 to use the default AudioSource.maxDistance 25.0f")] public float overrideSfxRange = -1f; public LocalNetworkObject overrideMoonParent; public MoveToPoint moveMoonOnSpawn; public UnityEvent onAlreadyCollected; [HideInInspector] public PowerMoon spawnedMoon; public void SpawnMoon() { MoonManager.SpawnMoon(this); } public bool SpawnMoonAndCheck() { return MoonManager.SpawnMoon(this); } public void DespawnMoon() { MoonManager.DespawnMoon(this); } } public class MoveToPoint : MonoBehaviour, IPhysicsSearchable { private string keyName = "Move To Point"; private static ManualLogSource Logger; [Header("GENERAL")] public GameObject startMovingOnLoad; [Space] public float moveOverTime; public float delayBeforeMoving; public float delayBeforeUnpausing; private Coroutine unpauseCoroutine; private bool pauseMovementTo; [Space] public bool snapToEnd; public MoveToPoint passOntoNextPoint; public UnityEvent invokeOnMoveEnd = new UnityEvent(); public bool endResetsPosition; public bool endResetsRotation; public bool endResetsScale; public bool endResetsAnimation; public bool endResetsAudio; public bool endResetsParticles; [Space(3f)] [Header("MOVEMENT")] [Header("Position")] public bool lerpPosX; public AnimationCurve positionX; public bool lerpPosY; public AnimationCurve positionY; public bool lerpPosZ; public AnimationCurve positionZ; [Space] [Header("Rotation")] public bool lerpRotX; public AnimationCurve rotationX; public bool lerpRotY; public AnimationCurve rotationY; public bool lerpRotZ; public AnimationCurve rotationZ; [Space] [Header("Scale")] public bool lerpScaleX; public AnimationCurve scaleX; public bool lerpScaleY; public AnimationCurve scaleY; public bool lerpScaleZ; public AnimationCurve scaleZ; [Space(3f)] [Header("AUDIOVISUAL")] public Animator playAnimation; public string overrideAnimString; public bool animationMotionTime; [Space] public AudioSource playAudioSource; public AudioClip overrideAudioClip; public ParticleSystem playParticle; string IPhysicsSearchable.keyName => keyName; public void OnLoadDelay() { Logger.LogDebug((object)$"{this} starting locally"); StartMovingObjectToPointNoSync(startMovingOnLoad); } public void StartMovingObjectToPointWithSync(GameObject objectToMove) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0020: Unknown result type (might be due to invalid IL or missing references) StartMovingObjectToPoint(objectToMove, syncWithServer: true); } public void StartMovingObjectToPointWithSyncServerOnly(GameObject objectToMove) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0027: Unknown result type (might be due to invalid IL or missing references) if (NewDonkCityManager.localPlayerServer) { StartMovingObjectToPoint(objectToMove, syncWithServer: true); } } public void StartMovingObjectToPointNoSync(GameObject objectToMove) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0020: Unknown result type (might be due to invalid IL or missing references) StartMovingObjectToPoint(objectToMove, syncWithServer: false); } public void StartMovingObjectToPointNoSync(GameObject objectToMove, Animator animatedOnStart, AudioSource soundOnStart, ParticleSystem particlesOnStart, Vector3 initialPosition, Vector3 initialRotation, Vector3 initialScale) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) StartMovingObjectToPoint(objectToMove, syncWithServer: false, animatedOnStart, soundOnStart, particlesOnStart, initialPosition, initialRotation, initialScale); } public void StartMovingObjectToPoint(GameObject objectToMove, bool syncWithServer, Animator animatedOnStart = null, AudioSource soundOnStart = null, ParticleSystem particlesOnStart = null, Vector3 initialPosition = default(Vector3), Vector3 initialRotation = default(Vector3), Vector3 initialScale = default(Vector3)) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)objectToMove == (Object)null)) { Coroutine movement = ((MonoBehaviour)this).StartCoroutine(MoveObjectToPointCoroutine(objectToMove, animatedOnStart, soundOnStart, particlesOnStart, initialPosition, initialRotation, initialScale)); if (syncWithServer && (Object)(object)PropsManager.Instance != (Object)null) { PropsManager.Instance.MoveToPointAndSync(objectToMove, this, keyName); } MoveToPointData component = objectToMove.GetComponent(); if ((Object)(object)component != (Object)null) { component.StoreMovementCoroutine(this, movement, animatedOnStart, soundOnStart, particlesOnStart); } } } private IEnumerator MoveObjectToPointCoroutine(GameObject objectToMove, Animator animatedOnStart, AudioSource soundOnStart, ParticleSystem particlesOnStart, Vector3 initialPosition, Vector3 initialRotation, Vector3 initialScale) { //IL_002b: 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_0033: 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_003b: 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) if ((Object)(object)objectToMove == (Object)null) { yield break; } if (delayBeforeMoving > 0f) { yield return (object)new WaitForSeconds(delayBeforeMoving); } Vector3 startPosition = objectToMove.transform.position; Vector3 startRotation = objectToMove.transform.eulerAngles; if (startRotation.x > ((Component)this).transform.eulerAngles.x) { startRotation.x -= 360f; } if (startRotation.y > ((Component)this).transform.eulerAngles.y) { startRotation.y -= 360f; } if (startRotation.z > ((Component)this).transform.eulerAngles.z) { startRotation.z -= 360f; } Vector3 startScale = objectToMove.transform.localScale; if (initialPosition == default(Vector3)) { initialPosition = startPosition; } if (initialRotation == default(Vector3)) { initialRotation = startRotation; } if (initialScale == default(Vector3)) { initialScale = startScale; } if ((Object)(object)playAnimation != (Object)null) { animatedOnStart = playAnimation; } ToggleAnimation(animatedOnStart, setTo: true); if ((Object)(object)playAudioSource != (Object)null) { soundOnStart = playAudioSource; } ToggleAudio(soundOnStart, setTo: true); if ((Object)(object)playParticle != (Object)null) { particlesOnStart = playParticle; } ToggleParticles(particlesOnStart, setTo: true); float timePassed = 0f; while (timePassed < moveOverTime) { if (pauseMovementTo || (Object)(object)objectToMove == (Object)null) { yield return null; continue; } float timeNormalized = timePassed / moveOverTime; objectToMove.transform.position = new Vector3(lerpPosX ? GetThisFrameValue(objectToMove.transform.position.x, startPosition.x, ((Component)this).transform.position.x, timeNormalized, positionX) : objectToMove.transform.position.x, lerpPosY ? GetThisFrameValue(objectToMove.transform.position.y, startPosition.y, ((Component)this).transform.position.y, timeNormalized, positionY) : objectToMove.transform.position.y, lerpPosZ ? GetThisFrameValue(objectToMove.transform.position.z, startPosition.z, ((Component)this).transform.position.z, timeNormalized, positionZ) : objectToMove.transform.position.z); objectToMove.transform.eulerAngles = new Vector3(lerpRotX ? GetThisFrameValue(objectToMove.transform.eulerAngles.x, startRotation.x, ((Component)this).transform.eulerAngles.x, timeNormalized, rotationX, isRotation: true) : objectToMove.transform.eulerAngles.x, lerpRotY ? GetThisFrameValue(objectToMove.transform.eulerAngles.y, startRotation.y, ((Component)this).transform.eulerAngles.y, timeNormalized, rotationY, isRotation: true) : objectToMove.transform.eulerAngles.y, lerpRotZ ? GetThisFrameValue(objectToMove.transform.eulerAngles.z, startRotation.z, ((Component)this).transform.eulerAngles.z, timeNormalized, rotationZ, isRotation: true) : objectToMove.transform.eulerAngles.z); objectToMove.transform.localScale = new Vector3(lerpScaleX ? GetThisFrameValue(objectToMove.transform.localScale.x, startScale.x, ((Component)this).transform.localScale.x, timeNormalized, scaleX) : objectToMove.transform.localScale.x, lerpScaleY ? GetThisFrameValue(objectToMove.transform.localScale.y, startScale.y, ((Component)this).transform.localScale.y, timeNormalized, scaleY) : objectToMove.transform.localScale.y, lerpScaleZ ? GetThisFrameValue(objectToMove.transform.localScale.z, startScale.z, ((Component)this).transform.localScale.z, timeNormalized, scaleZ) : objectToMove.transform.localScale.z); GetThisFrameMotionTime(animatedOnStart, timeNormalized); timePassed += Time.deltaTime; if (timePassed < moveOverTime) { yield return null; } } if (!((Object)(object)objectToMove == (Object)null)) { if (snapToEnd) { objectToMove.transform.position = new Vector3(lerpPosX ? GetThisFrameValue(objectToMove.transform.position.x, startPosition.x, ((Component)this).transform.position.x, 1f, positionX) : objectToMove.transform.position.x, lerpPosY ? GetThisFrameValue(objectToMove.transform.position.y, startPosition.y, ((Component)this).transform.position.y, 1f, positionY) : objectToMove.transform.position.y, lerpPosZ ? GetThisFrameValue(objectToMove.transform.position.z, startPosition.z, ((Component)this).transform.position.z, 1f, positionZ) : objectToMove.transform.position.z); objectToMove.transform.eulerAngles = new Vector3(lerpRotX ? GetThisFrameValue(objectToMove.transform.eulerAngles.x, startRotation.x, ((Component)this).transform.eulerAngles.x, 1f, rotationX, isRotation: true) : objectToMove.transform.eulerAngles.x, lerpRotY ? GetThisFrameValue(objectToMove.transform.eulerAngles.y, startRotation.y, ((Component)this).transform.eulerAngles.y, 1f, rotationY, isRotation: true) : objectToMove.transform.eulerAngles.y, lerpRotZ ? GetThisFrameValue(objectToMove.transform.eulerAngles.z, startRotation.z, ((Component)this).transform.eulerAngles.z, 1f, rotationZ, isRotation: true) : objectToMove.transform.eulerAngles.z); objectToMove.transform.localScale = new Vector3(lerpScaleX ? GetThisFrameValue(objectToMove.transform.localScale.x, startScale.x, ((Component)this).transform.localScale.x, 1f, scaleX) : objectToMove.transform.localScale.x, lerpScaleY ? GetThisFrameValue(objectToMove.transform.localScale.y, startScale.y, ((Component)this).transform.localScale.y, 1f, scaleY) : objectToMove.transform.localScale.y, lerpScaleZ ? GetThisFrameValue(objectToMove.transform.localScale.z, startScale.z, ((Component)this).transform.localScale.z, 1f, scaleZ) : objectToMove.transform.localScale.z); } if (endResetsPosition) { objectToMove.transform.position = initialPosition; } if (endResetsRotation) { objectToMove.transform.eulerAngles = initialRotation; } if (endResetsScale) { objectToMove.transform.localScale = initialScale; } if (endResetsAnimation) { ToggleAnimation(animatedOnStart, setTo: false); } if (endResetsAudio) { ToggleAudio(soundOnStart, setTo: false); } invokeOnMoveEnd.Invoke(objectToMove); MoveToPointData component = objectToMove.GetComponent(); if ((Object)(object)component != (Object)null) { component.WipeMovementCoroutineIfMatching(this); } if ((Object)(object)passOntoNextPoint != (Object)null) { passOntoNextPoint.StartMovingObjectToPointNoSync(objectToMove, animatedOnStart, soundOnStart, particlesOnStart, initialPosition, initialRotation, initialScale); } } } private float GetThisFrameValue(float currentValue, float startValue, float endValue, float timeNormalized, AnimationCurve evaluateOn, bool isRotation = false) { if (evaluateOn == null || evaluateOn.keys.Length < 2) { return currentValue; } if (isRotation) { return Mathf.LerpAngle(startValue, endValue, evaluateOn.Evaluate(timeNormalized)); } return Mathf.LerpUnclamped(startValue, endValue, evaluateOn.Evaluate(timeNormalized)); } private void GetThisFrameMotionTime(Animator animator, float timeNormalized) { if (!((Object)(object)animator == (Object)null) && animationMotionTime) { animator.SetFloat("MoveToPointMotionTime", timeNormalized); } } public void SetPausedMovementTo(bool setTo, Animator pauseAnimator, bool checkDelay = true) { if (setTo == pauseMovementTo) { return; } if (!setTo && checkDelay && delayBeforeUnpausing > 0f) { if (unpauseCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(unpauseCoroutine); } unpauseCoroutine = ((MonoBehaviour)this).StartCoroutine(WaitForDelayToUnpause(pauseAnimator)); return; } pauseMovementTo = setTo; if ((Object)(object)pauseAnimator != (Object)null) { pauseAnimator.SetTrigger(pauseMovementTo ? "MoveToPointPauseEnter" : "MoveToPointPauseExit"); SetAnimationSpeedMultiplier(pauseAnimator, pauseMovementTo ? 0f : 1f); } } private IEnumerator WaitForDelayToUnpause(Animator pauseAnimator) { yield return (object)new WaitForSeconds(delayBeforeUnpausing); SetPausedMovementTo(setTo: false, pauseAnimator, checkDelay: false); unpauseCoroutine = null; } private void ToggleAnimation(Animator animatorToAnimate, bool setTo) { if (!((Object)(object)animatorToAnimate == (Object)null)) { if (!string.IsNullOrEmpty(overrideAnimString)) { animatorToAnimate.SetBool(overrideAnimString, setTo); } else { animatorToAnimate.SetBool("MoveToPointAnimation", setTo); } SetAnimationSpeedMultiplier(animatorToAnimate, setTo ? 1f : 0f); } } private void SetAnimationSpeedMultiplier(Animator animatorToAnimate, float setTo) { if (!((Object)(object)animatorToAnimate == (Object)null)) { animatorToAnimate.SetFloat("MoveToPointSpeedMultiplier", setTo); } } private void ToggleAudio(AudioSource sourceToPlay, bool setTo) { if ((Object)(object)sourceToPlay == (Object)null) { return; } if (setTo) { if (!sourceToPlay.isPlaying) { if ((Object)(object)overrideAudioClip != (Object)null) { sourceToPlay.clip = overrideAudioClip; } if (!((Object)(object)sourceToPlay.clip == (Object)null)) { sourceToPlay.Play(); } } } else { sourceToPlay.Stop(); } } private void ToggleParticles(ParticleSystem particlesToPlay, bool setTo) { if ((Object)(object)particlesToPlay == (Object)null) { return; } if (setTo) { if (!particlesToPlay.isPlaying) { particlesToPlay.Play(); } } else { particlesToPlay.Stop(); } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); } void IPhysicsSearchable.CallNetworkedMonoBehaviourEvent(PlayerControllerB calledBy, int specialID, GameObject linkedObject) { } } public class NPCEnemyAI : EnemyAI { public override void Start() { ((EnemyAI)this).Start(); base.hitsPhysicsObjects = Random.Range(0, 2) == 0; } public override void Update() { //IL_005a: 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_0070: 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_0096: 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_00c6: Unknown result type (might be due to invalid IL or missing references) if (base.timeSinceSpawn > 0f) { base.timeSinceSpawn -= Time.deltaTime; if (base.timeSinceSpawn <= 0f) { ((Behaviour)this).enabled = false; return; } } if (!((NetworkBehaviour)this).IsOwner || !base.moveTowardsDestination) { ((EnemyAI)this).SetClientCalculatingAI(false); ((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, base.serverPosition, ref base.tempVelocity, 2f); ((Component)this).transform.eulerAngles = new Vector3(((Component)this).transform.eulerAngles.x, Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, base.targetYRotation, 3f * Time.deltaTime), ((Component)this).transform.eulerAngles.z); return; } ((EnemyAI)this).SetClientCalculatingAI(true); if (base.updateDestinationInterval >= 0f) { base.updateDestinationInterval -= Time.deltaTime; return; } base.updateDestinationInterval = base.AIIntervalTime; CustomOwnerSyncPosition(); } public void CustomOwnerSyncPosition(bool forceSync = false, bool moveTowardDestination = false, bool rotateTowardDestination = false) { //IL_0059: 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_0150: 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_004a: 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_00de: 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_00f0: 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_00fa: 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_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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_01a3: 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) if (!((NetworkBehaviour)this).IsOwner || (Object)(object)base.agent == (Object)null) { return; } if (base.moveTowardsDestination && base.agent.isOnNavMesh) { base.hitsPhysicsObjects = !base.hitsPhysicsObjects; if (base.hitsPhysicsObjects) { base.agent.SetDestination(base.destination); } } if (!forceSync && !(Vector3.Distance(base.prevDestination, ((Component)this).transform.position) > 1f)) { return; } NPCAnimation currentBehaviourStateIndex = (NPCAnimation)base.currentBehaviourStateIndex; if (currentBehaviourStateIndex.ToString().Contains("Walking")) { if (moveTowardDestination || Vector3.Angle(((Component)this).transform.forward, base.destination - ((Component)this).transform.position) < 15f) { base.serverPosition = ((Component)this).transform.position + NewDonkCityManager.GetForwardToPosition(((Component)this).transform, base.destination, matchX: false, matchY: true) * 3.33f; } else { base.serverPosition = ((Component)this).transform.position + ((Component)this).transform.forward * 3.33f; } base.serverPosition.y = ((Component)this).transform.position.y; } else { base.serverPosition = ((Component)this).transform.position; } if ((Object)(object)NPCManager.Instance != (Object)null) { base.prevDestination = ((Component)this).transform.position; NPCManager.Instance.QueueUpNewNpcToSync(this, base.serverPosition, rotateTowardDestination ? NewDonkCityManager.GetRotationToPosition(((Component)this).transform, base.destination, matchX: false, matchY: true) : ((Component)this).transform.eulerAngles); } } public void MakeGreetingSound() { if (!((Object)(object)base.enemyType == (Object)null) && base.enemyType.audioClips != null && base.enemyType.audioClips.Length != 0) { GenericManager.PlaySFX(base.creatureVoice, base.enemyType.audioClips[new Random(StartOfRound.Instance.randomMapSeed + TimeOfDay.Instance.hour + base.previousBehaviourStateIndex).Next(0, base.enemyType.audioClips.Length)], audible: true, 20f); } } public void MakeFootstepSound() { if (!((Object)(object)base.enemyType == (Object)null) && base.enemyType.miscAnimations != null && base.enemyType.miscAnimations.Length != 0) { GenericManager.PlaySFX(base.creatureSFX, base.enemyType.miscAnimations[Random.Range(0, base.enemyType.miscAnimations.Length)].AnimVoiceclip, audible: false, 10f, 0.75f, 0, transmitWalkie: false); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { GetHurt(); } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null) { GetHurt(); } public void GetHurtAndSync() { if (((NetworkBehaviour)this).IsServer) { GetHurt(); GetHurtClientRpc(); } } [ClientRpc] private void GetHurtClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1751049051u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1751049051u, 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) { GetHurt(); } } } public void GetHurt() { if (!((Object)(object)base.enemyType == (Object)null) && !((Object)(object)base.enemyType.hitEnemyVoiceSFX == (Object)null)) { GenericManager.PlaySFX(base.creatureVoice, base.enemyType.hitEnemyVoiceSFX, audible: true, 15f, 1f); base.creatureAnimator.SetTrigger("Damaged"); } } protected override void __initializeVariables() { ((EnemyAI)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 ((NetworkBehaviour)this).__registerRpc(1751049051u, new RpcReceiveHandler(__rpc_handler_1751049051), "GetHurtClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1751049051(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; ((NPCEnemyAI)(object)target).GetHurtClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NPCEnemyAI"; } } public class NPCNode : MonoBehaviour { [Header("Self")] public Transform aiNode; public bool isExit; public List animationStrings = new List { NPCAnimation.Walking1 }; public bool lockNPC; [Space(3f)] [Header("Other")] public List destinationNodes; public NPCData spawnNPC; public MaterialArray spawnNPCMaterial; public InteractTrigger usesInteractable; private void OnTriggerEnter(Collider other) { if ((Object)(object)other == (Object)null) { return; } EnemyAICollisionDetect component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.mainScript == (Object)null)) { NPCEnemyAI nPCEnemyAI = component.mainScript as NPCEnemyAI; if (!((Object)(object)nPCEnemyAI == (Object)null) && ((NetworkBehaviour)nPCEnemyAI).IsSpawned) { NPCManager.Instance.NodeInteractWithNPC(nPCEnemyAI, this); } } } } public class Odyssey : NetworkBehaviour { public float baseRotation; public float jumpIncreaseRotation; public float maxRotation; public float rotationSlowdown; private float addRotation; [Space(3f)] [Header("Self")] public RotateObject globeContainer; public SceneBGM musicBox; [Space] public MoonData spawnMoon; [Space(3f)] [Header("Collected Moons")] public int moonCountStart = 64; public TextMeshPro moonCounter; public Animator sailsAnimator; private void Update() { if (addRotation > 0f) { addRotation -= Time.deltaTime * rotationSlowdown; if (!musicBox.globalAudio.isPlaying) { musicBox.StartSong(); } else { musicBox.globalAudio.volume = Mathf.Lerp(0f, 1f, addRotation / maxRotation); if (musicBox.globalAudio.time > musicBox.songToPlay.loopPoints[0].y - 1f) { spawnMoon.SpawnMoon(); } } } else if (musicBox.globalAudio.isPlaying) { musicBox.StopSong(); } globeContainer.SetRotation(0f, baseRotation + addRotation, 0f); } public void LocallyBounceOffGlobe() { BounceOffGlobeLocal(NewDonkCityManager.localPlayer); BounceOffGlobeServerRpc(NewDonkCityManager.localPlayerID); } [ServerRpc(RequireOwnership = false)] private void BounceOffGlobeServerRpc(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(4127977972u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4127977972u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BounceOffGlobeClientRpc(playerID); } } } [ClientRpc] private void BounceOffGlobeClientRpc(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(2494225127u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2494225127u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { BounceOffGlobeLocal(NewDonkCityManager.GetPlayerWithID(playerID)); } } } private void BounceOffGlobeLocal(PlayerControllerB bouncedPlayer) { bouncedPlayer.movementAudio.Stop(); addRotation += jumpIncreaseRotation; addRotation = Mathf.Clamp(addRotation, 0f, maxRotation); } public void SetCollectedMoonsDisplay(int amountCollected, bool completedAllMoons) { if (!((Object)(object)sailsAnimator == (Object)null) && !((Object)(object)moonCounter == (Object)null)) { sailsAnimator.SetBool("Completed", completedAllMoons); ((TMP_Text)moonCounter).text = $"{moonCountStart + amountCollected}"; } } 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(4127977972u, new RpcReceiveHandler(__rpc_handler_4127977972), "BounceOffGlobeServerRpc"); ((NetworkBehaviour)this).__registerRpc(2494225127u, new RpcReceiveHandler(__rpc_handler_2494225127), "BounceOffGlobeClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4127977972(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; ((Odyssey)(object)target).BounceOffGlobeServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2494225127(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; ((Odyssey)(object)target).BounceOffGlobeClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Odyssey"; } } public class PowerMoon : GrabbableObject { public AudioSource spawnSFX; [Header("Rotation")] [Space(3f)] public RotateObject rotator; [Space] public float rotation; public float rotateTime; public float rotateSpeed; private Coroutine spawnAnimCoroutine; [Space(3f)] [Header("Moon Shard")] public bool isShard; public AudioClip breakSFX; public LoadEvents onDayEndEvent; [HideInInspector] public string[] shardTooltip; [Space(3f)] [Header("Misc")] public int countTowardsTotal = 1; [HideInInspector] public int ID; [HideInInspector] public Vector3 overrideSpawnPos; private void Awake() { //IL_0017: 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) ID = -1; overrideSpawnPos = new Vector3(-999f, -999f, -999f); } public override void InitializeAfterPositioning() { //IL_0007: 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_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) ((GrabbableObject)this).InitializeAfterPositioning(); if (overrideSpawnPos != new Vector3(-999f, -999f, -999f)) { base.targetFloorPosition = overrideSpawnPos; } } public void DoMoonSpawnAnimation() { if (spawnAnimCoroutine == null) { spawnAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(MoonSpawnRotationAnim()); } } private IEnumerator MoonSpawnRotationAnim() { if (!((Object)(object)rotator == (Object)null)) { for (float animTime = rotateTime; animTime > 0f; animTime -= Time.deltaTime) { rotator.SetRotation(0f, rotation + animTime * rotateSpeed, 0f); yield return null; } StartRotating(); } } public void InitializeShardOnSpawn(string tooltipFromData) { if (isShard) { if ((Object)(object)onDayEndEvent != (Object)null) { onDayEndEvent.AddEventsToManager(); } if (!string.IsNullOrEmpty(tooltipFromData)) { shardTooltip = new string[1] { "\"" + tooltipFromData + "\"" }; } } } public void StartRotating() { if ((Object)(object)base.parentObject == (Object)null) { rotator.SetRotation(0f, rotation, 0f); } } public void StopRotating() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (spawnAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(spawnAnimCoroutine); } rotator.SetRotation(Vector3.zero); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); StopRotating(); SetCollectedTrue(); if (isShard) { if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)NewDonkCityManager.localPlayer) { HUDManager.Instance.ChangeControlTipMultiple(shardTooltip, base.isHeld, base.itemProperties); } MoonManager.CheckShardsCollected(this); } } private void SetCollectedTrue() { if (Application.isEditor) { Plugin.Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: SetCollectedTrue()"); } MoonManager.SetMoonIDCollected(this); } private void SetCollectedFalse() { if (Application.isEditor) { Plugin.Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: SetCollectedFalse()"); } MoonManager.SetMoonIDCollected(this, setTo: false); } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); StartRotating(); } public void OnDayEnd() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (isShard) { SetCollectedFalse(); GenericManager.PlaySFXAtLocation(((Component)this).transform.position, breakSFX, audible: false, 20f, 1f, 0f); NewDonkCityManager.DestroyItem((GrabbableObject)(object)this, ((NetworkBehaviour)this).NetworkObject); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PowerMoon"; } } public class PSwitch : NetworkBehaviour { private static ManualLogSource Logger; public float challengeTime; [Space(3f)] [Header("Visual")] public PlatformingChallenge spawnContainer; public Animator animContainer; [Space(3f)] [Header("Audio")] public Transform buttonAudio; public AudioClip clickSFX; [Space] public AudioSource timerAudio; public Song timerSFX; private float timer; private bool activeLocally; private void Update() { if (activeLocally) { if (timer < challengeTime) { timer += Time.deltaTime; JumpInAudioVisual(); } else if (((NetworkBehaviour)this).IsServer) { ToggleTimerAndSync(setTo: false); } } } public void LandOnPSwitch() { Logger.LogDebug((object)$"client landed on {this} #{((NetworkBehaviour)this).NetworkObjectId} // {activeLocally}"); if (!activeLocally) { ToggleTimerServerRpc(setTo: true); } } [ServerRpc(RequireOwnership = false)] private void ToggleTimerServerRpc(bool setTo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(811118552u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setTo, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 811118552u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ToggleTimerAndSync(setTo); } } } private void ToggleTimerAndSync(bool setTo) { if (((NetworkBehaviour)this).IsServer && activeLocally != setTo) { Logger.LogDebug((object)$"server updating activeness of {this} #{((NetworkBehaviour)this).NetworkObjectId} to {setTo}"); ToggleActiveLocally(setTo); ToggleTimerClientRpc(setTo); } } [ClientRpc] private void ToggleTimerClientRpc(bool setTo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) 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(2108393027u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setTo, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2108393027u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { ToggleActiveLocally(setTo); } } } private void ToggleActiveLocally(bool setTo) { activeLocally = setTo; if (activeLocally) { timer = 0f; ActivateAudioVisual(); } else { RemoveAudioVisual(); } Logger.LogDebug((object)$"locally set {this} #{((NetworkBehaviour)this).NetworkObjectId} to {activeLocally} with timer {timer}"); } private void ActivateAudioVisual() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (Application.isEditor) { Logger.LogDebug((object)"P-Switch: A"); } GenericManager.PlaySFXAtLocation(buttonAudio.position, clickSFX, audible: true, 20f); spawnContainer.SpawnContainerLocally(); SetAnimation(setTo: true); SongsManager.Instance.PlaySong(timerSFX, timerAudio); } private void JumpInAudioVisual() { if (timerSFX.currentLoopIndex == 0 && timer / challengeTime > 0.75f) { if (Application.isEditor) { Logger.LogDebug((object)"P-Switch: B"); } SongsManager.Instance.JumpInSong(timerSFX, timerAudio); } } private void RemoveAudioVisual() { spawnContainer.DestroyContainerLocally(); SetAnimation(setTo: false); if (Application.isEditor) { Logger.LogDebug((object)"P-Switch: C"); } SongsManager.Instance.JumpToOutro(timerSFX, timerAudio); } private void SetAnimation(bool setTo) { animContainer.SetBool("Pressed", setTo); } 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(811118552u, new RpcReceiveHandler(__rpc_handler_811118552), "ToggleTimerServerRpc"); ((NetworkBehaviour)this).__registerRpc(2108393027u, new RpcReceiveHandler(__rpc_handler_2108393027), "ToggleTimerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_811118552(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setTo = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setTo, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PSwitch)(object)target).ToggleTimerServerRpc(setTo); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2108393027(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setTo = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setTo, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PSwitch)(object)target).ToggleTimerClientRpc(setTo); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PSwitch"; } } public class RandomSitAnimation : MonoBehaviour { } public class RcCar : NetworkBehaviour, IHitboxMainScript { private static ManualLogSource Logger; [Header("Components")] public Rigidbody rb; public Collider playerMustBeInBounds; public MoonData spawnMoon; [Space(3f)] [Header("Paramaters")] public float syncPositionSpeed; public float syncRotationSpeed; public float multiplierForce; public float multiplierRotation; [Space] public float maxSpeed; public float maxOffsetX; [Space(3f)] [Header("Laps")] public int completeXLaps = 1; [Tooltip("Make sure the finish line is the first checkpoint.")] public Hitbox[] checkpoints; public TextMeshPro lapCounter; private Vector2 lastInput; private Dictionary inputs = new Dictionary(); private Vector3 syncedPosition; private Quaternion syncedRotation; private float cooldown; private int onLap; private int lastCheckpointPassed = -1; public void OnLoadDelay() { rb.maxLinearVelocity = maxSpeed; if ((Object)(object)PropsManager.Instance != (Object)null && PropsManager.Instance.allRcCars != null && !PropsManager.Instance.allRcCars.Contains(this)) { PropsManager.Instance.allRcCars.Add(this); } UpdateLapCounter(); } public void ReceiveNewInput(Vector2 input, ulong joyconUlong) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) if (inputs.ContainsKey(joyconUlong)) { if (input == Vector2.zero) { inputs.Remove(joyconUlong); } else { inputs[joyconUlong] = input; } } else if (input != Vector2.zero) { inputs.TryAdd(joyconUlong, input); } GetPooledInputs(); } private void OnDisable() { if ((Object)(object)PropsManager.Instance != (Object)null && PropsManager.Instance.allRcCars != null && PropsManager.Instance.allRcCars.Contains(this)) { PropsManager.Instance.allRcCars.Remove(this); } } private void FixedUpdate() { //IL_0035: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) rb.isKinematic = !((NetworkBehaviour)this).IsServer; if (((NetworkBehaviour)this).IsServer) { MoveRigidbody(); SyncTransformServer(); } else { rb.MovePosition(Vector3.Lerp(((Component)this).transform.position, syncedPosition, Time.fixedDeltaTime * syncPositionSpeed)); rb.MoveRotation(Quaternion.Lerp(((Component)this).transform.rotation, syncedRotation, syncRotationSpeed)); } } private void MoveRigidbody() { //IL_001e: 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_0043: 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_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_009b: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (lastInput.y != 0f) { rb.AddForce(((Component)this).transform.forward * lastInput.y * multiplierForce * Time.fixedDeltaTime); } if (lastInput.x != 0f) { Transform transform = ((Component)this).transform; float x = lastInput.x; Vector3 velocity = rb.velocity; transform.Rotate(new Vector3(0f, x * ((Vector3)(ref velocity)).magnitude * multiplierRotation * Time.fixedDeltaTime, 0f), (Space)1); } float num = ((Component)this).transform.localEulerAngles.x; if (num > maxOffsetX && num < 360f - maxOffsetX) { num = Mathf.LerpAngle(((Component)this).transform.localEulerAngles.x, (((Component)this).transform.localEulerAngles.x > 180f) ? (360f - maxOffsetX) : maxOffsetX, 1f); } ((Component)this).transform.localEulerAngles = new Vector3(num, ((Component)this).transform.localEulerAngles.y, 0f); } private void GetPooledInputs() { //IL_0016: 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_0041: 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) if (inputs == null || inputs.Count == 0) { lastInput = Vector2.zero; return; } float num = 0f; float num2 = 0f; for (int i = 0; i < inputs.Count; i++) { num += inputs.ElementAt(i).Value.x; num2 += inputs.ElementAt(i).Value.y; } lastInput.x = Mathf.Clamp(num, -1f, 1f); lastInput.y = Mathf.Clamp(num2, -1f, 1f); } private void SyncTransformServer() { //IL_0035: 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_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_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_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) if (!((NetworkBehaviour)this).IsServer) { return; } if (cooldown > 0f) { cooldown -= Time.fixedDeltaTime; return; } cooldown = 0.1f; if (Vector3.Distance(syncedPosition, ((Component)this).transform.position) > 0.25f) { syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.rotation; SyncTransformClientRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles); } } [ClientRpc] private void SyncTransformClientRpc(Vector3 pos, Vector3 rot) { //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_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) //IL_00e1: 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) //IL_00e8: 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_00ee: 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(2475804113u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rot); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2475804113u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; syncedPosition = pos; syncedRotation = Quaternion.Euler(rot); } } } void IHitboxMainScript.HitboxTriggerEntered(Hitbox hitbox, Collider other) { if (((NetworkBehaviour)this).IsServer && (Object)(object)hitbox != (Object)null && (Object)(object)other != (Object)null && (Object)(object)((Component)other).gameObject == (Object)(object)((Component)this).gameObject) { PassCheckpoint(hitbox); } } private void PassCheckpoint(Hitbox hitCheckpoint) { if ((Object)(object)hitCheckpoint == (Object)null || checkpoints == null || checkpoints.Length == 0 || onLap == completeXLaps) { return; } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} hit checkpoint {hitCheckpoint}"); int num = -1; for (int i = 0; i < checkpoints.Length; i++) { if ((Object)(object)checkpoints[i] == (Object)(object)hitCheckpoint) { num = i; break; } } if (num != -1) { Logger.LogDebug((object)$"hitbox index = {num}"); if (num == 0 && lastCheckpointPassed == checkpoints.Length - 1) { lastCheckpointPassed = num; onLap++; Logger.LogDebug((object)$"increasing lap to {onLap}"); } else if (lastCheckpointPassed + 1 == num) { lastCheckpointPassed = num; Logger.LogDebug((object)$"default: {lastCheckpointPassed}"); } else { Logger.LogDebug((object)$"hit checkpoint out of order; last = {lastCheckpointPassed}"); } UpdateLapCounter(); if (onLap == completeXLaps && (Object)(object)spawnMoon != (Object)null) { spawnMoon.SpawnMoon(); } } } private void UpdateLapCounter() { if ((Object)(object)lapCounter != (Object)null) { ((TMP_Text)lapCounter).text = $"{Mathf.Clamp(onLap + 1, 1, completeXLaps)}/{completeXLaps}"; } } 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 ((NetworkBehaviour)this).__registerRpc(2475804113u, new RpcReceiveHandler(__rpc_handler_2475804113), "SyncTransformClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2475804113(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: 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_0052: 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) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 rot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); target.__rpc_exec_stage = (__RpcExecStage)1; ((RcCar)(object)target).SyncTransformClientRpc(pos, rot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RcCar"; } } public class RetroCharacterController : NetworkBehaviour { private static ManualLogSource Logger; public static RetroCharacterController LocalInstance; [Header("Components")] public Rigidbody rb; public SnapPlayerToPosition mover; public Camera retroZoneCamera; public Light helperLight; [HideInInspector] public PlayerControllerB controllingPlayer; [HideInInspector] public TwoDimensionalZone inZone; [Space] public Transform collisionPointCenter; public Transform collisionPointGround; public Transform collisionPointCeiling; [Space(3f)] [Header("Parameters")] public float speedWalk; public float speedRun; public float speedFall; [Space] [Tooltip("X = jump force when still and walking\nY = jump force when running full speed")] public Vector2 jumpForce2D; private float fallValue2D; [Tooltip("X = acceleration when on the ground\nY = acceleration when in mid-air")] public Vector2 acceleration2D; [Tooltip("X = slowdown when on the ground\nY = clowdown when in mid-air")] public Vector2 deceleration2D; [Space] public float offsetTolerance; private Vector3 tempVec; private Vector2 moveInputVector; private Vector2 lastInput; private float currentSpeed; private bool continuousInput; private float timeLastJump; private bool isJumping; private bool isInAir; private bool isSprinting; private Vector3 syncedPosition; private Vector3 syncedRotation; private float syncTimer; private bool animateWalk; private bool animateSprint; private bool animateFall; private Vector3 playerSizeOnEnter; private float tick; private int activationState = -1; public void OnStartPipeAnimationNonRetro(PlayerControllerB player) { activationState = 0; rb.isKinematic = true; controllingPlayer = player; mover.Initialize(controllingPlayer, null, ((Component)this).gameObject, normalUpdate: true, ((NetworkBehaviour)this).NetworkObject); ResetPlayerBody(); if ((Object)(object)controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { LocalInstance = this; } if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(controllingPlayer.actualClientId); } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} started with controllingPlayer: \"{controllingPlayer}\""); } public void OnStartPipeAnimation() { activationState = 0; rb.isKinematic = true; ResetPlayerBody(); } public void OnEnterRetroZone(bool sync = true) { //IL_0021: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0165: Unknown result type (might be due to invalid IL or missing references) activationState = 1; ((Component)mover).transform.localPosition = new Vector3(0f, 0f, -1.25f); ((Behaviour)helperLight).enabled = true; syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.eulerAngles; SetPlayerSize(flatten: true); if ((Object)(object)controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { rb.isKinematic = false; ((Component)controllingPlayer.localVisor).gameObject.SetActive(false); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed += JumpIn2DZone; NewDonkCityManager.localPlayer.DisablePlayerModel(((Component)NewDonkCityManager.localPlayer).gameObject, true, true); controllingPlayer.disableMoveInput = true; controllingPlayer.disableLookInput = true; controllingPlayer.disableInteract = true; if ((Object)(object)StartOfRound.Instance.activeCamera != (Object)(object)retroZoneCamera) { ((Component)retroZoneCamera).transform.SetParent((Transform)null); ((Component)retroZoneCamera).transform.position = ((Component)StartOfRound.Instance.activeCamera).transform.position; ((Component)retroZoneCamera).transform.rotation = ((Component)StartOfRound.Instance.activeCamera).transform.rotation; retroZoneCamera.nearClipPlane = StartOfRound.Instance.activeCamera.nearClipPlane; retroZoneCamera.farClipPlane = StartOfRound.Instance.activeCamera.farClipPlane; retroZoneCamera.fieldOfView = StartOfRound.Instance.activeCamera.fieldOfView; retroZoneCamera.cullingMask = StartOfRound.Instance.activeCamera.cullingMask; retroZoneCamera.targetTexture = StartOfRound.Instance.activeCamera.targetTexture; StartOfRound.Instance.SwitchCamera(retroZoneCamera); controllingPlayer.ChangeAudioListenerToObject(((Component)StartOfRound.Instance.activeCamera).gameObject); } if (sync) { OnEnterRetroZoneServerRpc(); } } else { Object.Destroy((Object)(object)((Component)retroZoneCamera).gameObject); } } [ServerRpc(RequireOwnership = true)] private void OnEnterRetroZoneServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3349155683u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3349155683u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnEnterRetroZoneClientRpc(); } } [ClientRpc] private void OnEnterRetroZoneClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(664664124u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 664664124u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { OnEnterRetroZone(sync: false); } } } public void OnSwitchRetroZone(bool sync = true) { //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_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_0053: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) activationState = 1; syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.eulerAngles; if ((Object)(object)controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { rb.isKinematic = false; rb.MovePosition(((Component)this).transform.position + Vector3.up * 0.01f); if (sync) { OnSwitchRetroZoneServerRpc(); } } } [ServerRpc(RequireOwnership = true)] private void OnSwitchRetroZoneServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(698934022u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 698934022u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnSwitchRetroZoneClientRpc(); } } [ClientRpc] private void OnSwitchRetroZoneClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3123539671u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3123539671u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { OnSwitchRetroZone(sync: false); } } } public void OnExitRetroZone(bool sync = true, int destroyFrames = 0) { if (activationState == -1) { return; } activationState = -1; mover.SetToDestroy(destroyFrames); SetPlayerSize(flatten: false); ResetPlayerBody(); if ((Object)(object)controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { ((Component)controllingPlayer.localVisor).gameObject.SetActive(true); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed -= JumpIn2DZone; NewDonkCityManager.localPlayer.DisablePlayerModel(((Component)NewDonkCityManager.localPlayer).gameObject, true, false); controllingPlayer.disableMoveInput = false; controllingPlayer.disableLookInput = false; controllingPlayer.disableInteract = false; if ((Object)(object)StartOfRound.Instance.activeCamera == (Object)(object)retroZoneCamera) { StartOfRound.Instance.SwitchCamera(controllingPlayer.gameplayCamera); controllingPlayer.ChangeAudioListenerToObject(((Component)StartOfRound.Instance.activeCamera).gameObject); } Object.Destroy((Object)(object)((Component)retroZoneCamera).gameObject); LocalInstance = null; inZone = null; if (sync) { OnExitRetroZoneServerRpc(destroyFrames); } } } [ServerRpc(RequireOwnership = true)] private void OnExitRetroZoneServerRpc(int destroyFrames) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4275513439u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, destroyFrames); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4275513439u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnExitRetroZoneClientRpc(destroyFrames); } } [ClientRpc] private void OnExitRetroZoneClientRpc(int destroyFrames) { //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(883550357u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, destroyFrames); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 883550357u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { OnExitRetroZone(sync: false, destroyFrames); } } } private void FixedUpdate() { //IL_002c: 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_0042: 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_0084: 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_00d6: Unknown result type (might be due to invalid IL or missing references) if (activationState == 1) { tick = Time.fixedDeltaTime; if (!((NetworkBehaviour)this).IsOwner) { ((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, syncedPosition, ref tempVec, 0.15f); ((Component)this).transform.eulerAngles = new Vector3(Mathf.LerpAngle(((Component)this).transform.eulerAngles.x, syncedRotation.x, 25f * tick), Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, syncedRotation.y, 25f * tick), Mathf.LerpAngle(((Component)this).transform.eulerAngles.z, syncedRotation.z, 25f * tick)); CustomAnimatePlayer(); } else { MovementUpdate(); CheckAndSyncPosition(); } } } private void MovementUpdate() { //IL_0060: 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) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_0227: 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_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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: 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_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: 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_03ea: 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_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0440: 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_032d: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)inZone == (Object)null) { return; } if ((Object)(object)controllingPlayer == (Object)null || !controllingPlayer.isPlayerControlled || controllingPlayer.teleportingThisFrame || (Object)(object)controllingPlayer.inAnimationWithEnemy != (Object)null) { OnExitRetroZone(); return; } ClampCameraInBounds(); Get2DInput(); tempVec = Vector3.zero; if (moveInputVector != Vector2.zero) { if (continuousInput || MoveInputInDirectionOfLooking()) { float num = (isSprinting ? speedRun : speedWalk); float num2 = (isJumping ? acceleration2D.y : acceleration2D.x); if (currentSpeed < -0.1f) { currentSpeed = Mathf.Lerp(currentSpeed, 0f, isJumping ? deceleration2D.y : deceleration2D.x); } else if (currentSpeed <= num) { currentSpeed += tick * num2; } else { currentSpeed -= tick * num2; } } else { ((Component)rb).transform.eulerAngles = new Vector3(((Component)rb).transform.localEulerAngles.x, ((Component)rb).transform.localEulerAngles.y, ((Component)rb).transform.localEulerAngles.z + 180f); currentSpeed *= -1f; if (Application.isEditor) { Logger.LogDebug((object)"!!rotate!!"); } } } else { currentSpeed = Mathf.Lerp(currentSpeed, 0f, 0.2f); } if (Mathf.Abs(currentSpeed) > 0.1f) { tempVec += ((Component)mover).transform.forward * currentSpeed; } if (isJumping && fallValue2D > 2f && Physics.Linecast(collisionPointCenter.position, collisionPointCeiling.position, LayerMask.op_Implicit(rb.includeLayers), (QueryTriggerInteraction)1) && (Object)(object)NewDonkCityManager.Instance != (Object)null) { fallValue2D = (NewDonkCityManager.Instance.CallHitCeilingEvent(((Component)mover).transform.up) ? (-1f) : 0f); } if (Physics.Linecast(collisionPointCenter.position, collisionPointGround.position, LayerMask.op_Implicit(rb.includeLayers), (QueryTriggerInteraction)1)) { if (isInAir && Time.realtimeSinceStartup - timeLastJump > 0.25f) { if (fallValue2D < -1f && (Object)(object)NewDonkCityManager.Instance != (Object)null) { NewDonkCityManager.Instance.CallHitGroundEvent(((Component)mover).transform.up * -1f); } fallValue2D = 0f; isJumping = false; isInAir = false; } } else { fallValue2D = Mathf.Clamp(fallValue2D - tick * speedFall, -20f, 25f); } if (fallValue2D != 0f) { tempVec += ((Component)rb).transform.forward * fallValue2D; isInAir = true; } if (((Vector3)(ref controllingPlayer.externalForceAutoFade)).magnitude > 0.05f) { tempVec += controllingPlayer.externalForceAutoFade / 2f; controllingPlayer.externalForceAutoFade = Vector3.Lerp(controllingPlayer.externalForceAutoFade, Vector3.zero, 2f * tick); } OwnerAnimatePlayer(); if (!(tempVec == Vector3.zero)) { MovePlayerIn2DZone(tempVec); bool flag = true; switch (inZone.gravityType) { default: flag = false; break; case TwoDimensionalZone.GravityType.MatchUp: { Transform val2 = (((Object)(object)inZone.gravitySource != (Object)null) ? inZone.gravitySource : ((Component)inZone).transform); tempVec = ((Component)rb).transform.position + val2.up; break; } case TwoDimensionalZone.GravityType.ToSource: { Transform val3 = (((Object)(object)inZone.gravitySource != (Object)null) ? inZone.gravitySource : ((Component)inZone).transform); Vector3 position = val3.position; float num3 = Vector3.Distance(((Component)rb).transform.position, position); tempVec = position + NewDonkCityManager.GetForwardToPosition(val3, rb.position) * (num3 * 1.5f); break; } case TwoDimensionalZone.GravityType.FromSource: { Transform val = (((Object)(object)inZone.gravitySource != (Object)null) ? inZone.gravitySource : ((Component)inZone).transform); tempVec = val.position; break; } } if (flag) { RoundManager.Instance.tempTransform.position = ((Component)rb).transform.position; RoundManager.Instance.tempTransform.rotation = ((Component)rb).transform.rotation; RoundManager.Instance.tempTransform.LookAt(tempVec, RoundManager.Instance.tempTransform.up); ((Component)rb).transform.eulerAngles = new Vector3(Mathf.LerpAngle(((Component)rb).transform.eulerAngles.x, RoundManager.Instance.tempTransform.eulerAngles.x, 0.3f), Mathf.LerpAngle(((Component)rb).transform.eulerAngles.y, RoundManager.Instance.tempTransform.eulerAngles.y, 0.3f), Mathf.LerpAngle(((Component)rb).transform.eulerAngles.z, RoundManager.Instance.tempTransform.eulerAngles.z, 0.3f)); } CorrectPlayerRotationAwayFromCamera(); } } private bool MoveInputInDirectionOfLooking() { //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_0084: 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_0078: 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_0083: 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_0045: 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_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) Vector3 val = ((Component)retroZoneCamera).transform.right; if (moveInputVector.x == 0f && moveInputVector.y != 0f) { val = ((Component)retroZoneCamera).transform.up; if (moveInputVector.y < 0f) { val *= -1f; } } else if (moveInputVector.x < 0f) { val *= -1f; } return Vector3.Angle(val, ((Component)rb).transform.up * -1f) < 90f; } private void MovePlayerIn2DZone(Vector3 movement) { //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_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_00a4: 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_00b0: 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_008e: 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_00e2: Unknown result type (might be due to invalid IL or missing references) tempVec = ((Component)rb).transform.position; if (inZone.lockX) { tempVec.x = ((Component)inZone).transform.position.x; } if (inZone.lockY) { tempVec.y = ((Component)inZone).transform.position.y; } if (inZone.lockZ) { tempVec.z = ((Component)inZone).transform.position.z; } rb.MovePosition(tempVec + movement * tick); if (!rb.isKinematic) { rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; } } private void ClampCameraInBounds() { //IL_000c: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0075: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fd: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e4: 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_0123: 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_0174: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) tempVec = ((Component)inZone).transform.right * inZone.boundsOffset.x + ((Component)inZone).transform.up * inZone.boundsOffset.y + ((Component)inZone).transform.forward * inZone.boundsOffset.z; if ((Object)(object)inZone.cameraPoint != (Object)null) { tempVec = inZone.cameraPoint.position; } else if ((Object)(object)inZone.cameraBounds != (Object)null) { tempVec = ((Collider)inZone.cameraBounds).ClosestPoint(((Component)this).transform.position + tempVec); } else { tempVec = ((Component)this).transform.position + tempVec; } ((Component)retroZoneCamera).transform.position = Vector3.Lerp(((Component)retroZoneCamera).transform.position, tempVec, inZone.followSpeedMove); if ((Object)(object)inZone.cameraDirection != (Object)null) { tempVec = inZone.cameraDirection.eulerAngles; } else { tempVec = new Vector3(((Component)inZone).transform.eulerAngles.x, ((Component)inZone).transform.eulerAngles.y + 180f, ((Component)inZone).transform.eulerAngles.z); } ((Component)retroZoneCamera).transform.eulerAngles = new Vector3(Mathf.LerpAngle(((Component)retroZoneCamera).transform.eulerAngles.x, tempVec.x, inZone.followSpeedTurn), Mathf.LerpAngle(((Component)retroZoneCamera).transform.eulerAngles.y, tempVec.y, inZone.followSpeedTurn), Mathf.LerpAngle(((Component)retroZoneCamera).transform.eulerAngles.z, tempVec.z, inZone.followSpeedTurn)); } private void CorrectPlayerRotationAwayFromCamera() { //IL_000b: 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_0071: 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_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_00c4: 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_00ce: 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_00e0: 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_01a3: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Angle(((Component)mover).transform.forward, ((Component)inZone).transform.forward); if (!(Mathf.Abs(90f - num) < offsetTolerance)) { if (Application.isEditor) { Logger.LogDebug((object)$"correction - A: {num}"); } RoundManager.Instance.tempTransform.position = ((Component)mover).transform.position; RoundManager.Instance.tempTransform.rotation = ((Component)inZone).transform.rotation; Vector3 val = RoundManager.Instance.tempTransform.InverseTransformPoint(((Component)mover).transform.position + ((Component)mover).transform.forward); if (Application.isEditor) { Logger.LogDebug((object)$"correction - B: {val}"); } float num2 = num; if (val.x < 0f) { num2 *= -1f; } if (Application.isEditor) { Logger.LogDebug((object)$"correction - C: {num2}"); } float num3 = 0f; num3 = ((num2 > 0f) ? ((!(num > 90f)) ? (90f - num) : ((270f - num) * -1f)) : ((!(num > 90f)) ? ((90f - num) * -1f) : (270f - num))); ((Component)rb).transform.eulerAngles = new Vector3(((Component)rb).transform.localEulerAngles.x, ((Component)rb).transform.localEulerAngles.y, ((Component)rb).transform.localEulerAngles.z + num3); if (Application.isEditor) { Logger.LogDebug((object)$"correction - D: {((Component)rb).transform.eulerAngles.z}"); } } } private void Get2DInput() { //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_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_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_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) if ((Object)(object)NewDonkCityManager.escapeMenu != (Object)null && !NewDonkCityManager.escapeMenu.isMenuOpen) { moveInputVector = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); isSprinting = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Sprint", false).IsPressed(); continuousInput = moveInputVector == lastInput; } else { moveInputVector = Vector2.zero; isSprinting = false; continuousInput = false; } lastInput = moveInputVector; } private void JumpIn2DZone(CallbackContext context) { if (((CallbackContext)(ref context)).performed) { Jump(); } } private void Jump() { if ((!((Object)(object)NewDonkCityManager.escapeMenu != (Object)null) || !NewDonkCityManager.escapeMenu.isMenuOpen) && !isJumping && !(Time.realtimeSinceStartup - timeLastJump < 0.5f) && !(fallValue2D < -2.5f)) { isJumping = true; isInAir = true; fallValue2D = Mathf.Lerp(jumpForce2D.x, jumpForce2D.y, Mathf.InverseLerp(speedWalk, speedRun, Mathf.Clamp(currentSpeed, speedWalk, speedRun))); timeLastJump = Time.realtimeSinceStartup; } } private void ResetPlayerBody() { currentSpeed = 0f; fallValue2D = 0f; OverrideAnimatePlayer(walkAnim: false, sprintAnim: false, fallAnim: false); } private void OwnerAnimatePlayer() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) animateWalk = moveInputVector != Vector2.zero; animateSprint = isSprinting; animateFall = isJumping || fallValue2D < -5f; CustomAnimatePlayer(); } private void OverrideAnimatePlayer(bool walkAnim, bool sprintAnim, bool fallAnim) { animateWalk = walkAnim; animateSprint = sprintAnim; animateFall = fallAnim; CustomAnimatePlayer(); } private void CustomAnimatePlayer() { controllingPlayer.playerBodyAnimator.SetBool("Walking", animateWalk); controllingPlayer.playerBodyAnimator.SetBool("Sprinting", animateSprint); controllingPlayer.playerBodyAnimator.SetBool("FallNoJump", animateFall); } private void SetPlayerSize(bool flatten) { //IL_0075: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_0011: 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_0096: 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_005f: 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_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) if (flatten) { if (playerSizeOnEnter == default(Vector3)) { playerSizeOnEnter = controllingPlayer.meshContainer.localScale; } controllingPlayer.meshContainer.localScale = new Vector3(0.03f, controllingPlayer.meshContainer.localScale.y, controllingPlayer.meshContainer.localScale.z); } else { if (playerSizeOnEnter != default(Vector3)) { controllingPlayer.meshContainer.localScale = playerSizeOnEnter; } playerSizeOnEnter = default(Vector3); } } private void CheckAndSyncPosition() { //IL_0032: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_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_004f: 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) if (syncTimer > 0f) { syncTimer -= tick; return; } syncTimer = 0.15f; if (Vector3.Distance(((Component)this).transform.position, syncedPosition) > 0.1f || Vector3.Angle(((Component)this).transform.eulerAngles, syncedRotation) > 10f) { syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.eulerAngles; SyncTransformServerRpc(syncedPosition, syncedRotation, animateWalk, animateSprint, animateFall); } } [ServerRpc(RequireOwnership = true)] private void SyncTransformServerRpc(Vector3 ownerPos, Vector3 ownerEul, bool animWalk, bool animSprint, bool animFall) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Invalid comparison between Unknown and I4 //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_00f8: 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_0113: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(863584974u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerEul); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animWalk, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animSprint, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animFall, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 863584974u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncTransformClientRpc(ownerPos, ownerEul, animWalk, animSprint, animFall); } } [ClientRpc] private void SyncTransformClientRpc(Vector3 ownerPos, Vector3 ownerEul, bool animWalk, bool animSprint, bool animFall) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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) 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(869240076u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerPos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerEul); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animWalk, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animSprint, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref animFall, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 869240076u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { syncedPosition = ownerPos; syncedRotation = ownerEul; animateWalk = animWalk; animateSprint = animSprint; animateFall = animFall; } } } private void OnDisable() { OnExitRetroZone(sync: false); } 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 ((NetworkBehaviour)this).__registerRpc(3349155683u, new RpcReceiveHandler(__rpc_handler_3349155683), "OnEnterRetroZoneServerRpc"); ((NetworkBehaviour)this).__registerRpc(664664124u, new RpcReceiveHandler(__rpc_handler_664664124), "OnEnterRetroZoneClientRpc"); ((NetworkBehaviour)this).__registerRpc(698934022u, new RpcReceiveHandler(__rpc_handler_698934022), "OnSwitchRetroZoneServerRpc"); ((NetworkBehaviour)this).__registerRpc(3123539671u, new RpcReceiveHandler(__rpc_handler_3123539671), "OnSwitchRetroZoneClientRpc"); ((NetworkBehaviour)this).__registerRpc(4275513439u, new RpcReceiveHandler(__rpc_handler_4275513439), "OnExitRetroZoneServerRpc"); ((NetworkBehaviour)this).__registerRpc(883550357u, new RpcReceiveHandler(__rpc_handler_883550357), "OnExitRetroZoneClientRpc"); ((NetworkBehaviour)this).__registerRpc(863584974u, new RpcReceiveHandler(__rpc_handler_863584974), "SyncTransformServerRpc"); ((NetworkBehaviour)this).__registerRpc(869240076u, new RpcReceiveHandler(__rpc_handler_869240076), "SyncTransformClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3349155683(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).OnEnterRetroZoneServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_664664124(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; ((RetroCharacterController)(object)target).OnEnterRetroZoneClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_698934022(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).OnSwitchRetroZoneServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3123539671(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; ((RetroCharacterController)(object)target).OnSwitchRetroZoneClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4275513439(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int destroyFrames = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref destroyFrames); target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).OnExitRetroZoneServerRpc(destroyFrames); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_883550357(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 destroyFrames = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref destroyFrames); target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).OnExitRetroZoneClientRpc(destroyFrames); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_863584974(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b1: 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_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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 ownerPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerPos); Vector3 ownerEul = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerEul); bool animWalk = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animWalk, default(ForPrimitives)); bool animSprint = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animSprint, default(ForPrimitives)); bool animFall = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animFall, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).SyncTransformServerRpc(ownerPos, ownerEul, animWalk, animSprint, animFall); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_869240076(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_007f: 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_0094: 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_00a3: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 ownerPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerPos); Vector3 ownerEul = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerEul); bool animWalk = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animWalk, default(ForPrimitives)); bool animSprint = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animSprint, default(ForPrimitives)); bool animFall = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animFall, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RetroCharacterController)(object)target).SyncTransformClientRpc(ownerPos, ownerEul, animWalk, animSprint, animFall); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RetroCharacterController"; } } public class Scarecrow : NetworkBehaviour { private static ManualLogSource Logger; public PlatformingChallenge spawnContainer; public Animator animContainer; private List playersHolding; [Space(3f)] public InteractTrigger holdInteract; private Coroutine disableCoroutine; public void OnLoadDelay() { playersHolding = new List(); } public void SetPlayerHoldingLocalClient(bool isHolding) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} client update: {isHolding}"); SetPlayerHoldingScarecrowServerRpc(NewDonkCityManager.localPlayerID, isHolding); } [ServerRpc(RequireOwnership = false)] private void SetPlayerHoldingScarecrowServerRpc(int playerID, bool isHolding) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(956454978u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isHolding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 956454978u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playersHolding == null) { return; } if (isHolding) { if (!playersHolding.Contains(playerID)) { playersHolding.Add(playerID); } } else if (playersHolding.Contains(playerID)) { playersHolding.Remove(playerID); } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} server count: {playersHolding.Count}"); DetermineNewSpawnCondition(); } private void DetermineNewSpawnCondition() { if (playersHolding != null && playersHolding.Count > 0) { SpawnContainerOnServer(); } else if (playersHolding == null || playersHolding.Count == 0) { DestroyContainerOnServer(); } } private void SpawnContainerOnServer() { if (((NetworkBehaviour)this).IsServer) { LocallySpawnContainer(); SpawnContainerClientRpc(); } } [ClientRpc] private void SpawnContainerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3963613850u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3963613850u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { LocallySpawnContainer(); } } } private void LocallySpawnContainer() { spawnContainer.SpawnContainerLocally(); SetAnimation(setTo: true); } private void DestroyContainerOnServer() { if (((NetworkBehaviour)this).IsServer) { LocallyDestroyContainer(); DestroyContainerClientRpc(); } } [ClientRpc] private void DestroyContainerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1103061167u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1103061167u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { LocallyDestroyContainer(); } } } private void LocallyDestroyContainer() { spawnContainer.DestroyContainerLocally(); SetAnimation(setTo: false); } private void SetAnimation(bool setTo) { animContainer.SetBool("IsHeld", setTo); } public void TemporarilyDisable() { TemporarilyDisableLocal(); TemporarilyDisableServerRpc(NewDonkCityManager.localPlayerID); } [ServerRpc(RequireOwnership = false)] private void TemporarilyDisableServerRpc(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(3095949547u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3095949547u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TemporarilyDisableClientRpc(playerID); } } } [ClientRpc] private void TemporarilyDisableClientRpc(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(972171389u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 972171389u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { TemporarilyDisableLocal(); } } } private void TemporarilyDisableLocal() { animContainer.SetTrigger("Hit"); if (disableCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(disableCoroutine); } disableCoroutine = ((MonoBehaviour)this).StartCoroutine(DisableCoroutine(1.5f)); } private IEnumerator DisableCoroutine(float disableTime) { holdInteract.interactable = false; yield return (object)new WaitForSeconds(disableTime); holdInteract.interactable = true; disableCoroutine = 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 ((NetworkBehaviour)this).__registerRpc(956454978u, new RpcReceiveHandler(__rpc_handler_956454978), "SetPlayerHoldingScarecrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(3963613850u, new RpcReceiveHandler(__rpc_handler_3963613850), "SpawnContainerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1103061167u, new RpcReceiveHandler(__rpc_handler_1103061167), "DestroyContainerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3095949547u, new RpcReceiveHandler(__rpc_handler_3095949547), "TemporarilyDisableServerRpc"); ((NetworkBehaviour)this).__registerRpc(972171389u, new RpcReceiveHandler(__rpc_handler_972171389), "TemporarilyDisableClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_956454978(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 isHolding = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isHolding, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scarecrow)(object)target).SetPlayerHoldingScarecrowServerRpc(playerID, isHolding); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3963613850(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; ((Scarecrow)(object)target).SpawnContainerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1103061167(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; ((Scarecrow)(object)target).DestroyContainerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3095949547(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; ((Scarecrow)(object)target).TemporarilyDisableServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_972171389(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; ((Scarecrow)(object)target).TemporarilyDisableClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Scarecrow"; } } public class SceneBGM : MonoBehaviour { public AudioSource globalAudio; public Song songToPlay; public void StartSong() { if (!((Object)(object)globalAudio == (Object)null) && !((Object)(object)songToPlay == (Object)null) && !((Object)(object)SongsManager.Instance == (Object)null)) { SongsManager.Instance.PlaySong(songToPlay, globalAudio); } } public void StopSong() { if (!((Object)(object)globalAudio == (Object)null) && !((Object)(object)songToPlay == (Object)null) && !((Object)(object)SongsManager.Instance == (Object)null)) { SongsManager.Instance.StopSong(songToPlay, globalAudio); } } } public class Scooter : NetworkBehaviour, IHitboxMainScript { private static ManualLogSource Logger; private PlayerControllerB driver; private Vector2 moveInputVector; private bool isJumping; private float jumpInputCooldown; private float timeLastInteractedWithScooter; private float timeLastCollided; private float timeLastMadeEngineNoise; private float timeAccelerated; private float lastSteerTarget; private bool setTooltips; private bool lastSetStiffnessLoose; private Vector3 syncedPosition; private Quaternion syncedRotation; private float currentMotorTorque; private float currentSteerAngle; private float genericTimer; [Header("Components")] public InteractTrigger interactable; public BounceSurface exitBounce; public Rigidbody rb; public WheelCollider[] allWheels; public WheelCollider[] steerableWheels; public Animator scooterAnimator; public AudioSource engineAudio; public Collider[] allColliders; [Space(3f)] [Header("Parameters")] public float targetSpeed; public float targetSpeedAccelerate; public float turnSpeed; public float brakeForce; [Space] public float jumpForce; public float jumpTurnSpeed; public float jumpBounce; public float maxSpeed; public float maxSpeedAerial; [Space] public float syncPositionSpeed; public float syncRotationSpeed; [Space] public float maxRotation; public float maxRotationAerial; [Space] public float stiffnessLoose; public float stiffnessRigid; public float backTargetStill; public float backTargetDrive; [Space(3f)] [Header("Misc")] public string[] tooltips; public LayerMask layersWithHittables; public LayerMask layersWithoutHittables; private void Start() { DetermineNewMaxSpeed(); SetWheelAnim(0f, 1f); SetSteerAnim(0f, 1f); IncludePlayers(); } public void OnLoadDelay() { rb.isKinematic = false; } public void LandOnScooter() { if (Time.realtimeSinceStartup - timeLastInteractedWithScooter < 1f) { return; } timeLastInteractedWithScooter = Time.realtimeSinceStartup; Logger.LogDebug((object)"LandOnScooter()"); PlayerControllerB localPlayer = NewDonkCityManager.localPlayer; if (!((Object)(object)localPlayer == (Object)null) && localPlayer.isPlayerControlled) { if ((Object)(object)driver != (Object)null || (Object)(object)localPlayer.currentlyHeldObjectServer != (Object)null) { exitBounce.BounceLocalPlayerOff(); } else { interactable.Interact(((Component)localPlayer).transform); } } } public void TryDrivingScooter(PlayerControllerB player) { Logger.LogDebug((object)$"TryDrivingScooter(): {player}"); if ((Object)(object)player == (Object)null) { player = NewDonkCityManager.localPlayer; } if ((Object)(object)driver != (Object)null) { player.CancelSpecialTriggerAnimations(); exitBounce.BounceLocalPlayerOff(); } else { SetNewDriverLocal(player, doDismountEffects: false); DetermineNewDriverServerRpc(NewDonkCityManager.GetIDWithPlayer(player), doDismountEffects: false); } } public void StopDrivingScooterOnInput(CallbackContext context) { if (((CallbackContext)(ref context)).performed) { StopDrivingScooter(); } } public void StopDrivingScooterNoDismountEffects() { StopDrivingScooter(doDismountEffects: false); } public void StopDrivingScooter(bool doDismountEffects = true) { Logger.LogDebug((object)$"StopDrivingScooter(): {driver}"); if (!((Object)(object)driver == (Object)null)) { SetNewDriverLocal(null, doDismountEffects); DetermineNewDriverServerRpc(-1, doDismountEffects); } } [ServerRpc(RequireOwnership = false)] private void DetermineNewDriverServerRpc(int newPlayerID, bool doDismountEffects) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(998709150u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, newPlayerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref doDismountEffects, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 998709150u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(newPlayerID); if ((Object)(object)playerWithID != (Object)null) { if ((Object)(object)driver == (Object)null || (Object)(object)driver == (Object)(object)playerWithID) { ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(playerWithID.actualClientId); DetermineNewDriverClientRpc(newPlayerID, validated: true, doDismountEffects); } else { DetermineNewDriverClientRpc(newPlayerID, validated: false, doDismountEffects); } } else { DetermineNewDriverClientRpc(newPlayerID, validated: true, doDismountEffects); } } [ClientRpc] private void DetermineNewDriverClientRpc(int newPlayerID, bool validated, bool doDismountEffects) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3787657777u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, newPlayerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref validated, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref doDismountEffects, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3787657777u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(newPlayerID); if ((Object)(object)playerWithID != (Object)null) { if (!validated) { playerWithID.CancelSpecialTriggerAnimations(); } else { SetNewDriverLocal(playerWithID, doDismountEffects: false); } } else { SetNewDriverLocal(null, doDismountEffects); } } private void SetNewDriverLocal(PlayerControllerB newDriver, bool doDismountEffects) { //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_0169: Unknown result type (might be due to invalid IL or missing references) setTooltips = false; timeLastInteractedWithScooter = Time.realtimeSinceStartup; timeLastCollided = Time.realtimeSinceStartup; SetWheelAnim(0f, 1f); SetSteerAnim(0f, 1f); if ((Object)(object)newDriver != (Object)null) { driver = newDriver; if ((Object)(object)driver == (Object)(object)NewDonkCityManager.localPlayer) { IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed += TryJumping; IngamePlayerSettings.Instance.playerInput.actions.FindAction("Crouch", false).performed += StopDrivingScooterOnInput; } ExcludePlayers(); } else { PlayerControllerB val = driver; driver = null; if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)NewDonkCityManager.localPlayer) { IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).performed -= TryJumping; IngamePlayerSettings.Instance.playerInput.actions.FindAction("Crouch", false).performed -= StopDrivingScooterOnInput; HUDManager.Instance.ClearControlTips(); if (doDismountEffects) { val.CancelSpecialTriggerAnimations(); val.TeleportPlayer(interactable.overridePlayerParent.position + Vector3.up, false, 0f, false, true); exitBounce.BounceLocalPlayerOff(); } } ((MonoBehaviour)this).StartCoroutine(ExcludePlayersTemporarily(1f)); } SetIsJumping(setTo: false, forceCooldown: true); DoScooterAnimation("LightOn", sync: false, (AnimatorControllerParameterType)4, (Object)(object)driver != (Object)null); Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} SetNewDriverLocal(): {driver}"); } private void IncludePlayers() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SetCollidersToExcludeLayerMask(layersWithoutHittables); } private void ExcludePlayers() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SetCollidersToExcludeLayerMask(layersWithHittables); } private IEnumerator ExcludePlayersTemporarily(float maxTime) { ExcludePlayers(); float timeWaited = 0f; float waitIntervals = 0.1f; bool success = false; while (timeWaited < maxTime && !success) { yield return (object)new WaitForSeconds(waitIntervals); timeWaited += waitIntervals; if (Vector3.Distance(((Component)NewDonkCityManager.localPlayer).transform.position, ((Component)this).transform.position) > 3.33f) { if (Application.isEditor) { Logger.LogDebug((object)"succeeded coroutine check prematurely"); } success = true; } } IncludePlayers(); } private void SetCollidersToExcludeLayerMask(LayerMask mask) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < allColliders.Length; i++) { if (!((Object)(object)allColliders[i] == (Object)null)) { allColliders[i].excludeLayers = mask; } } } public void TryJumping(CallbackContext context) { if (((CallbackContext)(ref context)).performed) { MakeScooterJumpWithForce(jumpForce); } } private void StartJumpCooldown() { jumpInputCooldown = 0.33f; } private void MakeScooterJumpWithForce(float force) { //IL_0017: 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 (!isJumping) { SetIsJumping(setTo: true); rb.AddForce(Vector3.up * force, (ForceMode)1); } } private void SetIsJumping(bool setTo, bool forceCooldown = false) { isJumping = setTo; DetermineNewMaxSpeed(); if (isJumping || forceCooldown) { StartJumpCooldown(); } } private void DetermineNewMaxSpeed() { rb.maxLinearVelocity = (isJumping ? maxSpeedAerial : maxSpeed); if ((Object)(object)driver == (Object)null) { Rigidbody obj = rb; obj.maxLinearVelocity /= 2f; } if (Application.isEditor) { Logger.LogInfo((object)$"speed = {rb.maxLinearVelocity}"); } } private void OnCollisionEnter(Collision collision) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (collision != null && !((Object)(object)collision.gameObject == (Object)null)) { ScooterCollide(collision.gameObject, isTrigger: false, collision.relativeVelocity); } } void IHitboxMainScript.HitboxTriggerEntered(Hitbox hitbox, Collider other) { //IL_0014: 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) if (!((Object)(object)other == (Object)null)) { ScooterCollide(((Component)other).gameObject, isTrigger: true); } } private void ScooterCollide(GameObject hitObject, bool isTrigger, Vector3 useVelocity = default(Vector3)) { //IL_001c: 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_0025: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || Time.realtimeSinceStartup - timeLastCollided < 0.5f) { return; } if (useVelocity == default(Vector3)) { useVelocity = rb.velocity; } if (Application.isEditor) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} ScooterCollide(): {hitObject} ({LayerMask.LayerToName(hitObject.layer)}) // {((Vector3)(ref useVelocity)).magnitude} // {isTrigger}"); } PlayerControllerB component = hitObject.GetComponent(); if ((Object)(object)component != (Object)null && (!component.isPlayerControlled || (!isTrigger && (Object)(object)driver == (Object)null) || ((Object)(object)driver != (Object)null && (Object)(object)component == (Object)(object)driver))) { return; } float num = 0f; bool flag = false; bool flag2 = false; if (((Vector3)(ref useVelocity)).magnitude < 5f) { Logger.LogDebug((object)"collision type: A"); flag = false; flag2 = false; num = 0.05f; } else { IHittable component2 = hitObject.GetComponent(); if (component2 != null) { Logger.LogDebug((object)$"collision type: B ({component2})"); component2.Hit(1, useVelocity, NewDonkCityManager.localPlayer, true, -1); flag = true; flag2 = false; num = 0.45f; } else if (!isTrigger && ((Vector3)(ref useVelocity)).magnitude >= 12.5f && (Object)(object)driver != (Object)null && (Object)(object)driver == (Object)(object)NewDonkCityManager.localPlayer) { Logger.LogDebug((object)$"collision type: C ({driver})"); driver.DamagePlayer(10, true, true, (CauseOfDeath)16, 0, false, useVelocity); flag = true; flag2 = true; num = -0.5f; } } if (flag) { timeLastCollided = Time.realtimeSinceStartup - num; } if (flag2) { DoScooterAnimation("HitObject", sync: true, (AnimatorControllerParameterType)9); } } private void Update() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { if ((Object)(object)driver != (Object)null) { SetWheelAnim(currentMotorTorque, Time.deltaTime * 5f); SetSteerAnim(currentSteerAngle, Time.deltaTime * 5f); } return; } if (genericTimer > 0f) { genericTimer -= Time.deltaTime; } else { genericTimer = 1f; DoGenericCheck(); } if ((Object)(object)driver != (Object)null && (!driver.isPlayerControlled || driver.teleportingThisFrame)) { StopDrivingScooterNoDismountEffects(); return; } bool forceSync = false; if (!setTooltips) { setTooltips = true; if ((Object)(object)driver != (Object)null && (Object)(object)driver == (Object)(object)NewDonkCityManager.localPlayer) { HUDManager.Instance.ChangeControlTipMultiple(tooltips, false, (Item)null); } } if (jumpInputCooldown > 0f) { jumpInputCooldown -= Time.deltaTime; } if (isJumping) { if (moveInputVector.x != 0f) { ((Component)this).transform.Rotate(new Vector3(0f, moveInputVector.x * jumpTurnSpeed * Time.deltaTime, 0f), (Space)0); } if (jumpInputCooldown <= 0f) { bool flag = false; for (int i = 0; i < allWheels.Length; i++) { if ((Object)(object)allWheels[i] != (Object)null && allWheels[i].isGrounded) { flag = true; break; } } if (flag) { SetIsJumping(setTo: false); if (Application.isEditor) { Logger.LogInfo((object)"reset jump"); } CheckSurfaceLandedOn(); } } } GetVehicleInput(); WheelFrictionCurve forwardFriction2; if (moveInputVector.y > 0.1f) { if (timeAccelerated == 0f) { DoScooterAnimation("AccelerateBoost", sync: true, (AnimatorControllerParameterType)9); } if (!lastSetStiffnessLoose) { for (int j = 0; j < allWheels.Length; j++) { WheelFrictionCurve forwardFriction = allWheels[j].forwardFriction; ((WheelFrictionCurve)(ref forwardFriction)).stiffness = stiffnessLoose; allWheels[j].forwardFriction = forwardFriction; JointSpring suspensionSpring = allWheels[j].suspensionSpring; suspensionSpring.targetPosition = backTargetDrive; allWheels[j].suspensionSpring = suspensionSpring; if (Application.isEditor) { ManualLogSource logger = Logger; WheelCollider arg = allWheels[j]; forwardFriction2 = allWheels[j].forwardFriction; logger.LogDebug((object)$"{arg} --> {((WheelFrictionCurve)(ref forwardFriction2)).stiffness} & {allWheels[j].suspensionSpring.targetPosition}"); } } lastSetStiffnessLoose = true; if (Application.isEditor) { Logger.LogInfo((object)"set stiffness and targetPos"); } } currentMotorTorque = ((timeAccelerated < 0.5f) ? targetSpeedAccelerate : targetSpeed); if (timeAccelerated < 0.5f) { timeAccelerated += Time.deltaTime; } for (int k = 0; k < allWheels.Length; k++) { allWheels[k].motorTorque = currentMotorTorque; allWheels[k].brakeTorque = 0f; } } else { if (timeAccelerated > 0f) { Vector3 velocity = rb.velocity; if (((Vector3)(ref velocity)).magnitude <= 0.01f) { timeAccelerated = 0f; forceSync = true; if (Application.isEditor) { Logger.LogInfo((object)"reset acceleration"); } } } if (lastSetStiffnessLoose) { for (int l = 0; l < allWheels.Length; l++) { WheelFrictionCurve forwardFriction3 = allWheels[l].forwardFriction; ((WheelFrictionCurve)(ref forwardFriction3)).stiffness = stiffnessRigid; allWheels[l].forwardFriction = forwardFriction3; JointSpring suspensionSpring2 = allWheels[l].suspensionSpring; suspensionSpring2.targetPosition = backTargetStill; allWheels[l].suspensionSpring = suspensionSpring2; if (Application.isEditor) { ManualLogSource logger2 = Logger; WheelCollider arg2 = allWheels[l]; forwardFriction2 = allWheels[l].forwardFriction; logger2.LogDebug((object)$"{arg2} --> {((WheelFrictionCurve)(ref forwardFriction2)).stiffness} & {allWheels[l].suspensionSpring.targetPosition}"); } } lastSetStiffnessLoose = false; if (Application.isEditor) { Logger.LogInfo((object)"reset stiffness and targetPos"); } } currentMotorTorque = 0f; for (int m = 0; m < allWheels.Length; m++) { allWheels[m].motorTorque = currentMotorTorque; allWheels[m].brakeTorque = brakeForce; } } currentSteerAngle = moveInputVector.x * turnSpeed; if (timeAccelerated == 0f && Mathf.Abs(steerableWheels[0].steerAngle - currentSteerAngle) > 1f) { forceSync = true; } for (int n = 0; n < steerableWheels.Length; n++) { steerableWheels[n].steerAngle = currentSteerAngle; } if ((Object)(object)driver != (Object)null) { SetWheelAnim(currentMotorTorque, Time.deltaTime * 5f); SetSteerAnim(currentSteerAngle, Time.deltaTime * 5f); } SyncScooterTransformOwner(forceSync); } private void FixedUpdate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0060: 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) rb.isKinematic = !((NetworkBehaviour)this).IsOwner; if (rb.isKinematic) { rb.MovePosition(Vector3.Lerp(((Component)this).transform.position, syncedPosition, Time.fixedDeltaTime * syncPositionSpeed)); rb.MoveRotation(Quaternion.Lerp(((Component)this).transform.rotation, syncedRotation, syncRotationSpeed)); } else { RotateScooterToMatchFloor(); } } private void SetWheelAnim(float torque, float lerpSpeed) { DoScooterAnimation("WheelSpinSpeed", sync: false, (AnimatorControllerParameterType)1, boolVal: false, Mathf.InverseLerp(0f, targetSpeed, torque)); DoScooterAnimation("StepUp", sync: false, (AnimatorControllerParameterType)4, torque != 0f); EngineAudioCheck(torque, lerpSpeed); } private void SetSteerAnim(float wheelSteerAngle, float lerpSpeed) { float num = Mathf.InverseLerp(turnSpeed * -1f, turnSpeed, wheelSteerAngle); float numVal = Mathf.Lerp(lastSteerTarget, num, lerpSpeed); DoScooterAnimation("SteerDegree", sync: false, (AnimatorControllerParameterType)1, boolVal: false, numVal); lastSteerTarget = numVal; } private void RotateScooterToMatchFloor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_004c: Unknown result type (might be due to invalid IL or missing references) float num = ((Component)this).transform.localEulerAngles.x; float num2 = (isJumping ? maxRotationAerial : maxRotation); if (num > num2 && num < 360f - num2) { num = Mathf.LerpAngle(((Component)this).transform.localEulerAngles.x, (((Component)this).transform.localEulerAngles.x > 180f) ? (360f - num2) : num2, 1f); } ((Component)this).transform.localEulerAngles = new Vector3(num, ((Component)this).transform.localEulerAngles.y, 0f); } private void CheckSurfaceLandedOn() { for (int i = 0; i < allWheels.Length && !WheelHitSurfaceSuccessful(allWheels[i]); i++) { } } private bool WheelHitSurfaceSuccessful(WheelCollider toCheck) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)toCheck == (Object)null) { return false; } RaycastHit val = default(RaycastHit); if (!Physics.Raycast(((Component)toCheck).transform.position, Vector3.down, ref val, 0.5f, LayerMask.op_Implicit(NewDonkCityManager.Instance.ndcHitMask), (QueryTriggerInteraction)1)) { return false; } if ((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) { return false; } BounceSurface component = ((Component)((RaycastHit)(ref val)).collider).GetComponent(); if ((Object)(object)component != (Object)null) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} 1) found bouncable {component} to jump off of"); MakeScooterJumpWithForce(jumpBounce); return true; } LocalPlayerHitSurface component2 = ((Component)((RaycastHit)(ref val)).collider).GetComponent(); if ((Object)(object)component2 != (Object)null) { int persistentEventCount = ((UnityEventBase)component2.invokeOnHit).GetPersistentEventCount(); if (persistentEventCount > 0) { for (int i = 0; i < persistentEventCount; i++) { Object persistentTarget = ((UnityEventBase)component2.invokeOnHit).GetPersistentTarget(i); if (Application.isEditor) { Logger.LogDebug((object)persistentTarget); } if (persistentTarget != (Object)null && ((object)persistentTarget).GetType() == typeof(BounceSurface)) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} 2) found target {persistentTarget} to jump off of"); MakeScooterJumpWithForce(jumpBounce); return true; } } } } return false; } private void GetVehicleInput() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)driver != (Object)null && (Object)(object)NewDonkCityManager.escapeMenu != (Object)null && !NewDonkCityManager.escapeMenu.isMenuOpen) { moveInputVector = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); } else { moveInputVector = Vector2.zero; } } private void SyncScooterTransformOwner(bool forceSync = false) { //IL_0030: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_000d: 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) if (((NetworkBehaviour)this).IsOwner && (forceSync || Vector3.Distance(syncedPosition, ((Component)this).transform.position) > 0.2f)) { syncedPosition = ((Component)this).transform.position; syncedRotation = ((Component)this).transform.rotation; SyncScooterTransformServerRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles, currentMotorTorque, currentSteerAngle); } } [ServerRpc(RequireOwnership = false)] private void SyncScooterTransformServerRpc(Vector3 pos, Vector3 rot, float torque, float steer) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1970837359u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rot); ((FastBufferWriter)(ref val)).WriteValueSafe(ref torque, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref steer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1970837359u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncScooterTransformClientRpc(pos, rot, torque, steer); } } } [ClientRpc] private void SyncScooterTransformClientRpc(Vector3 pos, Vector3 rot, float torque, float steer) { //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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0127: 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) 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(2619502428u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rot); ((FastBufferWriter)(ref val)).WriteValueSafe(ref torque, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref steer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2619502428u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { syncedPosition = pos; syncedRotation = Quaternion.Euler(rot); currentMotorTorque = torque; currentSteerAngle = steer; } } } private void DoScooterAnimation(string animString, bool sync = true, AnimatorControllerParameterType parameter = (AnimatorControllerParameterType)9, bool boolVal = true, float numVal = 1f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected I4, but got Unknown DoScooterAnimationLocal(animString, parameter, boolVal, numVal); if (sync) { DoScooterAnimationServerRpc(NewDonkCityManager.localPlayerID, animString, (int)parameter, boolVal, numVal); } } [ServerRpc(RequireOwnership = false)] private void DoScooterAnimationServerRpc(int playerID, string animString, int parameter, bool boolVal, float numVal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014f: 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_00d5: 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_00f0: 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_010a: 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(3000725412u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); bool flag = animString != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animString, false); } BytePacker.WriteValueBitPacked(val, parameter); ((FastBufferWriter)(ref val)).WriteValueSafe(ref boolVal, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref numVal, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3000725412u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DoScooterAnimationClientRpc(playerID, animString, parameter, boolVal, numVal); } } [ClientRpc] private void DoScooterAnimationClientRpc(int playerID, string animString, int parameter, bool boolVal, float numVal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014f: 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_00d5: 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_00f0: 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_010a: 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(3618986915u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); bool flag = animString != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animString, false); } BytePacker.WriteValueBitPacked(val, parameter); ((FastBufferWriter)(ref val)).WriteValueSafe(ref boolVal, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref numVal, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3618986915u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { DoScooterAnimationLocal(animString, (AnimatorControllerParameterType)parameter, boolVal, numVal); } } } private void DoScooterAnimationLocal(string animString, AnimatorControllerParameterType parameter, bool boolVal, float numVal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 switch (parameter - 1) { case 3: scooterAnimator.SetBool(animString, boolVal); return; case 0: scooterAnimator.SetFloat(animString, numVal); return; case 2: scooterAnimator.SetInteger(animString, (int)numVal); return; case 1: return; } if ((int)parameter == 9) { scooterAnimator.SetTrigger(animString); } } private void EngineAudioCheck(float torque, float lerpSpeed) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.InverseLerp(0f, targetSpeed, torque); engineAudio.volume = Mathf.Lerp(engineAudio.volume, num * 0.25f, lerpSpeed); engineAudio.pitch = Mathf.Lerp(engineAudio.pitch, (torque > targetSpeed) ? 1.33f : (allWheels[0].isGrounded ? 1f : 1.1f), lerpSpeed); if (((NetworkBehaviour)this).IsOwner && engineAudio.volume > 0f && Time.realtimeSinceStartup - timeLastMadeEngineNoise > 0.5f) { timeLastMadeEngineNoise = Time.realtimeSinceStartup; RoundManager.Instance.PlayAudibleNoise(((Component)engineAudio).transform.position, 15f, num, 0, false, 0); } } private void DoGenericCheck() { IsFallingNoJump(); } private void IsFallingNoJump() { if (isJumping) { return; } for (int i = 0; i < allWheels.Length; i++) { if ((Object)(object)allWheels[i] != (Object)null && allWheels[i].isGrounded) { return; } } SetIsJumping(setTo: true); } private void OnDisable() { if (((NetworkBehaviour)this).IsOwner) { StopDrivingScooterNoDismountEffects(); } } 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(998709150u, new RpcReceiveHandler(__rpc_handler_998709150), "DetermineNewDriverServerRpc"); ((NetworkBehaviour)this).__registerRpc(3787657777u, new RpcReceiveHandler(__rpc_handler_3787657777), "DetermineNewDriverClientRpc"); ((NetworkBehaviour)this).__registerRpc(1970837359u, new RpcReceiveHandler(__rpc_handler_1970837359), "SyncScooterTransformServerRpc"); ((NetworkBehaviour)this).__registerRpc(2619502428u, new RpcReceiveHandler(__rpc_handler_2619502428), "SyncScooterTransformClientRpc"); ((NetworkBehaviour)this).__registerRpc(3000725412u, new RpcReceiveHandler(__rpc_handler_3000725412), "DoScooterAnimationServerRpc"); ((NetworkBehaviour)this).__registerRpc(3618986915u, new RpcReceiveHandler(__rpc_handler_3618986915), "DoScooterAnimationClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_998709150(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 newPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newPlayerID); bool doDismountEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doDismountEffects, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).DetermineNewDriverServerRpc(newPlayerID, doDismountEffects); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3787657777(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int newPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newPlayerID); bool validated = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref validated, default(ForPrimitives)); bool doDismountEffects = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doDismountEffects, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).DetermineNewDriverClientRpc(newPlayerID, validated, doDismountEffects); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1970837359(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 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 rot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); float torque = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref torque, default(ForPrimitives)); float steer = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref steer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).SyncScooterTransformServerRpc(pos, rot, torque, steer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2619502428(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 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 rot = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); float torque = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref torque, default(ForPrimitives)); float steer = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref steer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).SyncScooterTransformClientRpc(pos, rot, torque, steer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3000725412(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_0068: 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_0087: 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_00a2: 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_00db: 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)); string animString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animString, false); } int parameter = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref parameter); bool boolVal = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boolVal, default(ForPrimitives)); float numVal = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref numVal, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).DoScooterAnimationServerRpc(playerID, animString, parameter, boolVal, numVal); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3618986915(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_0068: 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_0087: 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_00a2: 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_00db: 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)); string animString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animString, false); } int parameter = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref parameter); bool boolVal = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boolVal, default(ForPrimitives)); float numVal = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref numVal, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scooter)(object)target).DoScooterAnimationClientRpc(playerID, animString, parameter, boolVal, numVal); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Scooter"; } } public class SeedPot : NetworkBehaviour, IHittable { private static ManualLogSource Logger; [Header("Growing")] public int daysToGrow; private int plantedOnDay = -99; public SaveableObject saveScriptGrowing; public GameObject sproutPrefab; public GameObject bloomPrefab; private EventMessenger spawnedBloom; public Transform spawnSproutsFrom; [Space(3f)] [Header("Spraying")] public int weedSpraySkipsDays; public int weedSprayDecreasesValue; public SaveableObject saveScriptSpray; private int daysSprayed; private bool sprayedToday; [Space(3f)] [Header("Moon")] public Transform spawnSeedPosition; public MoonData spawnMoon; public LocalNetworkObject moonSpawnParent; public CoinContainer spawnCoin; [Space(3f)] [Header("Misc")] public Item seedItemProperties; public MoveToPoint tossSeedIn; public InteractTrigger interactScript; public BoxCollider hittableCollider; public Animator potAnimator; public void OnInteract(PlayerControllerB player) { //IL_0052: 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_0072: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)NewDonkCityManager.localPlayer)) { GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if (!((Object)(object)currentlyHeldObjectServer == (Object)null) && !((Object)(object)currentlyHeldObjectServer.itemProperties == (Object)null) && !((Object)(object)currentlyHeldObjectServer.itemProperties != (Object)(object)seedItemProperties)) { NewDonkCityManager.localPlayer.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); ThrowSeedInLocal(currentlyHeldObjectServer); ThrowSeedInServerRpc(NewDonkCityManager.localPlayerID, NetworkObjectReference.op_Implicit(((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject)); } } } [ServerRpc(RequireOwnership = false)] private void ThrowSeedInServerRpc(int playerID, NetworkObjectReference itemNOR) { //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(3662889484u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3662889484u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ThrowSeedInClientRpc(playerID, itemNOR); } } } [ClientRpc] private void ThrowSeedInClientRpc(int playerID, NetworkObjectReference itemNOR) { //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(1323114946u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1323114946u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID == NewDonkCityManager.localPlayerID) { return; } NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref itemNOR)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.itemProperties == (Object)null) && !((Object)(object)component.itemProperties != (Object)(object)seedItemProperties)) { ThrowSeedInLocal(component); } } else { Logger.LogWarning((object)"ThrowSeedInClientRpc(): failed to get netObj"); } } private void ThrowSeedInLocal(GrabbableObject seedItem) { if (!((Object)(object)seedItem == (Object)null)) { seedItem.grabbable = false; seedItem.grabbableToEnemies = false; seedItem.EnableItemMeshes(true); seedItem.EnablePhysics(false); ((Behaviour)seedItem).enabled = false; tossSeedIn.StartMovingObjectToPointNoSync(((Component)seedItem).gameObject); } } public void OnMoveToPointEnd(GameObject thrownSeedItem) { if ((Object)(object)thrownSeedItem == (Object)null) { return; } GrabbableObject component = thrownSeedItem.GetComponent(); if (!((Object)(object)component == (Object)null)) { NewDonkCityManager.DestroyItem(component, ((NetworkBehaviour)component).NetworkObject); if (((NetworkBehaviour)this).IsServer) { plantedOnDay = StartOfRound.Instance.gameStats.daysSpent; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} server registered planting: {plantedOnDay}"); } SpawnSproutsPerDayGrown(0, 0); potAnimator.SetTrigger("FirstSprout"); interactScript.interactable = false; } } public void OnLoadDelay() { LoadedDataState loadedDataState = saveScriptGrowing.RetrieveData(); if (loadedDataState == null || !loadedDataState.loadSuccessful) { SpawnSeedItem(); return; } plantedOnDay = (int)loadedDataState.loadedValue; loadedDataState = saveScriptSpray.RetrieveData(); if (loadedDataState != null && loadedDataState.loadSuccessful) { daysSprayed = (int)loadedDataState.loadedValue; } int num = CalculateDaysSpentGrowing(); SpawnSproutsPerDayGrown(num, daysSprayed); SpawnSproutsClientRpc(num, daysSprayed); } private void SpawnSeedItem() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer) { return; } GameObject val = Object.Instantiate(seedItemProperties.spawnPrefab, spawnSeedPosition.position, spawnSeedPosition.rotation); if (!((Object)(object)val == (Object)null)) { GrabbableObject component = val.GetComponent(); NetworkObject component2 = ((Component)component).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component2 == (Object)null) { Object.Destroy((Object)(object)val); return; } component2.Spawn(false); int value = (int)Random.Range((float)seedItemProperties.minValue * RoundManager.Instance.scrapValueMultiplier, (float)seedItemProperties.maxValue * RoundManager.Instance.scrapValueMultiplier); SpawnSeedLocal(component, value); SpawnSeedClientRpc(NetworkObjectReference.op_Implicit(component2), value); } } [ClientRpc] private void SpawnSeedClientRpc(NetworkObjectReference itemNOR, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4075547666u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemNOR, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4075547666u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkBehaviour)this).IsServer && ((NetworkObjectReference)(ref itemNOR)).TryGet(ref val3, (NetworkManager)null)) { SpawnSeedLocal(((Component)val3).GetComponent(), value); } } } private void SpawnSeedLocal(GrabbableObject seedItem, int value) { if (!((Object)(object)seedItem == (Object)null)) { seedItem.SetScrapValue(value); interactScript.interactable = true; } } public void OnDayEnd() { if (((NetworkBehaviour)this).IsServer) { if (plantedOnDay != -99) { saveScriptGrowing.SaveData(plantedOnDay); } if (daysSprayed != 0) { saveScriptSpray.SaveData(daysSprayed); } } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { HitPotServerRpc(NewDonkCityManager.localPlayerID); return true; } [ServerRpc(RequireOwnership = false)] private void HitPotServerRpc(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(4003139064u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4003139064u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((Object)(object)spawnedBloom == (Object)null)) { HitPotClientRpc(!spawnMoon.SpawnMoonAndCheck(), playerID); } } } [ClientRpc] private void HitPotClientRpc(bool doSpawnCoin, 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3101912814u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref doSpawnCoin, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3101912814u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)spawnedBloom != (Object)null) { spawnedBloom.InvokeEventDefault1(); interactScript.interactable = false; interactScript.disabledHoverTip = string.Empty; if (doSpawnCoin) { spawnCoin.CollectCoinLocal(NewDonkCityManager.GetPlayerWithID(playerID)); } } } [ClientRpc] private void SpawnSproutsClientRpc(int serverDays, int serverSprays) { //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(1131366749u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, serverDays); BytePacker.WriteValueBitPacked(val, serverSprays); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1131366749u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { SpawnSproutsPerDayGrown(serverDays, serverSprays); } } } private void SpawnSproutsPerDayGrown(int spawnSprouts, int timesSprayed) { //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_0123: 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_004a: 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_005b: 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_0075: 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_0085: 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_01c8: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_019e: 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_008c: 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_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_00a8: 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_00d4: 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_0294: Unknown result type (might be due to invalid IL or missing references) spawnSprouts = Mathf.Clamp(spawnSprouts, 0, daysToGrow); Vector3 val = spawnSproutsFrom.position; Transform transform = spawnSproutsFrom; float num = 0f; float num2 = 0.25f; for (int i = 0; i <= spawnSprouts; i++) { if (spawnSprouts < daysToGrow || i < spawnSprouts) { transform = Object.Instantiate(sproutPrefab, val, Quaternion.Euler(new Vector3(0f, num, 0f)), transform).transform; num += 90f; val += Vector3.up * num2; } else { val += Vector3.up * 0.725f; spawnedBloom = Object.Instantiate(bloomPrefab, val, Quaternion.identity, transform).GetComponentInChildren(); ((Component)moonSpawnParent).transform.position = ((Component)spawnedBloom).transform.position; spawnMoon.overrideMoonParent = moonSpawnParent; ((Component)spawnCoin).transform.position = ((Component)moonSpawnParent).transform.position; } } float y = ((Component)this).transform.InverseTransformPoint(val).y; if ((Object)(object)spawnedBloom == (Object)null) { hittableCollider.center = new Vector3(hittableCollider.center.x, y / 2f, hittableCollider.center.z); hittableCollider.size = new Vector3(hittableCollider.size.x, y, hittableCollider.size.z); } else { hittableCollider.center = new Vector3(hittableCollider.center.x, y, hittableCollider.center.z); hittableCollider.size = new Vector3(hittableCollider.size.x, 1f, hittableCollider.size.z); } if (timesSprayed > 0) { int num3 = 0; for (int j = 0; j < timesSprayed; j++) { num3 += (j + 1) * weedSprayDecreasesValue; } spawnMoon.moonValue = Mathf.Max(1, spawnMoon.moonValue - num3); } if (Application.isEditor) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: SpawnSproutsPerDayGrown() finished with spawnSprouts {spawnSprouts}, timesSprayed {timesSprayed}, spawnPos {val}, height {y}, and moonValue {spawnMoon.moonValue}."); } } private int CalculateDaysSpentGrowing() { if (plantedOnDay == -99) { return -1; } if ((Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.gameStats == null) { return -1; } return StartOfRound.Instance.gameStats.daysSpent - plantedOnDay; } public static void LocalPlayerUseWeedKiller(SprayPaintItem item) { //IL_0088: 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_00a9: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel || (Object)(object)NewDonkCityManager.Instance == (Object)null || (Object)(object)item == (Object)null || !item.isWeedKillerSprayBottle || !item.isSpraying || (Object)(object)((GrabbableObject)item).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)item).playerHeldBy != (Object)(object)NewDonkCityManager.localPlayer || !Physics.Raycast(((GrabbableObject)item).playerHeldBy.playerEye.position, ((GrabbableObject)item).playerHeldBy.playerEye.forward, ref val, 4.5f, LayerMask.op_Implicit(NewDonkCityManager.Instance.ndcHitMask), (QueryTriggerInteraction)2) || (Object)(object)((RaycastHit)(ref val)).collider == (Object)null) { return; } SeedPot component = ((Component)((RaycastHit)(ref val)).collider).GetComponent(); if ((Object)(object)component != (Object)null) { component.SpraySeedPot(); } else if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).transform.parent != (Object)null) { component = ((Component)((Component)((RaycastHit)(ref val)).collider).transform.parent).GetComponent(); if ((Object)(object)component != (Object)null) { component.SpraySeedPot(); } } } private void SpraySeedPot() { if (!sprayedToday) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} getting sprayed!"); SeedPotGotSprayedServerRpc(NewDonkCityManager.localPlayerID); } } [ServerRpc(RequireOwnership = false)] private void SeedPotGotSprayedServerRpc(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(3975082834u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3975082834u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (plantedOnDay != -99 && !sprayedToday && CalculateDaysSpentGrowing() < daysToGrow) { sprayedToday = true; plantedOnDay -= weedSpraySkipsDays; daysSprayed++; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} server validated spray: updated plantedOnDay to {plantedOnDay} and daysSprayed to {daysSprayed}"); SeedPotGotSprayedClientRpc(playerID); } } } [ClientRpc] private void SeedPotGotSprayedClientRpc(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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3100178094u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3100178094u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sprayedToday = true; potAnimator.SetTrigger("Sprayed"); interactScript.disabledHoverTip = "[ Fertilized ]"; } } } 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 ((NetworkBehaviour)this).__registerRpc(3662889484u, new RpcReceiveHandler(__rpc_handler_3662889484), "ThrowSeedInServerRpc"); ((NetworkBehaviour)this).__registerRpc(1323114946u, new RpcReceiveHandler(__rpc_handler_1323114946), "ThrowSeedInClientRpc"); ((NetworkBehaviour)this).__registerRpc(4075547666u, new RpcReceiveHandler(__rpc_handler_4075547666), "SpawnSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(4003139064u, new RpcReceiveHandler(__rpc_handler_4003139064), "HitPotServerRpc"); ((NetworkBehaviour)this).__registerRpc(3101912814u, new RpcReceiveHandler(__rpc_handler_3101912814), "HitPotClientRpc"); ((NetworkBehaviour)this).__registerRpc(1131366749u, new RpcReceiveHandler(__rpc_handler_1131366749), "SpawnSproutsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3975082834u, new RpcReceiveHandler(__rpc_handler_3975082834), "SeedPotGotSprayedServerRpc"); ((NetworkBehaviour)this).__registerRpc(3100178094u, new RpcReceiveHandler(__rpc_handler_3100178094), "SeedPotGotSprayedClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3662889484(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 itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeedPot)(object)target).ThrowSeedInServerRpc(playerID, itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1323114946(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 itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeedPot)(object)target).ThrowSeedInClientRpc(playerID, itemNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4075547666(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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 itemNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNOR, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeedPot)(object)target).SpawnSeedClientRpc(itemNOR, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4003139064(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; ((SeedPot)(object)target).HitPotServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3101912814(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool doSpawnCoin = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doSpawnCoin, default(ForPrimitives)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeedPot)(object)target).HitPotClientRpc(doSpawnCoin, playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1131366749(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 serverDays = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverDays); int serverSprays = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serverSprays); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeedPot)(object)target).SpawnSproutsClientRpc(serverDays, serverSprays); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3975082834(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; ((SeedPot)(object)target).SeedPotGotSprayedServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3100178094(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; ((SeedPot)(object)target).SeedPotGotSprayedClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SeedPot"; } } public class Seesaw : NetworkBehaviour { private static ManualLogSource Logger; public float distanceMultiplier; public AnimationCurve weightMultiplier; public float maxRotation; public float maxSpeed; public Transform[] ends; private List playersInCollider = new List(); private float currentOffset; private float cooldown; private float targetRotation; private float currentRotation; private float targetSpeed; private float currentSpeed; private float syncedRotation; private void OnTriggerEnter(Collider other) { if (!((Object)(object)other == (Object)null)) { PlayerControllerB component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component != (Object)(object)NewDonkCityManager.localPlayer) && component.isPlayerControlled) { Logger.LogDebug((object)$"ADDING {component.playerUsername} to {this} #{((NetworkBehaviour)this).NetworkObjectId} on LOCAL CLIENT"); PlayerEnterExitTriggerServerRpc(NewDonkCityManager.localPlayerID, triggerEntered: true); } } } private void OnTriggerExit(Collider other) { if (!((Object)(object)other == (Object)null)) { PlayerControllerB component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component != (Object)(object)NewDonkCityManager.localPlayer)) { Logger.LogDebug((object)$"REMOVING {component.playerUsername} from {this} #{((NetworkBehaviour)this).NetworkObjectId} on LOCAL CLIENT"); PlayerEnterExitTriggerServerRpc(NewDonkCityManager.localPlayerID, triggerEntered: false); } } } [ServerRpc(RequireOwnership = false)] private void PlayerEnterExitTriggerServerRpc(int playerID, bool triggerEntered) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(518288031u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref triggerEntered, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 518288031u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(playerID); if ((Object)(object)playerWithID == (Object)null || playersInCollider == null) { return; } if (triggerEntered && !playersInCollider.Contains(playerWithID)) { Logger.LogDebug((object)$"ADDING {playerWithID.playerUsername} to {this} #{((NetworkBehaviour)this).NetworkObjectId} on SERVER"); playersInCollider.Add(playerWithID); } else if (!triggerEntered && playersInCollider.Contains(playerWithID)) { Logger.LogDebug((object)$"REMOVING {playerWithID.playerUsername} from {this} #{((NetworkBehaviour)this).NetworkObjectId} on SERVER"); playersInCollider.Remove(playerWithID); } if (playersInCollider.Count == 1 && (Object)(object)playersInCollider[0] != (Object)null && ((NetworkBehaviour)this).OwnerClientId != playersInCollider[0].actualClientId) { Logger.LogInfo((object)$"OWNERSHIP CHANGE: {this} #{((NetworkBehaviour)this).NetworkObjectId} now belongs to {playersInCollider[0].playerUsername}"); ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(playersInCollider[0].actualClientId); } if (playersInCollider.Count > 0) { int[] array = new int[playersInCollider.Count]; for (int i = 0; i < playersInCollider.Count; i++) { array[i] = NewDonkCityManager.GetIDWithPlayer(playersInCollider[i]); } SyncPlayersOnSeesawClientRpc(clear: false, array); } else { SyncPlayersOnSeesawClientRpc(clear: true, null); } } [ClientRpc] private void SyncPlayersOnSeesawClientRpc(bool clear, int[] playerIDs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00a3: 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_0127: 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) //IL_00c7: 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) 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(1732857462u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref clear, default(ForPrimitives)); bool flag = playerIDs != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(playerIDs, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1732857462u, 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; } if (clear) { playersInCollider = null; return; } playersInCollider = new List(); for (int i = 0; i < playerIDs.Length; i++) { playersInCollider.Add(NewDonkCityManager.GetPlayerWithID(playerIDs[i])); } } private void FixedUpdate() { //IL_0014: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { ((Component)this).transform.localEulerAngles = new Vector3(Mathf.LerpAngle(((Component)this).transform.localEulerAngles.x, syncedRotation, currentSpeed * 17.5f * Time.fixedDeltaTime), ((Component)this).transform.localEulerAngles.y, ((Component)this).transform.localEulerAngles.z); return; } if (cooldown <= 0f) { cooldown = 0.25f; currentOffset = DetermineCenterOfBalance(); if (currentOffset == -99f) { targetRotation = 0f; targetSpeed = ((currentRotation > 0f) ? (-0.1f) : 0.1f); } else { targetRotation = ((currentOffset == 0f) ? 0f : ((currentOffset > 0f) ? maxRotation : (maxRotation * -1f))); targetSpeed = currentOffset; } if (Mathf.Abs(currentRotation - syncedRotation) >= 1.5f) { SyncRotationOwner(); } } else { cooldown -= Time.fixedDeltaTime; } currentRotation = ((Component)this).transform.localEulerAngles.x; if (currentRotation > 180f) { currentRotation -= 360f; } if (currentRotation > maxRotation && currentRotation < 360f - maxRotation) { currentSpeed = 0f; } if (currentRotation > targetRotation + 1f || currentRotation < targetRotation - 1f) { if (targetRotation > 0f == currentSpeed > 0f) { currentSpeed += Time.fixedDeltaTime * targetSpeed * 1f; } else { currentSpeed -= Time.fixedDeltaTime * targetSpeed * -2f; } currentSpeed = Mathf.Clamp(currentSpeed, maxSpeed * -1f, maxSpeed); ((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x + currentSpeed, 0f, 0f); } else { currentSpeed = 0f; if (syncedRotation != currentRotation) { SyncRotationOwner(); } } } private float DetermineCenterOfBalance() { //IL_007f: 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_009c: 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_00c2: 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 (playersInCollider == null || playersInCollider.Count == 0) { return -99f; } float num = 0f; for (int i = 0; i < playersInCollider.Count; i++) { if (!((Object)(object)playersInCollider[i] == (Object)null) && playersInCollider[i].isPlayerControlled && !(playersInCollider[i].carryWeight < 1f)) { num += (Mathf.InverseLerp(((Component)this).transform.InverseTransformPoint(ends[0].position).z, ((Component)this).transform.InverseTransformPoint(ends[1].position).z, ((Component)this).transform.InverseTransformPoint(((Component)playersInCollider[i]).transform.position).z) * 2f - 1f) * distanceMultiplier * weightMultiplier.Evaluate(playersInCollider[i].carryWeight - 1f); } } return num; } private void SyncRotationOwner() { if (((NetworkBehaviour)this).IsOwner) { syncedRotation = currentRotation; SyncTargetsServerRpc(syncedRotation, Mathf.Abs(currentSpeed)); } } [ServerRpc(RequireOwnership = false)] private void SyncTargetsServerRpc(float ownerRotation, float ownerSpeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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(581036380u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 581036380u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncTargetsClientRpc(ownerRotation, ownerSpeed); } } } [ClientRpc] private void SyncTargetsClientRpc(float ownerRotation, float ownerSpeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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(1467669494u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1467669494u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { syncedRotation = ownerRotation; currentSpeed = ownerSpeed; } } } 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 ((NetworkBehaviour)this).__registerRpc(518288031u, new RpcReceiveHandler(__rpc_handler_518288031), "PlayerEnterExitTriggerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1732857462u, new RpcReceiveHandler(__rpc_handler_1732857462), "SyncPlayersOnSeesawClientRpc"); ((NetworkBehaviour)this).__registerRpc(581036380u, new RpcReceiveHandler(__rpc_handler_581036380), "SyncTargetsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1467669494u, new RpcReceiveHandler(__rpc_handler_1467669494), "SyncTargetsClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_518288031(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 triggerEntered = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref triggerEntered, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Seesaw)(object)target).PlayerEnterExitTriggerServerRpc(playerID, triggerEntered); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1732857462(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_0089: 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_0073: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool clear = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clear, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] playerIDs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerIDs, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Seesaw)(object)target).SyncPlayersOnSeesawClientRpc(clear, playerIDs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_581036380(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_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float ownerRotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerRotation, default(ForPrimitives)); float ownerSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerSpeed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Seesaw)(object)target).SyncTargetsServerRpc(ownerRotation, ownerSpeed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1467669494(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_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float ownerRotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerRotation, default(ForPrimitives)); float ownerSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerSpeed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Seesaw)(object)target).SyncTargetsClientRpc(ownerRotation, ownerSpeed); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Seesaw"; } } public class Slingshot : NetworkBehaviour { private static ManualLogSource Logger; public MoveToPoint pullPlayerIn; public BounceSurface launchPlayerOut; public void OnInteract(PlayerControllerB interactingPlayer) { //IL_002d: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)interactingPlayer == (Object)null || (Object)(object)interactingPlayer != (Object)(object)NewDonkCityManager.localPlayer || !interactingPlayer.isPlayerControlled || interactingPlayer.teleportingThisFrame) { return; } GameObject val = PropsManager.SpawnGenericPlayerMover(((Component)interactingPlayer).transform.position, ((Component)interactingPlayer).transform.rotation); if (!((Object)(object)val == (Object)null)) { SnapPlayerToPosition componentInChildren = val.GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.Initialize(interactingPlayer, ((Component)interactingPlayer).transform); pullPlayerIn.StartMovingObjectToPointNoSync(val); } } } public void InvokeOnMoveEnd(GameObject moverObject) { if (!((Object)(object)moverObject == (Object)null)) { SnapPlayerToPosition componentInChildren = moverObject.GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.SetToDestroy(); ((MonoBehaviour)this).StartCoroutine(PlayerLaunch()); } } } private IEnumerator PlayerLaunch() { PlayerControllerB player = NewDonkCityManager.localPlayer; Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: Launch A: StartCoroutine // {player}"); if ((Object)(object)player == (Object)null || (Object)(object)player.thisController == (Object)null) { yield break; } player.teleportingThisFrame = false; launchPlayerOut.BounceLocalPlayerOff(); Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: Launch B: WaitUntil !isGrounded // {player.thisController.isGrounded}"); float timeWaited = 0f; float maxTime = 2f; bool wait = true; while (wait) { yield return null; timeWaited += Time.deltaTime; if (timeWaited >= maxTime) { wait = false; } if (!player.thisController.isGrounded || !player.isPlayerControlled) { wait = false; } } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: Launch C: fallValue = 0.0f // {player.thisController.isGrounded}"); timeWaited = 0f; maxTime = 60f; wait = true; while (wait) { yield return null; timeWaited += Time.deltaTime; if (timeWaited >= maxTime) { wait = false; } player.fallValueUncapped = 0f; if (player.thisController.isGrounded || !player.isPlayerControlled) { wait = false; } } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: Launch D: Complete"); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Slingshot"; } } public class Song : MonoBehaviour { public AudioClip songClip; [Space(3f)] [Header("STATIC")] [Header("Jump Points")] [Tooltip("The X-value is the point the SongsManager will jump to if the Y-value at this same index has been surpassed.")] public Vector2[] loopPoints; [Space] [Tooltip("Use this to override when the song's currentLoopIndex will be set from -1 (the intro) to 0 (the main body).\nIf left at -1, currentLoopIndex be set to 0 as soon as the loopPoints[0].x has been surpassed.")] public float introPoint = -1f; [Tooltip("Use this to override the point JumpToOutro() will jump to.\nIf left at -1, JumpToOutro() will jump to loopPoints[loopPoints.Length - 1].y")] public float outroPoint = -1f; [Space(3f)] [Header("INGAME")] [Header("Volumes")] [Range(0f, 1f)] public float volumeOutside = 1f; [Range(0f, 1f)] public float volumeFactory; [Range(0f, 1f)] public float volumeHangarRoom = 0.33f; public float volumeDeadMultiplier = 0.25f; [Space] [Header("Effects")] public bool affectedByGlobalMultiplier; public bool muteVanillaMusic; public bool customSetVolume; [HideInInspector] public int currentLoopIndex = -1; [HideInInspector] public bool ignoreNextLoopPoint; } public class SparkBall : MonoBehaviour { public SnapPlayerToPosition matchPositionScript; public AudioSource sparkAudio; public MeshRenderer sparkMesh; public void InitializeSparkBall(PlayerControllerB setToMove, int timesZapped) { if (!((Object)(object)setToMove == (Object)null) && setToMove.isPlayerControlled) { matchPositionScript.Initialize(setToMove, ((Component)setToMove).transform, null, normalUpdate: false); sparkAudio.pitch = Mathf.Lerp(0.9f, 1.1f, (float)new Random(StartOfRound.Instance.randomMapSeed + TimeOfDay.Instance.hour + NewDonkCityManager.GetIDWithPlayer(setToMove) + timesZapped).NextDouble()); if ((Object)(object)AestheticsManager.Instance != (Object)null && (Object)(object)AestheticsManager.Instance.todaysAesthetics != (Object)null) { AudioSource obj = sparkAudio; obj.pitch += AestheticsManager.Instance.todaysAesthetics.pitchOffset; } if ((Object)(object)setToMove == (Object)(object)NewDonkCityManager.localPlayer) { ((Renderer)sparkMesh).enabled = false; } } } public void SetSparkBallToDestroy() { ((Renderer)sparkMesh).enabled = false; matchPositionScript.SetToDestroy(1); } public PlayerControllerB GetPlayerMoved() { return matchPositionScript.GetMovingPlayer(); } } public class SparkPylon : NetworkBehaviour, IShockableWithGun { public MoveToPoint movePlayerAlong; public BounceSurface launchPlayerAtEnd; public AudioClip captureSFX; private int timesZapped; private static bool allowDeathAtStart; public int prefabIndex = 1; bool IShockableWithGun.CanBeShocked() { return true; } float IShockableWithGun.GetDifficultyMultiplier() { return 0f; } NetworkObject IShockableWithGun.GetNetworkObject() { return ((NetworkBehaviour)this).NetworkObject; } Vector3 IShockableWithGun.GetShockablePosition() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.position; } Transform IShockableWithGun.GetShockableTransform() { return ((Component)this).transform; } void IShockableWithGun.ShockWithGun(PlayerControllerB shockedByPlayer) { StartMovingPlayerToPoint(shockedByPlayer); } void IShockableWithGun.StopShockingWithGun() { } public void StartMovingPlayerToPoint(PlayerControllerB player) { //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0143: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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) ((MonoBehaviour)this).StartCoroutine(StopGun(player)); if ((Object)(object)player == (Object)null || (Object)(object)movePlayerAlong == (Object)null) { return; } Vector3 position = ((Component)this).transform.position; Quaternion identity = Quaternion.identity; int num = prefabIndex; GameObject val = PropsManager.SpawnGenericPlayerMover(position, identity, null, default(Vector3), num); if ((Object)(object)val == (Object)null) { return; } SparkBall component = val.GetComponent(); if (!((Object)(object)component == (Object)null)) { timesZapped++; component.InitializeSparkBall(player, timesZapped); player.thisController.detectCollisions = false; player.disableLookInput = true; player.disableMoveInput = true; player.disableSyncInAnimation = true; if ((Object)(object)player.currentlyHeldObjectServer != (Object)null) { player.currentlyHeldObjectServer.EnableItemMeshes(false); } if ((Object)(object)player == (Object)(object)NewDonkCityManager.localPlayer) { allowDeathAtStart = StartOfRound.Instance.allowLocalPlayerDeath; StartOfRound.Instance.allowLocalPlayerDeath = false; ((Component)player.localVisor).gameObject.SetActive(false); } GenericManager.PlaySFXAtLocation(((Component)this).transform.position, captureSFX, audible: true, 20f, 1f); movePlayerAlong.StartMovingObjectToPoint(((Component)component).gameObject, syncWithServer: false, null, component.sparkAudio); } } public void EndMovingPlayerToPoint(GameObject objectMoved) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) if ((Object)(object)objectMoved == (Object)null || (Object)(object)launchPlayerAtEnd == (Object)null) { return; } SparkBall component = objectMoved.GetComponent(); if ((Object)(object)component == (Object)null) { return; } PlayerControllerB playerMoved = component.GetPlayerMoved(); if (!((Object)(object)playerMoved == (Object)null)) { component.SetSparkBallToDestroy(); playerMoved.enteringSpecialAnimation = false; playerMoved.externalForces = Vector3.zero; playerMoved.externalForceAutoFade = Vector3.zero; playerMoved.ResetFallGravity(); playerMoved.CancelSpecialTriggerAnimations(); playerMoved.thisController.detectCollisions = true; playerMoved.disableLookInput = false; playerMoved.disableMoveInput = false; playerMoved.disableSyncInAnimation = false; if ((Object)(object)playerMoved.currentlyHeldObjectServer != (Object)null) { playerMoved.currentlyHeldObjectServer.EnableItemMeshes(true); } if ((Object)(object)playerMoved == (Object)(object)NewDonkCityManager.localPlayer) { StartOfRound.Instance.allowLocalPlayerDeath = allowDeathAtStart; ((Component)playerMoved.localVisor).gameObject.SetActive(true); launchPlayerAtEnd.BounceLocalPlayerOff(); } } } private IEnumerator StopGun(PlayerControllerB player) { float timeWaited = 0f; float maxTime = 2.5f; float waitIntervals = 0.3f; bool success = false; while (timeWaited < maxTime && !success) { yield return (object)new WaitForSeconds(waitIntervals); timeWaited += waitIntervals; if ((Object)(object)player != (Object)null && (Object)(object)player.currentlyHeldObjectServer != (Object)null) { PatcherTool component = ((Component)player.currentlyHeldObjectServer).GetComponent(); if ((Object)(object)component != (Object)null && component.isShocking) { component.StopShockingAnomalyOnClient(false); success = true; } } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SparkPylon"; } } public class SwingableStreetLight : NetworkBehaviour { [Header("Parameters")] public float horizontalMultiplier = 2.25f; public float horizontalBonus = 1.5f; public float verticalMultiplier = 1.5f; public float verticalBonus = 20f; [Space(3f)] [Header("Components")] public int animCurveIndex; public InteractTrigger interactScript; public void OnInteract(PlayerControllerB usedBy) { //IL_0044: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)usedBy == (Object)null) && !((Object)(object)usedBy != (Object)(object)NewDonkCityManager.localPlayer) && !((Object)(object)usedBy.thisController == (Object)null)) { if (usedBy.thisController.isGrounded) { ((MonoBehaviour)this).StartCoroutine(NotifyOfAerial()); return; } StartSwing(usedBy); StartSwingServerRpc(NewDonkCityManager.localPlayerID, usedBy.thisController.velocity); } } private IEnumerator NotifyOfAerial() { interactScript.interactable = false; yield return (object)new WaitForSeconds(interactScript.cooldownTime); interactScript.interactable = true; } [ServerRpc(RequireOwnership = false)] private void StartSwingServerRpc(int playerID, Vector3 ownerVelocity) { //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_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) //IL_00e2: 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(1086350694u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerVelocity); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1086350694u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartSwingClientRpc(playerID, ownerVelocity); } } } [ClientRpc] private void StartSwingClientRpc(int playerID, Vector3 ownerVelocity) { //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_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) //IL_00f0: 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(126064226u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref ownerVelocity); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 126064226u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (playerID != NewDonkCityManager.localPlayerID) { StartSwing(NewDonkCityManager.GetPlayerWithID(playerID), ownerVelocity); } } } private void StartSwing(PlayerControllerB swingPlayer, Vector3 useVelocity = default(Vector3)) { //IL_0012: 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_001b: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)swingPlayer == (Object)null) && swingPlayer.isPlayerControlled) { if (useVelocity == default(Vector3) && (Object)(object)swingPlayer.thisController != (Object)null) { useVelocity = swingPlayer.thisController.velocity; } ((MonoBehaviour)this).StartCoroutine(SwingPlayerAnim(swingPlayer, useVelocity)); } } private IEnumerator SwingPlayerAnim(PlayerControllerB swingingPlayer, Vector3 velocityGoingIn) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)swingingPlayer == (Object)null) { yield break; } GameObject spawnedSwinger = PropsManager.SpawnGenericPlayerMover(((Component)this).transform.position, ((Component)this).transform.rotation, null, new Vector3(0f, -2f, -0.5f)); if ((Object)(object)spawnedSwinger == (Object)null) { yield break; } SnapPlayerToPosition matchPositionScript = spawnedSwinger.GetComponentInChildren(); if ((Object)(object)matchPositionScript == (Object)null) { yield break; } matchPositionScript.Initialize(swingingPlayer); float startingAngle = Mathf.Clamp(((Vector3)(ref velocityGoingIn)).magnitude * 5f, 20f, 70f); if (Vector3.Angle(swingingPlayer.playerEye.forward, ((Component)this).transform.forward) > 90f) { spawnedSwinger.transform.Rotate(new Vector3(0f, 180f, 0f), (Space)1); } float timePassed = 0f; float maxTime = 0.75f; if (NewDonkCityManager.GetAnimationCurveNonAlloc(animCurveIndex)) { for (; timePassed < maxTime; timePassed += Time.deltaTime) { spawnedSwinger.transform.localEulerAngles = new Vector3(startingAngle * NewDonkCityManager.Instance.sharedAnimCurves[animCurveIndex].Evaluate(timePassed / maxTime), spawnedSwinger.transform.localEulerAngles.y, spawnedSwinger.transform.localEulerAngles.z); yield return null; } } EndSwing(swingingPlayer, velocityGoingIn, matchPositionScript); } public void EndSwing(PlayerControllerB swingingPlayer, Vector3 velocityGoingIn, SnapPlayerToPosition spawnedMover) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0072: 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_009d: 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_00d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)spawnedMover != (Object)null) { spawnedMover.SetToDestroy(); } if ((Object)(object)swingingPlayer != (Object)null && (Object)(object)swingingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(velocityGoingIn.x * Mathf.Abs(((Component)this).transform.forward.x), velocityGoingIn.y * Mathf.Abs(((Component)this).transform.forward.y), velocityGoingIn.z * Mathf.Abs(((Component)this).transform.forward.z)); Vector3 force = default(Vector3); ((Vector3)(ref force))..ctor(val.x * horizontalMultiplier + horizontalBonus, Mathf.Abs(velocityGoingIn.y) * verticalMultiplier + verticalBonus, val.z * horizontalMultiplier + horizontalBonus); NewDonkCityManager.AddForceToPlayerBody(swingingPlayer, force, addToExistingForce: false); } } 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(1086350694u, new RpcReceiveHandler(__rpc_handler_1086350694), "StartSwingServerRpc"); ((NetworkBehaviour)this).__registerRpc(126064226u, new RpcReceiveHandler(__rpc_handler_126064226), "StartSwingClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1086350694(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0052: 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); Vector3 ownerVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerVelocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((SwingableStreetLight)(object)target).StartSwingServerRpc(playerID, ownerVelocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_126064226(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0052: 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); Vector3 ownerVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerVelocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((SwingableStreetLight)(object)target).StartSwingClientRpc(playerID, ownerVelocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SwingableStreetLight"; } } public class SwingingScaffold : MonoBehaviour { private static ManualLogSource Logger; public bool doSwinging; [Space(3f)] [Header("Visuals")] public Transform rotateTransform; public float maxSwingAngle; public float loopOverTime; private float animTimer; public AnimationCurve loopAnimCurve; [Space(3f)] [Header("NavMesh")] public OffMeshLink[] toggleNavLinks; public float angleForValidLink; private bool lastLinksEnabled; [Space(3f)] [Header("Audio")] public AudioSource swingAudio; private bool playedFirstHalfSFX; public void OnLoadDelay() { Logger.LogDebug((object)$"{this} starting locally"); SetSwinging(setTo: true); } public void SetSwinging(bool setTo) { doSwinging = setTo; } private void Awake() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if ((Object)(object)rotateTransform == (Object)null) { rotateTransform = ((Component)this).transform; } if (loopAnimCurve == null) { loopAnimCurve = new AnimationCurve(); } if (toggleNavLinks != null && toggleNavLinks.Length != 0) { lastLinksEnabled = toggleNavLinks[0].activated; } } private void Update() { if (doSwinging) { DoRotation(); ToggleNavMeshLinks(); DetermineSwingAudio(); } } private void DoRotation() { //IL_0037: 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_0070: Unknown result type (might be due to invalid IL or missing references) animTimer += Time.deltaTime; if (animTimer >= loopOverTime) { animTimer = 0f; } rotateTransform.localEulerAngles = new Vector3(rotateTransform.localEulerAngles.x, loopAnimCurve.Evaluate(animTimer / loopOverTime) * maxSwingAngle, rotateTransform.localEulerAngles.z); } private void ToggleNavMeshLinks() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (toggleNavLinks != null && toggleNavLinks.Length != 0 && lastLinksEnabled != Mathf.Abs(rotateTransform.localEulerAngles.y) > angleForValidLink) { UpdateNavMeshLinksActivated(!lastLinksEnabled); } } private void UpdateNavMeshLinksActivated(bool setTo) { lastLinksEnabled = setTo; OffMeshLink[] array = toggleNavLinks; foreach (OffMeshLink val in array) { if ((Object)(object)val != (Object)null) { val.activated = lastLinksEnabled; } } } private void DetermineSwingAudio() { if (playedFirstHalfSFX) { if (animTimer > loopOverTime / 2f) { PlaySwingSFX(); playedFirstHalfSFX = false; } } else if (animTimer < loopOverTime / 2f) { PlaySwingSFX(); playedFirstHalfSFX = true; } } private void PlaySwingSFX() { GenericManager.PlaySFX(swingAudio, swingAudio.clip, audible: false); } } public class TwoDimensionalZone : MonoBehaviour { public enum GravityType { None, [InspectorName("Match Gravity Source Up")] MatchUp, [InspectorName("Gravity Source Attracts")] ToSource, [InspectorName("Gravity Source Repels")] FromSource } private static ManualLogSource Logger; [Header("Gravity")] public GravityType gravityType = GravityType.MatchUp; public Transform gravitySource; [Space(3f)] [Header("Camera")] public Transform cameraPoint; public BoxCollider cameraBounds; public Vector3 boundsOffset = new Vector3(0f, 0f, 20f); public Transform cameraDirection; [Space] [Range(0f, 1f)] public float followSpeedMove = 0.03f; [Range(0f, 1f)] public float followSpeedTurn = 0.03f; [Space(3f)] [Header("Lock")] public bool lockX; public bool lockY; public bool lockZ; private void OnTriggerEnter(Collider other) { if (!((Object)(object)RetroCharacterController.LocalInstance == (Object)null) && !((Object)(object)RetroCharacterController.LocalInstance.inZone == (Object)null) && !((Object)(object)RetroCharacterController.LocalInstance.inZone == (Object)(object)this)) { Enter2DZone(((Component)other).gameObject); } } public void Enter2DZone(GameObject container) { if ((Object)(object)container == (Object)null) { return; } RetroCharacterController component = container.GetComponent(); if ((Object)(object)component == (Object)null) { return; } Logger.LogDebug((object)$"{this} Enter2DZone(): {component.controllingPlayer}"); if (!((Object)(object)component.controllingPlayer != (Object)(object)NewDonkCityManager.localPlayer)) { if ((Object)(object)component.inZone == (Object)null) { component.OnEnterRetroZone(); } else { component.OnSwitchRetroZone(); } component.inZone = this; } } } public class WallJumpPanel : MonoBehaviour { [Header("Jump Off")] [Tooltip("X is this object's right\nY is the world up\nZ is this object's forward")] public Vector3 jumpOffForce; [Tooltip("Setting any of these values to 0.0f effectively resets the force in that world-direction to make the wall's forward the new force.")] public Vector3 alterForceBeforeJump = new Vector3(1f, 0f, 1f); [Range(0f, 1f)] public float staminaDecrease = 0.16f; public void WallJumpLocalPlayerOffPanel(PlayerControllerB player) { //IL_0035: 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_0072: Unknown result type (might be due to invalid IL or missing references) if (Application.isEditor) { Plugin.Logger.LogDebug((object)$"{this} WallJumpLocalPlayerOffPanel(): {player}"); } if ((Object)(object)player == (Object)null) { return; } AlterForceBeforeJump(player); NewDonkCityManager.AddForceToPlayerBody(player, new Vector3(((Component)this).transform.forward.x * jumpOffForce.x, jumpOffForce.y, ((Component)this).transform.forward.z * jumpOffForce.z)); player.sprintMeter = Mathf.Clamp(player.sprintMeter - staminaDecrease * (11f / Mathf.Max(player.sprintTime, 1f)), 0f, 1f); if ((Object)(object)StartOfRound.Instance != (Object)null) { ((UnityEvent)(object)StartOfRound.Instance.PlayerJumpEvent).Invoke(player); player.PlayJumpAudio(); if (StartOfRound.Instance.connectedPlayersAmount != 0) { player.PlayerJumpedServerRpc(); } } } private void AlterForceBeforeJump(PlayerControllerB player) { if (!((Object)(object)player == (Object)null)) { player.externalForceAutoFade.x *= alterForceBeforeJump.x; player.externalForceAutoFade.y *= alterForceBeforeJump.y; player.externalForceAutoFade.z *= alterForceBeforeJump.z; } } public static void LocalPlayerPressedJump(PlayerControllerB player) { //IL_00a7: 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_00c7: 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) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel || (Object)(object)NewDonkCityManager.Instance == (Object)null || (Object)(object)player == (Object)null || (Object)(object)player != (Object)(object)NewDonkCityManager.localPlayer || (Object)(object)player.lowerSpine == (Object)null || (Object)(object)player.thisController == (Object)null || player.thisController.isGrounded || !player.isPlayerControlled || player.inSpecialInteractAnimation || (Object)(object)player.inAnimationWithEnemy != (Object)null) { return; } GameObject val = NewDonkCityManager.SearchPhysicsComponentAtPosition(new Vector3(((Component)player).transform.position.x, player.lowerSpine.position.y, ((Component)player).transform.position.z), "Local NetworkObject", 0.1f); if (!((Object)(object)val == (Object)null)) { WallJumpPanel component = val.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.WallJumpLocalPlayerOffPanel(player); } } } } public class WarpPipe : NetworkBehaviour { private static ManualLogSource Logger; [Header("2D Zone")] public WarpPipe linkedToPipe; [Tooltip("This is the zone this pipe is located within.")] public TwoDimensionalZone toAndFrom2DZone; public bool isEntranceTo2DZone; [Space(3f)] [Header("Movement")] public MoveToPoint movePlayerIntoPipe; public BounceSurface launchPlayerOut; public int prefabIndex = 2; [Space(3f)] [Header("Audiovisual")] public AudioClip warpEnterSFX; public AudioClip warpExitSFX; public Transform warpSource; public Collider ownCollider; public void LocalPlayerHitSurfaceWarpPipe() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)RetroCharacterController.LocalInstance != (Object)null) { PlayerHitWarpPipeServerRpc(NewDonkCityManager.localPlayerID, NetworkObjectReference.op_Implicit(((NetworkBehaviour)RetroCharacterController.LocalInstance).NetworkObject)); } else { PlayerHitWarpPipeNonRetroServerRpc(NewDonkCityManager.localPlayerID); } } [ServerRpc(RequireOwnership = false)] private void PlayerHitWarpPipeNonRetroServerRpc(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_00ea: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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(3204761410u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3204761410u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerWithID = NewDonkCityManager.GetPlayerWithID(playerID); if ((Object)(object)playerWithID == (Object)null) { return; } Vector3 position = ((Component)playerWithID).transform.position; Quaternion rotation = Quaternion.Euler(((Component)playerWithID).transform.eulerAngles); int num = prefabIndex; GameObject val3 = PropsManager.SpawnGenericPlayerMover(position, rotation, null, default(Vector3), num); if (!((Object)(object)val3 == (Object)null)) { NetworkObject component = val3.GetComponent(); if (!((Object)(object)component == (Object)null)) { PlayerHitWarpPipeClientRpc(playerID, NetworkObjectReference.op_Implicit(component), firstEnter: true); } } } [ServerRpc(RequireOwnership = false)] private void PlayerHitWarpPipeServerRpc(int playerID, NetworkObjectReference moverNOR) { //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(1563489160u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moverNOR, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1563489160u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerHitWarpPipeClientRpc(playerID, moverNOR, firstEnter: false); } } } [ClientRpc] private void PlayerHitWarpPipeClientRpc(int playerID, NetworkObjectReference moverNOR, bool firstEnter) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1095829634u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref moverNOR, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref firstEnter, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1095829634u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref moverNOR)).TryGet(ref val3, (NetworkManager)null)) { PlayerHitWarpPipe(NewDonkCityManager.GetPlayerWithID(playerID), ((Component)val3).gameObject, firstEnter); } } } private void PlayerHitWarpPipe(PlayerControllerB player, GameObject container, bool firstEnter) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)container == (Object)null) { return; } Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId}: PlayerHitWarpPipe({player})"); RetroCharacterController component = container.GetComponent(); if (!((Object)(object)component == (Object)null)) { GenericManager.PlaySFXAtLocation(warpSource.position, warpEnterSFX, audible: true, 20f, 1f, 0f, 0f, (Object)(object)player == (Object)(object)NewDonkCityManager.localPlayer); ((MonoBehaviour)this).StartCoroutine(TemporarilyDisableCollision(movePlayerIntoPipe.moveOverTime + 0.1f)); movePlayerIntoPipe.StartMovingObjectToPointNoSync(container); if (firstEnter) { component.OnStartPipeAnimationNonRetro(player); } else { component.OnStartPipeAnimation(); } } } public void OnMovedIntoPipe(GameObject spawnedMover) { if (!((Object)(object)linkedToPipe == (Object)null)) { Logger.LogDebug((object)$"{this} #{((NetworkBehaviour)this).NetworkObjectId} linking to {linkedToPipe} #{((NetworkBehaviour)linkedToPipe).NetworkObjectId}"); linkedToPipe.Enter2DZoneFromOtherWarpPipe(this, spawnedMover); } } private void Enter2DZoneFromOtherWarpPipe(WarpPipe fromPipe, GameObject container) { //IL_0033: 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_008c: 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_00b6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)container == (Object)null) { return; } ((MonoBehaviour)this).StartCoroutine(TemporarilyDisableCollision(0.5f)); RetroCharacterController component = container.GetComponent(); if ((Object)(object)component == (Object)null) { return; } GenericManager.PlaySFXAtLocation(warpSource.position, warpExitSFX, audible: true, 20f, 1f, 0f, 0f, (Object)(object)component.controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer); container.transform.position = warpSource.position; container.transform.eulerAngles = new Vector3(container.transform.eulerAngles.x, ((Component)this).transform.eulerAngles.y, container.transform.eulerAngles.z); if ((Object)(object)component.controllingPlayer == (Object)(object)NewDonkCityManager.localPlayer) { launchPlayerOut.BounceLocalPlayerOff(); } if (!((Object)(object)fromPipe == (Object)null) && !((Object)(object)toAndFrom2DZone == (Object)null)) { if (fromPipe.isEntranceTo2DZone) { toAndFrom2DZone.Enter2DZone(container); } else if (((NetworkBehaviour)component).IsOwner) { component.OnExitRetroZone(sync: true, 1); } } } private IEnumerator TemporarilyDisableCollision(float time) { ownCollider.enabled = false; yield return (object)new WaitForSeconds(time); ownCollider.enabled = true; } 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 ((NetworkBehaviour)this).__registerRpc(3204761410u, new RpcReceiveHandler(__rpc_handler_3204761410), "PlayerHitWarpPipeNonRetroServerRpc"); ((NetworkBehaviour)this).__registerRpc(1563489160u, new RpcReceiveHandler(__rpc_handler_1563489160), "PlayerHitWarpPipeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1095829634u, new RpcReceiveHandler(__rpc_handler_1095829634), "PlayerHitWarpPipeClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3204761410(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; ((WarpPipe)(object)target).PlayerHitWarpPipeNonRetroServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1563489160(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 moverNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moverNOR, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WarpPipe)(object)target).PlayerHitWarpPipeServerRpc(playerID, moverNOR); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1095829634(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); NetworkObjectReference moverNOR = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref moverNOR, default(ForNetworkSerializable)); bool firstEnter = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref firstEnter, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WarpPipe)(object)target).PlayerHitWarpPipeClientRpc(playerID, moverNOR, firstEnter); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "WarpPipe"; } } internal class HarmonyPatches { [HarmonyPatch(typeof(NetworkManager))] public class NewDonkCityPatches { [HarmonyPostfix] [HarmonyPatch("SetSingleton")] public static void SetSingleton_Postfix() { for (int i = 0; i < Plugin.ndcAllAssets.allNetworkPrefabs.Length; i++) { GameObject val = Plugin.ndcAllAssets.allNetworkPrefabs[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val.GetComponent() == (Object)null)) { NetworkManager.Singleton.AddNetworkPrefab(val); } } } } [HarmonyPatch(typeof(StartOfRound))] public class NewDonkCityPatches_StartOfRound { [HarmonyPostfix] [HarmonyPatch("Awake")] public static void Awake_Postfix() { if ((Object)(object)NetworkManager.Singleton != (Object)null && (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)) { GameObject val = Plugin.ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/Prefabs/ManagerPrefabs/GenericManager.prefab"); if ((Object)(object)val != (Object)null) { GameObject val2 = Object.Instantiate(val); if ((Object)(object)val2 != (Object)null) { NetworkObject component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(false); } } } } if (!((Object)(object)StartOfRound.Instance == (Object)null)) { if (Application.isEditor) { Logger.LogDebug((object)$"Awake() on {StartOfRound.Instance}"); } SetUpData.AddLevelToStartOfRound(); SetUpData.ReplaceItemsInLevel(); SetUpData.ReplaceEnemiesInLevel(); SetUpData.ReplaceIndoorHazardsInLevel(); SetUpData.SetUpLevelAmbienceLibrary(); SetUpData.AddItemsToItemsList(); } } [HarmonyPostfix] [HarmonyPatch("Start")] public static void Start_Postfix() { CrossModEasterEggs.LCPlaylistsModCompatibility(); } [HarmonyPostfix] [HarmonyPatch("EndPlayersFiredSequenceClientRpc")] public static void EndPlayersFiredSequenceClientRpc_Postfix() { if (!((Object)(object)GameNetworkManager.Instance == (Object)null) && NewDonkCityManager.localPlayerServer) { Plugin.DeleteSaveDataFull(GameNetworkManager.Instance.saveFileNum); } } [HarmonyPrefix] [HarmonyPatch("ShipHasLeft")] public static void ShipHasLeft_Prefix() { if (!((Object)(object)PropsManager.Instance == (Object)null)) { PropsManager.Instance.OnDayEndServer(); } } } [HarmonyPatch(typeof(StartMatchLever))] public class NewDonkCityPatches_StartMatchLever { [HarmonyPostfix] [HarmonyPatch("PullLeverAnim")] public static void PullLeverAnim_Postfix(StartMatchLever __instance) { if (!((Object)(object)__instance == (Object)null) && __instance.leverHasBeenPulled && !((Object)(object)GenericManager.Instance == (Object)null)) { GenericManager.Instance.SyncPreLevelGenerate(); } } } [HarmonyPatch(typeof(Terminal))] public class NewDonkCityPatches_Terminal { [HarmonyPostfix] [HarmonyPatch("Start")] public static void Start_Postfix(Terminal __instance) { if (!((Object)(object)__instance == (Object)null)) { if (Application.isEditor) { Logger.LogDebug((object)$"Start() on {__instance}"); } SetUpData.AddMoonToTerminal(__instance); SetUpData.AddKeywordsToTerminal(__instance); SetUpData.AddNodesToTerminal(__instance); SetUpData.AddCompatibleNounToRoute(__instance); } } [HarmonyPrefix] [HarmonyPatch("OnSubmit")] public static void OnSubmit_Postfix(Terminal __instance) { string text = __instance.currentText.Substring(__instance.currentText.Length - __instance.textAdded).ToLower(); if (!text.StartsWith("ndcd ")) { return; } text = text.Remove(0, 5); Logger.LogDebug((object)("doing debug things: \"" + text + "\"")); if (text.StartsWith("w ")) { text = text.Remove(0, 2); int result = -1; if (int.TryParse(text, out result)) { GenericManager.SetLevelWeather(result); } } } } [HarmonyPatch(typeof(PlayerControllerB))] public class NewDonkCityPatches_PlayerControllerB { [HarmonyPostfix] [HarmonyPatch("ConnectClientToPlayerObject")] public static void ConnectClientToPlayerObject_Postfix(PlayerControllerB __instance) { NewDonkCityManager.GetLocalPlayerControllerB(); NewDonkCityManager.SetParameterScrapSpawn(1f, 1f, mustBeServer: false); NewDonkCityManager.SetParameterSizeMultiplier(1f, mustbeServer: false); } [HarmonyPostfix] [HarmonyPatch("CheckConditionsForSinkingInQuicksand")] public static void CheckConditionsForSinkingInQuicksand_Postfix(PlayerControllerB __instance, ref bool __result) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Invalid comparison between Unknown and I4 if (__result || (Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel || (Object)(object)__instance == (Object)null || __instance.isInsideFactory || (Object)(object)__instance != (Object)(object)StartOfRound.Instance.localPlayerController) { return; } if (__instance.isUnderwater) { if (Application.isEditor) { Logger.LogDebug((object)"CheckConditionsForSinkingInQuicksand overwriting __result: A"); } __result = true; } else { if ((int)StartOfRound.Instance.currentLevel.currentWeather != 4 || StartOfRound.Instance.footstepSurfaces[__instance.currentFootstepSurfaceIndex] == null) { return; } switch (StartOfRound.Instance.footstepSurfaces[__instance.currentFootstepSurfaceIndex].surfaceTag) { case "Concrete": case "Catwalk": case "Wood": case "Carpet": if (Application.isEditor) { Logger.LogDebug((object)"CheckConditionsForSinkingInQuicksand overwriting __result: B"); } __result = true; break; } } } [HarmonyPostfix] [HarmonyPatch("Jump_performed")] public static void Jump_performed_Postfix(PlayerControllerB __instance) { WallJumpPanel.LocalPlayerPressedJump(__instance); } } [HarmonyPatch(typeof(HUDManager))] public class NewDonkCityPatches_HUDManager { [HarmonyPostfix] [HarmonyPatch("DisplayNewDeadline")] public static void DisplayNewDeadline_Postfix() { if (!((Object)(object)GameNetworkManager.Instance == (Object)null) && NewDonkCityManager.localPlayerServer) { Plugin.DeleteSaveDataMidGame(GameNetworkManager.Instance.saveFileNum); } } } [HarmonyPatch(typeof(SprayPaintItem))] public class NewDonkCityPatches_SprayPaintItem { [HarmonyPostfix] [HarmonyPatch("StartSpraying")] public static void StartSpraying_Postfix(SprayPaintItem __instance) { SeedPot.LocalPlayerUseWeedKiller(__instance); } [HarmonyPostfix] [HarmonyPatch("TrySpraying")] public static void AddSprayPaintLocal_Postfix(SprayPaintItem __instance) { ColoredLetter.LocalPlayerUseSprayPaint(__instance); } } [HarmonyPatch(typeof(BoomboxItem))] public class NewDonkCityPatches_BoomboxItem { [HarmonyPostfix] [HarmonyPatch("ItemActivate")] public static void ItemActivate_Postfix(BoomboxItem __instance) { GeneralCollisionBounds.ItemActivatedInsideBounds((GrabbableObject)(object)__instance); } } [HarmonyPatch(typeof(NoisemakerProp))] public class NewDonkCityPatches_NoisemakerProp { [HarmonyPostfix] [HarmonyPatch("ItemActivate")] public static void ItemActivate_Postfix(NoisemakerProp __instance) { GeneralCollisionBounds.ItemActivatedInsideBounds((GrabbableObject)(object)__instance); } } [HarmonyPatch(typeof(SandWormAI))] public class NewDonkCityPatches_SandWormAI { [HarmonyPrefix] [HarmonyPatch("StartEmergeAnimation")] public static bool StartEmergeAnimation_Prefix(SandWormAI __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel) { return true; } Intercept_SandWormAI_StartEmergeAnimation(__instance); return false; } private static void Intercept_SandWormAI_StartEmergeAnimation(SandWormAI worm) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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) //IL_01b5: 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_00a6: 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_00b0: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: 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_021f: 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) if (!((NetworkBehaviour)worm).IsServer) { return; } ((Behaviour)((EnemyAI)worm).agent).enabled = false; worm.inEmergingState = true; ((EnemyAI)worm).inSpecialAnimation = true; bool flag = false; RoundManager.Instance.tempTransform.eulerAngles = new Vector3(0f, 0f, 0f); int num = Random.Range(3, 7); RaycastHit val2 = default(RaycastHit); for (int i = 0; i < num; i++) { ((Component)worm).transform.eulerAngles = new Vector3(0f, RoundManager.Instance.tempTransform.eulerAngles.y, 0f); for (int j = 0; j < worm.airPathNodes.Length - 1; j++) { Vector3 val = worm.airPathNodes[j + 1].position - worm.airPathNodes[j].position; if (Physics.SphereCast(worm.airPathNodes[j].position, 5f, val, ref val2, ((Vector3)(ref val)).magnitude, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && (((Component)((RaycastHit)(ref val2)).collider).CompareTag("Concrete") || ((Component)((RaycastHit)(ref val2)).collider).CompareTag("Rock") || ((Component)((RaycastHit)(ref val2)).collider).CompareTag("Grass") || ((Component)((RaycastHit)(ref val2)).collider).CompareTag("Gravel"))) { flag = true; } } if (flag) { break; } RoundManager.Instance.tempTransform.eulerAngles = new Vector3(0f, RoundManager.Instance.tempTransform.eulerAngles.y + 360f / (float)num, 0f); } if (flag) { if (Physics.Raycast(worm.endingPosition.position + Vector3.up * 50f, Vector3.down, ref val2, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { worm.endOfFlightPathPosition = RoundManager.Instance.GetNavMeshPosition(((RaycastHit)(ref val2)).point, worm.navHit, 8f, ((EnemyAI)worm).agent.areaMask); if (!RoundManager.Instance.GotNavMeshPositionResult) { worm.endOfFlightPathPosition = RoundManager.Instance.GetClosestNode(((RaycastHit)(ref val2)).point, true).position; } worm.EmergeServerRpc((int)((Component)worm).transform.eulerAngles.y); } else { flag = false; } } if (!flag) { ((Behaviour)((EnemyAI)worm).agent).enabled = true; worm.inEmergingState = false; ((EnemyAI)worm).inSpecialAnimation = false; } } } [HarmonyPatch(typeof(PumaAI))] public class NewDonkCityPatches_PumaAI { [HarmonyPostfix] [HarmonyPatch("StartLeapToTree")] public static void StartLeapToTree_Postfix(PumaAI __instance, bool __result) { if (__result && !((Object)(object)__instance == (Object)null) && !((Object)(object)StartOfRound.Instance == (Object)null) && !((Object)(object)StartOfRound.Instance.currentLevel != (Object)(object)Plugin.ndcSelectableLevel)) { Intercept_PumaAI_StartLeapToTree(__instance); } } private static void Intercept_PumaAI_StartLeapToTree(PumaAI puma) { //IL_0054: 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_008f: 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_00a9: 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_00b8: 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) if (!((Object)(object)puma.TargetTree == (Object)null) && !((Object)(object)puma.TargetTree.GetComponent() == (Object)null)) { Plugin.Logger.LogDebug((object)$"{puma} #{((NetworkBehaviour)puma).NetworkObjectId}: {puma.TargetTree}"); puma.treeClingRotation = puma.TargetTree.transform.eulerAngles.y; puma.clingIdlePosition = new Vector3(puma.TargetTree.transform.position.x, puma.clingIdlePosition.y, puma.TargetTree.transform.position.z) + puma.TargetTree.transform.forward * -1f; } } } [HarmonyPatch(typeof(DeleteFileButton))] public class NewDonkCityPatches_DeleteFileButton { [HarmonyPostfix] [HarmonyPatch("DeleteFile")] public static void DeleteFile_Postfix(DeleteFileButton __instance) { if (!((Object)(object)__instance == (Object)null)) { Plugin.DeleteSaveDataFull(__instance.fileToDelete); } } } [HarmonyPatch(typeof(GameNetworkManager), "Disconnect")] public class NewGameNetworkManagerDisconnect { [HarmonyPrefix] public static void DisconnectPostfix() { if ((Object)(object)NewDonkCityManager.localPlayer == (Object)null || !NewDonkCityManager.localPlayer.isHostPlayerObject) { Plugin.Logger.LogDebug((object)"null or client, returning"); } else { Plugin.SaveSaveData(); } } } private static ManualLogSource Logger; } internal class SceneManagerPatches { [HarmonyPatch(typeof(NetworkSceneManager))] public class NewDonkCityPatches_NetworkSceneManager { [HarmonyPostfix] [HarmonyPatch("GenerateScenesInBuild")] public static void GenerateScenesInBuild_Postfix(NetworkSceneManager __instance) { if (!CrossModEasterEggs.compatibilityLethalLevelLoader) { AddSceneToBuild(__instance); } else { LLLCompatibilityFixer.SpawnFrameDelaySceneFixer(__instance); } } [HarmonyPrefix] [HarmonyPatch("SceneNameFromHash")] public static void SceneNameFromHash_Prefix(ref uint sceneHash, out bool __state) { __state = sceneHash == assignedHash; if (__state) { sceneHash = 0u; } } [HarmonyPostfix] [HarmonyPatch("SceneNameFromHash")] public static void SceneNameFromHash_Postfix(ref string __result, bool __state) { if (__result != assignedScenePath && __state) { __result = assignedScenePath; } } } [HarmonyPatch(typeof(SceneUtility))] public class NewDonkCityPatches_SceneUtility { [HarmonyPostfix] [HarmonyPatch("GetBuildIndexByScenePath")] public static void GetBuildIndexByScenePath_Postfix(ref int __result, string scenePath) { if (__result == -1 && scenePath == assignedScenePath) { __result = assignedBuildIndex; } } [HarmonyPostfix] [HarmonyPatch("GetScenePathByBuildIndex")] public static void GetScenePathByBuildIndex_Postfix(ref string __result, int buildIndex) { if (string.IsNullOrEmpty(__result) && buildIndex == assignedBuildIndex) { __result = assignedScenePath; } } } private static ManualLogSource Logger; private static string assignedScenePath; private static int assignedBuildIndex; private static uint assignedHash; public static void SetScenePath(string scenePath) { assignedScenePath = scenePath; } public static void AddSceneToBuild(NetworkSceneManager sceneManager) { assignedBuildIndex = sceneManager.HashToBuildIndex.Count; assignedHash = XXHash.Hash32(assignedScenePath); Logger.LogInfo((object)$"assignedBuildIndex = {assignedBuildIndex} // assignedHash: {assignedHash} // assignedScenePath: {assignedScenePath}"); sceneManager.HashToBuildIndex.Add(assignedHash, assignedBuildIndex); sceneManager.BuildIndexToHash.Add(assignedBuildIndex, assignedHash); } } [BepInPlugin("local.SimonTendo.LCNewDonkCityMod", "LCNewDonkCityMod", "0.8.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle ndcBundleAssets; public static SelectableLevel ndcSelectableLevel; public static AllAssets ndcAllAssets; private void Awake() { //IL_010b: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin LCNewDonkCityMod is loaded!"); ndcBundleAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ndcassets")); if ((Object)(object)ndcBundleAssets == (Object)null) { Logger.LogError((object)"Failed to load NewDonkCity AssetBundle"); return; } if ((Object)(object)AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ndcscene")) == (Object)null) { Logger.LogError((object)"Failed to load NewDonkCity Scene"); return; } ndcSelectableLevel = ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ScriptableObjects/SelectableLevel/SelectableLevelNewDonkCity.asset"); if ((Object)(object)ndcSelectableLevel == (Object)null) { Logger.LogError((object)"Failed to load NewDonkCity SelectableLevel"); return; } ndcAllAssets = ndcBundleAssets.LoadAsset("Assets/LCNewDonkCityMod/ScriptableObjects/AllAssets.asset"); if ((Object)(object)ndcAllAssets == (Object)null) { Logger.LogError((object)"Failed to load NewDonkCity AllAssets"); return; } Logger.LogDebug((object)"Successfully loaded AssetBundles and AllAssets"); SendLoggers(); new Harmony("LCNewDonkCityMod").PatchAll(); SceneManagerPatches.SetScenePath(ndcSelectableLevel.sceneName); LoadSaveData(); GetModCompatibility(); } private static void SendLoggers() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); foreach (Type type in types) { FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType == typeof(ManualLogSource)) { fieldInfo.SetValue(type, Logger); } } } } 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 SaveSaveData() { new SaveDataManager.SaveData().Save(); } private static void LoadSaveData() { new SaveDataManager.SaveData().Load(); PropsManager.LoadSaveDataOnModAwake(); } public static void DeleteSaveDataFull(int saveFileNum) { PropsManager.RemoveCollectTypesFromDictionary(new CoinContainer.CollectableType[2] { CoinContainer.CollectableType.PerQuota, CoinContainer.CollectableType.OnlyOnce }, saveFileNum, deleteFromSaveData: false); for (int i = 0; i < SaveDataManager.allKeys.Length; i++) { SaveDataManager.DeleteSavedData(saveFileNum, SaveDataManager.allKeys[i]); } SaveSaveData(); } public static void DeleteSaveDataMidGame(int saveFileNum) { PropsManager.RemoveCollectTypesFromDictionary(new CoinContainer.CollectableType[1] { CoinContainer.CollectableType.PerQuota }, saveFileNum); } private static void GetModCompatibility() { CrossModEasterEggs.compatibilityPlaylistsMod = CheckForPlugin("LCSimonTendoPlaylistsMod"); CrossModEasterEggs.compatibilityCrashBandicootCrates = CheckForPlugin("LCCrashBandicootCratesMod"); CrossModEasterEggs.compatibilityLethalLevelLoader = CheckForPlugin("LethalLevelLoader"); CrossModEasterEggs.LCCrashBandicootCratesMod(); } 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; } } internal class SetUpData { private static ManualLogSource Logger; private static List setUpMethodIDs = new List(); private static bool CanSetUpStaticFunctionality(int methodID) { if (setUpMethodIDs != null && setUpMethodIDs.Contains(methodID)) { return false; } setUpMethodIDs.Add(methodID); return true; } public static void AddLevelToStartOfRound() { if (!((Object)(object)StartOfRound.Instance == (Object)null)) { List list = StartOfRound.Instance.levels.ToList(); Plugin.ndcSelectableLevel.levelID = StartOfRound.Instance.levels.Length; list.Add(Plugin.ndcSelectableLevel); StartOfRound.Instance.levels = list.ToArray(); } } public static void ReplaceItemsInLevel() { if (!CanSetUpStaticFunctionality(0) || (Object)(object)StartOfRound.Instance == (Object)null) { return; } Dictionary dictionary = new Dictionary(); int num = 12; for (int i = 0; i < num; i++) { SelectableLevel val = StartOfRound.Instance.levels[i]; if ((Object)(object)val == (Object)null) { continue; } List spawnableScrap = val.spawnableScrap; if (spawnableScrap == null || spawnableScrap.Count == 0) { continue; } for (int j = 0; j < spawnableScrap.Count; j++) { SpawnableItemWithRarity val2 = spawnableScrap[j]; if (val2 != null && !((Object)(object)val2.spawnableItem == (Object)null) && !((Object)val2.spawnableItem).name.Contains("NDCReplaceAtRuntime_") && !dictionary.ContainsKey(((Object)val2.spawnableItem).name)) { dictionary.Add(((Object)val2.spawnableItem).name, val2.spawnableItem); } } } if (dictionary.Count == 0) { Logger.LogWarning((object)"found no replacements for: ITEMS"); return; } List allItems = Plugin.ndcAllAssets.allItems; for (int k = 0; k < allItems.Count; k++) { SpawnableItemWithRarity val3 = allItems[k]; if (val3 == null || (Object)(object)val3.spawnableItem == (Object)null || !((Object)val3.spawnableItem).name.Contains("NDCReplaceAtRuntime_")) { continue; } string key = ((Object)val3.spawnableItem).name.Replace("NDCReplaceAtRuntime_", null); if (dictionary.TryGetValue(key, out var value)) { allItems[k].spawnableItem = value; if (Application.isEditor) { Logger.LogDebug((object)$"replaced to {allItems[k].spawnableItem}"); } } else { Logger.LogError((object)$"error replacing ITEM: {val3}"); } } Plugin.ndcSelectableLevel.spawnableScrap = allItems; } public static void ReplaceEnemiesInLevel() { if (!CanSetUpStaticFunctionality(1) || (Object)(object)StartOfRound.Instance == (Object)null) { return; } Dictionary dictionary = new Dictionary(); int num = 12; for (int i = 0; i < num; i++) { SelectableLevel val = StartOfRound.Instance.levels[i]; if ((Object)(object)val == (Object)null) { continue; } for (int j = 0; j < 3; j++) { List list = val.Enemies; switch (j) { case 1: list = val.OutsideEnemies; break; case 2: list = val.DaytimeEnemies; break; } if (list == null || list.Count == 0) { continue; } for (int k = 0; k < list.Count; k++) { SpawnableEnemyWithRarity val2 = list[k]; if (val2 != null && !((Object)(object)val2.enemyType == (Object)null) && !((Object)val2.enemyType).name.Contains("NDCReplaceAtRuntime_") && !dictionary.ContainsKey(((Object)val2.enemyType).name)) { dictionary.Add(((Object)val2.enemyType).name, val2.enemyType); } } } } if (dictionary.Count == 0) { Logger.LogWarning((object)"found no replacements for: ENEMIES"); return; } for (int l = 0; l < 3; l++) { List list2 = Plugin.ndcAllAssets.allEnemies; switch (l) { case 1: list2 = Plugin.ndcAllAssets.allOutsideEnemies; break; case 2: list2 = Plugin.ndcAllAssets.allDaytimeEnemies; break; } for (int m = 0; m < list2.Count; m++) { SpawnableEnemyWithRarity val3 = list2[m]; if (val3 == null || (Object)(object)val3.enemyType == (Object)null || !((Object)val3.enemyType).name.Contains("NDCReplaceAtRuntime_")) { continue; } string key = ((Object)val3.enemyType).name.Replace("NDCReplaceAtRuntime_", null); if (dictionary.TryGetValue(key, out var value)) { list2[m].enemyType = value; if (Application.isEditor) { Logger.LogDebug((object)$"replaced to {list2[m].enemyType}"); } } else { Logger.LogError((object)$"error replacing ENEMY: {val3}"); } } switch (l) { case 0: Plugin.ndcSelectableLevel.Enemies = list2; break; case 1: Plugin.ndcSelectableLevel.OutsideEnemies = list2; break; case 2: Plugin.ndcSelectableLevel.DaytimeEnemies = list2; break; } } } public static void ReplaceIndoorHazardsInLevel() { if (!CanSetUpStaticFunctionality(2) || (Object)(object)StartOfRound.Instance == (Object)null) { return; } Dictionary dictionary = new Dictionary(); int num = 12; for (int i = 0; i < num; i++) { SelectableLevel val = StartOfRound.Instance.levels[i]; if ((Object)(object)val == (Object)null || val.indoorMapHazards == null || val.indoorMapHazards.Length == 0) { continue; } for (int j = 0; j < val.indoorMapHazards.Length; j++) { if (val.indoorMapHazards[j] != null) { IndoorMapHazardType hazardType = val.indoorMapHazards[j].hazardType; if (!((Object)(object)hazardType == (Object)null) && !((Object)hazardType).name.Contains("NDCReplaceAtRuntime_") && !dictionary.ContainsKey(((Object)hazardType).name)) { dictionary.Add(((Object)hazardType).name, hazardType); } } } } if (dictionary.Count == 0) { Logger.LogWarning((object)"found no replacements for: INDOOR HAZARDS"); return; } for (int k = 0; k < Plugin.ndcAllAssets.allIndoorHazards.Length; k++) { if (Plugin.ndcAllAssets.allIndoorHazards[k] == null) { continue; } IndoorMapHazardType hazardType2 = Plugin.ndcAllAssets.allIndoorHazards[k].hazardType; if ((Object)(object)hazardType2 == (Object)null || !((Object)hazardType2).name.Contains("NDCReplaceAtRuntime_")) { continue; } string key = ((Object)hazardType2).name.Replace("NDCReplaceAtRuntime_", null); if (dictionary.TryGetValue(key, out var value)) { Plugin.ndcAllAssets.allIndoorHazards[k].hazardType = value; if (Application.isEditor) { Logger.LogDebug((object)$"replaced to {Plugin.ndcAllAssets.allIndoorHazards[k].hazardType}"); } } else { Logger.LogError((object)$"error replacing INDOOR HAZARD: {hazardType2}"); } } Plugin.ndcSelectableLevel.indoorMapHazards = Plugin.ndcAllAssets.allIndoorHazards; } public static void SetUpLevelAmbienceLibrary() { if (CanSetUpStaticFunctionality(3) && !((Object)(object)StartOfRound.Instance == (Object)null) && StartOfRound.Instance.levels != null && StartOfRound.Instance.levels.Length != 0 && !((Object)(object)StartOfRound.Instance.levels[0] == (Object)null) && !((Object)(object)StartOfRound.Instance.levels[0].levelAmbienceClips == (Object)null)) { Plugin.ndcSelectableLevel.levelAmbienceClips.insanityMusicAudios = StartOfRound.Instance.levels[0].levelAmbienceClips.insanityMusicAudios; Plugin.ndcSelectableLevel.levelAmbienceClips.insideAmbience = StartOfRound.Instance.levels[0].levelAmbienceClips.insideAmbience; Plugin.ndcSelectableLevel.levelAmbienceClips.insideAmbienceInsanity = StartOfRound.Instance.levels[0].levelAmbienceClips.insideAmbienceInsanity; } } public static void AddItemsToItemsList() { if (CanSetUpStaticFunctionality(4) && !((Object)(object)StartOfRound.Instance == (Object)null) && !((Object)(object)StartOfRound.Instance.allItemsList == (Object)null) && StartOfRound.Instance.allItemsList.itemsList != null) { StartOfRound.Instance.allItemsList.itemsList.AddRange(Plugin.ndcAllAssets.allGrabbableObjects); } } public static void AddMoonToTerminal(Terminal terminalScript) { if ((Object)(object)terminalScript == (Object)null || terminalScript.moonsCatalogueList == null || (Object)(object)terminalScript.terminalNodes == (Object)null || terminalScript.terminalNodes.allKeywords == null) { return; } List list = terminalScript.moonsCatalogueList.ToList(); list.Add(Plugin.ndcSelectableLevel); terminalScript.moonsCatalogueList = list.ToArray(); if (!CanSetUpStaticFunctionality(5)) { return; } TerminalNode val = null; for (int i = 0; i < terminalScript.terminalNodes.allKeywords.Length; i++) { TerminalKeyword val2 = terminalScript.terminalNodes.allKeywords[i]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.specialKeywordResult == (Object)null) && val2.word == "moons" && ((Object)val2.specialKeywordResult).name == "MoonsCatalogue" && val2.specialKeywordResult.displayText.Contains("Welcome to the exomoons catalogue.")) { val = val2.specialKeywordResult; break; } } if ((Object)(object)val == (Object)null) { Logger.LogError((object)"failed to find moon catalogue"); } else { val.displayText = val.displayText.Replace("* Titan [planetTime]", "* Titan [planetTime]\n\n* New Donk City [planetTime]"); } } public static void AddNodesToTerminal(Terminal terminalScript) { if (!CanSetUpStaticFunctionality(6) || (Object)(object)terminalScript == (Object)null) { return; } for (int i = 0; i < Plugin.ndcAllAssets.allTerminalNodes.Length; i++) { TerminalNode val = Plugin.ndcAllAssets.allTerminalNodes[i]; string name = ((Object)val).name; if (!(name == "RouteNewDonkCity")) { if (name == "RouteNewDonkCityConfirm") { val.buyRerouteToMoon = Plugin.ndcSelectableLevel.levelID; } } else { val.displayPlanetInfo = Plugin.ndcSelectableLevel.levelID; } SearchNodeForReplacements(terminalScript, val); } } public static void AddKeywordsToTerminal(Terminal terminalScript) { if (CanSetUpStaticFunctionality(7) && !((Object)(object)terminalScript == (Object)null)) { List list = terminalScript.terminalNodes.allKeywords.ToList(); for (int i = 0; i < Plugin.ndcAllAssets.allTerminalKeywords.Length; i++) { TerminalKeyword val = Plugin.ndcAllAssets.allTerminalKeywords[i]; list.Add(val); SearchKeywordForReplacements(terminalScript, val); } terminalScript.terminalNodes.allKeywords = list.ToArray(); } } public static void AddCompatibleNounToRoute(Terminal terminalScript) { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown if (!CanSetUpStaticFunctionality(8) || (Object)(object)terminalScript == (Object)null || (Object)(object)terminalScript.terminalNodes == (Object)null || terminalScript.terminalNodes.specialNodes == null) { return; } TerminalKeyword val = null; for (int i = 0; i < terminalScript.terminalNodes.allKeywords.Length; i++) { TerminalKeyword val2 = terminalScript.terminalNodes.allKeywords[i]; if ((Object)(object)val2 != (Object)null && ((Object)val2).name == "Route" && val2.word == "route") { val = val2; break; } } if (!((Object)(object)val == (Object)null)) { TerminalKeyword val3 = Plugin.ndcAllAssets.allTerminalKeywords[0]; TerminalNode val4 = Plugin.ndcAllAssets.allTerminalNodes[0]; if (!((Object)(object)val3 == (Object)null) && !(((Object)val3).name != "RouteNewDonkCity") && !((Object)(object)val4 == (Object)null) && !(((Object)val4).name != "RouteNewDonkCity")) { List list = val.compatibleNouns.ToList(); list.Add(new CompatibleNoun(val3, val4)); val.compatibleNouns = list.ToArray(); } } } private static void SearchNodeForReplacements(Terminal terminalScript, TerminalNode searchNode) { if ((Object)(object)searchNode == (Object)null || searchNode.terminalOptions == null || searchNode.terminalOptions.Length == 0) { return; } for (int i = 0; i < searchNode.terminalOptions.Length; i++) { CompatibleNoun val = searchNode.terminalOptions[i]; if (val != null) { if (ShouldKeywordBeReplaced(val.noun)) { val.noun = LookForKeywordOriginal(terminalScript, val.noun); } if (ShouldNodeBeReplaced(val.result)) { val.result = LookForNodeOriginal(terminalScript, val.result); } } } } private static bool ShouldNodeBeReplaced(TerminalNode nodeInQuestion) { if ((Object)(object)nodeInQuestion == (Object)null) { return false; } if (((Object)nodeInQuestion).name.StartsWith("NDCReplaceAtRuntime_")) { return true; } return false; } private static TerminalNode LookForNodeOriginal(Terminal terminal, TerminalNode replaceNode) { if ((Object)(object)terminal == (Object)null || (Object)(object)terminal.terminalNodes == (Object)null || terminal.terminalNodes.specialNodes == null || (Object)(object)replaceNode == (Object)null) { return null; } string text = ((Object)replaceNode).name.Replace("NDCReplaceAtRuntime_", null); for (int i = 0; i < terminal.terminalNodes.specialNodes.Count; i++) { TerminalNode val = terminal.terminalNodes.specialNodes[i]; if (!((Object)(object)val == (Object)null) && ((Object)val).name == text) { return val; } } return null; } private static void SearchKeywordForReplacements(Terminal terminalScript, TerminalKeyword searchKeyword) { if (!((Object)(object)searchKeyword == (Object)null)) { if (ShouldNodeBeReplaced(searchKeyword.specialKeywordResult)) { searchKeyword.specialKeywordResult = LookForNodeOriginal(terminalScript, searchKeyword.specialKeywordResult); } if (ShouldKeywordBeReplaced(searchKeyword.defaultVerb)) { searchKeyword.defaultVerb = LookForKeywordOriginal(terminalScript, searchKeyword.defaultVerb); } } } private static bool ShouldKeywordBeReplaced(TerminalKeyword keywordInQuestion) { if ((Object)(object)keywordInQuestion == (Object)null) { return false; } if (((Object)keywordInQuestion).name.StartsWith("NDCReplaceAtRuntime_")) { return true; } return false; } private static TerminalKeyword LookForKeywordOriginal(Terminal terminal, TerminalKeyword replaceKeyword) { if ((Object)(object)terminal == (Object)null || (Object)(object)terminal.terminalNodes == (Object)null || terminal.terminalNodes.allKeywords == null || (Object)(object)replaceKeyword == (Object)null) { return null; } string text = ((Object)replaceKeyword).name.Replace("NDCReplaceAtRuntime_", null); for (int i = 0; i < terminal.terminalNodes.specialNodes.Count; i++) { TerminalKeyword val = terminal.terminalNodes.allKeywords[i]; if (!((Object)(object)val == (Object)null) && ((Object)val).name == text) { return val; } } return 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[5704] { 0, 0, 0, 1, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 65, 108, 108, 65, 115, 115, 101, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 68, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 92, 67, 114, 111, 115, 115, 77, 111, 100, 69, 97, 115, 116, 101, 114, 69, 103, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 71, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 92, 76, 76, 76, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 70, 105, 120, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 62, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 65, 101, 115, 116, 104, 101, 116, 105, 99, 115, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 64, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 111, 110, 100, 105, 116, 105, 111, 110, 97, 108, 115, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 70, 101, 115, 116, 105, 118, 97, 108, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 71, 101, 110, 101, 114, 105, 99, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 77, 111, 111, 110, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 78, 80, 67, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 80, 114, 111, 112, 115, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 83, 97, 118, 101, 68, 97, 116, 97, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 83, 111, 110, 103, 115, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 52, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 67, 111, 110, 100, 105, 116, 105, 111, 110, 97, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 65, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 67, 117, 115, 116, 111, 109, 68, 97, 109, 97, 103, 101, 80, 108, 97, 121, 101, 114, 83, 99, 114, 105, 112, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 49, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 68, 111, 103, 83, 116, 97, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 68, 121, 110, 97, 109, 105, 99, 77, 97, 116, 101, 114, 105, 97, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 69, 118, 101, 110, 116, 77, 101, 115, 115, 101, 110, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 71, 101, 110, 101, 114, 97, 108, 67, 111, 108, 108, 105, 115, 105, 111, 110, 66, 111, 117, 110, 100, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 71, 105, 118, 101, 73, 110, 116, 101, 114, 97, 99, 116, 97, 98, 108, 101, 73, 99, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 73, 65, 115, 115, 101, 116, 82, 101, 99, 101, 105, 118, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 73, 72, 105, 116, 98, 111, 120, 77, 97, 105, 110, 83, 99, 114, 105, 112, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 73, 80, 104, 121, 115, 105, 99, 115, 83, 101, 97, 114, 99, 104, 97, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 75, 105, 99, 107, 97, 98, 108, 101, 82, 105, 103, 105, 100, 98, 111, 100, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 76, 111, 97, 100, 101, 100, 68, 97, 116, 97, 83, 116, 97, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 51, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 76, 111, 97, 100, 69, 118, 101, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 76, 111, 99, 97, 108, 78, 101, 116, 119, 111, 114, 107, 79, 98, 106, 101, 99, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 62, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 76, 111, 99, 97, 108, 80, 108, 97, 121, 101, 114, 72, 105, 116, 83, 117, 114, 102, 97, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 54, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 77, 97, 116, 101, 114, 105, 97, 108, 65, 114, 114, 97, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 77, 111, 118, 101, 84, 111, 80, 111, 105, 110, 116, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 48, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 78, 80, 67, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 80, 108, 97, 116, 102, 111, 114, 109, 105, 110, 103, 67, 104, 97, 108, 108, 101, 110, 103, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 80, 108, 97, 121, 71, 101, 110, 101, 114, 105, 99, 83, 111, 117, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 49, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 80, 117, 109, 97, 84, 114, 101, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 53, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 82, 111, 116, 97, 116, 101, 79, 98, 106, 101, 99, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 83, 97, 118, 101, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 83, 105, 116, 65, 110, 105, 109, 97, 116, 105, 111, 110, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 83, 110, 97, 112, 80, 108, 97, 121, 101, 114, 84, 111, 80, 111, 115, 105, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 64, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 105, 115, 99, 92, 86, 111, 108, 117, 109, 101, 77, 117, 108, 116, 105, 112, 108, 105, 101, 114, 84, 114, 105, 103, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 65, 101, 115, 116, 104, 101, 116, 105, 99, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 66, 111, 117, 110, 99, 101, 83, 117, 114, 102, 97, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 67, 104, 97, 108, 108, 101, 110, 103, 101, 68, 111, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 67, 111, 105, 110, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 67, 111, 108, 111, 114, 101, 100, 76, 101, 116, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 65, 73, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 68, 105, 103, 103, 97, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 67, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 83, 116, 97, 116, 101, 65, 116, 116, 97, 99, 107, 105, 110, 103, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 65, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 83, 116, 97, 116, 101, 68, 105, 103, 103, 105, 110, 103, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 67, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 83, 116, 97, 116, 101, 70, 111, 108, 108, 111, 119, 105, 110, 103, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 62, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 68, 111, 103, 83, 116, 97, 116, 101, 73, 100, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 70, 105, 114, 101, 72, 121, 100, 114, 97, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 71, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 71, 114, 111, 117, 110, 100, 76, 105, 103, 104, 116, 82, 101, 118, 101, 97, 108, 97, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 72, 105, 116, 98, 111, 120, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 65, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 72, 105, 116, 116, 97, 98, 108, 101, 83, 112, 97, 119, 110, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 74, 111, 121, 67, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 74, 117, 109, 112, 82, 111, 112, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 76, 97, 117, 110, 99, 104, 80, 111, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 77, 111, 111, 110, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 77, 111, 118, 101, 84, 111, 80, 111, 105, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 78, 80, 67, 69, 110, 101, 109, 121, 65, 73, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 78, 80, 67, 78, 111, 100, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 79, 100, 121, 115, 115, 101, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 80, 111, 119, 101, 114, 77, 111, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 80, 83, 119, 105, 116, 99, 104, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 68, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 82, 97, 110, 100, 111, 109, 83, 105, 116, 65, 110, 105, 109, 97, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 82, 99, 67, 97, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 82, 101, 116, 114, 111, 67, 104, 97, 114, 97, 99, 116, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 99, 97, 114, 101, 99, 114, 111, 119, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 99, 101, 110, 101, 66, 71, 77, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 99, 111, 111, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 101, 101, 100, 80, 111, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 101, 101, 115, 97, 119, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 108, 105, 110, 103, 115, 104, 111, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 54, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 111, 110, 103, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 112, 97, 114, 107, 66, 97, 108, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 112, 97, 114, 107, 80, 121, 108, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 70, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 119, 105, 110, 103, 97, 98, 108, 101, 83, 116, 114, 101, 101, 116, 76, 105, 103, 104, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 66, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 83, 119, 105, 110, 103, 105, 110, 103, 83, 99, 97, 102, 102, 111, 108, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 68, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 84, 119, 111, 68, 105, 109, 101, 110, 115, 105, 111, 110, 97, 108, 90, 111, 110, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 87, 97, 108, 108, 74, 117, 109, 112, 80, 97, 110, 101, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 78, 101, 119, 32, 68, 111, 110, 107, 32, 67, 105, 116, 121, 92, 87, 97, 114, 112, 80, 105, 112, 101, 46, 99, 115, 0, 0, 0, 14, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 80, 97, 116, 99, 104, 101, 115, 92, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 63, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 80, 97, 116, 99, 104, 101, 115, 92, 83, 99, 101, 110, 101, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 42, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 80, 108, 117, 103, 105, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 76, 67, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 111, 100, 92, 83, 99, 114, 105, 112, 116, 115, 92, 83, 101, 116, 85, 112, 68, 97, 116, 97, 46, 99, 115 }, TypesData = new byte[2452] { 0, 0, 0, 0, 10, 124, 65, 108, 108, 65, 115, 115, 101, 116, 115, 0, 0, 0, 0, 19, 124, 67, 114, 111, 115, 115, 77, 111, 100, 69, 97, 115, 116, 101, 114, 69, 103, 103, 115, 0, 0, 0, 0, 22, 124, 76, 76, 76, 67, 111, 109, 112, 97, 116, 105, 98, 105, 108, 105, 116, 121, 70, 105, 120, 101, 114, 0, 0, 0, 0, 18, 124, 65, 101, 115, 116, 104, 101, 116, 105, 99, 115, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 20, 124, 67, 111, 110, 100, 105, 116, 105, 111, 110, 97, 108, 115, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 16, 124, 70, 101, 115, 116, 105, 118, 97, 108, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 15, 124, 71, 101, 110, 101, 114, 105, 99, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 12, 124, 77, 111, 111, 110, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 19, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 11, 124, 78, 80, 67, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 13, 124, 80, 114, 111, 112, 115, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 16, 124, 83, 97, 118, 101, 68, 97, 116, 97, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 26, 83, 97, 118, 101, 68, 97, 116, 97, 77, 97, 110, 97, 103, 101, 114, 124, 68, 97, 116, 97, 84, 111, 83, 97, 118, 101, 0, 0, 0, 0, 24, 83, 97, 118, 101, 68, 97, 116, 97, 77, 97, 110, 97, 103, 101, 114, 124, 83, 97, 118, 101, 68, 97, 116, 97, 0, 0, 0, 0, 13, 124, 83, 111, 110, 103, 115, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 12, 124, 67, 111, 110, 100, 105, 116, 105, 111, 110, 97, 108, 0, 0, 0, 0, 25, 124, 67, 117, 115, 116, 111, 109, 68, 97, 109, 97, 103, 101, 80, 108, 97, 121, 101, 114, 83, 99, 114, 105, 112, 116, 0, 0, 0, 0, 9, 124, 68, 111, 103, 83, 116, 97, 116, 101, 0, 0, 0, 0, 16, 124, 68, 121, 110, 97, 109, 105, 99, 77, 97, 116, 101, 114, 105, 97, 108, 0, 0, 0, 0, 15, 124, 69, 118, 101, 110, 116, 77, 101, 115, 115, 101, 110, 103, 101, 114, 0, 0, 0, 0, 23, 124, 71, 101, 110, 101, 114, 97, 108, 67, 111, 108, 108, 105, 115, 105, 111, 110, 66, 111, 117, 110, 100, 115, 0, 0, 0, 0, 21, 124, 71, 105, 118, 101, 73, 110, 116, 101, 114, 97, 99, 116, 97, 98, 108, 101, 73, 99, 111, 110, 0, 0, 0, 0, 15, 124, 73, 65, 115, 115, 101, 116, 82, 101, 99, 101, 105, 118, 101, 114, 0, 0, 0, 0, 18, 124, 73, 72, 105, 116, 98, 111, 120, 77, 97, 105, 110, 83, 99, 114, 105, 112, 116, 0, 0, 0, 0, 19, 124, 73, 80, 104, 121, 115, 105, 99, 115, 83, 101, 97, 114, 99, 104, 97, 98, 108, 101, 0, 0, 0, 0, 18, 124, 75, 105, 99, 107, 97, 98, 108, 101, 82, 105, 103, 105, 100, 98, 111, 100, 121, 0, 0, 0, 0, 16, 124, 76, 111, 97, 100, 101, 100, 68, 97, 116, 97, 83, 116, 97, 116, 101, 0, 0, 0, 0, 11, 124, 76, 111, 97, 100, 69, 118, 101, 110, 116, 115, 0, 0, 0, 0, 19, 124, 76, 111, 99, 97, 108, 78, 101, 116, 119, 111, 114, 107, 79, 98, 106, 101, 99, 116, 0, 0, 0, 0, 22, 124, 76, 111, 99, 97, 108, 80, 108, 97, 121, 101, 114, 72, 105, 116, 83, 117, 114, 102, 97, 99, 101, 0, 0, 0, 0, 14, 124, 77, 97, 116, 101, 114, 105, 97, 108, 65, 114, 114, 97, 121, 0, 0, 0, 0, 16, 124, 77, 111, 118, 101, 84, 111, 80, 111, 105, 110, 116, 68, 97, 116, 97, 0, 0, 0, 0, 8, 124, 78, 80, 67, 68, 97, 116, 97, 0, 0, 0, 0, 21, 124, 80, 108, 97, 116, 102, 111, 114, 109, 105, 110, 103, 67, 104, 97, 108, 108, 101, 110, 103, 101, 0, 0, 0, 0, 17, 124, 80, 108, 97, 121, 71, 101, 110, 101, 114, 105, 99, 83, 111, 117, 110, 100, 0, 0, 0, 0, 9, 124, 80, 117, 109, 97, 84, 114, 101, 101, 0, 0, 0, 0, 13, 124, 82, 111, 116, 97, 116, 101, 79, 98, 106, 101, 99, 116, 0, 0, 0, 0, 15, 124, 83, 97, 118, 101, 97, 98, 108, 101, 79, 98, 106, 101, 99, 116, 0, 0, 0, 0, 17, 124, 83, 105, 116, 65, 110, 105, 109, 97, 116, 105, 111, 110, 68, 97, 116, 97, 0, 0, 0, 0, 21, 124, 83, 110, 97, 112, 80, 108, 97, 121, 101, 114, 84, 111, 80, 111, 115, 105, 116, 105, 111, 110, 0, 0, 0, 0, 24, 124, 86, 111, 108, 117, 109, 101, 77, 117, 108, 116, 105, 112, 108, 105, 101, 114, 84, 114, 105, 103, 103, 101, 114, 0, 0, 0, 0, 10, 124, 65, 101, 115, 116, 104, 101, 116, 105, 99, 0, 0, 0, 0, 14, 124, 66, 111, 117, 110, 99, 101, 83, 117, 114, 102, 97, 99, 101, 0, 0, 0, 0, 14, 124, 67, 104, 97, 108, 108, 101, 110, 103, 101, 68, 111, 111, 114, 0, 0, 0, 0, 14, 124, 67, 111, 105, 110, 67, 111, 110, 116, 97, 105, 110, 101, 114, 0, 0, 0, 0, 14, 124, 67, 111, 108, 111, 114, 101, 100, 76, 101, 116, 116, 101, 114, 0, 0, 0, 0, 6, 124, 68, 111, 103, 65, 73, 0, 0, 0, 0, 12, 124, 68, 111, 103, 68, 105, 103, 103, 97, 98, 108, 101, 0, 0, 0, 0, 18, 124, 68, 111, 103, 83, 116, 97, 116, 101, 65, 116, 116, 97, 99, 107, 105, 110, 103, 0, 0, 0, 0, 16, 124, 68, 111, 103, 83, 116, 97, 116, 101, 68, 105, 103, 103, 105, 110, 103, 0, 0, 0, 0, 18, 124, 68, 111, 103, 83, 116, 97, 116, 101, 70, 111, 108, 108, 111, 119, 105, 110, 103, 0, 0, 0, 0, 13, 124, 68, 111, 103, 83, 116, 97, 116, 101, 73, 100, 108, 101, 0, 0, 0, 0, 12, 124, 70, 105, 114, 101, 72, 121, 100, 114, 97, 110, 116, 0, 0, 0, 0, 22, 124, 71, 114, 111, 117, 110, 100, 76, 105, 103, 104, 116, 82, 101, 118, 101, 97, 108, 97, 98, 108, 101, 0, 0, 0, 0, 7, 124, 72, 105, 116, 98, 111, 120, 0, 0, 0, 0, 16, 124, 72, 105, 116, 116, 97, 98, 108, 101, 83, 112, 97, 119, 110, 101, 114, 0, 0, 0, 0, 7, 124, 74, 111, 121, 67, 111, 110, 0, 0, 0, 0, 9, 124, 74, 117, 109, 112, 82, 111, 112, 101, 0, 0, 0, 0, 11, 124, 76, 97, 117, 110, 99, 104, 80, 111, 108, 101, 0, 0, 0, 0, 9, 124, 77, 111, 111, 110, 68, 97, 116, 97, 0, 0, 0, 0, 12, 124, 77, 111, 118, 101, 84, 111, 80, 111, 105, 110, 116, 0, 0, 0, 0, 11, 124, 78, 80, 67, 69, 110, 101, 109, 121, 65, 73, 0, 0, 0, 0, 8, 124, 78, 80, 67, 78, 111, 100, 101, 0, 0, 0, 0, 8, 124, 79, 100, 121, 115, 115, 101, 121, 0, 0, 0, 0, 10, 124, 80, 111, 119, 101, 114, 77, 111, 111, 110, 0, 0, 0, 0, 8, 124, 80, 83, 119, 105, 116, 99, 104, 0, 0, 0, 0, 19, 124, 82, 97, 110, 100, 111, 109, 83, 105, 116, 65, 110, 105, 109, 97, 116, 105, 111, 110, 0, 0, 0, 0, 6, 124, 82, 99, 67, 97, 114, 0, 0, 0, 0, 25, 124, 82, 101, 116, 114, 111, 67, 104, 97, 114, 97, 99, 116, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 10, 124, 83, 99, 97, 114, 101, 99, 114, 111, 119, 0, 0, 0, 0, 9, 124, 83, 99, 101, 110, 101, 66, 71, 77, 0, 0, 0, 0, 8, 124, 83, 99, 111, 111, 116, 101, 114, 0, 0, 0, 0, 8, 124, 83, 101, 101, 100, 80, 111, 116, 0, 0, 0, 0, 7, 124, 83, 101, 101, 115, 97, 119, 0, 0, 0, 0, 10, 124, 83, 108, 105, 110, 103, 115, 104, 111, 116, 0, 0, 0, 0, 5, 124, 83, 111, 110, 103, 0, 0, 0, 0, 10, 124, 83, 112, 97, 114, 107, 66, 97, 108, 108, 0, 0, 0, 0, 11, 124, 83, 112, 97, 114, 107, 80, 121, 108, 111, 110, 0, 0, 0, 0, 21, 124, 83, 119, 105, 110, 103, 97, 98, 108, 101, 83, 116, 114, 101, 101, 116, 76, 105, 103, 104, 116, 0, 0, 0, 0, 17, 124, 83, 119, 105, 110, 103, 105, 110, 103, 83, 99, 97, 102, 102, 111, 108, 100, 0, 0, 0, 0, 19, 124, 84, 119, 111, 68, 105, 109, 101, 110, 115, 105, 111, 110, 97, 108, 90, 111, 110, 101, 0, 0, 0, 0, 14, 124, 87, 97, 108, 108, 74, 117, 109, 112, 80, 97, 110, 101, 108, 0, 0, 0, 0, 9, 124, 87, 97, 114, 112, 80, 105, 112, 101, 0, 0, 0, 0, 15, 124, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 33, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 46, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 83, 116, 97, 114, 116, 79, 102, 82, 111, 117, 110, 100, 0, 0, 0, 0, 49, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 83, 116, 97, 114, 116, 77, 97, 116, 99, 104, 76, 101, 118, 101, 114, 0, 0, 0, 0, 42, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 84, 101, 114, 109, 105, 110, 97, 108, 0, 0, 0, 0, 51, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 80, 108, 97, 121, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 66, 0, 0, 0, 0, 44, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 72, 85, 68, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 48, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 83, 112, 114, 97, 121, 80, 97, 105, 110, 116, 73, 116, 101, 109, 0, 0, 0, 0, 45, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 66, 111, 111, 109, 98, 111, 120, 73, 116, 101, 109, 0, 0, 0, 0, 48, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 78, 111, 105, 115, 101, 109, 97, 107, 101, 114, 80, 114, 111, 112, 0, 0, 0, 0, 44, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 83, 97, 110, 100, 87, 111, 114, 109, 65, 73, 0, 0, 0, 0, 40, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 80, 117, 109, 97, 65, 73, 0, 0, 0, 0, 50, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 68, 101, 108, 101, 116, 101, 70, 105, 108, 101, 66, 117, 116, 116, 111, 110, 0, 0, 0, 0, 46, 72, 97, 114, 109, 111, 110, 121, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 71, 97, 109, 101, 78, 101, 116, 119, 111, 114, 107, 77, 97, 110, 97, 103, 101, 114, 68, 105, 115, 99, 111, 110, 110, 101, 99, 116, 0, 0, 0, 0, 20, 124, 83, 99, 101, 110, 101, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 58, 83, 99, 101, 110, 101, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 78, 101, 116, 119, 111, 114, 107, 83, 99, 101, 110, 101, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 51, 83, 99, 101, 110, 101, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 124, 78, 101, 119, 68, 111, 110, 107, 67, 105, 116, 121, 80, 97, 116, 99, 104, 101, 115, 95, 83, 99, 101, 110, 101, 85, 116, 105, 108, 105, 116, 121, 0, 0, 0, 0, 7, 124, 80, 108, 117, 103, 105, 110, 0, 0, 0, 0, 10, 124, 83, 101, 116, 85, 112, 68, 97, 116, 97 }, TotalFiles = 85, TotalTypes = 102, IsEditorOnly = false }; } } namespace __GEN; internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } }