using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.BoneMenu.Elements;
using MelonLoader;
using MelonLoader.Preferences;
using ParkourMovement;
using ParkourMovement.InternalHelpers;
using SLZ.Rig;
using SLZ.Vehicle;
using UnhollowerBaseLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(ParkourMovementMod), "ParkourMovement", "1.0.1", "Blockchat", null)]
[assembly: AssemblyTitle("ParkourMovement")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ParkourMovement")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1d88aaf5-9850-4a65-a4b1-39c84e809c1b")]
[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 ParkourMovement
{
internal static class MelonPrefs
{
public static MelonPreferences_Category MelonPrefCategory { get; private set; }
public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }
public static bool isEnabled { get; set; }
public static MenuCategory BoneMenuCategory { get; private set; }
public static BoolElement EnabledElement { get; private set; }
public static bool isWREnabled { get; private set; }
public static MelonPreferences_Entry<bool> MelonPrefWREnabled { get; private set; }
public static BoolElement WREnabledElement { get; private set; }
public static MelonPreferences_Entry<bool> MelonPrefWJEnabled { get; private set; }
public static bool isWJEnabled { get; private set; }
public static BoolElement WJEnabledElement { get; private set; }
public static bool isSlEnabled { get; private set; }
public static MelonPreferences_Entry<bool> MelonPrefSlEnabled { get; private set; }
public static BoolElement SlEnabledElement { get; private set; }
public static MelonPreferences_Entry<bool> MelonPrefDJEnabled { get; private set; }
public static bool isDJEnabled { get; private set; }
public static BoolElement DJEnabledElement { get; private set; }
public static MelonPreferences_Entry<float> MelonPrefWRFMult { get; private set; }
public static FloatElement WRFMultElement { get; private set; }
public static MelonPreferences_Entry<float> MelonPrefWRWCLength { get; private set; }
public static FloatElement WRWCLengthElement { get; private set; }
public static MelonPreferences_Entry<float> MelonPrefWJMult { get; private set; }
public static FloatElement WJMultElement { get; private set; }
public static MelonPreferences_Entry<float> MelonPrefMSLVel { get; private set; }
public static FloatElement MSLVelElement { get; private set; }
public static void SetupMelonPrefs()
{
MelonPrefCategory = MelonPreferences.CreateCategory("Parkour");
MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("isEnabled", true, "Enabled", (string)null, false, false, (ValueValidator)null, (string)null);
isEnabled = MelonPrefEnabled.Value;
MelonPrefWREnabled = MelonPrefCategory.CreateEntry<bool>("isWREnabled", true, "Wallrun Enabled", (string)null, false, false, (ValueValidator)null, (string)null);
isWREnabled = MelonPrefWREnabled.Value;
MelonPrefSlEnabled = MelonPrefCategory.CreateEntry<bool>("isSlEnabled", true, "Slide Enabled", (string)null, false, false, (ValueValidator)null, (string)null);
isSlEnabled = MelonPrefSlEnabled.Value;
MelonPrefDJEnabled = MelonPrefCategory.CreateEntry<bool>("isDJEnabled", true, "Double Jump Enabled", (string)null, false, false, (ValueValidator)null, (string)null);
isDJEnabled = MelonPrefDJEnabled.Value;
MelonPrefWJEnabled = MelonPrefCategory.CreateEntry<bool>("isWJEnabled", true, "Wall Jump Enabled", (string)null, false, false, (ValueValidator)null, (string)null);
isWJEnabled = MelonPrefWJEnabled.Value;
MelonPrefWRFMult = MelonPrefCategory.CreateEntry<float>("WRFMult", 1f, "Wallrun Forward Multiplier", (string)null, false, false, (ValueValidator)null, (string)null);
ParkourMovementMod.WRFwdMult = MelonPrefWRFMult.Value;
MelonPrefWRWCLength = MelonPrefCategory.CreateEntry<float>("WRWCLength", 1f, "Wall Check Distance", (string)null, false, false, (ValueValidator)null, (string)null);
ParkourMovementMod.normWallCheckLength = MelonPrefWRWCLength.Value;
MelonPrefWJMult = MelonPrefCategory.CreateEntry<float>("WJMult", 60f, "Wall Jump Multiplier", (string)null, false, false, (ValueValidator)null, (string)null);
ParkourMovementMod.WJForceMult = MelonPrefWJMult.Value;
MelonPrefMSLVel = MelonPrefCategory.CreateEntry<float>("MSLVel", 0.15f, "Max Slide Velocity", (string)null, false, false, (ValueValidator)null, (string)null);
ParkourMovementMod.maxSlVel = MelonPrefMSLVel.Value;
}
public static void SetupBoneMenu()
{
//IL_0006: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
BoneMenuCategory = MenuManager.CreateCategory("Parkour", Color.white);
EnabledElement = BoneMenuCategory.CreateBoolElement("Mod Toggle", Color.white, isEnabled, (Action<bool>)OnSetEnabled);
WREnabledElement = BoneMenuCategory.CreateBoolElement("Wallrun Toggle", Color.white, isWREnabled, (Action<bool>)OnSetWREnabled);
SlEnabledElement = BoneMenuCategory.CreateBoolElement("Slide Toggle", Color.white, isSlEnabled, (Action<bool>)OnSetSlEnabled);
DJEnabledElement = BoneMenuCategory.CreateBoolElement("Double Jump Toggle", Color.white, isDJEnabled, (Action<bool>)OnSetDJEnabled);
WJEnabledElement = BoneMenuCategory.CreateBoolElement("Wall Jump Toggle", Color.white, isWJEnabled, (Action<bool>)OnSetWJEnabled);
WRFMultElement = BoneMenuCategory.CreateFloatElement("Wallrun Forward Mult", Color.white, ParkourMovementMod.WRFwdMult, 0.25f, 0f, 10f, (Action<float>)OnSetWRFwdMult);
WRWCLengthElement = BoneMenuCategory.CreateFloatElement("Wall Check Distance", Color.white, ParkourMovementMod.normWallCheckLength, 0.25f, 0.25f, 5f, (Action<float>)OnSetWRWCLength);
WJMultElement = BoneMenuCategory.CreateFloatElement("Walljump Force Mult", Color.white, ParkourMovementMod.WJForceMult, 5f, 5f, 300f, (Action<float>)OnSetWJMult);
MSLVelElement = BoneMenuCategory.CreateFloatElement("Max Slide Velocity", Color.white, ParkourMovementMod.maxSlVel, 0.01f, 0.01f, 0.3f, (Action<float>)OnSetMSLVel);
}
public static void OnSetEnabled(bool value)
{
isEnabled = value;
MelonPrefEnabled.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetWREnabled(bool value)
{
isWREnabled = value;
MelonPrefWREnabled.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetSlEnabled(bool value)
{
isSlEnabled = value;
MelonPrefSlEnabled.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetDJEnabled(bool value)
{
isDJEnabled = value;
Player.remapRig.doubleJump = value;
MelonPrefDJEnabled.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetWJEnabled(bool value)
{
isWJEnabled = value;
MelonPrefWJEnabled.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetWRFwdMult(float value)
{
ParkourMovementMod.WRFwdMult = value;
MelonPrefWRFMult.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetWRWCLength(float value)
{
ParkourMovementMod.normWallCheckLength = value;
MelonPrefWRWCLength.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetWJMult(float value)
{
ParkourMovementMod.WJForceMult = value;
MelonPrefWJMult.Value = value;
MelonPrefCategory.SaveToFile(false);
}
public static void OnSetMSLVel(float value)
{
ParkourMovementMod.maxSlVel = value;
MelonPrefMSLVel.Value = value;
MelonPrefCategory.SaveToFile(false);
}
}
public class ParkourMovementMod : MelonMod
{
public static ParkourMovementMod Instance;
public static bool isReady = false;
public PhysicsRig Phys;
public Transform head;
public Rigidbody pelvis;
public RigManager RM;
public BaseController controller;
public float CurrWallCheckLength = 1f;
public float WRStickMult = 0.3f;
public static float WRFwdMult = 1f;
public float WRUptimeMult = 0.25f;
public float WRMinFU = 1f;
public float WRWallCheckLength = 3f;
public static float normWallCheckLength = 1f;
public static float WJForceMult = 60f;
public float ungVel = 0.5f;
public float minVelForWR = 0.4f;
public float wallRunAngle;
public float MaxWRSpeed = 8.25f;
public Camera cam;
public LayerMask WallMask;
public bool canWallRun = true;
public bool isInWR = false;
public int framesUngrounded = 0;
public float minSlVel = 1.2f;
public float crouch;
public float MinSlCrouch = -0.5f;
public bool isInSlide = false;
public float SlSpeedMult = 6400f;
public float SlEndTime;
public static float maxSlVel = 0.15f;
public Seat SlidingSeat;
public Vector3 dir;
public float seatVelIncr = 0.35f;
public float currSlVel;
public float seatGrav = 2.6f;
public bool midAirSlid;
public static AssetBundle SlidingSeatBundle;
public static GameObject SlidingSeatObj;
public const string SSBundleName = "ParkourMovement.dependencies.slidingseat.bundle";
public const string SSQBundleName = "ParkourMovement.dependencies.slidingseatQuest.bundle";
public override void OnPreferencesLoaded()
{
MelonPrefs.isEnabled = MelonPrefs.MelonPrefEnabled.Value;
((GenericElement<bool>)(object)MelonPrefs.EnabledElement).SetValue(MelonPrefs.isEnabled);
((GenericElement<bool>)(object)MelonPrefs.WREnabledElement).SetValue(MelonPrefs.isWREnabled);
((GenericElement<bool>)(object)MelonPrefs.SlEnabledElement).SetValue(MelonPrefs.isSlEnabled);
((GenericElement<bool>)(object)MelonPrefs.DJEnabledElement).SetValue(MelonPrefs.isDJEnabled);
((GenericElement<bool>)(object)MelonPrefs.WJEnabledElement).SetValue(MelonPrefs.isWJEnabled);
((GenericElement<float>)(object)MelonPrefs.WRFMultElement).SetValue(WRFwdMult);
((GenericElement<float>)(object)MelonPrefs.WRWCLengthElement).SetValue(normWallCheckLength);
}
public override void OnInitializeMelon()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
WallMask = LayerMask.op_Implicit(LayerMask.op_Implicit(WallMask) | 1);
WallMask = LayerMask.op_Implicit(LayerMask.op_Implicit(WallMask) | 0x2000);
MelonPrefs.SetupMelonPrefs();
MelonPrefs.SetupBoneMenu();
Sliding.Setup();
WallStuff.Setup();
if (HelperMethods.IsAndroid())
{
SlidingSeatBundle = EmbeddedAssembly.LoadFromAssembly(Assembly.GetExecutingAssembly(), "ParkourMovement.dependencies.slidingseatQuest.bundle");
}
else
{
SlidingSeatBundle = EmbeddedAssembly.LoadFromAssembly(Assembly.GetExecutingAssembly(), "ParkourMovement.dependencies.slidingseat.bundle");
}
if ((Object)(object)SlidingSeatBundle == (Object)null)
{
MelonLogger.Msg("failed to load target bundle, check dll / check you made target bundle into embedded resource");
}
Il2CppReferenceArray<Object> val = SlidingSeatBundle.LoadAllAssets();
((Il2CppArrayBase<Object>)(object)val)[0].hideFlags = (HideFlags)32;
SlidingSeatObj = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[0]).TryCast<GameObject>();
}
public override void OnFixedUpdate()
{
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Player.physicsRig != (Object)null && !isReady)
{
RM = Player.rigManager;
Phys = Player.physicsRig;
head = Player.playerHead;
pelvis = Phys.torso.rbPelvis;
controller = Player.rightController;
isReady = true;
}
else if ((Object)(object)Player.physicsRig == (Object)null)
{
isReady = false;
Phys = null;
head = null;
pelvis = null;
controller = null;
SlidingSeat = null;
}
if (!MelonPrefs.isEnabled || !isReady)
{
return;
}
Vector3 wholeBodyVelocity;
if (MelonPrefs.isWREnabled)
{
WallStuff.UpdateGroundedVariables();
if (isInWR)
{
CurrWallCheckLength = WRWallCheckLength;
Player.remapRig.doubleJump = false;
if (Player.rightController.GetAButtonDown() && MelonPrefs.isWJEnabled)
{
WallStuff.WallJump();
}
}
else
{
Player.remapRig.doubleJump = MelonPrefs.isDJEnabled;
}
if ((float)framesUngrounded >= WRMinFU && canWallRun)
{
wholeBodyVelocity = Phys.wholeBodyVelocity;
if (((Vector3)(ref wholeBodyVelocity)).magnitude > minVelForWR)
{
RaycastHit hit = default(RaycastHit);
if (Physics.Raycast(head.position, head.right, ref hit, CurrWallCheckLength, LayerMask.op_Implicit(WallMask), (QueryTriggerInteraction)1))
{
WallStuff.WallRun(rightSide: true, hit);
}
if (Physics.Raycast(head.position, -head.right, ref hit, CurrWallCheckLength, LayerMask.op_Implicit(WallMask), (QueryTriggerInteraction)1))
{
WallStuff.WallRun(rightSide: false, hit);
}
}
}
}
if (!MelonPrefs.isSlEnabled)
{
return;
}
crouch = controller._thumbstickAxis.y;
if (midAirSlid && Mathf.Abs(Phys.wholeBodyVelocity.y) < ungVel)
{
midAirSlid = false;
}
if (isInSlide)
{
if (Time.time >= SlEndTime || crouch > MinSlCrouch)
{
Sliding.EndSlide();
}
else
{
Sliding.Slide();
}
}
else if (crouch < MinSlCrouch)
{
wholeBodyVelocity = Phys.wholeBodyVelocity;
if (((Vector3)(ref wholeBodyVelocity)).magnitude > minSlVel && Mathf.Abs(Phys.wholeBodyVelocity.y) < minSlVel && !midAirSlid)
{
Sliding.SetupSlide();
}
}
}
}
internal static class Sliding
{
private static ParkourMovementMod PM;
public static void Setup()
{
PM = ParkourMovementMod.Instance;
}
public static void SetupSlide()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
PM.isInSlide = true;
PM.SlidingSeat = Object.Instantiate<GameObject>(ParkourMovementMod.SlidingSeatObj).GetComponent<Seat>();
PM.SlidingSeat.seatRb = ((Component)PM.SlidingSeat).gameObject.GetComponent<Rigidbody>();
((Component)PM.SlidingSeat).transform.position = PM.pelvis.position;
PM.dir = ((Component)PM.head).transform.forward;
PM.dir = new Vector3(PM.dir.x, 0f, PM.dir.z);
PM.currSlVel = 0f;
((Component)PM.SlidingSeat).transform.eulerAngles = new Vector3(70f, 0f, 0f);
PM.SlidingSeat.Register(PM.RM);
((Component)PM.SlidingSeat).transform.forward = ((Component)PM.head).transform.forward;
((Component)PM.SlidingSeat).transform.eulerAngles = new Vector3(0f, ((Component)PM.SlidingSeat).transform.eulerAngles.y, ((Component)PM.SlidingSeat).transform.eulerAngles.z);
PM.SlEndTime = Time.time + 2f;
}
public static void EndSlide()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
PM.isInSlide = false;
PM.pelvis.velocity = Vector3.zero;
PM.SlidingSeat.DeRegister();
Object.Destroy((Object)(object)((Component)PM.SlidingSeat).gameObject);
}
public static void Slide()
{
//IL_0044: 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)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
PM.currSlVel = Mathf.Clamp(PM.currSlVel + PM.seatVelIncr * Time.deltaTime, 0f, ParkourMovementMod.maxSlVel);
Vector3 val = ((Component)PM.SlidingSeat).transform.position + PM.currSlVel * PM.dir;
if (!Physics.Raycast(((Component)PM.SlidingSeat).transform.position + new Vector3(0f, 0.3f, 0f), Vector3.down, 0.5f, LayerMask.op_Implicit(PM.WallMask)))
{
val.y -= PM.seatGrav * Time.deltaTime;
PM.midAirSlid = true;
}
PM.SlidingSeat.seatRb.MovePosition(val);
}
}
internal static class WallStuff
{
private static ParkourMovementMod PM;
public static void Setup()
{
PM = ParkourMovementMod.Instance;
}
public static void UpdateGroundedVariables()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if (Mathf.Abs(PM.Phys.wholeBodyVelocity.y) > PM.ungVel)
{
PM.framesUngrounded++;
return;
}
PM.framesUngrounded = 0;
PM.isInWR = false;
PM.CurrWallCheckLength = ParkourMovementMod.normWallCheckLength;
}
public static void WallJump()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
PM.pelvis.velocity = Vector3.zero;
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(PM.head.forward.x * ParkourMovementMod.WJForceMult, PM.head.forward.y * ParkourMovementMod.WJForceMult, PM.head.forward.z * ParkourMovementMod.WJForceMult);
PM.pelvis.AddForce(val, (ForceMode)2);
}
public static void WallRun(bool rightSide, RaycastHit hit)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
if (!(Vector3.Angle(Vector3.down, ((RaycastHit)(ref hit)).normal) > 80f))
{
return;
}
if (rightSide)
{
if (!PM.isInWR)
{
PM.pelvis.velocity = Vector3.zero;
}
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(0f - ((RaycastHit)(ref hit)).normal.z, 0f, ((RaycastHit)(ref hit)).normal.x);
if (Vector3.Angle(val, PM.head.forward) >= 90f)
{
val = -val;
}
Vector3 val2 = new Vector3((0f - ((RaycastHit)(ref hit)).normal.x) * PM.WRStickMult, (0f - ((RaycastHit)(ref hit)).normal.y) * PM.WRStickMult, (0f - ((RaycastHit)(ref hit)).normal.z) * PM.WRStickMult) + new Vector3(val.x * ParkourMovementMod.WRFwdMult, PM.WRUptimeMult, val.z * ParkourMovementMod.WRFwdMult);
PM.pelvis.AddForce(val2, (ForceMode)2);
PM.pelvis.velocity = Vector3.ClampMagnitude(PM.pelvis.velocity, PM.MaxWRSpeed);
PM.isInWR = true;
}
else
{
if (!PM.isInWR)
{
PM.pelvis.velocity = Vector3.zero;
}
Vector3 val3 = default(Vector3);
((Vector3)(ref val3))..ctor(0f - ((RaycastHit)(ref hit)).normal.z, 0f, ((RaycastHit)(ref hit)).normal.x);
if (Vector3.Angle(val3, PM.head.forward) >= 90f)
{
val3 = -val3;
}
Vector3 val4 = new Vector3((0f - ((RaycastHit)(ref hit)).normal.x) * PM.WRStickMult, (0f - ((RaycastHit)(ref hit)).normal.y) * PM.WRStickMult, (0f - ((RaycastHit)(ref hit)).normal.z) * PM.WRStickMult) + new Vector3(val3.x * ParkourMovementMod.WRFwdMult, PM.WRUptimeMult, val3.z * ParkourMovementMod.WRFwdMult);
PM.pelvis.AddForce(val4, (ForceMode)2);
PM.pelvis.velocity = Vector3.ClampMagnitude(PM.pelvis.velocity, PM.MaxWRSpeed);
PM.isInWR = true;
}
}
}
}
namespace ParkourMovement.InternalHelpers
{
public static class EmbeddedAssembly
{
internal static byte[] Internal_LoadFromAssembly(Assembly assembly, string name)
{
string[] manifestResourceNames = assembly.GetManifestResourceNames();
if (manifestResourceNames.Contains(name))
{
using (Stream stream = assembly.GetManifestResourceStream(name))
{
using MemoryStream memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
return null;
}
public static void LoadAssembly(string name)
{
byte[] rawAssembly = Internal_LoadFromAssembly(Assembly.GetExecutingAssembly(), name);
Assembly.Load(rawAssembly);
}
public static AssetBundle LoadFromAssembly(Assembly assembly, string name)
{
string[] manifestResourceNames = assembly.GetManifestResourceNames();
foreach (string text in manifestResourceNames)
{
MelonLogger.Msg(text);
}
Stream manifestResourceStream = assembly.GetManifestResourceStream(name);
MemoryStream memoryStream = new MemoryStream();
manifestResourceStream.CopyTo(memoryStream);
byte[] array = memoryStream.ToArray();
return AssetBundle.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array));
}
public static T LoadPersistentAsset<T>(this AssetBundle bundle, string name) where T : Object
{
Object val = bundle.LoadAsset(name);
if (val != (Object)null)
{
val.hideFlags = (HideFlags)32;
return ((Il2CppObjectBase)val).TryCast<T>();
}
return default(T);
}
}
}