Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Fruitys NotSoLethal v0.0.2
BepInEx/plugins/FruitysLethalMod.dll
Decompiled 2 years agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FruitysLethalMod.Patches; using GameNetcodeStuff; using HarmonyLib; 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("FruitysLethalMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FruitysLethalMod")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b85511d8-70c6-4804-ae2d-fd9dba0b1deb")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace FruitysLethalMod { [BepInPlugin("Fruity.LethalMod", "FruitysLethalMod", "0.0.1")] public class FruitysModBase : BaseUnityPlugin { private const string modGUID = "Fruity.LethalMod"; private const string modName = "FruitysLethalMod"; private const string modVersion = "0.0.1"; public static ConfigEntry<float> configSprintingMultiplier; public static ConfigEntry<bool> configInfiniteSprint; private readonly Harmony harmony = new Harmony("Fruity.LethalMod"); private static FruitysModBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Fruity.LethalMod"); mls.LogInfo((object)"Fruitys mod has loaded"); harmony.PatchAll(typeof(FruitysModBase)); harmony.PatchAll(typeof(PlayerControlledBPatch)); harmony.PatchAll(typeof(JetpackItemPatch)); configSprintingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Sprinting", "SprintMultiplier", 2f, "The multiplier you want applied when sprinting."); configInfiniteSprint = ((BaseUnityPlugin)this).Config.Bind<bool>("Sprinting", "InfiniteSprint", true, "Infinitely sprint?"); } } } namespace FruitysLethalMod.Patches { [HarmonyPatch(typeof(JetpackItem))] internal class JetpackItemPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void ModifyJetpack(ref Battery ___insertedBattery) { ___insertedBattery.charge = 1f; } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControlledBPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void ModifySprint(ref float ___sprintMeter, ref bool ___isSprinting, ref float ___sprintMultiplier) { if (FruitysModBase.configInfiniteSprint.Value) { ___sprintMeter = 1f; } float value = FruitysModBase.configSprintingMultiplier.Value; if (___isSprinting) { ___sprintMultiplier = value; } } } }