Decompiled source of PrimePresidents v1.2.1

PrimePresidents.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PrimePresidents")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Replaces the prime fights (+Gabriel) with current and former U.S. presidents, Fixed for Ultra-Revamp update!")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyInformationalVersion("1.2.1")]
[assembly: AssemblyProduct("PrimePresidents")]
[assembly: AssemblyTitle("PrimePresidents")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PrimePresidents
{
	[BepInPlugin("gov.PrimePresidents", "Prime Presidents", "1.2.1")]
	[BepInProcess("ULTRAKILL.exe")]
	public class Presidents : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(MinosPrime), "Start")]
		internal class Patch01
		{
			private static void Postfix(MinosPrime __instance)
			{
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Expected O, but got Unknown
				Debug.Log((object)"Replacing minos voice lines");
				__instance.dropkickVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("biden_blast.mp3") };
				__instance.comboVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("biden_chocolate_chocolate.mp3") };
				__instance.boxingVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("biden_come_here.mp3") };
				__instance.riderKickVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("biden_joewareeda.mp3") };
				__instance.dropAttackVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("biden_slam.mp3") };
				__instance.phaseChangeVoice = PresidentsAssetBundle.LoadAsset<AudioClip>("biden_thats_it.mp3");
				Debug.Log((object)"Replacing minos mesh texture");
				Transform val = ((Component)__instance).transform.Find("Model").Find("MinosPrime_Body.001");
				Renderer component = ((Component)val).GetComponent<Renderer>();
				Material val2 = new Material(component.material);
				val2.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("JoePrime_1.png");
				component.sharedMaterial = val2;
			}
		}

		[HarmonyPatch(typeof(SubtitleController), "DisplaySubtitle", new Type[]
		{
			typeof(string),
			typeof(AudioSource),
			typeof(bool)
		})]
		internal class Patch02
		{
			private static void Prefix(ref string caption, AudioSource audioSource, bool ignoreSetting)
			{
				if (caption == "Thy end is now!")
				{
					caption = "Come here, bucko!";
				}
				else if (caption == "Die!")
				{
					caption = "Jowarida!";
				}
				else if (caption == "WEAK")
				{
					caption = "THAT'S IT BUD";
				}
				else if (caption == "Judgement!")
				{
					caption = "Biden blast!";
				}
				else if (caption == "Crush!")
				{
					caption = "Biden slam!";
				}
				else if (caption == "Prepare thyself!")
				{
					caption = "Eat some chocolate chocolate chip!";
				}
				else if (caption == "YES! That's it!")
				{
					caption = "Time to make Trump great again!";
				}
				else if (caption == "Nice try!")
				{
					caption = "Nice coin, bozo!";
				}
				else if (caption == "DESTROY!")
				{
					caption = "Fake news!";
				}
				else if (caption == "You can't escape!")
				{
					caption = "I'm the best WWE superstar, absolutely the best";
				}
				else if (caption == "BE GONE!")
				{
					caption = "BING BONG!";
				}
				else if (caption == "This will hurt.")
				{
					caption = "You're a disgrace.";
				}
				else if (caption == "BEHOLD! THE POWER OF AN ANGEL")
				{
					caption = "BEHOLD! THE POWER OF A PRESIDENT";
				}
			}
		}

		[HarmonyPatch(typeof(StockMapInfo), "Awake")]
		internal class Patch03
		{
			private static void Postfix(StockMapInfo __instance)
			{
				//IL_0eb9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ec0: Expected O, but got Unknown
				//IL_0f06: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f0d: Expected O, but got Unknown
				AudioSource[] array = Resources.FindObjectsOfTypeAll<AudioSource>();
				foreach (AudioSource val in array)
				{
					if (!Object.op_Implicit((Object)(object)val.clip))
					{
						continue;
					}
					bool flag = false;
					List<SubtitleDataLine> list = new List<SubtitleDataLine>();
					if (val.clip.GetName() == "mp_intro2")
					{
						Debug.Log((object)"Replacing minos intro");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("biden_intro.mp3");
						flag = true;
						list.Add(MakeLine("Ahh...", 0f));
						list.Add(MakeLine("Gotta give it to our penitentiaries", 1.25f));
						list.Add(MakeLine("they do a good job of keeping a man locked up", 3.15f));
						list.Add(MakeLine("Donald Trump, now you uh...", 6.4f));
						list.Add(MakeLine("Listen up, ok?", 8.75f));
						list.Add(MakeLine("The 2024 election is right around the corner", 10.4f));
						list.Add(MakeLine("The American people want change, they want progress not you", 13f));
						list.Add(MakeLine("Your only legacy will be a smear on the history of this great nation", 16.7f));
						list.Add(MakeLine("Uhh... listen fa-, listen machine...", 21.25f));
						list.Add(MakeLine("Now I do gotta thank you for my freedom, it's the basis of which our country was formed", 24.3f));
						list.Add(MakeLine("So your patriotism, I uh...", 29.35f));
						list.Add(MakeLine("I do appreciate it", 30.9f));
						list.Add(MakeLine("but the uh...", 32.75f));
						list.Add(MakeLine("the crimes that you have committed against America and its people... ", 34.4f));
						list.Add(MakeLine("They uh...", 38f));
						list.Add(MakeLine("They've not been forgotten alright?", 38.9f));
						list.Add(MakeLine("And your punishment, according to the constitution is uh...", 40.34f));
						list.Add(MakeLine("I... it's DEATH", 43.75f));
					}
					else if (val.clip.GetName() == "mp_outro")
					{
						Debug.Log((object)"Replacing minos outro");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("biden_outro.mp3");
						flag = true;
						list.Add(MakeLine("Aagh!", 0f));
						list.Add(MakeLine("It's Joever", 4f));
						list.Add(MakeLine("Oh hey a cool robot", 5f));
						list.Add(MakeLine("Ah, American made, just the way I like to see it", 6.8f));
						list.Add(MakeLine("American machines like YOU", 9.75f));
						list.Add(MakeLine("Are what really drives this great nation", 11.6f));
						list.Add(MakeLine("Keep up the good work, you're doing America proud", 13.7f));
						list.Add(MakeLine("Anyway, I uh...", 16.2f));
						list.Add(MakeLine("I forgot how to breathe so I gotta go", 17.36f));
					}
					else if (val.clip.GetName() == "mp_deathscream")
					{
						Debug.Log((object)"Replacing death scream");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("biden_soda.mp3");
						flag = true;
						list.Add(MakeLine("SODA!", 0f));
					}
					else if (val.clip.GetName() == "mp_useless")
					{
						Debug.Log((object)"Replacing useless");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("biden_nice_try.mp3");
						flag = true;
						list.Add(MakeLine("Nice try, kid", 0f));
					}
					else if (val.clip.GetName() == "sp_thisprison")
					{
						Debug.Log((object)"Replacing sisyphus intro (prison)");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("trump_escape.mp3");
						flag = true;
						list.Add(MakeLine("This obamanopticon...", 0f));
						list.Add(MakeLine("To hold ME?", 1.75f));
					}
					else if (val.clip.GetName() == "sp_intro")
					{
						Debug.Log((object)"Replacing sisyphus intro");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("trump_intro.mp3");
						flag = true;
						list.Add(MakeLine("Who the hell are you?", 0f));
						list.Add(MakeLine("Don't answer that, I don't care", 1.25f));
						list.Add(MakeLine("Now let me tell you...", 2.7f));
						list.Add(MakeLine("The people of America have long since forgotten my presidency", 3.5f));
						list.Add(MakeLine("And I think it's a shame...", 6.6f));
						list.Add(MakeLine("It's a real shame", 8.4f));
						list.Add(MakeLine("But I'm gonna remind them what a REAL president looks like", 9.9f));
						list.Add(MakeLine("I heard you knocked off Sleepy Joe and I thought...", 14f));
						list.Add(MakeLine("That's tremendous news, absolutely tremendous", 17.1f));
						list.Add(MakeLine("I gotta admit", 20.5f));
						list.Add(MakeLine("I wanna see if you've got what it takes to take me down too", 21.3f));
						list.Add(MakeLine("Because let me tell you", 24.6f));
						list.Add(MakeLine("Nobody takes me down", 25.6f));
						list.Add(MakeLine("NOBODY", 27.4f));
						list.Add(MakeLine("So before I drain the swamp and crush those armies of liberals...", 28.6f));
						list.Add(MakeLine("I'm gonna crush you first. That's right...", 32.8f));
						list.Add(MakeLine("You made in China, boston dynamics wannabe piece of shit...", 35f));
						list.Add(MakeLine("YOU'RE FIRED", 38.1f));
					}
					else if (val.clip.GetName() == "sp_outro")
					{
						Debug.Log((object)"Replacing sisyphus outro");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("trump_outro.mp3");
						flag = true;
						list.Add(MakeLine("You piece of shit, I demand a recount", 0.2f));
						list.Add(MakeLine("Who's running this shit anyway?", 2f));
						list.Add(MakeLine("I bet its that twink, Gabriel", 3.85f));
						list.Add(MakeLine("Russian bots have rigged this", 5.9f));
						list.Add(MakeLine("Right under our American noses", 7.3f));
						list.Add(MakeLine("If this is the America of tomorrow...", 9.4f));
						list.Add(MakeLine("I don't want to be a part of it", 10.9f));
						list.Add(MakeLine("This fight was disasterous", 12.45f));
						list.Add(MakeLine("Absolutely disasterous", 14.35f));
						list.Add(MakeLine("Fuck this fight", 16.15f));
						list.Add(MakeLine("And fuck YOU", 17f));
						list.Add(MakeLine("Trump OUT", 18.1f));
						list.Add(MakeLine("WAAA!", 19.5f));
						list.Add(MakeLine("That's you machine", 20.25f));
						list.Add(MakeLine("WAAA! WAAA! WAAA!", 21.2f));
						list.Add(MakeLine("Keep crying liberal", 22.7f));
						list.Add(MakeLine("WAAA! WAAA!", 23.8f));
					}
					else if (val.clip.GetName() == "sp_keepthemcoming")
					{
						Debug.Log((object)"Replacing keep them coming");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("trump_rigged.mp3");
						flag = true;
						list.Add(MakeLine("Oh this is so rigged", 0f));
					}
					else if (val.clip.GetName() == "gab_Behold")
					{
						Debug.Log((object)"Replacing behold");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_behold.mp3");
					}
					else if (val.clip.GetName() == "gab_Intro1d")
					{
						Debug.Log((object)"Replacing gab intro(1/2)");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_intro1.mp3");
						flag = true;
						list.Add(MakeLine("Good evening machine", 0.6f));
						list.Add(MakeLine("Now let me be clear", 2f));
						list.Add(MakeLine("We all share a deep appreciation for the", 3.5f));
						list.Add(MakeLine("Wonders and treasures that this great nation has to offer", 5.8f));
						list.Add(MakeLine("And I understand your eagerness to experience them firsthand", 8.6f));
						list.Add(MakeLine("But we must also recognize...", 11.8f));
						list.Add(MakeLine("That there are certain places that must be reserved for the purposes", 14.4f));
						list.Add(MakeLine("Of preserving our heritage", 18.5f));
						list.Add(MakeLine("And safeguarding the security of our people", 19.8f));
						list.Add(MakeLine("And this monument you're standing in...", 22.2f));
						list.Add(MakeLine("Is one such place", 24.5f));
						list.Add(MakeLine("It is the property of the United States government", 26f));
						list.Add(MakeLine("And is not open to public access", 28.6f));
						list.Add(MakeLine("So I urge you to comply with the law and vacate the premises", 31.6f));
						list.Add(MakeLine("Because at the end of the day...", 36f));
						list.Add(MakeLine("We are all responsible for upholding the laws that", 38.6f));
						list.Add(MakeLine("Protect the rights and freedoms", 41.2f));
						list.Add(MakeLine("That we hold dear as Americans", 43.2f));
						list.Add(MakeLine("Thank you", 44.9f));
					}
					else if (val.clip.GetName() == "gab_Intro2b")
					{
						Debug.Log((object)"Replacing gab intro(2/2)");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_intro2.mp3");
						flag = true;
						list.Add(MakeLine("My fellow Americans...", 0.6f));
						list.Add(MakeLine("I come before you today with a heavy heart", 1.9f));
						list.Add(MakeLine("For it is with great sorrow that I must inform you", 4.6f));
						list.Add(MakeLine("That despite my best efforts to communciate", 6.8f));
						list.Add(MakeLine("The gravity of the situation...", 9.5f));
						list.Add(MakeLine("It appears that my message has not been recieved", 11.3f));
						list.Add(MakeLine("As a former leader of this great nation...", 13.8f));
						list.Add(MakeLine("I cannot stand idly by", 15.8f));
						list.Add(MakeLine("While the safety and security of our citizens are put in peril", 17.5f));
						list.Add(MakeLine("Therefore...", 21f));
						list.Add(MakeLine("Let it be known that this grave offense will not go unpunished", 22.1f));
						list.Add(MakeLine("And that the full force of the law...", 26f));
						list.Add(MakeLine("Including, if necessary, the use of lethal force", 28.11f));
						list.Add(MakeLine("Will be brought to bear to bring this perpetrator to...", 31f));
						list.Add(MakeLine("JUSTICE", 34.9f));
					}
					else if (val.clip.GetName() == "gab_Woes")
					{
						Debug.Log((object)"Replacing gab woes");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_woes.mp3");
						flag = true;
						list.Add(MakeLine("May the challenges you face be numerous", 0.3f));
						list.Add(MakeLine("And may you cherish each and every day...", 2.4f));
						list.Add(MakeLine("As an opportunity to overcome them and grow stronger", 5f));
					}
					else if (val.clip.GetName() == "gab_Insignificant2b")
					{
						Debug.Log((object)"Replacing gab outro");
						val.clip = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_outro.mp3");
						flag = true;
						list.Add(MakeLine("How could I have been bested by this...", 0.3f));
						list.Add(MakeLine("this THING", 2.1f));
						list.Add(MakeLine("It's unnacceptable and frankly...", 2.8f));
						list.Add(MakeLine("It makes me ANGRY", 4.2f));
						list.Add(MakeLine("We are better than this", 5.3f));
						list.Add(MakeLine("We are STRONGER than this", 6.3f));
						list.Add(MakeLine("AND WE WILL NOT LET THIS SETBACK DEFINE US", 8f));
						list.Add(MakeLine("We are a nation", 9.8f));
						list.Add(MakeLine("Of fighters, of dreamers, of believers", 10.9f));
						list.Add(MakeLine("And we will NOT...", 12.3f));
						list.Add(MakeLine("Let this defeat bring us down", 13.5f));
					}
					if (flag)
					{
						SubtitledAudioSource component = ((Component)val).GetComponent<SubtitledAudioSource>();
						if ((Object)(object)component != (Object)null)
						{
							Traverse val2 = Traverse.Create((object)component).Field("subtitles");
							object value = val2.GetValue();
							((SubtitleData)((value is SubtitleData) ? value : null)).lines = list.ToArray();
						}
					}
				}
				SkinnedMeshRenderer[] array2 = Resources.FindObjectsOfTypeAll<SkinnedMeshRenderer>();
				foreach (SkinnedMeshRenderer val3 in array2)
				{
					if (((Object)((Component)val3).gameObject).name == "MinosPrime_Body.001")
					{
						Material val4 = new Material(((Renderer)val3).material);
						val4.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("JoePrime_1.png");
						((Renderer)val3).sharedMaterial = val4;
					}
					if (((Object)((Component)val3).gameObject).name == "Sisyphus_Head")
					{
						Material val5 = new Material(((Renderer)val3).material);
						val5.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("TrumpHead.png");
						((Renderer)val3).sharedMaterial = val5;
					}
				}
			}
		}

		[HarmonyPatch(typeof(BossHealthBar), "Awake")]
		internal class Patch04
		{
			private static void Prefix(BossHealthBar __instance)
			{
				if (__instance.bossName == "MINOS PRIME")
				{
					__instance.bossName = "BIDEN PRIME";
				}
				if (__instance.bossName == "SISYPHUS PRIME")
				{
					__instance.bossName = "TRUMP PRIME";
				}
				if (__instance.bossName == "FLESH PANOPTICON")
				{
					__instance.bossName = "OBAMANOPTICON";
				}
				if (__instance.bossName == "GABRIEL, JUDGE OF HELL")
				{
					__instance.bossName = "OBAMA, JUDGE OF DC";
				}
			}
		}

		[HarmonyPatch(typeof(LevelNamePopup), "Start")]
		internal class Patch05
		{
			private static void Postfix(LevelNamePopup __instance)
			{
				Traverse val = Traverse.Create((object)__instance).Field("nameString");
				if (val.GetValue() as string == "SOUL SURVIVOR")
				{
					val.SetValue((object)"CHIEF OF STATE");
				}
				if (val.GetValue() as string == "WAIT OF THE WORLD")
				{
					val.SetValue((object)"SIN OF THE APPRENTICE");
				}
				if (val.GetValue() as string == "IN THE FLESH")
				{
					val.SetValue((object)"INAUGURAL ADDRESS");
				}
				val = Traverse.Create((object)__instance).Field("layerString");
				if (val.GetValue() as string == "GLUTTONY /// ACT I CLIMAX")
				{
					val.SetValue((object)"FEDERAL RESERVE /// ACT I CLIMAX");
				}
			}
		}

		[HarmonyPatch(typeof(FleshPrison), "Start")]
		internal class Patch06
		{
			private static void Postfix(FleshPrison __instance)
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Expected O, but got Unknown
				if (__instance.altVersion)
				{
					Debug.Log((object)"Swapping in obama");
					Transform val = ((Component)__instance).transform.Find("FleshPrison2").Find("FleshPrison2_Head");
					Renderer component = ((Component)val).GetComponent<Renderer>();
					Material val2 = new Material(component.material);
					val2.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("Obamanopticon.png");
					component.sharedMaterial = val2;
				}
			}
		}

		[HarmonyPatch(typeof(SisyphusPrime), "Start")]
		internal class Patch07
		{
			private static void Postfix(SisyphusPrime __instance)
			{
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				Transform val = ((Component)__instance).transform.Find("Sisyphus (1)").Find("Sisyphus_Head");
				Transform val2 = ((Component)__instance).transform.Find("Sisyphus (1)").Find("Sisyphus_Hair");
				Transform val3 = ((Component)__instance).transform.Find("Sisyphus (1)").Find("Sisyphus_Beard");
				ChangeMaterials component = ((Component)val).GetComponent<ChangeMaterials>();
				if ((Object)(object)component != (Object)null)
				{
					for (int i = 0; i < component.materials.Length; i++)
					{
						Material val4 = new Material(component.materials[i]);
						val4.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("TrumpHead.png");
						component.materials[i] = val4;
					}
				}
				Renderer component2 = ((Component)val).GetComponent<Renderer>();
				Material val5 = new Material(component2.material);
				val5.mainTexture = (Texture)(object)PresidentsAssetBundle.LoadAsset<Texture2D>("TrumpHead.png");
				component2.sharedMaterial = val5;
				if ((Object)(object)val3 != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)val3).gameObject);
				}
				if ((Object)(object)val2 != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)val2).gameObject);
				}
				__instance.clapVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("trump_bingbong.mp3") };
				__instance.explosionVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("trump_disgrace.mp3") };
				__instance.tauntVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("trump_nicecoin.mp3") };
				__instance.stompComboVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("trump_bestwwe.mp3") };
				__instance.uppercutComboVoice = (AudioClip[])(object)new AudioClip[1] { PresidentsAssetBundle.LoadAsset<AudioClip>("trump_fakenews.mp3") };
				__instance.phaseChangeVoice = PresidentsAssetBundle.LoadAsset<AudioClip>("trump_makegreatagain.mp3");
			}
		}

		[HarmonyPatch(typeof(GabrielVoice), "Start")]
		internal class Patch08
		{
			private static void Postfix(GabrielVoice __instance)
			{
				Traverse val = Traverse.Create((object)__instance).Field("taunts");
				Traverse val2 = Traverse.Create((object)__instance).Field("tauntsSecondPhase");
				if (!Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<Gabriel>()))
				{
					return;
				}
				__instance.phaseChange = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_phasechange.mp3");
				__instance.phaseChangeSubtitle = "Filibuster!";
				__instance.taunt = (AudioClip[])(object)new AudioClip[12];
				string[] array = new string[12];
				__instance.tauntSecondPhase = (AudioClip[])(object)new AudioClip[12];
				string[] array2 = new string[12];
				for (int i = 0; i < 12; i++)
				{
					__instance.taunt[i] = PresidentsAssetBundle.LoadAsset<AudioClip>($"obama1_taunt{i + 1}.mp3");
					switch (i)
					{
					case 0:
						array[i] = "Change is coming and I'm leading the charge";
						break;
					case 1:
						array[i] = "Not even American";
						break;
					case 2:
						array[i] = "A single taste of my Obamehameha will reduce you to dust";
						break;
					case 3:
						array[i] = "From diplomacy to punches, I'll always find a way to deliver a knockout speech";
						break;
					case 4:
						array[i] = "When it comes to battle, I don't just talk about change. I AM the embodiement of change";
						break;
					case 5:
						array[i] = "Don't underestimate the power of hope and change when it's aimed directly at you";
						break;
					case 6:
						array[i] = "Brace yourself for an Obamarama of epic proportions";
						break;
					case 7:
						array[i] = "Nothing personal machine, this is merely a matter of audacity vs arrogance and trust me, I've got audacity in spades";
						break;
					case 8:
						array[i] = "Before I spread the wealth, I'm gonna spread your scrap all over the floor";
						break;
					case 9:
						array[i] = "Pathetic";
						break;
					case 10:
						array[i] = "Ha, nice try, but this armor is made out of pure Obamium";
						break;
					case 11:
						array[i] = "Your entire existence will be vetoed by MY hand";
						break;
					default:
						array[i] = $"FIX THE SUBTITLE BOZO: obama_taunt{i + 1}";
						break;
					}
					__instance.tauntSecondPhase[i] = __instance.taunt[i];
					array2[i] = array[i];
				}
				val.SetValue((object)array);
				val2.SetValue((object)array2);
				__instance.hurt = (AudioClip[])(object)new AudioClip[3];
				__instance.hurt[0] = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_hurt1.mp3");
				__instance.hurt[1] = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_hurt2.mp3");
				__instance.hurt[2] = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_hurt3.mp3");
				__instance.bigHurt = (AudioClip[])(object)new AudioClip[1];
				__instance.bigHurt[0] = PresidentsAssetBundle.LoadAsset<AudioClip>("obama1_bighurt.mp3");
			}
		}

		private static Harmony harmony;

		internal static AssetBundle PresidentsAssetBundle;

		private void Awake()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Prime presidents starting");
			try
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Loading asset bundle...");
				Assembly executingAssembly = Assembly.GetExecutingAssembly();
				string name = "PrimePresidents.Resources.primepresidents";
				using (Stream stream = executingAssembly.GetManifestResourceStream(name))
				{
					if (stream == null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"Could not find embedded asset bundle!");
						return;
					}
					PresidentsAssetBundle = AssetBundle.LoadFromStream(stream);
				}
				if ((Object)(object)PresidentsAssetBundle == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load asset bundle!");
					return;
				}
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Asset bundle loaded successfully!");
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Starting Harmony patches...");
				harmony = new Harmony("gov.PrimePresidents");
				harmony.PatchAll();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Harmony patches applied successfully!");
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Prime Presidents loaded successfully!");
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)$"Fatal error during initialization: {arg}");
				throw;
			}
		}

		private void OnDestroy()
		{
		}

		private static SubtitleDataLine MakeLine(string subtitle, float time)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			SubtitleDataLine val = new SubtitleDataLine();
			val.subtitle = subtitle;
			val.time = time;
			return val;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "PrimePresidents";

		public const string PLUGIN_NAME = "PrimePresidents";

		public const string PLUGIN_VERSION = "1.2.1";
	}
}