Decompiled source of GM Fork v0.1.0

GM_Fork.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using Atlas;
using Atlas.MappingComponents.Sandbox;
using BepInEx;
using BepInEx.Logging;
using CustomScripts;
using CustomScripts.Gamemode;
using CustomScripts.Gamemode.GMDebug;
using CustomScripts.Managers;
using CustomScripts.Objects;
using CustomScripts.Objects.Weapons;
using CustomScripts.Objects.Windows;
using CustomScripts.Player;
using CustomScripts.Powerups;
using CustomScripts.Powerups.Perks;
using CustomScripts.Zombie;
using FistVR;
using H3MP;
using H3MP.Networking;
using HarmonyLib;
using LuxWater;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using Sodalite.Api;
using Sodalite.Utilities;
using Technie.PhysicsCreator.QHull;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;
using Valve.VR;

[assembly: AssemblyTitle("CustomScripts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomScripts")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7ac675fa-8ffe-4c1b-8787-a764e1845c24")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace CustomScripts
{
	[RequireComponent(typeof(IPurchasable))]
	public class CanPurchaseTextChanger : MonoBehaviour
	{
		private IPurchasable _purchasable;

		private IRequiresPower _requiresPower;

		[SerializeField]
		private List<Text> _texts;

		private void Start()
		{
			_purchasable = ((Component)this).GetComponent<IPurchasable>();
			_requiresPower = ((Component)this).GetComponent<IRequiresPower>();
			GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(UpdateTexts));
			GameManager.OnPowerEnabled = (Action)Delegate.Combine(GameManager.OnPowerEnabled, new Action(UpdateTexts));
			UpdateTexts();
		}

		private void UpdateTexts()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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)
			if (_requiresPower != null && !_requiresPower.IsPowered)
			{
				for (int i = 0; i < _texts.Count; i++)
				{
					_texts[i].text = "No power";
					((Graphic)_texts[i]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor;
				}
			}
			else if (_purchasable.IsOneTimeOnly && _purchasable.AlreadyBought)
			{
				for (int j = 0; j < _texts.Count; j++)
				{
					_texts[j].text = "Out of stock";
					((Graphic)_texts[j]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor;
				}
			}
			else if (MonoBehaviourSingleton<GameManager>.Instance.Points >= _purchasable.PurchaseCost)
			{
				for (int k = 0; k < _texts.Count; k++)
				{
					Text obj = _texts[k];
					string text = _purchasable.PurchaseCost.ToString();
					_texts[k].text = text;
					obj.text = text;
					((Graphic)_texts[k]).color = MonoBehaviourSingleton<GameReferences>.Instance.CanBuyColor;
				}
			}
			else
			{
				for (int l = 0; l < _texts.Count; l++)
				{
					Text obj2 = _texts[l];
					string text = _purchasable.PurchaseCost.ToString();
					_texts[l].text = text;
					obj2.text = text;
					((Graphic)_texts[l]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor;
				}
			}
		}

		private void OnDestroy()
		{
			GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdateTexts));
			GameManager.OnPowerEnabled = (Action)Delegate.Remove(GameManager.OnPowerEnabled, new Action(UpdateTexts));
		}
	}
}
namespace CustomScripts.Gamemode.GMDebug
{
	public class CheatItemSpawner : MonoBehaviour
	{
		private void Awake()
		{
			RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(TrySpawning));
		}

		private void OnDrawGizmos()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_0070: 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)
			Gizmos.color = new Color(0.4f, 0.4f, 0.9f, 0.5f);
			Gizmos.matrix = ((Component)this).transform.localToWorldMatrix;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(0f, 0.7f, 0.25f);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(2.3f, 1.2f, 0.5f);
			Vector3 forward = Vector3.forward;
			Gizmos.DrawCube(val, val2);
			Gizmos.DrawLine(val, val + forward * 0.5f);
		}

		public void TrySpawning()
		{
			if (GameSettings.ItemSpawnerEnabled)
			{
				((MonoBehaviour)this).StartCoroutine(InitializeAsync());
			}
		}

		private IEnumerator InitializeAsync()
		{
			yield return null;
			Scene sceneByName = SceneManager.GetSceneByName("ModBlank_Simple");
			GameObject[] rootGameObjects = ((Scene)(ref sceneByName)).GetRootGameObjects();
			GameObject itemSpawner = rootGameObjects.First((GameObject x) => ((Object)x).name == "ItemSpawner");
			Object.Instantiate<GameObject>(itemSpawner, ((Component)this).transform.position, ((Component)this).transform.rotation).SetActive(true);
			Object.Destroy((Object)(object)this);
		}

		private void OnDestroy()
		{
			RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(TrySpawning));
		}
	}
}
namespace CustomScripts
{
	public static class Delegates
	{
		public delegate void VoidDelegate();
	}
	public static class Extensions
	{
		public static void Shuffle<T>(this IList<T> list)
		{
			Random random = new Random();
			int num = list.Count;
			while (num > 1)
			{
				num--;
				int index = random.Next(num + 1);
				T value = list[index];
				list[index] = list[num];
				list[num] = value;
			}
		}
	}
	public interface IModifier
	{
		void ApplyModifier();
	}
	public interface IPowerUp : IModifier
	{
		void Spawn(Vector3 pos);
	}
	public abstract class PowerUp : MonoBehaviour, IPowerUp, IModifier
	{
		public AudioClip ApplyAudio;

		public abstract void ApplyModifier();

		public abstract void Spawn(Vector3 pos);
	}
	public interface IPurchasable
	{
		int PurchaseCost { get; }

		bool IsOneTimeOnly { get; }

		bool AlreadyBought { get; }
	}
	public interface IRequiresPower
	{
		bool IsPowered { get; }
	}
	public interface ITrap
	{
		void OnEnemyEntered(ZombieController controller);
	}
	public class MonoBehaviourSingleton<T> : MonoBehaviour where T : Component
	{
		public static T Instance { get; private set; }

		public virtual void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = (T)(object)((this is T) ? this : null);
			}
			else
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class Speech : MonoBehaviour
	{
		public AudioClip RaygunRolled;

		public AudioClip T33Rolled;

		public AudioClip JuggernogConsumed;

		public AudioClip GettingHit;

		public AudioClip BeingRevived;

		public AudioClip BuyingStaminUp;

		public AudioClip DoublePointsPickedUp;

		public AudioClip UsingPackAPunch;

		public AudioClip Barricading;

		public AudioClip RoundEnd;

		public AudioClip StartingGame;

		public AudioClip SwitchingPower;

		private void Awake()
		{
			MysteryBox.WeaponSpawnedEvent = (Action<WeaponData>)Delegate.Combine(MysteryBox.WeaponSpawnedEvent, new Action<WeaponData>(OnWeaponSpawned));
			JuggerNogPerkBottle.ConsumedEvent = (Action)Delegate.Combine(JuggerNogPerkBottle.ConsumedEvent, new Action(OnJuggernogConsumed));
			StaminUpPerkBottle.ConsumedEvent = (Action)Delegate.Combine(StaminUpPerkBottle.ConsumedEvent, new Action(OnStaminUpConsumed));
			PlayerData.GettingHitEvent = (Action)Delegate.Combine(PlayerData.GettingHitEvent, new Action(OnGettingHit));
			PlayerSpawner.BeingRevivedEvent = (Action)Delegate.Combine(PlayerSpawner.BeingRevivedEvent, new Action(OnBeingRevived));
			PowerUpDoublePoints.PickedUpEvent = (Action)Delegate.Combine(PowerUpDoublePoints.PickedUpEvent, new Action(OnDoublePointsPickedUp));
			PackAPunch.PurchaseEvent = (Action)Delegate.Combine(PackAPunch.PurchaseEvent, new Action(OnPackAPunchPurchase));
			RoundManager.OnRoundChanged = (Action)Delegate.Combine(RoundManager.OnRoundChanged, new Action(OnRoundChanged));
			RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(OnGameStarted));
			GameManager.OnPowerEnabled = (Action)Delegate.Combine(GameManager.OnPowerEnabled, new Action(OnPowerTurnedOn));
		}

		private void Start()
		{
			Window.BarricadedEvent = (Action)Delegate.Combine(Window.BarricadedEvent, new Action(OnBarricading));
		}

		private void OnGameStarted()
		{
			if (Random.Range(0, 2000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(StartingGame, 0.5f, 9f);
				RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnGameStarted));
			}
		}

		private void OnRoundChanged()
		{
			if (Random.Range(0, 2500) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(RoundEnd, 0.5f, 9f);
				RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(OnRoundChanged));
			}
		}

		private void OnBarricading()
		{
			if (Random.Range(0, 3000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(Barricading, 0.5f, 1f);
				Window.BarricadedEvent = (Action)Delegate.Remove(Window.BarricadedEvent, new Action(OnBarricading));
			}
		}

		private void OnPackAPunchPurchase()
		{
			if (Random.Range(0, 1500) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(UsingPackAPunch, 0.5f, 1f);
				PackAPunch.PurchaseEvent = (Action)Delegate.Remove(PackAPunch.PurchaseEvent, new Action(OnPackAPunchPurchase));
			}
		}

		private void OnWeaponSpawned(WeaponData weapon)
		{
			if (Random.Range(0, 850) == 0)
			{
				if (weapon.Id == "aftr_raygunmk1")
				{
					MonoBehaviourSingleton<AudioManager>.Instance.Play(RaygunRolled, 0.5f);
					MysteryBox.WeaponSpawnedEvent = (Action<WeaponData>)Delegate.Remove(MysteryBox.WeaponSpawnedEvent, new Action<WeaponData>(OnWeaponSpawned));
				}
				if (weapon.Id == "TT33")
				{
					MonoBehaviourSingleton<AudioManager>.Instance.Play(T33Rolled, 0.5f);
					MysteryBox.WeaponSpawnedEvent = (Action<WeaponData>)Delegate.Remove(MysteryBox.WeaponSpawnedEvent, new Action<WeaponData>(OnWeaponSpawned));
				}
			}
		}

		private void OnJuggernogConsumed()
		{
			if (Random.Range(0, 1000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(JuggernogConsumed, 0.5f, 3f);
				JuggerNogPerkBottle.ConsumedEvent = (Action)Delegate.Remove(JuggerNogPerkBottle.ConsumedEvent, new Action(OnJuggernogConsumed));
			}
		}

		private void OnStaminUpConsumed()
		{
			if (Random.Range(0, 1000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(BuyingStaminUp, 0.5f, 3f);
				StaminUpPerkBottle.ConsumedEvent = (Action)Delegate.Remove(StaminUpPerkBottle.ConsumedEvent, new Action(OnStaminUpConsumed));
			}
		}

		private void OnGettingHit()
		{
			if (Random.Range(0, 2000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(GettingHit, 0.5f, 1f);
				PlayerData.GettingHitEvent = (Action)Delegate.Remove(PlayerData.GettingHitEvent, new Action(OnGettingHit));
			}
		}

		private void OnBeingRevived()
		{
			if (Random.Range(0, 1000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(BeingRevived, 0.5f, 1f);
				PlayerSpawner.BeingRevivedEvent = (Action)Delegate.Remove(PlayerSpawner.BeingRevivedEvent, new Action(OnBeingRevived));
			}
		}

		private void OnDoublePointsPickedUp()
		{
			if (Random.Range(0, 1500) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(DoublePointsPickedUp, 0.5f, 1.5f);
				PowerUpDoublePoints.PickedUpEvent = (Action)Delegate.Remove(PowerUpDoublePoints.PickedUpEvent, new Action(OnDoublePointsPickedUp));
			}
		}

		private void OnPowerTurnedOn()
		{
			if (Random.Range(0, 1000) == 0)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(SwitchingPower, 0.5f, 1.5f);
				GameManager.OnPowerEnabled = (Action)Delegate.Remove(GameManager.OnPowerEnabled, new Action(OnPowerTurnedOn));
			}
		}

		private void OnDestroy()
		{
			MysteryBox.WeaponSpawnedEvent = (Action<WeaponData>)Delegate.Remove(MysteryBox.WeaponSpawnedEvent, new Action<WeaponData>(OnWeaponSpawned));
			JuggerNogPerkBottle.ConsumedEvent = (Action)Delegate.Remove(JuggerNogPerkBottle.ConsumedEvent, new Action(OnJuggernogConsumed));
			StaminUpPerkBottle.ConsumedEvent = (Action)Delegate.Remove(StaminUpPerkBottle.ConsumedEvent, new Action(OnStaminUpConsumed));
			PlayerData.GettingHitEvent = (Action)Delegate.Remove(PlayerData.GettingHitEvent, new Action(OnGettingHit));
			PlayerSpawner.BeingRevivedEvent = (Action)Delegate.Remove(PlayerSpawner.BeingRevivedEvent, new Action(OnBeingRevived));
			PowerUpDoublePoints.PickedUpEvent = (Action)Delegate.Remove(PowerUpDoublePoints.PickedUpEvent, new Action(OnDoublePointsPickedUp));
			PackAPunch.PurchaseEvent = (Action)Delegate.Remove(PackAPunch.PurchaseEvent, new Action(OnPackAPunchPurchase));
			Window.BarricadedEvent = (Action)Delegate.Remove(Window.BarricadedEvent, new Action(OnBarricading));
			RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(OnRoundChanged));
			RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnGameStarted));
			GameManager.OnPowerEnabled = (Action)Delegate.Remove(GameManager.OnPowerEnabled, new Action(OnPowerTurnedOn));
		}
	}
	public class StartSpawner : MonoBehaviour
	{
		public ItemSpawner WeaponSpawner;

		public ItemSpawner AmmoSpawner;

		public void Spawn()
		{
			WeaponSpawner.SpawnItem();
			AmmoSpawner.SpawnItem();
			if (GameSettings.LimitedAmmo)
			{
				AmmoSpawner.SpawnItem();
				AmmoSpawner.SpawnItem();
			}
		}
	}
}
namespace CustomScripts.Gamemode.GMDebug
{
	public class CustomItemSpawner : MonoBehaviour
	{
		public string ObjectId;

		[HideInInspector]
		public GameObject SpawnedObject;

		private void OnDrawGizmos()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			Gizmos.color = new Color(0f, 0f, 0.6f, 0.5f);
			Gizmos.matrix = ((Component)this).transform.localToWorldMatrix;
			Gizmos.DrawSphere(Vector3.zero, 0.1f);
		}

		public void Spawn()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			FVRObject val = IM.OD[ObjectId];
			GameObject gameObject = ((AnvilAsset)val).GetGameObject();
			GameObject val2 = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform.position, ((Component)this).transform.rotation);
			val2.SetActive(true);
			SpawnedObject = val2;
		}
	}
}
public class DisableOnAwake : MonoBehaviour
{
	private void Awake()
	{
		((Component)this).gameObject.SetActive(false);
	}
}
public class DoorBanging : MonoBehaviour
{
	public AudioSource BangingSound;

	private float _timer;

	private bool _activated;

	private void Awake()
	{
		if (Random.Range(0, 20) != 0)
		{
			Object.Destroy((Object)(object)this);
			return;
		}
		RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(OnGameStart));
		_timer = Time.time;
	}

	private void Update()
	{
		if (!_activated && _timer + 120f <= Time.time)
		{
			BangingSound.Play();
			_activated = true;
		}
	}

	public void OnGameStart()
	{
		Object.Destroy((Object)(object)this);
	}

	private void OnDestroy()
	{
		RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnGameStart));
	}
}
namespace CustomScripts.Gamemode.GMDebug
{
	public class ErrorShower : MonoBehaviourSingleton<ErrorShower>
	{
		public Text ErrorText;

		public void Show(string message)
		{
			ErrorText.text = message;
			((Component)ErrorText).gameObject.SetActive(true);
		}
	}
}
namespace CustomScripts
{
	public class EndPanel : MonoBehaviourSingleton<EndPanel>
	{
		public Text TotalPointsText;

		public Text BestPointsText;

		public Text KillsText;

		public Text DifficultyText;

		public Text EnemiesTypeText;

		public Text LimitedAmmoText;

		public Text SpecialRoundsText;

		public Text LessZombieHPText;

		public void UpdatePanel()
		{
			TotalPointsText.text = "Total Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.TotalPoints;
			BestPointsText.text = "High Score:\n" + MonoBehaviourSingleton<SaveSystem>.Instance.GetHighscore();
			KillsText.text = "Kills:\n" + MonoBehaviourSingleton<GameManager>.Instance.Kills;
			DifficultyText.text = ((!GameSettings.HardMode) ? "Normal" : "Hard");
			EnemiesTypeText.text = ((!GameSettings.UseCustomEnemies) ? "Normal" : "Custom");
			LimitedAmmoText.text = ((!GameSettings.LimitedAmmo) ? "No" : "Yes");
			SpecialRoundsText.text = ((!GameSettings.SpecialRoundDisabled) ? "Yes" : "No");
			LessZombieHPText.text = ((!GameSettings.WeakerEnemiesEnabled) ? "No" : "Yes");
		}
	}
}
namespace CustomScripts.Gamemode.GMDebug
{
	public class CustomDebug : MonoBehaviour
	{
		public Transform Point;

		public PowerUpCarpenter Carpenter;

		public PowerUpInstaKill InstaKill;

		public PowerUpDeathMachine DeathMachine;

		public PowerUpMaxAmmo MaxAmmo;

		public PowerUpDoublePoints DoublePoints;

		public PowerUpNuke Nuke;

		public Blockade TrapBlockade;

		public ElectroTrap ElectroTrap;

		public Teleport TeleportToSecondArea;

		public Teleport TeleportToMainArea;

		public DeadShotPerkBottle DeadShotPerkBottle;

		public LootPoolChoice newLootPool;

		private ZombieBodyPart part;

		public LootPoolChoice Choice1;

		public LootPoolChoice Choice2;

		private bool _forcingSpecialEnemy;

		private void Update()
		{
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_004e: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)97))
			{
				MonoBehaviourSingleton<GameSettings>.Instance.EnableCustomEnemiesClicked();
				MonoBehaviourSingleton<RoundManager>.Instance.StartGame();
			}
			if (Input.GetKeyDown((KeyCode)98) && MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count > 0)
			{
				Damage val = new Damage();
				val.Class = (DamageClass)1;
				val.Dam_Piercing += 1f;
				val.Dam_TotalKinetic = 60000f;
				val.hitNormal = Vector3.back;
				((Component)MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0]).GetComponentInChildren<ZombieBodyPart>().Damage(val);
				part = ((Component)MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0]).GetComponentInChildren<ZombieBodyPart>();
			}
			if (Input.GetKeyDown((KeyCode)99))
			{
				Damage val2 = new Damage();
				val2.Class = (DamageClass)1;
				val2.Dam_Piercing += 1f;
				val2.Dam_TotalKinetic = 60000f;
				val2.hitNormal = Vector3.back;
				part.Damage(val2);
			}
			if (Input.GetKeyDown((KeyCode)100))
			{
				DeadShotPerkBottle.ApplyModifier();
			}
			if (Input.GetKeyDown((KeyCode)101))
			{
				((MonoBehaviour)this).StartCoroutine(MonoBehaviourSingleton<PlayerData>.Instance.ActivateStun());
			}
			if (Input.GetKeyDown((KeyCode)109))
			{
				MonoBehaviourSingleton<GameManager>.Instance.AddPoints(300);
			}
			if (Input.GetKeyDown((KeyCode)107))
			{
				TrapBlockade.Buy();
			}
			if (Input.GetKeyDown((KeyCode)108))
			{
				ElectroTrap.OnLeverPull();
			}
			if (Input.GetKeyDown((KeyCode)47))
			{
				MonoBehaviourSingleton<GameManager>.Instance.TurnOnPower();
			}
			if (Input.GetKeyDown((KeyCode)105))
			{
				TeleportToSecondArea.OnLeverPull();
			}
			if (Input.GetKeyDown((KeyCode)111))
			{
				TeleportToMainArea.OnLeverPull();
			}
			if (Input.GetKeyDown((KeyCode)109))
			{
				MonoBehaviourSingleton<GameSettings>.Instance.ToggleBackgroundMusic();
			}
			if (Input.GetKeyDown((KeyCode)91))
			{
				Choice1.ChangePoolToThis();
			}
			if (Input.GetKeyDown((KeyCode)93))
			{
				Choice2.ChangePoolToThis();
			}
		}

		public void SpawnCarpenter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			Carpenter.Spawn(Point.position);
		}

		public void SpawnInstaKill()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			InstaKill.Spawn(Point.position);
		}

		public void SpawnDeathMachine()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			DeathMachine.Spawn(Point.position);
		}

		public void SpawnMaxAmmo()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			MaxAmmo.Spawn(Point.position);
		}

		public void SpawnDoublePoints()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			DoublePoints.Spawn(Point.position);
		}

		public void SpawnNuke()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			Nuke.Spawn(Point.position);
		}

		public void KillRandom()
		{
			if (MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count > 0)
			{
				MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0].OnHit(99999f);
			}
		}

		public void ToggleForceSpecialRound()
		{
			if (_forcingSpecialEnemy)
			{
				MonoBehaviourSingleton<RoundManager>.Instance.SpecialRoundInterval = 8;
				_forcingSpecialEnemy = false;
			}
			else
			{
				MonoBehaviourSingleton<RoundManager>.Instance.SpecialRoundInterval = 1;
				_forcingSpecialEnemy = true;
			}
		}
	}
	public class DebugDamagableShower : MonoBehaviour, IFVRDamageable
	{
		public Text Text;

		public Text LowestText;

		public Text HighestText;

		public float DamageSum;

		public float LowestDam;

		public float HighestDam;

		public void Damage(Damage dam)
		{
			DamageSum += dam.Dam_TotalKinetic;
			if (LowestDam < dam.Dam_TotalKinetic)
			{
				LowestDam = dam.Dam_TotalKinetic;
			}
			if (HighestDam > dam.Dam_TotalKinetic)
			{
				HighestDam = dam.Dam_TotalKinetic;
			}
			Text.text = "Kinetic: " + DamageSum;
			LowestText.text = "Lowest: " + LowestDam;
			HighestText.text = "Highest: " + HighestDam;
		}

		public void ResetData()
		{
			DamageSum = 0f;
			LowestDam = float.MaxValue;
			HighestDam = float.MinValue;
			Text.text = "Kinetic: " + 0;
			LowestText.text = "Lowest: " + 0;
			HighestText.text = "Highest: " + 0;
		}
	}
	public class MoveTest : MonoBehaviour
	{
		[FormerlySerializedAs("isMoving")]
		public bool IsMoving;

		public float Speed;

		private void Update()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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)
			if (IsMoving)
			{
				Transform transform = ((Component)this).transform;
				transform.position += Vector3.forward * (Speed * Time.deltaTime);
				Transform transform2 = ((Component)MonoBehaviourSingleton<GameReferences>.Instance.Player).transform;
				transform2.position += Vector3.forward * (Speed * Time.deltaTime);
			}
		}

		public void StartMoving()
		{
			IsMoving = true;
		}
	}
}
namespace CustomScripts
{
	public class GameReferences : MonoBehaviourSingleton<GameReferences>
	{
		public Color CanBuyColor;

		public Color CannotBuyColor;

		[HideInInspector]
		public List<Window> Windows;

		[HideInInspector]
		public Transform Player;

		[SerializeField]
		private Transform DebugPlayer;

		[HideInInspector]
		public Transform PlayerHead;

		[SerializeField]
		private Transform DebugPlayerHead;

		public override void Awake()
		{
			base.Awake();
			Player = DebugPlayer;
			PlayerHead = DebugPlayerHead;
			Windows = Object.FindObjectsOfType<Window>().ToList();
		}

		private IEnumerator Start()
		{
			while ((Object)(object)GM.CurrentPlayerBody == (Object)null)
			{
				yield return null;
			}
			Player = ((Component)GM.CurrentPlayerBody).transform;
			PlayerHead = ((Component)GM.CurrentPlayerBody.Head).transform;
		}

		public bool IsPlayerClose(Transform pos, float dist)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return Vector3.Distance(pos.position, Player.position) <= dist;
		}
	}
	public class GameSettings : MonoBehaviourSingleton<GameSettings>
	{
		public static Action OnSettingsChanged;

		public static Action OnMusicSettingChanged;

		public LootPool DefaultLootPool;

		[HideInInspector]
		public LootPool CurrentLootPool;

		[HideInInspector]
		public List<LootPoolChoice> LootPoolChoices;

		public static bool HardMode;

		public static bool UseCustomEnemies;

		public static bool LimitedAmmo;

		public static bool SpecialRoundDisabled;

		public static bool ItemSpawnerEnabled;

		public static bool WeakerEnemiesEnabled;

		public static bool BackgroundMusic;

		public Text OptionDescriptionText;

		private void Start()
		{
			LootPoolChoices = Object.FindObjectsOfType<LootPoolChoice>().ToList();
			if (LootPoolChoices.Count == 0)
			{
				Debug.LogError((object)"No LootPoolChoices in the scene, At least one component has to be present");
			}
			if (Object.op_Implicit((Object)(object)DefaultLootPool))
			{
				CurrentLootPool = DefaultLootPool;
			}
			else
			{
				CurrentLootPool = LootPoolChoices[0].LootPool;
			}
			if (Object.op_Implicit((Object)(object)CurrentLootPool))
			{
				foreach (LootPoolChoice lootPoolChoice in LootPoolChoices)
				{
					if ((Object)(object)lootPoolChoice.LootPool == (Object)(object)CurrentLootPool)
					{
						lootPoolChoice.IsEnabled = true;
					}
				}
			}
			OptionDescriptionText.text = "Call of Duty\nZOMBIES";
			if (Random.Range(0, 500) == 0)
			{
				switch (Random.Range(0, 7))
				{
				case 0:
					OptionDescriptionText.text = "You are my sunshine,\nMy only sunshine";
					break;
				case 1:
					OptionDescriptionText.text = "I missed you";
					break;
				case 2:
					OptionDescriptionText.text = "Play with me";
					break;
				case 3:
					OptionDescriptionText.text = "It's just a game, mostly";
					break;
				case 4:
					OptionDescriptionText.text = "I have granted kids to hell";
					break;
				case 5:
					OptionDescriptionText.text = "It's only partially your fault";
					break;
				}
			}
		}

		public void RestoreDefaultSettings()
		{
			HardMode = false;
			LimitedAmmo = false;
			UseCustomEnemies = false;
			ItemSpawnerEnabled = false;
			SpecialRoundDisabled = false;
			WeakerEnemiesEnabled = false;
			OptionDescriptionText.text = "Default settings restored.";
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
		}

		public void DifficultyNormalClicked()
		{
			HardMode = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Normal mode: Normal Enemy speed, HP and numbers.";
		}

		public void DifficultyHardClicked()
		{
			HardMode = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Hard mode: Increased Enemy speed, HP and numbers.";
		}

		public void EnableCustomEnemiesClicked()
		{
			UseCustomEnemies = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Custom humanoid enemies\n(Instead of Sosigs).";
		}

		public void DisableCustomEnemiesClicked()
		{
			UseCustomEnemies = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Default Sosig zombies.";
		}

		public void EnableLimitedAmmoClicked()
		{
			LimitedAmmo = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Cannot use Spawnlock. Restore ammunition from Max Ammo power ups or buy it from a wall.";
		}

		public void DisableLimitedAmmoClicked()
		{
			LimitedAmmo = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Spawnlock enabled.";
		}

		public void EnableSpecialRoundClicked()
		{
			SpecialRoundDisabled = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Special round inspired by Hellhounds, occurs every 8 rounds.";
		}

		public void DisableSpecialRoundClicked()
		{
			SpecialRoundDisabled = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Special round disabled.";
		}

		public void EnableItemSpawnerClicked()
		{
			ItemSpawnerEnabled = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Item Spawner will appear at the starting location. Scoring will be disabled for that game.";
		}

		public void DisableItemSpawnerClicked()
		{
			ItemSpawnerEnabled = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "No Item Spawner. Scoring enabled";
		}

		public void EnableWeakerEnemiesClicked()
		{
			WeakerEnemiesEnabled = true;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Enemies have reduced HP";
		}

		public void DisableWeakerEnemiesClicked()
		{
			WeakerEnemiesEnabled = false;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
			OptionDescriptionText.text = "Enemies have normal HP";
		}

		public void ToggleBackgroundMusic()
		{
			BackgroundMusic = !BackgroundMusic;
			if (OnMusicSettingChanged != null)
			{
				OnMusicSettingChanged();
			}
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
		}

		public void ChangeLootPool(LootPoolChoice newLootPool)
		{
			foreach (LootPoolChoice lootPoolChoice in LootPoolChoices)
			{
				lootPoolChoice.IsEnabled = false;
			}
			newLootPool.IsEnabled = true;
			CurrentLootPool = newLootPool.LootPool;
			if (OnSettingsChanged != null)
			{
				OnSettingsChanged();
			}
		}
	}
	public class GameSettingsPanel : MonoBehaviour
	{
		public Text BackgroundMusic;

		public Text DifficultyNormalText;

		public Text DifficultyHardText;

		public Text CustomEnemiesEnabledText;

		public Text CustomEnemiesDisabledText;

		public Text LimitedAmmoEnabledText;

		public Text LimitedAmmoDisabledText;

		public Text SpecialRoundEnabledText;

		public Text SpecialRoundDisabledText;

		public Text ItemSpawnerEnabledText;

		public Text ItemSpawnerDisabledText;

		public Text WeakerZombiesEnabledText;

		public Text WeakerZombiesDisabledText;

		public Color EnabledColor;

		public Color DisabledColor;

		private void Awake()
		{
			GameSettings.OnSettingsChanged = (Action)Delegate.Combine(GameSettings.OnSettingsChanged, new Action(UpdateText));
		}

		private void Start()
		{
			UpdateText();
		}

		private void OnDestroy()
		{
			GameSettings.OnSettingsChanged = (Action)Delegate.Remove(GameSettings.OnSettingsChanged, new Action(UpdateText));
		}

		private void UpdateText()
		{
			//IL_0041: 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_0067: 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_008d: 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_00b3: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: 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_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			BackgroundMusic.text = ((!GameSettings.BackgroundMusic) ? "Disabled" : "Enabled");
			((Graphic)DifficultyNormalText).color = ((!GameSettings.HardMode) ? EnabledColor : DisabledColor);
			((Graphic)DifficultyHardText).color = ((!GameSettings.HardMode) ? DisabledColor : EnabledColor);
			((Graphic)CustomEnemiesEnabledText).color = ((!GameSettings.UseCustomEnemies) ? DisabledColor : EnabledColor);
			((Graphic)CustomEnemiesDisabledText).color = ((!GameSettings.UseCustomEnemies) ? EnabledColor : DisabledColor);
			((Graphic)LimitedAmmoEnabledText).color = ((!GameSettings.LimitedAmmo) ? DisabledColor : EnabledColor);
			((Graphic)LimitedAmmoDisabledText).color = ((!GameSettings.LimitedAmmo) ? EnabledColor : DisabledColor);
			((Graphic)SpecialRoundEnabledText).color = ((!GameSettings.SpecialRoundDisabled) ? EnabledColor : DisabledColor);
			((Graphic)SpecialRoundDisabledText).color = ((!GameSettings.SpecialRoundDisabled) ? DisabledColor : EnabledColor);
			((Graphic)ItemSpawnerEnabledText).color = ((!GameSettings.ItemSpawnerEnabled) ? DisabledColor : EnabledColor);
			((Graphic)ItemSpawnerDisabledText).color = ((!GameSettings.ItemSpawnerEnabled) ? EnabledColor : DisabledColor);
			((Graphic)WeakerZombiesEnabledText).color = ((!GameSettings.WeakerEnemiesEnabled) ? DisabledColor : EnabledColor);
			((Graphic)WeakerZombiesDisabledText).color = ((!GameSettings.WeakerEnemiesEnabled) ? EnabledColor : DisabledColor);
			foreach (LootPoolChoice lootPoolChoice in MonoBehaviourSingleton<GameSettings>.Instance.LootPoolChoices)
			{
				((Graphic)lootPoolChoice.LootChoiceText).color = ((!lootPoolChoice.IsEnabled) ? DisabledColor : EnabledColor);
			}
		}
	}
	public class GameStart : MonoBehaviourSingleton<GameStart>
	{
		private void OnDrawGizmos()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Gizmos.color = Color.red;
			Gizmos.DrawSphere(((Component)this).transform.position, 0.5f);
		}
	}
	public class HighscoreShower : MonoBehaviour
	{
		public Text HighscoreText;

		private void Start()
		{
			HighscoreText.text = "Highscore:\n" + MonoBehaviourSingleton<SaveSystem>.Instance.GetHighscore();
		}
	}
	public class LeverWrapper : MonoBehaviour
	{
		public UnityEvent LeverToggleEvent;

		public UnityEvent LeverOnEvent;

		public UnityEvent LeverOffEvent;

		public UnityEvent LeverHoldStartEvent;

		public UnityEvent LeverHoldEndEvent;

		private TrapLever _lever;

		private bool _isOn;

		private bool _isHeld;

		private void Awake()
		{
			_lever = ((Component)this).GetComponent<TrapLever>();
			_lever.MessageTargets.Add(((Component)this).gameObject);
		}

		private void Update()
		{
			if (!_isHeld && ((FVRInteractiveObject)_lever).IsHeld)
			{
				OnHoldStart();
			}
			else if (_isHeld && !((FVRInteractiveObject)_lever).IsHeld)
			{
				OnHoldEnd();
			}
		}

		private void OnHoldStart()
		{
			_isHeld = true;
			if (LeverHoldStartEvent != null)
			{
				LeverHoldStartEvent.Invoke();
			}
		}

		private void OnHoldEnd()
		{
			_isHeld = false;
			if (LeverHoldEndEvent != null)
			{
				LeverHoldEndEvent.Invoke();
			}
		}

		public void ON()
		{
			if (!_isOn)
			{
				_isOn = true;
				if (LeverToggleEvent != null)
				{
					LeverToggleEvent.Invoke();
				}
				if (LeverOnEvent != null)
				{
					LeverOnEvent.Invoke();
				}
			}
		}

		public void OFF()
		{
			if (_isOn)
			{
				_isOn = false;
				if (LeverToggleEvent != null)
				{
					LeverToggleEvent.Invoke();
				}
				if (LeverOffEvent != null)
				{
					LeverOffEvent.Invoke();
				}
			}
		}
	}
}
namespace CustomScripts.Gamemode
{
	public class PointsView : MonoBehaviour
	{
		public Text PointsText;

		private void Awake()
		{
			GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(OnPointsChanged));
		}

		private void OnDestroy()
		{
			GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(OnPointsChanged));
		}

		private void OnPointsChanged()
		{
			PointsText.text = "Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.Points;
		}
	}
}
public class Location : MonoBehaviour
{
	public List<Transform> ZombieSpawnPoints;

	public List<Transform> SpecialZombieSpawnPoints;

	private void Start()
	{
		if (ZombieSpawnPoints.Count == 0)
		{
			Debug.LogError((object)"ZombieSpawnPoints is empty, zombies don't have a place to spawn");
		}
		if (SpecialZombieSpawnPoints.Count == 0)
		{
			Debug.LogError((object)"SpecialZombieSpawnPoints is empty, special zombies don't have a place to spawn");
		}
	}
}
[CreateAssetMenu]
public class LootPool : ScriptableObject
{
	public string LootPoolTitle;

	[Header("Elements in the list corresponds to the ID of the Wallshops.")]
	public List<WeaponData> WallShopsPool;

	public List<WeaponData> MysteryBoxPool;

	public List<WeaponData> LimitedAmmoMysteryBoxPool;

	public HashSet<WeaponData> PackAPunchPool => GetPackAPunchPool();

	public HashSet<WeaponData> GetPackAPunchPool()
	{
		HashSet<WeaponData> hashSet = new HashSet<WeaponData>();
		foreach (WeaponData item in WallShopsPool)
		{
			hashSet.Add(item);
		}
		foreach (WeaponData item2 in MysteryBoxPool)
		{
			hashSet.Add(item2);
		}
		foreach (WeaponData item3 in LimitedAmmoMysteryBoxPool)
		{
			hashSet.Add(item3);
		}
		return hashSet;
	}
}
public class LootPoolChoice : MonoBehaviour
{
	public LootPool LootPool;

	public Text LootChoiceText;

	[HideInInspector]
	public bool IsEnabled;

	private void Awake()
	{
		LootChoiceText.text = LootPool.LootPoolTitle;
	}

	public void ChangePoolToThis()
	{
		MonoBehaviourSingleton<GameSettings>.Instance.ChangeLootPool(this);
		IsEnabled = true;
	}
}
namespace CustomScripts.Gamemode
{
	public class MagazineWrapper : MonoBehaviour
	{
		private FVRFireArmMagazine _magazine;

		private FVRFireArmClip _clip;

		private Speedloader _speedloader;

		public FireArmRoundClass RoundClass;

		public void Initialize(FVRFireArmMagazine magazine)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			_magazine = magazine;
			RoundClass = magazine.DefaultLoadingPattern.Classes[0];
		}

		public void InitialzieWithAmmo(FVRFireArmMagazine magazine, FireArmRoundClass roundClass)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			_magazine = magazine;
			RoundClass = roundClass;
		}

		public void InitialzieWithAmmo(FVRFireArmClip clip, FireArmRoundClass roundClass)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			_clip = clip;
			RoundClass = roundClass;
		}

		public void InitialzieWithAmmo(Speedloader speedloader, FireArmRoundClass roundClass)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			_speedloader = speedloader;
			RoundClass = roundClass;
		}
	}
}
namespace CustomScripts
{
	public class GameManager : MonoBehaviourSingleton<GameManager>
	{
		public static Action OnPointsChanged;

		public static Action OnPowerEnabled;

		[HideInInspector]
		public int Points;

		[HideInInspector]
		public int TotalPoints;

		[HideInInspector]
		public bool GameStarted = false;

		[HideInInspector]
		public bool GameEnded = false;

		public Transform StartGameWaypoint;

		public WallShop FirstShop;

		public bool PowerEnabled;

		[HideInInspector]
		public int Kills;

		private Harmony _harmony;

		public override void Awake()
		{
			base.Awake();
			_harmony = Harmony.CreateAndPatchAll(typeof(PlayerData), (string)null);
			_harmony.PatchAll(typeof(PlayerSpawner));
			_harmony.PatchAll(typeof(ZombieManager));
		}

		public void TurnOnPower()
		{
			if (!PowerEnabled)
			{
				PowerEnabled = true;
				MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.PowerOnSound, 0.8f);
				if (OnPowerEnabled != null)
				{
					OnPowerEnabled();
				}
			}
		}

		public void AddPoints(int amount)
		{
			float num = (float)amount * MonoBehaviourSingleton<PlayerData>.Instance.MoneyModifier;
			MonoBehaviourSingleton<PlayerData>.Instance.MoneyModifier.ToString();
			amount = (int)num;
			Points += amount;
			TotalPoints += amount;
			if (OnPointsChanged != null)
			{
				OnPointsChanged();
			}
		}

		public bool TryRemovePoints(int amount)
		{
			if (Points >= amount)
			{
				Points -= amount;
				if (OnPointsChanged != null)
				{
					OnPointsChanged();
				}
				return true;
			}
			return false;
		}

		public void KillPlayer()
		{
			if (!GameEnded)
			{
				GM.CurrentPlayerBody.KillPlayer(false);
			}
		}

		public void EndGame()
		{
			if (!GameEnded)
			{
				GameEnded = true;
				MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.EndMusic, 0.25f, 1f);
				MonoBehaviourSingleton<EndPanel>.Instance.UpdatePanel();
				if (!GameSettings.ItemSpawnerEnabled)
				{
					MonoBehaviourSingleton<SaveSystem>.Instance.SaveHighscore(TotalPoints);
				}
			}
		}

		private void OnDestroy()
		{
			_harmony.UnpatchSelf();
		}
	}
	public class PowerUpManager : MonoBehaviourSingleton<PowerUpManager>
	{
		public float ChanceForAmmo = 2.5f;

		public float ChanceForPowerUp = 6f;

		public float AmmoCooldownTime;

		public float PowerUpCooldownTime;

		public PowerUpMaxAmmo MaxAmmo;

		public List<PowerUp> PowerUps;

		private readonly List<int> _randomIndexes = new List<int>();

		private bool _isPowerUpCooldown;

		private bool _isMaxAmmoCooldown;

		public override void Awake()
		{
			base.Awake();
			RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Remove(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp));
			RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Combine(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp));
			ShuffleIndexes();
		}

		private void OnDestroy()
		{
			RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Remove(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp));
		}

		public void RollForPowerUp(GameObject spawnPos)
		{
			//IL_004e: 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)
			float num = Random.Range(0f, 100f);
			if (GameSettings.LimitedAmmo && !_isMaxAmmoCooldown && num < ChanceForAmmo)
			{
				((MonoBehaviour)this).StartCoroutine(PowerUpMaxAmmoCooldown());
				SpawnPowerUp(MaxAmmo, spawnPos.transform.position);
			}
			else
			{
				if (_isPowerUpCooldown)
				{
					return;
				}
				num = Random.Range(0f, 100f);
				if (num < ChanceForPowerUp)
				{
					if (_randomIndexes.Count == 0)
					{
						ShuffleIndexes();
					}
					((MonoBehaviour)this).StartCoroutine(PowerUpMaxAmmoCooldown());
					SpawnPowerUp(PowerUps[_randomIndexes[0]], spawnPos.transform.position);
					_randomIndexes.RemoveAt(0);
				}
			}
		}

		private void ShuffleIndexes()
		{
			_randomIndexes.Clear();
			for (int i = 0; i < PowerUps.Count; i++)
			{
				_randomIndexes.Add(i);
			}
			_randomIndexes.Shuffle();
		}

		public void SpawnPowerUp(PowerUp powerUp, Vector3 pos)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)powerUp == (Object)null)
			{
				Debug.LogWarning((object)"PowerUp spawn failed! PowerUp == null");
				return;
			}
			((MonoBehaviour)this).StartCoroutine(PowerUpCooldown());
			powerUp.Spawn(pos + Vector3.up);
		}

		private IEnumerator PowerUpCooldown()
		{
			_isPowerUpCooldown = true;
			yield return (object)new WaitForSeconds(PowerUpCooldownTime);
			_isPowerUpCooldown = false;
		}

		private IEnumerator PowerUpMaxAmmoCooldown()
		{
			_isMaxAmmoCooldown = true;
			yield return (object)new WaitForSeconds(AmmoCooldownTime);
			_isMaxAmmoCooldown = false;
		}
	}
	public class RoundManager : MonoBehaviourSingleton<RoundManager>
	{
		public static Action RoundStarted;

		public static Action RoundEnded;

		public static Action OnRoundChanged;

		public static Action OnZombiesLeftChanged;

		public static Action<GameObject> OnZombieKilled;

		public static Action OnGameStarted;

		public int ZombieFastWalkRound = 2;

		public int ZombieRunRound = 6;

		public int HardModeFastWalkRound = 0;

		public int HardModeRunRound = 3;

		public int SpecialRoundInterval;

		[HideInInspector]
		public int RoundNumber = 0;

		private Coroutine _roundDelayCoroutine;

		public bool IsRoundSpecial
		{
			get
			{
				if (GameSettings.SpecialRoundDisabled)
				{
					return false;
				}
				return RoundNumber % SpecialRoundInterval == 0;
			}
		}

		public bool IsFastWalking
		{
			get
			{
				if (GameSettings.HardMode)
				{
					return RoundNumber >= HardModeFastWalkRound;
				}
				return RoundNumber >= ZombieFastWalkRound;
			}
		}

		public bool IsRunning
		{
			get
			{
				if (GameSettings.HardMode)
				{
					return RoundNumber >= HardModeRunRound;
				}
				return RoundNumber >= ZombieRunRound;
			}
		}

		public void StartGame()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (!Application.isEditor)
			{
				GM.CurrentMovementManager.TeleportToPoint(MonoBehaviourSingleton<GameManager>.Instance.StartGameWaypoint.position, true);
				GM.CurrentSceneSettings.IsSpawnLockingEnabled = !GameSettings.LimitedAmmo;
			}
			MonoBehaviourSingleton<GameManager>.Instance.GameStarted = true;
			RoundNumber = 0;
			AdvanceRound();
			if (OnGameStarted != null)
			{
				OnGameStarted();
			}
			if (Object.op_Implicit((Object)(object)MonoBehaviourSingleton<GameManager>.Instance.FirstShop))
			{
				MonoBehaviourSingleton<GameManager>.Instance.FirstShop.IsFree = true;
				MonoBehaviourSingleton<GameManager>.Instance.FirstShop.TryBuying();
			}
		}

		public void AdvanceRound()
		{
			if (!MonoBehaviourSingleton<GameManager>.Instance.GameEnded)
			{
				RoundNumber++;
				MonoBehaviourSingleton<ZombieManager>.Instance.BeginSpawningEnemies();
				if (OnZombiesLeftChanged != null)
				{
					OnZombiesLeftChanged();
				}
				if (OnRoundChanged != null)
				{
					OnRoundChanged();
				}
			}
		}

		public void EndRound()
		{
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.RoundEndSound, 0.2f, 1f);
			if (RoundEnded != null)
			{
				RoundEnded();
			}
			if (GameSettings.LimitedAmmo)
			{
				_roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(20f));
			}
			else
			{
				_roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(17f));
			}
		}

		private IEnumerator DelayedAdvanceRound(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			AdvanceRound();
			if (RoundStarted != null)
			{
				RoundStarted();
			}
		}

		public void PauseGame()
		{
			((MonoBehaviour)this).StopCoroutine(_roundDelayCoroutine);
		}

		public void ResumeGame()
		{
			_roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(0f));
		}
	}
	public class AudioManager : MonoBehaviourSingleton<AudioManager>
	{
		public List<AudioClip> FarZombieSounds;

		public List<AudioClip> CloseZombieSounds;

		public List<AudioClip> HellHoundsSounds;

		public AudioSource MainAudioSource;

		public AudioSource MusicAudioSource;

		[Space(20f)]
		public AudioClip Music;

		public AudioClip BuySound;

		public AudioClip DrinkSound;

		public AudioClip ZombieHitSound;

		public AudioClip ZombieDeathSound;

		public AudioClip HellHoundSpawnSound;

		public AudioClip HellHoundDeathSound;

		public AudioClip RoundStartSound;

		public AudioClip RoundEndSound;

		public AudioClip HellHoundRoundStartSound;

		public AudioClip PowerOnSound;

		public AudioClip EndMusic;

		public AudioClip TeleportingSound;

		public AudioClip PlayerHitSound;

		public AudioClip BarricadeRepairSound;

		private Coroutine _musicRepetition;

		public override void Awake()
		{
			base.Awake();
			GameSettings.OnMusicSettingChanged = (Action)Delegate.Combine(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingChanged));
		}

		private void OnMusicSettingChanged()
		{
			if (GameSettings.BackgroundMusic)
			{
				PlayMusic(Music, 0.08f, 0f, repeat: true);
			}
			else
			{
				MusicAudioSource.Stop();
			}
		}

		public void Play(AudioClip audioClip, float volume = 1f, float delay = 0f)
		{
			if (delay != 0f)
			{
				((MonoBehaviour)this).StartCoroutine(PlayDelayed(audioClip, volume, delay));
			}
			else
			{
				MainAudioSource.PlayOneShot(audioClip, volume);
			}
		}

		private IEnumerator PlayDelayed(AudioClip audioClip, float volume, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			MainAudioSource.PlayOneShot(audioClip, volume);
		}

		public void PlayMusic(AudioClip audioClip, float volume = 1f, float delay = 0f, bool repeat = false)
		{
			if (_musicRepetition != null)
			{
				((MonoBehaviour)this).StopCoroutine(_musicRepetition);
				_musicRepetition = null;
			}
			MusicAudioSource.clip = audioClip;
			MusicAudioSource.volume = volume;
			MusicAudioSource.PlayDelayed(delay);
			if (repeat)
			{
				_musicRepetition = ((MonoBehaviour)this).StartCoroutine(RepeatMusic(audioClip.length, volume));
			}
		}

		private IEnumerator RepeatMusic(float endTimer, float volume)
		{
			yield return (object)new WaitForSeconds(endTimer);
			if (GameSettings.BackgroundMusic)
			{
				PlayMusic(Music, 0.08f, 0f, repeat: true);
			}
		}

		private void OnDestroy()
		{
			GameSettings.OnMusicSettingChanged = (Action)Delegate.Remove(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingChanged));
		}
	}
}
namespace CustomScripts.Managers.Sound
{
	public class MusicManager : MonoBehaviourSingleton<MusicManager>
	{
	}
}
namespace CustomScripts
{
	public class SoundPool : MonoBehaviour
	{
		public List<SoundPoolableObject> PooledAudioSources;

		public static SoundPool Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		public SoundPoolableObject Spawn()
		{
			if (PooledAudioSources.Count <= 0)
			{
				return null;
			}
			SoundPoolableObject result = PooledAudioSources[0];
			PooledAudioSources.RemoveAt(0);
			return result;
		}

		public void Despawn(SoundPoolableObject soundPoolable)
		{
			PooledAudioSources.Add(soundPoolable);
		}
	}
	public class SoundPoolableObject : MonoBehaviour
	{
		public AudioSource AudioSource;

		public float DespawnTime = 4f;

		public void Initialize()
		{
			AudioSource.Play();
			((MonoBehaviour)this).StartCoroutine(DespawnDelay());
		}

		private IEnumerator DespawnDelay()
		{
			yield return (object)new WaitForSeconds(DespawnTime);
			SoundPool.Instance.Despawn(this);
		}
	}
}
namespace CustomScripts.Managers
{
	public class ZombieManager : MonoBehaviourSingleton<ZombieManager>
	{
		public static Action LocationChangedEvent;

		public Location CurrentLocation;

		public ZombiePool NormalZombiePool;

		public ZombiePool SpecialZombiePool;

		public AnimationCurve ZombieCountCurve;

		public AnimationCurve CustomZombieHPCurve;

		public AnimationCurve ZosigHPCurve;

		public AnimationCurve ZosigLinkIntegrityCurve;

		public AnimationCurve ZosigPerRoundSpeed;

		public int CustomZombieDamage = 2000;

		public int PointsOnHit = 10;

		public int PointsOnKill = 100;

		public List<ZombieController> AllCustomZombies;

		[HideInInspector]
		public List<ZombieController> ExistingZombies;

		private Transform _zombieTarget;

		public ParticleSystem HellhoundExplosionPS;

		public int ZombieAtOnceLimit = 20;

		[HideInInspector]
		public int ZombiesRemaining;

		private Coroutine _spawningCoroutine;

		private int ZombiesToSpawnThisRound
		{
			get
			{
				if (GameSettings.HardMode)
				{
					return Mathf.CeilToInt(ZombieCountCurve.Evaluate((float)MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber) + 1f);
				}
				return Mathf.CeilToInt(ZombieCountCurve.Evaluate((float)MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber));
			}
		}

		public void BeginSpawningEnemies()
		{
			ZombiesRemaining = ZombiesToSpawnThisRound;
			if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
			{
				StartSpawningZombies(6f);
				MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.HellHoundRoundStartSound, 0.35f);
			}
			else
			{
				StartSpawningZombies(2f);
				MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.RoundStartSound, 0.2f, 1f);
			}
		}

		public void StartSpawningZombies(float initialDelay)
		{
			_spawningCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedZombieSpawn(initialDelay));
		}

		public void OnZombieSpawned(ZombieController controller)
		{
			((MonoBehaviour)this).StartCoroutine(DelayedCustomZombieSpawn(controller));
		}

		private IEnumerator DelayedZombieSpawn(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			while (ZombiesRemaining > ExistingZombies.Count)
			{
				if (ExistingZombies.Count >= ZombieAtOnceLimit)
				{
					yield return (object)new WaitForSeconds(5f);
					continue;
				}
				_zombieTarget = MonoBehaviourSingleton<GameReferences>.Instance.Player;
				if (!GameSettings.UseCustomEnemies)
				{
					SpawnZosig();
				}
				else if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
				{
					SpecialZombiePool.Spawn();
				}
				else
				{
					NormalZombiePool.Spawn();
				}
				yield return (object)new WaitForSeconds(2f);
			}
		}

		private IEnumerator DelayedCustomZombieSpawn(ZombieController controller)
		{
			yield return null;
			Transform spawnPoint2 = null;
			spawnPoint2 = ((!MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) ? CurrentLocation.ZombieSpawnPoints[Random.Range(0, CurrentLocation.ZombieSpawnPoints.Count)] : ((Component)CurrentLocation.SpecialZombieSpawnPoints[Random.Range(0, CurrentLocation.SpecialZombieSpawnPoints.Count)]).transform);
			if ((Object)(object)((Component)spawnPoint2).GetComponent<ZombieSpawner>() != (Object)null)
			{
				Window windowWaypoint = ((Component)spawnPoint2).GetComponent<ZombieSpawner>().WindowWaypoint;
				if ((Object)(object)windowWaypoint != (Object)null)
				{
					_zombieTarget = windowWaypoint.ZombieWaypoint;
				}
			}
			ExistingZombies.Add(controller);
			if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
			{
				((Component)spawnPoint2).GetComponent<CustomSosigSpawnPoint>().SpawnPS.Play(true);
				if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
				{
					MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.HellHoundSpawnSound, 0.4f, 0.25f);
				}
				yield return (object)new WaitForSeconds(2f);
			}
			if (ExistingZombies.Contains(controller))
			{
				((Component)controller).transform.position = spawnPoint2.position;
				controller.Initialize(_zombieTarget);
				if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
				{
					controller.InitializeSpecialType();
				}
			}
		}

		public void SpawnZosig()
		{
			if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
			{
				CustomSosigSpawnPoint component = ((Component)CurrentLocation.SpecialZombieSpawnPoints[Random.Range(0, CurrentLocation.SpecialZombieSpawnPoints.Count)]).GetComponent<CustomSosigSpawnPoint>();
				component.Spawn();
				return;
			}
			CustomSosigSpawnPoint component2 = ((Component)CurrentLocation.ZombieSpawnPoints[Random.Range(0, CurrentLocation.ZombieSpawnPoints.Count)]).GetComponent<CustomSosigSpawnPoint>();
			Window windowWaypoint = ((Component)component2).GetComponent<ZombieSpawner>().WindowWaypoint;
			if ((Object)(object)windowWaypoint != (Object)null)
			{
				_zombieTarget = windowWaypoint.ZombieWaypoint;
			}
			component2.Spawn();
		}

		public void OnZosigSpawned(Sosig zosig)
		{
			ZombieController zombieController = ((Component)zosig).gameObject.AddComponent<ZosigZombieController>();
			zombieController.Initialize(_zombieTarget);
			ExistingZombies.Add(zombieController);
			if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
			{
				zombieController.InitializeSpecialType();
			}
		}

		public void ChangeLocation(Location newLocation)
		{
			if (_spawningCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(_spawningCoroutine);
			}
			CurrentLocation = newLocation;
			for (int num = ExistingZombies.Count - 1; num >= 0; num--)
			{
				ExistingZombies[num].OnKill(awardPoints: false);
			}
			StartSpawningZombies(5f);
			if (LocationChangedEvent != null)
			{
				LocationChangedEvent();
			}
		}

		public void OnZombieDied(ZombieController controller, bool awardKill = true)
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			MonoBehaviourSingleton<GameManager>.Instance.Kills++;
			if (GameSettings.UseCustomEnemies)
			{
				((MonoBehaviour)this).StartCoroutine(DelayedCustomZombieDespawn(((Component)controller).GetComponent<CustomZombieController>()));
			}
			ExistingZombies.Remove(controller);
			if (!awardKill)
			{
				return;
			}
			ZombiesRemaining--;
			if (ZombiesRemaining <= 0)
			{
				if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial && GameSettings.LimitedAmmo)
				{
					MonoBehaviourSingleton<PowerUpManager>.Instance.SpawnPowerUp(MonoBehaviourSingleton<PowerUpManager>.Instance.MaxAmmo, ((Component)controller).transform.position);
				}
				MonoBehaviourSingleton<RoundManager>.Instance.EndRound();
			}
			if (RoundManager.OnZombiesLeftChanged != null)
			{
				RoundManager.OnZombiesLeftChanged();
			}
			if (RoundManager.OnZombieKilled != null)
			{
				RoundManager.OnZombieKilled(((Component)controller).gameObject);
			}
		}

		private IEnumerator DelayedCustomZombieDespawn(CustomZombieController controller)
		{
			if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial)
			{
				yield return (object)new WaitForSeconds(0f);
				SpecialZombiePool.Despawn(controller);
			}
			else
			{
				yield return (object)new WaitForSeconds(5f);
				NormalZombiePool.Despawn(controller);
			}
		}

		[HarmonyPatch(typeof(Sosig), "SosigDies")]
		[HarmonyPostfix]
		private static void OnSosigDied(Sosig __instance, DamageClass damClass, SosigDeathType deathType)
		{
			((Component)__instance).GetComponent<ZosigZombieController>().OnKill();
		}

		[HarmonyPatch(typeof(Sosig), "ProcessDamage", new Type[]
		{
			typeof(Damage),
			typeof(SosigLink)
		})]
		[HarmonyPrefix]
		private static void BeforeZombieHit(Damage d, SosigLink link)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)d.Class == 3 && d.Source_IFF != GM.CurrentSceneSettings.DefaultPlayerIFF)
			{
				d.Dam_Blinding = 0f;
				d.Dam_TotalKinetic = 0f;
				d.Dam_TotalEnergetic = 0f;
				d.Dam_Blunt = 0f;
				d.Dam_Chilling = 0f;
				d.Dam_Cutting = 0f;
				d.Dam_Thermal = 0f;
				d.Dam_EMP = 0f;
				d.Dam_Piercing = 0f;
				d.Dam_Stunning = 0f;
			}
		}

		[HarmonyPatch(typeof(Sosig), "ProcessDamage", new Type[]
		{
			typeof(Damage),
			typeof(SosigLink)
		})]
		[HarmonyPostfix]
		private static void AfterZombieHit(Sosig __instance, Damage d, SosigLink link)
		{
			((Component)__instance).GetComponent<ZosigZombieController>().OnHit(d);
		}
	}
}
namespace CustomScripts
{
	public class Blockade : MonoBehaviour, IPurchasable
	{
		public Action OnPurchase;

		public List<Transform> UnlockableZombieSpawnPoints;

		public List<Transform> UnlockableSpecialZombieSpawnPoints;

		public List<Text> CostTexts;

		public int Cost;

		[SerializeField]
		private bool _isOneTimeOnly = true;

		private bool _alreadyBought;

		private bool _alreadyUsed;

		public int PurchaseCost => Cost;

		public bool IsOneTimeOnly => _isOneTimeOnly;

		public bool AlreadyBought => _alreadyBought;

		private void OnValidate()
		{
			foreach (Text costText in CostTexts)
			{
				costText.text = Cost.ToString();
			}
		}

		public void Buy()
		{
			if (_alreadyUsed || !MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost))
			{
				return;
			}
			_alreadyUsed = true;
			foreach (Transform unlockableZombieSpawnPoint in UnlockableZombieSpawnPoints)
			{
				if (!MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.ZombieSpawnPoints.Contains(unlockableZombieSpawnPoint))
				{
					MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.ZombieSpawnPoints.Add(unlockableZombieSpawnPoint);
				}
			}
			foreach (Transform unlockableSpecialZombieSpawnPoint in UnlockableSpecialZombieSpawnPoints)
			{
				if (!MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.SpecialZombieSpawnPoints.Contains(unlockableSpecialZombieSpawnPoint))
				{
					MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.SpecialZombieSpawnPoints.Add(unlockableSpecialZombieSpawnPoint);
				}
			}
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BuySound, 0.5f);
			((Component)this).gameObject.SetActive(false);
			if (OnPurchase != null)
			{
				OnPurchase();
			}
		}
	}
	public class MysteryBox : MonoBehaviour, IPurchasable
	{
		public static Action<WeaponData> WeaponSpawnedEvent;

		public int Cost = 950;

		[SerializeField]
		private bool _isOneTimeOnly;

		private bool _alreadyBought;

		[HideInInspector]
		public List<WeaponData> LootId;

		[HideInInspector]
		public List<WeaponData> LimitedAmmoLootId;

		public ObjectSpawnPoint WeaponSpawner;

		public ObjectSpawnPoint AmmoSpawner;

		public AudioClip RollSound;

		[HideInInspector]
		public bool InUse = false;

		private MysteryBoxMover _mysteryBoxMover;

		public int PurchaseCost => Cost;

		public bool IsOneTimeOnly => _isOneTimeOnly;

		public bool AlreadyBought => _alreadyBought;

		private void Awake()
		{
			_mysteryBoxMover = ((Component)this).GetComponent<MysteryBoxMover>();
			RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(LoadWeaponPool));
		}

		private void LoadWeaponPool()
		{
			LootId = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.MysteryBoxPool;
			LimitedAmmoLootId = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.LimitedAmmoMysteryBoxPool;
		}

		public void SpawnWeapon()
		{
			if (!InUse && MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost))
			{
				InUse = true;
				MonoBehaviourSingleton<AudioManager>.Instance.Play(RollSound, 0.25f);
				((MonoBehaviour)this).StartCoroutine(DelayedSpawn());
			}
		}

		private IEnumerator DelayedSpawn()
		{
			yield return (object)new WaitForSeconds(5.5f);
			if (_mysteryBoxMover.TryTeleport())
			{
				_mysteryBoxMover.StartTeleportAnim();
				MonoBehaviourSingleton<GameManager>.Instance.AddPoints(Cost);
				yield break;
			}
			if (GameSettings.LimitedAmmo)
			{
				int index = Random.Range(0, LimitedAmmoLootId.Count);
				WeaponData weaponData = LimitedAmmoLootId[index];
				WeaponSpawner.ObjectId = weaponData.DefaultSpawners[0];
				WeaponSpawner.Spawn();
				AmmoSpawner.ObjectId = weaponData.DefaultSpawners[1];
				for (int i = 0; i < weaponData.LimitedAmmoMagazineCount; i++)
				{
					AmmoSpawner.Spawn();
				}
				if (WeaponSpawnedEvent != null)
				{
					WeaponSpawnedEvent(weaponData);
				}
			}
			else
			{
				int index2 = Random.Range(0, LootId.Count);
				WeaponData weaponData2 = LootId[index2];
				WeaponSpawner.ObjectId = weaponData2.DefaultSpawners[0];
				AmmoSpawner.ObjectId = weaponData2.DefaultSpawners[1];
				WeaponSpawner.Spawn();
				AmmoSpawner.Spawn();
				if (WeaponSpawnedEvent != null)
				{
					WeaponSpawnedEvent(weaponData2);
				}
			}
			InUse = false;
			_mysteryBoxMover.CurrentRoll++;
		}

		private void OnDestroy()
		{
			RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(LoadWeaponPool));
		}
	}
	public class MysteryBoxMover : MonoBehaviour
	{
		public List<Transform> SpawnPoints;

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

		public int SafeRollsProvided = 3;

		public AudioClip TeddyBearSound;

		public AudioClip SecretTeddyBearSound;

		public Transform TeddyBear;

		[HideInInspector]
		public Transform CurrentPos;

		[HideInInspector]
		public int CurrentRoll = 0;

		private Animator _animator;

		private MysteryBox _mysteryBox;

		private Transform _parent;

		private void Awake()
		{
			_parent = ((Component)this).transform.parent;
			_animator = ((Component)_parent).GetComponent<Animator>();
			_mysteryBox = ((Component)this).GetComponent<MysteryBox>();
		}

		private void Start()
		{
			Teleport(firstTime: true);
		}

		public void Teleport(bool firstTime = false)
		{
			//IL_0057: 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)
			Transform val = SpawnPoints[Random.Range(0, SpawnPoints.Count)];
			if (!firstTime)
			{
				SpawnPoints.Add(CurrentPos);
			}
			CurrentPos = val;
			SpawnPoints.Remove(val);
			((Component)_parent).transform.position = val.position;
			((Component)_parent).transform.rotation = val.rotation;
			CurrentRoll = 0;
			_mysteryBox.InUse = false;
		}

		public bool TryTeleport()
		{
			if (CurrentRoll <= SafeRollsProvided)
			{
				return false;
			}
			return (float)Random.Range(0, 100) <= TeleportChance;
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)104))
			{
				StartTeleportAnim();
			}
		}

		public void StartTeleportAnim()
		{
			GameObject gameObject;
			if (Random.Range(0, 5801) == 0)
			{
				gameObject = ((Component)TeddyBear.GetChild(1)).gameObject;
				MonoBehaviourSingleton<AudioManager>.Instance.Play(SecretTeddyBearSound);
			}
			else
			{
				gameObject = ((Component)TeddyBear.GetChild(0)).gameObject;
				MonoBehaviourSingleton<AudioManager>.Instance.Play(TeddyBearSound);
			}
			((Component)TeddyBear).GetComponent<Animator>().Play("Activation");
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DelayedAnimation(gameObject));
		}

		private IEnumerator DelayedAnimation(GameObject teddy)
		{
			yield return (object)new WaitForSeconds(3f);
			teddy.SetActive(false);
			yield return (object)new WaitForSeconds(1.2f);
			_animator.Play("Teleport");
			((MonoBehaviour)this).StartCoroutine(DelayedTeleport());
		}

		private IEnumerator DelayedTeleport()
		{
			yield return (object)new WaitForSeconds(4.2f);
			Teleport();
		}
	}
	public class QuestionMarkBlinking : MonoBehaviour
	{
		public Renderer QuestionMark1;

		public Renderer QuestionMark2;

		private float _emissionValue;

		private int _emissionWeight;

		private bool _emit;

		private float _time;

		private void Awake()
		{
			_emissionWeight = Shader.PropertyToID("_EmissionWeight");
		}

		private void Update()
		{
			if (_emit)
			{
				if (_time >= 1.5f)
				{
					_emit = false;
					((MonoBehaviour)this).StartCoroutine(SmoothEmissionChange(0f, 1f, 1f));
					_time = 0f;
				}
			}
			else if (_time >= 3f)
			{
				_emit = true;
				((MonoBehaviour)this).StartCoroutine(SmoothEmissionChange(1f, 0f, 1f));
				_time = 0f;
			}
			_time += Time.deltaTime;
		}

		private IEnumerator SmoothEmissionChange(float startValue, float endValue, float duration)
		{
			float elapsed = 0f;
			while (elapsed < duration)
			{
				_emissionValue = Mathf.Lerp(startValue, endValue, elapsed / duration);
				elapsed += Time.deltaTime;
				QuestionMark1.sharedMaterial.SetFloat(_emissionWeight, _emissionValue);
				QuestionMark2.sharedMaterial.SetFloat(_emissionWeight, _emissionValue);
				yield return null;
			}
			_emissionValue = endValue;
			QuestionMark1.sharedMaterial.SetFloat(_emissionWeight, _emissionValue);
			QuestionMark2.sharedMaterial.SetFloat(_emissionWeight, _emissionValue);
		}
	}
}
namespace CustomScripts.Objects
{
	public class Radio : MonoBehaviour, IFVRDamageable
	{
		public AudioClip Song;

		private bool _isThrottled;

		private bool _isPlaying;

		private Coroutine _musicEndCoroutine;

		private void Awake()
		{
			GameSettings.OnMusicSettingChanged = (Action)Delegate.Combine(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingsChanged));
		}

		private void OnMusicSettingsChanged()
		{
			_isPlaying = false;
			if (_musicEndCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(_musicEndCoroutine);
			}
		}

		private void Update()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			if (Input.GetKeyDown((KeyCode)99))
			{
				Damage dam = new Damage();
				Damage(dam);
			}
			if (Input.GetKeyDown((KeyCode)118))
			{
				MonoBehaviourSingleton<GameSettings>.Instance.ToggleBackgroundMusic();
			}
		}

		public void Damage(Damage dam)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)dam.Class == 2 || _isThrottled)
			{
				return;
			}
			if (_isPlaying)
			{
				_isPlaying = false;
				MonoBehaviourSingleton<AudioManager>.Instance.MusicAudioSource.Stop();
				if (GameSettings.BackgroundMusic)
				{
					MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.Music, 0.08f);
				}
				if (_musicEndCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(_musicEndCoroutine);
				}
			}
			else
			{
				_isPlaying = true;
				float length = Song.length;
				_musicEndCoroutine = ((MonoBehaviour)this).StartCoroutine(OnMusicEnd(length));
				MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(Song, 0.095f);
			}
			((MonoBehaviour)this).StartCoroutine(Throttle());
		}

		private IEnumerator Throttle()
		{
			_isThrottled = true;
			yield return (object)new WaitForSeconds(0.5f);
			_isThrottled = false;
		}

		private IEnumerator OnMusicEnd(float endTimer)
		{
			yield return (object)new WaitForSeconds(endTimer);
			_isPlaying = false;
			if (GameSettings.BackgroundMusic)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.Music, 0.08f);
			}
		}

		private void OnDestroy()
		{
			GameSettings.OnMusicSettingChanged = (Action)Delegate.Remove(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingsChanged));
		}
	}
}
namespace CustomScripts
{
	public class StatPanel : MonoBehaviour
	{
		public Text RoundText;

		public Text PointsText;

		public Text LeftText;

		private void Start()
		{
			GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdatePointsText));
			GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(UpdatePointsText));
			RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(UpdateRoundText));
			RoundManager.OnRoundChanged = (Action)Delegate.Combine(RoundManager.OnRoundChanged, new Action(UpdateRoundText));
			RoundManager.OnZombiesLeftChanged = (Action)Delegate.Remove(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText));
			RoundManager.OnZombiesLeftChanged = (Action)Delegate.Combine(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText));
			UpdateRoundText();
			UpdatePointsText();
		}

		private void OnDestroy()
		{
			GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdatePointsText));
			RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(UpdateRoundText));
			RoundManager.OnZombiesLeftChanged = (Action)Delegate.Remove(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText));
		}

		private void UpdateRoundText()
		{
			RoundText.text = "Round:\n" + MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber;
		}

		private void UpdatePointsText()
		{
			PointsText.text = "Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.Points;
		}

		private void UpdateLeftText()
		{
			LeftText.text = "Left:\n" + MonoBehaviourSingleton<ZombieManager>.Instance.ZombiesRemaining;
		}
	}
}
namespace CustomScripts.Objects
{
	public class WallShop : MonoBehaviour, IPurchasable
	{
		[Header("LootPool asset defines which weapon can be purchased")]
		public int ID;

		private const int AMMO_SPAWNER_ID = 1;

		public bool ExistsInLimitedAmmo = true;

		public bool ExistsInSpawnlock = true;

		[HideInInspector]
		public int Cost;

		[SerializeField]
		private bool _isOneTimeOnly;

		private bool _alreadyBought;

		public Text NameText;

		public Text CostText;

		public List<ObjectSpawnPoint> ItemSpawners;

		[HideInInspector]
		public WeaponData Weapon;

		public bool SameRebuy = false;

		[HideInInspector]
		public bool IsFree;

		public int PurchaseCost => Cost;

		public bool IsOneTimeOnly => _isOneTimeOnly;

		public bool AlreadyBought => _alreadyBought;

		private void Awake()
		{
			RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(OnRoundStarted));
		}

		private void OnDestroy()
		{
			RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnRoundStarted));
		}

		private void LoadWeapon()
		{
			if (ID >= MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.WallShopsPool.Count)
			{
				((Component)this).gameObject.SetActive(false);
				return;
			}
			Weapon = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.WallShopsPool[ID];
			Cost = Weapon.Price;
			NameText.text = Weapon.DisplayName;
			CostText.text = Cost.ToString();
		}

		private void OnRoundStarted()
		{
			if (GameSettings.LimitedAmmo && !ExistsInLimitedAmmo)
			{
				((Component)this).gameObject.SetActive(false);
			}
			if (!GameSettings.LimitedAmmo && !ExistsInSpawnlock)
			{
				((Component)this).gameObject.SetActive(false);
			}
			LoadWeapon();
		}

		public void TryBuying()
		{
			if (!IsFree && !MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost))
			{
				return;
			}
			IsFree = false;
			if (GameSettings.LimitedAmmo && !SameRebuy)
			{
				if (!_alreadyBought)
				{
					for (int i = 0; i < Weapon.DefaultSpawners.Count; i++)
					{
						if (i != 1)
						{
							ItemSpawners[i].ObjectId = Weapon.DefaultSpawners[i];
							ItemSpawners[i].Spawn();
						}
					}
				}
				if (SameRebuy)
				{
					for (int j = 0; j < Weapon.DefaultSpawners.Count; j++)
					{
						ItemSpawners[j].ObjectId = Weapon.DefaultSpawners[j];
						ItemSpawners[j].Spawn();
					}
				}
				else
				{
					ItemSpawners[1].ObjectId = Weapon.DefaultSpawners[1];
					((MonoBehaviour)this).StartCoroutine(DelayedAmmoSpawn());
				}
				Cost = Weapon.AmmoBuyCost;
				CostText.text = Weapon.AmmoBuyCost.ToString();
			}
			else
			{
				for (int k = 0; k < Weapon.DefaultSpawners.Count; k++)
				{
					ItemSpawners[k].ObjectId = Weapon.DefaultSpawners[k];
					ItemSpawners[k].Spawn();
				}
			}
			if (!_alreadyBought)
			{
				_alreadyBought = true;
			}
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BuySound, 0.5f);
		}

		private IEnumerator DelayedAmmoSpawn()
		{
			for (int i = 0; i < Weapon.LimitedAmmoMagazineCount; i++)
			{
				ItemSpawners[1].Spawn();
				yield return (object)new WaitForSeconds(0.15f);
			}
		}
	}
}
namespace CustomScripts.Objects.Weapons
{
	[CreateAssetMenu(fileName = "WeaponData")]
	public class WeaponData : ScriptableObject
	{
		[Tooltip("Used by WallShop")]
		public string DisplayName;

		[Tooltip("No real use in the code btw")]
		public string Description;

		[Tooltip("First is always weapon, second is always ammo (if exists)")]
		public List<string> DefaultSpawners;

		[Tooltip("Result of pack a punching")]
		public WeaponData UpgradedWeapon;

		[Tooltip("How many magazines spawn in the limited ammo mode")]
		public int LimitedAmmoMagazineCount = 0;

		[Tooltip("How much does the weapon cost in the Wallshop")]
		public int Price;

		[Tooltip("How much does ammo cost in the limited ammo mode (Wall rebuy)")]
		public int AmmoBuyCost = 0;

		public string Id => DefaultSpawners[0];
	}
}
namespace CustomScripts
{
	public class DropPlankZone : MonoBehaviour
	{
		private void OnTriggerExit(Collider other)
		{
			Plank component = ((Component)other).GetComponent<Plank>();
			if (Object.op_Implicit((Object)(object)component))
			{
				((FVRInteractiveObject)component.PhysicalObject).ForceBreakInteraction();
				component.ReturnToRest();
			}
		}
	}
	public class Plank : MonoBehaviour
	{
		[HideInInspector]
		public FVRPhysicalObject PhysicalObject;

		public Transform RestTransform;

		private void Awake()
		{
			PhysicalObject = ((Component)this).GetComponent<FVRPhysicalObject>();
		}

		public void ReturnToRest()
		{
			((MonoBehaviour)this).StartCoroutine(MoveTo(RestTransform, 0.5f));
		}

		public void OnRepairDrop(Transform destination)
		{
			((MonoBehaviour)this).StartCoroutine(MoveTo(destination, 0.2f));
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BarricadeRepairSound, 0.5f);
		}

		public IEnumerator MoveTo(Transform destination, float time)
		{
			Vector3 startingPos = ((Component)this).transform.position;
			Vector3 finalPos = destination.position;
			Quaternion startingRot = ((Component)this).transform.rotation;
			Quaternion finalRot = destination.rotation;
			float elapsedTime = 0f;
			while (elapsedTime < time)
			{
				((Component)this).transform.position = Vector3.Lerp(startingPos, finalPos, elapsedTime / time);
				((Component)this).transform.rotation = Quaternion.Lerp(startingRot, finalRot, elapsedTime / time);
				elapsedTime += Time.deltaTime;
				yield return null;
			}
			((Component)this).transform.position = finalPos;
			((Component)this).transform.rotation = finalRot;
		}
	}
	public class Window : MonoBehaviour
	{
		public static Action BarricadedEvent;

		public Transform ZombieWaypoint;

		public List<WindowPlank> PlankSlots;

		public List<Plank> AllPlanks;

		private AudioSource _tearPlankAudio;

		public int PlanksRemain { get; set; }

		public bool IsOpen => PlanksRemain == 0;

		private void Start()
		{
			_tearPlankAudio = ((Component)this).GetComponent<AudioSource>();
			RepairAll();
		}

		private void OnTriggerEnter(Collider other)
		{
			if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<Plank>()))
			{
				OnPlankTouch(((Component)other).GetComponent<Plank>());
			}
		}

		public void RepairAll(bool playSound = false)
		{
			//IL_0048: 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)
			for (int i = 0; i < PlankSlots.Count; i++)
			{
				PlankSlots[i].Plank = AllPlanks[i];
				((Component)AllPlanks[i]).transform.position = ((Component)PlankSlots[i]).transform.position;
				((Component)AllPlanks[i]).transform.rotation = ((Component)PlankSlots[i]).transform.rotation;
				((FVRInteractiveObject)AllPlanks[i].PhysicalObject).ForceBreakInteraction();
				AllPlanks[i].PhysicalObject.IsPickUpLocked = true;
			}
			PlanksRemain = PlankSlots.Count;
			if (playSound)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BarricadeRepairSound, 0.5f);
			}
		}

		public void OnPlankTouch(Plank plank)
		{
			if (BarricadedEvent != null && MonoBehaviourSingleton<GameManager>.Instance.GameStarted)
			{
				BarricadedEvent();
			}
			if (MonoBehaviourSingleton<PlayerData>.Instance.SpeedColaPerkActivated)
			{
				RepairAll(playSound: true);
				return;
			}
			WindowPlank windowPlank = PlankSlots.FirstOrDefault((WindowPlank x) => (Object)(object)x.Plank == (Object)null);
			if (!Object.op_Implicit((Object)(object)windowPlank))
			{
				RepairAll();
				return;
			}
			windowPlank.Plank = plank;
			((FVRInteractiveObject)plank.PhysicalObject).ForceBreakInteraction();
			plank.PhysicalObject.IsPickUpLocked = true;
			plank.OnRepairDrop(((Component)windowPlank).transform);
			PlanksRemain++;
		}

		public void OnPlankRipped()
		{
			WindowPlank windowPlank = PlankSlots.LastOrDefault((WindowPlank x) => (Object)(object)x.Plank != (Object)null);
			if (Object.op_Implicit((Object)(object)windowPlank))
			{
				Plank plank = windowPlank.Plank;
				plank.ReturnToRest();
				FVRPhysicalObject component = ((Component)plank).GetComponent<FVRPhysicalObject>();
				component.IsPickUpLocked = false;
				windowPlank.Plank = null;
				_tearPlankAudio.Play();
				PlanksRemain--;
			}
		}
	}
}
namespace CustomScripts.Objects.Windows
{
	public class WindowPlank : MonoBehaviour
	{
		public Plank Plank;
	}
}
namespace CustomScripts
{
	public class WindowTrigger : MonoBehaviour
	{
		public Window Window;
	}
	public class DeadShotPerkBottle : MonoBehaviour, IModifier
	{
		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.DeadShotPerkActivated = true;
			if (!GameSettings.UseCustomEnemies)
			{
				for (int i = 0; i < MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count; i++)
				{
					(MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[i] as ZosigZombieController).CheckPerks();
				}
			}
			else
			{
				for (int j = 0; j < MonoBehaviourSingleton<ZombieManager>.Instance.AllCustomZombies.Count; j++)
				{
					CapsuleCollider component = (MonoBehaviourSingleton<ZombieManager>.Instance.AllCustomZombies[j] as CustomZombieController).HeadObject.GetComponent<CapsuleCollider>();
					component.radius *= 1.375f;
				}
			}
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class DoubleTapPerkBottle : MonoBehaviour, IModifier
	{
		public float DamageMultiplier = 1.5f;

		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.DoubleTapPerkActivated = true;
			if (!GameSettings.UseCustomEnemies)
			{
				for (int i = 0; i < MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count; i++)
				{
					(MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[i] as ZosigZombieController).CheckPerks();
				}
			}
			FVRInteractiveObject currentInteractable = MonoBehaviourSingleton<PlayerData>.Instance.LeftHand.CurrentInteractable;
			FVRFireArm val = (FVRFireArm)(object)((currentInteractable is FVRFireArm) ? currentInteractable : null);
			if ((Object)(object)val != (Object)null)
			{
				((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed();
			}
			FVRInteractiveObject currentInteractable2 = MonoBehaviourSingleton<PlayerData>.Instance.RightHand.CurrentInteractable;
			val = (FVRFireArm)(object)((currentInteractable2 is FVRFireArm) ? currentInteractable2 : null);
			if ((Object)(object)val != (Object)null)
			{
				((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed();
			}
			MonoBehaviourSingleton<PlayerData>.Instance.DamageModifier *= DamageMultiplier;
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class ElectricCherryPerkBottle : MonoBehaviour, IModifier
{
	public void ApplyModifier()
	{
		MonoBehaviourSingleton<PlayerData>.Instance.ElectricCherryPerkActivated = true;
		MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}
}
namespace CustomScripts
{
	public class JuggerNogPerkBottle : MonoBehaviour, IModifier
	{
		public static Action ConsumedEvent;

		public float NewHealth = 10000f;

		public void ApplyModifier()
		{
			GM.CurrentPlayerBody.SetHealthThreshold(NewHealth);
			GM.CurrentPlayerBody.ResetHealth();
			if (ConsumedEvent != null)
			{
				ConsumedEvent();
			}
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
namespace CustomScripts.Powerups.Perks
{
	public class MuleKickPerkBottle : MonoBehaviour, IModifier
	{
		public ObjectSpawnPoint Spawner;

		public string ObjectID;

		public GameObject Model;

		public void ApplyModifier()
		{
			Spawner.ObjectId = ObjectID;
			Spawner.Spawn();
			((Component)this).GetComponent<FVRPhysicalObject>().IsPickUpLocked = true;
			((FVRInteractiveObject)((Component)this).GetComponent<FVRPhysicalObject>()).ForceBreakInteraction();
			((Component)this).GetComponent<Collider>().enabled = false;
			Model.SetActive(false);
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject, 1f);
		}
	}
	public class PHDFlopperPerkBottle : MonoBehaviour, IModifier
	{
		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.PHDFlopperPerkActivated = true;
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
namespace CustomScripts
{
	public class PerkShop : MonoBehaviour, IPurchasable, IRequiresPower
	{
		public AudioSource PurchaseJingle;

		public int Cost;

		[SerializeField]
		private bool _isOneTimeOnly = true;

		private bool _alreadyBought;

		public GameObject Bottle;

		public Transform SpawnPoint;

		private bool alreadyUsed = false;

		public int PurchaseCost => Cost;

		public bool IsOneTimeOnly => _isOneTimeOnly;

		public bool AlreadyBought => _alreadyBought;

		public bool IsPowered => MonoBehaviourSingleton<GameManager>.Instance.PowerEnabled;

		public void TryBuying()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			if (!alreadyUsed && IsPowered && MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost))
			{
				alreadyUsed = true;
				Bottle.transform.position = SpawnPoint.position;
				PurchaseJingle.Play();
			}
		}
	}
}
namespace CustomScripts.Powerups.Perks
{
	public class QuickRevivePerkBottle : MonoBehaviour, IModifier
	{
		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.QuickRevivePerkActivated = true;
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class SpeedColaPerkBottle : MonoBehaviour, IModifier
	{
		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.SpeedColaPerkActivated = true;
			FVRInteractiveObject currentInteractable = MonoBehaviourSingleton<PlayerData>.Instance.LeftHand.CurrentInteractable;
			FVRFireArm val = (FVRFireArm)(object)((currentInteractable is FVRFireArm) ? currentInteractable : null);
			if ((Object)(object)val != (Object)null)
			{
				((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed();
			}
			FVRInteractiveObject currentInteractable2 = MonoBehaviourSingleton<PlayerData>.Instance.RightHand.CurrentInteractable;
			val = (FVRFireArm)(object)((currentInteractable2 is FVRFireArm) ? currentInteractable2 : null);
			if ((Object)(object)val != (Object)null)
			{
				((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed();
			}
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class StaminUpPerkBottle : MonoBehaviour, IModifier
	{
		public static Action ConsumedEvent;

		public void ApplyModifier()
		{
			MonoBehaviourSingleton<PlayerData>.Instance.StaminUpPerkActivated = true;
			GM.CurrentSceneSettings.MaxSpeedClamp = 6f;
			MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
namespace CustomScripts.Objects
{
	public class ElectroTrap : MonoBehaviour, IPurchasable, IRequiresPower, ITrap
	{
		public Blockade RequiredBlockade;

		public GameObject LeversCanvases;

		public int Cost;

		[SerializeField]
		private bool _isOneTimeOnly;

		private bool _alreadyBought;

		public float EnabledTime;

		public float PlayerTouchDamage;

		public ParticleSystem ElectricityPS;

		public AudioSource ElectricityAudio;

		public Collider DamageTrigger;

		public GameObject PlayerBlocker;

		public List<Text> CanvasCostTexts;

		private bool _activated = false;

		private bool _damageThrottled = false;

		public int PurchaseCost => Cost;

		public bool IsOneTimeOnly => _isOneTimeOnly;

		public bool AlreadyBought => _alreadyBought;

		public bool IsPowered => MonoBehaviourSingleton<GameManager>.Instance.PowerEnabled;

		private void OnValidate()
		{
			for (int i = 0; i < CanvasCostTexts.Count; i++)
			{
				CanvasCostTexts[i].text = Cost.ToString();
			}
		}

		private void Awake()
		{
			if (Object.op_Implicit((Object)(object)RequiredBlockade))
			{
				LeversCanvases.SetActive(false);
				Blockade requiredBlockade = RequiredBlockade;
				requiredBlockade.OnPurchase = (Action)Delegate.Combine(requiredBlockade.OnPurchase, new Action(EnableLevers));
			}
		}

		private void EnableLevers()
		{
			LeversCanvases.SetActive(true);
			Blockade requiredBlockade = RequiredBlockade;
			requiredBlockade.OnPurchase = (Action)Delegate.Remove(requiredBlockade.OnPurchase, new Action(EnableLevers));
		}

		public void OnEnemyEntered(ZombieController controller)
		{
			controller.OnHit(99999f, headHit: true);
		}

		private void OnTriggerEnter(Collider other)
		{
			if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<PlayerCollider>()) && !_damageThrottled)
			{
				MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.PlayerHitSound);
				FVRPlayerBody currentPlayerBody = GM.CurrentPlayerBody;
				currentPlayerBody.Health -= PlayerTouchDamage;
				if (GM.CurrentPlayerBody.Health <= 0f)
				{
					MonoBehaviourSingleton<GameManager>.Instance.KillPlayer();
				}
				((MonoBehaviour)this).StartCoroutine(ThrottleDamage());
			}
		}

		public void OnLeverPull()
		{
			if (!_activated && IsPowered && MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost))
			{
				ActivateTrap();
			}
		}

		private void ActivateTrap()
		{
			_activated = true;
			ElectricityPS.Play(true);
			ElectricityAudio.Play();
			PlayerBlocker.SetActive(true);
			DamageTrigger.enabled = true;
			((MonoBehaviour)this).StartCoroutine(DelayedDeactivateTrap());
		}

		private IEnumerator DelayedDeactivateTrap()
		{
			yield return (object)new WaitForSeconds(EnabledTime);
			_activated = false;
			ElectricityPS.Stop(true);
			ElectricityAudio.Stop();
			PlayerBlocker.SetActive(false);
			DamageTrigger.enabled = false;
		}

		private IEnumerator ThrottleDamage()
		{
			_damageThrottled = true;
			yield return (object)new WaitForSeconds(1.5f);
			_damageThrottled = false;
		}

		private void OnDestroy()
		{
			if (Object.op_Implicit((Object)(object)RequiredBlockade))
			{
				Blockade requiredBlockade = RequiredBlockade;
				requiredBlockade.OnPurchase = (Action)Delegate.Remove(requiredBlockade.OnPurchase, new Action(EnableLevers));
			}
		}
	}
}
public class MagazineBox : FVRPhysicalObject
{
	public Sprite EmptySprite;

	[SerializeField]
	private Text _magazineNameText;

	[SerializeField]
	private Text _magazineCountText;

	[SerializeField]
	private Image _magazineImage;

	private Stack<FVRFireArmMagazine> _magazines = new Stack<FVRFireArmMagazine>();

	private bool IsEmpty => _magazines.Count == 0;

	private FVRFireArmMagazine CurrentMagazine => _magazines.Peek();

	public override void BeginInteraction(FVRViveHand hand)
	{
		if ((double)hand.Input.TriggerFloat > 0.5)
		{
			RetrieveMagazine(hand);
		}
		else
		{
			((FVRPhysicalObject)this).BeginInteraction(hand);
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Expected O, but got Unknown
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<FVRViveHand>()))
		{
			FVRViveHand component = ((Component)other).GetComponent<FVRViveHand>();
			if (component.IsThisTheRightHand)
			{
				component.Trigger_Button.RemoveOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)2);
				component.Trigger_Button.AddOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)2);
			}
			else
			{
				component.Trigger_Button.RemoveOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)1);
				component.Trigger_Button.AddOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)1);
			}
		}
	}

	private void OnTriggerExit(Collider other)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<FVRViveHand>()))
		{
			FVRViveHand component = ((Component)other).GetComponent<FVRViveHand>();
			if (component.IsThisTheRightHand)
			{
				component.Trigger_Button.RemoveOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)2);
			}
			else
			{
				component.Trigger_Button.RemoveOnStateUpListener(new StateUpHandler(TryPlacing), (SteamVR_Input_Sources)1);
			}
		}
	}

	private void TryPlacing(SteamVR_Action_Boolean fromaction, SteamVR_Input_Sources fromsource)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Invalid comparison between Unknown and I4
		FVRViveHand val = (((int)fromsource == 2) ? GM.CurrentMovementManager.Hands[1] : GM.CurrentMovementManager.Hands[0]);
		if (!((Object)(object)val.CurrentInteractable == (Object)null))
		{
			FVRFireArmMagazine component = ((Component)val.CurrentInteractable).GetComponent<FVRFireArmMagazine>();
			if (!((Object)(object)component == (Object)null) && (IsEmpty || (!IsEmpty && IsMagazineCompatible(component))))
			{
				AddMagazine(component);
			}
		}
	}

	private void RetrieveMagazine(FVRViveHand hand)
	{
		if (!IsEmpty)
		{
			FVRFireArmMagazine val = _magazines.Pop();
			((Component)val).gameObject.SetActive(true);
			hand.RetrieveObject((FVRPhysicalObject)(object)val);
			UpdateUI();
		}
	}

	public void AddMagazine(FVRFireArmMagazine magazine)
	{
		_magazines.Push(magazine);
		((Component)magazine).gameObject.SetActive(false);
		UpdateUI();
	}

	private bool IsMagazineCompatible(FVRFireArmMagazine magazine)
	{
		return ((FVRPhysicalObject)CurrentMagazine).ObjectWrapper.SpawnedFromId == ((FVRPhysicalObject)magazine).ObjectWrapper.SpawnedFromId;
	}

	private void UpdateUI()
	{
		if (IsEmpty)
		{
			_magazineNameText.text = "None";
			_magazineCountText.text = "0";
			_magazineImage.sprite = EmptySprite;
		}
		else
		{
			_magazineNameText.text = IM.GetSpawnerID(((FVRPhysicalObject)CurrentMagazine).ObjectWrapper.SpawnedFromId).DisplayName;
			_magazineCountText.text = _magazines.Count.ToString();
			_magazineImage.sprite = IM.GetSpawnerID(((FVRPhysicalObject)CurrentMagazine).ObjectWrapper.SpawnedFromId).Sprite;
		}
	}
}
public class Pause : MonoBehaviour
{
	[SerializeField]
	private GameObject _pauseWrapper;

	[SerializeField]
	private GameObject _playerBlocker;

	[SerializeField]
	private Text _isPausedText;

	private bool _isPaused;

	private void Awake()
	{
		if (Object.op_Implicit((Object)(object)_playerBlocker))
		{
			_playerBlocker.SetActive(false);
		}
		RoundManager.RoundEnded = (Action)Delegate.Combine(RoundManager.RoundEnded, new Action(Show));
		RoundManager.RoundStarted = (Action)Delegate.Combine(RoundManager.RoundStarted, new Action(Hide));
		_isPausedText.text = "Disabled";
		Hide();
	}

	private void Show()
	{
		_pauseWrapper.SetActive(true);
	}

	private void Hide()
	{
		_pauseWrapper.SetActive(false);
	}

	public void OnLeverPull()
	{
		if (_isPaused)
		{
			MonoBehaviourSingleton<RoundManager>.Instance.ResumeGame();
			_isPaused = false;
			if (Object.op_Implicit((Object)(object)_playerBlocker))
			{
				_playerBlocker.SetActive(false);
			}
			_isPausedText.text = "Disabled";
		}
		else
		{
			MonoBehaviourSingleton<RoundManager>.Instance.PauseGame();
			_isPaused = true;
			if (Object.op_Implicit((Object)(object)_playerBlocker))
			{
				_playerBlocker.SetActive(true);
			}
			_isPausedText.text = "Enabled";
		}
	}

	private void OnDestroy()
	{
		RoundManager.RoundEnded = (Action)Delegate.Remove(RoundManager.RoundEnded, new Action(Show));
		RoundManager.RoundStarted = (Action)Delegate.Remove(RoundManager.RoundStarted, new Action(Hide));
	}
}
namespace CustomScripts
{
	public class PlayerCollider : MonoBehaviour
	{
		public LayerMask EnemyLayer;

		private Transform _transform;

		private List<CustomZombieController> _touchingZombies = new List<CustomZombieController>();

		private Coroutine _dealDamageCoroutine;

		private const float DamageInterval = 1.5f;

		private float _damageTimer;

		private void Awake()
		{
			_transform = ((Component)this).transform;
		}

		private void Update()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or mi