Decompiled source of Tokar LMG Liminal Influenza NEXT v1.0.1

Tokar_LMG_Liminal_Influenza_NEXT.dll

Decompiled a year 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.Text.RegularExpressions;
using AOT;
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.Zombie;
using FistVR;
using GunGame.Scripts;
using GunGame.Scripts.Options;
using GunGame.Scripts.Weapons;
using HarmonyLib;
using LuxWater;
using OtherLoader;
using Plawius.NonConvexCollider;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Assertions;
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 StartSpawner : MonoBehaviour
	{
		public ItemSpawner WeaponSpawner;

		public ItemSpawner AmmoSpawner;

		public void Spawn()
		{
			WeaponSpawner.SpawnItem();
			AmmoSpawner.SpawnItem();
			if (GameSettings.LimitedAmmo)
			{
				AmmoSpawner.SpawnItem();
				AmmoSpawner.SpawnItem();
			}
		}
	}
}
public class CustomDebug : GunGame.Scripts.MonoBehaviourSingleton<CustomDebug>
{
	public Text DebugWeaponText;

	public Text DebugAmmoText;
}
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;
		}
	}
}
namespace GunGame.Scripts
{
	public class CustomSosigSpawner : MonoBehaviour
	{
		public SosigEnemyID SosigType;

		public SosigOrder SpawnState;

		public int IFF;

		public Sosig Spawn()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			SpawnOptions val = new SpawnOptions();
			val.SpawnActivated = true;
			val.SpawnState = SpawnState;
			val.IFF = IFF;
			val.SpawnWithFullAmmo = true;
			val.EquipmentMode = (EquipmentSlots)7;
			val.SosigTargetPosition = ((Component)this).transform.position;
			val.SosigTargetRotation = ((Component)this).transform.eulerAngles;
			SpawnOptions val2 = val;
			SosigEnemyTemplate val3 = ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType];
			return SosigAPI.Spawn(val3, val2, ((Component)this).transform.position, ((Component)this).transform.rotation);
		}

		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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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)
			Gizmos.color = new Color(0.8f, 0.2f, 0.2f, 0.5f);
			Gizmos.DrawSphere(((Component)this).transform.position, 0.1f);
			Gizmos.DrawLine(((Component)this).transform.position, ((Component)this).transform.position + ((Component)this).transform.forward * 0.25f);
		}
	}
}
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 GunGame.Scripts
{
	public class EndArea : MonoBehaviour
	{
		public Text TimeText;

		public Text KillsText;

		public Text DeathsText;

		public Transform EndPos;

		public void EndGame()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			GM.CurrentMovementManager.TeleportToPoint(EndPos.position, true, ((Component)this).transform.position + ((Component)this).transform.forward);
			foreach (Transform playerSpawner in MonoBehaviourSingleton<GameManager>.Instance.PlayerSpawners)
			{
				((Component)playerSpawner).transform.position = EndPos.position;
			}
			KillsText.text = "Kills: " + MonoBehaviourSingleton<GameManager>.Instance.Kills;
			DeathsText.text = "Deaths: " + MonoBehaviourSingleton<GameManager>.Instance.Deaths;
			TimeSpan timeSpan = TimeSpan.FromSeconds(MonoBehaviourSingleton<GameManager>.Instance.GameTime);
			TimeText.text = "Time: " + timeSpan.Hours.ToString("00") + ":" + timeSpan.Minutes.ToString("00") + ":" + timeSpan.Seconds.ToString("00");
		}
	}
}
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 GunGame.Scripts
{
	public class GameManager : MonoBehaviourSingleton<GameManager>
	{
		[HideInInspector]
		public int Kills;

		[HideInInspector]
		public int Deaths;

		[HideInInspector]
		public bool GameEnded;

		public EndArea EndArea;

		public static Action BeforeGameStartedEvent;

		public static Action GameStartedEvent;

		public PlayerSpawner PlayerSpawner;

		public List<Transform> PlayerSpawners;

		private Progression _progression;

		private Harmony _harmony;

		private float _timer;

		public float GameTime => Time.time - _timer;

		public override void Awake()
		{
			base.Awake();
			_progression = ((Component)this).GetComponent<Progression>();
			_harmony = Harmony.CreateAndPatchAll(typeof(PlayerSpawner), (string)null);
			_harmony.PatchAll(typeof(SosigBehavior));
			_harmony.PatchAll(typeof(Progression));
		}

		public void StartGame()
		{
			GameEnded = false;
			if (BeforeGameStartedEvent != null)
			{
				BeforeGameStartedEvent();
			}
			_progression.SpawnAndEquip();
			PlayerSpawner.MovePlayerToRandomSpawn();
			if (GameStartedEvent != null)
			{
				GameStartedEvent();
			}
			_timer = Time.time;
		}

		public void RemovePausedTime(float timePaused)
		{
			_timer += timePaused;
		}

		public void EndGame()
		{
			EndArea.EndGame();
			GameEnded = true;
		}

		public void DebugAdvanceWeapon()
		{
			_progression.Promote();
		}

		public void DebugPreviousWeapon()
		{
			_progression.Demote();
		}

		public void DebugTeleport()
		{
			PlayerSpawner.MovePlayerToRandomSpawn();
		}

		public void DebugStart()
		{
			if (BeforeGameStartedEvent != null)
			{
				BeforeGameStartedEvent();
			}
			_progression.SpawnAndEquip();
			if (GameStartedEvent != null)
			{
				GameStartedEvent();
			}
			_timer = Time.time;
		}

		private void OnDestroy()
		{
			_harmony.UnpatchSelf();
		}
	}
}
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).GetComponentInChildren<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 GunsLeftUI : MonoBehaviour
{
	private Text _gunsLeftText;

	private void Awake()
	{
		_gunsLeftText = ((Component)this).GetComponent<Text>();
		Progression.WeaponChangedEvent = (Action)Delegate.Combine(Progression.WeaponChangedEvent, new Action(UpdateUI));
	}

	private void UpdateUI()
	{
		int num = Mathf.Min(GunGame.Scripts.Options.GameSettings.CurrentPool.Guns.Count, WeaponCountOption.WeaponCount);
		int num2 = GunGame.Scripts.MonoBehaviourSingleton<Progression>.Instance.CurrentWeaponId + 1;
		int num3 = num - num2;
		_gunsLeftText.text = "Guns left: " + num3;
	}

	private void OnDestroy()
	{
		Progression.WeaponChangedEvent = (Action)Delegate.Remove(Progression.WeaponChangedEvent, new Action(UpdateUI));
	}
}
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()
	{
		CustomScripts.MonoBehaviourSingleton<CustomScripts.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 GunGame.Scripts
{
	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);
			}
		}
	}
}
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;
	}
}
namespace GunGame.Scripts.Options
{
	public class GameSettings : MonoBehaviourSingleton<GameSettings>
	{
		public static Action SettingsChanged;

		public static Action WeaponPoolChanged;

		public static bool DisabledAutoLoading;

		public static bool AlwaysChamberRounds;

		public static bool HealOnPromotion;

		[SerializeField]
		private Image DisabledAutoLoadingImage;

		[SerializeField]
		private Image AlwaysChamberRoundsImage;

		[SerializeField]
		private Image HealOnPromotionImage;

		[SerializeField]
		private Text MaxSosigCountText;

		public static int MaxSosigCount;

		public static WeaponPool CurrentPool { get; private set; }

		private void Start()
		{
			DisabledAutoLoading = false;
			AlwaysChamberRounds = false;
			HealOnPromotion = false;
			ResetMaxSosigCount();
		}

		public void IncreaseMaxSosigCount()
		{
			MaxSosigCount++;
			MaxSosigCountText.text = MaxSosigCount.ToString();
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public void DecreaseMaxSosigCount()
		{
			MaxSosigCount--;
			if (MaxSosigCount < 1)
			{
				MaxSosigCount = 1;
			}
			MaxSosigCountText.text = MaxSosigCount.ToString();
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public void ResetMaxSosigCount()
		{
			MaxSosigCount = MonoBehaviourSingleton<SosigBehavior>.Instance.MaxSosigCount;
			MaxSosigCountText.text = MaxSosigCount.ToString();
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public void ToggleAutoLoading()
		{
			DisabledAutoLoading = !DisabledAutoLoading;
			((Behaviour)DisabledAutoLoadingImage).enabled = DisabledAutoLoading;
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public void ToggleAlwaysChamberRounds()
		{
			AlwaysChamberRounds = !AlwaysChamberRounds;
			((Behaviour)AlwaysChamberRoundsImage).enabled = AlwaysChamberRounds;
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public void ToggleHealOnPromotion()
		{
			HealOnPromotion = !HealOnPromotion;
			((Behaviour)HealOnPromotionImage).enabled = HealOnPromotion;
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}

		public static void ChangeCurrentPool(WeaponPool newPool)
		{
			CurrentPool = newPool;
			CurrentPool.Initialize();
			if (WeaponPoolChanged != null)
			{
				WeaponPoolChanged();
			}
			if (SettingsChanged != null)
			{
				SettingsChanged();
			}
		}
	}
	public class KillsPerWeaponOption : MonoBehaviour
	{
		public Action OptionChanged;

		public int DefaultCount;

		public static int KillsPerWeaponCount;

		[SerializeField]
		private Text _counterText;

		private void Awake()
		{
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI));
		}

		private void Start()
		{
			ResetClicked();
		}

		public void ArrowLeftClicked()
		{
			KillsPerWeaponCount--;
			if (KillsPerWeaponCount <= 1)
			{
				KillsPerWeaponCount = 1;
			}
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ArrowRightClicked()
		{
			KillsPerWeaponCount++;
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ResetClicked()
		{
			KillsPerWeaponCount = DefaultCount;
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		private void UpdateUI()
		{
			_counterText.text = KillsPerWeaponCount.ToString();
		}

		private void OnDestroy()
		{
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI));
		}
	}
	public class LeftHandOption : MonoBehaviour
	{
		public Action OptionChanged;

		public static bool LeftHandModeEnabled;

		[SerializeField]
		private Image EnabledImage;

		private void Awake()
		{
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI));
			LeftHandModeEnabled = false;
			((Behaviour)EnabledImage).enabled = false;
		}

		public void ToggleClicked()
		{
			LeftHandModeEnabled = !LeftHandModeEnabled;
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		private void UpdateUI()
		{
			((Behaviour)EnabledImage).enabled = LeftHandModeEnabled;
		}

		private void OnDestroy()
		{
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI));
		}
	}
	public class MusicToggleOption : MonoBehaviour
	{
		public Action OptionChanged;

		public static bool MusicEnabled;

		public AudioSource MusicAudioSource;

		public bool MusicEnabledAtStart = false;

		[SerializeField]
		private Image EnabledImage;

		private void Awake()
		{
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(OnToggleMusic));
			MusicEnabled = MusicEnabledAtStart;
			((Behaviour)EnabledImage).enabled = MusicEnabled;
			OnToggleMusic();
		}

		public void ToggleClicked()
		{
			MusicEnabled = !MusicEnabled;
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		private void OnToggleMusic()
		{
			if (MusicEnabled)
			{
				MusicAudioSource.Play();
			}
			else
			{
				MusicAudioSource.Stop();
			}
			((Behaviour)EnabledImage).enabled = MusicEnabled;
		}

		private void OnDestroy()
		{
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(OnToggleMusic));
		}
	}
	public class QuickbeltOption : MonoBehaviour
	{
		public static FVRQuickBeltSlot AmmoQuickbeltSlot;

		private FVRPhysicalObject MagObject;

		public Transform MagSpawnPos;

		private string _magName = "MagazineStanag5rnd";

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

		private IEnumerator Start()
		{
			yield return (object)new WaitForSeconds(0.2f);
			AmmoQuickbeltSlot = GM.CurrentPlayerBody.QBSlots_Internal[0];
			SpawnMag();
		}

		private void OnGameStart()
		{
			if (Object.op_Implicit((Object)(object)MagObject.QuickbeltSlot))
			{
				AmmoQuickbeltSlot = MagObject.QuickbeltSlot;
			}
		}

		private void SpawnMag()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			FVRObject value = null;
			if (!IM.OD.TryGetValue(_magName, out value))
			{
				Debug.LogError((object)("No object found with id: " + _magName));
				return;
			}
			GameObject gameObject = ((AnvilAsset)value).GetGameObject();
			GameObject val = Object.Instantiate<GameObject>(gameObject, ((Component)MagSpawnPos).transform.position, ((Component)this).transform.rotation);
			val.SetActive(true);
			MagObject = val.GetComponent<FVRPhysicalObject>();
		}

		private void OnDestroy()
		{
			GameManager.BeforeGameStartedEvent = (Action)Delegate.Remove(GameManager.BeforeGameStartedEvent, new Action(OnGameStart));
		}
	}
	public class SelectedPoolUI : MonoBehaviour
	{
		public Text TitleText;

		public Text DescriptionText;

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

		private void OnSettingsChanged()
		{
			TitleText.text = GameSettings.CurrentPool.Name;
			DescriptionText.text = GameSettings.CurrentPool.Description;
		}

		private void OnDestroy()
		{
			GameSettings.SettingsChanged = (Action)Delegate.Remove(GameSettings.SettingsChanged, new Action(OnSettingsChanged));
		}
	}
	public class StartingHealthOption : MonoBehaviour
	{
		public Action OptionChanged;

		public int[] PossibleHealth;

		private int _optionIndex = 1;

		public static int CurrentHealth = 1000;

		[SerializeField]
		private Text _healthText;

		private void Awake()
		{
			PossibleHealth = new int[5] { 100, 1000, 2000, 5000, 10000 };
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI));
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateHealth));
		}

		private IEnumerator Start()
		{
			yield return (object)new WaitForSeconds(0.1f);
			ResetClicked();
		}

		public void ArrowLeftClicked()
		{
			_optionIndex--;
			if (_optionIndex < 0)
			{
				_optionIndex = 0;
			}
			CurrentHealth = PossibleHealth[_optionIndex];
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ArrowRightClicked()
		{
			_optionIndex++;
			if (_optionIndex >= PossibleHealth.Length)
			{
				_optionIndex = PossibleHealth.Length - 1;
			}
			CurrentHealth = PossibleHealth[_optionIndex];
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ResetClicked()
		{
			_optionIndex = 1;
			CurrentHealth = PossibleHealth[_optionIndex];
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		private void UpdateHealth()
		{
			GM.CurrentPlayerBody.SetHealthThreshold((float)CurrentHealth);
			GM.CurrentPlayerBody.ResetHealth();
		}

		private void UpdateUI()
		{
			_healthText.text = CurrentHealth.ToString();
		}

		private void OnDestroy()
		{
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI));
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateHealth));
		}
	}
	public class WeaponCountOption : MonoBehaviour
	{
		public Action OptionChanged;

		public static int WeaponCount;

		[SerializeField]
		private Text _counterText;

		private void Awake()
		{
			OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI));
			GameSettings.WeaponPoolChanged = (Action)Delegate.Combine(GameSettings.WeaponPoolChanged, new Action(ResetClicked));
		}

		public void ArrowLeftClicked()
		{
			WeaponCount--;
			if (WeaponCount <= 1)
			{
				WeaponCount = 1;
			}
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ArrowRightClicked()
		{
			WeaponCount++;
			if (WeaponCount > GameSettings.CurrentPool.Guns.Count)
			{
				WeaponCount = GameSettings.CurrentPool.Guns.Count;
			}
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ArrowRight10Clicked()
		{
			WeaponCount += 20;
			if (WeaponCount > GameSettings.CurrentPool.Guns.Count)
			{
				WeaponCount = GameSettings.CurrentPool.Guns.Count;
			}
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ArrowLeft10Clicked()
		{
			WeaponCount -= 20;
			if (WeaponCount <= 1)
			{
				WeaponCount = 1;
			}
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		public void ResetClicked()
		{
			WeaponCount = GameSettings.CurrentPool.Guns.Count;
			if (OptionChanged != null)
			{
				OptionChanged();
			}
		}

		private void UpdateUI()
		{
			_counterText.text = WeaponCount.ToString();
		}

		private void OnDestroy()
		{
			OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI));
			GameSettings.WeaponPoolChanged = (Action)Delegate.Remove(GameSettings.WeaponPoolChanged, new Action(ResetClicked));
		}
	}
}
public class Pause : MonoBehaviour
{
	[SerializeField]
	private Transform PauseWaypoint;

	[SerializeField]
	private Transform UnPauseWaypoint;

	[SerializeField]
	private Text TimeText;

	[SerializeField]
	private Text KillsText;

	[SerializeField]
	private Text DeathsText;

	private float _pauseTimer;

	public void PauseTheGame()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		GM.CurrentMovementManager.TeleportToPoint(PauseWaypoint.position, true, ((Component)this).transform.position + ((Component)this).transform.forward);
		KillsText.text = "Kills: " + GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.Kills;
		DeathsText.text = "Deaths: " + GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.Deaths;
		TimeSpan timeSpan = TimeSpan.FromSeconds(GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.GameTime);
		TimeText.text = "Time: " + timeSpan.Hours.ToString("00") + ":" + timeSpan.Minutes.ToString("00") + ":" + timeSpan.Seconds.ToString("00");
		_pauseTimer = Time.time;
	}

	public void UnpauseTheGame()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		GM.CurrentMovementManager.TeleportToPoint(UnPauseWaypoint.position, true, ((Component)this).transform.position + ((Component)this).transform.forward);
		float timePaused = Time.time - _pauseTimer;
		GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.RemovePausedTime(timePaused);
	}
}
namespace CustomScripts
{
	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()
	{
		CustomScripts.MonoBehaviourSingleton<PlayerData>.Instance.ElectricCherryPerkActivated = true;
		CustomScripts.MonoBehaviourSingleton<AudioManager>.Instance.Play(CustomScripts.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