Decompiled source of Parkour Knuckle v1.4.8
BepInEx/plugins/ParkourKnuckle/ParkourKnuckle.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; 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 BepInEx; using BepInEx.Configuration; using HarmonyLib; using ParkourKnuckle.UI; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("KnuckleTesting")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KnuckleTesting")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9407f467-496e-4117-8715-bdfe3bce9f1b")] [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 ParkourKnuckle { [BepInPlugin("com.nimius.parkourknuckle", "Parkour Knuckle", "1.4.8")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static ConfigEntry<bool> EnableParkourRotation; public static ConfigEntry<bool> EnableParkourFOV; public static ConfigEntry<bool> EnableParkourShake; public static ConfigEntry<bool> EnableWallRunHelper; public static bool isUIVisible = false; public static ConfigFile ProgressionFile; public static Dictionary<string, ConfigEntryBase> SkillConfigs = new Dictionary<string, ConfigEntryBase>(); private void Awake() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown EnableParkourRotation = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera Settings", "Use Parkour Rotation", true, "Determines whether the camera will tilt and rotate differently during wall runs and rolls."); EnableParkourFOV = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera Settings", "Use Parkour FOV", true, "Determines whether the camera will zoom in and out while charging, leaping, and sliding."); EnableParkourShake = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera Settings", "Use Parkour Shake", true, "Determines whether the camera will shake while wall running and charging."); EnableWallRunHelper = ((BaseUnityPlugin)this).Config.Bind<bool>("UI Settings", "Use the Wall Run Helper", false, "When a wall run is able to be performed, the sides of your screen will glow."); string text = Path.Combine(Paths.ConfigPath, "parkourprogress.cfg"); ProgressionFile = new ConfigFile(text, true); SkillConfigs["QuickTurning"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "QuickTurning", false, ""); SkillConfigs["Sliding"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "Sliding", false, ""); SkillConfigs["SlideJumping"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "SlideJumping", false, ""); SkillConfigs["Leaping"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "Leaping", false, ""); SkillConfigs["Rolling"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "Rolling", false, ""); SkillConfigs["WallKicking"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "WallKicking", false, ""); SkillConfigs["WallRunning"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "WallRunning", false, ""); SkillConfigs["VerticalWallRunning"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "VerticalWallRunning", false, ""); SkillConfigs["WallRunBoost"] = (ConfigEntryBase)(object)ProgressionFile.Bind<bool>("Progression", "WallRunBoost", false, ""); SkillConfigs["HeightCurrency"] = (ConfigEntryBase)(object)ProgressionFile.Bind<float>("Currency", "HeightCurrency", 0f, ""); SkillConfigs["MaxHeight"] = (ConfigEntryBase)(object)ProgressionFile.Bind<float>("Currency", "MaxHeight", 0f, ""); _harmony = new Harmony("com.nimius.parkourknuckle"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Parkour Knuckle Patches Applied Successfully."); ParkourUI.Initialize(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Parkour Knuckle Initialized."); } } [HarmonyPatch(typeof(ENT_Player), "Update")] public class PlayerModifierPatch { private static Quaternion targetRotation; private static bool isRotating = false; private static readonly float turnSpeed = 24f; public static bool onCooldown = false; public static readonly float CooldownDur = 0.2f; public static float CooldownTime = 0f; public static float chargeStartTime; public static bool isCharging; public static float currentCharge; public static readonly float maxChargeTime = 3.5f; public static float leapCooldownTime = 0f; public static readonly float leapCooldownDur = 2f; private static readonly float leapForceMultiplier = 1f; public static bool leapCooldown = false; private static readonly float minStamina = 1f; private static readonly float maxStamina = 6f; private static readonly float upwardArcForce = 1f; private static bool isHolding = false; public static bool hasWallRunInAir = false; private static readonly float tiltLerpSpeed = 4f; private static float gripValue = 0f; public static bool isHorizRun = false; private static int spaceTapCount = 0; private static float spaceTapTimer = 0f; private const float doubleTapWindow = 0.3f; public static bool wallLeft; public static bool wallRight; public static bool canRun; public static bool isVerticalRun = false; public static bool hasWallRunVertical = false; private static float verticalGraceTimer = 0f; private static readonly float maxGraceTime = 0.2f; public static bool wallFront; public static bool canVert; private static bool isVaulting = false; private static Vector3 vaultTargetPos; private static float vaultTimer = 0f; private static readonly float vaultDuration = 2f; private static bool isSliding = false; private static readonly float minSlideSpeed = 6f; private static Vector3 slideDir; private static bool canSlide = true; private static float slideTime = 0f; private static readonly float slideDuration = 1.8f; private static Vector3 slideStartPos; private static Vector3 slideTargetPos; private static float startY; private static bool wasGrounded; private static bool isRotatingRoll = false; private static Quaternion startRotationRoll; private static Vector3 rollStartPos; private static Vector3 rollTargetPos; private static Vector3 rollDir; private static float rollTimer = 0f; private static readonly float rollDur = 0.5f; private static bool cancelNextRollingFallDamage = false; private static float rollingFallDamageCancelExpiresAt = -1f; private const float rollingFallDamageCancelGrace = 0.2f; public static float levelHighestHeight; public static int highestMilestone = 0; public static float liveRunHeight = 0f; public static bool isConsumableUltimate = false; public static int roidedCount = 0; public static float previousCurrency = 0f; private static void ArmRollingFallDamageCancel() { cancelNextRollingFallDamage = true; rollingFallDamageCancelExpiresAt = Time.time + 0.2f; } private static void ExpireRollingFallDamageCancel() { if (cancelNextRollingFallDamage && Time.time > rollingFallDamageCancelExpiresAt) { cancelNextRollingFallDamage = false; rollingFallDamageCancelExpiresAt = -1f; } } public static bool TryCancelRollingFallDamage(DamageInfo info) { ExpireRollingFallDamageCancel(); if (!cancelNextRollingFallDamage || info == null || !info.HasTag("falling")) { return false; } cancelNextRollingFallDamage = false; rollingFallDamageCancelExpiresAt = -1f; return true; } [HarmonyPostfix] public static void Postfix(ENT_Player __instance) { //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_095a: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c66: Unknown result type (might be due to invalid IL or missing references) //IL_0c6b: Unknown result type (might be due to invalid IL or missing references) //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_0c7e: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0cd6: Unknown result type (might be due to invalid IL or missing references) //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0a22: Unknown result type (might be due to invalid IL or missing references) //IL_0a19: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_0a29: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Unknown result type (might be due to invalid IL or missing references) //IL_0a51: Unknown result type (might be due to invalid IL or missing references) //IL_0a82: Unknown result type (might be due to invalid IL or missing references) //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0aa4: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0ad4: Unknown result type (might be due to invalid IL or missing references) //IL_0ad6: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0aec: Unknown result type (might be due to invalid IL or missing references) //IL_0af1: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b11: Unknown result type (might be due to invalid IL or missing references) //IL_0b1d: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0b4c: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b5b: Unknown result type (might be due to invalid IL or missing references) //IL_0e53: Unknown result type (might be due to invalid IL or missing references) //IL_0e5a: Unknown result type (might be due to invalid IL or missing references) //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_0e6f: Unknown result type (might be due to invalid IL or missing references) //IL_0e76: Unknown result type (might be due to invalid IL or missing references) //IL_0e86: Unknown result type (might be due to invalid IL or missing references) //IL_0e8b: Unknown result type (might be due to invalid IL or missing references) //IL_0e90: Unknown result type (might be due to invalid IL or missing references) //IL_0e93: Unknown result type (might be due to invalid IL or missing references) //IL_0f45: Unknown result type (might be due to invalid IL or missing references) //IL_0f4a: Unknown result type (might be due to invalid IL or missing references) //IL_0f54: Unknown result type (might be due to invalid IL or missing references) //IL_0f65: Unknown result type (might be due to invalid IL or missing references) //IL_0f6a: Unknown result type (might be due to invalid IL or missing references) //IL_1464: Unknown result type (might be due to invalid IL or missing references) //IL_1474: Unknown result type (might be due to invalid IL or missing references) //IL_1489: Unknown result type (might be due to invalid IL or missing references) //IL_148b: Unknown result type (might be due to invalid IL or missing references) //IL_1490: Unknown result type (might be due to invalid IL or missing references) //IL_1492: Unknown result type (might be due to invalid IL or missing references) //IL_1011: Unknown result type (might be due to invalid IL or missing references) //IL_1016: Unknown result type (might be due to invalid IL or missing references) //IL_105a: Unknown result type (might be due to invalid IL or missing references) //IL_105f: Unknown result type (might be due to invalid IL or missing references) //IL_1064: Unknown result type (might be due to invalid IL or missing references) //IL_106c: Unknown result type (might be due to invalid IL or missing references) //IL_1071: Unknown result type (might be due to invalid IL or missing references) //IL_107b: Unknown result type (might be due to invalid IL or missing references) //IL_1080: Unknown result type (might be due to invalid IL or missing references) //IL_1085: Unknown result type (might be due to invalid IL or missing references) //IL_1087: Unknown result type (might be due to invalid IL or missing references) //IL_1089: Unknown result type (might be due to invalid IL or missing references) //IL_1097: Unknown result type (might be due to invalid IL or missing references) //IL_109e: Unknown result type (might be due to invalid IL or missing references) //IL_10a3: Unknown result type (might be due to invalid IL or missing references) //IL_10a8: Unknown result type (might be due to invalid IL or missing references) //IL_17c6: Unknown result type (might be due to invalid IL or missing references) //IL_17cb: Unknown result type (might be due to invalid IL or missing references) //IL_17de: Unknown result type (might be due to invalid IL or missing references) //IL_17e3: Unknown result type (might be due to invalid IL or missing references) //IL_17eb: Unknown result type (might be due to invalid IL or missing references) //IL_17f0: Unknown result type (might be due to invalid IL or missing references) //IL_17fa: Unknown result type (might be due to invalid IL or missing references) //IL_17ff: Unknown result type (might be due to invalid IL or missing references) //IL_1804: Unknown result type (might be due to invalid IL or missing references) //IL_180e: Unknown result type (might be due to invalid IL or missing references) //IL_1813: Unknown result type (might be due to invalid IL or missing references) //IL_1818: Unknown result type (might be due to invalid IL or missing references) //IL_1532: Unknown result type (might be due to invalid IL or missing references) //IL_1537: Unknown result type (might be due to invalid IL or missing references) //IL_154c: Unknown result type (might be due to invalid IL or missing references) //IL_1551: Unknown result type (might be due to invalid IL or missing references) //IL_1556: Unknown result type (might be due to invalid IL or missing references) //IL_155b: Unknown result type (might be due to invalid IL or missing references) //IL_1570: Unknown result type (might be due to invalid IL or missing references) //IL_1575: Unknown result type (might be due to invalid IL or missing references) //IL_157a: Unknown result type (might be due to invalid IL or missing references) //IL_10c0: Unknown result type (might be due to invalid IL or missing references) //IL_10c5: Unknown result type (might be due to invalid IL or missing references) //IL_1834: Unknown result type (might be due to invalid IL or missing references) //IL_1839: Unknown result type (might be due to invalid IL or missing references) //IL_1632: Unknown result type (might be due to invalid IL or missing references) //IL_1639: Unknown result type (might be due to invalid IL or missing references) //IL_163e: Unknown result type (might be due to invalid IL or missing references) //IL_1645: Unknown result type (might be due to invalid IL or missing references) //IL_164a: Unknown result type (might be due to invalid IL or missing references) //IL_164f: Unknown result type (might be due to invalid IL or missing references) //IL_1142: Unknown result type (might be due to invalid IL or missing references) //IL_114d: Unknown result type (might be due to invalid IL or missing references) //IL_10e6: Unknown result type (might be due to invalid IL or missing references) //IL_10eb: Unknown result type (might be due to invalid IL or missing references) //IL_10f5: Unknown result type (might be due to invalid IL or missing references) //IL_10fa: Unknown result type (might be due to invalid IL or missing references) //IL_1104: Unknown result type (might be due to invalid IL or missing references) //IL_1a84: Unknown result type (might be due to invalid IL or missing references) //IL_1191: Unknown result type (might be due to invalid IL or missing references) //IL_1193: Unknown result type (might be due to invalid IL or missing references) //IL_1d64: Unknown result type (might be due to invalid IL or missing references) //IL_1ad6: Unknown result type (might be due to invalid IL or missing references) //IL_18bd: Unknown result type (might be due to invalid IL or missing references) //IL_18c2: Unknown result type (might be due to invalid IL or missing references) //IL_18cc: Unknown result type (might be due to invalid IL or missing references) //IL_18d1: Unknown result type (might be due to invalid IL or missing references) //IL_18db: Unknown result type (might be due to invalid IL or missing references) //IL_12f3: Unknown result type (might be due to invalid IL or missing references) //IL_12fd: Unknown result type (might be due to invalid IL or missing references) //IL_1318: Unknown result type (might be due to invalid IL or missing references) //IL_131d: Unknown result type (might be due to invalid IL or missing references) //IL_1320: Unknown result type (might be due to invalid IL or missing references) //IL_12d5: Unknown result type (might be due to invalid IL or missing references) //IL_12da: Unknown result type (might be due to invalid IL or missing references) //IL_12e7: Unknown result type (might be due to invalid IL or missing references) //IL_11ac: Unknown result type (might be due to invalid IL or missing references) //IL_11ae: Unknown result type (might be due to invalid IL or missing references) //IL_11b5: Unknown result type (might be due to invalid IL or missing references) //IL_11ba: Unknown result type (might be due to invalid IL or missing references) //IL_11bf: Unknown result type (might be due to invalid IL or missing references) //IL_11c1: Unknown result type (might be due to invalid IL or missing references) //IL_11c3: Unknown result type (might be due to invalid IL or missing references) //IL_1be8: Unknown result type (might be due to invalid IL or missing references) //IL_1bf9: Unknown result type (might be due to invalid IL or missing references) //IL_1bfe: Unknown result type (might be due to invalid IL or missing references) //IL_19f1: Unknown result type (might be due to invalid IL or missing references) //IL_16bf: Unknown result type (might be due to invalid IL or missing references) //IL_11e0: Unknown result type (might be due to invalid IL or missing references) //IL_11e5: Unknown result type (might be due to invalid IL or missing references) //IL_11ef: Unknown result type (might be due to invalid IL or missing references) //IL_11f4: Unknown result type (might be due to invalid IL or missing references) //IL_11f9: Unknown result type (might be due to invalid IL or missing references) //IL_11fb: Unknown result type (might be due to invalid IL or missing references) //IL_11fd: Unknown result type (might be due to invalid IL or missing references) //IL_11ff: Unknown result type (might be due to invalid IL or missing references) //IL_1c62: Unknown result type (might be due to invalid IL or missing references) //IL_1c67: Unknown result type (might be due to invalid IL or missing references) //IL_1c6e: Unknown result type (might be due to invalid IL or missing references) //IL_1c73: Unknown result type (might be due to invalid IL or missing references) //IL_1c7b: Unknown result type (might be due to invalid IL or missing references) //IL_1c80: Unknown result type (might be due to invalid IL or missing references) //IL_1c8a: Unknown result type (might be due to invalid IL or missing references) //IL_1c8f: Unknown result type (might be due to invalid IL or missing references) //IL_1c94: Unknown result type (might be due to invalid IL or missing references) //IL_1c9e: Unknown result type (might be due to invalid IL or missing references) //IL_1ca3: Unknown result type (might be due to invalid IL or missing references) //IL_1ca8: Unknown result type (might be due to invalid IL or missing references) //IL_1c23: Unknown result type (might be due to invalid IL or missing references) //IL_1233: Unknown result type (might be due to invalid IL or missing references) //IL_1238: Unknown result type (might be due to invalid IL or missing references) //IL_1242: Unknown result type (might be due to invalid IL or missing references) //IL_1247: Unknown result type (might be due to invalid IL or missing references) //IL_1251: Unknown result type (might be due to invalid IL or missing references) //IL_1cc4: Unknown result type (might be due to invalid IL or missing references) //IL_1cc9: Unknown result type (might be due to invalid IL or missing references) //IL_1b1f: Unknown result type (might be due to invalid IL or missing references) //IL_1b24: Unknown result type (might be due to invalid IL or missing references) //IL_1b3d: Unknown result type (might be due to invalid IL or missing references) //IL_1b42: Unknown result type (might be due to invalid IL or missing references) //IL_1b67: Unknown result type (might be due to invalid IL or missing references) //IL_1b6c: Unknown result type (might be due to invalid IL or missing references) //IL_1b71: Unknown result type (might be due to invalid IL or missing references) //IL_1b76: Unknown result type (might be due to invalid IL or missing references) //IL_1b80: Unknown result type (might be due to invalid IL or missing references) //IL_1b85: Unknown result type (might be due to invalid IL or missing references) //IL_1b8a: Unknown result type (might be due to invalid IL or missing references) //IL_1a3c: Unknown result type (might be due to invalid IL or missing references) //IL_1a56: Unknown result type (might be due to invalid IL or missing references) //IL_1a5b: Unknown result type (might be due to invalid IL or missing references) //IL_190d: Unknown result type (might be due to invalid IL or missing references) //IL_1912: Unknown result type (might be due to invalid IL or missing references) //IL_126e: Unknown result type (might be due to invalid IL or missing references) //IL_1273: Unknown result type (might be due to invalid IL or missing references) //IL_127d: Unknown result type (might be due to invalid IL or missing references) //IL_1282: Unknown result type (might be due to invalid IL or missing references) //IL_1287: Unknown result type (might be due to invalid IL or missing references) //IL_1d0a: Unknown result type (might be due to invalid IL or missing references) //IL_1963: Unknown result type (might be due to invalid IL or missing references) //IL_1968: Unknown result type (might be due to invalid IL or missing references) //IL_1984: Unknown result type (might be due to invalid IL or missing references) //IL_1989: Unknown result type (might be due to invalid IL or missing references) //IL_198e: Unknown result type (might be due to invalid IL or missing references) //IL_1992: Unknown result type (might be due to invalid IL or missing references) //IL_1997: Unknown result type (might be due to invalid IL or missing references) //IL_19c7: Unknown result type (might be due to invalid IL or missing references) //IL_19cb: Unknown result type (might be due to invalid IL or missing references) if (CL_GameManager.gamemode.allowLeaderboardScoring) { CL_GameManager.gamemode.allowLeaderboardScoring = false; } CharacterController component = ((Component)__instance).GetComponent<CharacterController>(); bool isGrounded = component.isGrounded; isHolding = false; ExpireRollingFallDamageCancel(); if (CLGameManagerPatch.DidRestartThisFrame) { CLGameManagerPatch.DidRestartThisFrame = false; isRotating = false; isSliding = false; hasWallRunInAir = false; hasWallRunVertical = false; isHorizRun = false; isVerticalRun = false; onCooldown = false; CooldownTime = 0f; isCharging = false; leapCooldown = false; leapCooldownTime = 0f; } Hand[] hands = __instance.hands; foreach (Hand val in hands) { if ((Object)(object)val.handhold != (Object)null && val.handhold.GetHolding()) { isHolding = true; break; } } if (onCooldown) { if (!isRotating) { CooldownTime += Time.deltaTime; } if (CooldownTime >= CooldownDur) { onCooldown = false; CooldownTime = 0f; } } if (Input.GetKeyUp((KeyCode)120) && !onCooldown && !isHorizRun && ((GameEntity)__instance).health > 0f && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["QuickTurning"]).Value) { onCooldown = true; targetRotation = ((Component)__instance).transform.rotation * Quaternion.Euler(0f, 180f, 0f); isRotating = true; } if (isRotating) { ((Component)__instance).transform.rotation = Quaternion.Slerp(((Component)__instance).transform.rotation, targetRotation, Time.deltaTime * (turnSpeed * (float)(roidedCount / 2 + 1))); if (Quaternion.Angle(((Component)__instance).transform.rotation, targetRotation) < 0.5f) { isRotating = false; } } if (leapCooldown) { if (isGrounded || isHolding) { leapCooldownTime += Time.deltaTime; } if (leapCooldownTime >= leapCooldownDur) { leapCooldown = false; leapCooldownTime = 0f; } } if (Input.GetKeyDown((KeyCode)103) && !leapCooldown && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["Leaping"]).Value && (isGrounded || isHolding)) { bool flag = true; Hand[] hands2 = __instance.hands; foreach (Hand val2 in hands2) { if (val2.gripStrength < minStamina) { flag = false; } } if (flag) { chargeStartTime = Time.time; isCharging = true; } } currentCharge = 0f; if (isCharging && Input.GetKey((KeyCode)103) && (isGrounded || isHolding) && !leapCooldown) { currentCharge = Mathf.Min(Time.time - chargeStartTime, maxChargeTime); if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(currentCharge * Time.deltaTime * 0.025f); Hand[] hands3 = __instance.hands; foreach (Hand val3 in hands3) { val3.ShakeHand(currentCharge * Time.deltaTime * 0.025f); } } if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(currentCharge * 0.1f, false); } } if (Input.GetKeyUp((KeyCode)103) && isCharging && (isGrounded || isHolding) && !leapCooldown && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["Leaping"]).Value) { if (!isGrounded && !isHolding) { isCharging = false; return; } currentCharge = Mathf.Min(Time.time - chargeStartTime, maxChargeTime); float num = Mathf.Min(Time.time - chargeStartTime, maxChargeTime); float num2 = num * (leapForceMultiplier * (float)(roidedCount / 2 + 1)); float num3 = Mathf.CeilToInt(Mathf.Lerp(minStamina, maxStamina, num / maxChargeTime)); Vector3 val4 = ((Component)__instance.cam).transform.forward + Vector3.up * upwardArcForce; Vector3 directionalForce = ((Vector3)(ref val4)).normalized * num2; ((GameEntity)__instance).SetDirectionalForce(directionalForce); Hand[] hands4 = __instance.hands; foreach (Hand val5 in hands4) { if (!isConsumableUltimate) { val5.gripStrength -= num3; if (val5.gripStrength < 0f) { val5.gripStrength = 0f; } } if (val5.IsHolding()) { val5.DropHand(true); } } leapCooldown = true; isCharging = false; } if (!isGrounded && !isHolding) { currentCharge = 0f; isCharging = false; } if (Input.GetKeyDown((KeyCode)32) && Input.GetKey((KeyCode)115) && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["WallKicking"]).Value) { bool flag2 = true; Hand[] hands5 = __instance.hands; foreach (Hand val6 in hands5) { if (val6.gripStrength < 1f) { flag2 = false; } } if (!isHolding && flag2) { Vector3 val7 = -((Component)__instance).transform.forward; RaycastHit val8 = default(RaycastHit); if (Physics.Raycast(((Component)__instance).transform.position, val7, ref val8, 1.2f)) { Vector3 val9 = ((RaycastHit)(ref val8)).normal + Vector3.up * 1.2f; float num4 = 1.5f * (float)(roidedCount / 2 + 1); ((GameEntity)__instance).SetDirectionalForce(((Vector3)(ref val9)).normalized * num4); if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(num4, false); } if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(Time.deltaTime * 0.15f); } Hand[] hands6 = __instance.hands; foreach (Hand val10 in hands6) { if (!isConsumableUltimate) { val10.gripStrength -= 1f; if (val10.gripStrength < 0f) { val10.gripStrength = 0f; } } } } } } if (isGrounded && !isVerticalRun && !isHolding) { isHorizRun = false; isVerticalRun = false; hasWallRunInAir = false; hasWallRunVertical = false; ((Collider)component).enabled = true; ((Component)__instance).transform.rotation = Quaternion.Euler(0f, ((Component)__instance).transform.eulerAngles.y, 0f); } if (!isGrounded && isHolding) { isHorizRun = false; isVerticalRun = false; hasWallRunInAir = true; hasWallRunVertical = true; ((Collider)component).enabled = true; } canRun = true; bool flag3 = true; Hand[] hands7 = __instance.hands; foreach (Hand val11 in hands7) { gripValue = val11.gripStrength; if (val11.gripStrength <= 0f) { canRun = false; } } if (!canRun) { flag3 = false; } if (Input.GetKeyDown((KeyCode)32)) { spaceTapCount++; if (spaceTapCount == 1) { spaceTapTimer = 0.3f; } } if (spaceTapTimer > 0f && (!isVerticalRun || !isHorizRun)) { spaceTapTimer -= Time.deltaTime; } else { spaceTapCount = 0; } RaycastHit val12 = default(RaycastHit); wallLeft = Physics.Raycast(((Component)__instance).transform.position, -((Component)__instance).transform.right, ref val12, 1.2f); RaycastHit val13 = default(RaycastHit); wallRight = Physics.Raycast(((Component)__instance).transform.position, ((Component)__instance).transform.right, ref val13, 1.2f); bool flag4 = spaceTapCount >= 2; bool flag5 = Input.GetKey((KeyCode)32) && (Input.GetKey((KeyCode)97) || Input.GetKey((KeyCode)100)); Vector3 val15; if (!hasWallRunInAir && flag5 && (wallLeft || wallRight) && (isHorizRun || flag4)) { if (((ConfigEntry<bool>)(object)Plugin.SkillConfigs["WallRunning"]).Value) { if (flag3) { isHorizRun = true; spaceTapCount = 2; ((Collider)component).enabled = false; Vector3 val14 = (wallLeft ? ((RaycastHit)(ref val12)).normal : ((RaycastHit)(ref val13)).normal); val15 = Vector3.Cross(val14, Vector3.up); Vector3 val16 = ((Vector3)(ref val15)).normalized; RaycastHit val17 = default(RaycastHit); if (Physics.Raycast(((Component)__instance).transform.position, ((Component)__instance).transform.forward, ref val17, 1.2f)) { isHorizRun = false; hasWallRunInAir = true; ((Collider)component).enabled = true; return; } if (Vector3.Dot(val16, ((Component)__instance).transform.forward) < 0f) { val16 = -val16; } float num6 = ((!Plugin.EnableParkourRotation.Value) ? 0f : (wallLeft ? (-15f) : 15f)); Quaternion val18 = Quaternion.LookRotation(val16) * Quaternion.Euler(0f, 0f, num6); ((Component)__instance).transform.rotation = Quaternion.Slerp(((Component)__instance).transform.rotation, val18, Time.deltaTime * tiltLerpSpeed); ((GameEntity)__instance).SetDirectionalForce(val16 * 0.8f * (gripValue * 0.1f * ((float)roidedCount / 3.5f + 1f)) + Vector3.up * 0.1f); if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(Mathf.Lerp(1f, 0f, gripValue / 10f), false); } if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(Time.deltaTime * 0.25f); } Hand[] hands8 = __instance.hands; foreach (Hand val19 in hands8) { val19.gripStrength -= Time.deltaTime * (2.5f / (float)(roidedCount / 8 + 1)); if (val19.gripStrength < 0f) { val19.gripStrength = 0f; } } } else { isHorizRun = false; hasWallRunInAir = true; ((Collider)component).enabled = true; } } } else { Quaternion val20 = Quaternion.Euler(0f, ((Component)__instance).transform.eulerAngles.y, 0f); ((Component)__instance).transform.rotation = Quaternion.Slerp(((Component)__instance).transform.rotation, val20, Time.deltaTime * tiltLerpSpeed); if (!isGrounded && ((Collider)component).enabled && spaceTapTimer <= 0f) { hasWallRunInAir = true; } ((Collider)component).enabled = true; isHorizRun = false; } RaycastHit val21 = default(RaycastHit); wallFront = Physics.Raycast(((Component)__instance).transform.position, ((Component)__instance).transform.forward, ref val21, 1.2f); bool flag6 = Input.GetKey((KeyCode)32) && Input.GetKey((KeyCode)119); bool flag7 = spaceTapCount >= 2; if (isVerticalRun) { if (flag6) { verticalGraceTimer = 0f; } else { verticalGraceTimer += Time.deltaTime; } } canVert = true; bool flag8 = true; Hand[] hands9 = __instance.hands; foreach (Hand val22 in hands9) { if (val22.gripStrength <= 0f) { canVert = false; } } if (!canVert) { flag8 = false; } if (isVerticalRun && !flag8) { isVerticalRun = false; hasWallRunVertical = true; return; } if (isVerticalRun && Input.GetKeyDown((KeyCode)32) && verticalGraceTimer > 0f && verticalGraceTimer < maxGraceTime && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["WallRunBoost"]).Value) { float num9 = 1.5f * (float)(roidedCount / 2 + 1); float num10 = 1.5f * (float)(roidedCount / 2 + 1); Vector3 directionalForce2 = ((RaycastHit)(ref val21)).normal * num9 * (gripValue * 0.1f) + Vector3.up * num10 * (gripValue * 0.1f); ((GameEntity)__instance).SetDirectionalForce(directionalForce2); if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(2f, false); } isVerticalRun = false; verticalGraceTimer = 0f; hasWallRunVertical = true; ((Collider)component).enabled = true; return; } if (isVerticalRun && verticalGraceTimer >= maxGraceTime) { isVerticalRun = false; hasWallRunVertical = true; ((Collider)component).enabled = true; verticalGraceTimer = 0f; } if (isVaulting) { vaultTimer += Time.deltaTime; ((Component)__instance).transform.position = Vector3.Lerp(((Component)__instance).transform.position, vaultTargetPos, vaultDuration); if (Vector3.Distance(((Component)__instance).transform.position, vaultTargetPos) < 0.1f) { isVaulting = false; ((Collider)component).enabled = true; } return; } if (flag6 && !hasWallRunVertical && wallFront && (!hasWallRunVertical || isVerticalRun) && verticalGraceTimer == 0f && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["VerticalWallRunning"]).Value && (isVerticalRun || flag7)) { float num11 = Vector3.Angle(((RaycastHit)(ref val21)).normal, Vector3.up); if (flag3 && num11 > 80f && num11 < 100f) { isVerticalRun = true; spaceTapCount = 2; ((Collider)component).enabled = false; Vector3 val23 = -((RaycastHit)(ref val21)).normal; Vector3 val24 = ((Component)__instance).transform.position + Vector3.up * 1.5f; bool flag9 = Physics.Raycast(val24, val23, 0.25f); Quaternion val25 = Quaternion.LookRotation(Vector3.up, ((RaycastHit)(ref val21)).normal); RaycastHit val26 = default(RaycastHit); if (flag9 && (!Plugin.EnableParkourRotation.Value || Quaternion.Angle(((Component)__instance).transform.rotation, val25) < 25f) && Physics.SphereCast(((Component)__instance).transform.position + Vector3.up * 1f, 0.3f, Vector3.up, ref val26, 0.7f)) { isVaulting = false; hasWallRunVertical = true; isVerticalRun = false; ((Collider)component).enabled = true; return; } if (Physics.Raycast(((Component)__instance).transform.position, ((Component)__instance).transform.up, 3f)) { isVaulting = false; hasWallRunVertical = true; isVerticalRun = false; ((Collider)component).enabled = true; return; } if (!flag9 && !Physics.Raycast(val24, val23, 1f)) { Vector3 val27 = val24 + val23 * 1f; RaycastHit val28 = default(RaycastHit); if (Physics.Raycast(val27, Vector3.down, ref val28, 2f)) { Vector3 val29 = ((RaycastHit)(ref val28)).point + Vector3.up * 0.5f; RaycastHit val30 = default(RaycastHit); if (Physics.Raycast(val29, -val23, ref val30, 1.5f) && ((RaycastHit)(ref val30)).distance < 0.2f) { return; } if (!Physics.SphereCast(((RaycastHit)(ref val28)).point + Vector3.up * 0.1f, 0.3f, Vector3.up, ref val26, 1.8f)) { vaultTargetPos = ((RaycastHit)(ref val28)).point + Vector3.up * 1.1f; isVaulting = true; vaultTimer = 0f; isVerticalRun = false; hasWallRunVertical = true; ((Collider)component).enabled = false; return; } } } if (Plugin.EnableParkourRotation.Value) { ((Component)__instance).transform.rotation = Quaternion.Slerp(((Component)__instance).transform.rotation, val25, Time.deltaTime * 10f); } Vector3 directionalForce3 = Vector3.up * 0.4f * (gripValue * (0.15f * (float)(roidedCount / 3 + 1))); ((GameEntity)__instance).SetDirectionalForce(directionalForce3); if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(Mathf.Lerp(1f, 0f, gripValue / 10f), false); } if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(Time.deltaTime * 0.4f); } Hand[] hands10 = __instance.hands; foreach (Hand val31 in hands10) { val31.gripStrength -= Time.deltaTime * (4.5f / (float)(roidedCount / 8 + 1)); if (val31.gripStrength < 0f) { val31.gripStrength = 0f; } } return; } } if (!isGrounded && !isVerticalRun && !isVaulting && verticalGraceTimer <= 0f && spaceTapTimer <= 0f && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["VerticalWallRunning"]).Value && ((Collider)component).enabled) { hasWallRunVertical = true; } Vector3 val32 = default(Vector3); ((Vector3)(ref val32))..ctor(component.velocity.x, 0f, component.velocity.z); Vector3 val33 = ((Component)__instance).transform.InverseTransformDirection(val32); bool flag10 = val33.z > 0.1f; float magnitude = ((Vector3)(ref val32)).magnitude; if (!__instance.IsCrouching() || isGrounded) { canSlide = true; } if (isGrounded && __instance.IsCrouching() && !isSliding && canSlide && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["Sliding"]).Value && magnitude >= minSlideSpeed && flag10) { isSliding = true; canSlide = false; slideDir = ((Vector3)(ref val32)).normalized; slideTime = 0f; slideStartPos = ((Component)__instance).transform.position; slideTargetPos = slideStartPos + slideDir * (10f * (float)(roidedCount / 2 + 1)); ((Collider)component).enabled = false; if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(Time.deltaTime * 0.1f); } } if (isSliding) { if (Input.GetKeyDown((KeyCode)32) && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["SlideJumping"]).Value) { float num13 = 1f - slideTime / slideDuration; float num14 = 1f * num13 * (float)(roidedCount / 2 + 1); float num15 = 1.5f * num13 * (float)(roidedCount / 2 + 1); Vector3 directionalForce4 = slideDir * num14 + Vector3.up * num15; float num16 = ((Vector3)(ref directionalForce4)).magnitude * 1f; bool flag11 = true; bool flag12 = true; Hand[] hands11 = __instance.hands; foreach (Hand val34 in hands11) { if (val34.gripStrength < num16) { flag11 = false; break; } } if (!flag11) { flag12 = false; } if (flag12) { ((GameEntity)__instance).SetDirectionalForce(directionalForce4); if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(((Vector3)(ref directionalForce4)).magnitude * Time.deltaTime * 0.1f); } if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(2f, false); } Hand[] hands12 = __instance.hands; foreach (Hand val35 in hands12) { if (!isConsumableUltimate) { val35.gripStrength -= num16; if (val35.gripStrength < 0f) { val35.gripStrength = 0f; } } } isSliding = false; ((Collider)component).enabled = true; return; } } slideTime += Time.deltaTime; float num19 = slideTime / slideDuration; float num20 = 1f - (1f - num19) * (1f - num19); Vector3 position = Vector3.Lerp(slideStartPos, slideTargetPos, num20 * (float)(roidedCount / 10 + 1)); if (Physics.Raycast(((Component)__instance).transform.position + Vector3.up * 0.05f + slideDir * 0.3f, slideDir, 0.8f)) { slideTargetPos = ((Component)__instance).transform.position; slideTime = slideDuration; if (Plugin.EnableParkourShake.Value) { CL_CameraControl.Shake(Time.deltaTime * 0.1f); } isSliding = false; ((Collider)component).enabled = true; return; } if (num19 >= 1f || !__instance.IsCrouching() || !isGrounded) { isSliding = false; ((Collider)component).enabled = true; } else { RaycastHit[] array = Physics.SphereCastAll(((Component)__instance).transform.position + Vector3.down * 1.1f, 0.25f, slideDir, 1.3f); if (array.Length != 0) { RaycastHit[] array2 = array; for (int num21 = 0; num21 < array2.Length; num21++) { RaycastHit val36 = array2[num21]; if (!((Object)(object)((RaycastHit)(ref val36)).collider == (Object)null)) { Rigidbody componentInChildren = ((Component)((RaycastHit)(ref val36)).collider).gameObject.GetComponentInChildren<Rigidbody>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.isKinematic = false; componentInChildren.WakeUp(); val15 = slideDir + Vector3.up * (0.3f * (1f - slideTime / slideDuration)); Vector3 normalized = ((Vector3)(ref val15)).normalized; float num22 = 3f * (1f - slideTime / slideDuration) * ((float)roidedCount / 10f + 1f); componentInChildren.AddForce(normalized * num22, (ForceMode)2); } } } } ((Component)__instance).transform.position = position; if (Plugin.EnableParkourFOV.Value) { __instance.FOVShock(Mathf.Lerp(1.5f, 0f, num20), false); } if (Plugin.EnableParkourRotation.Value) { Transform transform = ((Component)__instance).transform; transform.rotation *= Quaternion.Euler(5f * Time.deltaTime, 0f, 0f); } } } if (wasGrounded && !isGrounded) { startY = ((Component)__instance).transform.position.y; } if (!wasGrounded && isGrounded && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["Rolling"]).Value) { float num23 = startY - ((Component)__instance).transform.position.y; if (num23 >= 15f && __instance.IsCrouching() && !isRotatingRoll) { isRotatingRoll = true; rollTimer = 0f; startRotationRoll = ((Component)__instance).transform.rotation; ((Collider)component).enabled = false; ArmRollingFallDamageCancel(); rollDir = ((Component)__instance).transform.forward; rollDir.y = 0f; ((Vector3)(ref rollDir)).Normalize(); rollStartPos = ((Component)__instance).transform.position; rollTargetPos = rollStartPos + rollDir * 5f; } } if (isRotatingRoll) { rollTimer += Time.deltaTime; float num24 = rollTimer / rollDur; float num25 = Mathf.Lerp(0f, 360f, num24); if (Plugin.EnableParkourRotation.Value) { ((Component)__instance).transform.rotation = startRotationRoll * Quaternion.Euler(num25, 0f, 0f); } if (num24 >= 1f) { ((Component)__instance).transform.rotation = startRotationRoll; __instance.UnLock(); isRotatingRoll = false; } float num26 = rollTimer / rollDur; float num27 = 1f - (1f - num26) * (1f - num26); Vector3 position2 = Vector3.Lerp(rollStartPos, rollTargetPos, num27); if (Physics.Raycast(((Component)__instance).transform.position + Vector3.up * 0.05f + rollDir * 0.3f, rollDir, 0.8f)) { rollTargetPos = ((Component)__instance).transform.position; rollTimer = rollDur; ((Collider)component).enabled = true; return; } if (num26 >= 1f) { ((Collider)component).enabled = true; } else { ((Component)__instance).transform.position = position2; } } wasGrounded = isGrounded; float value = ((ConfigEntry<float>)(object)Plugin.SkillConfigs["MaxHeight"]).Value; float value2 = ((ConfigEntry<float>)(object)Plugin.SkillConfigs["HeightCurrency"]).Value; int num28 = (int)(levelHighestHeight / 100f); levelHighestHeight = ((Component)__instance).transform.position.y; if (((GameEntity)__instance).health <= 0f) { if (levelHighestHeight > value) { ((ConfigEntry<float>)(object)Plugin.SkillConfigs["MaxHeight"]).Value = levelHighestHeight; } liveRunHeight = 0f; highestMilestone = 0; return; } if (liveRunHeight < value) { liveRunHeight = value; } int num29 = 0; if (num28 <= highestMilestone) { return; } int num30 = num28 - highestMilestone; previousCurrency = value2; ConfigEntry<float> obj = (ConfigEntry<float>)(object)Plugin.SkillConfigs["HeightCurrency"]; obj.Value += (float)num30 * 10f; if (levelHighestHeight > liveRunHeight && value >= 100f) { int num31 = (int)(levelHighestHeight / 100f); num29 += num31; if (num29 > 10) { num29 = 10; } ConfigEntry<float> obj2 = (ConfigEntry<float>)(object)Plugin.SkillConfigs["HeightCurrency"]; obj2.Value += (float)num29; liveRunHeight = levelHighestHeight; } ((MonoBehaviour)ParkourUI.Instance).StartCoroutine(ParkourUI.Instance.AnimateCurrencyGain((int)previousCurrency, num30 * 10 + num29)); highestMilestone = num28; } } [HarmonyPatch(typeof(ENT_Player), "Damage")] public class RollingFallDamagePatch { [HarmonyPrefix] public static bool Prefix(DamageInfo info, ref bool __result) { if (!PlayerModifierPatch.TryCancelRollingFallDamage(info)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(EventSystem), "Update")] public class WorldUpdate { private static bool playerExisted; [HarmonyPostfix] public static void Postfix() { float levelHighestHeight = PlayerModifierPatch.levelHighestHeight; ENT_Player playerObject = ENT_Player.playerObject; float value = ((ConfigEntry<float>)(object)Plugin.SkillConfigs["MaxHeight"]).Value; if ((Object)(object)playerObject != (Object)null) { if (!playerExisted) { playerExisted = true; } if (((GameEntity)(playerObject?)).curBuffs != null) { IEnumerable<string> enumerable = ((((object)((GameEntity)playerObject).curBuffs).GetType().GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((FieldInfo f) => f.FieldType == typeof(List<BuffContainer>))?.GetValue(((GameEntity)playerObject).curBuffs) is List<BuffContainer> source) ? (from b in source.SelectMany((BuffContainer c) => c?.buffs ?? new List<Buff>()) where b != null && !string.IsNullOrEmpty(b.id) select b.id) : null); PlayerModifierPatch.isConsumableUltimate = enumerable?.Any((string name) => name == "pilled" || name == "roided") ?? false; PlayerModifierPatch.roidedCount = Mathf.Min(enumerable?.Count((string name) => name == "roided") ?? 0, 5); } } if ((Object)(object)playerObject == (Object)null && playerExisted) { if (levelHighestHeight > value) { ((ConfigEntry<float>)(object)Plugin.SkillConfigs["MaxHeight"]).Value = levelHighestHeight; } PlayerModifierPatch.liveRunHeight = 0f; PlayerModifierPatch.highestMilestone = 0; playerExisted = false; } if (ParkourUI.hasPurchased) { ((ConfigEntry<float>)(object)Plugin.SkillConfigs["HeightCurrency"]).Value = ParkourUI.newCurrencyAmount; ParkourUI.hasPurchased = false; ParkourUI.UpdateCurrencyDisplay(); } } } [HarmonyPatch(typeof(CL_GameManager), "ChangeState")] public static class CLGameManagerPatch { public static bool DidRestartThisFrame; public static void Prefix(string s) { if (s == "restart") { DidRestartThisFrame = true; } } } } namespace ParkourKnuckle.UI { public class ParkourUI : MonoBehaviour { private const float percentLineFillRequiredToUnlock = 0.5f; private const float popInDuration = 0.25f; private const float popOutDuration = 0.18f; private const float nodeAnimateDuration = 0.35f; private GameObject uiInstance; private GameObject skillTreePanel; private GameObject openButtonObj; private GameObject closeButtonObj; private Transform contentTransform; private GameObject clickOutsideBlocker; private static TextMeshProUGUI currencyTextComponent; private static TextMeshProUGUI heightTextComponent; private GameObject currencyIconObj; private GameObject currencyAddObj; private TextMeshProUGUI mainText; private TextMeshProUGUI infoText; private CanvasGroup currencyAddCanvasGroup; private GameObject resetConfirmBox; private Button confirmButton; private Button denyButton; private GameObject abilityTimesContainer; private GameObject leapAbilityBox; private GameObject qtAbilityBox; private Image leapAbilityTimer; private Image leapForceGlow; private Image qtAbilityTimer; private GameObject loadingScreen; private GameObject loadingImages; private TextMeshProUGUI mapLoadingText; private TextMeshProUGUI seedLoadingText; private TextMeshProUGUI idLoadingText; private GameObject wallRunFadeHelper; private GameObject wallRunLeft; private GameObject wallRunRight; private GameObject wallRunUp; private CanvasGroup wallRunLeftGroup = null; private CanvasGroup wallRunRightGroup = null; private CanvasGroup wallRunUpGroup = null; private GameObject optionsContentObj; private GameObject forwardButtonObj; private GameObject backButtonObj; private Transform headerGroup; private TextMeshProUGUI textHeaderComponent; private Toggle cameraRotationToggle; private Toggle cameraFOVToggle; private Toggle cameraShakeToggle; private Toggle uiGlowToggle; private Button resetProgressButton; private GameObject descriptionPanelObj; private TextMeshProUGUI perkDescriptionText; private Button purchaseButton; private TextMeshProUGUI purchaseButtonText; private TextMeshProUGUI perkCurrencyText; private GameObject perkCurrencyIcon; private string currentlySelectedSkillKey = string.Empty; private bool pendingPurchaseAnimation = false; private readonly Dictionary<string, Button> skillButtons = new Dictionary<string, Button>(); private readonly Dictionary<string, string[]> skillDependencies = new Dictionary<string, string[]>(); private readonly Dictionary<string, Image> skillLines = new Dictionary<string, Image>(); private readonly List<Coroutine> activeAnimations = new List<Coroutine>(); private readonly Dictionary<string, Coroutine> activeButtonCoroutines = new Dictionary<string, Coroutine>(); private readonly Dictionary<string, GameObject> graffitiScreens = new Dictionary<string, GameObject>(); public static bool hasPurchased = false; public static float newCurrencyAmount = 0f; public static bool purchaseTrue = true; private readonly Dictionary<string, string> perkDescriptions = new Dictionary<string, string> { { "QuickTurning", "You can quick turn 180 degrees at any point with no debuff by tapping X. This may help save time when you need to turn around at fast intervals." }, { "Sliding", "While running (or moving at a high velocity), hold down the crouch key to slide." }, { "SlideJumping", "During a slide, you can jump to gain a boost. This boost does consume hand stamina. As the duration of your slide grows, less power will be put into the boost, however, less stamina will be taken." }, { "Leaping", "Holding G will cause you to charge up a leap. The longer you charge your leap, the further your leap will go, but your stamina will be consumed the more you charge your leap." }, { "Rolling", "While you are falling from great height, hold down your crouch button to initiate a roll when you land. This takes no stamina and prevents fall damage from the landing impact." }, { "WallKicking", "While your back is turned away from a wall, hold S and press the spacebar to kick off of that wall. holding down S after the kick will allow you to control your distance while in the air." }, { "WallRunning", "You can run on the side of walls by standing close to a wall and double tapping and holding the spacebar and holding A or D depending on which side of the wall you are standing near. This consumes very little hand stamina." }, { "VerticalWallRunning", "You have the ability to run up to walls and climb them without needing any tools whatsoever. Double tap and hold spacebar and hold W at the same time while facing a wall to begin a vertical wall run. This consumes a moderate amount of hand stamina.\r\n\r\n" }, { "WallRunBoost", "While vertically wall running, you can release W and quickly tap spacebar to kick off of the wall and give yourself a backwards boost. This does not use up your stamina, however, the power of the boost is determined by your hand stamina." } }; private readonly Dictionary<string, string> configToIconMap = new Dictionary<string, string> { { "QuickTurning", "QuickTurnIcon" }, { "Sliding", "SlideIcon" }, { "SlideJumping", "SlideJumpIcon" }, { "Leaping", "LeapIcon" }, { "Rolling", "RollIcon" }, { "WallKicking", "WallKickIcon" }, { "WallRunning", "WRHIcon" }, { "VerticalWallRunning", "WRVIcon" }, { "WallRunBoost", "WRBIcon" } }; private readonly Dictionary<string, float> skillPrices = new Dictionary<string, float> { { "QuickTurning", 0f }, { "Sliding", 15f }, { "SlideJumping", 30f }, { "Leaping", 100f }, { "Rolling", 75f }, { "WallKicking", 30f }, { "WallRunning", 50f }, { "VerticalWallRunning", 60f }, { "WallRunBoost", 75f } }; private Coroutine activePanelPopCoroutine; private Coroutine activeButtonPopCoroutine; private bool isAnimatingBranch = false; private bool wasPlayerObjectPresent = false; private const float wobbleSpeed = 2.5f; private const float wobbleMagnitude = 4f; private const float noiseSpacing = 100f; private const float FADE_SPEED = 5f; private readonly Dictionary<string, Vector2> nodeOriginPositions = new Dictionary<string, Vector2>(); private RectTransform quickTurnRect; private readonly Dictionary<string, Vector2> lineOriginPositions = new Dictionary<string, Vector2>(); private RectTransform lineToSlideRect; private GameObject perkIconHolderObj; private readonly Dictionary<string, GameObject> perkIcons = new Dictionary<string, GameObject>(); private bool hadLoading = false; private string activeGraffitiName = null; private float playerCheckTimer = 0f; private const float PLAYER_CHECK_INTERVAL = 0.2f; private bool cachedIsPlayerPresent = false; private CL_GameManager cachedGameManager = null; private RectTransform cachedPerkIconRect = null; public static ParkourUI Instance { get; private set; } public static void Initialize() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (!((Object)(object)Instance != (Object)null)) { GameObject val = new GameObject("ParkourKnuckle_UIHost"); Object.DontDestroyOnLoad((Object)(object)val); Instance = val.AddComponent<ParkourUI>(); Instance.LoadAndBuildUI(); } } private void Update() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) playerCheckTimer += Time.deltaTime; if (playerCheckTimer >= 0.2f) { playerCheckTimer = 0f; cachedIsPlayerPresent = (Object)(object)GameObject.Find("CL_Player") != (Object)null; } bool flag = cachedIsPlayerPresent; if (flag && !wasPlayerObjectPresent) { wasPlayerObjectPresent = true; if (Plugin.isUIVisible) { ToggleUIPanel(showMainPanel: false); } GameObject obj = openButtonObj; if (obj != null) { obj.SetActive(false); } GameObject obj2 = currencyIconObj; if (obj2 != null) { obj2.SetActive(false); } GameObject obj3 = abilityTimesContainer; if (obj3 != null) { obj3.SetActive(true); } GameObject obj4 = wallRunFadeHelper; if (obj4 != null) { obj4.SetActive(true); } } else if (!flag && wasPlayerObjectPresent) { wasPlayerObjectPresent = false; if ((Object)(object)openButtonObj != (Object)null && !Plugin.isUIVisible) { openButtonObj.SetActive(true); openButtonObj.transform.localScale = Vector3.one; } if ((Object)(object)currencyIconObj != (Object)null) { currencyIconObj.SetActive(true); UpdateCurrencyDisplay(); } GameObject obj5 = abilityTimesContainer; if (obj5 != null) { obj5.SetActive(false); } GameObject obj6 = wallRunFadeHelper; if (obj6 != null) { obj6.SetActive(false); } } if (flag) { if ((Object)(object)qtAbilityBox != (Object)null) { if (((ConfigEntry<bool>)(object)Plugin.SkillConfigs["QuickTurning"]).Value && ((GameEntity)ENT_Player.playerObject).health > 0f && !cachedGameManager.isPaused) { qtAbilityBox.SetActive(true); } else { qtAbilityBox.SetActive(false); } if ((Object)(object)qtAbilityTimer != (Object)null && PlayerModifierPatch.onCooldown) { qtAbilityTimer.fillAmount = PlayerModifierPatch.CooldownTime / PlayerModifierPatch.CooldownDur; } else if ((Object)(object)qtAbilityTimer != (Object)null) { qtAbilityTimer.fillAmount = 1f; } } if ((Object)(object)leapAbilityBox != (Object)null) { if (((ConfigEntry<bool>)(object)Plugin.SkillConfigs["Leaping"]).Value && ((GameEntity)ENT_Player.playerObject).health > 0f && !cachedGameManager.isPaused) { leapAbilityBox.SetActive(true); } else { leapAbilityBox.SetActive(false); } if ((Object)(object)leapAbilityTimer != (Object)null && PlayerModifierPatch.leapCooldown) { leapAbilityTimer.fillAmount = PlayerModifierPatch.leapCooldownTime / PlayerModifierPatch.leapCooldownDur; } else if ((Object)(object)leapAbilityTimer != (Object)null) { leapAbilityTimer.fillAmount = 1f; } if ((Object)(object)leapForceGlow != (Object)null && PlayerModifierPatch.isCharging) { leapForceGlow.fillAmount = PlayerModifierPatch.currentCharge / PlayerModifierPatch.maxChargeTime; ((Graphic)leapForceGlow).color = new Color(((Graphic)leapForceGlow).color.r, ((Graphic)leapForceGlow).color.g, ((Graphic)leapForceGlow).color.b, Mathf.Max(0.1f, leapForceGlow.fillAmount / 2f)); } else if ((Object)(object)leapForceGlow != (Object)null) { leapForceGlow.fillAmount = 0f; } } if ((Object)(object)currencyIconObj != (Object)null && (((GameEntity)ENT_Player.playerObject).health <= 0f || cachedGameManager.isPaused)) { currencyIconObj.SetActive(true); UpdateCurrencyDisplay(); } else if ((Object)(object)currencyIconObj != (Object)null && ((GameEntity)ENT_Player.playerObject).health > 0f && !cachedGameManager.isPaused) { currencyIconObj.SetActive(false); } if ((Object)(object)wallRunFadeHelper != (Object)null && Plugin.EnableWallRunHelper.Value) { if ((Object)(object)wallRunLeftGroup != (Object)null && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["WallRunning"]).Value) { float num = ((PlayerModifierPatch.canRun && PlayerModifierPatch.wallLeft && !PlayerModifierPatch.hasWallRunInAir && !PlayerModifierPatch.isHorizRun) ? 1f : 0f); wallRunLeftGroup.alpha = Mathf.MoveTowards(wallRunLeftGroup.alpha, num, 5f * Time.deltaTime); } if ((Object)(object)wallRunRightGroup != (Object)null && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["WallRunning"]).Value) { float num2 = ((PlayerModifierPatch.canRun && PlayerModifierPatch.wallRight && !PlayerModifierPatch.hasWallRunInAir && !PlayerModifierPatch.isHorizRun) ? 1f : 0f); wallRunRightGroup.alpha = Mathf.MoveTowards(wallRunRightGroup.alpha, num2, 5f * Time.deltaTime); } if ((Object)(object)wallRunUpGroup != (Object)null && ((ConfigEntry<bool>)(object)Plugin.SkillConfigs["VerticalWallRunning"]).Value) { float num3 = ((PlayerModifierPatch.canVert && PlayerModifierPatch.wallFront && !PlayerModifierPatch.hasWallRunVertical && !PlayerModifierPatch.isVerticalRun) ? 1f : 0f); wallRunUpGroup.alpha = Mathf.MoveTowards(wallRunUpGroup.alpha, num3, 5f * Time.deltaTime); } if ((Object)(object)cachedGameManager != (Object)null) { if (cachedGameManager.isPaused) { wallRunFadeHelper.SetActive(false); } else if (((GameEntity)ENT_Player.playerObject).health <= 0f) { wallRunFadeHelper.SetActive(false); } else { wallRunFadeHelper.SetActive(true); } } } else if ((Object)(object)wallRunFadeHelper != (Object)null && !Plugin.EnableWallRunHelper.Value) { wallRunFadeHelper.SetActive(false); } if (openButtonObj.activeSelf) { openButtonObj.SetActive(false); } } if ((Object)(object)cachedGameManager == (Object)null) { cachedGameManager = Object.FindObjectOfType<CL_GameManager>(); } if ((Object)(object)cachedGameManager != (Object)null) { if (CL_GameManager.IsLoading() && !hadLoading && (Object)(object)Object.FindAnyObjectByType<M_Level>() == (Object)null) { hadLoading = true; loadingScreen.SetActive(true); string key = "Graffiti" + Random.Range(1, 10); if (graffitiScreens.TryGetValue(key, out var value)) { value.SetActive(true); activeGraffitiName = key; } } else if (!CL_GameManager.IsLoading() && hadLoading) { hadLoading = false; ((TMP_Text)mapLoadingText).text = ""; ((TMP_Text)seedLoadingText).text = ""; ((TMP_Text)idLoadingText).text = ""; loadingScreen.SetActive(false); if (!string.IsNullOrEmpty(activeGraffitiName)) { if (graffitiScreens.TryGetValue(activeGraffitiName, out var value2)) { value2.SetActive(false); } activeGraffitiName = null; } } } if ((Object)(object)cachedGameManager != (Object)null && CL_GameManager.IsLoading()) { M_Level val = Object.FindAnyObjectByType<M_Level>(); if ((Object)(object)val != (Object)null) { string levelName = val.levelName; int levelSeed = val.GetLevelSeed(); int instanceID = ((Object)val).GetInstanceID(); ((TMP_Text)mapLoadingText).text = levelName; ((TMP_Text)seedLoadingText).text = levelSeed.ToString(); ((TMP_Text)idLoadingText).text = instanceID.ToString(); } } if (Plugin.isUIVisible && !isAnimatingBranch) { ApplyProceduralWobble(); } if (Plugin.isUIVisible && (Object)(object)perkIconHolderObj != (Object)null && perkIconHolderObj.activeSelf) { float num4 = Time.time * 2.5f; if ((Object)(object)cachedPerkIconRect == (Object)null) { cachedPerkIconRect = perkIconHolderObj.GetComponent<RectTransform>(); } float num5 = Mathf.Sin(num4) * 4f; float num6 = Mathf.Cos(num4 * 0.8f) * 4f; if ((Object)(object)cachedPerkIconRect != (Object)null) { cachedPerkIconRect.anchoredPosition = new Vector2(num5, num6); } } } private void ApplyProceduralWobble() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) float num = Time.time * 2.5f; foreach (KeyValuePair<string, Button> skillButton in skillButtons) { string key = skillButton.Key; Button value = skillButton.Value; if (!activeButtonCoroutines.TryGetValue(key, out var value2) || value2 == null) { RectTransform component = ((Component)value).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null && nodeOriginPositions.TryGetValue(key, out var value3)) { Vector2 val = ((!IsConnectedToRoot(key) && !AreDependenciesMet(key)) ? (value3 * 0.005f) : Vector2.zero); float num2 = Mathf.PerlinNoise(val.x + num, val.y) * 2f - 1f; float num3 = Mathf.PerlinNoise(val.x, val.y + num) * 2f - 1f; Vector2 val2 = new Vector2(num2, num3) * 4f; component.anchoredPosition = value3 + val2; } } if (!skillLines.TryGetValue(key, out var value4)) { continue; } RectTransform component2 = ((Component)value4).GetComponent<RectTransform>(); if ((Object)(object)component2 != (Object)null && lineOriginPositions.TryGetValue(key, out var value5)) { if (IsConnectedToRoot(key) || AreDependenciesMet(key)) { Vector2 zero = Vector2.zero; float num4 = Mathf.PerlinNoise(zero.x + num, zero.y) * 2f - 1f; float num5 = Mathf.PerlinNoise(zero.x, zero.y + num) * 2f - 1f; Vector2 val3 = new Vector2(num4, num5) * 4f; component2.anchoredPosition = value5 + val3; } else { component2.anchoredPosition = value5; } } } } private bool IsConnectedToRoot(string configKey) { if (configKey == "QuickTurning") { if (Plugin.SkillConfigs.TryGetValue("QuickTurning", out var value)) { return ((ConfigEntry<bool>)(object)value).Value; } return false; } if (Plugin.SkillConfigs.TryGetValue(configKey, out var value2) && !((ConfigEntry<bool>)(object)value2).Value) { return false; } if (skillDependencies.TryGetValue(configKey, out var value3)) { string[] array = value3; foreach (string configKey2 in array) { if (IsConnectedToRoot(configKey2)) { return true; } } } return false; } private void LoadAndBuildUI() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Expected O, but got Unknown //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Expected O, but got Unknown //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Expected O, but got Unknown //IL_0aa7: Unknown result type (might be due to invalid IL or missing references) //IL_0aae: Expected O, but got Unknown string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "Assets", "parkourui"); if (!File.Exists(text)) { CleanUpFailedInit(); return; } AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { CleanUpFailedInit(); return; } GameObject val2 = null; string[] allAssetNames = val.GetAllAssetNames(); if (allAssetNames.Length != 0) { val2 = val.LoadAsset<GameObject>(allAssetNames[0]); } if ((Object)(object)val2 == (Object)null) { val.Unload(false); CleanUpFailedInit(); return; } uiInstance = Object.Instantiate<GameObject>(val2); Object.DontDestroyOnLoad((Object)(object)uiInstance); val.Unload(false); Canvas component = uiInstance.GetComponent<Canvas>(); if ((Object)(object)component != (Object)null) { component.renderMode = (RenderMode)0; component.worldCamera = null; component.sortingOrder = 32767; } CanvasScaler component2 = uiInstance.GetComponent<CanvasScaler>(); if ((Object)(object)component2 != (Object)null) { component2.uiScaleMode = (ScaleMode)1; component2.referenceResolution = new Vector2(1920f, 1080f); component2.screenMatchMode = (ScreenMatchMode)0; component2.matchWidthOrHeight = 0.5f; } Transform obj = uiInstance.transform.Find("OpenSTButton"); openButtonObj = ((obj != null) ? ((Component)obj).gameObject : null); Transform obj2 = uiInstance.transform.Find("STMainBorder"); skillTreePanel = ((obj2 != null) ? ((Component)obj2).gameObject : null); Transform obj3 = uiInstance.transform.Find("CurrencyIcon"); currencyIconObj = ((obj3 != null) ? ((Component)obj3).gameObject : null); Transform obj4 = uiInstance.transform.Find("CurrencyAdd"); currencyAddObj = ((obj4 != null) ? ((Component)obj4).gameObject : null); Transform obj5 = uiInstance.transform.Find("AbilityTimes"); abilityTimesContainer = ((obj5 != null) ? ((Component)obj5).gameObject : null); Transform obj6 = uiInstance.transform.Find("LoadingScreen"); loadingScreen = ((obj6 != null) ? ((Component)obj6).gameObject : null); Transform obj7 = uiInstance.transform.Find("WallRunHelper"); wallRunFadeHelper = ((obj7 != null) ? ((Component)obj7).gameObject : null); if ((Object)(object)skillTreePanel == (Object)null) { return; } Transform obj8 = skillTreePanel.transform.Find("CloseSTButton"); closeButtonObj = ((obj8 != null) ? ((Component)obj8).gameObject : null); Transform obj9 = skillTreePanel.transform.Find("OptionsContent"); optionsContentObj = ((obj9 != null) ? ((Component)obj9).gameObject : null); Transform obj10 = skillTreePanel.transform.Find("PerkDescription"); descriptionPanelObj = ((obj10 != null) ? ((Component)obj10).gameObject : null); Transform obj11 = skillTreePanel.transform.Find("ResetConfirmBox"); resetConfirmBox = ((obj11 != null) ? ((Component)obj11).gameObject : null); contentTransform = skillTreePanel.transform.Find("PerkContent") ?? skillTreePanel.transform.Find("Content"); if ((Object)(object)resetConfirmBox != (Object)null) { resetConfirmBox.SetActive(false); Transform obj12 = resetConfirmBox.transform.Find("ConfirmButton"); confirmButton = ((obj12 != null) ? ((Component)obj12).GetComponent<Button>() : null); Transform obj13 = resetConfirmBox.transform.Find("DenyButton"); denyButton = ((obj13 != null) ? ((Component)obj13).GetComponent<Button>() : null); if ((Object)(object)confirmButton != (Object)null) { ((UnityEventBase)confirmButton.onClick).RemoveAllListeners(); ((UnityEvent)confirmButton.onClick).AddListener(new UnityAction(HandleResetConfirmed)); } if ((Object)(object)denyButton != (Object)null) { ((UnityEventBase)denyButton.onClick).RemoveAllListeners(); ((UnityEvent)denyButton.onClick).AddListener(new UnityAction(HandleResetDenied)); } } headerGroup = skillTreePanel.transform.Find("STMainTextHeader"); Transform obj14 = headerGroup; object obj15; if (obj14 == null) { obj15 = null; } else { Transform obj16 = obj14.Find("ForwardButton"); obj15 = ((obj16 != null) ? ((Component)obj16).gameObject : null); } forwardButtonObj = (GameObject)obj15; Transform obj17 = headerGroup; object obj18; if (obj17 == null) { obj18 = null; } else { Transform obj19 = obj17.Find("BackButton"); obj18 = ((obj19 != null) ? ((Component)obj19).gameObject : null); } backButtonObj = (GameObject)obj18; Transform obj20 = headerGroup; textHeaderComponent = ((obj20 != null) ? ((Component)obj20).GetComponentInChildren<TextMeshProUGUI>(true) : null); if ((Object)(object)optionsContentObj != (Object)null) { Transform transform = optionsContentObj.transform; Transform obj21 = transform.Find("EPRToggle"); cameraRotationToggle = ((obj21 != null) ? ((Component)obj21).GetComponent<Toggle>() : null); Transform obj22 = transform.Find("EPFToggle"); cameraFOVToggle = ((obj22 != null) ? ((Component)obj22).GetComponent<Toggle>() : null); Transform obj23 = transform.Find("EPSToggle"); cameraShakeToggle = ((obj23 != null) ? ((Component)obj23).GetComponent<Toggle>() : null); Transform obj24 = transform.Find("EWRHToggle"); uiGlowToggle = ((obj24 != null) ? ((Component)obj24).GetComponent<Toggle>() : null); Transform obj25 = transform.Find("ResetButton"); resetProgressButton = ((obj25 != null) ? ((Component)obj25).GetComponent<Button>() : null); } if ((Object)(object)descriptionPanelObj != (Object)null) { Transform obj26 = descriptionPanelObj.transform.Find("PerkDescText"); perkDescriptionText = ((obj26 != null) ? ((Component)obj26).GetComponent<TextMeshProUGUI>() : null); Transform obj27 = descriptionPanelObj.transform.Find("PurchaseButton"); purchaseButton = ((obj27 != null) ? ((Component)obj27).GetComponent<Button>() : null); Button obj28 = purchaseButton; object obj29; if (obj28 == null) { obj29 = null; } else { Transform obj30 = ((Component)obj28).transform.Find("PurchaseText"); obj29 = ((obj30 != null) ? ((Component)obj30).GetComponent<TextMeshProUGUI>() : null); } purchaseButtonText = (TextMeshProUGUI)obj29; } CreateClickOutsideBlocker(); MapInterfaceControls(); MapProgressionNodes(); bool flag = (wasPlayerObjectPresent = (Object)(object)GameObject.Find("CL_Player") != (Object)null); if ((Object)(object)openButtonObj != (Object)null) { openButtonObj.transform.localScale = (Plugin.isUIVisible ? Vector3.zero : Vector3.one); openButtonObj.SetActive(!Plugin.isUIVisible && !flag); } if ((Object)(object)currencyIconObj != (Object)null) { Transform obj31 = currencyIconObj.transform.Find("CurrencyText"); currencyTextComponent = ((obj31 != null) ? ((Component)obj31).GetComponent<TextMeshProUGUI>() : null); Transform obj32 = currencyIconObj.transform.Find("HeightText"); heightTextComponent = ((obj32 != null) ? ((Component)obj32).GetComponent<TextMeshProUGUI>() : null); } UpdateCurrencyDisplay(); if ((Object)(object)skillTreePanel != (Object)null) { skillTreePanel.transform.localScale = (Plugin.isUIVisible ? Vector3.one : Vector3.zero); skillTreePanel.SetActive(Plugin.isUIVisible); } GameObject obj33 = clickOutsideBlocker; if (obj33 != null) { obj33.SetActive(Plugin.isUIVisible); } SwitchSubMenuContext(showPerksTree: true); Transform obj34 = descriptionPanelObj.transform.Find("PerkIconHolder"); perkIconHolderObj = ((obj34 != null) ? ((Component)obj34).gameObject : null); if ((Object)(object)perkIconHolderObj != (Object)null) { foreach (Transform item in perkIconHolderObj.transform) { Transform val3 = item; if (!(((Object)val3).name == "PerkCurrencyAmount") && !(((Object)val3).name == "PerkCurrencyIcon")) { perkIcons[((Object)val3).name] = ((Component)val3).gameObject; ((Component)val3).gameObject.SetActive(false); } } Transform obj35 = perkIconHolderObj.transform.Find("PerkCurrencyAmount"); perkCurrencyText = ((obj35 != null) ? ((Component)obj35).GetComponent<TextMeshProUGUI>() : null); Transform obj36 = perkIconHolderObj.transform.Find("PerkCurrencyIcon"); perkCurrencyIcon = ((obj36 != null) ? ((Component)obj36).gameObject : null); } Transform obj37 = uiInstance.transform.Find("CurrencyAdd"); currencyAddObj = ((obj37 != null) ? ((Component)obj37).gameObject : null); if ((Object)(object)currencyAddObj == (Object)null) { return; } currencyAddCanvasGroup = currencyAddObj.GetComponent<CanvasGroup>(); currencyAddCanvasGroup = currencyAddCanvasGroup ?? currencyAddObj.AddComponent<CanvasGroup>(); Transform obj38 = currencyAddObj.transform.Find("CurrencyAddTextMain"); mainText = ((obj38 != null) ? ((Component)obj38).GetComponent<TextMeshProUGUI>() : null); Transform obj39 = currencyAddObj.transform.Find("CurrencyAddTextInto"); infoText = ((obj39 != null) ? ((Component)obj39).GetComponent<TextMeshProUGUI>() : null); currencyAddObj.SetActive(false); if ((Object)(object)abilityTimesContainer != (Object)null) { leapAbilityBox = ((Component)abilityTimesContainer.transform.Find("LeapAbility")).gameObject; qtAbilityBox = ((Component)abilityTimesContainer.transform.Find("QTAbility")).gameObject; if ((Object)(object)leapAbilityBox != (Object)null) { leapAbilityTimer = ((Component)leapAbilityBox.transform.Find("LeapTimer")).GetComponent<Image>(); leapForceGlow = ((Component)leapAbilityBox.transform.Find("LeapForceGlow")).GetComponent<Image>(); leapAbilityBox.SetActive(false); } if ((Object)(object)qtAbilityBox != (Object)null) { qtAbilityTimer = ((Component)qtAbilityBox.transform.Find("QTTimer")).GetComponent<Image>(); leapAbilityBox.SetActive(false); } abilityTimesContainer.SetActive(false); } if ((Object)(object)loadingScreen != (Object)null) { loadingImages = ((Component)loadingScreen.transform.Find("LoadingImages")).gameObject; foreach (Transform item2 in loadingImages.transform) { Transform val4 = item2; if (((Object)val4).name.StartsWith("Graffiti")) { graffitiScreens[((Object)val4).name] = ((Component)val4).gameObject; ((Component)val4).gameObject.SetActive(false); } } mapLoadingText = ((Component)loadingScreen.transform.Find("MapText")).GetComponent<TextMeshProUGUI>(); ((TMP_Text)mapLoadingText).text = ""; seedLoadingText = ((Component)loadingScreen.transform.Find("SeedText")).GetComponent<TextMeshProUGUI>(); ((TMP_Text)seedLoadingText).text = ""; idLoadingText = ((Component)loadingScreen.transform.Find("MapIDText")).GetComponent<TextMeshProUGUI>(); ((TMP_Text)idLoadingText).text = ""; loadingScreen.SetActive(false); } if ((Object)(object)wallRunFadeHelper != (Object)null) { wallRunFadeHelper.SetActive(false); Transform obj40 = wallRunFadeHelper.transform.Find("WallRunLeft"); wallRunLeft = ((obj40 != null) ? ((Component)obj40).gameObject : null); Transform obj41 = wallRunFadeHelper.transform.Find("WallRunRight"); wallRunRight = ((obj41 != null) ? ((Component)obj41).gameObject : null); Transform obj42 = wallRunFadeHelper.transform.Find("WallRunUp"); wallRunUp = ((obj42 != null) ? ((Component)obj42).gameObject : null); if ((Object)(object)wallRunLeft != (Object)null) { wallRunLeftGroup = wallRunLeft.GetComponent<CanvasGroup>() ?? wallRunLeft.AddComponent<CanvasGroup>(); } if ((Object)(object)wallRunRight != (Object)null) { wallRunRightGroup = wallRunRight.GetComponent<CanvasGroup>() ?? wallRunRight.AddComponent<CanvasGroup>(); } if ((Object)(object)wallRunUp != (Object)null) { wallRunUpGroup = wallRunUp.GetComponent<CanvasGroup>() ?? wallRunUp.AddComponent<CanvasGroup>(); } wallRunLeftGroup.alpha = 0f; wallRunRightGroup.alpha = 0f; wallRunUpGroup.alpha = 0f; } } public static void UpdateCurrencyDisplay() { if ((Object)(object)currencyTextComponent != (Object)null && Plugin.SkillConfigs.TryGetValue("HeightCurrency", out var value)) { ((TMP_Text)currencyTextComponent).text = ((ConfigEntry<float>)(object)value).Value.ToString(); } if ((Object)(object)heightTextComponent != (Object)null && Plugin.SkillConfigs.TryGetValue("MaxHeight", out var value2)) { int num = (int)((ConfigEntry<float>)(object)value2).Value; ((TMP_Text)heightTextComponent).text = num + "m"; } } public IEnumerator AnimateCurrencyGain(int oldVal, int addedAmount) { int finalVal = oldVal + addedAmount; currencyAddCanvasGroup.alpha = 0f; currencyAddObj.SetActive(true); ((TMP_Text)mainText).text = oldVal.ToString(); ((TMP_Text)infoText).text = $"+{addedAmount}"; float elapsed = 0f; float fadeDuration = 0.3f; while (elapsed < fadeDuration) { elapsed += Time.deltaTime; currencyAddCanvasGroup.alpha = Mathf.Clamp01(elapsed / fadeDuration); yield return null; } yield return (object)new WaitForSeconds(0.5f); RectTransform infoRect = ((Component)infoText).GetComponent<RectTransform>(); Vector2 startPos = infoRect.anchoredPosition; Vector2 targetPos = ((Component)mainText).GetComponent<RectTransform>().anchoredPosition; elapsed = 0f; float moveDuration = 0.4f; while (elapsed < moveDuration) { elapsed += Time.deltaTime; float t = Mathf.SmoothStep(0f, 1f, elapsed / moveDuration); infoRect.anchoredPosition = Vector2.Lerp(startPos, targetPos, t); ((TMP_Text)infoText).alpha = 1f - t; yield return null; } elapsed = 0f; float tickerDuration = 0.6f; while (elapsed < tickerDuration) { elapsed += Time.deltaTime; int current = (int)Mathf.Lerp((float)oldVal, (float)finalVal, elapsed / tickerDuration); ((TMP_Text)mainText).text = current.ToString(); yield return null; } ((TMP_Text)mainText).text = finalVal.ToString(); elapsed = 0f; while (elapsed < fadeDuration) { elapsed += Time.deltaTime; currencyAddCanvasGroup.alpha = 1f - Mathf.Clamp01(elapsed / fadeDuration); yield return null; } currencyAddObj.SetActive(false); } private void CreateClickOutsideBlocker() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown if (!((Object)(object)uiInstance == (Object)null)) { GameObject val = new GameObject("STOutsideClickBlocker"); val.transform.SetParent(uiInstance.transform, false); if ((Object)(object)skillTreePanel != (Object)null) { val.transform.SetSiblingIndex(skillTreePanel.transform.GetSiblingIndex()); } RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.sizeDelta = Vector2.zero; Image val3 = val.AddComponent<Image>(); ((Graphic)val3).color = new Color(0f, 0f, 0f, 0f); Button val4 = val.AddComponent<Button>(); ((UnityEvent)val4.onClick).AddListener((UnityAction)delegate { ToggleUIPanel(showMainPanel: false); }); clickOutsideBlocker = val; } } private void CleanUpFailedInit() { Instance = null; Object.Destroy((Object)(object)((Component)this).gameObject); } private void MapInterfaceControls() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown GameObject obj = openButtonObj; if (obj != null) { Button component = obj.GetComponent<Button>(); if (component != null) { ((UnityEvent)component.onClick).AddListener((UnityAction)delegate { ToggleUIPanel(showMainPanel: true); }); } } GameObject obj2 = closeButtonObj; if (obj2 != null) { Button component2 = obj2.GetComponent<Button>(); if (component2 != null) { ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { ToggleUIPanel(showMainPanel: false); }); } } GameObject obj3 = forwardButtonObj; if (obj3 != null) { Button component3 = obj3.GetComponent<Button>(); if (component3 != null) { ((UnityEvent)component3.onClick).AddListener((UnityAction)delegate { if (!((Object)(object)descriptionPanelObj != (Object)null) || !descriptionPanelObj.activeSelf) { SwitchSubMenuContext(showPerksTree: false); } }); } } GameObject obj4 = backButtonObj; if (obj4 != null) { Button component4 = obj4.GetComponent<Button>(); if (component4 != null) { ((UnityEvent)component4.onClick).AddListener((UnityAction)delegate { if ((Object)(object)descriptionPanelObj != (Object)null && descriptionPanelObj.activeSelf) { ReturnFromDescriptionPage(); } else { SwitchSubMenuContext(showPerksTree: true); } }); } } if ((Object)(object)cameraRotationToggle != (Object)null) { cameraRotationToggle.isOn = Plugin.EnableParkourRotation.Value; ((UnityEvent<bool>)(object)cameraRotationToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isChecked) { Plugin.EnableParkourRotation.Value = isChecked; }); } if ((Object)(object)cameraFOVToggle != (Object)null) { cameraFOVToggle.isOn = Plugin.EnableParkourFOV.Value; ((UnityEvent<bool>)(object)cameraFOVToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isChecked) { Plugin.EnableParkourFOV.Value = isChecked; }); } if ((Object)(object)cameraShakeToggle != (Object)null) { cameraShakeToggle.isOn = Plugin.EnableParkourShake.Value; ((UnityEvent<bool>)(object)cameraShakeToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isChecked) { Plugin.EnableParkourShake.Value = isChecked; }); } if ((Object)(object)uiGlowToggle != (Object)null) { uiGlowToggle.isOn = Plugin.EnableWallRunHelper.Value; ((UnityEvent<bool>)(object)uiGlowToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isChecked) { Plugin.EnableWallRunHelper.Value = isChecked; }); } Button obj5 = resetProgressButton; if (obj5 != null) { ((UnityEvent)obj5.onClick).AddListener(new UnityAction(ShowResetConfirmPopup)); } Button obj6 = purchaseButton; if (obj6 != null) { ((UnityEvent)obj6.onClick).AddListener(new UnityAction(OnPurchasePressed)); } } private void SwitchSubMenuContext(bool showPerksTree) { Transform obj = contentTransform; if (obj != null) { ((Component)obj).gameObject.SetActive(showPerksTree); } GameObject obj2 = optionsContentObj; if (obj2 != null) { obj2.SetActive(!showPerksTree); } GameObject obj3 = descriptionPanelObj; if (obj3 != null) { obj3.SetActive(false); } Transform obj4 = headerGroup; if (obj4 != null) { ((Component)obj4).gameObject.SetActive(true); } GameObject obj5 = forwardButtonObj; if (obj5 != null) { obj5.SetActive(showPerksTree); } GameObject obj6 = backButtonObj; if (obj6 != null) { obj6.SetActive(!showPerksTree); } TextMeshProUGUI obj7 = textHeaderComponent; if (obj7 != null) { ((Component)obj7).gameObject.SetActive(true); } ((TMP_Text)textHeaderComponent).text = (showPerksTree ? "SKILL TREE" : "OPTIONS"); if (!showPerksTree && (Object)(object)cameraRotationToggle != (Object)null) { cameraRotationToggle.isOn = Plugin.EnableParkourRotation.Value; } if (!showPerksTree && (Object)(object)cameraFOVToggle != (Object)null) { cameraFOVToggle.isOn = Plugin.EnableParkourFOV.Value; } if (!showPerksTree && (Object)(object)cameraShakeToggle != (Object)null) { cameraShakeToggle.isOn = Plugin.EnableParkourShake.Value; } if (!showPerksTree && (Object)(object)uiGlowToggle != (Object)null) { uiGlowToggle.isOn = Plugin.EnableWallRunHelper.Value; } if ((Object)(object)contentTransform != (Object)null) { ((MonoBehaviour)this).StartCoroutine(FadePanel(((Component)contentTransform).gameObject, showPerksTree, 0.3f)); } if ((Object)(object)optionsContentObj != (Object)null) { ((MonoBehaviour)this).StartCoroutine(FadePanel(optionsContentObj.gameObject, !showPerksTree, 0.3f)); } } private IEnumerator FadePanel(GameObject obj, bool fadeIn, float duration) { CanvasGroup cg = obj.GetComponent<CanvasGroup>(); cg = cg ?? obj.AddComponent<CanvasGroup>(); float startAlpha = cg.alpha; float endAlpha = (fadeIn ? 1f : 0f); float elapsed = 0f; while (elapsed < duration) { elapsed += Time.deltaTime; cg.alpha = Mathf.Lerp(startAlpha, endAlpha, elapsed / duration); yield return null; } cg.alpha = endAlpha; } private void OnResetRequested() { foreach (string key in skillButtons.Keys) { if (Plugin.SkillConfigs.TryGetValue(key, out var value)) { ((ConfigEntry<bool>)(object)value).Value = false; } } newCurrencyAmount = 0f; ((ConfigEntry<float>)(object)Plugin.SkillConfigs["HeightCurrency"]).Value = 0f; ((ConfigEntry<float>)(object)Plugin.SkillConfigs["MaxHeight"]).Value = 0f; UpdateCurrencyDisplay(); foreach (Coroutine activeAnimation in activeAnimations) { if (activeAnimation != null) { ((MonoBehaviour)this).StopCoroutine(activeAnimation); } } activeAnimations.Clear(); isAnimatingBranch = false; RefreshAllNodeVisuals(); } private void ShowResetConfirmPopup() { GameObject obj = optionsContentObj; if (obj != null) { obj.SetActive(false); } Transform obj2 = headerGroup; if (obj2 != null) { ((Component)obj2).gameObject.SetActive(false); } GameObject obj3 = resetConfirmBox; if (obj3 != null) { obj3.SetActive(true); } } private void HandleResetConfirmed() { OnResetRequested(); GameObject obj = resetConfirmBox; if (obj != null) { obj.SetActive(false); } GameObject obj2 = optionsContentObj; if (obj2 != null) { obj2.SetActive(true); } Transform obj3 = headerGroup; if (obj3 != null) { ((Component)obj3).gameObject.SetActive(true); } } private void HandleResetDenied() { GameObject obj = resetConfirmBox; if (obj != null) { obj.SetActive(false); } GameObject obj2 = optionsContentObj; if (obj2 != null) { obj2.SetActive(true); } Transform obj3 = headerGroup; if (obj3 != null) { ((Component)obj3).gameObject.SetActive(true); } } private void MapProgressionNodes() { //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)contentTransform == (Object)null) { return; } skillButtons.Clear(); skillDependencies.Clear(); skillLines.Clear(); nodeOriginPositions.Clear(); RegisterNode("QTButton", "QuickTurning", null, "LineToSlide"); RegisterNode("SlideButton", "Sliding", new string[1] { "QuickTurning" }, null); RegisterNode("SlideJButton", "SlideJumping", new string[1] { "Sliding" }, "LineToSJ"); RegisterNode("LeapButton", "Leaping", new string[1] { "SlideJumping" }, "LineToLeaping"); RegisterNode("RollButton", "Rolling", new string[1] { "Sliding" }, "LineToRoll"); RegisterNode("WKButton", "WallKicking", new string[1] { "Sliding" }, "LineToWK"); RegisterNode("WRButton", "WallRunning", new string[1] { "WallKicking" }, "LineToWR"); RegisterNode("VWRButton", "VerticalWallRunning", new string[1] { "WallRunning" }, "LineToVWR"); RegisterNode("WRBButton", "WallRunBoost", new string[1] { "VerticalWallRunning" }, "LineToWRB"); foreach (KeyValuePair<string, Button> skillButton in skillButtons) { string key = skillButton.Key; RectTransform component = ((Component)skillButton.Value).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null) { nodeOriginPositions[key] = component.anchoredPosition; if (key == "QuickTurning") { quickTurnRect = component; } } if (!skillLines.TryGetValue(key, out var value)) { continue; } RectTransform component2 = ((Component)value).GetComponent<RectTransform>(); if ((Object)(object)component2 != (Object)null) { lineOriginPositions[key] = component2.anchoredPosition; if (((Object)((Component)value).gameObject).name == "LineToSlide") { lineToSlideRect = component2; } } } } private void RegisterNode(string buttonObjectName, string configKey, string[] prerequisites, string lineObjectName) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown T