Decompiled source of WoodzMovementTweaks v1.1.3

WoodzGravity.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using UnityEngine;
using UnityEngine.SceneManagement;
using trickyclown;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("WoodzGravity")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Movement tweaks for Bomb Rush Cyberfunk")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WoodzGravity")]
[assembly: AssemblyTitle("WoodzGravity")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace woodzgravity
{
	public class PatchAirdash
	{
		[HarmonyPatch(typeof(AirDashAbility), "OnStartAbility")]
		[HarmonyPrefix]
		private static bool OnStartAbilityPrefix(AirDashAbility __instance)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: 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_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Invalid comparison between Unknown and I4
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Invalid comparison between Unknown and I4
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Invalid comparison between Unknown and I4
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: 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_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Invalid comparison between Unknown and I4
			if (((Ability)__instance).p.boostButtonHeld && ((Ability)((Ability)__instance).p.boostAbility).allowNormalJump && ToggleGravityPlugin.enableMidairtrickjumpCfg.Value)
			{
				SpecialAirAbility val = new SpecialAirAbility(((Ability)__instance).p);
				if (ToggleGravityPlugin.newMtj.Value)
				{
					float value = ToggleGravityPlugin.horizontalToVerticalPercent.Value;
					float value2 = ToggleGravityPlugin.horizontalToVerticalMax.Value;
					float value3 = ToggleGravityPlugin.horizontalLossPercent.Value;
					float value4 = ToggleGravityPlugin.minReferenceSpeed.Value;
					bool value5 = ToggleGravityPlugin.scaleBySpeed.Value;
					((Ability)__instance).p.jumpedThisFrame = true;
					((Ability)__instance).p.isJumping = true;
					((Ability)__instance).p.maintainSpeedJump = false;
					((Ability)__instance).p.jumpConsumed = true;
					((Ability)__instance).p.jumpRequested = false;
					((Ability)__instance).p.jumpedThisFrame = true;
					((Ability)__instance).p.timeSinceLastJump = 0f;
					Vector3 velocity = ((Ability)__instance).p.GetVelocity();
					Vector3 val2 = default(Vector3);
					((Vector3)(ref val2))..ctor(velocity.x, 0f, velocity.z);
					float num = ((Vector3)(ref val2)).magnitude;
					float num2 = velocity.y;
					if (num < 20f)
					{
						num = 20f;
					}
					if (num2 < val.jumpSpeed)
					{
						num2 = val.jumpSpeed;
					}
					float num3 = value;
					if (value5)
					{
						float num4 = value2;
						float num5 = Mathf.InverseLerp(value4, num4, num);
						num5 = Mathf.Clamp01(num5);
						num3 *= num5;
					}
					float num6 = num * num3;
					num6 = Mathf.Min(num6, value2);
					float num7 = num6 * Mathf.Clamp01(value3);
					Vector3 val3 = ((Vector3)(ref val2)).normalized * Mathf.Max(0f, num - num7);
					num2 += num6;
					Vector3 velocity2 = val3 + Vector3.up * num2;
					((Ability)__instance).p.SetVelocity(velocity2);
					((Ability)__instance).p.AudioManager.PlaySfxGameplay((SfxCollectionID)20, (AudioClipID)130, ((Ability)__instance).p.playerOneShotAudioSource, 0f);
					((Ability)__instance).p.PlayVoice((AudioClipID)489, (VoicePriority)0, true);
					((Ability)__instance).p.DoHighJumpEffects(((Ability)__instance).p.motor.groundNormalVisual * -1f);
				}
				else
				{
					((Ability)((Ability)__instance).p.specialAirAbility).OnStartAbility();
				}
				if ((int)((Ability)__instance).p.moveStyle == 0)
				{
					((Ability)__instance).p.PlayAnim(AnimationUtility.GetAnimationByName(ToggleGravityPlugin.mtjAnim.Value), false, false, -1f);
				}
				else if ((int)((Ability)__instance).p.moveStyle == 3)
				{
					((Ability)__instance).p.PlayAnim(AnimationUtility.GetAnimationByName(ToggleGravityPlugin.mtjAnimInline.Value), false, false, -1f);
				}
				else if ((int)((Ability)__instance).p.moveStyle == 2)
				{
					((Ability)__instance).p.PlayAnim(AnimationUtility.GetAnimationByName(ToggleGravityPlugin.mtjAnimSkateboard.Value), false, false, -1f);
				}
				else if ((int)((Ability)__instance).p.moveStyle == 1)
				{
					((Ability)__instance).p.PlayAnim(AnimationUtility.GetAnimationByName(ToggleGravityPlugin.mtjAnimBMX.Value), false, false, -1f);
				}
				else
				{
					((Ability)__instance).p.PlayAnim(Animator.StringToHash("jumpTrick1"), false, false, -1f);
				}
				__instance.haveAirDash = false;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(HandplantAbility), "FixedUpdateAbility")]
		[HarmonyPrefix]
		private static bool FixedUpdateAbilityPostfix(HandplantAbility __instance)
		{
			ToggleGravityPlugin.inhandplant = true;
			return true;
		}

		[HarmonyPatch(typeof(HandplantAbility), "OnStopAbility")]
		[HarmonyPrefix]
		private static bool OnStopAbilityPostfix(HandplantAbility __instance)
		{
			ToggleGravityPlugin.inhandplant = false;
			return true;
		}
	}
	[BepInPlugin("WoodzMovementTweaks", "Woodz Movement Tweaks", "1.0.0")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class ToggleGravityPlugin : BaseUnityPlugin
	{
		public static ConfigEntry<float> horizontalToVerticalPercent;

		public static ConfigEntry<float> horizontalToVerticalMax;

		public static ConfigEntry<float> minReferenceSpeed;

		public static ConfigEntry<float> horizontalLossPercent;

		public static ConfigEntry<bool> scaleBySpeed;

		public static ConfigEntry<string> mtjAnim;

		public static ConfigEntry<string> mtjAnimInline;

		public static ConfigEntry<string> mtjAnimSkateboard;

		public static ConfigEntry<string> mtjAnimBMX;

		public static ConfigEntry<bool> newMtj;

		private bool sprintToggled = false;

		public float G;

		public float G2;

		public float S;

		public bool runSpeed;

		public bool grav;

		private bool sceneLoaded = false;

		public static ConfigEntry<bool> enableMidairtrickjumpCfg;

		public ConfigEntry<bool> enableRunCfg;

		public ConfigEntry<bool> enableJumpCfg;

		public ConfigEntry<float> runSpeedCfg;

		public ConfigEntry<float> runSpeedCfgInline;

		public ConfigEntry<float> runSpeedCfgSkateboard;

		public ConfigEntry<float> runSpeedCfgBMX;

		public ConfigEntry<bool> enableGravCfg;

		public ConfigEntry<bool> enableMovestyleDifferences;

		public ConfigEntry<float> gravityUpCfg;

		public ConfigEntry<float> gravityDownCfg;

		public ConfigEntry<bool> enableGravCfgInline;

		public ConfigEntry<float> gravityUpCfgInline;

		public ConfigEntry<float> gravityDownCfgInline;

		public ConfigEntry<bool> enableGravCfgSkateboard;

		public ConfigEntry<float> gravityUpCfgSkateboard;

		public ConfigEntry<float> gravityDownCfgSkateboard;

		public ConfigEntry<bool> enableGravCfgBMX;

		public ConfigEntry<float> gravityUpCfgBMX;

		public ConfigEntry<float> gravityDownCfgBMX;

		public ConfigEntry<float> jumpHeight;

		public ConfigEntry<float> jumpHeightInline;

		public ConfigEntry<float> jumpHeightSkateboard;

		public ConfigEntry<float> jumpHeightBMX;

		public static bool inhandplant;

		private void Awake()
		{
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void ApplyRunSpeedCfg(float speed)
		{
			S = speed;
		}

		private void ApplyEnableGravCfg(float grav)
		{
			G = grav;
		}

		private void ApplyEnableGrav2Cfg(float grav2)
		{
			G2 = grav2;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			sceneLoaded = true;
		}

		private void Update()
		{
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Expected O, but got Unknown
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Expected O, but got Unknown
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Expected O, but got Unknown
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Invalid comparison between Unknown and I4
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Invalid comparison between Unknown and I4
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			//IL_067e: Invalid comparison between Unknown and I4
			//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Invalid comparison between Unknown and I4
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e7: Invalid comparison between Unknown and I4
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Invalid comparison between Unknown and I4
			//IL_0919: Unknown result type (might be due to invalid IL or missing references)
			//IL_091f: Invalid comparison between Unknown and I4
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0854: Invalid comparison between Unknown and I4
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0943: Invalid comparison between Unknown and I4
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_088e: Invalid comparison between Unknown and I4
			//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f9: Invalid comparison between Unknown and I4
			//IL_0961: Unknown result type (might be due to invalid IL or missing references)
			//IL_0967: Invalid comparison between Unknown and I4
			//IL_0a34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3a: Invalid comparison between Unknown and I4
			//IL_0987: Unknown result type (might be due to invalid IL or missing references)
			//IL_098d: Invalid comparison between Unknown and I4
			//IL_0a72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a78: Invalid comparison between Unknown and I4
			//IL_0ab0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab6: Invalid comparison between Unknown and I4
			enableMidairtrickjumpCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("MTJ", "EnableMidairtrickjump", true, "Enable midair trick jump (cancel a boost with an airdash to activate)");
			enableRunCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableRun", true, "Enable run speed tweak");
			enableJumpCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableJump", true, "Enable jump height tweak");
			runSpeedCfg = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RunSpeed", 4f, "Run speed modifier (0 is vanilla)");
			runSpeedCfgInline = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RunSpeedInline", 7f, "Inline Run speed modifier (0 is vanilla)");
			runSpeedCfgSkateboard = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RunSpeedSkateboard", 10f, "Skateboard Run speed modifier (0 is vanilla)");
			runSpeedCfgBMX = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RunSpeedBMX", 13f, "BMX Run speed modifier (0 is vanilla)");
			enableGravCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableGravity", false, "Enable rigidbody gravity. I also recommend setting your MovementPlus Max Fall Speed (not fastfall speed, the one in misc settings) to 66.667");
			enableMovestyleDifferences = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableMovestyles", true, "Enable using the movestyle config values for each movestyle.");
			gravityUpCfg = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UpGravity", 14.5f, "Rigidbody up gravity (14.5 is vanilla)");
			gravityDownCfg = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DownGravity", 14.5f, "Rigidbody down (falling) gravity (14.5 is vanilla)");
			enableGravCfgInline = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableGravityInline", false, "Inline Enable rigidbody gravity. I also recommend setting your MovementPlus Max Fall Speed (not fastfall speed, the one in misc settings) to 66.667");
			gravityUpCfgInline = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UpGravityInline", 16.85f, "Inline Rigidbody up gravity (14.5 is vanilla)");
			gravityDownCfgInline = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DownGravityInline", 16.85f, "Inline Rigidbody down (falling) gravity (14.5 is vanilla)");
			enableGravCfgSkateboard = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableGravitySkateboard", true, "Skateboard Enable rigidbody gravity. I also recommend setting your MovementPlus Max Fall Speed (not fastfall speed, the one in misc settings) to 66.667");
			gravityUpCfgSkateboard = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UpGravitySkateboard", 9.8f, "Skateboard Rigidbody up gravity (14.5 is vanilla)");
			gravityDownCfgSkateboard = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DownGravitySkateboard", 9.8f, "Skateboard Rigidbody down (falling) gravity (14.5 is vanilla)");
			enableGravCfgBMX = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableGravityBMX", true, "BMX Enable rigidbody gravity. I also recommend setting your MovementPlus Max Fall Speed (not fastfall speed, the one in misc settings) to 66.667");
			gravityUpCfgBMX = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UpGravityBMX", 9.8f, "BMX Rigidbody up gravity (14.5 is vanilla)");
			gravityDownCfgBMX = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DownGravityBMX", 14.5f, "BMX Rigidbody down (falling) gravity (14.5 is vanilla)");
			jumpHeight = ((BaseUnityPlugin)this).Config.Bind<float>("General", "JumpHeight", 8f, "Jump height. Also affects launchers. (8 is vanilla)");
			jumpHeightInline = ((BaseUnityPlugin)this).Config.Bind<float>("General", "JumpHeightInline", 9f, "Inline Jump height. Also affects launchers. (8 is vanilla)");
			jumpHeightSkateboard = ((BaseUnityPlugin)this).Config.Bind<float>("General", "JumpHeightSkateboard", 11f, "Skateboard Jump height. Also affects launchers. (8 is vanilla)");
			jumpHeightBMX = ((BaseUnityPlugin)this).Config.Bind<float>("General", "JumpHeightBMX", 11f, "BMX Jump height. Also affects launchers. (8 is vanilla)");
			newMtj = ((BaseUnityPlugin)this).Config.Bind<bool>("MTJ", "NewMidairTrickJump", true, "Use new midair trick jump. No jump storage, forward speed has a capped and optionally scaled percentage taken from and added to vertical speed.");
			mtjAnim = ((BaseUnityPlugin)this).Config.Bind<string>("MTJ", "MidairTrickJumpAnim", "jumpTrick1", "Midair trick jump animation.");
			mtjAnimInline = ((BaseUnityPlugin)this).Config.Bind<string>("MTJ", "MidairTrickJumpAnimInline", "jumpTrick1", "Midair trick jump animation. (Inline)");
			mtjAnimSkateboard = ((BaseUnityPlugin)this).Config.Bind<string>("MTJ", "MidairTrickJumpAnimSkateboard", "jumpTrick1", "Midair trick jump animation. (Skateboard)");
			mtjAnimBMX = ((BaseUnityPlugin)this).Config.Bind<string>("MTJ", "MidairTrickJumpAnimBMX", "jumpTrick1", "Midair trick jump animation. (BMX)");
			horizontalToVerticalMax = ((BaseUnityPlugin)this).Config.Bind<float>("MTJ", "horizontalToVerticalMax", 50f, new ConfigDescription("Max speed taken from horizontal and given to vertical. 10 is equivalent to 100 on Dragsun's speedometer, just move the decimal one over to the left.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, float.MaxValue), Array.Empty<object>()));
			minReferenceSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("MTJ", "minReferenceSpeed", 33.3f, "Speed at which to begin converting horizontal to vertical.");
			horizontalToVerticalPercent = ((BaseUnityPlugin)this).Config.Bind<float>("MTJ", "Horizontal To Vertical Percent", 0.14f, new ConfigDescription("What percentage of horizontal speed to convert to vertical (in new MTJ)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			horizontalLossPercent = ((BaseUnityPlugin)this).Config.Bind<float>("MTJ", "horizontalLossPercent", 0.5f, new ConfigDescription("What percentage of horizontal speed is actually lost when transfering to vertical.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			scaleBySpeed = ((BaseUnityPlugin)this).Config.Bind<bool>("MTJ", "scaleBySpeed", true, "Whether or not it will take less then your set percentage the slower you're going. Uses max speed in its calculation.");
			ApplyRunSpeedCfg(runSpeedCfg.Value);
			ApplyEnableGravCfg(gravityUpCfg.Value);
			ApplyEnableGrav2Cfg(gravityDownCfg.Value);
			if (!sceneLoaded)
			{
				return;
			}
			GameObject val = GameObject.Find("Player_HUMAN0");
			if (!((Object)(object)val != (Object)null))
			{
				return;
			}
			Rigidbody component = val.GetComponent<Rigidbody>();
			MovementMotor component2 = val.GetComponent<MovementMotor>();
			Player component3 = val.GetComponent<Player>();
			if ((Object)(object)component != (Object)null)
			{
				if (enableMovestyleDifferences.Value)
				{
					if ((int)component3.moveStyle == 3)
					{
						if (enableGravCfgInline.Value)
						{
							if (component3.IsGrounded() || component3.IsGrinding() || inhandplant)
							{
								component.useGravity = false;
							}
							else
							{
								component.useGravity = true;
							}
						}
						else
						{
							component.useGravity = false;
						}
					}
					else if ((int)component3.moveStyle == 2)
					{
						if (enableGravCfgSkateboard.Value)
						{
							if (component3.IsGrounded() || component3.IsGrinding() || inhandplant)
							{
								component.useGravity = false;
							}
							else
							{
								component.useGravity = true;
							}
						}
						else
						{
							component.useGravity = false;
						}
					}
					else if ((int)component3.moveStyle == 1)
					{
						if (enableGravCfgBMX.Value)
						{
							if (component3.IsGrounded() || component3.IsGrinding() || inhandplant)
							{
								component.useGravity = false;
							}
							else
							{
								component.useGravity = true;
							}
						}
						else
						{
							component.useGravity = false;
						}
					}
					else if ((int)component3.moveStyle == 0)
					{
						if (enableGravCfg.Value)
						{
							if (component3.IsGrounded() || component3.IsGrinding() || inhandplant)
							{
								component.useGravity = false;
							}
							else
							{
								component.useGravity = true;
							}
						}
						else
						{
							component.useGravity = false;
						}
					}
				}
				else if (enableGravCfg.Value)
				{
					if (component3.IsGrounded() || component3.IsGrinding() || inhandplant)
					{
						component.useGravity = false;
					}
					else
					{
						component.useGravity = true;
					}
				}
			}
			if ((Object)(object)component2 != (Object)null && enableGravCfg.Value)
			{
				if (enableMovestyleDifferences.Value)
				{
					if ((int)component3.moveStyle == 3)
					{
						component2.gravity = gravityDownCfgInline.Value;
						component2.gravityUp = gravityUpCfgInline.Value;
					}
					else if ((int)component3.moveStyle == 2)
					{
						component2.gravity = gravityDownCfgSkateboard.Value;
						component2.gravityUp = gravityUpCfgSkateboard.Value;
					}
					else if ((int)component3.moveStyle == 1)
					{
						component2.gravity = gravityDownCfgBMX.Value;
						component2.gravityUp = gravityUpCfgBMX.Value;
					}
					else if ((int)component3.moveStyle == 0)
					{
						component2.gravity = G2;
						component2.gravityUp = G;
					}
				}
				else
				{
					component2.gravity = G2;
					component2.gravityUp = G;
				}
			}
			if (!((Object)(object)component3 != (Object)null))
			{
				return;
			}
			if (enableRunCfg.Value)
			{
				if (enableMovestyleDifferences.Value)
				{
					if ((int)component3.moveStyle == 3)
					{
						component3.runSpeedModifier = runSpeedCfgInline.Value;
					}
					if ((int)component3.moveStyle == 2)
					{
						component3.runSpeedModifier = runSpeedCfgSkateboard.Value;
					}
					if ((int)component3.moveStyle == 1)
					{
						component3.runSpeedModifier = runSpeedCfgBMX.Value;
					}
					else if ((int)component3.moveStyle == 0)
					{
						component3.runSpeedModifier = S;
					}
				}
				else
				{
					component3.runSpeedModifier = S;
				}
			}
			else
			{
				component3.runSpeedModifier = 0f;
			}
			if (enableJumpCfg.Value)
			{
				if (enableMovestyleDifferences.Value)
				{
					if ((int)component3.moveStyle == 3)
					{
						component3.jumpSpeed = jumpHeightInline.Value;
						component3.jumpSpeedLauncher = jumpHeightInline.Value * 2f;
					}
					else if ((int)component3.moveStyle == 2)
					{
						component3.jumpSpeed = jumpHeightSkateboard.Value;
						component3.jumpSpeedLauncher = jumpHeightSkateboard.Value * 2f;
					}
					else if ((int)component3.moveStyle == 1)
					{
						component3.jumpSpeed = jumpHeightBMX.Value;
						component3.jumpSpeedLauncher = jumpHeightBMX.Value * 2f;
					}
					else if ((int)component3.moveStyle == 0)
					{
						component3.jumpSpeed = jumpHeight.Value;
						component3.jumpSpeedLauncher = jumpHeight.Value * 2f;
					}
				}
				else
				{
					component3.jumpSpeed = jumpHeight.Value;
					component3.jumpSpeedLauncher = jumpHeight.Value * 2f;
				}
			}
			else
			{
				component3.jumpSpeed = 8f;
				component3.jumpSpeedLauncher = 16f;
			}
		}
	}
	[BepInPlugin("info.mariobluegloves.woodzgravity", "Gravity Mod", "1.0.0")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class WoodzMovement : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Move Faster, Pokey!");
			Harmony val = new Harmony("info.mariobluegloves.woodzgravityp");
			val.PatchAll(typeof(PatchAirdash));
			if (Chainloader.PluginInfos.ContainsKey("com.Dragsun.BunchOfEmotes"))
			{
				BunchOfEmotesSupport.Initialize();
			}
		}
	}
}
namespace trickyclown
{
	public static class AnimationUtility
	{
		public static int GetAnimationByName(string name)
		{
			if (BunchOfEmotesSupport.Installed && BunchOfEmotesSupport.TryGetGameAnimationForCustomAnimation(name, out var gameAnim))
			{
				return gameAnim;
			}
			return Animator.StringToHash(name);
		}
	}
	public static class BunchOfEmotesSupport
	{
		private static object BoEPluginInstance = null;

		private static Type BoEPluginType = null;

		private static FieldInfo CustomAnimsField = null;

		private static bool Cached = false;

		private static Dictionary<string, int> GameAnimationByCustomAnimation = new Dictionary<string, int>();

		public static bool Installed { get; private set; } = false;


		public static void Initialize()
		{
			Installed = true;
			BoEPluginInstance = Chainloader.PluginInfos["com.Dragsun.BunchOfEmotes"].Instance;
			BoEPluginType = ReflectionUtility.GetTypeByName("BunchOfEmotes.BunchOfEmotesPlugin");
			CustomAnimsField = BoEPluginType.GetField("myCustomAnims2");
		}

		public static void CacheAnimationsIfNecessary()
		{
			if (Cached || !(CustomAnimsField.GetValue(BoEPluginInstance) is Dictionary<int, string> dictionary) || dictionary.Count <= 0)
			{
				return;
			}
			Cached = true;
			foreach (KeyValuePair<int, string> item in dictionary)
			{
				int key = item.Key;
				GameAnimationByCustomAnimation[item.Value] = key;
			}
		}

		public static bool TryGetGameAnimationForCustomAnimation(string customAnim, out int gameAnim)
		{
			if (!Installed)
			{
				gameAnim = 0;
				return false;
			}
			CacheAnimationsIfNecessary();
			if (GameAnimationByCustomAnimation.TryGetValue(customAnim, out gameAnim))
			{
				return true;
			}
			return false;
		}
	}
	public static class ReflectionUtility
	{
		public static Type GetTypeByName(string name)
		{
			foreach (Assembly item in AppDomain.CurrentDomain.GetAssemblies().Reverse())
			{
				Type type = item.GetType(name);
				if (type != null)
				{
					return type;
				}
			}
			return null;
		}
	}
}