using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("Niko666")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Because double jump is lame...")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Niko666.InfiniteJump")]
[assembly: AssemblyTitle("InfiniteJump")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
{
}
}
}
namespace Niko666
{
[BepInProcess("h3vr.exe")]
[BepInPlugin("Niko666.InfiniteJump", "InfiniteJump", "1.0.0")]
public class InfiniteJump : BaseUnityPlugin
{
public const string Id = "Niko666.InfiniteJump";
internal static ManualLogSource Logger { get; private set; }
public static string Name => "InfiniteJump";
public static string Version => "1.0.0";
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
Harmony.CreateAndPatchAll(typeof(InfiniteJumpPatch), (string)null);
Logger.LogMessage((object)("Fuck this world! Sent from Niko666.InfiniteJump " + Version));
}
}
internal class InfiniteJumpPatch : MonoBehaviour
{
[HarmonyPatch(typeof(FVRMovementManager), "Jump")]
[HarmonyPrefix]
public static bool InfiniteJumping(FVRMovementManager __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Expected I4, but got Unknown
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Invalid comparison between Unknown and I4
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Invalid comparison between Unknown and I4
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Invalid comparison between Unknown and I4
__instance.DelayGround(0.1f);
float num = 0f;
GravityMode playerGravityMode = GM.Options.SimulationOptions.PlayerGravityMode;
switch ((int)playerGravityMode)
{
case 0:
num = 7.1f;
break;
case 1:
num = 5f;
break;
case 2:
num = 3f;
break;
case 3:
num = 0.001f;
break;
}
num *= 0.65f;
if ((int)__instance.Mode == 4 || (int)__instance.Mode == 2 || (int)__instance.Mode == 6)
{
__instance.DelayGround(0.25f);
__instance.m_smoothLocoVelocity.y = Mathf.Clamp(__instance.m_smoothLocoVelocity.y, 0f, __instance.m_smoothLocoVelocity.y);
__instance.m_smoothLocoVelocity.y = num;
}
return false;
}
}
}