Decompiled source of FlashlightExtendedRange v1.1.0

ExtendedFlashlightRange.dll

Decompiled 8 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using ExtendedFlashlightRange.Patches;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
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("ExtendedFlashlightRange")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("The mod for the game flew a company that increases the radius of the lamps (works on the yellow and green lantern).")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+7bb8205b9be418e76a2e5f5f782abbbdbca96e4d")]
[assembly: AssemblyProduct("ExtendedFlashlightRange")]
[assembly: AssemblyTitle("ExtendedFlashlightRange")]
[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 ExtendedFlashlightRange
{
	[BepInPlugin("PC_Principal.ExtendedFlashlightRangeMod", "Extended Flashlight Range Mod", "1.1.0")]
	public class ExtendedFlashlightRangeModBase : BaseUnityPlugin
	{
		private const string modGUID = "PC_Principal.ExtendedFlashlightRangeMod";

		private const string modName = "Extended Flashlight Range Mod";

		private const string modVersion = "1.1.0";

		private readonly Harmony harmony = new Harmony("PC_Principal.ExtendedFlashlightRangeMod");

		private static ExtendedFlashlightRangeModBase Instance;

		internal ManualLogSource log_journal;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			log_journal = Logger.CreateLogSource("PC_Principal.ExtendedFlashlightRangeMod");
			log_journal.LogInfo((object)"Extended Flashlight Range Mod initiate started: v1.1.0");
			try
			{
				harmony.PatchAll(typeof(ExtendedFlashlightRangeModBase));
				harmony.PatchAll(typeof(FlashlightPatch));
				harmony.PatchAll(typeof(PlayerControllerBPatch));
				log_journal.LogInfo((object)"Extended Flashlight Range Mod harmony patch successfull");
			}
			catch
			{
				log_journal.LogError((object)"Extended Flashlight Range Mod: Error while harmony patching");
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ExtendedFlashlightRange";

		public const string PLUGIN_NAME = "ExtendedFlashlightRange";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace ExtendedFlashlightRange.Patches
{
	[HarmonyPatch(typeof(FlashlightItem))]
	internal class FlashlightPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchIntensityUpdate(ref FlashlightItem __instance)
		{
			__instance.flashlightBulb.intensity = 2000f;
			__instance.flashlightBulb.range = 500f;
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchIntensityUpdate(ref PlayerControllerB __instance)
		{
			__instance.helmetLight.intensity = 2500f;
			__instance.helmetLight.range = 800f;
		}
	}
}