Decompiled source of CybergrindDeathcam v1.1.0

plugins/CybergrindDeathcam/CybergrindDeathcam.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using CybergrindDeathcam.Components;
using CybergrindDeathcam.Utils;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using TMPro;
using UKEnemyIdentifier.Components;
using UKEnemyIdentifier.Utils;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CybergrindDeathcam")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CybergrindDeathcam")]
[assembly: AssemblyCopyright("Copyright © 2026 Flazhik")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("941412EE-5088-40AB-834A-40CA7F856E4B")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyVersion("1.1.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CybergrindDeathcam
{
	[BepInProcess("ULTRAKILL.exe")]
	[BepInPlugin("dev.flazhik.cybergrinddeathcam", "CybergrindDeathcam", "1.1.0")]
	public class CybergrindDeathcamPlugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static BoolValueChangeEventDelegate <0>__ManageSkipFields;

			public static PlayerHurtEventDelegate <1>__OnHit;
		}

		public static string catalogDir;

		public static BoolField UseCampaignDeathSequence;

		public static BoolField SkipLeaderboards;

		public static IntField LeaderboardsSkipThreshold;

		public static IntField AlwaysShowLeaderboardsStartingFrom;

		private static PluginConfigurator _config;

		private static Harmony _harmony;

		static CybergrindDeathcamPlugin()
		{
			catalogDir = Path.Combine(PathsUtils.AssemblyPath, "Assets");
		}

		private static void SetupConfig()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			_config = PluginConfigurator.Create("CybergrindDeathcam", "dev.flazhik.cybergrinddeathcam");
			UseCampaignDeathSequence = new BoolField(_config.rootPanel, "Enable campaign death screen", "deathcam.campaign-death-sequence", false);
			SkipLeaderboards = new BoolField(_config.rootPanel, "Skip Cyber Grind leaderboards", "deathcam.skip-leaderboards", false);
			LeaderboardsSkipThreshold = new IntField(_config.rootPanel, "Don't skip if PB is <= N waves away", "deathcam.threshold", 5);
			AlwaysShowLeaderboardsStartingFrom = new IntField(_config.rootPanel, "Don't skip starting from wave", "deathcam.always-show-starting-from", 999);
			BoolField skipLeaderboards = SkipLeaderboards;
			object obj = <>O.<0>__ManageSkipFields;
			if (obj == null)
			{
				BoolValueChangeEventDelegate val = ManageSkipFields;
				<>O.<0>__ManageSkipFields = val;
				obj = (object)val;
			}
			skipLeaderboards.onValueChange += (BoolValueChangeEventDelegate)obj;
			SkipLeaderboards.TriggerValueChangeEvent();
			_config.SetIconWithURL("file://" + Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icon.png"));
		}

		private void Start()
		{
			DeathCam.LoadNotification();
		}

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			Addressables.InitializeAsync().WaitForCompletion();
			Addressables.LoadContentCatalogAsync(Path.Combine(catalogDir, "catalog.json"), true, (string)null).WaitForCompletion();
			_harmony = new Harmony("dev.flazhik.cybergrinddeathcam");
			SetupConfig();
			_harmony.PatchAll();
			SceneManager.sceneLoaded += delegate
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected O, but got Unknown
				//IL_004b: 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_0056: Expected O, but got Unknown
				EnemyIdentifierManager instance = MonoSingleton<EnemyIdentifierManager>.Instance;
				object obj = <>O.<1>__OnHit;
				if (obj == null)
				{
					PlayerHurtEventDelegate val = OnHit;
					<>O.<1>__OnHit = val;
					obj = (object)val;
				}
				instance.OnPlayerHurt -= (PlayerHurtEventDelegate)obj;
				if (SceneHelper.CurrentScene == "Endless")
				{
					EnemyIdentifierManager instance2 = MonoSingleton<EnemyIdentifierManager>.Instance;
					object obj2 = <>O.<1>__OnHit;
					if (obj2 == null)
					{
						PlayerHurtEventDelegate val2 = OnHit;
						<>O.<1>__OnHit = val2;
						obj2 = (object)val2;
					}
					instance2.OnPlayerHurt += (PlayerHurtEventDelegate)obj2;
				}
			};
		}

		private static void ManageSkipFields(BoolValueChangeEvent e)
		{
			bool value = e.value;
			((ConfigField)LeaderboardsSkipThreshold).hidden = !value;
			((ConfigField)AlwaysShowLeaderboardsStartingFrom).hidden = !value;
		}

		private static void OnHit(PlayerHurtEvent e)
		{
			if (e.PlayerIsKilled)
			{
				NewMovement instance = MonoSingleton<NewMovement>.Instance;
				DeathCam obj = ((instance != null) ? ((Component)instance).gameObject.AddComponent<DeathCam>() : null);
				if (obj != null)
				{
					obj.killer = e.EnemyId;
				}
				if (obj != null)
				{
					((Behaviour)obj).enabled = true;
				}
			}
		}
	}
	internal static class PluginInfo
	{
		public const string Guid = "dev.flazhik.cybergrinddeathcam";

		public const string Name = "CybergrindDeathcam";

		public const string Version = "1.1.0";
	}
}
namespace CybergrindDeathcam.Utils
{
	public static class EnemyIdentifierExtension
	{
		public static GameObject GetObject(this EnemyIdentifier value)
		{
			return FirstNonNull(new <>z__ReadOnlyArray<MonoBehaviour>((MonoBehaviour[])(object)new MonoBehaviour[5]
			{
				(MonoBehaviour)value.zombie,
				(MonoBehaviour)value.drone,
				(MonoBehaviour)value.machine,
				(MonoBehaviour)value.spider,
				(MonoBehaviour)value.statue
			}));
		}

		private static GameObject FirstNonNull(IEnumerable<MonoBehaviour> values)
		{
			return (from m in values
				where (Object)(object)m != (Object)null
				select ((Component)m).gameObject).FirstOrDefault();
		}
	}
	public static class PathsUtils
	{
		public static readonly string ApplicationPath = Path.Combine(Directory.GetParent(Application.dataPath)?.FullName);

		public static readonly string AssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
	}
}
namespace CybergrindDeathcam.Patches
{
	[HarmonyPatch(typeof(DeathSequence))]
	public class DeathSequencePatch
	{
		private const string CyberRankCanvasPath = "/Player/FinishCanvas (1)";

		private const string BlackScreenCanvasPath = "/Canvas/BlackScreen";

		[HarmonyPostfix]
		[HarmonyPatch(typeof(DeathSequence), "EndSequence")]
		public static void DeathSequence_EndSequence_Postfix()
		{
			if (SceneHelper.CurrentScene != "Endless")
			{
				return;
			}
			MusicManager instance = MonoSingleton<MusicManager>.Instance;
			MonoSingleton<TimeController>.Instance.timeScale = 0f;
			GameObject val = GameObject.Find("/Player/FinishCanvas (1)");
			FinalCyberRank val2 = Object.FindObjectOfType<FinalCyberRank>(true);
			if (!((Object)(object)val2 == (Object)null))
			{
				Transform transform = GameObject.Find("/Canvas/BlackScreen").transform;
				((Component)transform.Find("YouDiedText")).gameObject.SetActive(false);
				((Component)transform.Find("LaughingSkull")).gameObject.SetActive(false);
				DeathCam component = ((Component)MonoSingleton<NewMovement>.Instance).gameObject.GetComponent<DeathCam>();
				if ((Object)(object)component == (Object)null || !component.skipLeaderboards)
				{
					val2.Appear();
					instance.forcedOff = true;
					instance.StopMusic();
				}
				else
				{
					GameProgressSaver.AddMoney(val2.totalPoints);
					SceneHelper.RestartScene();
				}
				val.transform.parent = GameObject.Find("/Canvas").transform;
			}
		}
	}
	[HarmonyPatch(typeof(FinalCyberRank))]
	public static class FinalCyberRankPatch
	{
		[HarmonyTranspiler]
		[HarmonyPatch(typeof(FinalCyberRank), "Update")]
		public static IEnumerable<CodeInstruction> FinalCyberRank_Update_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (InjectionPoint(list[i]))
				{
					DisableCybergrindTimeFreeze(list, i);
					break;
				}
			}
			return list;
		}

		private static bool InjectionPoint(CodeInstruction instruction)
		{
			if (instruction.opcode == OpCodes.Call)
			{
				return CodeInstructionExtensions.OperandIs(instruction, (MemberInfo)AccessTools.Method(typeof(Time), "set_timeScale", new Type[1] { typeof(float) }, (Type[])null));
			}
			return false;
		}

		private static void DisableCybergrindTimeFreeze(List<CodeInstruction> instructions, int index)
		{
			instructions.RemoveRange(index - 22, 23);
		}
	}
}
namespace CybergrindDeathcam.Components
{
	public class DeathCam : MonoBehaviour
	{
		private static GameObject _notificationPrefab;

		private const float RisingDistance = 10f;

		private const float RisingTime = 0.1f;

		private const float PointCameraAtKillerTime = 0.02f;

		private const float ZoomInRate = 0.1f;

		private const float FreezeDuration = 3f;

		private const float DistanceToKillerThreshold = 0.5f;

		private const string CanvasPath = "/Player/FinishCanvas (1)";

		public EnemyIdentifier killer;

		public bool skipLeaderboards;

		private DeathcamState _state;

		private GameObject _killerObj;

		private float _killerHeight;

		public FinalCyberRank finalCyberRank;

		private NewMovement _nm;

		private TimeController _timeController;

		private Vector3 _riseToPosition;

		private Vector3 _risingVelocity;

		private float _distanceToKiller;

		private float _freezeStart;

		private bool _endScheduled;

		private void Awake()
		{
			((Behaviour)this).enabled = false;
		}

		public static void LoadNotification()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			_notificationPrefab = Addressables.LoadAssetAsync<GameObject>((object)"Assets/CybergrindDeathcam/UI/elements/Notification.prefab").WaitForCompletion();
		}

		private void Start()
		{
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			_timeController = MonoSingleton<TimeController>.Instance;
			finalCyberRank = GameObject.Find("/Player/FinishCanvas (1)/Panel").GetComponent<FinalCyberRank>();
			_state = DeathcamState.FocusingOnKiller;
			_timeController.controlTimeScale = false;
			_freezeStart = Time.unscaledTime;
			if (CybergrindDeathcamPlugin.SkipLeaderboards.value)
			{
				CyberRankData bestCyber = GameProgressSaver.GetBestCyber();
				int num = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0);
				bool flag = bestCyber.preciseWavesByDifficulty[num] - finalCyberRank.savedWaves <= (float)CybergrindDeathcamPlugin.LeaderboardsSkipThreshold.value;
				bool flag2 = (float)CybergrindDeathcamPlugin.AlwaysShowLeaderboardsStartingFrom.value <= finalCyberRank.savedWaves;
				skipLeaderboards = !flag2 && !flag;
			}
			if (CybergrindDeathcamPlugin.UseCampaignDeathSequence.value)
			{
				((Component)MonoSingleton<NewMovement>.Instance.deathSequence).gameObject.SetActive(true);
			}
			else if (!((Object)(object)killer == (Object)null))
			{
				_nm = ((Component)this).gameObject.GetComponent<NewMovement>();
				_riseToPosition = ((Component)_nm).transform.position + new Vector3(0f, 10f, 0f);
				_killerObj = killer.GetObject();
				_killerHeight = GetKillerHeight();
				((MonoBehaviour)this).StartCoroutine(DeathCamRoutine());
				EnableNoclip();
			}
		}

		private void Update()
		{
			if (CybergrindDeathcamPlugin.UseCampaignDeathSequence.value)
			{
				return;
			}
			TimeFreeze();
			Time.timeScale = _timeController.timeScale * _timeController.timeScaleModifier;
			if ((double)_timeController.timeScale > 0.0)
			{
				if (!KillerIsDeadOrUnknown())
				{
					switch (_state)
					{
					case DeathcamState.FocusingOnKiller:
						FocusOnKiller();
						break;
					case DeathcamState.ZoomIn:
						ZoomIn();
						break;
					case DeathcamState.TimeFreeze:
						break;
					default:
						throw new ArgumentOutOfRangeException("Invalid Deathcam state");
					}
				}
			}
			else if (!_endScheduled)
			{
				_endScheduled = true;
				if (skipLeaderboards)
				{
					GameProgressSaver.AddMoney(finalCyberRank.totalPoints);
					SceneHelper.RestartScene();
				}
				else
				{
					((MonoBehaviour)this).StartCoroutine(ScheduleEndgameScreen(KillerIsDeadOrUnknown() ? 0f : 2f));
				}
			}
		}

		private void TimeFreeze()
		{
			float num = (skipLeaderboards ? 0.75f : 3f);
			float progress = ((num <= 0f) ? 1f : Mathf.Clamp01((Time.unscaledTime - _freezeStart) / num));
			_timeController.timeScale = 1f - EaseInOut(progress);
		}

		private static float EaseInOut(float progress)
		{
			return progress * progress * (3f - 2f * progress);
		}

		private IEnumerator ScheduleEndgameScreen(float delay)
		{
			yield return (object)new WaitForSecondsRealtime(delay);
			DisplayEndgameScreen();
		}

		private IEnumerator DeathCamRoutine()
		{
			yield return (object)new WaitForSecondsRealtime(2f);
			ShowNotification();
			_state = DeathcamState.ZoomIn;
		}

		private void EnableNoclip()
		{
			((Component)_nm).GetComponent<Rigidbody>().isKinematic = true;
			((Behaviour)((Component)_nm).GetComponent<KeepInBounds>()).enabled = false;
		}

		private void FocusOnKiller()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			if (!KillerIsDeadOrUnknown())
			{
				if (Math.Abs(((Component)_nm).transform.position.y - _riseToPosition.y) > float.Epsilon)
				{
					((Component)_nm).transform.position = Vector3.SmoothDamp(((Component)_nm).transform.position, _riseToPosition, ref _risingVelocity, 0.1f);
				}
				Quaternion val = Quaternion.LookRotation(_killerObj.transform.position - ((Component)_nm.cc.cam).transform.position);
				((Component)_nm.cc.cam).transform.rotation = Quaternion.Lerp(((Component)_nm.cc.cam).transform.rotation, val, 0.02f);
			}
		}

		private void ZoomIn()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			_distanceToKiller = Vector3.Distance(_killerObj.transform.position, ((Component)_nm.cc.cam).transform.position);
			if (KillerIsDeadOrUnknown())
			{
				_state = DeathcamState.TimeFreeze;
				return;
			}
			float num = _killerHeight * DeathcamDistanceCoefficient();
			Vector3 position = _killerObj.transform.position;
			Vector3 position2 = ((Component)_nm.cc.cam).transform.position;
			Vector3 val = num * ((position - position2) / _distanceToKiller) - new Vector3(0f, _killerHeight / 4f, 0f);
			Vector3 val2 = position - position2;
			Vector3 val3 = position - val;
			if (Vector3.Distance(position2, val3) < 0.5f)
			{
				_state = DeathcamState.TimeFreeze;
				return;
			}
			Quaternion val4 = Quaternion.LookRotation(val2);
			((Component)_nm.cc.cam).transform.rotation = Quaternion.Lerp(((Component)_nm.cc.cam).transform.rotation, val4, 0.1f);
			((Component)_nm.cc.cam).transform.position = Vector3.Lerp(position2, val3, 0.1f);
			_distanceToKiller = Vector3.Distance(position, ((Component)_nm.cc.cam).transform.position);
		}

		private float GetKillerHeight()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			EnemySimplifier[] componentsInChildren = _killerObj.GetComponentsInChildren<EnemySimplifier>();
			if (componentsInChildren.Length == 0)
			{
				return 0f;
			}
			Renderer val = ReflectionUtils.GetPrivate<Renderer>((object)componentsInChildren[0], "meshrenderer");
			Guttertank val2 = default(Guttertank);
			if (_killerObj.TryGetComponent<Guttertank>(ref val2))
			{
				return 6f;
			}
			if (!((Object)(object)val == (Object)null))
			{
				Bounds bounds = val.bounds;
				return ((Bounds)(ref bounds)).size.y;
			}
			return 0f;
		}

		private bool KillerIsDeadOrUnknown()
		{
			if (!((Object)(object)_killerObj == (Object)null) && !((Object)(object)killer == (Object)null))
			{
				return killer.dead;
			}
			return true;
		}

		private float DeathcamDistanceCoefficient()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected I4, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			EnemyType enemyType = killer.enemyType;
			if ((int)enemyType <= 7)
			{
				switch ((int)enemyType)
				{
				default:
					if ((int)enemyType != 7)
					{
						break;
					}
					return 3.5f;
				case 0:
					return 0.6f;
				case 4:
					return 0.6f;
				case 2:
					return 0.6f;
				case 1:
				case 3:
					break;
				}
			}
			else
			{
				if ((int)enemyType == 31)
				{
					return 0.7f;
				}
				if ((int)enemyType == 33)
				{
					return 1.3f;
				}
			}
			return 1f;
		}

		private void ShowNotification()
		{
			GameObject val = GameObject.Find("/Player/FinishCanvas (1)");
			DeathcamPanel component = Object.Instantiate<GameObject>(_notificationPrefab, val.transform).GetComponent<DeathcamPanel>();
			((Component)component).transform.SetSiblingIndex(0);
			component.Show(killer);
		}

		private void DisplayEndgameScreen()
		{
			finalCyberRank.Appear();
			MonoSingleton<MusicManager>.Instance.forcedOff = true;
			MonoSingleton<MusicManager>.Instance.StopMusic();
		}
	}
	public enum DeathcamState
	{
		FocusingOnKiller,
		ZoomIn,
		TimeFreeze
	}
	public class DeathcamPanel : MonoBehaviour
	{
		public SpawnableObjectsDatabase spawnableObjectsDatabase;

		public GameObject panel;

		public Image icon;

		public TMP_Text killerName;

		public AudioSource whoosh;

		private void Awake()
		{
			panel.SetActive(false);
		}

		public void Show(EnemyIdentifier killer)
		{
			panel.SetActive(false);
			if (!((Object)(object)killer == (Object)null))
			{
				SpawnableObject val = spawnableObjectsDatabase.enemies.First((SpawnableObject enemy) => enemy.enemyType == killer.enemyType);
				if (!((Object)(object)val == (Object)null))
				{
					panel.SetActive(true);
					icon.sprite = val.gridIcon;
					killerName.text = killer.FullName.ToUpperInvariant();
					whoosh.Play();
				}
			}
		}
	}
}
[CompilerGenerated]
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}