Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of pnot0sThings v1.1.0
plugins/pnot0s Things/pnot0s Things.dll
Decompiled 2 years agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TestItem.Extensions; using Unity.Netcode; using UnityEngine; using pnot0s Things.NetcodePatcher; using pnot0sThings.Behaviour; using pnot0sThings.ItemBehaviour; using pnot0sThings.MonoBehaviours; [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("pnot0s Things")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first LC mod")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("pnot0s Things")] [assembly: AssemblyTitle("pnot0s Things")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace pnot0sThings { [BepInPlugin("pnot0.pnot0sThings", "pnot0sThings", "1.0")] public class Plugin : BaseUnityPlugin { private const string GUID = "pnot0.pnot0sThings"; private const string NAME = "pnot0sThings"; private const string VERSION = "1.0"; public static Plugin instance; private void Awake() { instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "pnot0sthings"); AssetBundle val = AssetBundle.LoadFromFile(text); Item val2 = val.LoadAsset<Item>("Assets/pnot0sThings/CatObject/CatObjectItem.asset"); Item val3 = val.LoadAsset<Item>("Assets/pnot0sThings/FaultyRPG/FaultyRPGObjectItem.asset"); Item val4 = val.LoadAsset<Item>("Assets/pnot0sThings/SpeedCoil/SpeedCoilObjectItem.asset"); Item val5 = val.LoadAsset<Item>("Assets/pnot0sThings/GravityCoil/GravityCoilObjectItem.asset"); Item val6 = val.LoadAsset<Item>("Assets/pnot0sThings/AlbumVinyl/AlbumVinylObjectItem.asset"); Item val7 = val.LoadAsset<Item>("Assets/pnot0sThings/DollySoda/DollySodaObjectItem.asset"); Item val8 = val.LoadAsset<Item>("Assets/pnot0sThings/DollarBills/DollarBillsObjectItem.asset"); Item val9 = val.LoadAsset<Item>("Assets/pnot0sThings/ZapSoda/ZapSodaObjectItem.asset"); Item val10 = val.LoadAsset<Item>("Assets/pnot0sThings/Colt1911/Colt1911ObjectItem.asset"); CatItem catItem = val2.spawnPrefab.AddComponent<CatItem>(); ((GrabbableObject)catItem).itemProperties = val2; FaultyRPG faultyRPG = val3.spawnPrefab.AddComponent<FaultyRPG>(); val3.spawnPrefab.AddComponent<RPGExplosion>(); ((GrabbableObject)faultyRPG).itemProperties = val3; SpeedCoil speedCoil = val4.spawnPrefab.AddComponent<SpeedCoil>(); ((GrabbableObject)speedCoil).itemProperties = val4; GravityCoil gravityCoil = val5.spawnPrefab.AddComponent<GravityCoil>(); ((GrabbableObject)gravityCoil).itemProperties = val5; AlbumVinyl albumVinyl = val6.spawnPrefab.AddComponent<AlbumVinyl>(); ((GrabbableObject)albumVinyl).itemProperties = val6; DollySoda dollySoda = val7.spawnPrefab.AddComponent<DollySoda>(); ((GrabbableObject)dollySoda).itemProperties = val7; DollarBills dollarBills = val8.spawnPrefab.AddComponent<DollarBills>(); ((GrabbableObject)dollarBills).itemProperties = val8; ZapSoda zapSoda = val9.spawnPrefab.AddComponent<ZapSoda>(); ((GrabbableObject)zapSoda).itemProperties = val9; Colt1911 colt = val10.spawnPrefab.AddComponent<Colt1911>(); ((GrabbableObject)colt).itemProperties = val10; NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); Utilities.FixMixerGroups(val3.spawnPrefab); Utilities.FixMixerGroups(val4.spawnPrefab); Utilities.FixMixerGroups(val5.spawnPrefab); Utilities.FixMixerGroups(val6.spawnPrefab); Utilities.FixMixerGroups(val7.spawnPrefab); Utilities.FixMixerGroups(val8.spawnPrefab); Utilities.FixMixerGroups(val9.spawnPrefab); Utilities.FixMixerGroups(val10.spawnPrefab); Items.RegisterScrap(val2, 3, (LevelTypes)(-1)); Items.RegisterScrap(val3, 5, (LevelTypes)(-1)); Items.RegisterScrap(val6, 10, (LevelTypes)(-1)); Items.RegisterScrap(val7, 10, (LevelTypes)(-1)); Items.RegisterScrap(val8, 15, (LevelTypes)(-1)); Items.RegisterScrap(val9, 15, (LevelTypes)(-1)); Items.RegisterScrap(val10, 8, (LevelTypes)(-1)); TerminalNode val11 = ScriptableObject.CreateInstance<TerminalNode>(); val11.clearPreviousText = true; val11.displayText = "Speed Coil"; Items.RegisterShopItem(val4, (TerminalNode)null, (TerminalNode)null, val11, 250); val11.clearPreviousText = true; val11.displayText = "Gravity Coil"; Items.RegisterShopItem(val5, (TerminalNode)null, (TerminalNode)null, val11, 200); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "pnot0sthings"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin pnot0sThings is lock and loaded!"); 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); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "pnot0s Things"; public const string PLUGIN_NAME = "pnot0s Things"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace pnot0sThings.ItemBehaviour { internal class FaultyRPG : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = false; } public override async void ItemActivate(bool used, bool buttonDown = true) { <>n__0(used, buttonDown); if ((Object)(object)base.playerHeldBy != (Object)null && buttonDown) { base.playerHeldBy.itemAudio.PlayOneShot(base.itemProperties.throwSFX); await Task.Delay(1100); } if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsHost) { RPGExplosionSpawn(((Component)base.playerHeldBy).transform.position, ((Component)base.playerHeldBy).transform.rotation); } else { RPGExplosionSpawnServerRpc(((Component)base.playerHeldBy).transform.position, ((Component)base.playerHeldBy).transform.rotation); } PlayerControllerB player = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); player.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] private void RPGExplosionSpawnServerRpc(Vector3 playerPosition, Quaternion playerRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) 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(513859934u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerRotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 513859934u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { RPGExplosionSpawn(playerPosition, playerRotation); } } } private void RPGExplosionSpawn(Vector3 playerPosition, Quaternion playerRotation) { //IL_0011: 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) NetworkObject val = Object.Instantiate<NetworkObject>(base.itemProperties.spawnPrefab.GetComponent<NetworkObject>(), playerPosition, playerRotation); ((Component)val).GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false); ((Component)val).GetComponent<RPGExplosion>().Explode(); ((Component)val).GetComponent<NetworkObject>().Despawn(true); } [CompilerGenerated] [DebuggerHidden] private void <>n__0(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_FaultyRPG() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(513859934u, new RpcReceiveHandler(__rpc_handler_513859934)); } private static void __rpc_handler_513859934(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 playerPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerPosition); Quaternion playerRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((FaultyRPG)(object)target).RPGExplosionSpawnServerRpc(playerPosition, playerRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FaultyRPG"; } } internal class GravityCoil : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); PlayerControllerB playerHeldBy = base.playerHeldBy; playerHeldBy.jumpForce *= 1.8f; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); PlayerControllerB playerHeldBy = base.playerHeldBy; playerHeldBy.jumpForce /= 1.8f; } public override void Update() { ((GrabbableObject)this).Update(); if (base.hasBeenHeld && !base.isHeld && !base.isPocketed) { PlayerControllerB val = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); val.jumpForce /= 1.8f; base.hasBeenHeld = false; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "GravityCoil"; } } internal class RPGExplosion : NetworkBehaviour { public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = true, int damage = 50, float minDamageRange = 0f, float maxDamageRange = 10f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_030e: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val2 = null; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } if (((Component)array[i]).gameObject.layer == 3) { val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner) { float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)); val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3)); } } else if (((Component)array[i]).gameObject.layer == 21) { Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && !(num2 < 6f)) { } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1); } } } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); for (int j = 0; j < array.Length; j++) { Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(70f, explosionPosition, 10f); } } } [ServerRpc] public void ExplodeRPGServerRpc() { //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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1920385105u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1920385105u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ExplodeRPG(); ExplodeRPGClientRpc(); } } [ClientRpc] public void ExplodeRPGClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3948765825u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3948765825u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ExplodeRPG(); } } } public void ExplodeRPG() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 15f, 20, (CauseOfDeath)3); } public void Explode() { if (((NetworkBehaviour)this).IsHost) { ExplodeRPGClientRpc(); } else { ExplodeRPGServerRpc(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RPGExplosion() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1920385105u, new RpcReceiveHandler(__rpc_handler_1920385105)); NetworkManager.__rpc_func_table.Add(3948765825u, new RpcReceiveHandler(__rpc_handler_3948765825)); } private static void __rpc_handler_1920385105(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; ((RPGExplosion)(object)target).ExplodeRPGServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3948765825(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RPGExplosion)(object)target).ExplodeRPGClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RPGExplosion"; } } internal class SpeedCoil : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); PlayerControllerB playerHeldBy = base.playerHeldBy; playerHeldBy.movementSpeed *= 2.5f; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); PlayerControllerB playerHeldBy = base.playerHeldBy; playerHeldBy.movementSpeed /= 2.5f; } public override void Update() { ((GrabbableObject)this).Update(); if (base.hasBeenHeld && !base.isHeld && !base.isPocketed) { PlayerControllerB val = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); val.movementSpeed /= 2.5f; base.hasBeenHeld = false; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SpeedCoil"; } } } namespace pnot0sThings.Behaviour { internal class CatItem : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; base.itemProperties.allowDroppingAheadOfPlayer = false; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (!StartOfRound.Instance.inShipPhase && !base.playerHeldBy.CatItemGetWasItemUsed()) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)base.playerHeldBy != (Object)null && buttonDown) { PlayerControllerB playerHeldBy = base.playerHeldBy; playerHeldBy.movementSpeed *= 2.5f; PlayerControllerB playerHeldBy2 = base.playerHeldBy; playerHeldBy2.jumpForce *= 1.8f; base.playerHeldBy.DamagePlayer(50, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); base.playerHeldBy.itemAudio.PlayOneShot(base.itemProperties.throwSFX); base.playerHeldBy.CatItemWasItemUsed(value: true); ItemTimer(base.playerHeldBy); base.playerHeldBy.DespawnHeldObject(); } } } public async void ItemTimer(PlayerControllerB playerHeldBy) { while (!StartOfRound.Instance.inShipPhase) { await Task.Delay(2000); } if (StartOfRound.Instance.inShipPhase && base.playerHeldBy.CatItemGetWasItemUsed()) { playerHeldBy.CatItemWasItemUsed(value: false); playerHeldBy.movementSpeed /= 2.5f; PlayerControllerB playerHeldBy2 = base.playerHeldBy; playerHeldBy2.jumpForce /= 1.8f; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "CatItem"; } } } namespace pnot0sThings.MonoBehaviours { internal class AlbumVinyl : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "AlbumVinyl"; } } internal class Colt1911 : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; base.itemProperties.allowDroppingAheadOfPlayer = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); base.playerHeldBy.itemAudio.PlayOneShot(base.itemProperties.throwSFX); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Colt1911"; } } internal class DollarBills : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "DollarBills"; } } internal class DollySoda : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "DollySoda"; } } internal class ZapSoda : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; base.itemProperties.allowDroppingAheadOfPlayer = false; } public override async void ItemActivate(bool used, bool buttonDown = true) { <>n__0(used, buttonDown); base.playerHeldBy.drunkness = 10f; base.playerHeldBy.itemAudio.PlayOneShot(base.itemProperties.throwSFX); await Task.Delay(1000); } [CompilerGenerated] [DebuggerHidden] private void <>n__0(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "ZapSoda"; } } } namespace TestItem.Extensions { public static class PlayerControllerBExtensions { private static Dictionary<PlayerControllerB, bool> heldByCustomFlags = new Dictionary<PlayerControllerB, bool>(); public static bool CatItemGetWasItemUsed(this PlayerControllerB player) { if (heldByCustomFlags.ContainsKey(player)) { return heldByCustomFlags[player]; } return false; } public static void CatItemWasItemUsed(this PlayerControllerB player, bool value) { if (heldByCustomFlags.ContainsKey(player)) { heldByCustomFlags[player] = value; } else { heldByCustomFlags.Add(player, value); } } } } namespace pnot0s Things.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }