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 LC Plan de Resurrection v1.6.5
LePlanDeResurection.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LePlanDeResurection.Assets; using LePlanDeResurection.Item; using LePlanDeResurection.NetcodePatcher; using LePlanDeResurection.Util; using LePlanDeResurrection.Item; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; 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: AssemblyTitle("LePlanDeResurection")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LePlanDeResurection")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4BB4F307-9517-4301-ACD8-E3586F60815B")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] namespace LePlanDeResurrection.Item { internal class Lada : GrabbableObject { private AudioSource _audioSource; public float soundVolume = 1f; public AudioClip engineLoopSound; private const float SpeedMultiplier = 2.15f; private float baseMovementSpeedBeforeBoost; private bool boostApplied; private const float KillRange = 3f; private const float DamageRange = 6f; private const int ExplosionDamage = 70; private const float ExplosionForce = 2.5f; public override void Start() { ((GrabbableObject)this).Start(); _audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).GetComponentInChildren<AudioSource>(); } if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); Debug.Log((object)"[Lada] AudioSource créé automatiquement"); } _audioSource.spatialBlend = 1f; _audioSource.volume = soundVolume; _audioSource.minDistance = 1f; _audioSource.maxDistance = 50f; _audioSource.rolloffMode = (AudioRolloffMode)1; _audioSource.playOnAwake = false; _audioSource.loop = true; } public override void Update() { ((GrabbableObject)this).Update(); if (boostApplied && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.sprintMeter = 1f; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ApplyCarSpeedBoost(); PlayEngineLoop(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); RemoveCarSpeedBoost(); StopEngineLoop(); } public override void DiscardItem() { RemoveCarSpeedBoost(); StopEngineLoop(); ((GrabbableObject)this).DiscardItem(); } private void PlayEngineLoop() { if ((Object)(object)engineLoopSound == (Object)null) { Debug.LogWarning((object)"[Lada] engineLoopSound n'est pas assigne ! Verifie Assets.cs"); return; } _audioSource.clip = engineLoopSound; _audioSource.loop = true; _audioSource.Play(); } private void StopEngineLoop() { if ((Object)(object)_audioSource != (Object)null && _audioSource.isPlaying) { _audioSource.Stop(); } } private void ApplyCarSpeedBoost() { if (!boostApplied && !((Object)(object)base.playerHeldBy == (Object)null)) { baseMovementSpeedBeforeBoost = base.playerHeldBy.movementSpeed; base.playerHeldBy.movementSpeed = baseMovementSpeedBeforeBoost * 2.15f; boostApplied = true; } } private void RemoveCarSpeedBoost() { if (boostApplied && !((Object)(object)base.playerHeldBy == (Object)null)) { base.playerHeldBy.movementSpeed = baseMovementSpeedBeforeBoost; boostApplied = false; } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && buttonDown) { Debug.Log((object)"[Lada] ItemActivate declenche, envoi de la demande d'explosion..."); RequestExplosionServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void RequestExplosionServerRpc() { //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_00fb: 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_010e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(174376970u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 174376970u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"[Lada] RequestExplosionServerRpc recu par le serveur."); if ((Object)(object)base.playerHeldBy == (Object)null) { Debug.LogWarning((object)"[Lada] playerHeldBy est null, explosion annulee."); return; } Vector3 position = ((Component)base.playerHeldBy).transform.position; ulong playerClientId = base.playerHeldBy.playerClientId; ExplosionClientRpc(position, playerClientId); } } [ClientRpc] private void ExplosionClientRpc(Vector3 explosionPosition, ulong holderId) { //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_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_0103: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(774169u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref explosionPosition); BytePacker.WriteValueBitPacked(val, holderId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 774169u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"[Lada] ExplosionClientRpc recu, declenchement de la mine."); LadaHolderProtection.ProtectedPlayerId = holderId; LadaHolderProtection.ClearAfterDelay((MonoBehaviour)(object)this, 2f); Landmine.SpawnExplosion(explosionPosition, true, 3f, 6f, 70, 2.5f, (GameObject)null, false); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(174376970u, new RpcReceiveHandler(__rpc_handler_174376970), "RequestExplosionServerRpc"); ((NetworkBehaviour)this).__registerRpc(774169u, new RpcReceiveHandler(__rpc_handler_774169), "ExplosionClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_174376970(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; ((Lada)(object)target).RequestExplosionServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_774169(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_004e: 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 explosionPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref explosionPosition); ulong holderId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref holderId); target.__rpc_exec_stage = (__RpcExecStage)1; ((Lada)(object)target).ExplosionClientRpc(explosionPosition, holderId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Lada"; } } internal static class LadaHolderProtection { public static ulong? ProtectedPlayerId; public static void ClearAfterDelay(MonoBehaviour runner, float delaySeconds) { runner.StartCoroutine(ClearRoutine(delaySeconds)); } private static IEnumerator ClearRoutine(float delaySeconds) { yield return (object)new WaitForSeconds(delaySeconds); ProtectedPlayerId = null; } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] internal static class Lada_PreventHolderDeathPatch { [HarmonyPrefix] private static bool Prefix(PlayerControllerB __instance) { if (LadaHolderProtection.ProtectedPlayerId.HasValue && __instance.playerClientId == LadaHolderProtection.ProtectedPlayerId.Value) { LadaHolderProtection.ProtectedPlayerId = null; return false; } return true; } } internal class TomokariSetup : GrabbableObject { public override void Start() { ((GrabbableObject)this).Start(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && buttonDown) { } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TomokariSetup"; } } } namespace LePlanDeResurection { [BepInPlugin("LePlanDeResurection", "Le Plan De Resurection", "1.6.5")] public class ModMain : BaseUnityPlugin { public static ModMain Instance; public ManualLogSource logger; internal Harmony harmony; internal static KeyboardShortcut testkey = new KeyboardShortcut((KeyCode)107, Array.Empty<KeyCode>()); private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (!((Object)(object)Instance == (Object)null)) { return; } Instance = this; harmony = new Harmony("LePlanDeResurection"); logger = Logger.CreateLogSource("LePlanDeResurection"); harmony.PatchAll(); logger.LogMessage((object)" \n\n db mm `7MMF' 7MMMMMMML \n ;MM: MM MM MM \n ,V^MM. ,p6\"bo ,6\"Yb. `7MMpMMMb. mmMMmm MMpMMMb. MM \n ,M `MM 6M' OO 8) MM MM MM MM MM MM MMMMML \n AbmmmqMA 8M ,pm9MM MM MM MM MM MM MM \n A' VML YM. , 8M MM MM MM MM MM MM MM \n.AMA. .AMMA.YMbmd' `Moo9^Yo..JMML JMML. `Mbmo .JMML JMML..JMMMMMMML.\n"); LePlanDeResurection.Assets.Assets.Init(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); foreach (Type type in types) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class Test { [HarmonyPatch("Update")] [HarmonyPostfix] private static void TestPatch(PlayerControllerB __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (((NetworkBehaviour)__instance).IsOwner && ((KeyboardShortcut)(ref ModMain.testkey)).IsDown() && 1 == 0) { GameObject val = Object.Instantiate<GameObject>(LePlanDeResurection.Assets.Assets.Voiture.spawnPrefab, ((Component)__instance).transform.position, ((Component)__instance).transform.rotation); GrabbableObject component = val.GetComponent<GrabbableObject>(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; component.scrapValue = 1; NetworkObject component2 = val.GetComponent<NetworkObject>(); component2.Spawn(false); } } } } namespace LePlanDeResurection.Util { public class SpawnRarity { private readonly Dictionary<Planet, int> rarities = new Dictionary<Planet, int>(); private readonly Item item; private int defaultValue; public SpawnRarity(int baseValue, Item itemIn) { item = itemIn; defaultValue = baseValue; foreach (Planet value in Enum.GetValues(typeof(Planet))) { rarities.Add(value, baseValue); } } public int GetRarityFor(Planet planet) { return rarities[planet]; } public int GetRarityFor(int planet) { return rarities.Values.ToList()[planet]; } public void SetValues(int experimentation = -1, int assurance = -1, int vow = -1, int march = -1, int offense = -1, int adamance = -1, int rend = -1, int dine = -1, int titan = -1, int artifice = -1, int embrion = -1) { rarities[Planet.EXPERIMENTATION] = experimentation; rarities[Planet.ASSURANCE] = assurance; rarities[Planet.VOW] = vow; rarities[Planet.MARCH] = march; rarities[Planet.OFFENSE] = offense; rarities[Planet.ADAMANCE] = adamance; rarities[Planet.REND] = rend; rarities[Planet.DINE] = dine; rarities[Planet.TITAN] = titan; rarities[Planet.ARTIFICE] = artifice; rarities[Planet.EMBRION] = embrion; } public void CopyRaritiesFrom(SpawnRarity other) { rarities[Planet.EXPERIMENTATION] = other.rarities[Planet.EXPERIMENTATION]; rarities[Planet.ASSURANCE] = other.rarities[Planet.ASSURANCE]; rarities[Planet.VOW] = other.rarities[Planet.VOW]; rarities[Planet.MARCH] = other.rarities[Planet.MARCH]; rarities[Planet.OFFENSE] = other.rarities[Planet.OFFENSE]; rarities[Planet.ADAMANCE] = other.rarities[Planet.ADAMANCE]; rarities[Planet.REND] = other.rarities[Planet.REND]; rarities[Planet.DINE] = other.rarities[Planet.DINE]; rarities[Planet.TITAN] = other.rarities[Planet.TITAN]; rarities[Planet.ARTIFICE] = other.rarities[Planet.ARTIFICE]; rarities[Planet.EMBRION] = other.rarities[Planet.EMBRION]; } public void Multiply(float factor) { foreach (Planet item in rarities.Keys.ToList()) { rarities[item] = (int)((float)rarities[item] * factor); } } public SpawnableItemWithRarity GetSpawnableItemForPlanet(Planet planet) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown return new SpawnableItemWithRarity(item, AccessRaritySafe((int)planet)); } public SpawnableItemWithRarity GetSpawnableItemForPlanet(int planet) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown return new SpawnableItemWithRarity(item, AccessRaritySafe(planet)); } private int AccessRaritySafe(int planet) { try { return (rarities.Values.ToList()[planet] < 0) ? defaultValue : rarities.Values.ToList()[planet]; } catch (Exception) { } return defaultValue; } public void ApplySpawnRarity(SelectableLevel level) { level.spawnableScrap.Add(GetSpawnableItemForPlanet(level.levelID)); } } public enum Planet { EXPERIMENTATION, ASSURANCE, VOW, GORDION, MARCH, ADAMANCE, REND, DINE, OFFENSE, TITAN, ARTIFICE, LIQUIDATION, EMBRION } } namespace LePlanDeResurection.Item { public class Blasteur2caca : GrabbableObject { private AudioSource _audioSource; public AudioClip tipi; public float soundVolume = 1f; [SerializeField] private float batteryUsagePerUse = 0.5f; public override void Start() { ((GrabbableObject)this).Start(); _audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).GetComponentInChildren<AudioSource>(); } if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); Debug.Log((object)"[BolDeCaca] AudioSource créé automatiquement"); } _audioSource.spatialBlend = 1f; _audioSource.volume = soundVolume; _audioSource.minDistance = 1f; _audioSource.maxDistance = 50f; _audioSource.rolloffMode = (AudioRolloffMode)1; _audioSource.playOnAwake = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((NetworkBehaviour)this).IsOwner || !buttonDown || base.insertedBattery == null) { return; } if (base.insertedBattery.charge > 0f) { Battery insertedBattery = base.insertedBattery; insertedBattery.charge -= batteryUsagePerUse; UseitemServerRpc(); SwapPlayerPositions(); Debug.Log((object)$"Batterie restante : {base.insertedBattery.charge * 100f}%"); Debug.Log((object)"item utilise%"); if (base.insertedBattery.charge < 0f) { base.insertedBattery.charge = 0f; } } else { Debug.Log((object)"Batterie vide, impossible d'utiliser l'item !"); } } private void SwapPlayerPositions() { if ((Object)(object)base.playerHeldBy == (Object)null) { Debug.LogWarning((object)"Aucun joueur ne tient l'item !"); } else if (((NetworkBehaviour)this).IsServer) { PerformSwap(base.playerHeldBy); } else { RequestSwapServerRpc(base.playerHeldBy.actualClientId); } } [ServerRpc(RequireOwnership = false)] private void RequestSwapServerRpc(ulong requesterId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(287025985u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, requesterId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 287025985u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = FindPlayerById(requesterId); if ((Object)(object)val3 != (Object)null) { PerformSwap(val3); } } } private PlayerControllerB FindPlayerById(ulong clientId) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && val.actualClientId == clientId && val.isPlayerControlled && !val.isPlayerDead) { return val; } } return null; } private void PerformSwap(PlayerControllerB playerA) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) List<PlayerControllerB> list = new List<PlayerControllerB>(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && !val.isPlayerDead && !((Object)(object)val == (Object)(object)playerA)) { list.Add(val); } } if (list.Count == 0) { Debug.LogWarning((object)"Aucun autre joueur disponible pour l'échange !"); NotifyNoPlayerAvailableClientRpc(playerA.actualClientId); return; } PlayerControllerB val2 = list[Random.Range(0, list.Count)]; if ((Object)(object)val2 == (Object)null || val2.isPlayerDead) { Debug.LogError((object)"Le joueur B sélectionné est invalide ou mort !"); return; } Vector3 position = ((Component)playerA).transform.position; Vector3 position2 = ((Component)val2).transform.position; Quaternion rotation = ((Component)playerA).transform.rotation; Quaternion rotation2 = ((Component)val2).transform.rotation; Debug.Log((object)$"[Server] Swap START: {playerA.playerUsername} @ {position} <-> {val2.playerUsername} @ {position2}"); ((MonoBehaviour)this).StartCoroutine(PerformSwapWithDelay(playerA, val2, position, position2, rotation, rotation2)); } [ClientRpc] private void NotifyNoPlayerAvailableClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(37845483u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 37845483u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = FindPlayerById(playerId); if ((Object)(object)val3 != (Object)null && ((NetworkBehaviour)val3).IsOwner) { HUDManager.Instance.DisplayTip("Swap Item", "Aucun joueur disponible pour l'echange !", true, false, "LC_Tip1"); } } } private IEnumerator PerformSwapWithDelay(PlayerControllerB playerA, PlayerControllerB playerB, Vector3 posA, Vector3 posB, Quaternion rotA, Quaternion rotB) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerA == (Object)null || (Object)(object)playerB == (Object)null || playerA.isPlayerDead || playerB.isPlayerDead) { Debug.LogError((object)"Un des joueurs est devenu invalide pendant le swap !"); yield break; } CharacterController controllerA = ((Component)playerA).GetComponent<CharacterController>(); CharacterController controllerB = ((Component)playerB).GetComponent<CharacterController>(); bool wasEnabledA = (Object)(object)controllerA != (Object)null && ((Collider)controllerA).enabled; bool wasEnabledB = (Object)(object)controllerB != (Object)null && ((Collider)controllerB).enabled; if ((Object)(object)controllerA != (Object)null) { ((Collider)controllerA).enabled = false; } if ((Object)(object)controllerB != (Object)null) { ((Collider)controllerB).enabled = false; } yield return null; if ((Object)(object)playerB != (Object)null && !playerB.isPlayerDead) { playerB.TeleportPlayer(posA, false, 0f, false, true); } yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)playerA != (Object)null && !playerA.isPlayerDead) { playerA.TeleportPlayer(posB, false, 0f, false, true); } yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)controllerA != (Object)null && wasEnabledA) { ((Collider)controllerA).enabled = true; } if ((Object)(object)controllerB != (Object)null && wasEnabledB) { ((Collider)controllerB).enabled = true; } ResetPlayerPhysics(playerA); ResetPlayerPhysics(playerB); if ((Object)(object)playerA != (Object)null && !playerA.isPlayerDead) { ((Component)playerA).transform.rotation = rotB; } if ((Object)(object)playerB != (Object)null && !playerB.isPlayerDead) { ((Component)playerB).transform.rotation = rotA; } SyncPlayersClientRpc(playerA.actualClientId, playerB.actualClientId, posB, posA, rotB, rotA); Debug.Log((object)$"[Server] Swap COMPLETE: {playerA.playerUsername} now @ {((Component)playerA).transform.position}, {playerB.playerUsername} now @ {((Component)playerB).transform.position}"); FixVisualGlitchClientRpc(playerA.actualClientId); } [ClientRpc] private void FixVisualGlitchClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1207482160u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1207482160u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && localPlayerController.actualClientId == playerId) { ((MonoBehaviour)this).StartCoroutine(BlinkCamera(localPlayerController)); RenderSettings.ambientMode = (AmbientMode)0; DynamicGI.UpdateEnvironment(); } } } private IEnumerator BlinkCamera(PlayerControllerB player) { if ((Object)(object)player.gameplayCamera != (Object)null) { ((Behaviour)player.gameplayCamera).enabled = false; yield return null; ((Behaviour)player.gameplayCamera).enabled = true; } } [ClientRpc] private void SyncPlayersClientRpc(ulong idA, ulong idB, Vector3 newPosA, Vector3 newPosB, Quaternion newRotA, Quaternion newRotB) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2025533601u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, idA); BytePacker.WriteValueBitPacked(val, idB); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newPosA); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newPosB); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newRotA); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newRotB); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2025533601u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if ((Object)(object)val3 == (Object)null || !val3.isPlayerControlled || val3.isPlayerDead) { continue; } if (val3.actualClientId == idA) { ((Component)val3).transform.SetPositionAndRotation(newPosA, newRotA); CharacterController component = ((Component)val3).GetComponent<CharacterController>(); if ((Object)(object)component != (Object)null && ((Collider)component).enabled) { ((Collider)component).enabled = false; ((Collider)component).enabled = true; } } else if (val3.actualClientId == idB) { ((Component)val3).transform.SetPositionAndRotation(newPosB, newRotB); CharacterController component2 = ((Component)val3).GetComponent<CharacterController>(); if ((Object)(object)component2 != (Object)null && ((Collider)component2).enabled) { ((Collider)component2).enabled = false; ((Collider)component2).enabled = true; } } } } private void ResetPlayerPhysics(PlayerControllerB player) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !player.isPlayerDead) { Rigidbody component = ((Component)player).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.velocity = Vector3.zero; component.angularVelocity = Vector3.zero; } } } [ServerRpc(RequireOwnership = false)] private void UseitemServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2661712142u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2661712142u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UseitemClientRpc(); AudiotpClientRpc(); } } } [ClientRpc] private void AudiotpClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2514035334u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2514035334u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)_audioSource != (Object)null && (Object)(object)tipi != (Object)null) { _audioSource.PlayOneShot(tipi); Debug.Log((object)$"[Client] BLASTEUR2CACA sound played! Volume: {_audioSource.volume}"); } else { Debug.LogWarning((object)$"[Client] Cannot play sound - AudioSource: {(Object)(object)_audioSource != (Object)null}, tipi: {(Object)(object)tipi != (Object)null}"); } } } [ClientRpc] private void UseitemClientRpc() { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(535976740u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 535976740u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"item utilise%"); } } } public void TeleportPlayer(Vector3 pos) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"TeleportPlayer called on {((Object)((Component)this).gameObject).name} IsOwner={((NetworkBehaviour)this).IsOwner} IsServer={((NetworkBehaviour)this).IsServer} pos={pos}"); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(287025985u, new RpcReceiveHandler(__rpc_handler_287025985), "RequestSwapServerRpc"); ((NetworkBehaviour)this).__registerRpc(37845483u, new RpcReceiveHandler(__rpc_handler_37845483), "NotifyNoPlayerAvailableClientRpc"); ((NetworkBehaviour)this).__registerRpc(1207482160u, new RpcReceiveHandler(__rpc_handler_1207482160), "FixVisualGlitchClientRpc"); ((NetworkBehaviour)this).__registerRpc(2025533601u, new RpcReceiveHandler(__rpc_handler_2025533601), "SyncPlayersClientRpc"); ((NetworkBehaviour)this).__registerRpc(2661712142u, new RpcReceiveHandler(__rpc_handler_2661712142), "UseitemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2514035334u, new RpcReceiveHandler(__rpc_handler_2514035334), "AudiotpClientRpc"); ((NetworkBehaviour)this).__registerRpc(535976740u, new RpcReceiveHandler(__rpc_handler_535976740), "UseitemClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_287025985(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong requesterId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref requesterId); target.__rpc_exec_stage = (__RpcExecStage)1; ((Blasteur2caca)(object)target).RequestSwapServerRpc(requesterId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_37845483(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((Blasteur2caca)(object)target).NotifyNoPlayerAvailableClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1207482160(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((Blasteur2caca)(object)target).FixVisualGlitchClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2025533601(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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong idA = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref idA); ulong idB = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref idB); Vector3 newPosA = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPosA); Vector3 newPosB = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPosB); Quaternion newRotA = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newRotA); Quaternion newRotB = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newRotB); target.__rpc_exec_stage = (__RpcExecStage)1; ((Blasteur2caca)(object)target).SyncPlayersClientRpc(idA, idB, newPosA, newPosB, newRotA, newRotB); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2661712142(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; ((Blasteur2caca)(object)target).UseitemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2514035334(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; ((Blasteur2caca)(object)target).AudiotpClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_535976740(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; ((Blasteur2caca)(object)target).UseitemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Blasteur2caca"; } } public class BolDeCaca : GrabbableObject { private AudioSource _audioSource; [Header("Bol de Caca Settings")] public AudioClip useSound; public float soundVolume = 1f; public float effectDuration = 30f; public override void Start() { ((GrabbableObject)this).Start(); _audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).GetComponentInChildren<AudioSource>(); } if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); Debug.Log((object)"[BolDeCaca] AudioSource créé automatiquement"); } _audioSource.spatialBlend = 1f; _audioSource.volume = soundVolume; _audioSource.minDistance = 1f; _audioSource.maxDistance = 50f; _audioSource.rolloffMode = (AudioRolloffMode)1; _audioSource.playOnAwake = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && buttonDown) { Debug.Log((object)"[BolDeCaca] Item activated by owner"); ActivateBoldecacaServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void ActivateBoldecacaServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3857436051u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3857436051u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"[Server] BolDeCaca activated"); ActivateBoldecacaClientRpc(); } } } [ClientRpc] private void ActivateBoldecacaClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1043110069u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1043110069u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)_audioSource != (Object)null && (Object)(object)useSound != (Object)null) { _audioSource.PlayOneShot(useSound); Debug.Log((object)$"[Client] BolDeCaca sound played! Volume: {_audioSource.volume}"); } else { Debug.LogWarning((object)$"[Client] Cannot play sound - AudioSource: {(Object)(object)_audioSource != (Object)null}, useSound: {(Object)(object)useSound != (Object)null}"); } ApplyEffectToPlayer(); } } private void ApplyEffectToPlayer() { if (!((Object)(object)base.playerHeldBy == (Object)null)) { Debug.Log((object)("[Client] Stamina illimitée appliquée au joueur " + base.playerHeldBy.playerUsername)); ((MonoBehaviour)this).StartCoroutine(UnlimitedStaminaEffect(base.playerHeldBy)); } } private IEnumerator UnlimitedStaminaEffect(PlayerControllerB player) { float timeElapsed = 0f; while (timeElapsed < effectDuration && (Object)(object)player != (Object)null && !player.isPlayerDead) { player.sprintMeter = 1f; timeElapsed += Time.deltaTime; yield return (object)new WaitForSeconds(0.1f); } Debug.Log((object)("[Client] Effet stamina terminé pour " + player.playerUsername)); } public override void SetControlTipsForItem() { ((GrabbableObject)this).SetControlTipsForItem(); if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.ChangeControlTipMultiple(new string[1] { "Utiliser : [LMB]" }, true, base.itemProperties); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3857436051u, new RpcReceiveHandler(__rpc_handler_3857436051), "ActivateBoldecacaServerRpc"); ((NetworkBehaviour)this).__registerRpc(1043110069u, new RpcReceiveHandler(__rpc_handler_1043110069), "ActivateBoldecacaClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3857436051(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; ((BolDeCaca)(object)target).ActivateBoldecacaServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1043110069(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; ((BolDeCaca)(object)target).ActivateBoldecacaClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BolDeCaca"; } } public class ExplosiveDuck : GrabbableObject { private AudioSource _audioSource; [FormerlySerializedAs("DuckSound")] [FormerlySerializedAs("Duck")] [FormerlySerializedAs("Duckclip")] [Header("Duck Settings")] public AudioClip duckSound; public float explosionChance = 0.2f; public int valueMultiplier = 2; public override void Start() { ((GrabbableObject)this).Start(); _audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).GetComponentInChildren<AudioSource>(); } if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); Debug.Log((object)"[ExplosiveDuck] AudioSource créé automatiquement"); } _audioSource.spatialBlend = 1f; _audioSource.volume = 1f; _audioSource.minDistance = 1f; _audioSource.maxDistance = 50f; _audioSource.rolloffMode = (AudioRolloffMode)1; _audioSource.playOnAwake = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && buttonDown) { Debug.Log((object)"[ExplosiveDuck] Item activated by owner"); ActivateDuckServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void ActivateDuckServerRpc() { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(478993190u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 478993190u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; bool flag = Random.value < explosionChance; bool flag2 = (Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.shipHasLanded; Debug.Log((object)$"[Server] Duck activated - Will explode: {flag}, shipHasLanded (brut): {StartOfRound.Instance?.shipHasLanded}, isRoundOnPlanet: {flag2}, valeur actuelle avant: {base.scrapValue}"); PlayDuckSoundClientRpc(); if (flag) { if (flag2) { base.scrapValue *= valueMultiplier; Debug.Log((object)$"[Server] Duck value increased to: {base.scrapValue}"); } else { Debug.Log((object)"[Server] Vaisseau pas atterri sur une planete (en vol/en transit) - Duck value NOT increased"); } TriggerExplosionClientRpc(); } } [ClientRpc] private void PlayDuckSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1570103615u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1570103615u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)_audioSource == (Object)null) { Debug.LogError((object)"[Client] AudioSource is null!"); return; } if ((Object)(object)duckSound == (Object)null) { Debug.LogError((object)"[Client] duckSound clip is null!"); return; } _audioSource.PlayOneShot(duckSound); Debug.Log((object)"[Client] Duck sound played!"); } } [ClientRpc] private void TriggerExplosionClientRpc() { //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_00d9: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3502342413u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3502342413u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"[Client] Triggering explosion"); TriggerExplosion(((Component)this).transform.position); } } } private void TriggerExplosion(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Landmine.SpawnExplosion(position, true, 1f, 4f, 50, 50f, (GameObject)null, false); Debug.Log((object)"[Client] Landmine explosion spawned"); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(478993190u, new RpcReceiveHandler(__rpc_handler_478993190), "ActivateDuckServerRpc"); ((NetworkBehaviour)this).__registerRpc(1570103615u, new RpcReceiveHandler(__rpc_handler_1570103615), "PlayDuckSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(3502342413u, new RpcReceiveHandler(__rpc_handler_3502342413), "TriggerExplosionClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_478993190(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; ((ExplosiveDuck)(object)target).ActivateDuckServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1570103615(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; ((ExplosiveDuck)(object)target).PlayDuckSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3502342413(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; ((ExplosiveDuck)(object)target).TriggerExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ExplosiveDuck"; } } public class InvertOtron : GrabbableObject { [SerializeField] private float batteryUsagePerUse = 0.1f; [SerializeField] private float inverseGravityForce = 25f; [SerializeField] private float rotationSpeed = 5f; private PlayerControllerB targetPlayer; private bool gravityInverted = false; private Quaternion originalRotation; private Quaternion targetRotation; private bool isRestoringGravity = false; private float restoreTimer = 0f; private const float RESTORE_DURATION = 0.2f; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((NetworkBehaviour)this).IsOwner || !buttonDown) { return; } if (base.insertedBattery == null || base.insertedBattery.charge <= 0f) { Debug.Log((object)"Batterie vide ou absente !"); return; } Battery insertedBattery = base.insertedBattery; insertedBattery.charge -= batteryUsagePerUse; if (base.insertedBattery.charge < 0f) { base.insertedBattery.charge = 0f; } gravityInverted = !gravityInverted; if ((Object)(object)base.playerHeldBy != (Object)null) { ToggleGravityServerRpc(gravityInverted, (int)base.playerHeldBy.playerClientId); } } [ServerRpc(RequireOwnership = false)] private void ToggleGravityServerRpc(bool inverted, int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(170994486u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref inverted, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 170994486u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleGravityClientRpc(inverted, playerId); } } } [ClientRpc] private void ToggleGravityClientRpc(bool inverted, int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2835937656u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref inverted, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2835937656u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; gravityInverted = inverted; if ((Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.allPlayerScripts.Length <= playerId) { return; } targetPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)targetPlayer == (Object)null)) { if (inverted) { originalRotation = ((Component)targetPlayer).transform.rotation; targetRotation = originalRotation * Quaternion.Euler(0f, 0f, 180f); isRestoringGravity = false; restoreTimer = 0f; } else { targetRotation = originalRotation; isRestoringGravity = true; restoreTimer = 0f; targetPlayer.fallValue = 0f; targetPlayer.fallValueUncapped = 0f; targetPlayer.externalForces = Vector3.zero; } } } private void FixedUpdate() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetPlayer == (Object)null || targetPlayer.isPlayerDead || (!((Object)(object)targetPlayer == (Object)(object)GameNetworkManager.Instance?.localPlayerController) && !((NetworkBehaviour)this).IsServer)) { return; } if (isRestoringGravity) { targetPlayer.fallValue = 0f; targetPlayer.fallValueUncapped = 0f; targetPlayer.externalForces = Vector3.zero; } else if (gravityInverted) { if ((Object)(object)targetPlayer.thisController != (Object)null && ((Collider)targetPlayer.thisController).enabled) { targetPlayer.thisController.Move(Vector3.up * inverseGravityForce * Time.fixedDeltaTime); } targetPlayer.fallValue = 0f; targetPlayer.fallValueUncapped = 0f; targetPlayer.externalForces = Vector3.up * inverseGravityForce; } } public override void Update() { //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (isRestoringGravity) { restoreTimer += Time.deltaTime; if ((Object)(object)targetPlayer != (Object)null && !targetPlayer.isPlayerDead) { ((Component)targetPlayer).transform.rotation = Quaternion.Lerp(((Component)targetPlayer).transform.rotation, originalRotation, Time.deltaTime * rotationSpeed); } if (restoreTimer >= 0.2f) { isRestoringGravity = false; restoreTimer = 0f; if ((Object)(object)targetPlayer != (Object)null) { targetPlayer.fallValue = 0f; targetPlayer.fallValueUncapped = 0f; targetPlayer.externalForces = Vector3.zero; ((Component)targetPlayer).transform.rotation = originalRotation; } targetPlayer = null; originalRotation = Quaternion.identity; targetRotation = Quaternion.identity; } return; } if ((Object)(object)targetPlayer != (Object)null && !targetPlayer.isPlayerDead && gravityInverted) { ((Component)targetPlayer).transform.rotation = Quaternion.Lerp(((Component)targetPlayer).transform.rotation, targetRotation, Time.deltaTime * rotationSpeed); } if (!gravityInverted || (base.isHeld && !((Object)(object)base.playerHeldBy == (Object)null))) { return; } gravityInverted = false; if (!((Object)(object)targetPlayer != (Object)null)) { return; } int num = -1; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if ((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)(object)targetPlayer) { num = i; break; } } if (num >= 0 && ((NetworkBehaviour)this).IsOwner) { ToggleGravityServerRpc(inverted: false, num); } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!gravityInverted || !((Object)(object)targetPlayer != (Object)null)) { return; } gravityInverted = false; int num = -1; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if ((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)(object)targetPlayer) { num = i; break; } } if (num >= 0 && ((NetworkBehaviour)this).IsOwner) { ToggleGravityServerRpc(inverted: false, num); } } public override void OnDestroy() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).OnDestroy(); if ((Object)(object)targetPlayer != (Object)null) { targetPlayer.externalForces = Vector3.zero; targetPlayer.fallValue = 0f; targetPlayer.fallValueUncapped = 0f; if ((Object)(object)((Component)targetPlayer).transform != (Object)null) { ((Component)targetPlayer).transform.rotation = originalRotation; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(170994486u, new RpcReceiveHandler(__rpc_handler_170994486), "ToggleGravityServerRpc"); ((NetworkBehaviour)this).__registerRpc(2835937656u, new RpcReceiveHandler(__rpc_handler_2835937656), "ToggleGravityClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_170994486(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool inverted = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref inverted, default(ForPrimitives)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((InvertOtron)(object)target).ToggleGravityServerRpc(inverted, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2835937656(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool inverted = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref inverted, default(ForPrimitives)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((InvertOtron)(object)target).ToggleGravityClientRpc(inverted, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "InvertOtron"; } } public class LePlanderesurrection : GrabbableObject { private AudioSource _audioSource; [FormerlySerializedAs("audioClip")] public AudioClip PlanderesurrectionSound; private static readonly int Limp = Animator.StringToHash("Limp"); public float reviveRange = 5f; public float soundVolume = 1f; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((NetworkBehaviour)this).IsOwner || !buttonDown) { return; } PlayerControllerB val = FindClosestDeadPlayer(); if ((Object)(object)val != (Object)null) { RevivePlayerServerRpc((int)val.playerClientId); AudiotpClientRpc(); Debug.Log((object)(">> Joueur " + val.playerUsername + " a été ressuscité ce fdp")); if ((Object)(object)base.playerHeldBy != (Object)null) { ((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy); } } else { Debug.Log((object)">> chef ya rien par ici"); } } public override void Start() { ((GrabbableObject)this).Start(); _audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).GetComponentInChildren<AudioSource>(); } if ((Object)(object)_audioSource == (Object)null) { _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); Debug.Log((object)"[Planderesurrection] AudioSource créé automatiquement"); } _audioSource.spatialBlend = 1f; _audioSource.volume = soundVolume; _audioSource.minDistance = 1f; _audioSource.maxDistance = 50f; _audioSource.rolloffMode = (AudioRolloffMode)1; _audioSource.playOnAwake = false; } private PlayerControllerB FindClosestDeadPlayer() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB result = null; float num = float.PositiveInfinity; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; RaycastHit val2 = default(RaycastHit); foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerDead && !((Object)(object)val.deadBody == (Object)null)) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val.deadBody).transform.position); if (num2 < reviveRange && num2 < num && !Physics.Linecast(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)val.deadBody).transform.position, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { num = num2; result = val; } } } return result; } [ServerRpc(RequireOwnership = false)] private void TeleportRevivedPlayerServerRpc(int targetPlayerId, Vector3 revivePosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3562382500u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, targetPlayerId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref revivePosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3562382500u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new ulong[1] { (ulong)targetPlayerId } } }; TeleportRevivedPlayerClientRpc(targetPlayerId, revivePosition, clientRpcParams); } } } [ClientRpc] private void TeleportRevivedPlayerClientRpc(int targetPlayerId, Vector3 revivePosition, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1640985540u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, targetPlayerId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref revivePosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1640985540u, clientRpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(WaitAndTeleportClient(revivePosition)); } } } private IEnumerator WaitAndTeleportClient(Vector3 revivePosition) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return null; yield return (object)new WaitForFixedUpdate(); PlayerControllerB localPlayer = null; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB p = StartOfRound.Instance.allPlayerScripts[i]; if (!((Object)(object)p == (Object)null) && ((NetworkBehaviour)p).IsOwner) { localPlayer = p; break; } } if ((Object)(object)localPlayer != (Object)null) { localPlayer.TeleportPlayer(revivePosition, false, 0f, false, true); } } private static IEnumerator SetPlayerUI(PlayerControllerB player, bool critical = false) { yield return (object)new WaitForFixedUpdate(); HUDManager.Instance.UpdateHealthUI(player.health, false); HUDManager.Instance.HideHUD(false); player.MakeCriticallyInjured(critical); } [ServerRpc(RequireOwnership = false)] public void RevivePlayerServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(129188314u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 129188314u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevivePlayerClientRpc(playerId); } } } [ClientRpc] public void RevivePlayerClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1212640718u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1212640718u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!val3.isPlayerDead && !val3.isPlayerControlled) { return; } val3.ResetPlayerBloodObjects(true); val3.isClimbingLadder = false; val3.clampLooking = false; val3.inVehicleAnimation = false; val3.disableMoveInput = false; val3.ResetZAndXRotation(); ((Collider)val3.thisController).enabled = true; val3.health = 100; val3.hasBeenCriticallyInjured = false; val3.disableLookInput = false; val3.disableInteract = false; if (val3.isPlayerDead) { val3.isPlayerDead = false; val3.isPlayerControlled = true; val3.isInElevator = true; val3.isInHangarShipRoom = true; val3.isInsideFactory = ((Component)val3).transform.position.y < -80f; val3.parentedToElevatorLastFrame = false; val3.overrideGameOverSpectatePivot = null; StartOfRound.Instance.SetPlayerObjectExtrapolate(false); val3.TeleportPlayer(((Component)val3.deadBody).transform.position, false, 0f, false, true); val3.setPositionOfDeadPlayer = false; val3.DisablePlayerModel(StartOfRound.Instance.allPlayerObjects[playerId], true, true); ((Behaviour)val3.helmetLight).enabled = false; val3.Crouch(false); val3.criticallyInjured = false; if (Object.op_Implicit((Object)(object)val3.playerBodyAnimator)) { val3.playerBodyAnimator.SetBool(Limp, false); } val3.bleedingHeavily = false; val3.activatingItem = false; val3.twoHanded = false; val3.inShockingMinigame = false; val3.inSpecialInteractAnimation = false; val3.freeRotationInInteractAnimation = false; val3.disableSyncInAnimation = false; val3.inAnimationWithEnemy = null; val3.holdingWalkieTalkie = false; val3.speakingToWalkieTalkie = false; val3.isSinking = false; val3.isUnderwater = false; val3.sinkingValue = 0f; val3.statusEffectAudio.Stop(); val3.DisableJetpackControlsLocally(); val3.health = 100; val3.mapRadarDotAnimator.SetBool("dead", false); val3.externalForceAutoFade = Vector3.zero; if (((NetworkBehaviour)val3).IsOwner) { HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); val3.hasBegunSpectating = false; HUDManager.Instance.RemoveSpectateUI(); HUDManager.Instance.gameOverAnimator.SetTrigger("revive"); val3.hinderedMultiplier = 1f; val3.isMovementHindered = 0; val3.sourcesCausingSinking = 0; val3.reverbPreset = StartOfRound.Instance.shipReverb; } } if (((NetworkBehaviour)val3).IsOwner) { SoundManager.Instance.earsRingingTimer = 0f; val3.bleedingHeavily = false; val3.criticallyInjured = false; val3.playerBodyAnimator.SetBool(Limp, false); val3.health = 100; HUDManager.Instance.UpdateHealthUI(100, false); val3.spectatedPlayerScript = null; ((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false; StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, val3); ((MonoBehaviour)this).StartCoroutine(SetPlayerUI(val3)); } val3.voiceMuffledByEnemy = false; SoundManager.Instance.playerVoicePitchTargets[playerId] = 1f; SoundManager.Instance.SetPlayerPitch(1f, playerId); if (Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings)) { if (!Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio)) { val3.currentVoiceChatIngameSettings.InitializeComponents(); } if (!Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio)) { return; } ((Component)val3.currentVoiceChatIngameSettings.voiceAudio).GetComponent<OccludeAudio>().overridingLowPass = false; } RagdollGrabbableObject[] array = Object.FindObjectsOfType<RagdollGrabbableObject>(); RagdollGrabbableObject[] array2 = array; foreach (RagdollGrabbableObject val4 in array2) { if (val4.ragdoll.playerObjectId != playerId) { continue; } if (!((GrabbableObject)val4).isHeld) { if (((NetworkBehaviour)this).IsServer) { if (((NetworkBehaviour)val4).NetworkObject.IsSpawned) { ((NetworkBehaviour)val4).NetworkObject.Despawn(true); } else { Object.Destroy((Object)(object)((Component)val4).gameObject); } } } else if (Object.op_Implicit((Object)(object)((GrabbableObject)val4).playerHeldBy)) { ((GrabbableObject)val4).playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(V