Decompiled source of Audio Balancing v1.3.0

audio_balancing.dll

Decompiled 2 weeks ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("your_name")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Sample BepInEx plugin template for H3VR!")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("audio_balancing")]
[assembly: AssemblyTitle("BepInEx Plugin Title")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace plugin
{
	[BepInPlugin("Aiyke.Audio_balance", "Audio balancing", "1.2.0")]
	[BepInProcess("h3vr.exe")]
	public class audio_balance : BaseUnityPlugin
	{
		public static ConfigEntry<float> vol_master;

		public static ConfigEntry<float> vol_shots;

		public static ConfigEntry<float> vol_shot_mech;

		public static ConfigEntry<float> vol_handling;

		public static ConfigEntry<float> vol_amb;

		public static ConfigEntry<float> vol_casings;

		public static ConfigEntry<float> vol_reverb;

		public static ConfigEntry<float> vol_voices;

		private static float time_since_shot_fired = 0f;

		private static bool shot_sound_active = false;

		private static float t0 = 0f;

		private static float t1 = 0f;

		private static bool patch_clip_sets = false;

		private static bool log_volume = false;

		private static Stopwatch testtttttttt { get; } = new Stopwatch();

		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			vol_master = ((BaseUnityPlugin)this).Config.Bind<float>("Settings (may need scene reset or newly spawned weapon to take effect). Volume settings cannot be above 1 as Unity does not allow that.", "Master volume", 1.5f, "General volume, affects everything\nWARNING: values above 3 can lead to distortion.");
			vol_shots = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Shots", 1f, "Volume of shot sounds.");
			vol_shot_mech = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Shot mechanics", 0.5f, "Volume of mechanical sounds immediately following a shot.\nThis is usually the sound of the bolt snapping forward with automatic guns.\nA lower values makes the main shots sound more pronounced while firing.");
			vol_handling = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Handling", 1f, "Volume of handling/operation sounds.");
			vol_amb = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Ambience", 0.5f, "Volume of ambient sounds.\nSome ambient sounds are inaudibly quiet without this mod, so they have been adjusted a bit.\nReload the scene for changes to take effect.");
			vol_casings = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Casings", 1f, "Volume of empty casings.");
			vol_reverb = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Reverb", 1f, "Volume of reverb/echo/tails after shots.");
			vol_voices = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "Voices", 1f, "Volume of enemy voice lines.");
			Harmony.CreateAndPatchAll(typeof(audio_balance), (string)null);
			Logger.LogMessage((object)"audio_balance is active.");
		}

		private void Update()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			time_since_shot_fired += Time.deltaTime;
			if (time_since_shot_fired < 0.4f)
			{
				shot_sound_active = true;
			}
			else
			{
				shot_sound_active = false;
			}
		}

		private static AudioClip stereo_to_mono(AudioClip a)
		{
			Logger.LogInfo((object)("> stereo_to_mono <\n\ta.channels = " + a.channels + "\n\ta.samples = " + a.samples + "\n\ta.frequency = " + a.frequency));
			if (a.channels == 2)
			{
				Logger.LogInfo((object)"Stereo audio file detected.");
				int num = 0;
				if (Random.value > 0.5f)
				{
					num = 1;
				}
				Logger.LogInfo((object)("playing channel" + num + " "));
				float[] array = new float[a.samples * a.channels];
				Logger.LogInfo((object)"float[] samples = new float[a.samples * a.channels];");
				a.GetData(array, 0);
				Logger.LogInfo((object)"a.GetData(samples, 0);");
				float[] array2 = new float[a.samples];
				Logger.LogInfo((object)"float[] mono_samples = new float[a.samples];");
				Logger.LogInfo((object)"for (int i = 0; i < a.samples - 1; i++)...");
				for (int i = 1; i < a.samples - 1; i++)
				{
					array2[i] = Random.Range(-1f, 1f);
				}
				Logger.LogInfo((object)"mono_samples[i] = samples[i * a.samples + channel];");
				AudioClip obj = AudioClip.Create(((Object)a).name, a.samples, 1, a.frequency, true);
				Logger.LogInfo((object)" AudioClip mono_sound = AudioClip.Create(a.name + _mono_ + channel, a.samples, 1, a.frequency, false);");
				obj.SetData(array2, 0);
				Logger.LogInfo((object)"mono_sound.SetData(mono_samples, 0);");
				Logger.LogInfo((object)"return mono_sound...");
				return obj;
			}
			Logger.LogInfo((object)"Audio file is already mono.");
			return a;
		}

		[HarmonyPatch(typeof(FVRFireArm), "Awake")]
		[HarmonyPostfix]
		private static void patch_audio_clip_sets(FVRFireArm __instance)
		{
			if (((FVRInteractiveObject)__instance).IsHeld && log_volume)
			{
				Logger.LogDebug((object)("FVRFireArm_Awake_postix " + ((Object)__instance).name + " " + ((Object)__instance).GetInstanceID()));
				Logger.LogDebug((object)("AudioClipSet " + ((Object)__instance.AudioClipSet).name + "\n\t Shots_Main Vol = {" + __instance.AudioClipSet.Shots_Main.VolumeRange.x + ", " + __instance.AudioClipSet.Shots_Main.VolumeRange.y + "}\n\t BoltSlideBack Vol = {" + __instance.AudioClipSet.BoltSlideBack.VolumeRange.x + ", " + __instance.AudioClipSet.BoltSlideBack.VolumeRange.y + "}\n\t BoltSlideForward Vol = {" + __instance.AudioClipSet.BoltSlideForward.VolumeRange.x + ", " + __instance.AudioClipSet.BoltSlideForward.VolumeRange.y + "}"));
			}
		}

		[HarmonyPatch(typeof(AudioSourcePool), "PlayClipVolumePitchOverride")]
		[HarmonyPrefix]
		private static void SM_AudioSourcePool_PlayClipVolumePitchOverride_prefix(AudioSourcePool __instance, AudioEvent clipSet, Vector3 pos, Vector2 volumeOverride, Vector2 pitchOverride)
		{
			if (clipSet.Clips.Count != 0 && !((Object)clipSet.Clips[0]).name.StartsWith("Bot") && !((Object)clipSet.Clips[0]).name.StartsWith("bot") && log_volume)
			{
				Logger.LogDebug((object)"SM_AudioSourcePool_PlayClipVolumePitchOverride_prefix ");
				Logger.LogDebug((object)("AudioClipSet " + ((object)clipSet).GetHashCode() + "\n\t Clips[0] = " + ((Object)clipSet.Clips[0]).name + "\n\t clipSet.VolumeRange = {" + clipSet.VolumeRange.x + ", " + clipSet.VolumeRange.y + "}\n\t clipSet.PitchRange = {" + clipSet.PitchRange.x + ", " + clipSet.PitchRange.y + "}\n\t volumeOverride = {" + volumeOverride.x + ", " + volumeOverride.y + "}\n\t pitchOverride = {" + pitchOverride.x + ", " + pitchOverride.y + "}"));
			}
		}

		[HarmonyPatch(typeof(FVRFireArm), "PlayAudioEvent")]
		[HarmonyPrefix]
		private static bool PlayAudioEvent_prefix(FVRFireArm __instance, FirearmAudioEventType eType, float pitchmod = 1f)
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Invalid comparison between Unknown and I4
			//IL_0108: 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_0123: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Invalid comparison between Unknown and I4
			//IL_05be: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Invalid comparison between Unknown and I4
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Expected O, but got Unknown
			//IL_043e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Expected O, but got Unknown
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Expected I4, but got Unknown
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_082e: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0849: Unknown result type (might be due to invalid IL or missing references)
			//IL_0859: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1020: Unknown result type (might be due to invalid IL or missing references)
			//IL_102c: Unknown result type (might be due to invalid IL or missing references)
			//IL_103b: Unknown result type (might be due to invalid IL or missing references)
			//IL_104b: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_114c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1158: Unknown result type (might be due to invalid IL or missing references)
			//IL_1167: Unknown result type (might be due to invalid IL or missing references)
			//IL_1177: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_11fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_120d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1278: Unknown result type (might be due to invalid IL or missing references)
			//IL_1284: Unknown result type (might be due to invalid IL or missing references)
			//IL_1293: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_130e: Unknown result type (might be due to invalid IL or missing references)
			//IL_131a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1329: Unknown result type (might be due to invalid IL or missing references)
			//IL_1339: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_13b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_13bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_13cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_143a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1446: Unknown result type (might be due to invalid IL or missing references)
			//IL_1455: Unknown result type (might be due to invalid IL or missing references)
			//IL_1465: Unknown result type (might be due to invalid IL or missing references)
			//IL_14d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_14dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_14eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_14fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1566: Unknown result type (might be due to invalid IL or missing references)
			//IL_1572: Unknown result type (might be due to invalid IL or missing references)
			//IL_1581: Unknown result type (might be due to invalid IL or missing references)
			//IL_1591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aff: Unknown result type (might be due to invalid IL or missing references)
			//IL_15fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1608: Unknown result type (might be due to invalid IL or missing references)
			//IL_1617: Unknown result type (might be due to invalid IL or missing references)
			//IL_1627: Unknown result type (might be due to invalid IL or missing references)
			//IL_1692: Unknown result type (might be due to invalid IL or missing references)
			//IL_169e: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_16bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1728: Unknown result type (might be due to invalid IL or missing references)
			//IL_1734: Unknown result type (might be due to invalid IL or missing references)
			//IL_1743: Unknown result type (might be due to invalid IL or missing references)
			//IL_1753: Unknown result type (might be due to invalid IL or missing references)
			//IL_17be: Unknown result type (might be due to invalid IL or missing references)
			//IL_17ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_17d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_17e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_18c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_18d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_18e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_18f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1903: Unknown result type (might be due to invalid IL or missing references)
			//IL_191a: Unknown result type (might be due to invalid IL or missing references)
			//IL_185b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1867: Unknown result type (might be due to invalid IL or missing references)
			//IL_1876: Unknown result type (might be due to invalid IL or missing references)
			//IL_1886: Unknown result type (might be due to invalid IL or missing references)
			//IL_189d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a65: Unknown result type (might be due to invalid IL or missing references)
			//IL_19a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_19b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_19c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_19d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_19e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0912: Unknown result type (might be due to invalid IL or missing references)
			//IL_091e: Unknown result type (might be due to invalid IL or missing references)
			//IL_092d: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b61: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b86: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b96: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1af1: Unknown result type (might be due to invalid IL or missing references)
			//IL_1afd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b16: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b26: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_0718: Expected O, but got Unknown
			//IL_0a14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f60: Unknown result type (might be due to invalid IL or missing references)
			//IL_22ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_230b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2315: Unknown result type (might be due to invalid IL or missing references)
			//IL_2324: Unknown result type (might be due to invalid IL or missing references)
			//IL_2334: Unknown result type (might be due to invalid IL or missing references)
			//IL_234b: Unknown result type (might be due to invalid IL or missing references)
			//IL_228f: Unknown result type (might be due to invalid IL or missing references)
			//IL_229b: Unknown result type (might be due to invalid IL or missing references)
			//IL_22a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_22b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_22c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_22db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff6: Unknown result type (might be due to invalid IL or missing references)
			//IL_108c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1122: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_124e: Unknown result type (might be due to invalid IL or missing references)
			//IL_12e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_137a: Unknown result type (might be due to invalid IL or missing references)
			//IL_243a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2446: Unknown result type (might be due to invalid IL or missing references)
			//IL_245a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2469: Unknown result type (might be due to invalid IL or missing references)
			//IL_2479: Unknown result type (might be due to invalid IL or missing references)
			//IL_2490: Unknown result type (might be due to invalid IL or missing references)
			//IL_23c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_23d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_23e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_23ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_23fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_2413: Unknown result type (might be due to invalid IL or missing references)
			//IL_1410: Unknown result type (might be due to invalid IL or missing references)
			//IL_14a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_153c: Unknown result type (might be due to invalid IL or missing references)
			//IL_15d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1668: Unknown result type (might be due to invalid IL or missing references)
			//IL_16fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1794: Unknown result type (might be due to invalid IL or missing references)
			//IL_182a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2566: Unknown result type (might be due to invalid IL or missing references)
			//IL_2572: Unknown result type (might be due to invalid IL or missing references)
			//IL_257c: Unknown result type (might be due to invalid IL or missing references)
			//IL_258b: Unknown result type (might be due to invalid IL or missing references)
			//IL_259b: Unknown result type (might be due to invalid IL or missing references)
			//IL_251c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2528: Unknown result type (might be due to invalid IL or missing references)
			//IL_2537: Unknown result type (might be due to invalid IL or missing references)
			//IL_2547: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e29: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e38: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e48: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ddf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dee: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dfe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1970: Unknown result type (might be due to invalid IL or missing references)
			//IL_1abb: Unknown result type (might be due to invalid IL or missing references)
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bf3: Unknown result type (might be due to invalid IL or missing references)
			//IL_2028: Unknown result type (might be due to invalid IL or missing references)
			//IL_2034: Unknown result type (might be due to invalid IL or missing references)
			//IL_2043: Unknown result type (might be due to invalid IL or missing references)
			//IL_2053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
			//IL_2391: Unknown result type (might be due to invalid IL or missing references)
			//IL_24e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d08: Unknown result type (might be due to invalid IL or missing references)
			//IL_25dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_21ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_21d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_21e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_21f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_2208: Unknown result type (might be due to invalid IL or missing references)
			//IL_2218: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d03: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d19: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d28: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d38: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c93: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ca9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_2259: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f12: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f28: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f48: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f58: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f98: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fc2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_20c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_20cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_20e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_20fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_210a: Unknown result type (might be due to invalid IL or missing references)
			//IL_211a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d95: Unknown result type (might be due to invalid IL or missing references)
			//IL_2151: Unknown result type (might be due to invalid IL or missing references)
			//IL_215d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2178: Unknown result type (might be due to invalid IL or missing references)
			//IL_218c: Unknown result type (might be due to invalid IL or missing references)
			//IL_219b: Unknown result type (might be due to invalid IL or missing references)
			//IL_21ab: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)__instance).transform.position;
			int playerIFF = GM.CurrentPlayerBody.GetPlayerIFF();
			float num = 2f;
			if ((int)eType == 100)
			{
				float pitch = Random.Range((__instance.AudioClipSet.Shots_Main.PitchRange.x * 3f + __instance.AudioClipSet.Shots_Main.PitchRange.y * 2f) / 5f, (__instance.AudioClipSet.Shots_Main.PitchRange.y * 3f + __instance.AudioClipSet.Shots_Main.PitchRange.x * 2f) / 5f) * pitchmod;
				float spatialBlend = Random.Range(0.5f, 0.6f);
				float time = Random.Range(0f, 0.005f);
				float volume = (__instance.AudioClipSet.Shots_Main.VolumeRange.y + 0.2f + vol_shots.Value + vol_shots.Value) / 3f;
				AudioSource val = (AudioSource)new GameObject("One shot audio").AddComponent(typeof(AudioSource));
				((Component)val).transform.position = __instance.GetMuzzle().position;
				val.clip = __instance.AudioClipSet.Shots_Main.Clips[Random.Range(0, __instance.AudioClipSet.Shots_Main.Clips.Count)];
				val.spatialBlend = spatialBlend;
				val.volume = volume;
				val.pitch = pitch;
				val.time = time;
				val.Play();
				Object.Destroy((Object)(object)val, val.clip.length - val.time);
				shot_sound_active = true;
				time_since_shot_fired = 0f;
				GM.CurrentSceneSettings.OnPerceiveableSound(__instance.AudioClipSet.Loudness_Primary, __instance.AudioClipSet.Loudness_Primary * num * 1.2f, ((Component)__instance).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				return false;
			}
			if ((int)eType == 101)
			{
				if (__instance.AudioClipSet.Shots_Suppressed.Clips.Count == 0)
				{
					Logger.LogError((object)(((Object)__instance).name + " has no suppressed shot sound, but that's fine."));
				}
				AudioSource val2 = (AudioSource)new GameObject("One shot audio").AddComponent(typeof(AudioSource));
				((Component)val2).transform.position = __instance.GetMuzzle().position;
				val2.clip = __instance.AudioClipSet.Shots_Suppressed.Clips[Random.Range(0, __instance.AudioClipSet.Shots_Suppressed.Clips.Count)];
				val2.spatialBlend = 0.6f;
				val2.volume = __instance.AudioClipSet.Shots_Suppressed.VolumeRange.y * vol_shots.Value;
				val2.pitch = Random.Range((__instance.AudioClipSet.Shots_Suppressed.PitchRange.x + __instance.AudioClipSet.Shots_Suppressed.PitchRange.x + __instance.AudioClipSet.Shots_Suppressed.PitchRange.y) / 3f, (__instance.AudioClipSet.Shots_Suppressed.PitchRange.y + __instance.AudioClipSet.Shots_Suppressed.PitchRange.y + __instance.AudioClipSet.Shots_Suppressed.PitchRange.x) / 3f) * pitchmod;
				val2.Play();
				Object.Destroy((Object)(object)val2, val2.clip.length);
				shot_sound_active = true;
				time_since_shot_fired = 0f;
				GM.CurrentSceneSettings.OnPerceiveableSound(__instance.AudioClipSet.Loudness_Suppressed, __instance.AudioClipSet.Loudness_Suppressed * num * 1f, ((Component)__instance).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				return false;
			}
			if ((int)eType == 102)
			{
				_ = __instance.AudioClipSet.Shots_LowPressure.Clips.Count;
				AudioSource val3 = (AudioSource)new GameObject("One shot audio").AddComponent(typeof(AudioSource));
				((Component)val3).transform.position = __instance.GetMuzzle().position;
				val3.clip = __instance.AudioClipSet.Shots_LowPressure.Clips[Random.Range(0, __instance.AudioClipSet.Shots_LowPressure.Clips.Count)];
				val3.spatialBlend = 0.6f;
				val3.volume = __instance.AudioClipSet.Shots_LowPressure.VolumeRange.y * vol_shots.Value;
				val3.pitch = Random.Range((__instance.AudioClipSet.Shots_LowPressure.PitchRange.x + __instance.AudioClipSet.Shots_LowPressure.PitchRange.x + __instance.AudioClipSet.Shots_LowPressure.PitchRange.y) / 3f, (__instance.AudioClipSet.Shots_LowPressure.PitchRange.y + __instance.AudioClipSet.Shots_LowPressure.PitchRange.y + __instance.AudioClipSet.Shots_LowPressure.PitchRange.x) / 3f) * pitchmod;
				val3.Play();
				Object.Destroy((Object)(object)val3, val3.clip.length);
				shot_sound_active = true;
				time_since_shot_fired = 0f;
				GM.CurrentSceneSettings.OnPerceiveableSound(__instance.AudioClipSet.Loudness_Primary, __instance.AudioClipSet.Loudness_Primary * num * 1f, ((Component)__instance).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				return false;
			}
			if ((int)eType == 8)
			{
				return false;
			}
			bool flag = false;
			bool flag2 = __instance.IsLoaded();
			bool flag3 = false;
			if ((Object)(object)((Component)__instance).GetComponentInChildren<TubeFedShotgun>() != (Object)null && (int)((Component)__instance).GetComponentInChildren<TubeFedShotgun>().Mode == 0)
			{
				flag3 = true;
			}
			switch ((int)eType)
			{
			case 6:
				if (__instance.AudioClipSet.HammerHit.Clips.Count != 0)
				{
					GameObject val4 = new GameObject("One shot audio");
					val4.transform.position = position;
					AudioSource val5 = (AudioSource)val4.AddComponent(typeof(AudioSource));
					val5.clip = __instance.AudioClipSet.HammerHit.Clips[0];
					val5.spatialBlend = 0.8f;
					val5.volume = Random.Range(0.6f, 0.8f) * ((vol_shots.Value + vol_handling.Value) / 3f);
					val5.pitch = (__instance.AudioClipSet.HammerHit.PitchRange.x + __instance.AudioClipSet.HammerHit.PitchRange.y) / 2f;
					val5.Play();
					Object.Destroy((Object)(object)val5, val5.clip.length);
					if (__instance.m_fireWeaponHandlingPerceivableSounds)
					{
						GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, ((Component)__instance).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
					}
					return false;
				}
				break;
			case 2:
				__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideForwardHeld, position, __instance.AudioClipSet.BoltSlideForwardHeld.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BoltSlideForwardHeld.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 3:
				if (flag3)
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.Prefire, position, __instance.AudioClipSet.Prefire.VolumeRange * vol_handling.Value, __instance.AudioClipSet.Prefire.PitchRange, (AudioMixerGroup)null);
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideBackHeld, position, __instance.AudioClipSet.BoltSlideBackHeld.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BoltSlideBackHeld.PitchRange, (AudioMixerGroup)null);
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 9:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleGrab, position, __instance.AudioClipSet.HandleGrab.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleGrab.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(5f * __instance.AudioClipSet.Loudness_OperationMult, 5f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 11:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleForward, position, __instance.AudioClipSet.HandleForward.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleForward.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 40:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleForwardEmpty, position, __instance.AudioClipSet.HandleForwardEmpty.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleForwardEmpty.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(18f * __instance.AudioClipSet.Loudness_OperationMult, 18f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 10:
				if (!flag3)
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleBack, position, __instance.AudioClipSet.HandleBack.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBack.PitchRange, (AudioMixerGroup)null);
				}
				else
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.Prefire, position, __instance.AudioClipSet.HandleBack.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBack.PitchRange, (AudioMixerGroup)null);
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 41:
				if (!flag3)
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleBackEmpty, position, __instance.AudioClipSet.HandleBackEmpty.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBackEmpty.PitchRange, (AudioMixerGroup)null);
				}
				else
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.Prefire, position, __instance.AudioClipSet.HandleBackEmpty.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBackEmpty.PitchRange, (AudioMixerGroup)null);
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(16f * __instance.AudioClipSet.Loudness_OperationMult, 16f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 12:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleUp, position, __instance.AudioClipSet.HandleUp.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleUp.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 13:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleDown, position, __instance.AudioClipSet.HandleDown.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleDown.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 14:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.Safety, position, __instance.AudioClipSet.Safety.VolumeRange * vol_handling.Value, __instance.AudioClipSet.Safety.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(5f * __instance.AudioClipSet.Loudness_OperationMult, 5f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 15:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.FireSelector, position, __instance.AudioClipSet.FireSelector.VolumeRange * vol_handling.Value, __instance.AudioClipSet.FireSelector.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(5f * __instance.AudioClipSet.Loudness_OperationMult, 5f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 17:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BreachOpen, position, __instance.AudioClipSet.BreachOpen.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BreachOpen.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 18:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BreachClose, position, __instance.AudioClipSet.BreachClose.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BreachClose.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 20:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.MagazineIn, position, __instance.AudioClipSet.MagazineIn.VolumeRange * vol_handling.Value, __instance.AudioClipSet.MagazineIn.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 21:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.MagazineOut, position, __instance.AudioClipSet.MagazineOut.VolumeRange * vol_handling.Value, __instance.AudioClipSet.MagazineOut.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 22:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.TopCoverRelease, position, __instance.AudioClipSet.TopCoverRelease.VolumeRange * vol_handling.Value, __instance.AudioClipSet.TopCoverRelease.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 23:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.TopCoverUp, position, __instance.AudioClipSet.TopCoverUp.VolumeRange * vol_handling.Value, __instance.AudioClipSet.TopCoverUp.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 24:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.TopCoverDown, position, __instance.AudioClipSet.TopCoverDown.VolumeRange * vol_handling.Value, __instance.AudioClipSet.TopCoverDown.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 30:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.StockOpen, position, __instance.AudioClipSet.StockOpen.VolumeRange * vol_handling.Value, __instance.AudioClipSet.StockOpen.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 31:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.StockClosed, position, __instance.AudioClipSet.StockClosed.VolumeRange * vol_handling.Value, __instance.AudioClipSet.StockClosed.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 32:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BipodOpen, position, __instance.AudioClipSet.BipodOpen.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BipodOpen.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 33:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BipodClosed, position, __instance.AudioClipSet.BipodClosed.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BipodClosed.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 42:
				__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.ChamberManual, position, __instance.AudioClipSet.ChamberManual.VolumeRange * vol_handling.Value, __instance.AudioClipSet.ChamberManual.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 50:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BeltGrab, position, __instance.AudioClipSet.BeltGrab.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BeltGrab.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 51:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BeltRelease, position, __instance.AudioClipSet.BeltRelease.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BeltRelease.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 52:
				__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BeltSeat, position, __instance.AudioClipSet.BeltSeat.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BeltSeat.PitchRange, (AudioMixerGroup)null);
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(10f * __instance.AudioClipSet.Loudness_OperationMult, 10f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 0:
				if (!shot_sound_active)
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideForward, position, __instance.AudioClipSet.BoltSlideForward.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BoltSlideForward.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideForward.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideForward, position, __instance.AudioClipSet.BoltSlideForward.VolumeRange * Random.Range(0.9f, 1f) * vol_shot_mech.Value, __instance.AudioClipSet.BoltSlideForward.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideForward.VolumeRange;
					Random.Range(0.9f, 1f);
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.99f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			case 1:
				if (!shot_sound_active)
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideBack, position, __instance.AudioClipSet.BoltSlideBack.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BoltSlideBack.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideBack.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideBack, position, __instance.AudioClipSet.BoltSlideBack.VolumeRange * Random.Range(0.8f, 0.9f) * vol_shot_mech.Value, __instance.AudioClipSet.BoltSlideBack.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideBack.VolumeRange;
					Random.Range(0.8f, 0.9f);
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			case 4:
				if (!shot_sound_active)
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideBackLocked, position, __instance.AudioClipSet.BoltSlideBackLocked.VolumeRange * vol_handling.Value * 0.8f, __instance.AudioClipSet.BoltSlideBackLocked.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideBackLocked.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideBackLocked, position, __instance.AudioClipSet.BoltSlideBackLocked.VolumeRange * 0.6f * vol_shot_mech.Value, __instance.AudioClipSet.BoltSlideBackLocked.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.BoltSlideBackLocked.VolumeRange;
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				return false;
			case 5:
			{
				if (__instance.AudioClipSet.CatchOnSear == null || __instance.AudioClipSet.CatchOnSear.Clips.Count == 0)
				{
					break;
				}
				for (int i = 0; i < __instance.AudioClipSet.CatchOnSear.Clips.Count; i++)
				{
					if ((Object)(object)__instance.AudioClipSet.CatchOnSear.Clips[i] == (Object)null)
					{
						return false;
					}
				}
				if (!shot_sound_active)
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.CatchOnSear, position, __instance.AudioClipSet.CatchOnSear.VolumeRange * 0.9f * vol_handling.Value, __instance.AudioClipSet.CatchOnSear.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.CatchOnSear.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.CatchOnSear, position, __instance.AudioClipSet.CatchOnSear.VolumeRange * 0.7f * vol_shot_mech.Value, __instance.AudioClipSet.CatchOnSear.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.CatchOnSear.VolumeRange;
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(15f * __instance.AudioClipSet.Loudness_OperationMult, 15f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			}
			case 7:
				if (flag3)
				{
					if (__instance.IsLoaded())
					{
						__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleBack, position, __instance.AudioClipSet.HandleBack.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBack.PitchRange, (AudioMixerGroup)null);
					}
					else
					{
						__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.HandleBackEmpty, position, __instance.AudioClipSet.HandleBackEmpty.VolumeRange * vol_handling.Value, __instance.AudioClipSet.HandleBackEmpty.PitchRange, (AudioMixerGroup)null);
					}
					if (__instance.m_fireWeaponHandlingPerceivableSounds)
					{
						GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.9f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
					}
					break;
				}
				if (!shot_sound_active || flag2)
				{
					if (__instance.AudioClipSet.Prefire.Clips.Count == 0 && __instance.AudioClipSet.CatchOnSear.Clips.Count != 0)
					{
						if (__instance.AudioClipSet.BoltSlideForwardHeld.Clips.Count != 0)
						{
							__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideForwardHeld, position, __instance.AudioClipSet.BoltSlideForwardHeld.VolumeRange * 0.7f * ((vol_shot_mech.Value + vol_handling.Value) / 2f), __instance.AudioClipSet.BoltSlideForwardHeld.PitchRange, (AudioMixerGroup)null);
						}
						if (__instance.AudioClipSet.BoltRelease.Clips.Count != 0)
						{
							__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltRelease, position, __instance.AudioClipSet.BoltRelease.VolumeRange * 0.7f * ((vol_shot_mech.Value + vol_handling.Value) / 2f), __instance.AudioClipSet.BoltRelease.PitchRange, (AudioMixerGroup)null);
						}
						if (__instance.AudioClipSet.BoltRelease.Clips.Count == 0 && __instance.AudioClipSet.BoltSlideForwardHeld.Clips.Count != 0)
						{
						}
					}
					else
					{
						__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.Prefire, position, __instance.AudioClipSet.Prefire.VolumeRange * vol_handling.Value, __instance.AudioClipSet.Prefire.PitchRange, (AudioMixerGroup)null);
					}
				}
				else if (__instance.AudioClipSet.Prefire.Clips.Count == 0 && __instance.AudioClipSet.CatchOnSear.Clips.Count != 0)
				{
					if (__instance.AudioClipSet.BoltRelease.Clips.Count != 0)
					{
						__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltRelease, position, __instance.AudioClipSet.BoltRelease.VolumeRange / ((vol_handling.Value + 1f) / 2f) * Random.Range(0.7f, 0.9f) * vol_shot_mech.Value, __instance.AudioClipSet.BoltRelease.PitchRange, (AudioMixerGroup)null);
					}
					if (__instance.AudioClipSet.BoltSlideForwardHeld.Clips.Count != 0)
					{
						__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.BoltSlideForwardHeld, position, __instance.AudioClipSet.BoltSlideForwardHeld.VolumeRange / ((vol_handling.Value + 1f) / 2f) * Random.Range(0.7f, 0.9f) * vol_shot_mech.Value, __instance.AudioClipSet.BoltSlideForwardHeld.PitchRange, (AudioMixerGroup)null);
					}
				}
				else
				{
					__instance.m_pool_mechanics.PlayClipVolumePitchOverride(__instance.AudioClipSet.Prefire, position, __instance.AudioClipSet.Prefire.VolumeRange / vol_handling.Value * Random.Range(0.7f, 1f) * vol_shot_mech.Value, __instance.AudioClipSet.Prefire.PitchRange, (AudioMixerGroup)null);
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(20f * __instance.AudioClipSet.Loudness_OperationMult, 20f * __instance.AudioClipSet.Loudness_OperationMult * 0.9f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			case 16:
				if (!shot_sound_active)
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.TriggerReset, position, __instance.AudioClipSet.TriggerReset.VolumeRange * 0.8f * vol_handling.Value, __instance.AudioClipSet.TriggerReset.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.TriggerReset.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.TriggerReset, position, __instance.AudioClipSet.TriggerReset.VolumeRange * 0.7f * vol_shot_mech.Value, __instance.AudioClipSet.TriggerReset.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.TriggerReset.VolumeRange;
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(5f * __instance.AudioClipSet.Loudness_OperationMult, 5f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			case 29:
				if (!shot_sound_active)
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.MagazineEjectRound, position, __instance.AudioClipSet.MagazineEjectRound.VolumeRange * vol_handling.Value * 0.6f, __instance.AudioClipSet.MagazineEjectRound.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.MagazineEjectRound.VolumeRange;
					_ = vol_handling.Value;
				}
				else
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.MagazineEjectRound, position, __instance.AudioClipSet.MagazineEjectRound.VolumeRange * Random.Range(0.5f, 0.8f) * vol_shot_mech.Value, __instance.AudioClipSet.MagazineEjectRound.PitchRange, (AudioMixerGroup)null);
					_ = __instance.AudioClipSet.MagazineEjectRound.VolumeRange;
					Random.Range(0.5f, 0.8f);
					_ = vol_shot_mech.Value;
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(6f * __instance.AudioClipSet.Loudness_OperationMult, 6f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			case 53:
				if (!shot_sound_active)
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BeltSettle, position, __instance.AudioClipSet.BeltSettle.VolumeRange * vol_handling.Value, __instance.AudioClipSet.BeltSettle.PitchRange, (AudioMixerGroup)null);
				}
				else
				{
					__instance.m_pool_handling.PlayClipVolumePitchOverride(__instance.AudioClipSet.BeltSettle, position, __instance.AudioClipSet.BeltSettle.VolumeRange * 0.8f * vol_shot_mech.Value, __instance.AudioClipSet.BeltSettle.PitchRange, (AudioMixerGroup)null);
				}
				if (__instance.m_fireWeaponHandlingPerceivableSounds)
				{
					GM.CurrentSceneSettings.OnPerceiveableSound(8f * __instance.AudioClipSet.Loudness_OperationMult, 8f * __instance.AudioClipSet.Loudness_OperationMult * 0.5f, position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
				}
				flag = true;
				break;
			}
			if (flag)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(FVRPlayerBody), "Update")]
		[HarmonyPostfix]
		private static void UpdateFVRPlayerBody_postix(FVRPlayerBody __instance)
		{
			AudioListener.volume *= vol_master.Value;
		}

		[HarmonyPatch(typeof(FVRAmbienceController), "Start")]
		[HarmonyPostfix]
		private static void FVRAmbienceControllerStart_postix(FVRAmbienceController __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: 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_021a: 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_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_0529: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0626: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_0657: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0409: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0712: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_072e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0733: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_0757: Unknown result type (might be due to invalid IL or missing references)
			//IL_076a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0775: Unknown result type (might be due to invalid IL or missing references)
			//IL_078b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0796: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0804: Unknown result type (might be due to invalid IL or missing references)
			//IL_080f: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			Logger.LogDebug((object)("active_scene.name = " + ((Scene)(ref activeScene)).name));
			Logger.LogDebug((object)("#AmbienceClips = " + __instance.AmbienceClips.Capacity));
			for (int i = 0; i < __instance.AmbienceClips.Capacity; i++)
			{
				Logger.LogDebug((object)("AmbienceClip[" + i + "].name = " + ((Object)__instance.AmbienceClips[i]).name));
			}
			if (((Scene)(ref activeScene)).name == "TakeAndHoldClassic")
			{
				for (int j = 0; j < __instance.AmbienceClips.Capacity; j++)
				{
					if (((Object)__instance.AmbienceClips[j]).name == "Level_TakeAndHold_MainHalls")
					{
						GameObject val = new GameObject("One shot audio");
						val.transform.position = Vector3.zero;
						AudioSource val2 = (AudioSource)val.AddComponent(typeof(AudioSource));
						val2.clip = __instance.AmbienceClips[j];
						val2.spatialBlend = 0f;
						val2.volume = 0.8f * vol_amb.Value;
						val2.pitch = 1f;
						val2.loop = true;
						val2.Play();
						GameObject val3 = new GameObject("One shot audio");
						val3.transform.position = Vector3.zero;
						AudioSource val4 = (AudioSource)val3.AddComponent(typeof(AudioSource));
						val4.clip = __instance.AmbienceClips[j];
						val4.spatialBlend = 0f;
						val4.volume = 0.6f * vol_amb.Value;
						val4.pitch = 0.75f;
						val4.loop = true;
						val4.Play();
					}
				}
			}
			if (((Scene)(ref activeScene)).name == "TakeAndHold_WinterWasteland")
			{
				for (int k = 0; k < __instance.AmbienceClips.Capacity; k++)
				{
					if (((Object)__instance.AmbienceClips[k]).name == "Level_WurstWorld_Open")
					{
						GameObject val5 = new GameObject("One shot audio");
						val5.transform.position = Vector3.zero;
						AudioSource val6 = (AudioSource)val5.AddComponent(typeof(AudioSource));
						val6.clip = __instance.AmbienceClips[k];
						val6.spatialBlend = 0f;
						val6.volume = 0.8f * vol_amb.Value;
						val6.pitch = 1f;
						val6.loop = true;
						val6.Play();
						GameObject val7 = new GameObject("One shot audio");
						val7.transform.position = Vector3.zero;
						AudioSource val8 = (AudioSource)val7.AddComponent(typeof(AudioSource));
						val8.clip = __instance.AmbienceClips[k];
						val8.spatialBlend = 0f;
						val8.volume = 0.7f * vol_amb.Value;
						val8.pitch = 0.6f;
						val8.loop = true;
						val8.Play();
					}
					if (((Object)__instance.AmbienceClips[k]).name == "Level_WurstWorld_Enclosed")
					{
						GameObject val9 = new GameObject("One shot audio");
						val9.transform.position = Vector3.zero;
						AudioSource val10 = (AudioSource)val9.AddComponent(typeof(AudioSource));
						val10.clip = __instance.AmbienceClips[k];
						val10.spatialBlend = 0f;
						val10.volume = 0.9f * vol_amb.Value;
						val10.pitch = 1f;
						val10.loop = true;
						val10.Play();
						GameObject val11 = new GameObject("One shot audio");
						val11.transform.position = Vector3.zero;
						AudioSource val12 = (AudioSource)val11.AddComponent(typeof(AudioSource));
						val12.clip = __instance.AmbienceClips[k];
						val12.spatialBlend = 0f;
						val12.volume = 0.8f * vol_amb.Value;
						val12.pitch = 0.7f;
						val12.loop = true;
						val12.Play();
					}
					if (((Object)__instance.AmbienceClips[k]).name == "rotw_Wind_Heavy_Loop_05")
					{
						__instance.AmbienceVolumes[k] *= 0.5f;
					}
				}
			}
			if (((Scene)(ref activeScene)).name == "GP_Sandtrap")
			{
				for (int l = 0; l < __instance.AmbienceClips.Capacity; l++)
				{
					if (((Object)__instance.AmbienceClips[l]).name == "Level_Arizona_Day")
					{
						GameObject val13 = new GameObject("One shot audio");
						val13.transform.position = Vector3.zero;
						AudioSource val14 = (AudioSource)val13.AddComponent(typeof(AudioSource));
						val14.clip = __instance.AmbienceClips[l];
						val14.spatialBlend = 0.1f;
						val14.volume = 0.9f * vol_amb.Value;
						val14.pitch = 1f;
						val14.loop = true;
						val14.Play();
						GameObject val15 = new GameObject("One shot audio");
						val15.transform.position = Vector3.zero;
						AudioSource val16 = (AudioSource)val15.AddComponent(typeof(AudioSource));
						val16.clip = __instance.AmbienceClips[l];
						val16.spatialBlend = 0f;
						val16.volume = 0.7f * vol_amb.Value;
						val16.pitch = 1f;
						val16.loop = true;
						val16.Play();
						GameObject val17 = new GameObject("One shot audio");
						val17.transform.position = Vector3.zero;
						AudioSource val18 = (AudioSource)val17.AddComponent(typeof(AudioSource));
						val18.clip = __instance.AmbienceClips[l];
						val18.spatialBlend = 0f;
						val18.volume = 0.5f * vol_amb.Value;
						val18.pitch = 1.2f;
						val18.loop = true;
						val18.Play();
						GameObject val19 = new GameObject("One shot audio");
						val19.transform.position = Vector3.zero;
						AudioSource val20 = (AudioSource)val19.AddComponent(typeof(AudioSource));
						val20.clip = __instance.AmbienceClips[l];
						val20.spatialBlend = 0f;
						val20.volume = 0.6f * vol_amb.Value;
						val20.pitch = 0.75f;
						val20.loop = true;
						val20.Play();
					}
					if (((Object)__instance.AmbienceClips[l]).name == "Level_WurstWorld_Open")
					{
						GameObject val21 = new GameObject("One shot audio");
						val21.transform.position = Vector3.zero;
						AudioSource val22 = (AudioSource)val21.AddComponent(typeof(AudioSource));
						val22.clip = __instance.AmbienceClips[l];
						val22.spatialBlend = 0.1f;
						val22.volume = 0.8f * vol_amb.Value;
						val22.pitch = 1f;
						val22.loop = true;
						val22.Play();
						GameObject val23 = new GameObject("One shot audio");
						val23.transform.position = Vector3.zero;
						AudioSource val24 = (AudioSource)val23.AddComponent(typeof(AudioSource));
						val24.clip = __instance.AmbienceClips[l];
						val24.spatialBlend = 0.1f;
						val24.volume = 0.5f * vol_amb.Value;
						val24.pitch = 1.2f;
						val24.loop = true;
						val24.Play();
						GameObject val25 = new GameObject("One shot audio");
						val25.transform.position = Vector3.zero;
						AudioSource val26 = (AudioSource)val25.AddComponent(typeof(AudioSource));
						val26.clip = __instance.AmbienceClips[l];
						val26.spatialBlend = 0f;
						val26.volume = 0.5f * vol_amb.Value;
						val26.pitch = 0.75f;
						val26.loop = true;
						val26.Play();
					}
				}
			}
			__instance.MaxVolume = 1f * vol_amb.Value;
		}

		[HarmonyPatch(typeof(FVRPlayerBody), "Start")]
		[HarmonyPostfix]
		private static void FVRPlayerBodyStart_postix(FVRPlayerBody __instance)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_0083: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: 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_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: 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_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			AudioClip clip = null;
			AudioSource[] array = Object.FindObjectsOfType<AudioSource>();
			for (int i = 0; i < array.Length; i++)
			{
				if ((Object)(object)array[i].clip != (Object)null && ((Object)array[i]).name == "_AmbientAudio")
				{
					clip = array[i].clip;
				}
			}
			for (int j = 1; j < 3; j++)
			{
				GameObject val = new GameObject("One shot audio");
				val.transform.position = ((Component)GM.CurrentPlayerBody.FilteredHead).transform.position;
				AudioSource val2 = (AudioSource)val.AddComponent(typeof(AudioSource));
				val2.clip = clip;
				val2.spatialBlend = 0f;
				val2.volume = 0.8f * vol_amb.Value;
				val2.pitch = 1f;
				val2.loop = true;
				val2.Play();
			}
			GameObject val3 = new GameObject("One shot audio");
			val3.transform.position = ((Component)GM.CurrentPlayerBody.FilteredHead).transform.position;
			AudioSource val4 = (AudioSource)val3.AddComponent(typeof(AudioSource));
			val4.clip = clip;
			val4.spatialBlend = 0f;
			val4.volume = 0.7f * vol_amb.Value;
			val4.pitch = 0.8f;
			val4.loop = true;
			val4.Play();
			GameObject val5 = new GameObject("One shot audio");
			val5.transform.position = ((Component)GM.CurrentPlayerBody.FilteredHead).transform.position;
			AudioSource val6 = (AudioSource)val5.AddComponent(typeof(AudioSource));
			val6.clip = clip;
			val6.spatialBlend = 0f;
			val6.volume = 0.5f * vol_amb.Value;
			val6.pitch = 0.6f;
			val6.loop = true;
			val6.Play();
			AudioSource[] array2 = Object.FindObjectsOfType<AudioSource>();
			if (array2.Length == 0 || array2 == null)
			{
				return;
			}
			for (int k = 0; k < array2.Length; k++)
			{
				if ((Object)(object)array2[k] != (Object)null && (Object)(object)array2[k].clip != (Object)null && ((Object)array2[k].clip).name == "Wind_Falling_Loop_1")
				{
					Vector3 position = GM.CurrentPlayerBody.Head.position;
					for (int l = 0; l < 4; l++)
					{
						AudioSource val7 = (AudioSource)new GameObject("One shot audio").AddComponent(typeof(AudioSource));
						val7.clip = array2[k].clip;
						position = GM.CurrentPlayerBody.Head.position + Random.onUnitSphere * Random.Range(50f, 500f);
						position.y /= 2f;
						((Component)val7).transform.position = position;
						val7.spatialBlend = 0.9f;
						val7.maxDistance = 200f;
						val7.volume = 0.5f * vol_amb.Value;
						val7.pitch = Random.Range(0.2f, 0.8f);
						val7.loop = true;
						val7.Play();
					}
					break;
				}
			}
		}

		[HarmonyPatch(typeof(FVRPooledAudioSource), "Play")]
		[HarmonyPostfix]
		private static void FVRPooledAudioSource_Play_postfix(FVRPooledAudioSource __instance)
		{
			if (((Object)__instance).name == "PooledSource_Casings" || ((Object)__instance).name == "PooledSource_Casings(Clone)")
			{
				AudioSource source = __instance.Source;
				source.volume *= vol_casings.Value;
			}
			else if (((Object)__instance).name == "PooledSource_NPCBarks" || ((Object)__instance).name == "PooledSource_NPCBarks(Clone)")
			{
				AudioSource source2 = __instance.Source;
				source2.volume *= vol_voices.Value;
			}
			else if (((Object)__instance).name == "PooledSource_GunTail" || ((Object)__instance).name == "PooledSource_GunTail(Clone)")
			{
				AudioSource source3 = __instance.Source;
				source3.volume *= vol_reverb.Value;
			}
		}
	}
}
namespace plugin.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("plugin.Properties.Resources", typeof(Resources).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal Resources()
		{
		}
	}
}