Decompiled source of SaxtonPrime v1.0.0

voicelines.replace/SIS_ReplaceVoicelines.dll

Decompiled 8 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("SIS ReplaceVoicelines")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SIS ReplaceVoicelines")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6d923266-b0dc-4f43-b749-181a52930f1b")]
[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 SIS_ReplaceVoiceLines;

[BepInPlugin("DolfeMods.Ultrakill.SIS_ReplaceVoiceLines", "SIS_ReplaceVoiceLines", "1.0.0")]
public class Class1 : BaseUnityPlugin
{
	private AssetBundle bundle = null;

	private AudioClip Destroy1;

	private AudioClip Clap1;

	private AudioClip Explode1;

	private AudioClip Taunt1;

	private AudioClip Stomp1;

	private AudioClip Hurt1;

	private void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		Debug.Log((object)"Started SisVoiceSwapper1");
		Harmony val = new Harmony("DolfeMods.Ultrakill.SIS_ReplaceVoiceLines.IMightWantToDie");
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		val.PatchAll(executingAssembly);
		val.PatchAll();
	}

	private void Start()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		Debug.Log((object)"Started SisVoiceSwapper2");
		Harmony val = new Harmony("DolfeMods.Ultrakill.SIS_ReplaceVoiceLines.IMightWantToDie");
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		val.PatchAll(executingAssembly);
		val.PatchAll();
		Debug.Log((object)"Started SIS_ReplaceVoiceLines");
		if (!((Object)(object)bundle == (Object)null))
		{
			return;
		}
		string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		bundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "customsis"));
		Debug.Log((object)("Got bundle " + (object)bundle));
		for (int i = 0; i < bundle.GetAllAssetNames().Length; i++)
		{
			Debug.Log((object)bundle.GetAllAssetNames()[i]);
			if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/destroy1.wav")
			{
				Destroy1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/destroy1.wav");
			}
			else if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/clap1.wav")
			{
				Clap1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/clap1.wav");
			}
			else if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/explode1.wav")
			{
				Explode1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/explode1.wav");
			}
			else if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/taunt1.wav")
			{
				Taunt1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/taunt1.wav");
			}
			else if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/player_death1.wav")
			{
				Stomp1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/player_death1.wav");
			}
			else if (bundle.GetAllAssetNames()[i] == "assets/ultrakill/customsis/hurt1.wav")
			{
				Hurt1 = bundle.LoadAsset<AudioClip>("assets/ultrakill/customsis/hurt1.wav");
			}
		}
	}

	private void Update()
	{
		SisyphusPrime val = Object.FindObjectOfType<SisyphusPrime>();
		if ((Object)(object)val != (Object)null)
		{
			for (int i = 0; i < val.uppercutComboVoice.Length; i++)
			{
				val.uppercutComboVoice[i] = Destroy1;
			}
		}
		for (int j = 0; j < val.clapVoice.Length; j++)
		{
			val.clapVoice[j] = Clap1;
		}
		for (int k = 0; k < val.explosionVoice.Length; k++)
		{
			val.explosionVoice[k] = Explode1;
		}
		for (int l = 0; l < val.tauntVoice.Length; l++)
		{
			val.tauntVoice[l] = Taunt1;
		}
		for (int m = 0; m < val.stompComboVoice.Length; m++)
		{
			val.stompComboVoice[m] = Stomp1;
		}
		for (int n = 0; n < val.hurtVoice.Length; n++)
		{
			val.hurtVoice[n] = Hurt1;
		}
	}
}