Decompiled source of Suppression v1.0.0

Mods/Suppression.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib;
using BoneLib.BoneMenu;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using SuppressionMod;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Main), "Suppression", "1.0.0", "kamonkus", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[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 SuppressionMod
{
	public class Main : MelonMod
	{
		private float _nextErrorLog;

		public override void OnInitializeMelon()
		{
			Settings.Init();
			Hooking.OnPostFireGun += SuppressionManager.OnGunFired;
			Hooking.OnLevelUnloaded += SuppressionManager.Reset;
			Hooking.OnLevelLoaded += delegate
			{
				SuppressionManager.OnLevelLoaded();
			};
			Settings.BuildMenu();
			MelonLogger.Msg("Suppression loaded. Open BoneMenu -> Suppression.");
		}

		public override void OnLateUpdate()
		{
			try
			{
				SuppressionManager.Tick();
				Settings.Tick();
			}
			catch (Exception ex)
			{
				float realtimeSinceStartup = Time.realtimeSinceStartup;
				if (realtimeSinceStartup > _nextErrorLog)
				{
					_nextErrorLog = realtimeSinceStartup + 5f;
					MelonLogger.Error("[Suppression] tick error: " + ex);
				}
			}
		}
	}
	public static class Settings
	{
		private static MelonPreferences_Category _cat;

		private static float _saveAt = -1f;

		public static MelonPreferences_Entry<bool> Enabled;

		public static MelonPreferences_Entry<float> Intensity;

		public static MelonPreferences_Entry<float> MaxDistance;

		public static MelonPreferences_Entry<float> VisualSeconds;

		public static MelonPreferences_Entry<bool> Debug;

		public static MelonPreferences_Entry<float> Vignette;

		public static MelonPreferences_Entry<float> Darken;

		public static MelonPreferences_Entry<float> OverlayScale;

		public static MelonPreferences_Entry<float> DirVignette;

		public static MelonPreferences_Entry<bool> PostFx;

		public static MelonPreferences_Entry<float> Blur;

		public static MelonPreferences_Entry<float> Contrast;

		public static MelonPreferences_Entry<float> Desaturate;

		public static MelonPreferences_Entry<float> Chroma;

		public static MelonPreferences_Entry<float> Distortion;

		public static MelonPreferences_Entry<float> MuffleStrength;

		public static MelonPreferences_Entry<float> MuffleSeconds;

		public static MelonPreferences_Entry<float> MuffleMinHz;

		public static MelonPreferences_Entry<float> RingVolume;

		public static MelonPreferences_Entry<float> RingSeconds;

		public static MelonPreferences_Entry<bool> WhizEnabled;

		public static MelonPreferences_Entry<float> Whiz;

		public static MelonPreferences_Entry<float> WhizDistance;

		public static MelonPreferences_Entry<float> Heart;

		public static void Init()
		{
			_cat = MelonPreferences.CreateCategory("Suppression");
			Enabled = _cat.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Intensity = _cat.CreateEntry<float>("Intensity", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			MaxDistance = _cat.CreateEntry<float>("MaxDistance", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			VisualSeconds = _cat.CreateEntry<float>("VisualSeconds", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Debug = _cat.CreateEntry<bool>("DebugLog", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Vignette = _cat.CreateEntry<float>("Vignette", 0.85f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Darken = _cat.CreateEntry<float>("Darken", 0.18f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			OverlayScale = _cat.CreateEntry<float>("OverlayScale", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			DirVignette = _cat.CreateEntry<float>("DirectionalVignette", 0.6f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			PostFx = _cat.CreateEntry<bool>("PostEffects", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Blur = _cat.CreateEntry<float>("Blur", 0.7f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Contrast = _cat.CreateEntry<float>("Contrast", 22f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Desaturate = _cat.CreateEntry<float>("Desaturate", 15f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Chroma = _cat.CreateEntry<float>("ChromaticAberration", 0.25f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Distortion = _cat.CreateEntry<float>("LensDistortion", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			MuffleStrength = _cat.CreateEntry<float>("MuffleStrength", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			MuffleSeconds = _cat.CreateEntry<float>("MuffleSeconds", 2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			MuffleMinHz = _cat.CreateEntry<float>("MuffleMinHz", 700f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			RingVolume = _cat.CreateEntry<float>("RingVolume", 0.06f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			RingSeconds = _cat.CreateEntry<float>("RingSeconds", 0.9f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			WhizEnabled = _cat.CreateEntry<bool>("WhizEnabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Whiz = _cat.CreateEntry<float>("WhizVolume", 0.8f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			WhizDistance = _cat.CreateEntry<float>("WhizDistance", 12f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Heart = _cat.CreateEntry<float>("HeartbeatVolume", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		}

		public static void BuildMenu()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			Page obj = Page.Root.CreatePage("Suppression", Color.yellow, 0, true);
			AddBool(obj, "Enabled", Enabled);
			AddFloat(obj, "Intensity", Intensity, 0.1f, 0.2f, 2f);
			AddFloat(obj, "Effect distance (m)", MaxDistance, 0.25f, 1f, 8f);
			AddFloat(obj, "Visual fade time (s)", VisualSeconds, 0.5f, 1f, 10f);
			Page p = obj.CreatePage("Screen edges", Color.yellow, 0, true);
			AddFloat(p, "Vignette", Vignette, 0.05f, 0f, 1f);
			AddFloat(p, "Darken", Darken, 0.02f, 0f, 0.5f);
			AddFloat(p, "Side vignette (direction)", DirVignette, 0.1f, 0f, 1f);
			AddFloat(p, "Overlay size", OverlayScale, 0.05f, 0.5f, 2.5f);
			Page p2 = obj.CreatePage("Blur and contrast", Color.yellow, 0, true);
			AddBool(p2, "Post effects", PostFx);
			AddFloat(p2, "Blur", Blur, 0.05f, 0f, 1f);
			AddFloat(p2, "Contrast", Contrast, 2f, 0f, 60f);
			AddFloat(p2, "Desaturation", Desaturate, 2f, 0f, 60f);
			AddFloat(p2, "Chromatic aberration", Chroma, 0.05f, 0f, 1f);
			AddFloat(p2, "Lens distortion", Distortion, 0.05f, -0.5f, 0.5f);
			Page p3 = obj.CreatePage("Audio", Color.yellow, 0, true);
			AddFloat(p3, "Muffle strength", MuffleStrength, 0.05f, 0f, 1.5f);
			AddFloat(p3, "Muffle time (s)", MuffleSeconds, 0.25f, 0.5f, 8f);
			AddFloat(p3, "Muffle min Hz", MuffleMinHz, 50f, 200f, 4000f);
			AddFloat(p3, "Ear ringing volume", RingVolume, 0.01f, 0f, 0.3f);
			AddFloat(p3, "Ear ringing time (s)", RingSeconds, 0.1f, 0.2f, 6f);
			AddFloat(p3, "Heartbeat volume", Heart, 0.05f, 0f, 1f);
			AddBool(p3, "Bullet whiz sounds", WhizEnabled);
			AddFloat(p3, "Whiz volume", Whiz, 0.05f, 0f, 1.5f);
			AddFloat(p3, "Whiz distance (m)", WhizDistance, 1f, 2f, 40f);
			AddBool(obj, "Debug log", Debug);
		}

		public static void Tick()
		{
			if (_saveAt > 0f && Time.realtimeSinceStartup >= _saveAt)
			{
				_saveAt = -1f;
				MelonPreferences.Save();
			}
		}

		private static void Dirty()
		{
			_saveAt = Time.realtimeSinceStartup + 1.5f;
		}

		private static void AddBool(Page p, string name, MelonPreferences_Entry<bool> e)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			p.CreateBool(name, Color.white, e.Value, (Action<bool>)delegate(bool v)
			{
				e.Value = v;
				Dirty();
			});
		}

		private static void AddFloat(Page p, string name, MelonPreferences_Entry<float> e, float inc, float min, float max)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			p.CreateFloat(name, Color.white, e.Value, inc, min, max, (Action<float>)delegate(float v)
			{
				e.Value = v;
				Dirty();
			});
		}
	}
	internal static class SuppressionManager
	{
		private sealed class Pending
		{
			public float Time;

			public float Impulse;

			public Vector3 Point;

			public Vector2 Dir;

			public float Dist;

			public bool Whiz;
		}

		private static readonly List<Pending> _pending = new List<Pending>();

		private static float _energy;

		private static float _level;

		private static float _kick;

		private static float _pulse;

		private static Vector2 _dirOff;

		private static bool _active;

		private static bool _overlayReady;

		private static GameObject _root;

		private static SpriteRenderer _vig;

		private static SpriteRenderer _dark;

		private static Camera _cam;

		private static float _nextCamSearch;

		private static bool _volReady;

		private static bool _volFailed;

		private static GameObject _volGo;

		private static Volume _volume;

		private static VolumeProfile _profile;

		private static ColorAdjustments _ca;

		private static DepthOfField _dof;

		private static ChromaticAberration _chroma;

		private static LensDistortion _lens;

		private static float _fxSig = -1f;

		private static Camera _fxCam;

		private static readonly HashSet<string> _warned = new HashSet<string>();

		private static bool _audioReady;

		private static AudioListener _listener;

		private static AudioLowPassFilter _lp;

		private static AudioSource _ring;

		private static float _nextListenerSearch;

		private static float _ringPeak;

		private static float _ringAge;

		private static float _ringDur;

		private static AudioClip[] _whiz;

		private static readonly List<AudioSource> _whizSources = new List<AudioSource>();

		private static int _whizNext;

		private static AudioSource _heart;

		private static float _heartNext;

		public static void OnGunFired(Gun gun)
		{
			if (!Settings.Enabled.Value)
			{
				return;
			}
			try
			{
				Evaluate(gun);
			}
			catch (Exception ex)
			{
				MelonLogger.Error("[Suppression] shot error: " + ex);
			}
		}

		private static bool IsPlayersGun(Gun gun)
		{
			try
			{
				if (!Player.HandsExist)
				{
					return false;
				}
				int instanceID = ((Object)gun).GetInstanceID();
				Gun componentInHand = Player.GetComponentInHand<Gun>(Player.LeftHand);
				if ((Object)(object)componentInHand != (Object)null && ((Object)componentInHand).GetInstanceID() == instanceID)
				{
					return true;
				}
				Gun componentInHand2 = Player.GetComponentInHand<Gun>(Player.RightHand);
				if ((Object)(object)componentInHand2 != (Object)null && ((Object)componentInHand2).GetInstanceID() == instanceID)
				{
					return true;
				}
			}
			catch (Exception)
			{
			}
			return false;
		}

		private static bool IsPlayerCollider(Collider c)
		{
			try
			{
				RigManager rigManager = Player.RigManager;
				if ((Object)(object)rigManager == (Object)null)
				{
					return false;
				}
				return ((Component)c).transform.IsChildOf(((Component)rigManager).transform);
			}
			catch (Exception)
			{
				return false;
			}
		}

		private static void Evaluate(Gun gun)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_0076: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			Transform firePointTransform = gun.firePointTransform;
			if ((Object)(object)firePointTransform == (Object)null)
			{
				return;
			}
			Transform head = Player.Head;
			if ((Object)(object)head == (Object)null || IsPlayersGun(gun))
			{
				return;
			}
			Vector3 position = firePointTransform.position;
			Vector3 forward = firePointTransform.forward;
			float num = gun.muzzleVelocity;
			if (num < 80f)
			{
				num = 400f;
			}
			Vector3 position2 = head.position;
			Vector3 val = position2;
			Transform chest = Player.Chest;
			if ((Object)(object)chest != (Object)null)
			{
				val = chest.position;
			}
			float num2 = Vector3.Dot(position2 - position, forward);
			float num3 = Vector3.Dot(val - position, forward);
			float num4;
			Vector3 val2;
			if (!(num2 > 0.3f))
			{
				num4 = float.MaxValue;
			}
			else
			{
				val2 = position2 - (position + forward * num2);
				num4 = ((Vector3)(ref val2)).magnitude;
			}
			float num5 = num4;
			float num6;
			if (!(num3 > 0.3f))
			{
				num6 = float.MaxValue;
			}
			else
			{
				val2 = val - (position + forward * num3);
				num6 = ((Vector3)(ref val2)).magnitude * 1.2f;
			}
			float num7 = num6;
			float num8;
			float num9;
			if (num5 <= num7)
			{
				num8 = num5;
				num9 = num2;
			}
			else
			{
				num8 = num7;
				num9 = num3;
			}
			if (num8 >= float.MaxValue)
			{
				return;
			}
			float value = Settings.MaxDistance.Value;
			float num10 = (Settings.WhizEnabled.Value ? Settings.WhizDistance.Value : 0f);
			if (num8 > Mathf.Max(value, num10))
			{
				return;
			}
			bool flag = false;
			Vector3 val3 = position + forward * 0.25f;
			float num11 = Mathf.Max(0.1f, num9 - 0.25f) + 0.5f;
			RaycastHit val4 = default(RaycastHit);
			if (Physics.Raycast(val3, forward, ref val4, num11, -1, (QueryTriggerInteraction)1) && ((RaycastHit)(ref val4)).distance > 0.6f)
			{
				if (IsPlayerCollider(((RaycastHit)(ref val4)).collider))
				{
					num8 = Mathf.Min(num8, 0.1f);
				}
				else if (((RaycastHit)(ref val4)).distance + 0.25f < num9 - 0.4f)
				{
					flag = true;
					num8 = Vector3.Distance(position2, ((RaycastHit)(ref val4)).point);
					num9 = ((RaycastHit)(ref val4)).distance + 0.25f;
				}
			}
			float num12 = 0f;
			if (num8 <= value)
			{
				float num13 = 1f - Mathf.Clamp01((num8 - 0.25f) / Mathf.Max(0.1f, value - 0.25f));
				num12 = num13 * num13 * 0.6f * Settings.Intensity.Value;
			}
			bool flag2 = Settings.WhizEnabled.Value && !flag && num8 <= num10;
			if (!(num12 <= 0f) || flag2)
			{
				Vector3 val5 = position + forward * Mathf.Max(0f, num9);
				Vector3 val6 = val5 - position2;
				Transform val7 = (((Object)(object)_cam != (Object)null) ? ((Component)_cam).transform : head);
				Vector2 dir = default(Vector2);
				((Vector2)(ref dir))..ctor(Vector3.Dot(val6, val7.right), Vector3.Dot(val6, val7.up));
				if (((Vector2)(ref dir)).sqrMagnitude > 1E-06f)
				{
					((Vector2)(ref dir)).Normalize();
				}
				Pending pending = new Pending();
				pending.Time = Time.unscaledTime + Mathf.Clamp(num9 / num, 0f, 1f);
				pending.Impulse = num12;
				pending.Point = val5;
				pending.Dir = dir;
				pending.Dist = num8;
				pending.Whiz = flag2;
				if (_pending.Count < 64)
				{
					_pending.Add(pending);
				}
				if (Settings.Debug.Value)
				{
					MelonLogger.Msg("[Suppression] pass dist=" + num8.ToString("F2") + " impulse=" + num12.ToString("F2") + " whiz=" + flag2 + " blocked=" + flag + " speed=" + num.ToString("F0"));
				}
			}
		}

		private static void AddImpulse(float impulse, Vector2 dir)
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			_energy = Mathf.Min(1.5f, _energy + impulse * (1f - 0.35f * _energy));
			_kick = Mathf.Max(_kick, Mathf.Min(1f, impulse * 1.7f));
			_pulse = Mathf.Max(_pulse, Mathf.Min(1f, impulse * 1.6f));
			_dirOff = Vector2.ClampMagnitude(_dirOff + dir * Mathf.Min(1f, impulse * 1.5f), 1f);
			TriggerRing(impulse);
		}

		public static void OnLevelLoaded()
		{
			_cam = null;
			_fxCam = null;
			_listener = null;
			_lp = null;
		}

		public static void Reset()
		{
			_pending.Clear();
			_energy = 0f;
			_level = 0f;
			_kick = 0f;
			_pulse = 0f;
			_ringPeak = 0f;
			_cam = null;
			_fxCam = null;
			_listener = null;
			_lp = null;
		}

		public static void Tick()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			float unscaledTime = Time.unscaledTime;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			for (int num = _pending.Count - 1; num >= 0; num--)
			{
				Pending pending = _pending[num];
				if (!(pending.Time > unscaledTime))
				{
					_pending.RemoveAt(num);
					if (pending.Impulse > 0f)
					{
						AddImpulse(pending.Impulse, pending.Dir);
					}
					if (pending.Whiz)
					{
						PlayWhiz(pending.Point, pending.Dist);
					}
				}
			}
			if (!(_energy > 0.0005f) && !(_level > 0.001f) && !(_kick > 0.001f) && !(_pulse > 0.002f) && !(_ringPeak > 0f))
			{
				if (_active)
				{
					Deactivate();
				}
				return;
			}
			_active = true;
			float num2 = 3f / Mathf.Max(0.5f, Settings.VisualSeconds.Value);
			float num3 = Mathf.Lerp(0.4f, 0.14f, Mathf.Clamp01(_energy)) * num2;
			_energy = Mathf.Max(0f, _energy - num3 * unscaledDeltaTime);
			float num4 = Mathf.Clamp01(_energy);
			float num5 = ((num4 > _level) ? 7f : (1.4f * num2));
			_level += (num4 - _level) * (1f - Mathf.Exp((0f - num5) * unscaledDeltaTime));
			_kick = Mathf.Max(0f, _kick - unscaledDeltaTime / Mathf.Max(0.2f, Settings.MuffleSeconds.Value));
			_pulse *= Mathf.Exp(-6f * unscaledDeltaTime);
			if (_pulse < 0.002f)
			{
				_pulse = 0f;
			}
			_dirOff = Vector2.Lerp(_dirOff, Vector2.zero, 1f - Mathf.Exp(-2.5f * unscaledDeltaTime));
			UpdateOverlay(_level, _pulse);
			UpdatePostFx(_level, _pulse);
			UpdateAudio(_level);
			UpdateRing(unscaledDeltaTime);
			UpdateHeart(_level, unscaledTime);
		}

		private static void Deactivate()
		{
			_active = false;
			_level = 0f;
			_energy = 0f;
			_kick = 0f;
			_pulse = 0f;
			_ringPeak = 0f;
			if ((Object)(object)_vig != (Object)null)
			{
				((Renderer)_vig).enabled = false;
			}
			if ((Object)(object)_dark != (Object)null)
			{
				((Renderer)_dark).enabled = false;
			}
			if ((Object)(object)_lp != (Object)null)
			{
				((Behaviour)_lp).enabled = false;
			}
			if ((Object)(object)_ring != (Object)null && _ring.isPlaying)
			{
				_ring.Stop();
			}
			if ((Object)(object)_volGo != (Object)null && _volGo.activeSelf)
			{
				_volGo.SetActive(false);
			}
		}

		private static Camera FindViewCamera()
		{
			Camera val = null;
			Il2CppReferenceArray<Camera> allCameras = Camera.allCameras;
			for (int i = 0; i < ((Il2CppArrayBase<Camera>)(object)allCameras).Length; i++)
			{
				Camera val2 = ((Il2CppArrayBase<Camera>)(object)allCameras)[i];
				if (!((Object)(object)val2 == (Object)null) && ((Behaviour)val2).enabled && ((Component)val2).gameObject.activeInHierarchy && !((Object)(object)val2.targetTexture != (Object)null))
				{
					if ((Object)(object)val == (Object)null || val2.depth > val.depth)
					{
						val = val2;
					}
					if (((Component)val2).CompareTag("MainCamera") && ((Object)(object)val == (Object)null || val2.depth >= val.depth))
					{
						val = val2;
					}
				}
			}
			return val;
		}

		private static void EnsureOverlay()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_0084: 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)
			if (!_overlayReady)
			{
				_overlayReady = true;
				EnsureRoot();
				Sprite sprite = MakeVignetteSprite(128);
				Sprite sprite2 = MakeSolidSprite();
				GameObject val = new GameObject("vignette")
				{
					layer = 2
				};
				val.transform.SetParent(_root.transform, false);
				_vig = val.AddComponent<SpriteRenderer>();
				_vig.sprite = sprite;
				((Renderer)_vig).sortingOrder = 30001;
				((Renderer)_vig).enabled = false;
				GameObject val2 = new GameObject("darken")
				{
					layer = 2
				};
				val2.transform.SetParent(_root.transform, false);
				_dark = val2.AddComponent<SpriteRenderer>();
				_dark.sprite = sprite2;
				((Renderer)_dark).sortingOrder = 30000;
				((Renderer)_dark).enabled = false;
			}
		}

		private static void EnsureRoot()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			if (!((Object)(object)_root != (Object)null))
			{
				_root = new GameObject("Suppression_Overlay");
				Object.DontDestroyOnLoad((Object)(object)_root);
			}
		}

		private static void UpdateOverlay(float s, float pulse)
		{
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			EnsureOverlay();
			float unscaledTime = Time.unscaledTime;
			if (((Object)(object)_cam == (Object)null || !((Component)_cam).gameObject.activeInHierarchy) && unscaledTime >= _nextCamSearch)
			{
				_nextCamSearch = unscaledTime + 1f;
				_cam = FindViewCamera();
				if ((Object)(object)_cam != (Object)null)
				{
					MelonLogger.Msg("[Suppression] view camera: " + ((Object)_cam).name + " fov=" + _cam.fieldOfView + " aspect=" + _cam.aspect + " near=" + _cam.nearClipPlane);
				}
			}
			if (!((Object)(object)_cam == (Object)null))
			{
				Transform transform = ((Component)_cam).transform;
				if ((Object)(object)_root.transform.parent != (Object)(object)transform)
				{
					_root.transform.SetParent(transform, false);
					_root.transform.localPosition = new Vector3(0f, 0f, 0.3f);
					_root.transform.localRotation = Quaternion.identity;
				}
				float num = Mathf.Clamp(_cam.fieldOfView, 30f, 140f);
				float num2 = 0.6f * Mathf.Tan(num * 0.5f * ((float)Math.PI / 180f)) * 1.3f * Settings.OverlayScale.Value;
				float num3 = num2 * Mathf.Clamp(_cam.aspect, 1f, 2.4f);
				Vector3 localScale = default(Vector3);
				((Vector3)(ref localScale))..ctor(num3, num2, 1f);
				float num4 = Mathf.Clamp01((s + 0.25f * pulse) * Settings.Vignette.Value);
				float num5 = Mathf.Clamp01(s * Settings.Darken.Value);
				Vector2 val = _dirOff * (Settings.DirVignette.Value * 0.08f);
				((Component)_vig).transform.localPosition = new Vector3((0f - val.x) * num3, (0f - val.y) * num2, 0f);
				((Component)_vig).transform.localScale = localScale;
				((Component)_dark).transform.localScale = localScale;
				_vig.color = new Color(0f, 0f, 0f, num4);
				_dark.color = new Color(0f, 0f, 0f, num5);
				((Renderer)_vig).enabled = num4 > 0.003f;
				((Renderer)_dark).enabled = num5 > 0.003f;
			}
		}

		private static void WarnOnce(string msg)
		{
			if (_warned.Add(msg))
			{
				MelonLogger.Warning("[Suppression] " + msg);
			}
		}

		private static void EnsureVolume()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			if (_volReady || _volFailed)
			{
				return;
			}
			try
			{
				_volGo = new GameObject("Suppression_Volume");
				Object.DontDestroyOnLoad((Object)(object)_volGo);
				_volume = _volGo.AddComponent<Volume>();
				_volume.isGlobal = true;
				_volume.priority = 500f;
				_volume.weight = 0f;
				_profile = ScriptableObject.CreateInstance<VolumeProfile>();
				((Object)_profile).hideFlags = (HideFlags)32;
				_ca = _profile.Add<ColorAdjustments>(false);
				_dof = _profile.Add<DepthOfField>(false);
				_chroma = _profile.Add<ChromaticAberration>(false);
				_lens = _profile.Add<LensDistortion>(false);
				_volume.sharedProfile = _profile;
				_volReady = true;
				MelonLogger.Msg("[Suppression] post-effect volume created.");
			}
			catch (Exception ex)
			{
				_volFailed = true;
				MelonLogger.Warning("[Suppression] post effects unavailable: " + ex.Message);
			}
		}

		private static void ConfigureVolumeLayer(Camera cam)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				UniversalAdditionalCameraData component = ((Component)cam).GetComponent<UniversalAdditionalCameraData>();
				if ((Object)(object)component == (Object)null)
				{
					MelonLogger.Warning("[Suppression] camera has no URP camera data, using layer 0.");
					_volGo.layer = 0;
					return;
				}
				LayerMask volumeLayerMask = component.volumeLayerMask;
				int value = ((LayerMask)(ref volumeLayerMask)).value;
				bool renderPostProcessing = component.renderPostProcessing;
				MelonLogger.Msg("[Suppression] camera post-processing=" + renderPostProcessing + " volumeMask=" + value);
				if (!renderPostProcessing)
				{
					component.renderPostProcessing = true;
				}
				int layer = 0;
				if (value != 0 && (value & 1) == 0)
				{
					for (int i = 0; i < 32; i++)
					{
						if ((value & (1 << i)) != 0)
						{
							layer = i;
							break;
						}
					}
				}
				_volGo.layer = layer;
			}
			catch (Exception ex)
			{
				MelonLogger.Warning("[Suppression] volume layer setup failed: " + ex.Message);
			}
		}

		private static void SetParam(object comp, string name, object value)
		{
			if (comp == null)
			{
				return;
			}
			try
			{
				PropertyInfo property = comp.GetType().GetProperty(name, BindingFlags.Instance | BindingFlags.Public);
				if (property == null)
				{
					WarnOnce("missing property " + comp.GetType().Name + "." + name);
					return;
				}
				object value2 = property.GetValue(comp, null);
				if (value2 == null)
				{
					WarnOnce("null parameter " + comp.GetType().Name + "." + name);
					return;
				}
				Type type = value2.GetType();
				PropertyInfo property2 = type.GetProperty("value", BindingFlags.Instance | BindingFlags.Public);
				PropertyInfo property3 = type.GetProperty("overrideState", BindingFlags.Instance | BindingFlags.Public);
				if (property2 == null)
				{
					WarnOnce("no value property on " + type.Name);
					return;
				}
				object value3 = ((!property2.PropertyType.IsEnum) ? Convert.ChangeType(value, property2.PropertyType) : Enum.Parse(property2.PropertyType, value.ToString()));
				property2.SetValue(value2, value3, null);
				if (property3 != null)
				{
					property3.SetValue(value2, true, null);
				}
			}
			catch (Exception ex)
			{
				WarnOnce("could not set " + name + ": " + ex.Message);
			}
		}

		private static void ApplyProfile()
		{
			float value = Settings.Blur.Value;
			float value2 = Settings.Contrast.Value;
			float value3 = Settings.Desaturate.Value;
			float value4 = Settings.Chroma.Value;
			float value5 = Settings.Distortion.Value;
			((VolumeComponent)_dof).active = value > 0.01f;
			if (((VolumeComponent)_dof).active)
			{
				SetParam(_dof, "mode", "Gaussian");
				SetParam(_dof, "gaussianStart", 0f);
				SetParam(_dof, "gaussianEnd", Mathf.Lerp(30f, 2.5f, Mathf.Clamp01(value)));
				SetParam(_dof, "gaussianMaxRadius", Mathf.Lerp(0.6f, 1.5f, Mathf.Clamp01(value)));
				SetParam(_dof, "highQualitySampling", false);
			}
			((VolumeComponent)_ca).active = value2 > 0.01f || value3 > 0.01f;
			if (((VolumeComponent)_ca).active)
			{
				SetParam(_ca, "contrast", value2);
				SetParam(_ca, "saturation", 0f - value3);
			}
			((VolumeComponent)_chroma).active = value4 > 0.01f;
			if (((VolumeComponent)_chroma).active)
			{
				SetParam(_chroma, "intensity", Mathf.Clamp01(value4));
			}
			((VolumeComponent)_lens).active = Mathf.Abs(value5) > 0.01f;
			if (((VolumeComponent)_lens).active)
			{
				SetParam(_lens, "intensity", Mathf.Clamp(value5, -1f, 1f));
			}
		}

		private static void UpdatePostFx(float level, float pulse)
		{
			float num = (Settings.PostFx.Value ? Mathf.Clamp01(level + 0.35f * pulse) : 0f);
			if (num < 0.004f)
			{
				if (_volReady && _volGo.activeSelf)
				{
					_volGo.SetActive(false);
				}
				return;
			}
			EnsureVolume();
			if (_volReady)
			{
				if (!_volGo.activeSelf)
				{
					_volGo.SetActive(true);
				}
				if ((Object)(object)_cam != (Object)null && (Object)(object)_cam != (Object)(object)_fxCam)
				{
					_fxCam = _cam;
					ConfigureVolumeLayer(_cam);
				}
				float num2 = Settings.Blur.Value * 1f + Settings.Contrast.Value * 0.013f + Settings.Desaturate.Value * 0.0171f + Settings.Chroma.Value * 3.1f + Settings.Distortion.Value * 5.3f;
				if (Mathf.Abs(num2 - _fxSig) > 0.0001f)
				{
					_fxSig = num2;
					ApplyProfile();
				}
				_volume.weight = num;
			}
		}

		private static void EnsureAudio()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (!_audioReady)
			{
				_audioReady = true;
				EnsureRoot();
				GameObject val = new GameObject("ring");
				val.transform.SetParent(_root.transform, false);
				_ring = val.AddComponent<AudioSource>();
				_ring.clip = GenRing();
				_ring.loop = true;
				_ring.playOnAwake = false;
				_ring.spatialBlend = 0f;
				_ring.volume = 0f;
				_ring.bypassListenerEffects = true;
				_ring.bypassReverbZones = true;
			}
			float unscaledTime = Time.unscaledTime;
			if ((!((Object)(object)_listener == (Object)null) && !((Object)(object)_lp == (Object)null)) || !(unscaledTime >= _nextListenerSearch))
			{
				return;
			}
			_nextListenerSearch = unscaledTime + 1f;
			_listener = Object.FindObjectOfType<AudioListener>();
			if ((Object)(object)_listener != (Object)null)
			{
				_lp = ((Component)_listener).gameObject.GetComponent<AudioLowPassFilter>();
				if ((Object)(object)_lp == (Object)null)
				{
					_lp = ((Component)_listener).gameObject.AddComponent<AudioLowPassFilter>();
				}
				_lp.lowpassResonanceQ = 1f;
				_lp.cutoffFrequency = 22000f;
				((Behaviour)_lp).enabled = false;
				MelonLogger.Msg("[Suppression] audio listener: " + ((Object)_listener).name);
			}
		}

		private static void UpdateAudio(float level)
		{
			EnsureAudio();
			if (!((Object)(object)_lp == (Object)null))
			{
				float num = Mathf.Clamp01(Settings.MuffleStrength.Value * Mathf.Max(level * 1.2f, _kick));
				if (num > 0.02f)
				{
					float num2 = Mathf.Clamp(Settings.MuffleMinHz.Value, 200f, 8000f);
					float cutoffFrequency = Mathf.Exp(Mathf.Lerp(Mathf.Log(22000f), Mathf.Log(num2), Mathf.Pow(num, 0.8f)));
					((Behaviour)_lp).enabled = true;
					_lp.cutoffFrequency = cutoffFrequency;
				}
				else
				{
					((Behaviour)_lp).enabled = false;
				}
			}
		}

		private static float RingEnv(float age, float dur)
		{
			if (dur <= 0f || age >= dur)
			{
				return 0f;
			}
			float num = Mathf.Clamp01(age / 0.04f);
			float num2 = 1f - age / dur;
			return num * num2 * Mathf.Sqrt(num2);
		}

		private static void TriggerRing(float impulse)
		{
			float num = Mathf.Clamp01(impulse / 0.6f);
			if (!(num < 0.15f))
			{
				num = Mathf.Pow(num, 1.3f);
				float num2 = _ringPeak * RingEnv(_ringAge, _ringDur);
				if (!(num < num2))
				{
					_ringPeak = num;
					_ringAge = 0f;
					_ringDur = Mathf.Max(0.15f, Settings.RingSeconds.Value) * (0.6f + 0.4f * num);
				}
			}
		}

		private static void UpdateRing(float dt)
		{
			if (_ringPeak <= 0f)
			{
				return;
			}
			_ringAge += dt;
			float num = RingEnv(_ringAge, _ringDur);
			EnsureAudio();
			if ((Object)(object)_ring == (Object)null)
			{
				return;
			}
			if (num <= 0.001f)
			{
				_ringPeak = 0f;
				if (_ring.isPlaying)
				{
					_ring.Stop();
				}
				return;
			}
			float num2 = Settings.RingVolume.Value * _ringPeak * num;
			if (num2 > 0.0005f)
			{
				if (!_ring.isPlaying)
				{
					_ring.Play();
				}
				_ring.volume = num2;
			}
		}

		private static void EnsureWhiz()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (_whiz == null)
			{
				EnsureRoot();
				_whiz = (AudioClip[])(object)new AudioClip[4]
				{
					GenWhiz(1),
					GenWhiz(2),
					GenWhiz(3),
					GenWhiz(4)
				};
				for (int i = 0; i < 6; i++)
				{
					GameObject val = new GameObject("whiz" + i);
					val.transform.SetParent(_root.transform, false);
					AudioSource val2 = val.AddComponent<AudioSource>();
					val2.playOnAwake = false;
					val2.loop = false;
					val2.spatialBlend = 1f;
					val2.dopplerLevel = 0f;
					val2.rolloffMode = (AudioRolloffMode)1;
					val2.minDistance = 1f;
					val2.maxDistance = 45f;
					_whizSources.Add(val2);
				}
			}
		}

		private static void PlayWhiz(Vector3 point, float dist)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			if (Settings.WhizEnabled.Value)
			{
				EnsureWhiz();
				if (_whizSources.Count != 0)
				{
					AudioSource obj = _whizSources[_whizNext];
					_whizNext = (_whizNext + 1) % _whizSources.Count;
					float num = Mathf.Clamp(1.1f - dist / Mathf.Max(1f, Settings.WhizDistance.Value), 0.15f, 1f);
					obj.Stop();
					((Component)obj).transform.position = point;
					obj.clip = _whiz[Random.Range(0, _whiz.Length)];
					obj.pitch = Random.Range(0.92f, 1.12f);
					obj.volume = Mathf.Clamp01(Settings.Whiz.Value * num);
					obj.Play();
				}
			}
		}

		private static void UpdateHeart(float level, float now)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			float value = Settings.Heart.Value;
			if (!(value <= 0.001f) && !(level < 0.3f))
			{
				if ((Object)(object)_heart == (Object)null)
				{
					EnsureRoot();
					GameObject val = new GameObject("heart");
					val.transform.SetParent(_root.transform, false);
					_heart = val.AddComponent<AudioSource>();
					_heart.clip = GenHeart();
					_heart.loop = false;
					_heart.playOnAwake = false;
					_heart.spatialBlend = 0f;
					_heart.bypassListenerEffects = true;
					_heart.bypassReverbZones = true;
				}
				if (!(now < _heartNext))
				{
					float num = Mathf.Lerp(72f, 125f, Mathf.Clamp01(level));
					_heartNext = now + 60f / num;
					_heart.volume = Mathf.Clamp01(value * Mathf.Clamp01((level - 0.2f) * 1.5f));
					_heart.Play();
				}
			}
		}

		private static float Smooth(float e0, float e1, float x)
		{
			float num = Mathf.Clamp01((x - e0) / (e1 - e0));
			return num * num * (3f - 2f * num);
		}

		private static Sprite MakeVignetteSprite(int size)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(size, size, (TextureFormat)4, false);
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num = ((float)j + 0.5f) / (float)size - 0.5f;
					float num2 = ((float)i + 0.5f) / (float)size - 0.5f;
					float x = Mathf.Sqrt(num * num + num2 * num2);
					float num3 = Smooth(0.22f, 0.62f, x);
					val.SetPixel(j, i, new Color(1f, 1f, 1f, num3));
				}
			}
			return FinishSprite(val);
		}

		private static Sprite MakeSolidSprite()
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(4, 4, (TextureFormat)4, false);
			for (int i = 0; i < 4; i++)
			{
				for (int j = 0; j < 4; j++)
				{
					val.SetPixel(j, i, new Color(1f, 1f, 1f, 1f));
				}
			}
			return FinishSprite(val);
		}

		private static Sprite FinishSprite(Texture2D tex)
		{
			//IL_0036: 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)
			((Texture)tex).wrapMode = (TextureWrapMode)1;
			((Texture)tex).filterMode = (FilterMode)1;
			((Object)tex).hideFlags = (HideFlags)32;
			tex.Apply(false);
			Sprite obj = Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), (float)((Texture)tex).width);
			((Object)obj).hideFlags = (HideFlags)32;
			return obj;
		}

		private static AudioClip GenRing()
		{
			int num = 88200;
			float[] array = new float[num];
			for (int i = 0; i < num; i++)
			{
				float num2 = (float)i / 44100f;
				float num3 = 0.85f + 0.15f * Mathf.Sin((float)Math.PI * 3f * num2);
				float num4 = 0.55f * Mathf.Sin((float)Math.PI * 14400f * num2) + 0.35f * Mathf.Sin((float)Math.PI * 10000f * num2) * num3;
				array[i] = num4 * 0.6f;
			}
			AudioClip obj = AudioClip.Create("ss_ring", num, 1, 44100, false);
			obj.SetData(new Il2CppStructArray<float>(array), 0);
			((Object)obj).hideFlags = (HideFlags)32;
			return obj;
		}

		private static AudioClip GenHeart()
		{
			int num = 18522;
			float[] array = new float[num];
			float num2 = 0.0001f;
			for (int i = 0; i < num; i++)
			{
				float num3 = (float)i / 44100f;
				float num4 = Mathf.Exp((0f - num3) * 26f) * (1f - Mathf.Exp((0f - num3) * 400f));
				float num5 = num3 - 0.17f;
				float num6 = ((num5 > 0f) ? (Mathf.Exp((0f - num5) * 30f) * (1f - Mathf.Exp((0f - num5) * 400f)) * 0.75f) : 0f);
				float num7 = Mathf.Abs(array[i] = Mathf.Sin((float)Math.PI * 124f * num3) * num4 + Mathf.Sin((float)Math.PI * 104f * Mathf.Max(0f, num5)) * num6);
				if (num7 > num2)
				{
					num2 = num7;
				}
			}
			float num8 = 0.9f / num2;
			for (int j = 0; j < num; j++)
			{
				array[j] *= num8;
			}
			AudioClip obj = AudioClip.Create("ss_heart", num, 1, 44100, false);
			obj.SetData(new Il2CppStructArray<float>(array), 0);
			((Object)obj).hideFlags = (HideFlags)32;
			return obj;
		}

		private static AudioClip GenWhiz(int seed)
		{
			float num = 0.4f;
			int num2 = (int)(44100f * num);
			float[] array = new float[num2];
			Random random = new Random(seed * 977);
			float num3 = 0f;
			float num4 = 0f;
			float num5 = 4200f + (float)random.NextDouble() * 1200f;
			float num6 = 1500f + (float)random.NextDouble() * 500f;
			float num7 = 0.22f;
			float num8 = 0.0001f;
			for (int i = 0; i < num2; i++)
			{
				float num9 = (float)i / 44100f;
				float num10 = num9 / num;
				float num11 = (float)(random.NextDouble() * 2.0 - 1.0);
				float num12 = Mathf.Lerp(num5, num6, Mathf.Pow(num10, 0.7f));
				float num13 = 2f * Mathf.Sin((float)Math.PI * num12 / 44100f);
				float num14 = num11 - num3 - num7 * num4;
				num4 += num13 * num14;
				num3 += num13 * num4;
				float num15 = Mathf.Exp((0f - num9) * 9f) * (1f - Mathf.Exp((0f - num9) * 250f));
				float num16 = ((num9 < 0.012f) ? (num11 * Mathf.Exp((0f - num9) * 350f) * 0.9f) : 0f);
				float num17 = Mathf.Abs(array[i] = num4 * num15 + num16);
				if (num17 > num8)
				{
					num8 = num17;
				}
			}
			float num18 = 0.85f / num8;
			for (int j = 0; j < num2; j++)
			{
				array[j] *= num18;
			}
			AudioClip obj = AudioClip.Create("ss_whiz" + seed, num2, 1, 44100, false);
			obj.SetData(new Il2CppStructArray<float>(array), 0);
			((Object)obj).hideFlags = (HideFlags)32;
			return obj;
		}
	}
}