Decompiled source of StupidAlarm v1.0.0

BepInEx/plugins/querzzis.StupidAlarm/stupidAlarm.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using stupidAlarm.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
[assembly: AssemblyCompany("stupidAlarm")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("stupidAlarm")]
[assembly: AssemblyTitle("stupidAlarm")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : System.Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableAttribute : System.Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableContextAttribute : System.Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : System.Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace stupidAlarm
{
	[BepInPlugin("querzzis.StupidAlarm", "Stupid Alarm", "1.0.0")]
	public class StupidAlarmBase : BaseUnityPlugin
	{
		private const string modGUID = "querzzis.StupidAlarm";

		private const string modName = "Stupid Alarm";

		private const string modVersion = "1.0.0";

		private Harmony harmony = new Harmony("querzzis.StupidAlarm");

		private static StupidAlarmBase? Instance;

		internal ManualLogSource? mls;

		internal static AudioClip[]? newSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("querzzis.StupidAlarm");
			mls.LogInfo((object)"Stupid Alarm is loading.");
			AssetBundle val = AssetBundle.LoadFromFile(((BaseUnityPlugin)Instance).Info.Location.TrimEnd("stupidAlarm.dll".ToCharArray()) + "stupidalarmasset");
			newSFX = val.LoadAssetWithSubAssets<AudioClip>("newalarm.wav");
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(StupidAlarmBase));
			mls.LogInfo((object)"Stupid Alarm is loaded.");
		}
	}
}
namespace stupidAlarm.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void AlarmPatch(ref AudioClip ___alarmSFX)
		{
			AudioClip[] newSFX = StupidAlarmBase.newSFX;
			if (newSFX != null)
			{
				AudioClip val = newSFX[0];
				___alarmSFX = val;
			}
		}
	}
}