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 balrond mountjump v1.0.2
plugins/BalrondMountJumping.dll
Decompiled 11 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; 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: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace BalrondMountJumping; [BepInPlugin("balrond.astafaraios.BalrondMountJumping", "BalrondMountJumping", "1.0.2")] public class Launch : BaseUnityPlugin { [HarmonyPatch(typeof(Sadle), "ApplyControlls")] private static class ApplyControlls_Patch { private static void Prefix(ref bool run) { if (AutoRun) { run = true; } } } [HarmonyPatch(typeof(Sadle), "ResetControlls")] private static class ResetControlls_Patch { private static void Postfix() { AutoRun = false; } } [HarmonyPatch(typeof(Player), "SetControls")] private static class SetControls_Patch { private static void Prefix(Player __instance, ref bool jump) { if (!((Character)__instance).IsRiding()) { return; } if (AutoRun && Input.GetKeyDown((KeyCode)114)) { ((Character)__instance).m_run = true; } if (jump) { IDoodadController doodadController = __instance.m_doodadController; Sadle val = (Sadle)(object)((doodadController is Sadle) ? doodadController : null); if ((Object)(object)val != (Object)null) { ((BaseAI)val.m_monsterAI).m_character.Jump(false); jump = false; } } else { jump = false; } } } private readonly Harmony harmony = new Harmony("balrond.astafaraios.BalrondMountJumping"); public const string PluginGUID = "balrond.astafaraios.BalrondMountJumping"; public const string PluginName = "BalrondMountJumping"; public const string PluginVersion = "1.0.2"; public static bool AutoRun; private void Awake() { harmony.PatchAll(); } private void OnDestroy() { harmony.UnpatchSelf(); } private static bool IsEncumbered() { if (!((Character)Player.m_localPlayer).IsEncumbered()) { return false; } ((Character)Player.m_localPlayer).Message((MessageType)2, "$se_encumbered_repeat", 0, (Sprite)null); return true; } private void Update() { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && ((Character)localPlayer).IsRiding()) { if (Input.GetKeyDown((KeyCode)114)) { AutoRun = !AutoRun; } else if (Input.GetKeyDown((KeyCode)119) || Input.GetKeyDown((KeyCode)115)) { AutoRun = false; } } } }