using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using DoorBreach;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MonoMod.Utils;
using TestAccount666.TestAccountVariety.NetcodePatcher;
using TestAccountCore;
using TestAccountCore.Dependencies;
using TestAccountCore.Dependencies.Compatibility;
using TestAccountVariety.Config;
using TestAccountVariety.Dependencies;
using TestAccountVariety.Items.Bomb.Patches;
using TestAccountVariety.Items.ChristmasRadio;
using TestAccountVariety.Items.Corn.Patches;
using TestAccountVariety.Items.ExtendedItems;
using TestAccountVariety.Items.Popcorn;
using TestAccountVariety.Items.ShibaPlush.Functions;
using TestAccountVariety.Items.ThrowableCube.Patches;
using TestAccountVariety.Items.Yippee.Patches;
using TestAccountVariety.Patches;
using TestAccountVariety.ShopItems.Telepad;
using TestAccountVariety.Utils;
using Unity.Mathematics;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.ProBuilder;
using UnityEngine.Rendering.HighDefinition;
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: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TestAccount666.TestAccountVariety")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Random stuff from TestAccount")]
[assembly: AssemblyFileVersion("1.44.0.0")]
[assembly: AssemblyInformationalVersion("1.44.0+bc48dac543dc2e0d541eecd63e98a96fc2bbb8fa")]
[assembly: AssemblyProduct("TestAccountVariety")]
[assembly: AssemblyTitle("TestAccount666.TestAccountVariety")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.44.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace TestAccountVariety
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency("TestAccount666.TestAccountCore", "1.16.0")]
[BepInPlugin("TestAccount666.TestAccountVariety", "TestAccountVariety", "1.44.0")]
public class TestAccountVariety : BaseUnityPlugin
{
public static TestAccountVariety Instance { get; private set; }
internal static ManualLogSource Logger { get; private set; }
internal static Harmony? Harmony { get; set; }
internal static void Patch()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
if (Harmony == null)
{
Harmony = new Harmony("TestAccount666.TestAccountVariety");
}
Logger.LogDebug((object)"Patching...");
Harmony.PatchAll(typeof(ThrowableCubePatch));
Harmony.PatchAll(typeof(ShovelPatch));
Harmony.PatchAll(typeof(BombPatch));
Harmony.PatchAll(typeof(RoundManagerPatch));
Harmony.PatchAll(typeof(LandminePatch));
Logger.LogDebug((object)"Finished patching!");
}
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
Instance = this;
if (DependencyChecker.IsLobbyCompatibilityInstalled())
{
Logger.LogInfo((object)"Found LobbyCompatibility Mod, initializing support :)");
LobbyCompatibilitySupport.Initialize("TestAccount666.TestAccountVariety", "1.44.0", (CompatibilityLevel)2, (VersionStrictness)2);
}
Assembly executingAssembly = Assembly.GetExecutingAssembly();
Netcode.ExecuteNetcodePatcher(executingAssembly);
AssetLoader.LoadBundle(executingAssembly, "TestAccountVariety");
AssetLoader.LoadItems(((BaseUnityPlugin)this).Config);
AssetLoader.LoadShopItems(((BaseUnityPlugin)this).Config);
AssetLoader.LoadHazards(((BaseUnityPlugin)this).Config);
AssetLoader.LoadUnlockables(((BaseUnityPlugin)this).Config);
AssetLoader.LoadCustomScripts(((BaseUnityPlugin)this).Config);
VarietyConfig.InitializeConfigs(((BaseUnityPlugin)this).Config);
Patch();
Logger.LogInfo((object)"TestAccount666.TestAccountVariety v1.44.0 has loaded!");
}
internal static void Unpatch()
{
Logger.LogDebug((object)"Unpatching...");
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
Logger.LogDebug((object)"Finished unpatching!");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "TestAccount666.TestAccountVariety";
public const string PLUGIN_NAME = "TestAccountVariety";
public const string PLUGIN_VERSION = "1.44.0";
}
}
namespace TestAccountVariety.Utils
{
public static class GrabbableObjectExtension
{
public static void DestroyItem(this GrabbableObject item)
{
item.grabbable = false;
item.grabbableToEnemies = false;
item.deactivated = true;
if (Object.op_Implicit((Object)(object)item.playerHeldBy))
{
item.playerHeldBy.activatingItem = false;
}
if (Object.op_Implicit((Object)(object)item.radarIcon))
{
Object.Destroy((Object)(object)((Component)item.radarIcon).gameObject);
}
((Component)(object)item).DestroyAll<MeshRenderer>();
((Component)(object)item).DestroyAll<Collider>();
}
private static void DestroyAll<T>(this Component item) where T : Object
{
item.GetComponentsInChildren<T>().ToList().ForEach((Action<T>)Object.Destroy);
}
}
public static class IntPacker
{
private const int _COLOR_MAX_INT = 63;
private const float _COLOR_MAX = 63f;
private const float _ALPHA_MAX = 31f;
private const int _ALPHA_MAX_INT = 31;
private const float _ALPHA_MIN_VALUE = 0.1f;
private const float _ALPHA_MAX_VALUE = 0.9f;
public static int Pack(float red, float green, float blue, float alpha, int sizeIndex, bool enableLights, bool isRainbow)
{
int num = Mathf.Clamp(Mathf.RoundToInt(red * 63f), 0, 63);
int num2 = Mathf.Clamp(Mathf.RoundToInt(green * 63f), 0, 63);
int num3 = Mathf.Clamp(Mathf.RoundToInt(blue * 63f), 0, 63);
float num4 = Mathf.Clamp(alpha, 0.1f, 1f);
int num5 = Mathf.Clamp(Mathf.RoundToInt((num4 - 0.1f) / 0.9f * 31f), 0, 31);
int num6 = Mathf.Clamp(sizeIndex, 0, 3);
int num7 = (enableLights ? 1 : 0);
int num8 = (isRainbow ? 1 : 0);
int num9 = 0;
num9 |= num8 & 1;
num9 |= (num7 & 1) << 1;
num9 |= (num6 & 3) << 2;
num9 |= (num5 & 0x1F) << 4;
num9 |= (num3 & 0x3F) << 9;
num9 |= (num2 & 0x3F) << 15;
return num9 | ((num & 0x3F) << 21);
}
public static void Unpack(int packed, out float red, out float green, out float blue, out float alpha, out int sizeIndex, out bool enableLights, out bool isRainbow)
{
int num = packed & 1;
int num2 = (packed >> 1) & 1;
int num3 = (packed >> 2) & 3;
int num4 = (packed >> 4) & 0x1F;
int num5 = (packed >> 9) & 0x3F;
int num6 = (packed >> 15) & 0x3F;
int num7 = (packed >> 21) & 0x3F;
red = (float)num7 / 63f;
green = (float)num6 / 63f;
blue = (float)num5 / 63f;
float num8 = (float)num4 / 31f;
alpha = 0.1f + num8 * 0.9f;
sizeIndex = num3;
enableLights = num2 == 1;
isRainbow = num == 1;
}
}
public static class ReferenceResolver
{
public static bool TryGetTelepad(NetworkObjectReference telepadReference, out Telepad telepad)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
NetworkObject val = NetworkObjectReference.op_Implicit(telepadReference);
if (Object.op_Implicit((Object)(object)val))
{
return ((Component)val).TryGetComponent<Telepad>(ref telepad);
}
telepad = null;
return false;
}
public static bool TryGetPlayer(int playerIndex, out PlayerControllerB player)
{
if (playerIndex < 0)
{
player = null;
return false;
}
if (playerIndex >= StartOfRound.Instance.allPlayerScripts.Length)
{
player = null;
return false;
}
player = StartOfRound.Instance.allPlayerScripts[playerIndex];
return Object.op_Implicit((Object)(object)player);
}
public static bool TryGetEnemy(Collider collider, out EnemyAI enemyAI)
{
EnemyAICollisionDetect val = default(EnemyAICollisionDetect);
if (!((Component)collider).TryGetComponent<EnemyAICollisionDetect>(ref val) || !Object.op_Implicit((Object)(object)val.mainScript))
{
enemyAI = null;
return false;
}
enemyAI = val.mainScript;
return true;
}
public static bool TryGetEnemy(NetworkObjectReference enemyReference, out EnemyAI enemyAI)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
NetworkObject val = NetworkObjectReference.op_Implicit(enemyReference);
if (Object.op_Implicit((Object)(object)val))
{
return ((Component)val).TryGetComponent<EnemyAI>(ref enemyAI);
}
enemyAI = null;
return false;
}
}
public static class VectorExtension
{
public static int ConvertToInt(this Vector3 position)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
return (int)(position.x + position.y + position.z);
}
}
}
namespace TestAccountVariety.ShopItems.Telepad
{
public class Telepad : GrabbableObject
{
[CompilerGenerated]
private sealed class <TeleportPlayer>d__29 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public Telepad <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TeleportPlayer>d__29(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_00ad: 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 = (object)new WaitForEndOfFrame();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if (TelepadConfig.telepadDropsItems.Value)
{
player.DropAllHeldItems(true, false);
<>2__current = null;
<>1__state = 2;
return true;
}
break;
case 2:
<>1__state = -1;
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
break;
}
player.TeleportPlayer(<>4__this.teleportationPoint.position, false, 0f, false, true);
player.isInsideFactory = ((GrabbableObject)<>4__this).isInFactory;
player.isInElevator = ((GrabbableObject)<>4__this).isInElevator;
player.isInHangarShipRoom = ((GrabbableObject)<>4__this).isInShipRoom;
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();
}
}
public Transform teleportationPoint;
public TelepadTrigger teleportCollider;
public float teleportationCooldown;
public AudioSource teleportAudioSource;
public AudioClip teleportSound;
public AudioSource ambientAudioSource;
public AudioClip ambientSound;
public MeshRenderer meshRenderer;
public Material enabledMaterial;
public Material disabledMaterial;
public float currentTeleportCoolDown;
public bool active;
private const int _PLAYER_LAYER_MASK = 8;
private const float _ACTIVATED_SCALE = 0.5f;
private const float _DEACTIVATED_SCALE = 0.125f;
public override void Update()
{
((GrabbableObject)this).Update();
TickCoolDown();
UpdateAmbientSound();
}
public override void GrabItem()
{
Deactivate();
((GrabbableObject)this).GrabItem();
}
public override void GrabItemFromEnemy(EnemyAI enemy)
{
Deactivate();
((GrabbableObject)this).GrabItemFromEnemy(enemy);
}
public override void DiscardItemFromEnemy()
{
((GrabbableObject)this).DiscardItemFromEnemy();
active = true;
SetScale(0.5f);
}
public void Deactivate()
{
ApplyCoolDown();
active = false;
SetScale(0.125f);
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
((GrabbableObject)this).ItemActivate(used, buttonDown);
active = true;
SetScale(0.5f);
if (base.isHeld && Object.op_Implicit((Object)(object)base.playerHeldBy))
{
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if (!((Object)(object)base.playerHeldBy != (Object)(object)localPlayerController))
{
((MonoBehaviour)localPlayerController).StartCoroutine(localPlayerController.waitToEndOfFrameToDiscard());
}
}
}
public void UpdateAmbientSound()
{
if (!CanTeleport())
{
if (ambientAudioSource.isPlaying)
{
ambientAudioSource.Stop();
}
}
else
{
PlayAmbientSound();
}
}
public void PlayAmbientSound()
{
if (!ambientAudioSource.isPlaying)
{
ambientAudioSource.clip = ambientSound;
ambientAudioSource.loop = true;
ambientAudioSource.Play();
}
}
public void TickCoolDown()
{
if (!CanCoolDownTick())
{
currentTeleportCoolDown = teleportationCooldown;
}
else if (!(currentTeleportCoolDown <= 0f))
{
currentTeleportCoolDown -= Time.deltaTime;
if (!(currentTeleportCoolDown > 0f))
{
UpdateMaterial(activate: true);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void TeleportPlayerServerRpc(int playerIndex, NetworkObjectReference sourceTelepadReference)
{
//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_0071: 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_0090: 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_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
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(2721455297u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerIndex);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2721455297u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
{
return;
}
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (!ReferenceResolver.TryGetPlayer(playerIndex, out PlayerControllerB player))
{
return;
}
Random random = new Random((int)(DateTime.Now.Ticks + ((Component)this).transform.position.ConvertToInt()));
List<PlayerControllerB> poorPlayers = GetPoorPlayers(player);
foreach (PlayerControllerB item in poorPlayers)
{
if (random.Next(0, 2) <= 0)
{
KillPlayerClientRpc(playerIndex);
}
else
{
KillPlayerClientRpc((int)item.playerClientId);
}
}
TeleportPlayerClientRpc(playerIndex, sourceTelepadReference);
}
[ClientRpc]
public void KillPlayerClientRpc(int playerIndex)
{
//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_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
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(3017040244u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerIndex);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3017040244u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (!ReferenceResolver.TryGetPlayer(playerIndex, out PlayerControllerB player))
{
return;
}
player.KillPlayer(Vector3.up, true, (CauseOfDeath)8, 0, default(Vector3));
DeadBodyInfo deadBody = player.deadBody;
if (Object.op_Implicit((Object)(object)deadBody) && deadBody.bodyParts.Length != 0)
{
Rigidbody[] bodyParts = deadBody.bodyParts;
foreach (Rigidbody val3 in bodyParts)
{
val3.position = teleportationPoint.position;
}
}
}
public List<PlayerControllerB> GetPoorPlayers(PlayerControllerB exemptPlayer)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB exemptPlayer2 = exemptPlayer;
Collider[] array = (Collider[])(object)new Collider[16];
int count = Physics.OverlapSphereNonAlloc(teleportationPoint.position, 2f, array, 8, (QueryTriggerInteraction)1);
return (from collider in array.Take(count)
select ((Component)collider).GetComponent<PlayerControllerB>() into player
where Object.op_Implicit((Object)(object)player) && (Object)(object)player != (Object)(object)exemptPlayer2
select player).Distinct().ToList();
}
[ClientRpc]
public void TeleportPlayerClientRpc(int playerIndex, NetworkObjectReference sourceTelepadReference)
{
//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_0071: 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_0090: 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_011e: 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(1272997972u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerIndex);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1272997972u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (ReferenceResolver.TryGetPlayer(playerIndex, out PlayerControllerB player))
{
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if (!((Object)(object)player == (Object)(object)localPlayerController) && ReferenceResolver.TryGetTelepad(sourceTelepadReference, out Telepad telepad))
{
TeleportOnLocalClient(telepad, player);
}
}
}
public void TeleportOnLocalClient(Telepad sourceTelepad, PlayerControllerB player)
{
HandlePreTeleport(sourceTelepad);
((MonoBehaviour)this).StartCoroutine(TeleportPlayer(player));
}
[IteratorStateMachine(typeof(<TeleportPlayer>d__29))]
public IEnumerator TeleportPlayer(PlayerControllerB player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TeleportPlayer>d__29(0)
{
<>4__this = this,
player = player
};
}
[ClientRpc]
public void TeleportEnemyClientRpc(NetworkObjectReference sourceTelepadReference, NetworkObjectReference enemyReference)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Invalid comparison between Unknown and I4
//IL_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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: 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(1281692841u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref enemyReference, default(ForNetworkSerializable));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1281692841u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (ReferenceResolver.TryGetTelepad(sourceTelepadReference, out Telepad telepad) && ReferenceResolver.TryGetEnemy(enemyReference, out EnemyAI enemyAI))
{
HandlePreTeleport(telepad, TelepadConfig.telepadEnemyUsesPower.Value);
enemyAI.agent.Warp(teleportationPoint.position);
enemyAI.isInsidePlayerShip = base.isInShipRoom;
enemyAI.isOutside = !base.isInFactory;
}
}
}
public void HandlePreTeleport(Telepad sourceTelepad, bool ignoreBattery = false)
{
sourceTelepad.ApplyCoolDown();
sourceTelepad.teleportAudioSource.PlayOneShot(teleportSound);
if (((NetworkBehaviour)this).IsHost && !ignoreBattery)
{
((GrabbableObject)sourceTelepad).SyncBatteryClientRpc((int)(((GrabbableObject)sourceTelepad).insertedBattery.charge * 100f - ((GrabbableObject)sourceTelepad).itemProperties.batteryUsage * 100f));
}
ApplyCoolDown();
teleportAudioSource.PlayOneShot(teleportSound);
if (((NetworkBehaviour)this).IsHost && !ignoreBattery)
{
((GrabbableObject)this).SyncBatteryClientRpc((int)(base.insertedBattery.charge * 100f - base.itemProperties.batteryUsage * 100f));
}
}
public List<Telepad> GetAvailableTelepads()
{
Telepad[] source = Object.FindObjectsByType<Telepad>((FindObjectsInactive)0, (FindObjectsSortMode)0);
return (from telepad in source
where Object.op_Implicit((Object)(object)telepad)
where (Object)(object)telepad != (Object)(object)this && telepad.CanTeleport()
select telepad).ToList();
}
public void ApplyCoolDown()
{
currentTeleportCoolDown = teleportationCooldown;
UpdateMaterial(activate: false);
}
public void UpdateMaterial(bool activate)
{
((Renderer)meshRenderer).material = (activate ? enabledMaterial : disabledMaterial);
}
public bool CanTeleport()
{
return CanCoolDownTick() && currentTeleportCoolDown <= 0f;
}
public bool CanCoolDownTick()
{
return active && !base.isHeld && !base.isHeldByEnemy && base.insertedBattery.charge > 0f;
}
public void SetScale(float newScale)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
base.originalScale = new Vector3(newScale, newScale, newScale);
((Component)this).transform.localScale = new Vector3(newScale, newScale, newScale);
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(2721455297u, new RpcReceiveHandler(__rpc_handler_2721455297), "TeleportPlayerServerRpc");
((NetworkBehaviour)this).__registerRpc(3017040244u, new RpcReceiveHandler(__rpc_handler_3017040244), "KillPlayerClientRpc");
((NetworkBehaviour)this).__registerRpc(1272997972u, new RpcReceiveHandler(__rpc_handler_1272997972), "TeleportPlayerClientRpc");
((NetworkBehaviour)this).__registerRpc(1281692841u, new RpcReceiveHandler(__rpc_handler_1281692841), "TeleportEnemyClientRpc");
((GrabbableObject)this).__initializeRpcs();
}
private static void __rpc_handler_2721455297(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex);
NetworkObjectReference sourceTelepadReference = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
target.__rpc_exec_stage = (__RpcExecStage)1;
((Telepad)(object)target).TeleportPlayerServerRpc(playerIndex, sourceTelepadReference);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3017040244(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Telepad)(object)target).KillPlayerClientRpc(playerIndex);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1272997972(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex);
NetworkObjectReference sourceTelepadReference = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
target.__rpc_exec_stage = (__RpcExecStage)1;
((Telepad)(object)target).TeleportPlayerClientRpc(playerIndex, sourceTelepadReference);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1281692841(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
NetworkObjectReference sourceTelepadReference = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref sourceTelepadReference, default(ForNetworkSerializable));
NetworkObjectReference enemyReference = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref enemyReference, default(ForNetworkSerializable));
target.__rpc_exec_stage = (__RpcExecStage)1;
((Telepad)(object)target).TeleportEnemyClientRpc(sourceTelepadReference, enemyReference);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "Telepad";
}
}
public class TelepadTrigger : MonoBehaviour
{
public Telepad telepad;
public void OnTriggerEnter(Collider other)
{
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
if (!((Behaviour)this).enabled || !this.telepad.CanTeleport())
{
return;
}
PlayerControllerB val = default(PlayerControllerB);
if (!((Component)other).TryGetComponent<PlayerControllerB>(ref val))
{
Telepad telepad = this.telepad;
if (telepad == null || ((NetworkBehaviour)telepad).IsHost || ((NetworkBehaviour)telepad).IsServer)
{
TryHandleEnemyTeleport(other);
}
return;
}
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if ((Object)(object)val != (Object)(object)localPlayerController)
{
return;
}
List<Telepad> availableTelepads = this.telepad.GetAvailableTelepads();
if (availableTelepads.Count <= 0)
{
HUDManager.Instance.DisplayTip("Telepad", "No teleportation points found!", true, false, "LC_Tip1");
return;
}
availableTelepads.RemoveAll((Telepad otherTelepad) => Vector3.Distance(((Component)otherTelepad).transform.position, ((Component)this.telepad).transform.position) <= 5f);
if (availableTelepads.Count <= 0)
{
HUDManager.Instance.DisplayTip("Telepad", "Walk, you lazy ass!", true, false, "LC_Tip1");
return;
}
Random random = new Random((int)DateTime.Now.Ticks + this.telepad.teleportationPoint.position.ConvertToInt());
Telepad telepad2 = availableTelepads[random.Next(0, availableTelepads.Count)];
telepad2.TeleportOnLocalClient(this.telepad, val);
NetworkObjectReference sourceTelepadReference = NetworkObjectReference.op_Implicit(((NetworkBehaviour)this.telepad).NetworkObject);
telepad2.TeleportPlayerServerRpc((int)val.playerClientId, sourceTelepadReference);
}
public void TryHandleEnemyTeleport(Collider other)
{
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
if (!TelepadConfig.telepadEnableEnemyTeleport.Value || !ReferenceResolver.TryGetEnemy(other, out EnemyAI enemyAI) || enemyAI.isEnemyDead)
{
return;
}
HashSet<string> source = TelepadConfig.telepadEnemyBlacklist.Value.Replace(", ", ",").Split(",").ToHashSet();
if (!source.Any((string blacklistedEnemy) => enemyAI.enemyType.enemyName.ToLower().StartsWith(blacklistedEnemy.ToLower())))
{
List<Telepad> availableTelepads = this.telepad.GetAvailableTelepads();
if (availableTelepads.Count <= 0)
{
TestAccountVariety.Logger.LogDebug((object)"[Enemy] No teleportation points found!");
return;
}
Random random = new Random((int)DateTime.Now.Ticks);
Telepad telepad = availableTelepads[random.Next(0, availableTelepads.Count)];
NetworkObject networkObject = ((NetworkBehaviour)enemyAI).NetworkObject;
NetworkObjectReference sourceTelepadReference = NetworkObjectReference.op_Implicit(((NetworkBehaviour)this.telepad).NetworkObject);
telepad.TeleportEnemyClientRpc(sourceTelepadReference, NetworkObjectReference.op_Implicit(networkObject));
}
}
}
}
namespace TestAccountVariety.ShopItems.Rocket
{
public class Rocket : GrabbableObject
{
[CompilerGenerated]
private sealed class <>c__DisplayClass18_0
{
public Rocket <>4__this;
public int particleIndex;
internal bool <ShootRocket>b__0()
{
return !<>4__this.particles[particleIndex].isPlaying;
}
}
[CompilerGenerated]
private sealed class <ShootRocket>d__18 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public int particleIndex;
public Quaternion rotation;
public Vector3 direction;
public Rocket <>4__this;
private <>c__DisplayClass18_0 <>8__1;
private Vector3 <targetPosition>5__2;
private float <endTime>5__3;
private Random <random>5__4;
private int <explosionIndex>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ShootRocket>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Expected O, but got Unknown
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>8__1 = new <>c__DisplayClass18_0();
<>8__1.<>4__this = <>4__this;
<>8__1.particleIndex = particleIndex;
<>4__this._isFlying = true;
<targetPosition>5__2 = ((Component)<>4__this).transform.position + direction * 1000f;
<endTime>5__3 = Time.time + 1.4f;
goto IL_013f;
case 1:
<>1__state = -1;
((GrabbableObject)<>4__this).hasHitGround = false;
((GrabbableObject)<>4__this).targetFloorPosition = Vector3.MoveTowards(((GrabbableObject)<>4__this).targetFloorPosition, <targetPosition>5__2, <>4__this.flightSpeed * Time.deltaTime);
((Component)<>4__this).transform.rotation = rotation;
<>4__this.UpdatePositionAndRotationClientRpc(((GrabbableObject)<>4__this).targetFloorPosition, rotation);
goto IL_013f;
case 2:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 3;
return true;
case 3:
{
<>1__state = -1;
if (!((NetworkBehaviour)<>4__this).IsHost && !((NetworkBehaviour)<>4__this).IsServer)
{
return false;
}
((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true);
return false;
}
IL_013f:
if (!<>4__this._collided && Time.time <= <endTime>5__3)
{
<>2__current = null;
<>1__state = 1;
return true;
}
<random>5__4 = new Random((uint)(DateTime.Now.Ticks + ((Component)<>4__this).transform.position.ConvertToInt()));
<explosionIndex>5__5 = ((Random)(ref <random>5__4)).NextInt(0, <>4__this.explosionClips.Length);
<>4__this.ExplodeClientRpc(<>8__1.particleIndex, <explosionIndex>5__5);
<>2__current = (object)new WaitUntil((Func<bool>)(() => !<>8__1.<>4__this.particles[<>8__1.particleIndex].isPlaying));
<>1__state = 2;
return true;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public ParticleSystem[] particles;
public ParticleSystem sparkParticles;
public MeshRenderer meshRenderer;
public AudioSource flightSource;
public AudioSource explosionSource;
public AudioSource indoorExplosionSource;
public AudioClip[] explosionClips;
public AudioClip[] indoorExplosionClips;
public BoxCollider boxCollider;
public float flightSpeed = 30f;
private bool _isFlying;
private bool _collided;
private PlayerControllerB _launcher;
private const int _PLAYER_COLLISION_LAYER = 3;
private const int _PLAYER_COLLISION_LAYER_MASK = 8;
private const int _COLLISION_LAYER_MASK = 1393035528;
private readonly Collider[] _colliderResults = (Collider[])(object)new Collider[16];
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (Object.op_Implicit((Object)(object)base.playerHeldBy))
{
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if (!((Object)(object)base.playerHeldBy != (Object)(object)localPlayerController))
{
Quaternion rotation = ((Component)this).transform.rotation;
Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
((MonoBehaviour)localPlayerController).StartCoroutine(localPlayerController.waitToEndOfFrameToDiscard());
ShootRocketServerRpc((int)localPlayerController.playerClientId, eulerAngles);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void ShootRocketServerRpc(int playerWhoLaunched, Vector3 rotation)
{
//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_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: 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_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: 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(2779237465u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerWhoLaunched);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2779237465u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (ReferenceResolver.TryGetPlayer(playerWhoLaunched, out _launcher))
{
Random val3 = default(Random);
((Random)(ref val3))..ctor((uint)(DateTime.Now.Ticks + ((Component)this).transform.position.ConvertToInt()));
int particleIndex = ((Random)(ref val3)).NextInt(0, particles.Length);
((Component)this).transform.rotation = Quaternion.Euler(rotation);
ShootRocketClientRpc(playerWhoLaunched, rotation);
((MonoBehaviour)this).StartCoroutine(ShootRocket(particleIndex, ((Component)this).transform.rotation, ((Component)this).transform.up));
}
}
}
[ClientRpc]
public void ShootRocketClientRpc(int playerWhoLaunched, Vector3 rotation)
{
//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_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: 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(1213994428u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerWhoLaunched);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1213994428u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (ReferenceResolver.TryGetPlayer(playerWhoLaunched, out _launcher))
{
((Component)this).transform.rotation = Quaternion.Euler(rotation);
flightSource.Play();
sparkParticles.Play();
}
}
}
[ClientRpc]
public void UpdatePositionAndRotationClientRpc(Vector3 position, Quaternion rotation)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
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(550549106u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 550549106u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
base.targetFloorPosition = position;
((Component)this).transform.rotation = rotation;
}
}
}
[ClientRpc]
public void ExplodeClientRpc(int particleIndex, int explosionIndex)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
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(1839488551u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, particleIndex);
BytePacker.WriteValueBitPacked(val2, explosionIndex);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1839488551u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ParticleSystem val3 = particles[particleIndex];
explosionSource.clip = explosionClips[explosionIndex];
indoorExplosionSource.clip = indoorExplosionClips[explosionIndex];
flightSource.Stop();
explosionSource.Play();
indoorExplosionSource.Play();
RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 50f, 5f, 0, false, 0);
sparkParticles.Stop();
val3.Play();
Landmine.SpawnExplosion(((Component)this).transform.position, false, 5f, 10f, 75, 35f, (GameObject)null, true);
base.grabbable = false;
base.deactivated = true;
((Component)meshRenderer).gameObject.SetActive(false);
}
}
}
[IteratorStateMachine(typeof(<ShootRocket>d__18))]
public IEnumerator ShootRocket(int particleIndex, Quaternion rotation, Vector3 direction)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ShootRocket>d__18(0)
{
<>4__this = this,
particleIndex = particleIndex,
rotation = rotation,
direction = direction
};
}
[ServerRpc(RequireOwnership = false)]
public void CollideWithPlayerServerRpc(Vector3 position, int playerWhoCollided)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: 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(1206737851u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
BytePacker.WriteValueBitPacked(val2, playerWhoCollided);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1206737851u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (ReferenceResolver.TryGetPlayer(playerWhoCollided, out PlayerControllerB _))
{
UpdatePositionAndRotationClientRpc(position, ((Component)this).transform.rotation);
_collided = true;
}
}
}
public override void Update()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).Update();
if (!_isFlying)
{
return;
}
int num = ((((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) ? 1393035528 : 8);
int num2 = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 0.25f, _colliderResults, num);
PlayerControllerB val2 = default(PlayerControllerB);
for (int i = 0; i < num2; i++)
{
Collider val = _colliderResults[i];
if ((Object)(object)((Component)val).gameObject == (Object)(object)((Component)this).gameObject)
{
continue;
}
if (((Component)val).gameObject.layer == 3)
{
if (((Component)val).TryGetComponent<PlayerControllerB>(ref val2) && val2.playerClientId != _launcher.playerClientId)
{
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if (localPlayerController.playerClientId == val2.playerClientId)
{
CollideWithPlayerServerRpc(base.targetFloorPosition, (int)localPlayerController.playerClientId);
break;
}
}
continue;
}
_collided = true;
break;
}
}
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
((NetworkBehaviour)this).__registerRpc(2779237465u, new RpcReceiveHandler(__rpc_handler_2779237465), "ShootRocketServerRpc");
((NetworkBehaviour)this).__registerRpc(1213994428u, new RpcReceiveHandler(__rpc_handler_1213994428), "ShootRocketClientRpc");
((NetworkBehaviour)this).__registerRpc(550549106u, new RpcReceiveHandler(__rpc_handler_550549106), "UpdatePositionAndRotationClientRpc");
((NetworkBehaviour)this).__registerRpc(1839488551u, new RpcReceiveHandler(__rpc_handler_1839488551), "ExplodeClientRpc");
((NetworkBehaviour)this).__registerRpc(1206737851u, new RpcReceiveHandler(__rpc_handler_1206737851), "CollideWithPlayerServerRpc");
((GrabbableObject)this).__initializeRpcs();
}
private static void __rpc_handler_2779237465(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerWhoLaunched = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoLaunched);
Vector3 rotation = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Rocket)(object)target).ShootRocketServerRpc(playerWhoLaunched, rotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1213994428(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerWhoLaunched = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoLaunched);
Vector3 rotation = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Rocket)(object)target).ShootRocketClientRpc(playerWhoLaunched, rotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_550549106(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
Quaternion rotation = default(Quaternion);
((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Rocket)(object)target).UpdatePositionAndRotationClientRpc(position, rotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1839488551(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int particleIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref particleIndex);
int explosionIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref explosionIndex);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Rocket)(object)target).ExplodeClientRpc(particleIndex, explosionIndex);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1206737851(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
int playerWhoCollided = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoCollided);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Rocket)(object)target).CollideWithPlayerServerRpc(position, playerWhoCollided);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "Rocket";
}
}
}
namespace TestAccountVariety.Patches
{
[HarmonyPatch(typeof(Shovel))]
public static class ShovelPatch
{
[HarmonyPatch("HitShovel")]
[HarmonyPostfix]
public static void FixTwoHandedShovels(Shovel __instance, bool cancel)
{
if (!(!BugFixConfig.fixTwoHandedWeapons.Value || cancel))
{
__instance.previousPlayerHeldBy.twoHanded = ((GrabbableObject)__instance).itemProperties.twoHanded;
}
}
}
}
namespace TestAccountVariety.Items.Yippee
{
public class EvilYippeeParticles : NetworkBehaviour
{
public ParticleSystem particleSystem;
public GrabbableObject grabbableObject;
[NonSerialized]
public static readonly List<NetworkObject> SpawnedPrefabs = new List<NetworkObject>();
private Random _random;
public void Start()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
_random = new Random((uint)(DateTime.Now.Ticks & 0xFFFF));
}
private void OnEnable()
{
if (((NetworkBehaviour)grabbableObject).IsOwner)
{
PlayParticlesServerRpc();
}
}
private void OnDisable()
{
if (Object.op_Implicit((Object)(object)particleSystem))
{
particleSystem.Stop();
}
}
[ServerRpc(RequireOwnership = false)]
public void PlayParticlesServerRpc()
{
//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3143191247u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3143191247u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
try
{
SpawnHazard();
}
catch (Exception ex)
{
Extensions.LogDetailed(ex, (string)null);
}
int num = ((Random)(ref _random)).NextInt(1, 100);
if (num < YippeeConfig.yippeeParticleChance.Value)
{
PlayParticlesClientRpc();
}
}
}
public void SpawnHazard()
{
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
int num = ((Random)(ref _random)).NextInt(1, 100);
if (num >= YippeeConfig.EvilYippeeConfig.evilYippeeHazardSpawnChance.Value || StartOfRound.Instance.inShipPhase)
{
return;
}
List<SpawnableMapObject> list = RoundManager.Instance.currentLevel.spawnableMapObjects.ToList();
list.RemoveAll(delegate(SpawnableMapObject spawnableMapObject)
{
if (!Object.op_Implicit((Object)(object)spawnableMapObject.prefabToSpawn))
{
return true;
}
string text = ((Object)spawnableMapObject.prefabToSpawn).name.ToLower();
if (text.Contains("laseremitter"))
{
return false;
}
return !text.Contains("yeetmine") && !text.Contains("cagemine");
});
SpawnableMapObject val = list[((Random)(ref _random)).NextInt(0, list.Count)];
Transform transform = RoundManager.Instance.mapPropsContainer.transform;
GameObject val2 = Object.Instantiate<GameObject>(val.prefabToSpawn, ((Component)grabbableObject.playerHeldBy).transform.position, Quaternion.identity, transform);
NetworkObject component = val2.GetComponent<NetworkObject>();
component.Spawn(false);
SpawnedPrefabs.Add(component);
}
[ClientRpc]
public void PlayParticlesClientRpc()
{
//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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3718988893u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3718988893u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (Object.op_Implicit((Object)(object)particleSystem))
{
particleSystem.time = 0f;
particleSystem.Play();
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(3143191247u, new RpcReceiveHandler(__rpc_handler_3143191247), "PlayParticlesServerRpc");
((NetworkBehaviour)this).__registerRpc(3718988893u, new RpcReceiveHandler(__rpc_handler_3718988893), "PlayParticlesClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_3143191247(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;
((EvilYippeeParticles)(object)target).PlayParticlesServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3718988893(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;
((EvilYippeeParticles)(object)target).PlayParticlesClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "EvilYippeeParticles";
}
}
public class YippeeParticles : NetworkBehaviour
{
public ParticleSystem particleSystem;
public GrabbableObject grabbableObject;
private Random _random;
public void Start()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
_random = new Random((uint)(DateTime.Now.Ticks & 0xFFFF));
}
private void OnEnable()
{
if (((NetworkBehaviour)grabbableObject).IsOwner)
{
PlayParticlesServerRpc();
}
}
private void OnDisable()
{
if (Object.op_Implicit((Object)(object)particleSystem))
{
particleSystem.Stop();
}
}
[ServerRpc(RequireOwnership = false)]
public void PlayParticlesServerRpc()
{
//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2334083020u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2334083020u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
int num = ((Random)(ref _random)).NextInt(1, 100);
if (num < YippeeConfig.yippeeParticleChance.Value)
{
PlayParticlesClientRpc();
}
}
}
[ClientRpc]
public void PlayParticlesClientRpc()
{
//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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1965948094u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1965948094u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (Object.op_Implicit((Object)(object)particleSystem))
{
particleSystem.time = 0f;
particleSystem.Play();
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(2334083020u, new RpcReceiveHandler(__rpc_handler_2334083020), "PlayParticlesServerRpc");
((NetworkBehaviour)this).__registerRpc(1965948094u, new RpcReceiveHandler(__rpc_handler_1965948094), "PlayParticlesClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_2334083020(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;
((YippeeParticles)(object)target).PlayParticlesServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1965948094(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;
((YippeeParticles)(object)target).PlayParticlesClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "YippeeParticles";
}
}
}
namespace TestAccountVariety.Items.Yippee.Patches
{
[HarmonyPatch(typeof(RoundManager))]
public class RoundManagerPatch
{
[HarmonyPatch("UnloadSceneObjectsEarly")]
[HarmonyPostfix]
public static void CleanEvilYippeeSpawns()
{
RoundManager instance = RoundManager.Instance;
if (instance != null && !((NetworkBehaviour)instance).IsHost && !((NetworkBehaviour)instance).IsServer)
{
return;
}
foreach (NetworkObject item in EvilYippeeParticles.SpawnedPrefabs.Where((NetworkObject spawnedPrefab) => Object.op_Implicit((Object)(object)spawnedPrefab)))
{
item.Despawn(true);
}
EvilYippeeParticles.SpawnedPrefabs.Clear();
}
}
}
namespace TestAccountVariety.Items.WebleyPyramid
{
[CreateAssetMenu(menuName = "ScriptableObjects/AudioClipWithWeight", order = 1)]
public class AudioClipWithWeight : ScriptableObject
{
public AudioClip audioClip;
public int weight;
public bool isDeadly;
}
public class WebleyPyramid : MonoBehaviour
{
[CompilerGenerated]
private sealed class <KillPlayerAfterClip>d__6 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public WebleyPyramid <>4__this;
private PlayerControllerB <localPlayer>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <KillPlayerAfterClip>d__6(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<localPlayer>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitUntil((Func<bool>)(() => !Object.op_Implicit((Object)(object)<>4__this.audioSource) || !<>4__this.audioSource.isPlaying));
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<localPlayer>5__1 = StartOfRound.Instance.localPlayerController;
if ((Object)(object)<localPlayer>5__1 == (Object)null || !Object.op_Implicit((Object)(object)<localPlayer>5__1))
{
if (Object.op_Implicit((Object)(object)<>4__this.animator))
{
<>4__this.animator.SetTrigger(_UntriggerAnimatorHash);
}
return false;
}
if (<localPlayer>5__1.isPlayerDead)
{
if (Object.op_Implicit((Object)(object)<>4__this.animator))
{
<>4__this.animator.SetTrigger(_UntriggerAnimatorHash);
}
return false;
}
<localPlayer>5__1.DamagePlayer(int.MaxValue, true, true, (CauseOfDeath)15, 1, false, default(Vector3));
if (Object.op_Implicit((Object)(object)<>4__this.animator))
{
<>4__this.animator.SetTrigger(_UntriggerAnimatorHash);
}
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 static readonly int _UntriggerAnimatorHash = Animator.StringToHash("Untrigger");
public GrabbableObject grabbableObject;
public AudioSource audioSource;
public List<AudioClipWithWeight> audioClips;
public Animator animator;
private void OnEnable()
{
if (audioSource.isPlaying)
{
animator.SetTrigger(_UntriggerAnimatorHash);
return;
}
if (!grabbableObject.isHeld)
{
animator.SetTrigger(_UntriggerAnimatorHash);
return;
}
PlayerControllerB playerHeldBy = grabbableObject.playerHeldBy;
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if ((Object)(object)playerHeldBy != (Object)(object)localPlayerController)
{
animator.SetTrigger(_UntriggerAnimatorHash);
return;
}
int num = audioClips.Select((AudioClipWithWeight _, int weight) => weight).Sum();
Random val = default(Random);
((Random)(ref val))..ctor((uint)(DateTime.Now.Ticks & 0xFFFF));
int num2 = ((Random)(ref val)).NextInt(num * 3, num * 12 + 1);
AudioClipWithWeight audioClipWithWeight = null;
bool flag;
do
{
flag = false;
foreach (AudioClipWithWeight audioClip in audioClips)
{
num2 -= audioClip.weight;
if (num2 > 0)
{
continue;
}
audioClipWithWeight = audioClip;
flag = true;
break;
}
}
while (!flag);
grabbableObject.currentUseCooldown = audioClipWithWeight.audioClip.length;
audioSource.PlayOneShot(audioClipWithWeight.audioClip);
if (!audioClipWithWeight.isDeadly)
{
animator.SetTrigger(_UntriggerAnimatorHash);
}
else
{
((MonoBehaviour)this).StartCoroutine(KillPlayerAfterClip());
}
}
[IteratorStateMachine(typeof(<KillPlayerAfterClip>d__6))]
public IEnumerator KillPlayerAfterClip()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <KillPlayerAfterClip>d__6(0)
{
<>4__this = this
};
}
}
}
namespace TestAccountVariety.Items.ToyCar
{
public class ToyCar : HoldableNoisemakerProp
{
protected override void __initializeVariables()
{
base.__initializeVariables();
}
protected override void __initializeRpcs()
{
base.__initializeRpcs();
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "ToyCar";
}
}
}
namespace TestAccountVariety.Items.ThrowableCube
{
public class ThrowableCube : StunGrenadeItem
{
public float physicsForce = 45f;
private static InputAction? _interactInputAction;
private static InputAction? _discardInputAction;
private const float KILL_RANGE = 1f;
private const float DAMAGE_RANGE = 3f;
private Random _random;
public override void Start()
{
//IL_001e: 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)
((StunGrenadeItem)this).Start();
_random = new Random((uint)(DateTime.Now.Ticks & 0xFFFF));
}
public override void Update()
{
if (!((GrabbableObject)this).isHeld)
{
((StunGrenadeItem)this).Update();
return;
}
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)localPlayerController)
{
((StunGrenadeItem)this).Update();
return;
}
if (_interactInputAction == null)
{
_interactInputAction = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Interact", false);
}
if (_discardInputAction == null)
{
_discardInputAction = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Discard", false);
}
base.explodeOnCollision = !_interactInputAction.IsPressed() && !_discardInputAction.IsPressed();
((StunGrenadeItem)this).Update();
}
[ServerRpc(RequireOwnership = false)]
public void ExplodeServerRpc()
{
//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(437332633u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 437332633u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
int num = ((Random)(ref _random)).NextInt(1, 100);
bool explode = num < CubeConfig.cubeExplodeChance.Value;
ExplodeClientRpc(explode);
}
}
}
[ClientRpc]
public void ExplodeClientRpc(bool explode)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_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_0097: 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)
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(2048215277u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref explode, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2048215277u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ExplodeStunGrenade(explode);
}
}
}
public void ExplodeStunGrenade(bool explode)
{
//IL_0034: 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)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
base.gotExplodeOnThrowRPC = false;
base.hasCollided = false;
base.explodeTimer = 2.5f;
base.hasExploded = false;
if (explode)
{
Vector3 val = ((Component)this).transform.position + Vector3.up * 0.2f;
Landmine.SpawnExplosion(val, false, 1f, 3f, 40, 0f, (GameObject)null, false);
ApplyPhysicsForce(val);
Transform val2 = ((!((GrabbableObject)this).isInElevator) ? RoundManager.Instance.mapPropsContainer.transform : StartOfRound.Instance.elevatorTransform);
Object.Instantiate<GameObject>(base.stunGrenadeExplosion, ((Component)this).transform.position, Quaternion.identity, val2);
base.itemAudio.PlayOneShot(base.explodeSFX);
WalkieTalkie.TransmitOneShotAudio(base.itemAudio, base.explodeSFX, 1f);
}
}
public void ApplyPhysicsForce(Vector3 explosionPosition)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: 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)
PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
if (IsWithinEffectiveRange(((Component)localPlayerController).transform.position, explosionPosition) && !IsBlockedByObstacle(explosionPosition, ((Component)localPlayerController).transform.position))
{
Vector3 force = CalculatePhysicsForce(((Component)localPlayerController).transform.position, explosionPosition);
if (!((double)((Vector3)(ref force)).magnitude <= 2.0))
{
ApplyForceToLocalPlayer(localPlayerController, force);
}
}
}
private static bool IsWithinEffectiveRange(Vector3 playerPosition, Vector3 explosionPosition)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
float num = Vector3.Distance(playerPosition, explosionPosition);
return (double)num < 35.0;
}
private static bool IsBlockedByObstacle(Vector3 explosionPosition, Vector3 playerPosition)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
return Physics.Linecast(explosionPosition, playerPosition + Vector3.up * 0.3f, ref val, 256, (QueryTriggerInteraction)1);
}
private Vector3 CalculatePhysicsForce(Vector3 playerPosition, Vector3 explosionPosition)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
float num = Vector3.Distance(playerPosition, explosionPosition);
Vector3 val = Vector3.Normalize(playerPosition + Vector3.up * num - explosionPosition);
return val / (num * 0.35f) * physicsForce;
}
private static void ApplyForceToLocalPlayer(PlayerControllerB localPlayer, Vector3 force)
{
//IL_0028: 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_002e: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unkno