Decompiled source of UltraVoice v0.9.999
UltraVoice.dll
Decompiled an hour ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; 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 TMPro; using ULTRAKILL.Cheats; using UltraVoice.Characters; using UltraVoice.Utilities; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; [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.mel33.ultravoice", "UltraVoice", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class UltraVoicePlugin : BaseUnityPlugin { public enum SwordsmachineVoiceActor { Mel, Noto } public enum SentryVoiceActor { Noto, Goober } [CompilerGenerated] private sealed class <DelayedVox>d__35 : 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__35(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 BoolField ProvidenceVoiceEnabled; public static BoolField SentryVoiceEnabled; public static BoolField MauriceVoiceEnabled; public static BoolField EarthmoverVoiceEnabled; public static BoolField MirrorReaperVoiceEnabled; public static BoolField PowerSubtitleColorEnabled; public static FloatField VoiceCooldown; public static FloatField VoiceVolume; public static EnumField<SwordsmachineVoiceActor> SwordsmachineVoiceActorField; public static EnumField<SentryVoiceActor> SentryVoiceActorField; public static ConfigPanel TogglesPanel; public static ConfigPanel SubtitleColorPanel; 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Expected O, but got Unknown //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Expected O, but got Unknown //IL_0327: Unknown result type (might be due to invalid IL or missing references) Instance = this; VoiceManager = new VoiceManager(); config = PluginConfigurator.Create("UltraVoice", "com.mel33.ultravoice"); config.SetIconWithURL("https://filebin.net/xcwluh1i8mu3o41d/icon.png"); TogglesPanel = new ConfigPanel(config.rootPanel, "Enemy Line Toggles", "toggles"); SubtitleColorPanel = new ConfigPanel(config.rootPanel, "Subtitle Color Toggles", "subtitlecolor"); 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); ProvidenceVoiceEnabled = new BoolField(TogglesPanel, "Enable Providence Voice Lines", "providencevoice", true); SentryVoiceEnabled = new BoolField(TogglesPanel, "Enable Sentry Voice Lines", "sentryvoice", true); MauriceVoiceEnabled = new BoolField(TogglesPanel, "Enable Malicious Face Voice Lines", "mauricevoice", true); EarthmoverVoiceEnabled = new BoolField(TogglesPanel, "Enable Earthmover Voice Lines", "earthmovervoice", true); MirrorReaperVoiceEnabled = new BoolField(TogglesPanel, "Enable Mirror Reaper Voice Lines", "mirrorreapervoice", true); PowerSubtitleColorEnabled = new BoolField(SubtitleColorPanel, "Enable Power Subtitle Color", "powersubtitlecolor", true); VoiceCooldown = new FloatField(SlidersPanel, "Voice Cooldown", "cooldown", 0.25f, 0f, 0.35f); VoiceVolume = new FloatField(SlidersPanel, "Voice Volume", "volume", 1f, 0f, 1f); SwordsmachineVoiceActorField = new EnumField<SwordsmachineVoiceActor>(ActorPanel, "Swordsmachine Voice Actor", "smvoiceactor", SwordsmachineVoiceActor.Mel); SentryVoiceActorField = new EnumField<SentryVoiceActor>(ActorPanel, "Sentry Voice Actor", "svoiceactor", SentryVoiceActor.Goober); SwordsmachineVoiceActorField.SetEnumDisplayName(SwordsmachineVoiceActor.Mel, "Mel"); SwordsmachineVoiceActorField.SetEnumDisplayName(SwordsmachineVoiceActor.Noto, "Noto"); SentryVoiceActorField.SetEnumDisplayName(SentryVoiceActor.Goober, "Goober"); SentryVoiceActorField.SetEnumDisplayName(SentryVoiceActor.Noto, "Noto"); LoadAssets(); new Harmony("com.mel33.ultravoice").PatchAll(); SceneManager.sceneLoaded += OnSceneLoaded; ((BaseUnityPlugin)this).Logger.LogInfo((object)"UltraVoice loaded successfully!"); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { ResetCharacterStates(); } private void ResetCharacterStates() { SwordsmachineCharacter.FirstFightDone = false; SwordsmachineCharacter.FirstFightLinePlayed = false; V2Character.V2IntroTime = -999f; V2Character.V2CutsceneVoicePlayed = false; V2Character.V2SecondVoiceRestartPlayed = false; V2Character.V2DeathPlayed = false; FerrymanCharacter.FerrymanCoinTossed = false; FerrymanCharacter.FerrymanPhaseChangePlayed = false; GuttertankCharacter.GuttertankSpawnInMirror = false; MirrorReaperCharacter.Spawned = false; } private void LoadAssets() { CerberusCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); SwordsmachineCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); V2Character.LoadVoiceLines(((BaseUnityPlugin)this).Logger); MindflayerCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); VirtueCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); StreetcleanerCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); FerrymanCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); MannequinCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); GuttermanCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); GuttertankCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); ProvidenceCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); SentryCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); MaliciousFaceCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); EarthmoverCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); MirrorReaperCharacter.LoadVoiceLines(((BaseUnityPlugin)this).Logger); } public static AudioClip LoadClip(string resourcePath) { try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (!resourcePath.StartsWith("UltraVoice.Resources.")) { resourcePath = "UltraVoice.Resources." + resourcePath; } using Stream stream = executingAssembly.GetManifestResourceStream(resourcePath); if (stream == null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("UltraVoice missing clip: " + resourcePath)); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); AudioClip val = WavUtility.ToAudioClip(array); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("UltraVoice failed to convert clip: " + resourcePath)); return null; } return val; } catch (Exception arg) { ((BaseUnityPlugin)Instance).Logger.LogError((object)$"UltraVoice error loading clip {resourcePath}: {arg}"); return null; } } [IteratorStateMachine(typeof(<DelayedVox>d__35))] public static IEnumerator DelayedVox(Action playAction, Func<bool> ready, Component attached) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayedVox>d__35(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected I4, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected I4, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } Color result; if ((int)enemyType <= 26) { switch ((int)enemyType) { case 7: goto IL_0083; case 6: goto IL_009d; case 0: goto IL_00b7; case 5: goto IL_00d1; case 9: goto IL_00eb; case 4: goto IL_0195; case 1: case 2: case 3: case 8: goto IL_01c3; } if ((int)enemyType != 20) { if ((int)enemyType != 26) { goto IL_01c3; } result = new Color(0f, 0.66f, 0.77f); } else { result = new Color(0.51f, 0.68f, 0.1f); } } else { switch (enemyType - 31) { case 2: goto IL_0105; case 3: goto IL_0139; case 0: goto IL_0150; case 1: goto IL_01c3; } if ((int)enemyType != 38) { if ((int)enemyType != 41) { goto IL_01c3; } result = new Color(0.9f, 0.85f, 0.76f); } else { result = new Color(0.9f, 0.79f, 0.86f); } } goto IL_01cb; IL_00b7: result = new Color(0.65f, 0.65f, 0.65f); goto IL_01cb; IL_0105: result = new Color(0.91f, 0.73f, 0.51f); goto IL_01cb; IL_01c3: result = Color.white; goto IL_01cb; IL_01cb: if (1 == 0) { } return result; IL_0139: result = new Color(0.8f, 0.07f, 0.07f); goto IL_01cb; IL_0150: result = new Color(0.91f, 0.91f, 0.91f); goto IL_01cb; IL_00eb: result = new Color(0.4f, 0.75f, 0.94f); goto IL_01cb; IL_0083: result = new Color(0.91f, 0.6f, 0.05f); goto IL_01cb; IL_009d: result = new Color(0.82f, 0.3f, 0.09f); goto IL_01cb; IL_00d1: result = new Color(0.26f, 0.89f, 0.74f); goto IL_01cb; IL_0195: result = new Color(0.76f, 0.66f, 0.56f); goto IL_01cb; } 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, float spatialBlend = 1f, float volumeMult = 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 = spatialBlend; val2.volume = UltraVoicePlugin.VoiceVolume.value; val2.volume *= 1.5f + volumeMult; val2.minDistance = 50f; val2.maxDistance = 200f; val2.dopplerLevel = 0.25f; 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 PlayRandomVoice(Component enemy, string enemyName, AudioClip[] clips, string[] subtitles, bool interrupt = false, Color? colorOverride = null) { if (clips != null && clips.Length != 0) { int num = Random.Range(0, clips.Length); string subtitle = null; if (subtitles != null && num < subtitles.Length) { subtitle = subtitles[num]; } CreateVoiceSource(enemy, enemyName, clips[num], subtitle, interrupt, colorOverride); } } 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); } } } } public static class WavUtility { public static AudioClip ToAudioClip(byte[] fileBytes, string name = "AudioClip") { using (MemoryStream memoryStream = new MemoryStream(fileBytes)) { using BinaryReader binaryReader = new BinaryReader(memoryStream); string text = new string(binaryReader.ReadChars(4)); if (text != "RIFF") { return null; } binaryReader.ReadInt32(); string text2 = new string(binaryReader.ReadChars(4)); if (text2 != "WAVE") { return null; } int num = 0; int num2 = 0; int num3 = 0; while (memoryStream.Position < memoryStream.Length) { string text3 = new string(binaryReader.ReadChars(4)); int num4 = binaryReader.ReadInt32(); if (text3 == "fmt ") { binaryReader.ReadInt16(); num = binaryReader.ReadInt16(); num2 = binaryReader.ReadInt32(); binaryReader.ReadInt32(); binaryReader.ReadInt16(); int num5 = binaryReader.ReadInt16(); num3 = num5 / 8; if (num4 > 16) { binaryReader.ReadBytes(num4 - 16); } continue; } if (text3 == "data") { int num6 = num4 / num3 / num; float[] array = new float[num6 * num]; for (int i = 0; i < num6 * num; i++) { switch (num3) { case 2: { short num7 = binaryReader.ReadInt16(); array[i] = (float)num7 / 32768f; break; } case 1: { byte b = binaryReader.ReadByte(); array[i] = (float)(b - 128) / 128f; break; } } } AudioClip val = AudioClip.Create(name, num6, num, num2, false); val.SetData(array, 0); return val; } binaryReader.ReadBytes(num4); } } return null; } } } namespace UltraVoice.Characters { public class CerberusCharacter { 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(ManualLogSource logger) { PreludeClip = UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUpSpecial.wav"); AwakenClips = (AudioClip[])(object)new AudioClip[6] { UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp2.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp3.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp4.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp5.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_WakeUp6.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Cerberus.cerb_Enrage1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Enrage2.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Enrage3.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Enrage4.wav") }; ThrowClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Cerberus.cerb_Orb1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Orb2.wav") }; StompClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Cerberus.cerb_Stomp1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Stomp2.wav") }; TackleClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Cerberus.cerb_Tackle1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Tackle2.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Cerberus.cerb_Death1.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Death2.wav"), UltraVoicePlugin.LoadClip("Cerberus.cerb_Death3.wav") }; logger.LogInfo((object)"Cerberus voice lines loaded successfully!"); } } [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 = CerberusCharacter.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_006f: 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; VoiceManager.PlayRandomVoice((Component)(object)cerb, "Cerberus", CerberusCharacter.AwakenClips, CerberusCharacter.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; VoiceManager.PlayRandomVoice((Component)(object)cerb, "Cerberus", CerberusCharacter.EnrageClips, CerberusCharacter.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; VoiceManager.PlayRandomVoice((Component)(object)cerberus, "Cerberus", CerberusCharacter.ThrowClips, CerberusCharacter.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; VoiceManager.PlayRandomVoice((Component)(object)cerberus, "Cerberus", CerberusCharacter.StompClips, CerberusCharacter.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; VoiceManager.PlayRandomVoice((Component)(object)cerberus, "Cerberus", CerberusCharacter.TackleClips, CerberusCharacter.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 && CerberusCharacter.DeathClips != null && CerberusCharacter.DeathClips.Length != 0) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Cerberus", CerberusCharacter.DeathClips, null, interrupt: true); } } } public class EarthmoverCharacter { public static AudioClip IntroClip; public static AudioClip BloodVentClip; public static AudioClip DefenseSystemClip; public static AudioClip BloodFloodClip; public static AudioClip BrainBattleClip; public static AudioClip BrainKilledClip; public static float lastBloodFloodTime; public static float lastBrainBattleTime; public static float lastSelfDestructTime; public static void LoadVoiceLines(ManualLogSource logger) { IntroClip = UltraVoicePlugin.LoadClip("Earthmover.em_Intro.wav"); BloodVentClip = UltraVoicePlugin.LoadClip("Earthmover.em_BloodVent.wav"); DefenseSystemClip = UltraVoicePlugin.LoadClip("Earthmover.em_DefenseSystem.wav"); BloodFloodClip = UltraVoicePlugin.LoadClip("Earthmover.em_BloodFlood.wav"); BrainBattleClip = UltraVoicePlugin.LoadClip("Earthmover.em_BrainBattle.wav"); BrainKilledClip = UltraVoicePlugin.LoadClip("Earthmover.em_BrainKilled.wav"); logger.LogInfo((object)"Earthmover voice lines loaded successfully!"); } } [HarmonyPatch(typeof(AudioSource))] internal class EarthmoverPlayerDetectedPatch { [CompilerGenerated] private sealed class <<Postfix>g__Detected|1_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__Detected|1_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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton<NewMovement>.Instance, "Earthmover_Intro", EarthmoverCharacter.IntroClip, "MULTIPLE MACHINE SIGNATURES PRESENT ON RADAR", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 2; return true; case 2: <>1__state = -1; VoiceManager.ShowSubtitle("THREAT LEVEL: MAXIMAL", <src>5__1); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 3; return true; case 3: <>1__state = -1; VoiceManager.ShowSubtitle("READYING WEAPONS", <src>5__1); 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 IEnumerable<MethodBase> TargetMethods() { return from method in AccessTools.GetDeclaredMethods(typeof(AudioSource)) where !method.IsStatic && method.Name.Contains("Play") select method; } private static void Postfix(AudioSource __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.EarthmoverVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 0.1f) && !((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.clip == (Object)null)) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198") && ((Object)__instance.clip).name == "Centaur A-1") { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(Detected()); } } [IteratorStateMachine(typeof(<<Postfix>g__Detected|1_0>d))] static IEnumerator Detected() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__Detected|1_0>d(0); } } } [HarmonyPatch(typeof(Crossfade), "StartFade")] internal class EarthmoverBloodVentPatch { [CompilerGenerated] private sealed class <<Postfix>g__BloodVent|0_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__BloodVent|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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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; <src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton<NewMovement>.Instance, "Earthmover_BloodVent", EarthmoverCharacter.BloodVentClip, "CONTAMINATED BLOOD DETECTED IN FUEL TANK B", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(3.25f); <>1__state = 2; return true; case 2: <>1__state = -1; VoiceManager.ShowSubtitle("OPENING VENTS", <src>5__1); 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(Crossfade __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.EarthmoverVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 0.1f)) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198") && ((Object)__instance.to.clip).name == "Centaur A-2") { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(BloodVent()); } } [IteratorStateMachine(typeof(<<Postfix>g__BloodVent|0_0>d))] static IEnumerator BloodVent() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__BloodVent|0_0>d(0); } } } [HarmonyPatch(typeof(CombinedBossBar), "OnEnable")] internal class EarthmoverDefenseSystemPatch { [CompilerGenerated] private sealed class <<Postfix>g__DefenseSystem|0_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__DefenseSystem|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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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; <src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton<NewMovement>.Instance, "Earthmover_DefenseSystem", EarthmoverCharacter.DefenseSystemClip, "UNAUTHORIZED PERSONNEL DETECTED AT INTERIOR ENTRANCE", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(3.75f); <>1__state = 2; return true; case 2: <>1__state = -1; VoiceManager.ShowSubtitle("ENGAGING DEFENSE SYSTEM", <src>5__1); 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(CombinedBossBar __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.EarthmoverVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 0.1f)) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198") && ((Object)__instance).name == "SecuritySystem") { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(DefenseSystem()); } } [IteratorStateMachine(typeof(<<Postfix>g__DefenseSystem|0_0>d))] static IEnumerator DefenseSystem() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__DefenseSystem|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverBloodFloodPatch { [CompilerGenerated] private sealed class <<Postfix>g__BloodFlood|0_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__BloodFlood|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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton<NewMovement>.Instance, "Earthmover_BloodFlood", EarthmoverCharacter.BloodFloodClip, "UNAUTHORIZED PERSONNEL HAS BREACHED INTERIOR ENTRANCE", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(2.75f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.ShowSubtitle("FLUSHING INTERIOR", <src>5__1); 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(GameObject __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!UltraVoicePlugin.EarthmoverVoiceEnabled.value) { return; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198" || (Object)(object)__instance == (Object)null || !(((Object)__instance).name == "SecondBeats") || Time.time - EarthmoverCharacter.lastBloodFloodTime < 0.1f) { return; } Transform val = __instance.transform.Find("Alarm"); if (!((Object)(object)val == (Object)null)) { AudioSource component = ((Component)val).GetComponent<AudioSource>(); if (!((Object)(object)component == (Object)null) && component.isPlaying) { EarthmoverCharacter.lastBloodFloodTime = Time.time; ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(BloodFlood()); } } [IteratorStateMachine(typeof(<<Postfix>g__BloodFlood|0_0>d))] static IEnumerator BloodFlood() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__BloodFlood|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverBrainBattlePatch { [CompilerGenerated] private sealed class <<Postfix>g__BrainBattle|0_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__BrainBattle|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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <src>5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton<NewMovement>.Instance, "Earthmover_BrainBattle", EarthmoverCharacter.BrainBattleClip, "UNAUTHORIZED PERSONNEL HAS BREACHED CENTRAL CONTROL TOWER", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.ShowSubtitle("ENGAGING DEFENSE PROTOCOLS", <src>5__1); 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(GameObject __instance) { //IL_0035: 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) if (UltraVoicePlugin.EarthmoverVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && __instance.activeSelf) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198") && ((Object)__instance).name == "Beams" && ((Object)__instance.transform.parent.parent).name == "LaserRing" && !(Time.time - EarthmoverCharacter.lastBrainBattleTime < 0.1f)) { EarthmoverCharacter.lastBrainBattleTime = Time.time; ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(BrainBattle()); } } [IteratorStateMachine(typeof(<<Postfix>g__BrainBattle|0_0>d))] static IEnumerator BrainBattle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__BrainBattle|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverSelfDestructPatch { [CompilerGenerated] private sealed class <<Postfix>g__SelfDestruct|0_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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__SelfDestruct|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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown 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)MonoSingleton<NewMovement>.Instance, "Earthmover_SelfDestruct", EarthmoverCharacter.BrainKilledClip, "CRITICAL DAMAGE DETECTED IN CENTRAL CONTROL TOWER!", shouldInterrupt: true, null, 1f, 0f, 3f); <>2__current = (object)new WaitForSeconds(3.25f); <>1__state = 2; return true; case 2: <>1__state = -1; VoiceManager.ShowSubtitle("SELF-DESTRUCT SEQUENCE INITIATED!", <src>5__1); <>2__current = (object)new WaitForSeconds(2.25f); <>1__state = 3; return true; case 3: <>1__state = -1; VoiceManager.ShowSubtitle("ALL PERSONNEL EVACUATE IMMEDIATELY!", <src>5__1); 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(GameObject __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && __instance.activeSelf && UltraVoicePlugin.EarthmoverVoiceEnabled.value) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "6e981b1865c649749a610aafc471e198") && ((Object)__instance).name == "Countdown" && !(Time.time - EarthmoverCharacter.lastSelfDestructTime < 0.1f)) { EarthmoverCharacter.lastSelfDestructTime = Time.time; ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(SelfDestruct()); } } [IteratorStateMachine(typeof(<<Postfix>g__SelfDestruct|0_0>d))] static IEnumerator SelfDestruct() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__SelfDestruct|0_0>d(0); } } } 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 AgonisIntroClip; public static AudioClip RudrakshaIntroClip; public static AudioClip AgonisDownedClip; public static AudioClip RudrakshaDownedClip; public static AudioClip[] SpawnClips; public static AudioClip[] ChatterClips; public static AudioClip[] DeathClips; public static readonly string[] ChatterSubs = new string[4] { "Have at you!", "Come on!", "Come at me!", "Try me!" }; public static readonly string[] SpawnSubs = new string[5] { "Another soul to face my wrath.", "If you seek death, you have found it.", "You are not the first. You will not be the last.", "I have no mercy left to give.", "I grow weary of your kind." }; 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>(); return component.mirrorOnly; } public static bool IsRudraksha(Ferryman ferryman) { if (!IsAgonisOrRudraksha(ferryman)) { return false; } EnemyIdentifier component = ((Component)ferryman).GetComponent<EnemyIdentifier>(); return !component.mirrorOnly; } public static void LoadVoiceLines(ManualLogSource logger) { BossIntroClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_FightStarted.wav"); CoinSkipClip = UltraVoicePlugin.LoadClip("Ferryman.Ferry_CoinSkip.wav"); CoinFightClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_CoinFight.wav"); PhaseChangeClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_PhaseChange.wav"); ApproachClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_Approach.wav"); AgonisIntroClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_SpawnSpecialAgonis.wav"); RudrakshaIntroClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_SpawnSpecialRudraksha.wav"); AgonisDownedClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_DownedAgonis.wav"); RudrakshaDownedClip = UltraVoicePlugin.LoadClip("Ferryman.ferry_DownedRudraksha.wav"); SpawnClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Ferryman.ferry_Spawn1.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Spawn2.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Spawn3.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Spawn4.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Spawn5.wav") }; ChatterClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Ferryman.Ferry_Chatter1.wav"), UltraVoicePlugin.LoadClip("Ferryman.Ferry_Chatter2.wav"), UltraVoicePlugin.LoadClip("Ferryman.Ferry_Chatter3.wav"), UltraVoicePlugin.LoadClip("Ferryman.Ferry_Chatter4.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Ferryman.ferry_Death1.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Death2.wav"), UltraVoicePlugin.LoadClip("Ferryman.ferry_Death3.wav") }; logger.LogInfo((object)"Ferryman voice lines loaded successfully!"); } } [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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_0119: 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 WRETCH", <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 granted you passage, and you repay me with DECEIT!?", <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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00f8: 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 your kind", <src>5__1, (Color?)new Color(0f, 0.66f, 0.77f)); <>2__current = (object)new WaitForSeconds(2.75f); <>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 share his failure", <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) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!UltraVoicePlugin.FerrymanVoiceEnabled.value || (Object)(object)__instance == (Object)null) { return; } VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; FerrymanCharacter.FerrymanPhaseChangePlayed = false; Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "e964cf0ffaa9e0e4e940b5c738983796") { 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; } } else if (!FerrymanCharacter.IsAgonisOrRudraksha(__instance)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Ferryman", FerrymanCharacter.SpawnClips, FerrymanCharacter.SpawnSubs); } else if (FerrymanCharacter.IsAgonis(__instance)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "Ferryman", FerrymanCharacter.AgonisIntroClip); } else if (FerrymanCharacter.IsRudraksha(__instance)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "Ferryman", FerrymanCharacter.RudrakshaIntroClip, "Leave us alone!"); } [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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_0150: 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.5f); <>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.IsAgonis(__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 3f) && !(Random.Range(0f, 1f) < 0.75f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Ferryman", 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_0025: 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_0076: Expected O, but got Unknown //IL_00a0: 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; <>2__current = (object)new WaitForSeconds(1.5f); <>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), "OnDeath")] internal class FerrymanDeathPatch { private static void Prefix(Ferryman __instance) { if (UltraVoicePlugin.FerrymanVoiceEnabled.value && !FerrymanCharacter.IsAgonis(__instance)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Ferryman", FerrymanCharacter.DeathClips, null, interrupt: true); } } } [HarmonyPatch(typeof(Ferryman), "Knockdown")] internal class FerrymanKnockdownSpecialPatch { [CompilerGenerated] private sealed class <<Postfix>g__PlayDownedRudraksha|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__PlayDownedRudraksha|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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_009a: 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, "FerrymanDowned", FerrymanCharacter.RudrakshaDownedClip, null, shouldInterrupt: true); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.ShowSubtitle("No, not now...", <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) { if (FerrymanCharacter.IsAgonis(__instance)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "Ferryman", FerrymanCharacter.AgonisDownedClip); } else if (FerrymanCharacter.IsRudraksha(__instance)) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayDownedRudraksha(__instance)); } } [IteratorStateMachine(typeof(<<Postfix>g__PlayDownedRudraksha|0_0>d))] static IEnumerator PlayDownedRudraksha(Ferryman ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__PlayDownedRudraksha|0_0>d(0) { ferry = ferry }; } } } [HarmonyPatch(typeof(FerrymanFake), "Update")] internal class FerrymanFakeProximityPatch { private static void Postfix(FerrymanFake __instance) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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) { NewMovement instance = MonoSingleton<NewMovement>.Instance; 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, 1f, 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(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Gutterman.gm_Spawn1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Spawn2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Spawn3.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Spawn4.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Spawn5.wav") }; SpinUpClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Gutterman.gm_RevUp1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_RevUp2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_RevUp3.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_RevUp4.wav") }; LostSightClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Gutterman.gm_LostSight1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_LostSight2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_LostSight3.wav") }; ShieldBreakClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Gutterman.gm_GuardBreak1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_GuardBreak2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_GuardBreak3.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Gutterman.gm_Enrage1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Enrage2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Enrage3.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Enrage4.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Gutterman.gm_Death1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Death2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Death3.wav") }; ParryClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Gutterman.gm_Parry1.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Parry2.wav"), UltraVoicePlugin.LoadClip("Gutterman.gm_Parry3.wav") }; logger.LogInfo((object)"Gutterman voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Gutterman), "Start")] internal class GuttermanSpawnPatch { private static void Postfix(Gutterman __instance) { if (UltraVoicePlugin.GuttermanVoiceEnabled.value && !__instance.dead) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; VoiceManager.PlayRandomVoice((Component)(object)__instance, "Gutterman", GuttermanCharacter.SpawnClips, GuttermanCharacter.SpawnSubs); } } } [HarmonyPatch(typeof(Gutterman), "ShieldBreak")] internal class GuttermanShieldBreakPatch { private static void Postfix(Gutterman __instance) { if (UltraVoicePlugin.GuttermanVoiceEnabled.value) { if (__instance.enraged) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Gutterman", GuttermanCharacter.EnrageClips, GuttermanCharacter.EnrageSubs, interrupt: true); } else { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Gutterman", GuttermanCharacter.ShieldBreakClips, GuttermanCharacter.ShieldBreakSubs); } } } } [HarmonyPatch(typeof(Gutterman), "Death")] internal class GuttermanDeathPatch { private static void Postfix(Gutterman __instance) { if (UltraVoicePlugin.GuttermanVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Gutterman", 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)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Gutterman", 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!", "UGH, MY HEAD…", "SCHEIẞE!" }; public static bool GuttertankSpawnInMirror = false; public static void LoadVoiceLines(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Guttertank.gt_Spawn1.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_Spawn2.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_Spawn3.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_Spawn4.wav") }; AttackClip = UltraVoicePlugin.LoadClip("Guttertank.gt_Attack.wav"); PunchHitClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Guttertank.gt_PunchHit1.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_PunchHit2.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_PunchHit3.wav") }; FrustratedClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Guttertank.gt_PunchTrip1.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_PunchTrip2.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_PunchTrip3.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_PunchTrip4.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Guttertank.gt_Death1.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_Death2.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_Death3.wav") }; TripPainClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Guttertank.gt_TripPain1.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_TripPain2.wav"), UltraVoicePlugin.LoadClip("Guttertank.gt_TripPain3.wav") }; logger.LogInfo((object)"Guttertank voice lines loaded successfully!"); } } [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 { VoiceManager.PlayRandomVoice((Component)(object)__instance2, "Guttertank", 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 { VoiceManager.PlayRandomVoice((Component)(object)__instance2, "Guttertank", 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 <<Postfix>g__Frustration|0_2>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Guttertank tank; private <>c__DisplayClass0_1 <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <<Postfix>g__Frustration|0_2>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass0_1(); <>8__1.tank = tank; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>8__1.tank.dead || (Object)(object)<>8__1.tank == (Object)null || <>8__1.tank.eid.dead) { return false; } ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate { VoiceManager.PlayRandomVoice((Component)(object)<>8__1.tank, "Guttertank", GuttertankCharacter.FrustratedClips, GuttertankCharacter.FrustratedSubs, interrupt: true); }, () => GuttertankCharacter.FrustratedClips != null && GuttertankCharacter.FrustratedClips.Length != 0, (Component)(object)<>8__1.tank)); 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 <>c__DisplayClass0_1 { public Guttertank tank; internal void <Postfix>b__3() { VoiceManager.PlayRandomVoice((Component)(object)tank, "Guttertank", GuttertankCharacter.FrustratedClips, GuttertankCharacter.FrustratedSubs, interrupt: true); } } private static void Postfix(Guttertank __instance) { Guttertank __instance2 = __instance; if (UltraVoicePlugin.GuttertankVoiceEnabled.value) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(UltraVoicePlugin.DelayedVox(delegate { VoiceManager.PlayRandomVoice((Component)(object)__instance2, "Guttertank", GuttertankCharacter.TripPainClips, null); }, () => GuttertankCharacter.TripPainClips != null && GuttertankCharacter.TripPainClips.Length != 0, (Component)(object)__instance2)); ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(Frustration(__instance2)); } [IteratorStateMachine(typeof(<<Postfix>g__Frustration|0_2>d))] static IEnumerator Frustration(Guttertank tank) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<Postfix>g__Frustration|0_2>d(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 { VoiceManager.PlayRandomVoice((Component)(object)__instance2, "Guttertank", 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 MaliciousFaceCharacter { public static AudioClip[] GenericClips; public static AudioClip[] EnrageClips; public static AudioClip DeathClip; public static readonly string[] GenericSubs = new string[5] { "BLEED", "FOOLISH", "FUTILE", "FRAIL", "WEAKLING" }; public static readonly string[] EnrageSubs = new string[3] { "ENOUGH", "SUFFER", "PATHETIC" }; public static void LoadVoiceLines(ManualLogSource logger) { GenericClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Generic1.wav"), UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Generic2.wav"), UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Generic3.wav"), UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Generic4.wav"), UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Generic5.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Enraged1.wav"), UltraVoicePlugin.LoadClip("MaliciousFa