Decompiled source of Radio NoPower v1.0.0

RadioNoPower.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using RadioNoPower.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("ClassLibrary1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("71ca9749-96fe-471e-aa06-064156d40e96")]
[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 RadioNoPower
{
	[BepInPlugin("SYXZ.RadioNoPower", "Radio No Power", "1.0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "SYXZ.RadioNoPower";

		private const string modName = "Radio No Power";

		private const string modVersion = "1.0.0.0";

		private static Plugin instance;

		private readonly Harmony harmony = new Harmony("SYXZ.RadioNoPower");

		internal ManualLogSource logger;

		private void Awake()
		{
			if ((Object)(object)instance != (Object)null)
			{
				instance = this;
			}
			logger = Logger.CreateLogSource("SYXZ.RadioNoPower");
			logger.LogInfo((object)"Radio No Power has awoken");
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(WalkieTalkiePatch));
		}
	}
}
namespace RadioNoPower.Patches
{
	[HarmonyPatch(typeof(WalkieTalkie))]
	internal class WalkieTalkiePatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void PatchBattery(ref Item ___itemProperties)
		{
			___itemProperties.requiresBattery = false;
		}
	}
}