using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using UnityEngine;
using UnityEngine.SceneManagement;
[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)
{
if (((Ability)__instance).p.boostButtonHeld && ((Ability)((Ability)__instance).p.boostAbility).allowNormalJump && ToggleGravityPlugin.enableMidairtrickjumpCfg.Value)
{
((Ability)((Ability)__instance).p.specialAirAbility).OnStartAbility();
__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
{
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_03f5: Unknown result type (might be due to invalid IL or missing references)
//IL_03fb: Invalid comparison between Unknown and I4
//IL_0461: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Invalid comparison between Unknown and I4
//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
//IL_04d3: Invalid comparison between Unknown and I4
//IL_062c: Unknown result type (might be due to invalid IL or missing references)
//IL_0632: Invalid comparison between Unknown and I4
//IL_0536: Unknown result type (might be due to invalid IL or missing references)
//IL_053c: Invalid comparison between Unknown and I4
//IL_0669: Unknown result type (might be due to invalid IL or missing references)
//IL_066f: Invalid comparison between Unknown and I4
//IL_076e: Unknown result type (might be due to invalid IL or missing references)
//IL_0774: Invalid comparison between Unknown and I4
//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
//IL_06a9: Invalid comparison between Unknown and I4
//IL_0792: Unknown result type (might be due to invalid IL or missing references)
//IL_0798: Invalid comparison between Unknown and I4
//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
//IL_06e3: Invalid comparison between Unknown and I4
//IL_0848: Unknown result type (might be due to invalid IL or missing references)
//IL_084e: Invalid comparison between Unknown and I4
//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
//IL_07bc: Invalid comparison between Unknown and I4
//IL_0889: Unknown result type (might be due to invalid IL or missing references)
//IL_088f: Invalid comparison between Unknown and I4
//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
//IL_07e2: Invalid comparison between Unknown and I4
//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
//IL_08cd: Invalid comparison between Unknown and I4
//IL_0905: Unknown result type (might be due to invalid IL or missing references)
//IL_090b: Invalid comparison between Unknown and I4
enableMidairtrickjumpCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "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)");
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));
}
}
}