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 JetpackMod.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("JetpackMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JetpackMod")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9b86a88c-3260-4906-b3dc-6df7c9de0197")]
[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 JetpackMod
{
[BepInPlugin("Panda.Jetpackmod", "Jetpack Mod", "1.0.0")]
public class ModBase : BaseUnityPlugin
{
private const string modGUID = "Panda.Jetpackmod";
private const string modName = "Jetpack Mod";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Panda.Jetpackmod");
private static ModBase Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("Panda.Jetpackmod");
mls.LogInfo((object)"Mod as awoken !!!!");
harmony.PatchAll(typeof(ModBase));
harmony.PatchAll(typeof(JetpackBatteryPatch));
}
}
}
namespace JetpackMod.Patches
{
[HarmonyPatch(typeof(JetpackItem))]
internal class JetpackBatteryPatch
{
[HarmonyPatch("Update")]
[HarmonyPrefix]
private static void infiniteJetpackBatteryPrePatch(ref JetpackItem __instance)
{
((GrabbableObject)__instance).insertedBattery.charge = 1f;
if (((GrabbableObject)__instance).isBeingUsed)
{
((GrabbableObject)__instance).playerHeldBy.isPlayerDead = true;
}
}
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void infiniteJetpackBatteryPostPatch(ref JetpackItem __instance)
{
if (((GrabbableObject)__instance).isBeingUsed)
{
((GrabbableObject)__instance).playerHeldBy.isPlayerDead = false;
}
}
}
}