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.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 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.1")]
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 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.Setup.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
{
[CompilerGenerated]
private sealed class <BlinkCamera>d__13 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public Blasteur2caca <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <BlinkCamera>d__13(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
if ((Object)(object)player.gameplayCamera != (Object)null)
{
((Behaviour)player.gameplayCamera).enabled = false;
<>2__current = null;
<>1__state = 1;
return true;
}
break;
case 1:
<>1__state = -1;
((Behaviour)player.gameplayCamera).enabled = true;
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <PerformSwapWithDelay>d__11 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB playerA;
public PlayerControllerB playerB;
public Vector3 posA;
public Vector3 posB;
public Quaternion rotA;
public Quaternion rotB;
public Blasteur2caca <>4__this;
private CharacterController <controllerA>5__1;
private CharacterController <controllerB>5__2;
private bool <wasEnabledA>5__3;
private bool <wasEnabledB>5__4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PerformSwapWithDelay>d__11(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<controllerA>5__1 = null;
<controllerB>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Expected O, but got Unknown
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Expected O, but got Unknown
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Unknown result type (might be due to invalid IL or missing references)
//IL_036a: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
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 !");
return false;
}
<controllerA>5__1 = ((Component)playerA).GetComponent<CharacterController>();
<controllerB>5__2 = ((Component)playerB).GetComponent<CharacterController>();
<wasEnabledA>5__3 = (Object)(object)<controllerA>5__1 != (Object)null && ((Collider)<controllerA>5__1).enabled;
<wasEnabledB>5__4 = (Object)(object)<controllerB>5__2 != (Object)null && ((Collider)<controllerB>5__2).enabled;
if ((Object)(object)<controllerA>5__1 != (Object)null)
{
((Collider)<controllerA>5__1).enabled = false;
}
if ((Object)(object)<controllerB>5__2 != (Object)null)
{
((Collider)<controllerB>5__2).enabled = false;
}
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if ((Object)(object)playerB != (Object)null && !playerB.isPlayerDead)
{
playerB.TeleportPlayer(posA, false, 0f, false, true);
}
<>2__current = (object)new WaitForSeconds(0.1f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
if ((Object)(object)playerA != (Object)null && !playerA.isPlayerDead)
{
playerA.TeleportPlayer(posB, false, 0f, false, true);
}
<>2__current = (object)new WaitForSeconds(0.1f);
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
if (((Object)(object)<controllerA>5__1 != (Object)null) & <wasEnabledA>5__3)
{
((Collider)<controllerA>5__1).enabled = true;
}
if (((Object)(object)<controllerB>5__2 != (Object)null) & <wasEnabledB>5__4)
{
((Collider)<controllerB>5__2).enabled = true;
}
<>4__this.ResetPlayerPhysics(playerA);
<>4__this.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;
}
<>4__this.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}");
<>4__this.FixVisualGlitchClientRpc(playerA.actualClientId);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(287025985u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, requesterId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 287025985u, val, (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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(37845483u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 37845483u, val, (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");
}
}
}
[IteratorStateMachine(typeof(<PerformSwapWithDelay>d__11))]
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)
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <PerformSwapWithDelay>d__11(0)
{
<>4__this = this,
playerA = playerA,
playerB = playerB,
posA = posA,
posB = posB,
rotA = rotA,
rotB = rotB
};
}
[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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1207482160u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1207482160u, val, (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();
}
}
}
[IteratorStateMachine(typeof(<BlinkCamera>d__13))]
private IEnumerator BlinkCamera(PlayerControllerB player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <BlinkCamera>d__13(0)
{
<>4__this = this,
player = player
};
}
[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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2025533601u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, idA);
BytePacker.WriteValueBitPacked(val2, idB);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPosA);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPosB);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRotA);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRotB);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2025533601u, val, (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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2661712142u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2661712142u, val, (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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2514035334u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2514035334u, val, (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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(535976740u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 535976740u, val, (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
{
[CompilerGenerated]
private sealed class <UnlimitedStaminaEffect>d__9 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public BolDeCaca <>4__this;
private float <timeElapsed>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <UnlimitedStaminaEffect>d__9(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<timeElapsed>5__1 = 0f;
break;
case 1:
<>1__state = -1;
break;
}
if (<timeElapsed>5__1 < <>4__this.effectDuration && (Object)(object)player != (Object)null && !player.isPlayerDead)
{
player.sprintMeter = 1f;
<timeElapsed>5__1 += Time.deltaTime;
<>2__current = (object)new WaitForSeconds(0.1f);
<>1__state = 1;
return true;
}
Debug.Log((object)("[Client] Effet stamina terminé pour " + player.playerUsername));
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3857436051u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3857436051u, val, (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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1043110069u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1043110069u, val, (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));
}
}
[IteratorStateMachine(typeof(<UnlimitedStaminaEffect>d__9))]
private IEnumerator UnlimitedStaminaEffect(PlayerControllerB player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <UnlimitedStaminaEffect>d__9(0)
{
<>4__this = this,
player = player
};
}
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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(478993190u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 478993190u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
bool flag = Random.value < explosionChance;
Debug.Log((object)$"[Server] Duck activated - Will explode: {flag}");
PlayDuckSoundClientRpc();
if (flag)
{
base.scrapValue *= valueMultiplier;
Debug.Log((object)$"[Server] Duck value increased to: {base.scrapValue}");
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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1570103615u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1570103615u, val, (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] PlayDuckSoundClientRpc called - AudioSource: {(Object)(object)_audioSource != (Object)null}, DuckSound: {(Object)(object)duckSound != (Object)null}");
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! Volume: {_audioSource.volume}, Spatial: {_audioSource.spatialBlend}");
}
}
[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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3502342413u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3502342413u, val, (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");
Vector3 position = ((Component)this).transform.position;
TriggerExplosion(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;
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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(170994486u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inverted, default(ForPrimitives));
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 170994486u, val, (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_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: 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)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2835937656u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inverted, default(ForPrimitives));
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2835937656u, val, (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)
{
Debug.Log((object)((inverted ? "Gravité inversée" : "Gravité restaurée") + " pour " + targetPlayer.playerUsername + "!"));
if (inverted && originalRotation == Quaternion.identity)
{
originalRotation = ((Component)targetPlayer).transform.rotation;
}
if (inverted)
{
targetRotation = originalRotation * Quaternion.Euler(0f, 0f, 180f);
}
else
{
targetRotation = originalRotation;
}
}
}
private void FixedUpdate()
{
//IL_0087: 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_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
if (gravityInverted && !((Object)(object)targetPlayer == (Object)null) && !targetPlayer.isPlayerDead && (!((Object)(object)targetPlayer != (Object)(object)GameNetworkManager.Instance.localPlayerController) || ((NetworkBehaviour)this).IsServer))
{
if ((Object)(object)targetPlayer.thisController != (Object)null && ((Collider)targetPlayer.thisController).enabled)
{
Vector3 val = Vector3.up * inverseGravityForce * Time.fixedDeltaTime;
targetPlayer.thisController.Move(val);
}
if (targetPlayer.fallValue > 0f)
{
targetPlayer.fallValue = 0f;
}
Vector3 externalForces = Vector3.up * inverseGravityForce;
targetPlayer.externalForces = externalForces;
}
}
public override void Update()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: 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_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).Update();
if ((Object)(object)targetPlayer != (Object)null && !targetPlayer.isPlayerDead && gravityInverted)
{
((Component)targetPlayer).transform.rotation = Quaternion.Lerp(((Component)targetPlayer).transform.rotation, targetRotation, Time.deltaTime * rotationSpeed);
}
else if ((Object)(object)targetPlayer != (Object)null && !gravityInverted && targetRotation != Quaternion.identity)
{
((Component)targetPlayer).transform.rotation = Quaternion.Lerp(((Component)targetPlayer).transform.rotation, originalRotation, Time.deltaTime * rotationSpeed);
}
if (gravityInverted && (!base.isHeld || (Object)(object)base.playerHeldBy == (Object)null))
{
gravityInverted = false;
if ((Object)(object)targetPlayer != (Object)null)
{
targetPlayer.externalForces = Vector3.zero;
((Component)targetPlayer).transform.rotation = originalRotation;
targetPlayer = null;
}
}
}
public override void DiscardItem()
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).DiscardItem();
if (gravityInverted && (Object)(object)targetPlayer != (Object)null)
{
gravityInverted = false;
targetPlayer.externalForces = Vector3.zero;
targetPlayer.fallValue = 0f;
((Component)targetPlayer).transform.rotation = originalRotation;
if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null)
{
ToggleGravityServerRpc(inverted: false, (int)base.playerHeldBy.playerClientId);
}
}
targetPlayer = null;
originalRotation = Quaternion.identity;
targetRotation = Quaternion.identity;
}
public override void OnDestroy()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).OnDestroy();
if (gravityInverted && (Object)(object)targetPlayer != (Object)null)
{
gravityInverted = false;
targetPlayer.externalForces = Vector3.zero;
targetPlayer.fallValue = 0f;
((Component)targetPlayer).transform.rotation = originalRotation;
if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null)
{
ToggleGravityServerRpc(inverted: false, (int)base.playerHeldBy.playerClientId);
}
}
}
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
{
[CompilerGenerated]
private sealed class <SetPlayerUI>d__11 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public bool critical;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SetPlayerUI>d__11(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
HUDManager.Instance.UpdateHealthUI(player.health, false);
HUDManager.Instance.HideHUD(false);
player.MakeCriticallyInjured(critical);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <WaitAndTeleportClient>d__10 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public Vector3 revivePosition;
public LePlanderesurrection <>4__this;
private PlayerControllerB <localPlayer>5__1;
private int <i>5__2;
private PlayerControllerB <p>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <WaitAndTeleportClient>d__10(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<localPlayer>5__1 = null;
<p>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
<localPlayer>5__1 = null;
<i>5__2 = 0;
while (<i>5__2 < StartOfRound.Instance.allPlayerScripts.Length)
{
<p>5__3 = StartOfRound.Instance.allPlayerScripts[<i>5__2];
if (!((Object)(object)<p>5__3 == (Object)null))
{
if (((NetworkBehaviour)<p>5__3).IsOwner)
{
<localPlayer>5__1 = <p>5__3;
break;
}
<p>5__3 = null;
}
<i>5__2++;
}
if ((Object)(object)<localPlayer>5__1 != (Object)null)
{
<localPlayer>5__1.TeleportPlayer(revivePosition, false, 0f, false, true);
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3562382500u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, targetPlayerId);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref revivePosition);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3562382500u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ClientRpcParams val3 = default(ClientRpcParams);
val3.Send = new ClientRpcSendParams
{
TargetClientIds = new ulong[1] { (ulong)targetPlayerId }
};
ClientRpcParams clientRpcParams = val3;
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));
}
}
}
[IteratorStateMachine(typeof(<WaitAndTeleportClient>d__10))]
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 decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <WaitAndTeleportClient>d__10(0)
{
<>4__this = this,
revivePosition = revivePosition
};
}
[IteratorStateMachine(typeof(<SetPlayerUI>d__11))]
private static IEnumerator SetPlayerUI(PlayerControllerB player, bool critical = false)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SetPlayerUI>d__11(0)
{
player = player,
critical = 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 val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(129188314u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 129188314u, val, (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 val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1212640718u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1212640718u, val, (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(Vector3), default(Vector3));
}
}
DeadBodyInfo[] array3 = Object.FindObjectsOfType<DeadBodyInfo>();
DeadBodyInfo[] array4 = array3;
foreach (DeadBodyInfo val5 in array4)
{
if (val5.playerObjectId == playerId)
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
}
StartOfRound instance = StartOfRound.Instance;
instance.livingPlayers++;
StartOfRound.Instance.allPlayersDead = false;
StartOfRound.Instance.UpdatePlayerVoiceEffects();
}
[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 o