Decompiled source of Wesleys Shenanigans v1.0.0

WesleysInteriorTools.dll

Decompiled 8 hours 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.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen;
using DunGen.Tags;
using GameNetcodeStuff;
using HarmonyLib;
using JLL.API;
using JLL.Components;
using LethalLevelLoader;
using LethalModDataLib.Base;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Animations.Rigging;
using UnityEngine.Events;
using UnityEngine.Rendering.HighDefinition;
using WesleysInteriorTools.EnemyAiChanges;
using WesleysInteriorTools.Enums;
using WesleysInteriorTools.Features;
using WesleysInteriorTools.Items;
using WesleysInteriorTools.NetcodePatcher;
using WesleysInteriorTools.Patches;
using WesleysInteriorTools.Save;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("WesleysInteriorTools")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WesleysInteriorTools")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("39592857-f60c-4037-afe6-6ad4e7189866")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: NetcodePatchedAssembly]
public class AssimilatedEmployee : EnemyAI
{
	private int previousBehaviourState = -1;

	private Vector3 fallToPosition;

	private RaycastHit rayHit;

	public bool hasBurst;

	private Coroutine fallToGroundCoroutine;

	public AnimationCurve fallCurve;

	public ParticleSystem burstParticle;

	public SkinnedMeshRenderer thisSkinnedRenderer;

	public AudioClip burstSFX;

	private Vector3 agentLocalVelocity;

	private float velX;

	private float velZ;

	public Transform animationContainer;

	private Vector3 previousPosition;

	public float seenPlayersTimer;

	public AISearchRoutine searchForPlayers;

	private Vector3 lastPositionOfSeenPlayer;

	private bool lostPlayerInChase;

	private float lostPlayerTimer;

	private float seePlayerMeter;

	private float jitterMoveInterval;

	private Vector3 jitterDest;

	private RaycastHit rayhit;

	public bool testingBloomEnemy;

	private bool chestPlantVisible;

	private float timeSinceBurst;

	public AudioSource breathingSFX;

	public AudioSource burstSource;

	public AudioSource burstSource2;

	public List<AudioClip> plantFeetHitClips;

	public AudioClip chestBurst;

	private float timeAtLastChestBurst;

	public AudioClip[] chestPlantRoars;

	private float timeAtLastHeardNoise;

	private Vector3 pingAttentionPos;

	private float timeSinceHittingPlayer;

	private float timeAtLastHitStun;

	public GameObject killParticle;

	public PlayerControllerB burstPlayer;

	public AudioClip bitePlayer;

	private ScanNodeProperties playerScanNode;

	private float distanceToTarget;

	private RaycastHit hit;

	private bool isBehindObstacle;

	private float checkPathDistanceInterval;

	public Transform radarHeadTransform;

	public ParticleSystem teleportParticle;

	private IEnumerator teleportBloomCoroutine;

	public List<MeshRenderer> AltEnemyMeshes;

	public override Transform GetRadarHeadTransform()
	{
		return radarHeadTransform;
	}

	public override void ShipTeleportEnemy()
	{
		((EnemyAI)this).ShipTeleportEnemy();
		if (teleportBloomCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(teleportBloomCoroutine);
		}
		((MonoBehaviour)this).StartCoroutine(teleportBloom());
	}

	private IEnumerator teleportBloom()
	{
		teleportParticle.Play();
		base.creatureVoice.PlayOneShot(Object.FindObjectOfType<ShipTeleporter>().beamUpPlayerBodySFX);
		yield return (object)new WaitForSeconds(3f);
		if (StartOfRound.Instance.shipIsLeaving || !hasBurst)
		{
			yield break;
		}
		((EnemyAI)this).SetEnemyOutside(true);
		base.isInsidePlayerShip = true;
		ShipTeleporter[] array = Object.FindObjectsOfType<ShipTeleporter>();
		ShipTeleporter shipTeleporter = null;
		if (array != null)
		{
			for (int i = 0; i < array.Length; i++)
			{
				if (!array[i].isInverseTeleporter)
				{
					shipTeleporter = array[i];
				}
			}
		}
		if ((Object)(object)shipTeleporter != (Object)null)
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				((Behaviour)base.agent).enabled = false;
				((Component)this).transform.position = shipTeleporter.teleporterPosition.position;
				((Behaviour)base.agent).enabled = true;
				base.isInsidePlayerShip = true;
			}
			base.serverPosition = shipTeleporter.teleporterPosition.position;
			PlayerControllerB closestPlayer = ((EnemyAI)this).GetClosestPlayer(false, false, false);
			if ((Object)(object)closestPlayer != (Object)null)
			{
				PingAttention(((Component)closestPlayer.playerEye).transform.position);
			}
		}
		teleportBloomCoroutine = null;
	}

	public override void Start()
	{
		//IL_0066: 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)
		((EnemyAI)this).Start();
		if (!testingBloomEnemy)
		{
			base.inSpecialAnimation = true;
			((Behaviour)base.agent).enabled = false;
			if (!hasBurst)
			{
				((EnemyAI)this).EnableEnemyMesh(false, false, true);
			}
		}
		else
		{
			BurstForth(StartOfRound.Instance.allPlayerScripts[0], kill: false, ((Component)StartOfRound.Instance.allPlayerScripts[0]).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[0]).transform.eulerAngles);
		}
		AssimilatedGrowth assimilatedGrowth = Object.FindObjectOfType<AssimilatedGrowth>();
		if ((Object)(object)assimilatedGrowth != (Object)null)
		{
			int num = -1;
			for (int i = 0; i < assimilatedGrowth.bloomEnemies.Length; i++)
			{
				if ((Object)(object)assimilatedGrowth.bloomEnemies[i] == (Object)null)
				{
					num = i;
					break;
				}
			}
			assimilatedGrowth.bloomEnemies[num] = this;
		}
		lostPlayerInChase = true;
	}

	public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: 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_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: 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_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		if (!((NetworkBehaviour)this).IsOwner || !lostPlayerInChase || seePlayerMeter > 0.07f || base.inSpecialAnimation || base.isEnemyDead || Time.realtimeSinceStartup - timeAtLastHeardNoise < 1f || Vector3.Distance(noisePosition, ((Component)this).transform.position + Vector3.up * 0.4f) < 0.5f || (base.currentBehaviourStateIndex == 2 && Vector3.Angle(((Component)this).transform.forward, noisePosition - ((Component)this).transform.position) < 60f))
		{
			return;
		}
		float num = Vector3.Distance(noisePosition, ((Component)this).transform.position);
		float num2 = noiseLoudness / num;
		if (!(num > 15f) && !(num2 <= 0.075f))
		{
			if (Physics.Linecast(((Component)this).transform.position, noisePosition, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
			{
				num2 *= 0.6f;
			}
			if (!(num2 <= 0.022f))
			{
				PingAttention(noisePosition);
			}
		}
	}

	public void PingAttention(Vector3 lookAtPos)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		timeAtLastHeardNoise = Time.realtimeSinceStartup;
		pingAttentionPos = lookAtPos;
		PingAttentionRpc(lookAtPos);
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void PingAttentionRpc(Vector3 lookAtPos)
	{
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: 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_0084: 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_00c4: 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)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3351050978u, val3, val, (SendTo)5, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref lookAtPos);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 3351050978u, val3, val, (SendTo)5, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				timeAtLastHeardNoise = Time.realtimeSinceStartup;
				pingAttentionPos = lookAtPos;
			}
		}
	}

	public void BurstForth(PlayerControllerB player, bool kill, Vector3 burstPosition, Vector3 burstRotation)
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		burstPlayer = player;
		player.redirectToEnemy = (EnemyAI)(object)this;
		((EnemyAI)this).EnableEnemyMesh(true, false, false);
		base.inSpecialAnimation = true;
		((Behaviour)base.agent).enabled = false;
		((Component)this).transform.position = burstPosition + Vector3.up * 0.005f;
		((Component)this).transform.rotation = Quaternion.Euler(burstRotation);
		((EnemyAI)this).SetEnemyOutside(burstPosition.y > -90f);
		SetSuit(player.currentSuitID);
		player.DropBlood(Vector3.down, true, false);
		timeSinceBurst = Time.realtimeSinceStartup;
		fallToPosition = burstPosition;
		if (Physics.Raycast(burstPosition + Vector3.up * 0.75f, Vector3.down, ref rayHit, 10f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
		{
			fallToPosition = ((RaycastHit)(ref rayHit)).point;
		}
		fallToPosition = RoundManager.Instance.GetNavMeshPosition(fallToPosition, default(NavMeshHit), 1f, base.agentMask);
		if (!RoundManager.Instance.GotNavMeshPositionResult)
		{
			fallToPosition = RoundManager.Instance.GetNavMeshPosition(fallToPosition, default(NavMeshHit), 10f, base.agentMask);
		}
		base.serverPosition = fallToPosition;
		base.serverRotation = ((Component)this).transform.eulerAngles;
		if (kill && (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController)
		{
			if (!player.isPlayerDead)
			{
				player.KillPlayer(Vector3.zero, false, (CauseOfDeath)5, 0, default(Vector3), true);
			}
			else
			{
				player.overrideDontSpawnBody = true;
				player.overrideDropItems = true;
			}
			player.overrideGameOverSpectatePivot = base.eye;
		}
		playerScanNode = ((Component)this).gameObject.GetComponentInChildren<ScanNodeProperties>();
		playerScanNode.headerText = "Body of " + player.playerUsername;
		playerScanNode.subText = "Cause of death: Assimilation";
		playerScanNode.maxRange = 0;
		hasBurst = true;
		if (fallToGroundCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(fallToGroundCoroutine);
		}
		fallToGroundCoroutine = ((MonoBehaviour)this).StartCoroutine(DoBurstAnimation());
	}

	private IEnumerator DoBurstAnimation()
	{
		base.creatureAnimator.SetTrigger("Burst");
		burstParticle.Play(true);
		burstSource.pitch = Random.Range(0.93f, 1.07f);
		burstSource2.PlayOneShot(burstSFX);
		WalkieTalkie.TransmitOneShotAudio(burstSource2, burstSFX, 1f);
		float num = Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, ((Component)this).transform.position);
		if (num < 5f)
		{
			HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
		}
		else if (num < 14f)
		{
			HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
		}
		float fallTimer = 0f;
		float fallTime = Mathf.Min(Vector3.Distance(((Component)this).transform.position, fallToPosition), 15f) * 0.1f;
		Vector3 startFallingPos = ((Component)this).transform.position;
		Random random = new Random(StartOfRound.Instance.randomMapSeed + 7);
		CadaverGrowthAI cadaverGrowthAI = Object.FindObjectOfType<CadaverGrowthAI>();
		float animationTime = 1.7f;
		if ((Object)(object)cadaverGrowthAI != (Object)null && (Object)(object)burstPlayer != (Object)null && Object.op_Implicit((Object)(object)((EnemyAI)this).GetClosestPlayer(false, false, false)) && base.mostOptimalDistance < 7f && cadaverGrowthAI.playerInfections[burstPlayer.playerClientId].emittingSpores && random.Next(0, 100) < 40)
		{
			animationTime = 0.35f;
		}
		if (!((EnemyAI)this).IsInsideMineshaftElevator(((Component)this).transform.position) || RoundManager.Instance.currentMineshaftElevator.elevatorFinishedMoving)
		{
			while (fallTimer < fallTime)
			{
				fallTimer += Time.deltaTime;
				animationTime -= Time.deltaTime;
				((Component)this).transform.position = Vector3.Lerp(startFallingPos, fallToPosition, Mathf.Clamp(fallCurve.Evaluate(fallTimer / (fallTime + 0.01f)), 0f, 1f));
				yield return null;
			}
			((Component)this).transform.position = fallToPosition;
		}
		if (animationTime > 0f)
		{
			yield return (object)new WaitForSeconds(animationTime);
		}
		yield return (object)new WaitForSeconds(1.5f);
		base.creatureAnimator.SetBool("SproutLegs", true);
		int rand = Random.Range(0, plantFeetHitClips.Count);
		base.creatureSFX.PlayOneShot(plantFeetHitClips[rand]);
		yield return (object)new WaitForSeconds(0.25f);
		breathingSFX.Play();
		base.creatureSFX.Play();
		base.inSpecialAnimation = false;
		base.creatureAnimator.SetBool("FinishBurst", true);
		base.exitVentAnimationTime = 0f;
		if (((NetworkBehaviour)this).IsOwner)
		{
			CheckForVeryClosePlayer(seeInstantly: true);
		}
	}

	public void SetSuit(int suitId)
	{
		Material suitMaterial = StartOfRound.Instance.unlockablesList.unlockables[suitId].suitMaterial;
		Material[] sharedMaterials = ((Renderer)thisSkinnedRenderer).sharedMaterials;
		sharedMaterials[0] = suitMaterial;
		((Renderer)thisSkinnedRenderer).sharedMaterials = sharedMaterials;
	}

	public override void DoAIInterval()
	{
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: 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_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		if (base.inSpecialAnimation)
		{
			return;
		}
		((EnemyAI)this).DoAIInterval();
		switch (base.currentBehaviourStateIndex)
		{
		case 0:
			if (!CheckForVeryClosePlayer())
			{
				if (!lostPlayerInChase)
				{
					((EnemyAI)this).SwitchToBehaviourState(1);
				}
				else if (!searchForPlayers.inProgress)
				{
					searchForPlayers.searchWidth = 80f;
					((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers);
				}
			}
			break;
		case 1:
			if (CheckForVeryClosePlayer())
			{
				break;
			}
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				checkPathDistanceInterval -= base.AIIntervalTime;
				if (checkPathDistanceInterval < 0f)
				{
					Vector3 val = ((Component)base.targetPlayer).transform.position;
					if (Physics.Raycast(((Component)base.targetPlayer).transform.position, Vector3.down, ref hit, 15f, base.agentMask, (QueryTriggerInteraction)1))
					{
						val = ((RaycastHit)(ref hit)).point;
					}
					if (((EnemyAI)this).GetPathDistance(val, ((Component)this).transform.position))
					{
						distanceToTarget = base.pathDistance;
						isBehindObstacle = distanceToTarget - Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > distanceToTarget / 5f;
					}
					else
					{
						distanceToTarget = Vector3.Distance(((Component)base.targetPlayer).transform.position, ((Component)this).transform.position);
						isBehindObstacle = false;
					}
					if (distanceToTarget > 8.7f)
					{
						checkPathDistanceInterval = 0.5f;
					}
					else
					{
						checkPathDistanceInterval = 0f;
					}
				}
			}
			if (lostPlayerInChase)
			{
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 9f;
				if (!searchForPlayers.inProgress)
				{
					searchForPlayers.searchWidth = 18f;
					if (lastPositionOfSeenPlayer == Vector3.zero)
					{
						lastPositionOfSeenPlayer = ((Component)this).transform.position;
					}
					((EnemyAI)this).StartSearch(lastPositionOfSeenPlayer, searchForPlayers);
				}
				if (lostPlayerTimer > 9f)
				{
					((EnemyAI)this).SwitchToBehaviourState(0);
				}
			}
			else if (searchForPlayers.inProgress)
			{
				((EnemyAI)this).StopSearch(searchForPlayers, true);
			}
			break;
		case 2:
			break;
		}
	}

	private bool CheckForVeryClosePlayer(bool seeInstantly = false)
	{
		//IL_003b: 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_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: 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)
		float num = -1f;
		if (seeInstantly)
		{
			num = 6f;
		}
		int allPlayersInLineOfSightNonAlloc = ((EnemyAI)this).GetAllPlayersInLineOfSightNonAlloc(70f, 50, (Transform)null, num, -1);
		float num2 = 2000f;
		int num3 = -1;
		for (int i = 0; i < allPlayersInLineOfSightNonAlloc; i++)
		{
			Vector3 val = base.eye.position - ((Component)RoundManager.Instance.tempPlayersArray[i]).transform.position;
			float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
			if (sqrMagnitude < num2)
			{
				num2 = sqrMagnitude;
				num3 = i;
			}
		}
		if (num3 != -1)
		{
			lostPlayerTimer = 0f;
			seePlayerMeter = Mathf.Min(seePlayerMeter + base.AIIntervalTime, 0.5f);
			if (seePlayerMeter > 0.25f || seeInstantly)
			{
				lastPositionOfSeenPlayer = ((Component)RoundManager.Instance.tempPlayersArray[num3]).transform.position;
				lostPlayerInChase = false;
				seePlayerMeter = 0f;
				if ((Object)(object)base.targetPlayer == (Object)null || (Object)(object)base.targetPlayer != (Object)(object)RoundManager.Instance.tempPlayersArray[num3])
				{
					base.targetPlayer = RoundManager.Instance.tempPlayersArray[num3];
					SetNewTargetPlayerRpc((int)RoundManager.Instance.tempPlayersArray[num3].playerClientId);
					((EnemyAI)this).ChangeOwnershipOfEnemy(RoundManager.Instance.tempPlayersArray[num3].actualClientId);
					((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1);
				}
				return true;
			}
		}
		else
		{
			seePlayerMeter = Mathf.Max(seePlayerMeter - base.AIIntervalTime, 0f);
			lostPlayerTimer += base.AIIntervalTime;
			if (lostPlayerTimer > 6f)
			{
				lostPlayerInChase = true;
			}
		}
		return false;
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetNewTargetPlayerRpc(int playerId)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: 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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_00e8: 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)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2948708928u, val3, val, (SendTo)5, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 2948708928u, val3, val, (SendTo)5, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				base.targetPlayer = StartOfRound.Instance.allPlayerScripts[playerId];
				lostPlayerInChase = false;
				lostPlayerTimer = 0f;
				lastPositionOfSeenPlayer = ((Component)base.targetPlayer).transform.position;
				((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1);
			}
		}
	}

	private void CalculateAnimationDirection(float maxSpeed = 1f)
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		if (((Vector3)(ref agentLocalVelocity)).sqrMagnitude > 0f)
		{
			base.creatureSFX.volume = Mathf.Lerp(base.creatureSFX.volume, 1f, Time.deltaTime * 10f);
		}
		else
		{
			base.creatureSFX.volume = Mathf.Lerp(base.creatureSFX.volume, 0f, Time.deltaTime * 10f);
		}
		agentLocalVelocity = animationContainer.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / (Time.deltaTime * 2f));
		velX = Mathf.Lerp(velX, agentLocalVelocity.x, 10f * Time.deltaTime);
		base.creatureAnimator.SetFloat("MoveX", Mathf.Clamp(velX, 0f - maxSpeed, maxSpeed));
		velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime);
		base.creatureAnimator.SetFloat("MoveZ", Mathf.Clamp(velZ, 0f - maxSpeed, maxSpeed));
		previousPosition = ((Component)this).transform.position;
	}

	public override void OnCollideWithPlayer(Collider other)
	{
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		((EnemyAI)this).OnCollideWithPlayer(other);
		if (!(Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.65f) && !base.isEnemyDead)
		{
			PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
			if ((Object)(object)val != (Object)null)
			{
				timeSinceHittingPlayer = Time.realtimeSinceStartup;
				burstSource.PlayOneShot(bitePlayer);
				WalkieTalkie.TransmitOneShotAudio(burstSource, bitePlayer, 1f);
				val.DamagePlayer(30, true, true, (CauseOfDeath)6, 8, false, default(Vector3));
				GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(1f, true);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SyncBitePlayerRpc()
	{
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: 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_00a5: 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)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1116532825u, val3, val, (SendTo)5, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 1116532825u, val3, val, (SendTo)5, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				burstSource.PlayOneShot(bitePlayer);
				WalkieTalkie.TransmitOneShotAudio(burstSource, bitePlayer, 1f);
			}
		}
	}

	public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
	{
		((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
		if (!base.isEnemyDead)
		{
			TakeDamage(stun: true);
		}
	}

	public void TakeDamage(bool stun = false)
	{
		if (stun && Time.realtimeSinceStartup - timeAtLastHitStun > 1.15f && base.stunNormalizedTimer <= 0.2f)
		{
			timeAtLastHitStun = Time.realtimeSinceStartup;
		}
		base.enemyHP--;
		if (base.enemyHP <= 0)
		{
			((EnemyAI)this).KillEnemyOnOwnerClient(false);
		}
	}

	public override void KillEnemy(bool destroy = false)
	{
		//IL_0014: 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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: 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)
		//IL_00d2: 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)
		base.removedPowerLevel = true;
		GameObject val = Object.Instantiate<GameObject>(killParticle, ((Component)this).transform.position, ((Component)this).transform.rotation, RoundManager.Instance.mapPropsContainer.transform);
		Transform physicsParentAtEnemyPosition = GetPhysicsParentAtEnemyPosition();
		burstPlayer.SpawnDeadBody((int)burstPlayer.playerClientId, Vector3.zero, 5, burstPlayer, 11, physicsParentAtEnemyPosition, val.transform, default(Vector3));
		if (((NetworkBehaviour)this).IsServer)
		{
			GameObject val2 = Object.Instantiate<GameObject>(StartOfRound.Instance.ragdollGrabbableObjectPrefab, StartOfRound.Instance.propsContainer);
			val2.GetComponent<NetworkObject>().Spawn(false);
			val2.GetComponent<RagdollGrabbableObject>().bodyID = (int)burstPlayer.playerClientId;
		}
		if (Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, ((Component)this).transform.position) < 8f)
		{
			HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
		}
		if (searchForPlayers.inProgress)
		{
			((EnemyAI)this).StopSearch(searchForPlayers, true);
		}
		((EnemyAI)this).EnableEnemyMesh(false, true, true);
		foreach (MeshRenderer altEnemyMesh in AltEnemyMeshes)
		{
			((Renderer)altEnemyMesh).enabled = false;
		}
		base.inSpecialAnimation = true;
		((Behaviour)base.agent).enabled = false;
		base.agent.speed = 0f;
		base.overrideSettingEnemyMeshes = true;
		burstSource.Stop();
		base.creatureSFX.Stop();
		base.creatureVoice.Stop();
		breathingSFX.Stop();
		((EnemyAI)this).KillEnemy(false);
	}

	private Transform GetPhysicsParentAtEnemyPosition()
	{
		//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_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		VehicleController val = Object.FindObjectOfType<VehicleController>();
		if ((Object)(object)val != (Object)null && !val.physicsRegion.disablePhysicsRegion && val.physicsRegion.physicsCollider.ClosestPoint(((Component)this).transform.position) == ((Component)this).transform.position)
		{
			return val.physicsRegion.physicsTransform;
		}
		MineshaftElevatorController val2 = Object.FindObjectOfType<MineshaftElevatorController>();
		if ((Object)(object)val2 != (Object)null)
		{
			PlayerPhysicsRegion componentInChildren = ((Component)val2).GetComponentInChildren<PlayerPhysicsRegion>();
			if ((Object)(object)componentInChildren != (Object)null && componentInChildren.physicsCollider.ClosestPoint(((Component)this).transform.position + Vector3.up * 0.05f) == ((Component)this).transform.position + Vector3.up * 0.05f)
			{
				return componentInChildren.physicsTransform;
			}
		}
		return null;
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SyncChompingAnimRpc(bool chomping)
	{
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: 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)
		{
			RpcAttributeParams val = default(RpcAttributeParams);
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1172172720u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref chomping, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 1172172720u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			chestPlantVisible = chomping;
			base.creatureAnimator.SetBool("ChestVisible", chomping);
			base.creatureAnimator.SetBool("ChestBite", chomping);
			if (chomping && !burstSource.isPlaying)
			{
				burstSource.Play();
			}
			else if (!chomping && burstSource.isPlaying)
			{
				burstSource.Stop();
			}
		}
	}

	private void LateUpdate()
	{
		if (base.inSpecialAnimation)
		{
			((EnemyAI)this).MoveWithMineshaftElevator();
		}
	}

	public override void Update()
	{
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028c: Invalid comparison between Unknown and I4
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0478: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0947: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_080d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0818: Unknown result type (might be due to invalid IL or missing references)
		//IL_081d: Unknown result type (might be due to invalid IL or missing references)
		//IL_083b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0840: Unknown result type (might be due to invalid IL or missing references)
		//IL_087c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0880: Unknown result type (might be due to invalid IL or missing references)
		//IL_0888: Unknown result type (might be due to invalid IL or missing references)
		//IL_088d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0892: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0901: Unknown result type (might be due to invalid IL or missing references)
		//IL_0907: Unknown result type (might be due to invalid IL or missing references)
		//IL_090c: Unknown result type (might be due to invalid IL or missing references)
		((EnemyAI)this).Update();
		if (base.isEnemyDead || base.inSpecialAnimation)
		{
			return;
		}
		bool flag = Time.realtimeSinceStartup - timeAtLastHeardNoise < 1.5f;
		bool flag2 = Time.realtimeSinceStartup - timeAtLastHitStun < 0.75f;
		if ((flag && (lostPlayerInChase || seePlayerMeter < 0.07f)) || flag2 || base.stunNormalizedTimer > 0f)
		{
			base.agent.speed = 0f;
			velX = Mathf.Lerp(velX, 0f, Time.deltaTime * 3f);
			velZ = Mathf.Lerp(velZ, 0f, Time.deltaTime * 3f);
			base.creatureAnimator.SetFloat("MoveX", velX);
			base.creatureAnimator.SetFloat("MoveZ", velZ);
			base.creatureAnimator.SetBool("stun", base.stunNormalizedTimer > 0f);
			base.creatureAnimator.SetBool("hitStunned", flag2 && base.stunNormalizedTimer <= 0f);
			if ((Object)(object)base.stunnedByPlayer != (Object)null)
			{
				flag = true;
				pingAttentionPos = ((Component)base.stunnedByPlayer).transform.position;
			}
			if (flag)
			{
				RoundManager.Instance.tempTransform.position = ((Component)this).transform.position;
				RoundManager.Instance.tempTransform.LookAt(pingAttentionPos);
				((Component)this).transform.eulerAngles = new Vector3(0f, Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, RoundManager.Instance.tempTransform.eulerAngles.y, Time.deltaTime * 22f), 0f);
			}
			return;
		}
		base.creatureAnimator.SetBool("hitStunned", false);
		base.creatureAnimator.SetBool("stun", false);
		CalculateAnimationDirection();
		if (breathingSFX.isPlaying && Time.realtimeSinceStartup - timeSinceBurst > 10f)
		{
			breathingSFX.Stop();
			playerScanNode.maxRange = 17;
		}
		int num = 18;
		if ((int)TimeOfDay.Instance.currentLevelWeather == 3)
		{
			num = 8;
		}
		if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 80f, num, 5f, -1))
		{
			if (base.currentBehaviourStateIndex == 1 && !lostPlayerInChase)
			{
				GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.7f);
			}
			else
			{
				GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.3f);
			}
		}
		switch (base.currentBehaviourStateIndex)
		{
		case 0:
			if (previousBehaviourState != base.currentBehaviourStateIndex)
			{
				if (base.previousBehaviourStateIndex == 1 && searchForPlayers.inProgress)
				{
					((EnemyAI)this).StopSearch(searchForPlayers, true);
				}
				if (burstSource.isPlaying)
				{
					burstSource.Stop();
				}
				previousBehaviourState = base.currentBehaviourStateIndex;
			}
			if (((NetworkBehaviour)this).IsOwner)
			{
				base.agent.speed = 5f;
				if (chestPlantVisible)
				{
					chestPlantVisible = false;
					base.creatureAnimator.SetBool("ChestVisible", false);
					ChestBurstRpc(burst: false);
				}
			}
			break;
		case 1:
		{
			if (previousBehaviourState != base.currentBehaviourStateIndex)
			{
				previousBehaviourState = base.currentBehaviourStateIndex;
			}
			if (!((NetworkBehaviour)this).IsOwner || (Object)(object)base.targetPlayer == (Object)null || lostPlayerInChase)
			{
				break;
			}
			RoundManager.Instance.tempTransform.position = ((Component)this).transform.position;
			RoundManager.Instance.tempTransform.LookAt(((Component)base.targetPlayer).transform);
			((Component)this).transform.eulerAngles = new Vector3(0f, Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, RoundManager.Instance.tempTransform.eulerAngles.y, Time.deltaTime * 35f), 0f);
			float num2 = distanceToTarget;
			if (num2 < 3.6f)
			{
				base.agent.speed = 7f;
				base.movingTowardsTargetPlayer = true;
				base.agent.acceleration = Mathf.Lerp(base.agent.acceleration, 50f, Time.deltaTime * 12f);
				chestPlantVisible = true;
				base.creatureAnimator.SetBool("ChestVisible", true);
				if (!base.creatureAnimator.GetBool("ChestBite"))
				{
					base.creatureAnimator.SetBool("ChestBite", true);
					SyncChompingAnimRpc(chomping: true);
				}
				if (!burstSource.isPlaying)
				{
					burstSource.Play();
				}
				break;
			}
			if (base.creatureAnimator.GetBool("ChestBite"))
			{
				base.creatureAnimator.SetBool("ChestBite", false);
				SyncChompingAnimRpc(chomping: false);
			}
			if (burstSource.isPlaying)
			{
				burstSource.Stop();
			}
			if (chestPlantVisible)
			{
				if (num2 > 8f && Time.realtimeSinceStartup - timeAtLastChestBurst > 3f)
				{
					chestPlantVisible = false;
					base.creatureAnimator.SetBool("ChestVisible", false);
					ChestBurstRpc(burst: false);
				}
			}
			else if (num2 < 6f)
			{
				timeAtLastChestBurst = Time.realtimeSinceStartup;
				chestPlantVisible = true;
				base.creatureAnimator.SetBool("ChestVisible", true);
				base.creatureVoice.PlayOneShot(chestBurst);
				WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, chestBurst, 1f);
				base.creatureVoice.clip = chestPlantRoars[Random.Range(0, chestPlantRoars.Length)];
				base.creatureVoice.Play();
				ChestBurstRpc(burst: true);
			}
			if (num2 > 18f || isBehindObstacle)
			{
				base.movingTowardsTargetPlayer = true;
				base.agent.speed = 10f;
				base.agent.acceleration = Mathf.Lerp(base.agent.acceleration, 120f, Time.deltaTime * 12f);
				break;
			}
			float num3 = 3f;
			if (base.pathDistance > 12f)
			{
				num3 = 6f;
			}
			base.agent.speed = Random.Range(7f, 18f);
			jitterMoveInterval -= Time.deltaTime;
			if (jitterMoveInterval < 0f)
			{
				jitterMoveInterval = Random.Range(0.1f, 0.3f);
				Ray val = default(Ray);
				((Ray)(ref val))..ctor(((Component)this).transform.position + Vector3.up * 0.75f, ((Component)base.targetPlayer).transform.position - ((Component)this).transform.position);
				Vector3 point = ((Ray)(ref val)).GetPoint(Random.Range(0f, num2 / 2f));
				float num4 = Random.Range(0f, Mathf.Clamp(num2 / num3, 4f, 15f));
				int num5 = 1;
				if (Random.Range(0, 100) < 50)
				{
					num5 = -1;
				}
				if (Physics.Raycast(point, Vector3.Cross(((Ray)(ref val)).direction * (float)num5, Vector3.up), ref rayhit, num4, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1))
				{
					num4 = Random.Range(0f, Mathf.Clamp(num2 / 3f, 4f, ((RaycastHit)(ref rayhit)).distance));
				}
				Ray val2 = new Ray(point, Vector3.Cross(((Ray)(ref val)).direction * (float)num5, Vector3.up));
				jitterDest = ((Ray)(ref val2)).GetPoint(num4);
			}
			base.agent.acceleration = Mathf.Lerp(base.agent.acceleration, 180f, Time.deltaTime * 12f);
			base.movingTowardsTargetPlayer = false;
			((EnemyAI)this).SetDestinationToPosition(jitterDest, false);
			break;
		}
		case 2:
			if (previousBehaviourState != base.currentBehaviourStateIndex)
			{
				previousBehaviourState = base.currentBehaviourStateIndex;
			}
			break;
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void ChestBurstRpc(bool burst)
	{
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: 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)
		{
			RpcAttributeParams val = default(RpcAttributeParams);
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(611549464u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref burst, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 611549464u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			base.creatureAnimator.SetBool("ChestVisible", burst);
			chestPlantVisible = burst;
			if (burst)
			{
				timeAtLastChestBurst = Time.realtimeSinceStartup;
				base.creatureVoice.PlayOneShot(chestBurst);
				base.creatureVoice.clip = chestPlantRoars[Random.Range(0, chestPlantRoars.Length)];
				base.creatureVoice.Play();
			}
		}
	}

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

	protected override void __initializeRpcs()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		((NetworkBehaviour)this).__registerRpc(3351050978u, new RpcReceiveHandler(__rpc_handler_3351050978), "PingAttentionRpc");
		((NetworkBehaviour)this).__registerRpc(2948708928u, new RpcReceiveHandler(__rpc_handler_2948708928), "SetNewTargetPlayerRpc");
		((NetworkBehaviour)this).__registerRpc(1116532825u, new RpcReceiveHandler(__rpc_handler_1116532825), "SyncBitePlayerRpc");
		((NetworkBehaviour)this).__registerRpc(1172172720u, new RpcReceiveHandler(__rpc_handler_1172172720), "SyncChompingAnimRpc");
		((NetworkBehaviour)this).__registerRpc(611549464u, new RpcReceiveHandler(__rpc_handler_611549464), "ChestBurstRpc");
		((EnemyAI)this).__initializeRpcs();
	}

	private static void __rpc_handler_3351050978(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0036: 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)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			Vector3 lookAtPos = default(Vector3);
			((FastBufferReader)(ref reader)).ReadValueSafe(ref lookAtPos);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((AssimilatedEmployee)(object)target).PingAttentionRpc(lookAtPos);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_2948708928(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 newTargetPlayerRpc = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref newTargetPlayerRpc);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((AssimilatedEmployee)(object)target).SetNewTargetPlayerRpc(newTargetPlayerRpc);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1116532825(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;
			((AssimilatedEmployee)(object)target).SyncBitePlayerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1172172720(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 chomping = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref chomping, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((AssimilatedEmployee)(object)target).SyncChompingAnimRpc(chomping);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_611549464(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 burst = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref burst, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((AssimilatedEmployee)(object)target).ChestBurstRpc(burst);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "AssimilatedEmployee";
	}
}
public class AssimilatedGrowth : EnemyAI
{
	public List<TileWithGrowth> GrowthTiles = new List<TileWithGrowth>();

	public Random growthRandom;

	private int previousBehaviourState = -1;

	[Header("Growth Properties")]
	public float GrowthInterval = 3f;

	public AnimationCurve growthIntervalCurveOverDay;

	[Range(0f, 100f)]
	public float baseSpreadChance = 3f;

	public int TileCapacity = 40;

	[Range(0f, 100f)]
	public float GrowthChancePerInterval = 20f;

	[Space(5f)]
	[Header("Infect Properties")]
	public float InfectIntervalTime = 1f;

	[Range(0f, 2f)]
	public float ChanceToInfectMultiplier = 0.25f;

	[Range(0f, 2f)]
	public float InfectionSpeedMultiplier = 0.25f;

	[Range(0f, 2f)]
	public float BurstSpeedMultiplier = 0.25f;

	public GameObject[] plantPrefabs;

	private RaycastHit hit;

	public Tag RoomTileTag;

	public Tag TunnelTileTag;

	public Tag CaveTileTag;

	private float spreadInterval;

	public GameObject CadaverSporesParticle;

	public BatchAllMeshChildren[] plantBatchers;

	private int previousTileIndex;

	public int[,] moldPositions;

	public GameObject destroyPlantParticle;

	public AudioSource destroyAudio;

	public AudioSource plantAudio;

	private float cullIntervalTime = 0.75f;

	private float cullInterval;

	private float infectInterval;

	public PlayerInfection[] playerInfections;

	private int numberOfInfected;

	public GameObject backFlowersPrefab;

	private float showSignsMeter;

	public bool growingRecentPlant;

	public Vector3 recentPlantPosition;

	private float recentPlantSizeTarget = 1f;

	private (int batchNum, int positionIndex, int plantType) growingPlant;

	public GameObject bloomEnemyPrefab;

	public EnemyType bloomEnemyType;

	public AssimilatedEmployee[] bloomEnemies;

	private float timeLastMusicPlayed;

	public AudioSource bloomMusic;

	public GameObject faceSporesPrefab;

	public AudioSource sporeAmbienceSource;

	private float updateSporeAudioInterval;

	private float distToPlants = 100f;

	private bool growingInTiles;

	public GameObject scanNodePrefab;

	private const string sporesWarningText = "HEALTH RISK!\n\nAir filter overwhelmed by particulates";

	private List<Transform> particlesTempArray;

	private Random playerDeathChanceRandom;

	public GameObject crackDecal;

	public AudioClip[] healPlayerSFX;

	public float totalTimeSpentInPlants;

	private float growthBurstTimer;

	private bool inGrowthBurst;

	private float timeAtLastHealing;

	public AudioSource vinesInHeadAudio;

	public AudioClip[] vinesInHeadSFX;

	private bool hinderingLocalPlayer;

	private float setPoison;

	private float localPlayerImmunityTimer;

	private bool stoodInWeedsLastCheck;

	public void OnEnable()
	{
		((UnityEvent<float>)(object)StartOfRound.Instance.LocalPlayerTalkEvent).AddListener((UnityAction<float>)OnLocalPlayerTalk);
		((UnityEvent<PlayerControllerB, int>)(object)StartOfRound.Instance.LocalPlayerDieEvent).AddListener((UnityAction<PlayerControllerB, int>)OnLocalPlayerDie);
	}

	public void OnDisable()
	{
		((UnityEvent<float>)(object)StartOfRound.Instance.LocalPlayerTalkEvent).RemoveListener((UnityAction<float>)OnLocalPlayerTalk);
		((UnityEvent<PlayerControllerB, int>)(object)StartOfRound.Instance.LocalPlayerDieEvent).RemoveListener((UnityAction<PlayerControllerB, int>)OnLocalPlayerDie);
		if (hinderingLocalPlayer)
		{
			hinderingLocalPlayer = false;
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			localPlayerController.isMovementHindered--;
			playerInfections[GameNetworkManager.Instance.localPlayerController.playerClientId].hinderingPlayerMovement = false;
		}
		setPoison = 0f;
		if (GameNetworkManager.Instance.localPlayerController.overridePoisonValue)
		{
			GameNetworkManager.Instance.localPlayerController.overridePoisonValue = false;
		}
	}

	public void OnLocalPlayerDie(PlayerControllerB player, int deathAnimation)
	{
		//IL_00cf: 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_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: 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_0114: 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)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		switch (deathAnimation)
		{
		case -1:
		case 7:
		case 9:
			return;
		default:
			if ((Object)(object)player.enemyWaitingForBodyRagdoll != (Object)null && player.enemyWaitingForBodyRagdoll.enemyType.enemyName == "MouthDog")
			{
				return;
			}
			break;
		case 200:
			break;
		}
		if (playerInfections[player.playerClientId].infected && (playerInfections[player.playerClientId].bloomOnDeath || !((double)(playerInfections[player.playerClientId].infectionMeter + 0.15f) < playerDeathChanceRandom.NextDouble())))
		{
			Vector3 val = ((Component)player).transform.position;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(((Component)player).transform.position, Vector3.down, ref val2, 10f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
			{
				val = ((RaycastHit)(ref val2)).point;
			}
			val = RoundManager.Instance.GetNavMeshPosition(val, default(NavMeshHit), 10f, base.agentMask);
			if (RoundManager.Instance.GotNavMeshPositionResult)
			{
				playerInfections[player.playerClientId].infected = false;
				numberOfInfected--;
				BurstFromPlayer(player, ((Component)player).transform.position, ((Component)player).transform.eulerAngles);
				SyncBurstFromPlayerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((Component)player).transform.position, ((Component)player).transform.eulerAngles);
			}
		}
	}

	public void OnLocalPlayerTalk(float loudness)
	{
		if (GameNetworkManager.Instance.localPlayerController.isPlayerControlled)
		{
			PlayerInfection val = playerInfections[GameNetworkManager.Instance.localPlayerController.playerClientId];
			if (val.infected && val.infectionMeter > 0.6f && (val.emittingSpores || Random.Range(0, 1000) < 10) && !((Object)(object)val.backFlowers == (Object)null))
			{
				CoughSporesRpc(loudness, (int)GameNetworkManager.Instance.localPlayerController.playerClientId);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void CoughSporesRpc(float loudness, int playerId)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: 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)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: 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)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3885809940u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref loudness, default(ForPrimitives));
			BytePacker.WriteValueBitPacked(val2, playerId);
			((NetworkBehaviour)this).__endSendRpc(ref val2, 3885809940u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		PlayerInfection val4 = playerInfections[playerId];
		if (!(StartOfRound.Instance.allPlayerScripts[playerId].LineOfSightToPositionAngle(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, 12, 0f, -1) < 30f))
		{
			return;
		}
		float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[playerId]).transform.position);
		if (num < 6f)
		{
			HUDManager.Instance.DisplayStatusEffect("HEALTH RISK!\n\nAir filter overwhelmed by particulates");
		}
		if ((float)Random.Range(0, 1000) < Mathf.Lerp(50f, 1f, Mathf.Clamp(num * num / 60f, 0f, 1f)))
		{
			bool flag = false;
			if (Random.Range(0, 100) < 70)
			{
				flag = true;
			}
			bool flag2 = flag || Random.Range(0, 100) < 40;
			InfectPlayer(GameNetworkManager.Instance.localPlayerController, flag, flag2);
			InfectPlayerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, flag, flag2);
		}
	}

	public bool GetAllPlantPositionsInRadius(Vector3 position, float radius, bool fillArray = false)
	{
		//IL_003f: 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_0045: 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)
		bool result = false;
		int[] array = new int[plantBatchers.Length];
		int length = moldPositions.GetLength(0);
		for (int i = 0; i < plantBatchers.Length; i++)
		{
			List<Vector3> batchedPositions = plantBatchers[i].batchedPositions;
			for (int j = 0; j < batchedPositions.Count; j++)
			{
				Vector3 val = batchedPositions[j] - position;
				if (!(((Vector3)(ref val)).sqrMagnitude <= radius * radius))
				{
					continue;
				}
				result = true;
				if (fillArray)
				{
					moldPositions[array[i], i] = j;
					array[i]++;
					if (array[i] >= length)
					{
						return true;
					}
				}
				else
				{
					array[i]++;
				}
			}
		}
		if (fillArray)
		{
			for (int k = 0; k < plantBatchers.Length; k++)
			{
				for (int l = array[k]; l < length; l++)
				{
					moldPositions[l, k] = -1;
				}
			}
		}
		return result;
	}

	public void DestroyPlantAtPosition(Vector3 pos, bool playEffect = false)
	{
		//IL_0008: 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_006c: 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_007b: 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_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		float radius = 1.5f;
		if (!GetAllPlantPositionsInRadius(pos, 1.5f, fillArray: true))
		{
			return;
		}
		int length = moldPositions.GetLength(0);
		for (int i = 0; i < plantBatchers.Length; i++)
		{
			List<Vector3> batchedPositions = plantBatchers[i].batchedPositions;
			for (int j = 0; j < length && moldPositions[j, i] != -1; j++)
			{
				if (playEffect)
				{
					Vector3 val = batchedPositions[moldPositions[j, i]] + Vector3.up * 0.5f;
					Object.Instantiate<GameObject>(destroyPlantParticle, val, Quaternion.identity, (Transform)null);
					destroyAudio.Stop();
					((Component)destroyAudio).transform.position = val;
					destroyAudio.Play();
					RoundManager.Instance.PlayAudibleNoise(((Component)destroyAudio).transform.position, 6f, 0.5f, 0, false, 99611);
				}
				RemoveWeedFromTile(plantBatchers[i].batchedPositionTiles[moldPositions[j, i]], pos, radius);
			}
		}
		int[] array = new int[40];
		for (int k = 0; k < plantBatchers.Length; k++)
		{
			List<Vector3> batchedPositions2 = plantBatchers[k].batchedPositions;
			for (int l = 0; l < length; l++)
			{
				array[l] = moldPositions[l, k];
			}
			Array.Sort(array, (int a, int b) => b.CompareTo(a));
			for (int num = 0; num < length; num++)
			{
				moldPositions[num, k] = array[num];
				if (moldPositions[num, k] < 0 || moldPositions[num, k] >= batchedPositions2.Count)
				{
					break;
				}
				plantBatchers[k].DestroyWeedAtIndexInMatrixList(moldPositions[num, k]);
			}
		}
	}

	private void RemoveWeedFromTile(int tileIndex, Vector3 destroyAtPos, float radius)
	{
		//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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		TileWithGrowth obj = GrowthTiles[tileIndex];
		obj.plantsInTile--;
		GrowthTiles[tileIndex].particlesContainer.GetComponentsInChildren<Transform>(true, particlesTempArray);
		Vector3 val;
		for (int num = particlesTempArray.Count - 1; num >= 0; num--)
		{
			val = destroyAtPos + Vector3.up * 0.75f - particlesTempArray[num].position;
			if (((Vector3)(ref val)).sqrMagnitude <= radius * radius)
			{
				Object.Destroy((Object)(object)((Component)particlesTempArray[num]).gameObject);
			}
		}
		GrowthTiles[tileIndex].scanNodesContainer.GetComponentsInChildren<Transform>(true, particlesTempArray);
		for (int num2 = particlesTempArray.Count - 1; num2 >= 0; num2--)
		{
			val = destroyAtPos + Vector3.up * 0.35f - particlesTempArray[num2].position;
			if (((Vector3)(ref val)).sqrMagnitude <= radius * radius)
			{
				Object.Destroy((Object)(object)((Component)particlesTempArray[num2]).gameObject);
			}
		}
		if (growingRecentPlant && growingPlant.positionIndex < plantBatchers[growingPlant.plantType].Batches[growingPlant.batchNum].Count)
		{
			Matrix4x4 val2 = plantBatchers[growingPlant.plantType].Batches[growingPlant.batchNum][growingPlant.positionIndex];
			val = ((Matrix4x4)(ref val2)).GetPosition() - destroyAtPos;
			if (((Vector3)(ref val)).sqrMagnitude <= radius * radius)
			{
				growingPlant = (batchNum: -1, positionIndex: -1, plantType: -1);
				growingRecentPlant = false;
			}
		}
		GrowthTiles[tileIndex].plantPositions.Remove(destroyAtPos);
		for (int i = 0; i < GrowthTiles[tileIndex].plantPositions.Count; i++)
		{
			val = GrowthTiles[tileIndex].plantPositions[i] - destroyAtPos;
			if (((Vector3)(ref val)).sqrMagnitude <= radius * radius)
			{
				GrowthTiles[tileIndex].plantPositions.RemoveAt(i);
			}
		}
		if (GrowthTiles[tileIndex].plantsInTile <= 0)
		{
			GrowthTiles[tileIndex].eradicated = true;
			GrowthTiles[tileIndex].eradicatedAtTime = Time.realtimeSinceStartup;
			IEnumerable<Tile> adjacentTiles = GrowthTiles[tileIndex].tile.GetAdjacentTiles();
			List<Tile> list = new List<Tile>();
			foreach (Tile item in adjacentTiles)
			{
				list.Add(item);
			}
			for (int j = 0; j < list.Count; j++)
			{
				for (int k = 0; k < GrowthTiles.Count; k++)
				{
					if ((Object)(object)GrowthTiles[k].tile == (Object)(object)list[j])
					{
						GrowthTiles[k].cannotSpread = false;
					}
				}
			}
		}
		spreadInterval = Mathf.Min(spreadInterval + 2f, 12f);
	}

	public override void Start()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Expected O, but got Unknown
		if (Object.FindObjectsByType<CadaverGrowthAI>((FindObjectsSortMode)0).Length > 1)
		{
			base.isEnemyDead = true;
			base.inSpecialAnimation = true;
			if (((NetworkBehaviour)this).IsServer)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			return;
		}
		((EnemyAI)this).Start();
		particlesTempArray = new List<Transform>(TileCapacity);
		bloomEnemies = new AssimilatedEmployee[StartOfRound.Instance.allPlayerScripts.Length];
		plantBatchers = ((Component)this).gameObject.GetComponents<BatchAllMeshChildren>();
		moldPositions = new int[40, plantBatchers.Length];
		playerInfections = (PlayerInfection[])(object)new PlayerInfection[StartOfRound.Instance.allPlayerScripts.Length];
		for (int i = 0; i < playerInfections.Length; i++)
		{
			playerInfections[i] = new PlayerInfection();
		}
		for (int j = 0; j < plantBatchers.Length; j++)
		{
			int length = moldPositions.GetLength(0);
			for (int k = 0; k < length; k++)
			{
				moldPositions[k, j] = -1;
			}
		}
		growthRandom = new Random(StartOfRound.Instance.randomMapSeed + 11);
		playerDeathChanceRandom = new Random(StartOfRound.Instance.randomMapSeed + 12);
		if (((NetworkBehaviour)this).IsOwner)
		{
			GetRandomTileToStart();
		}
	}

	private void GetRandomTileToStart()
	{
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fe: Expected O, but got Unknown
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_0311: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Unknown result type (might be due to invalid IL or missing references)
		RuntimeDungeon val = Object.FindObjectOfType<RuntimeDungeon>();
		if ((Object)(object)val == (Object)null || (Object)(object)val.Generator.CurrentDungeon == (Object)null || val.Generator.CurrentDungeon.AllTiles.Count <= 0)
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			return;
		}
		List<Tile> list = new List<Tile>();
		List<Tile> list2 = new List<Tile>();
		for (int i = 0; i < val.Generator.CurrentDungeon.MainPathTiles.Count; i++)
		{
			if ((RoundManager.Instance.currentDungeonType == 4 && val.Generator.CurrentDungeon.AllTiles[i].Tags.Tags.Contains(CaveTileTag)) || val.Generator.CurrentDungeon.AllTiles[i].Tags.Tags.Contains(RoomTileTag))
			{
				list.Add(val.Generator.CurrentDungeon.AllTiles[i]);
			}
			else
			{
				list2.Add(val.Generator.CurrentDungeon.AllTiles[i]);
			}
		}
		bool flag = true;
		List<Tile> list3;
		if (growthRandom.Next(0, 100) < 30 || list.Count == 0)
		{
			list3 = list2;
			flag = false;
			if (RoundManager.Instance.currentDungeonType == 0 || (RoundManager.Instance.currentDungeonType == 3 && (Object)(object)list3[0] == (Object)(object)RoundManager.Instance.dungeonGenerator.Generator.CurrentDungeon.MainPathTiles[0]))
			{
				list3.RemoveAt(0);
			}
		}
		else
		{
			if ((Object)(object)list[list.Count - 1] == (Object)(object)val.Generator.CurrentDungeon.MainPathTiles[val.Generator.CurrentDungeon.MainPathTiles.Count - 1])
			{
				list.RemoveAt(list.Count - 1);
				if (list.Count == 0)
				{
					list3 = list2;
					flag = false;
				}
			}
			list3 = list;
		}
		if (list3.Count == 0)
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
		else
		{
			int num = (flag ? growthRandom.Next(0, list3.Count) : growthRandom.Next(0, list3.Count / 2));
			GrowthTiles.Add(new TileWithGrowth(list3[num], TileCapacity, CaveTileTag, RoomTileTag, TunnelTileTag, Vector3.zero + Vector3.down * 30f));
			SyncAddInitialGrowthTileRpc(num, Vector3.zero + Vector3.down * 30f, flag);
		}
	}

	private Transform FindChildWithTag(string tag, Transform inTransform)
	{
		Transform[] componentsInChildren = ((Component)inTransform).GetComponentsInChildren<Transform>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (((Component)componentsInChildren[i]).CompareTag(tag))
			{
				return componentsInChildren[i];
			}
		}
		return null;
	}

	public void CullParticlesForTiles()
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: 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)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		bool flag = ((Component)StartOfRound.Instance.activeCamera).transform.position.y < -90f;
		Vector3 val = default(Vector3);
		for (int i = 0; i < GrowthTiles.Count; i++)
		{
			if ((Object)(object)GrowthTiles[i].particlesContainer == (Object)null || (Object)(object)GrowthTiles[i].plantsContainer == (Object)null)
			{
				continue;
			}
			Bounds bounds = GrowthTiles[i].tile.Bounds;
			float x = ((Bounds)(ref bounds)).center.x;
			float y = ((Component)StartOfRound.Instance.activeCamera).transform.position.y;
			bounds = GrowthTiles[i].tile.Bounds;
			((Vector3)(ref val))..ctor(x, y, ((Bounds)(ref bounds)).center.z);
			bool flag2 = false;
			float y2 = ((Component)StartOfRound.Instance.activeCamera).transform.position.y;
			bounds = GrowthTiles[i].tile.Bounds;
			if (!(y2 < ((Bounds)(ref bounds)).min.y))
			{
				float y3 = ((Component)StartOfRound.Instance.activeCamera).transform.position.y;
				bounds = GrowthTiles[i].tile.Bounds;
				if (!(y3 > ((Bounds)(ref bounds)).max.y))
				{
					goto IL_015e;
				}
			}
			flag2 = true;
			goto IL_015e;
			IL_015e:
			if (!flag || flag2)
			{
				if (GrowthTiles[i].plantsContainer.activeSelf)
				{
					GrowthTiles[i].plantsContainer.SetActive(false);
				}
				if (GrowthTiles[i].particlesContainer.activeSelf)
				{
					GrowthTiles[i].particlesContainer.SetActive(false);
				}
				continue;
			}
			float num = Vector3.Distance(val, ((Component)StartOfRound.Instance.activeCamera).transform.position);
			bounds = GrowthTiles[i].tile.Bounds;
			float x2 = ((Bounds)(ref bounds)).size.x;
			bounds = GrowthTiles[i].tile.Bounds;
			float num2 = Mathf.Max(x2, ((Bounds)(ref bounds)).size.z);
			if (num > num2 + 16f)
			{
				if (GrowthTiles[i].plantsContainer.activeSelf)
				{
					GrowthTiles[i].plantsContainer.SetActive(false);
				}
				if (GrowthTiles[i].particlesContainer.activeSelf)
				{
					GrowthTiles[i].particlesContainer.SetActive(false);
				}
				continue;
			}
			if (!GrowthTiles[i].plantsContainer.activeSelf)
			{
				GrowthTiles[i].plantsContainer.SetActive(true);
			}
			if (!GrowthTiles[i].particlesContainer.activeSelf)
			{
				if (num < num2 + 6f)
				{
					GrowthTiles[i].particlesContainer.SetActive(true);
				}
			}
			else if (num > num2 + 8f)
			{
				GrowthTiles[i].particlesContainer.SetActive(false);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SyncSpawnPlantRpc(int plantId, int tileIndex, Vector3 spawnPosition, Quaternion spawnRotation, float randomSize, bool spawnScanNode, bool spawnDecal)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0064: 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_0075: 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_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: 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_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Expected O, but got Unknown
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Expected O, but got Unknown
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: Expected O, but got Unknown
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Expected O, but got Unknown
		//IL_0446: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_044f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0551: Unknown result type (might be due to invalid IL or missing references)
		//IL_0552: Unknown result type (might be due to invalid IL or missing references)
		//IL_0562: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: 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)
		{
			RpcAttributeParams val = default(RpcAttributeParams);
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(691312177u, val3, val, (SendTo)5, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, plantId);
			BytePacker.WriteValueBitPacked(val2, tileIndex);
			((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPosition);
			((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnRotation);
			((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref randomSize, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnScanNode, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnDecal, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 691312177u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		if (GrowthTiles.Count > tileIndex)
		{
			Bounds bounds;
			if ((Object)(object)GrowthTiles[tileIndex].plantsContainer == (Object)null)
			{
				GameObject val4 = new GameObject("PlantsContainer");
				Transform transform = val4.transform;
				bounds = GrowthTiles[tileIndex].tile.Bounds;
				transform.position = ((Bounds)(ref bounds)).center;
				val4.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true);
				GrowthTiles[tileIndex].plantsContainer = val4;
			}
			else
			{
				GameObject plantsContainer = GrowthTiles[tileIndex].plantsContainer;
			}
			GameObject val5 = Object.Instantiate<GameObject>(plantPrefabs[plantId], spawnPosition, spawnRotation, (Transform)null);
			GrowthTiles[tileIndex].plantPositions.Add(spawnPosition);
			val5.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
			if ((Object)(object)GrowthTiles[tileIndex].particlesContainer == (Object)null)
			{
				GameObject val6 = new GameObject("SporesContainer");
				Transform transform2 = val6.transform;
				bounds = GrowthTiles[tileIndex].tile.Bounds;
				transform2.position = ((Bounds)(ref bounds)).center;
				val6.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true);
				GrowthTiles[tileIndex].particlesContainer = val6;
			}
			GameObject val7 = Object.Instantiate<GameObject>(CadaverSporesParticle, val5.transform.position + Vector3.up * 0.75f, Quaternion.identity, (Transform)null);
			val7.transform.localScale = Vector3.one;
			val7.transform.SetParent(GrowthTiles[tileIndex].particlesContainer.transform, true);
			if ((Object)(object)GrowthTiles[tileIndex].scanNodesContainer == (Object)null)
			{
				GameObject val8 = new GameObject("ScanNodesContainer");
				Transform transform3 = val8.transform;
				bounds = GrowthTiles[tileIndex].tile.Bounds;
				transform3.position = ((Bounds)(ref bounds)).center;
				val8.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true);
				GrowthTiles[tileIndex].scanNodesContainer = val8;
			}
			if (spawnScanNode)
			{
				Object.Instantiate<GameObject>(scanNodePrefab, val7.transform.position + Vector3.up * 0.35f, Quaternion.identity, (Transform)null).transform.SetParent(GrowthTiles[tileIndex].scanNodesContainer.transform, true);
			}
			if ((Object)(object)GrowthTiles[tileIndex].decalsContainer == (Object)null)
			{
				GameObject val9 = new GameObject("DecalsContainer");
				Transform transform4 = val9.transform;
				bounds = GrowthTiles[tileIndex].tile.Bounds;
				transform4.position = ((Bounds)(ref bounds)).center;
				val9.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true);
				GrowthTiles[tileIndex].decalsContainer = val9;
			}
			if (spawnDecal)
			{
				Object.Instantiate<GameObject>(crackDecal, val7.transform.position + Vector3.up * 0.35f, Quaternion.Euler(0f, Random.Range(-360f, 360f), 0f), (Transform)null).transform.SetParent(GrowthTiles[tileIndex].scanNodesContainer.transform, true);
			}
			QuickFinishGrowingPlant();
			(int, int) tuple = plantBatchers[plantId].AddToBatchedChildren(val5.GetComponent<MeshFilter>(), true, tileIndex);
			int item = tuple.Item1;
			int item2 = tuple.Item2;
			growingPlant = (batchNum: item, positionIndex: item2, plantType: plantId);
			recentPlantSizeTarget = randomSize * 7.75f;
			growingRecentPlant = true;
			recentPlantPosition = spawnPosition;
			((Component)plantAudio).transform.position = spawnPosition;
			plantAudio.pitch = Random.Range(0.8f, 1.2f);
			plantAudio.Play();
			TileWithGrowth obj = GrowthTiles[tileIndex];
			obj.plantsInTile++;
		}
	}

	public void GrowInTiles()
	{
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024c: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0373: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03df: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0404: Unknown result type (might be due to invalid IL or missing references)
		//IL_0409: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_042f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0433: Unknown result type (might be due to invalid IL or missing references)
		//IL_044f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0454: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0484: Unknown result type (might be due to invalid IL or missing references)
		//IL_0489: Unknown result type (might be due to invalid IL or missing references)
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_048d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_056c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0573: Expected O, but got Unknown
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0612: Unknown result type (might be due to invalid IL or missing references)
		//IL_0619: Unknown result type (might be due to invalid IL or missing references)
		//IL_0665: Unknown result type (might be due to invalid IL or missing references)
		//IL_0683: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0529: Unknown result type (might be due to invalid IL or missing references)
		//IL_052e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0753: Unknown result type (might be due to invalid IL or missing references)
		//IL_0758: Unknown result type (might be due to invalid IL or missing references)
		//IL_0762: Unknown result type (might be due to invalid IL or missing references)
		//IL_0767: Unknown result type (might be due to invalid IL or missing references)
		//IL_076c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0780: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e7: Expected O, but got Unknown
		//IL_0700: Unknown result type (might be due to inva

WesleysWeatherStuff.dll

Decompiled 8 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WesleysWeatherStuff")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WesleysWeatherStuff")]
[assembly: AssemblyTitle("WesleysWeatherStuff")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
}
namespace WesleysWeatherStuff.Stuff
{
	public class ObjectRemover : MonoBehaviour
	{
		public void ObjectSuicide(GameObject o)
		{
			Object.Destroy((Object)(object)o, 15f);
		}
	}
}

DilapidatedManor.dll

Decompiled 8 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DilapidatedManor")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DilapidatedManor")]
[assembly: AssemblyTitle("DilapidatedManor")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
}
namespace DilapidatedManor.Features
{
	internal class AnimationManager : MonoBehaviour
	{
		public Animator animator;

		public string animationString;

		public void Changebool(bool b)
		{
			animator.SetBool(animationString, b);
		}
	}
	internal class DisablePower : NetworkBehaviour
	{
		private RoundManager roundManager;

		private void Start()
		{
			roundManager = Object.FindObjectOfType<RoundManager>();
		}

		public void DisableFacilityPower()
		{
			((MonoBehaviour)this).StartCoroutine(KillPower());
		}

		private IEnumerator KillPower()
		{
			roundManager.FlickerLights(false, false);
			yield return (object)new WaitForSeconds(3f);
			roundManager.FlickerLights(false, false);
			yield return (object)new WaitForSeconds(5f);
			roundManager.FlickerLights(false, false);
			yield return (object)new WaitForSeconds(2.5f);
			roundManager.SwitchPower(false);
			roundManager.powerOffPermanently = true;
			yield return (object)new WaitForSeconds(0.75f);
			HUDManager.Instance.RadiationWarningHUD();
		}
	}
	public class Exterminator : NetworkBehaviour
	{
		[SerializeField]
		private Animator AttackManager;

		[SerializeField]
		private Animator DoorManager;

		[SerializeField]
		private Animator MainManager;

		[SerializeField]
		private MeshRenderer ExterminatorEye1;

		[SerializeField]
		private MeshRenderer ExterminatorEye2;

		[SerializeField]
		private List<Texture2D> EyeOpenTextures;

		[SerializeField]
		private List<Texture2D> EyeBlink;

		[SerializeField]
		private List<Texture2D> EyeFinal;

		[SerializeField]
		private Texture2D EyeOpen;

		[SerializeField]
		private Texture2D EyePoint;

		[SerializeField]
		private AudioSource EyesAudio;

		[SerializeField]
		private AudioClip AwakeClip;

		[SerializeField]
		private List<AudioClip> BlinkSounds;

		[SerializeField]
		private List<AudioClip> AttackSounds;

		[SerializeField]
		private List<AudioSource> AttackAudiosources;

		[SerializeField]
		private List<GameObject> Spawners;

		public UnityEvent MoveAttackLeftEvent;

		public UnityEvent MoveAttackRightEvent;

		public UnityEvent StayAttackEvent;

		public UnityEvent Type1Event;

		public UnityEvent Type2Event;

		public UnityEvent Type3Event;

		public UnityEvent Type4Event;

		public UnityEvent Type5Event;

		public UnityEvent AttackEvent;

		private int CurrentPosition = 1;

		private int ThumpersSpawned = 0;

		private int ThumpersKilled = 0;

		private int AttackType = 0;

		private int AttackNum = 0;

		private int AttackCounter = 0;

		private string AttackTrigger = "";

		private int PreviousAttack;

		private float AttackDelay = 0f;

		private bool PrimingAttack = false;

		private int FinalSequence = 0;

		private bool SpawnSwitch = false;

		private void Update()
		{
			if (((NetworkBehaviour)this).IsSpawned && PrimingAttack)
			{
				if (AttackDelay > 0f)
				{
					AttackDelay -= Time.deltaTime;
					return;
				}
				AttackCounter++;
				ExecuteAttack();
				PrimingAttack = false;
			}
		}

		private void AttemptThumperSpawn()
		{
			if (ThumpersKilled < 4)
			{
				if (ThumpersKilled == ThumpersSpawned)
				{
					if (SpawnSwitch)
					{
						SpawnSwitch = false;
						return;
					}
					SpawnSwitch = true;
					Spawners[ThumpersKilled].SetActive(true);
					ThumpersSpawned++;
				}
			}
			else
			{
				FinalSequence = 2;
			}
		}

		public void HostAttackPicker()
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				PreviousAttack = AttackType;
				int num = AttackType;
				while (PreviousAttack == num)
				{
					num = Random.Range(0, 4);
				}
				AttackType = num;
				if (FinalSequence > 0)
				{
					AttackType = 4;
				}
				TriggerAttackClientRpc(AttackType);
			}
			AttackDelay = 1.5f;
			PrimingAttack = true;
		}

		public void ExecuteAttack()
		{
			int num = 0;
			switch (CurrentPosition)
			{
			case 0:
				num = 0;
				break;
			case 1:
				num = 4;
				break;
			case 2:
				num = 8;
				break;
			}
			num += AttackType;
			AttackNum = num;
			if (AttackType == 4)
			{
				AttackNum = 12;
			}
			AttackTrigger = "Attack" + AttackNum;
			ExecuteClientRpc(AttackType, AttackTrigger, FinalSequence);
		}

		public void ExecuteClientRpc(int attackType, string attackTrigger, int finalSequence)
		{
			AttackManager.SetTrigger(attackTrigger);
			EyesAudio.PlayOneShot(AttackSounds[attackType]);
			AttackAudiosources[attackType].Play();
			if (finalSequence == 2)
			{
				DoorManager.SetTrigger("OpenCage1");
			}
		}

		public void HostNextAttack()
		{
			bool flag = false;
			bool flag2 = false;
			float value = Random.value;
			if (AttackCounter > 12)
			{
				FinalSequence = 1;
			}
			if (FinalSequence > 0)
			{
				CurrentPosition = 1;
				MainManager.SetBool("FinalAttack", true);
				HostAttackPicker();
				return;
			}
			if (((NetworkBehaviour)this).IsServer)
			{
				if (value > 0.5f)
				{
					if (CurrentPosition < 2)
					{
						flag2 = true;
						flag = true;
					}
				}
				else if (CurrentPosition > 0)
				{
					flag = true;
				}
				if (!flag)
				{
					TriggerMoveClientRpc(0);
				}
				else if (flag2)
				{
					TriggerMoveClientRpc(1);
				}
				else
				{
					TriggerMoveClientRpc(2);
				}
			}
			HostAttackPicker();
		}

		public void TriggerMoveClientRpc(int moveType)
		{
			switch (moveType)
			{
			case 0:
				StayAttackEvent.Invoke();
				break;
			case 1:
				MoveAttackLeftEvent.Invoke();
				break;
			case 2:
				MoveAttackRightEvent.Invoke();
				break;
			}
		}

		public void TriggerAttackClientRpc(int attacktype)
		{
			switch (attacktype)
			{
			case 0:
				Type1Event.Invoke();
				break;
			case 1:
				Type2Event.Invoke();
				break;
			case 2:
				Type3Event.Invoke();
				break;
			case 3:
				Type4Event.Invoke();
				break;
			case 4:
				Type5Event.Invoke();
				break;
			}
		}

		public void IncreaseThumperCount()
		{
			ThumpersKilled++;
		}

		public void EyesBlinkSequence()
		{
			int index = Random.Range(0, BlinkSounds.Count - 1);
			((MonoBehaviour)this).StartCoroutine(EyeSequenceCoroutine(EyeBlink, Open: true, BlinkSounds[index]));
		}

		public void EyesFinalSequence()
		{
			int index = Random.Range(0, BlinkSounds.Count - 1);
			((MonoBehaviour)this).StartCoroutine(EyeSequenceCoroutine(EyeFinal, Open: false, BlinkSounds[index]));
		}

		public void EyesOpenSequence()
		{
			((MonoBehaviour)this).StartCoroutine(EyeSequenceCoroutine(EyeOpenTextures, Open: true, AwakeClip));
		}

		public void EyesPoint()
		{
			((Renderer)ExterminatorEye1).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyePoint);
			((Renderer)ExterminatorEye2).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyePoint);
		}

		public void EyesOpen()
		{
			((Renderer)ExterminatorEye1).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyeOpen);
			((Renderer)ExterminatorEye2).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyeOpen);
		}

		private IEnumerator EyeSequenceCoroutine(List<Texture2D>? Eyes, bool Open, AudioClip? Clip)
		{
			if ((Object)(object)Clip != (Object)null)
			{
				EyesAudio.PlayOneShot(Clip, 1f);
			}
			if (Eyes != null)
			{
				foreach (Texture2D texture in Eyes)
				{
					((Renderer)ExterminatorEye1).materials[1].SetTexture("_BaseColorMap", (Texture)(object)texture);
					((Renderer)ExterminatorEye2).materials[1].SetTexture("_BaseColorMap", (Texture)(object)texture);
					yield return (object)new WaitForSeconds(0.2f);
				}
				if (Eyes == EyeBlink)
				{
					AttemptThumperSpawn();
				}
			}
			if (Open)
			{
				((Renderer)ExterminatorEye1).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyeOpen);
				((Renderer)ExterminatorEye2).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyeOpen);
			}
			else
			{
				((Renderer)ExterminatorEye1).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyePoint);
				((Renderer)ExterminatorEye2).materials[1].SetTexture("_BaseColorMap", (Texture)(object)EyePoint);
			}
			yield return 0;
		}

		public void SetPosition1()
		{
			CurrentPosition++;
		}

		public void SetPosition2()
		{
			CurrentPosition--;
		}

		public void SetType0()
		{
			AttackType = 0;
		}

		public void SetType1()
		{
			AttackType = 1;
		}

		public void SetType2()
		{
			AttackType = 2;
		}

		public void SetType3()
		{
			AttackType = 3;
		}

		public void SetType4()
		{
			AttackType = 4;
		}
	}
	internal class GrandArmoryElevator : MonoBehaviour
	{
		public List<Transform> ElevatorFloors = new List<Transform>();

		public List<GameObject> FloorObjects = new List<GameObject>();

		public Animator ElevatorAnimator;

		public int CurrentFloor = 0;

		public int ButtonFloor = 0;

		public float Duration = 3.5f;

		public AnimationCurve ElevatorCurve;

		public Transform Elevator;

		public BoxCollider UpTrigger;

		public BoxCollider DownTrigger;

		public BoxCollider BottomTrigger;

		private Vector3 ElevatorHeight;

		private bool IsElevatorMoving;

		private void Start()
		{
			SetEnabledTriggers();
		}

		public void MoveFloorUp()
		{
			//IL_0065: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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)
			if (!IsElevatorMoving && CurrentFloor < ElevatorFloors.Count - 1)
			{
				((Collider)DownTrigger).enabled = false;
				((Collider)UpTrigger).enabled = false;
				((Collider)BottomTrigger).enabled = false;
				Vector3 position = ElevatorFloors[CurrentFloor].position;
				CurrentFloor++;
				IsElevatorMoving = true;
				Vector3 position2 = ElevatorFloors[CurrentFloor].position;
				ElevatorAnimator.SetTrigger("ElevatorMoveUp");
				((MonoBehaviour)this).StartCoroutine(MoveCoroutine(position, position2, Duration));
			}
		}

		public void MoveFloorDown()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (!IsElevatorMoving && CurrentFloor > 0)
			{
				((Collider)DownTrigger).enabled = false;
				((Collider)UpTrigger).enabled = false;
				((Collider)BottomTrigger).enabled = false;
				Vector3 position = ElevatorFloors[CurrentFloor].position;
				CurrentFloor--;
				IsElevatorMoving = true;
				Vector3 position2 = ElevatorFloors[CurrentFloor].position;
				ElevatorAnimator.SetTrigger("ElevatorMoveDown");
				((MonoBehaviour)this).StartCoroutine(MoveCoroutine(position, position2, Duration));
			}
		}

		public void MoveToButton()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			if (!IsElevatorMoving && CurrentFloor != ButtonFloor)
			{
				((Collider)DownTrigger).enabled = false;
				((Collider)UpTrigger).enabled = false;
				((Collider)BottomTrigger).enabled = false;
				Vector3 position = ElevatorFloors[CurrentFloor].position;
				CurrentFloor = ButtonFloor;
				IsElevatorMoving = true;
				Vector3 position2 = ElevatorFloors[CurrentFloor].position;
				ElevatorAnimator.SetTrigger("ElevatorMoveDown");
				((MonoBehaviour)this).StartCoroutine(MoveCoroutine(position, position2, Duration));
			}
		}

		private IEnumerator MoveCoroutine(Vector3 tStart, Vector3 tEnd, float duration)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			foreach (GameObject gameObject in FloorObjects)
			{
				gameObject.SetActive(false);
			}
			yield return (object)new WaitForSeconds(0.5f);
			float t = 0f;
			while (t < duration)
			{
				t += Time.deltaTime;
				float curvedT = ElevatorCurve.Evaluate(t / duration);
				ElevatorHeight = Vector3.Lerp(tStart, tEnd, curvedT);
				((Component)Elevator).transform.position = ElevatorHeight;
				yield return 0f;
			}
			yield return (object)new WaitForSeconds(1.5f);
			IsElevatorMoving = false;
			SetEnabledTriggers();
		}

		private void SetEnabledTriggers()
		{
			FloorObjects[CurrentFloor].SetActive(true);
			((Collider)DownTrigger).enabled = true;
			((Collider)UpTrigger).enabled = true;
			((Collider)BottomTrigger).enabled = true;
			if (CurrentFloor == ButtonFloor)
			{
				((Collider)BottomTrigger).enabled = false;
			}
			if (CurrentFloor == 0)
			{
				((Collider)DownTrigger).enabled = false;
			}
			else if (CurrentFloor == ElevatorFloors.Count - 1)
			{
				((Collider)UpTrigger).enabled = false;
			}
		}
	}
	internal class RadioReceiver : MonoBehaviour
	{
		public int ReceiverId;

		[SerializeField]
		private UnityEvent ReceiveEvent;

		public void MessageReceiveEvent()
		{
			ReceiveEvent.Invoke();
		}
	}
	public class RadioSender : MonoBehaviour
	{
		[SerializeField]
		private int SenderId;

		private RadioReceiver receiver;

		public void FindSignal()
		{
			if (!(Object.FindObjectsOfType(typeof(RadioReceiver)) is RadioReceiver[] array))
			{
				return;
			}
			RadioReceiver[] array2 = array;
			foreach (RadioReceiver radioReceiver in array2)
			{
				if (SenderId == radioReceiver.ReceiverId)
				{
					receiver = radioReceiver;
				}
			}
		}

		public void SendReceiverSignal()
		{
			receiver.MessageReceiveEvent();
		}
	}
	internal class SkinnedThumperDeath : MonoBehaviour
	{
		private Exterminator Exterminator;

		public void ThumperKilled()
		{
			Exterminator = Object.FindAnyObjectByType<Exterminator>();
			if ((Object)(object)Exterminator != (Object)null)
			{
				Exterminator.IncreaseThumperCount();
			}
		}
	}
	internal class WeatherTweaksButton : NetworkBehaviour
	{
		private RoundManager roundManager;

		private void Start()
		{
			roundManager = Object.FindObjectOfType<RoundManager>();
		}

		public void PressWeatherButton()
		{
			((MonoBehaviour)this).StartCoroutine(KillPowerShort());
		}

		private IEnumerator KillPowerShort()
		{
			roundManager.FlickerLights(false, false);
			yield return (object)new WaitForSeconds(5.5f);
			roundManager.SwitchPower(false);
			roundManager.powerOffPermanently = true;
			yield return (object)new WaitForSeconds(0.75f);
			HUDManager.Instance.RadiationWarningHUD();
		}
	}
}