using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using PyrkonScripts.NetcodePatcher; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PyrkonScripts")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("PyrkonScripts")] [assembly: AssemblyTitle("PyrkonScripts")] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace PyrkonScripts { public class BananaGunItem : GrabbableObject { private int ammoLoaded; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); base.playerHeldBy.equippedUsableItemQE = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); } public override int GetItemDataToSave() { return ammoLoaded; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); ammoLoaded = saveData; } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (right) { int num = FindAmmoInInventory(); if (num != -1 && ammoLoaded < 3) { ammoLoaded++; base.playerHeldBy.DestroyItemInSlotAndSync(num); SyncAmmoRpc(ammoLoaded); } } } private int FindAmmoInInventory() { for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if (!((Object)(object)base.playerHeldBy.ItemSlots[i] == (Object)null)) { GrabbableObject obj = base.playerHeldBy.ItemSlots[i]; GunAmmo val = (GunAmmo)(object)((obj is GunAmmo) ? obj : null); if ((Object)(object)val != (Object)null && val.ammoType == 102) { return i; } } } if ((Object)(object)base.playerHeldBy.ItemOnlySlot != (Object)null) { GrabbableObject itemOnlySlot = base.playerHeldBy.ItemOnlySlot; GunAmmo val2 = (GunAmmo)(object)((itemOnlySlot is GunAmmo) ? itemOnlySlot : null); if ((Object)(object)val2 != (Object)null && val2.ammoType == 102) { return 50; } } return -1; } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncAmmoRpc(int ammo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: 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_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_0068: 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_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(192557183u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ammo); ((NetworkBehaviour)this).__endSendRpc(ref val2, 192557183u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ammoLoaded = Mathf.Clamp(ammo, 0, 3); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(192557183u, new RpcReceiveHandler(__rpc_handler_192557183), "SyncAmmoRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_192557183(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 ammo = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ammo); target.__rpc_exec_stage = (__RpcExecStage)1; ((BananaGunItem)(object)target).SyncAmmoRpc(ammo); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BananaGunItem"; } } [Serializable] public class DamageLevel { public List meshes = new List(); public List meshFilters = new List(); } public class DepositableItem : GrabbableObject { [Space(10f)] [Header("DepositableItem")] public int depositAmount = 50; public ScanNodeProperties? scanNode; public int hp = 3; public List damageLevels = new List(); public GameObject? destructionObject; private PlayerControllerB? lastHeldBy; public override int GetItemDataToSave() { return hp; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); DamageItemRpc(saveData); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((Object)(object)scanNode == (Object)null)) { scanNode.subText = $"Kaucja: ${depositAmount}"; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); lastHeldBy = base.playerHeldBy; } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (!((Object)(object)lastHeldBy == (Object)null) && (!((Object)(object)lastHeldBy != (Object)null) || !lastHeldBy.isInHangarShipRoom) && ((NetworkBehaviour)this).IsServer) { hp--; DamageItemRpc(hp); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DamageItemRpc(int health) { //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_0043: 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_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_0068: 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_0084: 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_01ee: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1629268537u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, health); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1629268537u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hp = health; if (hp > -1 && damageLevels[hp] != null) { Debug.Log((object)"Changing depositable item mesh"); if (damageLevels[hp].meshes.Count == damageLevels[hp].meshFilters.Count) { for (int i = 0; i < damageLevels[hp].meshes.Count; i++) { damageLevels[hp].meshFilters[i].mesh = damageLevels[hp].meshes[i]; } } } else if (hp == -1 && (Object)(object)base.playerHeldBy == (Object)null) { Debug.Log((object)"Depositable item destroyed"); if ((Object)(object)destructionObject != (Object)null) { Object.Instantiate(destructionObject, ((Component)this).transform.position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); } if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1629268537u, new RpcReceiveHandler(__rpc_handler_1629268537), "DamageItemRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1629268537(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 health = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref health); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositableItem)(object)target).DamageItemRpc(health); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string? __getTypeName() { return "DepositableItem"; } } public class DepositMachine : NetworkBehaviour { public static DepositMachine Instance; public TMP_Text? monitorText; public AudioSource? audioSource; public Animator? animator; public PlaceableShipObject? shipObj; public AudioClip[]? clips; public InteractTrigger? emptyTrigger; public int maxCapacity = 10; public Transform? bagSpawnPos; public NetworkVariable capacity = new NetworkVariable(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); [TextArea] public string[] possibleSentences = new string[14] { "You're a true ecologist\n\nyour deposit: $[AMOUNT]", "Keep the company clean\n\nyour deposit: $[AMOUNT]", "We appreciate you following the rules\n\nyour deposit: $[AMOUNT]", "Thank you for depositing\n\nyour deposit: $[AMOUNT]", "Your work is looked upon\n\nyour deposit: $[AMOUNT]", "What an accomplishment\n\nyour deposit: $[AMOUNT]", "Keep up the pace\n\nyour deposit: $[AMOUNT]", "Sincerely thank you\n\nyour deposit: $[AMOUNT]", "You're the greatest asset\n\nyour deposit: $[AMOUNT]", "We reward your commitment\n\nyour deposit: $[AMOUNT]", "Must keep the ship tidy\n\nyour deposit: $[AMOUNT]", "Baboon Hawks are thankful\n\nyour deposit: $[AMOUNT]", "Your job is valued\n\nyour deposit: $[AMOUNT]", "Please pick up the trash\n\nyour deposit: $[AMOUNT]" }; private Coroutine? textDisplay; private Coroutine? disableTrigger; private Item? emptyBag = Plugin.trash; private Terminal? terminal; private void Awake() { terminal = Object.FindObjectOfType(); Instance = this; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = capacity; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnCapacityChanged)); if (ES3.KeyExists("DepositMachineCapacity", GameNetworkManager.Instance.currentSaveFileName) && ((NetworkBehaviour)this).IsServer) { int value = ES3.Load("DepositMachineCapacity", GameNetworkManager.Instance.currentSaveFileName); capacity.Value = value; } } public void OnCapacityChanged(int prevValue, int newValue) { if (newValue >= maxCapacity && (Object)(object)emptyTrigger != (Object)null) { emptyTrigger.interactable = true; } } public void EmptyDeposit(PlayerControllerB player) { EmptyDepositRpc(player.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] public void EmptyDepositRpc(ulong clientId) { //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_0043: 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_005f: 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_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(79017483u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 79017483u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong clientId2 = clientId; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB plr) => plr.playerClientId == clientId2)); if ((Object)(object)val4 == (Object)null || (Object)(object)animator == (Object)null || (Object)(object)emptyTrigger == (Object)null || (Object)(object)emptyBag == (Object)null || (Object)(object)bagSpawnPos == (Object)null) { return; } emptyTrigger.interactable = false; if (disableTrigger != null) { ((MonoBehaviour)this).StopCoroutine(disableTrigger); } disableTrigger = ((MonoBehaviour)this).StartCoroutine(disablePlaceableTrigger(0.5f)); if ((Object)(object)audioSource != (Object)null && clips != null) { audioSource.PlayOneShot(clips[1]); } DisplayText("Thank you " + val4.playerUsername + " for emptying the Company Depositor", 9f); if (((NetworkBehaviour)this).IsServer) { GameObject val5 = Object.Instantiate(emptyBag.spawnPrefab, bagSpawnPos.position, Quaternion.identity, StartOfRound.Instance.elevatorTransform); val5.GetComponent().Spawn(false); capacity.Value = 0; if (StartOfRound.Instance.inShipPhase) { ES3.Save("DepositMachineCapacity", capacity.Value, GameNetworkManager.Instance.currentSaveFileName); } } ((MonoBehaviour)this).StartCoroutine(openHatchWithDelay(4f)); } private IEnumerator openHatchWithDelay(float time) { if (!((Object)(object)animator == (Object)null)) { animator.SetBool("OpenHatch", true); yield return (object)new WaitForSeconds(time); animator.SetBool("OpenHatch", false); } } private IEnumerator disablePlaceableTrigger(float time) { if ((Object)(object)shipObj != (Object)null) { shipObj.placeObjectCollider.enabled = false; } yield return (object)new WaitForSeconds(time); if ((Object)(object)shipObj != (Object)null) { shipObj.placeObjectCollider.enabled = true; } } public void DepositCurrentItem(PlayerControllerB player) { GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer != (Object)null && currentlyHeldObjectServer is DepositableItem) { DepositableItem depositableItem = (DepositableItem)(object)currentlyHeldObjectServer; if (capacity.Value < maxCapacity) { int index = Random.Range(0, possibleSentences.Length); GetRewardRpc(depositableItem.depositAmount, index); ((GrabbableObject)depositableItem).playerHeldBy.DespawnHeldObject(); } else { EmptyNotifyRpc(); } } else { HUDManager.Instance.DisplayTip("Company Deposit", "Please insert depositable item", true, false, "LC_Tip1"); } } private IEnumerator displayTextAfterDelay(float time, int characters) { if (!((Object)(object)monitorText == (Object)null)) { while (monitorText.maxVisibleCharacters <= characters) { yield return (object)new WaitForSeconds(time); TMP_Text? obj = monitorText; obj.maxVisibleCharacters += 1; } } } public void DisplayText(string text, float fontSize = 6f) { if (!((Object)(object)monitorText == (Object)null)) { monitorText.fontSize = fontSize; monitorText.text = text; monitorText.maxVisibleCharacters = 0; if (textDisplay != null) { ((MonoBehaviour)this).StopCoroutine(textDisplay); } textDisplay = ((MonoBehaviour)this).StartCoroutine(displayTextAfterDelay(0.05f, text.Length)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void EmptyNotifyRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0081: 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_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2084601195u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2084601195u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; DisplayText("Depositor is full.\n\nPlease empty using the HATCH located on your right"); if ((Object)(object)audioSource != (Object)null && clips != null) { audioSource.PlayOneShot(clips[1]); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void GetRewardRpc(int kaucja, int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0076: 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_009b: 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_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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2958306765u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, kaucja); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2958306765u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)terminal == (Object)null) { return; } if (((NetworkBehaviour)this).IsServer) { NetworkVariable obj = capacity; obj.Value += 1; if (StartOfRound.Instance.inShipPhase) { ES3.Save("DepositMachineCapacity", capacity.Value, GameNetworkManager.Instance.currentSaveFileName); } } DisplayText(possibleSentences[index].Replace("[AMOUNT]", kaucja.ToString())); Terminal? obj2 = terminal; obj2.groupCredits += kaucja; if ((Object)(object)audioSource != (Object)null && clips != null) { audioSource.PlayOneShot(clips[0]); } } protected override void __initializeVariables() { if (capacity == null) { throw new Exception("DepositMachine.capacity cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)capacity).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)capacity, "capacity"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)capacity); ((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(79017483u, new RpcReceiveHandler(__rpc_handler_79017483), "EmptyDepositRpc"); ((NetworkBehaviour)this).__registerRpc(2084601195u, new RpcReceiveHandler(__rpc_handler_2084601195), "EmptyNotifyRpc"); ((NetworkBehaviour)this).__registerRpc(2958306765u, new RpcReceiveHandler(__rpc_handler_2958306765), "GetRewardRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_79017483(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) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositMachine)(object)target).EmptyDepositRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2084601195(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; ((DepositMachine)(object)target).EmptyNotifyRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2958306765(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 kaucja = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref kaucja); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositMachine)(object)target).GetRewardRpc(kaucja, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string? __getTypeName() { return "DepositMachine"; } } public class JayPhoneItem : GrabbableObject { private const int SCREEN_MATERIAL_INDEX = 0; public Material[] pageMaterials; public Material disabledMaterial; public MeshRenderer mesh; public AudioClip swapArtClip; public AudioClip enableClip; public AudioClip disableClip; public AudioSource phoneAudioSource; private int currentIndex = 0; private PlayerControllerB lastHeldBy; private bool isEnabled = false; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); lastHeldBy = base.playerHeldBy; lastHeldBy.equippedUsableItemQE = true; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); lastHeldBy.equippedUsableItemQE = false; SetState(enabled: false); base.isBeingUsed = false; } public override void UseUpBatteries() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).UseUpBatteries(); SetState(enabled: false); phoneAudioSource.PlayOneShot(disableClip); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 7f, 0.4f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); SetState(!isEnabled); } public void SetPage(int index) { if (index >= 0 && index < pageMaterials.Length) { currentIndex = index; if (isEnabled) { List list = new List(((Renderer)mesh).materials); list[0] = pageMaterials[currentIndex]; ((Renderer)mesh).materials = list.ToArray(); phoneAudioSource.PlayOneShot(swapArtClip); } } } public void SetState(bool enabled) { isEnabled = enabled; List list = new List(((Renderer)mesh).materials); list[0] = (isEnabled ? pageMaterials[currentIndex] : disabledMaterial); ((Renderer)mesh).materials = list.ToArray(); phoneAudioSource.PlayOneShot(isEnabled ? enableClip : disableClip); } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!isEnabled) { base.isBeingUsed = false; } else { base.isBeingUsed = true; } int num = currentIndex + (right ? 1 : (-1)); if (num < 0) { num = pageMaterials.Length - 1; } else if (num >= pageMaterials.Length) { num = 0; } SetPage(num); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "JayPhoneItem"; } } public class MaxplaierCapItem : GrabbableObject { public GameObject? CapHeadModel; private GameObject? activeCapModel; public override void PocketItem() { //IL_00de: 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_010a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).PocketItem(); int num = 0; GrabbableObject[] itemSlots = base.playerHeldBy.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (val is MaxplaierCapItem) { MaxplaierCapItem maxplaierCapItem = (MaxplaierCapItem)(object)val; if ((Object)(object)maxplaierCapItem.activeCapModel != (Object)null) { num++; } } } if (num != 0) { return; } activeCapModel = Object.Instantiate(CapHeadModel, base.playerHeldBy.headCostumeContainer.parent.Find("HeadPoint")); if ((Object)(object)activeCapModel != (Object)null) { if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { activeCapModel.SetActive(false); } activeCapModel.transform.localPosition = Vector3.zero; activeCapModel.transform.localRotation = Quaternion.identity; activeCapModel.transform.localScale = Vector3.one; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)activeCapModel != (Object)null) { Object.Destroy((Object)(object)activeCapModel); } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)activeCapModel != (Object)null) { Object.Destroy((Object)(object)activeCapModel); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string? __getTypeName() { return "MaxplaierCapItem"; } } public class OiikaBroomItem : GrabbableObject { public int broomHitForce = 1; public bool reelingUp; public bool isHoldingButton; private RaycastHit rayHit; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByBroom; private List objectsHitByBroomList = new List(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource shovelAudio; private PlayerControllerB previousPlayerHeldBy; private int shovelMask = 1084754248; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpShovel()); } } private IEnumerator reelUpShovel() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); shovelAudio.PlayOneShot(reelUp); ReelUpSFXServerRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !base.isHeld)); SwingShovel(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitShovel(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } [ServerRpc] public void ReelUpSFXServerRpc() { //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)((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(350106391u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 350106391u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ReelUpSFXClientRpc(); } } [ClientRpc] public void ReelUpSFXClientRpc() { //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(1780050249u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1780050249u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { shovelAudio.PlayOneShot(reelUp); } } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public void SwingShovel(bool cancel = false) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { shovelAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitShovel(bool cancel = false) { //IL_0063: 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_0082: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_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) //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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: 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_0332: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called."); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByBroom = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, shovelMask, (QueryTriggerInteraction)2); objectsHitByBroomList = objectsHitByBroom.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); List list = new List(); IHittable val2 = default(IHittable); for (int num2 = 0; num2 < objectsHitByBroomList.Count; num2++) { RaycastHit val = objectsHitByBroomList[num2]; Debug.Log((object)((Object)((Component)((RaycastHit)(ref val)).transform).gameObject).name); val = objectsHitByBroomList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByBroomList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByBroomList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByBroomList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByBroomList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; RaycastHit val3 = objectsHitByBroomList[num2]; if (Physics.Linecast(position, ((RaycastHit)(ref val3)).point, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; Vector3 position2 = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByBroomList[num2]; Debug.DrawLine(position2, ((RaycastHit)(ref val)).point, Color.green, 5f); try { val = objectsHitByBroomList[num2]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { if (!((Object)(object)component.mainScript == (Object)null) && !list.Contains(component.mainScript) && (!StartOfRound.Instance.hangarDoorsClosed || component.mainScript.isInsidePlayerShip == previousPlayerHeldBy.isInHangarShipRoom)) { goto IL_03ed; } continue; } val = objectsHitByBroomList[num2]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_03ed; } if (flag3) { continue; } flag3 = true; val = objectsHitByBroomList[num2]; PlayerControllerB component2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component2 != (Object)null) { bool flag4 = component2.playerSteamId == 76561198010917842L; bool flag5 = val2.Hit(flag4 ? 5 : broomHitForce, forward, previousPlayerHeldBy, true, 1); if (flag5 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag5; } } else { bool flag6 = val2.Hit(broomHitForce, forward, previousPlayerHeldBy, true, 1); if (flag6 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag6; } } goto end_IL_0324; IL_03ed: bool flag7 = val2.Hit(broomHitForce, forward, previousPlayerHeldBy, true, 1); if (flag7 && (Object)(object)component != (Object)null) { Debug.Log((object)(component.mainScript.enemyType.enemyName + " has been hit by force: " + broomHitForce + " true: " + flag7)); list.Add(component.mainScript); } if (!flag2) { flag2 = flag7; } end_IL_0324:; } catch (Exception arg) { Debug.Log((object)$"Exception caught when hitting object with shovel from player #{previousPlayerHeldBy.playerClientId}: {arg}"); } continue; } } val = objectsHitByBroomList[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByBroomList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; break; } } } } if (flag) { RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitBroomServerRpc(num); } } [ServerRpc] public void HitBroomServerRpc(int hitSurfaceID) { //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)((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(458182727u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 458182727u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitBroomClientRpc(hitSurfaceID); } } [ClientRpc] public void HitBroomClientRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2914920080u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2914920080u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { HitSurfaceWithShovel(hitSurfaceID); } } } private void HitSurfaceWithShovel(int hitSurfaceID) { shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(350106391u, new RpcReceiveHandler(__rpc_handler_350106391), "ReelUpSFXServerRpc"); ((NetworkBehaviour)this).__registerRpc(1780050249u, new RpcReceiveHandler(__rpc_handler_1780050249), "ReelUpSFXClientRpc"); ((NetworkBehaviour)this).__registerRpc(458182727u, new RpcReceiveHandler(__rpc_handler_458182727), "HitBroomServerRpc"); ((NetworkBehaviour)this).__registerRpc(2914920080u, new RpcReceiveHandler(__rpc_handler_2914920080), "HitBroomClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_350106391(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; ((OiikaBroomItem)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1780050249(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; ((OiikaBroomItem)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_458182727(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((OiikaBroomItem)(object)target).HitBroomServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2914920080(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((OiikaBroomItem)(object)target).HitBroomClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "OiikaBroomItem"; } } [BepInPlugin("WaterGun.PyrkonScripts", "Pyrkon", "1.0.0")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManager_Patch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Postfix(GameNetworkManager __instance) { if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)pyrkonNetworkObject)) { NetworkManager.Singleton.AddNetworkPrefab(pyrkonNetworkObject); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)maxplaierCup?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(maxplaierCup?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)maxplaierCap?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(maxplaierCap?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)maxplaierPillow?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(maxplaierPillow?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)chuckenPillow?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(chuckenPillow?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)rockus?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(rockus?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)companyDeposit)) { NetworkManager.Singleton.AddNetworkPrefab(companyDeposit); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)haalandPlushieObj)) { NetworkManager.Singleton.AddNetworkPrefab(haalandPlushieObj); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)trash?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(trash?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)oiikaBroom?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(oiikaBroom?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)admirozdroj?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(admirozdroj?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)starbucksCup?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(starbucksCup?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)leszekBanana?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(leszekBanana?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)jayPhone?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(jayPhone?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)jayJam?.spawnPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(jayJam?.spawnPrefab); } if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Any((NetworkPrefab p) => (Object)(object)p.Prefab == (Object)(object)tsurayaCat?.enemyPrefab)) { NetworkManager.Singleton.AddNetworkPrefab(tsurayaCat?.enemyPrefab); } } [HarmonyPatch("SaveGameValues")] [HarmonyPostfix] public static void SaveGameValues() { if ((Object)(object)PyrkonScripts.DepositMachine.Instance != (Object)null) { ES3.Save("DepositMachineCapacity", PyrkonScripts.DepositMachine.Instance.capacity.Value, GameNetworkManager.Instance.currentSaveFileName); } } } [HarmonyPatch(typeof(MenuManager))] internal class MenuManager_Patch { private static IEnumerator waitForMenuAndSetup(Transform header, TMP_Text text, GameObject loading) { while ((Object)(object)header == (Object)null || (Object)(object)text == (Object)null) { yield return null; } ((Component)header).GetComponent().sprite = headerLogo; text.text += " (Pyrkon 1.0.0)"; text.margin -= new Vector4(0f, 0f, 500f, 0f); Transform imageHeader = loading.transform.Find("Image"); if ((Object)(object)imageHeader != (Object)null) { ((Component)imageHeader).GetComponent().sprite = headerLogo; } } [HarmonyPatch("Start")] [HarmonyPrefix] public static void Prefix(MenuManager __instance) { __instance.menuMusic = menuMusic; } [HarmonyPatch("Start")] [HarmonyPostfix] public static void Postfix(MenuManager __instance) { Transform header = __instance.menuButtons.transform.Find("HeaderImage"); if ((Object)(object)__instance.loadingScreen != (Object)null) { ((MonoBehaviour)__instance).StartCoroutine(waitForMenuAndSetup(header, (TMP_Text)(object)__instance.versionNumberText, __instance.loadingScreen)); } } } [HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")] internal static class SpawnScrapInLevel_Patch { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown List list = new List(instructions); FieldInfo fieldInfo = AccessTools.Field(typeof(SelectableLevel), "spawnableScrap"); MethodInfo methodInfo = AccessTools.Method(typeof(SpawnScrapInLevel_Patch), "FilterSingleItemDay", (Type[])null, (Type[])null); for (int i = 1; i < list.Count; i++) { if (list[i].opcode == OpCodes.Stloc_2 && list[i - 1].opcode == OpCodes.Callvirt) { list.InsertRange(i + 1, (IEnumerable)(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldloc_2, (object)null), new CodeInstruction(OpCodes.Call, (object)methodInfo), new CodeInstruction(OpCodes.Stloc_2, (object)null) }); } } return list; } private static int FilterSingleItemDay(RoundManager roundManager, int index) { index = roundManager.AnomalyRandom.Next(0, roundManager.currentLevel.spawnableScrap.Count); Item spawnableItem = roundManager.currentLevel.spawnableScrap[index].spawnableItem; if ((Object)(object)spawnableItem.spawnPrefab.GetComponent() != (Object)null) { Debug.Log((object)("[PyrkonMod] Prevented DepositableItem '" + spawnableItem.itemName + "' from becoming the single-item day.")); return 0; } return index; } } [HarmonyPatch(typeof(DepositItemsDesk))] internal class DepositItemsDesk_Patch { [HarmonyPatch("PlaceItemOnCounter")] [HarmonyPrefix] public static bool PlaceItemOnCounter_Prefix(ref PlayerControllerB playerWhoTriggered) { if (playerWhoTriggered.currentlyHeldObjectServer is DepositableItem) { HUDManager.Instance.DisplayTip("Sell Counter", "This item is returnable, please upgrade your company ship to include Company Deposit!", true, false, "LC_Tip1"); return false; } return true; } } [HarmonyPatch(typeof(Terminal))] internal class Terminal_Patch { [HarmonyPatch("Awake")] [HarmonyPrefix] public static void Awake(Terminal __instance) { //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Expected O, but got Unknown //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Expected O, but got Unknown //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Expected O, but got Unknown //IL_0b4a: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Expected O, but got Unknown //IL_0fe9: Unknown result type (might be due to invalid IL or missing references) //IL_0fef: Expected O, but got Unknown //IL_0c4b: Unknown result type (might be due to invalid IL or missing references) //IL_0c55: Expected O, but got Unknown //IL_1067: Unknown result type (might be due to invalid IL or missing references) //IL_106d: Expected O, but got Unknown //IL_10f7: Unknown result type (might be due to invalid IL or missing references) //IL_1101: Expected O, but got Unknown //IL_11f8: Unknown result type (might be due to invalid IL or missing references) //IL_1202: Expected O, but got Unknown if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == maxplaierCup?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(maxplaierCup); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == maxplaierCap?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(maxplaierCap); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == maxplaierPillow?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(maxplaierPillow); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == chuckenPillow?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(chuckenPillow); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == rockus?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(rockus); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == oiikaBroom?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(oiikaBroom); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == trash?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(trash); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == admirozdroj?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(admirozdroj); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == starbucksCup?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(starbucksCup); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == leszekBanana?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(leszekBanana); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == jayPhone?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(jayPhone); } if (!StartOfRound.Instance.allItemsList.itemsList.Any((Item val11) => val11.itemName == jayJam?.itemName)) { StartOfRound.Instance.allItemsList.itemsList.Add(jayJam); } TerminalKeyword val = __instance.terminalNodes.allKeywords.First((TerminalKeyword k) => k.word == "info"); if (!__instance.enemyFiles.Any((TerminalNode f) => f.creatureName == Plugin.tsurayaCat?.enemyName)) { TerminalNode val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = Plugin.tsurayaCat?.enemyName.Replace(" ", "-") + "File"; val2.clearPreviousText = true; val2.creatureName = Plugin.tsurayaCat?.enemyName; val2.creatureFileID = __instance.enemyFiles.Count; val2.maxCharactersToType = 35; val2.displayText = "Tsuraya cats often become enormous sizes when reached please be careful"; val2.displayVideo = tsurayaCatVid; val2.playSyncedClip = 2; val2.loadImageSlowly = true; __instance.enemyFiles.Add(val2); EnemyType? tsurayaCat = Plugin.tsurayaCat; ScanNodeProperties val3 = ((tsurayaCat != null) ? tsurayaCat.enemyPrefab.GetComponentInChildren() : null); if ((Object)(object)val3 != (Object)null) { val3.creatureScanID = val2.creatureFileID; } } if (!__instance.terminalNodes.allKeywords.Any((TerminalKeyword k) => k.word == Plugin.tsurayaCat?.enemyName.ToLowerInvariant().Replace(" ", "-"))) { TerminalKeyword val4 = ScriptableObject.CreateInstance(); ((Object)val4).name = Plugin.tsurayaCat?.enemyName.Replace(" ", "-"); val4.word = Plugin.tsurayaCat?.enemyName.ToLowerInvariant().Replace(" ", "-"); val4.defaultVerb = val; List list = __instance.terminalNodes.allKeywords.ToList(); list.Add(val4); __instance.terminalNodes.allKeywords = list.ToArray(); } if (!val.compatibleNouns.Any((CompatibleNoun n) => n.noun.word == Plugin.tsurayaCat?.enemyName.ToLowerInvariant().Replace(" ", "-"))) { CompatibleNoun item = new CompatibleNoun(__instance.terminalNodes.allKeywords.First((TerminalKeyword k) => k.word == Plugin.tsurayaCat?.enemyName.ToLowerInvariant().Replace(" ", "-")), __instance.enemyFiles.First((TerminalNode n) => n.creatureName == Plugin.tsurayaCat?.enemyName)); List list2 = val.compatibleNouns.ToList(); list2.Add(item); val.compatibleNouns = list2.ToArray(); } DepositMachine.prefabObject = companyDeposit; DepositMachine.unlockableName = "Deposit machine"; DepositMachine.unlockableType = 1; DepositMachine.IsPlaceable = true; DepositMachine.alwaysInStock = true; if (!StartOfRound.Instance.unlockablesList.unlockables.Any((UnlockableItem unlockable) => unlockable.unlockableName == DepositMachine.unlockableName) && (Object)(object)DepositMachine.prefabObject != (Object)null) { PlaceableShipObject componentInChildren = DepositMachine.prefabObject.GetComponentInChildren(); componentInChildren.unlockableID = StartOfRound.Instance.unlockablesList.unlockables.Count; componentInChildren.parentObject.unlockableID = componentInChildren.unlockableID; StartOfRound.Instance.unlockablesList.unlockables.Add(DepositMachine); TerminalKeyword keyword = ScriptableObject.CreateInstance(); ((Object)keyword).name = "DepositMachine"; keyword.defaultVerb = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy"); keyword.word = DepositMachine.unlockableName.ToLowerInvariant().Replace(" ", "-"); if (__instance.terminalNodes.allKeywords.Any((TerminalKeyword key) => key.word == keyword.word)) { return; } int shipUnlockableID = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == DepositMachine.unlockableName); TerminalNode val5 = ScriptableObject.CreateInstance(); ((Object)val5).name = DepositMachine.unlockableName.Replace(" ", "-") + "BuyNode2"; val5.displayText = "Ordered [variableAmount] " + DepositMachine.unlockableName + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val5.clearPreviousText = true; val5.maxCharactersToType = 15; val5.buyItemIndex = -1; val5.shipUnlockableID = shipUnlockableID; val5.buyUnlockable = true; val5.creatureName = DepositMachine.unlockableName; val5.isConfirmationNode = false; val5.itemCost = 300; val5.playSyncedClip = 0; TerminalNode val6 = ScriptableObject.CreateInstance(); val6 = ScriptableObject.CreateInstance(); ((Object)val6).name = DepositMachine.unlockableName.Replace(" ", "-") + "BuyNode1"; val6.displayText = "You have requested to order " + DepositMachine.unlockableName + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val6.clearPreviousText = true; val6.maxCharactersToType = 35; val6.buyItemIndex = -1; val6.shipUnlockableID = shipUnlockableID; val6.creatureName = DepositMachine.unlockableName; val6.isConfirmationNode = true; val6.overrideOptions = true; val6.itemCost = 300; val6.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun(__instance.terminalNodes.allKeywords.First((TerminalKeyword val11) => val11.word == "confirm"), val5), new CompatibleNoun(__instance.terminalNodes.allKeywords.First((TerminalKeyword val11) => val11.word == "deny"), __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns[0].result.terminalOptions[1].result) }; List list3 = __instance.terminalNodes.allKeywords.ToList(); list3.Add(keyword); __instance.terminalNodes.allKeywords = list3.ToArray(); List list4 = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns.ToList(); list4.Add(new CompatibleNoun(keyword, val6)); __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns = list4.ToArray(); TerminalNode val7 = ScriptableObject.CreateInstance(); ((Object)val7).name = DepositMachine.unlockableName.Replace(" ", "-") + "InfoNode"; val7.displayText = "No information given about " + DepositMachine.unlockableName + "\n\n"; val7.clearPreviousText = true; val7.maxCharactersToType = 25; __instance.terminalNodes.allKeywords = list3.ToArray(); List list5 = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "info").compatibleNouns.ToList(); list5.Add(new CompatibleNoun(keyword, val7)); __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "info").compatibleNouns = list5.ToArray(); } HaalandPlushie.prefabObject = haalandPlushieObj; HaalandPlushie.unlockableName = "Haaland plushie"; HaalandPlushie.unlockableType = 1; HaalandPlushie.IsPlaceable = true; HaalandPlushie.alwaysInStock = false; if (StartOfRound.Instance.unlockablesList.unlockables.Any((UnlockableItem unlockable) => unlockable.unlockableName == HaalandPlushie.unlockableName) || !((Object)(object)HaalandPlushie.prefabObject != (Object)null)) { return; } PlaceableShipObject componentInChildren2 = HaalandPlushie.prefabObject.GetComponentInChildren(); componentInChildren2.unlockableID = StartOfRound.Instance.unlockablesList.unlockables.Count; componentInChildren2.parentObject.unlockableID = componentInChildren2.unlockableID; StartOfRound.Instance.unlockablesList.unlockables.Add(HaalandPlushie); TerminalKeyword keyword2 = ScriptableObject.CreateInstance(); ((Object)keyword2).name = "HaalandPlushie"; keyword2.defaultVerb = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy"); keyword2.word = HaalandPlushie.unlockableName.ToLowerInvariant().Replace(" ", "-"); if (!__instance.terminalNodes.allKeywords.Any((TerminalKeyword key) => key.word == keyword2.word)) { int shipUnlockableID2 = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == HaalandPlushie.unlockableName); TerminalNode val8 = ScriptableObject.CreateInstance(); ((Object)val8).name = HaalandPlushie.unlockableName.Replace(" ", "-") + "BuyNode2"; val8.displayText = "Ordered [variableAmount] " + HaalandPlushie.unlockableName + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val8.clearPreviousText = true; val8.maxCharactersToType = 15; val8.buyItemIndex = -1; val8.shipUnlockableID = shipUnlockableID2; val8.buyUnlockable = true; val8.creatureName = HaalandPlushie.unlockableName; val8.isConfirmationNode = false; val8.itemCost = 120; val8.playSyncedClip = 0; TerminalNode val9 = ScriptableObject.CreateInstance(); val9 = ScriptableObject.CreateInstance(); ((Object)val9).name = HaalandPlushie.unlockableName.Replace(" ", "-") + "BuyNode1"; val9.displayText = "You have requested to order " + HaalandPlushie.unlockableName + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val9.clearPreviousText = true; val9.maxCharactersToType = 35; val9.buyItemIndex = -1; val9.shipUnlockableID = shipUnlockableID2; val9.creatureName = HaalandPlushie.unlockableName; val9.isConfirmationNode = true; val9.overrideOptions = true; val9.itemCost = 120; val9.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun(__instance.terminalNodes.allKeywords.First((TerminalKeyword val11) => val11.word == "confirm"), val8), new CompatibleNoun(__instance.terminalNodes.allKeywords.First((TerminalKeyword val11) => val11.word == "deny"), __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns[0].result.terminalOptions[1].result) }; HaalandPlushie.shopSelectionNode = val9; List list6 = __instance.terminalNodes.allKeywords.ToList(); list6.Add(keyword2); __instance.terminalNodes.allKeywords = list6.ToArray(); List list7 = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns.ToList(); list7.Add(new CompatibleNoun(keyword2, val9)); __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "buy").compatibleNouns = list7.ToArray(); TerminalNode val10 = ScriptableObject.CreateInstance(); ((Object)val10).name = HaalandPlushie.unlockableName.Replace(" ", "-") + "InfoNode"; val10.displayText = "No information given about " + HaalandPlushie.unlockableName + "\n\n"; val10.clearPreviousText = true; val10.maxCharactersToType = 25; __instance.terminalNodes.allKeywords = list6.ToArray(); List list8 = __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "info").compatibleNouns.ToList(); list8.Add(new CompatibleNoun(keyword2, val10)); __instance.terminalNodes.allKeywords.First((TerminalKeyword key) => key.word == "info").compatibleNouns = list8.ToArray(); } } [HarmonyPatch("TextPostProcess")] [HarmonyPrefix] public static void TextPostProcess(ref TerminalNode node, ref string modifiedDisplayText, Terminal __instance) { if (modifiedDisplayText.Contains("[buyableItemsList]") && modifiedDisplayText.Contains("[unlockablesSelectionList]")) { int num = modifiedDisplayText.IndexOf(":"); string unlockableName = DepositMachine.unlockableName; int num2 = 300; string value = $"\n* {unlockableName} // Price: ${num2}"; modifiedDisplayText = modifiedDisplayText.Insert(num + 1, value); } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRound_Patch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Postfix(StartOfRound __instance) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Expected O, but got Unknown //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Expected O, but got Unknown //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Expected O, but got Unknown //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown if (NetworkManager.Singleton.IsServer) { GameObject val = Object.Instantiate(pyrkonNetworkObject); if (val != null) { val.GetComponent().Spawn(false); } } SelectableLevel val2 = __instance.levels.First((SelectableLevel l) => l.PlanetName == "52 Pyrkon"); if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == maxplaierCup?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(maxplaierCup, 30)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == maxplaierCap?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(maxplaierCap, 25)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == maxplaierPillow?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(maxplaierPillow, 55)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == chuckenPillow?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(chuckenPillow, 25)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == rockus?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(rockus, 50)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == admirozdroj?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(admirozdroj, 45)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == oiikaBroom?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(oiikaBroom, 20)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == starbucksCup?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(starbucksCup, 25)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == leszekBanana?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(leszekBanana, 10)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == jayPhone?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(jayPhone, 45)); } if (!val2.spawnableScrap.Any((SpawnableItemWithRarity s) => s.spawnableItem.itemName == jayJam?.itemName)) { val2.spawnableScrap.Add(new SpawnableItemWithRarity(jayJam, 50)); } if (!val2.Enemies.Any((SpawnableEnemyWithRarity e) => e.enemyType.enemyName == tsurayaCat?.enemyName)) { val2.Enemies.Add(new SpawnableEnemyWithRarity(tsurayaCat, 200)); } if ((Object)(object)val2.specialEnemyRarity.overrideEnemy != (Object)(object)tsurayaCat) { val2.specialEnemyRarity.overrideEnemy = tsurayaCat; } } } [HarmonyPatch] internal class MaskedPlayerEnemy_Transpiler { public static MethodBase TargetMethod() { Type type = AccessTools.Inner(typeof(MaskedPlayerEnemy), "d__119"); return AccessTools.Method(type, "MoveNext", (Type[])null, (Type[])null); } public static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown List list = new List(instructions); MethodInfo methodInfo = AccessTools.Method(typeof(MaskedPlayerEnemy_Transpiler), "GetKillAudio", (Type[])null, (Type[])null); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldloc_1 && list[i + 1].opcode == OpCodes.Ldfld && list[i + 1].operand is FieldInfo fieldInfo && fieldInfo.FieldType == typeof(EnemyType) && list[i + 3].opcode == OpCodes.Ldc_I4_0) { list[i + 4] = new CodeInstruction(OpCodes.Call, (object)methodInfo); } if (list[i].opcode == OpCodes.Ldloc_1 && list[i + 1].opcode == OpCodes.Ldfld && list[i + 1].operand is FieldInfo fieldInfo2 && fieldInfo2.FieldType == typeof(EnemyType) && list[i + 3].opcode == OpCodes.Ldc_I4_2) { list[i + 4] = new CodeInstruction(OpCodes.Call, (object)methodInfo); } } return list; } private static AudioClip GetKillAudio(AudioClip[] array, int index) { if ((Object)(object)PyrkonMaskAudio != (Object)null && StartOfRound.Instance.currentLevel.PlanetName == "52 Pyrkon") { return PyrkonMaskAudio; } return array[index]; } } [HarmonyPatch(typeof(ButlerEnemyAI))] internal class ButlerEnemy_Patch { [HarmonyPostfix] [HarmonyPatch("Start")] public static void Postfix(ButlerEnemyAI __instance) { if (StartOfRound.Instance.currentLevel.PlanetName == "52 Pyrkon") { __instance.knifePrefab = leszekBanana?.spawnPrefab; } } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedPlayerEnemy_Patch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Postfix(MaskedPlayerEnemy __instance) { if (!(StartOfRound.Instance.currentLevel.PlanetName == "52 Pyrkon") || !((Object)(object)PyrkonMaskSuit != (Object)null) || !((Object)(object)PyrkonMaskMesh != (Object)null) || !((Object)(object)PyrkonMaskMat != (Object)null) || !((Object)(object)GzdaczeSuit != (Object)null)) { return; } Debug.Log((object)"Passed first if"); if (TimeOfDay.Instance.currentDayTime < 900f) { Debug.Log((object)"Mask is daytime"); ((Renderer)__instance.rendererLOD0).SetMaterials(new List { PyrkonMaskSuit }); ((Renderer)__instance.rendererLOD1).SetMaterials(new List { PyrkonMaskSuit }); ((Renderer)__instance.rendererLOD2).SetMaterials(new List { PyrkonMaskSuit }); MeshFilter component = ((Component)__instance.maskTypes[0].transform.Find("Mesh")).GetComponent(); MeshFilter component2 = ((Component)__instance.maskTypes[0].transform.Find("ComedyMaskLOD1")).GetComponent(); component.mesh = PyrkonMaskMesh; ((Renderer)((Component)component).GetComponent()).SetMaterials(new List { PyrkonMaskMat }); component2.mesh = PyrkonMaskMesh; ((Renderer)((Component)component2).GetComponent()).SetMaterials(new List { PyrkonMaskMat }); GameObject gameObject = ((Component)((Component)__instance).transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/LevelSticker")).gameObject; GameObject gameObject2 = ((Component)((Component)__instance).transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/BetaBadge")).gameObject; gameObject.SetActive(false); gameObject2.SetActive(false); if (!((Object)(object)PyrkonMaskRandAudio1 == (Object)null) && !((Object)(object)PyrkonMaskRandAudio2 == (Object)null) && !((Object)(object)PyrkonMaskRandAudio3 == (Object)null) && !((Object)(object)PyrkonMaskRandAudio4 == (Object)null) && !((Object)(object)PyrkonMaskRandAudio5 == (Object)null)) { RandomPeriodicAudioPlayer component3 = __instance.maskTypes[0].GetComponent(); AudioClip[] randomClips = (AudioClip[])(object)new AudioClip[5] { PyrkonMaskRandAudio1, PyrkonMaskRandAudio2, PyrkonMaskRandAudio3, PyrkonMaskRandAudio4, PyrkonMaskRandAudio5 }; component3.randomClips = randomClips; component3.audioMaxInterval = 12f; component3.audioChancePercent = 80f; } } else { Debug.Log((object)"Mask is nightTime"); ((Renderer)__instance.rendererLOD0).SetMaterials(new List { GzdaczeSuit }); ((Renderer)__instance.rendererLOD1).SetMaterials(new List { GzdaczeSuit }); ((Renderer)__instance.rendererLOD2).SetMaterials(new List { GzdaczeSuit }); Transform val = __instance.maskTypes[0].transform.Find("Mesh"); Transform val2 = __instance.maskTypes[0].transform.Find("ComedyMaskLOD1"); ((Component)val).gameObject.SetActive(false); ((Component)val2).gameObject.SetActive(false); GameObject gameObject3 = ((Component)((Component)__instance).transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/LevelSticker")).gameObject; GameObject gameObject4 = ((Component)((Component)__instance).transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/BetaBadge")).gameObject; gameObject3.SetActive(false); gameObject4.SetActive(false); if (!((Object)(object)GzdaczMaskRandAudio1 == (Object)null) && !((Object)(object)GzdaczMaskRandAudio2 == (Object)null) && !((Object)(object)GzdaczMaskRandAudio3 == (Object)null)) { RandomPeriodicAudioPlayer component4 = __instance.maskTypes[0].GetComponent(); AudioClip[] randomClips2 = (AudioClip[])(object)new AudioClip[3] { GzdaczMaskRandAudio1, GzdaczMaskRandAudio2, GzdaczMaskRandAudio3 }; component4.randomClips = randomClips2; component4.audioMaxInterval = 12f; component4.audioChancePercent = 80f; } } } } [HarmonyPatch(typeof(GrabbableObject))] internal class GrabbableObject_Patch { [HarmonyPatch("SetScrapValue")] [HarmonyPrefix] public static bool Prefix(GrabbableObject __instance) { if (__instance is DepositableItem) { return false; } return true; } } [HarmonyPatch(typeof(TVScript))] internal class TVScript_Patch { [HarmonyPatch("OnEnable")] [HarmonyPostfix] public static void Postfix(TVScript __instance) { if (!__instance.tvClips.Contains(rockusAdVid) && !__instance.tvAudioClips.Contains(rockusAdAudio)) { List list = __instance.tvClips.ToList(); list.Add(rockusAdVid); __instance.tvClips = list.ToArray(); List list2 = __instance.tvAudioClips.ToList(); list2.Add(rockusAdAudio); __instance.tvAudioClips = list2.ToArray(); } } } private const string GUID = "WaterGun.PyrkonScripts"; private const string NAME = "Pyrkon"; private const string VER = "1.0.0"; public static Sprite? headerLogo; public static Item? maxplaierCup; public static Item? maxplaierCap; public static Item? maxplaierPillow; public static Item? chuckenPillow; public static Item? rockus; public static Item? trash; public static Item? oiikaBroom; public static Item? admirozdroj; public static Item? starbucksCup; public static Item? leszekBanana; public static Item? jayPhone; public static Item? jayJam; public static GameObject? companyDeposit; public static UnlockableItem DepositMachine = new UnlockableItem(); public static GameObject? haalandPlushieObj; public static UnlockableItem HaalandPlushie = new UnlockableItem(); public static Material? PyrkonMaskSuit; public static Mesh? PyrkonMaskMesh; public static Material? PyrkonMaskMat; public static AudioClip? PyrkonMaskAudio; public static AudioClip? PyrkonMaskRandAudio1; public static AudioClip? PyrkonMaskRandAudio2; public static AudioClip? PyrkonMaskRandAudio3; public static AudioClip? PyrkonMaskRandAudio4; public static AudioClip? PyrkonMaskRandAudio5; public static AudioClip? GzdaczMaskRandAudio1; public static AudioClip? GzdaczMaskRandAudio2; public static AudioClip? GzdaczMaskRandAudio3; public static Material? GzdaczeSuit; public static VideoClip? rockusAdVid; public static AudioClip? rockusAdAudio; public static EnemyType? tsurayaCat; public static VideoClip? tsurayaCatVid; public static GameObject? treeParticle1; public static GameObject? treeParticle2; public static GameObject? treeParticle3; public static GameObject? pyrkonNetworkObject; public static AudioClip? menuMusic; public static List treeBreaks = new List(); private void Awake() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } Harmony val = new Harmony("WaterGun.PyrkonScripts"); val.PatchAll(); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "pyrkonassets"); AssetBundle val2 = AssetBundle.LoadFromFile(text); pyrkonNetworkObject = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/NetworkPyrkon.prefab"); pyrkonNetworkObject.AddComponent(); headerLogo = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MainMenu/pyrkontitle.png"); menuMusic = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MainMenu/PyrkonMainTheme.ogg"); maxplaierCup = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/MaxCup/MaxplaierCup.asset"); maxplaierCap = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/MaxCap/MaxplaierCap.asset"); maxplaierPillow = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/MaxPillow/MaxplaierPillow.asset"); chuckenPillow = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/ChuckenPillow/ChuckenPillow.asset"); oiikaBroom = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/OiikaBroom/OiikaBroom.asset"); starbucksCup = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/StarbucksCup/StarbucksCup.asset"); leszekBanana = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/LeszekBanana/LeszekBanana.asset"); jayPhone = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/JayPhone/JayPhone.asset"); jayJam = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/JayJam/JayJam.asset"); rockus = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/Rockus/Rockus.asset"); admirozdroj = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/Admirozdroj/AdmiroZdroj.asset"); companyDeposit = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Unlockables/CompanyDeposit/CompanyDeposit.prefab"); trash = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Items/Trash/Trash.asset"); haalandPlushieObj = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Unlockables/Haaland/HaalandContainer.prefab"); PyrkonMaskSuit = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/PyrkonMaskSkin.mat"); PyrkonMaskMesh = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/PyrkonMaskMesh.asset"); PyrkonMaskMat = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/PyrkonMaskMat.mat"); PyrkonMaskAudio = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/MaskSound.ogg"); PyrkonMaskRandAudio1 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/RandomMaskSound1.ogg"); PyrkonMaskRandAudio2 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/RandomMaskSound2.ogg"); PyrkonMaskRandAudio3 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/RandomMaskSound3.ogg"); PyrkonMaskRandAudio4 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/RandomMaskSound4.ogg"); PyrkonMaskRandAudio5 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/RandomMaskSound5.ogg"); GzdaczMaskRandAudio1 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/GzdaczSound1.ogg"); GzdaczMaskRandAudio2 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/GzdaczSound2.ogg"); GzdaczMaskRandAudio3 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/GzdaczSound3.ogg"); GzdaczeSuit = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/MaskedSkin/GzdaczeMaskSkin.mat"); rockusAdVid = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/TVPatches/rockus_reklama.mp4"); rockusAdAudio = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/TVPatches/rockus_reklama_audio.ogg"); tsurayaCat = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Enemies/TsurayaEnemy.asset"); tsurayaCatVid = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Enemies/TsurayaVid.mp4"); treeParticle1 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Trees/Particles/GreenLeafParticle.prefab"); treeParticle2 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Trees/Particles/GreenMappleParticle.prefab"); treeParticle3 = val2.LoadAsset("Assets/LethalCompany/Mods/Moons/Pyrkon/Trees/Particles/GreenSwampParticle.prefab"); treeBreaks.Add(treeParticle1); treeBreaks.Add(treeParticle2); treeBreaks.Add(treeParticle3); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded!"); } } public class PyrkonBoomBox : NetworkBehaviour { public AudioSource Boombox; public void SetBoombox() { SetBoomboxRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetBoomboxRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0081: 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_00b3: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2215438205u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2215438205u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Boombox.isPlaying) { Boombox.Stop(); return; } RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.5f, 0, false, 0); Boombox.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 ((NetworkBehaviour)this).__registerRpc(2215438205u, new RpcReceiveHandler(__rpc_handler_2215438205), "SetBoomboxRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2215438205(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; ((PyrkonBoomBox)(object)target).SetBoomboxRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PyrkonBoomBox"; } } public class PyrkonNetwork : NetworkBehaviour { public static PyrkonNetwork Instance; private void Awake() { Instance = this; } [Rpc(/*Could not decode attribute arguments.*/)] public void BreakSpecialTreeRpc(int breakTreePrefab, Vector3 pos, int playerWhoSent) { //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_0043: 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_005f: 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_0076: 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_00a8: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(334894786u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, breakTreePrefab); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendRpc(ref val2, 334894786u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId != playerWhoSent) { RoundManager.Instance.DestroySpecialTreeAtPosition(breakTreePrefab, pos); } } } 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(334894786u, new RpcReceiveHandler(__rpc_handler_334894786), "BreakSpecialTreeRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_334894786(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_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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int breakTreePrefab = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref breakTreePrefab); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyrkonNetwork)(object)target).BreakSpecialTreeRpc(breakTreePrefab, pos, playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PyrkonNetwork"; } } [Serializable] public class SelectableConnector { public Transform? connectorTransform; public GameObject? connectorBlocker; public MeshRenderer? connectorPointer; } public class RandomEntrance : NetworkBehaviour { [Header("Refrences")] public List entranceConnectors = new List(); public Material? pointerMat; [Space(5f)] [Header("Settings")] public List selectableEntrances = new List(); public static RandomEntrance? Instance; private int readyClients = 0; private void Awake() { Instance = this; } private void SelectEntrances() { if (!((NetworkBehaviour)this).IsServer) { return; } List list = new List(); while (list.Count < selectableEntrances.Count) { int item = Random.Range(0, entranceConnectors.Count); if (!list.Contains(item)) { list.Add(item); } } SyncEntrancesRpc(list.ToArray()); } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncEntrancesRpc(int[] connectors) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_0043: 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_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_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_00f0: 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_00c2: 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_019a: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(712864538u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = connectors != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(connectors, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 712864538u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; int num = 0; Vector3 val4 = default(Vector3); Quaternion val5 = default(Quaternion); foreach (int num2 in connectors) { Debug.Log((object)$"Selected: {num2}"); Transform connectorTransform = entranceConnectors[num2].connectorTransform; if ((Object)(object)pointerMat != (Object)null) { MeshRenderer? connectorPointer = entranceConnectors[num2].connectorPointer; if (connectorPointer != null) { ((Renderer)connectorPointer).SetMaterials(new List { pointerMat }); } } if ((Object)(object)connectorTransform != (Object)null) { connectorTransform.GetPositionAndRotation(ref val4, ref val5); selectableEntrances[num].SetPositionAndRotation(val4, val5); num++; } } int j; for (j = 0; j < entranceConnectors.Count; j++) { if (!connectors.Any((int c) => c == j)) { GameObject? connectorBlocker = entranceConnectors[j].connectorBlocker; if (connectorBlocker != null) { connectorBlocker.SetActive(true); } Debug.Log((object)$"Blocked: {j}"); } else { GameObject? connectorBlocker2 = entranceConnectors[j].connectorBlocker; if (connectorBlocker2 != null) { connectorBlocker2.SetActive(false); } } } Debug.Log((object)"Synced entrances"); } [Rpc(/*Could not decode attribute arguments.*/)] public void ConnectClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0081: 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_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2663791435u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2663791435u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; readyClients++; if (readyClients == StartOfRound.Instance.connectedPlayersAmount) { SelectEntrances(); Debug.Log((object)"Selecting entrances..."); } } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((NetworkBehaviour)this).IsServer) { ConnectClientRpc(); } else if (((NetworkBehaviour)this).IsServer && StartOfRound.Instance.connectedPlayersAmount == 0) { SelectEntrances(); } } 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(712864538u, new RpcReceiveHandler(__rpc_handler_712864538), "SyncEntrancesRpc"); ((NetworkBehaviour)this).__registerRpc(2663791435u, new RpcReceiveHandler(__rpc_handler_2663791435), "ConnectClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_712864538(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_006e: 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_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)); int[] connectors = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref connectors, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomEntrance)(object)target).SyncEntrancesRpc(connectors); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2663791435(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; ((RandomEntrance)(object)target).ConnectClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RandomEntrance"; } } [Serializable] public class VariantType { public List materials; public Mesh mesh; } public class StarbucksCupItem : GrabbableObject { public List variants = new List(); public MeshRenderer rend; public MeshFilter filter; private int chosenVariant = -1; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer && !base.scrapPersistedThroughRounds) { int variantRpc = Random.Range(0, variants.Count); SetVariantRpc(variantRpc); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetVariantRpc(int random) { //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_0043: 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_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_0068: 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_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3728956216u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, random); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3728956216u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Renderer)rend).SetMaterials(variants[random].materials); filter.mesh = variants[random].mesh; chosenVariant = random; } } } public override int GetItemDataToSave() { return chosenVariant; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); chosenVariant = saveData; SetVariantRpc(saveData); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3728956216u, new RpcReceiveHandler(__rpc_handler_3728956216), "SetVariantRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3728956216(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 variantRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref variantRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((StarbucksCupItem)(object)target).SetVariantRpc(variantRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "StarbucksCupItem"; } } public static class RoundManagerExtensions { public static void DestroySpecialTreeOnLocalClient(this RoundManager roundManager, int breakTreePrefab, Vector3 pos) { //IL_0007: 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 (RoundManager.Instance.DestroySpecialTreeAtPosition(breakTreePrefab, pos)) { PyrkonNetwork.Instance.BreakSpecialTreeRpc(breakTreePrefab, pos, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } public static bool DestroySpecialTreeAtPosition(this RoundManager roundManager, int breakTreePrefab, Vector3 pos, float range = 5f) { //IL_0001: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapSphereNonAlloc(pos, range, roundManager.tempColliderResults, 33554432, (QueryTriggerInteraction)1); if (num == 0) { return false; } float num2 = Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, pos); if (num2 < 15f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num2 < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } PumaAI val = Object.FindObjectOfType(); for (int i = 0; i < num; i++) { if ((Object)(object)val != (Object)null) { val.RemoveTree(((Component)roundManager.tempColliderResults[i]).gameObject); } Object.Destroy((Object)(object)((Component)roundManager.tempColliderResults[i]).gameObject); AudioSource component = Object.Instantiate(Plugin.treeBreaks[breakTreePrefab], ((Component)roundManager.tempColliderResults[i]).gameObject.transform.position + Vector3.up, Quaternion.identity).GetComponent(); if (Random.Range(0, 20) < 10) { component.clip = roundManager.breakTreeAudio1; } else { component.clip = roundManager.breakTreeAudio2; } component.Play(); } return true; } } public class TreeCollider : MonoBehaviour { public int breakTreePrefab; private void OnTriggerEnter(Collider other) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_002c: 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_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) VehicleController component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null) && ((NetworkBehaviour)component).IsOwner && ((Vector3)(ref component.averageVelocity)).magnitude > 5f && Vector3.Angle(component.averageVelocity, ((Component)this).transform.position - component.mainRigidbody.position) < 80f) { RoundManager.Instance.DestroySpecialTreeOnLocalClient(breakTreePrefab, ((Component)this).transform.position); component.CarReactToObstacle(component.mainRigidbody.position - ((Component)this).transform.position, ((Component)this).transform.position, Vector3.zero, (CarObstacleType)2, 1f, (EnemyAI)null, false); } } } public class TsurayaCatAI : EnemyAI { private enum State { SearchingForPlayer, ApproachingPlayer, HuntingPlayer } public AudioClip[]? meowAudio; public AudioClip[]? growling; public AudioClip[]? purring; public Transform? Head; private int isWalkingBool = Animator.StringToHash("Walk"); private int isSprintingBool = Animator.StringToHash("Sprint"); private int transformTrigger = Animator.StringToHash("Transform"); private int unTransformTrigger = Animator.StringToHash("Untransform"); private bool walkActive; private bool sprintActive; private NetworkVariable isRaged = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private float lastRageTime; private bool transforming; private bool transformed; private bool isAbleToMeow = true; private bool isAbleToGrowl = true; private bool isAbleToPurr = true; private void SetWalk(bool value) { if (walkActive != value) { walkActive = value; SetAnimRpc(isBool: true, isWalkingBool, value); } } private void SetSprint(bool value) { if (sprintActive != value) { sprintActive = value; SetAnimRpc(isBool: true, isSprintingBool, value); } } public override void DoAIInterval() { //IL_00ce: 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_01be: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead && StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 2f; transformed = false; if (((NetworkBehaviour)this).IsServer) { SetSprint(value: false); } if (((NetworkBehaviour)this).IsServer) { SetWalk(value: true); } if (((NetworkBehaviour)this).IsServer && isAbleToMeow) { ((MonoBehaviour)this).StartCoroutine(MeowRandomlyAfterDelay()); } if (FoundClosestPlayerInRange(50f, 1f) || ((Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 50f && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 50, -1f, (Transform)null))) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourState(1); } break; case 1: base.agent.speed = 1f; if (((NetworkBehaviour)this).IsServer) { SetSprint(value: false); } if (((NetworkBehaviour)this).IsServer) { SetWalk(value: true); } if (((NetworkBehaviour)this).IsServer && isAbleToMeow) { ((MonoBehaviour)this).StartCoroutine(MeowRandomlyAfterDelay()); } if (!FoundClosestPlayerInRange(10f, 1f) || ((Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 10f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 10, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourState(0); if (((NetworkBehaviour)this).IsServer && isAbleToPurr) { ((MonoBehaviour)this).StartCoroutine(PurrRandomlyAfterDelay()); } } if ((Object)(object)base.targetPlayer != (Object)null && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 3, -1f, (Transform)null)) { ((EnemyAI)this).SwitchToBehaviourState(2); } if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false); } break; case 2: if ((Time.realtimeSinceStartup - lastRageTime > 20f && isRaged.Value) || !TargetClosestPlayerInAnyCase()) { if (((NetworkBehaviour)this).IsServer) { SetSprint(value: false); } base.agent.speed = 0f; isRaged.Value = false; if (((NetworkBehaviour)this).IsServer && transforming && transformed) { transforming = false; SetAnimRpc(isBool: false, unTransformTrigger, boolValue: false); if (isAbleToGrowl) { ((MonoBehaviour)this).StartCoroutine(GrowlRandomlyAfterDelay()); } } ((MonoBehaviour)this).StartCoroutine(SetBehaviourAfterDelay(3f, 0)); } if (isRaged.Value && transformed && ((NetworkBehaviour)this).IsServer) { SetWalk(value: false); SetSprint(value: true); base.agent.speed = 6f; if (isAbleToGrowl) { ((MonoBehaviour)this).StartCoroutine(GrowlRandomlyAfterDelay()); } } if (!isRaged.Value && !transformed && ((NetworkBehaviour)this).IsServer) { lastRageTime = Time.realtimeSinceStartup; base.agent.speed = 0f; if (!transforming) { JumpToFearLevelWithDistanceRpc(10f, 1f); transforming = true; transformed = true; SetWalk(value: false); SetAnimRpc(isBool: false, transformTrigger, boolValue: false); ((MonoBehaviour)this).StartCoroutine(SetRageAfterDelay(3f, value: true)); if (isAbleToPurr) { ((MonoBehaviour)this).StartCoroutine(PurrRandomlyAfterDelay()); } } } if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false); } break; } } public override void OnCollideWithPlayer(Collider other) { //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_0055: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).OnCollideWithPlayer(other); if (isRaged.Value) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { val.KillPlayer(new Vector3(0f, 100f, 0f), true, (CauseOfDeath)18, 10, default(Vector3), false); ((EnemyAI)this).SwitchToBehaviourState(0); } } } private IEnumerator SetBehaviourAfterDelay(float delay, int state) { yield return (object)new WaitForSeconds(delay); ((EnemyAI)this).SwitchToBehaviourState(state); } private IEnumerator SetRageAfterDelay(float delay, bool value) { yield return (object)new WaitForSeconds(delay); isRaged.Value = value; } private IEnumerator MeowRandomlyAfterDelay() { if (meowAudio != null && meowAudio.Length >= 1) { isAbleToMeow = false; PlayRandomMeowRpc(Random.Range(0, meowAudio.Length)); yield return (object)new WaitForSeconds((float)Random.Range(2, 6)); isAbleToMeow = true; } } private IEnumerator GrowlRandomlyAfterDelay() { if (growling != null && growling.Length >= 1) { isAbleToGrowl = false; PlayRandomGrowlRpc(Random.Range(0, growling.Length)); yield return (object)new WaitForSeconds((float)Random.Range(3, 6)); isAbleToGrowl = true; } } private IEnumerator PurrRandomlyAfterDelay() { if (purring != null && purring.Length >= 1) { isAbleToPurr = false; PlayRandomPurrRpc(Random.Range(0, purring.Length)); yield return (object)new WaitForSeconds((float)Random.Range(4, 10)); isAbleToPurr = true; } } private bool TargetClosestPlayerInAnyCase() { //IL_001f: 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) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0054: 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) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f, false, false, true); range = senseRange; } return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } [Rpc(/*Could not decode attribute arguments.*/)] private void JumpToFearLevelWithDistanceRpc(float distance, float fearLevel) { //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_0043: 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_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_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_008f: 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_00a9: 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_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_00fb: 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) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3678724445u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref distance, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fearLevel, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3678724445u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position) < distance) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(fearLevel, true); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayRandomGrowlRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: 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_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_0068: 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_0084: 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_00e7: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(365281195u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 365281195u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioSource creatureVoice = base.creatureVoice; AudioClip[]? array = growling; creatureVoice.PlayOneShot((array != null) ? array[index] : null); if (Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, ((Component)this).transform.position) < 10f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayRandomMeowRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: 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_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_0068: 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_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2469470033u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2469470033u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioSource creatureVoice = base.creatureVoice; AudioClip[]? array = meowAudio; creatureVoice.PlayOneShot((array != null) ? array[index] : null); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayRandomPurrRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: 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_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_0068: 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_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2515118103u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2515118103u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioSource creatureVoice = base.creatureVoice; AudioClip[]? array = purring; creatureVoice.PlayOneShot((array != null) ? array[index] : null); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetAnimRpc(bool isBool, int anim, bool boolValue) { //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_0043: 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_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_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_0083: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3364885500u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isBool, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, anim); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref boolValue, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3364885500u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (isBool) { base.creatureAnimator.SetBool(anim, boolValue); } else { base.creatureAnimator.SetTrigger(anim); } } } protected override void __initializeVariables() { if (isRaged == null) { throw new Exception("TsurayaCatAI.isRaged cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isRaged).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isRaged, "isRaged"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isRaged); ((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 //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(3678724445u, new RpcReceiveHandler(__rpc_handler_3678724445), "JumpToFearLevelWithDistanceRpc"); ((NetworkBehaviour)this).__registerRpc(365281195u, new RpcReceiveHandler(__rpc_handler_365281195), "PlayRandomGrowlRpc"); ((NetworkBehaviour)this).__registerRpc(2469470033u, new RpcReceiveHandler(__rpc_handler_2469470033), "PlayRandomMeowRpc"); ((NetworkBehaviour)this).__registerRpc(2515118103u, new RpcReceiveHandler(__rpc_handler_2515118103), "PlayRandomPurrRpc"); ((NetworkBehaviour)this).__registerRpc(3364885500u, new RpcReceiveHandler(__rpc_handler_3364885500), "SetAnimRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3678724445(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 distance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref distance, default(ForPrimitives)); float fearLevel = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fearLevel, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TsurayaCatAI)(object)target).JumpToFearLevelWithDistanceRpc(distance, fearLevel); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_365281195(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((TsurayaCatAI)(object)target).PlayRandomGrowlRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2469470033(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((TsurayaCatAI)(object)target).PlayRandomMeowRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2515118103(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((TsurayaCatAI)(object)target).PlayRandomPurrRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3364885500(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_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) { bool isBool = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isBool, default(ForPrimitives)); int anim = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref anim); bool boolValue = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boolValue, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TsurayaCatAI)(object)target).SetAnimRpc(isBool, anim, boolValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TsurayaCatAI"; } } public class WindowsManager : NetworkBehaviour { [Header("Refrences")] public Transform? windowContainer; public GameObject? WarningUI; public Material? lightTexture; public Material? disabledTexture; public AudioClip? lightSequenceClip; public AudioClip? lightEnableClip; public AudioClip? warningSound; public AudioSource? mainSource; public List maskSpawns = new List(); public static WindowsManager? Instance; private EnemyType? maskEnemy; private bool hasBeenEnabled = false; private TimeOfDay TOD; private MeshRenderer[]? windowRenderers; private List? lightList; private List? disabledList; private Animator? pyrkonUIAnimator; private GameObject? pyrkonUIobj; public void TrySetLights() { if (!hasBeenEnabled && TOD.currentDayTime >= 900f && windowRenderers != null) { ((MonoBehaviour)this).StartCoroutine(handleSounds()); ((MonoBehaviour)this).StartCoroutine(handleEnemies()); RoundManager.Instance.FlickerLights(false, false); MeshRenderer[] array = windowRenderers; foreach (MeshRenderer renderer in array) { ((MonoBehaviour)this).StartCoroutine(flickerSequence(renderer)); } hasBeenEnabled = true; } } public IEnumerator flickerSequence(MeshRenderer renderer) { if (!((Object)(object)lightTexture == (Object)null) && !((Object)(object)disabledTexture == (Object)null) && !((Object)(object)mainSource == (Object)null)) { ((Renderer)renderer).SetSharedMaterials(lightList); yield return (object)new WaitForSeconds(0.1f); ((Renderer)renderer).SetSharedMaterials(disabledList); yield return (object)new WaitForSeconds(0.3f); ((Renderer)renderer).SetSharedMaterials(lightList); yield return (object)new WaitForSeconds(0.2f); ((Renderer)renderer).SetSharedMaterials(disabledList); yield return (object)new WaitForSeconds(0.1f); ((Renderer)renderer).SetSharedMaterials(lightList); yield return (object)new WaitForSeconds(0.4f); ((Renderer)renderer).SetSharedMaterials(disabledList); yield return (object)new WaitForSeconds(0.1f); ((Renderer)renderer).SetSharedMaterials(lightList); } } public IEnumerator handleSounds() { if (!((Object)(object)mainSource == (Object)null)) { mainSource.PlayOneShot(lightSequenceClip); yield return (object)new WaitForSeconds(1.3f); mainSource.PlayOneShot(lightEnableClip); } } public IEnumerator handleEnemies() { yield return (object)new WaitForSeconds(2f); Animator? obj = pyrkonUIAnimator; if (obj != null) { obj.SetTrigger("Alert"); } HUDManager.Instance.UIAudio.PlayOneShot(warningSound); yield return (object)new WaitForSeconds(8f); foreach (Transform spawn in maskSpawns) { RoundManager.Instance.SpawnEnemyGameObject(spawn.position, spawn.rotation.y, -1, maskEnemy); } } private void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown TimeOfDay.Instance.onHourChanged.AddListener(new UnityAction(TrySetLights)); } public override void OnDestroy() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ((NetworkBehaviour)this).OnDestroy(); TimeOfDay.Instance.onHourChanged.RemoveListener(new UnityAction(TrySetLights)); if ((Object)(object)pyrkonUIobj != (Object)null) { Object.Destroy((Object)(object)pyrkonUIobj); } } private void Awake() { Instance = this; maskEnemy = Resources.FindObjectsOfTypeAll().First((EnemyType e) => e.enemyName == "Masked"); TOD = TimeOfDay.Instance; if ((Object)(object)windowContainer != (Object)null) { windowRenderers = ((Component)windowContainer).GetComponentsInChildren(); } if ((Object)(object)lightTexture != (Object)null && (Object)(object)disabledTexture != (Object)null) { lightList = new List { lightTexture }; disabledList = new List { disabledTexture }; } if ((Object)(object)WarningUI != (Object)null) { pyrkonUIobj = Object.Instantiate(WarningUI, HUDManager.Instance.HUDContainer.transform); pyrkonUIAnimator = pyrkonUIobj.GetComponent(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string? __getTypeName() { return "WindowsManager"; } } public class WobbleLiquid : MonoBehaviour { public enum UpdateMode { Normal, UnscaledTime } public UpdateMode updateMode; [SerializeField] private float MaxWobble = 0.03f; [SerializeField] private float WobbleSpeedMove = 1f; [SerializeField] private float fillAmount = 0.5f; [SerializeField] private float Recovery = 1f; [SerializeField] private float Thickness = 1f; [Range(0f, 1f)] public float CompensateShapeAmount; [SerializeField] private Mesh mesh; [SerializeField] private Renderer rend; private Vector3 pos; private Vector3 lastPos; private Vector3 velocity; private Quaternion lastRot; private Vector3 angularVelocity; private float wobbleAmountX; private float wobbleAmountZ; private float wobbleAmountToAddX; private float wobbleAmountToAddZ; private float pulse; private float sinewave; private float time = 0.5f; private Vector3 comp; private void Start() { GetMeshAndRend(); } private void OnValidate() { GetMeshAndRend(); } private void GetMeshAndRend() { if ((Object)(object)mesh == (Object)null) { mesh = ((Component)this).GetComponent().sharedMesh; } if ((Object)(object)rend == (Object)null) { rend = ((Component)this).GetComponent(); } } private void Update() { //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_025a: 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_010e: 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_011e: 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_0129: 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_013c: 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_0146: Unknown result type (might be due to invalid IL or missing references) float num = 0f; switch (updateMode) { case UpdateMode.Normal: num = Time.deltaTime; break; case UpdateMode.UnscaledTime: num = Time.unscaledDeltaTime; break; } time += num; if (num != 0f) { wobbleAmountToAddX = Mathf.Lerp(wobbleAmountToAddX, 0f, num * Recovery); wobbleAmountToAddZ = Mathf.Lerp(wobbleAmountToAddZ, 0f, num * Recovery); pulse = MathF.PI * 2f * WobbleSpeedMove; sinewave = Mathf.Lerp(sinewave, Mathf.Sin(pulse * time), num * Mathf.Clamp(((Vector3)(ref velocity)).magnitude + ((Vector3)(ref angularVelocity)).magnitude, Thickness, 10f)); wobbleAmountX = wobbleAmountToAddX * sinewave; wobbleAmountZ = wobbleAmountToAddZ * sinewave; velocity = (lastPos - ((Component)this).transform.position) / num; angularVelocity = GetAngularVelocity(lastRot, ((Component)this).transform.rotation); wobbleAmountToAddX += Mathf.Clamp((velocity.x + velocity.y * 0.2f + angularVelocity.z + angularVelocity.y) * MaxWobble, 0f - MaxWobble, MaxWobble); wobbleAmountToAddZ += Mathf.Clamp((velocity.z + velocity.y * 0.2f + angularVelocity.x + angularVelocity.y) * MaxWobble, 0f - MaxWobble, MaxWobble); } rend.sharedMaterial.SetFloat("_WobbleX", wobbleAmountX); rend.sharedMaterial.SetFloat("_WobbleZ", wobbleAmountZ); UpdatePos(num); lastPos = ((Component)this).transform.position; lastRot = ((Component)this).transform.rotation; } private void UpdatePos(float deltaTime) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0059: 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_0128: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_0086: 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_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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0117: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; Bounds bounds = mesh.bounds; float x = ((Bounds)(ref bounds)).center.x; bounds = mesh.bounds; float y = ((Bounds)(ref bounds)).center.y; bounds = mesh.bounds; Vector3 val = transform.TransformPoint(new Vector3(x, y, ((Bounds)(ref bounds)).center.z)); if (CompensateShapeAmount > 0f) { if (deltaTime != 0f) { comp = Vector3.Lerp(comp, val - new Vector3(0f, GetLowestPoint(), 0f), deltaTime * 10f); } else { comp = val - new Vector3(0f, GetLowestPoint(), 0f); } pos = val - ((Component)this).transform.position - new Vector3(0f, fillAmount - comp.y * CompensateShapeAmount, 0f); } else { pos = val - ((Component)this).transform.position - new Vector3(0f, fillAmount, 0f); } rend.sharedMaterial.SetVector("_FillAmount", Vector4.op_Implicit(pos)); } private Vector3 GetAngularVelocity(Quaternion foreLastFrameRotation, Quaternion lastFrameRotation) { //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) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0030: 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_006d: 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_00cf: 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_009c: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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) Quaternion val = lastFrameRotation * Quaternion.Inverse(foreLastFrameRotation); if (Mathf.Abs(val.w) > 0.9995117f) { return Vector3.zero; } float num2; if (val.w < 0f) { float num = Mathf.Acos(0f - val.w); num2 = -2f * num / (Mathf.Sin(num) * Time.deltaTime); } else { float num3 = Mathf.Acos(val.w); num2 = 2f * num3 / (Mathf.Sin(num3) * Time.deltaTime); } Vector3 zero = default(Vector3); ((Vector3)(ref zero))..ctor(val.x * num2, val.y * num2, val.z * num2); if (float.IsNaN(zero.z)) { zero = Vector3.zero; } return zero; } private float GetLowestPoint() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0043: 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 num = float.MaxValue; Vector3 val = Vector3.zero; Vector3[] vertices = mesh.vertices; for (int i = 0; i < vertices.Length; i++) { Vector3 val2 = ((Component)this).transform.TransformPoint(vertices[i]); if (val2.y < num) { num = val2.y; val = val2; } } return val.y; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace PyrkonScripts.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }