Decompiled source of Plazard Company v1.0.0

PlazardSR.dll

Decompiled 8 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalCompanyTemplate.Patches;
using LethalCompanyTemplate.Properties;
using Microsoft.CodeAnalysis;
using SoundReplacement;
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("BoxSR")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Replaces lehtal company sounds")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BoxSR")]
[assembly: AssemblyTitle("BoxSR")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 SoundReplacement
{
	[BepInPlugin("Box.SoundReplacement", "Sound Replacement", "1.0.0")]
	public class SoundReplacementBase : BaseUnityPlugin
	{
		private const string modGUID = "Box.SoundReplacement";

		private const string modName = "Sound Replacement";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Box.SoundReplacement");

		private static SoundReplacementBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip[] SoundFX;

		internal static AudioClip SoundFX2;

		internal static AudioClip SoundFX3;

		internal static AudioClip SoundFX4;

		internal static AssetBundle Bundle;

		private static string GetAssemblyName()
		{
			return Assembly.GetExecutingAssembly().GetName().Name.Replace(" ", "_");
		}

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Box.SoundReplacement");
			mls.LogInfo((object)"Sound Replacement started");
			harmony.PatchAll(typeof(SoundReplacementBase));
			harmony.PatchAll(typeof(HoarderbugAiPatch));
			harmony.PatchAll(typeof(FlowerManAiPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			Bundle = AssetBundle.LoadFromMemory(Resources.hbundle2);
			if ((Object)(object)Bundle != (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Succes loading Sound rplacment");
				SoundFX = (AudioClip[])(object)new AudioClip[2]
				{
					Bundle.LoadAsset<AudioClip>("idkplus noooo"),
					Bundle.LoadAsset<AudioClip>("idkplus laugh")
				};
				SoundFX2 = Bundle.LoadAsset<AudioClip>("hoarding bug chase");
				SoundFX3 = Bundle.LoadAsset<AudioClip>("bracken kill sound");
				SoundFX4 = Bundle.LoadAsset<AudioClip>("bracken growl");
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load audio assets!");
			}
		}
	}
}
namespace LethalCompanyTemplate
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BoxSR";

		public const string PLUGIN_NAME = "BoxSR";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LethalCompanyTemplate.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("LethalCompanyTemplate.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static byte[] hbundle
		{
			get
			{
				object @object = ResourceManager.GetObject("hbundle", resourceCulture);
				return (byte[])@object;
			}
		}

		internal static byte[] hbundle2
		{
			get
			{
				object @object = ResourceManager.GetObject("hbundle2", resourceCulture);
				return (byte[])@object;
			}
		}

		internal Resources()
		{
		}
	}
}
namespace LethalCompanyTemplate.Patches
{
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class FlowerManAiPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void flowermanAudioPatch(ref AudioClip ___crackNeckSFX)
		{
			AudioClip soundFX = SoundReplacementBase.SoundFX3;
			___crackNeckSFX = soundFX;
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void flowermanAudioPatch2(ref AudioSource ___creatureAngerVoice)
		{
			AudioClip soundFX = SoundReplacementBase.SoundFX4;
			___creatureAngerVoice.clip = soundFX;
		}
	}
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderbugAiPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
		{
			AudioClip[] soundFX = SoundReplacementBase.SoundFX;
			___chitterSFX = soundFX;
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void hoarderBugAudioPatch2(ref AudioClip ___bugFlySFX)
		{
			AudioClip soundFX = SoundReplacementBase.SoundFX2;
			___bugFlySFX = soundFX;
		}
	}
}