Decompiled source of TestAccountVariety v1.35.3

BepInEx/plugins/TestAccount666-TestAccountVariety/TestAccountVariety.dll

Decompiled a day ago
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.ExtendedItems;
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("DissonanceVoip")]
[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.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.35.3.0")]
[assembly: AssemblyInformationalVersion("1.35.3+d8e1b999b1f7a49aa0a341e252186e57a0c6bc71")]
[assembly: AssemblyProduct("TestAccountVariety")]
[assembly: AssemblyTitle("TestAccount666.TestAccountVariety")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.35.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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.10.0")]
	[BepInPlugin("TestAccount666.TestAccountVariety", "TestAccountVariety", "1.35.3")]
	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));
			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.35.3", (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.35.3 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.35.3";
	}
}
namespace TestAccountVariety.Utils
{
	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
	{
		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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: 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) || !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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: 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 != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !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_0113: 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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost) && 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));
		}

		public IEnumerator TeleportPlayer(PlayerControllerB player)
		{
			yield return (object)new WaitForEndOfFrame();
			if (TelepadConfig.telepadDropsItems.Value)
			{
				player.DropAllHeldItems(true, false);
				yield return null;
				yield return (object)new WaitForEndOfFrame();
			}
			player.TeleportPlayer(teleportationPoint.position, false, 0f, false, true);
			player.isInsideFactory = base.isInFactory;
			player.isInElevator = base.isInElevator;
			player.isInHangarShipRoom = base.isInShipRoom;
		}

		[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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: 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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost) && 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();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Telepad()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2721455297u, new RpcReceiveHandler(__rpc_handler_2721455297));
			NetworkManager.__rpc_func_table.Add(3017040244u, new RpcReceiveHandler(__rpc_handler_3017040244));
			NetworkManager.__rpc_func_table.Add(1272997972u, new RpcReceiveHandler(__rpc_handler_1272997972));
			NetworkManager.__rpc_func_table.Add(1281692841u, new RpcReceiveHandler(__rpc_handler_1281692841));
		}

		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)2;
				((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)2;
				((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)2;
				((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.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)
			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))
			{
				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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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;
			}
			SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects;
			List<SpawnableMapObject> list = new List<SpawnableMapObject>(spawnableMapObjects.Length);
			list.AddRange(spawnableMapObjects);
			List<SpawnableMapObject> list2 = list;
			list2.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 = list2[((Random)(ref _random)).NextInt(0, list2.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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3718988893u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3718988893u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && Object.op_Implicit((Object)(object)particleSystem))
				{
					particleSystem.time = 0f;
					particleSystem.Play();
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_EvilYippeeParticles()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3143191247u, new RpcReceiveHandler(__rpc_handler_3143191247));
			NetworkManager.__rpc_func_table.Add(3718988893u, new RpcReceiveHandler(__rpc_handler_3718988893));
		}

		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)2;
				((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)
			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))
			{
				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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1965948094u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1965948094u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && Object.op_Implicit((Object)(object)particleSystem))
				{
					particleSystem.time = 0f;
					particleSystem.Play();
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_YippeeParticles()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2334083020u, new RpcReceiveHandler(__rpc_handler_2334083020));
			NetworkManager.__rpc_func_table.Add(1965948094u, new RpcReceiveHandler(__rpc_handler_1965948094));
		}

		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)2;
				((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
	{
		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());
			}
		}

		public IEnumerator KillPlayerAfterClip()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => !Object.op_Implicit((Object)(object)audioSource) || !audioSource.isPlaying));
			PlayerControllerB localPlayer = StartOfRound.Instance.localPlayerController;
			if ((Object)(object)localPlayer == (Object)null || !Object.op_Implicit((Object)(object)localPlayer))
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetTrigger(_UntriggerAnimatorHash);
				}
				yield break;
			}
			if (localPlayer.isPlayerDead)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetTrigger(_UntriggerAnimatorHash);
				}
				yield break;
			}
			localPlayer.DamagePlayer(int.MaxValue, true, true, (CauseOfDeath)15, 1, false, default(Vector3));
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetTrigger(_UntriggerAnimatorHash);
			}
		}
	}
}
namespace TestAccountVariety.Items.ToyCar
{
	public class ToyCar : HoldableNoisemakerProp
	{
		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[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)
			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))
				{
					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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					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: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			if ((double)((Vector3)(ref force)).magnitude > 10.0)
			{
				localPlayer.CancelSpecialTriggerAnimations();
			}
			if (localPlayer.inVehicleAnimation)
			{
				Vector3 val = localPlayer.externalForceAutoFade + force;
				if ((double)((Vector3)(ref val)).magnitude < 50.0)
				{
					return;
				}
			}
			localPlayer.externalForceAutoFade += force;
		}

		public Vector3 GetGrenadeThrowDestination()
		{
			//IL_0013: 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)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0043: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform;
			Vector3 val = transform.position;
			Vector3 forward = transform.forward;
			if (forward.y <= -0.9f)
			{
				val += -forward;
			}
			RaycastHit val2 = default(RaycastHit);
			Vector3 val3 = (Physics.Raycast(val, forward, ref val2, 15f, base.stunGrenadeMask) ? ((RaycastHit)(ref val2)).point : (val + forward * 15f));
			RaycastHit val4 = default(RaycastHit);
			if (Physics.Raycast(new Ray(val3 + Vector3.up, Vector3.down), ref val4, 100f, base.stunGrenadeMask))
			{
				return ((RaycastHit)(ref val4)).point + new Vector3(0f, ((GrabbableObject)this).itemProperties.verticalOffset, 0f);
			}
			TestAccountVariety.Logger.LogError((object)(((GrabbableObject)this).playerHeldBy.playerUsername + " cube couldn't find ground!"));
			return val3;
		}

		protected override void __initializeVariables()
		{
			((StunGrenadeItem)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ThrowableCube()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(437332633u, new RpcReceiveHandler(__rpc_handler_437332633));
			NetworkManager.__rpc_func_table.Add(2048215277u, new RpcReceiveHandler(__rpc_handler_2048215277));
		}

		private static void __rpc_handler_437332633(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;
				((ThrowableCube)(object)target).ExplodeServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2048215277(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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool explode = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref explode, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ThrowableCube)(object)target).ExplodeClientRpc(explode);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string? __getTypeName()
		{
			return "ThrowableCube";
		}
	}
}
namespace TestAccountVariety.Items.ThrowableCube.Patches
{
	[HarmonyPatch(typeof(StunGrenadeItem))]
	public static class ThrowableCubePatch
	{
		[HarmonyPatch("GetGrenadeThrowDestination")]
		[HarmonyPrefix]
		private static bool RedirectGetGrenadeThrowDestination(StunGrenadeItem __instance, ref Vector3 __result)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (!(__instance is ThrowableCube throwableCube))
			{
				return true;
			}
			__result = throwableCube.GetGrenadeThrowDestination();
			return false;
		}

		[HarmonyPatch("ExplodeStunGrenade")]
		[HarmonyPrefix]
		private static bool RedirectExplodeStunGrenade(StunGrenadeItem __instance)
		{
			if (!(__instance is ThrowableCube throwableCube))
			{
				return true;
			}
			if (!((NetworkBehaviour)throwableCube).IsOwner)
			{
				return false;
			}
			if (!((GrabbableObject)throwableCube).grabbable)
			{
				return false;
			}
			throwableCube.ExplodeServerRpc();
			return false;
		}
	}
}
namespace TestAccountVariety.Items.ThrowableCube.Colored
{
	public class ColoredThrowableCube : ThrowableCube
	{
		public MeshRenderer renderer;

		public Material opaqueMaterial;

		public Material transparentMaterial;

		[FormerlySerializedAs("light")]
		public Light[] lights;

		public Item[] itemPropertiesBySize;

		public float[] sizes;

		public LightList[] lightLists;

		public Random colorRandom;

		public bool choseColor;

		public float red;

		public float green;

		public float blue;

		public float alpha;

		public int sizeIndex;

		public bool enableLights;

		public bool isRainbow;

		public float currentColorHSV;

		public bool reverse;

		public const float HSV_INCREMENT = 0.1f;

		public override void Start()
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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)
			base.Start();
			if (itemPropertiesBySize.Length != 0)
			{
				Item[] array = itemPropertiesBySize;
				foreach (Item val in array)
				{
					val.itemId = ((GrabbableObject)this).itemProperties.itemId;
				}
			}
			LightList[] array2 = lightLists;
			foreach (LightList lightList in array2)
			{
				Light[] array3 = lightList.lights;
				foreach (Light val2 in array3)
				{
					((Behaviour)val2).enabled = false;
				}
			}
			uint num = (uint)(StartOfRound.Instance.randomMapSeed + ((Component)this).transform.position.ConvertToInt() + (DateTime.Now.Ticks & 0xFFFF));
			colorRandom = new Random(num);
			SyncColorServerRpc();
		}

		private void FixedUpdate()
		{
			if (!isRainbow)
			{
				return;
			}
			currentColorHSV += (reverse ? (-0.1f) : 0.1f) * Time.deltaTime;
			float num = currentColorHSV;
			float num2 = num;
			if (!(num2 >= 1f))
			{
				if (num2 <= 0f && reverse)
				{
					currentColorHSV = 0f;
					reverse = false;
				}
			}
			else if (!reverse)
			{
				currentColorHSV = 1f;
				reverse = true;
			}
			UpdateColor(useHSV: true, createNewMaterial: false);
		}

		public override void EquipItem()
		{
			((StunGrenadeItem)this).EquipItem();
			ActivateLights(enable: true);
		}

		public override void GrabItem()
		{
			((GrabbableObject)this).GrabItem();
			ActivateLights(enable: true);
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			ActivateLights(enable: false);
		}

		public void ActivateLights(bool enable)
		{
			Light[] array = lights;
			foreach (Light val in array)
			{
				((Behaviour)val).enabled = enableLights;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncColorServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(958627876u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 958627876u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (!choseColor)
				{
					red = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					green = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					blue = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					alpha = ((Random)(ref colorRandom)).NextFloat(0.2f, 1f);
					sizeIndex = ((itemPropertiesBySize.Length == 0) ? (-1) : ((Random)(ref colorRandom)).NextInt(0, itemPropertiesBySize.Length));
					enableLights = ((Random)(ref colorRandom)).NextInt(1, 100) <= CubeConfig.ColoredCubeConfig.coloredCubeLightChance.Value;
					isRainbow = ((Random)(ref colorRandom)).NextInt(1, 100) <= CubeConfig.ColoredCubeConfig.coloredCubeRainbowChance.Value;
					choseColor = true;
				}
				SyncColorClientRpc(red, green, blue, alpha, sizeIndex, enableLights, isRainbow);
			}
		}

		[ClientRpc]
		public void SyncColorClientRpc(float red, float green, float blue, float alpha, int sizeIndex, bool enableLights, bool isRainbow)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1715528030u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref red, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref green, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref blue, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref alpha, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, sizeIndex);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enableLights, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isRainbow, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1715528030u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				this.red = red;
				this.green = green;
				this.blue = blue;
				this.alpha = alpha;
				this.sizeIndex = sizeIndex;
				this.enableLights = enableLights;
				this.isRainbow = isRainbow;
				float num = default(float);
				float num2 = default(float);
				Color.RGBToHSV(new Color(this.red, this.green, this.blue, this.alpha), ref currentColorHSV, ref num, ref num2);
				if (this.sizeIndex >= 0)
				{
					float num3 = sizes[this.sizeIndex];
					((GrabbableObject)this).itemProperties = itemPropertiesBySize[this.sizeIndex];
					((Component)this).transform.localScale = new Vector3(num3, num3, num3);
					((GrabbableObject)this).originalScale = new Vector3(num3, num3, num3);
					lights = lightLists[this.sizeIndex].lights;
				}
				UpdateColor(useHSV: false, createNewMaterial: true);
			}
		}

		public void UpdateColor(bool useHSV, bool createNewMaterial)
		{
			//IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_00af: 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_008e: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			if (useHSV)
			{
				Color val = Color.HSVToRGB(currentColorHSV, 1f, 1f);
				red = val.r;
				green = val.g;
				blue = val.b;
			}
			Color color = default(Color);
			((Color)(ref color))..ctor(red, green, blue, alpha);
			Material val2 = (Material)((!createNewMaterial) ? ((object)((Renderer)renderer).material) : ((object)new Material(Math.Approx(alpha, 1f, 0.1f) ? opaqueMaterial : transparentMaterial)
			{
				color = color
			}));
			if (!createNewMaterial)
			{
				val2.color = color;
			}
			((Renderer)renderer).material = val2;
			Light[] array = lights;
			foreach (Light val3 in array)
			{
				val3.color = color;
				((Behaviour)val3).enabled = enableLights;
			}
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ColoredThrowableCube()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(958627876u, new RpcReceiveHandler(__rpc_handler_958627876));
			NetworkManager.__rpc_func_table.Add(1715528030u, new RpcReceiveHandler(__rpc_handler_1715528030));
		}

		private static void __rpc_handler_958627876(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;
				((ColoredThrowableCube)(object)target).SyncColorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1715528030(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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float num = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num, default(ForPrimitives));
				float num2 = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num2, default(ForPrimitives));
				float num3 = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num3, default(ForPrimitives));
				float num4 = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num4, default(ForPrimitives));
				int num5 = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num5);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				bool flag2 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ColoredThrowableCube)(object)target).SyncColorClientRpc(num, num2, num3, num4, num5, flag, flag2);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "ColoredThrowableCube";
		}
	}
	public class LightList : MonoBehaviour
	{
		public int size;

		public Light[] lights;
	}
}
namespace TestAccountVariety.Items.ThrowableCube.Colored.HyperCube
{
	public class HyperCube : ThrowableCube
	{
		public MeshRenderer[] starRenderers;

		public MeshRenderer renderer;

		public Random colorRandom;

		public bool choseColor;

		public float red;

		public float green;

		public float blue;

		public float currentColorHSV;

		public bool reverse;

		public const float HSV_INCREMENT = 0.1f;

		public override void Start()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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)
			base.Start();
			uint num = (uint)(StartOfRound.Instance.randomMapSeed + ((Component)this).transform.position.ConvertToInt() + (DateTime.Now.Ticks & 0xFFFF));
			colorRandom = new Random(num);
			SyncColorServerRpc();
		}

		private void FixedUpdate()
		{
			currentColorHSV += (reverse ? (-0.1f) : 0.1f) * Time.deltaTime;
			float num = currentColorHSV;
			float num2 = num;
			if (!(num2 >= 1f))
			{
				if (num2 <= 0f && reverse)
				{
					currentColorHSV = 0f;
					reverse = false;
				}
			}
			else if (!reverse)
			{
				currentColorHSV = 1f;
				reverse = true;
			}
			UpdateColor(useHSV: true, createNewMaterial: false);
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncColorServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3876681021u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3876681021u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (!choseColor)
				{
					red = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					green = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					blue = ((Random)(ref colorRandom)).NextFloat(0f, 1f);
					choseColor = true;
				}
				SyncColorClientRpc(red, green, blue);
			}
		}

		[ClientRpc]
		public void SyncColorClientRpc(float red, float green, float blue)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3452600983u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref red, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref green, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref blue, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3452600983u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					this.red = red;
					this.green = green;
					this.blue = blue;
					float num = default(float);
					float num2 = default(float);
					Color.RGBToHSV(new Color(this.red, this.green, this.blue, 1f), ref currentColorHSV, ref num, ref num2);
					UpdateColor(useHSV: false, createNewMaterial: true);
				}
			}
		}

		public void UpdateColor(bool useHSV, bool createNewMaterial)
		{
			//IL_0017: 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_001f: 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)
			if (useHSV)
			{
				Color color = Color.HSVToRGB(currentColorHSV, 1f, 1f);
				UpdateColor(0, color, createNewMaterial);
				return;
			}
			Color color2 = default(Color);
			((Color)(ref color2))..ctor(red, green, blue, 1f);
			for (int i = 0; i < 4; i++)
			{
				UpdateColor(i, color2, createNewMaterial);
			}
		}

		public void UpdateColor(int index, Color color, bool createNewMaterial)
		{
			//IL_0072: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			if (1 == 0)
			{
			}
			MeshRenderer[] array = (MeshRenderer[])((index != 0) ? ((Array)new MeshRenderer[1] { renderer }) : ((Array)new ReadOnlySpan<MeshRenderer>(starRenderers).ToArray()));
			if (1 == 0)
			{
			}
			MeshRenderer[] array2 = array;
			int num = 0;
			if (index >= 1)
			{
				num = index - 1;
			}
			MeshRenderer[] array3 = array2;
			foreach (MeshRenderer val in array3)
			{
				Material[] materials = ((Renderer)val).materials;
				Material val2 = (Material)(createNewMaterial ? ((object)new Material(materials[num])) : ((object)materials[num]));
				color.a = val2.color.a;
				val2.color = color;
				materials[num] = val2;
				((Renderer)val).materials = materials;
				((Renderer)val).material = materials[0];
			}
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HyperCube()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3876681021u, new RpcReceiveHandler(__rpc_handler_3876681021));
			NetworkManager.__rpc_func_table.Add(3452600983u, new RpcReceiveHandler(__rpc_handler_3452600983));
		}

		private static void __rpc_handler_3876681021(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;
				((HyperCube)(object)target).SyncColorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3452600983(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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float num = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num, default(ForPrimitives));
				float num2 = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num2, default(ForPrimitives));
				float num3 = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num3, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HyperCube)(object)target).SyncColorClientRpc(num, num2, num3);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "HyperCube";
		}
	}
}
namespace TestAccountVariety.Items.ShibaPlush
{
	public class ShibaPlush : NoisemakerProp
	{
		private static readonly int _SqueezeAnimatorHash = Animator.StringToHash("Squeeze");

		public ShibaPlushFunction[] shibaPlushFunctions;

		public GameObject partyHat;

		public override void Start()
		{
			((NoisemakerProp)this).Start();
			partyHat.SetActive(false);
			DateTime now = DateTime.Now;
			int day = now.Day;
			if (day >= 8 && day <= 10 && now.Month == 10)
			{
				partyHat.SetActive(true);
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && Object.op_Implicit((Object)(object)((GrabbableObject)this).playerHeldBy))
			{
				PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
				if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)localPlayerController))
				{
					Random val = default(Random);
					((Random)(ref val))..ctor((uint)(DateTime.Now.Ticks & 0xFFFF));
					RunActionServerRpc(((Random)(ref val)).NextInt(0, shibaPlushFunctions.Length));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void RunActionServerRpc(int index)
		{
			//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)
			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(1613242418u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, index);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1613242418u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RunActionClientRpc(index);
				}
			}
		}

		[ClientRpc]
		public void RunActionClientRpc(int index)
		{
			//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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkMa