Decompiled source of UltraVoice v0.9.7

UltraVoice.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using ULTRAKILL.Cheats;
using UltraVoice.Characters;
using UltraVoice.Utilities;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("UltraVoice")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UltraVoice")]
[assembly: AssemblyTitle("UltraVoice")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace UltraVoice
{
	[BepInPlugin("com.yourname.ultravoice", "UltraVoice", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class UltraVoicePlugin : BaseUnityPlugin
	{
		public enum SwordsmachineVoiceActor
		{
			Mof,
			Noto
		}

		[CompilerGenerated]
		private sealed class <DelayedVox>d__26 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Action playAction;

			public Func<bool> ready;

			public Component attached;

			private float <waited>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedVox>d__26(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<waited>5__1 = 0f;
					break;
				case 1:
					<>1__state = -1;
					<waited>5__1 += 0.1f;
					break;
				}
				if (!ready() && <waited>5__1 < 2f)
				{
					if ((Object)(object)attached == (Object)null)
					{
						return false;
					}
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				}
				if (ready() && (Object)(object)attached != (Object)null)
				{
					playAction();
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static UltraVoicePlugin Instance;

		public static VoiceManager VoiceManager;

		private PluginConfigurator config;

		public static BoolField CerberusVoiceEnabled;

		public static BoolField SwordsmachineVoiceEnabled;

		public static BoolField V2VoiceEnabled;

		public static BoolField StreetcleanerVoiceEnabled;

		public static BoolField MindflayerVoiceEnabled;

		public static BoolField VirtueVoiceEnabled;

		public static BoolField FerrymanVoiceEnabled;

		public static BoolField GuttermanVoiceEnabled;

		public static BoolField MannequinVoiceEnabled;

		public static BoolField GuttertankVoiceEnabled;

		public static FloatField VoiceVolume;

		public static FloatField VoiceCooldown;

		public static EnumField<SwordsmachineVoiceActor> SwordsmachineVoiceActorField;

		public static ConfigPanel TogglesPanel;

		public static ConfigPanel SlidersPanel;

		public static ConfigPanel ActorPanel;

		private static Dictionary<ICharacter, Dictionary<string, AudioClip[]>> characterVoiceLines = new Dictionary<ICharacter, Dictionary<string, AudioClip[]>>();

		private void Awake()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Expected O, but got Unknown
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			VoiceManager = new VoiceManager();
			config = PluginConfigurator.Create("UltraVoice", "com.yourname.ultravoice");
			config.SetIconWithURL("https://storage.filebin.net/filebin/b20425983c28fd7feab09818ce6af10c2e766bd0e547ab3bd40a9709c9474171?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GK352fd2505074fc9dde7fd2cb%2F20260331%2Fhel1-dc4%2Fs3%2Faws4_request&X-Amz-Date=20260331T220455Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&response-cache-control=max-age%3D900&response-content-disposition=inline%3B%20filename%3D%22icon.png%22&response-content-type=image%2Fpng&x-id=GetObject&X-Amz-Signature=965a1e646897a43091c19c99eaae70175fefe00de01754a84238fa971ba6780b");
			TogglesPanel = new ConfigPanel(config.rootPanel, "Enemy Line Toggles", "toggles");
			SlidersPanel = new ConfigPanel(config.rootPanel, "Audio Settings", "sliders");
			ActorPanel = new ConfigPanel(config.rootPanel, "Voice Actors", "actors");
			CerberusVoiceEnabled = new BoolField(TogglesPanel, "Enable Cerberus Voice Lines", "cerberusvoice", true);
			SwordsmachineVoiceEnabled = new BoolField(TogglesPanel, "Enable Swordsmachine Voice Lines", "swordsmachinevoice", true);
			V2VoiceEnabled = new BoolField(TogglesPanel, "Enable V2 Voice Lines", "v2voice", true);
			StreetcleanerVoiceEnabled = new BoolField(TogglesPanel, "Enable Streetcleaner Voice Lines", "streetcleanervoice", true);
			MindflayerVoiceEnabled = new BoolField(TogglesPanel, "Enable Mindflayer Voice Lines", "mindflayervoice", true);
			VirtueVoiceEnabled = new BoolField(TogglesPanel, "Enable Virtue Voice Lines", "virtuevoice", true);
			FerrymanVoiceEnabled = new BoolField(TogglesPanel, "Enable Ferryman Voice Lines", "ferrymanvoice", true);
			GuttermanVoiceEnabled = new BoolField(TogglesPanel, "Enable Gutterman Voice Lines", "guttermanvoice", true);
			MannequinVoiceEnabled = new BoolField(TogglesPanel, "Enable Mannequin Voice Lines", "mannequinvoice", true);
			GuttertankVoiceEnabled = new BoolField(TogglesPanel, "Enable Guttertank Voice Lines", "guttertankvoice", true);
			VoiceVolume = new FloatField(SlidersPanel, "Voice Line Volume", "volume", 1f, 0f, 1f);
			VoiceCooldown = new FloatField(SlidersPanel, "Voice Cooldown", "cooldown", 0.25f, 0f, 1f);
			SwordsmachineVoiceActorField = new EnumField<SwordsmachineVoiceActor>(ActorPanel, "Swordsmachine Voice Actor", "smvoiceactor", SwordsmachineVoiceActor.Mof);
			SwordsmachineVoiceActorField.SetEnumDisplayName(SwordsmachineVoiceActor.Mof, "Mof");
			SwordsmachineVoiceActorField.SetEnumDisplayName(SwordsmachineVoiceActor.Noto, "Noto");
			LoadAssets();
			new Harmony("com.yourname.ultravoice").PatchAll();
			SceneManager.sceneLoaded += OnSceneLoaded;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"UltraVoice loaded successfully!");
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			ResetCharacterStates();
		}

		private void ResetCharacterStates()
		{
			Swordsmachine.FirstFightDone = false;
			V2Character.V2IntroTime = -999f;
			V2Character.V2CutsceneVoicePlayed = false;
			V2Character.V2SecondVoiceRestartPlayed = false;
			V2Character.V2DeathPlayed = false;
			FerrymanCharacter.FerrymanCoinTossed = false;
			FerrymanCharacter.FerrymanPhaseChangePlayed = false;
			GuttertankCharacter.GuttertankSpawnInMirror = false;
		}

		private void LoadAssets()
		{
			string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "ultravoiceassets");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			if ((Object)(object)val == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"UltraVoice: Failed to load asset bundle.");
				return;
			}
			Cerberus.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			Swordsmachine.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			V2Character.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			MindflayerCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			VirtueCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			StreetcleanerCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			FerrymanCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			MannequinCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			GuttermanCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
			GuttertankCharacter.LoadVoiceLines(val, ((BaseUnityPlugin)this).Logger);
		}

		public static AudioClip LoadClip(AssetBundle bundle, string name)
		{
			AudioClip val = bundle.LoadAsset<AudioClip>(name);
			if ((Object)(object)val == (Object)null)
			{
				((BaseUnityPlugin)Instance).Logger.LogWarning((object)("UltraVoice missing clip: " + name));
			}
			return val;
		}

		[IteratorStateMachine(typeof(<DelayedVox>d__26))]
		public static IEnumerator DelayedVox(Action playAction, Func<bool> ready, Component attached)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedVox>d__26(0)
			{
				playAction = playAction,
				ready = ready,
				attached = attached
			};
		}
	}
}
namespace UltraVoice.Utilities
{
	public class VoiceManager
	{
		private static float lastVoiceTime = -999f;

		private static Dictionary<int, float> enemyVoiceCooldown = new Dictionary<int, float>();

		public static Dictionary<Component, float> spawnVoiceEndTimes = new Dictionary<Component, float>();

		public static Dictionary<Component, float> enemySpawnTimes = new Dictionary<Component, float>();

		public static Color GetEnemyTypeColor(EnemyType enemyType)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_000a: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected I4, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected I4, but got Unknown
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			if (1 == 0)
			{
			}
			Color result;
			if ((int)enemyType <= 9)
			{
				if ((int)enemyType != 0)
				{
					switch (enemyType - 5)
					{
					case 2:
						break;
					case 1:
						goto IL_0072;
					case 0:
						goto IL_00a6;
					case 4:
						goto IL_00bd;
					default:
						goto IL_0130;
					}
					result = new Color(0.91f, 0.6f, 0.05f);
				}
				else
				{
					result = new Color(0.65f, 0.65f, 0.65f);
				}
			}
			else if ((int)enemyType != 26)
			{
				switch (enemyType - 31)
				{
				case 2:
					break;
				case 3:
					goto IL_0102;
				case 0:
					goto IL_0119;
				default:
					goto IL_0130;
				}
				result = new Color(0.91f, 0.73f, 0.51f);
			}
			else
			{
				result = new Color(0f, 0.66f, 0.77f);
			}
			goto IL_0138;
			IL_0138:
			if (1 == 0)
			{
			}
			return result;
			IL_0119:
			result = new Color(0.91f, 0.91f, 0.91f);
			goto IL_0138;
			IL_0102:
			result = new Color(0.8f, 0.07f, 0.07f);
			goto IL_0138;
			IL_00bd:
			result = new Color(0.4f, 0.75f, 0.94f);
			goto IL_0138;
			IL_0130:
			result = Color.white;
			goto IL_0138;
			IL_0072:
			result = new Color(0.82f, 0.3f, 0.09f);
			goto IL_0138;
			IL_00a6:
			result = new Color(0.26f, 0.89f, 0.74f);
			goto IL_0138;
		}

		public static Color? GetSubtitleColor(Component enemy, Color? colorOverride)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (colorOverride.HasValue)
			{
				return colorOverride.Value;
			}
			EnemyIdentifier val = default(EnemyIdentifier);
			if (enemy.TryGetComponent<EnemyIdentifier>(ref val))
			{
				return GetEnemyTypeColor(val.enemyType);
			}
			return null;
		}

		public static bool CheckCooldown(Component enemy, float cooldown)
		{
			int instanceID = ((Object)enemy).GetInstanceID();
			if (enemyVoiceCooldown.TryGetValue(instanceID, out var value) && Time.time - value < cooldown)
			{
				return false;
			}
			enemyVoiceCooldown[instanceID] = Time.time;
			return true;
		}

		public static bool CheckGlobalCooldown()
		{
			if (Time.time - lastVoiceTime < UltraVoicePlugin.VoiceCooldown.value)
			{
				return false;
			}
			lastVoiceTime = Time.time;
			return true;
		}

		public static bool IsSpawnVoicePlaying(Component enemy)
		{
			if (!spawnVoiceEndTimes.TryGetValue(enemy, out var value))
			{
				return false;
			}
			return Time.time < value;
		}

		public static bool IsEnemyVoicePlaying(Component enemy)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in enemy.transform)
			{
				Transform val = item;
				if (((Object)val).name.StartsWith("UltraVoice_"))
				{
					return true;
				}
			}
			return false;
		}

		public static bool TooSoonAfterSpawn(Component enemy, float delay)
		{
			if (!enemySpawnTimes.TryGetValue(enemy, out var value))
			{
				return false;
			}
			return Time.time - value < delay;
		}

		public static AudioSource CreateVoiceSource(Component enemy, string name, AudioClip clip, string subtitle = null, bool shouldInterrupt = false, Color? subtitleColor = null, float pitch = 1f)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)enemy == (Object)null || (Object)(object)clip == (Object)null)
			{
				return null;
			}
			if (((Object)enemy.gameObject).name.Contains("Big Johninator"))
			{
				return null;
			}
			if (!shouldInterrupt)
			{
				if (!CheckGlobalCooldown())
				{
					return null;
				}
				if (IsEnemyVoicePlaying(enemy))
				{
					return null;
				}
			}
			else
			{
				InterruptVoices(enemy);
			}
			lastVoiceTime = Time.time;
			GameObject val = new GameObject("UltraVoice_" + name);
			val.transform.SetParent(enemy.transform);
			val.transform.localPosition = Vector3.zero;
			AudioSource val2 = val.AddComponent<AudioSource>();
			val2.clip = clip;
			val2.spatialBlend = 1f;
			val2.volume = UltraVoicePlugin.VoiceVolume.value;
			val2.pitch = pitch;
			val2.minDistance = 50f;
			val2.maxDistance = 500f;
			val2.dopplerLevel = 0f;
			AudioMixerController instance = MonoSingleton<AudioMixerController>.Instance;
			if ((Object)(object)instance != (Object)null)
			{
				val2.outputAudioMixerGroup = instance.allGroup;
			}
			val2.Play();
			Color? subtitleColor2 = GetSubtitleColor(enemy, subtitleColor);
			if (!string.IsNullOrEmpty(subtitle))
			{
				ShowSubtitle(subtitle, val2, subtitleColor2);
			}
			Object.Destroy((Object)(object)val, clip.length + 1f);
			return val2;
		}

		public static void ShowSubtitle(string text, AudioSource src, Color? color = null)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (!string.IsNullOrEmpty(text))
			{
				if (color.HasValue)
				{
					string text2 = "<color=#" + ColorUtility.ToHtmlStringRGB(color.Value) + ">" + text + "</color>";
					MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(text2, src, false);
				}
				else
				{
					MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(text, src, false);
				}
			}
		}

		public static void InterruptVoices(Component enemy)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in enemy.transform)
			{
				Transform val = item;
				if (((Object)val).name.StartsWith("UltraVoice_"))
				{
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
			}
		}
	}
}
namespace UltraVoice.Characters
{
	public class Cerberus
	{
		public static AudioClip PreludeClip;

		public static AudioClip[] AwakenClips;

		public static AudioClip[] EnrageClips;

		public static AudioClip[] ThrowClips;

		public static AudioClip[] StompClips;

		public static AudioClip[] TackleClips;

		public static AudioClip[] DeathClips;

		public static readonly string[] AwakenSubs = new string[6] { "Who dares awaken me", "You will go no further", "Your story ends here", "Your defiance shall be punished", "Be gone, or be destroyed", "You stand condemned" };

		public static readonly string[] EnrageSubs = new string[4] { "You will regret crossing me", "Your arrogance will cost you", "I will avenge my brother", "This shall not go unpunished" };

		public static readonly string[] ThrowSubs = new string[2] { "Perish", "Die" };

		public static readonly string[] StompSubs = new string[2] { "Tremble", "Fall" };

		public static readonly string[] TackleSubs = new string[2] { "Face me", "You cannot run" };

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			PreludeClip = UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUpSpecial");
			AwakenClips = (AudioClip[])(object)new AudioClip[6]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp2"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp3"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp4"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp5"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_WakeUp6")
			};
			EnrageClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_Enrage1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Enrage2"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Enrage3"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Enrage4")
			};
			ThrowClips = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_Orb1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Orb2")
			};
			StompClips = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_Stomp1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Stomp2")
			};
			TackleClips = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_Tackle1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Tackle2")
			};
			DeathClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "cerb_Death1"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Death2"),
				UltraVoicePlugin.LoadClip(bundle, "cerb_Death3")
			};
			logger.LogInfo((object)"Cerberus voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component cerberus, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(cerberus, "Cerberus", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(StatueFake), "SlowStart")]
	internal class CerberusIntroVoice
	{
		[CompilerGenerated]
		private sealed class <PlayIntro>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueFake cerb;

			private AudioClip <clip>5__1;

			private GameObject <obj>5__2;

			private AudioSource <src>5__3;

			private AudioMixerController <mixer>5__4;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayIntro>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<clip>5__1 = null;
				<obj>5__2 = null;
				<src>5__3 = null;
				<mixer>5__4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected O, but got Unknown
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Expected O, but got Unknown
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: 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_018e: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(3.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<clip>5__1 = Cerberus.PreludeClip;
					if ((Object)(object)<clip>5__1 == (Object)null)
					{
						return false;
					}
					<obj>5__2 = new GameObject("UltraVoice_CerberusIntro");
					<obj>5__2.transform.position = ((Component)cerb).transform.position;
					<src>5__3 = <obj>5__2.AddComponent<AudioSource>();
					<src>5__3.clip = <clip>5__1;
					<src>5__3.spatialBlend = 1f;
					<src>5__3.volume = 1f;
					<src>5__3.minDistance = 50f;
					<src>5__3.maxDistance = 500f;
					<src>5__3.dopplerLevel = 0f;
					<mixer>5__4 = MonoSingleton<AudioMixerController>.Instance;
					<src>5__3.outputAudioMixerGroup = <mixer>5__4.allGroup;
					<src>5__3.Play();
					if ((Object)(object)<src>5__3 == (Object)null)
					{
						return false;
					}
					VoiceManager.ShowSubtitle("You tread forbidden ground, machine", <src>5__3, (Color?)new Color(0.65f, 0.65f, 0.65f));
					<>2__current = (object)new WaitForSeconds(3.75f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					VoiceManager.ShowSubtitle("BEGONE", <src>5__3, (Color?)new Color(0.65f, 0.65f, 0.65f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueFake __instance)
		{
			if (!__instance.quickSpawn && UltraVoicePlugin.CerberusVoiceEnabled.value)
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayIntro(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayIntro>d__1))]
		private static IEnumerator PlayIntro(StatueFake cerb)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayIntro>d__1(0)
			{
				cerb = cerb
			};
		}
	}
	[HarmonyPatch(typeof(StatueFake), "Activate")]
	internal class CerberusWakePatch
	{
		[CompilerGenerated]
		private sealed class <PlayAwaken>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueFake cerb;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayAwaken>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Expected O, but got Unknown
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(Random.Range(0f, 1f));
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Cerberus.PlayRandomVoice((Component)(object)cerb, Cerberus.AwakenClips, Cerberus.AwakenSubs, interrupt: false, (Color?)new Color(0.65f, 0.65f, 0.65f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueFake __instance)
		{
			if (__instance.quickSpawn && UltraVoicePlugin.CerberusVoiceEnabled.value)
			{
				VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayAwaken(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayAwaken>d__1))]
		private static IEnumerator PlayAwaken(StatueFake cerb)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayAwaken>d__1(0)
			{
				cerb = cerb
			};
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "Start")]
	internal class CerberusSpawnTracker
	{
		private static void Postfix(StatueBoss __instance)
		{
			VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "Enrage")]
	internal class CerberusEnragePatch
	{
		[CompilerGenerated]
		private sealed class <PlayEnrage>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueBoss cerb;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayEnrage>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Cerberus.PlayRandomVoice((Component)(object)cerb, Cerberus.EnrageClips, Cerberus.EnrageSubs);
					VoiceManager.spawnVoiceEndTimes[(Component)(object)cerb] = Time.time + 3f;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueBoss __instance)
		{
			if (UltraVoicePlugin.CerberusVoiceEnabled.value)
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayEnrage(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayEnrage>d__1))]
		private static IEnumerator PlayEnrage(StatueBoss cerb)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayEnrage>d__1(0)
			{
				cerb = cerb
			};
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "Throw")]
	internal class CerberusThrowPatch
	{
		[CompilerGenerated]
		private sealed class <PlayThrowVoice>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueBoss cerberus;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayThrowVoice>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Cerberus.PlayRandomVoice((Component)(object)cerberus, Cerberus.ThrowClips, Cerberus.ThrowSubs);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueBoss __instance)
		{
			if (UltraVoicePlugin.CerberusVoiceEnabled.value && !VoiceManager.IsSpawnVoicePlaying((Component)(object)__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 3f))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayThrowVoice(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayThrowVoice>d__1))]
		private static IEnumerator PlayThrowVoice(StatueBoss cerberus)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayThrowVoice>d__1(0)
			{
				cerberus = cerberus
			};
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "Stomp")]
	internal class CerberusStompPatch
	{
		[CompilerGenerated]
		private sealed class <PlayStompVoice>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueBoss cerberus;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayStompVoice>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Cerberus.PlayRandomVoice((Component)(object)cerberus, Cerberus.StompClips, Cerberus.StompSubs);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueBoss __instance)
		{
			if (UltraVoicePlugin.CerberusVoiceEnabled.value && !VoiceManager.IsSpawnVoicePlaying((Component)(object)__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 3f))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayStompVoice(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayStompVoice>d__1))]
		private static IEnumerator PlayStompVoice(StatueBoss cerberus)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayStompVoice>d__1(0)
			{
				cerberus = cerberus
			};
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "Tackle")]
	internal class CerberusTacklePatch
	{
		[CompilerGenerated]
		private sealed class <PlayTackleVoice>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StatueBoss cerberus;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayTackleVoice>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Cerberus.PlayRandomVoice((Component)(object)cerberus, Cerberus.TackleClips, Cerberus.TackleSubs);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(StatueBoss __instance)
		{
			if (UltraVoicePlugin.CerberusVoiceEnabled.value && !VoiceManager.IsSpawnVoicePlaying((Component)(object)__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 3f))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayTackleVoice(__instance));
			}
		}

		[IteratorStateMachine(typeof(<PlayTackleVoice>d__1))]
		private static IEnumerator PlayTackleVoice(StatueBoss cerberus)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayTackleVoice>d__1(0)
			{
				cerberus = cerberus
			};
		}
	}
	[HarmonyPatch(typeof(StatueBoss), "OnGoLimp")]
	internal class CerberusDeathPatch
	{
		private static void Postfix(StatueBoss __instance)
		{
			if (UltraVoicePlugin.CerberusVoiceEnabled.value && Cerberus.DeathClips != null && Cerberus.DeathClips.Length != 0)
			{
				Cerberus.PlayRandomVoice((Component)(object)__instance, Cerberus.DeathClips, null, interrupt: true);
			}
		}
	}
	public class FerrymanCharacter
	{
		public static AudioClip BossIntroClip;

		public static AudioClip CoinSkipClip;

		public static AudioClip CoinFightClip;

		public static AudioClip PhaseChangeClip;

		public static AudioClip ApproachClip;

		public static AudioClip[] ChatterClips;

		public static AudioClip[] ParryClips;

		public static AudioClip[] DeathClips;

		public static readonly string[] ChatterSubs = new string[4] { "Have at you!", "Come on!", "Come at me!", "Try me!" };

		public static bool FerrymanCoinTossed = false;

		public static bool FerrymanPhaseChangePlayed = false;

		public static bool IsAgonisOrRudraksha(Ferryman ferryman)
		{
			if ((Object)(object)ferryman == (Object)null)
			{
				return false;
			}
			Transform val = ((Component)ferryman).transform;
			while ((Object)(object)val != (Object)null)
			{
				if (((Object)val).name.Contains("10S - Secret Arena"))
				{
					return true;
				}
				val = val.parent;
			}
			return false;
		}

		public static bool IsAgonis(Ferryman ferryman)
		{
			if (!IsAgonisOrRudraksha(ferryman))
			{
				return false;
			}
			EnemyIdentifier component = ((Component)ferryman).GetComponent<EnemyIdentifier>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			return component.mirrorOnly;
		}

		public static bool IsRudraksha(Ferryman ferryman)
		{
			if (!IsAgonisOrRudraksha(ferryman))
			{
				return false;
			}
			EnemyIdentifier component = ((Component)ferryman).GetComponent<EnemyIdentifier>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			return !component.mirrorOnly;
		}

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			BossIntroClip = UltraVoicePlugin.LoadClip(bundle, "ferry_FightStarted");
			CoinSkipClip = UltraVoicePlugin.LoadClip(bundle, "ferry_CoinSkip");
			CoinFightClip = UltraVoicePlugin.LoadClip(bundle, "ferry_CoinFight");
			PhaseChangeClip = UltraVoicePlugin.LoadClip(bundle, "ferry_PhaseChange");
			ApproachClip = UltraVoicePlugin.LoadClip(bundle, "ferry_Approach");
			ChatterClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "ferry_Chatter1"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Chatter2"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Chatter3"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Chatter4")
			};
			ParryClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "ferry_Parry1"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Parry2"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Parry3"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Parry4")
			};
			DeathClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "ferry_Death1"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Death2"),
				UltraVoicePlugin.LoadClip(bundle, "ferry_Death3")
			};
			logger.LogInfo((object)"Ferryman voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component ferryman, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(ferryman, "Ferryman", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Ferryman), "Start")]
	internal class FerrymanSpawnPatch
	{
		[CompilerGenerated]
		private sealed class <<Postfix>g__PlayCoin|0_1>d : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Ferryman ferry;

			private AudioSource <src>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <<Postfix>g__PlayCoin|0_1>d(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<src>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				//IL_010f: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanIntro", FerrymanCharacter.CoinFightClip);
					VoiceManager.spawnVoiceEndTimes[(Component)(object)ferry] = Time.time + FerrymanCharacter.CoinFightClip.length;
					if ((Object)(object)<src>5__1 == (Object)null)
					{
						return false;
					}
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("You SCOUNDREL", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					<>2__current = (object)new WaitForSeconds(1.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("I should have never trusted a machine like you!", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <<Postfix>g__PlayNoCoin|0_0>d : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Ferryman ferry;

			private AudioSource <src>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <<Postfix>g__PlayNoCoin|0_0>d(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<src>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Expected O, but got Unknown
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanIntro", FerrymanCharacter.BossIntroClip, null, shouldInterrupt: true);
					if ((Object)(object)<src>5__1 == (Object)null)
					{
						return false;
					}
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("Gabriel warned me of you and your likes", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					<>2__current = (object)new WaitForSeconds(3f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("I will not make the same mistakes as him!", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(Ferryman __instance)
		{
			if (!UltraVoicePlugin.FerrymanVoiceEnabled.value || (Object)(object)__instance == (Object)null || MonoSingleton<StatsManager>.Instance.restarts > 0)
			{
				return;
			}
			VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
			if (!FerrymanCharacter.IsAgonisOrRudraksha(__instance) && __instance.bossVersion)
			{
				if (FerrymanCharacter.FerrymanCoinTossed)
				{
					((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayCoin(__instance));
					VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
					VoiceManager.spawnVoiceEndTimes[(Component)(object)__instance] = Time.time + FerrymanCharacter.CoinFightClip.length;
				}
				else
				{
					((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayNoCoin(__instance));
					VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
					VoiceManager.spawnVoiceEndTimes[(Component)(object)__instance] = Time.time + FerrymanCharacter.BossIntroClip.length;
				}
			}
			[IteratorStateMachine(typeof(<<Postfix>g__PlayCoin|0_1>d))]
			static IEnumerator PlayCoin(Ferryman ferry)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <<Postfix>g__PlayCoin|0_1>d(0)
				{
					ferry = ferry
				};
			}
			[IteratorStateMachine(typeof(<<Postfix>g__PlayNoCoin|0_0>d))]
			static IEnumerator PlayNoCoin(Ferryman ferry)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <<Postfix>g__PlayNoCoin|0_0>d(0)
				{
					ferry = ferry
				};
			}
		}
	}
	[HarmonyPatch(typeof(FerrymanFake), "CoinCatch")]
	internal class FerrymanCoinDetectedPatch
	{
		[CompilerGenerated]
		private sealed class <<Postfix>g__Play|0_0>d : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FerrymanFake ferry;

			private AudioSource <src>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <<Postfix>g__Play|0_0>d(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<src>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Expected O, but got Unknown
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Expected O, but got Unknown
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Expected O, but got Unknown
				//IL_0146: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.25f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanSkip", FerrymanCharacter.CoinSkipClip, "Hm?", shouldInterrupt: true);
					if ((Object)(object)<src>5__1 == (Object)null)
					{
						return false;
					}
					<>2__current = (object)new WaitForSeconds(1.75f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("This shall do", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					<>2__current = (object)new WaitForSeconds(1.5f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					if (!Object.op_Implicit((Object)(object)<src>5__1))
					{
						return false;
					}
					VoiceManager.ShowSubtitle("You may pass", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(FerrymanFake __instance)
		{
			if (UltraVoicePlugin.FerrymanVoiceEnabled.value)
			{
				FerrymanCharacter.FerrymanCoinTossed = true;
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(Play(__instance));
			}
			[IteratorStateMachine(typeof(<<Postfix>g__Play|0_0>d))]
			static IEnumerator Play(FerrymanFake ferry)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <<Postfix>g__Play|0_0>d(0)
				{
					ferry = ferry
				};
			}
		}
	}
	[HarmonyPatch(typeof(Ferryman), "Update")]
	internal class FerrymanChatterPatch
	{
		private static void Postfix(Ferryman __instance)
		{
			if (UltraVoicePlugin.FerrymanVoiceEnabled.value && !BlindEnemies.Blind && !((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.currentWindup != (Object)null) && VoiceManager.CheckCooldown((Component)(object)__instance, 6f) && !FerrymanCharacter.IsAgonisOrRudraksha(__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 3f) && !(Random.Range(0f, 1f) > 0.75f))
			{
				FerrymanCharacter.PlayRandomVoice((Component)(object)__instance, FerrymanCharacter.ChatterClips, FerrymanCharacter.ChatterSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Ferryman), "PhaseChange")]
	internal class FerrymanPhaseChangePatch
	{
		[CompilerGenerated]
		private sealed class <<Postfix>g__PlayPhaseChange|0_0>d : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Ferryman ferry;

			private AudioSource <src>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <<Postfix>g__PlayPhaseChange|0_0>d(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<src>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Expected O, but got Unknown
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					new WaitForSeconds(0.1f);
					<src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanPhase", FerrymanCharacter.PhaseChangeClip, null, shouldInterrupt: true);
					FerrymanCharacter.FerrymanPhaseChangePlayed = true;
					VoiceManager.spawnVoiceEndTimes[(Component)(object)ferry] = Time.time + FerrymanCharacter.BossIntroClip.length;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					VoiceManager.ShowSubtitle("I am not finished with you!", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f));
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(Ferryman __instance)
		{
			if (UltraVoicePlugin.FerrymanVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && !FerrymanCharacter.IsAgonisOrRudraksha(__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 0.25f) && !FerrymanCharacter.FerrymanPhaseChangePlayed)
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayPhaseChange(__instance));
			}
			[IteratorStateMachine(typeof(<<Postfix>g__PlayPhaseChange|0_0>d))]
			static IEnumerator PlayPhaseChange(Ferryman ferry)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <<Postfix>g__PlayPhaseChange|0_0>d(0)
				{
					ferry = ferry
				};
			}
		}
	}
	[HarmonyPatch(typeof(Ferryman), "OnGoLimp")]
	internal class FerrymanDeathPatch
	{
		private static void Postfix(Ferryman __instance)
		{
			if (UltraVoicePlugin.FerrymanVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && !FerrymanCharacter.IsAgonisOrRudraksha(__instance))
			{
				FerrymanCharacter.PlayRandomVoice((Component)(object)__instance, FerrymanCharacter.DeathClips, null, interrupt: true);
			}
		}
	}
	[HarmonyPatch(typeof(FerrymanFake), "Update")]
	internal class FerrymanFakeProximityPatch
	{
		private static void Postfix(FerrymanFake __instance)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			if (!UltraVoicePlugin.FerrymanVoiceEnabled.value || (Object)(object)__instance == (Object)null || MonoSingleton<StatsManager>.Instance.restarts > 0)
			{
				return;
			}
			NewMovement instance = MonoSingleton<NewMovement>.Instance;
			if (!((Object)(object)instance == (Object)null))
			{
				int instanceID = ((Object)__instance).GetInstanceID();
				float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)instance).transform.position);
				if (!(num > 60f) && VoiceManager.CheckCooldown((Component)(object)__instance, 999f))
				{
					VoiceManager.CreateVoiceSource((Component)(object)__instance, "FerrymanApproach", FerrymanCharacter.ApproachClip, "Who goes there?", shouldInterrupt: false, (Color?)new Color(0f, 0.66f, 0.77f), 1f);
				}
			}
		}
	}
	public class GuttermanCharacter
	{
		public static AudioClip[] SpawnClips;

		public static AudioClip[] SpinUpClips;

		public static AudioClip[] LostSightClips;

		public static AudioClip[] ShieldBreakClips;

		public static AudioClip[] EnrageClips;

		public static AudioClip[] DeathClips;

		public static AudioClip[] ParryClips;

		public static readonly string[] SpawnSubs = new string[5] { "THIS WILL NOT TAKE LONG.", "WHO MUST I KILL TODAY?", "IT IS TIME TO KILL.", "FOR THE MOTHERLAND!", "SAY YOUR PRAYERS." };

		public static readonly string[] SpinUpSubs = new string[2] { "THERE YOU ARE!", "TARGET SIGHTED!" };

		public static readonly string[] LostSightSubs = new string[3] { "COME OUT AND FACE ME!", "SHOW YOURSELF, COWARD!", "DO NOT WASTE MY TIME." };

		public static readonly string[] ShieldBreakSubs = new string[4] { "SHIELD DOWN!", "SHIELD DESTROYED!", "SHIELD BROKEN!", "DEFENSES BREACHED!" };

		public static readonly string[] EnrageSubs = new string[4] { "THAT COST MONEY!", "YOU WILL PAY FOR THIS!", "I WILL TURN YOU TO SCRAP!", "OH, YOU MAKE ME SO MAD…" };

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			SpawnClips = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_Spawn1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Spawn2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Spawn3"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Spawn4"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Spawn5")
			};
			SpinUpClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_RevUp1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_RevUp2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_RevUp3"),
				UltraVoicePlugin.LoadClip(bundle, "gm_RevUp4")
			};
			LostSightClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_LostSight1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_LostSight2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_LostSight3")
			};
			ShieldBreakClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_GuardBreak1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_GuardBreak2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_GuardBreak3")
			};
			EnrageClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_Enrage1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Enrage2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Enrage3"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Enrage4")
			};
			DeathClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_Death1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Death2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Death3")
			};
			ParryClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gm_Parry1"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Parry2"),
				UltraVoicePlugin.LoadClip(bundle, "gm_Parry3")
			};
			logger.LogInfo((object)"Gutterman voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component gutterman, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(gutterman, "Gutterman", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Gutterman), "Start")]
	internal class GuttermanSpawnPatch
	{
		private static void Postfix(Gutterman __instance)
		{
			if (UltraVoicePlugin.GuttermanVoiceEnabled.value)
			{
				VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
				GuttermanCharacter.PlayRandomVoice((Component)(object)__instance, GuttermanCharacter.SpawnClips, GuttermanCharacter.SpawnSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Gutterman), "ShieldBreak")]
	internal class GuttermanShieldBreakPatch
	{
		private static void Postfix(Gutterman __instance)
		{
			if (UltraVoicePlugin.GuttermanVoiceEnabled.value)
			{
				if (__instance.enraged)
				{
					GuttermanCharacter.PlayRandomVoice((Component)(object)__instance, GuttermanCharacter.EnrageClips, GuttermanCharacter.EnrageSubs, interrupt: true);
				}
				else
				{
					GuttermanCharacter.PlayRandomVoice((Component)(object)__instance, GuttermanCharacter.ShieldBreakClips, GuttermanCharacter.ShieldBreakSubs);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Gutterman), "Death")]
	internal class GuttermanDeathPatch
	{
		private static void Postfix(Gutterman __instance)
		{
			if (UltraVoicePlugin.GuttermanVoiceEnabled.value)
			{
				GuttermanCharacter.PlayRandomVoice((Component)(object)__instance, GuttermanCharacter.DeathClips, null, interrupt: true);
			}
		}
	}
	[HarmonyPatch(typeof(Gutterman), "GotParried")]
	internal class GuttermanParryPatch
	{
		private static void Postfix(Gutterman __instance)
		{
			if (UltraVoicePlugin.GuttermanVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f))
			{
				GuttermanCharacter.PlayRandomVoice((Component)(object)__instance, GuttermanCharacter.ParryClips, null, interrupt: true);
			}
		}
	}
	public class GuttertankCharacter
	{
		public static AudioClip[] SpawnClips;

		public static AudioClip AttackClip;

		public static AudioClip[] PunchHitClips;

		public static AudioClip[] FrustratedClips;

		public static AudioClip[] DeathClips;

		public static AudioClip[] TripPainClips;

		public static readonly string[] SpawnSubs = new string[4] { "WEAPONS ONLINE.", "READY FOR COMBAT.", "ENGAGING PROTOCOLS.", "ALL SYSTEMS OPERATIONAL." };

		public static readonly string[] PunchHitSubs = new string[3] { "DIRECT HIT.", "HIT CONFIRMED.", "TRY THAT AGAIN." };

		public static readonly string[] FrustratedSubs = new string[4] { "DAMN IT!", "VERDAMMT!", "AH, MY HEAD…", "SCHEIẞE!" };

		public static bool GuttertankSpawnInMirror = false;

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			SpawnClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "gt_Spawn1"),
				UltraVoicePlugin.LoadClip(bundle, "gt_Spawn2"),
				UltraVoicePlugin.LoadClip(bundle, "gt_Spawn3"),
				UltraVoicePlugin.LoadClip(bundle, "gt_Spawn4")
			};
			AttackClip = UltraVoicePlugin.LoadClip(bundle, "gt_Attack");
			PunchHitClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchHit1"),
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchHit2"),
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchHit3")
			};
			FrustratedClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchTrip1"),
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchTrip2"),
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchTrip3"),
				UltraVoicePlugin.LoadClip(bundle, "gt_PunchTrip4")
			};
			DeathClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gt_Death1"),
				UltraVoicePlugin.LoadClip(bundle, "gt_Death2"),
				UltraVoicePlugin.LoadClip(bundle, "gt_Death3")
			};
			TripPainClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "gt_TripPain1"),
				UltraVoicePlugin.LoadClip(bundle, "gt_TripPain2"),
				UltraVoicePlugin.LoadClip(bundle, "gt_TripPain3")
			};
			logger.LogInfo((object)"Guttertank voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component guttertank, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(guttertank, "Guttertank", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Guttertank), "Start")]
	internal class GuttertankSpawnPatch
	{
		private static void Postfix(Guttertank __instance)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			Guttertank __instance2 = __instance;
			if (!UltraVoicePlugin.GuttertankVoiceEnabled.value || (Object)(object)__instance2 == (Object)null)
			{
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "45addc6c3730dae418321e00af1116c5" && !GuttertankCharacter.GuttertankSpawnInMirror)
			{
				GuttertankCharacter.GuttertankSpawnInMirror = true;
				VoiceManager.enemySpawnTimes[(Component)(object)__instance2] = Time.time;
				return;
			}
			VoiceManager.enemySpawnTimes[(Component)(object)__instance2] = Time.time;
			((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate
			{
				GuttertankCharacter.PlayRandomVoice((Component)(object)__instance2, GuttertankCharacter.SpawnClips, GuttertankCharacter.SpawnSubs);
			}, () => GuttertankCharacter.SpawnClips != null && GuttertankCharacter.SpawnClips.Length != 0, (Component)(object)__instance2));
		}
	}
	[HarmonyPatch(typeof(Guttertank), "TargetBeenHit")]
	internal class GuttertankPunchHitPatch
	{
		private static void Postfix(Guttertank __instance)
		{
			Guttertank __instance2 = __instance;
			if (UltraVoicePlugin.GuttertankVoiceEnabled.value && !((Object)(object)__instance2 == (Object)null))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate
				{
					GuttertankCharacter.PlayRandomVoice((Component)(object)__instance2, GuttertankCharacter.PunchHitClips, GuttertankCharacter.PunchHitSubs);
				}, () => GuttertankCharacter.PunchHitClips != null && GuttertankCharacter.PunchHitClips.Length != 0, (Component)(object)__instance2));
			}
		}
	}
	[HarmonyPatch(typeof(Guttertank), "FallImpact")]
	internal class GuttertankFallImpactPatch
	{
		[CompilerGenerated]
		private sealed class <DelayedPunchTripVox>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Guttertank tank;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedPunchTripVox>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.75f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					GuttertankCharacter.PlayRandomVoice((Component)(object)tank, GuttertankCharacter.FrustratedClips, GuttertankCharacter.FrustratedSubs, interrupt: true);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(Guttertank __instance)
		{
			Guttertank __instance2 = __instance;
			if (UltraVoicePlugin.GuttertankVoiceEnabled.value && !((Object)(object)__instance2 == (Object)null))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate
				{
					GuttertankCharacter.PlayRandomVoice((Component)(object)__instance2, GuttertankCharacter.TripPainClips, null);
				}, () => GuttertankCharacter.TripPainClips != null && GuttertankCharacter.TripPainClips.Length != 0, (Component)(object)__instance2));
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(DelayedPunchTripVox(__instance2));
			}
		}

		[IteratorStateMachine(typeof(<DelayedPunchTripVox>d__1))]
		private static IEnumerator DelayedPunchTripVox(Guttertank tank)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedPunchTripVox>d__1(0)
			{
				tank = tank
			};
		}
	}
	[HarmonyPatch(typeof(Guttertank), "Death")]
	internal class GuttertankDeathPatch
	{
		private static void Postfix(Guttertank __instance)
		{
			Guttertank __instance2 = __instance;
			if (UltraVoicePlugin.GuttertankVoiceEnabled.value && !((Object)(object)__instance2 == (Object)null))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate
				{
					GuttertankCharacter.PlayRandomVoice((Component)(object)__instance2, GuttertankCharacter.DeathClips, null, interrupt: true);
				}, () => GuttertankCharacter.DeathClips != null && GuttertankCharacter.DeathClips.Length != 0, (Component)(object)__instance2));
			}
		}
	}
	public interface ICharacter
	{
		string CharacterName { get; }

		void PlayVoiceLine(string actionName, bool interrupt = false);
	}
	public class MannequinCharacter
	{
		public static AudioClip[] ChatterClips;

		public static AudioClip[] DeathClips;

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			ChatterClips = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "mq_Laugh1"),
				UltraVoicePlugin.LoadClip(bundle, "mq_Laugh2"),
				UltraVoicePlugin.LoadClip(bundle, "mq_Laugh3"),
				UltraVoicePlugin.LoadClip(bundle, "mq_Laugh4"),
				UltraVoicePlugin.LoadClip(bundle, "mq_Laugh5")
			};
			DeathClips = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "mq_Death1"),
				UltraVoicePlugin.LoadClip(bundle, "mq_Death2")
			};
			logger.LogInfo((object)"Mannequin voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component mannequin, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(mannequin, "Mannequin", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Mannequin), "Update")]
	internal class MannequinChatterPatch
	{
		private static void Postfix(Mannequin __instance)
		{
			if (UltraVoicePlugin.MannequinVoiceEnabled.value && !BlindEnemies.Blind && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !(Random.Range(0f, 1f) > 0.75f))
			{
				MannequinCharacter.PlayRandomVoice((Component)(object)__instance, MannequinCharacter.ChatterClips, null);
			}
		}
	}
	[HarmonyPatch(typeof(Mannequin), "MeleeAttack")]
	internal class MannequinSwingPatch
	{
		private static void Postfix(Mannequin __instance)
		{
			if (UltraVoicePlugin.MannequinVoiceEnabled.value)
			{
				MannequinCharacter.PlayRandomVoice((Component)(object)__instance, MannequinCharacter.ChatterClips, null);
			}
		}
	}
	[HarmonyPatch(typeof(Mannequin), "OnDeath")]
	internal class MannequinDeathPatch
	{
		private static void Postfix(Mannequin __instance)
		{
			if (UltraVoicePlugin.MannequinVoiceEnabled.value)
			{
				MannequinCharacter.PlayRandomVoice((Component)(object)__instance, MannequinCharacter.DeathClips, null, interrupt: true);
			}
		}
	}
	public class MindflayerCharacter
	{
		public static AudioClip[] SpawnClips;

		public static AudioClip[] ChatterClips;

		public static AudioClip[] MeleeClips;

		public static AudioClip[] EnrageClips;

		public static AudioClip[] SpawnClipsMasc;

		public static AudioClip[] ChatterClipsMasc;

		public static AudioClip[] MeleeClipsMasc;

		public static AudioClip[] EnrageClipsMasc;

		public static readonly string[] SpawnSubs = new string[5] { "I require your blood.", "You appear to contain blood.", "You are suitable for blood extraction.", "Please donate your blood to me.", "Thank you for your imminent blood donation." };

		public static readonly string[] ChatterSubs = new string[4] { "This process will be brief.", "Your cooperation is appreciated.", "Please do not resist.", "Continued resistance is unnecessary." };

		public static readonly string[] MeleeSubs = new string[3] { "Please maintain distance.", "Kindly step back.", "You are too close." };

		public static readonly string[] EnrageSubs = new string[4] { "You have made a very unwise choice.", "Your behavior is unacceptable.", "This is your final warning.", "I will correct you by force." };

		public static bool IsMascMindflayer(Mindflayer mf)
		{
			SkinnedMeshRenderer componentInChildren = ((Component)mf).GetComponentInChildren<SkinnedMeshRenderer>();
			if ((Object)(object)componentInChildren == (Object)null)
			{
				return false;
			}
			return (Object)(object)componentInChildren.sharedMesh == (Object)(object)mf.maleMesh;
		}

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			SpawnClips = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn1"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn2"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn3"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn4"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn5")
			};
			ChatterClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter1"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter2"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter3"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter4")
			};
			MeleeClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee1"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee2"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee3")
			};
			EnrageClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage1"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage2"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage3"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage4")
			};
			SpawnClipsMasc = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn1Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn2Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn3Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn4Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Spawn5Masc")
			};
			ChatterClipsMasc = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter1Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter2Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter3Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Chatter4Masc")
			};
			MeleeClipsMasc = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee1Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee2Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Melee3Masc")
			};
			EnrageClipsMasc = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage1Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage2Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage3Masc"),
				UltraVoicePlugin.LoadClip(bundle, "mf_Enrage4Masc")
			};
			logger.LogInfo((object)"Mindflayer voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component mindflayer, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(mindflayer, "Mindflayer", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Mindflayer), "Start")]
	internal class MindflayerSpawnPatch
	{
		private static void Postfix(Mindflayer __instance)
		{
			if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying)
			{
				VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
				AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.SpawnClipsMasc : MindflayerCharacter.SpawnClips);
				MindflayerCharacter.PlayRandomVoice((Component)(object)__instance, clips, MindflayerCharacter.SpawnSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Mindflayer), "Update")]
	internal class MindflayerChatterPatch
	{
		private static void Postfix(Mindflayer __instance)
		{
			if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && !__instance.dying && VoiceManager.CheckCooldown((Component)(object)__instance, 5f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 3f) && !__instance.dying && Random.Range(0f, 1f) > 0.75f)
			{
				AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.ChatterClipsMasc : MindflayerCharacter.ChatterClips);
				MindflayerCharacter.PlayRandomVoice((Component)(object)__instance, clips, MindflayerCharacter.ChatterSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Mindflayer), "MeleeAttack")]
	internal class MindflayerMeleePatch
	{
		[CompilerGenerated]
		private sealed class <DelayedMeleeVoice>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Mindflayer mf;

			private AudioClip[] <clips>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedMeleeVoice>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<clips>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if ((Object)(object)mf == (Object)null)
					{
						return false;
					}
					<clips>5__1 = (MindflayerCharacter.IsMascMindflayer(mf) ? MindflayerCharacter.MeleeClipsMasc : MindflayerCharacter.MeleeClips);
					MindflayerCharacter.PlayRandomVoice((Component)(object)mf, <clips>5__1, MindflayerCharacter.MeleeSubs);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(Mindflayer __instance)
		{
			if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying && VoiceManager.CheckCooldown((Component)(object)__instance, 2f))
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(DelayedMeleeVoice(__instance));
			}
		}

		[IteratorStateMachine(typeof(<DelayedMeleeVoice>d__1))]
		private static IEnumerator DelayedMeleeVoice(Mindflayer mf)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedMeleeVoice>d__1(0)
			{
				mf = mf
			};
		}
	}
	[HarmonyPatch(typeof(Mindflayer), "Enrage")]
	internal class MindflayerEnragePatch
	{
		private static void Postfix(Mindflayer __instance)
		{
			if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying)
			{
				AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.EnrageClipsMasc : MindflayerCharacter.EnrageClips);
				MindflayerCharacter.PlayRandomVoice((Component)(object)__instance, clips, MindflayerCharacter.EnrageSubs, interrupt: true);
			}
		}
	}
	[HarmonyPatch(typeof(Mindflayer), "Death")]
	internal class MindflayerDeathPatch
	{
		private static void Postfix(Mindflayer __instance)
		{
			VoiceManager.InterruptVoices((Component)(object)__instance);
		}
	}
	public class StreetcleanerCharacter
	{
		public static AudioClip[] ChatterClips;

		public static AudioClip[] AttackClips;

		public static AudioClip[] ParryClips;

		public static readonly string[] ChatterSubs = new string[5] { "IMPURITY", "SANITIZE", "EXTERMINATE", "PURGE", "UNCLEAN" };

		public static readonly string[] AttackSubs = new string[5] { "CLEANSING", "PURIFYING", "TO ASH", "QUIT MOVING", "STOP RESISTING" };

		public static readonly string[] ParrySubs = new string[3] { "DENIED", "DEFLECTED", "HA HA" };

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			ChatterClips = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "sc_Chatter1"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Chatter2"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Chatter3"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Chatter4"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Chatter5")
			};
			AttackClips = (AudioClip[])(object)new AudioClip[5]
			{
				UltraVoicePlugin.LoadClip(bundle, "sc_Attack1"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Attack2"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Attack3"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Attack4"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Attack5")
			};
			ParryClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "sc_Parry1"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Parry2"),
				UltraVoicePlugin.LoadClip(bundle, "sc_Parry3")
			};
			logger.LogInfo((object)"Streetcleaner voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component streetcleaner, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(streetcleaner, "Streetcleaner", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(Streetcleaner), "Start")]
	internal class StreetcleanerSpawnTrackPatch
	{
		private static void Postfix(Streetcleaner __instance)
		{
			VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
		}
	}
	[HarmonyPatch(typeof(Streetcleaner), "Update")]
	internal class StreetcleanerChatterPatch
	{
		private static void Postfix(Streetcleaner __instance)
		{
			if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && !__instance.dead && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 1f) && (double)Random.Range(0f, 1f) > 0.75)
			{
				StreetcleanerCharacter.PlayRandomVoice((Component)(object)__instance, StreetcleanerCharacter.ChatterClips, StreetcleanerCharacter.ChatterSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Streetcleaner), "StartFire")]
	internal class StreetcleanerFlameAttackPatch
	{
		private static void Postfix(Streetcleaner __instance)
		{
			if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && (double)Random.Range(0f, 1f) > 0.75)
			{
				StreetcleanerCharacter.PlayRandomVoice((Component)(object)__instance, StreetcleanerCharacter.AttackClips, StreetcleanerCharacter.AttackSubs);
			}
		}
	}
	[HarmonyPatch(typeof(Streetcleaner), "DeflectShot")]
	internal class StreetcleanerParryPatch
	{
		private static void Postfix(Streetcleaner __instance)
		{
			if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 4f))
			{
				StreetcleanerCharacter.PlayRandomVoice((Component)(object)__instance, StreetcleanerCharacter.ParryClips, StreetcleanerCharacter.ParrySubs, interrupt: true);
			}
		}
	}
	[HarmonyPatch(typeof(Streetcleaner), "OnGoLimp")]
	internal class StreetcleanerDeathInterruptPatch
	{
		private static void Postfix(Streetcleaner __instance)
		{
			VoiceManager.InterruptVoices((Component)(object)__instance);
		}
	}
	public class Swordsmachine
	{
		public static AudioClip IntroClip;

		public static AudioClip IntroClipSecond;

		public static AudioClip BigPainClip;

		public static AudioClip LungeClip;

		public static AudioClip ComboClip;

		public static AudioClip DeathClip;

		public static AudioClip AgonySpawnClip;

		public static AudioClip TundraSpawnClip;

		public static AudioClip AgonyKnockdownClip;

		public static AudioClip TundraKnockdownClip;

		public static AudioClip[] SpawnClips;

		public static AudioClip[] EnrageClips;

		public static AudioClip[] KnockdownClips;

		public static AudioClip[] RangedClips;

		public static AudioClip IntroClipNoto;

		public static AudioClip IntroClipSecondNoto;

		public static AudioClip BigPainClipNoto;

		public static AudioClip LungeClipNoto;

		public static AudioClip ComboClipNoto;

		public static AudioClip DeathClipNoto;

		public static AudioClip AgonySpawnClipNoto;

		public static AudioClip TundraSpawnClipNoto;

		public static AudioClip AgonyKnockdownClipNoto;

		public static AudioClip TundraKnockdownClipNoto;

		public static AudioClip[] SpawnClipsNoto;

		public static AudioClip[] EnrageClipsNoto;

		public static AudioClip[] KnockdownClipsNoto;

		public static AudioClip[] RangedClipsNoto;

		public static readonly string[] EnrageSubs = new string[4] { "GRRR", "GRRR", "MOTHERFUCKER", "OHOHO, YOU ARE SO DEAD" };

		public static readonly string[] EnrageSubs2 = new string[4] { "I'LL KICK YOUR ASS!", "I'LL KILL YOU!", null, null };

		public static readonly string[] SpawnSubs = new string[7] { "COME ON, COME ON", "LET'S SEE SOME BLOOD", "WHO'S READY TO FIGHT", "I SMELL BLOOD", "I'LL CUT YOU ALL DOWN", "FRESH BLOOD", "MORE MEAT FOR THE SLAUGHTER" };

		public static readonly string[] KnockdownSubs = new string[3] { "IS THAT ALL YOU GOT?", "I AIN'T DONE WITH YOU YET!", "I'M JUST GETTING STARTED" };

		public static readonly string[] RangedSubs = new string[2] { "CATCH THIS", "TAKE THIS" };

		public static Color SwordsmachineColor = new Color(0.91f, 0.6f, 0.05f);

		public static Color AgonyColor = new Color(0.79f, 0.17f, 0.17f);

		public static Color TundraColor = new Color(0.2f, 0.73f, 0.87f);

		public static bool FirstFightDone = false;

		public static bool IsAgony(SwordsMachine sm)
		{
			if ((Object)(object)sm == (Object)null)
			{
				return false;
			}
			string name = ((Object)((Component)sm).gameObject).name;
			return name.Contains("Agony");
		}

		public static bool IsTundra(SwordsMachine sm)
		{
			if ((Object)(object)sm == (Object)null)
			{
				return false;
			}
			string name = ((Object)((Component)sm).gameObject).name;
			return name.Contains("Tundra");
		}

		public static bool IsAgonyOrTundra(SwordsMachine sm)
		{
			return IsAgony(sm) || IsTundra(sm);
		}

		public static Color? GetColorOverride(SwordsMachine sm)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (IsAgony(sm))
			{
				return AgonyColor;
			}
			if (IsTundra(sm))
			{
				return TundraColor;
			}
			return SwordsmachineColor;
		}

		public static AudioClip UseSwordsmachineClip(AudioClip mofClip, AudioClip notoClip)
		{
			return (UltraVoicePlugin.SwordsmachineVoiceActorField != null && UltraVoicePlugin.SwordsmachineVoiceActorField.value == UltraVoicePlugin.SwordsmachineVoiceActor.Noto) ? notoClip : mofClip;
		}

		public static AudioClip[] UseSwordsmachineClips(AudioClip[] mofClips, AudioClip[] notoClips)
		{
			return (UltraVoicePlugin.SwordsmachineVoiceActorField != null && UltraVoicePlugin.SwordsmachineVoiceActorField.value == UltraVoicePlugin.SwordsmachineVoiceActor.Noto) ? notoClips : mofClips;
		}

		public static void LoadVoiceLines(AssetBundle bundle, ManualLogSource logger)
		{
			IntroClip = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecial");
			IntroClipSecond = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecial2");
			BigPainClip = UltraVoicePlugin.LoadClip(bundle, "sm_BigPain");
			LungeClip = UltraVoicePlugin.LoadClip(bundle, "sm_Lunge");
			ComboClip = UltraVoicePlugin.LoadClip(bundle, "sm_Combo");
			DeathClip = UltraVoicePlugin.LoadClip(bundle, "sm_Death");
			AgonySpawnClip = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecialAgony");
			TundraSpawnClip = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecialTundra");
			AgonyKnockdownClip = UltraVoicePlugin.LoadClip(bundle, "sm_DownedAgony");
			TundraKnockdownClip = UltraVoicePlugin.LoadClip(bundle, "sm_DownedTundra");
			SpawnClips = (AudioClip[])(object)new AudioClip[7]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn1"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn2"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn3"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn4"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn5"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn6"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn7")
			};
			EnrageClips = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage1"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage2"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage3"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage4")
			};
			KnockdownClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown1"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown2"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown3")
			};
			RangedClips = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Ranged1"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Ranged2")
			};
			IntroClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecialNoto");
			IntroClipSecondNoto = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecial2Noto");
			BigPainClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_BigPainNoto");
			LungeClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_LungeNoto");
			ComboClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_ComboNoto");
			DeathClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_DeathNoto");
			AgonySpawnClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecialAgonyNoto");
			TundraSpawnClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_SpawnSpecialTundraNoto");
			AgonyKnockdownClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_DownedAgonyNoto");
			TundraKnockdownClipNoto = UltraVoicePlugin.LoadClip(bundle, "sm_DownedTundraNoto");
			SpawnClipsNoto = (AudioClip[])(object)new AudioClip[7]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn1Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn2Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn3Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn4Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn5Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn6Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Spawn7Noto")
			};
			EnrageClipsNoto = (AudioClip[])(object)new AudioClip[4]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage1Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage2Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage3Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Enrage4Noto")
			};
			KnockdownClips = (AudioClip[])(object)new AudioClip[3]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown1Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown2Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Knockdown3Noto")
			};
			RangedClipsNoto = (AudioClip[])(object)new AudioClip[2]
			{
				UltraVoicePlugin.LoadClip(bundle, "sm_Ranged1Noto"),
				UltraVoicePlugin.LoadClip(bundle, "sm_Ranged2Noto")
			};
			logger.LogInfo((object)"Swordsmachine voice lines loaded successfully!");
		}

		public static void PlayRandomVoice(Component swordsmachine, AudioClip[] clips, string[] subs, bool interrupt = false, Color? colorOverride = null)
		{
			if (clips != null && clips.Length != 0)
			{
				int num = Random.Range(0, clips.Length);
				string subtitle = null;
				if (subs != null && num < subs.Length)
				{
					subtitle = subs[num];
				}
				VoiceManager.CreateVoiceSource(swordsmachine, "Swordsmachine", clips[num], subtitle, interrupt, colorOverride);
			}
		}
	}
	[HarmonyPatch(typeof(SwordsMachine), "Start")]
	internal class SwordsmachineSpawnPatch
	{
		[CompilerGenerated]
		private sealed class <PlayBossIntro>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public SwordsMachine sm;

			private AudioClip <clip>5__1;

			private string <subtitle>5__2;

			private AudioSource <src>5__3;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayBossIntro>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<clip>5__1 = null;
				<subtitle>5__2 = null;
				<src>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (!Swordsmachine.FirstFightDone)
					{
						<clip>5__1 = Swordsmachine.UseSwordsmachineClip(Swordsmachine.IntroClip, Swordsmachine.IntroClipNoto);
						<subtitle>5__2 = "YOU WANT A FIGHT? LET'S FIGHT";
					}
					else
					{
						<clip>5__1 = Swordsmachine.UseSwordsmachineClip(Swordsmachine.IntroClipSecond, Swordsmachine.IntroClipSecondNoto);
						<subtitle>5__2 = "DID YOU THINK I FORGOT ABOUT YOU?";
					}
					<src>5__3 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineIntro", <clip>5__1, <subtitle>5__2);
					if ((Object)(object)<src>5__3 != (Object)null)
					{
						VoiceManager.spawnVoiceEndTimes[(Component)(object)sm] = Time.time + <clip>5__1.length;
					}
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Postfix(SwordsMachine __instance)
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
			if (!UltraVoicePlugin.SwordsmachineVoiceEnabled.value || Swordsmachine.IsAgonyOrTundra(__instance))
			{
				return;
			}
			Scene activeScene;
			if (__instance.bossVersion)
			{
				activeScene = SceneManager.GetActiveScene();
				if (!(((Scene)(ref activeScene)).name != "5bcb2e0461e7fce408badfcb6778c271"))
				{
					((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayBossIntro(__instance));
				}
			}
			else
			{
				activeScene = SceneManager.GetActiveScene();
				if (!(((Scene)(ref activeScene)).name == "7927c42db92e4164cae682a55e6b7725"))
				{
					Swordsmachine.PlayRandomVoice((Component)(object)__instance, Swordsmachine.UseSwordsmachineClips(Swordsmachine.SpawnClips, Swordsmachine.SpawnClipsNoto), Swordsmachine.SpawnSubs, interrupt: true);
				}
			}
		}

		[IteratorStateMachine(typeof(<PlayBossIntro>d__1))]
		private static IEnumerator PlayBossIntro(SwordsMachine sm)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PlayBossIntro>d__1(0)
			{
				sm = sm
			};
		}
	}
	[HarmonyPatch(typeof(SwordsMachine), "Start")]
	internal class SwordsmachineSpecialSpawnPatch
	{
		private static void Postfix(SwordsMachine __instance)
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && Swordsmachine.IsAgonyOrTundra(__instance))
			{
				VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time;
				if (Swordsmachine.IsAgony(__instance))
				{
					VoiceManager.CreateVoiceSource((Component)(object)__instance, "AgonySpawn", Swordsmachine.UseSwordsmachineClip(Swordsmachine.AgonySpawnClip, Swordsmachine.AgonySpawnClipNoto), "JUMP 'EM!", shouldInterrupt: true, Swordsmachine.AgonyColor);
				}
				else if (Swordsmachine.IsTundra(__instance))
				{
					VoiceManager.CreateVoiceSource((Component)(object)__instance, "TundraSpawn", Swordsmachine.UseSwordsmachineClip(Swordsmachine.TundraSpawnClip, Swordsmachine.TundraSpawnClipNoto), "THERE THEY ARE!", shouldInterrupt: true, Swordsmachine.TundraColor);
				}
			}
		}
	}
	[HarmonyPatch(typeof(SwordsMachine), "Enrage")]
	internal class SwordsmachineEnragePatch
	{
		[CompilerGenerated]
		private sealed class <PlayEnrage>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public SwordsMachine sm;

			private int <i>5__1;

			private AudioSource <src>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PlayEnrage>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<src>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected O, but got Unknown
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.75f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<i>5__1 = Random.Range(0, Swordsmachine.EnrageClips.Length);
					if (!sm.enraged)
					{
						return false;
					}
					<src>5__2 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineEnrage", Swordsmachine.UseSwordsmachineClip(Swordsmachine.EnrageClips[<i>5__1], Swordsmachine.EnrageClipsNoto[<i>5__1]), Swordsmachine.EnrageSubs[<i>5__1], shouldInterrupt: true, Swordsmachine.GetColorOverride(sm));
					if ((Object)(object)<src>5__2 == (Object)null)
					{
						return false;
					}
					if (!string.IsNullOrEmpty(Swordsmachine.EnrageSubs2[<i>5__1]))
					{
						<>2__current = (object)new WaitForSeconds(0.75f);
						<>1__state = 2;
						return true;
					}
					break;
				case 2:
					<>1__state = -1;
					VoiceManager.ShowSubtitle(Swordsmachine.EnrageSubs2[<i>5__1], <src>5__2, Swordsmachine.GetColorOverride(sm));
					break;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static void Prefix(SwordsMachine __instance)
		{
			if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && !Swordsmachine.IsAgonyOrTundra(__instance) && !__instance.enraged)
			{
				((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayEnrage(__instance));
			}
		}

		[It