using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BoneLib; using BoneLib.BoneMenu; using FallBoost; using Il2CppSLZ.Marrow; using Il2CppSystem.Collections.Generic; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.XR; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(FallBoostMod), "Fall Boost", "1.0.0", "TonPseudo", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("FallBoost")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FallBoost")] [assembly: AssemblyTitle("FallBoost")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 FallBoost { public class FallBoostMod : MelonMod { private enum BoostBind { LeftStickClick, RightStickClick, LeftTrigger, RightTrigger, LeftGrip, RightGrip } private static MelonPreferences_Category _category; private static MelonPreferences_Entry _enabled; private static MelonPreferences_Entry _boostSpeed; private static MelonPreferences_Entry _bindName; private BoostBind _currentBind; private bool _buttonWasPressedLastFrame; private bool _menuBuilt; public override void OnInitializeMelon() { _category = MelonPreferences.CreateCategory("FallBoost"); _enabled = _category.CreateEntry("Enabled", true, (string)null, "Active ou désactive le mod Fall Boost", false, false, (ValueValidator)null, (string)null); _boostSpeed = _category.CreateEntry("BoostSpeed", 10f, (string)null, "Vitesse verticale ajoutée vers le bas à chaque pression (m/s)", false, false, (ValueValidator)null, (string)null); _bindName = _category.CreateEntry("BindButton", BoostBind.LeftStickClick.ToString(), (string)null, "Bouton manette qui déclenche le boost de chute", false, false, (ValueValidator)null, (string)null); if (!Enum.TryParse(_bindName.Value, out _currentBind)) { _currentBind = BoostBind.LeftStickClick; } Hooking.OnUIRigCreated += SetupBoneMenu; MelonLogger.Msg("[FallBoost] Mod chargé. Bind=" + _currentBind.ToString() + " Speed=" + _boostSpeed.Value + " m/s"); } private void SetupBoneMenu() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (!_menuBuilt) { _menuBuilt = true; Page obj = Page.Root.CreatePage("Fall Boost", Color.cyan, 0, true); obj.CreateBool("Mod active", Color.green, _enabled.Value, (Action)delegate(bool val) { _enabled.Value = val; }); obj.CreateFloat("Vitesse du boost (m/s)", Color.white, _boostSpeed.Value, 1f, 1f, 40f, (Action)delegate(float val) { _boostSpeed.Value = val; }); obj.CreateEnum("Bouton de declenchement", Color.white, (Enum)_currentBind, (Action)delegate(Enum val) { _currentBind = (BoostBind)(object)val; _bindName.Value = _currentBind.ToString(); }); MelonLogger.Msg("[FallBoost] Page BoneMenu créée."); } } public override void OnUpdate() { if (_enabled.Value) { bool flag = IsBindPressed(_currentBind); if (flag && !_buttonWasPressedLastFrame) { ApplyBoost(); } _buttonWasPressedLastFrame = flag; } } private static InputDeviceCharacteristics GetHandCharacteristics(BoostBind bind) { switch (bind) { case BoostBind.LeftStickClick: case BoostBind.LeftTrigger: case BoostBind.LeftGrip: return (InputDeviceCharacteristics)256; default: return (InputDeviceCharacteristics)512; } } private static InputFeatureUsage GetUsageForBind(BoostBind bind) { switch (bind) { case BoostBind.LeftStickClick: case BoostBind.RightStickClick: return CommonUsages.primary2DAxisClick; case BoostBind.LeftTrigger: case BoostBind.RightTrigger: return CommonUsages.triggerButton; default: return CommonUsages.gripButton; } } private bool IsBindPressed(BoostBind bind) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) InputDeviceCharacteristics handCharacteristics = GetHandCharacteristics(bind); InputFeatureUsage usageForBind = GetUsageForBind(bind); List val = new List(); InputDevices.GetDevicesWithCharacteristics((InputDeviceCharacteristics)(0x40 | handCharacteristics), val); for (int i = 0; i < val.Count; i++) { InputDevice val2 = val[i]; if (((InputDevice)(ref val2)).isValid) { bool flag = false; if (((InputDevice)(ref val2)).TryGetFeatureValue(usageForBind, ref flag) && flag) { return true; } } } return false; } private void ApplyBoost() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) PhysicsRig physicsRig = Player.PhysicsRig; if ((Object)(object)physicsRig == (Object)null) { MelonLogger.Warning("[FallBoost] PhysicsRig introuvable, boost ignoré."); return; } Vector3 val = Vector3.down * _boostSpeed.Value; Rigidbody rbFeet = physicsRig.rbFeet; Rigidbody rbKnee = physicsRig.rbKnee; if ((Object)(object)rbFeet != (Object)null) { rbFeet.AddForce(val, (ForceMode)2); } if ((Object)(object)rbKnee != (Object)null) { rbKnee.AddForce(val, (ForceMode)2); } MelonLogger.Msg("[FallBoost] Boost déclenché (" + _boostSpeed.Value + " m/s, bind=" + _currentBind.ToString() + ")."); } } }