Decompiled source of ReindogAndFriends v2.2.8

ReindogFan1372.ReindogDLL.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using ReindogFan1372.ReindogDLL.NetcodePatcher;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("LethalLevelLoader")]
[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.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("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("ReindogFan1372.ReindogDLL")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyInformationalVersion("1.1.2")]
[assembly: AssemblyProduct("ReindogDLL")]
[assembly: AssemblyTitle("ReindogFan1372.ReindogDLL")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.2.0")]
[module: UnverifiableCode]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ReindogDLL
{
	[BepInPlugin("ReindogFan1372.ReindogDLL", "ReindogDLL", "1.1.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ReindogDLL : BaseUnityPlugin
	{
		internal static AssetBundle MyCustomAssets;

		internal static Texture2D fosgreathTexture;

		internal static AudioClip fosgreathClip;

		public static Dictionary<string, LevelMatchingProperties> LevelMatchingPropertiesByName = new Dictionary<string, LevelMatchingProperties>();

		public static ReindogDLL Instance { get; private set; } = null;


		internal static ManualLogSource Logger { get; private set; } = null;


		internal static Harmony? Harmony { get; set; }

		internal static MyModConfig ReindogAndFriendsModConfig { get; private set; } = null;


		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			ReindogAndFriendsModConfig = new MyModConfig(((BaseUnityPlugin)this).Config);
			AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)OnExtendedModRegistered, "ReindogFan1372", "ReindogAndFriends");
			NetcodePatcher();
			Patch();
			Logger.LogInfo((object)"ReindogAndFriends has loaded!                                                                 \r\n                                                                 \r\n                       =--.                                      \r\n                       **+=-                                     \r\n                           +=:                                   \r\n         .                  -=:                                  \r\n         -+             -=  -=+                                  \r\n        .=*             ===.-+#                                  \r\n        -*    .          :--+#.                                  \r\n        ==                =+#.                                   \r\n        =.=              -+#                                     \r\n        =:=             .+#                                      \r\n        --+     .       +#.   .--.                               \r\n        --=            =*=    -*+-:                              \r\n         -:.           +#    -*-:.=                              \r\n          --.        .:**#=::+*::=-                              \r\n           --:       :=*===++++*                                 \r\n            -==     :::---==+--                                  \r\n             ++..  .::--=++=+=-:                                 \r\n          .-: .... ::--=+++++++-::..+                            \r\n          **. .:::::--=#+*++=====--+.-                           \r\n          -:.:----:---=*%*:::---===::-                           \r\n          ==.-===-----=+=::--++=====*                            \r\n            .--=#-:...:::--=+**+===*=                            \r\n            .-:=%- ------=++****+++*                             \r\n            ..... =###+++++*-.*+***:                             \r\n            ......=##*+****:..-*=*-                              \r\n           .::=--:-=#*+**:..::-**:.                              \r\n          .--=++++===+**..::-:-#%#:..                            \r\n         .=-=+:....+**=...:---=##*-..                            \r\n            :+-..........::-=+#*#---:                            \r\n            .==-:::......-:=****--:.                             \r\n             -.=--::..:-:-=**+=:--.                              \r\n             - .*==-:::--***+:.:--..                             \r\n           . -  :**-:::-+**-...---.:                             \r\n            -:  ..:*:::+++.....--:.:.                            \r\n               ....==:=*=.....---:.:..                           \r\n               .....::*......::--::-::.                          \r\n              .......+......------:-:::.                         \r\n              :............:------:---=..                        \r\n              ............:------------.:.                       \r\n              ..........::---------:-=:--:.                      \r\n             ..........:::--------=:=-:=--.                      \r\n             ::.-:....:-:---------=---=----:                     \r\n             --::+.:=:=::-::------=---:....:                     \r\n             --::-.:--::::--------=-=-----...                    \r\n            .:-:::-+::::::------==+-=-----:..                    \r\n            .:-=-::-::::..-----===+=-------:.                    \r\n           ..:-=-:-:::- :-.----=++++:-------..                   \r\n           .:--++-----:..:-:--==+*---:---==+::                   \r\n          .::-==#+---= ...---===+*=.::--==++=.        .....      \r\n         .::-===*%+=== -:::====+*=+++:-===++=.   ....:::::::     \r\n         ::--==++##:=.:--::====++++*++:==+*+++...::----::::..    \r\n         ::-==++*#:   --=-:===+#+*##*+-++*#*+**++===+-:----:.    \r\n        .:--=++*#:   ---==:==+**+*##*+-**#**%##*****-----==-=.   \r\n        -:-==+*#:   .===+===++:++*#*+++*#%%    .-*#+======+**    \r\n       =--==+*#.     ---==+++* +++**+=*:           =++++++*#     \r\n       .=+-+#-       -=-==++#  *+*+++*             :#*####       \r\n         :          .--===*#   *+++*                             \r\n                    :#:++==      .                               \r\n                      :                                                \r\n");
		}

		internal static void OnExtendedModRegistered(ExtendedMod myMod)
		{
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Expected O, but got Unknown
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Expected O, but got Unknown
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Expected O, but got Unknown
			if ((Object)(object)myMod == (Object)null)
			{
				return;
			}
			LoadNeededAssets();
			foreach (ExtendedItem extendedItem in myMod.ExtendedItems)
			{
				if (extendedItem.Item.itemName == "Holding Pen")
				{
					extendedItem.Item.creditsWorth = ReindogAndFriendsModConfig.holdingPenCost.Value;
					continue;
				}
				int configValueForItem = GetConfigValueForItem(extendedItem.Item.itemName);
				((MatchingProperties)extendedItem.LevelMatchingProperties).modNames.Clear();
				((MatchingProperties)extendedItem.LevelMatchingProperties).modNames.TrimExcess();
				((MatchingProperties)extendedItem.LevelMatchingProperties).authorNames.Clear();
				((MatchingProperties)extendedItem.LevelMatchingProperties).authorNames.TrimExcess();
				extendedItem.LevelMatchingProperties.levelTags.Clear();
				extendedItem.LevelMatchingProperties.levelTags.TrimExcess();
				extendedItem.LevelMatchingProperties.currentRoutePrice.Clear();
				extendedItem.LevelMatchingProperties.currentRoutePrice.TrimExcess();
				extendedItem.LevelMatchingProperties.currentWeather.Clear();
				extendedItem.LevelMatchingProperties.currentWeather.TrimExcess();
				extendedItem.LevelMatchingProperties.planetNames.Clear();
				extendedItem.LevelMatchingProperties.planetNames.TrimExcess();
				StringWithRarity item = new StringWithRarity("Vanilla", configValueForItem);
				StringWithRarity item2 = new StringWithRarity("Custom", configValueForItem);
				LevelMatchingPropertiesByName.Add(extendedItem.Item.itemName, extendedItem.LevelMatchingProperties);
				if (configValueForItem > 0)
				{
					extendedItem.LevelMatchingProperties.levelTags.Add(item2);
					extendedItem.LevelMatchingProperties.levelTags.Add(item);
					LevelMatchingPropertiesByName[extendedItem.Item.itemName] = extendedItem.LevelMatchingProperties;
				}
			}
			foreach (ExtendedEnemyType extendedEnemyType in myMod.ExtendedEnemyTypes)
			{
				if (extendedEnemyType.EnemyType.enemyName == "Mario")
				{
					((MatchingProperties)extendedEnemyType.InsideLevelMatchingProperties).modNames.Clear();
					((MatchingProperties)extendedEnemyType.InsideLevelMatchingProperties).modNames.TrimExcess();
					((MatchingProperties)extendedEnemyType.InsideLevelMatchingProperties).authorNames.Clear();
					((MatchingProperties)extendedEnemyType.InsideLevelMatchingProperties).authorNames.TrimExcess();
					extendedEnemyType.InsideLevelMatchingProperties.levelTags.Clear();
					extendedEnemyType.InsideLevelMatchingProperties.levelTags.TrimExcess();
					extendedEnemyType.InsideLevelMatchingProperties.currentRoutePrice.Clear();
					extendedEnemyType.InsideLevelMatchingProperties.currentRoutePrice.TrimExcess();
					extendedEnemyType.InsideLevelMatchingProperties.currentWeather.Clear();
					extendedEnemyType.InsideLevelMatchingProperties.currentWeather.TrimExcess();
					extendedEnemyType.InsideLevelMatchingProperties.planetNames.Clear();
					extendedEnemyType.InsideLevelMatchingProperties.planetNames.TrimExcess();
					int value = ReindogAndFriendsModConfig.marioRarity.Value;
					StringWithRarity item3 = new StringWithRarity("Vanilla", value);
					StringWithRarity item4 = new StringWithRarity("Custom", value);
					LevelMatchingPropertiesByName.Add(extendedEnemyType.EnemyType.enemyName, extendedEnemyType.InsideLevelMatchingProperties);
					if (value > 0)
					{
						extendedEnemyType.InsideLevelMatchingProperties.levelTags.Add(item4);
						extendedEnemyType.InsideLevelMatchingProperties.levelTags.Add(item3);
						extendedEnemyType.EnemyType.MaxCount = ReindogAndFriendsModConfig.marioMaxCount.Value;
						extendedEnemyType.EnemyType.PowerLevel = ReindogAndFriendsModConfig.marioPowerLevel.Value;
						LevelMatchingPropertiesByName[extendedEnemyType.EnemyType.enemyName] = extendedEnemyType.InsideLevelMatchingProperties;
					}
				}
			}
		}

		internal static void LoadNeededAssets()
		{
			if (ReindogAndFriendsModConfig.maximumFosgreathModeEnabled.Value)
			{
				fosgreathTexture = AssetBundleLoader.assetBundles["reindogandfriends.lethalbundle"].LoadAsset<Texture2D>("assets/lethalcompany/mods/reindogandfriends/items/fosgreath/data/texturegreath.jpg");
				fosgreathClip = AssetBundleLoader.assetBundles["reindogandfriends.lethalbundle"].LoadAsset<AudioClip>("assets/lethalcompany/mods/reindogandfriends/audio/clipgreath.ogg");
			}
		}

		private static int GetConfigValueForItem(string itemName)
		{
			switch (itemName)
			{
			case "Bober Kurwa":
				return ReindogAndFriendsModConfig.boberKurwaSpawnRate.Value;
			case "Mini Nuke":
				return ReindogAndFriendsModConfig.miniNukeSpawnRate.Value;
			case "Broda":
				return ReindogAndFriendsModConfig.brodaSpawnRate.Value;
			case "Chris Griffin":
				return ReindogAndFriendsModConfig.chrisGriffinSpawnRate.Value;
			case "Cid":
				return ReindogAndFriendsModConfig.cidSpawnRate.Value;
			case "Clyde":
				return ReindogAndFriendsModConfig.cidSpawnRate.Value;
			case "Crawly":
				return ReindogAndFriendsModConfig.crawlySpawnRate.Value;
			case "Deku":
				return ReindogAndFriendsModConfig.dekuSpawnRate.Value;
			case "Fosgreath":
				return ReindogAndFriendsModConfig.fosgreathSpawnRate.Value;
			case "Frieza":
				return ReindogAndFriendsModConfig.friezaSpawnRate.Value;
			case "Golden Reindog":
				return ReindogAndFriendsModConfig.goldenReindogSpawnRate.Value;
			case "Hamster":
				return ReindogAndFriendsModConfig.hamsterSpawnRate.Value;
			case "Iron Giant":
				return ReindogAndFriendsModConfig.ironGiantSpawnRate.Value;
			case "Lebron":
				return ReindogAndFriendsModConfig.lebronSpawnRate.Value;
			case "Lightning McQueen":
				return ReindogAndFriendsModConfig.lightningMcqueenSpawnRate.Value;
			case "Monkey Cube":
				return ReindogAndFriendsModConfig.monkeyCubeSpawnRate.Value;
			case "Nerd":
				return ReindogAndFriendsModConfig.nerdSpawnRate.Value;
			case "Optimus Prime":
				return ReindogAndFriendsModConfig.optimusPrimeSpawnRate.Value;
			case "Rat":
				return ReindogAndFriendsModConfig.ratSpawnRate.Value;
			case "Reindog":
				return ReindogAndFriendsModConfig.reindogSpawnRate.Value;
			case "Saul Bigman":
				return ReindogAndFriendsModConfig.saulBigmanSpawnRate.Value;
			case "Saul Goodman":
				return ReindogAndFriendsModConfig.saulGoodmanSpawnRate.Value;
			case "Sonic":
				return ReindogAndFriendsModConfig.sonicSpawnRate.Value;
			case "Superman":
				return ReindogAndFriendsModConfig.supermanSpawnRate.Value;
			case "Swag Baby":
				return ReindogAndFriendsModConfig.babySpawnRate.Value;
			case "Rayman":
				return ReindogAndFriendsModConfig.raymanSpawnRate.Value;
			case "Shadow":
				return ReindogAndFriendsModConfig.shadowSpawnRate.Value;
			case "Remy":
				return ReindogAndFriendsModConfig.remySpawnRate.Value;
			case "Fan":
				return ReindogAndFriendsModConfig.fanSpawnRate.Value;
			case "Knuckles":
				return ReindogAndFriendsModConfig.knucklesSpawnRate.Value;
			case "1-Up Mushroom":
				return ReindogAndFriendsModConfig.mushroomSpawnRate.Value;
			default:
				Logger.LogInfo((object)("No configuration found for item type: " + itemName));
				return 30;
			}
		}

		public static float GetVolumeConfig(string itemName)
		{
			return itemName switch
			{
				"Sonic" => ReindogAndFriendsModConfig.sonicVolume.Value, 
				"Crawly" => ReindogAndFriendsModConfig.crawlyVolume.Value, 
				"Deku" => ReindogAndFriendsModConfig.dekuVolume.Value, 
				"Rayman" => ReindogAndFriendsModConfig.raymanVolume.Value, 
				"Shadow" => ReindogAndFriendsModConfig.shadowVolume.Value, 
				"Remy" => ReindogAndFriendsModConfig.remyVolume.Value, 
				"Knuckles" => ReindogAndFriendsModConfig.knucklesVolume.Value, 
				"1-Up Mushroom" => ReindogAndFriendsModConfig.mushroomVolume.Value, 
				_ => 1f, 
			};
		}

		public static float GetSpeedConfig(string itemName)
		{
			return itemName switch
			{
				"Sonic" => ReindogAndFriendsModConfig.sonicSpeed.Value, 
				"Crawly" => ReindogAndFriendsModConfig.crawlySpeed.Value, 
				"Deku" => ReindogAndFriendsModConfig.dekuSpeed.Value, 
				"Rayman" => ReindogAndFriendsModConfig.raymanSpeed.Value, 
				"Shadow" => ReindogAndFriendsModConfig.shadowSpeed.Value, 
				"Remy" => ReindogAndFriendsModConfig.remySpeed.Value, 
				"Knuckles" => ReindogAndFriendsModConfig.knucklesSpeed.Value, 
				"1-Up Mushroom" => ReindogAndFriendsModConfig.mushroomSpeed.Value, 
				_ => 5f, 
			};
		}

		public static int GetRoamChanceConfig(string itemName)
		{
			return itemName switch
			{
				"Sonic" => ReindogAndFriendsModConfig.sonicRoamChance.Value, 
				"Crawly" => ReindogAndFriendsModConfig.crawlyRoamChance.Value, 
				"Deku" => ReindogAndFriendsModConfig.dekuRoamChance.Value, 
				"Rayman" => ReindogAndFriendsModConfig.raymanRoamChance.Value, 
				"Shadow" => ReindogAndFriendsModConfig.shadowRoamChance.Value, 
				"Remy" => ReindogAndFriendsModConfig.remyRoamChance.Value, 
				"Knuckles" => ReindogAndFriendsModConfig.knucklesRoamChance.Value, 
				"1-Up Mushroom" => ReindogAndFriendsModConfig.mushroomRoamChance.Value, 
				_ => 100, 
			};
		}

		public static float GetMaxHearableDistanceConfig(string itemName)
		{
			return itemName switch
			{
				"Sonic" => ReindogAndFriendsModConfig.sonicHearableDist.Value, 
				"Crawly" => ReindogAndFriendsModConfig.crawlyHearableDist.Value, 
				"Deku" => ReindogAndFriendsModConfig.dekuHearableDist.Value, 
				"Rayman" => ReindogAndFriendsModConfig.raymanHearableDist.Value, 
				"Shadow" => ReindogAndFriendsModConfig.shadowHearableDist.Value, 
				"Remy" => ReindogAndFriendsModConfig.remyHearableDist.Value, 
				"Knuckles" => ReindogAndFriendsModConfig.knucklesHearableDist.Value, 
				"1-Up Mushroom" => ReindogAndFriendsModConfig.mushroomHearableDist.Value, 
				_ => 40f, 
			};
		}

		public static int GetMusicMode(string itemName)
		{
			if (!(itemName == "Crawly"))
			{
				if (itemName == "Knuckles")
				{
					return ReindogAndFriendsModConfig.knucklesMusicMode.Value;
				}
				return -1;
			}
			return ReindogAndFriendsModConfig.crawlyMusicMode.Value;
		}

		internal static void Patch()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("ReindogFan1372.ReindogDLL");
			}
			Logger.LogDebug((object)"Patching...");
			Harmony.PatchAll();
			Logger.LogDebug((object)"Finished patching!");
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Logger.LogDebug((object)"Finished unpatching!");
		}

		private static void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	internal class MyModConfig
	{
		public readonly ConfigEntry<int> boberKurwaSpawnRate;

		public readonly ConfigEntry<int> miniNukeSpawnRate;

		public readonly ConfigEntry<int> miniNukeExplodeChance;

		public readonly ConfigEntry<float> timeBetweenBombActivationChecksMax;

		public readonly ConfigEntry<float> nukeDetonationTime;

		public readonly ConfigEntry<int> brodaSpawnRate;

		public readonly ConfigEntry<int> chrisGriffinSpawnRate;

		public readonly ConfigEntry<int> cidSpawnRate;

		public readonly ConfigEntry<int> clydeSpawnRate;

		public readonly ConfigEntry<int> crawlySpawnRate;

		public readonly ConfigEntry<float> crawlyVolume;

		public readonly ConfigEntry<int> crawlyMusicMode;

		public readonly ConfigEntry<float> crawlySpeed;

		public readonly ConfigEntry<int> crawlyRoamChance;

		public readonly ConfigEntry<float> crawlyHearableDist;

		public readonly ConfigEntry<int> dekuSpawnRate;

		public readonly ConfigEntry<float> dekuVolume;

		public readonly ConfigEntry<float> dekuSpeed;

		public readonly ConfigEntry<int> dekuRoamChance;

		public readonly ConfigEntry<float> dekuHearableDist;

		public readonly ConfigEntry<int> fosgreathSpawnRate;

		public readonly ConfigEntry<int> friezaSpawnRate;

		public readonly ConfigEntry<int> goldenReindogSpawnRate;

		public readonly ConfigEntry<int> hamsterSpawnRate;

		public readonly ConfigEntry<int> ironGiantSpawnRate;

		public readonly ConfigEntry<int> lebronSpawnRate;

		public readonly ConfigEntry<int> lightningMcqueenSpawnRate;

		public readonly ConfigEntry<int> monkeyCubeSpawnRate;

		public readonly ConfigEntry<int> nerdSpawnRate;

		public readonly ConfigEntry<int> optimusPrimeSpawnRate;

		public readonly ConfigEntry<int> ratSpawnRate;

		public readonly ConfigEntry<int> reindogSpawnRate;

		public readonly ConfigEntry<int> saulBigmanSpawnRate;

		public readonly ConfigEntry<int> saulGoodmanSpawnRate;

		public readonly ConfigEntry<int> sonicSpawnRate;

		public readonly ConfigEntry<float> sonicVolume;

		public readonly ConfigEntry<float> sonicSpeed;

		public readonly ConfigEntry<int> sonicRoamChance;

		public readonly ConfigEntry<float> sonicHearableDist;

		public readonly ConfigEntry<int> supermanSpawnRate;

		public readonly ConfigEntry<int> babySpawnRate;

		public readonly ConfigEntry<int> fanSpawnRate;

		public readonly ConfigEntry<float> fanVolume;

		public readonly ConfigEntry<float> fanBlowForceMin;

		public readonly ConfigEntry<float> fanBlowForceMax;

		public readonly ConfigEntry<float> fanBlowDist;

		public readonly ConfigEntry<int> fanActivationChance;

		public readonly ConfigEntry<float> fanActivationMaxInterval;

		public readonly ConfigEntry<int> raymanSpawnRate;

		public readonly ConfigEntry<float> raymanVolume;

		public readonly ConfigEntry<float> raymanSpeed;

		public readonly ConfigEntry<int> raymanRoamChance;

		public readonly ConfigEntry<float> raymanHearableDist;

		public readonly ConfigEntry<int> shadowSpawnRate;

		public readonly ConfigEntry<float> shadowVolume;

		public readonly ConfigEntry<float> shadowSpeed;

		public readonly ConfigEntry<int> shadowRoamChance;

		public readonly ConfigEntry<float> shadowHearableDist;

		public readonly ConfigEntry<int> knucklesSpawnRate;

		public readonly ConfigEntry<float> knucklesVolume;

		public readonly ConfigEntry<float> knucklesSpeed;

		public readonly ConfigEntry<int> knucklesRoamChance;

		public readonly ConfigEntry<float> knucklesHearableDist;

		public readonly ConfigEntry<int> knucklesMusicMode;

		public readonly ConfigEntry<int> remySpawnRate;

		public readonly ConfigEntry<float> remyVolume;

		public readonly ConfigEntry<float> remySpeed;

		public readonly ConfigEntry<int> remyRoamChance;

		public readonly ConfigEntry<float> remyHearableDist;

		public readonly ConfigEntry<bool> maximumFosgreathModeEnabled;

		public readonly ConfigEntry<string> dekuExplodeTargetPlayerName;

		public readonly ConfigEntry<int> holdingPenCost;

		public readonly ConfigEntry<bool> quicktimeEventsToggle;

		public readonly ConfigEntry<float> quicktimeEventsDropRate;

		public readonly ConfigEntry<float> quicktimeEventsIncreaseRate;

		public readonly ConfigEntry<int> quicktimeEventChance;

		public readonly ConfigEntry<float> quicktimeEventIntervalMax;

		public readonly ConfigEntry<float> quicktimeEventIntervalMin;

		public readonly ConfigEntry<int> marioRarity;

		public readonly ConfigEntry<int> marioHealth;

		public readonly ConfigEntry<float> marioSearchSpeed;

		public readonly ConfigEntry<float> marioChaseSpeed;

		public readonly ConfigEntry<float> marioChaseMusicVolume;

		public readonly ConfigEntry<int> marioDamagePerHit;

		public readonly ConfigEntry<int> mushroomSpawnRate;

		public readonly ConfigEntry<float> mushroomVolume;

		public readonly ConfigEntry<float> mushroomSpeed;

		public readonly ConfigEntry<int> mushroomRoamChance;

		public readonly ConfigEntry<float> mushroomHearableDist;

		public readonly ConfigEntry<int> marioMaxHearableDistSfx;

		public readonly ConfigEntry<int> marioMaxHearableDistChaseMusic;

		public readonly ConfigEntry<int> marioMaxCount;

		public readonly ConfigEntry<int> marioPowerLevel;

		public readonly ConfigEntry<int> minNumOfMushroomsToSpawn;

		public readonly ConfigEntry<int> maxNumOfMushroomsToSpawn;

		public MyModConfig(ConfigFile cfg)
		{
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Expected O, but got Unknown
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Expected O, but got Unknown
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Expected O, but got Unknown
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Expected O, but got Unknown
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Expected O, but got Unknown
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Expected O, but got Unknown
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Expected O, but got Unknown
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Expected O, but got Unknown
			//IL_057f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Expected O, but got Unknown
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Expected O, but got Unknown
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Expected O, but got Unknown
			//IL_0716: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Expected O, but got Unknown
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Expected O, but got Unknown
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Expected O, but got Unknown
			//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Expected O, but got Unknown
			//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dc: Expected O, but got Unknown
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_080b: Expected O, but got Unknown
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Expected O, but got Unknown
			//IL_0a70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7a: Expected O, but got Unknown
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b05: Expected O, but got Unknown
			//IL_0b6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b77: Expected O, but got Unknown
			//IL_0ba6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb0: Expected O, but got Unknown
			//IL_0bdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be9: Expected O, but got Unknown
			//IL_0c18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c22: Expected O, but got Unknown
			//IL_0c47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Expected O, but got Unknown
			//IL_0c76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c80: Expected O, but got Unknown
			//IL_0ca5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0caf: Expected O, but got Unknown
			//IL_0cd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdc: Expected O, but got Unknown
			//IL_0cff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d09: Expected O, but got Unknown
			//IL_0d2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d37: Expected O, but got Unknown
			//IL_0d65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6f: Expected O, but got Unknown
			//IL_0d93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9d: Expected O, but got Unknown
			cfg.SaveOnConfigSet = false;
			boberKurwaSpawnRate = cfg.Bind<int>("Bober Kurwa", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			miniNukeSpawnRate = cfg.Bind<int>("Mini Nuke", "Item Weighting", 12, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			brodaSpawnRate = cfg.Bind<int>("Broda", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			chrisGriffinSpawnRate = cfg.Bind<int>("Chris Griffin", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			cidSpawnRate = cfg.Bind<int>("Cid", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			clydeSpawnRate = cfg.Bind<int>("Clyde", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			crawlySpawnRate = cfg.Bind<int>("Crawly The Wizard", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			dekuSpawnRate = cfg.Bind<int>("Deku", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			fosgreathSpawnRate = cfg.Bind<int>("Fosgreath", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			friezaSpawnRate = cfg.Bind<int>("Frieza", "Item Weighting", 35, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			goldenReindogSpawnRate = cfg.Bind<int>("GoldenReindog", "Item Weighting", 7, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			hamsterSpawnRate = cfg.Bind<int>("Hamster", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			ironGiantSpawnRate = cfg.Bind<int>("Iron Giant", "Item Weighting", 12, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			lebronSpawnRate = cfg.Bind<int>("LeBron", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			lightningMcqueenSpawnRate = cfg.Bind<int>("Lightning McQueen", "Item Weighting", 12, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			monkeyCubeSpawnRate = cfg.Bind<int>("Monkey Cube", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			nerdSpawnRate = cfg.Bind<int>("Nerd", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			optimusPrimeSpawnRate = cfg.Bind<int>("Optimus Prime", "Item Weighting (Default 30)", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			ratSpawnRate = cfg.Bind<int>("Rat", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			reindogSpawnRate = cfg.Bind<int>("Reindog", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			saulBigmanSpawnRate = cfg.Bind<int>("Saul Bigman", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			saulGoodmanSpawnRate = cfg.Bind<int>("Saul Goodman", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			sonicSpawnRate = cfg.Bind<int>("Sonic", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			supermanSpawnRate = cfg.Bind<int>("Superman", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			babySpawnRate = cfg.Bind<int>("Baby", "Item Weighting", 30, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			raymanSpawnRate = cfg.Bind<int>("Rayman", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			shadowSpawnRate = cfg.Bind<int>("Shadow", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			remySpawnRate = cfg.Bind<int>("Remy", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			fanSpawnRate = cfg.Bind<int>("Fan", "Item Weighting", 25, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			knucklesSpawnRate = cfg.Bind<int>("Knuckles", "Item Weighting", 20, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			marioRarity = cfg.Bind<int>("Mario", "Spawn Weighting", 220, new ConfigDescription("How likely this enemy is to spawn over others", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 9999), Array.Empty<object>()));
			mushroomSpawnRate = cfg.Bind<int>("Mushroom", "Item Weighting", 0, "Rarity of the item, 30-40 is roughly normal vanilla weighting for standard scrap");
			crawlyVolume = cfg.Bind<float>("Crawly The Wizard", "Roaming Audio Volume (Default 0.25)", 0.28f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			sonicVolume = cfg.Bind<float>("Sonic", "Roaming Audio Volume (Default 0.5)", 0.5f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			dekuVolume = cfg.Bind<float>("Deku", "Roaming Audio Volume (Default 0.9)", 0.9f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			raymanVolume = cfg.Bind<float>("Rayman", "Roaming Audio Volume (Default 0.8)", 0.8f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			shadowVolume = cfg.Bind<float>("Shadow", "Roaming Audio Volume (Default 0.75)", 0.75f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			knucklesVolume = cfg.Bind<float>("Knuckles", "Roaming Audio Volume (Default 0.75)", 0.7f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			mushroomVolume = cfg.Bind<float>("Mushroom", "Roaming Audio Volume (Default 0.75)", 0.7f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			fanVolume = cfg.Bind<float>("Fan", "Volume of the fan (default 1f)", 1f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			remyVolume = cfg.Bind<float>("Remy", "Roaming Audio Volume (Default 0.75)", 0.7f, new ConfigDescription("Volume of the roaming audio, set to 0 to turn off", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			sonicSpeed = cfg.Bind<float>("Sonic", "Roaming Speed (Default 16.75)", 16.75f, "How fast should they move around");
			crawlySpeed = cfg.Bind<float>("Crawly The Wizard", "Roaming Speed (Default 2.1)", 2.1f, "How fast should they move around");
			dekuSpeed = cfg.Bind<float>("Deku", "Chase Speed (Default 12.5)", 12.5f, "How fast should deku chase the player");
			raymanSpeed = cfg.Bind<float>("Rayman", "Roaming Speed (Default 9)", 9f, "How fast should they move around");
			knucklesSpeed = cfg.Bind<float>("Knuckles", "Roaming Speed (Default 12.5)", 12.5f, "How fast should they move around");
			shadowSpeed = cfg.Bind<float>("Shadow", "Roaming Speed (Default 16.5)", 16.5f, "How fast should they move around");
			remySpeed = cfg.Bind<float>("Remy", "Roaming Speed (Default 0.9)", 0.9f, "How fast should they move around");
			mushroomSpeed = cfg.Bind<float>("Mushroom", "Roaming Speed", 5.5f, "How fast should they move around");
			dekuRoamChance = cfg.Bind<int>("Deku", "Chase chance (default 50)", 50, new ConfigDescription("Chance to chase the player on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			sonicRoamChance = cfg.Bind<int>("Sonic", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			crawlyRoamChance = cfg.Bind<int>("Crawly The Wizard", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			raymanRoamChance = cfg.Bind<int>("Rayman", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			knucklesRoamChance = cfg.Bind<int>("Knuckles", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			shadowRoamChance = cfg.Bind<int>("Shadow", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			remyRoamChance = cfg.Bind<int>("Remy", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			mushroomRoamChance = cfg.Bind<int>("Mushroom", "Roam chance (default 100)", 100, new ConfigDescription("Chance to start roaming on drop", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			crawlyHearableDist = cfg.Bind<float>("Crawly The Wizard", "Max Audio Distance (default 32)", 32f, "Max distance at which audio is still audible");
			sonicHearableDist = cfg.Bind<float>("Sonic", "Max Audio Distance (default 45f)", 42f, "Max distance at which audio is still audible");
			raymanHearableDist = cfg.Bind<float>("Rayman", "Max Audio Distance (default 40f)", 40f, "Max distance at which audio is still audible");
			dekuHearableDist = cfg.Bind<float>("Deku", "Max Audio Distance (default 50f)", 50f, "Max distance at which audio is still audible");
			shadowHearableDist = cfg.Bind<float>("Shadow", "Max Audio Distance (default 45)", 42f, "Max distance at which audio is still audible");
			remyHearableDist = cfg.Bind<float>("Remy", "Max Audio Distance", 32f, "Max distance at which audio is still audible");
			mushroomHearableDist = cfg.Bind<float>("Mushroom", "Max Audio Distance", 40f, "Max distance at which audio is still audible");
			knucklesHearableDist = cfg.Bind<float>("Knuckles", "Max Audio Distance (default 45)", 45f, "Max distance at which audio is still audible");
			maximumFosgreathModeEnabled = cfg.Bind<bool>("Fosgreath", "Enable Maximum Fosgreath Mode (default false)", false, "Should Maximum Fosgreath Mode Be Enabled?");
			dekuExplodeTargetPlayerName = cfg.Bind<string>("Deku", "Target Player Name (default NULL)", "NUll", "Deku has a small chance to explode when held by the player with the specified username");
			holdingPenCost = cfg.Bind<int>("Holding Pen", "Price of the Holding Pen (default 100)", 100, "Price of the Holding Pen when purchasing from the store in the terminal");
			crawlyMusicMode = cfg.Bind<int>("Crawly The Wizard", "Roaming Audio (default standard)", 0, "Which Audio should be played whilst roaming {0 = standard, 1 = full, 2 = lyrics}");
			knucklesMusicMode = cfg.Bind<int>("Knuckles", "Roaming Audio (default standard)", 0, "Which Audio should be played whilst roaming {0 = standard, 1 = All Knuckles}");
			fanBlowForceMin = cfg.Bind<float>("Fan", "Blow Force Minimum", 3f, "How much force should the fan exert at minimum (at max distance from fan)");
			fanBlowForceMax = cfg.Bind<float>("Fan", "Blow Force Maximum", 18f, "How much force should the fan exert at maximum (close to fan)");
			fanBlowDist = cfg.Bind<float>("Fan", "Blowing Distance", 22f, "How far does the fans blow reach");
			fanActivationMaxInterval = cfg.Bind<float>("Fan", "Max Activation Interval", 7.5f, "How long should the fan wait at max before checking if it should turn on");
			fanActivationChance = cfg.Bind<int>("Fan", "Activation Chance", 10, new ConfigDescription("Chance for the fan to turn on every interval", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			quicktimeEventsToggle = cfg.Bind<bool>("Quicktime Events", "Enable Quicktime Events?", true, "Should Quicktime Events be enabled for roaming scrap?");
			quicktimeEventsDropRate = cfg.Bind<float>("Quicktime Events", "Drop Rate", 0.55f, "Rate at which the progress bar decreases");
			quicktimeEventsIncreaseRate = cfg.Bind<float>("Quicktime Events", "Increase Rate", 0.1f, "Rate at which the progress bar increase per button tap as a percent (0.1 = 10% of the bar per tap)");
			quicktimeEventChance = cfg.Bind<int>("Quicktime Events", "Drop Chance", 50, new ConfigDescription("Chance of triggering the dropping quicktime event every quicktime interval", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			quicktimeEventIntervalMin = cfg.Bind<float>("Quicktime Events", "Minimum Interval", 5f, "Minimum time holding the item before the quicktime event could possibly trigger (randomised between min and max interval)");
			quicktimeEventIntervalMax = cfg.Bind<float>("Quicktime Events", "Maximum Interval", 25f, "Maximum time holding the item before the quicktime event could possibly trigger (randomised between min and max interval)");
			marioHealth = cfg.Bind<int>("Mario", "Health", 10, new ConfigDescription("How much health should mario have", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 9999), Array.Empty<object>()));
			marioSearchSpeed = cfg.Bind<float>("Mario", "Search Speed", 2.5f, new ConfigDescription("How fast should Mario move whilst searching?", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 15f), Array.Empty<object>()));
			marioChaseSpeed = cfg.Bind<float>("Mario", "Chase Speed", 3.3f, new ConfigDescription("How fast should Mario move whilst chasing a player?", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
			marioChaseMusicVolume = cfg.Bind<float>("Mario", "Chase Music Volume", 0.8f, new ConfigDescription("How loud should the chase music be? (0 to turn it off)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			marioDamagePerHit = cfg.Bind<int>("Mario", "Mario Damage", 45, new ConfigDescription("How much damage should be dealt when hit by Mario's Punch?", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			marioMaxHearableDistSfx = cfg.Bind<int>("Mario", "Sound Effect Distance", 40, new ConfigDescription("How many units should mario's sound effects travel?", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			marioMaxHearableDistChaseMusic = cfg.Bind<int>("Mario", "Chase Music Distance", 30, new ConfigDescription("How many units should mario's chase music travel?", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			marioMaxCount = cfg.Bind<int>("Mario", "Max Count", 2, new ConfigDescription("Max number of Mario's that can be active each round", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 5), Array.Empty<object>()));
			marioPowerLevel = cfg.Bind<int>("Mario", "Power Level", 2, new ConfigDescription("How much should Mario contribute to the rounds max power level? (for reference, 1 is the power level of a hoarding bug, 3 is a thumper)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 5), Array.Empty<object>()));
			minNumOfMushroomsToSpawn = cfg.Bind<int>("Mario", "Min Number of Mushrooms to Spawn", 1, new ConfigDescription("How many mushrooms should Mario spawn on death at minimum?)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			maxNumOfMushroomsToSpawn = cfg.Bind<int>("Mario", "Max Number of Mushrooms to Spawn", 3, new ConfigDescription("How many mushrooms should Mario spawn on death at maximum?)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(minNumOfMushroomsToSpawn.Value, 10), Array.Empty<object>()));
			miniNukeExplodeChance = cfg.Bind<int>("Mini Nuke", "Explosion Chance (0-100)", 2, new ConfigDescription("Chance for the explosion procedure to be triggered", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			timeBetweenBombActivationChecksMax = cfg.Bind<float>("Mini Nuke", "Activation Check Timer", 10f, "Max time for the bomb to check if it should explode (random between 0 and this value)");
			nukeDetonationTime = cfg.Bind<float>("Mini Nuke", "How Long It Takes The Nuke To Explode", 6.5f, "Once the bomb is activated, how long it will take before it explodes");
			ClearOrphanedEntries(cfg);
			cfg.Save();
			cfg.SaveOnConfigSet = true;
		}

		private static void ClearOrphanedEntries(ConfigFile cfg)
		{
			PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg);
			dictionary.Clear();
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "ReindogFan1372.ReindogDLL";

		public const string PLUGIN_NAME = "ReindogDLL";

		public const string PLUGIN_VERSION = "1.1.2";
	}
}
namespace ReindogDLL.Patches
{
	public class ExplosiveItem : GrabbableObject
	{
		private enum BombState
		{
			Inate,
			PreparingToExplode,
			Sizzling,
			Exploding
		}

		private float timer = 0f;

		[SerializeField]
		private AudioSource bombAudioSource;

		[SerializeField]
		private AudioClip explosionClip;

		[SerializeField]
		private AudioClip sizzleClip;

		private BombState bombState;

		private float timeBetweenActivationChecks;

		private float bombActivationCheckTimer = 0f;

		private float playerHoldingObjectHealthLastFrame = 100f;

		private Random noiseRandomSeed;

		[SerializeField]
		private float noiseRange = 80f;

		private float minLoudness = 0.95f;

		private float maxLoudness = 1f;

		private void Awake()
		{
			bombState = BombState.Inate;
			timeBetweenActivationChecks = Random.Range(0f, ReindogDLL.ReindogAndFriendsModConfig.timeBetweenBombActivationChecksMax.Value);
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
			noiseRandomSeed = new Random(StartOfRound.Instance.randomMapSeed + 85);
		}

		public override void Update()
		{
			Explosive();
			((GrabbableObject)this).Update();
		}

		private void Explosive()
		{
			if ((!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost) || !StartOfRound.Instance.shipHasLanded)
			{
				return;
			}
			if ((base.isHeld || base.isPocketed) && bombState == BombState.Inate)
			{
				bombActivationCheckTimer += Time.deltaTime;
				if (bombActivationCheckTimer >= timeBetweenActivationChecks)
				{
					bombActivationCheckTimer = 0f;
					timeBetweenActivationChecks = Random.Range(0f, ReindogDLL.ReindogAndFriendsModConfig.timeBetweenBombActivationChecksMax.Value);
					if (Random.Range(0, 101) <= ReindogDLL.ReindogAndFriendsModConfig.miniNukeExplodeChance.Value)
					{
						bombState = BombState.PreparingToExplode;
					}
				}
				if ((float)base.playerHeldBy.health < playerHoldingObjectHealthLastFrame)
				{
					bombState = BombState.PreparingToExplode;
				}
				playerHoldingObjectHealthLastFrame = base.playerHeldBy.health;
			}
			if (bombState == BombState.PreparingToExplode)
			{
				timer += Time.deltaTime;
				if (timer > ReindogDLL.ReindogAndFriendsModConfig.nukeDetonationTime.Value - sizzleClip.length)
				{
					bombState = BombState.Sizzling;
					PlaySizzleSoundClientRpc();
				}
			}
			if (bombState == BombState.Sizzling)
			{
				timer += Time.deltaTime;
				if (timer > ReindogDLL.ReindogAndFriendsModConfig.nukeDetonationTime.Value)
				{
					bombActivationCheckTimer = 0f;
					timer = 0f;
					bombState = BombState.Inate;
					ExplodeBombClientRpc();
				}
			}
		}

		[ClientRpc]
		private void PlaySizzleSoundClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(148881451u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 148881451u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				bombAudioSource.PlayOneShot(sizzleClip);
				float num = (float)noiseRandomSeed.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				if (minLoudness >= 0.5f && (Object)(object)base.playerHeldBy != (Object)null)
				{
					base.playerHeldBy.timeSinceMakingLoudNoise = 0f;
				}
			}
		}

		[ClientRpc]
		private void ExplodeBombClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(715212118u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 715212118u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				bombAudioSource.PlayOneShot(explosionClip);
				float num = (float)noiseRandomSeed.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				if (minLoudness >= 0.5f && (Object)(object)base.playerHeldBy != (Object)null)
				{
					base.playerHeldBy.timeSinceMakingLoudNoise = 0f;
				}
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 10f, 12.5f, 50, 0f, (GameObject)null, false);
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up + new Vector3(5.5f, 0f, 0f), true, 10f, 12.5f, 50, 0f, (GameObject)null, false);
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up + new Vector3(-5.5f, 0f, 0f), true, 10f, 12.5f, 50, 0f, (GameObject)null, false);
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up + new Vector3(0f, 0f, 5.5f), true, 10f, 12.5f, 50, 0f, (GameObject)null, false);
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up + new Vector3(0f, 0f, -5.5f), true, 10f, 12.5f, 50, 0f, (GameObject)null, false);
				((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy);
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ExplosiveItem()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(148881451u, new RpcReceiveHandler(__rpc_handler_148881451));
			NetworkManager.__rpc_func_table.Add(715212118u, new RpcReceiveHandler(__rpc_handler_715212118));
		}

		private static void __rpc_handler_148881451(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ExplosiveItem)(object)target).PlaySizzleSoundClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_715212118(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ExplosiveItem)(object)target).ExplodeBombClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "ExplosiveItem";
		}
	}
	public class Frieza : GrabbableObject
	{
		[SerializeField]
		private AudioSource audio;

		[SerializeField]
		private AudioClip brolyLook;

		[SerializeField]
		private AudioClip vineBoom;

		[SerializeField]
		private uint chance = 2u;

		[SerializeField]
		private float timeBetweenActivationChecksMax = 1f;

		private float timeBetweenActivationChecks;

		private float checkTimer = 0f;

		[SerializeField]
		private Sprite[] sprites;

		[SerializeField]
		private GameObject uiCanvasPrefab;

		private GameObject uiCanvas;

		private Image imageOnCanvas;

		private bool isOnCooldown = false;

		private float cooldownTime = 5f;

		private PlayerControllerB playerWhoTriggeredFrieza;

		private Random noiseRandomSeed;

		[SerializeField]
		private float noiseRange = 70f;

		private float minLoudness = 0.99f;

		private float maxLoudness = 1f;

		private void Awake()
		{
			timeBetweenActivationChecks = Random.Range(0f, timeBetweenActivationChecksMax);
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
			noiseRandomSeed = new Random(StartOfRound.Instance.randomMapSeed + 85);
		}

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			uiCanvas = Object.Instantiate<GameObject>(uiCanvasPrefab);
			uiCanvas.SetActive(false);
			imageOnCanvas = uiCanvas.GetComponentInChildren<Image>();
		}

		public override void Update()
		{
			DoFriezaChecks();
			((GrabbableObject)this).Update();
		}

		private void DoFriezaChecks()
		{
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			if ((!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost) || (!base.isHeld && !base.isPocketed) || isOnCooldown)
			{
				return;
			}
			checkTimer += Time.deltaTime;
			if (checkTimer >= timeBetweenActivationChecks)
			{
				checkTimer = 0f;
				timeBetweenActivationChecks = Random.Range(0f, timeBetweenActivationChecksMax);
				if (Random.Range(0, 101) <= chance)
				{
					isOnCooldown = true;
					((MonoBehaviour)this).Invoke("ResetCooldown", cooldownTime);
					ActivateFriezaAudioBrolyLookClientRpc();
					ClientRpcParams val = default(ClientRpcParams);
					val.Send = new ClientRpcSendParams
					{
						TargetClientIds = new ulong[1] { base.playerHeldBy.actualClientId }
					};
					ClientRpcParams clientRpcParams = val;
					DisplayImageClientRpc(clientRpcParams);
				}
			}
		}

		[ClientRpc]
		private void ActivateFriezaAudioBrolyLookClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3762915186u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3762915186u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				audio.PlayOneShot(brolyLook);
				float num = (float)noiseRandomSeed.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				if (minLoudness >= 0.5f && (Object)(object)base.playerHeldBy != (Object)null)
				{
					base.playerHeldBy.timeSinceMakingLoudNoise = 0f;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void ActivateFriezaAudioVineBoomServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2223191387u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2223191387u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ActivateFriezaAudioVineBoomClientRpc();
				}
			}
		}

		[ClientRpc]
		private void ActivateFriezaAudioVineBoomClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(500400452u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 500400452u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				audio.PlayOneShot(vineBoom);
				float num = (float)noiseRandomSeed.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				if (minLoudness >= 0.5f && (Object)(object)base.playerHeldBy != (Object)null)
				{
					base.playerHeldBy.timeSinceMakingLoudNoise = 0f;
				}
			}
		}

		[ClientRpc]
		private void DisplayImageClientRpc(ClientRpcParams clientRpcParams = default(ClientRpcParams))
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1545275795u, clientRpcParams, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 1545275795u, clientRpcParams, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((MonoBehaviour)this).StartCoroutine(FriezaActivated());
				}
			}
		}

		private IEnumerator FriezaActivated()
		{
			playerWhoTriggeredFrieza = base.playerHeldBy;
			yield return (object)new WaitForSeconds(brolyLook.length - 0.1f);
			imageOnCanvas.sprite = sprites[Random.Range(0, sprites.Length)];
			uiCanvas.SetActive(true);
			Color imageColor = ((Graphic)imageOnCanvas).color;
			imageColor.a = 0f;
			float fadeTime = 0.15f;
			float timePassed2 = 0f;
			ActivateFriezaAudioVineBoomServerRpc();
			playerWhoTriggeredFrieza.JumpToFearLevel(0.9f, true);
			while (imageColor.a < 0.95f)
			{
				timePassed2 += Time.deltaTime;
				imageColor.a = Mathf.Lerp(imageColor.a, 1f, timePassed2 / fadeTime);
				((Graphic)imageOnCanvas).color = imageColor;
				yield return (object)new WaitForSeconds(Time.deltaTime);
			}
			timePassed2 = 0f;
			imageColor.a = 1f;
			((Graphic)imageOnCanvas).color = imageColor;
			yield return (object)new WaitForSeconds(0.3f);
			while ((double)imageColor.a > 0.05)
			{
				timePassed2 += Time.deltaTime;
				imageColor.a = Mathf.Lerp(imageColor.a, 0f, timePassed2 / fadeTime);
				((Graphic)imageOnCanvas).color = imageColor;
				yield return (object)new WaitForSeconds(Time.deltaTime);
			}
			imageColor.a = 0f;
			((Graphic)imageOnCanvas).color = imageColor;
			uiCanvas.SetActive(false);
		}

		private void ResetCooldown()
		{
			isOnCooldown = false;
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Frieza()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3762915186u, new RpcReceiveHandler(__rpc_handler_3762915186));
			NetworkManager.__rpc_func_table.Add(2223191387u, new RpcReceiveHandler(__rpc_handler_2223191387));
			NetworkManager.__rpc_func_table.Add(500400452u, new RpcReceiveHandler(__rpc_handler_500400452));
			NetworkManager.__rpc_func_table.Add(1545275795u, new RpcReceiveHandler(__rpc_handler_1545275795));
		}

		private static void __rpc_handler_3762915186(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Frieza)(object)target).ActivateFriezaAudioBrolyLookClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2223191387(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Frieza)(object)target).ActivateFriezaAudioVineBoomServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_500400452(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Frieza)(object)target).ActivateFriezaAudioVineBoomClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1545275795(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ClientRpcParams client = rpcParams.Client;
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Frieza)(object)target).DisplayImageClientRpc(client);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "Frieza";
		}
	}
	public class HoldingPen : GrabbableObject
	{
		private InteractTrigger triggerScript;

		private void Awake()
		{
			triggerScript = ((Component)this).GetComponentInChildren<InteractTrigger>();
			InteractTrigger obj = triggerScript;
			obj.hoverTip = obj.hoverTip + ": [" + InputActionRebindingExtensions.GetBindingDisplayString(IngamePlayerSettings.Instance.playerInput.actions.FindAction("Interact", false), (DisplayStringOptions)0, (string)null).Split(' ')[0] + "]";
		}

		public void AddCurrentlyHeldItemToPenOnDeposit(PlayerControllerB playerWhoTriggered)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			AddToHoldingPenServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)playerWhoTriggered));
		}

		[ServerRpc(RequireOwnership = false)]
		private void AddToHoldingPenServerRpc(NetworkBehaviourReference networkRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2249303774u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref networkRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2249303774u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				PlayerControllerB val3 = (PlayerControllerB)NetworkBehaviourReference.op_Implicit(networkRef);
				RoamingObject roamingObject = default(RoamingObject);
				if (val3.isHoldingObject && !val3.isGrabbingObjectAnimation && (Object)(object)val3.currentlyHeldObjectServer != (Object)null && !base.isHeld && !base.isPocketed && ((Component)val3.currentlyHeldObjectServer).TryGetComponent<RoamingObject>(ref roamingObject))
				{
					PermeateHoldingPenStatusClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)roamingObject));
					roamingObject.EnableDisableAIClientRpc(enableState: false);
					roamingObject.timer = 0f;
				}
			}
		}

		[ClientRpc]
		public void PermeateHoldingPenStatusClientRpc(NetworkBehaviourReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(934601757u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 934601757u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					RoamingObject roamingObject = (RoamingObject)(object)NetworkBehaviourReference.op_Implicit(obj);
					roamingObject.isInHoldingPen = true;
				}
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HoldingPen()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2249303774u, new RpcReceiveHandler(__rpc_handler_2249303774));
			NetworkManager.__rpc_func_table.Add(934601757u, new RpcReceiveHandler(__rpc_handler_934601757));
		}

		private static void __rpc_handler_2249303774(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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)
			//IL_004f: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkBehaviourReference networkRef = default(NetworkBehaviourReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref networkRef, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HoldingPen)(object)target).AddToHoldingPenServerRpc(networkRef);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_934601757(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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)
			//IL_004f: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkBehaviourReference obj = default(NetworkBehaviourReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HoldingPen)(object)target).PermeateHoldingPenStatusClientRpc(obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "HoldingPen";
		}
	}
	public class LargeFan : GrabbableObject
	{
		private float blowForceMin = 3f;

		private float blowForceMax = 18f;

		private int activationChance = 15;

		private float activationChanceInterval = 5f;

		private float activationChanceIntervalMax = 5f;

		private float activationChanceTimer = 0f;

		private bool fanActivated = false;

		[SerializeField]
		private Transform forcePoint;

		[SerializeField]
		private Transform blades;

		private float maxBlowForceDist = 22f;

		private float forceApplyInterval = 0.2f;

		private float forceApplyTimer = 0f;

		[SerializeField]
		private AnimationClip blowingAnim;

		[SerializeField]
		private Animator fanAnimator;

		[SerializeField]
		private AudioSource fanAudioSource;

		private float blowRadius = 4f;

		private float rotationSpeed = 0f;

		private float lastBladesRotAngleX = 0f;

		private int staffMask = 11012424;

		private LayerMask hittableLayers;

		private Random noiseRandomSeed;

		private float detectNoiseInterval = 1f;

		private float detectNoiseTimer = 0f;

		private bool fanBlowing = false;

		private void Awake()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = blades.rotation;
			lastBladesRotAngleX = ((Quaternion)(ref rotation)).eulerAngles.x;
			activationChanceInterval = Random.Range(0f, activationChanceIntervalMax);
			fanAudioSource.volume = ReindogDLL.ReindogAndFriendsModConfig.fanVolume.Value;
			blowForceMin = ReindogDLL.ReindogAndFriendsModConfig.fanBlowForceMin.Value;
			blowForceMax = ReindogDLL.ReindogAndFriendsModConfig.fanBlowForceMax.Value;
			maxBlowForceDist = ReindogDLL.ReindogAndFriendsModConfig.fanBlowDist.Value;
			activationChance = ReindogDLL.ReindogAndFriendsModConfig.fanActivationChance.Value;
			activationChanceIntervalMax = ReindogDLL.ReindogAndFriendsModConfig.fanActivationMaxInterval.Value;
			noiseRandomSeed = new Random(StartOfRound.Instance.randomMapSeed + 85);
		}

		public override void Update()
		{
			DoFanChecks();
			((GrabbableObject)this).Update();
		}

		public void ApplyFanForce()
		{
			//IL_0007: 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)
			//IL_0042: 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_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit[] array = Physics.SphereCastAll(forcePoint.position, blowRadius, forcePoint.forward, maxBlowForceDist + 3f, staffMask, (QueryTriggerInteraction)2);
			RaycastHit[] array2 = array;
			PlayerControllerB val2 = default(PlayerControllerB);
			Quaternion rotation;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val = array2[i];
				if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<PlayerControllerB>(ref val2))
				{
					if (!val2.HasLineOfSightToPosition(((Component)this).transform.position, 50f, (int)maxBlowForceDist + 3, -1f) && (Object)(object)base.playerHeldBy != (Object)(object)val2)
					{
						return;
					}
					float distance = ((RaycastHit)(ref val)).distance;
					if (distance > maxBlowForceDist)
					{
						return;
					}
					rotation = blades.rotation;
					rotationSpeed = Mathf.Clamp(Mathf.Abs(((Quaternion)(ref rotation)).eulerAngles.x - lastBladesRotAngleX), 0f, 90f);
					rotationSpeed = (90f - rotationSpeed) / 90f;
					float num = (blowForceMax - blowForceMin) * ((maxBlowForceDist - distance) / maxBlowForceDist);
					float blowForce = (blowForceMin + num) * rotationSpeed * Time.deltaTime;
					ApplyFanForceClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val2), blowForce);
				}
			}
			rotation = blades.rotation;
			lastBladesRotAngleX = ((Quaternion)(ref rotation)).eulerAngles.x;
		}

		[ClientRpc]
		private void ApplyFanForceClientRpc(NetworkBehaviourReference hitController, float blowForce)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1819779707u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref hitController, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref blowForce, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1819779707u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerControllerB val3 = (PlayerControllerB)NetworkBehaviourReference.op_Implicit(hitController);
					Vector3 forward = forcePoint.forward;
					forward.y = 0f;
					val3.externalForceAutoFade += forward * blowForce;
				}
			}
		}

		private IEnumerator DisableFan()
		{
			yield return (object)new WaitForSeconds(blowingAnim.length);
			ToggleFanClientRpc(fanState: false);
		}

		[ClientRpc]
		private void ToggleFanClientRpc(bool fanState)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3457784654u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref fanState, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3457784654u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				fanAnimator.SetBool("isActive", fanState);
				fanActivated = fanState;
				if (!fanState)
				{
					fanAudioSource.Stop();
					fanBlowing = false;
				}
				else
				{
					fanAudioSource.Play();
				}
			}
		}

		private void DoFanChecks()
		{
			if (!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost)
			{
				return;
			}
			if (!StartOfRound.Instance.shipHasLanded)
			{
				if (fanActivated)
				{
					ToggleFanClientRpc(fanState: false);
				}
				return;
			}
			if (fanAudioSource.isPlaying)
			{
				detectNoiseTimer += Time.deltaTime;
				if (detectNoiseTimer >= detectNoiseInterval)
				{
					detectNoiseTimer = 0f;
					SyncDetectNoiseClientRpc();
				}
			}
			if (!fanActivated)
			{
				activationChanceTimer += Time.deltaTime;
				if (activationChanceTimer >= activationChanceInterval)
				{
					activationChanceInterval = Random.Range(0f, activationChanceIntervalMax);
					activationChanceTimer = 0f;
					if (Random.Range(0, 101) <= activationChance)
					{
						ToggleFanClientRpc(fanState: true);
						((MonoBehaviour)this).StartCoroutine(DisableFan());
						((MonoBehaviour)this).StartCoroutine(DelayBlowStart(1.5f));
						((MonoBehaviour)this).StartCoroutine(DelayBlowEnd(blowingAnim.length - 4f));
					}
				}
			}
			if (fanBlowing)
			{
				ApplyFanForce();
			}
		}

		private IEnumerator DelayBlowStart(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			fanBlowing = true;
		}

		private IEnumerator DelayBlowEnd(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			fanBlowing = false;
		}

		[ClientRpc]
		private void SyncDetectNoiseClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1280311848u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1280311848u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				float num = (float)noiseRandomSeed.Next(90, 100) / 100f;
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 40f, num, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				if ((Object)(object)base.playerHeldBy != (Object)null)
				{
					base.playerHeldBy.timeSinceMakingLoudNoise = 0f;
				}
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_LargeFan()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1819779707u, new RpcReceiveHandler(__rpc_handler_1819779707));
			NetworkManager.__rpc_func_table.Add(3457784654u, new RpcReceiveHandler(__rpc_handler_3457784654));
			NetworkManager.__rpc_func_table.Add(1280311848u, new RpcReceiveHandler(__rpc_handler_1280311848));
		}

		private static void __rpc_handler_1819779707(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkBehaviourReference hitController = default(NetworkBehaviourReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref hitController, default(ForNetworkSerializable));
				float blowForce = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref blowForce, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((LargeFan)(object)target).ApplyFanForceClientRpc(hitController, blowForce);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3457784654(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool fanState = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref fanState, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((LargeFan)(object)target).ToggleFanClientRpc(fanState);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1280311848(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkMa