Decompiled source of PixelMod v1.56.0

PixelModHUNedition.dll

Decompiled 3 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using PixelModHUNedition.Patches;
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("PixelModHUNedition")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PixelModHUNedition")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f6ef7491-867f-4450-a956-6ecea3af86fc")]
[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 PixelModHUNedition
{
	[BepInPlugin("apuci.Pixelmod-Hun-Edition", "Pixelmod Hun Edition", "1.56.0.0")]
	public class PixHunBase : BaseUnityPlugin
	{
		private const string modGUID = "apuci.Pixelmod-Hun-Edition";

		private const string modName = "Pixelmod Hun Edition";

		private const string modVersion = "1.56.0.0";

		private readonly Harmony harmony = new Harmony("apuci.Pixelmod-Hun-Edition");

		private static PixHunBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("apuci.Pixelmod-Hun-Edition");
			mls.LogInfo((object)"Apuci ebren van");
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(TurretPatch));
			harmony.PatchAll(typeof(HornPatch));
			harmony.PatchAll(typeof(HoarderPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("PixelModHUNedition.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "modhang");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Assets loaded succesfully daddy");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load assetbundle daddy");
			}
		}
	}
}
namespace PixelModHUNedition.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(HoarderBugAI __instance)
		{
			__instance.chitterSFX[0] = PixHunBase.SoundFX[3];
			__instance.chitterSFX[1] = PixHunBase.SoundFX[4];
		}
	}
	[HarmonyPatch(typeof(NoisemakerProp))]
	internal class HornPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(NoisemakerProp __instance)
		{
			__instance.noiseSFX[0] = PixHunBase.SoundFX[2];
			__instance.noiseSFXFar[0] = PixHunBase.SoundFX[2];
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = PixHunBase.SoundFX[5];
			__instance.alarmSFX = PixHunBase.SoundFX[6];
		}
	}
	[HarmonyPatch(typeof(Turret))]
	internal class TurretPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(Turret __instance)
		{
			__instance.detectPlayerSFX = PixHunBase.SoundFX[0];
		}
	}
}