using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using JLL; using JLL.API; using JLL.API.Events; using JLL.Components; using JLL.Patches; using JLLItemsModule.Components; using JLLItemsModule.NetcodePatcher; using JLLItemsModule.Patches; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; [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("JLLItemsModule")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("JLLItemsModule")] [assembly: AssemblyTitle("JLLItemsModule")] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 JLLItemsModule { [BepInPlugin("JacobG5.JLLItemModule", "JLLItemModule", "1.3.7")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class JLLItemsCore : BaseUnityPlugin { private const string modGUID = "JacobG5.JLLItemModule"; private const string modName = "JLLItemModule"; private const string modVersion = "1.3.7"; private readonly Harmony harmony = new Harmony("JacobG5.JLLItemModule"); public void Awake() { JLL.NetcodePatch(JLogHelper.GetSource(), new Type[6] { typeof(JEventBoxItem), typeof(JGrabbableObject), typeof(JInteractableItem), typeof(JMeleeWeapon), typeof(JNoisemakerProp), typeof(JThrowableItem) }); JLL.HarmonyPatch(harmony, JLogHelper.GetSource(), new Type[2] { typeof(PlayerPatch), typeof(DepositItemsDeskPatch) }); } } } namespace JLLItemsModule.Patches { [HarmonyPatch(typeof(DepositItemsDesk))] internal class DepositItemsDeskPatch { [HarmonyPatch("AddObjectToDeskClientRpc")] [HarmonyPostfix] public static void patchAddObjectToDeskClientRpc(NetworkObjectReference grabbableObjectNetObject) { NetworkObject val = default(NetworkObject); JGrabbableObject jGrabbableObject = default(JGrabbableObject); if (((NetworkObjectReference)(ref grabbableObjectNetObject)).TryGet(ref val, (NetworkManager)null) && ((Component)val).TryGetComponent(ref jGrabbableObject)) { jGrabbableObject.PlacedOnDepositDesk(); jGrabbableObject.OnPlacedOnDepositDesk.Invoke(); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerPatch { [HarmonyPatch("SetItemInElevator")] [HarmonyPrefix] public static void patchSetItemInElevator(bool droppedInShipRoom, bool droppedInElevator, GrabbableObject gObject) { if (gObject.isInShipRoom != droppedInShipRoom && gObject is JGrabbableObject jGrabbableObject) { jGrabbableObject.OnSetInsideShip(droppedInShipRoom); ((UnityEvent)(object)jGrabbableObject.OnSetInShip).Invoke(droppedInShipRoom); } } } } namespace JLLItemsModule.Components { public class JEventBoxItem : JGrabbableObject { [CompilerGenerated] private sealed class d__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabbableObject gObject; public JEventBoxItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; Debug.Log((object)("Setting " + gObject.itemProperties.itemName + " hit ground to false")); gObject.reachedFloorTarget = false; gObject.hasHitGround = false; gObject.fallTime = 0f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Event Box")] public bool canOpenInOrbit = true; public int boxUses = 1; public bool destroyWhenEmpty = true; private float lastUsedTime = 0f; public float openCooldown = 0.4f; public PlayerEvent OpenEvent = new PlayerEvent(); public WeightedEvent[] RandomOpenEvent = (WeightedEvent[])(object)new WeightedEvent[1] { new WeightedEvent { Weight = 20 } }; [Header("Item Spawner")] public bool spawnItemsOnOpen = true; public int numberToSpawn = 1; public SpawnPoolSource SourcePool = (SpawnPoolSource)0; public WeightedItemRefrence[] CustomList = (WeightedItemRefrence[])(object)new WeightedItemRefrence[1] { new WeightedItemRefrence() }; [Header("Audio & FX")] public ParticleSystem? PoofParticle; public AudioSource? BoxAudio; public AudioClip? OpenBoxClip; [HideInInspector] public PlayerControllerB previousPlayerHeldBy; public override void Start() { ((GrabbableObject)this).Start(); WeightedItemRefrence[] customList = CustomList; foreach (WeightedItemRefrence val in customList) { val.FindRegistered(); } } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); boxUses = saveData; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return boxUses; } public override void EquipItem() { base.EquipItem(); previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((canOpenInOrbit || !StartOfRound.Instance.inShipPhase) && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && boxUses > 0 && Time.realtimeSinceStartup - lastUsedTime > openCooldown) { lastUsedTime = Time.realtimeSinceStartup; ((GrabbableObject)this).playerHeldBy.activatingItem = true; if (((NetworkBehaviour)this).IsOwner) { OpenGiftBoxServerRpc(); } } } public override void PocketItem() { base.PocketItem(); ((GrabbableObject)this).playerHeldBy.activatingItem = false; } [ServerRpc(RequireOwnership = false)] public void OpenGiftBoxServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1900567855u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1900567855u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; boxUses--; int num = -1; if (RandomOpenEvent.Length != 0) { IWeightedItem[] randomOpenEvent = (IWeightedItem[])(object)RandomOpenEvent; num = IWeightedItem.GetRandomIndex(randomOpenEvent); if (!RandomOpenEvent[num].SendClientRPC) { InvokeRandomEvent(num); num = -1; } } if (spawnItemsOnOpen) { SpawnItemsOnServer(numberToSpawn); } OpenBoxClientRpc(num, boxUses); } public virtual void SpawnItemsOnServer(int amount) { SpawnItemsServerRpc(amount); } [ServerRpc(RequireOwnership = false)] private void SpawnItemsServerRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2647915572u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2647915572u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val3 = ((Component)this).transform.position + Vector3.up * 0.25f; Transform val4 = ((((!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) || !((GrabbableObject)this).playerHeldBy.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); SpawnPoolSource sourcePool = SourcePool; Quaternion rotation = ((Component)this).transform.rotation; List> list = ItemSpawner.SpawnRandomItems(sourcePool, val3, val4, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f), CustomList, (Vector3[])null, amount, false, (RotationType)2); foreach (KeyValuePair item in list) { item.Key.startFallingPosition = val3; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(item.Key)); item.Key.targetFloorPosition = item.Key.GetItemFloorPosition(((Component)this).transform.position); if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, item.Key); } ((NetworkBehaviour)item.Key).NetworkObject.Spawn(false); ItemSpawner.OverrideScrapValue(item.Key, item.Value); } } [IteratorStateMachine(typeof(d__24))] private IEnumerator SetObjectToHitGroundSFX(GrabbableObject gObject) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { <>4__this = this, gObject = gObject }; } [ClientRpc] private void OpenBoxClientRpc(int weightedEvent, int usesLeft) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1016085238u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, weightedEvent); BytePacker.WriteValueBitPacked(val2, usesLeft); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1016085238u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)PoofParticle != (Object)null) { PoofParticle.Play(); } if ((Object)(object)BoxAudio != (Object)null && (Object)(object)OpenBoxClip != (Object)null) { BoxAudio.PlayOneShot(OpenBoxClip); WalkieTalkie.TransmitOneShotAudio(BoxAudio, OpenBoxClip, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)BoxAudio).transform.position, 8f, 0.5f, 0, ((GrabbableObject)this).isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); } boxUses = usesLeft; OnBoxOpen(); InvokeRandomEvent(weightedEvent); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((UnityEvent)(object)OpenEvent).Invoke(((GrabbableObject)this).playerHeldBy); ((GrabbableObject)this).playerHeldBy.activatingItem = false; if (destroyWhenEmpty && boxUses <= 0) { ((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy); } } } private void InvokeRandomEvent(int weightedEvent) { if (weightedEvent >= 0 && weightedEvent < RandomOpenEvent.Length) { RandomOpenEvent[weightedEvent].Event.Invoke(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((UnityEvent)(object)RandomOpenEvent[weightedEvent].PlayerEvent).Invoke(((GrabbableObject)this).playerHeldBy); } } } public virtual void OnBoxOpen() { } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1900567855u, new RpcReceiveHandler(__rpc_handler_1900567855), "OpenGiftBoxServerRpc"); ((NetworkBehaviour)this).__registerRpc(2647915572u, new RpcReceiveHandler(__rpc_handler_2647915572), "SpawnItemsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1016085238u, new RpcReceiveHandler(__rpc_handler_1016085238), "OpenBoxClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1900567855(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; ((JEventBoxItem)(object)target).OpenGiftBoxServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2647915572(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 amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((JEventBoxItem)(object)target).SpawnItemsServerRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1016085238(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 weightedEvent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref weightedEvent); int usesLeft = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref usesLeft); target.__rpc_exec_stage = (__RpcExecStage)1; ((JEventBoxItem)(object)target).OpenBoxClientRpc(weightedEvent, usesLeft); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JEventBoxItem"; } } public class JGrabbableObject : GrabbableObject { [Header("JGrabbableObject")] public GameObject chargedEffects; public GameObject[] hideWhenPocketed = (GameObject[])(object)new GameObject[0]; public UnityEvent OnEquip = new UnityEvent(); public InteractEvent OnEquipPlayer = new InteractEvent(); public UnityEvent OnPocketed = new UnityEvent(); public InteractEvent OnPocketedPlayer = new InteractEvent(); public BoolEvent OnSetInShip = new BoolEvent(); public UnityEvent OnPlacedOnDepositDesk = new UnityEvent(); public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if ((Object)(object)base.playerHeldBy != (Object)null && base.isHeld) { HeldUpdate(); } if (base.itemProperties.requiresBattery && base.insertedBattery != null) { GameObject obj = chargedEffects; if (obj != null) { obj.SetActive(!base.insertedBattery.empty); } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); GameObject[] array = hideWhenPocketed; foreach (GameObject val in array) { val.SetActive(true); } OnEquip.Invoke(); if ((Object)(object)base.playerHeldBy != (Object)null) { ((UnityEvent)(object)OnEquipPlayer).Invoke(base.playerHeldBy); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); GameObject[] array = hideWhenPocketed; foreach (GameObject val in array) { val.SetActive(false); } OnPocketed.Invoke(); if ((Object)(object)base.playerHeldBy != (Object)null) { ((UnityEvent)(object)OnPocketedPlayer).Invoke(base.playerHeldBy); } } public virtual void HeldUpdate() { } public virtual void OnSetInsideShip(bool isEntering) { } public virtual void PlacedOnDepositDesk() { } public bool IsBeingHeldByPlayer() { return (Object)(object)base.playerHeldBy != (Object)null && base.isHeld; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "JGrabbableObject"; } } public class JInteractableItem : JGrabbableObject { public enum InteractionType { Press, Toggle, Hold } [Header("Interactable Item")] public InteractionType interactionType = InteractionType.Press; public InteractEvent OnUse = new InteractEvent(); public BoolEvent OnToggle = new BoolEvent(); public UnityEvent OnHoldingButton = new UnityEvent(); [Header("Extra Events")] public InteractEvent CollisionEvent = new InteractEvent(); [Space(5f)] public AudioClip[] interactSFX = (AudioClip[])(object)new AudioClip[0]; public AudioClip[] disableSFX = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudio; public float maxVolume = 1f; public float minVolume = 0.8f; public Animator? triggerAnimator; [HideInInspector] public PlayerControllerB? playerLastHeld; private bool toggle = false; public override void EquipItem() { base.EquipItem(); playerLastHeld = ((GrabbableObject)this).playerHeldBy; } public override void ItemActivate(bool used, bool buttonDown = true) { if (used && (Object)(object)playerLastHeld != (Object)null) { ((UnityEvent)(object)OnUse).Invoke(playerLastHeld); } switch (interactionType) { case InteractionType.Toggle: ToggleInteract(!toggle); break; case InteractionType.Hold: if (buttonDown) { OnHoldInteraction(); OnHoldingButton.Invoke(); } break; default: InteractFX(interactSFX, "interact"); break; } } public virtual void InteractFX(AudioClip[] clips, string trigger) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) Animator? obj = triggerAnimator; if (obj != null) { obj.SetTrigger(trigger); } if ((Object)(object)noiseAudio != (Object)null && Object.op_Implicit((Object)(object)noiseAudio) && clips.Length != 0) { int num = Random.Range(0, clips.Length); if ((Object)(object)clips[num] != (Object)null) { float num2 = Random.Range(minVolume, maxVolume); noiseAudio.PlayOneShot(clips[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)noiseAudio).transform.position, 4f * num2, num2 * 0.5f, 0, false, 0); } } } public void ToggleInteract() { ToggleInteract(!toggle); } public void ToggleInteract(bool on) { toggle = on; if (on) { InteractFX(interactSFX, "toggleOn"); } else { InteractFX(disableSFX, "toggleOff"); } ((GrabbableObject)this).isBeingUsed = on; OnToggled(on); ((UnityEvent)(object)OnToggle).Invoke(on); } public virtual void OnToggled(bool on) { } public virtual void OnHoldInteraction() { } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if ((Object)(object)playerLastHeld != (Object)null) { ((UnityEvent)(object)CollisionEvent).Invoke(playerLastHeld); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "JInteractableItem"; } } public class JMeleeWeapon : JGrabbableObject { [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JMeleeWeapon <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.activatingItem = true; ((GrabbableObject)<>4__this).playerHeldBy.twoHanded = true; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); if (JLLExtentions.IsLocalPlayer(((GrabbableObject)<>4__this).playerHeldBy)) { <>4__this.reelingAnimSpeed = 0.35f / <>4__this.reelingTime; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.speed = <>4__this.reelingAnimSpeed; } <>4__this.PlayRandomSFX(<>4__this.reelUpSFX); <>4__this.ReelUpSFXServerRpc(); <>2__current = (object)new WaitForSeconds(<>4__this.reelingTime); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !<>4__this.isHoldingButton || !((GrabbableObject)<>4__this).isHeld)); <>1__state = 2; return true; case 2: <>1__state = -1; if (JLLExtentions.IsLocalPlayer(((GrabbableObject)<>4__this).playerHeldBy)) { ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.speed = 1f; } <>4__this.SwingHeavyWeapon(!((GrabbableObject)<>4__this).isHeld); <>2__current = (object)new WaitForSeconds(<>4__this.swingTime); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this.HitWeapon(!((GrabbableObject)<>4__this).isHeld); <>2__current = (object)new WaitForSeconds(<>4__this.weaponCooldown); <>1__state = 5; return true; case 5: <>1__state = -1; <>4__this.reelingUp = false; <>4__this.reelingUpCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Melee Weapon")] public int HitForce = 1; [Tooltip("Shovel Default: 1.5\nKnife Default: 0.3")] public float weaponRange = 1.5f; [Tooltip("Shovel Default: 0.3\nKnife Default: 0.43")] public float weaponCooldown = 0.3f; [Tooltip("Leave blank for no blood particle on hit")] public ParticleSystem bloodParticle; private float timeAtLastDamageDealt; [Tooltip("Player is the player who swung the weapon")] public UnityEvent OnHitSuccess = new UnityEvent(); public LayerMask hitMask = LayerMask.op_Implicit(1084754248); [Tooltip("Default: 1\nPop Butlers: 5")] public int HitId = 1; [Header("Heavy Weapons")] [Tooltip("Heavy Weapons are similar to the shovel or signs.\nNon Heavy Weapons are similar to the Kitchen Knife")] public bool isHeavyWeapon = true; [Tooltip("Shovel Default: 0.35")] public float reelingTime = 0.35f; private float reelingAnimSpeed = 1f; [Tooltip("Shovel Default: 0.13")] public float swingTime = 0.13f; private bool reelingUp; private bool isHoldingButton; private Coroutine? reelingUpCoroutine; [Header("Damage Targets")] public bool damagePlayers = true; [Tooltip("Passes a Player that has been damaged by the weapon")] public UnityEvent OnPlayerHit = new UnityEvent(); public bool damageEnemies = true; [Tooltip("Passes an Enemy that has been damaged by the weapon")] public UnityEvent OnEnemyHit = new UnityEvent(); public bool damageVehicles = false; [Tooltip("Passes a Vehicle that has been damaged by the weapon")] public UnityEvent OnVehicleHit = new UnityEvent(); public bool damageObjects = true; [Tooltip("Passes an Object that has been damaged by the weapon")] public UnityEvent OnObjectHit = new UnityEvent(); [Header("Audio")] public AudioClip[] hitSFX; [Tooltip("Only used for Heavy Weapons")] public AudioClip[] reelUpSFX; public AudioClip[] swingSFX; public AudioSource weaponAudio; [HideInInspector] public PlayerControllerB previousPlayerHeldBy; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) { return; } previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (((GrabbableObject)this).itemProperties.requiresBattery && ((GrabbableObject)this).insertedBattery.empty) { return; } if (isHeavyWeapon) { isHoldingButton = buttonDown; if (!(!reelingUp && buttonDown)) { return; } reelingUp = true; previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (reelingUpCoroutine != null) { if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = 1f; } ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(ReelBackWeapon()); return; } PlayRandomSFX(swingSFX); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("UseHeldItem1"); } } if (((NetworkBehaviour)this).IsOwner && Time.realtimeSinceStartup - timeAtLastDamageDealt > weaponCooldown) { HitWeapon(); } } [IteratorStateMachine(typeof(d__29))] private IEnumerator ReelBackWeapon() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this }; } [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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3259025159u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3259025159u, val, (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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2764645124u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2764645124u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayRandomSFX(reelUpSFX); } } } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = 1f; } } ((GrabbableObject)this).DiscardItem(); } public virtual void SwingHeavyWeapon(bool cancel = false) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { PlayRandomSFX(swingSFX); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public bool HitWeapon(bool cancel = false) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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_030d: 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_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Expected I4, but got Unknown if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called."); return false; } previousPlayerHeldBy.activatingItem = false; int num = -1; bool flag = false; bool flag2 = false; if (!cancel) { previousPlayerHeldBy.twoHanded = false; RaycastHit[] source = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, weaponRange / 1.5f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, weaponRange, LayerMask.op_Implicit(hitMask), (QueryTriggerInteraction)2); List list = source.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); List list2 = new List(); Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; IHittable val = default(IHittable); VehicleController val8 = default(VehicleController); foreach (RaycastHit item in list) { RaycastHit current = item; if (((Component)((RaycastHit)(ref current)).collider).gameObject.layer == 8 || ((Component)((RaycastHit)(ref current)).collider).gameObject.layer == 11) { if (((RaycastHit)(ref current)).collider.isTrigger) { continue; } for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (((Component)((RaycastHit)(ref current)).collider).gameObject.tag == StartOfRound.Instance.footstepSurfaces[i].surfaceTag) { num = i; flag = true; break; } } continue; } if (((Component)((RaycastHit)(ref current)).collider).TryGetComponent(ref val)) { GameObject val2 = null; ColliderType val3 = (ColliderType)3; bool flag3 = true; EnemyAICollisionDetect val4 = (EnemyAICollisionDetect)(object)((val is EnemyAICollisionDetect) ? val : null); if (val4 != null) { flag3 = damageEnemies; val2 = ((Component)val4.mainScript).gameObject; val3 = (ColliderType)1; } else { PlayerControllerB val5 = (PlayerControllerB)(object)((val is PlayerControllerB) ? val : null); if (val5 != null) { if (val5.actualClientId == previousPlayerHeldBy.actualClientId) { continue; } flag3 = damagePlayers; val2 = ((Component)val5).gameObject; val3 = (ColliderType)0; } else { flag3 = damageObjects; val2 = ((Component)((RaycastHit)(ref current)).collider).gameObject; } } JLogHelper.LogInfo($"{((Object)((RaycastHit)(ref current)).transform).name} {flag3}", (JLogLevel)2); if (flag3 && (Object)(object)val2 != (Object)null && !list2.Contains(val2) && OnWeaponHit(val, forward)) { list2.Add(val2); if (!flag) { flag = true; } if (!flag2) { flag2 = true; } ColliderType val6 = val3; ColliderType val7 = val6; switch ((int)val7) { case 0: { OnPlayerHit.Invoke(((Component)((RaycastHit)(ref current)).collider).GetComponent()); ParticleSystem obj2 = bloodParticle; if (obj2 != null) { obj2.Play(true); } break; } case 1: { OnEnemyHit.Invoke(((Component)((RaycastHit)(ref current)).collider).GetComponent().mainScript); ParticleSystem obj = bloodParticle; if (obj != null) { obj.Play(true); } break; } case 3: OnObjectHit.Invoke(val); break; } } } if (damageVehicles && ((Component)((RaycastHit)(ref current)).collider).TryGetComponent(ref val8) && !list2.Contains(((Component)val8).gameObject)) { list2.Add(((Component)val8).gameObject); flag = true; val8.PushTruckServerRpc(((Component)previousPlayerHeldBy).transform.position, forward); VehicleControllerPatch.DealPermanentDamage((object)val8, HitForce, ((Component)previousPlayerHeldBy).transform.position); OnVehicleHit.Invoke(val8); } } } if (flag) { timeAtLastDamageDealt = Time.realtimeSinceStartup; PlayRandomSFX(hitSFX); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { weaponAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(weaponAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } if (isHeavyWeapon) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); } HitWeaponServerRpc(num); } return flag; } public virtual bool OnWeaponHit(IHittable target, Vector3 hitDir) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) return target.Hit(HitForce, hitDir, previousPlayerHeldBy, true, HitId); } [ServerRpc] public void HitWeaponServerRpc(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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1250179881u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1250179881u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitWeaponClientRpc(hitSurfaceID); } } [ClientRpc] public void HitWeaponClientRpc(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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(209898509u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 209898509u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayRandomSFX(hitSFX); OnHitSuccess.Invoke(previousPlayerHeldBy); if (hitSurfaceID != -1) { HitSurface(hitSurfaceID); } } } private void PlayRandomSFX(AudioClip[] clips) { if (clips.Length > 1) { RoundManager.PlayRandomClip(weaponAudio, clips, true, 1f, 0, 1000); } else if (clips.Length == 1) { weaponAudio.PlayOneShot(clips[0], Random.Range(0.82f, 1f)); } } private void HitSurface(int hitSurfaceID) { weaponAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(weaponAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3259025159u, new RpcReceiveHandler(__rpc_handler_3259025159), "ReelUpSFXServerRpc"); ((NetworkBehaviour)this).__registerRpc(2764645124u, new RpcReceiveHandler(__rpc_handler_2764645124), "ReelUpSFXClientRpc"); ((NetworkBehaviour)this).__registerRpc(1250179881u, new RpcReceiveHandler(__rpc_handler_1250179881), "HitWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(209898509u, new RpcReceiveHandler(__rpc_handler_209898509), "HitWeaponClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3259025159(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; ((JMeleeWeapon)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2764645124(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; ((JMeleeWeapon)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1250179881(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; ((JMeleeWeapon)(object)target).HitWeaponServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_209898509(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; ((JMeleeWeapon)(object)target).HitWeaponClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JMeleeWeapon"; } } public class JNoisemakerProp : JGrabbableObject { [Header("Noisemaker")] public bool isToggle = false; public bool waitForCompletion = false; private float activeClipLength = 0f; private float lastUsedTime = 0f; [Space(5f)] public AudioClip[] noiseSFX = (AudioClip[])(object)new AudioClip[0]; public AudioClip[] disableSFX = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudio; public AudioClip[] noiseSFXFar = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudioFar; [Space(3f)] [Tooltip("Airhorn: 65\nCash Register: 25\nClown Horn: 60\nHair Dryer: 30")] public float noiseRange = 60f; [Tooltip("Airhorn: 1\nCash Register: 1\nClown Horn: 1\nHair Dryer: 0.9")] public float maxLoudness = 1f; [Tooltip("Airhorn: 0.95\nCash Register: 0.9\nClown Horn: 0.6\nHair Dryer: 0.8")] public float minLoudness = 0.6f; [Tooltip("Airhorn: 1\nCash Register: 1\nClown Horn: 1\nHair Dryer: 1")] public float maxPitch = 1f; [Tooltip("Airhorn: 0.8\nCash Register: 0.95\nClown Horn: 0.93\nHair Dryer: 0.96")] public float minPitch = 0.93f; private Random noisemakerRandom; public Animator? triggerAnimator; public override void Start() { ((GrabbableObject)this).Start(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_029b: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (Time.realtimeSinceStartup - lastUsedTime < activeClipLength) { if (isToggle) { if ((Object)(object)noiseAudio != (Object)null) { noiseAudio.Stop(); if (disableSFX.Length != 0) { int num = noisemakerRandom.Next(0, disableSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(disableSFX[num], num2); } } AudioSource obj = noiseAudioFar; if (obj != null) { obj.Stop(); } activeClipLength = 0f; return; } if (waitForCompletion) { return; } } if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { int num3 = noisemakerRandom.Next(0, noiseSFX.Length); float num4 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch2 = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; activeClipLength = noiseSFX[num3].length; lastUsedTime = Time.realtimeSinceStartup; if ((Object)(object)noiseAudio != (Object)null) { noiseAudio.pitch = pitch2; noiseAudio.PlayOneShot(noiseSFX[num3], num4); } if ((Object)(object)noiseAudioFar != (Object)null && num3 < noiseSFXFar.Length) { noiseAudioFar.pitch = pitch2; noiseAudioFar.PlayOneShot(noiseSFXFar[num3], num4); } Animator? obj2 = triggerAnimator; if (obj2 != null) { obj2.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num3], num4); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num4, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); if (minLoudness >= 0.6f && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.timeSinceMakingLoudNoise = 0f; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "JNoisemakerProp"; } } public class JThrowableItem : JGrabbableObject { [CompilerGenerated] private sealed class d__58 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JThrowableItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__58(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>4__this.inInteractAnimation = true; ((GrabbableObject)<>4__this).playerHeldBy.activatingItem = true; ((GrabbableObject)<>4__this).playerHeldBy.doingUpperBodyEmote = 1.16f; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetTrigger(<>4__this.playerAnimation); Animator? itemAnimator = <>4__this.itemAnimator; if (itemAnimator != null) { itemAnimator.SetTrigger("pullPin"); } if (Object.op_Implicit((Object)(object)<>4__this.itemAudio) && (Object)(object)<>4__this.interactSFX != (Object)null) { <>4__this.itemAudio.PlayOneShot(<>4__this.interactSFX); WalkieTalkie.TransmitOneShotAudio(<>4__this.itemAudio, <>4__this.interactSFX, 0.8f); } ((UnityEvent)(object)<>4__this.InteractionEvent).Invoke(((GrabbableObject)<>4__this).playerHeldBy); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } case 1: <>1__state = -1; if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null) { if (!<>4__this.destroyOnExplode) { ((GrabbableObject)<>4__this).playerHeldBy.activatingItem = false; } <>4__this.playerThrownBy = ((GrabbableObject)<>4__this).playerHeldBy; } <>4__this.inInteractAnimation = false; <>4__this.interactedWith = true; ((GrabbableObject)<>4__this).itemUsedUp = true; if (((NetworkBehaviour)<>4__this).IsOwner && (Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null) { ((GrabbableObject)<>4__this).SetControlTipsForItem(); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Throwable Item")] public bool throwable = true; public string throwString = "Throw grenade: [RMB]"; private LayerMask projectileMask = LayerMask.op_Implicit(268437761); public AnimationCurve projectileFallCurve; public AnimationCurve projectileVerticalFallCurve; public AnimationCurve projectileVerticalFallCurveNoBounce; [Header("Explosion Settings")] public bool damageOnExplode = false; public bool stunOnExplode = false; public bool spawnItemsOnExplode = false; public GameObject? explosionPrefab; public bool hasExploded = false; [Tooltip("Random chance is rolled on impact. If interaction is required then explosion chance will only be rolled on collisions after the interaction has been performed")] public float chanceToExplodeOnThrow = 100f; [Tooltip("Random chance is rolled on impact. If interaction is required then explosion chance will only be rolled on collisions after the interaction has been performed")] public float chanceToExplodeOnDropped = 100f; public bool destroyOnExplode = false; [Header("Interact Before Throw")] public bool hasInteraction = false; public string interactString = "Pull pin: [RMB]"; public string playerAnimation = "PullGrenadePin"; public bool interactedWith = false; private bool inInteractAnimation = false; private Coroutine? interactCoroutine; public bool interactionStartsTimer = false; [Tooltip("Waits timeToExplode before exploding. If interactionStartsTimer is checked the timer will have to run twice for the explosion to occur.")] [FormerlySerializedAs("explodeOnTimer")] public bool explosionStartsTimer = false; private bool markedToExplode = false; public float timeToExplode = 2.25f; private float explodeTimer = 0f; [Header("Explosion Properties")] public float killDistance = 0.5f; public float damageRange = 3f; public int nonLethalDamage = 40; public float pushForce = 45f; public bool goThroughCar = false; [Header("Stun Explosion Properties")] public bool affectAudio = true; public float flashSeverityMultiplier = 1f; public float enemyStunTime = 7.5f; public float flashSeverityDistanceRolloff = 1f; [Header("Item Spawner")] [Tooltip("How many items get spawned in")] public int numberToSpawn = 1; public SpawnPoolSource SourcePool = (SpawnPoolSource)0; public WeightedItemRefrence[] CustomList = (WeightedItemRefrence[])(object)new WeightedItemRefrence[1] { new WeightedItemRefrence() }; [Tooltip("Spawn offsets. Index is the number spawned")] public Vector3[] SpawnOffsets = (Vector3[])(object)new Vector3[0]; [Header("Events")] public UnityEvent ExplodeEvent = new UnityEvent(); public InteractEvent ThrowEvent = new InteractEvent(); public InteractEvent InteractionEvent = new InteractEvent(); public InteractEvent CollisionEvent = new InteractEvent(); [Header("FX")] [Tooltip("Trigger: \"pullPin\"\nTrigger: \"explode\"")] public Animator? itemAnimator; public AudioSource itemAudio; public AudioClip? interactSFX; public AudioClip? explodeSFX; private bool explodeOnThrow = false; private bool explodeOnDrop = false; public bool wasThrown = false; [HideInInspector] public PlayerControllerB? playerThrownBy; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (inInteractAnimation) { return; } if (hasInteraction && !interactedWith) { if (interactCoroutine == null) { ((GrabbableObject)this).playerHeldBy.activatingItem = true; interactCoroutine = ((MonoBehaviour)this).StartCoroutine(interactAnimation()); } } else if (((NetworkBehaviour)this).IsOwner && throwable) { ThrowItem(); } } public virtual void ThrowItem() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) wasThrown = true; ((UnityEvent)(object)ThrowEvent).Invoke(((GrabbableObject)this).playerHeldBy); ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetThrowDestination(), true); } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { base.EquipItem(); playerThrownBy = ((GrabbableObject)this).playerHeldBy; explodeOnThrow = false; explodeOnDrop = false; wasThrown = false; SetExplodeOnThrowServerRpc(); } [ServerRpc(RequireOwnership = false)] public void SetExplodeOnThrowServerRpc() { //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) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4058280918u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4058280918u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetExplodeOnThrowClientRpc(new Random(StartOfRound.Instance.randomMapSeed + 10 + (int)((Component)this).transform.position.x + (int)((Component)this).transform.position.z).Next(0, 100)); } } } [ClientRpc] public void SetExplodeOnThrowClientRpc(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(217367956u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, random); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 217367956u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; explodeOnThrow = (float)random <= chanceToExplodeOnThrow; explodeOnDrop = (float)random <= chanceToExplodeOnDropped; } } } public override void SetControlTipsForItem() { List list = new List(); list.AddRange(((GrabbableObject)this).itemProperties.toolTips); if (hasInteraction && !interactedWith) { list.Add(interactString); } else if (throwable) { list.Add(throwString); } HUDManager.Instance.ChangeControlTipMultiple(list.ToArray(), true, ((GrabbableObject)this).itemProperties); } public override void FallWithCurve() { //IL_0002: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0086: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, projectileFallCurve.Evaluate(((GrabbableObject)this).fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), projectileVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), projectileVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } [IteratorStateMachine(typeof(d__58))] private IEnumerator interactAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__58(0) { <>4__this = this }; } public override void Update() { ((GrabbableObject)this).Update(); if (((!interactionStartsTimer || !interactedWith) && (!explosionStartsTimer || !markedToExplode)) || hasExploded) { return; } explodeTimer += Time.deltaTime; if (explodeTimer > timeToExplode) { if (interactionStartsTimer && explosionStartsTimer && !markedToExplode) { markedToExplode = true; explodeTimer = 0f; } else { ExplodeProjectile(destroyOnExplode); } } } public override void Start() { ((GrabbableObject)this).Start(); if (!hasInteraction) { interactedWith = true; } } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if ((Object)(object)playerThrownBy != (Object)null && (!hasInteraction || interactedWith)) { ((UnityEvent)(object)CollisionEvent).Invoke(playerThrownBy); OnItemCollision(wasThrown); } } public virtual void OnItemCollision(bool thrown) { if ((thrown && explodeOnThrow) || (!thrown && explodeOnDrop)) { ExplodeProjectile(destroyOnExplode); } } public void ExplodeProjectile(bool destroy = false) { if (hasExploded) { return; } if ((Object)(object)StartOfRound.Instance.currentLevel != (Object)null && !StartOfRound.Instance.currentLevel.spawnEnemiesAndScrap) { DepositItemsDesk val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null && (Object)(object)playerThrownBy != (Object)null && (Object)(object)((GrabbableObject)this).parentObject == (Object)(object)val.deskObjectsContainer) { playerThrownBy.activatingItem = false; return; } } Animator? obj = itemAnimator; if (obj != null) { obj.SetTrigger("explode"); } if (explosionStartsTimer && !markedToExplode) { markedToExplode = true; return; } hasExploded = true; ExplodeEvent.Invoke(); Transform parent = ((!((GrabbableObject)this).isInElevator) ? RoundManager.Instance.mapPropsContainer.transform : StartOfRound.Instance.elevatorTransform); CreateExplosion(parent); if (destroy) { ((GrabbableObject)this).DestroyObjectInHand(playerThrownBy); } } public virtual void CreateExplosion(Transform parent) { //IL_0012: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (damageOnExplode) { Landmine.SpawnExplosion(((Component)this).transform.position, false, killDistance, damageRange, nonLethalDamage, pushForce, (GameObject)null, goThroughCar); } if (stunOnExplode) { StunGrenadeItem.StunExplosion(((Component)this).transform.position, affectAudio, flashSeverityMultiplier, enemyStunTime, flashSeverityDistanceRolloff, ((GrabbableObject)this).isHeld, ((GrabbableObject)this).playerHeldBy, playerThrownBy, 0f); } if (spawnItemsOnExplode) { SpawnItemsOnServer(numberToSpawn); } if ((Object)(object)explosionPrefab != (Object)null) { Object.Instantiate(explosionPrefab, ((Component)this).transform.position, Quaternion.identity, parent); } if (Object.op_Implicit((Object)(object)itemAudio) && (Object)(object)explodeSFX != (Object)null) { itemAudio.PlayOneShot(explodeSFX); WalkieTalkie.TransmitOneShotAudio(itemAudio, explodeSFX, 1f); } } public void ResetExplosionTimer() { explodeTimer = 0f; } public void SpawnItemsOnServer(int amount) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position + Vector3.up * 0.25f; Transform val2 = ((!((GrabbableObject)this).isInElevator) ? RoundManager.Instance.mapPropsContainer.transform : StartOfRound.Instance.elevatorTransform); SpawnPoolSource sourcePool = SourcePool; Quaternion rotation = ((Component)this).transform.rotation; ItemSpawner.SpawnRandomItems(sourcePool, val, val2, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f), CustomList, SpawnOffsets, amount, true, (RotationType)2); } public Vector3 GetThrowDestination() { //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_001d: 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_0037: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_0126: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Debug.DrawRay(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f); Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); position = ((!Physics.Raycast(val, ref val2, 12f, LayerMask.op_Implicit(projectileMask), (QueryTriggerInteraction)1)) ? ((Ray)(ref val)).GetPoint(10f) : ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val2)).distance - 0.05f)); Debug.DrawRay(position, Vector3.down, Color.blue, 15f); ((Ray)(ref val))..ctor(position, Vector3.down); if (Physics.Raycast(val, ref val2, 30f, LayerMask.op_Implicit(projectileMask), (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val2)).point + Vector3.up * 0.05f; } return ((Ray)(ref val)).GetPoint(30f); } private void OnDrawGizmosSelected() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) if (damageOnExplode) { if (killDistance > 0f) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, killDistance); } if (damageRange > 0f) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, damageRange); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4058280918u, new RpcReceiveHandler(__rpc_handler_4058280918), "SetExplodeOnThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(217367956u, new RpcReceiveHandler(__rpc_handler_217367956), "SetExplodeOnThrowClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_4058280918(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; ((JThrowableItem)(object)target).SetExplodeOnThrowServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_217367956(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 explodeOnThrowClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref explodeOnThrowClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((JThrowableItem)(object)target).SetExplodeOnThrowClientRpc(explodeOnThrowClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JThrowableItem"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace JLLItemsModule.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }