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 InfiniteFlashlight.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("InfiniteFlashlight")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InfiniteFlashlight")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e5c9470d-66c1-4bbe-bf90-bcba94c8fd7b")]
[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 InfiniteFlashlight
{
[BepInPlugin("onlyriley.flashlightfix", "Infinite Flashlight", "1.0.0.0")]
public class FlashlightMod : BaseUnityPlugin
{
private const string modGUI = "onlyriley.flashlightfix";
private const string modName = "Infinite Flashlight";
private const string modVersion = "1.0.0.0";
private readonly Harmony harmony = new Harmony("onlyriley.flashlightfix");
private static FlashlightMod Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("onlyriley.flashlightfix");
mls.LogInfo((object)"Infinite Flashlight Mod Loaded!");
harmony.PatchAll(typeof(FlashlightMod));
harmony.PatchAll(typeof(FlashlightBatteryPatch));
harmony.PatchAll(typeof(SprintRegenPatch));
}
}
}
namespace InfiniteFlashlight.Patches
{
[HarmonyPatch(typeof(Flashlight))]
internal class FlashlightBatteryPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void infiniteFlashlightPatch(ref BatteryEntry ___m_batteryEntry)
{
___m_batteryEntry.m_charge = ___m_batteryEntry.m_maxCharge;
}
}
[HarmonyPatch(typeof(PlayerController))]
internal class SprintRegenPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void fasterSprintRegenPatch(ref float ___staminaRegRate, ref float ___maxStamina)
{
___staminaRegRate = 10f;
___maxStamina = 20f;
}
}
}