Decompiled source of ULTRASHIT v4.5.0

BepInEx/plugins/AudioLogger.dll

Decompiled 17 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AudioLogger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AudioLogger")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fc931212-4d45-4608-9f50-a49733f8c286")]
[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 AudioLoggerMod;

[BepInPlugin("com.yourname.audiologger", "Audio Logger", "1.0.1")]
public class AudioLoggerPlugin : BaseUnityPlugin
{
	private const string PluginGUID = "com.yourname.audiologger";

	private const string PluginName = "Audio Logger";

	private const string PluginVersion = "1.0.1";

	internal static ManualLogSource Log;

	private void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		Harmony val = new Harmony("com.yourname.audiologger");
		val.PatchAll();
		Log.LogInfo((object)"Plugin Audio Logger (versão 1.0.1) foi carregado e corrigido!");
	}
}
[HarmonyPatch(typeof(AudioSource))]
internal class AudioSourcePatch
{
	[HarmonyPatch("Play", new Type[] { })]
	[HarmonyPrefix]
	private static void PlayPrefix(AudioSource __instance)
	{
		if ((Object)(object)__instance.clip != (Object)null)
		{
			string name = ((Object)((Component)__instance).gameObject).name;
			AudioLoggerPlugin.Log.LogInfo((object)("[Play] Som '" + ((Object)__instance.clip).name + "' tocou no objeto '" + name + "'."));
		}
	}

	[HarmonyPatch("PlayOneShot", new Type[]
	{
		typeof(AudioClip),
		typeof(float)
	})]
	[HarmonyPrefix]
	private static void PlayOneShotPrefix(AudioSource __instance, AudioClip clip)
	{
		if ((Object)(object)clip != (Object)null)
		{
			string name = ((Object)((Component)__instance).gameObject).name;
			AudioLoggerPlugin.Log.LogInfo((object)("[PlayOneShot] Som '" + ((Object)clip).name + "' tocou no objeto '" + name + "'."));
		}
	}
}

BepInEx/plugins/ColorizedInk.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
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("ColorizedInk")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ColorizedInk")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c4949cca-4c4f-4b1b-9796-d93416b86105")]
[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 ColorizedInk;

[BepInPlugin("com.thehalfbunny.colorizedink", "ColorizedInk", "29.0.1")]
public class Plugin : BaseUnityPlugin
{
	public class ConfigData
	{
		public string Comentario { get; set; } = "Use 'Root' (nome exato) ou 'RootContains' (nome parcial) para definir os alvos.";


		public List<TargetProperty> TargetProperties { get; set; } = new List<TargetProperty>();

	}

	public class TargetProperty
	{
		public string Root { get; set; } = "";


		public string RootContains { get; set; } = "";


		public string Path { get; set; }

		public string PropertyName { get; set; }

		public object Value { get; set; }

		public string Comment { get; set; } = "";

	}

	private class CachedTarget
	{
		public Component Component;

		public string PropertyName;

		public object Value;

		public object OriginalValue;

		public TargetProperty SourceProperty;
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass21_0
	{
		public GameObject go;

		internal bool <DiscoveryCoroutine>b__3(TargetProperty p)
		{
			return ((Object)go).name == p.Root;
		}

		internal bool <DiscoveryCoroutine>b__4(TargetProperty p)
		{
			return ((Object)go).name.Contains(p.RootContains);
		}
	}

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

		private object <>2__current;

		public Plugin <>4__this;

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

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

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

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

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.25f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.ReloadConfiguration("Alteração no ficheiro detetada. Recarregando automaticamente...");
				return false;
			}
		}

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

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

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

		private object <>2__current;

		public Plugin <>4__this;

		private List<TargetProperty> <globalTargets>5__1;

		private List<TargetProperty> <exactNameTargets>5__2;

		private List<TargetProperty> <containsNameTargets>5__3;

		private List<TargetProperty>.Enumerator <>s__4;

		private TargetProperty <prop>5__5;

		private GameObject <foundObject>5__6;

		private GameObject[] <allGameObjects>5__7;

		private GameObject[] <>s__8;

		private int <>s__9;

		private <>c__DisplayClass21_0 <>8__10;

		private IEnumerable<TargetProperty> <matchingExactRules>5__11;

		private IEnumerable<TargetProperty> <matchingContainsRules>5__12;

		private IEnumerator<TargetProperty> <>s__13;

		private TargetProperty <prop>5__14;

		private IEnumerator<TargetProperty> <>s__15;

		private TargetProperty <prop>5__16;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<globalTargets>5__1 = null;
			<exactNameTargets>5__2 = null;
			<containsNameTargets>5__3 = null;
			<>s__4 = default(List<TargetProperty>.Enumerator);
			<prop>5__5 = null;
			<foundObject>5__6 = null;
			<allGameObjects>5__7 = null;
			<>s__8 = null;
			<>8__10 = null;
			<matchingExactRules>5__11 = null;
			<matchingContainsRules>5__12 = null;
			<>s__13 = null;
			<prop>5__14 = null;
			<>s__15 = null;
			<prop>5__16 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<globalTargets>5__1 = <>4__this.currentConfig.TargetProperties.Where((TargetProperty p) => string.IsNullOrEmpty(p.Root) && string.IsNullOrEmpty(p.RootContains)).ToList();
				<exactNameTargets>5__2 = <>4__this.currentConfig.TargetProperties.Where((TargetProperty p) => !string.IsNullOrEmpty(p.Root)).ToList();
				<containsNameTargets>5__3 = <>4__this.currentConfig.TargetProperties.Where((TargetProperty p) => !string.IsNullOrEmpty(p.RootContains)).ToList();
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			<>s__4 = <globalTargets>5__1.GetEnumerator();
			try
			{
				while (<>s__4.MoveNext())
				{
					<prop>5__5 = <>s__4.Current;
					<foundObject>5__6 = GameObject.Find(<prop>5__5.Path);
					if ((Object)(object)<foundObject>5__6 != (Object)null)
					{
						<>4__this.TryCacheComponent(<foundObject>5__6.transform, <prop>5__5);
					}
					<foundObject>5__6 = null;
					<prop>5__5 = null;
				}
			}
			finally
			{
				((IDisposable)<>s__4).Dispose();
			}
			<>s__4 = default(List<TargetProperty>.Enumerator);
			if (<exactNameTargets>5__2.Any() || <containsNameTargets>5__3.Any())
			{
				<allGameObjects>5__7 = Object.FindObjectsOfType<GameObject>();
				<>s__8 = <allGameObjects>5__7;
				for (<>s__9 = 0; <>s__9 < <>s__8.Length; <>s__9++)
				{
					<>8__10 = new <>c__DisplayClass21_0();
					<>8__10.go = <>s__8[<>s__9];
					<matchingExactRules>5__11 = <exactNameTargets>5__2.Where((TargetProperty p) => ((Object)<>8__10.go).name == p.Root);
					<>s__13 = <matchingExactRules>5__11.GetEnumerator();
					try
					{
						while (<>s__13.MoveNext())
						{
							<prop>5__14 = <>s__13.Current;
							<>4__this.FindAndCacheFromRoot(<>8__10.go, <prop>5__14);
							<prop>5__14 = null;
						}
					}
					finally
					{
						if (<>s__13 != null)
						{
							<>s__13.Dispose();
						}
					}
					<>s__13 = null;
					<matchingContainsRules>5__12 = <containsNameTargets>5__3.Where((TargetProperty p) => ((Object)<>8__10.go).name.Contains(p.RootContains));
					<>s__15 = <matchingContainsRules>5__12.GetEnumerator();
					try
					{
						while (<>s__15.MoveNext())
						{
							<prop>5__16 = <>s__15.Current;
							<>4__this.FindAndCacheFromRoot(<>8__10.go, <prop>5__16);
							<prop>5__16 = null;
						}
					}
					finally
					{
						if (<>s__15 != null)
						{
							<>s__15.Dispose();
						}
					}
					<>s__15 = null;
					<matchingExactRules>5__11 = null;
					<matchingContainsRules>5__12 = null;
					<>8__10 = null;
				}
				<>s__8 = null;
				<allGameObjects>5__7 = null;
			}
			<>2__current = (object)new WaitForSeconds(0.1f);
			<>1__state = 1;
			return true;
		}

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

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

	internal static ManualLogSource Log;

	private string configPath;

	private ConfigData currentConfig;

	private Coroutine discoveryCoroutine;

	private FileSystemWatcher configWatcher;

	private volatile bool needsReload = false;

	private readonly Dictionary<(Component, string), CachedTarget> activeTargets = new Dictionary<(Component, string), CachedTarget>();

	private void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		configPath = Path.Combine(Paths.ConfigPath, "ColorizedInk.json");
		SetupConfigWatcher();
		LoadConfig();
		Log.LogInfo((object)$"Plugin '{((BaseUnityPlugin)this).Info.Metadata.Name}' v{((BaseUnityPlugin)this).Info.Metadata.Version} ativado. Recarregamento automático está ativo.");
	}

	private void OnEnable()
	{
		SceneManager.sceneLoaded += OnSceneLoaded;
		if (configWatcher != null)
		{
			configWatcher.EnableRaisingEvents = true;
		}
		RestartDiscoveryCoroutine();
	}

	private void OnDisable()
	{
		SceneManager.sceneLoaded -= OnSceneLoaded;
		if (configWatcher != null)
		{
			configWatcher.EnableRaisingEvents = false;
			configWatcher.Dispose();
		}
		if (discoveryCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(discoveryCoroutine);
		}
		Log.LogInfo((object)"Plugin desativado. Revertendo todas as alterações...");
		RevertAllChanges();
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)287) || needsReload)
		{
			if (needsReload)
			{
				needsReload = false;
				((MonoBehaviour)this).StartCoroutine(DelayedReload());
			}
			else
			{
				ReloadConfiguration("Recarregamento manual (F6) iniciado...");
			}
		}
	}

	private void LateUpdate()
	{
		List<(Component, string)> list = null;
		foreach (KeyValuePair<(Component, string), CachedTarget> activeTarget in activeTargets)
		{
			CachedTarget value = activeTarget.Value;
			if ((Object)(object)value.Component == (Object)null)
			{
				if (list == null)
				{
					list = new List<(Component, string)>();
				}
				list.Add(activeTarget.Key);
			}
			else
			{
				ApplyProperty(value);
			}
		}
		if (list == null)
		{
			return;
		}
		foreach (var item in list)
		{
			activeTargets.Remove(item);
			Log.LogInfo((object)("Alvo para '" + item.Item2 + "' foi destruído. Removendo do cache ativo."));
		}
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		Log.LogInfo((object)("Cena '" + ((Scene)(ref scene)).name + "' carregada. Reiniciando configuração."));
		ReloadConfiguration("Nova cena carregada, reiniciando busca de alvos.");
	}

	private void LoadConfig()
	{
		if (configWatcher != null)
		{
			configWatcher.EnableRaisingEvents = false;
		}
		try
		{
			if (!File.Exists(configPath))
			{
				Log.LogWarning((object)"Arquivo de configuração não encontrado. Criando um novo com valores padrão.");
				currentConfig = CreateDefaultConfig();
				File.WriteAllText(configPath, JsonConvert.SerializeObject((object)currentConfig, (Formatting)1));
			}
			else
			{
				string text = File.ReadAllText(configPath);
				currentConfig = JsonConvert.DeserializeObject<ConfigData>(text);
			}
		}
		catch (Exception ex)
		{
			Log.LogError((object)("Erro ao ler ou criar o arquivo de configuração: " + ex.Message));
			currentConfig = CreateDefaultConfig();
		}
		finally
		{
			if (configWatcher != null)
			{
				configWatcher.EnableRaisingEvents = true;
			}
		}
	}

	private ConfigData CreateDefaultConfig()
	{
		return new ConfigData
		{
			TargetProperties = new List<TargetProperty>
			{
				new TargetProperty
				{
					RootContains = "MinosPrime",
					Path = "Point Light",
					PropertyName = "color",
					Value = new
					{
						r = 1f,
						g = 0.2f,
						b = 0.8f,
						a = 1f
					},
					Comment = "Cor da luz de qualquer objeto que contenha 'MinosPrime' no nome. Propriedade 'color'."
				},
				new TargetProperty
				{
					RootContains = "MinosPrimeAttackTrail",
					Path = "",
					PropertyName = "color",
					Value = new
					{
						r = 1f,
						g = 0.2f,
						b = 0.8f,
						a = 1f
					},
					Comment = "Exemplo para TrailRenderer."
				}
			}
		};
	}

	private void SetupConfigWatcher()
	{
		configWatcher = new FileSystemWatcher(Paths.ConfigPath, Path.GetFileName(configPath))
		{
			NotifyFilter = (NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite),
			EnableRaisingEvents = true
		};
		configWatcher.Changed += delegate
		{
			needsReload = true;
		};
		configWatcher.Created += delegate
		{
			needsReload = true;
		};
		configWatcher.Deleted += delegate
		{
			needsReload = true;
		};
		configWatcher.Renamed += delegate
		{
			needsReload = true;
		};
	}

	[IteratorStateMachine(typeof(<DelayedReload>d__19))]
	private IEnumerator DelayedReload()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DelayedReload>d__19(0)
		{
			<>4__this = this
		};
	}

	private void RestartDiscoveryCoroutine()
	{
		if (discoveryCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(discoveryCoroutine);
		}
		discoveryCoroutine = ((MonoBehaviour)this).StartCoroutine(DiscoveryCoroutine());
	}

	[IteratorStateMachine(typeof(<DiscoveryCoroutine>d__21))]
	private IEnumerator DiscoveryCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DiscoveryCoroutine>d__21(0)
		{
			<>4__this = this
		};
	}

	private void FindAndCacheFromRoot(GameObject root, TargetProperty prop)
	{
		Transform val = (string.IsNullOrEmpty(prop.Path) ? root.transform : root.transform.Find(prop.Path));
		if ((Object)(object)val != (Object)null)
		{
			TryCacheComponent(val, prop);
		}
	}

	private void TryCacheComponent(Transform targetTransform, TargetProperty prop)
	{
		var (val, obj) = GetTargetComponentAndValue(targetTransform, prop);
		if ((Object)(object)val == (Object)null || obj == null)
		{
			return;
		}
		(Component, string) key = (val, prop.PropertyName);
		if (!activeTargets.ContainsKey(key))
		{
			object obj2 = ParseValue(prop.Value, obj.GetType());
			if (obj2 == null)
			{
				Log.LogWarning((object)("Não foi possível converter o valor para o alvo '" + prop.Path + "' com a propriedade '" + prop.PropertyName + "'."));
				return;
			}
			CachedTarget value = new CachedTarget
			{
				Component = val,
				PropertyName = prop.PropertyName,
				Value = obj2,
				OriginalValue = obj,
				SourceProperty = prop
			};
			activeTargets[key] = value;
			Log.LogInfo((object)("--> Alvo '" + prop.Root + prop.RootContains + "/" + prop.Path + "' ('" + prop.PropertyName + "') cacheado com sucesso."));
		}
	}

	private void ReloadConfiguration(string message)
	{
		Log.LogInfo((object)message);
		RevertAllChanges();
		LoadConfig();
		RestartDiscoveryCoroutine();
		Log.LogInfo((object)"Configuração recarregada e busca por alvos reiniciada.");
	}

	private void RevertAllChanges()
	{
		foreach (CachedTarget value in activeTargets.Values)
		{
			if ((Object)(object)value.Component != (Object)null)
			{
				RevertProperty(value);
			}
		}
		activeTargets.Clear();
		Log.LogInfo((object)"Todas as alterações ativas foram revertidas.");
	}

	private void ApplyProperty(CachedTarget target)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		Component component = target.Component;
		Component val = component;
		TrailRenderer val2 = (TrailRenderer)(object)((val is TrailRenderer) ? val : null);
		object value;
		if (val2 == null)
		{
			Renderer val3 = (Renderer)(object)((val is Renderer) ? val : null);
			if (val3 == null)
			{
				Light val4 = (Light)(object)((val is Light) ? val : null);
				if (val4 == null)
				{
					ParticleSystem val5 = (ParticleSystem)(object)((val is ParticleSystem) ? val : null);
					if (val5 != null)
					{
						MainModule main = val5.main;
						((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit((Color)target.Value);
					}
				}
				else if (target.PropertyName.Equals("color", StringComparison.OrdinalIgnoreCase))
				{
					val4.color = (Color)target.Value;
				}
				else if (target.PropertyName.Equals("intensity", StringComparison.OrdinalIgnoreCase))
				{
					val4.intensity = (float)target.Value;
				}
			}
			else
			{
				if ((Object)(object)val3.material == (Object)null)
				{
					return;
				}
				if (target.Value is Color val6)
				{
					val3.material.SetColor(target.PropertyName, val6);
					return;
				}
				value = target.Value;
				if (value is float)
				{
					float num = (float)value;
					if (true)
					{
						val3.material.SetFloat(target.PropertyName, num);
					}
				}
			}
			return;
		}
		value = target.Value;
		if (value is Color)
		{
			Color val7 = (Color)value;
			if (true)
			{
				val2.startColor = val7;
				val2.endColor = val7;
			}
		}
	}

	private void RevertProperty(CachedTarget target)
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Component component = target.Component;
			Component val = component;
			TrailRenderer val2 = (TrailRenderer)(object)((val is TrailRenderer) ? val : null);
			object originalValue;
			if (val2 == null)
			{
				Renderer val3 = (Renderer)(object)((val is Renderer) ? val : null);
				if (val3 == null)
				{
					Light val4 = (Light)(object)((val is Light) ? val : null);
					if (val4 == null)
					{
						ParticleSystem val5 = (ParticleSystem)(object)((val is ParticleSystem) ? val : null);
						if (val5 != null)
						{
							MainModule main = val5.main;
							((MainModule)(ref main)).startColor = (MinMaxGradient)target.OriginalValue;
						}
					}
					else if (target.PropertyName.Equals("color", StringComparison.OrdinalIgnoreCase))
					{
						val4.color = (Color)target.OriginalValue;
					}
					else if (target.PropertyName.Equals("intensity", StringComparison.OrdinalIgnoreCase))
					{
						val4.intensity = (float)target.OriginalValue;
					}
				}
				else
				{
					if ((Object)(object)val3.material == (Object)null)
					{
						return;
					}
					if (target.OriginalValue is Color val6)
					{
						val3.material.SetColor(target.PropertyName, val6);
						return;
					}
					originalValue = target.OriginalValue;
					if (originalValue is float)
					{
						float num = (float)originalValue;
						if (true)
						{
							val3.material.SetFloat(target.PropertyName, num);
						}
					}
				}
				return;
			}
			originalValue = target.OriginalValue;
			if (originalValue is ValueTuple<Color, Color>)
			{
				(Color, Color) tuple = ((Color, Color))originalValue;
				if (true)
				{
					val2.startColor = tuple.Item1;
					val2.endColor = tuple.Item2;
				}
			}
		}
		catch (Exception ex)
		{
			Log.LogError((object)("Falha ao reverter propriedade para '" + target.SourceProperty.Path + "': " + ex.Message));
		}
	}

	private (Component, object) GetTargetComponentAndValue(Transform targetTransform, TargetProperty prop)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		string text = prop.PropertyName.ToLower();
		Light val = default(Light);
		if (((Component)targetTransform).TryGetComponent<Light>(ref val))
		{
			if (text == "color")
			{
				return ((Component)(object)val, val.color);
			}
			if (text == "intensity")
			{
				return ((Component)(object)val, val.intensity);
			}
		}
		ParticleSystem val2 = default(ParticleSystem);
		if (((Component)targetTransform).TryGetComponent<ParticleSystem>(ref val2) && text.Contains("color"))
		{
			ParticleSystem item = val2;
			MainModule main = val2.main;
			return ((Component)(object)item, ((MainModule)(ref main)).startColor);
		}
		TrailRenderer val3 = default(TrailRenderer);
		if (((Component)targetTransform).TryGetComponent<TrailRenderer>(ref val3) && text.Contains("color"))
		{
			return ((Component)(object)val3, (val3.startColor, val3.endColor));
		}
		Renderer val4 = default(Renderer);
		if (((Component)targetTransform).TryGetComponent<Renderer>(ref val4) && (Object)(object)val4.material != (Object)null && val4.material.HasProperty(prop.PropertyName))
		{
			if (prop.Value is JObject || prop.Value is Color)
			{
				return ((Component)(object)val4, val4.material.GetColor(prop.PropertyName));
			}
			return ((Component)(object)val4, val4.material.GetFloat(prop.PropertyName));
		}
		return (null, null);
	}

	private object ParseValue(object valueFromConfig, Type originalType)
	{
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		JObject val = (JObject)((valueFromConfig is JObject) ? valueFromConfig : null);
		if (val != null)
		{
			JToken obj = val["r"];
			float num = ((obj != null) ? Extensions.Value<float>((IEnumerable<JToken>)obj) : 0f);
			JToken obj2 = val["g"];
			float num2 = ((obj2 != null) ? Extensions.Value<float>((IEnumerable<JToken>)obj2) : 0f);
			JToken obj3 = val["b"];
			float num3 = ((obj3 != null) ? Extensions.Value<float>((IEnumerable<JToken>)obj3) : 0f);
			JToken obj4 = val["a"];
			return (object)new Color(num, num2, num3, (obj4 != null) ? Extensions.Value<float>((IEnumerable<JToken>)obj4) : 1f);
		}
		try
		{
			if (originalType.IsGenericType && originalType.GetGenericTypeDefinition() == typeof(ValueTuple<, >))
			{
				return null;
			}
			return Convert.ChangeType(valueFromConfig, originalType);
		}
		catch
		{
			try
			{
				return Convert.ToSingle(valueFromConfig);
			}
			catch
			{
				return null;
			}
		}
	}
}

BepInEx/plugins/DeathMessages.dll

Decompiled 17 hours ago
using 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 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.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/TextureToolbox.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Concurrent;
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 BepInEx;
using HarmonyLib;
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("TextureToolbox")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TextureToolbox")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b493dcfd-39c7-4373-bd10-db202667e149")]
[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 TextureToolbox;

[BepInPlugin("com.thehalfbunny.TextureToolbox", "TextureToolbox", "1.2.0")]
public class Plugin : BaseUnityPlugin
{
	public const string MODNAME = "TextureToolbox";

	public const string AUTHOR = "TheHalfBunny";

	public const string GUID = "com.thehalfbunny.TextureToolbox";

	public const string VERSION = "1.2.0";

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"[TextureToolbox] Plugin is loaded!");
		TextureToolbox.Setup();
	}
}
public class TextureToolbox : MonoBehaviour
{
	public class SelectableTextureSet
	{
		public string Name { get; }

		public Dictionary<string, string> Items { get; }

		public SelectableTextureSet(string name)
		{
			Name = name;
			Items = new Dictionary<string, string>();
		}
	}

	[HarmonyPatch("Anima2D.SpriteMeshInstance", "get_spriteTexture")]
	public class SpriteMeshInstance_get_spriteTexture_Patch
	{
		private static bool Prepare()
		{
			return AccessTools.TypeByName("Anima2D.SpriteMeshInstance") != null;
		}

		[HarmonyPostfix]
		public static void Postfix(ref Texture2D __result)
		{
			if ((Object)(object)__result != (Object)null)
			{
				ReplaceTextureIfNeeded(__result);
			}
		}
	}

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

		private object <>2__current;

		public TextureToolbox <>4__this;

		private string <sceneDumpPath>5__1;

		private int <dumpedCount>5__2;

		private int <i>5__3;

		private Texture2D <tex>5__4;

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

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

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

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

		private bool MoveNext()
		{
			int num = <>1__state;
			if (num != 0)
			{
				if (num != 1)
				{
					return false;
				}
				<>1__state = -1;
				goto IL_0149;
			}
			<>1__state = -1;
			Debug.Log((object)"[TextureToolbox] Iniciando exportação de texturas da cena...");
			<>4__this.RefreshSceneTextures();
			<sceneDumpPath>5__1 = Path.Combine(ImagesDumpPath, <>4__this.GetCurrentSceneName());
			Directory.CreateDirectory(<sceneDumpPath>5__1);
			<dumpedCount>5__2 = 0;
			<i>5__3 = 0;
			goto IL_0161;
			IL_0149:
			<tex>5__4 = null;
			<i>5__3++;
			goto IL_0161;
			IL_0161:
			if (<i>5__3 < sceneTextures.Length)
			{
				<tex>5__4 = sceneTextures[<i>5__3];
				if ((Object)(object)<tex>5__4 != (Object)null && ((Texture)<tex>5__4).width > 16 && ((Texture)<tex>5__4).height > 16 && <>4__this.DumpTexture(<tex>5__4, <sceneDumpPath>5__1))
				{
					<dumpedCount>5__2++;
				}
				if (<i>5__3 % 20 == 0)
				{
					toastMessage = $"Exportando... {<i>5__3}/{sceneTextures.Length}";
					toastStartTime = DateTime.Now;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				goto IL_0149;
			}
			toastMessage = $"Exportação concluída! {<dumpedCount>5__2} novas texturas salvas em '{<sceneDumpPath>5__1}'.";
			toastStartTime = DateTime.Now;
			return false;
		}

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

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

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

		private object <>2__current;

		public TextureToolbox <>4__this;

		private string <currentSceneId>5__1;

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

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

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

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

		private bool MoveNext()
		{
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				goto IL_0194;
			case 1:
				<>1__state = -1;
				goto IL_0194;
			case 2:
				<>1__state = -1;
				isDumping = false;
				isProcessing = false;
				break;
			case 3:
				{
					<>1__state = -1;
					<currentSceneId>5__1 = null;
					goto IL_0194;
				}
				IL_0194:
				if (isProcessing)
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				if (needsToClearCheckedIDs)
				{
					checkedInstanceIDs.Clear();
					needsToClearCheckedIDs = false;
				}
				<currentSceneId>5__1 = <>4__this.GetCurrentSceneName();
				if (lastSceneId != <currentSceneId>5__1)
				{
					<>4__this.ResetForNewScene(<currentSceneId>5__1);
				}
				if (isDumping)
				{
					isProcessing = true;
					<>2__current = <>4__this.DumpAllSceneTexturesCoroutine();
					<>1__state = 2;
					return true;
				}
				break;
			}
			if (!isAnima2DHooked)
			{
				if (!nextCheckTime.HasValue || DateTime.Now > nextCheckTime.Value)
				{
					<>4__this.RefreshSceneTextures();
				}
				if (currentTextureIndex >= 0 && currentTextureIndex < sceneTextures.Length)
				{
					<>4__this.ProcessSceneTextures();
				}
			}
			<>2__current = (object)new WaitForSeconds(0.1f);
			<>1__state = 3;
			return true;
		}

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

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

	private static readonly string CustomImagesPathName = "CustomImages";

	private static readonly string DumpedImagesPathName = "DumpedImages";

	private static readonly string SelectFolderName = "select";

	private static Dictionary<string, string> replacementImagePaths = new Dictionary<string, string>();

	private static Dictionary<int, string> checkedInstanceIDs = new Dictionary<int, string>();

	private static List<SelectableTextureSet> selectableTextureSets = new List<SelectableTextureSet>();

	private static int currentTextureSetIndex = -1;

	private static bool needsToClearCheckedIDs = false;

	private static bool isDumping = false;

	private static bool isProcessing = false;

	private static bool isAnima2DHooked = false;

	private static string toastMessage = "";

	private static DateTime? toastStartTime = null;

	private static readonly ConcurrentQueue<Action> mainThreadActions = new ConcurrentQueue<Action>();

	private static FileSystemWatcher watcher;

	private static bool isSceneManagerSupported = false;

	private static string lastSceneId = string.Empty;

	private static int lastTextureCountInScene = 0;

	private static DateTime? nextCheckTime = null;

	private static readonly TimeSpan checkInterval = new TimeSpan(0, 0, 2);

	private static Texture2D[] sceneTextures = (Texture2D[])(object)new Texture2D[0];

	private static int currentTextureIndex = -1;

	public static TextureToolbox Instance { get; private set; }

	public static string ImagesPath { get; private set; } = "";


	public static string ImagesDumpPath { get; private set; } = "";


	public static void Setup()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		GameObject val = new GameObject("TextureToolbox_Manager");
		Object.DontDestroyOnLoad((Object)(object)val);
		((Object)val).hideFlags = (HideFlags)61;
		try
		{
			Instance = val.AddComponent<TextureToolbox>();
			ImagesPath = Path.Combine(Paths.PluginPath, CustomImagesPathName);
			ImagesDumpPath = Path.Combine(Paths.PluginPath, DumpedImagesPathName);
			Directory.CreateDirectory(ImagesPath);
			Directory.CreateDirectory(ImagesDumpPath);
			LoadImageFiles();
			Debug.Log((object)"[TextureToolbox] Pressione F11 para exportar as texturas da cena.");
			Debug.Log((object)"[TextureToolbox] Pressione F10 para recarregar as texturas dos arquivos.");
			if (currentTextureSetIndex > -1)
			{
				Debug.Log((object)"[TextureToolbox] Pressione F12 para alternar entre os conjuntos de texturas.");
			}
			SetupFileSystemWatcher();
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[TextureToolbox] Erro na inicialização: " + ex.Message));
		}
	}

	private void Start()
	{
		try
		{
			if (AccessTools.Method(typeof(SceneManager), "GetActiveScene", (Type[])null, (Type[])null) != null)
			{
				isSceneManagerSupported = true;
			}
		}
		catch
		{
		}
		((MonoBehaviour)this).StartCoroutine(MainLoopCoroutine());
		PatchAnima2D();
	}

	private static void SetupFileSystemWatcher()
	{
		watcher = new FileSystemWatcher
		{
			Path = ImagesPath,
			NotifyFilter = (NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite),
			Filter = "*.png",
			IncludeSubdirectories = true,
			EnableRaisingEvents = true
		};
		watcher.Changed += OnFileChanged;
		watcher.Created += OnFileChanged;
		watcher.Deleted += OnFileChanged;
		watcher.Renamed += OnFileRenamed;
	}

	private void PatchAnima2D()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Expected O, but got Unknown
		try
		{
			Type type = AccessTools.TypeByName("Anima2D.SpriteMeshInstance");
			if (type == null)
			{
				Debug.Log((object)"[TextureToolbox] Anima2D não detectado. O patch para SpriteMeshInstance será ignorado.");
				return;
			}
			Harmony val = new Harmony("com.thehalfbunny.TextureToolbox");
			MethodInfo methodInfo = AccessTools.PropertyGetter(type, "spriteTexture");
			MethodInfo methodInfo2 = AccessTools.Method(typeof(SpriteMeshInstance_get_spriteTexture_Patch), "Postfix", (Type[])null, (Type[])null);
			if (methodInfo != null && methodInfo2 != null)
			{
				val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				isAnima2DHooked = true;
				Debug.Log((object)"[TextureToolbox] Patch para Anima2D aplicado com sucesso.");
			}
			else
			{
				Debug.LogWarning((object)"[TextureToolbox] Não foi possível aplicar o patch no Anima2D: método 'get_spriteTexture' não encontrado.");
			}
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[TextureToolbox] Falha ao aplicar o patch no Anima2D: " + ex.Message));
		}
	}

	private static void LoadImageFiles()
	{
		try
		{
			replacementImagePaths.Clear();
			selectableTextureSets.Clear();
			string[] files = Directory.GetFiles(ImagesPath, "*.png", SearchOption.AllDirectories);
			Array.Sort(files);
			string[] array = files;
			foreach (string text in array)
			{
				string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(text);
				if (!fileNameWithoutExtension.EndsWith("_"))
				{
					continue;
				}
				string text2 = fileNameWithoutExtension.Remove(fileNameWithoutExtension.Length - 1);
				string[] pathParts = text.Split(new char[1] { Path.DirectorySeparatorChar });
				string selectSetName = GetSelectSetNameFromPath(pathParts);
				if (string.IsNullOrEmpty(selectSetName))
				{
					if (replacementImagePaths.ContainsKey(text2))
					{
						Debug.LogWarning((object)("[TextureToolbox] Chave de imagem duplicada encontrada (será ignorada): " + text2));
					}
					else
					{
						replacementImagePaths[text2] = text;
					}
					continue;
				}
				SelectableTextureSet selectableTextureSet = selectableTextureSets.FirstOrDefault((SelectableTextureSet s) => s.Name == selectSetName);
				if (selectableTextureSet == null)
				{
					selectableTextureSet = new SelectableTextureSet(selectSetName);
					selectableTextureSets.Add(selectableTextureSet);
				}
				selectableTextureSet.Items[text2] = text;
			}
			Debug.Log((object)$"[TextureToolbox] {replacementImagePaths.Count} chaves de substituição carregadas.");
			Debug.Log((object)$"[TextureToolbox] {selectableTextureSets.Count} conjuntos de texturas selecionáveis carregados.");
			if (selectableTextureSets.Any())
			{
				currentTextureSetIndex = 0;
				ApplyTextureSet(currentTextureSetIndex);
			}
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[TextureToolbox] Erro ao carregar imagens: " + ex.Message));
		}
	}

	private static void ApplyTextureSet(int index)
	{
		if (index < 0 || index >= selectableTextureSets.Count)
		{
			return;
		}
		isProcessing = true;
		SelectableTextureSet selectableTextureSet = selectableTextureSets[index];
		foreach (KeyValuePair<string, string> item in selectableTextureSet.Items)
		{
			replacementImagePaths[item.Key] = item.Value;
		}
		needsToClearCheckedIDs = true;
		isProcessing = false;
		toastMessage = "Conjunto de texturas alterado para: " + selectableTextureSet.Name;
		toastStartTime = DateTime.Now;
	}

	private void Update()
	{
		Action result;
		while (mainThreadActions.TryDequeue(out result))
		{
			result?.Invoke();
		}
	}

	[IteratorStateMachine(typeof(<MainLoopCoroutine>d__41))]
	private IEnumerator MainLoopCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <MainLoopCoroutine>d__41(0)
		{
			<>4__this = this
		};
	}

	private void ProcessSceneTextures()
	{
		isProcessing = true;
		int num = 0;
		while (num < 100 && currentTextureIndex < sceneTextures.Length)
		{
			Texture2D val = sceneTextures[currentTextureIndex];
			if ((Object)(object)val != (Object)null)
			{
				ReplaceTextureIfNeeded(val);
			}
			num++;
			currentTextureIndex++;
		}
		if (currentTextureIndex >= sceneTextures.Length)
		{
			currentTextureIndex = -1;
		}
		isProcessing = false;
	}

	public static void ReplaceTextureIfNeeded(Texture2D texture)
	{
		if ((Object)(object)texture == (Object)null || ((Texture)texture).width <= 16 || ((Texture)texture).height <= 16)
		{
			return;
		}
		int instanceID = ((Object)texture).GetInstanceID();
		if (checkedInstanceIDs.ContainsKey(instanceID))
		{
			return;
		}
		string text = SanitizeFileName(((Object)texture).name);
		if (!string.IsNullOrEmpty(text))
		{
			checkedInstanceIDs[instanceID] = text;
			if (replacementImagePaths.TryGetValue(text, out var value))
			{
				LoadImageIntoTexture(texture, value);
				Debug.Log((object)("[TextureToolbox] Textura '" + text + "' substituída."));
			}
		}
	}

	[IteratorStateMachine(typeof(<DumpAllSceneTexturesCoroutine>d__44))]
	private IEnumerator DumpAllSceneTexturesCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DumpAllSceneTexturesCoroutine>d__44(0)
		{
			<>4__this = this
		};
	}

	private bool DumpTexture(Texture2D texture, string dumpPath)
	{
		try
		{
			string text = SanitizeFileName(((Object)texture).name);
			string path = text + ".png";
			string path2 = Path.Combine(dumpPath, path);
			if (File.Exists(path2))
			{
				return false;
			}
			byte[] array = EncodeToPNG(texture);
			if (array.Length != 0)
			{
				File.WriteAllBytes(path2, array);
				return true;
			}
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[TextureToolbox] Falha ao exportar a textura '" + ((Object)texture).name + "': " + ex.Message));
		}
		return false;
	}

	public static byte[] EncodeToPNG(Texture2D source)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		if (((Texture)source).isReadable)
		{
			return ImageConversion.EncodeToPNG(source);
		}
		RenderTexture val = null;
		try
		{
			val = RenderTexture.GetTemporary(((Texture)source).width, ((Texture)source).height, 0, (RenderTextureFormat)7, (RenderTextureReadWrite)1);
			Graphics.Blit((Texture)(object)source, val);
			RenderTexture active = RenderTexture.active;
			RenderTexture.active = val;
			Texture2D val2 = new Texture2D(((Texture)source).width, ((Texture)source).height);
			val2.ReadPixels(new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), 0, 0);
			val2.Apply();
			RenderTexture.active = active;
			return ImageConversion.EncodeToPNG(val2);
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[TextureToolbox] Erro ao codificar textura não legível para PNG: " + ex.Message));
			return new byte[0];
		}
		finally
		{
			if ((Object)(object)val != (Object)null)
			{
				RenderTexture.ReleaseTemporary(val);
			}
		}
	}

	private static void LoadImageIntoTexture(Texture2D texture, string path)
	{
		if ((Object)(object)texture != (Object)null && File.Exists(path))
		{
			byte[] array = File.ReadAllBytes(path);
			ImageConversion.LoadImage(texture, array);
		}
	}

	private static string GetSelectSetNameFromPath(string[] pathParts)
	{
		for (int i = 0; i < pathParts.Length - 2; i++)
		{
			if (pathParts[i].Equals(SelectFolderName, StringComparison.OrdinalIgnoreCase))
			{
				return pathParts[i + 1];
			}
		}
		return string.Empty;
	}

	private static string SanitizeFileName(string fileName)
	{
		return Path.GetInvalidFileNameChars().Aggregate(fileName, (string current, char c) => current.Replace(c, '_'));
	}

	private void OnGUI()
	{
		HandleInput();
		if (toastStartTime.HasValue)
		{
			DrawToastMessage();
		}
	}

	private void HandleInput()
	{
		if (Input.GetKeyDown((KeyCode)292))
		{
			isDumping = true;
			toastMessage = "Iniciando exportação de texturas...";
			toastStartTime = DateTime.Now;
		}
		if (Input.GetKeyDown((KeyCode)291))
		{
			if (isProcessing)
			{
				toastMessage = "Processando, por favor aguarde...";
			}
			else
			{
				Debug.Log((object)"[TextureToolbox] Recarregando texturas dos arquivos...");
				LoadImageFiles();
				needsToClearCheckedIDs = true;
				toastMessage = "Texturas recarregadas!";
			}
			toastStartTime = DateTime.Now;
		}
		if (selectableTextureSets.Any() && Input.GetKeyDown((KeyCode)293))
		{
			if (isProcessing)
			{
				toastMessage = "Processando, por favor aguarde...";
			}
			else
			{
				currentTextureSetIndex = (currentTextureSetIndex + 1) % selectableTextureSets.Count;
				ApplyTextureSet(currentTextureSetIndex);
			}
			toastStartTime = DateTime.Now;
		}
	}

	private static void OnFileChanged(object sender, FileSystemEventArgs e)
	{
		mainThreadActions.Enqueue(delegate
		{
			Debug.Log((object)("[TextureToolbox] Arquivo alterado: " + e.FullPath + ". Recarregando imagens."));
			LoadImageFiles();
			needsToClearCheckedIDs = true;
		});
	}

	private static void OnFileRenamed(object sender, RenamedEventArgs e)
	{
		mainThreadActions.Enqueue(delegate
		{
			Debug.Log((object)("[TextureToolbox] Arquivo renomeado: " + e.OldFullPath + " -> " + e.FullPath + ". Recarregando imagens."));
			LoadImageFiles();
			needsToClearCheckedIDs = true;
		});
	}

	private void ResetForNewScene(string newSceneId)
	{
		lastSceneId = newSceneId;
		needsToClearCheckedIDs = true;
		nextCheckTime = null;
		currentTextureIndex = -1;
		RefreshSceneTextures();
	}

	private void RefreshSceneTextures()
	{
		sceneTextures = Resources.FindObjectsOfTypeAll<Texture2D>();
		lastTextureCountInScene = sceneTextures.Length;
		currentTextureIndex = 0;
		nextCheckTime = DateTime.Now + checkInterval;
	}

	private string GetCurrentSceneName()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		if (isSceneManagerSupported)
		{
			Scene activeScene = SceneManager.GetActiveScene();
			return SanitizeFileName(((Scene)(ref activeScene)).name);
		}
		return SanitizeFileName(Application.loadedLevelName);
	}

	private void DrawToastMessage()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		if (toastStartTime.HasValue)
		{
			GUIStyle val = new GUIStyle(GUI.skin.box)
			{
				fontSize = 16,
				alignment = (TextAnchor)4
			};
			val.normal.textColor = Color.white;
			GUIStyle val2 = val;
			GUI.backgroundColor = new Color(0f, 0f, 0f, 0.7f);
			GUI.Box(new Rect(10f, 10f, (float)(Screen.width - 20), 40f), toastMessage, val2);
			if (DateTime.Now - toastStartTime.Value > TimeSpan.FromSeconds(3.0))
			{
				toastStartTime = null;
			}
		}
	}
}

BepInEx/plugins/UKV1Voice/V1.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
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("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")]
namespace EnemyTaunter;

[BepInPlugin("com.thehalfbunny.enemytaunter", "EnemyTaunter", "2.0.0")]
public class VoiceModPlugin : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <LoadAllSoundsCoroutine>d__11 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public VoiceModPlugin <>4__this;

		private string <pluginFolder>5__1;

		private string <soundsRoot>5__2;

		private string <defaultPath>5__3;

		private string <exclusiveRoot>5__4;

		private string[] <>s__5;

		private int <>s__6;

		private string <file>5__7;

		private string[] <>s__8;

		private int <>s__9;

		private string <dir>5__10;

		private string <enemyKey>5__11;

		private string[] <>s__12;

		private int <>s__13;

		private string <file>5__14;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<pluginFolder>5__1 = null;
			<soundsRoot>5__2 = null;
			<defaultPath>5__3 = null;
			<exclusiveRoot>5__4 = null;
			<>s__5 = null;
			<file>5__7 = null;
			<>s__8 = null;
			<dir>5__10 = null;
			<enemyKey>5__11 = null;
			<>s__12 = null;
			<file>5__14 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<pluginFolder>5__1 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
				<soundsRoot>5__2 = Path.Combine(<pluginFolder>5__1, "sounds");
				<defaultPath>5__3 = Path.Combine(<soundsRoot>5__2, "default");
				<exclusiveRoot>5__4 = Path.Combine(<soundsRoot>5__2, "exclusive");
				if (Directory.Exists(<defaultPath>5__3))
				{
					((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"Loading default sounds...");
					<>s__5 = Directory.GetFiles(<defaultPath>5__3, "*.wav");
					<>s__6 = 0;
					goto IL_0132;
				}
				((BaseUnityPlugin)<>4__this).Logger.LogWarning((object)"No 'default' sounds folder found in 'sounds/default'");
				goto IL_0164;
			case 1:
				<>1__state = -1;
				<file>5__7 = null;
				<>s__6++;
				goto IL_0132;
			case 2:
				{
					<>1__state = -1;
					<file>5__14 = null;
					<>s__13++;
					goto IL_0298;
				}
				IL_0164:
				if (Directory.Exists(<exclusiveRoot>5__4))
				{
					((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"Loading exclusive sounds...");
					<>s__8 = Directory.GetDirectories(<exclusiveRoot>5__4);
					<>s__9 = 0;
					goto IL_02cc;
				}
				((BaseUnityPlugin)<>4__this).Logger.LogWarning((object)"No 'exclusive' sounds folder found in 'sounds/exclusive'");
				break;
				IL_0132:
				if (<>s__6 < <>s__5.Length)
				{
					<file>5__7 = <>s__5[<>s__6];
					<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.LoadClipCoroutine(<file>5__7, DefaultKillSounds));
					<>1__state = 1;
					return true;
				}
				<>s__5 = null;
				goto IL_0164;
				IL_02cc:
				if (<>s__9 < <>s__8.Length)
				{
					<dir>5__10 = <>s__8[<>s__9];
					<enemyKey>5__11 = Path.GetFileName(<dir>5__10).ToLower();
					ExclusiveKillSounds[<enemyKey>5__11] = new List<AudioClip>();
					((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)("Found exclusive folder for enemy: " + <enemyKey>5__11));
					<>s__12 = Directory.GetFiles(<dir>5__10, "*.wav");
					<>s__13 = 0;
					goto IL_0298;
				}
				<>s__8 = null;
				break;
				IL_0298:
				if (<>s__13 < <>s__12.Length)
				{
					<file>5__14 = <>s__12[<>s__13];
					<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.LoadClipCoroutine(<file>5__14, ExclusiveKillSounds[<enemyKey>5__11]));
					<>1__state = 2;
					return true;
				}
				<>s__12 = null;
				<enemyKey>5__11 = null;
				<dir>5__10 = null;
				<>s__9++;
				goto IL_02cc;
			}
			((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"Finished loading all sounds.");
			return false;
		}

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

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

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

		private object <>2__current;

		public string filePath;

		public List<AudioClip> targetList;

		public VoiceModPlugin <>4__this;

		private UnityWebRequest <www>5__1;

		private AudioClip <clip>5__2;

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

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

		[DebuggerHidden]
		public <LoadClipCoroutine>d__12(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();
				}
			}
			<www>5__1 = null;
			<clip>5__2 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Invalid comparison between Unknown and I4
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<www>5__1 = UnityWebRequestMultimedia.GetAudioClip("file://" + filePath, (AudioType)20);
					<>1__state = -3;
					<>2__current = <www>5__1.SendWebRequest();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -3;
					if ((int)<www>5__1.result == 1)
					{
						<clip>5__2 = DownloadHandlerAudioClip.GetContent(<www>5__1);
						if ((Object)(object)<clip>5__2 != (Object)null)
						{
							((Object)<clip>5__2).name = Path.GetFileNameWithoutExtension(filePath);
							targetList.Add(<clip>5__2);
						}
						<clip>5__2 = null;
					}
					else
					{
						((BaseUnityPlugin)<>4__this).Logger.LogError((object)("Failed to load audio clip at path: " + filePath + "\nError: " + <www>5__1.error));
					}
					<>m__Finally1();
					<www>5__1 = 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__1 != null)
			{
				((IDisposable)<www>5__1).Dispose();
			}
		}

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

	internal static readonly List<AudioClip> DefaultKillSounds = new List<AudioClip>();

	internal static readonly Dictionary<string, List<AudioClip>> ExclusiveKillSounds = new Dictionary<string, List<AudioClip>>();

	public static ConfigEntry<float> Volume;

	public static ConfigEntry<int> Chance;

	public static ConfigEntry<bool> EnableExclusiveChance;

	public static ConfigEntry<int> ExclusiveChance;

	public static VoiceModPlugin Instance { get; private set; }

	private void Awake()
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Expected O, but got Unknown
		Instance = this;
		Volume = ((BaseUnityPlugin)this).Config.Bind<float>("1. Geral", "Volume", 1f, "Volume das vozes (de 0.0 a 1.0)");
		Chance = ((BaseUnityPlugin)this).Config.Bind<int>("1. Geral", "Chance", 1, "Chance de tocar uma voz (ex: 4 = 1/4 de chance, 1 = sempre)");
		EnableExclusiveChance = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Exclusivo", "Ativar Chance Exclusiva", false, "Se ativado, usa a chance abaixo para sons exclusivos de inimigos.");
		ExclusiveChance = ((BaseUnityPlugin)this).Config.Bind<int>("2. Exclusivo", "Chance Exclusiva", 4, "Chance de tocar uma voz exclusiva, se existir para o inimigo (ex: 4 = 1/4 de chance)");
		Harmony val = new Harmony("com.thehalfbunny.enemytaunter");
		val.PatchAll();
		((MonoBehaviour)this).StartCoroutine(LoadAllSoundsCoroutine());
		((BaseUnityPlugin)this).Logger.LogInfo((object)"EnemyTaunter (BepInEx Config Version) has been loaded and patched!");
	}

	[IteratorStateMachine(typeof(<LoadAllSoundsCoroutine>d__11))]
	private IEnumerator LoadAllSoundsCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <LoadAllSoundsCoroutine>d__11(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<LoadClipCoroutine>d__12))]
	private IEnumerator LoadClipCoroutine(string filePath, List<AudioClip> targetList)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <LoadClipCoroutine>d__12(0)
		{
			<>4__this = this,
			filePath = filePath,
			targetList = targetList
		};
	}
}
[HarmonyPatch(typeof(EnemyIdentifier), "Death", new Type[] { typeof(bool) })]
public static class EnemyDeathPatch
{
	private static float lastPlayTime = 0f;

	private static float cooldownSeconds = 1f;

	public static void Prefix(EnemyIdentifier __instance)
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)__instance == (Object)null) && !__instance.dead && Random.Range(1, VoiceModPlugin.Chance.Value + 1) == 1 && !(Time.time < lastPlayTime + cooldownSeconds))
		{
			AudioClip clipForEnemy = GetClipForEnemy(__instance.enemyType);
			if (!((Object)(object)clipForEnemy == (Object)null))
			{
				lastPlayTime = Time.time;
				cooldownSeconds = clipForEnemy.length + 0.1f;
				PlaySound(clipForEnemy);
			}
		}
	}

	private static AudioClip GetClipForEnemy(EnemyType enemyType)
	{
		string key = ((object)(EnemyType)(ref enemyType)).ToString().ToLower();
		if (VoiceModPlugin.EnableExclusiveChance.Value && VoiceModPlugin.ExclusiveKillSounds.TryGetValue(key, out var value) && value.Count > 0 && Random.Range(1, VoiceModPlugin.ExclusiveChance.Value + 1) == 1)
		{
			return value[Random.Range(0, value.Count)];
		}
		if (VoiceModPlugin.DefaultKillSounds.Count > 0)
		{
			return VoiceModPlugin.DefaultKillSounds[Random.Range(0, VoiceModPlugin.DefaultKillSounds.Count)];
		}
		return null;
	}

	private static void PlaySound(AudioClip clip)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Expected O, but got Unknown
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)Camera.main == (Object)null))
		{
			GameObject val = new GameObject("TempAudio_" + ((Object)clip).name);
			val.transform.position = ((Component)Camera.main).transform.position;
			AudioSource val2 = val.AddComponent<AudioSource>();
			val2.clip = clip;
			val2.spatialBlend = 0f;
			val2.volume = VoiceModPlugin.Volume.Value;
			val2.Play();
			Object.Destroy((Object)(object)val, clip.length + 0.2f);
		}
	}
}

BepInEx/plugins/ULTRAKILLSoundModder.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
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("ULTRAKILLSoundModder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ULTRAKILLSoundModder")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bf77accb-047f-45c0-b551-682b7f6fee30")]
[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 UKSoundTool;

[HarmonyPatch(typeof(Punch))]
public static class PunchPatches
{
	public static AudioModPlugin PluginInstance;

	[HarmonyPatch("Awake")]
	[HarmonyPostfix]
	public static void AwakePostfix(Punch __instance)
	{
		try
		{
			ReplaceAudioSourceClipInField(__instance, "normalHit");
			ReplaceAudioSourceClipInField(__instance, "heavyHit");
			ReplaceAudioSourceClipInField(__instance, "specialHit");
		}
		catch (Exception arg)
		{
			PluginInstance.Logger.LogError((object)$"Erro no patch do Punch.Awake: {arg}");
		}
	}

	[HarmonyPatch("PunchStart")]
	[HarmonyPrefix]
	public static void PunchStartPrefix(Punch __instance)
	{
		try
		{
			ReplaceAudioSourceClipInField(__instance, "aud");
		}
		catch (Exception arg)
		{
			PluginInstance.Logger.LogError((object)$"Erro no patch do Punch.PunchStart: {arg}");
		}
	}

	private static void ReplaceAudioSourceClipInField(Punch punchInstance, string fieldName)
	{
		FieldInfo fieldInfo = AccessTools.Field(typeof(Punch), fieldName);
		if (!(fieldInfo == null))
		{
			object? value = fieldInfo.GetValue(punchInstance);
			AudioSource val = (AudioSource)((value is AudioSource) ? value : null);
			if (val != null && (Object)(object)val.clip != (Object)null && PluginInstance.CustomAudioClips.TryGetValue(((Object)val.clip).name, out var value2) && (Object)(object)val.clip != (Object)(object)value2)
			{
				PluginInstance.Logger.LogInfo((object)("[Punch Patch] Intercetado e substituído '" + ((Object)val.clip).name + "' no campo '" + fieldName + "'."));
				val.clip = value2;
			}
		}
	}
}
[HarmonyPatch]
public static class InstantiationPatch
{
	public static AudioModPlugin PluginInstance;

	[HarmonyTargetMethods]
	public static IEnumerable<MethodBase> TargetMethods()
	{
		return (from m in typeof(Object).GetMethods(BindingFlags.Static | BindingFlags.Public)
			where m.Name == "Instantiate" && !m.IsGenericMethod
			select m).Cast<MethodBase>();
	}

	[HarmonyPostfix]
	public static void Postfix(Object original, Object __result)
	{
		GameObject val = (GameObject)(object)((original is GameObject) ? original : null);
		if ((val == null || !((Object)(object)val.GetComponentInChildren<AudioSource>(true) == (Object)null)) && (original is GameObject || original is AudioSource))
		{
			string originalName = ((original != null) ? original.name : null) ?? "Unknown";
			ProcessInstantiatedObject(originalName, __result);
		}
	}

	private static void ProcessInstantiatedObject(string originalName, Object result)
	{
		try
		{
			CheckAndReplaceAudio(result);
		}
		catch (Exception arg)
		{
			PluginInstance.Logger.LogError((object)$"[Instantiate Patch] Erro ao processar objeto '{originalName}': {arg}");
		}
	}

	private static void CheckAndReplaceAudio(Object result)
	{
		if (result == (Object)null)
		{
			return;
		}
		AudioSource val = null;
		GameObject val2 = (GameObject)(object)((result is GameObject) ? result : null);
		if (val2 != null)
		{
			val = val2.GetComponentInChildren<AudioSource>(true);
		}
		else
		{
			AudioSource val3 = (AudioSource)(object)((result is AudioSource) ? result : null);
			if (val3 != null)
			{
				val = val3;
			}
		}
		if ((Object)(object)((val != null) ? val.clip : null) != (Object)null && PluginInstance.CustomAudioClips.TryGetValue(((Object)val.clip).name, out var value) && (Object)(object)val.clip != (Object)(object)value)
		{
			PluginInstance.Logger.LogInfo((object)("[Instantiate Patch] Intercetado e substituído '" + ((Object)val.clip).name + "' no novo objeto '" + result.name + "'."));
			bool isPlaying = val.isPlaying;
			bool playOnAwake = val.playOnAwake;
			var anon = new { val.volume, val.pitch, val.panStereo, val.spatialBlend, val.loop };
			val.clip = value;
			val.volume = anon.volume;
			val.pitch = anon.pitch;
			val.panStereo = anon.panStereo;
			val.spatialBlend = anon.spatialBlend;
			val.loop = anon.loop;
			if (playOnAwake || isPlaying)
			{
				val.Play();
			}
		}
	}
}
[HarmonyPatch]
public static class AudioSourceUniversalPatch
{
	public static AudioModPlugin PluginInstance;

	[HarmonyPatch(typeof(AudioSource), "Play", new Type[] { })]
	[HarmonyPrefix]
	public static void PlayPrefix(AudioSource __instance)
	{
		try
		{
			if ((Object)(object)__instance.clip != (Object)null && PluginInstance.CustomAudioClips.TryGetValue(((Object)__instance.clip).name, out var value) && (Object)(object)__instance.clip != (Object)(object)value)
			{
				PluginInstance.Logger.LogInfo((object)("[Tática Universal] '" + ((Object)__instance.clip).name + "' intercetado em Play()!"));
				__instance.clip = value;
			}
		}
		catch (Exception arg)
		{
			PluginInstance.Logger.LogError((object)$"Erro no patch de AudioSource.Play: {arg}");
		}
	}

	[HarmonyPatch(typeof(AudioSource), "PlayOneShot", new Type[]
	{
		typeof(AudioClip),
		typeof(float)
	})]
	[HarmonyPrefix]
	public static void PlayOneShotPrefix(ref AudioClip clip)
	{
		try
		{
			if ((Object)(object)clip != (Object)null && PluginInstance.CustomAudioClips.TryGetValue(((Object)clip).name, out var value) && (Object)(object)clip != (Object)(object)value)
			{
				PluginInstance.Logger.LogInfo((object)("[Tática Universal] '" + ((Object)clip).name + "' intercetado em PlayOneShot()!"));
				clip = value;
			}
		}
		catch (Exception arg)
		{
			PluginInstance.Logger.LogError((object)$"Erro no patch de AudioSource.PlayOneShot: {arg}");
		}
	}
}
[BepInPlugin("com.thehalfbunny.uksoundtool", "UKSoundTool", "1.5.0")]
public class AudioModPlugin : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass24_0
	{
		public byte[] wavData;

		public AudioClip clip;

		public Exception conversionEx;

		public bool conversionDone;

		public AudioModPlugin <>4__this;

		internal void <ExportAllAudioClips>b__0(object _)
		{
			try
			{
				wavData = <>4__this.ConvertToWav(clip);
			}
			catch (Exception ex)
			{
				conversionEx = ex;
			}
			finally
			{
				conversionDone = true;
			}
		}

		internal bool <ExportAllAudioClips>b__1()
		{
			return conversionDone;
		}
	}

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

		private object <>2__current;

		public AudioModPlugin <>4__this;

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

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

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

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

		private bool MoveNext()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.PatchAllAudioSourcesInScene();
				<>2__current = (object)new WaitForSeconds(0.1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.PatchAllAudioSourcesInScene();
				<>2__current = (object)new WaitForSeconds(0.4f);
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				<>4__this.PatchAllAudioSourcesInScene();
				<>2__current = (object)new WaitForSeconds(0.5f);
				<>1__state = 3;
				return true;
			case 3:
				<>1__state = -1;
				<>4__this.PatchAllAudioSourcesInScene();
				<>4__this.Logger.LogInfo((object)"Patrulha de áudio concluída.");
				return false;
			}
		}

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

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

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

		private object <>2__current;

		public AudioModPlugin <>4__this;

		private AudioClip[] <allGameClips>5__1;

		private HashSet<string> <exportedNames>5__2;

		private int <exportedCount>5__3;

		private int <i>5__4;

		private <>c__DisplayClass24_0 <>8__5;

		private string <sanitizedName>5__6;

		private string <filePath>5__7;

		private Exception <ex>5__8;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<allGameClips>5__1 = null;
			<exportedNames>5__2 = null;
			<>8__5 = null;
			<sanitizedName>5__6 = null;
			<filePath>5__7 = null;
			<ex>5__8 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this._isBusy = true;
				<>4__this.Logger.LogInfo((object)"A iniciar a exportação de todos os áudios do jogo. Isto pode levar um tempo e causar pequenas travadas...");
				<allGameClips>5__1 = Resources.FindObjectsOfTypeAll<AudioClip>();
				<exportedNames>5__2 = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
				<exportedCount>5__3 = 0;
				<>4__this.Logger.LogInfo((object)$"Encontrados {<allGameClips>5__1.Length} clipes de áudio para processar.");
				<i>5__4 = 0;
				goto IL_0350;
			case 1:
				<>1__state = -1;
				try
				{
					if (<>8__5.conversionEx != null)
					{
						throw <>8__5.conversionEx;
					}
					if (<>8__5.wavData != null)
					{
						<filePath>5__7 = Path.Combine(<>4__this._exportPath, <sanitizedName>5__6 + ".wav");
						File.WriteAllBytes(<filePath>5__7, <>8__5.wavData);
						<exportedNames>5__2.Add(((Object)<>8__5.clip).name);
						<exportedCount>5__3++;
						<filePath>5__7 = null;
					}
				}
				catch (Exception ex)
				{
					<ex>5__8 = ex;
					<>4__this.Logger.LogError((object)("Não foi possível exportar o clipe '" + ((Object)<>8__5.clip).name + "': " + <ex>5__8.Message));
				}
				if (<i>5__4 % 100 == 0)
				{
					<>4__this.Logger.LogInfo((object)$"Progresso: {<i>5__4} / {<allGameClips>5__1.Length} clipes processados...");
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				goto IL_032f;
			case 2:
				{
					<>1__state = -1;
					goto IL_032f;
				}
				IL_033e:
				<i>5__4++;
				goto IL_0350;
				IL_032f:
				<>8__5 = null;
				<sanitizedName>5__6 = null;
				goto IL_033e;
				IL_0350:
				if (<i>5__4 < <allGameClips>5__1.Length)
				{
					<>8__5 = new <>c__DisplayClass24_0();
					<>8__5.<>4__this = <>4__this;
					<>8__5.clip = <allGameClips>5__1[<i>5__4];
					if ((Object)(object)<>8__5.clip == (Object)null || string.IsNullOrEmpty(((Object)<>8__5.clip).name) || <exportedNames>5__2.Contains(((Object)<>8__5.clip).name) || <>8__5.clip.samples == 0 || !<>8__5.clip.preloadAudioData)
					{
						goto IL_033e;
					}
					<sanitizedName>5__6 = <>4__this.SanitizeFileName(((Object)<>8__5.clip).name);
					<>8__5.wavData = null;
					<>8__5.conversionDone = false;
					<>8__5.conversionEx = null;
					ThreadPool.QueueUserWorkItem(delegate
					{
						try
						{
							<>8__5.wavData = <>8__5.<>4__this.ConvertToWav(<>8__5.clip);
						}
						catch (Exception conversionEx)
						{
							<>8__5.conversionEx = conversionEx;
						}
						finally
						{
							<>8__5.conversionDone = true;
						}
					});
					<>2__current = (object)new WaitUntil((Func<bool>)(() => <>8__5.conversionDone));
					<>1__state = 1;
					return true;
				}
				<>4__this.Logger.LogInfo((object)$"Exportação concluída! {<exportedCount>5__3} áudios foram salvos em: {<>4__this._exportPath}");
				<>4__this._isBusy = false;
				return false;
			}
		}

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

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

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

		private object <>2__current;

		public AudioModPlugin <>4__this;

		private IEnumerable<string> <audioFiles>5__1;

		private int <loadedCount>5__2;

		private IEnumerator<string> <>s__3;

		private string <filePath>5__4;

		private UnityWebRequest <webRequest>5__5;

		private AudioClip <clip>5__6;

		private string <clipName>5__7;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if ((uint)(num - -4) <= 1u || num == 1)
			{
				try
				{
					if (num == -4 || num == 1)
					{
						try
						{
						}
						finally
						{
							<>m__Finally2();
						}
					}
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<audioFiles>5__1 = null;
			<>s__3 = null;
			<filePath>5__4 = null;
			<webRequest>5__5 = null;
			<clip>5__6 = null;
			<clipName>5__7 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Invalid comparison between Unknown and I4
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.Logger.LogInfo((object)("A procurar por ficheiros de áudio em: " + <>4__this._modPath));
					<audioFiles>5__1 = from f in Directory.GetFiles(<>4__this._modPath, "*.*", SearchOption.AllDirectories)
						where f.EndsWith(".wav", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".ogg", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase)
						select f;
					<loadedCount>5__2 = 0;
					<>s__3 = <audioFiles>5__1.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -4;
					if ((int)<webRequest>5__5.result != 1)
					{
						<>4__this.Logger.LogError((object)("Erro ao carregar o áudio '" + <filePath>5__4 + "': " + <webRequest>5__5.error));
					}
					else
					{
						<clip>5__6 = DownloadHandlerAudioClip.GetContent(<webRequest>5__5);
						if ((Object)(object)<clip>5__6 != (Object)null)
						{
							<clipName>5__7 = Path.GetFileNameWithoutExtension(<filePath>5__4);
							((Object)<clip>5__6).name = <clipName>5__7;
							<>4__this.CustomAudioClips[<clipName>5__7] = <clip>5__6;
							<loadedCount>5__2++;
							<clipName>5__7 = null;
						}
						<clip>5__6 = null;
					}
					<>m__Finally2();
					<webRequest>5__5 = null;
					<filePath>5__4 = null;
					break;
				}
				if (<>s__3.MoveNext())
				{
					<filePath>5__4 = <>s__3.Current;
					<webRequest>5__5 = UnityWebRequestMultimedia.GetAudioClip("file:///" + <filePath>5__4, (AudioType)0);
					<>1__state = -4;
					<>2__current = <webRequest>5__5.SendWebRequest();
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>s__3 = null;
				if (<loadedCount>5__2 > 0)
				{
					<>4__this.Logger.LogInfo((object)$"{<loadedCount>5__2} áudio(s) personalizado(s) foram carregados.");
				}
				else
				{
					<>4__this.Logger.LogWarning((object)"Nenhum áudio personalizado encontrado ou carregado da pasta AudioMod.");
				}
				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 (<>s__3 != null)
			{
				<>s__3.Dispose();
			}
		}

		private void <>m__Finally2()
		{
			<>1__state = -3;
			if (<webRequest>5__5 != null)
			{
				((IDisposable)<webRequest>5__5).Dispose();
			}
		}

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

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

		private object <>2__current;

		public AudioModPlugin <>4__this;

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

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

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

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

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this._isBusy = true;
				<>4__this.Logger.LogInfo((object)"A recarregar áudios personalizados da pasta AudioMod...");
				<>4__this.CustomAudioClips.Clear();
				<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.LoadCustomAudio());
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.Logger.LogInfo((object)"Recarregamento de áudio concluído. A iniciar nova patrulha de cena...");
				<>4__this._patchedSceneSources.Clear();
				((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.AggressiveSceneScan());
				<>4__this._isBusy = false;
				return false;
			}
		}

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

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

	public const string PluginGUID = "com.thehalfbunny.uksoundtool";

	public const string PluginName = "UKSoundTool";

	public const string PluginVersion = "1.5.0";

	public readonly Dictionary<string, AudioClip> CustomAudioClips = new Dictionary<string, AudioClip>(StringComparer.OrdinalIgnoreCase);

	private readonly HashSet<AudioSource> _patchedSceneSources = new HashSet<AudioSource>();

	private string _exportPath;

	private string _modPath;

	private bool _isBusy = false;

	private ConfigEntry<KeyCode> _reloadKey;

	private ConfigEntry<KeyCode> _exportKey;

	private ConfigEntry<KeyCode> _exportModifierKey;

	public static AudioModPlugin Instance { get; private set; }

	public ManualLogSource Logger => ((BaseUnityPlugin)this).Logger;

	private void Awake()
	{
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Expected O, but got Unknown
		Instance = this;
		_reloadKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Hotkeys", "ReloadAudio", (KeyCode)293, "Tecla para recarregar os áudios da pasta AudioMod.");
		_exportKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Hotkeys", "ExportAudio", (KeyCode)293, "Tecla para exportar os áudios do jogo.");
		_exportModifierKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Hotkeys", "ExportModifier", (KeyCode)308, "Tecla modificadora (ex: Alt, Shift) para ativar a exportação em vez do recarregamento.");
		_exportPath = Path.Combine(Paths.PluginPath, "AudioExports");
		_modPath = Path.Combine(Paths.PluginPath, "AudioMod");
		Directory.CreateDirectory(_exportPath);
		Directory.CreateDirectory(_modPath);
		Logger.LogInfo((object)"UKSoundTool v1.5.0 foi carregado!");
		Logger.LogInfo((object)$"Recarregar Áudio: [{_reloadKey.Value}] | Exportar Áudio: [{_exportModifierKey.Value} + {_exportKey.Value}]");
		((MonoBehaviour)this).StartCoroutine(LoadCustomAudio());
		PunchPatches.PluginInstance = this;
		InstantiationPatch.PluginInstance = this;
		AudioSourceUniversalPatch.PluginInstance = this;
		Harmony val = new Harmony("com.thehalfbunny.uksoundtool");
		val.PatchAll();
		SceneManager.sceneLoaded += OnSceneLoaded;
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		Logger.LogInfo((object)("Cena '" + ((Scene)(ref scene)).name + "' carregada. A iniciar a patrulha de áudio..."));
		_patchedSceneSources.Clear();
		((MonoBehaviour)this).StartCoroutine(AggressiveSceneScan());
	}

	[IteratorStateMachine(typeof(<AggressiveSceneScan>d__19))]
	private IEnumerator AggressiveSceneScan()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <AggressiveSceneScan>d__19(0)
		{
			<>4__this = this
		};
	}

	private void PatchAllAudioSourcesInScene()
	{
		if (CustomAudioClips.Count == 0)
		{
			return;
		}
		AudioSource[] array = Object.FindObjectsOfType<AudioSource>(true);
		int num = 0;
		AudioSource[] array2 = array;
		foreach (AudioSource val in array2)
		{
			if (!_patchedSceneSources.Contains(val) && (Object)(object)val.clip != (Object)null && CustomAudioClips.TryGetValue(((Object)val.clip).name, out var value) && (Object)(object)val.clip != (Object)(object)value)
			{
				bool isPlaying = val.isPlaying;
				val.clip = value;
				num++;
				_patchedSceneSources.Add(val);
				if (isPlaying)
				{
					val.Play();
				}
			}
		}
		if (num > 0)
		{
			Logger.LogInfo((object)$"{num} nova(s) fonte(s) de áudio foram substituídas na patrulha da cena.");
		}
	}

	private void Update()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		if (!_isBusy && Input.GetKeyDown(_exportKey.Value))
		{
			if (Input.GetKey(_exportModifierKey.Value))
			{
				((MonoBehaviour)this).StartCoroutine(ExportAllAudioClips());
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(ReloadAndPatchAudioCoroutine());
			}
		}
	}

	[IteratorStateMachine(typeof(<ReloadAndPatchAudioCoroutine>d__22))]
	private IEnumerator ReloadAndPatchAudioCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ReloadAndPatchAudioCoroutine>d__22(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<LoadCustomAudio>d__23))]
	private IEnumerator LoadCustomAudio()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <LoadCustomAudio>d__23(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<ExportAllAudioClips>d__24))]
	private IEnumerator ExportAllAudioClips()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ExportAllAudioClips>d__24(0)
		{
			<>4__this = this
		};
	}

	private string SanitizeFileName(string fileName)
	{
		return Path.GetInvalidFileNameChars().Aggregate(fileName, (string current, char c) => current.Replace(c, '_'));
	}

	private byte[] ConvertToWav(AudioClip clip)
	{
		float[] array = new float[clip.samples * clip.channels];
		if (!clip.GetData(array, 0))
		{
			throw new Exception("Não foi possível obter os dados de áudio (GetData falhou). O clipe pode estar em streaming ou descarregado.");
		}
		using MemoryStream memoryStream = new MemoryStream();
		using BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
		binaryWriter.Write(Encoding.ASCII.GetBytes("RIFF"));
		binaryWriter.Write(0);
		binaryWriter.Write(Encoding.ASCII.GetBytes("WAVE"));
		binaryWriter.Write(Encoding.ASCII.GetBytes("fmt "));
		binaryWriter.Write(16);
		binaryWriter.Write((ushort)1);
		binaryWriter.Write((ushort)clip.channels);
		binaryWriter.Write((uint)clip.frequency);
		binaryWriter.Write((uint)(clip.frequency * clip.channels * 2));
		binaryWriter.Write((ushort)(clip.channels * 2));
		binaryWriter.Write((ushort)16);
		binaryWriter.Write(Encoding.ASCII.GetBytes("data"));
		binaryWriter.Write(array.Length * 2);
		float[] array2 = array;
		foreach (float num in array2)
		{
			binaryWriter.Write((short)(num * 32767f));
		}
		binaryWriter.Seek(4, SeekOrigin.Begin);
		binaryWriter.Write((int)(memoryStream.Length - 8));
		return memoryStream.ToArray();
	}
}

BepInEx/plugins/UltrakULL/UltrakULL.dll

Decompiled 17 hours ago
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.Tasks;
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.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
	{
		public static string Fix(string str)
		{
			return Fix(str, showTashkeel: false, useHinduNumbers: true);
		}

		public static string Fix(string str, bool rtl)
		{
			if (rtl)
			{
				return Fix(str);
			}
			string[] array = str.Split(new char[1] { ' ' });
			string text = "";
			string text2 = "";
			string[] array2 = array;
			foreach (string text3 in array2)
			{
				if (char.IsLower(text3.ToLower()[text3.Length / 2]))
				{
					text = text + Fix(text2) + text3 + " ";
					text2 = "";
				}
				else
				{
					text2 = text2 + text3 + " ";
				}
			}
			if (text2 != "")
			{
				text += Fix(text2);
			}
			return text;
		}

		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"))
			{
				((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(((Component)CommonFunctions.GetGameObjectChild(CommonFunctions.GetInactiveRootObject("3-4 - Outdoors Arenas"), "3-4 Stuff").transform.Find("Crane (Moveable)")).gameObject, "Cube (19)"), "Cube"), "UsableScreen New"), "InteractiveScreen"), "Canvas"), "Background"), "Text (TMP) (1)"))).text = LanguageManager.CurrentLanguage.act1.act1_lustFirst_crane;
			}
		}
	}
	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 parentObject = list[0];
			GameObject parentObject2 = list[1];
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst1;
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst2;
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject, "Button (C)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptFirst3;
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject2, "Button (A)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptSecond1;
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject2, "Button (B)"), "Text")).text = LanguageManager.CurrentLanguage.visualnovel.visualnovel_fallenPromptSecond2;
			CommonFunctions.GetTextfromGameObject(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(parentObject2, "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;
			}
		}
	}
	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()
		{
			return "Unknown 8-1 string";
		}

		public static string Level82()
		{
			return "Unknown 8-2 string";
		}

		public static string Level83()
		{
			return "Unknown 8-3 string";
		}

		public static string Level84()
		{
			return "Unknown 8-4 string";
		}

		public static string Level8Secret()
		{
			return "Unknown 8-S string";
		}

		public static string Level91()
		{
			return "Unknown 9-1 string";
		}

		public static string Level92()
		{
			return "Unknown 9-2 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(), 
				"Level 8-2" => Level82(), 
				"Level 8-3" => Level83(), 
				"Level 8-4" => Level84(), 
				"Level 8-S" => Level8Secret(), 
				"Level 9-1" => Level91(), 
				"Level 9-2" => Level92(), 
				_ => "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)
		{
			switch (CommonFunctions.GetCurrentSceneName())
			{
			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" + LanguageManager.CurrentLanguage.books.books_wrathSecond3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_wrathSecond4 + "\n\n" + LanguageManager.CurrentLanguage.books.books_wrathSecond5 + "\n\n<i>" + LanguageManager.CurrentLanguage.books.books_wrathSecond6 + "</i>\n\n" + LanguageManager.CurrentLanguage.books.books_wrathSecond7 + "\n\n" + LanguageManager.CurrentLanguage.books.books_wrathSecond8 + "\n\n<b>" + LanguageManager.CurrentLanguage.books.books_wrathSecond9 + "</b>";
			case "Level 5-S":
				if (originalText.Contains("DAY 529"))
				{
					return LanguageManager.CurrentLanguage.fishing.fish_book1 + "\n\n" + LanguageManager.CurrentLanguage.fishing.fish_book2 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book3 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book4 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book8 + "\n\n" + LanguageManager.CurrentLanguage.fishing.fish_book5 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book6 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book7 + "\n\n" + LanguageManager.CurrentLanguage.fishing.fish_book8 + "\n\n" + LanguageManager.CurrentLanguage.fishing.fish_book7 + "\n" + LanguageManager.CurrentLanguage.fishing.fish_book8 + "\n\n" + LanguageManager.CurrentLanguage.fishing.fish_book7 + " " + LanguageManager.CurrentLanguage.fishing.fish_book8 + "<size=47>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=45>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=43>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=41>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=39>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=37>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=35>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=33>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=31>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=29>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=27>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=25>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=23>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=21>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=19>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=17>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=15>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=13>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=11>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=9>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=7>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=5>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=3>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>\n<size=1>" + LanguageManager.CurrentLanguage.fishing.fish_book9 + "</size>" + LanguageManager.CurrentLanguage.fishing.fish_book10;
				}
				return LanguageManager.CurrentLanguage.fishing.fish_bottleMessage1 + "\n\n\n" + LanguageManager.CurrentLanguage.fishing.fish_bottleMessage2 + "\n\n\n" + LanguageManager.CurrentLanguage.fishing.fish_bottleMessage3 + "\n\n\n" + LanguageManager.CurrentLanguage.fishing.fish_bottleMessage4 + "\n\n\n" + LanguageManager.CurrentLanguage.fishing.fish_bottleMessage5 + "\n\n\n" + LanguageManager.CurrentLanguage.fishing.fish_bottleMessage6;
			case "Level 6-1":
				return "<size=244>" + LanguageManager.CurrentLanguage.act2.act2_heresyFirst_armboy + "</size>";
			case "Level 7-1":
				if (originalText.Contains("The unending halls of"))
				{
					return "<b>" + LanguageManager.CurrentLanguage.books.books_violenceFirst1 + "</b>\n<b>" + LanguageManager.CurrentLanguage.books.books_violenceFirst2 + "</b>\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst4 + "\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst5 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst6 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst7 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst8 + "\n\n<color=red>" + LanguageManager.CurrentLanguage.books.books_violenceFirst9 + "</color>";
				}
				return LanguageManager.CurrentLanguage.books.books_violenceFirst_Slate1 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst_Slate2 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst_Slate3 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceFirst_Slate4;
			case "Level 7-2":
				if (originalText.Contains("> < < > < < > > < > > < >"))
				{
					return LanguageManager.CurrentLanguage.books.books_violenceSecond1 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecond2 + "\n\n> < < > < < > > < > > < >";
				}
				return "<i>" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush1 + "\n\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush2 + "\n\n\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush1 + "\n\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush3 + "\n\n\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush1 + "\n\n\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecondAmbush4 + "</i>";
			case "Level 7-4":
				return "<size=20><color=red>" + LanguageManager.CurrentLanguage.books.books_violenceFourth1 + "</color></size>\n\n\n<size=20><color=red>" + LanguageManager.CurrentLanguage.books.books_violenceFourth2 + "</color></size>\n\n\n<size=20><color=red>" + LanguageManager.CurrentLanguage.books.books_violenceFourth3 + "</color></size>\n\n\n<size=20><color=red>" + LanguageManager.CurrentLanguage.books.books_violenceFourth4 + "</color></size>\n\n<size=20>" + LanguageManager.CurrentLanguage.books.books_violenceFourth5 + "</size>";
			case "Level 7-S":
				return LanguageManager.CurrentLanguage.books.books_violenceSecret_Slate1 + "\n\n" + LanguageManager.CurrentLanguage.books.books_violenceSecret_Slate2;
			default:
				return "<big><b>Unknown book</b></big>\n\n" + originalText;
			}
		}
	}
	public static class BossStrings
	{
		public static string GetBossName(string originalBossName)
		{
			Logging.Warn(originalBossName);
			return EnemyBios.GetName(originalBossName.ToUpper());
		}
	}
	public static class Cheats
	{
		public static void PatchCheatConsentPanel(ref GameObject canvasObj)
		{
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObjectChild = CommonFunctions.GetGameObjectChild(canvasObj, "Cheat Menu");
			GameObject gameObjectChild2 = CommonFunctions.GetGameObjectChild(gameObjectChild, "Cheats Consent");
			GameObject gameObjectChild3 = CommonFunctions.GetGameObjectChild(gameObjectChild2, "Text");
			((TMP_Text)CommonFunctions.GetTextMeshProUGUI(gameObjectChild3)).text = LanguageManager.CurrentLanguage.cheats.cheats_disclaimer1 + "\n\n" + LanguageManager.CurrentLanguage.cheats.cheats_disclaimer2;
			TextMeshProUGUI textMeshProUGUI = CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild2, "Yes"), "Text"));
			((TMP_Text)textMeshProUGUI).text = LanguageManager.CurrentLanguage.cheats.cheats_disclaimerYes;
			((TMP_Text)textMeshProUGUI).fontSize = 22f;
			((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild2, "No"), "Text"))).text = LanguageManager.CurrentLanguage.cheats.cheats_disclaimerNo;
			((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(gameObjectChild, "Cheats Manager"), "Title"))).text = LanguageManager.CurrentLanguage.cheats.cheats_panelTitle;
			((Behaviour)gameObjectChild3.GetComponents(typeof(Component))[2]).enabled = false;
			GameObject gameObjectChild4 = CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(CommonFunctions.GetGameObjectChild(canvasObj, "Cheat Menu"), "Cheats Overlay"), "Cheats Enabled");
			((TMP_Text)CommonFunctions.GetTextMeshProUGUI(CommonFunctions.GetGameObjectChild(gameObjectChild4, "Title"))).text = LanguageManager