Decompiled source of WoodzMovementTweaks v0.2.0

WoodzGravity.dll

Decompiled 2 months ago
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 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("0.2.0.0")]
[assembly: AssemblyInformationalVersion("0.2.0")]
[assembly: AssemblyProduct("WoodzGravity")]
[assembly: AssemblyTitle("WoodzGravity")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.2.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
{
	[BepInPlugin("info.mariobluegloves.woodzgravity2", "Gravity Mod", "0.2.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 ConfigEntry<bool> enableRunCfg;

		public ConfigEntry<float> runSpeedCfg;

		public ConfigEntry<bool> enableRunStickCfg;

		public ConfigEntry<bool> enableRunToggleCfg;

		public ConfigEntry<bool> enableGravCfg;

		public ConfigEntry<float> gravityUpCfg;

		public ConfigEntry<float> gravityDownCfg;

		private void Awake()
		{
			enableRunCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableRun", true, "Enable run speed tweak");
			runSpeedCfg = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RunSpeed", 13.5f, "Run speed modifier (0 is vanilla)");
			enableGravCfg = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableGravity", true, "Enable rigidbody gravity. I also recommend setting your MovementPlus Max Fall Speed (not fastfall speed, the one in misc settings) to 66.667");
			gravityUpCfg = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UpGravity", 9.8f, "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)");
			ApplyRunSpeedCfg(runSpeedCfg.Value);
			ApplyEnableGravCfg(gravityUpCfg.Value);
			ApplyEnableGrav2Cfg(gravityDownCfg.Value);
			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()
		{
			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 && enableGravCfg.Value)
			{
				if (component3.IsGrounded())
				{
					component.useGravity = false;
				}
				else
				{
					component.useGravity = true;
				}
			}
			if ((Object)(object)component2 != (Object)null && enableGravCfg.Value)
			{
				component2.gravity = G2;
				component2.gravityUp = G;
			}
			if ((Object)(object)component3 != (Object)null && enableRunCfg.Value)
			{
				component3.runSpeedModifier = S;
			}
		}
	}
	[BepInPlugin("info.mariobluegloves.woodzgravity", "Gravity Mod", "0.2.0")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class WoodzMovement : BaseUnityPlugin
	{
		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Move Faster, Pokey!");
		}
	}
}