Decompiled source of SlidingCompany v1.1.1

SlidingCompany.dll

Decompiled 9 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using CSync.Extensions;
using CSync.Lib;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("com.sigurd.csync")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("DunGen")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")]
[assembly: IgnoresAccessChecksTo("Unity.XR.Management")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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;
		}
	}
}
[BepInPlugin("CoddingCat.SlidingCompany", "Sliding Company", "1.1.1")]
[BepInDependency("com.sigurd.csync", "5.0.1")]
public class SlidingCompanyPlugin : BaseUnityPlugin
{
	public static ConfigEntry<Key> DefaultSlideKey;

	public static ConfigEntry<Key> AdditionalSlideKeyBind;

	public static ConfigEntry<Key> BrakeKey;

	public static ConfigEntry<Key> TestSlopesKey;

	public static ConfigEntry<bool> AdditionalSlideKey;

	public static ConfigEntry<string> SlideMode;

	public static ConfigEntry<float> SlideVolume;

	public static AudioClip[] slideStartSFX = (AudioClip[])(object)new AudioClip[20];

	public static AudioClip[] slideLoopSFX = (AudioClip[])(object)new AudioClip[10];

	public static AudioClip[] slideLoopFastSFX = (AudioClip[])(object)new AudioClip[10];

	public static AnimationClip slideInAnimation;

	public static AnimationClip slideLoopAnimation;

	public static AnimationClip slideOutAnimation;

	public static ParticleSystem[] dustParticles = (ParticleSystem[])(object)new ParticleSystem[10];

	public static ParticleSystem splinterParticle;

	public static ParticleSystem grassParticle;

	public static ParticleSystem sparkParticle;

	public static ParticleSystem mudParticle;

	public static Volume speedVolume;

	public static GameObject testSlopesPrefab;

	private void Awake()
	{
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Expected O, but got Unknown
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		new SlideConfig(((BaseUnityPlugin)this).Config);
		DefaultSlideKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "DefaultSlideKey", (Key)55, "Slide key, separate from the game's crouch key. Not synced.");
		AdditionalSlideKey = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "AdditionalSlideKey", false, "Turns on a second slide key, set with AdditionalSlideKeyBind. Not synced.");
		AdditionalSlideKeyBind = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "AdditionalSlideKeyBind", (Key)17, "The second slide key. Not synced.");
		SlideMode = ((BaseUnityPlugin)this).Config.Bind<string>("Controls", "SlideMode", "Toggle", new ConfigDescription("Toggle: press to slide, press again to stop. Hold: slide until you let go. Not synced.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "Toggle", "Hold" }), Array.Empty<object>()));
		BrakeKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "BrakeKey", (Key)33, "Hold while sliding to slow down. Not synced.");
		SlideVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "SlideVolume", 0.4f, "Volume of the sliding sound. Not synced, everyone sets their own.");
		TestSlopesKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "TestSlopesKey", (Key)101, "Host only. Teleports you to a test slope of every surface, only you see them.");
		AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "slidingcompany"));
		string[] names = Enum.GetNames(typeof(SlideSurface));
		for (int i = 0; i < slideStartSFX.Length; i++)
		{
			slideStartSFX[i] = val.LoadAsset<AudioClip>("SlideStart" + (i + 1).ToString("00"));
		}
		for (int j = 0; j < names.Length; j++)
		{
			slideLoopFastSFX[j] = val.LoadAsset<AudioClip>("SlideLoop" + names[j] + "Fast");
			slideLoopSFX[j] = val.LoadAsset<AudioClip>(((Object)(object)slideLoopFastSFX[j] != (Object)null) ? ("SlideLoop" + names[j] + "Slow") : "SlideLoopGround");
			if (j != 3)
			{
				dustParticles[j] = Spawn<ParticleSystem>(val, "SlideDust" + names[j]);
			}
		}
		slideInAnimation = val.LoadAsset<AnimationClip>("SlideIn");
		slideLoopAnimation = val.LoadAsset<AnimationClip>("SlideLoop");
		slideOutAnimation = val.LoadAsset<AnimationClip>("SlideOut");
		splinterParticle = Spawn<ParticleSystem>(val, "SlideSplinters");
		grassParticle = Spawn<ParticleSystem>(val, "SlideGrassStrands");
		sparkParticle = Spawn<ParticleSystem>(val, "SlideSparks");
		mudParticle = Spawn<ParticleSystem>(val, "SlideMud");
		speedVolume = Spawn<Volume>(val, "SlideSpeedVolume");
		testSlopesPrefab = val.LoadAsset<GameObject>("SlideTestSlopes");
		new Harmony("CoddingCat.SlidingCompany").PatchAll(typeof(SlidePatches));
	}

	private static T Spawn<T>(AssetBundle bundle, string name) where T : Component
	{
		GameObject obj = Object.Instantiate<GameObject>(bundle.LoadAsset<GameObject>(name));
		Object.DontDestroyOnLoad((Object)(object)obj);
		return obj.GetComponent<T>();
	}
}
public enum SlideSurface
{
	Concrete,
	Dirt,
	Gravel,
	Metal,
	Wood,
	Snow,
	Grass,
	Carpet,
	Water,
	Rock
}
public class SlideConfig : SyncedConfig2<SlideConfig>
{
	[SyncedEntryField]
	public static SyncedEntry<float> MinStartSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> EntryBoost;

	[SyncedEntryField]
	public static SyncedEntry<float> EntrySpeedCap;

	[SyncedEntryField]
	public static SyncedEntry<float> MomentumLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> DownhillAcceleration;

	[SyncedEntryField]
	public static SyncedEntry<float> UphillDeceleration;

	[SyncedEntryField]
	public static SyncedEntry<float> DownhillDrag;

	[SyncedEntryField]
	public static SyncedEntry<float> MaxSlideSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> EndSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> MinSlideTime;

	[SyncedEntryField]
	public static SyncedEntry<float> CancelDelay;

	[SyncedEntryField]
	public static SyncedEntry<float> SprintGrace;

	[SyncedEntryField]
	public static SyncedEntry<float> MaxAirTime;

	[SyncedEntryField]
	public static SyncedEntry<float> TurnRate;

	[SyncedEntryField]
	public static SyncedEntry<float> LookAroundDegrees;

	[SyncedEntryField]
	public static SyncedEntry<float> LookUpDownDegrees;

	[SyncedEntryField]
	public static SyncedEntry<float> DriftMouseSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DriftStrength;

	[SyncedEntryField]
	public static SyncedEntry<float> DriftMaxRate;

	[SyncedEntryField]
	public static SyncedEntry<float> DriftSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> SurfaceEffect;

	[SyncedEntryField]
	public static SyncedEntry<float> Cooldown;

	[SyncedEntryField]
	public static SyncedEntry<float> JumpCarry;

	[SyncedEntryField]
	public static SyncedEntry<float> NoiseRange;

	[SyncedEntryField]
	public static SyncedEntry<float> NoiseLoudness;

	[SyncedEntryField]
	public static SyncedEntry<float> NoiseInterval;

	[SyncedEntryField]
	public static SyncedEntry<float> OtherPlayerSlideSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DefaultSprintSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> MaxSprintSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> SlowBumpSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> BrakeStrength;

	[SyncedEntryField]
	public static SyncedEntry<float> StaminaStartCost;

	[SyncedEntryField]
	public static SyncedEntry<float> StaminaDrain;

	[SyncedEntryField]
	public static SyncedEntry<float> ExhaustedBelow;

	[SyncedEntryField]
	public static SyncedEntry<float> ExhaustedSlopeGain;

	[SyncedEntryField]
	public static SyncedEntry<float> ExhaustedFriction;

	[SyncedEntryField]
	public static SyncedEntry<float> DamageStartSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DamageVsRunSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> LightHitSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> UltraHitSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> LightHitMinDamage;

	[SyncedEntryField]
	public static SyncedEntry<float> LightHitMaxDamage;

	[SyncedEntryField]
	public static SyncedEntry<float> UltraHitDamage;

	[SyncedEntryField]
	public static SyncedEntry<float> TreeBreakSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> TreeSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> TreeBreakMinWeight;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorOpenSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorBashSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorOpenSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorBashSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorTriggerDistance;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorOpenAnimSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorBashNoiseRange;

	[SyncedEntryField]
	public static SyncedEntry<float> DoorBashNoiseLoudness;

	[SyncedEntryField]
	public static SyncedEntry<float> ImpactShake;

	[SyncedEntryField]
	public static SyncedEntry<float> PlayerHitSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> PlayerHitReach;

	[SyncedEntryField]
	public static SyncedEntry<float> PlayerHitWidth;

	[SyncedEntryField]
	public static SyncedEntry<float> PlayerKnockbackPower;

	[SyncedEntryField]
	public static SyncedEntry<float> EnemyHitSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> EnemyStunSeconds;

	[SyncedEntryField]
	public static SyncedEntry<float> HitCooldown;

	[SyncedEntryField]
	public static SyncedEntry<float> HitSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> BounceMinAngle;

	[SyncedEntryField]
	public static SyncedEntry<float> BounceMaxSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> BounceKeepSteep;

	[SyncedEntryField]
	public static SyncedEntry<float> BounceKeepGlancing;

	[SyncedEntryField]
	public static SyncedEntry<float> ForceSlideMinSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> JumpComboSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> JumpComboHigher;

	[SyncedEntryField]
	public static SyncedEntry<float> JumpComboFurther;

	[SyncedEntryField]
	public static SyncedEntry<float> JumpBoostTime;

	[SyncedEntryField]
	public static SyncedEntry<float> DodgeSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipDrag;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipSlopeGain;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipSteer;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipSteerSpike;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipWobble;

	[SyncedEntryField]
	public static SyncedEntry<float> SlipLockTime;

	[SyncedEntryField]
	public static SyncedEntry<float> TripChancePerSecond;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightFriction;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightSlopeLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightSpeedDrag;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightSpeedCap;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightUphill;

	[SyncedEntryField]
	public static SyncedEntry<float> WeightStamina;

	[SyncedEntryField]
	public static SyncedEntry<float> StartSoundVolume;

	[SyncedEntryField]
	public static SyncedEntry<float> LandingVolume;

	[SyncedEntryField]
	public static SyncedEntry<float> GritVolumeSlow;

	[SyncedEntryField]
	public static SyncedEntry<float> GritVolumeFast;

	[SyncedEntryField]
	public static SyncedEntry<float> LoopCutoffSlow;

	[SyncedEntryField]
	public static SyncedEntry<float> LoopCutoffFast;

	[SyncedEntryField]
	public static SyncedEntry<float> MudSplashSpeed;

	[SyncedEntryField]
	public static SyncedEntry<float> MudVisorSeconds;

	[SyncedEntryField]
	public static SyncedEntry<float> MudSlipSeconds;

	[SyncedEntryField]
	public static SyncedEntry<float> MudSlipperiness;

	[SyncedEntryField]
	public static SyncedEntry<float> MudSteer;

	[SyncedEntryField]
	public static SyncedEntry<float> BodyShake;

	[SyncedEntryField]
	public static SyncedEntry<float> CameraShake;

	[SyncedEntryField]
	public static SyncedEntry<float> BumpsPerMeter;

	[SyncedEntryField]
	public static SyncedEntry<float> BumpSpeedLoss;

	[SyncedEntryField]
	public static SyncedEntry<float> FovBoost;

	[SyncedEntryField]
	public static SyncedEntry<float> SpeedBlur;

	[SyncedEntryField]
	public static SyncedEntry<float> SpeedEffectStart;

	[SyncedEntryField]
	public static SyncedEntry<float> SpeedEffectRange;

	[SyncedEntryField]
	public static SyncedEntry<int> MinHealthLeft;

	[SyncedEntryField]
	public static SyncedEntry<int> DoorBashDamage;

	[SyncedEntryField]
	public static SyncedEntry<int> PlayerHitDamage;

	[SyncedEntryField]
	public static SyncedEntry<int> EnemyHitDamage;

	[SyncedEntryField]
	public static SyncedEntry<string> PlayerHitMode;

	[SyncedEntryField]
	public static SyncedEntry<string> EnemyHitMode;

	[SyncedEntryField]
	public static SyncedEntry<string> ForceSlideTag;

	[SyncedEntryField]
	public static SyncedEntry<string> ForceSlideNameMarker;

	[SyncedEntryField]
	public static SyncedEntry<bool> BounceEnabled;

	[SyncedEntryField]
	public static SyncedEntry<bool> AutoStandUp;

	[SyncedEntryField]
	public static SyncedEntry<bool> MudSplashEnabled;

	public static SyncedEntry<float>[] SurfaceFriction = new SyncedEntry<float>[10];

	public static SyncedEntry<float>[] SurfaceSlopeGain = new SyncedEntry<float>[10];

	public static SyncedEntry<float>[] SurfaceEntrySpeed = new SyncedEntry<float>[10];

	public static SyncedEntry<float>[] SurfaceRoughness = new SyncedEntry<float>[10];

	public SlideConfig(ConfigFile cfg)
		: base("CoddingCat.SlidingCompany")
	{
		//IL_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_074d: Expected O, but got Unknown
		//IL_0827: Unknown result type (might be due to invalid IL or missing references)
		//IL_0831: Expected O, but got Unknown
		MinStartSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MinStartSpeed", 5f, "Horizontal speed needed to start a slide (m/s).");
		EntryBoost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "EntryBoost", 0.95f, "Speed multiplier when the slide starts.");
		EntrySpeedCap = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "EntrySpeedCap", 1.3f, "Entry speed can't go over this multiple of your sprint speed (plus 1 m/s).");
		MomentumLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MomentumLoss", 2.4f, "Speed lost per second on flat ground.");
		DownhillAcceleration = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DownhillAcceleration", 20f, "How hard slopes speed you up going downhill.");
		UphillDeceleration = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "UphillDeceleration", 16f, "How hard slopes slow you down going uphill.");
		DownhillDrag = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DownhillDrag", 0.5f, "Light players only lose this fraction of MomentumLoss going downhill.");
		MaxSlideSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MaxSlideSpeed", 35f, "Speed cap while sliding (m/s).");
		EndSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "EndSpeed", 3.1f, "Slide ends below this speed.");
		MinSlideTime = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MinSlideTime", 0.2f, "A slide lasts at least this long before EndSpeed can end it.");
		CancelDelay = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "CancelDelay", 0.15f, "Seconds into a slide before you can cancel it.");
		SprintGrace = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "SprintGrace", 0.25f, "You can still start a slide this many seconds after you stopped sprinting.");
		MaxAirTime = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MaxAirTime", 1f, "Slide ends after this many seconds in the air.");
		TurnRate = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "TurnRateDegrees", 40f, "How fast A/D turn the slide (degrees per second).");
		LookAroundDegrees = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "LookAroundDegrees", 130f, "How far you can look left/right from the slide direction before it drags the slide around.");
		LookUpDownDegrees = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "LookUpDownDegrees", 35f, "How far you can look up/down while sliding.");
		DriftMouseSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DriftMouseSpeed", 1500f, "Mouse speed (pixels/second) above which flicking sideways makes you drift.");
		DriftStrength = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DriftStrength", 0.04f, "How hard a mouse flick turns the slide.");
		DriftMaxRate = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DriftMaxRate", 400f, "Fastest a drift can turn you (degrees per second).");
		DriftSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DriftSpeedLoss", 0.0025f, "Speed lost while drifting, per degree of turn.");
		SurfaceEffect = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "SurfaceEffect", 1f, "How much the surface matters (0 = every surface the same).");
		Cooldown = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "Cooldown", 0.1f, "Minimum seconds between slides.");
		JumpCarry = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "JumpCarry", 0.8f, "Fraction of slide speed kept when you jump out of a slide.");
		NoiseRange = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "NoiseRange", 14f, "How far enemies can hear a slide.");
		NoiseLoudness = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "NoiseLoudness", 0.55f, "How loud a slide is to enemies.");
		NoiseInterval = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "NoiseInterval", 0.5f, "Seconds between slide noises.");
		OtherPlayerSlideSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "OtherPlayerSlideSpeed", 4.2f, "A crouching player faster than this is shown as sliding on other clients.");
		DefaultSprintSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "DefaultSprintSpeed", 7f, "Sprint speed assumed until a player has been seen sprinting.");
		MaxSprintSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "MaxSprintSpeed", 16f, "Highest sprint speed that counts for EntrySpeedCap and DamageVsRunSpeed.");
		AutoStandUp = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Slide", "AutoStandUp", true, "Stand up when a slide runs out of speed or you bump into a player slower than SlowBumpSpeed.");
		SlowBumpSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "SlowBumpSpeed", 5f, "Bumping into a player slower than this ends your slide, if AutoStandUp is on.");
		BrakeStrength = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Slide", "BrakeStrength", 4f, "Extra speed lost per second while holding BrakeKey.");
		StaminaStartCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Stamina", "StartCost", 0.04f, "Stamina taken when a slide starts.");
		StaminaDrain = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Stamina", "DrainPerSecond", 0.16f, "Stamina drained per second while sliding.");
		ExhaustedBelow = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Stamina", "ExhaustedBelow", 0.1f, "The slide gets slow and heavy below this much stamina.");
		ExhaustedSlopeGain = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Stamina", "ExhaustedSlopeGain", 0.08f, "With no stamina, slopes give only this fraction of their boost.");
		ExhaustedFriction = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Stamina", "ExhaustedFriction", 3f, "With no stamina, you lose speed this many times faster.");
		DamageStartSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DamageStartSpeed", 6f, "Minimum head-on speed for wall damage.");
		DamageVsRunSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DamageVsRunSpeed", 1.5f, "Wall hits only hurt above this multiple of your sprint speed.");
		LightHitSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "LightHitSpeed", 9f, "Speed where a light hit reaches LightHitMaxDamage.");
		UltraHitSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "UltraHitSpeed", 30f, "Speed where a hit reaches UltraHitDamage.");
		LightHitMinDamage = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "LightHitMinDamage", 5f, "Damage of the lightest hit that hurts.");
		LightHitMaxDamage = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "LightHitMaxDamage", 15f, "Damage at LightHitSpeed.");
		UltraHitDamage = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "UltraHitDamage", 100f, "Damage at UltraHitSpeed.");
		MinHealthLeft = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, "Impact", "MinHealthLeft", 1, "A slide crash never takes you below this much health.");
		TreeBreakSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "TreeBreakSpeed", 20f, "Head-on speed needed to smash through a tree.");
		TreeSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "TreeSpeedLoss", 0.75f, "Fraction of speed lost smashing through a tree.");
		TreeBreakMinWeight = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "TreeBreakMinWeight", 25f, "Pounds you must carry to smash through a tree.");
		DoorOpenSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorOpenSpeed", 6f, "Speed at which sliding into a door opens it.");
		DoorBashSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "LockedDoorBashSpeed", 15f, "Speed at which sliding into a locked door bashes it open.");
		DoorOpenSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorOpenSpeedLoss", 0.15f, "Fraction of speed lost opening a door.");
		DoorBashSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorBashSpeedLoss", 0.4f, "Fraction of speed lost bashing a locked door.");
		DoorTriggerDistance = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorTriggerDistance", 1f, "How far ahead doors open for you while sliding fast enough.");
		DoorOpenAnimSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorOpenAnimSpeed", 2.5f, "How much faster doors swing open when a slide opens them.");
		DoorBashDamage = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, "Impact", "LockedDoorBashDamage", 20, "Damage you take bashing a locked door.");
		DoorBashNoiseRange = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorBashNoiseRange", 30f, "How far enemies can hear a door being bashed.");
		DoorBashNoiseLoudness = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "DoorBashNoiseLoudness", 1f, "How loud a door being bashed is to enemies.");
		ImpactShake = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Impact", "ImpactShake", 1f, "How hard crashes, doors and hits jolt you.");
		PlayerHitMode = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, "Hits", "PlayerHitMode", "Damage", new ConfigDescription("What happens to players you slide into.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Knockback", "Damage", "Off" }), Array.Empty<object>()));
		PlayerHitSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "PlayerHitSpeed", 8f, "Above this speed hits launch players into the air, and in Damage mode hurt them.");
		PlayerHitReach = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "PlayerHitReach", 1f, "How far ahead a player can be and still get hit.");
		PlayerHitWidth = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "PlayerHitWidth", 0.5f, "How far to the side a player can be and still get hit.");
		PlayerHitDamage = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, "Hits", "PlayerHitDamage", 15, "Damage to a player in Damage mode (up to 2x at top speed).");
		PlayerKnockbackPower = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "PlayerKnockbackPower", 12f, "How hard players you slide into get thrown.");
		EnemyHitMode = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, "Hits", "EnemyHitMode", "Stun", new ConfigDescription("What happens to monsters you slide into.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Stun", "Damage", "Off" }), Array.Empty<object>()));
		EnemyHitSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "EnemyHitSpeed", 9f, "Speed needed to hit a monster.");
		EnemyHitDamage = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, "Hits", "EnemyHitDamage", 1, "Damage to a monster in Damage mode (a shovel hit is 1).");
		EnemyStunSeconds = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "EnemyStunSeconds", 1.5f, "Stun time in Stun mode.");
		HitCooldown = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "HitCooldown", 1f, "Seconds before the same player or monster can be hit again.");
		HitSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Hits", "HitSpeedLoss", 0.3f, "Fraction of speed lost when you ram someone.");
		BounceEnabled = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Bounce", "Enabled", true, "Bounce off walls you hit at an angle instead of crashing.");
		BounceMinAngle = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Bounce", "MinAngle", 35f, "Hits more than this many degrees from straight-on bounce off.");
		BounceMaxSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Bounce", "MaxSpeed", 22f, "Above this speed you crash instead of bouncing.");
		BounceKeepSteep = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Bounce", "SpeedKeptSteep", 0.55f, "Speed kept bouncing at the steepest angle.");
		BounceKeepGlancing = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Bounce", "SpeedKeptGlancing", 0.9f, "Speed kept just grazing a wall.");
		ForceSlideTag = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, "ForceSlide", "Tag", "ForceSlide", "Colliders with this tag force anyone on them to slide.");
		ForceSlideNameMarker = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, "ForceSlide", "NameMarker", "ForceSlide", "Colliders (or parents) with this in their name force sliding.");
		ForceSlideMinSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "ForceSlide", "MinSpeed", 4f, "Minimum slide speed on ForceSlide surfaces.");
		JumpComboSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "JumpComboSpeed", 8f, "Slide speed above which jumping out of a slide gets a bonus.");
		JumpComboHigher = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "JumpComboHigher", 0.45f, "Extra jump force at top slide speed.");
		JumpComboFurther = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "JumpComboFurther", 0.5f, "Extra forward carry at top slide speed.");
		JumpBoostTime = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "JumpBoostTime", 0.8f, "Seconds the extra jump force stays on.");
		DodgeSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "DodgeSpeed", 9f, "Sliding this fast lets you slip through Forest Giant and Old Bird grabs.");
		SlipDrag = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipDrag", 1.6f, "How much faster a slip loses speed than a slide.");
		SlipSlopeGain = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipSlopeGain", 0.3f, "Fraction of the downhill boost you get while slipping.");
		SlipSteer = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipSteer", 0.15f, "Steering strength while slipping.");
		SlipSteerSpike = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipSteerSpike", 2.2f, "How hard steering randomly bites while slipping.");
		SlipWobble = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipWobble", 35f, "How much a slip wanders around (degrees/second).");
		SlipLockTime = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlipLockTime", 0.8f, "Seconds after slipping before you can jump or crouch out.");
		TripChancePerSecond = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Combo", "SlimeTripChancePerSecond", 0.6f, "Chance per second of tripping while sprinting over slime.");
		WeightFriction = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "MomentumLossPer50lb", 2.5f, "How much weight drags a slide.");
		WeightSlopeLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "SlopeGainLossPer50lb", 0.35f, "How much weight shrinks what slopes give you.");
		WeightSpeedDrag = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "SpeedDragPer50lb", 0.25f, "Heavy players brake harder the faster they go.");
		WeightSpeedCap = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "TopSpeedLossPer50lb", 1f, "How much weight lowers your top slide speed.");
		WeightUphill = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "UphillPer50lb", 0.6f, "Extra uphill slowdown per 50 lb.");
		WeightStamina = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Weight", "StaminaDrainPer100lb", 1f, "Extra stamina drain per 100 lb.");
		StartSoundVolume = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "StartSoundVolume", 1f, "Volume of the slide start sound.");
		LandingVolume = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "LandingVolume", 0.5f, "Volume of the thud when you drop into a slide.");
		GritVolumeSlow = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "GritVolumeSlow", 0.12f, "Volume of foot drag sounds at low speed.");
		GritVolumeFast = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "GritVolumeFast", 0.35f, "Volume of foot drag sounds at high speed.");
		LoopCutoffSlow = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "LoopCutoffSlow", 900f, "Low-pass of the sliding sound when nearly stopped (Hz).");
		LoopCutoffFast = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Effects", "LoopCutoffFast", 18000f, "Low-pass of the sliding sound at full speed (Hz).");
		MudSplashEnabled = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Mud", "Enabled", true, "Sliding into quicksand fast sprays mud at you.");
		MudSplashSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Mud", "SplashSpeed", 6f, "Speed needed to splash.");
		MudVisorSeconds = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Mud", "VisorSeconds", 1f, "Seconds the mud blocks your visor.");
		MudSlipSeconds = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Mud", "SlipSeconds", 3f, "Seconds you stay slippery after a splash.");
		MudSlipperiness = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Mud", "Slipperiness", 3f, "How slippery you are on foot after a splash.");
		MudSteer = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Mud", "SteerWhileSlippery", 0.5f, "Steering strength while slippery.");
		BodyShake = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Shake", "BodyShake", 1.105f, "How much the body shakes while sliding.");
		CameraShake = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Shake", "CameraShake", 1.105f, "How much the camera shakes while sliding.");
		BumpsPerMeter = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Shake", "BumpsPerMeter", 0.9f, "How often you hit bumps on rough ground.");
		BumpSpeedLoss = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Shake", "BumpSpeedLoss", 0.012f, "Fraction of speed a hard bump takes off.");
		FovBoost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Camera", "SpeedFovBoost", 12f, "Extra field of view at full slide speed.");
		SpeedBlur = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Camera", "SpeedBlur", 1f, "Strength of the motion blur and vignette while sliding fast.");
		SpeedEffectStart = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Camera", "SpeedEffectStart", 4f, "Speed where the FOV boost and blur start.");
		SpeedEffectRange = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Camera", "SpeedEffectRange", 16f, "How many m/s above SpeedEffectStart they reach full strength.");
		float[,] array = new float[10, 4]
		{
			{ 1f, 1f, 1f, 0.6f },
			{ 1.45f, 0.8f, 0.93f, 0.85f },
			{ 2.1f, 0.6f, 0.85f, 1f },
			{ 0.6f, 1.2f, 1.05f, 0.35f },
			{ 0.55f, 1.25f, 1.06f, 0.55f },
			{ 0.4f, 1.35f, 1.1f, 0.3f },
			{ 0.9f, 1f, 0.98f, 0.7f },
			{ 2.4f, 0.55f, 0.8f, 0.25f },
			{ 0.7f, 1.1f, 1f, 0.4f },
			{ 2.1f, 0.6f, 0.85f, 1f }
		};
		string[] names = Enum.GetNames(typeof(SlideSurface));
		for (int i = 0; i < names.Length; i++)
		{
			SurfaceFriction[i] = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Surface." + names[i], "Friction", array[i, 0], "Multiplier on speed lost per second.");
			SurfaceSlopeGain[i] = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Surface." + names[i], "SlopeGain", array[i, 1], "Multiplier on downhill speed gain.");
			SurfaceEntrySpeed[i] = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Surface." + names[i], "EntrySpeed", array[i, 2], "Multiplier on the speed you keep when you drop into a slide.");
			SurfaceRoughness[i] = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, "Surface." + names[i], "Roughness", array[i, 3], "How much this surface shakes and bumps you.");
			((IDictionary<(string, SyncedConfigDefinition), SyncedEntryBase>)base.EntryContainer).Add(ConfigEntryExtensions.ToSyncedEntryIdentifier(((SyncedEntryBase)SurfaceFriction[i]).BoxedEntry), (SyncedEntryBase)(object)SurfaceFriction[i]);
			((IDictionary<(string, SyncedConfigDefinition), SyncedEntryBase>)base.EntryContainer).Add(ConfigEntryExtensions.ToSyncedEntryIdentifier(((SyncedEntryBase)SurfaceSlopeGain[i]).BoxedEntry), (SyncedEntryBase)(object)SurfaceSlopeGain[i]);
			((IDictionary<(string, SyncedConfigDefinition), SyncedEntryBase>)base.EntryContainer).Add(ConfigEntryExtensions.ToSyncedEntryIdentifier(((SyncedEntryBase)SurfaceEntrySpeed[i]).BoxedEntry), (SyncedEntryBase)(object)SurfaceEntrySpeed[i]);
			((IDictionary<(string, SyncedConfigDefinition), SyncedEntryBase>)base.EntryContainer).Add(ConfigEntryExtensions.ToSyncedEntryIdentifier(((SyncedEntryBase)SurfaceRoughness[i]).BoxedEntry), (SyncedEntryBase)(object)SurfaceRoughness[i]);
		}
		ConfigManager.Register<SlideConfig>((SyncedConfig2<SlideConfig>)this);
	}
}
internal class SlidePatches
{
	[CompilerGenerated]
	private static class <>O
	{
		public static HandleNamedMessageDelegate <0>__OnKnockbackMessage;

		public static HandleNamedMessageDelegate <1>__OnStunMessage;
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
	[HarmonyPostfix]
	private static void AddSlideToPlayer(PlayerControllerB __instance)
	{
		((Component)__instance).gameObject.AddComponent<PlayerSlide>();
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyPrefix]
	private static void RestoreCameraBeforeUpdate(PlayerControllerB __instance)
	{
		((Component)__instance).GetComponent<PlayerSlide>().RestoreCamera();
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyTranspiler]
	private static IEnumerable<CodeInstruction> SlidersDontShove(IEnumerable<CodeInstruction> instructions)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		List<CodeInstruction> list = new List<CodeInstruction>(instructions);
		int num = list.FindIndex((CodeInstruction x) => x.operand is MethodInfo { Name: "GetComponent" } methodInfo && methodInfo.ReturnType == typeof(PlayerControllerB));
		list.Insert(num + 1, new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SlidePatches), "NullIfSliding", (Type[])null, (Type[])null)));
		return list;
	}

	private static PlayerControllerB NullIfSliding(PlayerControllerB nearbyPlayer)
	{
		if ((Object)(object)nearbyPlayer != (Object)null && ((Component)nearbyPlayer).GetComponent<PlayerSlide>().sliding)
		{
			return null;
		}
		return nearbyPlayer;
	}

	[HarmonyPatch(typeof(StartOfRound), "Awake")]
	[HarmonyPostfix]
	private static void LoadRoundStuff()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//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_0059: Expected O, but got Unknown
		CustomMessagingManager customMessagingManager = NetworkManager.Singleton.CustomMessagingManager;
		object obj = <>O.<0>__OnKnockbackMessage;
		if (obj == null)
		{
			HandleNamedMessageDelegate val = PlayerSlide.OnKnockbackMessage;
			<>O.<0>__OnKnockbackMessage = val;
			obj = (object)val;
		}
		customMessagingManager.RegisterNamedMessageHandler("SlidingCompany.Knockback", (HandleNamedMessageDelegate)obj);
		CustomMessagingManager customMessagingManager2 = NetworkManager.Singleton.CustomMessagingManager;
		object obj2 = <>O.<1>__OnStunMessage;
		if (obj2 == null)
		{
			HandleNamedMessageDelegate val2 = PlayerSlide.OnStunMessage;
			<>O.<1>__OnStunMessage = val2;
			obj2 = (object)val2;
		}
		customMessagingManager2.RegisterNamedMessageHandler("SlidingCompany.Stun", (HandleNamedMessageDelegate)obj2);
		PlayerSlide.dragFootSFX = Array.FindAll(Resources.FindObjectsOfTypeAll<AudioClip>(), (AudioClip x) => ((Object)x).name.StartsWith("DragFoot"));
		PlayerSlide.doorBashSFX = Resources.FindObjectsOfTypeAll<CrawlerAI>()[0].hitWallSFX;
	}

	[HarmonyPatch(typeof(ForestGiantAI), "GrabPlayerServerRpc")]
	[HarmonyPrefix]
	private static bool DodgeGiantGrab(int playerId)
	{
		return ((Component)StartOfRound.Instance.allPlayerScripts[playerId]).GetComponent<PlayerSlide>().GetSlideSpeed() < SlideConfig.DodgeSpeed.Value;
	}

	[HarmonyPatch(typeof(RadMechAI), "GrabPlayerServerRpc")]
	[HarmonyPrefix]
	private static bool DodgeOldBirdGrab(int playerId)
	{
		return ((Component)StartOfRound.Instance.allPlayerScripts[playerId]).GetComponent<PlayerSlide>().GetSlideSpeed() < SlideConfig.DodgeSpeed.Value;
	}
}
[DefaultExecutionOrder(30000)]
public class PlayerSlide : MonoBehaviour
{
	public static AudioClip[] dragFootSFX;

	public static AudioClip[] doorBashSFX;

	private static float[] dustDensity = new float[10] { 0.9f, 1.3f, 1.7f, 0f, 0.35f, 2.2f, 0.2f, 0.3f, 1f, 0.9f };

	private static string[][] surfaceWords = new string[10][]
	{
		new string[5] { "metal", "catwalk", "alumin", "steel", "grate" },
		new string[2] { "wood", "plank" },
		new string[2] { "snow", "ice" },
		new string[1] { "rock" },
		new string[2] { "gravel", "stone" },
		new string[3] { "grass", "leaf", "foliage" },
		new string[3] { "carpet", "rug", "fabric" },
		new string[4] { "water", "puddle", "mud", "wet" },
		new string[5] { "dirt", "sand", "soil", "ground", "terrain" },
		new string[2] { "concrete", "brick" }
	};

	private static SlideSurface[] surfaceOfWords = new SlideSurface[10]
	{
		SlideSurface.Metal,
		SlideSurface.Wood,
		SlideSurface.Snow,
		SlideSurface.Rock,
		SlideSurface.Gravel,
		SlideSurface.Grass,
		SlideSurface.Carpet,
		SlideSurface.Water,
		SlideSurface.Dirt,
		SlideSurface.Concrete
	};

	private static string[] dustBoneNames = new string[13]
	{
		"foot.L", "foot.R", "toe.L", "toe.R", "shin.L", "shin.R", "hand.L", "hand.R", "spine", "thigh.L",
		"thigh.R", "arm.L_lower", "arm.R_lower"
	};

	private static GameObject testSlopes;

	private static DoorLock[] allDoors;

	private static float timeAtFindingDoors = -100f;

	private static Collider[] hitColliders = (Collider[])(object)new Collider[32];

	public bool sliding;

	public bool isForced;

	public Vector3 velocity;

	private PlayerControllerB player;

	private bool localPlayer;

	private bool moveInputLocked;

	private bool slideKeyWaiting;

	private bool slideHeld;

	private bool wasInQuicksand;

	private bool slipped;

	private bool lastSlideEndedWithJump;

	private bool lastSlideHitWall;

	private bool wasSliding;

	private bool effectsWereActive;

	private bool touchingGround;

	private bool dustLandingBurst;

	private bool cameraDirty;

	private bool cameraEffectsReady;

	private bool armsHidden;

	private int groundMask;

	private int previousStartClip = -1;

	private RaycastHit groundHit;

	private Vector3 lastPosition;

	private Vector3 measuredVelocity;

	private Vector3 forcedPush;

	private Vector3 lastTravel;

	private Vector3 groundPivot;

	private Vector3 cameraCleanPosition;

	private Vector3 smoothedGroundNormal = Vector3.up;

	private Quaternion cameraCleanRotation;

	private float timeInQuicksand = -100f;

	private float lastMudSplashTime = -100f;

	private float muddyEndTime = -100f;

	private float lastSprintTime = -10f;

	private float lastSlideStartTime = -100f;

	private float forcedEndTime = -100f;

	private float passingDoorTime = -100f;

	private float mudVisorEndTime;

	private float slipSeed;

	private float slideTime;

	private float airTime;

	private float standUpEndTime;

	private float sprintSpeedSeen;

	private float mouseSpeed;

	private float savedJumpForce;

	private float jumpBoostEndTime;

	private float forcedMinSpeed;

	private float gripFriction = 1f;

	private float gripSlope = 1f;

	private float gripEntry = 1f;

	private float crossfade = 1f;

	private float roughness = 0.6f;

	private float clipTime;

	private float previousClipTime;

	private float heldClipTime;

	private float bodyWeight;

	private float distanceSlid;

	private float shakeFade;

	private float shakeAmount;

	private float rumble;

	private float rumble2;

	private float undulation;

	private float bump;

	private float bumpVelocity;

	private float shakeSeed;

	private float gritTimer;

	private float noiseTimer;

	private float fovBoost;

	private float speedEffect;

	private Color goopColor;

	private SlideSurface currentSurface;

	private DoorLock passingDoor;

	private Dictionary<int, float> hitCooldowns = new Dictionary<int, float>();

	private Transform[] bones;

	private Transform[] dustBones;

	private Quaternion[] animatorRotations;

	private Quaternion[] previousClipRotations;

	private GameObject rig;

	private Transform spine;

	private Transform lowerSpine;

	private Transform head;

	private AnimationClip currentClip;

	private AnimationClip previousClip;

	private AnimationClip heldClip;

	private AudioSource slideSFXAudio;

	private AudioSource slideStartAudio;

	private AudioSource slideLoopAudio;

	private AudioSource slideLoopFastAudio;

	private AudioLowPassFilter slideLoopFilter;

	private AudioLowPassFilter slideLoopFastFilter;

	private float[] dustAccumulated;

	private float[] bitsAccumulated;

	public static event Action<PlayerControllerB> SlideStarted;

	public static event Action<PlayerControllerB> SlideEnded;

	private void Awake()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		player = ((Component)this).GetComponent<PlayerControllerB>();
		lastPosition = ((Component)this).transform.position;
		shakeSeed = Random.value * 100f;
	}

	private void Start()
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Expected O, but got Unknown
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Expected O, but got Unknown
		groundMask = StartOfRound.Instance.collidersAndRoomMaskAndDefault;
		slideSFXAudio = CreateAudioSource(((Component)this).gameObject);
		slideStartAudio = CreateAudioSource(((Component)this).gameObject);
		slideLoopAudio = CreateAudioSource(new GameObject("SlideLoopAudio"));
		slideLoopFilter = ((Component)slideLoopAudio).gameObject.AddComponent<AudioLowPassFilter>();
		slideLoopFastAudio = CreateAudioSource(new GameObject("SlideLoopFastAudio"));
		slideLoopFastFilter = ((Component)slideLoopFastAudio).gameObject.AddComponent<AudioLowPassFilter>();
		slideLoopAudio.loop = true;
		slideLoopFastAudio.loop = true;
		List<Transform> list = new List<Transform>();
		List<Transform> list2 = new List<Transform>();
		Transform[] array = player.thisPlayerModel.bones;
		foreach (Transform val in array)
		{
			if (!((Object)(object)val == (Object)null))
			{
				list.Add(val);
				if (Array.IndexOf(dustBoneNames, ((Object)val).name) != -1)
				{
					list2.Add(val);
				}
				switch (((Object)val).name)
				{
				case "spine":
					spine = val;
					break;
				case "spine.001":
					lowerSpine = val;
					break;
				case "spine.004":
					head = val;
					break;
				}
			}
		}
		bones = list.ToArray();
		dustBones = list2.ToArray();
		animatorRotations = (Quaternion[])(object)new Quaternion[bones.Length];
		previousClipRotations = (Quaternion[])(object)new Quaternion[bones.Length];
		dustAccumulated = new float[dustBones.Length];
		bitsAccumulated = new float[dustBones.Length];
		rig = ((Component)spine.parent).gameObject;
	}

	private AudioSource CreateAudioSource(GameObject onObject)
	{
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)onObject != (Object)(object)((Component)this).gameObject)
		{
			onObject.transform.SetParent(((Component)this).transform, false);
		}
		AudioSource obj = onObject.AddComponent<AudioSource>();
		obj.playOnAwake = false;
		obj.outputAudioMixerGroup = player.movementAudio.outputAudioMixerGroup;
		obj.spatialBlend = player.movementAudio.spatialBlend;
		obj.rolloffMode = player.movementAudio.rolloffMode;
		obj.minDistance = player.movementAudio.minDistance;
		obj.maxDistance = player.movementAudio.maxDistance;
		obj.SetCustomCurve((AudioSourceCurveType)0, player.movementAudio.GetCustomCurve((AudioSourceCurveType)0));
		obj.dopplerLevel = 0f;
		return obj;
	}

	private static bool KeyPressed(Key key)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		if ((int)key != 0)
		{
			return ((ButtonControl)Keyboard.current[key]).wasPressedThisFrame;
		}
		return false;
	}

	private static bool KeyHeld(Key key)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		if ((int)key != 0)
		{
			return ((ButtonControl)Keyboard.current[key]).isPressed;
		}
		return false;
	}

	private float Grip(SyncedEntry<float>[] surfaceValues)
	{
		return Mathf.Lerp(1f, surfaceValues[(int)currentSurface].Value, SlideConfig.SurfaceEffect.Value);
	}

	private float RunSpeed()
	{
		if (!(sprintSpeedSeen > 3f))
		{
			return SlideConfig.DefaultSprintSpeed.Value;
		}
		return Mathf.Min(sprintSpeedSeen, SlideConfig.MaxSprintSpeed.Value);
	}

	public float GetSlideSpeed()
	{
		if (!sliding)
		{
			return 0f;
		}
		return ((Vector3)(ref velocity)).magnitude;
	}

	public bool StartSliding(Vector3 startVelocity = default(Vector3))
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		if (!localPlayer || sliding || !CanContinueSlide())
		{
			return false;
		}
		startVelocity.y = 0f;
		if (((Vector3)(ref startVelocity)).sqrMagnitude < 0.01f)
		{
			((Vector3)(ref startVelocity))..ctor(player.thisController.velocity.x, 0f, player.thisController.velocity.z);
		}
		if (((Vector3)(ref startVelocity)).magnitude < 2f)
		{
			startVelocity = ((((Vector3)(ref startVelocity)).sqrMagnitude > 0.01f) ? ((Vector3)(ref startVelocity)).normalized : ((Component)this).transform.forward) * Mathf.Max(2f, SlideConfig.ForceSlideMinSpeed.Value);
		}
		StartSlide(startVelocity, tripped: true, slip: false);
		return true;
	}

	public void ForceSlide(float seconds, float minSpeed = 4f, Vector3 push = default(Vector3))
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		forcedEndTime = Mathf.Max(forcedEndTime, Time.time + seconds);
		forcedMinSpeed = minSpeed;
		forcedPush = new Vector3(push.x, 0f, push.z);
	}

	public void StopSliding()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		forcedEndTime = -100f;
		forcedPush = Vector3.zero;
		if (localPlayer && sliding)
		{
			EndSlide(jumped: false);
		}
	}

	private bool CanContinueSlide()
	{
		if (!player.isPlayerDead && player.isPlayerControlled && !player.isClimbingLadder && !player.inTerminalMenu && !player.isTypingChat && !player.inSpecialInteractAnimation)
		{
			return !player.quickMenuManager.isMenuOpen;
		}
		return false;
	}

	private void Update()
	{
		//IL_0048: 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_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: 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_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: 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_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0254: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_030c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0464: Unknown result type (might be due to invalid IL or missing references)
		//IL_047e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0938: Unknown result type (might be due to invalid IL or missing references)
		//IL_093d: Unknown result type (might be due to invalid IL or missing references)
		//IL_093f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0941: Unknown result type (might be due to invalid IL or missing references)
		//IL_094b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0950: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Unknown result type (might be due to invalid IL or missing references)
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_050c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0984: Unknown result type (might be due to invalid IL or missing references)
		//IL_0977: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_051c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0989: Unknown result type (might be due to invalid IL or missing references)
		//IL_063c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0813: Unknown result type (might be due to invalid IL or missing references)
		//IL_0818: Unknown result type (might be due to invalid IL or missing references)
		//IL_0824: Unknown result type (might be due to invalid IL or missing references)
		//IL_082b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0830: Unknown result type (might be due to invalid IL or missing references)
		//IL_0835: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0732: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bd6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b82: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d16: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d28: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e4b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e15: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ece: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ebb: Unknown result type (might be due to invalid IL or missing references)
		//IL_101a: Unknown result type (might be due to invalid IL or missing references)
		//IL_101c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1026: Unknown result type (might be due to invalid IL or missing references)
		//IL_102b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f43: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f48: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4f: Unknown result type (might be due to invalid IL or missing references)
		//IL_105c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1061: Unknown result type (might be due to invalid IL or missing references)
		//IL_1080: Unknown result type (might be due to invalid IL or missing references)
		//IL_1085: Unknown result type (might be due to invalid IL or missing references)
		//IL_1664: Unknown result type (might be due to invalid IL or missing references)
		//IL_1669: Unknown result type (might be due to invalid IL or missing references)
		//IL_166b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1672: Unknown result type (might be due to invalid IL or missing references)
		//IL_1677: Unknown result type (might be due to invalid IL or missing references)
		//IL_1681: Unknown result type (might be due to invalid IL or missing references)
		//IL_1688: Unknown result type (might be due to invalid IL or missing references)
		//IL_168d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1692: Unknown result type (might be due to invalid IL or missing references)
		//IL_1697: Unknown result type (might be due to invalid IL or missing references)
		//IL_169f: Unknown result type (might be due to invalid IL or missing references)
		//IL_16a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_16a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_16ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_16b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_16b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_16c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_16c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_16cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_10a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_1093: Unknown result type (might be due to invalid IL or missing references)
		//IL_16ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_16f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_14b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_14b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_14bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_14c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_14c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_14d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_14d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_1134: Unknown result type (might be due to invalid IL or missing references)
		//IL_1139: Unknown result type (might be due to invalid IL or missing references)
		//IL_113b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1140: Unknown result type (might be due to invalid IL or missing references)
		//IL_1142: Unknown result type (might be due to invalid IL or missing references)
		//IL_1144: Unknown result type (might be due to invalid IL or missing references)
		//IL_114d: Unknown result type (might be due to invalid IL or missing references)
		//IL_114f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1153: Unknown result type (might be due to invalid IL or missing references)
		//IL_1158: Unknown result type (might be due to invalid IL or missing references)
		//IL_115d: Unknown result type (might be due to invalid IL or missing references)
		//IL_173f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1750: Unknown result type (might be due to invalid IL or missing references)
		//IL_175a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1734: Unknown result type (might be due to invalid IL or missing references)
		//IL_1736: Unknown result type (might be due to invalid IL or missing references)
		//IL_175f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1702: Unknown result type (might be due to invalid IL or missing references)
		//IL_170e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1715: Unknown result type (might be due to invalid IL or missing references)
		//IL_171a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1778: Unknown result type (might be due to invalid IL or missing references)
		//IL_176f: Unknown result type (might be due to invalid IL or missing references)
		//IL_177d: Unknown result type (might be due to invalid IL or missing references)
		//IL_17ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_1783: Unknown result type (might be due to invalid IL or missing references)
		//IL_1785: Unknown result type (might be due to invalid IL or missing references)
		//IL_178f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1794: Unknown result type (might be due to invalid IL or missing references)
		//IL_1799: Unknown result type (might be due to invalid IL or missing references)
		//IL_17a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_17a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_11bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_11c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_17b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_17b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_17b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_11dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_17ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_17cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_17ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_17ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_17ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_17f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_17fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_1805: Unknown result type (might be due to invalid IL or missing references)
		//IL_131d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1322: Unknown result type (might be due to invalid IL or missing references)
		//IL_1324: Unknown result type (might be due to invalid IL or missing references)
		//IL_1329: Unknown result type (might be due to invalid IL or missing references)
		//IL_132b: Unknown result type (might be due to invalid IL or missing references)
		//IL_132d: Unknown result type (might be due to invalid IL or missing references)
		//IL_132f: Unknown result type (might be due to invalid IL or missing references)
		//IL_15ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_130a: Unknown result type (might be due to invalid IL or missing references)
		//IL_160d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1622: Unknown result type (might be due to invalid IL or missing references)
		//IL_1627: Unknown result type (might be due to invalid IL or missing references)
		//IL_1349: Unknown result type (might be due to invalid IL or missing references)
		//IL_134e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1355: Unknown result type (might be due to invalid IL or missing references)
		//IL_135a: Unknown result type (might be due to invalid IL or missing references)
		//IL_135f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1363: Unknown result type (might be due to invalid IL or missing references)
		//IL_1372: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_1401: Unknown result type (might be due to invalid IL or missing references)
		//IL_1444: Unknown result type (might be due to invalid IL or missing references)
		//IL_1459: Unknown result type (might be due to invalid IL or missing references)
		//IL_145e: Unknown result type (might be due to invalid IL or missing references)
		//IL_192a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1952: Unknown result type (might be due to invalid IL or missing references)
		//IL_1967: Unknown result type (might be due to invalid IL or missing references)
		//IL_196c: Unknown result type (might be due to invalid IL or missing references)
		//IL_18e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_18e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_18fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_18ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a7c: Unknown result type (might be due to invalid IL or missing references)
		//IL_19c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_19fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a10: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a25: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_19d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_19d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_19e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_19e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_1aae: Unknown result type (might be due to invalid IL or missing references)
		//IL_1ab0: Unknown result type (might be due to invalid IL or missing references)
		//IL_1ab2: Unknown result type (might be due to invalid IL or missing references)
		//IL_1ab9: Unknown result type (might be due to invalid IL or missing references)
		//IL_1aed: Unknown result type (might be due to invalid IL or missing references)
		//IL_1af2: Unknown result type (might be due to invalid IL or missing references)
		//IL_1b02: Unknown result type (might be due to invalid IL or missing references)
		//IL_1b09: Unknown result type (might be due to invalid IL or missing references)
		//IL_1b0e: Unknown result type (might be due to invalid IL or missing references)
		localPlayer = player.isPlayerControlled && (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController;
		if (!localPlayer)
		{
			if (moveInputLocked)
			{
				EndSlide(jumped: false);
			}
			velocity = Vector3.Lerp(velocity, (((Component)this).transform.position - lastPosition) / Time.deltaTime, Time.deltaTime * 10f);
			velocity.y = 0f;
			lastPosition = ((Component)this).transform.position;
			sliding = player.isPlayerControlled && !player.isPlayerDead && player.isCrouching && ((Vector3)(ref velocity)).magnitude > SlideConfig.OtherPlayerSlideSpeed.Value;
			return;
		}
		if (!player.isTypingChat && !player.inTerminalMenu && !player.quickMenuManager.isMenuOpen && ((NetworkBehaviour)player).IsServer && KeyPressed(SlidingCompanyPlugin.TestSlopesKey.Value))
		{
			GoToTestSlopes();
			return;
		}
		InputAction val = InputSystem.actions.FindAction("Crouch", false);
		bool flag = val.WasPressedThisFrame();
		bool flag2 = InputSystem.actions.FindAction("Jump", false).WasPressedThisFrame();
		Key value = SlidingCompanyPlugin.DefaultSlideKey.Value;
		Key key = (Key)(SlidingCompanyPlugin.AdditionalSlideKey.Value ? ((int)SlidingCompanyPlugin.AdditionalSlideKeyBind.Value) : 0);
		bool flag3 = KeyPressed(value) || KeyPressed(key) || (flag && val.activeControl != null && val.activeControl.device is Gamepad);
		bool flag4 = KeyHeld(value) || KeyHeld(key);
		slideKeyWaiting = !sliding && (flag3 || (slideKeyWaiting && flag4));
		if (!sliding && Time.time < muddyEndTime)
		{
			player.slipperyFloor = Mathf.Max(player.slipperyFloor, SlideConfig.MudSlipperiness.Value);
		}
		Vector3 val2 = (((Component)this).transform.position - lastPosition) / Time.deltaTime;
		lastPosition = ((Component)this).transform.position;
		if (((Vector3)(ref val2)).sqrMagnitude < 2500f)
		{
			measuredVelocity = Vector3.Lerp(measuredVelocity, val2, Time.deltaTime * 15f);
		}
		if (jumpBoostEndTime > 0f && Time.time > jumpBoostEndTime)
		{
			player.jumpForce = savedJumpForce;
			jumpBoostEndTime = 0f;
		}
		bool flag5 = false;
		float num = SlideConfig.ForceSlideMinSpeed.Value;
		if (player.thisController.isGrounded && Physics.Raycast(((Component)this).transform.position + Vector3.up * 0.4f, Vector3.down, ref groundHit, 1f, -1, (QueryTriggerInteraction)1) && !((Component)((RaycastHit)(ref groundHit)).collider).transform.IsChildOf(((Component)this).transform))
		{
			string value2 = SlideConfig.ForceSlideNameMarker.Value;
			flag5 = SlideConfig.ForceSlideTag.Value != "" && ((Component)((RaycastHit)(ref groundHit)).collider).tag == SlideConfig.ForceSlideTag.Value;
			Transform val3 = ((Component)((RaycastHit)(ref groundHit)).collider).transform;
			while ((Object)(object)val3 != (Object)null && !flag5 && value2 != "")
			{
				flag5 = ((Object)val3).name.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0;
				val3 = val3.parent;
			}
			ForceSlideSurface componentInParent = ((Component)((RaycastHit)(ref groundHit)).collider).GetComponentInParent<ForceSlideSurface>();
			if ((Object)(object)componentInParent != (Object)null && ((Behaviour)componentInParent).enabled)
			{
				flag5 = true;
				num = componentInParent.minSpeed;
			}
		}
		isForced = flag5 || Time.time < forcedEndTime;
		float num2 = Mathf.Max((Time.time < forcedEndTime) ? forcedMinSpeed : 0f, flag5 ? num : 0f);
		Vector3 val4 = default(Vector3);
		((Vector3)(ref val4))..ctor(player.thisController.velocity.x, 0f, player.thisController.velocity.z);
		Vector3 val5;
		if (!sliding)
		{
			if (Time.time < standUpEndTime && player.isCrouching && !isForced)
			{
				player.Crouch(false);
			}
			if (isForced && CanContinueSlide() && player.thisController.isGrounded)
			{
				StartSlide((((Vector3)(ref val4)).magnitude < num2) ? (((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val4)).normalized : ((Component)this).transform.forward) * num2) : val4, tripped: true, slip: false);
				return;
			}
			if (player.isSprinting && !flag)
			{
				lastSprintTime = Time.time;
			}
			if (player.isSprinting && player.thisController.isGrounded && ((Vector3)(ref player.externalForceAutoFade)).sqrMagnitude < 1f)
			{
				sprintSpeedSeen = Mathf.Max(sprintSpeedSeen, ((Vector3)(ref val4)).magnitude);
			}
			bool flag6 = Time.time - lastSlideStartTime >= SlideConfig.Cooldown.Value;
			if (slideKeyWaiting && (player.isSprinting || Time.time - lastSprintTime < SlideConfig.SprintGrace.Value) && player.thisController.isGrounded && CanContinueSlide() && !player.isExhausted && player.sprintMeter >= SlideConfig.StaminaStartCost.Value && flag6)
			{
				if (((Vector3)(ref val4)).magnitude >= SlideConfig.MinStartSpeed.Value)
				{
					StartSlide(val4, tripped: false, slip: false);
					slideHeld = flag4 && SlidingCompanyPlugin.SlideMode.Value == "Hold";
				}
			}
			else if (player.isSprinting && player.thisController.isGrounded && player.alreadyOnSlipperyFloor && player.slimeSlipAudio.isPlaying && player.slimeSlipAudio.volume > 0.05f && CanContinueSlide() && flag6)
			{
				val5 = new Vector3(measuredVelocity.x, 0f, measuredVelocity.z);
				if (((Vector3)(ref val5)).magnitude >= SlideConfig.MinStartSpeed.Value && Random.value < SlideConfig.TripChancePerSecond.Value * Time.deltaTime)
				{
					StartSlide(new Vector3(measuredVelocity.x, 0f, measuredVelocity.z), tripped: true, slip: true);
				}
			}
			return;
		}
		bool flag7 = slipped && slideTime < SlideConfig.SlipLockTime.Value;
		if (!CanContinueSlide() || ((flag || flag3 || (slideHeld && !flag4)) && slideTime > SlideConfig.CancelDelay.Value && !isForced && !flag7))
		{
			EndSlide(jumped: false);
			return;
		}
		if (flag2 && !flag7)
		{
			Vector3 val6 = velocity;
			float num3 = ((((Vector3)(ref velocity)).magnitude > SlideConfig.JumpComboSpeed.Value) ? Mathf.InverseLerp(SlideConfig.JumpComboSpeed.Value, SlideConfig.MaxSlideSpeed.Value, ((Vector3)(ref velocity)).magnitude) : 0f);
			EndSlide(jumped: true);
			if (num3 > 0f)
			{
				PlayerControllerB obj = player;
				obj.externalForceAutoFade += val6 * SlideConfig.JumpComboFurther.Value * num3;
				if (jumpBoostEndTime <= 0f)
				{
					savedJumpForce = player.jumpForce;
				}
				player.jumpForce = savedJumpForce * (1f + SlideConfig.JumpComboHigher.Value * num3);
				jumpBoostEndTime = Time.time + SlideConfig.JumpBoostTime.Value;
			}
			if (!player.isJumping)
			{
				player.isJumping = true;
				player.jumpCoroutine = ((MonoBehaviour)player).StartCoroutine(player.PlayerJump());
				player.PlayerJumpedServerRpc();
			}
			else if (player.fallValue > 0f)
			{
				player.fallValue = Mathf.Max(player.fallValue, player.jumpForce);
			}
			return;
		}
		float num4 = Mathf.Min(Time.deltaTime, 0.05f);
		slideTime += num4;
		Vector3 position = ((Component)this).transform.position;
		bool flag8 = Physics.Raycast(position + Vector3.up * 0.4f, Vector3.down, ref groundHit, 1f, groundMask, (QueryTriggerInteraction)1);
		Vector3 val7 = (flag8 ? ((RaycastHit)(ref groundHit)).normal : Vector3.up);
		if (flag8)
		{
			gripFriction = Mathf.Lerp(gripFriction, Grip(SlideConfig.SurfaceFriction), num4 * 6f);
			gripSlope = Mathf.Lerp(gripSlope, Grip(SlideConfig.SurfaceSlopeGain), num4 * 6f);
		}
		airTime = ((flag8 || player.thisController.isGrounded) ? 0f : (airTime + num4));
		if (airTime > SlideConfig.MaxAirTime.Value)
		{
			EndSlide(jumped: false);
			return;
		}
		float num5 = Mathf.Max(0f, (player.carryWeight - 1f) * 105f);
		float num6 = num5 / 50f;
		float num7 = 1f - Mathf.Clamp01(player.sprintMeter / SlideConfig.ExhaustedBelow.Value);
		Vector3 val8 = (flag8 ? GetGroundNormal() : Vector3.up);
		Vector3 val9 = default(Vector3);
		((Vector3)(ref val9))..ctor(val8.x, 0f, val8.z);
		float magnitude = ((Vector3)(ref val9)).magnitude;
		float num8 = 0f;
		if (magnitude > 0.03f)
		{
			num8 = Vector3.Dot(((Vector3)(ref velocity)).normalized, val9 / magnitude);
			if (num8 >= 0f)
			{
				velocity += val9 * SlideConfig.DownhillAcceleration.Value * gripSlope * Mathf.Lerp(1f, SlideConfig.ExhaustedSlopeGain.Value, num7) / (1f + SlideConfig.WeightSlopeLoss.Value * Mathf.Pow(num6, 1.2f)) * (slipped ? SlideConfig.SlipSlopeGain.Value : 1f) * num4;
			}
			else
			{
				velocity += val9 * SlideConfig.UphillDeceleration.Value * (1f + num6 * SlideConfig.WeightUphill.Value) * num4;
			}
		}
		if (Time.time < forcedEndTime)
		{
			velocity += forcedPush * num4;
		}
		float magnitude2 = ((Vector3)(ref velocity)).magnitude;
		float num9 = SlideConfig.MomentumLoss.Value * gripFriction * (1f + SlideConfig.WeightFriction.Value * Mathf.Pow(num6, 1.6f)) * Mathf.Lerp(1f, SlideConfig.ExhaustedFriction.Value, num7) * (slipped ? SlideConfig.SlipDrag.Value : 1f);
		if (num8 > 0.3f && magnitude > 0.08f)
		{
			num9 *= Mathf.Lerp(SlideConfig.DownhillDrag.Value, 1f, Mathf.Clamp01(num6));
		}
		num9 += magnitude2 * SlideConfig.WeightSpeedDrag.Value * num6 + (KeyHeld(SlidingCompanyPlugin.BrakeKey.Value) ? SlideConfig.BrakeStrength.Value : 0f);
		magnitude2 = Mathf.Min(SlideConfig.MaxSlideSpeed.Value / (1f + SlideConfig.WeightSpeedCap.Value * num6), Mathf.Max(0f, magnitude2 - num9 * num4));
		if (isForced)
		{
			magnitude2 = Mathf.Max(magnitude2, num2);
		}
		Vector3 val10 = ((((Vector3)(ref velocity)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref velocity)).normalized : ((Component)this).transform.forward);
		float num10 = InputSystem.actions.FindAction("Move", false).ReadValue<Vector2>().x * ((Time.time < muddyEndTime) ? SlideConfig.MudSteer.Value : 1f);
		if (slipped)
		{
			float num11 = Mathf.InverseLerp(0.6f, 1f, Mathf.PerlinNoise(Time.time * 2.3f, slipSeed + 7f)) * SlideConfig.SlipSteerSpike.Value;
			val10 = Quaternion.Euler(0f, (Mathf.PerlinNoise(Time.time * 1.7f, slipSeed) - 0.5f) * 2f * SlideConfig.SlipWobble.Value * num4 + num10 * SlideConfig.TurnRate.Value * (SlideConfig.SlipSteer.Value + num11) * num4, 0f) * val10;
			player.slipperyForce = Vector3.zero;
			player.slipperyForceLerpTo = Vector3.zero;
		}
		else
		{
			val10 = Quaternion.Euler(0f, num10 * SlideConfig.TurnRate.Value * num4, 0f) * val10;
		}
		if (!slipped)
		{
			float num12 = Vector3.SignedAngle(val10, ((Component)this).transform.forward, Vector3.up);
			if (Mathf.Abs(num12) > SlideConfig.LookAroundDegrees.Value)
			{
				val10 = Quaternion.Euler(0f, num12 - Mathf.Sign(num12) * SlideConfig.LookAroundDegrees.Value, 0f) * val10;
			}
			mouseSpeed = Mathf.Lerp(mouseSpeed, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).delta).ReadValue().x / num4, num4 * 12f);
			float num13 = Mathf.Min((Mathf.Abs(mouseSpeed) - SlideConfig.DriftMouseSpeed.Value) * SlideConfig.DriftStrength.Value, SlideConfig.DriftMaxRate.Value);
			if (num13 > 0f)
			{
				val10 = Quaternion.Euler(0f, Mathf.Sign(mouseSpeed) * num13 * num4, 0f) * val10;
				magnitude2 = Mathf.Max(0f, magnitude2 - magnitude2 * num13 * SlideConfig.DriftSpeedLoss.Value * num4);
			}
			player.cameraUp = Mathf.MoveTowards(player.cameraUp, Mathf.Clamp(player.cameraUp, 0f - SlideConfig.LookUpDownDegrees.Value, SlideConfig.LookUpDownDegrees.Value), 240f * num4);
		}
		velocity = val10 * magnitude2;
		if (magnitude2 < SlideConfig.EndSpeed.Value && slideTime > SlideConfig.MinSlideTime.Value && !isForced)
		{
			EndSlide(jumped: false, SlideConfig.AutoStandUp.Value);
			return;
		}
		if (magnitude2 >= SlideConfig.DoorOpenSpeed.Value)
		{
			RaycastHit[] array = Physics.SphereCastAll(position + Vector3.up * 0.9f, 0.45f, val10, SlideConfig.DoorTriggerDistance.Value + magnitude2 * 0.06f, -1, (QueryTriggerInteraction)2);
			for (int i = 0; i < array.Length; i++)
			{
				RaycastHit val11 = array[i];
				DoorLock componentInParent2 = ((Component)((RaycastHit)(ref val11)).collider).GetComponentInParent<DoorLock>();
				if ((Object)(object)componentInParent2 != (Object)null && OpenDoor(componentInParent2, (((RaycastHit)(ref val11)).point == Vector3.zero) ? ((Component)componentInParent2).transform.position : ((RaycastHit)(ref val11)).point, magnitude2) > 0)
				{
					break;
				}
			}
		}
		string value3 = SlideConfig.PlayerHitMode.Value;
		string value4 = SlideConfig.EnemyHitMode.Value;
		bool flag9 = SlideConfig.AutoStandUp.Value && magnitude2 < SlideConfig.SlowBumpSpeed.Value && !isForced;
		if (value3 != "Off" || flag9)
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val12 in allPlayerScripts)
			{
				Vector3 val13 = ((Component)val12).transform.position - position;
				float num14 = Vector3.Dot(val13, val10);
				Vector3 val14 = val13 - val10 * num14;
				if ((Object)(object)val12 == (Object)(object)player || !val12.isPlayerControlled || val12.isPlayerDead || num14 < 0f || num14 > SlideConfig.PlayerHitReach.Value + magnitude2 * num4)
				{
					continue;
				}
				val5 = new Vector3(val14.x, 0f, val14.z);
				if (((Vector3)(ref val5)).magnitude > SlideConfig.PlayerHitWidth.Value || Mathf.Abs(val13.y) > 1.2f)
				{
					continue;
				}
				AudioClip val15 = StartOfRound.Instance.playerShoveSFX[Random.Range(0, StartOfRound.Instance.playerShoveSFX.Length)];
				player.movementAudio.pitch = 1f;
				if (flag9)
				{
					player.movementAudio.PlayOneShot(val15, 0.55f);
					WalkieTalkie.TransmitOneShotAudio(player.movementAudio, val15, 0.55f);
					player.ShovePlayerRpc(false);
					EndSlide(jumped: false);
					return;
				}
				if (!hitCooldowns.TryGetValue(((Object)val12).GetInstanceID(), out var value5) || !(Time.time - value5 < SlideConfig.HitCooldown.Value))
				{
					hitCooldowns[((Object)val12).GetInstanceID()] = Time.time;
					if (value3 == "Damage" && magnitude2 >= SlideConfig.PlayerHitSpeed.Value)
					{
						val12.DamagePlayerFromOtherClientServerRpc(Mathf.RoundToInt((float)SlideConfig.PlayerHitDamage.Value * Mathf.Lerp(1f, 2f, Mathf.InverseLerp(SlideConfig.PlayerHitSpeed.Value, SlideConfig.MaxSlideSpeed.Value, magnitude2))), val10, (int)player.playerClientId);
					}
					Vector3 val16 = Vector3.Cross(Vector3.up, val10);
					val5 = val16 * ((Vector3.Dot(val13, val16) >= 0f) ? 1f : (-1f)) + val10 * 0.5f;
					Vector3 force = ((Vector3)(ref val5)).normalized * SlideConfig.PlayerKnockbackPower.Value * Mathf.Lerp(0.72f, 1.55f, Mathf.InverseLerp(SlideConfig.SlowBumpSpeed.Value, SlideConfig.MaxSlideSpeed.Value, magnitude2));
					float num15 = Mathf.InverseLerp(SlideConfig.PlayerHitSpeed.Value, SlideConfig.PlayerHitSpeed.Value + 6f, magnitude2);
					force.y = Mathf.Lerp(((Vector3)(ref force)).magnitude * 0.5f, 16f + ((Vector3)(ref force)).magnitude * 0.6f, num15);
					Knockback((int)val12.playerClientId, force);
					player.movementAudio.PlayOneShot(val15, 1f);
					WalkieTalkie.TransmitOneShotAudio(player.movementAudio, val15, 1f);
					player.ShovePlayerRpc(true);
					velocity *= 1f - SlideConfig.HitSpeedLoss.Value;
					bumpVelocity += 0.5f * SlideConfig.ImpactShake.Value;
				}
			}
		}
		if (value4 != "Off" && magnitude2 >= SlideConfig.EnemyHitSpeed.Value)
		{
			int num16 = Physics.OverlapSphereNonAlloc(position + Vector3.up * 0.8f + val10 * 0.55f, 0.75f, hitColliders, -1, (QueryTriggerInteraction)2);
			for (int j = 0; j < num16; j++)
			{
				EnemyAICollisionDetect componentInParent3 = ((Component)hitColliders[j]).GetComponentInParent<EnemyAICollisionDetect>();
				EnemyAI val17 = (((Object)(object)componentInParent3 != (Object)null) ? componentInParent3.mainScript : ((Component)hitColliders[j]).GetComponentInParent<EnemyAI>());
				if (!((Object)(object)val17 == (Object)null) && !val17.isEnemyDead && ((value4 == "Damage") ? val17.enemyType.canDie : val17.enemyType.canBeStunned) && (!hitCooldowns.TryGetValue(((Object)val17).GetInstanceID(), out var value6) || !(Time.time - value6 < SlideConfig.HitCooldown.Value)))
				{
					hitCooldowns[((Object)val17).GetInstanceID()] = Time.time;
					if (value4 == "Damage")
					{
						val17.HitEnemyOnLocalClient(SlideConfig.EnemyHitDamage.Value, val10, player, true, -1);
					}
					else
					{
						val17.SetEnemyStunned(true, SlideConfig.EnemyStunSeconds.Value, player);
						SendStun(((NetworkBehaviour)val17).NetworkObjectId, (int)player.playerClientId);
					}
					velocity *= 1f - SlideConfig.HitSpeedLoss.Value;
					bumpVelocity += 0.7f * SlideConfig.ImpactShake.Value;
				}
			}
		}
		CollisionFlags val18 = player.thisController.Move(Vector3.ProjectOnPlane(velocity, val7) * num4 + Vector3.down * 2f * num4);
		Vector3 val19 = ((Component)this).transform.position - position;
		float num17 = magnitude2 * num4;
		RaycastHit val20 = default(RaycastHit);
		bool flag10 = Physics.SphereCast(position + Vector3.up * 0.6f, 0.25f, val10, ref val20, 0.45f + num17, groundMask, (QueryTriggerInteraction)1);
		if (flag10)
		{
			goto IL_1730;
		}
		if ((val18 & 1) != 0 && num17 > 0.001f)
		{
			val5 = new Vector3(val19.x, 0f, val19.z);
			if (((Vector3)(ref val5)).magnitude < num17 * 0.35f)
			{
				goto IL_1730;
			}
		}
		goto IL_1c7c;
		IL_1730:
		Vector3 val21 = (Vector3)(flag10 ? new Vector3(((RaycastHit)(ref val20)).normal.x, 0f, ((RaycastHit)(ref val20)).normal.z) : (-val10));
		val21 = ((((Vector3)(ref val21)).sqrMagnitude >= 0.01f) ? ((Vector3)(ref val21)).normalized : Vector3.zero);
		Vector3 val22 = (flag10 ? ((RaycastHit)(ref val20)).point : (position + Vector3.up * 0.6f + val10 * 0.4f));
		float num18 = ((val21 != Vector3.zero) ? Mathf.Clamp01(Vector3.Dot(val10, -val21)) : 1f);
		float num19 = magnitude2 * num18;
		if (!flag10)
		{
			Physics.SphereCast(position + Vector3.up * 0.6f, 0.3f, val10, ref val20, 1.2f, groundMask, (QueryTriggerInteraction)1);
		}
		DoorLock val23 = (((Object)(object)((RaycastHit)(ref val20)).collider != (Object)null) ? ((Component)((RaycastHit)(ref val20)).collider).GetComponentInParent<DoorLock>() : null);
		if ((Object)(object)val23 == (Object)null && (Object)(object)((RaycastHit)(ref val20)).collider != (Object)null && (Object)(object)((Component)((RaycastHit)(ref val20)).collider).transform.parent != (Object)null)
		{
			val23 = ((Component)((Component)((RaycastHit)(ref val20)).collider).transform.parent).GetComponentInChildren<DoorLock>();
		}
		if ((Object)(object)val23 == (Object)null)
		{
			if (Time.time - timeAtFindingDoors > 5f)
			{
				allDoors = Object.FindObjectsOfType<DoorLock>();
				timeAtFindingDoors = Time.time;
			}
			float num20 = 2.2f;
			DoorLock[] array2 = allDoors;
			foreach (DoorLock val24 in array2)
			{
				if ((Object)(object)val24 != (Object)null && Vector3.Distance(((Component)val24).transform.position, val22) < num20)
				{
					num20 = Vector3.Distance(((Component)val24).transform.position, val22);
					val23 = val24;
				}
			}
		}
		int num21 = (((Object)(object)val23 != (Object)null) ? OpenDoor(val23, val22, num19) : 0);
		float num22 = Mathf.Acos(num18) * 57.29578f;
		float num23 = 0f;
		if (num21 == 1)
		{
			velocity *= 1f - SlideConfig.DoorOpenSpeedLoss.Value;
			bumpVelocity += 0.2f * SlideConfig.ImpactShake.Value;
		}
		else if (num21 == 0 && num19 >= SlideConfig.TreeBreakSpeed.Value && num5 >= SlideConfig.TreeBreakMinWeight.Value && (RoundManager.Instance.DestroyTreeAtPosition(val22, 1.3f) || RoundManager.Instance.DestroyTreeAtPosition(val22 - Vector3.up * 0.6f, 1.6f)))
		{
			RoundManager.Instance.BreakTreeServerRpc(val22, (int)player.playerClientId);
			velocity *= 1f - SlideConfig.TreeSpeedLoss.Value;
			bumpVelocity += 0.9f * SlideConfig.ImpactShake.Value;
			num23 = Mathf.Min(num19, SlideConfig.LightHitSpeed.Value);
		}
		else if (num21 == 0 && SlideConfig.BounceEnabled.Value && val21 != Vector3.zero && num22 >= SlideConfig.BounceMinAngle.Value && magnitude2 <= SlideConfig.BounceMaxSpeed.Value)
		{
			velocity = Vector3.Reflect(val10, val21) * magnitude2 * Mathf.Lerp(SlideConfig.BounceKeepSteep.Value, SlideConfig.BounceKeepGlancing.Value, Mathf.InverseLerp(SlideConfig.BounceMinAngle.Value, 90f, num22));
			player.thisController.Move(val21 * 0.06f);
			bumpVelocity += Mathf.Lerp(0.15f, 0.6f, num18) * SlideConfig.ImpactShake.Value;
			slideSFXAudio.PlayOneShot(dragFootSFX[Random.Range(0, dragFootSFX.Length)], 0.5f * SlidingCompanyPlugin.SlideVolume.Value);
		}
		else if (num21 == 0)
		{
			bumpVelocity += Mathf.Clamp(num19 * 0.12f, 0.2f, 2.2f) * SlideConfig.ImpactShake.Value;
			num23 = num19;
			lastSlideHitWall = true;
		}
		float num24 = Mathf.Max(SlideConfig.DamageStartSpeed.Value, SlideConfig.DamageVsRunSpeed.Value * RunSpeed());
		float num25 = num24 + Mathf.Max(1f, SlideConfig.LightHitSpeed.Value - SlideConfig.DamageStartSpeed.Value);
		if (num23 >= num24)
		{
			float num26 = ((num23 < num25) ? Mathf.Lerp(SlideConfig.LightHitMinDamage.Value, SlideConfig.LightHitMaxDamage.Value, Mathf.InverseLerp(num24, num25, num23)) : Mathf.LerpUnclamped(SlideConfig.LightHitMaxDamage.Value, SlideConfig.UltraHitDamage.Value, (num23 - num25) / (Mathf.Max(SlideConfig.UltraHitSpeed.Value, num25 + 2f) - num25)));
			HurtSelf(Mathf.RoundToInt(num26));
		}
		if (lastSlideHitWall)
		{
			EndSlide(jumped: false);
			return;
		}
		goto IL_1c7c;
		IL_1c7c:
		player.sprintMeter = Mathf.Clamp01(player.sprintMeter - num4 * SlideConfig.StaminaDrain.Value * (1f + num5 / 100f * SlideConfig.WeightStamina.Value));
	}

	private void HurtSelf(int damage)
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		damage = Mathf.Min(damage, player.health - SlideConfig.MinHealthLeft.Value);
		if (damage > 0 && !player.isPlayerDead)
		{
			player.DamagePlayer(damage, true, true, (CauseOfDeath)16, 0, false, default(Vector3));
		}
	}

	private void StartSlide(Vector3 startVelocity, bool tripped, bool slip)
	{
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		sliding = true;
		slipped = slip;
		slideTime = 0f;
		airTime = 0f;
		lastSlideStartTime = Time.time;
		CheckGround(out var grounded);
		if (grounded)
		{
			gripFriction = Grip(SlideConfig.SurfaceFriction);
			gripSlope = Grip(SlideConfig.SurfaceSlopeGain);
			gripEntry = Grip(SlideConfig.SurfaceEntrySpeed);
		}
		float num = (slip ? SlideConfig.MaxSlideSpeed.Value : Mathf.Min(SlideConfig.MaxSlideSpeed.Value, RunSpeed() * SlideConfig.EntrySpeedCap.Value + 1f));
		velocity = Vector3.ClampMagnitude(startVelocity, num) * (tripped ? 1f : (SlideConfig.EntryBoost.Value * gripEntry));
		if (slip)
		{
			slipSeed = Random.value * 100f;
			player.slipperyForce = Vector3.zero;
			player.slipperyForceLerpTo = Vector3.zero;
		}
		if (!tripped)
		{
			player.sprintMeter = Mathf.Clamp01(player.sprintMeter - SlideConfig.StaminaStartCost.Value);
		}
		if (!player.disableMoveInput)
		{
			player.disableMoveInput = true;
			moveInputLocked = true;
		}
		if (!player.isCrouching)
		{
			player.Crouch(true);
		}
		PlayerSlide.SlideStarted?.Invoke(player);
	}

	private void EndSlide(bool jumped, bool standUp = true)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: 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)
		sliding = false;
		slipped = false;
		slideHeld = false;
		lastSlideEndedWithJump = jumped;
		if (moveInputLocked)
		{
			player.disableMoveInput = false;
			moveInputLocked = false;
		}
		if (jumped)
		{
			PlayerControllerB obj = player;
			obj.externalForceAutoFade += velocity * SlideConfig.JumpCarry.Value;
		}
		if (standUp)
		{
			standUpEndTime = Time.time + 0.8f;
			if (player.isCrouching)
			{
				player.Crouch(false);
			}
		}