Decompiled source of Rebound v3.0.3

plugins/Rebound/Rebound.dll

Decompiled 2 weeks 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 BepInEx.Logging;
using CrewBoomMono;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using QuickTurn;
using Reptile;
using UnityEngine;
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.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyCompany("Rebound")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("3.0.3.0")]
[assembly: AssemblyInformationalVersion("3.0.3+7510dc119dcb07bec1f17e5dfe7efeaaf05bb407")]
[assembly: AssemblyProduct("Rebound")]
[assembly: AssemblyTitle("Rebound")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.0.3.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 Rebound
{
	internal class RBSettings
	{
		public static List<string> PlayerActionTypes = new List<string> { "slide", "boost", "spray", "dance", "trick1", "trick2", "trick3", "trickany", "switchstyle", "walk" };

		private static ConfigEntry<float> config_reboundVelocityMultiplier;

		private static ConfigEntry<float> config_maxLandingTimeToRebound;

		private static ConfigEntry<float> config_minVelocityToRebound;

		private static ConfigEntry<float> config_minReboundYVelocity;

		private static ConfigEntry<float> config_maxReboundYVelocity;

		private static ConfigEntry<float> config_launcherBonusMultiplier;

		public static ConfigEntry<float> config_slopeMultiplierX;

		public static ConfigEntry<float> config_slopeMultiplierY;

		private static ConfigEntry<bool> config_capBasedOnHeight;

		private static ConfigEntry<float> config_heightCapGenerosity;

		private static ConfigEntry<bool> config_refreshCombo;

		private static ConfigEntry<bool> config_tempDisableBoostAfterRebound;

		private static ConfigEntry<bool> config_alwaysCalculateBasedOnHeight;

		public static ConfigEntry<bool> config_slopeOnLauncher;

		public static ConfigEntry<bool> config_preventComboExtend;

		public static ConfigEntry<bool> config_practiceMode;

		public static ConfigEntry<bool> config_enableTrail;

		public static ConfigEntry<float> config_trailLength;

		public static ConfigEntry<float> config_trailWidth;

		public static ConfigEntry<float> config_burstReboundPower;

		private static ConfigEntry<string> config_cancelReboundActions;

		private static ConfigEntry<string> config_doReboundActions;

		public static ConfigEntry<bool> config_requireAllDRA;

		public static ConfigEntry<bool> config_requireAllCRA;

		public static ConfigEntry<float> config_burstReboundSens;

		public static ConfigEntry<float> config_burstReboundDead;

		public static float config_burstReboundDeadSquared;

		public static void UpdateSettings(ConfigFile Config)
		{
			BindSettings(Config);
			SetSettingsInPlugin();
		}

		public static void SetSettingsInPlugin()
		{
			ReboundPlugin.reboundVelocityMultiplier = config_reboundVelocityMultiplier.Value;
			ReboundPlugin.maxLandingTimeToRebound = config_maxLandingTimeToRebound.Value;
			ReboundPlugin.minVelocityToRebound = config_minVelocityToRebound.Value;
			ReboundPlugin.minReboundYVelocity = config_minReboundYVelocity.Value;
			ReboundPlugin.maxReboundYVelocity = config_maxReboundYVelocity.Value;
			ReboundPlugin.launcherBonusMultiplier = config_launcherBonusMultiplier.Value;
			ReboundPlugin.capBasedOnHeight = config_capBasedOnHeight.Value;
			ReboundPlugin.heightCapGenerosity = config_heightCapGenerosity.Value;
			ReboundPlugin.refreshCombo = config_refreshCombo.Value;
			ReboundPlugin.alwaysCalculateBasedOnHeight = config_alwaysCalculateBasedOnHeight.Value;
			ReboundPlugin.tempDisableBoostAfterRebound = config_tempDisableBoostAfterRebound.Value;
			ReboundPlugin.cancelReboundActions = ConvertString(config_cancelReboundActions.Value, PlayerActionTypes);
			ReboundPlugin.doReboundActions = ConvertString(config_doReboundActions.Value, PlayerActionTypes);
			config_burstReboundDeadSquared = config_burstReboundDead.Value * config_burstReboundDead.Value;
		}

		public static void UpdateSettingsEvent(object sender, EventArgs args)
		{
			SetSettingsInPlugin();
		}

		public static List<string> ConvertString(string _string, List<string> _list)
		{
			string text = _string.Replace(" ", "").ToLower();
			List<string> list = text.Split(new char[1] { ',' }).ToList();
			List<string> list2 = new List<string>();
			foreach (string item in list)
			{
				string text2 = item;
				if (_list.Contains(text2))
				{
					if (!text2.Equals("trickany"))
					{
						text2 = ((!text2.Equals("switchstyle")) ? (text2 + "ButtonHeld") : "switchStyleButtonHeld");
					}
					else
					{
						text2 = "trick1ButtonHeld";
						list2.Add(text2);
						text2 = "trick2ButtonHeld";
						list2.Add(text2);
						text2 = "trick3ButtonHeld";
					}
					list2.Add(text2);
				}
			}
			return list2;
		}

		private static void BindSettings(ConfigFile Config)
		{
			config_reboundVelocityMultiplier = Config.Bind<float>("1. Variables", "Rebound Velocity Multiplier", 0.8f, "How much vertical speed is preserved when Rebounding.");
			config_maxLandingTimeToRebound = Config.Bind<float>("1. Variables", "Rebound Grace Period", 0.2f, "How much time you have after landing to do a Rebound.");
			config_minVelocityToRebound = Config.Bind<float>("1. Variables", "Minimum Falling Velocity to Rebound", 0f, "How fast you have to be falling to be able to do a Rebound. (For reference, 8 is the player's jump height)");
			config_minReboundYVelocity = Config.Bind<float>("1. Variables", "Minimum Rebound Velocity", 8f, "The minimum upward speed a Rebound can send you. (For reference, 8 is the player's jump height)");
			config_maxReboundYVelocity = Config.Bind<float>("1. Variables", "Maximum Rebound Velocity", 0f, "The maximum upward speed a Rebound can send you. If zero or below, there's no upper limit (except the maximum fall speed). Note that reaching this limit will slow down your forward speed as well as your upward speed.");
			config_launcherBonusMultiplier = Config.Bind<float>("1. Variables", "Launcher Bonus Multiplier", 0.5f, "How much extra momentum you get from Rebounding off a launcher. A Rebound off a launcher will never send you lower than the height a launcher sends you by default.");
			config_slopeMultiplierX = Config.Bind<float>("1. Variables", "Ground Angle Multiplier on Forward Speed", 1f, "How much the angle of the ground you Rebound off affects your forward speed. Speeds up on downward slopes, slows down on upward slopes. Note that you will automatically be flipped over if the slope sends you backwards.");
			config_slopeMultiplierY = Config.Bind<float>("1. Variables", "Ground Angle Multiplier on Upward Speed", 1f, "How much the angle of the ground you Rebound off affects your Rebound height. Higher on upward slopes, lower on downward slopes. Not restricted by minimum/maximum Rebound height.");
			config_capBasedOnHeight = Config.Bind<bool>("2. Options", "Cap Rebound Velocity Based on Height", true, "Limit your Rebound speed based on the peak of your jump, preventing you from going really high really fast by abusing Movement Plus fast falls. Shouldn't ever have an effect on vanilla gameplay, but when playing with Movement Plus, you may be sent lower than you might expect.");
			config_heightCapGenerosity = Config.Bind<float>("2. Options", "Height Cap Generosity", 1.5f, "How much extra speed is added to the height-based velocity cap. Note that this is not a multiplier, but an offset added to the height cap.");
			config_refreshCombo = Config.Bind<bool>("2. Options", "Refresh Combo Meter", true, "Toggle whether your combo meter is set to the value it was at before you landed before every Rebound. Keeps your combo losses consistent, regardless of when within the grace period you rebounded.");
			config_tempDisableBoostAfterRebound = Config.Bind<bool>("2. Options", "Temporarily Disable Boost on Rebound", true, "Toggle whether doing a Rebound stops you from boosting until the trick is done. Does not affect Boosted Rebounds.");
			config_burstReboundPower = Config.Bind<float>("2. Options", "Burst Rebound Power", 0.65f, "Hold back (relative to the player) and boost while Rebounding to do a Burst Rebound, converting your forward speed directly into height. Burst Rebound Power adjusts how much forward speed you lose; higher values preserve more forward speed, but reduce Burst Rebound height.");
			config_alwaysCalculateBasedOnHeight = Config.Bind<bool>("2. Options", "Always Calculate Rebound Velocity Based On Height", false, "Always set the Rebound velocity to the height-based velocity cap, regardless of the player's falling velocity. Note that this method tends to send you slightly higher, and also may be less accurate with mid-jump velocity changes (ex. wall plants or air boosts). However, this does prevent the fall speed limitations from capping your Rebound height. Highly recommended to leave on false.");
			config_slopeOnLauncher = Config.Bind<bool>("2. Options", "Apply Slope Physics When Rebounding Off Launcher", false, "If false, Rebounding off a launcher will act like you have rebounded off of flat ground. If true, Rebounding off a launcher will send you at an angle. Note that this can and will send you flying in directions you may not want - but it also could be used to your advantage to get insane height/speed.");
			config_preventComboExtend = Config.Bind<bool>("2. Options", "Prevent Combo Extension", true, "Prevents using the Rebound grace period to artificially extend combos by detecting if an action other than a Rebound is taken during the period and cancelling the combo accordingly. If using MovementPlus, this does not apply until the combo meter runs out while on the ground.");
			config_practiceMode = Config.Bind<bool>("2. Options", "Practice Mode", false, "(FLASHING COLORS WARNING) If true, your character will be colored pink when it is possible to Rebound.");
			config_enableTrail = Config.Bind<bool>("2. Options", "Enable Rebound Trail", true, "Toggle the extended boost trail effect when Rebounding.");
			config_trailLength = Config.Bind<float>("2. Options", "Trail Time", 3f, "Affects how long the Rebound trail lasts. Note that this time is adjusted depending on the height of the Rebound. The default value reflects the approximate time at the peak of a Rebound.");
			config_trailWidth = Config.Bind<float>("2. Options", "Trail Width", 0.25f, "Affects how big the Rebound trail starts off as.");
			config_doReboundActions = Config.Bind<string>("3. Input", "Rebound Modifier Actions", "", "A list of what additional player actions need to be pressed/held to do a Rebound, separated by commas. Note that jumping is always required. Acceptable values: slide, boost, spray, dance, trick1, trick2, trick3, trickAny, switchStyle, walk");
			config_requireAllDRA = Config.Bind<bool>("3. Input", "Require ALL Rebound Modifiers to Rebound", false, "If true, the player must press/hold ALL the Rebound modifier actions (as well as jump) to successfully Rebound. If false, the player can hold ANY of them (along with jump) to Rebound.");
			config_cancelReboundActions = Config.Bind<string>("3. Input", "Cancel Rebound Modifier Actions", "slide", "A list of what player actions can be pressed/held to prevent a Rebound and do a regular jump instead, separated by commas. Acceptable values: slide, boost, spray, dance, trick1, trick2, trick3, trickAny, switchStyle, walk");
			config_requireAllCRA = Config.Bind<bool>("3. Input", "Require ALL Cancel Rebound Modifiers to Cancel", false, "If true, the player must press/hold ALL the cancel modifier actions to cancel a Rebound. If false, the player can hold ANY of them to cancel a Rebound.");
			config_burstReboundSens = Config.Bind<float>("3. Input", "Burst Rebound Sensitivity", 0.6f, "How precice you have to hold the left stick backwards (relative to the player) to activate a Burst Rebound. Higher values are more precise.");
			config_burstReboundDead = Config.Bind<float>("3. Input", "Burst Rebound Deadzone", 0.8f, "How far back you have to hold the left stick to activate a Burst Rebound. 1.0 is completely backwards, while 0.0 is not holding the stick at all.");
			config_burstReboundDeadSquared = config_burstReboundDead.Value * config_burstReboundDead.Value;
			config_reboundVelocityMultiplier.SettingChanged += UpdateSettingsEvent;
			config_maxLandingTimeToRebound.SettingChanged += UpdateSettingsEvent;
			config_minVelocityToRebound.SettingChanged += UpdateSettingsEvent;
			config_minReboundYVelocity.SettingChanged += UpdateSettingsEvent;
			config_maxReboundYVelocity.SettingChanged += UpdateSettingsEvent;
			config_launcherBonusMultiplier.SettingChanged += UpdateSettingsEvent;
			config_slopeMultiplierX.SettingChanged += UpdateSettingsEvent;
			config_slopeMultiplierY.SettingChanged += UpdateSettingsEvent;
			config_capBasedOnHeight.SettingChanged += UpdateSettingsEvent;
			config_heightCapGenerosity.SettingChanged += UpdateSettingsEvent;
			config_refreshCombo.SettingChanged += UpdateSettingsEvent;
			config_tempDisableBoostAfterRebound.SettingChanged += UpdateSettingsEvent;
			config_alwaysCalculateBasedOnHeight.SettingChanged += UpdateSettingsEvent;
			config_slopeOnLauncher.SettingChanged += UpdateSettingsEvent;
			config_cancelReboundActions.SettingChanged += UpdateSettingsEvent;
			config_doReboundActions.SettingChanged += UpdateSettingsEvent;
			config_requireAllDRA.SettingChanged += UpdateSettingsEvent;
			config_requireAllCRA.SettingChanged += UpdateSettingsEvent;
			config_burstReboundDead.SettingChanged += UpdateSettingsEvent;
		}
	}
	public class RBCBHelper
	{
		public static List<Material> GetPlayerMaterials(Player p)
		{
			List<Material> list = new List<Material>();
			CharacterDefinition componentInChildren = ((Component)p.characterVisual).GetComponentInChildren<CharacterDefinition>(true);
			if ((Object)(object)componentInChildren == (Object)null)
			{
				return new List<Material> { ((Renderer)((Component)p.characterVisual).GetComponentInChildren<SkinnedMeshRenderer>()).material };
			}
			SkinnedMeshRenderer[] renderers = componentInChildren.Renderers;
			foreach (SkinnedMeshRenderer val in renderers)
			{
				Material[] materials = ((Renderer)val).materials;
				foreach (Material item in materials)
				{
					list.Add(item);
				}
			}
			return list;
		}
	}
	[HarmonyPatch(typeof(AirTrickAbility))]
	internal class AirTrickPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("SetupBoostTrick")]
		private static bool SetupBoostTrick_Prefix(AirTrickAbility __instance)
		{
			if (ReboundPlugin.rebounding && RBTrix.boostedReboundsRespectTrickButtons.Value)
			{
				int num = RBTrix.GetPlayerTrickNumber(ReboundPlugin.player);
				if (num < 0)
				{
					num = 0;
				}
				__instance.curTrick = num;
			}
			ReboundPlugin.Log.LogInfo((object)__instance.curTrick);
			ReboundPlugin.Log.LogInfo((object)(ReboundPlugin.rebounding.ToString() + true + RBTrix.boostedReboundsRespectTrickButtons.Value));
			return true;
		}
	}
	[HarmonyPatch(typeof(Player))]
	internal class PlayerPatches
	{
		public static bool wasRequestingJump;

		public static float wasRequestingJumpTime;

		[HarmonyPrefix]
		[HarmonyPatch("HandleJump")]
		public static bool HandleJumpPrefix_TriggerRebound(Player __instance)
		{
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			__instance.jumpedThisFrame = false;
			__instance.timeSinceJumpRequested += Core.dt;
			if (__instance.jumpRequested && __instance.IsGrounded() && (!__instance.jumpConsumed || __instance.ability == __instance.slideAbility || __instance.ability == __instance.boostAbility))
			{
				if (ReboundPlugin.PlayerAttemptingRebound())
				{
					ReboundPlugin.ReboundTrick();
				}
				else if (__instance.JumpIsAllowed())
				{
					if (ReboundPlugin.CanRebound())
					{
						ReboundPlugin.CancelRebound();
					}
					__instance.Jump();
					ReboundPlugin.landTime = float.PositiveInfinity;
				}
				ReboundPlugin.distanceFallenFromPeakOfJump = 0f;
			}
			return false;
		}

		[HarmonyPrefix]
		[HarmonyPatch("FixedUpdateAbilities")]
		public static bool Postfix_FuckOverQuickTurn(Player __instance)
		{
			if (!ReboundPlugin.hasQuickTurn)
			{
				return true;
			}
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			if (!RBQTHelper.AbilityIsQuickTurn(__instance))
			{
				return true;
			}
			if (__instance.jumpButtonNew && __instance.IsGrounded() && ReboundPlugin.PlayerAttemptingRebound())
			{
				__instance.jumpButtonNew = false;
				ReboundPlugin.ReboundTrick();
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch("OnLanded")]
		public static bool OnLandedPrefix_ReboundDistance(Player __instance)
		{
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			ReboundPlugin.rebounding = false;
			ReboundPlugin.landTime = 0f;
			ReboundPlugin.distanceFallenFromPeakOfJump += __instance.reallyMovedVelocity.y;
			if (__instance.comboTimeOutTimer <= 0f)
			{
				ReboundPlugin.CancelRebound();
			}
			wasRequestingJump = __instance.jumpRequested;
			wasRequestingJumpTime = __instance.timeSinceJumpRequested;
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch("OnLanded")]
		public static void OnLandedPostfix_ReboundSlide(Player __instance)
		{
			if (!((Object)(object)__instance != (Object)(object)ReboundPlugin.player) && !__instance.isDisabled && !__instance.isAI && __instance.slideButtonHeld && !((Ability)__instance.slideAbility).locked && !__instance.jumpRequested && ((wasRequestingJump && wasRequestingJumpTime <= __instance.JumpPreGroundingGraceTime) || __instance.jumpButtonNew) && ReboundPlugin.PlayerAttemptingRebound())
			{
				__instance.jumpRequested = true;
				__instance.timeSinceJumpRequested = wasRequestingJumpTime;
				ReboundPlugin.ReboundTrick();
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("DoTrick")]
		public static bool DoTrickPrefix_FailIfNotRebound(TrickType type, string trickName, int trickNum, Player __instance)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Invalid comparison between Unknown and I4
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			if (ReboundPlugin.CanRebound() && !ReboundPlugin.rebounding && ReboundPlugin.landTime > Core.dt * 3f && ((int)__instance.currentTrickType != 12 || (int)type != 12))
			{
				ReboundPlugin.CancelRebound();
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch("LandCombo")]
		public static bool LandComboPrefix_ExtendForRebound(Player __instance)
		{
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			return !ReboundPlugin.CanRebound();
		}

		[HarmonyPrefix]
		[HarmonyPatch("ActivateAbility")]
		public static bool AbilityPrefix_CancelRebound(Ability a, Player __instance)
		{
			if ((Object)(object)__instance != (Object)(object)ReboundPlugin.player || __instance.isDisabled || __instance.isAI)
			{
				return true;
			}
			if (!ReboundPlugin.settingUpRebound)
			{
				ReboundPlugin.rebounding = false;
			}
			if ((__instance.ability == null || __instance.ability == __instance.slideAbility) && a != __instance.boostAbility && ReboundPlugin.CanRebound() && ReboundPlugin.landTime > Core.dt * 3f)
			{
				ReboundPlugin.CancelRebound();
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch("UpdateTrails")]
		public static bool UpdateReboundTrail(Player __instance)
		{
			if (__instance.characterVisual.VFX.boostpackEffect.activeSelf)
			{
				if (!__instance.preBoostpackActive)
				{
					TrailRenderer boostpackTrail = __instance.boostpackTrail;
					float time = (__instance.boostpackTrail.startWidth = 0f);
					boostpackTrail.time = time;
				}
				__instance.preBoostpackActive = true;
				__instance.characterVisual.VFX.boostpackTrail.SetActive(true);
				__instance.boostTrailTimer += Core.dt * 1.2f;
				if (__instance.boostTrailTimer > __instance.boostpackTrailDefaultTime && !ReboundPlugin.rebounding)
				{
					__instance.boostTrailTimer = __instance.boostpackTrailDefaultTime;
				}
				__instance.trailWidth += Core.dt;
				if (__instance.trailWidth > __instance.boostpackTrailDefaultWidth && !ReboundPlugin.rebounding)
				{
					__instance.trailWidth = __instance.boostpackTrailDefaultWidth;
				}
			}
			else
			{
				__instance.preBoostpackActive = false;
				__instance.boostTrailTimer -= Core.dt * 6f;
				if (__instance.boostTrailTimer < 0f)
				{
					__instance.boostTrailTimer = 0f;
					__instance.characterVisual.VFX.boostpackTrail.SetActive(false);
					ReboundPlugin.rebounding = false;
				}
				__instance.trailWidth -= Core.dt;
				if (__instance.trailWidth < 0f)
				{
					__instance.trailWidth = 0f;
				}
			}
			__instance.boostpackTrail.time = __instance.boostTrailTimer;
			__instance.boostpackTrail.startWidth = __instance.trailWidth;
			return false;
		}

		[HarmonyPrefix]
		[HarmonyPatch("PlayAnim")]
		public static bool PlayAnimPrefix(int newAnim, bool forceOverwrite, bool instant, float atTime, Player __instance)
		{
			if (!((Component)__instance).gameObject.activeSelf || (newAnim == __instance.curAnim && !forceOverwrite) || !ReboundPlugin.rebounding || RBTrix.forceAnimationBlending.Value <= 0f)
			{
				return true;
			}
			if (!instant && atTime == -1f && ReboundPlugin.rebounding && !__instance.animInfos.ContainsKey(__instance.curAnim) && RBTrix.GetAllReboundAnimations().Contains(__instance.curAnim) && (newAnim == __instance.fallHash || newAnim == Animator.StringToHash("fallIdle")))
			{
				__instance.anim.CrossFade(newAnim, RBTrix.forceAnimationBlending.Value);
				__instance.curAnimActiveTime = 0f;
				__instance.firstFrameAnim = true;
				__instance.characterVisual.feetIK = __instance.animInfos.ContainsKey(newAnim) && __instance.animInfos[newAnim].feetIK;
				__instance.curAnim = newAnim;
				return false;
			}
			return true;
		}
	}
	[BepInPlugin("goatgirl.Rebound", "Rebound", "3.0.3")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ReboundPlugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		internal static Harmony Harmony = new Harmony("goatgirl.Rebound");

		public static bool MPlusActive = false;

		public static bool hasCBMono = false;

		public static bool hasQuickTurn = false;

		public static float landTime = float.PositiveInfinity;

		public static Vector2 landingVelocity = new Vector2(0f, 0f);

		public static float distanceFallenFromPeakOfJump = 0f;

		public static float landingComboMeter = 1f;

		public static float reboundVelocityMultiplier = 0.8f;

		public static float launcherBonusMultiplier = 0.5f;

		public static float maxLandingTimeToRebound = 0.15f;

		public static float minVelocityToRebound = 0f;

		public static float minReboundYVelocity = 8f;

		public static float maxReboundYVelocity = 0f;

		public static bool capBasedOnHeight = true;

		public static float heightCapGenerosity = 1.5f;

		public static bool alwaysCalculateBasedOnHeight = false;

		public static bool refreshCombo = true;

		public static bool tempDisableBoostAfterRebound = true;

		public const float comboCost = 0.215f;

		public const float boostCost = 0f;

		public const bool allowBoostedRebounds = true;

		public static bool canCancelCombo = true;

		public static List<string> cancelReboundActions = new List<string>();

		public static List<string> doReboundActions = new List<string>();

		public static bool rebounding = false;

		public static bool settingUpRebound = false;

		public static bool hasUnlitCharacter = false;

		public static Player player
		{
			get
			{
				WorldHandler instance = WorldHandler.instance;
				return (instance != null) ? instance.GetCurrentPlayer() : null;
			}
		}

		public static float reboundTrailTime => RBSettings.config_trailLength.Value + 0.000125f;

		public static float reboundTrailWidth => RBSettings.config_trailWidth.Value + 0.000125f;

		public static Shader unlitShader => Shader.Find("Unlit/Normal");

		public static bool attemptingBoostedRebound => player.CheckBoostTrick();

		public static bool attemptingBurstRebound => attemptingBoostedRebound && Vector3.Dot(player.dir, player.moveInput) <= 0f - RBSettings.config_burstReboundSens.Value && ((Vector2)(ref player.moveInputPlain)).sqrMagnitude >= RBSettings.config_burstReboundDeadSquared;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Rebound is loaded!");
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				if (pluginInfo.Value.Metadata.GUID.Equals("com.yuril.MovementPlus"))
				{
					MPlusActive = true;
					Log.LogInfo((object)"Rebound: MovementPlus found!");
				}
				else if (pluginInfo.Value.Metadata.GUID.Equals("com.yuril.QuickTurn"))
				{
					hasQuickTurn = true;
					Log.LogInfo((object)"Rebound: QuickTurn found!");
				}
				else if (pluginInfo.Value.Metadata.GUID.Equals("CrewBoom"))
				{
					hasCBMono = true;
					Log.LogInfo((object)"Rebound: CrewBoomMono found!");
				}
			}
			RBSettings.UpdateSettings(((BaseUnityPlugin)this).Config);
		}

		private void FixedUpdate()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			if (!InGame())
			{
				return;
			}
			if (landTime < maxLandingTimeToRebound)
			{
				landTime += Core.dt;
			}
			if (!player.IsGrounded())
			{
				landingVelocity = new Vector2(player.GetForwardSpeed(), player.GetVelocity().y);
				landingComboMeter = player.comboTimeOutTimer;
				if (player.GetVelocity().y < 0f)
				{
					distanceFallenFromPeakOfJump += Mathf.Abs(player.GetVelocity().y);
					landTime = 0f;
				}
				else
				{
					distanceFallenFromPeakOfJump = 0f;
				}
			}
			else if (player.ability == player.boostAbility && landTime >= maxLandingTimeToRebound && !MPlusActive)
			{
				player.LandCombo();
			}
			if (rebounding && player.boostTrailTimer <= 0f)
			{
				rebounding = false;
			}
			else if (rebounding && RBSettings.config_enableTrail.Value)
			{
				Player obj = player;
				obj.boostTrailTimer += Mathf.Min(Core.dt, player.GetVelocity().y / 500f) * 6f;
				Player obj2 = player;
				obj2.trailWidth += Mathf.Min(Core.dt, player.GetVelocity().y / 500f);
			}
			if (!RBSettings.config_practiceMode.Value)
			{
				return;
			}
			if (CanReboundDetailed() && !hasUnlitCharacter)
			{
				hasUnlitCharacter = true;
				List<Material> list = (hasCBMono ? RBCBHelper.GetPlayerMaterials(player) : new List<Material> { ((Renderer)((Component)player.characterVisual).GetComponentInChildren<SkinnedMeshRenderer>()).material });
				{
					foreach (Material item in list)
					{
						item.shader = unlitShader;
						if (item.HasColor("Main Color"))
						{
							item.SetColor("Main Color", new Color(255f, 246f, 143f, 255f));
						}
					}
					return;
				}
			}
			if (!CanReboundDetailed() && hasUnlitCharacter)
			{
				hasUnlitCharacter = false;
				player.SetOutfit(Core.Instance.SaveManager.CurrentSaveSlot.GetCharacterProgress(player.character).outfit);
			}
		}

		public static bool CanRebound()
		{
			return landTime < maxLandingTimeToRebound && player.IsGrounded();
		}

		public static bool CanReboundDetailed()
		{
			return CanRebound() && (!player.jumpConsumed || player.ability == player.slideAbility || player.ability == player.boostAbility);
		}

		public static bool PlayerAttemptingRebound()
		{
			bool flag = !doReboundActions.Any() || ActionsPressed(doReboundActions, RBSettings.config_requireAllDRA.Value);
			bool flag2 = cancelReboundActions.Any() && ActionsPressed(cancelReboundActions, RBSettings.config_requireAllCRA.Value);
			return landingVelocity.y < 0f - minVelocityToRebound && landTime < maxLandingTimeToRebound && !flag2 && flag;
		}

		public static void ReboundTrick()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0471: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			bool flag = attemptingBoostedRebound;
			bool flag2 = attemptingBurstRebound || (attemptingBoostedRebound && DoingQuickTurn());
			if (RBSettings.config_burstReboundPower.Value <= 0.001f)
			{
				flag2 = false;
			}
			Vector3 val = Vector3.ProjectOnPlane(player.motor.groundNormalVisual, Vector3.up);
			float num = Vector3.Dot(((Vector3)(ref val)).normalized, player.dir);
			player.animInfosSets[player.moveStyle][Animator.StringToHash("jumpTrick1")].fadeTo[player.fallHash] = 1f;
			player.animInfosSets[player.moveStyle][Animator.StringToHash("jumpTrick1")].fadeTo[Animator.StringToHash("fallIdle")] = 1f;
			PrepForRebound(flag);
			if (refreshCombo)
			{
				player.comboTimeOutTimer = landingComboMeter;
			}
			rebounding = true;
			settingUpRebound = true;
			Vector2 val2 = landingVelocity;
			val2.y = (0f - val2.y) * reboundVelocityMultiplier;
			if (flag)
			{
				player.DoTrick((TrickType)6, flag2 ? "Burst Rebound" : "Boosted Rebound", 0);
				player.ActivateAbility((Ability)(object)player.airTrickAbility);
				val2.x = Mathf.Max(val2.x, player.GetForwardSpeed());
			}
			else
			{
				if (tempDisableBoostAfterRebound)
				{
					player.ActivateAbility((Ability)(object)player.airTrickAbility);
					AirTrickAbility airTrickAbility = player.airTrickAbility;
					airTrickAbility.duration /= 3f;
				}
				player.DoTrick((TrickType)6, RBTrix.GetReboundTrickName(), 0);
				player.PlayAnim(RBTrix.StringToHash(RBTrix.GetReboundAnimation()), true, true, -1f);
			}
			float num2 = distanceFallenFromPeakOfJump * reboundVelocityMultiplier;
			float num3 = Mathf.Sqrt(2f * num2 * player.motor.gravity);
			float num4 = num3 / 9f + heightCapGenerosity;
			if (alwaysCalculateBasedOnHeight)
			{
				val2.y = num4 - heightCapGenerosity;
			}
			else if (capBasedOnHeight)
			{
				val2.y = Mathf.Min(val2.y, num4);
			}
			if (Object.op_Implicit((Object)(object)player.onLauncher))
			{
				if (!RBSettings.config_slopeOnLauncher.Value)
				{
					num = 0f;
				}
				float num5 = (((Object)((Component)player.onLauncher.parent).gameObject).name.Contains("Super") ? (player.jumpSpeedLauncher * 1.4f) : player.jumpSpeedLauncher);
				val2.y = Mathf.Max(val2.y + num5 * launcherBonusMultiplier, num5);
			}
			val2.y = Mathf.Max(val2.y, minReboundYVelocity);
			if (val2.y > maxReboundYVelocity && maxReboundYVelocity != 0f)
			{
				val2.x = maxReboundYVelocity * (val2.x / val2.y);
				val2.y = maxReboundYVelocity;
			}
			if (flag)
			{
				val2 *= 1.1f;
				if (flag2)
				{
					Vector2 val3 = val2;
					val2.y *= (1f - RBSettings.config_burstReboundPower.Value) * 1.65f;
					val2.x = Mathf.Pow(val2.x, RBSettings.config_burstReboundPower.Value);
					val2.y += (val3.x - val2.x) * 0.65f;
					player.audioManager.PlaySfxGameplay((SfxCollectionID)20, (AudioClipID)114, player.playerOneShotAudioSource, 0f);
				}
			}
			Vector2 val4 = default(Vector2);
			((Vector2)(ref val4))..ctor(Mathf.Sin(num) * RBSettings.config_slopeMultiplierX.Value, Mathf.Cos(num) * RBSettings.config_slopeMultiplierY.Value);
			if (val4.x < 0f)
			{
				val4.y += 1f;
			}
			player.motor.SetVelocityYOneTime(val2.y * val4.y);
			float num6 = val2.x + val2.y * val4.x;
			player.SetForwardSpeed(num6);
			if (num6 < 0f)
			{
				player.SetRotation(-player.dir);
			}
			bool flag3 = true;
			if (player.comboTimeOutTimer - 0.215f > 1f)
			{
				player.ResetComboTimeOut();
			}
			else
			{
				player.DoComboTimeOut(0.215f);
				player.comboTimeOutTimer = Mathf.Clamp(player.comboTimeOutTimer, 0f, 1f);
			}
			if (player.comboTimeOutTimer == 0f)
			{
				player.LandCombo();
			}
			if (RBSettings.config_enableTrail.Value)
			{
				player.boostTrailTimer = reboundTrailTime;
				player.trailWidth = reboundTrailWidth;
			}
			rebounding = true;
			settingUpRebound = false;
		}

		public static void PrepForRebound(bool isBoosting)
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			if (!isBoosting)
			{
				player.StopCurrentAbility();
			}
			player.jumpedThisFrame = true;
			player.isJumping = true;
			player.maintainSpeedJump = true;
			player.jumpConsumed = true;
			player.jumpRequested = false;
			player.jumpedThisFrame = true;
			player.timeSinceLastJump = 0f;
			player.ForceUnground(true);
			player.radialHitbox.SetActive(true);
			player.AudioManager.PlaySfxGameplay((SfxCollectionID)20, (AudioClipID)130, player.playerOneShotAudioSource, 0f);
			player.PlayVoice((AudioClipID)489, (VoicePriority)0, true);
			if (!isBoosting)
			{
				player.PlayAnim(RBTrix.StringToHash(RBTrix.GetReboundAnimation()), true, false, -1f);
			}
			else
			{
				player.PlayAnim(Animator.StringToHash("jump"), true, false, -1f);
			}
			player.DoHighJumpEffects(player.motor.groundNormalVisual * -1f);
		}

		public static void CancelRebound()
		{
			if (ComboCanBeCancelled() && RBSettings.config_preventComboExtend.Value && !rebounding)
			{
				landTime = maxLandingTimeToRebound + 1f;
				player.LandCombo();
			}
		}

		public static bool ComboCanBeCancelled()
		{
			if (!canCancelCombo)
			{
				return false;
			}
			return (!MPlusActive || player.comboTimeOutTimer <= 0f) && player.ability != player.slideAbility && !((Ability)player.slideAbility).locked && player.ability != player.ledgeClimbAbility && player.switchMoveStyleAbility != player.ability;
		}

		private void OnDestroy()
		{
			Harmony.UnpatchSelf();
		}

		public static bool ActionsPressed(List<string> actions, bool checkIfAllPressed)
		{
			if (actions == null || !actions.Any())
			{
				return false;
			}
			bool result = checkIfAllPressed;
			foreach (string action in actions)
			{
				if (TranslateActionString(action) == !checkIfAllPressed)
				{
					result = !checkIfAllPressed;
				}
			}
			return result;
		}

		public static bool TranslateActionString(string action)
		{
			return action switch
			{
				"jumpRequested" => player.jumpRequested, 
				"trick1ButtonHeld" => player.trick1ButtonHeld || player.trick1ButtonNew, 
				"trick2ButtonHeld" => player.trick2ButtonHeld || player.trick2ButtonNew, 
				"trick3ButtonHeld" => player.trick3ButtonHeld || player.trick3ButtonNew, 
				"slideButtonHeld" => player.slideButtonHeld || player.slideButtonNew || player.ability == player.slideAbility, 
				"boostButtonHeld" => player.boostButtonHeld || player.boostButtonNew, 
				"sprayButtonHeld" => player.sprayButtonHeld || player.sprayButtonNew, 
				"danceButtonHeld" => player.danceButtonHeld || player.danceButtonNew, 
				"switchStyleButtonHeld" => player.switchStyleButtonHeld || player.switchStyleButtonNew, 
				"walkButtonHeld" => player.walkButtonHeld || player.walkButtonNew, 
				_ => false, 
			};
		}

		public static bool InGame()
		{
			return (Object)(object)player != (Object)null && !player.isDisabled && !Core.Instance.BaseModule.IsInGamePaused;
		}

		public static bool DoingQuickTurn()
		{
			if (!hasQuickTurn)
			{
				return false;
			}
			return RBQTHelper.AbilityIsQuickTurn(player);
		}
	}
	public class RBQTHelper
	{
		public static float QuickTurnSavedSpeed()
		{
			return NewQuickTurnAbility.savedSpeed;
		}

		public static bool AbilityIsQuickTurn(Player p)
		{
			return p.ability is NewQuickTurnAbility;
		}
	}
	[BepInPlugin("goatgirl.Rebound.NewTrix", "Rebound.NewTrix", "1.0.0")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ReboundTrixPlugin : BaseUnityPlugin
	{
		private void Awake()
		{
			RBTrix.UpdateSettings(((BaseUnityPlugin)this).Config);
			bool flag = false;
			bool flag2 = false;
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				if (pluginInfo.Value.Metadata.GUID.Equals("ConfigTrixAirTricks"))
				{
					flag = true;
				}
				else if (pluginInfo.Value.Metadata.GUID.Equals("com.Dragsun.BunchOfEmotes"))
				{
					flag2 = true;
				}
			}
			RBTrix.TrixBOEActive = flag && flag2;
			if (RBTrix.TrixBOEActive)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"NewTrix + BOE active!");
			}
		}
	}
	internal class RBTrix
	{
		public static ConfigEntry<bool> boostedReboundsRespectTrickButtons;

		public static ConfigEntry<float> forceAnimationBlending;

		public static ConfigEntry<bool> directionalTricks;

		public static ConfigEntry<float> directionalTrickDeadzone;

		public static ConfigEntry<string> inputsForNewTrix;

		public static List<string> newTrixActions;

		public static ConfigEntry<string> reboundTrickAnimFootDefault;

		public static ConfigEntry<string> reboundTrickNameFootDefault;

		public static ConfigEntry<string> reboundTrickAnimFoot0;

		public static ConfigEntry<string> reboundTrickNameFoot0;

		public static ConfigEntry<string> reboundTrickAnimFoot1;

		public static ConfigEntry<string> reboundTrickNameFoot1;

		public static ConfigEntry<string> reboundTrickAnimFoot2;

		public static ConfigEntry<string> reboundTrickNameFoot2;

		public static ConfigEntry<string> reboundTrickAnimBMXDefault;

		public static ConfigEntry<string> reboundTrickNameBMXDefault;

		public static ConfigEntry<string> reboundTrickAnimBMX0;

		public static ConfigEntry<string> reboundTrickNameBMX0;

		public static ConfigEntry<string> reboundTrickAnimBMX1;

		public static ConfigEntry<string> reboundTrickNameBMX1;

		public static ConfigEntry<string> reboundTrickAnimBMX2;

		public static ConfigEntry<string> reboundTrickNameBMX2;

		public static ConfigEntry<string> reboundTrickAnimInlineDefault;

		public static ConfigEntry<string> reboundTrickNameInlineDefault;

		public static ConfigEntry<string> reboundTrickAnimInline0;

		public static ConfigEntry<string> reboundTrickNameInline0;

		public static ConfigEntry<string> reboundTrickAnimInline1;

		public static ConfigEntry<string> reboundTrickNameInline1;

		public static ConfigEntry<string> reboundTrickAnimInline2;

		public static ConfigEntry<string> reboundTrickNameInline2;

		public static ConfigEntry<string> reboundTrickAnimBoardDefault;

		public static ConfigEntry<string> reboundTrickNameBoardDefault;

		public static ConfigEntry<string> reboundTrickAnimBoard0;

		public static ConfigEntry<string> reboundTrickNameBoard0;

		public static ConfigEntry<string> reboundTrickAnimBoard1;

		public static ConfigEntry<string> reboundTrickNameBoard1;

		public static ConfigEntry<string> reboundTrickAnimBoard2;

		public static ConfigEntry<string> reboundTrickNameBoard2;

		public static bool TrixBOEActive;

		public static void UpdateSettings(ConfigFile Config)
		{
			BindSettings(Config);
		}

		public static void UpdateSettingsEvent(object sender, EventArgs args)
		{
			newTrixActions = RBSettings.ConvertString(inputsForNewTrix.Value, RBSettings.PlayerActionTypes);
		}

		private static void BindSettings(ConfigFile Config)
		{
			boostedReboundsRespectTrickButtons = Config.Bind<bool>("1. Options", "Multiple Tricks for Boosted Rebounds", true, "If enabled, holding a trick button while doing a Boosted Rebound will perform the boost trick associated with that button.");
			forceAnimationBlending = Config.Bind<float>("1. Options", "Force Smooth Animation Blending", 0f, "The speed at which the Rebound animation blends into the fall animation (bigger is slower). If set to 0 or below, many custom Rebound animations will not smoothly transition into the fall animation.");
			directionalTricks = Config.Bind<bool>("1. Options", "Directional Tricks", false, "If enabled, holding a specific direction with the left stick can activate custom Rebound animations the same way trick buttons do. Left maps to Trick 0, Up maps to Trick 1, and Right maps to Trick 2. Holding down or no direction maps to the default.");
			directionalTrickDeadzone = Config.Bind<float>("1. Options", "Directional Tricks Deadzone", 0.8f, "How far you have to hold the stick a certain direction to activate a directional trick. The higher the number, the farther you must push the left stick. No effect if Directional Tricks are disabled.");
			inputsForNewTrix = Config.Bind<string>("1. Options", "Required Inputs for Custom Animations", "", "A list of ALL the additional player actions that need to be held to activate a custom Rebound animation (in addition to trick buttons, or directions if Directional Tricks is enabled), separated by commas. Can be blank to only require buttons/directions. Without pressing these buttons, the default animation will play. Note that jumping is always required. Acceptable values: slide, boost, spray, dance, trick1, trick2, trick3, trickAny, switchStyle, walk");
			inputsForNewTrix.SettingChanged += UpdateSettingsEvent;
			newTrixActions = RBSettings.ConvertString(inputsForNewTrix.Value, RBSettings.PlayerActionTypes);
			reboundTrickAnimFootDefault = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick (Default)", "jumpTrick1", "Default Rebound trick, holding no trick button");
			reboundTrickNameFootDefault = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick (Default) Name", "Rebound Corkscrew", "Default Rebound trick name, holding no trick button");
			reboundTrickAnimFoot0 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 0", "jumpTrick1", "Button 1 Rebound trick");
			reboundTrickNameFoot0 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 0 Name", "Rebound Corkscrew", "Button 1 Rebound trick name");
			reboundTrickAnimFoot1 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 1", "jumpTrick1", "Button 2 Rebound trick");
			reboundTrickNameFoot1 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 1 Name", "Rebound Corkscrew", "Button 2 Rebound trick name");
			reboundTrickAnimFoot2 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 2", "jumpTrick1", "Button 3 Rebound trick");
			reboundTrickNameFoot2 = Config.Bind<string>("2. On-Foot Rebound Tricks", "On-Foot Trick 2 Name", "Rebound Corkscrew", "Button 3 Rebound trick name");
			reboundTrickAnimBoardDefault = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick (Default)", "jumpTrick1", "Default Rebound trick, holding no trick button");
			reboundTrickNameBoardDefault = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick (Default) Name", "Rebound McTwist", "Default Rebound trick name, holding no trick button");
			reboundTrickAnimBoard0 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 0", "jumpTrick1", "Button 1 Rebound trick");
			reboundTrickNameBoard0 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 0 Name", "Rebound McTwist", "Button 1 Rebound trick name");
			reboundTrickAnimBoard1 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 1", "jumpTrick1", "Button 2 Rebound trick");
			reboundTrickNameBoard1 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 1 Name", "Rebound McTwist", "Button 2 Rebound trick name");
			reboundTrickAnimBoard2 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 2", "jumpTrick1", "Button 3 Rebound trick");
			reboundTrickNameBoard2 = Config.Bind<string>("3. Skateboard Rebound Tricks", "Skateboard Trick 2 Name", "Rebound McTwist", "Button 3 Rebound trick name");
			reboundTrickAnimInlineDefault = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick (Default)", "jumpTrick1", "Default Rebound trick, holding no trick button");
			reboundTrickNameInlineDefault = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick (Default) Name", "Rebound Corkscrew", "Default Rebound trick name, holding no trick button");
			reboundTrickAnimInline0 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 0", "jumpTrick1", "Button 1 Rebound trick");
			reboundTrickNameInline0 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 0 Name", "Rebound Corkscrew", "Button 1 Rebound trick name");
			reboundTrickAnimInline1 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 1", "jumpTrick1", "Button 2 Rebound trick");
			reboundTrickNameInline1 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 1 Name", "Rebound Corkscrew", "Button 2 Rebound trick name");
			reboundTrickAnimInline2 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 2", "jumpTrick1", "Button 3 Rebound trick");
			reboundTrickNameInline2 = Config.Bind<string>("4. Inline Rebound Tricks", "Inline Trick 2 Name", "Rebound Corkscrew", "Button 3 Rebound trick name");
			reboundTrickAnimBMXDefault = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick (Default)", "jumpTrick1", "Default Rebound trick, holding no trick button");
			reboundTrickNameBMXDefault = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick (Default) Name", "Rebound 360 Backflip", "Default Rebound trick name, holding no trick button");
			reboundTrickAnimBMX0 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 0", "jumpTrick1", "Button 1 Rebound trick");
			reboundTrickNameBMX0 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 0 Name", "Rebound 360 Backflip", "Button 1 Rebound trick name");
			reboundTrickAnimBMX1 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 1", "jumpTrick1", "Button 2 Rebound trick");
			reboundTrickNameBMX1 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 1 Name", "Rebound 360 Backflip", "Button 2 Rebound trick name");
			reboundTrickAnimBMX2 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 2", "jumpTrick1", "Button 3 Rebound trick");
			reboundTrickNameBMX2 = Config.Bind<string>("5. BMX Rebound Tricks", "BMX Trick 2 Name", "Rebound 360 Backflip", "Button 3 Rebound trick name");
		}

		public static string GetReboundAnimation(MoveStyle moveStyle, int trickButton = -1)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			string text = ((trickButton == -1) ? "Default" : trickButton.ToString());
			string text2 = (((int)moveStyle == 1) ? "BMX" : (((int)moveStyle == 2 || (int)moveStyle == 4) ? "Board" : (((int)moveStyle == 3) ? "Inline" : "Foot")));
			try
			{
				string name = "reboundTrickAnim" + text2 + text;
				ConfigEntry<string> val = (ConfigEntry<string>)typeof(RBTrix).GetField(name).GetValue(null);
				return val.Value;
			}
			catch (Exception ex)
			{
				ReboundPlugin.Log.LogError((object)("GetReboundAnimation exception: " + ex.Message));
				return "jumpTrick1";
			}
		}

		public static string GetReboundTrickName(MoveStyle moveStyle, int trickButton = -1)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Invalid comparison between Unknown and I4
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Invalid comparison between Unknown and I4
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Invalid comparison between Unknown and I4
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			string text = ((trickButton == -1) ? "Default" : trickButton.ToString());
			string text2 = (((int)moveStyle == 1) ? "BMX" : (((int)moveStyle == 2 || (int)moveStyle == 4) ? "Board" : (((int)moveStyle == 3) ? "Inline" : "Foot")));
			try
			{
				string name = "reboundTrickName" + text2 + text;
				ConfigEntry<string> val = (ConfigEntry<string>)typeof(RBTrix).GetField(name).GetValue(null);
				return val.Value;
			}
			catch (Exception ex)
			{
				ReboundPlugin.Log.LogError((object)("GetReboundTrickName exception: " + ex.Message));
				return ((int)moveStyle == 1) ? "Rebound 360 Backflip" : (((int)moveStyle == 2 || (int)moveStyle == 4) ? "Rebound McTwist" : (((int)moveStyle == 3) ? "Rebound Corkscrew" : "Rebound Corkscrew"));
			}
		}

		public static string GetReboundAnimation()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			Player player = ReboundPlugin.player;
			return GetReboundAnimation(player.moveStyle, GetPlayerTrickNumber(player));
		}

		public static List<int> GetAllReboundAnimations()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Player player = ReboundPlugin.player;
			return new List<int>
			{
				StringToHash(GetReboundAnimation(player.moveStyle)),
				StringToHash(GetReboundAnimation(player.moveStyle, 0)),
				StringToHash(GetReboundAnimation(player.moveStyle, 1)),
				StringToHash(GetReboundAnimation(player.moveStyle, 2))
			};
		}

		public static string GetReboundTrickName()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			Player player = ReboundPlugin.player;
			return GetReboundTrickName(player.moveStyle, GetPlayerTrickNumber(player));
		}

		public static int GetPlayerTrickNumber(Player p)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			List<string> list = newTrixActions;
			if (list != null && list.Any() && !ReboundPlugin.ActionsPressed(newTrixActions, checkIfAllPressed: true))
			{
				return -1;
			}
			if (directionalTricks.Value)
			{
				Vector2 moveInputPlain = p.moveInputPlain;
				if (((Vector2)(ref moveInputPlain)).sqrMagnitude >= directionalTrickDeadzone.Value * directionalTrickDeadzone.Value)
				{
					float num = Vector2.Dot(moveInputPlain, Vector2.up);
					float num2 = 0f - num;
					float num3 = ((moveInputPlain.x < 0f) ? Vector2.Dot(moveInputPlain, Vector2.left) : Vector2.Dot(moveInputPlain, Vector2.right));
					float num4 = Mathf.Max(new float[3] { num, num2, num3 });
					if (num4 == num3)
					{
						return (!(moveInputPlain.x < 0f)) ? 2 : 0;
					}
					if (num4 == num)
					{
						return 1;
					}
					return -1;
				}
			}
			if (p.trick1ButtonNew || p.trick1ButtonHeld)
			{
				return 0;
			}
			if (p.trick2ButtonNew || p.trick2ButtonHeld)
			{
				return 1;
			}
			if (p.trick3ButtonNew || p.trick3ButtonHeld)
			{
				return 2;
			}
			return -1;
		}

		public static int StringToHash(string name)
		{
			if (TrixBOEActive)
			{
				return RBTrixHelper.StringToHash(name);
			}
			return Animator.StringToHash(name);
		}
	}
	public class RBTrixHelper
	{
		public static int StringToHash(string animationName)
		{
			return AnimationUtility.GetAnimationByName(animationName);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Rebound";

		public const string PLUGIN_NAME = "Rebound";

		public const string PLUGIN_VERSION = "3.0.3";
	}
}