Decompiled source of ULTRASHIT v6.0.0
BepInEx/plugins/DeathMessages.dll
Decompiled 9 hours agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using TMPro; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("DeathMessages")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DeathMessages")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c01cdbcd-39dc-446c-a021-553d8f403dc2")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace DeathMessages; [BepInPlugin("com.thehalfbunny.deathmsg", "DeathMSG", "1.0.1")] public class CustomDeathMessagePlugin : BaseUnityPlugin { public static class PluginInfo { public const string PLUGIN_GUID = "com.thehalfbunny.deathmsg"; public const string PLUGIN_NAME = "DeathMSG"; public const string PLUGIN_VERSION = "1.0.1"; } private const string DeathMessage = "<color=white>WARNING: EXTREME BADDIE LOCATED (possibly cacriel)</color>\r\n<color=#ff81f7>MEDIC TF2 DIAGNOSTIC</color>\r\n<color=#ff81f7>ERROR: MASTURBATE #1 NOT RESPONDING</color>\r\n<color=#ff81f7>ERROR: MASTUBATE #2 NOT RESPONDING</color>\r\n<color=white>WARNING: MOLEST SYSTEMS INOPERABLE</color>\r\n<color=#ff81f7>ATTEMPTING RE-CUMMING</color>\r\n<color=#ff81f7>ERROR: SELF MASTURBATE NOT RESPONDING</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INITIATING GOONING PROTOCOL</color>\r\n<color=#ff81f7>ATTEMPTING CONNECTION WITH SEXY POSES MODULES</color>\r\n<color=#ff81f7>ERROR: AWWWW MY LEG #1 NOT RESPONDING</color>\r\n<color=#ff81f7>ERROR: AWWWW MY LEG #2 NOT RESPONDING</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN DICK FUNCTIONS</color>\r\n<color=#ff81f7>ERROR: VISUAL BADDIE IDENTIFIER</color>\r\n<color=#ff81f7>ERROR: LICK FUNCTION NOT RESPONDING</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN THE ACT OF GOONING</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONING -!-</color>\r\n<color=#ff81f7>ERROR: NO BADDIE DETECTED ON INTERFACE, UNABLE TO COMPLETE TASK GOON</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN BASIC DICK FUNCTIONS PROBLEM: ERECTILE DYSFUNCTION</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONER -!-</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONER -!-</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>"; private static ManualLogSource Log; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; SceneManager.sceneLoaded += OnSceneLoaded; Log.LogInfo((object)"Plugin DeathMSG is loaded!"); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902") { Log.LogInfo((object)"Main menu detected, skipping death message change."); return; } DeathSequence val = Object.FindObjectOfType<DeathSequence>(true); if ((Object)(object)val != (Object)null) { TextMeshProUGUI componentInChildren = ((Component)val).GetComponentInChildren<TextMeshProUGUI>(true); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = "<color=white>WARNING: EXTREME BADDIE LOCATED (possibly cacriel)</color>\r\n<color=#ff81f7>MEDIC TF2 DIAGNOSTIC</color>\r\n<color=#ff81f7>ERROR: MASTURBATE #1 NOT RESPONDING</color>\r\n<color=#ff81f7>ERROR: MASTUBATE #2 NOT RESPONDING</color>\r\n<color=white>WARNING: MOLEST SYSTEMS INOPERABLE</color>\r\n<color=#ff81f7>ATTEMPTING RE-CUMMING</color>\r\n<color=#ff81f7>ERROR: SELF MASTURBATE NOT RESPONDING</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INITIATING GOONING PROTOCOL</color>\r\n<color=#ff81f7>ATTEMPTING CONNECTION WITH SEXY POSES MODULES</color>\r\n<color=#ff81f7>ERROR: AWWWW MY LEG #1 NOT RESPONDING</color>\r\n<color=#ff81f7>ERROR: AWWWW MY LEG #2 NOT RESPONDING</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN DICK FUNCTIONS</color>\r\n<color=#ff81f7>ERROR: VISUAL BADDIE IDENTIFIER</color>\r\n<color=#ff81f7>ERROR: LICK FUNCTION NOT RESPONDING</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN THE ACT OF GOONING</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONING -!-</color>\r\n<color=#ff81f7>ERROR: NO BADDIE DETECTED ON INTERFACE, UNABLE TO COMPLETE TASK GOON</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>! CUMMING FAILURE !</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=#ff81f7>INSUFFICIENT CUM.</color>\r\n<color=white>WARNING: UNABLE TO SUSTAIN BASIC DICK FUNCTIONS PROBLEM: ERECTILE DYSFUNCTION</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONER -!-</color>\r\n<color=#ff81f7>-!- SHUTDOWN THE GOONER -!-</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>\r\n<color=#ff81f7>I WANT TO CUM.</color>"; Log.LogInfo((object)"Successfully set custom death message."); } else { Log.LogError((object)"Could not find the TextMeshProUGUI component on the DeathSequence object."); } } else { Log.LogWarning((object)"Could not find a DeathSequence object in this scene."); } } }
BepInEx/plugins/StyleAnnouncer/StyleAnnouncer.dll
Decompiled 9 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("StyleAnnouncer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("StyleAnnouncer")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8448158b-f9d1-43df-8646-48d2e0a392b1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace StyleAnnouncer; [BepInPlugin("com.thehalfbunny.styleannouncer", "StyleAnnouncer", "1.0.1")] [BepInProcess("ULTRAKILL.exe")] public class StyleAnnouncerPlugin : BaseUnityPlugin { public static ConfigEntry<bool> EnableSounds; public static ConfigEntry<bool> PlayOnDownrank; public static ConfigEntry<bool> PlayAlphabetical; public static ConfigEntry<float> Volume; public static StyleAnnouncerPlugin Instance { get; private set; } public ManualLogSource Logger => ((BaseUnityPlugin)this).Logger; private void Awake() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown Instance = this; EnableSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Geral", "Enable Rank Sounds", true, "Ativa ou desativa os sons de rank."); PlayOnDownrank = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Geral", "Play on Downrank", false, "Se ativado, também toca sons quando seu rank diminui."); PlayAlphabetical = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Geral", "Play Alphabetical", false, "Se ativado, toca os sons em ordem alfabética em vez de aleatória."); Volume = ((BaseUnityPlugin)this).Config.Bind<float>("1. Geral", "Volume", 1f, new ConfigDescription("Volume dos sons de rank (de 0.0 a 1.0)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); SoundManager.ReloadSounds(); Harmony val = new Harmony("com.thehalfbunny.styleannouncer"); val.PatchAll(); Logger.LogInfo((object)"StyleAnnouncer by thehalfbunny & Gemini has been loaded!"); } } public static class SoundManager { private class SoundCollection { private List<string> soundPaths = new List<string>(); private int cursor = -1; public void Add(string path) { soundPaths.Add(path); } public void Clear() { soundPaths.Clear(); cursor = -1; } public string GetNextSound() { if (soundPaths.Count == 0) { return null; } if (StyleAnnouncerPlugin.PlayAlphabetical.Value) { cursor = (cursor + 1) % soundPaths.Count; return soundPaths[cursor]; } return soundPaths[Random.Range(0, soundPaths.Count)]; } } private static readonly Dictionary<int, SoundCollection> UprankSounds; private static readonly Dictionary<int, SoundCollection> DownrankSounds; static SoundManager() { UprankSounds = new Dictionary<int, SoundCollection>(); DownrankSounds = new Dictionary<int, SoundCollection>(); for (int i = 0; i < 8; i++) { UprankSounds[i] = new SoundCollection(); DownrankSounds[i] = new SoundCollection(); } } public static void ReloadSounds() { foreach (SoundCollection value2 in UprankSounds.Values) { value2.Clear(); } foreach (SoundCollection value3 in DownrankSounds.Values) { value3.Clear(); } string path = Path.Combine(Path.GetDirectoryName(typeof(StyleAnnouncerPlugin).Assembly.Location), "sounds"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); StyleAnnouncerPlugin.Instance.Logger.LogWarning((object)"'sounds' folder created. Please add your audio files there."); return; } Dictionary<string, int> dictionary = new Dictionary<string, int> { { "D", 0 }, { "C", 1 }, { "B", 2 }, { "A", 3 }, { "S", 4 }, { "SS", 5 }, { "SSS", 6 }, { "ULTR", 7 } }; string[] files = Directory.GetFiles(path); foreach (string path2 in files) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(path2); bool flag = fileNameWithoutExtension.StartsWith("downrank-"); string key = (flag ? fileNameWithoutExtension.Substring(9) : fileNameWithoutExtension); if (dictionary.TryGetValue(key, out var value)) { if (flag) { DownrankSounds[value].Add(path2); } else { UprankSounds[value].Add(path2); } } } StyleAnnouncerPlugin.Instance.Logger.LogInfo((object)"Sound files have been reloaded and categorized."); } public static string GetSoundPathForRank(int rankIndex, bool isAscending) { Dictionary<int, SoundCollection> dictionary = (isAscending ? UprankSounds : DownrankSounds); if (dictionary.ContainsKey(rankIndex)) { return dictionary[rankIndex].GetNextSound(); } return null; } } public class CustomSoundPlayer : MonoBehaviour { [CompilerGenerated] private sealed class <PlaySoundRoutine>d__3 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string path; public CustomSoundPlayer <>4__this; private AudioType <audioType>5__1; private string <extension>5__2; private UnityWebRequest <www>5__3; private AudioClip <clip>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PlaySoundRoutine>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <extension>5__2 = null; <www>5__3 = null; <clip>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <audioType>5__1 = (AudioType)0; <extension>5__2 = Path.GetExtension(path).ToLower(); if (<extension>5__2 == ".wav") { <audioType>5__1 = (AudioType)20; } else if (<extension>5__2 == ".ogg") { <audioType>5__1 = (AudioType)14; } else if (<extension>5__2 == ".mp3") { <audioType>5__1 = (AudioType)13; } <www>5__3 = UnityWebRequestMultimedia.GetAudioClip("file://" + path, <audioType>5__1); <>1__state = -3; <>2__current = <www>5__3.SendWebRequest(); <>1__state = 1; return true; case 1: <>1__state = -3; if ((int)<www>5__3.result == 1) { <clip>5__4 = DownloadHandlerAudioClip.GetContent(<www>5__3); <>4__this.audioSource.volume = StyleAnnouncerPlugin.Volume.Value; <>4__this.audioSource.PlayOneShot(<clip>5__4); Object.Destroy((Object)(object)<clip>5__4, <clip>5__4.length + 0.5f); <clip>5__4 = null; } else { StyleAnnouncerPlugin.Instance.Logger.LogError((object)("Failed to load sound: " + <www>5__3.error)); } <>m__Finally1(); <www>5__3 = null; return false; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<www>5__3 != null) { ((IDisposable)<www>5__3).Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private AudioSource audioSource; private void Awake() { audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); audioSource.playOnAwake = false; } public void Play(string filePath) { if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath)) { ((MonoBehaviour)this).StartCoroutine(PlaySoundRoutine(filePath)); } } [IteratorStateMachine(typeof(<PlaySoundRoutine>d__3))] private IEnumerator PlaySoundRoutine(string path) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PlaySoundRoutine>d__3(0) { <>4__this = this, path = path }; } } [HarmonyPatch(typeof(StyleHUD))] public static class StyleHUDPatch { private static CustomSoundPlayer soundPlayer; private static int lastRank = -1; [HarmonyPostfix] [HarmonyPatch("Start")] public static void StartPostfix(StyleHUD __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)soundPlayer == (Object)null) { GameObject val = new GameObject("StyleAnnouncerSoundPlayer"); val.transform.SetParent(((Component)__instance).transform); soundPlayer = val.AddComponent<CustomSoundPlayer>(); } } [HarmonyPostfix] [HarmonyPatch("AscendRank")] public static void AscendRankPostfix(StyleHUD __instance) { if (StyleAnnouncerPlugin.EnableSounds.Value) { string soundPathForRank = SoundManager.GetSoundPathForRank(__instance.rankIndex, isAscending: true); if (soundPathForRank != null) { soundPlayer.Play(soundPathForRank); } lastRank = __instance.rankIndex; } } [HarmonyPostfix] [HarmonyPatch("DescendRank")] public static void DescendRankPostfix(StyleHUD __instance) { if (StyleAnnouncerPlugin.EnableSounds.Value && StyleAnnouncerPlugin.PlayOnDownrank.Value && lastRank != __instance.rankIndex) { string soundPathForRank = SoundManager.GetSoundPathForRank(__instance.rankIndex, isAscending: false); if (soundPathForRank != null) { soundPlayer.Play(soundPathForRank); } lastRank = __instance.rankIndex; } } }
BepInEx/plugins/UltrakULL/UltrakULL.dll
Decompiled 9 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Xml; using ArabicSupportUnity; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Discord; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Sandbox; using SettingsMenu.Components; using TMPro; using UltrakULL.Harmony_Patches; using UltrakULL.audio; using UltrakULL.json; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("UltrakULL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("UltrakULL")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a4a60eef-e5f3-4a77-b125-236fbf44cca4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } [HarmonyPatch(typeof(IntroViolenceScreen))] public static class IntroViolenceScreenPatch { private static GameObject textObject1; private static GameObject textObject2; [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(IntroViolenceScreen __instance) { Transform parent = ((Component)__instance).transform.parent; if (!((Object)(object)parent == (Object)null)) { Transform val = parent.Find("Image"); Transform val2 = parent.Find("ImageRed"); if ((Object)(object)val != (Object)null) { ReplaceImage(val, "violence1.png"); textObject1 = AddTextToImage(val, LanguageManager.CurrentLanguage.misc.violenceScreenText1, 0f); } if ((Object)(object)val2 != (Object)null) { ReplaceImage(val2, "violence2.png"); textObject2 = AddTextToImage(val2, LanguageManager.CurrentLanguage.misc.violenceScreenText2, 0f); } } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdatePatch(IntroViolenceScreen __instance) { //IL_0071: 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_008c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)textObject1 == (Object)null) && !((Object)(object)textObject2 == (Object)null)) { float value = Traverse.Create((object)__instance).Field("fadeAmount").GetValue<float>(); float value2 = Traverse.Create((object)__instance).Field("targetAlpha").GetValue<float>(); bool value3 = Traverse.Create((object)__instance).Field("fade").GetValue<bool>(); Color color = ((Graphic)Traverse.Create((object)__instance).Field("red").GetValue<Image>()).color; if (value3 && value2 == 1f) { UpdateTextAlpha(textObject1, value); } if (color.a > 0f) { UpdateTextAlpha(textObject1, 0f); UpdateTextAlpha(textObject2, value); } } } private static GameObject AddTextToImage(Transform imageTransform, string text, float startAlpha) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_010a: Expected O, but got Unknown GameObject val = new GameObject("Text"); val.transform.SetParent(imageTransform, false); TextMeshProUGUI __instance = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)__instance).text = text; ((TMP_Text)__instance).enableAutoSizing = true; ((TMP_Text)__instance).fontSizeMin = 10f; ((TMP_Text)__instance).fontSizeMax = 100f; ((TMP_Text)__instance).alignment = (TextAlignmentOptions)514; ((TMP_Text)__instance).overflowMode = (TextOverflowModes)0; ((Graphic)__instance).color = new Color(1f, 1f, 1f, startAlpha); ((TMP_Text)__instance).enableWordWrapping = false; TextMeshProFontSwap.SwapTMPFont(ref __instance); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; float num = Mathf.Min((float)Screen.width * 0.9f, 800f); float num2 = Mathf.Min((float)Screen.height * 0.45f, 300f); component.sizeDelta = new Vector2(num, num2); return val; } private static void UpdateTextAlpha(GameObject textObj, float alpha) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI component = textObj.GetComponent<TextMeshProUGUI>(); ((Graphic)component).color = new Color(((Graphic)component).color.r, ((Graphic)component).color.g, ((Graphic)component).color.b, alpha); } private static void ReplaceImage(Transform imageTransform, string ImageName) { Image component = ((Component)imageTransform).GetComponent<Image>(); if (!((Object)(object)component == (Object)null)) { Sprite val = LoadPNG(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\IntroViolenceScreen", ImageName)); if ((Object)(object)val != (Object)null) { component.sprite = val; } } } private static Sprite LoadPNG(string filePath) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!File.Exists(filePath)) { return null; } byte[] array = File.ReadAllBytes(filePath); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } return null; } } internal enum IsolatedArabicLetters { Hamza = 65152, Alef = 65165, AlefHamza = 65155, WawHamza = 65157, AlefMaksoor = 65159, AlefMaksora = 64508, HamzaNabera = 65161, Ba = 65167, Ta = 65173, Tha2 = 65177, Jeem = 65181, H7aa = 65185, Khaa2 = 65189, Dal = 65193, Thal = 65195, Ra2 = 65197, Zeen = 65199, Seen = 65201, Sheen = 65205, S9a = 65209, Dha = 65213, T6a = 65217, T6ha = 65221, Ain = 65225, Gain = 65229, Fa = 65233, Gaf = 65237, Kaf = 65241, Lam = 65245, Meem = 65249, Noon = 65253, Ha = 65257, Waw = 65261, Ya = 65265, AlefMad = 65153, TaMarboota = 65171, PersianPe = 64342, PersianChe = 64378, PersianZe = 64394, PersianGaf = 64402, PersianGaf2 = 64398, PersianYeh = 64508 } internal enum GeneralArabicLetters { Hamza = 1569, Alef = 1575, AlefHamza = 1571, WawHamza = 1572, AlefMaksoor = 1573, AlefMagsora = 1609, HamzaNabera = 1574, Ba = 1576, Ta = 1578, Tha2 = 1579, Jeem = 1580, H7aa = 1581, Khaa2 = 1582, Dal = 1583, Thal = 1584, Ra2 = 1585, Zeen = 1586, Seen = 1587, Sheen = 1588, S9a = 1589, Dha = 1590, T6a = 1591, T6ha = 1592, Ain = 1593, Gain = 1594, Fa = 1601, Gaf = 1602, Kaf = 1603, Lam = 1604, Meem = 1605, Noon = 1606, Ha = 1607, Waw = 1608, Ya = 1610, AlefMad = 1570, TaMarboota = 1577, PersianPe = 1662, PersianChe = 1670, PersianZe = 1688, PersianGaf = 1711, PersianGaf2 = 1705, PersianYeh = 1740 } internal struct ArabicMapping { public int from; public int to; public ArabicMapping(int from, int to) { this.from = from; this.to = to; } } internal class ArabicTable { private static ArabicMapping[] mapList; private static ArabicTable arabicMapper; internal static ArabicTable ArabicMapper { get { if (arabicMapper == null) { arabicMapper = new ArabicTable(); } return arabicMapper; } } private ArabicTable() { mapList = new ArabicMapping[42] { new ArabicMapping(1569, 65152), new ArabicMapping(1575, 65165), new ArabicMapping(1571, 65155), new ArabicMapping(1572, 65157), new ArabicMapping(1573, 65159), new ArabicMapping(1609, 64508), new ArabicMapping(1574, 65161), new ArabicMapping(1576, 65167), new ArabicMapping(1578, 65173), new ArabicMapping(1579, 65177), new ArabicMapping(1580, 65181), new ArabicMapping(1581, 65185), new ArabicMapping(1582, 65189), new ArabicMapping(1583, 65193), new ArabicMapping(1584, 65195), new ArabicMapping(1585, 65197), new ArabicMapping(1586, 65199), new ArabicMapping(1587, 65201), new ArabicMapping(1588, 65205), new ArabicMapping(1589, 65209), new ArabicMapping(1590, 65213), new ArabicMapping(1591, 65217), new ArabicMapping(1592, 65221), new ArabicMapping(1593, 65225), new ArabicMapping(1594, 65229), new ArabicMapping(1601, 65233), new ArabicMapping(1602, 65237), new ArabicMapping(1603, 65241), new ArabicMapping(1604, 65245), new ArabicMapping(1605, 65249), new ArabicMapping(1606, 65253), new ArabicMapping(1607, 65257), new ArabicMapping(1608, 65261), new ArabicMapping(1610, 65265), new ArabicMapping(1570, 65153), new ArabicMapping(1577, 65171), new ArabicMapping(1662, 64342), new ArabicMapping(1670, 64378), new ArabicMapping(1688, 64394), new ArabicMapping(1711, 64402), new ArabicMapping(1705, 64398), new ArabicMapping(1740, 64508) }; } internal int Convert(int toBeConverted) { for (int i = 0; i < mapList.Length; i++) { ArabicMapping arabicMapping = mapList[i]; if (arabicMapping.from == toBeConverted) { return arabicMapping.to; } } return toBeConverted; } } internal class TashkeelLocation { public char tashkeel; public int position; public TashkeelLocation(char tashkeel, int position) { this.tashkeel = tashkeel; this.position = position; } } internal class ArabicFixerTool { internal static bool showTashkeel = true; internal static bool combineTashkeel = true; internal static bool useHinduNumbers = true; internal static StringBuilder internalStringBuilder = new StringBuilder(); internal static void RemoveTashkeel(ref string str, out List<TashkeelLocation> tashkeelLocation) { tashkeelLocation = new List<TashkeelLocation>(); int lastSplitIndex = 0; internalStringBuilder.Clear(); internalStringBuilder.EnsureCapacity(str.Length); int num = 0; for (int j = 0; j < str.Length; j++) { if (str[j] == '\u064b') { tashkeelLocation.Add(new TashkeelLocation('\u064b', j)); num++; IncrementSB(ref str, j); } else if (str[j] == '\u064c') { tashkeelLocation.Add(new TashkeelLocation('\u064c', j)); num++; IncrementSB(ref str, j); } else if (str[j] == '\u064d') { tashkeelLocation.Add(new TashkeelLocation('\u064d', j)); num++; IncrementSB(ref str, j); } else if (str[j] == '\u064e') { if (num > 0 && combineTashkeel && tashkeelLocation[num - 1].tashkeel == '\u0651') { tashkeelLocation[num - 1].tashkeel = 'ﱠ'; IncrementSB(ref str, j); } else { tashkeelLocation.Add(new TashkeelLocation('\u064e', j)); num++; IncrementSB(ref str, j); } } else if (str[j] == '\u064f') { if (num > 0 && combineTashkeel && tashkeelLocation[num - 1].tashkeel == '\u0651') { tashkeelLocation[num - 1].tashkeel = 'ﱡ'; IncrementSB(ref str, j); } else { tashkeelLocation.Add(new TashkeelLocation('\u064f', j)); num++; IncrementSB(ref str, j); } } else if (str[j] == '\u0650') { if (num > 0 && combineTashkeel && tashkeelLocation[num - 1].tashkeel == '\u0651') { tashkeelLocation[num - 1].tashkeel = 'ﱢ'; IncrementSB(ref str, j); } else { tashkeelLocation.Add(new TashkeelLocation('\u0650', j)); num++; IncrementSB(ref str, j); } } else if (str[j] == '\u0651') { if (num > 0 && combineTashkeel) { if (tashkeelLocation[num - 1].tashkeel == '\u064e') { tashkeelLocation[num - 1].tashkeel = 'ﱠ'; IncrementSB(ref str, j); continue; } if (tashkeelLocation[num - 1].tashkeel == '\u064f') { tashkeelLocation[num - 1].tashkeel = 'ﱡ'; IncrementSB(ref str, j); continue; } if (tashkeelLocation[num - 1].tashkeel == '\u0650') { tashkeelLocation[num - 1].tashkeel = 'ﱢ'; IncrementSB(ref str, j); continue; } } tashkeelLocation.Add(new TashkeelLocation('\u0651', j)); num++; IncrementSB(ref str, j); } else if (str[j] == '\u0652') { tashkeelLocation.Add(new TashkeelLocation('\u0652', j)); num++; IncrementSB(ref str, j); } else if (str[j] == '\u0653') { tashkeelLocation.Add(new TashkeelLocation('\u0653', j)); num++; IncrementSB(ref str, j); } else if (str[j] == 'ﱠ') { IncrementSB(ref str, j); } else if (str[j] == 'ﱡ') { IncrementSB(ref str, j); } else if (str[j] == 'ﱢ') { IncrementSB(ref str, j); } } if (lastSplitIndex != 0) { IncrementSB(ref str, str.Length); str = internalStringBuilder.ToString(); } void IncrementSB(ref string str2, int i) { if (i - lastSplitIndex > 0) { internalStringBuilder.Append(str2, lastSplitIndex, i - lastSplitIndex); } lastSplitIndex = i + 1; } } internal static void ReturnTashkeel(ref char[] letters, List<TashkeelLocation> tashkeelLocation) { Array.Resize(ref letters, letters.Length + tashkeelLocation.Count); for (int i = 0; i < tashkeelLocation.Count; i++) { TashkeelLocation tashkeelLocation2 = tashkeelLocation[i]; for (int num = letters.Length - 1; num > tashkeelLocation2.position; num--) { letters[num] = letters[num - 1]; } letters[tashkeelLocation2.position] = tashkeelLocation2.tashkeel; } } internal static string FixLine(string str) { RemoveTashkeel(ref str, out var tashkeelLocation); char[] array = new char[str.Length]; char[] letters = str.ToCharArray(); for (int i = 0; i < array.Length; i++) { array[i] = (char)ArabicTable.ArabicMapper.Convert(str[i]); } for (int j = 0; j < array.Length; j++) { bool flag = false; if (array[j] == 'ﻝ' && j < array.Length - 1) { if (array[j + 1] == 'ﺇ') { array[j] = 'ﻷ'; letters[j + 1] = '\uffff'; flag = true; } else if (array[j + 1] == 'ﺍ') { array[j] = 'ﻹ'; letters[j + 1] = '\uffff'; flag = true; } else if (array[j + 1] == 'ﺃ') { array[j] = 'ﻵ'; letters[j + 1] = '\uffff'; flag = true; } else if (array[j + 1] == 'ﺁ') { array[j] = 'ﻳ'; letters[j + 1] = '\uffff'; flag = true; } } if (!IsIgnoredCharacter(array[j])) { if (IsMiddleLetter(array, j)) { letters[j] = (char)(array[j] + 3); } else if (IsFinishingLetter(array, j)) { letters[j] = (char)(array[j] + 1); } else if (IsLeadingLetter(array, j)) { letters[j] = (char)(array[j] + 2); } } if (flag) { j++; } letters[j] = (char)HandleInduNumber(array[j], letters[j]); } if (showTashkeel && tashkeelLocation.Count > 0) { ReturnTashkeel(ref letters, tashkeelLocation); } internalStringBuilder.Clear(); internalStringBuilder.EnsureCapacity(letters.Length); List<char> numberList = null; for (int num = letters.Length - 1; num >= 0; num--) { if (char.IsPunctuation(letters[num]) && num > 0 && num < letters.Length - 1 && (char.IsPunctuation(letters[num - 1]) || char.IsPunctuation(letters[num + 1]))) { if (letters[num] != '\uffff') { internalStringBuilder.Append(letters[num]); } } else if (letters[num] == ' ' && num > 0 && num < letters.Length - 1 && (char.IsLower(letters[num - 1]) || char.IsUpper(letters[num - 1]) || char.IsNumber(letters[num - 1])) && (char.IsLower(letters[num + 1]) || char.IsUpper(letters[num + 1]) || char.IsNumber(letters[num + 1]))) { AddNumber(letters[num]); } else if (char.IsNumber(letters[num]) || char.IsLower(letters[num]) || char.IsUpper(letters[num]) || char.IsSymbol(letters[num]) || char.IsPunctuation(letters[num])) { AddNumber(letters[num]); } else if ((letters[num] >= '\ud800' && letters[num] <= '\udbff') || (letters[num] >= '\udc00' && letters[num] <= '\udfff')) { AddNumber(letters[num]); } else { AppendNumbers(); if (letters[num] != '\uffff') { internalStringBuilder.Append(letters[num]); } } } AppendNumbers(); return internalStringBuilder.ToString(); void AddNumber(char value) { if (numberList == null) { numberList = new List<char>(); } numberList.Add(value); } void AppendNumbers() { if (numberList != null && numberList.Count > 0) { for (int k = 0; k < numberList.Count; k++) { internalStringBuilder.Append(numberList[numberList.Count - 1 - k]); } numberList.Clear(); } } } internal static ushort HandleInduNumber(ushort letterOrigin, ushort letterFinal) { return letterOrigin switch { 48 => 1632, 49 => 1633, 50 => 1634, 51 => 1635, 52 => 1636, 53 => 1637, 54 => 1638, 55 => 1639, 56 => 1640, 57 => 1641, _ => letterFinal, }; } internal static bool IsIgnoredCharacter(char ch) { bool num = char.IsPunctuation(ch); bool flag = char.IsNumber(ch); bool flag2 = char.IsLower(ch); bool flag3 = char.IsUpper(ch); bool flag4 = char.IsSymbol(ch); bool flag5 = ch == 'ﭖ' || ch == 'ﭺ' || ch == 'ﮊ' || ch == 'ﮒ' || ch == 'ﮎ'; bool flag6 = (ch <= '\ufeff' && ch >= 'ﹰ') || flag5 || ch == 'ﯼ'; if (!(num || flag || flag2 || flag3 || flag4) && flag6 && ch != 'a' && ch != '>' && ch != '<') { return ch == '؛'; } return true; } internal static bool IsLeadingLetter(char[] letters, int index) { bool num = index == 0 || letters[index - 1] == ' ' || char.IsPunctuation(letters[index - 1]) || letters[index - 1] == 'ﺍ' || letters[index - 1] == 'ﺩ' || letters[index - 1] == 'ﺫ' || letters[index - 1] == 'ﺭ' || letters[index - 1] == 'ﺯ' || letters[index - 1] == 'ﮊ' || letters[index - 1] == 'ﻭ' || letters[index - 1] == 'ﺁ' || letters[index - 1] == 'ﺃ' || letters[index - 1] == 'ﺀ' || letters[index - 1] == 'ﺇ' || letters[index - 1] == 'ﺅ'; bool flag = letters[index] != ' ' && letters[index] != 'ﺩ' && letters[index] != 'ﺫ' && letters[index] != 'ﺭ' && letters[index] != 'ﺯ' && letters[index] != 'ﮊ' && letters[index] != 'ﺍ' && letters[index] != 'ﺃ' && letters[index] != 'ﺇ' && letters[index] != 'ﺁ' && letters[index] != 'ﺅ' && letters[index] != 'ﻭ' && letters[index] != 'ﺀ'; bool flag2 = index < letters.Length - 1 && letters[index + 1] != ' ' && letters[index + 1] != '\n' && letters[index + 1] != '\r' && !char.IsPunctuation(letters[index + 1]) && !char.IsNumber(letters[index + 1]) && !char.IsSymbol(letters[index + 1]) && !char.IsLower(letters[index + 1]) && !char.IsUpper(letters[index + 1]) && letters[index + 1] != 'ﺀ'; if (num && flag && flag2) { return true; } return false; } internal static bool IsFinishingLetter(char[] letters, int index) { bool num = index != 0 && letters[index - 1] != ' ' && letters[index - 1] != 'ﺩ' && letters[index - 1] != 'ﺫ' && letters[index - 1] != 'ﺭ' && letters[index - 1] != 'ﺯ' && letters[index - 1] != 'ﮊ' && letters[index - 1] != 'ﻭ' && letters[index - 1] != 'ﺍ' && letters[index - 1] != 'ﺁ' && letters[index - 1] != 'ﺃ' && letters[index - 1] != 'ﺇ' && letters[index - 1] != 'ﺅ' && letters[index - 1] != 'ﺀ' && !char.IsPunctuation(letters[index - 1]) && !char.IsSymbol(letters[index - 1]); bool flag = letters[index] != ' ' && letters[index] != 'ﺀ'; if (num && flag) { return true; } return false; } internal static bool IsMiddleLetter(char[] letters, int index) { bool flag = index != 0 && letters[index] != 'ﺍ' && letters[index] != 'ﺩ' && letters[index] != 'ﺫ' && letters[index] != 'ﺭ' && letters[index] != 'ﺯ' && letters[index] != 'ﮊ' && letters[index] != 'ﻭ' && letters[index] != 'ﺁ' && letters[index] != 'ﺃ' && letters[index] != 'ﺇ' && letters[index] != 'ﺅ' && letters[index] != 'ﺀ'; bool flag2 = index != 0 && letters[index - 1] != 'ﺍ' && letters[index - 1] != 'ﺩ' && letters[index - 1] != 'ﺫ' && letters[index - 1] != 'ﺭ' && letters[index - 1] != 'ﺯ' && letters[index - 1] != 'ﮊ' && letters[index - 1] != 'ﻭ' && letters[index - 1] != 'ﺁ' && letters[index - 1] != 'ﺃ' && letters[index - 1] != 'ﺇ' && letters[index - 1] != 'ﺅ' && letters[index - 1] != 'ﺀ' && !char.IsPunctuation(letters[index - 1]) && letters[index - 1] != '>' && letters[index - 1] != '<' && letters[index - 1] != ' ' && letters[index - 1] != '*'; if (index < letters.Length - 1 && letters[index + 1] != ' ' && letters[index + 1] != '\r' && letters[index + 1] != 'ﺀ' && !char.IsNumber(letters[index + 1]) && !char.IsSymbol(letters[index + 1]) && !char.IsPunctuation(letters[index + 1]) && flag2 && flag) { try { if (char.IsPunctuation(letters[index + 1])) { return false; } return true; } catch { return false; } } return false; } } namespace ArabicSupportUnity { public class ArabicFixer { private static readonly Dictionary<string, string> processedCache = new Dictionary<string, string>(StringComparer.Ordinal); private static readonly string[] protectedPatterns = new string[3] { "<color=[^>]+>.*?</color>", "\\{\\d+\\}", "<[^>]+>" }; private const int MaxCacheSize = 1000; private static string PreserveSpecialText(string input, out Dictionary<string, string> placeholderMap) { string text = input; int num = 0; placeholderMap = new Dictionary<string, string>(StringComparer.Ordinal); string[] array = protectedPatterns; foreach (string pattern in array) { foreach (Match item in Regex.Matches(text, pattern)) { string text2 = $"##TAG_{num}##"; placeholderMap[text2] = item.Value; text = text.Replace(item.Value, text2); num++; } } return text; } private static string RestoreSpecialText(string input, Dictionary<string, string> placeholderMap) { if (placeholderMap == null || placeholderMap.Count == 0) { return input; } string text = input; foreach (KeyValuePair<string, string> item in placeholderMap) { if (item.Key != null) { text = text.Replace(item.Key, item.Value); } } return text; } private static void TrimCache() { if (processedCache.Count > 1000) { processedCache.Clear(); } } public static string Fix(string str) { if (string.IsNullOrEmpty(str)) { return str; } if (processedCache.TryGetValue(str, out var value)) { return value; } TrimCache(); string input = FixMixedText(PreserveSpecialText(str, out var placeholderMap)); input = RestoreSpecialText(input, placeholderMap); processedCache[str] = input; return input; } private static string FixMixedText(string input) { if (string.IsNullOrEmpty(input)) { return input; } Regex regex = new Regex("([\u0600-ۿݐ-ݿࢠ-\u08ff]+)|([^\u0600-ۿݐ-ݿࢠ-\u08ff]+)", RegexOptions.Compiled); StringBuilder stringBuilder = new StringBuilder(); foreach (Match item in regex.Matches(input)) { if (item.Groups[1].Success) { stringBuilder.Append(ArabicFixerTool.FixLine(item.Value)); } else { stringBuilder.Append(item.Value); } } return stringBuilder.ToString(); } public static string Fix(string str, bool rtl) { return FixMixedText(str); } public static string Fix(string str, bool showTashkeel, bool useHinduNumbers) { ArabicFixerTool.showTashkeel = showTashkeel; ArabicFixerTool.useHinduNumbers = useHinduNumbers; if (str.Contains("\n")) { str = str.Replace("\n", Environment.NewLine); } if (str.Contains(Environment.NewLine)) { string[] separator = new string[1] { Environment.NewLine }; string[] array = str.Split(separator, StringSplitOptions.None); if (array.Length == 0) { return ArabicFixerTool.FixLine(str); } if (array.Length == 1) { return ArabicFixerTool.FixLine(str); } string text = ArabicFixerTool.FixLine(array[0]); int i = 1; if (array.Length > 1) { for (; i < array.Length; i++) { text = text + Environment.NewLine + ArabicFixerTool.FixLine(array[i]); } } return text; } return ArabicFixerTool.FixLine(str); } public static string Fix(string str, bool showTashkeel, bool combineTashkeel, bool useHinduNumbers) { ArabicFixerTool.combineTashkeel = combineTashkeel; return Fix(str, showTashkeel, useHinduNumbers); } } } namespace UltrakULL { public static class Act1 { private static void PatchHellmap(ref GameObject canvasObj) { try { GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Hellmap"), "Hellmap Act 1"); ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text"))).text = LanguageManager.CurrentLanguage.misc.hellmap_limbo; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (1)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_lust; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (2)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_gluttony; } catch (Exception ex) { Logging.Warn("Failed to patch Act 1 hellmap."); Logging.Warn(ex.ToString()); } } public static void PatchAct1(ref GameObject canvasObj) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); string levelName = Act1Strings.GetLevelName(); string levelChallenge = Act1Strings.GetLevelChallenge(currentSceneName); PatchHellmap(ref canvasObj); CommonFunctions.PatchResultsScreen(levelName, levelChallenge); if (currentSceneName.Contains("2-1")) { Transform transform = CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("3-4 - Outdoors Arenas"), "3-4 Stuff").transform; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(((Component)transform.Find("Crane (Moveable)")).gameObject, "Cube (19)"), "Cube"), "UsableScreen New"), "InteractiveScreen"), "Canvas"), "Background"), "Text (TMP) (1)"))).text = LanguageManager.CurrentLanguage.act1.act1_lustFirst_crane; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(((Component)transform.Find("UsableScreen New")).gameObject, "InteractiveScreen"), "Canvas"), "Background"), "InteractiveScreen Button"), "Text (TMP)"))).text = LanguageManager.CurrentLanguage.act1.act1_lustFirst_elevator; } } } public static class EncoreStrings { public static string GetLevelChallenge(string currentLevel) { return "There are no Challenges for this level."; } public static string GetLevelName() { string currentSceneName = CommonFunctions.GetCurrentSceneName(); if (!(currentSceneName == "Level 0-E")) { if (currentSceneName == "Level 1-E") { return "1-E - " + LanguageManager.CurrentLanguage.levelNames.levelName_encoreLimbo; } Logging.Warn("Unknown level name: " + currentSceneName); return currentSceneName; } return "0-E - " + LanguageManager.CurrentLanguage.levelNames.levelName_encorePrelude; } private static string Level0E(string message, string message2) { if ((message + message2).Contains("RADIANT")) { return LanguageManager.CurrentLanguage.encore.encorePrelude_aboutRadiantEnemies; } return "Unimplemented string"; } public static string GetMessage(string message, string message2, string input) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); _ = message + message2; if (currentSceneName == "Level 0-E") { return Level0E(message, message2); } Logging.Warn("Unknown Encore HUD-message string in " + currentSceneName + ": \n" + message + message2); return "Unimplemented string"; } } public static class Act1Strings { private static string Level11(string message, string message2, string input) { string text = message + message2; if (text.Contains("ITEMS")) { CommonFunctions.PreviousHudMessage = LanguageManager.CurrentLanguage.act1.act1_limboFirst_items1 + " '<color=orange>" + input + "'</color> " + LanguageManager.CurrentLanguage.act1.act1_limboFirst_items2; return LanguageManager.CurrentLanguage.act1.act1_limboFirst_items1 + " '<color=orange>" + input + "'</color> " + LanguageManager.CurrentLanguage.act1.act1_limboFirst_items2; } if (text.Contains("NAILGUN")) { CommonFunctions.PreviousHudMessage = LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun1 + " '<color=orange>" + input + "'</color> " + LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun2 + "\n" + LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun3; return LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun1 + " '<color=orange>" + input + "'</color> " + LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun2 + "\n" + LanguageManager.CurrentLanguage.act1.act1_limboFirst_nailgun3; } return CommonFunctions.PreviousHudMessage; } private static string Level12(string message, string message2) { if ((message + message2).Contains("BLUE")) { return LanguageManager.CurrentLanguage.act1.act1_limboSecond_blueAttack; } return "Unimplemented string"; } private static string Level13(string message, string message2) { if ((message + message2).Contains("SPLIT")) { return LanguageManager.CurrentLanguage.act1.act1_limboThird_splitDoor1 + "\n" + LanguageManager.CurrentLanguage.act1.act1_limboThird_splitDoor2; } return "Unimplemented string"; } private static string Level14(string message, string message2, string input) { string text = message + message2; if (text.Contains("PICK")) { return LanguageManager.CurrentLanguage.act1.act1_limboFourth_book; } if (text.Contains("Hank")) { return LanguageManager.CurrentLanguage.act1.act1_limboFourth_hank1 + "\n" + LanguageManager.CurrentLanguage.act1.act1_limboFourth_hank2; } if (message.Contains("versions")) { return LanguageManager.CurrentLanguage.misc.hud_alternateVersion; } if (text.Contains("ALTERNATE REVOLVER")) { return LanguageManager.CurrentLanguage.act1.act1_limboFourth_alternateRevolver; } if (text.Contains("EQUIPPED")) { return LanguageManager.CurrentLanguage.act1.act1_limboFourth_newArm + " '<color=orange>" + input + "'</color>."; } return "Unimplemented string"; } private static string Level1Secret(string message, string message2) { if ((message + message2).Contains("LOOKS")) { return LanguageManager.CurrentLanguage.act1.act1_limboSecret_noclipSkip; } return "Unimplemented string"; } private static string Level21(string message, string message2, string input) { string text = message + message2; if (text.Contains("KNUCKLE")) { return LanguageManager.CurrentLanguage.act1.act1_lustFirst_knuckleblaster1 + " '<color=orange>" + input + "</color>' " + LanguageManager.CurrentLanguage.act1.act1_lustFirst_knuckleblaster2; } if (text.Contains("DASH")) { return LanguageManager.CurrentLanguage.act1.act1_lustFirst_dashJump; } return "Unimplemented string"; } private static string Level22(string message, string message2, string input) { string text = message + message2; if (text.Contains("FEEDBACKER")) { return LanguageManager.CurrentLanguage.act1.act1_lustSecond_feedbacker1 + "\n" + LanguageManager.CurrentLanguage.act1.act1_lustSecond_feedbacker2 + " '<color=orange>" + input + "</color>'."; } if (text.Contains("RAILCANNON")) { return LanguageManager.CurrentLanguage.act1.act1_lustSecond_railcannon; } if (text.Contains("CHECKPOINTS")) { return LanguageManager.CurrentLanguage.act1.act1_lustSecond_checkPoints; } return "Unimplemented string"; } private static string Level23(string message, string message2) { if ((message + message2).Contains("water")) { return LanguageManager.CurrentLanguage.act1.act1_lustThird_water; } return "Unimplemented string"; } private static string Level24(string message, string message2) { _ = message + message2; return "Unimplemented string"; } private static string Level2Secret(string message, string message2) { _ = message + message2; return "Unimplemented string"; } private static string Level31(string message, string message2) { _ = message + message2; return "Unimplemented string"; } private static string Level32(string message, string message2) { _ = message + message2; return "Unimplemented string"; } public static string GetMessage(string message, string message2, string input) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); if ((message + message2).Contains("mechanism")) { return LanguageManager.CurrentLanguage.act1.act1_secret; } return currentSceneName switch { "Level 1-1" => Level11(message, message2, input), "Level 1-2" => Level12(message, message2), "Level 1-3" => Level13(message, message2), "Level 1-4" => Level14(message, message2, input), "Level 1-S" => Level1Secret(message, message2), "Level 2-1" => Level21(message, message2, input), "Level 2-2" => Level22(message, message2, input), "Level 2-3" => Level23(message, message2), "Level 2-4" => Level24(message, message2), "Level 2-S" => Level2Secret(message, message2), "Level 3-1" => Level31(message, message2), "Level 3-2" => Level32(message, message2), _ => "Unimplemented string", }; } public static string GetLevelChallenge(string currentLevel) { return currentLevel switch { "Level 1-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_limboFirst, "Level 1-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_limboSecond, "Level 1-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_limboThird, "Level 1-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_limboFourth, "Level 2-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_lustFirst, "Level 2-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_lustSecond, "Level 2-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_lustThird, "Level 2-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_lustFourth, "Level 3-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_gluttonyFirst, "Level 3-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_gluttonySecond, _ => "Unknown challenge description", }; } public static string GetLevelName() { return CommonFunctions.GetCurrentSceneName() switch { "Level 1-1" => "1-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_limboFirst, "Level 1-2" => "1-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_limboSecond, "Level 1-3" => "1-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_limboThird, "Level 1-4" => "1-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_limboFourth, "Level 1-S" => "1-S - " + LanguageManager.CurrentLanguage.levelNames.levelName_limboSecret, "Level 2-1" => "2-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_lustFirst, "Level 2-2" => "2-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_lustSecond, "Level 2-3" => "2-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_lustThird, "Level 2-4" => "2-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_lustFourth, "Level 2-S" => "2-S - " + LanguageManager.CurrentLanguage.levelNames.levelName_lustSecret, "Level 3-1" => "3-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_gluttonyFirst, "Level 3-2" => "3-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_gluttonySecond, _ => "Unknown level name", }; } } public static class Act1Vn { public static void PatchPrompts(ref GameObject canvasObj) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "PowerUpVignette"), "Panel"), "Aspect Ratio Mask"); GameObject gameObjectChild2 = CommonFunctions.GetGameObjectChild(gameObjectChild, "Fallen"); List<GameObject> list = new List<GameObject>(); foreach (Transform item in gameObjectChild2.transform) { Transform val = item; if (((Object)((Component)val).gameObject).name == "Choices Box") { list.Add(((Component)val).gameObject); } } GameObject parent = list[0]; GameObject parent2 = list[1]; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent, "Button (C)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst3; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent2, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptSecond1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent2, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptSecond2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parent2, "Button (C)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptSecond3; GameObject gameObjectChild3 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Middle"), "Choices Box (1)"); CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild3, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_middlePrompt1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild3, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_middlePrompt2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild3, "Button (C)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_middlePrompt3; GameObject gameObjectChild4 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Middle"), "Choices Box (2)"); CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_middlePromptSecondRecklessness; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_middlePromptSecondWaiting; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "Button (C)"), "Text")).text = "...Pourquoi sommes-nous ici?"; GameObject gameObjectChild5 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Recklessness"), "Choices Box"); CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild5, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessPrompt1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild5, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessPrompt2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Recklessness"), "Choices Box (1)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessPrompt3; GameObject gameObjectChild6 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Waiting"), "Choices Box"); CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild6, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingPromptFirst1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild6, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingPromptFirst2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Waiting"), "Choices Box (1)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingPromptThird; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (2)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt1; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (3)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt2; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (4)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt3; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (5)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt4; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (6)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt5; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (7)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt6; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (8)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt7; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (9)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt8; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (10)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt9; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (11)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt10; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (12)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt11; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (13)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt12; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (14)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt13; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (16)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt14; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (17)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt15; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (18)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt16; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (19)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt17; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (20)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt18; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (21)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt19; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (22)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt20; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (25)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt21; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (23)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt22; CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Nihilism"), "Choices Box (24)"), "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilismPrompt23; GameObject gameObjectChild7 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Conclusion"), "Choices Box (2)"); Text textfromGameObject = CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild7, "Button (A)"), "Text")); Text textfromGameObject2 = CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild7, "Button (B)"), "Text")); textfromGameObject.text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionPrompt1; textfromGameObject2.text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionPrompt2; } public static string GetNextString(string inputString) { if (inputString.Contains("Heavy steps")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst3 + "▼\n\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst4 + "▼\n\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst5 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst6 + "▼\n\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introFirst7 + "▼\n"; } if (inputString.Contains("I bit down")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond3 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond4 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond5 + "▼}\n\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond6 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond7 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_introSecond8 + "▼"; } if (inputString.Contains("Oof ow")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallen1 + "▼"; } if (inputString.Contains("I'm just someone")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseFirst + "▼"; } if (inputString.Contains("Well I just got")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseSecond + "▼"; } if (inputString.Contains("Oh great")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseThird1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseThird2 + "▼"; } if (inputString.Contains("Alright, alright")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseFourth + "▼"; } if (inputString.Contains("UGH?")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenResponseFifth + "▼"; } if (inputString.Contains("*Sigh*")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_kindFirst1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_kindFirst2 + "▼"; } if (inputString.Contains("Though, by the")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_kindSecond + "▼"; } if (inputString.Contains("So how about you")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_kindThird + "▼"; } if (inputString.Contains("Listen up,")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_rudeFirst1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_rudeFirst2 + "▼"; } if (inputString.Contains("By the looks of it")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_rudeSecond + "▼"; } if (inputString.Contains("So I'll forgive you")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_rudeThird + "▼"; } if (inputString.Contains("UGH!")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst1 + "▼"; } if (inputString.Contains("Though in retrospect")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst2 + "▼"; } if (inputString.Contains("Oh well,")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst3 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst4 + "▼\n"; } if (inputString.Contains("I'm Mirage.")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst5 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseFirst6 + "▼"; } if (inputString.Contains("WHAT?")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseSecond2 + "▼"; } if (inputString.Contains("If you DON'T")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseSecond3 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseSecond4 + "▼"; } if (inputString.Contains("Bullshit!")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseThird1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseThird2 + "▼"; } if (inputString.Contains("Though considering")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_middleResponseThird3 + "▼"; } if (inputString.Contains("Wandering around like")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingFirst + "▼"; } if (inputString.Contains("Since we were")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingSecond + "▼"; } if (inputString.Contains("Therefore,")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingThird1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingThird2 + "▼"; } if (inputString.Contains("Suit yourself")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseFirst1 + "▼\n"; } if (inputString.Contains("Couldn't care less")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseFirst2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseFirst3 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseFirst4 + "▼"; } if (inputString.Contains("Hah!")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseSecond2 + "▼"; } if (inputString.Contains("Because nothing")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseThird1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseThird2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_waitingResponseThird3 + "▼"; } if (inputString.Contains("Yeah?")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessFirst + "▼"; } if (inputString.Contains("But yes,")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessSecond2 + "▼"; } if (inputString.Contains("What's the point of making")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseFirst1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseFirst2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseFirst3 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseFirst4 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseFirst5 + "▼\n"; } if (inputString.Contains("Don't flatter yourself")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseSecond2 + "▼"; } if (inputString.Contains("Everything.")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_recklessnessResponseThird + "▼"; } if (inputString.Contains("I mean really")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism1 + "▼"; } if (inputString.Contains("The human mind,")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism2 + "▼"; } if (inputString.Contains("We can only ever")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism3 + "▼"; } if (inputString.Contains("Death is")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism4 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism5 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism6 + "▼"; } if (inputString.Contains("It doesn't matter")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism7 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism8 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism9 + "▼"; } if (inputString.Contains("Human intelligence")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism10 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism11 + "▼"; } if (inputString.Contains("Our intelligence")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism12 + "▼"; } if (inputString.Contains("It's an over-extension")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism13 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism14 + "▼\n"; } if (inputString.Contains("Much like the Irish")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism15 + "▼"; } if (inputString.Contains("The human mind is an")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism16 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism17 + "▼\n"; } if (inputString.Contains("Existential dread")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism18 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism19 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism20 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism21 + "▼"; } if (inputString.Contains("We are unable")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism22 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism23 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism24 + "▼"; } if (inputString.Contains("We create distractions")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism25 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism26 + "▼"; } if (inputString.Contains("We sublimate it")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism27 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism28 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism29 + "▼"; } if (inputString.Contains("But these ways")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism30 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism31 + "▼"; } if (inputString.Contains("In the end")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism32 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism33 + "▼"; } if (inputString.Contains("Huh?")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism34 + "▼"; } if (inputString.Contains("How could it not be?")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism35 + "▼"; } if (inputString.Contains("But still")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism36 + "▼"; } if (inputString.Contains("I do understand")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism37 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism38 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism39 + "▼"; } if (inputString.Contains("I see.")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism40 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism41 + "▼"; } if (inputString.Contains("I understand it logically")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism42 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_nihilism43 + "▼"; } if (inputString.Contains("Well I'll be damned")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion1 + "▼"; } if (inputString.Contains("Guess you got a good")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion3 + "▼"; } if (inputString.Contains("Man...")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion4 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion5 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion6 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion7 + "▼"; } if (inputString.Contains("Thank you.")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion8 + "▼\n"; } if (inputString.Contains("You've given me a lot")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion9 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion10 + "▼\n"; } if (inputString.Contains("Say...")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusion11 + "▼"; } if (inputString.Contains("Oh, you sneaky")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseFirst1 + "▼"; } if (inputString.Contains("But alright")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseFirst2 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseFirst3 + "▼"; } if (inputString.Contains("Alright, suit yourself")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseSecond1 + "▼\n" + LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseSecond2 + "▼"; } if (inputString.Contains("See you around")) { return LanguageManager.CurrentLanguage.visualnovel.visualnovel_conclusionResponseSecond3 + "▼"; } return inputString; } } public static class Act2 { private static void PatchHellmap(ref GameObject canvasObj) { GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Hellmap"), "Hellmap Act 2"); ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text"))).text = LanguageManager.CurrentLanguage.misc.hellmap_greed; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (1)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_wrath; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (2)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_heresy; } public static void PatchAct2(ref GameObject canvasObj) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); string levelName = Act2Strings.GetLevelName(); string levelChallenge = Act2Strings.GetLevelChallenge(currentSceneName); CommonFunctions.PatchResultsScreen(levelName, levelChallenge); PatchHellmap(ref canvasObj); } } public static class Act2Strings { private static string _previousMessage = ""; private static string Level41(string message, string message2) { _ = message + message2; return "Unimplemented string"; } private static string Level42(string message, string message2) { if ((message + message2).Contains("BLEED")) { return LanguageManager.CurrentLanguage.act2.act2_greedSecond_sand; } return "Unimplemented string"; } private static string Level43(string message, string message2) { string text = message + message2; if (text.Contains("FILTH")) { return LanguageManager.CurrentLanguage.act2.act2_greedThird_wallClip; } if (text.Contains("wicked")) { return LanguageManager.CurrentLanguage.act2.act2_greedThird_troll1; } if (text.Contains("kidding")) { return LanguageManager.CurrentLanguage.act2.act2_greedThird_troll2; } if (text.Contains("TOMB")) { return LanguageManager.CurrentLanguage.act2.act2_greedThird_tombOfKings; } return "Unimplemented string"; } private static string Level44(string message, string message2, string input) { string text = message + message2; if (text == "") { return _previousMessage; } if (message.Contains("versions")) { return LanguageManager.CurrentLanguage.misc.hud_alternateVersion; } if (text.Contains("ALTERNATE NAILGUN")) { return LanguageManager.CurrentLanguage.act2.act2_greedFourth_alternateNailgun; } if (text.Contains("You're")) { return LanguageManager.CurrentLanguage.act2.act2_greedFourth_v2; } if (text.Contains("Hold")) { _previousMessage = LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash1 + " <color=orange>" + input + "</color> " + LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash2; return LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash1 + " <color=orange>" + input + "</color> " + LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash2; } if (text.Contains("HEAVY")) { _previousMessage = LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash3; return LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplash3; } if (text.Contains("HARD DAMAGE")) { _previousMessage = LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplashHardDamage1 + "\n" + LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplashHardDamage2; return LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplashHardDamage1 + "\n" + LanguageManager.CurrentLanguage.act2.act2_greedFourth_whiplashHardDamage2; } return "Unimplemented string"; } private static string Level4Secret(string message, string message2, string input) { if ((message + message2).Contains("HOLD")) { return LanguageManager.CurrentLanguage.act2.act2_greedSecret_holdToJump1 + "<color=orange> " + input + " </color>" + LanguageManager.CurrentLanguage.act2.act2_greedSecret_holdToJump2; } return "Unimplemented string"; } private static string Level51(string message, string message2) { string text = message + message2; if (text.Contains("HOOKPOINT")) { return LanguageManager.CurrentLanguage.act2.act2_wrathFirst_slingshot; } if (text.Contains("WHIPLASH")) { return LanguageManager.CurrentLanguage.act2.act2_wrathFirst_whiplashUnderwater; } if (text.Contains("SENTRIES")) { return LanguageManager.CurrentLanguage.act2.act2_wrathFirst_sentry; } if (text.Contains("drained")) { return LanguageManager.CurrentLanguage.act2.act2_wrathFirst_waterDrained; } return "Unimplemented string"; } private static string Level52(string message, string message2) { string text = message + message2; if (text.Contains("JAKITO")) { return LanguageManager.CurrentLanguage.act2.act2_wrathSecond_jakito1; } if (text.Contains("THANK")) { return LanguageManager.CurrentLanguage.act2.act2_wrathSecond_jakito2; } if (text.Contains("NO")) { return LanguageManager.CurrentLanguage.act2.act2_wrathSecond_jakito3; } if (text.Contains("Hark")) { return LanguageManager.CurrentLanguage.act2.act2_wrathSecond_neptune; } if (text.Contains("IDOL")) { return LanguageManager.CurrentLanguage.act2.act2_wrathSecond_idol; } return "Unimplemented string"; } private static string Level53(string message, string message2) { string text = message + message2; if (text.Contains("Indirect")) { return LanguageManager.CurrentLanguage.act2.act2_wrathThird_rocketLauncher; } if (text.Contains("FALLING")) { return LanguageManager.CurrentLanguage.act2.act2_wrathThird_rocketLauncherMidair; } if (text.Contains("Soldiers")) { return LanguageManager.CurrentLanguage.act2.act2_wrathThird_soldierBlock; } if (text.Contains("Hank")) { return LanguageManager.CurrentLanguage.act2.act2_wrathThird_hank; } return "Unimplemented string"; } private static string Level54(string message, string message2) { _ = message + message2; return "Unimplemented string"; } private static string Level5Secret(string message) { if (message.Contains("living")) { return LanguageManager.CurrentLanguage.fishing.fish_living; } if (message.Contains("Too small")) { return LanguageManager.CurrentLanguage.fishing.fish_tooSmall; } if (message.Contains("This bait")) { return LanguageManager.CurrentLanguage.fishing.fish_baitNotWork; } if (message.Contains("A fish took")) { return LanguageManager.CurrentLanguage.fishing.fish_baitTaken; } if (message.Contains("Fishing interrupted")) { return LanguageManager.CurrentLanguage.fishing.fish_interrupted; } if (message.Contains("Cooking failed")) { return LanguageManager.CurrentLanguage.fishing.fish_cookingFailed; } if (message.Contains("Nothing seems")) { return LanguageManager.CurrentLanguage.fishing.fish_noFishBiting; } return "Unimplemented string"; } private static string Level61(string message, string message2) { if ((message + message2).Contains("A R M B O Y")) { return LanguageManager.CurrentLanguage.act2.act2_heresyFirst_armboy; } return "Unimplemented string"; } private static string Level62(string message, string message2) { _ = message + message2; return "Unimplemented string"; } public static string GetMessage(string message, string message2, string input) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); if ((message + message2).Contains("opens")) { return LanguageManager.CurrentLanguage.act2.act2_greed_secretDoor; } return currentSceneName switch { "Level 4-1" => Level41(message, message2), "Level 4-2" => Level42(message, message2), "Level 4-3" => Level43(message, message2), "Level 4-4" => Level44(message, message2, input), "Level 4-S" => Level4Secret(message, message2, input), "Level 5-1" => Level51(message, message2), "Level 5-2" => Level52(message, message2), "Level 5-3" => Level53(message, message2), "Level 5-4" => Level54(message, message2), "Level 5-S" => Level5Secret(message), "Level 6-1" => Level61(message, message2), "Level 6-2" => Level62(message, message2), _ => "Unimplemented string", }; } public static string GetLevelChallenge(string currentLevel) { return currentLevel switch { "Level 4-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_greedFirst, "Level 4-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_greedSecond, "Level 4-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_greedThird, "Level 4-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_greedFourth, "Level 5-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_wrathFirst, "Level 5-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_wrathSecond, "Level 5-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_wrathThird, "Level 5-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_wrathFourth, "Level 6-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_heresyFirst, "Level 6-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_heresySecond, _ => "Unknown challenge description", }; } public static string GetLevelName() { return CommonFunctions.GetCurrentSceneName() switch { "Level 4-1" => "4-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_greedFirst, "Level 4-2" => "4-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_greedSecond, "Level 4-3" => "4-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_greedThird, "Level 4-4" => "4-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_greedFourth, "Level 5-1" => "5-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_wrathFirst, "Level 5-2" => "5-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_wrathSecond, "Level 5-3" => "5-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_wrathThird, "Level 5-4" => "5-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_wrathFourth, "Level 6-1" => "6-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_heresyFirst, "Level 6-2" => "6-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_heresySecond, _ => "Unknown level name", }; } } public static class Act3 { private static void PatchHellmap(ref GameObject canvasObj) { GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Hellmap"), "Hellmap Act 3"); ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text"))).text = LanguageManager.CurrentLanguage.misc.hellmap_violence; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (1)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_fraud; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild, "Text (2)"))).text = LanguageManager.CurrentLanguage.misc.hellmap_treachery; } public static void PatchAct3(ref GameObject canvasObj) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); string levelName = Act3Strings.GetLevelName(); string levelChallenge = Act3Strings.GetLevelChallenge(currentSceneName); CommonFunctions.PatchResultsScreen(levelName, levelChallenge); PatchHellmap(ref canvasObj); if (currentSceneName.Contains("7-2")) { GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("Other Interiors"), "9 - Tram Station"), "9 Stuff"), "9A"), "InteractiveScreenWithStand"), "InteractiveScreen"), "Canvas"), "Background"); TextMeshProUGUI textMeshProUGUI = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "A"), "Opened"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI2 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "A"), "Closed"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI3 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "B"), "Opened"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI4 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "B"), "Closed"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI5 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "C"), "Opened"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI6 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "C"), "Closed"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI7 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "D"), "Opened"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI8 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "D"), "Closed"), "Text (TMP)")); ((TMP_Text)textMeshProUGUI).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlOpen; ((TMP_Text)textMeshProUGUI2).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlClosed; ((TMP_Text)textMeshProUGUI3).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlOpen; ((TMP_Text)textMeshProUGUI4).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlClosed; ((TMP_Text)textMeshProUGUI5).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlOpen; ((TMP_Text)textMeshProUGUI6).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlClosed; ((TMP_Text)textMeshProUGUI7).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlOpen; ((TMP_Text)textMeshProUGUI8).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_gateControlClosed; GameObject gameObjectChild2 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("Outdoors"), "10 - Ambush Station"), "10 Nonstuff"), "InteractiveScreenWithStand"), "InteractiveScreen"), "Canvas"), "Background"); TextMeshProUGUI textMeshProUGUI9 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild2, "Text (TMP) (1)")); TextMeshProUGUI textMeshProUGUI10 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild2, "Button (Open)"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI11 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild2, "Button (Closed)"), "Text (TMP)")); ((TMP_Text)textMeshProUGUI9).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_cartGateControlTitle; ((TMP_Text)textMeshProUGUI10).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_cartGateControlOpen; ((TMP_Text)textMeshProUGUI11).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_cartGateControlClosed; GameObject gameObjectChild3 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("Outdoors"), "11 - Bomb Station"), "11 Nonstuff"), "Bomb Mechanisms"), "InteractiveScreenWithStand"), "InteractiveScreen"), "Canvas"); TextMeshProUGUI textMeshProUGUI12 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild3, "Text (TMP)")); TextMeshProUGUI[] componentsInChildren = CommonFunctions.GetGameObjectChild(gameObjectChild3, "UsableButtons").GetComponentsInChildren<TextMeshProUGUI>(true); TextMeshProUGUI textMeshProUGUI13 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild3, "UsableButtons"), "Error")); TextMeshProUGUI textMeshProUGUI14 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild3, "Done")); ((TMP_Text)textMeshProUGUI12).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_payloadControlTitle; TextMeshProUGUI[] array = componentsInChildren; foreach (TextMeshProUGUI val in array) { if (((TMP_Text)val).text.Contains("LOWER")) { ((TMP_Text)val).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_payloadControlLower; } } ((TMP_Text)textMeshProUGUI13).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_payloadControlError1 + "<size=12>\n" + LanguageManager.CurrentLanguage.act3.act3_violenceSecond_payloadControlError2; ((TMP_Text)textMeshProUGUI14).text = LanguageManager.CurrentLanguage.act3.act3_violenceSecond_payloadControlHell; } else if (currentSceneName.Contains("7-3")) { GameObject gameObjectChild4 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("Outdoors Areas"), "8 - Upper Garden Battlefield"), "8 Stuff"), "Destructible Tunnel"), "InteractiveScreenWithStand"), "InteractiveScreen"), "Canvas"), "Background"); TextMeshProUGUI textMeshProUGUI15 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "PreActivation"), "Text (TMP) (1)")); TextMeshProUGUI textMeshProUGUI16 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "PreActivation"), "InteractiveScreenButton"), "Text (TMP)")); TextMeshProUGUI textMeshProUGUI17 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild4, "PostActivation"), "Text (TMP) (1)")); ((TMP_Text)textMeshProUGUI15).text = LanguageManager.CurrentLanguage.act3.act3_violenceThird_becomeMarked; ((TMP_Text)textMeshProUGUI16).text = LanguageManager.CurrentLanguage.act3.act3_violenceThird_becomeMarkedButton; ((TMP_Text)textMeshProUGUI17).text = LanguageManager.CurrentLanguage.act3.act3_violenceThird_starOfTheShow; } else if (currentSceneName.Contains("7-4")) { ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Warning"), "Text (TMP)"))).text = LanguageManager.CurrentLanguage.act3.act3_violenceFourth_floodingWarning; ((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Countdown"), "Text (TMP)"))).text = LanguageManager.CurrentLanguage.act3.act3_violenceFourth_countdownTitle; } else if (currentSceneName.Contains("8-2")) { GameObject inactiveRootObject = CommonFunctions.GetInactiveRootObject("4 - Hub"); if ((Object)(object)inactiveRootObject == (Object)null) { inactiveRootObject = CommonFunctions.GetInactiveRootObject("Hub"); } if ((Object)(object)inactiveRootObject != (Object)null) { TextMeshProUGUI[] componentsInChildren2 = inactiveRootObject.GetComponentsInChildren<TextMeshProUGUI>(true); string act3_fraudSecond_outOfOrder = LanguageManager.CurrentLanguage.act3.act3_fraudSecond_outOfOrder; string act3_fraudSecond_errorResetPower = LanguageManager.CurrentLanguage.act3.act3_fraudSecond_errorResetPower; bool flag = string.IsNullOrEmpty(act3_fraudSecond_outOfOrder); bool flag2 = string.IsNullOrEmpty(act3_fraudSecond_errorResetPower); if (flag) { Logging.Warn("[Act3] Translation for 'act3_fraudSecond_outOfOrder' is missing or empty. Will keep original text."); } if (flag2) { Logging.Warn("[Act3] Translation for 'act3_fraudSecond_errorResetPower' is missing or empty. Will keep original text."); } TextMeshProUGUI[] array = componentsInChildren2; foreach (TextMeshProUGUI val2 in array) { string text = ((TMP_Text)val2).text; string text2 = Regex.Replace(Regex.Replace(text, "<.*?>", ""), "\\s+", " ").Trim().ToUpperInvariant(); if (text2.Contains("ERROR") || text2.Contains("RESET") || text2.Contains("POWER") || text2.Contains("OUT") || text2.Contains("ORDER")) { Logging.Info("[Act3] Text candidate: original='" + text + "', normalized='" + text2 + "'"); } if (text2 == "OUT OF ORDER" && !flag) { Logging.Info("[Act3] Replacing OUT OF ORDER with translation"); ((TMP_Text)val2).text = act3_fraudSecond_outOfOrder; } else if (text2 == "ERROR RESET POWER TO OPEN" && !flag2) { Logging.Info("[Act3] Replacing ERROR RESET POWER TO OPEN with translation"); ((TMP_Text)val2).text = act3_fraudSecond_errorResetPower; } } } else { Logging.Warn("[Act3] Hub not found"); } } else { if (!currentSceneName.Contains("8-4")) { return; } TextMeshProUGUI textMeshProUGUI18 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "HeightMarkerParent"), "HeightMarker"), "Title")); string act3_fraudFourth_heightMarkerTitle = LanguageManager.CurrentLanguage.act3.act3_fraudFourth_heightMarkerTitle; ((TMP_Text)textMeshProUGUI18).text = CommonFunctions.MakeVertical(act3_fraudFourth_heightMarkerTitle); ((TMP_Text)textMeshProUGUI18).ForceMeshUpdate(false, false); GameObject inactiveRootObject2 = CommonFunctions.GetInactiveRootObject("The Intro"); if (!((Object)(object)inactiveRootObject2 != (Object)null)) { return; } GameObject gameObjectChild5 = CommonFunctions.GetGameObjectChild(inactiveRootObject2, "3 - Upper Intro"); if (!((Object)(object)gameObjectChild5 != (Object)null)) { return; } GameObject gameObjectChild6 = CommonFunctions.GetGameObjectChild(gameObjectChild5, "ElevatorSet"); if (!((Object)(object)gameObjectChild6 != (Object)null)) { return; } GameObject gameObjectChild7 = CommonFunctions.GetGameObjectChild(gameObjectChild6, "Elevator"); if (!((Object)(object)gameObjectChild7 != (Object)null)) { return; } GameObject gameObjectChild8 = CommonFunctions.GetGameObjectChild(gameObjectChild7, "InteractiveScreen"); if (!((Object)(object)gameObjectChild8 != (Object)null)) { return; } GameObject gameObjectChild9 = CommonFunctions.GetGameObjectChild(gameObjectChild8, "Canvas"); if (!((Object)(object)gameObjectChild9 != (Object)null)) { return; } GameObject gameObjectChild10 = CommonFunctions.GetGameObjectChild(gameObjectChild9, "Background"); if (!((Object)(object)gameObjectChild10 != (Object)null)) { return; } GameObject gameObjectChild11 = CommonFunctions.GetGameObjectChild(gameObjectChild10, "1 (Nope)"); if (!((Object)(object)gameObjectChild11 != (Object)null)) { return; } TextMeshProUGUI textMeshProUGUI19 = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild11, "Text (TMP)")); if ((Object)(object)textMeshProUGUI19 != (Object)null) { string act3_fraudFourth_nope = LanguageManager.CurrentLanguage.act3.act3_fraudFourth_nope; if (!string.IsNullOrEmpty(act3_fraudFourth_nope)) { ((TMP_Text)textMeshProUGUI19).text = act3_fraudFourth_nope; } else { Logging.Warn("[Act3] Translation for 'act3_fraudFourth_nope' is missing or empty. Will keep original text."); } } } } } public static class Act3Strings { public static string Level71(string message, string message2) { if ((message + message2).Contains("A door opens.")) { return LanguageManager.CurrentLanguage.act3.act3_violenceFirst_doorOpens; } return "Unimplemented string"; } public static string Level72(string message, string message2, string input) { string text = message + message2; if (text.Contains("Swap arms with")) { return LanguageManager.CurrentLanguage.act3.act3_violenceSecond_guttermanTutorial + " '<color=orange>" + input + "</color>'"; } if (text.Contains("You should probably")) { return LanguageManager.CurrentLanguage.act3.act3_violenceSecond_guttermanTutorialNoKB; } if (text.Contains("BIGGER BOOM")) { return "<color=red>" + LanguageManager.CurrentLanguage.act3.act3_violenceSecond_biggerBoom + "</color>"; } if (message.Contains("versions")) { return LanguageManager.CurrentLanguage.misc.hud_alternateVersion; } if (text.Contains("ALTERNATE SHOTGUN")) { return LanguageManager.CurrentLanguage.act3.act3_violenceSecond_alternateShotgun; } return "Unimplemented string"; } public static string Level73(string message, string message2) { string text = message + message2; if (text.Contains("YOU'RE NOT")) { return LanguageManager.CurrentLanguage.act3.act3_secretNotReady; } if (text.Contains("F E E D")) { return "<color=red>" + LanguageManager.CurrentLanguage.act3.act3_violenceThird_feedIt + "</color>"; } return "Unimplemented string"; } public static string Level74(string message, string message2) { if ((message + message2).Contains("MAGENTA")) { return LanguageManager.CurrentLanguage.act3.act3_violenceFourth_magentaAttack; } return "Unimplemented string"; } public static string Level7Secret(string message, string message2) { return "Unimplemented string"; } public static string Level81(string message, string message2) { return "Unimplemented string"; } public static string Level82(string message, string message2) { string text = message + message2; if (text.Contains("The cycle of life")) { return LanguageManager.CurrentLanguage.act3.act3_fraudSecond_cycleOfLife; } if (text.Contains("It is happening again")) { return LanguageManager.CurrentLanguage.act3.act3_fraudSecond_happeningAgain; } return "Unimplemented string"; } public static string Level83(string message, string message2) { return "Unimplemented string"; } public static string Level84(string format = "", string message2 = "", string[] inputs = null) { string text = format + message2; if (text.Contains("WARNING:") && text.Contains("free fall")) { string text2 = ((inputs != null && inputs.Length != 0) ? CommonFunctions.GetLocalizedInput(inputs[0]) : ""); string text3 = ((inputs != null && inputs.Length > 1) ? CommonFunctions.GetLocalizedInput(inputs[1]) : ""); return LanguageManager.CurrentLanguage.act3.act3_fraudFourth_fallWarning_part1 + "\n" + LanguageManager.CurrentLanguage.act3.act3_fraudFourth_fallWarning_part2 + " <color=orange>" + text2 + "</color> " + LanguageManager.CurrentLanguage.act3.act3_fraudFourth_fallWarning_part3 + " <color=orange>" + text3 + "</color>."; } return "Unimplemented string"; } public static string Level8Secret(string message, string message2) { return "Unimplemented string"; } public static string Level91(string message, string message2) { return "Unimplemented string"; } public static string Level92(string message, string message2) { return "Unimplemented string"; } public static string GetMessage(string message, string message2, string input) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); _ = message + message2; return currentSceneName switch { "Level 7-1" => Level71(message, message2), "Level 7-2" => Level72(message, message2, input), "Level 7-3" => Level73(message, message2), "Level 7-4" => Level74(message, message2), "Level 7-S" => Level7Secret(message, message2), "Level 8-1" => Level81(message, message2), "Level 8-2" => Level82(message, message2), "Level 8-3" => Level83(message, message2), "Level 8-4" => Level84(message, message2), "Level 8-S" => Level8Secret(message, message2), "Level 9-1" => Level91(message, message2), "Level 9-2" => Level92(message, message2), _ => "Unimplemented string", }; } public static string GetLevelChallenge(string currentLevel) { return currentLevel switch { "Level 7-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_violenceFirst, "Level 7-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_violenceSecond, "Level 7-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_violenceThird, "Level 7-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_violenceFourth, "Level 8-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_fraudFirst, "Level 8-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_fraudSecond, "Level 8-3" => LanguageManager.CurrentLanguage.levelChallenges.challenges_fraudThird, "Level 8-4" => LanguageManager.CurrentLanguage.levelChallenges.challenges_fraudFourth, "Level 9-1" => LanguageManager.CurrentLanguage.levelChallenges.challenges_treacheryFirst, "Level 9-2" => LanguageManager.CurrentLanguage.levelChallenges.challenges_treacherySecond, _ => "Unknown challenge description", }; } public static string GetLevelName() { return CommonFunctions.GetCurrentSceneName() switch { "Level 7-1" => "7-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_violenceFirst, "Level 7-2" => "7-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_violenceSecond, "Level 7-3" => "7-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_violenceThird, "Level 7-4" => "7-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_violenceFourth, "Level 8-1" => "8-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_fraudFirst, "Level 8-2" => "8-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_fraudSecond, "Level 8-3" => "8-3 - " + LanguageManager.CurrentLanguage.levelNames.levelName_fraudThird, "Level 8-4" => "8-4 - " + LanguageManager.CurrentLanguage.levelNames.levelName_fraudFourth, "Level 9-1" => "9-1 - " + LanguageManager.CurrentLanguage.levelNames.levelName_treacheryFirst, "Level 9-2" => "9-2 - " + LanguageManager.CurrentLanguage.levelNames.levelName_treacherySecond, _ => "Unknown level name", }; } } public static class Books { public static string GetBookText(string originalText) { string currentSceneName = CommonFunctions.GetCurrentSceneName(); switch (currentSceneName) { case "CreditsMuseum2": return DevMuseum.GetMuseumBook(originalText); case "Level 1-4": return "<b>" + LanguageManager.CurrentLanguage.books.books_limboFourth1 + "</b>\n\n<i>" + LanguageManager.CurrentLanguage.books.books_limboFourth2 + "\n\n" + LanguageManager.CurrentLanguage.books.books_limboFourth3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_limboFourth4 + "</i>\n\n<b>" + LanguageManager.CurrentLanguage.books.books_limboFourth5 + "</b>"; case "Level 2-2": return "<b>" + LanguageManager.CurrentLanguage.books.books_lustSecond1 + "</b>\n\n<i>" + LanguageManager.CurrentLanguage.books.books_lustSecond2 + "\n\n" + LanguageManager.CurrentLanguage.books.books_lustSecond3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_lustSecond4 + "</i>\n\n<b>" + LanguageManager.CurrentLanguage.books.books_lustSecond5 + "</b>"; case "Level 4-2": return "<b>" + LanguageManager.CurrentLanguage.books.books_greedSecond1 + "</b>\n\n<i>" + LanguageManager.CurrentLanguage.books.books_greedSecond2 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedSecond3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedSecond4 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedSecond5 + "</i>\n\n<b>" + LanguageManager.CurrentLanguage.books.books_greedSecond6 + "</b>"; case "Level 4-3": return LanguageManager.CurrentLanguage.books.books_greedThird1 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedThird2 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedThird3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_greedThird4; case "Level 5-2": return "<b>" + LanguageManager.CurrentLanguage.books.books_wrathSecond1 + "</b>\n\n<b>" + LanguageManager.CurrentLanguage.books.books_wrathSecond2 + "</b>\n\n" + LanguageMana
BepInEx/plugins/V1.dll
Decompiled 9 hours agousing 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.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("V1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("V1")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5060f184-3919-4661-aae5-d41785337514")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [BepInPlugin("com.v1voice.mod", "V1 Voice", "3.0.0")] public class V1VoicePlugin : BaseUnityPlugin { private static V1VoicePlugin Instance; private static ManualLogSource Log; private static string VoicesPath; private static AudioSource source; private static readonly Dictionary<string, AudioClip> cache = new Dictionary<string, AudioClip>(); private static readonly Dictionary<string, string[]> fileLists = new Dictionary<string, string[]>(); private static readonly Dictionary<string, float> lastPlayed = new Dictionary<string, float>(); private static readonly HashSet<int> killed = new HashSet<int>(); private static int playToken; private static bool loading; private static ConfigEntry<float> volume; private static ConfigEntry<float> hurtChance; private static ConfigEntry<float> hurtCooldown; private static ConfigEntry<float> killChance; private static ConfigEntry<float> killCooldown; private static ConfigEntry<float> nailgunChance; private static ConfigEntry<float> nailgunCooldown; private static ConfigEntry<float> parryChance; private static ConfigEntry<float> parryCooldown; private static ConfigEntry<bool> parryOnlyShotgun; private static ConfigEntry<float> levelStartChance; private static ConfigEntry<float> respawnChance; private static ConfigEntry<float> respawnCooldown; private static ConfigEntry<float> v2EscapeChance; private static ConfigEntry<string> v2EscapeScene; private static ConfigEntry<float> tauntChance; private static ConfigEntry<float> tauntExclusiveChance; private static ConfigEntry<bool> tauntExclusiveEnabled; private static ConfigEntry<float> tauntExtraCooldown; private static ConfigEntry<float> deathChance; private static ConfigEntry<float> lowHpChance; private static ConfigEntry<float> lowHpThreshold; private static ConfigEntry<float> lowHpCooldown; private static ConfigEntry<float> bossKillChance; private static ConfigEntry<string> bossTypes; private static ConfigEntry<float> slamChance; private static ConfigEntry<float> slamCooldown; private static ConfigEntry<float> whiplashChance; private static ConfigEntry<float> whiplashCooldown; private static ConfigEntry<float> coinChance; private static ConfigEntry<float> coinCooldown; private static ConfigEntry<int> multiKillCount; private static ConfigEntry<float> multiKillWindow; private static ConfigEntry<float> multiKillChance; private static ConfigEntry<float> multiKillCooldown; private static ConfigEntry<KeyboardShortcut> reloadKey; private static bool knuckleBaseline; private static readonly HashSet<int> pickupChecking = new HashSet<int>(); private static readonly HashSet<string> pickupSeen = new HashSet<string>(); private static bool levelStartPending; private static float levelStartSince; private static string lastLevelScene; private const string TauntDir = "enemytaunt"; private static readonly HashSet<string> v2Seen = new HashSet<string>(); private static readonly List<float> recentKills = new List<float>(); private static float tauntNextAllowed; private static GameObject currentTempGo; private static AudioSource currentTempSrc; private void Awake() { //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); volume = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Volume", 1f, "Voice volume (0.0 to 1.0)."); hurtChance = ((BaseUnityPlugin)this).Config.Bind<float>("Hurt", "Chance", 0.8f, "Chance (0 to 1) for V1 to speak when taking damage. 0.8 = 80%."); hurtCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Hurt", "CooldownSeconds", 3f, "Minimum time (s) between two hurt lines."); killChance = ((BaseUnityPlugin)this).Config.Bind<float>("Kill", "Chance", 0.25f, "Chance (0 to 1) for V1 to speak when killing an enemy. 0.25 = 25%."); killCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Kill", "CooldownSeconds", 3f, "Minimum time (s) between two kill lines."); nailgunChance = ((BaseUnityPlugin)this).Config.Bind<float>("Nailgun", "Chance", 0.15f, "Chance (0 to 1) for V1 to speak when picking up a nailgun. 0.15 = 15%."); nailgunCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Nailgun", "CooldownSeconds", 30f, "Minimum time (s) between two nailgun lines."); parryChance = ((BaseUnityPlugin)this).Config.Bind<float>("Parry", "Chance", 0.5f, "Chance (0 to 1) for V1 to speak when parrying a shotgun pellet."); parryCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Parry", "CooldownSeconds", 2f, "Minimum time (s) between two parry lines."); parryOnlyShotgun = ((BaseUnityPlugin)this).Config.Bind<bool>("Parry", "ShotgunOnly", true, "true = shotgun pellets only; false = any parried projectile."); levelStartChance = ((BaseUnityPlugin)this).Config.Bind<float>("LevelStart", "Chance", 1f, "Chance (0 to 1) for V1 to speak when entering a level. 1 = guaranteed."); respawnChance = ((BaseUnityPlugin)this).Config.Bind<float>("Respawn", "Chance", 1f, "Chance (0 to 1) for V1 to speak when respawning. 1 = guaranteed."); respawnCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Respawn", "CooldownSeconds", 2f, "Minimum time (s) between two respawn lines."); v2EscapeChance = ((BaseUnityPlugin)this).Config.Bind<float>("V2Escape", "Chance", 1f, "Chance (0 to 1) for V1 to speak when V2 flees. 1 = guaranteed."); v2EscapeScene = ((BaseUnityPlugin)this).Config.Bind<string>("V2Escape", "SceneContains", "ac1675e648695a343bd064c6d0c56e57", "Only speaks in scenes whose name contains this text (the 2nd V2 fight). Leave empty to apply to any level."); tauntChance = ((BaseUnityPlugin)this).Config.Bind<float>("EnemyTaunt", "Chance", 0.25f, "Chance (0 to 1) for a dying enemy to play a taunt from voices/enemytaunt/default. 0.25 = 25%."); tauntExclusiveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("EnemyTaunt", "ExclusiveEnabled", true, "If true, enemies with their own folder (voices/enemytaunt/<enemytype>) can use the exclusive chance below."); tauntExclusiveChance = ((BaseUnityPlugin)this).Config.Bind<float>("EnemyTaunt", "ExclusiveChance", 1f, "Chance (0 to 1) for an enemy-exclusive taunt to play when that enemy has its own folder."); tauntExtraCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("EnemyTaunt", "ExtraCooldown", 0.1f, "Extra seconds added on top of the clip length before another enemy taunt can play."); deathChance = ((BaseUnityPlugin)this).Config.Bind<float>("Death", "Chance", 1f, "Chance (0 to 1) for V1 to speak when dying. 1 = guaranteed."); lowHpChance = ((BaseUnityPlugin)this).Config.Bind<float>("LowHealth", "Chance", 1f, "Chance (0 to 1) for V1 to speak when health drops below the threshold."); lowHpThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("LowHealth", "Threshold", 25f, "Health value that triggers the line (only fires once until health goes back above it)."); lowHpCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("LowHealth", "CooldownSeconds", 30f, "Minimum time (s) between two low-health lines."); bossKillChance = ((BaseUnityPlugin)this).Config.Bind<float>("BossKill", "Chance", 1f, "Chance (0 to 1) for V1 to speak when killing an enemy in the BossTypes list. 1 = guaranteed."); bossTypes = ((BaseUnityPlugin)this).Config.Bind<string>("BossKill", "BossTypes", "v2,v2second,gabriel,gabrielsecond,minos,minosprime,sisyphus,sisyphusprime,fleshprison,fleshpanopticon,minotaur,leviathan,hideousmass,mandalore,geryon,cancerousrodent,verycancerousrodent", "Comma-separated enemyType names (lowercase) that count as bosses."); slamChance = ((BaseUnityPlugin)this).Config.Bind<float>("Slam", "Chance", 0.3f, "Chance (0 to 1) for V1 to speak on a ground slam / slam dive."); slamCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Slam", "CooldownSeconds", 8f, "Minimum time (s) between two slam lines."); whiplashChance = ((BaseUnityPlugin)this).Config.Bind<float>("Whiplash", "Chance", 0.3f, "Chance (0 to 1) for V1 to speak when throwing the whiplash."); whiplashCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Whiplash", "CooldownSeconds", 8f, "Minimum time (s) between two whiplash lines."); coinChance = ((BaseUnityPlugin)this).Config.Bind<float>("Coin", "Chance", 0.3f, "Chance (0 to 1) for V1 to speak when a coin (railcoin/ricoshot) appears."); coinCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Coin", "CooldownSeconds", 5f, "Minimum time (s) between two coin lines."); multiKillCount = ((BaseUnityPlugin)this).Config.Bind<int>("MultiKill", "Kills", 3, "How many kills inside the window count as a multi-kill."); multiKillWindow = ((BaseUnityPlugin)this).Config.Bind<float>("MultiKill", "WindowSeconds", 1f, "Time window (s) the kills must happen in."); multiKillChance = ((BaseUnityPlugin)this).Config.Bind<float>("MultiKill", "Chance", 1f, "Chance (0 to 1) for V1 to speak on a multi-kill. 1 = guaranteed."); multiKillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("MultiKill", "CooldownSeconds", 15f, "Minimum time (s) between two multi-kill lines."); reloadKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "ReloadKey", new KeyboardShortcut((KeyCode)290, Array.Empty<KeyCode>()), "Hotkey to rescan the voices folders and clear the clip cache (for adding/swapping audio without restarting)."); VoicesPath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "voices"); source = ((Component)this).gameObject.AddComponent<AudioSource>(); source.spatialBlend = 0f; source.playOnAwake = false; Harmony harmony = new Harmony("com.v1voice.mod"); Hook(harmony, "NewMovement", "GetHurt", "Post_hurt"); Hook(harmony, "EnemyIdentifier", "Death", "Post_kill"); HookSlam(harmony); Hook(harmony, "EnemyIdentifier", "Death", "Pre_taunt", prefix: true); Hook(harmony, "Punch", "ParryProjectile", "Post_parry"); Hook(harmony, "NewMovement", "Respawn", "Post_respawn"); Hook(harmony, "SubtitleController", "DisplaySubtitle", "Post_subtitle"); HookV2Escape(harmony); HookPickups(harmony); SceneManager.sceneLoaded += OnSceneLoaded; ((MonoBehaviour)this).StartCoroutine(NailgunWatch()); ((MonoBehaviour)this).StartCoroutine(LevelStartWatch()); ((MonoBehaviour)this).StartCoroutine(V2Watch()); ((MonoBehaviour)this).StartCoroutine(KnuckleWatch()); ((MonoBehaviour)this).StartCoroutine(LowHpWatch()); ((MonoBehaviour)this).StartCoroutine(CoinWatch()); ((MonoBehaviour)this).StartCoroutine(DeathWatch()); ((MonoBehaviour)this).StartCoroutine(WhiplashWatch()); Log.LogInfo((object)("Voices folder: " + VoicesPath)); string[] array = new string[17] { "hurt", "kill", "nailgun", "parry", "levelstart", "respawn", "v2escape", "knuckleblaster", "death", "lowhp", "boss", "slam", "whiplash", "coin", "multikill", "enemytaunt", "enemytaunt/default" }; foreach (string text in array) { string path = Path.Combine(VoicesPath, text); Directory.CreateDirectory(path); int num = Directory.GetFiles(path, "*", SearchOption.AllDirectories).Count(IsAudio); Log.LogInfo((object)("Category '" + text + "': " + ((num < 0) ? "FOLDER MISSING" : (num + " audio(s)")))); } string[] array2 = bossTypes.Value.Split(new char[1] { ',' }); foreach (string text2 in array2) { string text3 = text2.Trim().ToLower(); if (text3.Length > 0) { Directory.CreateDirectory(Path.Combine(VoicesPath, "boss", text3)); } } } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = reloadKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { fileLists.Clear(); cache.Clear(); Log.LogInfo((object)"Voice folders rescanned; clip cache cleared."); string[] array = new string[16] { "hurt", "kill", "nailgun", "parry", "levelstart", "respawn", "v2escape", "knuckleblaster", "death", "lowhp", "boss", "slam", "whiplash", "coin", "multikill", "enemytaunt" }; foreach (string text in array) { string dir = Path.Combine(VoicesPath, text); Log.LogInfo((object)("Category '" + text + "': " + FilesIn(dir).Length + " audio(s)")); } } } private static bool IsAudio(string f) { string text = Path.GetExtension(f).ToLower(); return text == ".ogg" || text == ".wav" || text == ".mp3"; } private static string[] FilesIn(string dir) { if (!fileLists.TryGetValue(dir, out var value)) { value = (Directory.Exists(dir) ? Directory.GetFiles(dir).Where(IsAudio).ToArray() : new string[0]); fileLists[dir] = value; } return value; } private void Hook(Harmony harmony, string typeName, string methodName, string handlerName, bool prefix = false) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown Type type = AccessTools.TypeByName(typeName); if (type == null) { Log.LogWarning((object)("Class not found: " + typeName)); return; } List<MethodInfo> list = (from m in AccessTools.GetDeclaredMethods(type) where m.Name == methodName select m).ToList(); if (list.Count == 0) { Log.LogWarning((object)("Method not found: " + typeName + "." + methodName)); return; } HarmonyMethod val = new HarmonyMethod(typeof(V1VoicePlugin).GetMethod(handlerName, BindingFlags.Static | BindingFlags.NonPublic)); foreach (MethodInfo item in list) { if (prefix) { harmony.Patch((MethodBase)item, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } else { harmony.Patch((MethodBase)item, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } Log.LogInfo((object)("Trigger active: " + typeName + "." + methodName + " (" + list.Count + " overload(s), " + (prefix ? "prefix" : "postfix") + ")")); } private static void Post_hurt() { float value = Random.value; if (!(value > hurtChance.Value)) { Log.LogInfo((object)("Trigger fired: hurt (roll " + value.ToString("0.00") + ")")); PlayWithCooldown("hurt", hurtCooldown.Value); } } private unsafe void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 string text = ((Scene)(ref scene)).name ?? ""; Log.LogInfo((object)("Scene loaded: " + text + " (" + ((object)(*(LoadSceneMode*)(&mode))/*cast due to .constrained prefix*/).ToString() + ")")); knuckleBaseline = true; if ((int)mode > 0) { return; } string text2 = text.ToLower(); if (text2.Contains("menu") || text2.Contains("bootstrap") || text2.Contains("intro") || text2.Length == 0) { lastLevelScene = null; levelStartPending = false; return; } bool flag = text == lastLevelScene; lastLevelScene = text; float value = Random.value; if (flag) { levelStartPending = false; Log.LogInfo((object)("Trigger fired: respawn (level restarted, roll " + value.ToString("0.00") + ")")); if (value <= respawnChance.Value) { PlayWithCooldown("respawn", respawnCooldown.Value, force: true); } } else { levelStartPending = true; levelStartSince = Time.unscaledTime; Log.LogInfo((object)"Level loaded; waiting for V1 to appear in the scene..."); } } private void HookV2Escape(Harmony harmony) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown Type type = AccessTools.TypeByName("V2"); if (type == null) { return; } string[] array = new string[7] { "update", "check", "can", "should", "is", "get", "set" }; HarmonyMethod val = new HarmonyMethod(typeof(V1VoicePlugin).GetMethod("Post_v2method", BindingFlags.Static | BindingFlags.NonPublic)); int num = 0; foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(type)) { string n = declaredMethod.Name.ToLower(); if ((n.Contains("escap") || n.Contains("flee")) && !array.Any((string k) => n.StartsWith(k))) { harmony.Patch((MethodBase)declaredMethod, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo((object)("Trigger active: V2." + declaredMethod.Name)); num++; } } if (num == 0) { Log.LogInfo((object)"V2: no escape method found (no such trigger)."); } } private static void Post_v2method(MethodBase __originalMethod) { string name = __originalMethod.Name; if (v2Seen.Add(name)) { Log.LogInfo((object)("V2 method called: " + name)); } OnV2Escape("method " + name); } private static void Post_subtitle(object[] __args) { if (__args == null) { return; } string text = null; foreach (object obj in __args) { if (obj is string) { text = (string)obj; break; } } if (text == null) { return; } Log.LogInfo((object)("Subtitle: " + text)); string text2 = Regex.Replace(text, "<.*?>", "").Trim().ToLower(); if (text2.Contains("not getting away this time")) { float value = Random.value; Log.LogInfo((object)("Trigger fired: v2escape via subtitle (roll " + value.ToString("0.00") + ")")); if (value <= v2EscapeChance.Value) { PlayWithCooldown("v2escape", 20f, force: true); } } } private static void Post_respawn() { float value = Random.value; Log.LogInfo((object)("Trigger fired: respawn (checkpoint, roll " + value.ToString("0.00") + ")")); if (value <= respawnChance.Value) { PlayWithCooldown("respawn", respawnCooldown.Value, force: true); } } private static void Post_parry(object[] __args) { string text = null; if (__args != null) { foreach (object obj in __args) { Component val = (Component)((obj is Component) ? obj : null); if ((Object)(object)val != (Object)null) { text = ((Object)val.gameObject).name; break; } GameObject val2 = (GameObject)((obj is GameObject) ? obj : null); if ((Object)(object)val2 != (Object)null) { text = ((Object)val2).name; break; } } } Log.LogInfo((object)("Parry on projectile: " + (text ?? "(unknown name)"))); if (parryOnlyShotgun.Value && text != null) { string text2 = text.ToLower(); if (!text2.Contains("shotgun") && !text2.Contains("pellet")) { return; } } float value = Random.value; if (!(value > parryChance.Value)) { Log.LogInfo((object)("Trigger fired: parry (roll " + value.ToString("0.00") + ")")); PlayWithCooldown("parry", parryCooldown.Value); } } private static void Post_kill(object __instance) { Object val = (Object)((__instance is Object) ? __instance : null); if (val == (Object)null) { return; } if (killed.Count > 2000) { killed.Clear(); } if (killed.Add(val.GetInstanceID())) { float value = Random.value; if (value <= killChance.Value) { Log.LogInfo((object)("Trigger fired: kill (roll " + value.ToString("0.00") + ")")); PlayWithCooldown("kill", killCooldown.Value); } OnMultiKill(); OnBossKill(val); } } private static void OnMultiKill() { float now = Time.unscaledTime; recentKills.RemoveAll((float t) => now - t > multiKillWindow.Value); recentKills.Add(now); if (recentKills.Count >= multiKillCount.Value) { recentKills.Clear(); float value = Random.value; if (!(value > multiKillChance.Value)) { Log.LogInfo((object)("Trigger fired: multikill (" + multiKillCount.Value + " in " + multiKillWindow.Value + "s)")); PlayWithCooldown("multikill", multiKillCooldown.Value, force: true); } } } private static void OnBossKill(Object enemy) { Component val = (Component)(object)((enemy is Component) ? enemy : null); if ((Object)(object)val == (Object)null) { Log.LogInfo((object)"BossKill: killed object is not a Component, skipped."); return; } object obj = null; FieldInfo field = ((object)val).GetType().GetField("enemyType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { obj = field.GetValue(val); } else { PropertyInfo property = ((object)val).GetType().GetProperty("enemyType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { obj = property.GetValue(val, null); } } if (obj == null) { Log.LogInfo((object)("BossKill: no enemyType on " + ((object)val).GetType().Name + " ('" + ((Object)val.gameObject).name + "'), skipped.")); return; } string text = Normalize(obj.ToString()); List<string> list = (from s in bossTypes.Value.Split(new char[1] { ',' }) select Normalize(s) into s where s.Length > 0 select s).ToList(); bool flag = list.Contains(text); Log.LogInfo((object)("BossKill check: enemyType='" + obj?.ToString() + "' (key '" + text + "'), in BossTypes: " + flag)); if (flag) { float value = Random.value; if (value > bossKillChance.Value) { Log.LogInfo((object)("BossKill: roll " + value.ToString("0.00") + " lost against chance " + bossKillChance.Value)); return; } string text2 = BossDirFor(text); Log.LogInfo((object)("Trigger fired: bosskill (" + text + ") -> " + text2)); PlayWithCooldown("boss", 5f, force: true, text2); } } private static string BossDirFor(string key) { string text = Path.Combine(VoicesPath, "boss"); if (Directory.Exists(text)) { string[] directories = Directory.GetDirectories(text); foreach (string text2 in directories) { if (Normalize(Path.GetFileName(text2)) == key && FilesIn(text2).Length != 0) { return text2; } } } return text; } private static string Normalize(string s) { StringBuilder stringBuilder = new StringBuilder(); foreach (char c in s) { if (char.IsLetterOrDigit(c)) { stringBuilder.Append(char.ToLowerInvariant(c)); } } return stringBuilder.ToString(); } private IEnumerator DeathWatch() { Type type = AccessTools.TypeByName("NewMovement"); if (type == null) { Log.LogWarning((object)"Class not found: NewMovement (death disabled)"); yield break; } FieldInfo deadField = type.GetField("dead", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (deadField == null) { Log.LogWarning((object)"NewMovement.dead not found (death disabled)"); yield break; } bool wasDead = false; while (true) { yield return (object)new WaitForSecondsRealtime(0.2f); Object obj = Object.FindObjectOfType(type); Component player = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)player == (Object)null || !player.gameObject.activeInHierarchy) { wasDead = false; continue; } bool dead; try { dead = (bool)deadField.GetValue(player); } catch { continue; } if (dead && !wasDead) { float roll = Random.value; Log.LogInfo((object)("Trigger fired: death (roll " + roll.ToString("0.00") + ")")); if (roll <= deathChance.Value) { PlayWithCooldown("death", 5f, force: true); } } wasDead = dead; } } private void HookSlam(Harmony harmony) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown Type type = AccessTools.TypeByName("NewMovement"); if (type == null) { return; } string[] array = new string[9] { "update", "check", "can", "should", "is", "get", "set", "stop", "end" }; HarmonyMethod val = new HarmonyMethod(typeof(V1VoicePlugin).GetMethod("Post_slam", BindingFlags.Static | BindingFlags.NonPublic)); int num = 0; foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(type)) { string n = declaredMethod.Name.ToLower(); if ((n.Contains("slam") || n.Contains("dive")) && !array.Any((string k) => n.StartsWith(k))) { harmony.Patch((MethodBase)declaredMethod, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo((object)("Trigger active: NewMovement." + declaredMethod.Name + " (slam)")); num++; } } if (num == 0) { Log.LogInfo((object)"NewMovement: no slam method found (slam line disabled)."); } } private static void Post_slam() { float value = Random.value; if (!(value > slamChance.Value)) { Log.LogInfo((object)"Trigger fired: slam"); PlayWithCooldown("slam", slamCooldown.Value); } } private IEnumerator WhiplashWatch() { Type type = AccessTools.TypeByName("HookArm"); if (type == null) { Log.LogInfo((object)"HookArm class not found (whiplash line disabled)."); yield break; } FieldInfo stateField = type.GetField("state", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (stateField == null) { Log.LogWarning((object)"HookArm.state not found (whiplash disabled)"); yield break; } Dictionary<int, string> prev = new Dictionary<int, string>(); while (true) { yield return (object)new WaitForSecondsRealtime(0.2f); Object[] array = Object.FindObjectsOfType(type); foreach (Object o in array) { int id = o.GetInstanceID(); object v; try { v = stateField.GetValue(o); } catch { continue; } string now = ((v != null) ? v.ToString().ToLower() : ""); prev.TryGetValue(id, out var was); prev[id] = now; bool isThrow = now.Contains("throw") || now.Contains("hook"); bool wasThrow = was != null && (was.Contains("throw") || was.Contains("hook")); if (isThrow && !wasThrow) { float roll = Random.value; Log.LogInfo((object)("Trigger fired: whiplash (state " + now + ", roll " + roll.ToString("0.00") + ")")); if (roll <= whiplashChance.Value) { PlayWithCooldown("whiplash", whiplashCooldown.Value); } } was = null; } } } private IEnumerator LowHpWatch() { Type type = AccessTools.TypeByName("NewMovement"); if (type == null) { Log.LogWarning((object)"Class not found: NewMovement (lowhp disabled)"); yield break; } FieldInfo hpField = type.GetField("hp", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (hpField == null) { Log.LogWarning((object)"NewMovement.hp not found (lowhp disabled)"); yield break; } bool wasLow = false; while (true) { yield return (object)new WaitForSecondsRealtime(0.25f); Object obj = Object.FindObjectOfType(type); Component player = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)player == (Object)null || !player.gameObject.activeInHierarchy) { continue; } float hp; try { hp = Convert.ToSingle(hpField.GetValue(player)); } catch { continue; } bool low = hp <= lowHpThreshold.Value && hp > 0f; if (low && !wasLow) { float roll = Random.value; Log.LogInfo((object)("Trigger fired: lowhp (" + hp.ToString("0") + " hp, roll " + roll.ToString("0.00") + ")")); if (roll <= lowHpChance.Value) { PlayWithCooldown("lowhp", lowHpCooldown.Value, force: true); } } wasLow = low; } } private IEnumerator CoinWatch() { Type type = AccessTools.TypeByName("Coin"); if (type == null) { Log.LogInfo((object)"Coin class not found (coin line disabled)."); yield break; } HashSet<int> previous = new HashSet<int>(); while (true) { yield return (object)new WaitForSecondsRealtime(0.3f); HashSet<int> current = new HashSet<int>(); bool newlyActive = false; Object[] array = Object.FindObjectsOfType(type); foreach (Object o in array) { int id = o.GetInstanceID(); current.Add(id); if (!previous.Contains(id)) { newlyActive = true; } } previous = current; if (newlyActive) { float roll = Random.value; Log.LogInfo((object)("Coin tossed (roll " + roll.ToString("0.00") + ")")); if (!(roll > coinChance.Value)) { PlayWithCooldown("coin", coinCooldown.Value); } } } } private static void Pre_taunt(object __instance) { Component val = (Component)((__instance is Component) ? __instance : null); if ((Object)(object)val == (Object)null) { return; } FieldInfo field = ((object)val).GetType().GetField("enemyType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); string text = ((field != null && field.GetValue(val) != null) ? field.GetValue(val).ToString().ToLower() : null); FieldInfo field2 = ((object)val).GetType().GetField("dead", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field2 != null && field2.FieldType == typeof(bool) && (bool)field2.GetValue(val)) { return; } float unscaledTime = Time.unscaledTime; if (!(unscaledTime < tauntNextAllowed)) { string text2 = PickTauntFile(text); if (text2 != null) { float num = CachedClipLength(text2); tauntNextAllowed = unscaledTime + num + tauntExtraCooldown.Value; Log.LogInfo((object)("Trigger fired: enemy taunt (" + (text ?? "unknown") + ")")); ((MonoBehaviour)Instance).StartCoroutine(Instance.LoadAndSpawn(text2)); } } } private static string PickTauntFile(string enemyKey) { string path = Path.Combine(VoicesPath, "enemytaunt"); if (tauntExclusiveEnabled.Value && enemyKey != null) { string[] array = FilesIn(Path.Combine(path, enemyKey)); if (array.Length != 0 && Random.value <= tauntExclusiveChance.Value) { return array[Random.Range(0, array.Length)]; } } string[] array2 = FilesIn(Path.Combine(path, "default")); if (array2.Length == 0 || Random.value > tauntChance.Value) { return null; } return array2[Random.Range(0, array2.Length)]; } private IEnumerator LoadAndSpawn(string path) { if (!cache.TryGetValue(path, out var clip) || (Object)(object)clip == (Object)null) { clip = null; string ext = Path.GetExtension(path).ToLower(); AudioType type = (AudioType)((ext == ".ogg") ? 14 : ((ext == ".mp3") ? 13 : 20)); string url = new Uri(path).AbsoluteUri; Log.LogInfo((object)("Loading: " + url)); UnityWebRequest req = UnityWebRequestMultimedia.GetAudioClip(url, type); try { yield return req.SendWebRequest(); if ((int)req.result != 1) { Log.LogError((object)("Failed to load " + path + ": " + req.error)); yield break; } clip = DownloadHandlerAudioClip.GetContent(req); } finally { ((IDisposable)req)?.Dispose(); } if ((Object)(object)clip == (Object)null || clip.length <= 0f) { Log.LogError((object)("Empty/invalid clip: " + path)); yield break; } ((Object)clip).name = Path.GetFileNameWithoutExtension(path); cache[path] = clip; } if (!((Object)(object)Camera.main == (Object)null)) { GameObject go = new GameObject("TempAudio_" + Path.GetFileNameWithoutExtension(path)); go.transform.position = ((Component)Camera.main).transform.position; AudioSource src = go.AddComponent<AudioSource>(); src.clip = clip; src.spatialBlend = 0f; src.volume = ((volume != null) ? volume.Value : 1f); src.Play(); Log.LogInfo((object)("Playing taunt: " + Path.GetFileName(path) + " (" + clip.length.ToString("0.00") + "s)")); Object.Destroy((Object)(object)go, clip.length + 0.2f); } } private static float CachedClipLength(string file) { if (cache.TryGetValue(file, out var value) && (Object)(object)value != (Object)null) { return value.length; } return 1f; } private IEnumerator LevelStartWatch() { Type type = AccessTools.TypeByName("NewMovement"); if (type == null) { Log.LogWarning((object)"Class not found: NewMovement (levelstart disabled)"); yield break; } FieldInfo activatedField = type.GetField("activated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (activatedField != null && activatedField.FieldType != typeof(bool)) { activatedField = null; } while (true) { yield return (object)new WaitForSecondsRealtime(0.2f); if (!levelStartPending) { continue; } if (Time.unscaledTime - levelStartSince > 60f) { levelStartPending = false; Log.LogWarning((object)"V1 did not appear in the scene within 60s; levelstart line cancelled."); continue; } Object obj = Object.FindObjectOfType(type); Component player = (Component)(object)((obj is Component) ? obj : null); if (!((Object)(object)player == (Object)null) && player.gameObject.activeInHierarchy && (!(activatedField != null) || (bool)activatedField.GetValue(player))) { levelStartPending = false; float roll = Random.value; Log.LogInfo((object)("V1 appeared in the scene; levelstart trigger (roll " + roll.ToString("0.00") + ")")); if (roll <= levelStartChance.Value) { PlayWithCooldown("levelstart", 2f, force: true); } } } } private static void PlayKnuckle() { PlayWithCooldown("knuckleblaster", 10f, force: true); } private void HookPickups(Harmony harmony) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "Assembly-CSharp"); if (assembly == null) { Log.LogWarning((object)"Assembly-CSharp not found (pickup trigger disabled)"); return; } Type[] array; try { array = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { array = ex.Types.Where((Type t) => t != null).ToArray(); } HashSet<string> hashSet = new HashSet<string> { "pickup", "pickedup", "collect", "ontriggerenter", "oncollisionenter" }; HarmonyMethod val = new HarmonyMethod(typeof(V1VoicePlugin).GetMethod("Post_pickup", BindingFlags.Static | BindingFlags.NonPublic)); int num = 0; Type[] array2 = array; foreach (Type type in array2) { if (!type.Name.ToLower().Contains("pickup") || !typeof(Component).IsAssignableFrom(type)) { continue; } foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(type)) { if (hashSet.Contains(declaredMethod.Name.ToLower()) && !declaredMethod.IsAbstract && !declaredMethod.IsGenericMethod) { try { harmony.Patch((MethodBase)declaredMethod, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num++; Log.LogInfo((object)("Trigger active: " + type.Name + "." + declaredMethod.Name + " (pickup)")); } catch (Exception ex2) { Log.LogWarning((object)("Failed to hook " + type.Name + "." + declaredMethod.Name + ": " + ex2.Message)); } } } } if (num == 0) { Log.LogWarning((object)"No pickup class (*PickUp*) found; only arm-in-hand detection applies."); } } private static void Post_pickup(object __instance) { Component val = (Component)((__instance is Component) ? __instance : null); if ((Object)(object)val == (Object)null) { return; } StringBuilder stringBuilder = new StringBuilder(((Object)val.gameObject).name); Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>(true); foreach (Transform val2 in componentsInChildren) { stringBuilder.Append(' ').Append(((Object)val2).name); } if ((Object)(object)val.transform.parent != (Object)null) { stringBuilder.Append(' ').Append(((Object)val.transform.parent).name); } string text = stringBuilder.ToString().ToLower(); if (pickupSeen.Add(((Object)val.gameObject).name)) { Log.LogInfo((object)("Pickup item touched: " + ((Object)val.gameObject).name)); } if (text.Contains("knuckle")) { int instanceID = ((Object)val).GetInstanceID(); if (pickupChecking.Add(instanceID)) { ((MonoBehaviour)Instance).StartCoroutine(Instance.CheckKnucklePickup(val, instanceID)); } } } private IEnumerator CheckKnucklePickup(Component comp, int id) { yield return (object)new WaitForSecondsRealtime(0.25f); pickupChecking.Remove(id); if ((Object)(object)comp == (Object)null || !comp.gameObject.activeInHierarchy) { Log.LogInfo((object)"Knuckleblaster collected from the ground."); PlayKnuckle(); } } private IEnumerator KnuckleWatch() { Type type = AccessTools.TypeByName("Punch"); if (type == null) { Log.LogWarning((object)"Class not found: Punch (knuckleblaster line disabled)"); yield break; } FieldInfo typeField = type.GetField("type", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); HashSet<int> seen = new HashSet<int>(); while (true) { yield return (object)new WaitForSecondsRealtime(0.3f); if (knuckleBaseline) { Object[] array = Object.FindObjectsOfType(type); foreach (Object b in array) { seen.Add(b.GetInstanceID()); } knuckleBaseline = false; continue; } Object[] array2 = Object.FindObjectsOfType(type); foreach (Object o in array2) { Component comp = (Component)(object)((o is Component) ? o : null); if ((Object)(object)comp == (Object)null) { continue; } int id = o.GetInstanceID(); if (!seen.Add(id)) { continue; } string objName = ((Object)comp.gameObject).name; string fist = "?"; if (typeField != null) { object v = typeField.GetValue(o); if (v != null) { fist = v.ToString(); } } Log.LogInfo((object)("Active punch: object '" + objName + "', type " + fist)); if (objName.ToLower().Contains("knuckle") || fist.ToLower().Contains("heavy")) { Log.LogInfo((object)"Knuckleblaster appeared in hand during the level."); PlayKnuckle(); } } } } private IEnumerator V2Watch() { Type type = AccessTools.TypeByName("V2"); if (type == null) { Log.LogWarning((object)"Class not found: V2 (escape line disabled)"); yield break; } BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo[] boolFields = (from fieldInfo in type.GetFields(flags) where fieldInfo.FieldType == typeof(bool) select fieldInfo).ToArray(); Log.LogInfo((object)("V2: bool fields = " + string.Join(", ", boolFields.Select((FieldInfo fieldInfo) => fieldInfo.Name).ToArray()))); FieldInfo[] watched = boolFields.Where(delegate(FieldInfo fieldInfo) { string text = fieldInfo.Name.ToLower(); return text.Contains("escap") || text.Contains("flee"); }).ToArray(); if (watched.Length == 0) { Log.LogWarning((object)"V2: no escape field found (see the list above)."); yield break; } Log.LogInfo((object)("V2: watching = " + string.Join(", ", watched.Select((FieldInfo fieldInfo) => fieldInfo.Name).ToArray()))); Dictionary<string, bool> prev = new Dictionary<string, bool>(); while (true) { yield return (object)new WaitForSecondsRealtime(0.3f); Object[] array = Object.FindObjectsOfType(type); foreach (Object o in array) { int id = o.GetInstanceID(); FieldInfo[] array2 = watched; foreach (FieldInfo f in array2) { string key = id + ":" + f.Name; bool now = (bool)f.GetValue(o); if (prev.TryGetValue(key, out var was) && !was && now) { OnV2Escape(f.Name); } prev[key] = now; } } } } private static void OnV2Escape(string fieldName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string text = ((Scene)(ref activeScene)).name ?? ""; Log.LogInfo((object)("V2 started fleeing (" + fieldName + ") in scene '" + text + "'")); string value = v2EscapeScene.Value; if (!string.IsNullOrEmpty(value) && text.IndexOf(value, StringComparison.OrdinalIgnoreCase) < 0) { Log.LogInfo((object)("Ignored: the scene does not contain '" + value + "'")); return; } float value2 = Random.value; if (!(value2 > v2EscapeChance.Value)) { PlayWithCooldown("v2escape", 20f, force: true); } } private IEnumerator NailgunWatch() { Type type = AccessTools.TypeByName("Nailgun"); if (type == null) { Log.LogWarning((object)"Class not found: Nailgun"); yield break; } Log.LogInfo((object)"Watching the Nailgun class"); HashSet<int> previous = new HashSet<int>(); while (true) { yield return (object)new WaitForSecondsRealtime(0.3f); HashSet<int> current = new HashSet<int>(); bool newlyActive = false; Object[] array = Object.FindObjectsOfType(type); foreach (Object o in array) { int id = o.GetInstanceID(); current.Add(id); if (!previous.Contains(id)) { newlyActive = true; } } previous = current; if (newlyActive) { float roll = Random.value; Log.LogInfo((object)("Nailgun equipped (roll " + roll.ToString("0.00") + ")")); if (!(roll > nailgunChance.Value)) { PlayWithCooldown("nailgun", nailgunCooldown.Value); } } } } private static void PlayWithCooldown(string category, float cooldown, bool force = false, string dirOverride = null) { if ((Object)(object)Instance == (Object)null) { Log.LogWarning((object)("Play('" + category + "') ignored: plugin object was destroyed.")); return; } float unscaledTime = Time.unscaledTime; if (lastPlayed.TryGetValue(category, out var value) && unscaledTime - value < cooldown) { return; } string text = dirOverride ?? Path.Combine(VoicesPath, category); string[] array = FilesIn(text); if (array.Length == 0) { Log.LogWarning((object)("No .ogg/.wav/.mp3 in: " + text)); return; } string file = array[Random.Range(0, array.Length)]; if (Enqueue(file, force)) { lastPlayed[category] = unscaledTime; } } private static bool Enqueue(string file, bool force = false) { if (!force && (loading || ((Object)(object)currentTempSrc != (Object)null && currentTempSrc.isPlaying))) { return false; } if (force && (Object)(object)currentTempGo != (Object)null) { Object.Destroy((Object)(object)currentTempGo); } playToken++; loading = true; ((MonoBehaviour)Instance).StartCoroutine(Instance.LoadAndPlay(file, playToken)); return true; } private IEnumerator LoadAndPlay(string path, int token) { try { if (!cache.TryGetValue(path, out var clip)) { string ext = Path.GetExtension(path).ToLower(); AudioType type = (AudioType)((ext == ".ogg") ? 14 : ((ext == ".mp3") ? 13 : 20)); string url = new Uri(path).AbsoluteUri; Log.LogInfo((object)("Loading: " + url)); UnityWebRequest req = UnityWebRequestMultimedia.GetAudioClip(url, type); try { yield return req.SendWebRequest(); if ((int)req.result != 1) { Log.LogError((object)("Failed to load " + path + ": " + req.error)); yield break; } clip = DownloadHandlerAudioClip.GetContent(req); } finally { ((IDisposable)req)?.Dispose(); } if ((Object)(object)clip == (Object)null || clip.length <= 0f) { Log.LogError((object)("Empty/invalid clip: " + path)); yield break; } ((Object)clip).name = Path.GetFileNameWithoutExtension(path); cache[path] = clip; } if (token == playToken) { Log.LogInfo((object)("Playing: " + Path.GetFileName(path) + " (" + clip.length.ToString("0.00") + "s)")); GameObject go = new GameObject("TempAudio_" + Path.GetFileNameWithoutExtension(path)); go.transform.position = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : ((Component)Instance).transform.position); AudioSource src = go.AddComponent<AudioSource>(); src.clip = clip; src.spatialBlend = 0f; src.volume = ((volume != null) ? volume.Value : 1f); src.Play(); currentTempGo = go; currentTempSrc = src; Object.Destroy((Object)(object)go, clip.length + 0.2f); } } finally { if (token == playToken) { loading = false; } } } }
BepInEx/plugins/WesV2.dll
Decompiled 9 hours agousing 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.Bootstrap; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using UltrakULL; using UltrakULL.audio; using UltrakULL.json; using UnityEngine; using UnityEngine.SceneManagement; using WesV2.Patches; using WesV2.Scripts; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("WesV2")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.2.2.0")] [assembly: AssemblyInformationalVersion("1.2.2+269facfd68b3e16944580b73f46c6dce4d1e97b3")] [assembly: AssemblyProduct("WesV2")] [assembly: AssemblyTitle("WesV2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace WesV2 { public static class ExtensionMethods { private static readonly ConditionalWeakTable<V2, V2Voice> additionalDataTable = new ConditionalWeakTable<V2, V2Voice>(); public static Type[] GetPatchesOfType(this Assembly assembly, Type type) { return (from t in assembly.GetTypes() where t.IsSubclassOf(type) select t).ToArray(); } public static V2Voice GetVoice(this V2 v2) { additionalDataTable.TryGetValue(v2, out var value); return value; } public static void AddVoice(this V2 v2) { V2Voice value = ((Component)v2).gameObject.AddComponent<V2Voice>(); additionalDataTable.Add(v2, value); } } [BepInPlugin("kyryh.wesv2", "WesV2", "1.2.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static AssetBundle WesV2AssetBundle; public static ManualLogSource Log; public static Plugin Instance; public static bool secondEncounterIntro; public static bool ultrakullLoaded; public const string GUID = "kyryh.wesv2"; public void Awake() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; Assembly executingAssembly = Assembly.GetExecutingAssembly(); using (Stream stream = executingAssembly.GetManifestResourceStream("WesV2.Resources.wesv2assetbundle")) { WesV2AssetBundle = AssetBundle.LoadFromStream(stream); } SceneManager.sceneLoaded += delegate { OnSceneLoaded(); }; Harmony val = new Harmony("kyryh.wesv2"); Type[] patchesOfType = executingAssembly.GetPatchesOfType(typeof(DefaultPatch)); foreach (Type type in patchesOfType) { val.PatchAll(type); } ultrakullLoaded = Chainloader.PluginInfos.ContainsKey("clearwater.ultrakill.ultrakull"); if (ultrakullLoaded) { Type[] patchesOfType2 = executingAssembly.GetPatchesOfType(typeof(UltrakULLPatch)); foreach (Type type2 in patchesOfType2) { val.PatchAll(type2); } } V2VoicelinesData.LoadSubtitles(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Wes V2 is loaded!"); } public void OnSceneLoaded() { ((MonoBehaviour)this).StopAllCoroutines(); string currentScene = SceneHelper.CurrentScene; if (currentScene == "Level 1-4") { GameObject val = Utils.FindGameObjectByName("Fake V2"); Utils.CreateOneTimeVoiceObject("Voice", V2VoicelinesData.GetAudioClip("v2_1/jumpscare"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_jumpscare_1"))), val.transform); } else if (currentScene == "Level 4-4") { ((MonoBehaviour)this).StartCoroutine(V2_2Intro()); } } private static IEnumerator V2_2Intro() { secondEncounterIntro = true; yield return null; GameObject bossArena = Utils.FindGameObjectByName("7 Stuff(Clone)"); if (!bossArena.GetComponentInChildren<V2>(true).longIntro) { yield break; } GameObject bossIntro = ((Component)bossArena.transform.Find("BossIntro")).gameObject; GameObject versusIntro = ((Component)bossIntro.transform.Find("VersusIntro")).gameObject; GameObject introVoice = new GameObject("IntroVoice"); introVoice.transform.position = bossIntro.transform.Find("v2_GreenArm").position; AudioSource audioSource1 = Utils.CreateOneTimeVoiceObject("IntroVoice1", V2VoicelinesData.GetAudioClip("v2_2/intro1"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro1_1")), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro1_2"), 1.4f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro1_3"), 4.9f)), introVoice.transform); AudioSource audioSource2 = Utils.CreateOneTimeVoiceObject("IntroVoice2", V2VoicelinesData.GetAudioClip("v2_2/intro2"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro2_1")), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro2_2"), 2f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_intro2_3"), 4.6f)), introVoice.transform); yield return (object)new WaitUntil((Func<bool>)delegate { if ((Object)(object)bossArena == (Object)null) { bossArena = Utils.FindGameObjectByName("7 Stuff(Clone)"); } return bossArena.activeInHierarchy; }); yield return (object)new WaitForSeconds(1.5f); audioSource1.Play(); LogDebug("INTRO 1"); yield return (object)new WaitUntil((Func<bool>)delegate { if ((Object)(object)versusIntro == (Object)null) { versusIntro = ((Component)Utils.FindGameObjectByName("7 Stuff(Clone)").transform.Find("BossIntro/VersusIntro")).gameObject; } return versusIntro.activeInHierarchy; }); audioSource1.Stop(); yield return (object)new WaitForSeconds(1f); audioSource2.Play(); LogDebug("INTRO 2"); yield return (object)new WaitWhile((Func<bool>)delegate { if ((Object)(object)versusIntro == (Object)null) { versusIntro = ((Component)Utils.FindGameObjectByName("7 Stuff(Clone)").transform.Find("BossIntro/VersusIntro")).gameObject; } return versusIntro.activeInHierarchy; }); audioSource2.Stop(); yield return null; secondEncounterIntro = false; } public static void LogDebug(object data) { Log.LogDebug(data); } public static void LogError(object data) { Log.LogError(data); } } internal static class Utils { public static GameObject FindGameObjectByName(string name) { GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); GameObject[] array2 = array; foreach (GameObject val in array2) { if (((Object)val).name == name) { return val; } } Plugin.LogError("huh??? " + name); return null; } public static SubtitleDataLine MakeLine(string subtitle, float time = 0f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown return new SubtitleDataLine { subtitle = subtitle, time = time }; } public static SubtitleData CreateSubtitleData(params SubtitleDataLine[] array) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown return new SubtitleData { lines = array }; } public static void PlayClipAtPoint(AudioClip clip, Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("One shot audio"); val.transform.position = position; AudioSource val2 = val.AddComponent<AudioSource>(); val2.pitch = Random.Range(0.95f, 1f); val2.clip = clip; val2.Play(); Object.Destroy((Object)(object)val, clip.length + 1f); } public static AudioSource CreateVoiceObject(string name, Transform parent = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent); val.transform.localPosition = Vector3.zero; AudioSource val2 = val.AddComponent<AudioSource>(); val2.playOnAwake = false; val2.spatialBlend = 1f; val2.rolloffMode = (AudioRolloffMode)1; val2.dopplerLevel = 0f; val.AddComponent<SoundPause>(); return val2; } public static AudioSource CreateOneTimeVoiceObject(string name, AudioClip clip, SubtitleData subtitles, Transform parent = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent); val.transform.localPosition = Vector3.zero; AudioSource val2 = val.AddComponent<AudioSource>(); val2.clip = clip; val2.playOnAwake = true; val2.spatialBlend = 1f; val2.rolloffMode = (AudioRolloffMode)1; val2.dopplerLevel = 0f; val.AddComponent<SoundPause>(); SubtitledAudioSource val3 = val.AddComponent<SubtitledAudioSource>(); val3.subtitles = subtitles; return val2; } } internal static class V2VoicelinesData { private static Dictionary<string, V2Subtitles> allSubtitles = new Dictionary<string, V2Subtitles>(); public static void LoadSubtitles() { allSubtitles.Add("default", new V2Subtitles()); if (!Plugin.ultrakullLoaded) { return; } string[] files = Directory.GetFiles(Path.Combine(Paths.ConfigPath, "ultrakull"), "*.json"); string[] array = files; foreach (string path in array) { try { JObject val = JObject.Parse(File.ReadAllText(path)); string text = (string)val["metadata"][(object)"langName"]; if (!allSubtitles.ContainsKey(text) && text != "te-mp") { V2Subtitles value = JsonConvert.DeserializeObject<V2Subtitles>(((object)val["subtitles"]).ToString()); allSubtitles.Add(text, value); } } catch (Exception ex) { Plugin.LogError("something happened while trying to load a language: " + ex); } } } public static string GetSubtitle(string voiceLine) { if (Plugin.ultrakullLoaded) { string subtitleUltrakull = GetSubtitleUltrakull(voiceLine); if (subtitleUltrakull != null) { return subtitleUltrakull; } } return Traverse.Create((object)allSubtitles["default"]).Field(voiceLine).GetValue<string>(); } private static string GetSubtitleUltrakull(string voiceLine) { string langName = LanguageManager.CurrentLanguage.metadata.langName; return Traverse.Create((object)allSubtitles[langName]).Field(voiceLine).GetValue<string>(); } public static AudioClip GetAudioClip(string audioFilePath) { if (Plugin.ultrakullLoaded) { AudioClip audioClipUltrakull = GetAudioClipUltrakull(audioFilePath); if ((Object)(object)audioClipUltrakull != (Object)null) { return audioClipUltrakull; } } return Plugin.WesV2AssetBundle.LoadAsset<AudioClip>("assets/" + audioFilePath + ".wav"); } private static AudioClip GetAudioClipUltrakull(string audioFilePath) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown AudioClip val = new AudioClip(); string text = audioFilePath.Replace('/', Path.DirectorySeparatorChar); AudioClip val2 = AudioSwapper.SwapClipWithFile(val, AudioSwapper.SpeechFolder + text); if ((Object)(object)val2 != (Object)(object)val) { return val2; } return null; } } internal class V2Subtitles { public string subtitles_v2_jumpscare_1 = "hallway noises.."; public string subtitles_v2_windowsbreak = "GET THE FUCK OFF MY GEOMETRIC STRUCTURE"; public string subtitles_v2_intro_1 = "Please don't be a speedrunner.."; public string subtitles_v2_intro_2 = "Ohh hi Vfirst!"; public string subtitles_v2_intro_3 = "How are you my blue gay ass bitch?"; public string subtitles_v2_taunt1 = "*goofy ahh sounds*"; public string subtitles_v2_taunt2 = "Jokes aside, jokes aside, it's beautiful outside, isn't it?"; public string subtitles_v2_taunt3 = "Nananana, you can't parry me!"; public string subtitles_v2_taunt4 = "You're in the files, we're in the Epstein Files!!"; public string subtitles_v2_taunt5 = "You know what, i actually like that, do it again."; public string subtitles_v2_taunt6 = "I mean, you could just death coin me and i'm an easy target,\nBut it's not like i want it, it's not like i want it!"; public string subtitles_v2_death = "banana slip"; public string subtitles_v2_outro1 = "My diagnostics for ya"; public string subtitles_v2_outro2 = "Gay ass *N-WORD*"; public string subtitles_v2Second_intro1_1 = "Yo Vfirst."; public string subtitles_v2Second_intro1_2 = "I heard you`re using my arm to masturbate the demons."; public string subtitles_v2Second_intro1_3 = "That's devilish bro, that's devilish."; public string subtitles_v2Second_intro2_1 = "I mean we could trade arms, you know"; public string subtitles_v2Second_intro2_2 = "Be a cool duo, red and blue, but no"; public string subtitles_v2Second_intro2_3 = "You prefer the fucking loud ass character in the fucking game!"; public string subtitles_v2Second_taunt1 = "Oh, bluetooth this will cost you the left fucking ball"; public string subtitles_v2Second_taunt2 = "Why did you grab my arm, you don't even use it, you just parry the fucking around"; public string subtitles_v2Second_taunt3 = "My god you're so hot- I MEAN IT's HOT OUTSIDE"; public string subtitles_v2Second_taunt4 = "I WILL FUCKING KILL YOU"; public string subtitles_v2Second_enrage = "YOU MOTHERFUCKER"; public string subtitles_v2Second_fleeing1 = "Well, i mean this is kinda funny.."; public string subtitles_v2Second_fleeing2_1 = "Fuck, fuck, no, no.."; public string subtitles_v2Second_fleeing2_2 = "No, you can't beat me..!"; public string subtitles_v2Second_death = "*HARD R*"; } public static class PluginInfo { public const string PLUGIN_GUID = "WesV2"; public const string PLUGIN_NAME = "WesV2"; public const string PLUGIN_VERSION = "1.2.2"; } } namespace WesV2.Scripts { public class V2Voice : MonoBehaviour { private AudioSource audioSource; private V2 v2; private AudioClip[] tauntAudioClips; private string[] tauntSubtitles; private AudioClip enrageAudioClip; private string enrageSubtitle; private AudioClip deathAudioClip; private string deathSubtitle; private int[] tauntWeights; private int timesChangedWeapon = 0; protected void Awake() { v2 = ((Component)this).GetComponent<V2>(); audioSource = ((Component)((Component)this).transform.Find("Voice")).GetComponent<AudioSource>(); if (!v2.secondEncounter) { tauntAudioClips = (AudioClip[])(object)new AudioClip[6] { V2VoicelinesData.GetAudioClip("v2_1/taunt1"), V2VoicelinesData.GetAudioClip("v2_1/taunt2"), V2VoicelinesData.GetAudioClip("v2_1/taunt3"), V2VoicelinesData.GetAudioClip("v2_1/taunt4"), V2VoicelinesData.GetAudioClip("v2_1/taunt5"), V2VoicelinesData.GetAudioClip("v2_1/taunt6") }; tauntSubtitles = new string[6] { V2VoicelinesData.GetSubtitle("subtitles_v2_taunt1"), V2VoicelinesData.GetSubtitle("subtitles_v2_taunt2"), V2VoicelinesData.GetSubtitle("subtitles_v2_taunt3"), V2VoicelinesData.GetSubtitle("subtitles_v2_taunt4"), V2VoicelinesData.GetSubtitle("subtitles_v2_taunt5"), V2VoicelinesData.GetSubtitle("subtitles_v2_taunt6") }; deathAudioClip = V2VoicelinesData.GetAudioClip("v2_1/death"); deathSubtitle = V2VoicelinesData.GetSubtitle("subtitles_v2_death"); } else { tauntAudioClips = (AudioClip[])(object)new AudioClip[4] { V2VoicelinesData.GetAudioClip("v2_2/taunt1"), V2VoicelinesData.GetAudioClip("v2_2/taunt2"), V2VoicelinesData.GetAudioClip("v2_2/taunt3"), V2VoicelinesData.GetAudioClip("v2_2/taunt4") }; tauntSubtitles = new string[4] { V2VoicelinesData.GetSubtitle("subtitles_v2Second_taunt1"), V2VoicelinesData.GetSubtitle("subtitles_v2Second_taunt2"), V2VoicelinesData.GetSubtitle("subtitles_v2Second_taunt3"), V2VoicelinesData.GetSubtitle("subtitles_v2Second_taunt4") }; enrageAudioClip = V2VoicelinesData.GetAudioClip("v2_2/enrage"); enrageSubtitle = V2VoicelinesData.GetSubtitle("subtitles_v2Second_enrage"); deathAudioClip = V2VoicelinesData.GetAudioClip("v2_1/death"); deathSubtitle = V2VoicelinesData.GetSubtitle("subtitles_v2_death"); } tauntWeights = Enumerable.Repeat(1, tauntAudioClips.Length).ToArray(); } protected void Start() { if (v2.secondEncounter && v2.firstPhase && !Plugin.secondEncounterIntro) { Taunt(); } if (v2.intro) { PlayVoice(V2VoicelinesData.GetAudioClip("v2_1/windowbreak")); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(V2VoicelinesData.GetSubtitle("subtitles_v2_windowsbreak"), (AudioSource)null, false); } if (v2.longIntro) { ((MonoBehaviour)this).StartCoroutine(LongIntro()); } } public int WeightedRandomIndex() { int i = 0; int num = -1; for (int num2 = Random.Range(0, tauntWeights.Sum()); num2 >= i; i += tauntWeights[num]) { num++; } return num; } public void Taunt() { int num = WeightedRandomIndex(); for (int i = 0; i < tauntWeights.Length; i++) { tauntWeights[i]++; } tauntWeights[num] = 0; PlayVoice(tauntAudioClips[num]); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(tauntSubtitles[num], (AudioSource)null, false); } private void PlayVoice(AudioClip clip) { audioSource.pitch = Random.Range(0.95f, 1f); audioSource.clip = clip; audioSource.Play(); } private IEnumerator LongIntro() { yield return (object)new WaitUntil((Func<bool>)(() => v2.anim.GetBool("Intro"))); AudioSource audioSource = Utils.CreateOneTimeVoiceObject("IntroVoice", V2VoicelinesData.GetAudioClip("v2_1/intro"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_intro_1"), 0.1f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_intro_1"), 1.1f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_intro_1"), 2.2f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_intro_2"), 3.2f), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_intro_3"), 5f)), ((Component)v2).transform); audioSource.Play(); } public void SwitchWeapons() { timesChangedWeapon++; if (timesChangedWeapon >= 7) { timesChangedWeapon = 0; Taunt(); } } internal void Enrage(string enrageName) { if (enrageName == "STOP HITTING YOURSELF" && !v2.enraged) { timesChangedWeapon = 0; PlayVoice(enrageAudioClip); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(enrageSubtitle, (AudioSource)null, false); } } public void Die() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!v2.dead) { if (v2.inIntro) { ((Component)((Component)this).transform.Find("IntroVoice")).gameObject.SetActive(false); } timesChangedWeapon = 0; audioSource.Stop(); if (!v2.secondEncounter || !v2.bossVersion) { Utils.PlayClipAtPoint(deathAudioClip, ((Component)this).transform.position); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(deathSubtitle, (AudioSource)null, false); } } } public void KnockedOut(string triggerName) { if (triggerName == "KnockedDown") { if (!v2.secondEncounter) { ((MonoBehaviour)v2).StartCoroutine(Outro()); } else { ((MonoBehaviour)v2).StartCoroutine(Fleeing()); } } else if (triggerName == "Flailing") { ((MonoBehaviour)Plugin.Instance).StartCoroutine(Falling()); } else { Plugin.LogError("what"); } } private IEnumerator Outro() { yield return (object)new WaitForSeconds(1f); AudioSource audioSource = Utils.CreateOneTimeVoiceObject("OutroVoice", V2VoicelinesData.GetAudioClip("v2_1/outro"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_outro1")), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2_outro2"), 1.6f)), ((Component)this).transform); audioSource.Play(); } private IEnumerator Fleeing() { PlayVoice(deathAudioClip); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(deathSubtitle, (AudioSource)null, false); AudioSource fleeingVoice = Utils.CreateOneTimeVoiceObject("FleeingVoice", V2VoicelinesData.GetAudioClip("v2_2/fleeing1"), Utils.CreateSubtitleData(), ((Component)this).transform); yield return (object)new WaitForSeconds(2.5f); fleeingVoice.Play(); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(V2VoicelinesData.GetSubtitle("subtitles_v2Second_fleeing1"), (AudioSource)null, false); } private static IEnumerator Falling() { GameObject fallingV2 = ((Component)Utils.FindGameObjectByName("8 Stuff(Clone)(Clone)").transform.Find("v2_GreenArm")).gameObject; AudioSource audioSource = Utils.CreateVoiceObject("FallingVoice", fallingV2.transform); audioSource.clip = V2VoicelinesData.GetAudioClip("v2_2/death"); yield return (object)new WaitUntil((Func<bool>)(() => fallingV2.activeInHierarchy)); yield return (object)new WaitForSeconds(0.3f); audioSource.Play(); MonoSingleton<SubtitleController>.Instance.DisplaySubtitle(V2VoicelinesData.GetSubtitle("subtitles_v2Second_death"), (AudioSource)null, false); } protected void OnDestroy() { Plugin.Log.LogInfo((object)"destroyed"); } protected void OnDisable() { Plugin.Log.LogInfo((object)"disabled"); } } } namespace WesV2.Scripts.HarmonyPatches { [HarmonyPatch(typeof(V2))] internal class V2Patches : DefaultPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPostfix(V2 __instance) { if (!((Object)(object)((Component)__instance).transform.Find("BigJohn") != (Object)null)) { if (__instance.firstPhase) { Utils.CreateVoiceObject("Voice", ((Component)__instance).transform); } else { Utils.CreateOneTimeVoiceObject("SlidingVoice", V2VoicelinesData.GetAudioClip("v2_2/fleeing2"), Utils.CreateSubtitleData(Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_fleeing2_1")), Utils.MakeLine(V2VoicelinesData.GetSubtitle("subtitles_v2Second_fleeing2_2"), 3f)), ((Component)__instance).transform).Play(); } __instance.AddVoice(); Plugin.LogDebug("v2 started"); } } [HarmonyPatch("SwitchWeapon")] [HarmonyPostfix] private static void SwitchWeaponPostfix(V2 __instance) { if (__instance.firstPhase) { __instance.GetVoice()?.SwitchWeapons(); Plugin.LogDebug("v2 changed weapon"); } } [HarmonyPatch("Enrage", new Type[] { typeof(string) })] [HarmonyPrefix] private static void EnragePrefix(V2 __instance, string enrageName) { __instance.GetVoice()?.Enrage(enrageName); Plugin.LogDebug("v2 enraged (enrageName=\"" + enrageName + "\")"); } [HarmonyPatch("KnockedOut")] [HarmonyPostfix] private static void KnockedOutPostfix(V2 __instance, string triggerName) { __instance.GetVoice()?.KnockedOut(triggerName); Plugin.LogDebug("v2 knocked out: " + triggerName); } [HarmonyPatch("Die")] [HarmonyPrefix] private static void DiePrefix(V2 __instance, bool ___dead, bool ___bossVersion) { __instance.GetVoice()?.Die(); Plugin.LogDebug("v2 died"); } } } namespace WesV2.Patches { [HarmonyPatch(typeof(GoToTarget))] internal class GoToTargetPatch : DefaultPatch { [HarmonyPatch("Activate")] [HarmonyPrefix] private static void ActivatePrefix(GoToTarget __instance) { if (!__instance.activated) { Transform transform = ((Component)__instance).transform; if (((Object)transform).name == "Fake V2") { transform.Find("Voice").SetParent((Transform)null); } } } } [HarmonyPatch(typeof(HudMessage))] internal class HudMessagePatches : DefaultPatch { [HarmonyPatch("PlayMessage")] [HarmonyPrefix] private static void PlayMessagePrefix(ref string ___message) { if (___message == "You're not getting away this time.") { ___message = "You get back here right this FUCKING INSTANT."; } } } internal class DefaultPatch { } internal class UltrakULLPatch { } [HarmonyPatch(typeof(UltrakillEvent))] internal class UltrakillEventPatches : DefaultPatch { [HarmonyPatch("Invoke")] [HarmonyPostfix] private static void InvokePostfix(UltrakillEvent __instance) { if (__instance.toDisActivateObjects == null) { return; } GameObject[] toDisActivateObjects = __instance.toDisActivateObjects; foreach (GameObject val in toDisActivateObjects) { if (((val != null) ? ((Object)val).name : null) == "V2 Green Arm") { val.transform.Find("FleeingVoice").SetParent((Transform)null); } } } } [HarmonyPatch(typeof(Act2Strings))] internal class Act2StringsPatch : UltrakULLPatch { [HarmonyPatch("Level44")] [HarmonyPrefix] private static void Level44Prefix(ref string message) { if (message == "You get back here right this FUCKING INSTANT.") { message = "You're not getting away this time."; } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }