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 d__35 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Action playAction; public Func ready; public Component attached; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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; 5__1 = 0f; break; case 1: <>1__state = -1; 5__1 += 0.1f; break; } if (!ready() && 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 SwordsmachineVoiceActorField; public static EnumField SentryVoiceActorField; public static ConfigPanel TogglesPanel; public static ConfigPanel SubtitleColorPanel; public static ConfigPanel SlidersPanel; public static ConfigPanel ActorPanel; private static Dictionary> characterVoiceLines = new Dictionary>(); 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(ActorPanel, "Swordsmachine Voice Actor", "smvoiceactor", SwordsmachineVoiceActor.Mel); SentryVoiceActorField = new EnumField(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(d__35))] public static IEnumerator DelayedVox(Action playAction, Func ready, Component attached) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__35(0) { playAction = playAction, ready = ready, attached = attached }; } } } namespace UltraVoice.Utilities { public class VoiceManager { private static float lastVoiceTime = -999f; private static Dictionary enemyVoiceCooldown = new Dictionary(); public static Dictionary spawnVoiceEndTimes = new Dictionary(); public static Dictionary enemySpawnTimes = new Dictionary(); 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(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(); 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.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 = "" + text + ""; MonoSingleton.Instance.DisplaySubtitle(text2, src, false); } else { MonoSingleton.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 d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueFake cerb; private AudioClip 5__1; private GameObject 5__2; private AudioSource 5__3; private AudioMixerController 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 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; 5__1 = CerberusCharacter.PreludeClip; if ((Object)(object)5__1 == (Object)null) { return false; } 5__2 = new GameObject("UltraVoice_CerberusIntro"); 5__2.transform.position = ((Component)cerb).transform.position; 5__3 = 5__2.AddComponent(); 5__3.clip = 5__1; 5__3.spatialBlend = 1f; 5__3.volume = 1f; 5__3.minDistance = 50f; 5__3.maxDistance = 500f; 5__3.dopplerLevel = 0f; 5__4 = MonoSingleton.Instance; 5__3.outputAudioMixerGroup = 5__4.allGroup; 5__3.Play(); if ((Object)(object)5__3 == (Object)null) { return false; } VoiceManager.ShowSubtitle("You tread forbidden ground, machine", 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", 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(d__1))] private static IEnumerator PlayIntro(StatueFake cerb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { cerb = cerb }; } } [HarmonyPatch(typeof(StatueFake), "Activate")] internal class CerberusWakePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueFake cerb; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(d__1))] private static IEnumerator PlayAwaken(StatueFake cerb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new 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 d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueBoss cerb; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(d__1))] private static IEnumerator PlayEnrage(StatueBoss cerb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { cerb = cerb }; } } [HarmonyPatch(typeof(StatueBoss), "Throw")] internal class CerberusThrowPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueBoss cerberus; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(d__1))] private static IEnumerator PlayThrowVoice(StatueBoss cerberus) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { cerberus = cerberus }; } } [HarmonyPatch(typeof(StatueBoss), "Stomp")] internal class CerberusStompPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueBoss cerberus; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(d__1))] private static IEnumerator PlayStompVoice(StatueBoss cerberus) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { cerberus = cerberus }; } } [HarmonyPatch(typeof(StatueBoss), "Tackle")] internal class CerberusTacklePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StatueBoss cerberus; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(d__1))] private static IEnumerator PlayTackleVoice(StatueBoss cerberus) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new 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 <g__Detected|1_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__Detected|1_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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", 5__1); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 3; return true; case 3: <>1__state = -1; VoiceManager.ShowSubtitle("READYING WEAPONS", 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 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(<g__Detected|1_0>d))] static IEnumerator Detected() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__Detected|1_0>d(0); } } } [HarmonyPatch(typeof(Crossfade), "StartFade")] internal class EarthmoverBloodVentPatch { [CompilerGenerated] private sealed class <g__BloodVent|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__BloodVent|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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", 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(<g__BloodVent|0_0>d))] static IEnumerator BloodVent() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__BloodVent|0_0>d(0); } } } [HarmonyPatch(typeof(CombinedBossBar), "OnEnable")] internal class EarthmoverDefenseSystemPatch { [CompilerGenerated] private sealed class <g__DefenseSystem|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__DefenseSystem|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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", 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(<g__DefenseSystem|0_0>d))] static IEnumerator DefenseSystem() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__DefenseSystem|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverBloodFloodPatch { [CompilerGenerated] private sealed class <g__BloodFlood|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__BloodFlood|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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", 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(); if (!((Object)(object)component == (Object)null) && component.isPlaying) { EarthmoverCharacter.lastBloodFloodTime = Time.time; ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(BloodFlood()); } } [IteratorStateMachine(typeof(<g__BloodFlood|0_0>d))] static IEnumerator BloodFlood() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__BloodFlood|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverBrainBattlePatch { [CompilerGenerated] private sealed class <g__BrainBattle|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__BrainBattle|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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", 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(<g__BrainBattle|0_0>d))] static IEnumerator BrainBattle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__BrainBattle|0_0>d(0); } } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class EarthmoverSelfDestructPatch { [CompilerGenerated] private sealed class <g__SelfDestruct|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__SelfDestruct|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)MonoSingleton.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!", 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!", 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(<g__SelfDestruct|0_0>d))] static IEnumerator SelfDestruct() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <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(); return component.mirrorOnly; } public static bool IsRudraksha(Ferryman ferryman) { if (!IsAgonisOrRudraksha(ferryman)) { return false; } EnemyIdentifier component = ((Component)ferryman).GetComponent(); 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 <g__PlayCoin|0_1>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Ferryman ferry; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__PlayCoin|0_1>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanIntro", FerrymanCharacter.CoinFightClip); VoiceManager.spawnVoiceEndTimes[(Component)(object)ferry] = Time.time + FerrymanCharacter.CoinFightClip.length; if ((Object)(object)5__1 == (Object)null) { return false; } if (!Object.op_Implicit((Object)(object)5__1)) { return false; } VoiceManager.ShowSubtitle("You WRETCH", 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)5__1)) { return false; } VoiceManager.ShowSubtitle("I granted you passage, and you repay me with DECEIT!?", 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 <g__PlayNoCoin|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Ferryman ferry; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__PlayNoCoin|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanIntro", FerrymanCharacter.BossIntroClip, null, shouldInterrupt: true); if ((Object)(object)5__1 == (Object)null) { return false; } if (!Object.op_Implicit((Object)(object)5__1)) { return false; } VoiceManager.ShowSubtitle("Gabriel warned me of your kind", 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)5__1)) { return false; } VoiceManager.ShowSubtitle("I will not share his failure", 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(<g__PlayCoin|0_1>d))] static IEnumerator PlayCoin(Ferryman ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__PlayCoin|0_1>d(0) { ferry = ferry }; } [IteratorStateMachine(typeof(<g__PlayNoCoin|0_0>d))] static IEnumerator PlayNoCoin(Ferryman ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__PlayNoCoin|0_0>d(0) { ferry = ferry }; } } } [HarmonyPatch(typeof(FerrymanFake), "CoinCatch")] internal class FerrymanCoinDetectedPatch { [CompilerGenerated] private sealed class <g__Play|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FerrymanFake ferry; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__Play|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)ferry, "FerrymanSkip", FerrymanCharacter.CoinSkipClip, "Hm?", shouldInterrupt: true); if ((Object)(object)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)5__1)) { return false; } VoiceManager.ShowSubtitle("This shall do", 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)5__1)) { return false; } VoiceManager.ShowSubtitle("You may pass", 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(<g__Play|0_0>d))] static IEnumerator Play(FerrymanFake ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <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 <g__PlayPhaseChange|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Ferryman ferry; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__PlayPhaseChange|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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); 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!", 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(<g__PlayPhaseChange|0_0>d))] static IEnumerator PlayPhaseChange(Ferryman ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <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 <g__PlayDownedRudraksha|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Ferryman ferry; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__PlayDownedRudraksha|0_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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); 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...", 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(<g__PlayDownedRudraksha|0_0>d))] static IEnumerator PlayDownedRudraksha(Ferryman ferry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <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.Instance.restarts <= 0) { NewMovement instance = MonoSingleton.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 <g__Frustration|0_2>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Guttertank tank; private <>c__DisplayClass0_1 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <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 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(<g__Frustration|0_2>d))] static IEnumerator Frustration(Guttertank tank) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <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("MaliciousFace.maurice_Enraged2.wav"), UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Enraged3.wav") }; DeathClip = UltraVoicePlugin.LoadClip("MaliciousFace.maurice_Death.wav"); logger.LogInfo((object)"Malicious Face voice lines loaded successfully!"); } } [HarmonyPatch(typeof(MaliciousFace), "Start")] internal class MaliciousFaceSpawnPatch { private static void Postfix(MaliciousFace __instance) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; } } [HarmonyPatch(typeof(MaliciousFace), "Update")] internal class MaliciousFaceChatterPatch { private static void Postfix(MaliciousFace __instance) { if (UltraVoicePlugin.MauriceVoiceEnabled.value && !BlindEnemies.Blind && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead && Random.Range(0f, 1f) < 0.75f) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MaliciousFace", MaliciousFaceCharacter.GenericClips, MaliciousFaceCharacter.GenericSubs); } } } [HarmonyPatch(typeof(MaliciousFace), "Enrage")] internal class MaliciousFaceEnragePatch { private static void Postfix(MaliciousFace __instance) { if (UltraVoicePlugin.MauriceVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MaliciousFace", MaliciousFaceCharacter.EnrageClips, MaliciousFaceCharacter.EnrageSubs); } } } [HarmonyPatch(typeof(MaliciousFace), "OnGoLimp")] internal class MaliciousFaceDeathPatch { private static void Prefix(MaliciousFace __instance) { if (UltraVoicePlugin.MauriceVoiceEnabled.value) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "MaliciousFace", MaliciousFaceCharacter.DeathClip, null, shouldInterrupt: true); } } } public class MannequinCharacter { public static AudioClip[] ChatterClips; public static AudioClip[] DeathClips; public static void LoadVoiceLines(ManualLogSource logger) { ChatterClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Mannequin.mq_Laugh1.wav"), UltraVoicePlugin.LoadClip("Mannequin.mq_Laugh2.wav"), UltraVoicePlugin.LoadClip("Mannequin.mq_Laugh3.wav"), UltraVoicePlugin.LoadClip("Mannequin.mq_Laugh4.wav"), UltraVoicePlugin.LoadClip("Mannequin.mq_Laugh5.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Mannequin.mq_Death1.wav"), UltraVoicePlugin.LoadClip("Mannequin.mq_Death2.wav") }; logger.LogInfo((object)"Mannequin voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Mannequin), "Update")] internal class MannequinChatterPatch { private static void Postfix(Mannequin __instance) { if (UltraVoicePlugin.MannequinVoiceEnabled.value && !BlindEnemies.Blind && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !(Random.Range(0f, 1f) < 0.75f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mannequin", MannequinCharacter.ChatterClips, null); } } } [HarmonyPatch(typeof(Mannequin), "MeleeAttack")] internal class MannequinSwingPatch { private static void Postfix(Mannequin __instance) { if (UltraVoicePlugin.MannequinVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mannequin", MannequinCharacter.ChatterClips, null); } } } [HarmonyPatch(typeof(Mannequin), "OnDeath")] internal class MannequinDeathPatch { private static void Postfix(Mannequin __instance) { if (UltraVoicePlugin.MannequinVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mannequin", MannequinCharacter.DeathClips, null, interrupt: true); } } } public class MindflayerCharacter { public static AudioClip[] SpawnClips; public static AudioClip[] ChatterClips; public static AudioClip[] MeleeClips; public static AudioClip[] EnrageClips; public static AudioClip[] SpawnClipsMasc; public static AudioClip[] ChatterClipsMasc; public static AudioClip[] MeleeClipsMasc; public static AudioClip[] EnrageClipsMasc; public static readonly string[] SpawnSubs = new string[5] { "I require your blood.", "You appear to contain blood.", "You are suitable for blood extraction.", "Please donate your blood to me.", "Thank you for your imminent blood donation." }; public static readonly string[] ChatterSubs = new string[4] { "This process will be brief.", "Your cooperation is appreciated.", "Please do not resist.", "Continued resistance is unnecessary." }; public static readonly string[] MeleeSubs = new string[3] { "Please maintain distance.", "Kindly step back.", "You are too close." }; public static readonly string[] EnrageSubs = new string[4] { "You have made a very unwise choice.", "Your behavior is unacceptable.", "This is your final warning.", "I will correct you by force." }; public static bool IsMascMindflayer(Mindflayer mf) { SkinnedMeshRenderer componentInChildren = ((Component)mf).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return false; } return (Object)(object)componentInChildren.sharedMesh == (Object)(object)mf.maleMesh; } public static void LoadVoiceLines(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn1.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn2.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn3.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn4.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn5.wav") }; ChatterClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter1.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter2.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter3.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter4.wav") }; MeleeClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee1.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee2.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee3.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage1.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage2.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage3.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage4.wav") }; SpawnClipsMasc = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn1Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn2Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn3Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn4Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Spawn5Masc.wav") }; ChatterClipsMasc = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter1Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter2Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter3Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Chatter4Masc.wav") }; MeleeClipsMasc = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee1Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee2Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Melee3Masc.wav") }; EnrageClipsMasc = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage1Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage2Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage3Masc.wav"), UltraVoicePlugin.LoadClip("Mindflayer.mf_Enrage4Masc.wav") }; logger.LogInfo((object)"Mindflayer voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Mindflayer), "Start")] internal class MindflayerSpawnPatch { private static void Postfix(Mindflayer __instance) { if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.SpawnClipsMasc : MindflayerCharacter.SpawnClips); VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mindflayer", clips, MindflayerCharacter.SpawnSubs); } } } [HarmonyPatch(typeof(Mindflayer), "Update")] internal class MindflayerChatterPatch { private static void Postfix(Mindflayer __instance) { if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !BlindEnemies.Blind && !((Object)(object)__instance == (Object)null) && !__instance.dying && VoiceManager.CheckCooldown((Component)(object)__instance, 5f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 3f) && !__instance.dying && Random.Range(0f, 1f) < 0.75f) { AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.ChatterClipsMasc : MindflayerCharacter.ChatterClips); VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mindflayer", clips, MindflayerCharacter.ChatterSubs); } } } [HarmonyPatch(typeof(Mindflayer), "MeleeAttack")] internal class MindflayerMeleePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Mindflayer mf; private AudioClip[] 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)mf == (Object)null) { return false; } 5__1 = (MindflayerCharacter.IsMascMindflayer(mf) ? MindflayerCharacter.MeleeClipsMasc : MindflayerCharacter.MeleeClips); VoiceManager.PlayRandomVoice((Component)(object)mf, "Mindflayer", 5__1, MindflayerCharacter.MeleeSubs); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(Mindflayer __instance) { if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying && VoiceManager.CheckCooldown((Component)(object)__instance, 2f)) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(DelayedMeleeVoice(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator DelayedMeleeVoice(Mindflayer mf) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { mf = mf }; } } [HarmonyPatch(typeof(Mindflayer), "Enrage")] internal class MindflayerEnragePatch { private static void Postfix(Mindflayer __instance) { if (UltraVoicePlugin.MindflayerVoiceEnabled.value && !__instance.dying) { AudioClip[] clips = (MindflayerCharacter.IsMascMindflayer(__instance) ? MindflayerCharacter.EnrageClipsMasc : MindflayerCharacter.EnrageClips); VoiceManager.PlayRandomVoice((Component)(object)__instance, "Mindflayer", clips, MindflayerCharacter.EnrageSubs, interrupt: true); } } } [HarmonyPatch(typeof(Mindflayer), "Death")] internal class MindflayerDeathPatch { private static void Postfix(Mindflayer __instance) { VoiceManager.InterruptVoices((Component)(object)__instance); } } public class MirrorReaperCharacter { public static AudioClip BossSpawnClip; public static AudioClip[] SpawnClips; public static AudioClip[] LaughClips; public static AudioClip[] MirrorTauntClips; public static AudioClip[] PuppetHandClips; public static AudioClip[] DeathClips; public static readonly string[] SpawnSubs = new string[4] { "I FOUND YOU!", "THERE YOU ARE", "FOUND YOU! FOUND YOU!", "YOU CAN'T HIDE!" }; public static readonly string[] MirrorTauntSubs = new string[3] { "TURN AROUND", "LOOK IN THE MIRROR", "DO YOU SEE ME? DO YOU SEE ME?!" }; public static readonly string[] PuppetHandSubs = new string[4] { "TAKE HOLD", "NO ESCAPE", "FIND THEM", "SEEK THEM OUT" }; public static bool Spawned = false; public static void LoadVoiceLines(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("MirrorReaper.mr_SpawnSpecial.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Spawn1.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Spawn2.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Spawn3.wav") }; LaughClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("MirrorReaper.mr_Laugh1.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Laugh2.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Laugh3.wav") }; MirrorTauntClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("MirrorReaper.mr_MirrorTaunt1.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_MirrorTaunt2.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_MirrorTaunt3.wav") }; PuppetHandClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("MirrorReaper.mr_PuppetHand1.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_PuppetHand2.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_PuppetHand3.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_PuppetHand4.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("MirrorReaper.mr_Death1.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Death2.wav"), UltraVoicePlugin.LoadClip("MirrorReaper.mr_Death3.wav") }; logger.LogInfo((object)"Mirror Reaper voice lines loaded successfully!"); } } [HarmonyPatch(typeof(BossHealthBar), "OnEnable")] internal class MirrorReaperBossSpawnPatch { private static void Postfix(BossHealthBar __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value) { Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "45addc6c3730dae418321e00af1116c5") { VoiceManager.enemySpawnTimes[(Component)(object)((Component)__instance).GetComponentInParent()] = Time.time; } VoiceManager.PlayRandomVoice((Component)(object)((Component)__instance).GetComponentInParent(), "MirrorReaper", MirrorReaperCharacter.SpawnClips, MirrorReaperCharacter.SpawnSubs); MirrorReaperCharacter.Spawned = true; } } } [HarmonyPatch(typeof(MirrorReaper), "Start")] internal class MirrorReaperCommonSpawnPatch { private static void Postfix(MirrorReaper __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name == "45addc6c3730dae418321e00af1116c5")) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.SpawnClips, MirrorReaperCharacter.SpawnSubs); MirrorReaperCharacter.Spawned = true; } } } } [HarmonyPatch(typeof(MirrorReaper), "Update")] internal class MirrorReaperChatterPatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value && !BlindEnemies.Blind && MirrorReaperCharacter.Spawned && VoiceManager.CheckCooldown((Component)(object)__instance, 6f) && !(Random.Range(0f, 1f) < 0.75f) && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead) { if (__instance.inMirrorPhase) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.MirrorTauntClips, MirrorReaperCharacter.MirrorTauntSubs); } else { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.LaughClips, null); } } } } [HarmonyPatch(typeof(MirrorReaper), "SwingTriple")] internal class MirrorReaperSwingTriplePatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value && MirrorReaperCharacter.Spawned && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !(Random.Range(0f, 1f) < 0.75f) && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.LaughClips, null); } } } [HarmonyPatch(typeof(MirrorReaper), "SwingVertical")] internal class MirrorReaperSwingVerticalPatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value && MirrorReaperCharacter.Spawned && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !(Random.Range(0f, 1f) < 0.75f) && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.LaughClips, null); } } } [HarmonyPatch(typeof(MirrorReaper), "SwingSpree")] internal class MirrorReaperSwingSpreePatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value && MirrorReaperCharacter.Spawned && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !(Random.Range(0f, 1f) < 0.75f) && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.LaughClips, null); } } } [HarmonyPatch(typeof(MirrorReaper), "GroundWave")] internal class MirrorReaperHandPatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value && MirrorReaperCharacter.Spawned && !((Object)(object)__instance == (Object)null) && !__instance.eid.dead && !(Random.Range(0f, 1f) < 0.75f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.PuppetHandClips, MirrorReaperCharacter.PuppetHandSubs); } } } [HarmonyPatch(typeof(MirrorReaper), "Death")] internal class MirrorReaperDeathPatch { private static void Postfix(MirrorReaper __instance) { if (UltraVoicePlugin.MirrorReaperVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "MirrorReaper", MirrorReaperCharacter.DeathClips, null, interrupt: true); } } } [HarmonyPatch(typeof(SubtitleController), "DisplaySubtitle", new Type[] { typeof(string), typeof(AudioSource), typeof(bool) })] public class PowerSubtitlePatch { private static readonly Color PowerYellow = new Color(0.855f, 0.776f, 0.384f); private static readonly string[] PowerLines = new string[29] { "Be afraid, machine.", "Here shall be your grave.", "It is over, machine!", "Surrender or perish!", "Lay down and die!", "Bastard!", "You piece of SHIT!", "Just DIE already!", "Why won't you die!?", "God DAMN it!", "This lowly thing could never have bested him!", "An inconvenience at best.", "This is a waste of my time!", "Just another worthless object.", "PAY ATTENTION!", "Wait your TURN!", "WRONG TARGET!", "Rapier!", "Greatsword!", "Spear!", "Over here!", "Glaive!", "Take THIS!", "HALT!", "Where is Gabriel and what have you done to him?", "Enough!", "Your insolence must be punished.", "There is no escape from Gabriel's children.", "WHERE IS HE!?" }; public static void Postfix(string caption, AudioSource audioSource, bool ignoreSetting) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) bool flag = false; string[] powerLines = PowerLines; foreach (string text in powerLines) { if (caption == text) { flag = true; break; } } if (!flag) { return; } SubtitleController instance = MonoSingleton.Instance; if ((Object)(object)instance != (Object)null && (Object)(object)instance.previousSubtitle != (Object)null) { TMP_Text componentInChildren = ((Component)instance.previousSubtitle).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Graphic)componentInChildren).color = PowerYellow; } } } } public class ProvidenceCharacter { public static AudioClip[] SpawnClips; public static AudioClip[] AttackClips; public static AudioClip[] DodgeClips; public static readonly string[] SpawnSubs = new string[5] { "The light descends", "The light finds you", "You cannot hide from the light", "He must be found", "His silence calls us here" }; public static readonly string[] AttackSubs = new string[5] { "Your end is written", "You will answer", "You chose this", "This ends here", "I will unmake you" }; public static readonly string[] DodgeSubs = new string[3] { "Foolish", "Unwise", "You know nothing" }; public static bool IsProvidence(Drone d) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 if ((Object)(object)d == (Object)null || (Object)(object)d.eid == (Object)null) { return false; } if ((Object)(object)((Component)d).GetComponent() != (Object)null) { return false; } return (int)d.eid.enemyType == 38; } public static void LoadVoiceLines(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Providence.prov_Spawn1.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Spawn2.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Spawn3.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Spawn4.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Spawn5.wav") }; AttackClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Providence.prov_Chatter1.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Chatter2.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Chatter3.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Chatter4.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Chatter5.wav") }; DodgeClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Providence.prov_Dodge1.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Dodge2.wav"), UltraVoicePlugin.LoadClip("Providence.prov_Dodge3.wav") }; logger.LogInfo((object)"Providence voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Drone), "Start")] internal class ProvidenceSpawnPatch { private static void Postfix(Drone __instance) { if (UltraVoicePlugin.ProvidenceVoiceEnabled.value && ProvidenceCharacter.IsProvidence(__instance)) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; VoiceManager.PlayRandomVoice((Component)(object)__instance, "Providence", ProvidenceCharacter.SpawnClips, ProvidenceCharacter.SpawnSubs); } } } [HarmonyPatch(typeof(Drone), "Shoot")] internal class ProvidenceShootPatch { private static void Postfix(Drone __instance) { if (UltraVoicePlugin.ProvidenceVoiceEnabled.value && ProvidenceCharacter.IsProvidence(__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 5f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 2f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Providence", ProvidenceCharacter.AttackClips, ProvidenceCharacter.AttackSubs); } } } [HarmonyPatch(typeof(Drone), "ShootSecondary")] internal class ProvidencePincerPatch { private static void Postfix(Drone __instance) { if (UltraVoicePlugin.ProvidenceVoiceEnabled.value && ProvidenceCharacter.IsProvidence(__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 5f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 2f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Providence", ProvidenceCharacter.AttackClips, ProvidenceCharacter.AttackSubs); } } } [HarmonyPatch(typeof(Drone), "DodgeLaugh")] internal class ProvidenceDodgePatch { private static void Postfix(Drone __instance) { if (UltraVoicePlugin.ProvidenceVoiceEnabled.value && ProvidenceCharacter.IsProvidence(__instance) && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 4f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Providence", ProvidenceCharacter.DodgeClips, ProvidenceCharacter.DodgeSubs); } } } public class SentryCharacter { public static AudioClip[] DigInClips; public static AudioClip[] InterruptClips; public static AudioClip[] KickClips; public static AudioClip[] DeathClips; public static AudioClip[] DigInClipsGoob; public static AudioClip[] InterruptClipsGoob; public static AudioClip[] KickClipsGoob; public static AudioClip[] DeathClipsGoob; public static readonly string[] DigInSubs = new string[6] { "This'll do!", "This spot's perfect!", "Now… to wait.", "Let's make this quick.", "Lockin' in.", "Holding here!" }; public static readonly string[] KickSubs = new string[3] { "Outta my face!", "Back off!", "Shoo!" }; public static readonly string[] InterruptSubs = new string[5] { "What the- hey!", "The hell!?", "Oh, you little...", "Oh, come on!", "Seriously!?" }; public static AudioClip[] UseSentryClips(AudioClip[] notoClips, AudioClip[] goobClips) { return (UltraVoicePlugin.SentryVoiceActorField != null && UltraVoicePlugin.SentryVoiceActorField.value == UltraVoicePlugin.SentryVoiceActor.Goober) ? goobClips : notoClips; } public static void LoadVoiceLines(ManualLogSource logger) { DigInClips = (AudioClip[])(object)new AudioClip[6] { UltraVoicePlugin.LoadClip("Sentry.tur_DigIn1.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn2.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn3.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn4.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn5.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn6.wav") }; InterruptClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt1.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt2.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt3.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt4.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt5.wav") }; KickClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Sentry.tur_Kick1.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Kick2.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Kick3.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Sentry.tur_Death1.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Death2.wav") }; DigInClipsGoob = (AudioClip[])(object)new AudioClip[6] { UltraVoicePlugin.LoadClip("Sentry.tur_DigIn1Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn2Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn3Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn4Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn5Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_DigIn6Goob.wav") }; InterruptClipsGoob = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt1Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt2Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt3Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt4Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Interrupt5Goob.wav") }; KickClipsGoob = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Sentry.tur_Kick1Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Kick2Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Kick3Goob.wav") }; DeathClipsGoob = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Sentry.tur_Death1Goob.wav"), UltraVoicePlugin.LoadClip("Sentry.tur_Death2Goob.wav") }; logger.LogInfo((object)"Sentry voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Turret), "StartAiming")] internal class SentryStartAimingPatch { private static void Postfix(Turret __instance) { if (UltraVoicePlugin.SentryVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Sentry", SentryCharacter.UseSentryClips(SentryCharacter.DigInClips, SentryCharacter.DigInClipsGoob), SentryCharacter.DigInSubs); } } } [HarmonyPatch(typeof(Turret), "Kick")] internal class SentryKickPatch { private static void Postfix(Turret __instance) { if (UltraVoicePlugin.SentryVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Sentry", SentryCharacter.UseSentryClips(SentryCharacter.KickClips, SentryCharacter.KickClipsGoob), SentryCharacter.KickSubs); } } } [HarmonyPatch(typeof(Turret), "Interrupt")] internal class SentryInterruptPatch { [CompilerGenerated] private sealed class <g__Interrupt|0_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Turret turret; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__Interrupt|0_0>d(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.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)turret == (Object)null) { return false; } VoiceManager.PlayRandomVoice((Component)(object)turret, "Sentry", SentryCharacter.UseSentryClips(SentryCharacter.InterruptClips, SentryCharacter.InterruptClipsGoob), SentryCharacter.InterruptSubs); 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(Turret __instance) { if (UltraVoicePlugin.SentryVoiceEnabled.value) { VoiceManager.InterruptVoices((Component)(object)__instance); ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(Interrupt(__instance)); } [IteratorStateMachine(typeof(<g__Interrupt|0_0>d))] static IEnumerator Interrupt(Turret turret) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__Interrupt|0_0>d(0) { turret = turret }; } } } [HarmonyPatch(typeof(Turret), "OnDeath")] internal class SentryDeathPatch { private static void Postfix(Turret __instance) { if (UltraVoicePlugin.SentryVoiceEnabled.value) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Sentry", SentryCharacter.UseSentryClips(SentryCharacter.DeathClips, SentryCharacter.DeathClipsGoob), null, interrupt: true); } } } public class StreetcleanerCharacter { public static AudioClip[] ChatterClips; public static AudioClip[] AttackClips; public static AudioClip[] ParryClips; public static AudioClip ScreamingClip; public static readonly string[] ChatterSubs = new string[5] { "IMPURITY", "SANITIZE", "EXTERMINATE", "PURGE", "UNCLEAN" }; public static readonly string[] AttackSubs = new string[5] { "CLEANSING", "PURIFYING", "TO ASH", "QUIT MOVING", "STOP RESISTING" }; public static readonly string[] ParrySubs = new string[3] { "DENIED", "DEFLECTED", "HA HA" }; public static void LoadVoiceLines(ManualLogSource logger) { ChatterClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Streetcleaner.sc_Chatter1.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Chatter2.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Chatter3.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Chatter4.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Chatter5.wav") }; AttackClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Streetcleaner.sc_Attack1.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Attack2.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Attack3.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Attack4.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Attack5.wav") }; ParryClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Streetcleaner.sc_Parry1.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Parry2.wav"), UltraVoicePlugin.LoadClip("Streetcleaner.sc_Parry3.wav") }; ScreamingClip = UltraVoicePlugin.LoadClip("Streetcleaner.sc_Screaming.wav"); logger.LogInfo((object)"Streetcleaner voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Streetcleaner), "Start")] internal class StreetcleanerSpawnTrackPatch { private static void Postfix(Streetcleaner __instance) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; } } [HarmonyPatch(typeof(Streetcleaner), "Update")] internal class StreetcleanerChatterPatch { private static void Postfix(Streetcleaner __instance) { if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && !((Object)(object)__instance == (Object)null) && !__instance.dead && VoiceManager.CheckCooldown((Component)(object)__instance, 4f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 1f) && (double)Random.Range(0f, 1f) < 0.75) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Streetcleaner", StreetcleanerCharacter.ChatterClips, StreetcleanerCharacter.ChatterSubs); } } } [HarmonyPatch(typeof(Streetcleaner), "StartFire")] internal class StreetcleanerFlameAttackPatch { private static void Postfix(Streetcleaner __instance) { if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && (double)Random.Range(0f, 1f) < 0.75) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Streetcleaner", StreetcleanerCharacter.AttackClips, StreetcleanerCharacter.AttackSubs); } } } [HarmonyPatch(typeof(Streetcleaner), "DeflectShot")] internal class StreetcleanerParryPatch { private static void Postfix(Streetcleaner __instance) { if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value && (double)Random.Range(0f, 1f) < 0.5) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Streetcleaner", StreetcleanerCharacter.ParryClips, StreetcleanerCharacter.ParrySubs); } } } [HarmonyPatch(typeof(Streetcleaner), "Update")] internal class StreetcleanerFallPatch { private static void Postfix(Streetcleaner __instance) { if (UltraVoicePlugin.StreetcleanerVoiceEnabled.value) { } } } [HarmonyPatch(typeof(Enemy), "HandleFallingSound")] internal class StreetcleanerScreamingPatch { private static void Prefix(Enemy __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 if ((int)__instance.eid.enemyType == 6 && __instance.ShouldSplat()) { __instance.aud.clip = StreetcleanerCharacter.ScreamingClip; } } } [HarmonyPatch(typeof(Streetcleaner), "OnGoLimp")] internal class StreetcleanerDeathInterruptPatch { private static void Postfix(Streetcleaner __instance) { VoiceManager.InterruptVoices((Component)(object)__instance); } } public class SwordsmachineCharacter { public static AudioClip IntroClip; public static AudioClip IntroClipSecond; public static AudioClip BigPainClip; public static AudioClip LungeClip; public static AudioClip ComboClip; public static AudioClip DeathClip; public static AudioClip KnockdownClipSpecial; public static AudioClip KnockdownClipSpecialBrutal; public static AudioClip AgonySpawnClip; public static AudioClip TundraSpawnClip; public static AudioClip AgonyKnockdownClip; public static AudioClip TundraKnockdownClip; public static AudioClip[] SpawnClips; public static AudioClip[] EnrageClips; public static AudioClip[] KnockdownClips; public static AudioClip[] RangedClips; public static AudioClip IntroClipNoto; public static AudioClip IntroClipSecondNoto; public static AudioClip BigPainClipNoto; public static AudioClip LungeClipNoto; public static AudioClip ComboClipNoto; public static AudioClip DeathClipNoto; public static AudioClip KnockdownClipSpecialNoto; public static AudioClip KnockdownClipSpecialBrutalNoto; public static AudioClip AgonySpawnClipNoto; public static AudioClip TundraSpawnClipNoto; public static AudioClip AgonyKnockdownClipNoto; public static AudioClip TundraKnockdownClipNoto; public static AudioClip[] SpawnClipsNoto; public static AudioClip[] EnrageClipsNoto; public static AudioClip[] KnockdownClipsNoto; public static AudioClip[] RangedClipsNoto; public static readonly string[] EnrageSubs = new string[4] { "GRRR", "GRRR", "MOTHERFUCKER", "OHOHO, YOU ARE SO DEAD" }; public static readonly string[] EnrageSubs2 = new string[4] { "I'LL KICK YOUR ASS!", "I'LL KILL YOU!", null, null }; public static readonly string[] SpawnSubs = new string[7] { "COME ON, COME ON", "LET'S SEE SOME BLOOD", "WHO'S READY TO FIGHT", "I SMELL BLOOD", "I'LL CUT YOU ALL DOWN", "FRESH BLOOD", "MORE MEAT FOR THE SLAUGHTER" }; public static readonly string[] KnockdownSubs = new string[3] { "IS THAT ALL YOU GOT?", "I AIN'T DONE WITH YOU YET!", "I'M JUST GETTING STARTED" }; public static readonly string[] RangedSubs = new string[2] { "CATCH THIS", "TAKE THIS" }; public static Color SwordsmachineColor = new Color(0.91f, 0.6f, 0.05f); public static Color AgonyColor = new Color(0.79f, 0.17f, 0.17f); public static Color TundraColor = new Color(0.2f, 0.73f, 0.87f); public static bool FirstFightDone = false; public static bool FirstFightLinePlayed = false; public static bool IsAgony(SwordsMachine sm) { if ((Object)(object)sm == (Object)null) { return false; } string name = ((Object)((Component)sm).gameObject).name; return name.Contains("Agony"); } public static bool IsTundra(SwordsMachine sm) { if ((Object)(object)sm == (Object)null) { return false; } string name = ((Object)((Component)sm).gameObject).name; return name.Contains("Tundra"); } public static bool IsAgonyOrTundra(SwordsMachine sm) { return IsAgony(sm) || IsTundra(sm); } public static Color? GetColorOverride(SwordsMachine sm) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (IsAgony(sm)) { return AgonyColor; } if (IsTundra(sm)) { return TundraColor; } return SwordsmachineColor; } public static AudioClip UseSwordsmachineClip(AudioClip mofClip, AudioClip notoClip) { return (UltraVoicePlugin.SwordsmachineVoiceActorField != null && UltraVoicePlugin.SwordsmachineVoiceActorField.value == UltraVoicePlugin.SwordsmachineVoiceActor.Noto) ? notoClip : mofClip; } public static AudioClip[] UseSwordsmachineClips(AudioClip[] mofClips, AudioClip[] notoClips) { return (UltraVoicePlugin.SwordsmachineVoiceActorField != null && UltraVoicePlugin.SwordsmachineVoiceActorField.value == UltraVoicePlugin.SwordsmachineVoiceActor.Noto) ? notoClips : mofClips; } public static void LoadVoiceLines(ManualLogSource logger) { IntroClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecial.wav"); IntroClipSecond = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecial2.wav"); BigPainClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_BigPain.wav"); LungeClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_Lunge.wav"); ComboClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_Combo.wav"); DeathClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_Death.wav"); KnockdownClipSpecial = UltraVoicePlugin.LoadClip("Swordsmachine.sm_KnockdownSpecial.wav"); KnockdownClipSpecialBrutal = UltraVoicePlugin.LoadClip("Swordsmachine.sm_PieceOfShit.wav"); KnockdownClipSpecialBrutalNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_PieceOfShitNoto.wav"); AgonySpawnClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecialAgony.wav"); TundraSpawnClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecialTundra.wav"); AgonyKnockdownClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_DownedAgony.wav"); TundraKnockdownClip = UltraVoicePlugin.LoadClip("Swordsmachine.sm_DownedTundra.wav"); SpawnClips = (AudioClip[])(object)new AudioClip[7] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn1.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn2.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn3.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn4.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn5.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn6.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn7.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage1.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage2.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage3.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage4.wav") }; KnockdownClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown1.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown2.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown3.wav") }; RangedClips = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Ranged1.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Ranged2.wav") }; IntroClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecialNoto.wav"); IntroClipSecondNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecial2Noto.wav"); BigPainClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_BigPainNoto.wav"); LungeClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_LungeNoto.wav"); ComboClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_ComboNoto.wav"); DeathClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_DeathNoto.wav"); KnockdownClipSpecialNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_KnockdownSpecialNoto.wav"); AgonySpawnClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecialAgonyNoto.wav"); TundraSpawnClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_SpawnSpecialTundraNoto.wav"); AgonyKnockdownClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_DownedAgonyNoto.wav"); TundraKnockdownClipNoto = UltraVoicePlugin.LoadClip("Swordsmachine.sm_DownedTundraNoto.wav"); SpawnClipsNoto = (AudioClip[])(object)new AudioClip[7] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn1Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn2Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn3Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn4Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn5Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn6Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Spawn7Noto.wav") }; EnrageClipsNoto = (AudioClip[])(object)new AudioClip[4] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage1Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage2Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage3Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Enrage4Noto.wav") }; KnockdownClipsNoto = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown1Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown2Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Knockdown3Noto.wav") }; RangedClipsNoto = (AudioClip[])(object)new AudioClip[2] { UltraVoicePlugin.LoadClip("Swordsmachine.sm_Ranged1Noto.wav"), UltraVoicePlugin.LoadClip("Swordsmachine.sm_Ranged2Noto.wav") }; logger.LogInfo((object)"Swordsmachine voice lines loaded successfully!"); } } [HarmonyPatch(typeof(SwordsMachine), "Start")] internal class SwordsmachineSpawnPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; private AudioClip 5__1; private string 5__2; private AudioSource 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; if (!SwordsmachineCharacter.FirstFightDone) { 5__1 = SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.IntroClip, SwordsmachineCharacter.IntroClipNoto); 5__2 = "YOU WANT A FIGHT? LET'S FIGHT"; } else { 5__1 = SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.IntroClipSecond, SwordsmachineCharacter.IntroClipSecondNoto); 5__2 = "DID YOU THINK I FORGOT ABOUT YOU?"; } 5__3 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineIntro", 5__1, 5__2, shouldInterrupt: true); if ((Object)(object)5__3 != (Object)null) { VoiceManager.spawnVoiceEndTimes[(Component)(object)sm] = Time.time + 5__1.length; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(SwordsMachine __instance) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; if (!UltraVoicePlugin.SwordsmachineVoiceEnabled.value || SwordsmachineCharacter.IsAgonyOrTundra(__instance)) { return; } Scene activeScene; if (__instance.bossVersion) { activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "5bcb2e0461e7fce408badfcb6778c271")) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayBossIntro(__instance)); } } else { activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name == "7927c42db92e4164cae682a55e6b7725")) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Swordsmachine", SwordsmachineCharacter.UseSwordsmachineClips(SwordsmachineCharacter.SpawnClips, SwordsmachineCharacter.SpawnClipsNoto), SwordsmachineCharacter.SpawnSubs, interrupt: true); } } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayBossIntro(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { sm = sm }; } } [HarmonyPatch(typeof(SwordsMachine), "Start")] internal class SwordsmachineSpecialSpawnPatch { private static void Postfix(SwordsMachine __instance) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && SwordsmachineCharacter.IsAgonyOrTundra(__instance)) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; if (SwordsmachineCharacter.IsAgony(__instance)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "AgonySpawn", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.AgonySpawnClip, SwordsmachineCharacter.AgonySpawnClipNoto), "JUMP 'EM!", shouldInterrupt: true, SwordsmachineCharacter.AgonyColor); } else if (SwordsmachineCharacter.IsTundra(__instance)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "TundraSpawn", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.TundraSpawnClip, SwordsmachineCharacter.TundraSpawnClipNoto), "THERE THEY ARE!", shouldInterrupt: true, SwordsmachineCharacter.TundraColor); } } } } [HarmonyPatch(typeof(SwordsMachine), "Enrage")] internal class SwordsmachineEnragePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; private int 5__1; private AudioSource 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.75f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Random.Range(0, SwordsmachineCharacter.EnrageClips.Length); if (!sm.enraged) { return false; } 5__2 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineEnrage", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.EnrageClips[5__1], SwordsmachineCharacter.EnrageClipsNoto[5__1]), SwordsmachineCharacter.EnrageSubs[5__1], shouldInterrupt: true, SwordsmachineCharacter.GetColorOverride(sm)); if ((Object)(object)5__2 == (Object)null) { return false; } if (!string.IsNullOrEmpty(SwordsmachineCharacter.EnrageSubs2[5__1])) { <>2__current = (object)new WaitForSeconds(0.75f); <>1__state = 2; return true; } break; case 2: <>1__state = -1; VoiceManager.ShowSubtitle(SwordsmachineCharacter.EnrageSubs2[5__1], 5__2, SwordsmachineCharacter.GetColorOverride(sm)); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Prefix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && !SwordsmachineCharacter.IsAgonyOrTundra(__instance) && !__instance.enraged) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayEnrage(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayEnrage(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { sm = sm }; } } [HarmonyPatch(typeof(SwordsMachine), "EndFirstPhase")] internal class SwordsmachinePhaseChangePatch { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; private int 5__1; private AudioSource 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Random.Range(0, SwordsmachineCharacter.KnockdownClips.Length); 5__2 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineKnockdown", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.KnockdownClipSpecialBrutal, SwordsmachineCharacter.KnockdownClipSpecialBrutalNoto), "PIECE OF SHIT!", shouldInterrupt: true, SwordsmachineCharacter.GetColorOverride(sm)); 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 d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; private int 5__1; private AudioSource 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Random.Range(0, SwordsmachineCharacter.KnockdownClips.Length); 5__2 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineKnockdown", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.KnockdownClips[5__1], SwordsmachineCharacter.KnockdownClipsNoto[5__1]), SwordsmachineCharacter.KnockdownSubs[5__1], shouldInterrupt: true, SwordsmachineCharacter.GetColorOverride(sm)); 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 d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; SwordsmachineCharacter.FirstFightLinePlayed = true; <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)sm, "SwordsmachineKnockdownSpecial", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.KnockdownClipSpecial, SwordsmachineCharacter.KnockdownClipSpecialNoto), "YOU'RE NOT OFF THE HOOK YET, YOU HEAR ME", shouldInterrupt: true, SwordsmachineCharacter.GetColorOverride(sm)); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 2; return true; case 2: <>1__state = -1; if ((Object)(object)5__1 == (Object)null) { return false; } VoiceManager.ShowSubtitle("I'LL", 5__1, SwordsmachineCharacter.GetColorOverride(sm)); if ((Object)(object)5__1 == (Object)null) { return false; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 3; return true; case 3: <>1__state = -1; VoiceManager.ShowSubtitle("BE", 5__1, SwordsmachineCharacter.GetColorOverride(sm)); if ((Object)(object)5__1 == (Object)null) { return false; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 4; return true; case 4: <>1__state = -1; VoiceManager.ShowSubtitle("BACK!", 5__1, SwordsmachineCharacter.GetColorOverride(sm)); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(SwordsMachine __instance) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!UltraVoicePlugin.SwordsmachineVoiceEnabled.value || SwordsmachineCharacter.IsAgonyOrTundra(__instance)) { return; } VoiceManager.CreateVoiceSource((Component)(object)__instance, "SwordsmachineBigPain", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.BigPainClip, SwordsmachineCharacter.BigPainClipNoto), null, shouldInterrupt: true); Scene activeScene; if (__instance.bossVersion) { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "5bcb2e0461e7fce408badfcb6778c271" && __instance.difficulty < 3 && !SwordsmachineCharacter.FirstFightLinePlayed) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayKnockdownSpecial(__instance)); return; } } if (__instance.bossVersion) { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "5bcb2e0461e7fce408badfcb6778c271" && __instance.difficulty == 4 && !SwordsmachineCharacter.FirstFightLinePlayed) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PieceOfShit(__instance)); return; } } ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayKnockdown(__instance)); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayKnockdown(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { sm = sm }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator PieceOfShit(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { sm = sm }; } [IteratorStateMachine(typeof(d__3))] private static IEnumerator PlayKnockdownSpecial(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { sm = sm }; } } [HarmonyPatch(typeof(SwordsMachine), "Knockdown")] internal class SwordsmachineKnockdownPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SwordsMachine sm; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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 //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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.75f); <>1__state = 1; return true; case 1: <>1__state = -1; if (SwordsmachineCharacter.IsAgony(sm)) { VoiceManager.CreateVoiceSource((Component)(object)sm, "AgonyKnockdown", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.AgonyKnockdownClip, SwordsmachineCharacter.AgonyKnockdownClipNoto), "DAMMIT!", shouldInterrupt: true, SwordsmachineCharacter.AgonyColor); } else if (SwordsmachineCharacter.IsTundra(sm)) { VoiceManager.CreateVoiceSource((Component)(object)sm, "TundraKnockdown", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.TundraKnockdownClip, SwordsmachineCharacter.TundraKnockdownClipNoto), "COVER ME!", shouldInterrupt: true, SwordsmachineCharacter.TundraColor); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 0.1f)) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "SwordsmachineBigPain", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.BigPainClip, SwordsmachineCharacter.BigPainClipNoto), null, shouldInterrupt: true); ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlaySpecialKnockdown(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlaySpecialKnockdown(SwordsMachine sm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { sm = sm }; } } [HarmonyPatch(typeof(SwordsMachine), "TeleportAway")] internal class SwordsmachineTeleportPatch { private static void Postfix(SwordsMachine __instance) { SwordsmachineCharacter.FirstFightDone = true; VoiceManager.InterruptVoices((Component)(object)__instance); } } [HarmonyPatch(typeof(SwordsMachine), "ShootGun")] internal class SwordsmachineShotgunPatch { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f) && !VoiceManager.IsEnemyVoicePlaying((Component)(object)__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 2f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Swordsmachine", SwordsmachineCharacter.UseSwordsmachineClips(SwordsmachineCharacter.RangedClips, SwordsmachineCharacter.RangedClipsNoto), SwordsmachineCharacter.RangedSubs, interrupt: false, SwordsmachineCharacter.GetColorOverride(__instance)); } } } [HarmonyPatch(typeof(SwordsMachine), "SwordThrow")] internal class SwordsmachineSwordThrowPatch { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f) && !VoiceManager.IsEnemyVoicePlaying((Component)(object)__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 2f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Swordsmachine", SwordsmachineCharacter.UseSwordsmachineClips(SwordsmachineCharacter.RangedClips, SwordsmachineCharacter.RangedClipsNoto), SwordsmachineCharacter.RangedSubs, interrupt: false, SwordsmachineCharacter.GetColorOverride(__instance)); } } } [HarmonyPatch(typeof(SwordsMachine), "SwordSpiral")] internal class SwordsmachineSwordSpiralPatch { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f) && !VoiceManager.IsEnemyVoicePlaying((Component)(object)__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 2f)) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "Swordsmachine", SwordsmachineCharacter.UseSwordsmachineClips(SwordsmachineCharacter.RangedClips, SwordsmachineCharacter.RangedClipsNoto), SwordsmachineCharacter.RangedSubs, interrupt: false, SwordsmachineCharacter.GetColorOverride(__instance)); } } } [HarmonyPatch(typeof(SwordsMachine), "Combo")] internal class SwordsmachineComboPatc { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f) && !VoiceManager.IsEnemyVoicePlaying((Component)(object)__instance)) { AudioSource val = VoiceManager.CreateVoiceSource((Component)(object)__instance, "SwordsmachineCombo", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.ComboClip, SwordsmachineCharacter.ComboClipNoto), "DIE, DIE, DIE", shouldInterrupt: false, SwordsmachineCharacter.GetColorOverride(__instance)); } } } [HarmonyPatch(typeof(SwordsMachine), "RunningSwing")] internal class SwordsmachineLungePatch { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 3f) && !VoiceManager.IsEnemyVoicePlaying((Component)(object)__instance)) { AudioSource val = VoiceManager.CreateVoiceSource((Component)(object)__instance, "SwordsmachineLunge", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.LungeClip, SwordsmachineCharacter.LungeClipNoto), "DIE", shouldInterrupt: false, SwordsmachineCharacter.GetColorOverride(__instance)); } } } [HarmonyPatch(typeof(SwordsMachine), "OnGoLimp")] internal class SwordsmachineDeathPatch { private static void Postfix(SwordsMachine __instance) { if (UltraVoicePlugin.SwordsmachineVoiceEnabled.value) { VoiceManager.InterruptVoices((Component)(object)__instance); AudioSource val = VoiceManager.CreateVoiceSource((Component)(object)__instance, "SwordsmachineDeath", SwordsmachineCharacter.UseSwordsmachineClip(SwordsmachineCharacter.DeathClip, SwordsmachineCharacter.DeathClipNoto), null, shouldInterrupt: true, SwordsmachineCharacter.GetColorOverride(__instance)); } } } public class V2Character { public static AudioClip IntroFirstClip; public static AudioClip IntroFirstRestartClip; public static AudioClip IntroSecondClip; public static AudioClip IntroSecondRestartClip; public static AudioClip FastDefeatClip; public static AudioClip DefeatClip; public static AudioClip DeathClip; public static AudioClip FlailingClip; public static AudioClip EnragePatienceClip; public static AudioClip EnragePunchedClip; public static AudioClip EscapingClip; public static AudioClip[] ChatterClips; public static AudioClip[] ChatterPissedClips; public static AudioClip[] PainClips; public static readonly string[] ChatterSubs = new string[5] { "Do keep up with me", "You can do better than that", "Is this your best effort", "Keep your eye open now", "Mind your footing" }; public static readonly string[] ChatterPissedSubs = new string[5] { "What's the matter? Does your arm hurt!?", "You really think you can kill me now!?", "I won't lose to you again!", "I'll make quick work of you this time!", "You don't stand a chance against me!" }; public static Color V2Color = new Color(1f, 1f, 1f); public static float V2IntroTime = -999f; public static bool V2CutsceneVoicePlayed = false; public static bool V2SecondVoiceRestartPlayed = false; public static bool V2DeathPlayed = false; public static void LoadVoiceLines(ManualLogSource logger) { IntroFirstClip = UltraVoicePlugin.LoadClip("V2.v2_IntroFirst.wav"); IntroFirstRestartClip = UltraVoicePlugin.LoadClip("V2.v2_RestartIntroFirst.wav"); IntroSecondClip = UltraVoicePlugin.LoadClip("V2.v2_IntroSecond.wav"); IntroSecondRestartClip = UltraVoicePlugin.LoadClip("V2.v2_RestartIntroSecond.wav"); FastDefeatClip = UltraVoicePlugin.LoadClip("V2.v2_FastDefeat.wav"); DefeatClip = UltraVoicePlugin.LoadClip("V2.v2_Defeat.wav"); DeathClip = UltraVoicePlugin.LoadClip("V2.v2_Death.wav"); FlailingClip = UltraVoicePlugin.LoadClip("V2.v2_Flailing.wav"); EnragePatienceClip = UltraVoicePlugin.LoadClip("V2.v2_EnragePatience.wav"); EnragePunchedClip = UltraVoicePlugin.LoadClip("V2.v2_EnragePunched.wav"); EscapingClip = UltraVoicePlugin.LoadClip("V2.v2_Escaping.wav"); ChatterClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("V2.v2_Chatter1.wav"), UltraVoicePlugin.LoadClip("V2.v2_Chatter2.wav"), UltraVoicePlugin.LoadClip("V2.v2_Chatter3.wav"), UltraVoicePlugin.LoadClip("V2.v2_Chatter4.wav"), UltraVoicePlugin.LoadClip("V2.v2_Chatter5.wav") }; ChatterPissedClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("V2.v2_ChatterPissed1.wav"), UltraVoicePlugin.LoadClip("V2.v2_ChatterPissed2.wav"), UltraVoicePlugin.LoadClip("V2.v2_ChatterPissed3.wav"), UltraVoicePlugin.LoadClip("V2.v2_ChatterPissed4.wav"), UltraVoicePlugin.LoadClip("V2.v2_ChatterPissed5.wav") }; PainClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("V2.v2_Pain1.wav"), UltraVoicePlugin.LoadClip("V2.v2_Pain2.wav"), UltraVoicePlugin.LoadClip("V2.v2_Pain3.wav"), UltraVoicePlugin.LoadClip("V2.v2_Pain4.wav"), UltraVoicePlugin.LoadClip("V2.v2_Pain5.wav") }; logger.LogInfo((object)"V2 voice lines loaded successfully!"); } } [HarmonyPatch(typeof(V2), "Start")] internal class V2IntroFirstPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.9f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2Intro", V2Character.IntroFirstClip); if ((Object)(object)5__1 == (Object)null) { return false; } V2Character.V2IntroTime = Time.time; VoiceManager.spawnVoiceEndTimes[(Component)(object)v2] = Time.time + V2Character.IntroFirstClip.length; VoiceManager.ShowSubtitle("So, you're my predecessor", 5__1); <>2__current = (object)new WaitForSeconds(2.25f); <>1__state = 2; return true; case 2: <>1__state = -1; if ((Object)(object)v2 == (Object)null || !v2.inIntro) { return false; } VoiceManager.ShowSubtitle("How quaint...", 5__1); <>2__current = (object)new WaitForSeconds(1.25f); <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)v2 == (Object)null || !v2.inIntro) { return false; } VoiceManager.ShowSubtitle("I suppose I'll have to show you what an upgrade looks like.", 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(V2 __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) if (MonoSingleton.Instance.restarts < 1 && UltraVoicePlugin.V2VoiceEnabled.value && !__instance.secondEncounter) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "36abcaae9708abc4d9e89e6ec73a2846") && UltraVoicePlugin.V2VoiceEnabled.value && __instance.inIntro) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayIntroFirst(__instance)); } } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayIntroFirst(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { v2 = v2 }; } } [HarmonyPatch(typeof(V2), "Start")] internal class V2IntroRetrySectionPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) //IL_004d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "36abcaae9708abc4d9e89e6ec73a2846") { return false; } <>2__current = (object)new WaitForSeconds(0.75f); <>1__state = 1; return true; } case 1: <>1__state = -1; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2IntroFirstRestart", V2Character.IntroFirstRestartClip, "Back so soon?", shouldInterrupt: true); if ((Object)(object)5__1 == (Object)null) { return false; } VoiceManager.spawnVoiceEndTimes[(Component)(object)v2] = Time.time + V2Character.IntroFirstRestartClip.length; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; if (V2Character.V2SecondVoiceRestartPlayed) { return false; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "ac1675e648695a343bd064c6d0c56e57") { return false; } 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2IntroSecondRestart", V2Character.IntroSecondRestartClip, "Just stay down!", shouldInterrupt: true); if ((Object)(object)5__1 == (Object)null) { return false; } VoiceManager.spawnVoiceEndTimes[(Component)(object)v2] = Time.time + V2Character.IntroSecondRestartClip.length; V2Character.V2SecondVoiceRestartPlayed = true; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(V2 __instance) { if (MonoSingleton.Instance.restarts != 0 && UltraVoicePlugin.V2VoiceEnabled.value) { if (!__instance.secondEncounter) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayRestartFirst(__instance)); } if (__instance.secondEncounter && !V2Character.V2SecondVoiceRestartPlayed) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayRestartSecond(__instance)); } VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayRestartFirst(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { v2 = v2 }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator PlayRestartSecond(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { v2 = v2 }; } } [HarmonyPatch(typeof(V2), "Update")] internal class V2CombatChatterPatch { private static void Postfix(V2 __instance) { if (!((Object)(object)__instance == (Object)null) && UltraVoicePlugin.V2VoiceEnabled.value && !BlindEnemies.Blind && __instance.active && __instance.target != null && !VoiceManager.IsSpawnVoicePlaying((Component)(object)__instance) && !VoiceManager.TooSoonAfterSpawn((Component)(object)__instance, 6f) && VoiceManager.CheckCooldown((Component)(object)__instance, 6f) && !__instance.inIntro && !__instance.enraged && Random.Range(0f, 1f) < 0.75f) { if (!__instance.secondEncounter) { VoiceManager.PlayRandomVoice((Component)(object)__instance, "V2", V2Character.ChatterClips, V2Character.ChatterSubs); } else { VoiceManager.PlayRandomVoice((Component)(object)__instance, "V2", V2Character.ChatterPissedClips, V2Character.ChatterPissedSubs); } } } } [HarmonyPatch(typeof(V2), "KnockedOut")] internal class V2DefeatPatch { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.25f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2Defeat", V2Character.DefeatClip, null, shouldInterrupt: true); if ((Object)(object)5__1 == (Object)null) { return false; } VoiceManager.ShowSubtitle("This isn't over! Mark my words...", 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(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(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(1f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.CreateVoiceSource((Component)(object)v2, "V2Escape", V2Character.EscapingClip, "I won't give you the PLEASURE of killing me!", shouldInterrupt: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2FastDefeat", V2Character.FastDefeatClip, null, shouldInterrupt: true); if ((Object)(object)5__1 == (Object)null) { return false; } VoiceManager.ShowSubtitle("Enough", 5__1); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.ShowSubtitle("You've proven your point...", 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(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public V2 v2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(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.5f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.CreateVoiceSource((Component)(object)((Component)v2).transform, "V2Realization", V2Character.FlailingClip, "No... NO!", shouldInterrupt: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Prefix(V2 __instance) { if (!UltraVoicePlugin.V2VoiceEnabled.value) { return; } float num = Time.time - V2Character.V2IntroTime; if (!__instance.secondEncounter) { if (__instance.inIntro || num < 15f) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayFastDefeat(__instance)); } else { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayDefeat(__instance)); } } else if (!__instance.dead) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayEscape(__instance)); } else { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayRealization(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayFastDefeat(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { v2 = v2 }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator PlayDefeat(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { v2 = v2 }; } [IteratorStateMachine(typeof(d__3))] private static IEnumerator PlayEscape(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { v2 = v2 }; } [IteratorStateMachine(typeof(d__4))] private static IEnumerator PlayRealization(V2 v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { v2 = v2 }; } } [HarmonyPatch(typeof(V2), "OnDamage")] internal class V2PainPatch { private static void Postfix(V2 __instance, ref DamageData data) { if (!(data.damage <= 2f) && !__instance.dead && UltraVoicePlugin.V2VoiceEnabled.value && VoiceManager.CheckCooldown((Component)(object)__instance, 0.1f)) { int num = Random.Range(0, V2Character.PainClips.Length); VoiceManager.CreateVoiceSource((Component)(object)__instance, "V2Pain", V2Character.PainClips[num]); } } } [HarmonyPatch(typeof(V2), "InstaEnrage")] internal class V2InstaEnragePatch { private static void Prefix(V2 __instance) { if (UltraVoicePlugin.V2VoiceEnabled.value && !__instance.enraged) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "V2Enrage", V2Character.EnragePunchedClip, "EXCUSE ME?!", shouldInterrupt: true); } } } [HarmonyPatch(typeof(V2), "Enrage", new Type[] { })] internal class V2PatienceEnragePatch { private static void Postfix(V2 __instance) { if (UltraVoicePlugin.V2VoiceEnabled.value) { VoiceManager.CreateVoiceSource((Component)(object)__instance, "V2Enrage", V2Character.EnragePatienceClip, "COME HERE!"); } } } [HarmonyPatch(typeof(Animator), "Play", new Type[] { typeof(string), typeof(int), typeof(float) })] internal class V2CutsceneVoicePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Animator v2; private AudioSource 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; V2Character.V2CutsceneVoicePlayed = true; 5__1 = VoiceManager.CreateVoiceSource((Component)(object)v2, "V2Cutscene", V2Character.IntroSecondClip); VoiceManager.ShowSubtitle("There you are.", 5__1); if ((Object)(object)v2 == (Object)null || !5__1.isPlaying) { return false; } <>2__current = (object)new WaitForSeconds(1.25f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.ShowSubtitle("I was wondering how long you'd keep my arm...", 5__1); if ((Object)(object)v2 == (Object)null || !5__1.isPlaying) { return false; } <>2__current = (object)new WaitForSeconds(2.75f); <>1__state = 2; return true; case 2: <>1__state = -1; VoiceManager.ShowSubtitle("Don't worry, I'll pry it off you myself.", 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(Animator __instance, string stateName, int layer, float normalizedTime) { if (UltraVoicePlugin.V2VoiceEnabled.value && !((Object)(object)__instance == (Object)null)) { GameObject gameObject = ((Component)__instance).gameObject; if (!(((Object)gameObject).name != "v2_GreenArm") && !V2Character.V2CutsceneVoicePlayed) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayCutsceneVoice(__instance)); } } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayCutsceneVoice(Animator v2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { v2 = v2 }; } } [HarmonyPatch(typeof(GameObject), "SetActive")] internal class V2DeathPatch { private static void Postfix(GameObject __instance, bool value) { if (((Object)__instance).name != "v2_GreenArm" || !UltraVoicePlugin.V2VoiceEnabled.value || V2Character.V2DeathPlayed) { return; } Transform val = __instance.transform; bool flag = false; while ((Object)(object)val != (Object)null) { if (((Object)val).name.Contains("8 Stuff(Clone)(Clone)")) { flag = true; break; } val = val.parent; } if (flag) { VoiceManager.CreateVoiceSource((Component)(object)__instance.transform, "V2Death", V2Character.DeathClip, "NOOOOOOO", shouldInterrupt: true); V2Character.V2DeathPlayed = true; } } } public class VirtueCharacter { public static AudioClip[] SpawnClips; public static AudioClip[] AttackClips; public static AudioClip[] EnrageClips; public static AudioClip[] DeathClips; public static readonly string[] SpawnSubs = new string[5] { "It comes to this.", "I will do what must be done.", "I pray this ends swiftly.", "My orders have been given.", "Forgive me, machine." }; public static readonly string[] AttackSubs = new string[5] { "Why must it be this way?", "I take no joy in this.", "Do not make this harder for yourself.", "Must purpose demand such cruelty?", "I would spare you, if I could." }; public static readonly string[] EnrageSubs = new string[3] { "You force my hand!", "You leave me no choice!", "So be it…" }; public static bool IsVirtue(Drone d) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 if ((Object)(object)d == (Object)null || (Object)(object)d.eid == (Object)null) { return false; } if ((Object)(object)((Component)d).GetComponent() != (Object)null) { return false; } return (int)d.eid.enemyType == 9; } public static void LoadVoiceLines(ManualLogSource logger) { SpawnClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Virtue.virtue_Spawn1.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Spawn2.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Spawn3.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Spawn4.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Spawn5.wav") }; AttackClips = (AudioClip[])(object)new AudioClip[5] { UltraVoicePlugin.LoadClip("Virtue.virtue_Attack1.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Attack2.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Attack3.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Attack4.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Attack5.wav") }; EnrageClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Virtue.virtue_Enrage1.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Enrage2.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Enrage3.wav") }; DeathClips = (AudioClip[])(object)new AudioClip[3] { UltraVoicePlugin.LoadClip("Virtue.virtue_Death1.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Death2.wav"), UltraVoicePlugin.LoadClip("Virtue.virtue_Death3.wav") }; logger.LogInfo((object)"Virtue voice lines loaded successfully!"); } } [HarmonyPatch(typeof(Drone), "Start")] internal class VirtueSpawnPatch { private static void Postfix(Drone __instance) { if (UltraVoicePlugin.VirtueVoiceEnabled.value && VirtueCharacter.IsVirtue(__instance)) { VoiceManager.enemySpawnTimes[(Component)(object)__instance] = Time.time; VoiceManager.PlayRandomVoice((Component)(object)__instance, "Virtue", VirtueCharacter.SpawnClips, VirtueCharacter.SpawnSubs); } } } [HarmonyPatch(typeof(VirtueInsignia), "Activating")] internal class VirtueAttackPatch { private static void Postfix(VirtueInsignia __instance) { if (UltraVoicePlugin.VirtueVoiceEnabled.value) { Drone val = null; if (Object.op_Implicit((Object)(object)__instance.parentEnemy)) { ((Component)__instance.parentEnemy).TryGetComponent(ref val); } else if (Object.op_Implicit((Object)(object)__instance.parentDrone)) { val = __instance.parentDrone; } if (!((Object)(object)val == (Object)null) && VirtueCharacter.IsVirtue(val) && !val.isEnraged && VoiceManager.CheckCooldown((Component)(object)val, 4f) && !VoiceManager.TooSoonAfterSpawn((Component)(object)val, 0.5f) && Random.Range(0f, 1f) < 0.5f) { VoiceManager.PlayRandomVoice((Component)(object)val, "Virtue", VirtueCharacter.AttackClips, VirtueCharacter.AttackSubs); } } } } [HarmonyPatch(typeof(Drone), "Enrage")] internal class VirtueEnragePatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Drone drone; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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)drone, "Virtue", VirtueCharacter.EnrageClips, VirtueCharacter.EnrageSubs, interrupt: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(Drone __instance) { if (UltraVoicePlugin.VirtueVoiceEnabled.value && VirtueCharacter.IsVirtue(__instance)) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayEnrage(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayEnrage(Drone drone) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { drone = drone }; } } [HarmonyPatch(typeof(Drone), "Death")] internal class VirtueDeathPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Drone drone; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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(0f); <>1__state = 1; return true; case 1: <>1__state = -1; VoiceManager.PlayRandomVoice((Component)(object)drone, "Virtue", VirtueCharacter.DeathClips, null, interrupt: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(Drone __instance) { if (UltraVoicePlugin.VirtueVoiceEnabled.value && VirtueCharacter.IsVirtue(__instance)) { ((MonoBehaviour)UltraVoicePlugin.Instance).StartCoroutine(PlayDeath(__instance)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator PlayDeath(Drone drone) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { drone = drone }; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }