Decompiled source of ScienceBird Tweaks v4.2.2

ScienceBird.ScienceBirdTweaks.dll

Decompiled 8 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DigitalRuby.ThunderAndLightning;
using Dissonance.Config;
using DunGen;
using GameNetcodeStuff;
using GoodItemScan;
using HarmonyLib;
using JLLItemsModule.Components;
using LethalLevelLoader;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using ScienceBird.ScienceBirdTweaks.NetcodePatcher;
using ScienceBirdTweaks.ModPatches;
using ScienceBirdTweaks.Patches;
using ScienceBirdTweaks.Scripts;
using SelfSortingStorage.Cupboard;
using ShipWindows.Patches.Shutters;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Video;
using WesleyMoonScripts.Components;

[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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ScienceBird.ScienceBirdTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("4.2.2.0")]
[assembly: AssemblyInformationalVersion("4.2.2+08b30cfef2e67b241b813c2adbbf0944d3439a8c")]
[assembly: AssemblyProduct("ScienceBirdTweaks")]
[assembly: AssemblyTitle("ScienceBird.ScienceBirdTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.2.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[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;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ScienceBirdTweaks
{
	public class LobbyCompatibility
	{
		public static void RegisterCompatibility()
		{
			if (ScienceBirdTweaks.ClientsideMode.Value)
			{
				PluginHelper.RegisterPlugin("ScienceBird.ScienceBirdTweaks", Version.Parse("4.2.2"), (CompatibilityLevel)0, (VersionStrictness)0);
			}
			else
			{
				PluginHelper.RegisterPlugin("ScienceBird.ScienceBirdTweaks", Version.Parse("4.2.2"), (CompatibilityLevel)2, (VersionStrictness)0);
			}
		}
	}
	public class NetworkHandler : NetworkBehaviour
	{
		public static NetworkHandler Instance { get; private set; }

		public static event Action<string> LevelEvent;

		public override void OnNetworkSpawn()
		{
			NetworkHandler.LevelEvent = null;
			if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && (Object)(object)Instance != (Object)null)
			{
				GameObject gameObject = ((Component)Instance).gameObject;
				if (gameObject != null)
				{
					NetworkObject component = gameObject.GetComponent<NetworkObject>();
					if (component != null)
					{
						component.Despawn(true);
					}
				}
			}
			Instance = this;
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		[ClientRpc]
		public void EventClientRpc(string eventName)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3412331623u, val, (RpcDelivery)0);
				bool flag = eventName != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(eventName, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3412331623u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				NetworkHandler.LevelEvent?.Invoke(eventName);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_NetworkHandler()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3412331623u, new RpcReceiveHandler(__rpc_handler_3412331623));
		}

		private static void __rpc_handler_3412331623(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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string eventName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((NetworkHandler)(object)target).EventClientRpc(eventName);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "NetworkHandler";
		}
	}
	[HarmonyPatch]
	public class NetworkObjectManager
	{
		private static GameObject networkPrefab;

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		public static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			if (!((Object)(object)networkPrefab != (Object)null) && !ScienceBirdTweaks.ClientsideMode.Value)
			{
				networkPrefab = (GameObject)ScienceBirdTweaks.TweaksAssets.LoadAsset("SBTweaksNetworkHandler");
				networkPrefab.AddComponent<NetworkHandler>();
				NetworkManager.Singleton.AddNetworkPrefab(networkPrefab);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		private static void SpawnNetworkHandler()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && !ScienceBirdTweaks.ClientsideMode.Value)
			{
				GameObject val = Object.Instantiate<GameObject>(networkPrefab, Vector3.zero, Quaternion.identity);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
		}
	}
	[BepInPlugin("ScienceBird.ScienceBirdTweaks", "ScienceBirdTweaks", "4.2.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ScienceBirdTweaks : BaseUnityPlugin
	{
		public static AssetBundle TweaksAssets;

		public static ConfigEntry<bool> FixedShipObjects;

		public static ConfigEntry<bool> OnlyFixDefault;

		public static ConfigEntry<bool> AlternateFixLogic;

		public static ConfigEntry<bool> FixedSuitRack;

		public static ConfigEntry<bool> ConsistentCatwalkCollision;

		public static ConfigEntry<bool> TinyTeleporterCollision;

		public static ConfigEntry<bool> BegoneBottomCollision;

		public static ConfigEntry<bool> LargerLeverCollision;

		public static ConfigEntry<string> ModdedListMode;

		public static ConfigEntry<string> ModdedUnlockableList;

		public static ConfigEntry<bool> RemoveClipboard;

		public static ConfigEntry<bool> RemoveStickyNote;

		public static ConfigEntry<bool> RemoveTeleporterCord;

		public static ConfigEntry<bool> RemoveLongTube;

		public static ConfigEntry<bool> RemoveGenerator;

		public static ConfigEntry<bool> RemoveHelmet;

		public static ConfigEntry<bool> RemoveOxygenTanks;

		public static ConfigEntry<bool> RemoveBoots;

		public static ConfigEntry<bool> RemoveAirFilter;

		public static ConfigEntry<bool> RemoveBatteries;

		public static ConfigEntry<bool> RemoveCruiserClipboard;

		public static ConfigEntry<float> TinyTeleporterSizeX;

		public static ConfigEntry<float> TinyTeleporterSizeY;

		public static ConfigEntry<float> TinyTeleporterSizeZ;

		public static ConfigEntry<float> LargerLeverSizeX;

		public static ConfigEntry<float> LargerLeverSizeY;

		public static ConfigEntry<float> LargerLeverSizeZ;

		public static ConfigEntry<bool> FloodlightRotation;

		public static ConfigEntry<bool> FloodlightRotationOnLand;

		public static ConfigEntry<bool> FloodlightExtraControls;

		public static ConfigEntry<bool> FloodlightPlayerFollow;

		public static ConfigEntry<int> FloodLightIntensity;

		public static ConfigEntry<int> FloodLightAngle;

		public static ConfigEntry<int> FloodLightRange;

		public static ConfigEntry<float> FloodLightRotationSpeed;

		public static ConfigEntry<bool> FancyPanel;

		public static ConfigEntry<bool> DynamicOccupancySign;

		public static ConfigEntry<bool> OccupancyScribble;

		public static ConfigEntry<string> OccupancyFixedValue;

		public static ConfigEntry<bool> PlayGlobalDeathSFX;

		public static ConfigEntry<bool> AutoTeleportBody;

		public static ConfigEntry<bool> UnrecoverableNotification;

		public static ConfigEntry<string> Red1Tip;

		public static ConfigEntry<string> Red2Tip;

		public static ConfigEntry<string> Black1Tip;

		public static ConfigEntry<string> Black2Tip;

		public static ConfigEntry<string> Knob1Tip;

		public static ConfigEntry<string> Knob2Tip;

		public static ConfigEntry<string> Knob3Tip;

		public static ConfigEntry<string> SmallKnobTip;

		public static ConfigEntry<string> SmallRedTip;

		public static ConfigEntry<string> SmallGreenTip;

		public static ConfigEntry<bool> BigScrew;

		public static ConfigEntry<bool> MissingHoverTipFix;

		public static ConfigEntry<bool> SmokeFix;

		public static ConfigEntry<bool> BridgeItemsFix;

		public static ConfigEntry<bool> CleanBeltBagUI;

		public static ConfigEntry<bool> ClientShipItems;

		public static ConfigEntry<bool> LandmineFix;

		public static ConfigEntry<bool> CrouchDamageAnimation;

		public static ConfigEntry<bool> PauseMenuFlickerFix;

		public static ConfigEntry<bool> FallingRotationFix;

		public static ConfigEntry<bool> OldHalloweenElevatorMusic;

		public static ConfigEntry<string> StartingMoon;

		public static ConfigEntry<string> MuteScrapList;

		public static ConfigEntry<bool> CoilheadElevatorFix;

		public static ConfigEntry<bool> DropMasks;

		public static ConfigEntry<int> MaskScrapValue;

		public static ConfigEntry<string> CentipedeMode;

		public static ConfigEntry<float> CentipedeFixedDamage;

		public static ConfigEntry<int> CentipedeSecondChanceThreshold;

		public static ConfigEntry<bool> LeviathanSurfacePatch;

		public static ConfigEntry<bool> LeviathanQuicksand;

		public static ConfigEntry<string> LeviathanNaturalSurfaces;

		public static ConfigEntry<bool> ManeaterTransformInterrupt;

		public static ConfigEntry<bool> ManeaterFastDoors;

		public static ConfigEntry<bool> TulipSnakeMuteLaugh;

		public static ConfigEntry<bool> MineDisableAnimation;

		public static ConfigEntry<bool> SpikeTrapDisableAnimation;

		public static ConfigEntry<bool> ZapGunTutorialRevamp;

		public static ConfigEntry<bool> ZapGunRework;

		public static ConfigEntry<bool> ZappableTurrets;

		public static ConfigEntry<bool> ZappableMines;

		public static ConfigEntry<bool> ZappableSpikeTraps;

		public static ConfigEntry<bool> ZappableBigDoors;

		public static ConfigEntry<bool> PlayerLethalBigDoors;

		public static ConfigEntry<bool> EnemyLethalBigDoors;

		public static ConfigEntry<string> ZapGunTutorialMode;

		public static ConfigEntry<string> ZapScanPriority;

		public static ConfigEntry<int> ZapGunTutorialCount;

		public static ConfigEntry<float> ZapGunBattery;

		public static ConfigEntry<float> TurretZapBaseCooldown;

		public static ConfigEntry<float> MineZapBaseCooldown;

		public static ConfigEntry<float> SpikeTrapBaseCooldown;

		public static ConfigEntry<float> ZapScalingFactor;

		public static ConfigEntry<bool> ShotgunMasterDisable;

		public static ConfigEntry<bool> ShowAmmo;

		public static ConfigEntry<bool> UnloadShells;

		public static ConfigEntry<bool> DoAmmoCheck;

		public static ConfigEntry<bool> PickUpGunOrbit;

		public static ConfigEntry<bool> PickUpShellsOrbit;

		public static ConfigEntry<string> SafetyOnString;

		public static ConfigEntry<string> SafetyOffString;

		public static ConfigEntry<bool> DustSpaceClouds;

		public static ConfigEntry<bool> ThickDustClouds;

		public static ConfigEntry<bool> DustCloudsNoise;

		public static ConfigEntry<float> DustCloudsThickness;

		public static ConfigEntry<bool> PreventWorthlessDespawn;

		public static ConfigEntry<bool> UsePreventDespawnList;

		public static ConfigEntry<bool> ZeroDespawnPreventedItems;

		public static ConfigEntry<string> PreventedDespawnList;

		public static ConfigEntry<string> CustomWorthlessDisplayText;

		public static ConfigEntry<string> WorthlessDisplayTextBlacklist;

		public static ConfigEntry<bool> TrueBlackout;

		public static ConfigEntry<bool> BlackoutOnApparatusRemoval;

		public static ConfigEntry<bool> DisableTrapsOnApparatusRemoval;

		public static ConfigEntry<bool> DisableTrapsOnBreakerSwitch;

		public static ConfigEntry<bool> BlackoutSFX;

		public static ConfigEntry<bool> BlacklistLightAnimators;

		public static ConfigEntry<bool> BlackoutOnlySun;

		public static ConfigEntry<bool> BlacklistPoles;

		public static ConfigEntry<bool> BlacklistEmergency;

		public static ConfigEntry<int> BlackoutFloodLightIntensity;

		public static ConfigEntry<int> BlackoutFloodLightAngle;

		public static ConfigEntry<int> BlackoutFloodLightRange;

		public static ConfigEntry<string> TrueBlackoutNameBlacklist;

		public static ConfigEntry<string> TrueBlackoutHierarchyBlacklist;

		public static ConfigEntry<bool> JLLNoisemakerFix;

		public static ConfigEntry<bool> LLLUnlockSyncing;

		public static ConfigEntry<bool> LLLShipLeverFix;

		public static ConfigEntry<bool> VideoTapeInsertFix;

		public static ConfigEntry<bool> VideoTapeSkip;

		public static ConfigEntry<bool> ShipWindowsShutterFix;

		public static ConfigEntry<bool> SSSTerminalStock;

		public static ConfigEntry<bool> DiversityComputerBegone;

		public static ConfigEntry<bool> MrovWeatherTweaksAnnouncement;

		public static ConfigEntry<bool> ClientsideMode;

		public static ConfigEntry<bool> DebugMode;

		public static ConfigEntry<bool> ExtraLogs;

		public static ConfigEntry<bool> DisableWarnings;

		public static ConfigEntry<bool> InteriorLogging;

		public static bool doLobbyCompat;

		public static bool mrovPresent1;

		public static bool mrovPresent2;

		public static bool mrovPresent3;

		public static bool mrovPresent4;

		public static bool zigzagPresent;

		public static bool wesleyPresent;

		public static bool jacobPresent;

		public static bool batbyPresent;

		public static bool test1Present;

		public static bool test2Present;

		public static Vector3 ConfigTeleporterSize;

		public static Vector3 ConfigLeverSize;

		public static ScienceBirdTweaks Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		private void Awake()
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Expected O, but got Unknown
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Expected O, but got Unknown
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Expected O, but got Unknown
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04be: Expected O, but got Unknown
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_062d: Expected O, but got Unknown
			//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a13: Expected O, but got Unknown
			//IL_0a5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a64: Expected O, but got Unknown
			//IL_0a97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa1: Expected O, but got Unknown
			//IL_0aca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad4: Expected O, but got Unknown
			//IL_0c27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c31: Expected O, but got Unknown
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c63: Expected O, but got Unknown
			//IL_0cfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d04: Expected O, but got Unknown
			//IL_0d57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d61: Expected O, but got Unknown
			//IL_0db4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dbe: Expected O, but got Unknown
			//IL_0e11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1b: Expected O, but got Unknown
			//IL_0e4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e58: Expected O, but got Unknown
			//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f35: Expected O, but got Unknown
			//IL_12c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ca: Expected O, but got Unknown
			//IL_12f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1300: Expected O, but got Unknown
			//IL_132f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1339: Expected O, but got Unknown
			//IL_151c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1521: Unknown result type (might be due to invalid IL or missing references)
			//IL_1544: Unknown result type (might be due to invalid IL or missing references)
			//IL_1549: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			FixedShipObjects = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Fixed Ship Objects", true, "Stops all furniture/unlockable hitboxes from drifting/jittering players on takeoff and landing by properly parenting them to the ship (including teleporter button, welcome mat, etc.).");
			OnlyFixDefault = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Only Fix Vanilla Objects", true, "Only applies the ship object parenting to fix to all the vanilla furniture it's relevant to. You can disable this if you want all furniture to be fixed, but doing so may cause some errors in the console and a bit of lag when loading in.");
			ModdedListMode = ((BaseUnityPlugin)this).Config.Bind<string>("1 i. Ship Tweaks", "Fix Modded List Mode", "Don't Use List", new ConfigDescription("Choose whether the list of modded furniture below will be a whitelist (only listed items will be fixed), or a blacklist (everything EXCEPT listed items will be fixed).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Don't Use List", "Whitelist", "Blacklist" }), Array.Empty<object>()));
			ModdedUnlockableList = ((BaseUnityPlugin)this).Config.Bind<string>("1 i. Ship Tweaks", "Fix Modded Objects List", "", "List the exact names of modded furniture items you want to either blacklist or whitelist (not case-sensitive).");
			AlternateFixLogic = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Alternate Fix Logic", false, "EXPERIMENTAL - Simplifies parenting fix code. Try this if you're having any unexpected issues with ship objects/furniture (this is automatically used when in client-side mode).");
			FixedSuitRack = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Fixed Suit Rack", true, "Stops suits' hitboxes from drifting on takeoff and landing by properly parenting them to the ship.");
			ConsistentCatwalkCollision = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Consistent Catwalk Collision", true, "Ship catwalk has consistent collision outside its railing, so you can always jump and stand on the edge of the catwalk (not compatible with Wider Ship Mod).");
			TinyTeleporterCollision = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Tiny Teleporter Collision", true, "Shrinks the teleporter and inverse teleporter placement colliders (i.e. just their hitboxes) so they can be put next to all walls and in small nooks of the ship (customizable in Collider Sizes config section).");
			BegoneBottomCollision = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Begone Bottom Collision", false, "Removes collision from components underneath the ship, making it easier to get underneath if you need to (still depending on the moon).");
			LargerLeverCollision = ((BaseUnityPlugin)this).Config.Bind<bool>("1 i. Ship Tweaks", "Larger Lever Collision", false, "Makes the ship's start lever hitbox larger and thus easier to pull (customizable in Collider Sizes config section).");
			TinyTeleporterSizeX = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Tiny Teleporter Size X", 1.5f, "Vanilla: 2.48");
			TinyTeleporterSizeY = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Tiny Teleporter Size Y", 4f, "(Height) Vanilla: 6");
			TinyTeleporterSizeZ = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Tiny Teleporter Size Z", 1.6f, "Vanilla: 2.6");
			LargerLeverSizeX = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Larger Lever Size X", 1.25f, "(Length, e.g. from lever to monitor screen) Vanilla: 1");
			LargerLeverSizeY = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Larger Lever Size Y", 1.75f, "(Height) Vanilla: 1");
			LargerLeverSizeZ = ((BaseUnityPlugin)this).Config.Bind<float>("1 ii. Ship Tweaks Collider Sizes", "Larger Lever Size Z", 1.65f, "(Width, e.g. left to right edge of monitor) Vanilla: 1");
			RemoveClipboard = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Clipboard", false, "Removes the service manual clipboard.");
			RemoveStickyNote = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Sticky Note", false, "Removes the 'ACCESS FILE: SIGURD' hint sticky note.");
			RemoveTeleporterCord = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Teleporter Cord", false, "Removes the cord trailing off the teleporter button (which won't connect to the teleporter if you move it).");
			RemoveLongTube = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Long Tube", false, "Removes the long tube trailing off the generator and across the floor of the ship.");
			RemoveGenerator = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Generator", false, "Removes the generator next to the door.");
			RemoveHelmet = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Helmet", false, "Removes the helmet on the counter by the main monitor.");
			RemoveOxygenTanks = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Oxygen Tanks", false, "Removes the oxygen tanks leaning against the wall.");
			RemoveBoots = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Boots", false, "Removes the boots by the suit rack.");
			RemoveAirFilter = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Air Filter", false, "Removes the air filter in the corner by the monitors.");
			RemoveBatteries = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Batteries", false, "Removes the batteries strewn across the desk by the monitors.");
			RemoveCruiserClipboard = ((BaseUnityPlugin)this).Config.Bind<bool>("1 iii. Ship Tweaks Removals", "Cruiser Clipboard", false, "Removes the clipboard manual which comes with the Company Cruiser.");
			FloodlightRotation = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Rotating Floodlight", false, "The ship's top-mounted floodlight can rotate, toggled by a button near the start lever.");
			FloodLightRotationSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("2. Ship Additions", "Ship Floodlight Rotation Speed", 45f, new ConfigDescription("Rotation speed of the ship's floodlights.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 360f), Array.Empty<object>()));
			FloodLightIntensity = ((BaseUnityPlugin)this).Config.Bind<int>("2. Ship Additions", "Ship Floodlight Intensity", 2275, new ConfigDescription("Lumen value of the ship's floodlights.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 60000), Array.Empty<object>()));
			FloodLightAngle = ((BaseUnityPlugin)this).Config.Bind<int>("2. Ship Additions", "Ship Floodlight Angle", 115, new ConfigDescription("Light angle (degrees) of the ship's floodlights.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 180), Array.Empty<object>()));
			FloodLightRange = ((BaseUnityPlugin)this).Config.Bind<int>("2. Ship Additions", "Ship Floodlight Range", 45, new ConfigDescription("Light range (meters) of the ship's floodlights.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 2000), Array.Empty<object>()));
			FloodlightRotationOnLand = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Rotate Floodlight Upon Landing", false, "The ship's floodlight will automatically start rotating when the ship lands.");
			FloodlightExtraControls = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Floodlight Configuration Controls", true, "If floodlight rotation is enabled, the ship's main panel will come with additional controls to dynamically adjust the floodlight's speed, reset its position, or switch to targeting the closest player.");
			FloodlightPlayerFollow = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Floodlight Follows Players Button", false, "EXPERIMENTAL - If extra controls is enabled, a button is added to track the closest player (note that since the floodlight points outwards, the targeted player will be between the lights, not actually illuminated).");
			FancyPanel = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Fancy Button Panel", false, "Revamps the ship's main panel to have interactable buttons and knobs, with working lights that will activate at certain times. None of these buttons do anything (yet), unless you have the rotating floodlight and its extra configuration enabled, which gives a purpose to a few of the buttons.");
			DynamicOccupancySign = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Dynamic Occupancy Sign", false, "The ship's 'maximum occupancy' sign will now update accordingly if more than 4 players join the lobby.");
			OccupancyScribble = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Occupancy Sign Scribble", false, "Instead of just changing the number on the sign, enabling this will scribble out the old number and replace it with a new hand-drawn one, giving it a more amateur feel.");
			OccupancyFixedValue = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Occupancy Sign Fixed Value", "None", new ConfigDescription("Pick a maximum occupancy here if you'd rather a single fixed value rather than one which updates dynamically.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[14]
			{
				"None", "5", "6", "7", "8", "9", "10", "11", "12", "13",
				"14", "15", "16", "Infinite"
			}), Array.Empty<object>()));
			PlayGlobalDeathSFX = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Broadcast Death Notification", false, "All players will recieve a quick succession of beeps to let them know that somebody has just died.");
			AutoTeleportBody = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Auto Teleport Bodies", false, "If the ship has a teleporter, it will automatically teleport a player's body back upon their death, letting all players know via the scrap collected notification. If the player's body has been destroyed, an alternative notification will appear instead.");
			UnrecoverableNotification = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Ship Additions", "Unrecoverable Body Notification", false, "Whenever a player is teleported but their body cannot be recovered, an alternative notification to the 'body collected' scrap notification will appear. This happens when the above auto teleport feature cannot recover a body, but enabling it here will make it happen on player-initiated teleports as well, and even if the above feature is disabled.");
			Red1Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Bottom Right Red", "", "If using fancy button panel, the tooltip for the bottom right red button (overriden by rotating floodlight).");
			Red2Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Middle Right Red", "", "If using fancy button panel, the tooltip for the smaller middle right red button.");
			Black1Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Bottom Middle Black", "", "If using fancy button panel, the tooltip for the bottom middle black button (overriden by floodlight configuration controls).");
			Black2Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Middle Right Black", "", "If using fancy button panel, the tooltip for the middle right black button (overriden by floodlight configuration controls).");
			Knob1Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Middle Right Knob", "", "If using fancy button panel, the tooltip for the middle right knob (overriden by floodlight configuration controls).");
			Knob2Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Top Middle Knob 1", "", "If using fancy button panel, the tooltip for the top middle knob closest to the player.");
			Knob3Tip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Top Middle Knob 2", "", "If using fancy button panel, the tooltip for the top middle knob farther from the player.");
			SmallKnobTip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Small Knob", "", "If using fancy button panel, the tooltip for the small knob at the top middle.");
			SmallRedTip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Small Red", "", "If using fancy button panel, the tooltip for the small red button on the right.");
			SmallGreenTip = ((BaseUnityPlugin)this).Config.Bind<string>("2. Ship Additions", "Fancy Panel Tooltips III Small Green", "", "If using fancy button panel, the tooltip for the small green button on the right.");
			BigScrew = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Big Screw", true, "'Big bolt' is accurately renamed to 'Big screw'.");
			MissingHoverTipFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Missing Hover Tip Fix", true, "When starting a hold interaction before actually hovering over the interaction trigger, the hover tip will still display.");
			SmokeFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Smoke Particle Fix", true, "The exhaust smoke from the cruiser and smoke trail from old birds now blend normally into fog so the particles don't stand out so much from far away.");
			BridgeItemsFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Bridge Items Fix", true, "When a (vanilla) bridge collapses, any items left on it will now fall as well, rather than floating.");
			CleanBeltBagUI = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Clean Belt Bag UI", true, "Scan nodes currently on screen are cleared when opening the belt bag's inventory to reduce visual clutter.");
			ClientShipItems = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Joining Client Items Fix", true, "When clients join, items aren't normally registered as being inside the ship (meaning you'll see a 'collected' pop-up if you grab them). This fixes that.");
			LandmineFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Fix Mine Explosion On Exit", true, "Fixes a vanilla issue where mines would explode after being stepped on while deactivated then going outside.");
			CrouchDamageAnimation = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "No Crouched Damage Animation", true, "Disables the player damaged animation if they are crouching, as this animation would cause players to stand up when damaged.");
			StartingMoon = ((BaseUnityPlugin)this).Config.Bind<string>("3. General Tweaks", "Starting Moon", "Experimentation", "LLL REQUIRED - The default moon your ship will orbit when creating a new save or after being fired (only the moon name needs to be included, not the number). This can be either a vanilla or modded moon.");
			MuteScrapList = ((BaseUnityPlugin)this).Config.Bind<string>("3. General Tweaks", "Muted Scrap List", "", "A comma separated list of items which will have their passive noise effects disabled (e.g. 'Comedy, Tragedy, Clock, Toy robot, Radioactive barrel', not case-sensitive). Eyeless dogs will also no longer hear these sounds.");
			FallingRotationFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Falling Rotation Fix", false, "Normally, if you ever drop an object from really high up, its rotation takes so long to change that it's still rotating when it hits the ground. This tweak properly scales the rotation so objects land normally.");
			PauseMenuFlickerFix = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Pause Menu Flicker Fix", false, "'Fixes' the resume button flickering when pausing the game by making the currently selected option always highlighted (will look slightly strange).");
			OldHalloweenElevatorMusic = ((BaseUnityPlugin)this).Config.Bind<bool>("3. General Tweaks", "Old Halloween Elevator Music", false, "Restores mineshaft elevator to its old Halloween behaviour, playing a random selection of groovy tracks (disabled if ButteryStancakes' HalloweenElevator is installed).");
			CoilheadElevatorFix = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Coilhead Elevator Fix", true, "Fixes inconsistent sightlines when standing in an elevator, which could cause coilheads to kill players in the elevator while being looked at.");
			DropMasks = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Gimme That Mask", false, "Allows you to grab the masks off of dead masked enemies and sell them (will not work if you have any mod which removes the masks from masked enemies)");
			MaskScrapValue = ((BaseUnityPlugin)this).Config.Bind<int>("4. Enemy Tweaks", "Dropped Mask Scrap Value", 25, new ConfigDescription("The average scrap value of masks recovered from masked enemies (will vary slightly below and above this).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 200), Array.Empty<object>()));
			CentipedeMode = ((BaseUnityPlugin)this).Config.Bind<string>("4. Enemy Tweaks", "Snare Flea Mode", "Vanilla", new ConfigDescription("'Vanilla': Unchanged. - 'Second Chance': Implements the singleplayer 'second chance' mechanic in multiplayer, giving each player a chance to escape once it damages them to low HP. - 'Fixed Damage': Will damage a player for an exact proportion of their maximum health (at the same speed as vanilla).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Vanilla", "Second Chance", "Fixed Damage" }), Array.Empty<object>()));
			CentipedeFixedDamage = ((BaseUnityPlugin)this).Config.Bind<float>("4. Enemy Tweaks", "Snare Flea Fixed Damage", 0.5f, new ConfigDescription("The proportion of a player's maximum health to take if using the 'Fixed Damage' mode. When set to 50% or above, this effectively gives the player a second chance only if they're above half health (the lower this is set, the more chances).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			CentipedeSecondChanceThreshold = ((BaseUnityPlugin)this).Config.Bind<int>("4. Enemy Tweaks", "Snare Flea Second Chance Threshold", 15, new ConfigDescription("At what threshold of health should the snare flea drops off the player if it's using the 'Second Chance' mode (vanilla value in singleplayer is 15 HP).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			LeviathanSurfacePatch = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Earth Leviathan More Surfaces", false, "Allows the earth leviathan to burrow through and emerge from more types of surfaces, using the list below.");
			LeviathanNaturalSurfaces = ((BaseUnityPlugin)this).Config.Bind<string>("4. Enemy Tweaks", "Earth Leviathan Surfaces List", "Wood, Tiles, Aluminum, Rock, Catwalk, Concrete, Metal, Carpet, Puddle, Untagged", "Surface tags (tied to footstep sounds) earth leviathans should be able to burrow through if above option is enabled (in addition to the default tags Grass, Gravel, and Snow)");
			LeviathanQuicksand = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Earth Leviathan Quicksand", false, "Earth leviathans will leave behind patches of quicksand where they emerge and enter the ground (note that quicksand cannot appear on every type of surface).");
			ManeaterTransformInterrupt = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Maneater Transformation Interrupt", false, "Hitting the maneater while it's transforming will cause it to immediately exit its state and become active.");
			ManeaterFastDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Maneater Fast Doors", false, "The maneater will move more quickly through doors.");
			TulipSnakeMuteLaugh = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Enemy Tweaks", "Quiet Tulip Snakes", false, "Tulip snake chuckles will no longer alert eyeless dogs.");
			MineDisableAnimation = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Mine Cooldown Animation", false, "Changes mine lights and sound effects to reflect that it's been disabled (by terminal or otherwise). This is automatically enabled if using the zap gun rework.");
			SpikeTrapDisableAnimation = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Spike Trap Cooldown Animation", false, "Changes spike trap lights to reflect that it's been disabled (by terminal or otherwise). This is automatically enabled if using the zap gun rework.");
			ZapGunTutorialMode = ((BaseUnityPlugin)this).Config.Bind<string>("5. Zap Gun & Hazards", "Zap Gun Tutorial Mode", "Only First Time", new ConfigDescription("'Only First Time': All players will see the tutorial arrow their first few times using the zap gun and never again (I assume this is what's supposed to happen in vanilla). - 'Every Session': All players will see the tutorial arrow the first few times using the zap gun every time they restart the game. - 'Always': All players will always see the tutorial arrow whenever they use the zap gun. - 'Vanilla': Some players (generally the host) always see the tutorial arrow, while others never see it.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[4] { "Only First Time", "Every Session", "Always", "Vanilla" }), Array.Empty<object>()));
			ZapGunTutorialCount = ((BaseUnityPlugin)this).Config.Bind<int>("5. Zap Gun & Hazards", "Zap Gun Tutorial Count", 2, new ConfigDescription("How many times the tutorial arrow should be displayed (if using 'Only First Time' or 'Every Session' in above config. Vanilla is 2.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>()));
			ZapGunTutorialRevamp = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zap Gun Tutorial Revamp", false, "Changes the mouse graphic in the tutorial to be positioned relative to how much you need to correct the beam (instead of fixed swipes across the arrow).");
			ZapGunRework = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zap Gun Rework", false, "Activates all of the following config options below, which allow the zap gun to temporarily disable various traps the same way the terminal does (depending on how long you zap them)");
			ZapScanPriority = ((BaseUnityPlugin)this).Config.Bind<string>("5. Zap Gun & Hazards", "Zap Target Priority", "Doors, Enemies, Traps, Players", "Replaces vanilla scan logic to prioritize certain entities in the order specified by this list (if you want to edit the list, use the exact same set of words, not case-sensitive).");
			ZapGunBattery = ((BaseUnityPlugin)this).Config.Bind<float>("5. Zap Gun & Hazards", "Zap Gun Battery", 22f, new ConfigDescription("The battery life of the zap gun (vanilla is 22, pro-flashlight battery is 300 for reference)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 150f), Array.Empty<object>()));
			ZappableTurrets = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zappable Turrets", true, "Allows you to disable turrets with the zap gun.");
			TurretZapBaseCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("5. Zap Gun & Hazards", "Zapped Turret Cooldown", 7f, new ConfigDescription("Base cooldown of the turret when zapped (will be more or less than this depending how long it's zapped for). Default value is the vanilla value for being disabled by the terminal.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
			ZappableMines = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zappable Mines", true, "Allows you to disable mines with the zap gun.");
			MineZapBaseCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("5. Zap Gun & Hazards", "Zapped Mine Cooldown", 3.2f, new ConfigDescription("Base cooldown of the mine when zapped (will be more or less than this depending how long it's zapped for). Default value is the vanilla value for being disabled by the terminal.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
			ZappableSpikeTraps = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zappable Spike Traps", true, "Allows you to disable spike traps with the zap gun.");
			SpikeTrapBaseCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("5. Zap Gun & Hazards", "Zapped Spike Trap Cooldown", 7f, new ConfigDescription("Base cooldown of the spike trap when zapped (will be more or less than this depending how long it's zapped for). Default value is the vanilla value for being disabled by the terminal.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
			ZapScalingFactor = ((BaseUnityPlugin)this).Config.Bind<float>("5. Zap Gun & Hazards", "Zap Stun Scaling Factor", 0.25f, new ConfigDescription("This is multiplied by the amount of time spent zapping to make the multiplier for the stun time. Decrease this to make stuns shorter, increase this to make them longer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.03f, 3f), Array.Empty<object>()));
			ZappableBigDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Zappable Facility Doors", true, "Allows you to hold open the big airlock/pressure doors in the facility interior while zapping them.");
			PlayerLethalBigDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Deadly Facility Doors", true, "Players will be killed by the big facility doors when they close (this usually includes if you try to walk through them while zapping them).");
			EnemyLethalBigDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Zap Gun & Hazards", "Facility Doors Deadly To Enemies", true, "Enemies are also killed if they happen to be caught in the facility doors (only if they are normally killable).");
			DustSpaceClouds = ((BaseUnityPlugin)this).Config.Bind<bool>("6. Better Dust Clouds", "Dust Space Clouds", true, "Adds a space to the 'DustClouds' weather whenever it's displayed, making it 'Dust Clouds' (note this weather is unused in vanilla, will only be present with certain modded content).");
			ThickDustClouds = ((BaseUnityPlugin)this).Config.Bind<bool>("6. Better Dust Clouds", "Thick Dust Clouds", false, "Makes Dust Clouds visually thicker and more obscuring, in addition to various other internal changes to how the weather is handled, completely replacing vanilla behaviour (note this weather is unused in vanilla, will only be present with certain modded content).");
			DustCloudsThickness = ((BaseUnityPlugin)this).Config.Bind<float>("6. Better Dust Clouds", "Dust Clouds Thickness", 8f, new ConfigDescription("How far you should be able to see in Dust Clouds (lower means thicker clouds). Vanilla value is 17.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 40f), Array.Empty<object>()));
			DustCloudsNoise = ((BaseUnityPlugin)this).Config.Bind<bool>("6. Better Dust Clouds", "Dust Clouds Noise", false, "Adds howling wind noise during Dust Clouds weather, the same you hear on blizzard moons like Rend and Dine (note this weather is unused in vanilla, will only be present with certain modded content).");
			PreventWorthlessDespawn = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Selective Scrap Keeping", "Keep Worthless Scrap", true, "You won't lose scrap with zero value after your full crew dies.");
			UsePreventDespawnList = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Selective Scrap Keeping", "Keep Specific Scrap", false, "You won't lose scrap from the list in the following config option.");
			PreventedDespawnList = ((BaseUnityPlugin)this).Config.Bind<string>("7. Selective Scrap Keeping", "Scrap To Keep", "Shotgun", "Comma separated list of items that should be kept even if everybody dies (e.g. 'Shotgun, Frieren').");
			ZeroDespawnPreventedItems = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Selective Scrap Keeping", "Zero Kept Scrap", true, "When a piece of scrap from the prior config list is kept, its scrap value is set to zero.");
			CustomWorthlessDisplayText = ((BaseUnityPlugin)this).Config.Bind<string>("7. Selective Scrap Keeping", "Worthless Display Text", "Value: Priceless", "Custom scan text to display for scrap items with zero value when it's brought back to the ship (set to empty to skip)");
			WorthlessDisplayTextBlacklist = ((BaseUnityPlugin)this).Config.Bind<string>("7. Selective Scrap Keeping", "Worthless Display Text Blacklist", "Shotgun", "Comma separated list of scrap items that will not have their scan text changed.");
			ShotgunMasterDisable = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Master Disable", false, "Reject all changes made by this mod to shotguns, leaving vanilla behaviour untouched (turn this on to disable all shotgun changes).");
			ShowAmmo = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Show Loaded Shells", false, "Shows how many shells your shotgun has left in the top-right tooltips.");
			SafetyOnString = ((BaseUnityPlugin)this).Config.Bind<string>("8. Shotgun QOL", "Shotgun Safety On Tooltip", "The safety is on", "Customize the tooltip for the shotgun safety toggle (vanilla: 'Turn safety off').");
			SafetyOffString = ((BaseUnityPlugin)this).Config.Bind<string>("8. Shotgun QOL", "Shotgun Safety Off Tooltip", "The safety is off", "Customize the tooltip for the shotgun safety toggle (vanilla: 'Turn safety on').");
			UnloadShells = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Unload Shells", false, "Allows you to eject shells already in the shotgun by holding the reload button (E) while you have no shells to load in your inventory. Top-right tooltips are dynamically adjusted accordingly.");
			DoAmmoCheck = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Check and Unload Animation", false, "When pressing reload while unable to reload, the shotgun will open to reveal how many shells it has. Enabling this will also mean the eject shells function (which has you holding down the reload button) will be animated.");
			PickUpGunOrbit = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Pick Up Gun In Orbit", false, "Allows you to pick up the gun while the ship is in orbit.");
			PickUpShellsOrbit = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Shotgun QOL", "Pick Up Shells In Orbit", true, "Allows you to pick up shells while the ship is in orbit (enabled for ease of use with 'Unload Shells').");
			BlackoutOnApparatusRemoval = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Apparatus True Blackout", false, "Triggers a more comprehensive blackout on apparatus removal, affecting all lights inside and out, along with any emissive materials (does not affects sun).");
			DisableTrapsOnApparatusRemoval = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Apparatus Hazard Blackout", false, "Disables all traps/hazards on the map after removing the apparatus.");
			DisableTrapsOnBreakerSwitch = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Breaker Hazard Blackout", false, "Also disables all traps/hazards on the map when the breaker power is switched off.");
			TrueBlackout = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "MrovWeathers True Blackout", true, "Revamps MrovWeathers' blackout so emissive materials are also darkened (no white spots left over), more lights are included, and problematic ones are excluded (like map hazards and outdoor apparatuses).");
			BlackoutSFX = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Blackout Sound Effect", true, "Plays a global sound effect when a blackout of any kind occurs.");
			TrueBlackoutNameBlacklist = ((BaseUnityPlugin)this).Config.Bind<string>("9. Blackout", "MrovWeathers True Blackout Name Blacklist", "GunBarrelPos, BulletParticleFlare, LightSphere, Landmine, AnimContainer, BlackoutIgnore, ItemShip, ThrusterContainer", "A blacklist of object names to leave untouched during a blackout. If a light object's parent has the same name as one of these names, it will be skipped. This must be a comma-separated list and is case-sensitive. It is highly recommended you do not remove any of the default values unless you really know what you're doing.");
			TrueBlackoutHierarchyBlacklist = ((BaseUnityPlugin)this).Config.Bind<string>("9. Blackout", "MrovWeathers True Blackout Hierarchy Blacklist", "", "A blacklist of objects to leave untouched during a blackout. If a light object is found anywhere underneath these names in the hierarchy, it will be skipped. This must be a comma-separated list and is case-sensitive. It is recommended to use Name Blacklist whenever possible for performance reasons.");
			BlacklistLightAnimators = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Ignore Animators", false, "Exclude any lights associated with animations (will not exclude any manually included animators, such as the vanilla light switches). With mods like Facility Meltdown (or any mod/moon which animates lights), this will allow the lights to animate as usual rather than being blacked out.");
			BlacklistPoles = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Ignore Guidance Poles", false, "Exclude the guidance pole lights found on moons like Rend, Dine, and Titan.");
			BlacklistEmergency = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Ignore Emergency Exit Lights", false, "Exclude the red lights mounted on interior emergency exits.");
			BlackoutOnlySun = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Blackout", "Only Blackout Sun", false, "The blackout weather will only blackout the sun and no other lights.");
			BlackoutFloodLightIntensity = ((BaseUnityPlugin)this).Config.Bind<int>("9. Blackout", "Ship Floodlight Intensity in Lumen", 30000, new ConfigDescription("Lumen value of the ship's floodlights during MrovWeathers' blackout, (vanilla is 2275 Lumens). Set to 0 to disable floodlights during blackouts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 60000), Array.Empty<object>()));
			BlackoutFloodLightAngle = ((BaseUnityPlugin)this).Config.Bind<int>("9. Blackout", "Ship Floodlight Angle in degrees", 80, new ConfigDescription("Light angle (degrees) of the ship's floodlights during MrovWeathers' blackout, (vanilla is 115 degrees).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 180), Array.Empty<object>()));
			BlackoutFloodLightRange = ((BaseUnityPlugin)this).Config.Bind<int>("9. Blackout", "Ship Floodlight Range", 600, new ConfigDescription("Light range (meters) of the ship's floodlights during MrovWeathers' blackout, (vanilla is 44m)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 2000), Array.Empty<object>()));
			JLLNoisemakerFix = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "JLL Noisemaker Fix", true, "Fixes an inconsistent issue where JLL spawners wouldn't initialize items correctly, resulting in errors and the item not functioning correctly (for example: Wesley's Moons audio logs not playing when used).");
			LLLUnlockSyncing = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "LLL Unlock Syncing", false, "Sends the host's unlocked moons to the clients after they load in, so any moons unlocked by the host will be unlocked by the client as well.");
			LLLShipLeverFix = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "LLL Ship Lever Fix", true, "Fixes the ship lever remaining interactable while routing.");
			VideoTapeInsertFix = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "Wesley Moons Tape Insert Fix", false, "EXPERIMENTAL - For Wesley's Moons: attempts to fix an issue where clients are unable to insert cassette tapes into the projector (might also fix issues with registering story log items).");
			VideoTapeSkip = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "Wesley Moons Video Tape Skip", false, "For Wesley's Moons: after inserting a casette tape on Galetry, you can interact with the cassette player again to skip the video and unlock the moon immediately.");
			ShipWindowsShutterFix = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "ShipWindowsBeta Shutter Fix", true, "Closes the ship window shutters when taking off from a planet (requires you to have 'Hide Moon Transitions' enabled in ShipWindowsBeta config).");
			MrovWeatherTweaksAnnouncement = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "Weather Tweaks Announcement Change", true, "Makes the wording more clear when a weather change is announced, stating the current weather and the weather it's going to be transitioned into.");
			SSSTerminalStock = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "Smart Cupboard Mrov Terminal Stock", true, "If you are using both Self Sorting Storage (which adds the 'smart cupboard') and mrov's TerminalFormatter (which shows a count of items on the ship), items in the cupboard will be counted on the terminal display.");
			DiversityComputerBegone = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Mod Tweaks", "Diversity Computer Begone", false, "Removes the floppy reader computer from Diversity and any floppy disks that spawn (does nothing if Diversity isn't installed).");
			ClientsideMode = ((BaseUnityPlugin)this).Config.Bind<bool>("C. Technical", "Client-side Mode", false, "EXPERIMENTAL - Enable this if you want to use the mod client-side (i.e. if other players don't have the mod).");
			DebugMode = ((BaseUnityPlugin)this).Config.Bind<bool>("C. Technical", "Dev Mode", false, "For testing certain interactions and resetting some variables. Do not enable unless you know what you're doing.");
			ExtraLogs = ((BaseUnityPlugin)this).Config.Bind<bool>("C. Technical", "Verbose Logs", false, "Extra logging for debugging specific functions.");
			DisableWarnings = ((BaseUnityPlugin)this).Config.Bind<bool>("C. Technical", "Disable Warning Popups", false, "Disables all red warning boxes and their sound effects, vanilla and modded (e.g. when attempting to land with 0 days left).");
			InteriorLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("C. Technical", "Interior Analysis", false, "LLL REQUIRED - Logs the area and scrap density of the generated interior and its tiles.");
			ConfigTeleporterSize = new Vector3(TinyTeleporterSizeX.Value, TinyTeleporterSizeY.Value, TinyTeleporterSizeZ.Value);
			ConfigLeverSize = new Vector3(LargerLeverSizeX.Value, LargerLeverSizeY.Value, LargerLeverSizeZ.Value);
			KeepScrapPatches.Initialize();
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			TweaksAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "tweaksassets"));
			BlackoutTriggerPatches.LoadAssets();
			Patch();
			Logger.LogInfo((object)"ScienceBird.ScienceBirdTweaks v4.2.2 has loaded!");
		}

		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("ScienceBird.ScienceBirdTweaks");
			}
			Logger.LogDebug((object)"Patching...");
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly in assemblies)
			{
				if (assembly.GetName().Name == "BMX.LobbyCompatibility")
				{
					Logger.LogDebug((object)"Found BMX!");
					doLobbyCompat = true;
				}
				if (assembly.GetName().Name == "MrovWeathers")
				{
					Logger.LogDebug((object)"Found mrov1!");
					mrovPresent1 = true;
				}
				else if (assembly.GetName().Name == "WeatherRegistry")
				{
					Logger.LogDebug((object)"Found mrov2!");
					mrovPresent2 = true;
				}
				else if (assembly.GetName().Name == "TerminalFormatter")
				{
					Logger.LogDebug((object)"Found mrov3!");
					mrovPresent3 = true;
				}
				else if (assembly.GetName().Name == "WeatherTweaks")
				{
					Logger.LogDebug((object)"Found mrov4!");
					mrovPresent4 = true;
				}
				else if (assembly.GetName().Name == "SelfSortingStorage")
				{
					Logger.LogDebug((object)"Found zigzag!");
					zigzagPresent = true;
				}
				else if (assembly.GetName().Name == "WesleyMoons")
				{
					Logger.LogDebug((object)"Found wesley!");
					wesleyPresent = true;
				}
				else if (assembly.GetName().Name == "JLLItemsModule")
				{
					Logger.LogDebug((object)"Found jacob!");
					jacobPresent = true;
				}
				else if (assembly.GetName().Name == "LethalLevelLoader")
				{
					Logger.LogDebug((object)"Found batby!");
					batbyPresent = true;
				}
				else if (assembly.GetName().Name == "TestAccount666.ShipWindowsBeta")
				{
					Logger.LogDebug((object)"Found test1!");
					test1Present = true;
				}
				else if (assembly.GetName().Name == "TestAccount666.GoodItemScan")
				{
					Logger.LogDebug((object)"Found test2!");
					test2Present = true;
				}
			}
			if (doLobbyCompat)
			{
				LobbyCompatibility.RegisterCompatibility();
			}
			if (mrovPresent1 && mrovPresent2 && TrueBlackout.Value)
			{
				MrovWeathersPatch.DoPatching();
			}
			if (zigzagPresent && ((mrovPresent3 && SSSTerminalStock.Value) || PreventWorthlessDespawn.Value || UsePreventDespawnList.Value))
			{
				SSSPatches.DoPatching();
			}
			if (wesleyPresent && (VideoTapeSkip.Value || VideoTapeInsertFix.Value))
			{
				WesleyPatches.DoPatching();
			}
			if (batbyPresent)
			{
				LLLPatches.DoPatching();
			}
			if (jacobPresent && JLLNoisemakerFix.Value)
			{
				JLLPatches.DoPatching();
			}
			if (test1Present && ShipWindowsShutterFix.Value)
			{
				ShipWindowsPatch.DoPatching();
			}
			if (DynamicOccupancySign.Value || OccupancyFixedValue.Value != "None")
			{
				OccupancyPatch.LoadAssets();
			}
			Harmony.PatchAll();
			NetcodePatcher();
			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()
		{
			if (ClientsideMode.Value)
			{
				return;
			}
			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)
				{
					if (((!methodInfo.Name.Contains("CheckUnlocksClientRpc") && !methodInfo.Name.Contains("ConfigLoader")) || batbyPresent) && ((!methodInfo.Name.Contains("CollectDataServerRpc") && !methodInfo.Name.Contains("SendDataClientRpc") && !methodInfo.Name.Contains("ResetDictClientRpc")) || zigzagPresent) && ((!methodInfo.Name.Contains("StopTapeServerRpc") && !methodInfo.Name.Contains("StopTapeClientRpc")) || wesleyPresent))
					{
						object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
						if (customAttributes.Length != 0)
						{
							methodInfo.Invoke(null, null);
						}
					}
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "ScienceBird.ScienceBirdTweaks";

		public const string PLUGIN_NAME = "ScienceBirdTweaks";

		public const string PLUGIN_VERSION = "4.2.2";
	}
}
namespace ScienceBirdTweaks.ZapGun
{
	public class DoorZapper : NetworkBehaviour, IShockableWithGun
	{
		private TerminalAccessibleObject terminalObj;

		public bool stunned = false;

		public bool masterZappable = true;

		private void Start()
		{
			((Component)this).gameObject.layer = 21;
			terminalObj = ((Component)this).GetComponent<TerminalAccessibleObject>();
			masterZappable = ScienceBirdTweaks.ZappableBigDoors.Value && ScienceBirdTweaks.ZapGunRework.Value;
		}

		bool IShockableWithGun.CanBeShocked()
		{
			return !terminalObj.isDoorOpen && !stunned && masterZappable;
		}

		float IShockableWithGun.GetDifficultyMultiplier()
		{
			return 0.8f;
		}

		NetworkObject IShockableWithGun.GetNetworkObject()
		{
			return ((NetworkBehaviour)this).NetworkObject;
		}

		Vector3 IShockableWithGun.GetShockablePosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).gameObject.transform.position + new Vector3(0f, 2.5f, 0f);
		}

		Transform IShockableWithGun.GetShockableTransform()
		{
			return ((Component)this).gameObject.transform;
		}

		void IShockableWithGun.ShockWithGun(PlayerControllerB shockedByPlayer)
		{
			terminalObj.SetDoorOpen(true);
			stunned = true;
		}

		void IShockableWithGun.StopShockingWithGun()
		{
			stunned = false;
			terminalObj.SetDoorOpen(false);
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "DoorZapper";
		}
	}
	[HarmonyPatch]
	public class HazardPatches
	{
		public static GameObject doorPrefab;

		public static Color spikesGreen = new Color(0.3254902f, 1f, 0.3679014f, 1f);

		public static AudioClip disabledBeep;

		public static Material disabledMat;

		public static Material offMat;

		public static RuntimeAnimatorController newController;

		public static bool extraTrigger = false;

		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		[HarmonyPostfix]
		public static void InitializeAssets()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			if (ScienceBirdTweaks.SpikeTrapDisableAnimation.Value || ScienceBirdTweaks.MineDisableAnimation.Value || ScienceBirdTweaks.ZapGunRework.Value)
			{
				doorPrefab = (GameObject)ScienceBirdTweaks.TweaksAssets.LoadAsset("DoorKillTrigger");
				disabledMat = (Material)ScienceBirdTweaks.TweaksAssets.LoadAsset("SpikeRoofTrapDisabledMat");
				offMat = (Material)ScienceBirdTweaks.TweaksAssets.LoadAsset("SpikeRoofTrapOffMat");
				disabledBeep = (AudioClip)ScienceBirdTweaks.TweaksAssets.LoadAsset("SingleBeep");
				newController = (RuntimeAnimatorController)ScienceBirdTweaks.TweaksAssets.LoadAsset("landmineAltController");
			}
		}

		[HarmonyPatch(typeof(TerminalAccessibleObject), "Start")]
		[HarmonyPostfix]
		private static void BigDoorsPatch(TerminalAccessibleObject __instance)
		{
			if (__instance.isBigDoor && (ScienceBirdTweaks.PlayerLethalBigDoors.Value || ScienceBirdTweaks.EnemyLethalBigDoors.Value) && ScienceBirdTweaks.ZapGunRework.Value)
			{
				if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.transform.Find("DoorKillTrigger(Clone)")))
				{
					InitializeBigDoors(__instance);
				}
				((Component)__instance).gameObject.AddComponent<DoorZapper>();
			}
		}

		public static void InitializeBigDoors(TerminalAccessibleObject terminalObj)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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)
			GameObject val = Object.Instantiate<GameObject>(doorPrefab, Vector3.zero, Quaternion.Euler(-90f, 0f, 0f));
			val.transform.SetParent(((Component)terminalObj).gameObject.transform, false);
			GameObject gameObject = ((Component)val.transform.Find("Trigger")).gameObject;
			gameObject.transform.localPosition = new Vector3(0f, 2f, -2.623f);
			gameObject.AddComponent<KillOnStay>();
			Transform val2 = ((Component)terminalObj).gameObject.transform.Find("BigDoorLeft");
			Transform val3 = ((Component)terminalObj).gameObject.transform.Find("BigDoorRight");
			((Component)val2).gameObject.layer = 21;
			((Component)val3).gameObject.layer = 21;
		}

		[HarmonyPatch(typeof(TerminalAccessibleObject), "SetDoorOpen")]
		[HarmonyPostfix]
		public static void DoorClosePatch(TerminalAccessibleObject __instance, bool open)
		{
			if (__instance.isBigDoor && (ScienceBirdTweaks.PlayerLethalBigDoors.Value || ScienceBirdTweaks.EnemyLethalBigDoors.Value) && ScienceBirdTweaks.ZapGunRework.Value)
			{
				if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.transform.Find("DoorKillTrigger(Clone)")))
				{
					InitializeBigDoors(__instance);
				}
				if (Object.op_Implicit((Object)(object)((Component)__instance).gameObject.transform.Find("DoorKillTrigger(Clone)").Find("Trigger")))
				{
					GameObject gameObject = ((Component)((Component)__instance).gameObject.transform.Find("DoorKillTrigger(Clone)")).gameObject;
					GameObject gameObject2 = ((Component)gameObject.transform.Find("Trigger")).gameObject;
					gameObject.GetComponent<Animator>().SetBool("open", open);
				}
			}
		}

		[HarmonyPatch(typeof(SpikeRoofTrap), "ToggleSpikesEnabledLocalClient")]
		[HarmonyPostfix]
		public static void SpikeCooldownPatch(SpikeRoofTrap __instance, bool enabled)
		{
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			if (!ScienceBirdTweaks.SpikeTrapDisableAnimation.Value && !ScienceBirdTweaks.ZapGunRework.Value)
			{
				return;
			}
			GameObject gameObject = ((Component)((Component)__instance).gameObject.transform.parent).gameObject;
			SpikesZapper componentInChildren = gameObject.GetComponentInChildren<SpikesZapper>();
			if (!((Object)(object)componentInChildren != (Object)null) || componentInChildren.tempStun)
			{
				return;
			}
			if (!enabled)
			{
				if (BlackoutTriggerPatches.doingHazardShutdown)
				{
					componentInChildren.light.intensity = 0f;
					Material[] materials = ((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials;
					materials[0] = offMat;
					((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials = materials;
					return;
				}
				ScienceBirdTweaks.Logger.LogDebug((object)"Starting spike trap special animation!");
				componentInChildren.light.intensity = 2f;
				componentInChildren.light.colorTemperature = 6580f;
				componentInChildren.light.color = spikesGreen;
				Material[] materials2 = ((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials;
				materials2[0] = disabledMat;
				((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials = materials2;
				componentInChildren.startRoutine = true;
			}
			else
			{
				ScienceBirdTweaks.Logger.LogDebug((object)"Ending spike trap special animation!");
				if (!((Object)(object)componentInChildren == (Object)null))
				{
					componentInChildren.light.intensity = 1.172347f;
					componentInChildren.light.colorTemperature = 1500f;
					componentInChildren.light.color = Color.white;
					Material[] materials3 = ((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials;
					materials3[0] = componentInChildren.originalMat;
					((Renderer)componentInChildren.supportLights.GetComponent<MeshRenderer>()).materials = materials3;
				}
			}
		}

		[HarmonyPatch(typeof(Landmine), "TriggerMineOnLocalClientByExiting")]
		[HarmonyPrefix]
		public static bool DetonateCheck1(Landmine __instance)
		{
			if (!ScienceBirdTweaks.MineDisableAnimation.Value && !ScienceBirdTweaks.ZapGunRework.Value)
			{
				return true;
			}
			if (!__instance.mineActivated || (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<MineZapper>()) && (((Component)__instance).GetComponent<MineZapper>().tempStun || ((Component)__instance).GetComponent<MineZapper>().light1.intensity == 0f)))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Landmine), "SetOffMineAnimation")]
		[HarmonyPrefix]
		public static bool DetonateCheck2(Landmine __instance)
		{
			if (!ScienceBirdTweaks.MineDisableAnimation.Value && !ScienceBirdTweaks.ZapGunRework.Value)
			{
				return true;
			}
			if (!__instance.mineActivated || (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<MineZapper>()) && (((Component)__instance).GetComponent<MineZapper>().tempStun || ((Component)__instance).GetComponent<MineZapper>().light1.intensity == 0f)))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Landmine), "OnTriggerExit")]
		[HarmonyPrefix]
		public static void MineTriggerExitFix(Landmine __instance, Collider other)
		{
			if (ScienceBirdTweaks.LandmineFix.Value && !__instance.mineActivated && ((Component)other).CompareTag("Player"))
			{
				PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
				if ((Object)(object)component != (Object)null && !component.isPlayerDead && !((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController))
				{
					__instance.localPlayerOnMine = false;
				}
			}
		}

		[HarmonyPatch(typeof(Landmine), "ToggleMineEnabledLocalClient")]
		[HarmonyPostfix]
		public static void MineCooldownPatch(Landmine __instance, bool enabled)
		{
			if (!ScienceBirdTweaks.MineDisableAnimation.Value && !ScienceBirdTweaks.ZapGunRework.Value)
			{
				return;
			}
			MineZapper component = ((Component)__instance).GetComponent<MineZapper>();
			if (!((Object)(object)component != (Object)null) || component.tempStun || component.disabled)
			{
				return;
			}
			if (!enabled)
			{
				if (BlackoutTriggerPatches.doingHazardShutdown)
				{
					__instance.mineAudio.Stop();
					__instance.mineAudio.volume = 0f;
					component.light1.intensity = 0f;
					component.light2.intensity = 0f;
					component.indirectLight.intensity = 0f;
				}
				else
				{
					ScienceBirdTweaks.Logger.LogDebug((object)"Starting landmine special animation!");
					__instance.mineAnimator.SetBool("disabled", true);
					component.light1.intensity = 227.6638f;
					component.light2.intensity = 227.6638f;
					component.indirectLight.intensity = 436.6049f;
					component.startRoutine = true;
					extraTrigger = true;
				}
			}
			else if (BlackoutTriggerPatches.doingHazardStartup)
			{
				__instance.mineAudio.Play();
				__instance.mineAudio.volume = 1f;
				component.light1.intensity = 227.6638f;
				component.light2.intensity = 227.6638f;
				component.indirectLight.intensity = 436.6049f;
			}
			else
			{
				ScienceBirdTweaks.Logger.LogDebug((object)"Ending landmine special animation!");
				__instance.mineAnimator.SetBool("disabled", false);
			}
		}
	}
	public class KillOnStay : MonoBehaviour
	{
		public bool dontSpawnBody;

		public CauseOfDeath causeOfDeath = (CauseOfDeath)8;

		public bool justDamage;

		public int deathAnimation;

		[Space(5f)]
		public int playAudioOnDeath = -1;

		public GameObject spawnPrefab;

		public bool disallowKillingInShip;

		public void KillPlayer(PlayerControllerB playerWhoTriggered)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			if (justDamage)
			{
				playerWhoTriggered.DamagePlayer(25, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				return;
			}
			if (playAudioOnDeath != -1)
			{
				SoundManager.Instance.PlayAudio1AtPositionForAllClients(((Component)playerWhoTriggered).transform.position, playAudioOnDeath);
			}
			if ((Object)(object)spawnPrefab != (Object)null)
			{
				Object.Instantiate<GameObject>(spawnPrefab, ((Component)playerWhoTriggered.lowerSpine).transform.position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
			}
			playerWhoTriggered.KillPlayer(Vector3.zero, !dontSpawnBody, causeOfDeath, deathAnimation, default(Vector3));
		}

		private void OnTriggerStay(Collider other)
		{
			if (ScienceBirdTweaks.PlayerLethalBigDoors.Value && ((Component)other).gameObject.CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent<PlayerControllerB>()) && ((NetworkBehaviour)((Component)other).gameObject.GetComponent<PlayerControllerB>()).IsOwner && !((Component)other).gameObject.GetComponent<PlayerControllerB>().isPlayerDead)
			{
				KillPlayer(((Component)other).gameObject.GetComponent<PlayerControllerB>());
			}
			if (ScienceBirdTweaks.EnemyLethalBigDoors.Value && ((NetworkBehaviour)RoundManager.Instance).IsServer && ((Component)other).CompareTag("Enemy"))
			{
				EnemyAICollisionDetect component = ((Component)other).gameObject.GetComponent<EnemyAICollisionDetect>();
				if ((Object)(object)component != (Object)null && !component.mainScript.isEnemyDead)
				{
					component.mainScript.KillEnemyOnOwnerClient(false);
				}
			}
		}
	}
	public class MineZapper : NetworkBehaviour, IShockableWithGun
	{
		private Landmine mine;

		private TerminalAccessibleObject terminalObj;

		public float cooldown = 3.2f;

		private float cooldownTimer;

		private float startTime;

		private float effectiveCooldown;

		public Light light1;

		public Light light2;

		public Light indirectLight;

		public bool tempStun = false;

		public bool startRoutine = false;

		public bool masterZappable = true;

		public float multiplier = 0.25f;

		public bool disabled = false;

		private void Start()
		{
			mine = ((Component)this).GetComponent<Landmine>();
			terminalObj = ((Component)this).GetComponent<TerminalAccessibleObject>();
			Light[] componentsInChildren = ((Component)this).GetComponentsInChildren<Light>();
			Light[] array = componentsInChildren;
			foreach (Light val in array)
			{
				if (((Object)((Component)val).gameObject).name == "BrightLight")
				{
					light1 = val;
				}
				if (((Object)((Component)val).gameObject).name == "BrightLight2")
				{
					light2 = val;
				}
				if (((Object)((Component)val).gameObject).name == "IndirectLight")
				{
					indirectLight = val;
				}
			}
			Animator component = ((Component)mine).gameObject.GetComponent<Animator>();
			if ((Object)(object)component == (Object)null)
			{
				disabled = true;
				return;
			}
			component.runtimeAnimatorController = HazardPatches.newController;
			masterZappable = ScienceBirdTweaks.ZappableMines.Value && ScienceBirdTweaks.ZapGunRework.Value;
			cooldown = ScienceBirdTweaks.MineZapBaseCooldown.Value;
			multiplier = ScienceBirdTweaks.ZapScalingFactor.Value;
		}

		bool IShockableWithGun.CanBeShocked()
		{
			return !mine.hasExploded && !terminalObj.inCooldown && masterZappable && !disabled;
		}

		float IShockableWithGun.GetDifficultyMultiplier()
		{
			return 0.5f;
		}

		NetworkObject IShockableWithGun.GetNetworkObject()
		{
			return ((NetworkBehaviour)this).NetworkObject;
		}

		Vector3 IShockableWithGun.GetShockablePosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).gameObject.transform.position + new Vector3(0f, 0.5f, 0f);
		}

		Transform IShockableWithGun.GetShockableTransform()
		{
			return ((Component)this).gameObject.transform;
		}

		void IShockableWithGun.ShockWithGun(PlayerControllerB shockedByPlayer)
		{
			if (!terminalObj.inCooldown && !tempStun)
			{
				startRoutine = false;
				light1.intensity = 0f;
				light2.intensity = 0f;
				indirectLight.intensity = 0f;
				tempStun = true;
				startTime = Time.realtimeSinceStartup;
				mine.ToggleMineEnabledLocalClient(false);
				terminalObj.inCooldown = true;
			}
		}

		void IShockableWithGun.StopShockingWithGun()
		{
			if (terminalObj.inCooldown && tempStun)
			{
				tempStun = false;
				float num = Time.realtimeSinceStartup - startTime;
				mine.mineActivated = true;
				mine.ToggleMineEnabledLocalClient(false);
				effectiveCooldown = cooldown * (num * multiplier);
				cooldownTimer = effectiveCooldown;
				ScienceBirdTweaks.Logger.LogDebug((object)$"Freezing for {cooldownTimer}s ({num * multiplier}x normal)");
				((MonoBehaviour)this).StartCoroutine(mineCoolDown());
			}
		}

		private IEnumerator mineCoolDown()
		{
			while (!startRoutine)
			{
				yield return null;
			}
			startRoutine = false;
			if (!terminalObj.initializedValues)
			{
				terminalObj.InitializeValues();
			}
			Image cooldownBar = terminalObj.mapRadarBox;
			Image[] componentsInChildren = ((Component)terminalObj.mapRadarText).gameObject.GetComponentsInChildren<Image>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if ((int)componentsInChildren[i].type == 3)
				{
					cooldownBar = componentsInChildren[i];
				}
			}
			((Behaviour)cooldownBar).enabled = true;
			((Graphic)terminalObj.mapRadarText).color = Color.red;
			((Graphic)terminalObj.mapRadarBox).color = Color.red;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = cooldownTimer / effectiveCooldown;
			}
			terminalObj.TerminalCodeCooldownReached();
			((Graphic)terminalObj.mapRadarText).color = Color.green;
			((Graphic)terminalObj.mapRadarBox).color = Color.green;
			cooldownTimer = 1.5f;
			int frameNum = 0;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = Mathf.Abs(cooldownTimer / 1.5f - 1f);
				frameNum++;
				if (frameNum % 7 == 0)
				{
					((Behaviour)terminalObj.mapRadarText).enabled = !((Behaviour)terminalObj.mapRadarText).enabled;
				}
			}
			((Behaviour)terminalObj.mapRadarText).enabled = true;
			((Behaviour)cooldownBar).enabled = false;
			terminalObj.inCooldown = false;
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "MineZapper";
		}
	}
	public class SpikesZapper : NetworkBehaviour, IShockableWithGun
	{
		private SpikeRoofTrap spikes;

		private TerminalAccessibleObject terminalObj;

		public GameObject mainObj;

		public float cooldown = 7f;

		private float cooldownTimer;

		private float startTime;

		private float effectiveCooldown;

		public Light light;

		public GameObject supportLights;

		public bool tempStun = false;

		public Material originalMat;

		public bool startRoutine = false;

		public bool masterZappable = true;

		public float multiplier = 0.25f;

		private void Start()
		{
			mainObj = ((Component)((Component)this).transform.parent.parent).gameObject;
			supportLights = ((Component)mainObj.transform.Find("AnimContainer").Find("BaseSupport")).gameObject;
			mainObj.layer = 21;
			light = ((Component)this).GetComponent<Light>();
			spikes = mainObj.GetComponentInChildren<SpikeRoofTrap>();
			terminalObj = mainObj.GetComponentInChildren<TerminalAccessibleObject>();
			originalMat = ((Renderer)supportLights.GetComponent<MeshRenderer>()).materials[0];
			masterZappable = ScienceBirdTweaks.ZappableSpikeTraps.Value && ScienceBirdTweaks.ZapGunRework.Value;
			cooldown = ScienceBirdTweaks.SpikeTrapBaseCooldown.Value;
			multiplier = ScienceBirdTweaks.ZapScalingFactor.Value;
		}

		bool IShockableWithGun.CanBeShocked()
		{
			return spikes.trapActive && !terminalObj.inCooldown && masterZappable;
		}

		float IShockableWithGun.GetDifficultyMultiplier()
		{
			return 0.7f;
		}

		NetworkObject IShockableWithGun.GetNetworkObject()
		{
			return ((NetworkBehaviour)this).NetworkObject;
		}

		Vector3 IShockableWithGun.GetShockablePosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).gameObject.transform.position;
		}

		Transform IShockableWithGun.GetShockableTransform()
		{
			return ((Component)this).gameObject.transform;
		}

		void IShockableWithGun.ShockWithGun(PlayerControllerB shockedByPlayer)
		{
			if (!terminalObj.inCooldown && !tempStun)
			{
				startRoutine = false;
				startTime = Time.realtimeSinceStartup;
				tempStun = true;
				spikes.ToggleSpikesEnabledLocalClient(false);
				terminalObj.inCooldown = true;
			}
		}

		void IShockableWithGun.StopShockingWithGun()
		{
			if (terminalObj.inCooldown && tempStun)
			{
				tempStun = false;
				float num = Time.realtimeSinceStartup - startTime;
				spikes.trapActive = true;
				spikes.ToggleSpikesEnabledLocalClient(false);
				effectiveCooldown = cooldown * (num * multiplier);
				cooldownTimer = effectiveCooldown;
				ScienceBirdTweaks.Logger.LogDebug((object)$"Freezing for {cooldownTimer}s ({num * multiplier}x normal)");
				((MonoBehaviour)this).StartCoroutine(spikesCoolDown());
			}
		}

		private IEnumerator spikesCoolDown()
		{
			while (!startRoutine)
			{
				yield return null;
			}
			startRoutine = false;
			if (!terminalObj.initializedValues)
			{
				terminalObj.InitializeValues();
			}
			Image cooldownBar = terminalObj.mapRadarBox;
			Image[] componentsInChildren = ((Component)terminalObj.mapRadarText).gameObject.GetComponentsInChildren<Image>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if ((int)componentsInChildren[i].type == 3)
				{
					cooldownBar = componentsInChildren[i];
				}
			}
			((Behaviour)cooldownBar).enabled = true;
			((Graphic)terminalObj.mapRadarText).color = Color.red;
			((Graphic)terminalObj.mapRadarBox).color = Color.red;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = cooldownTimer / effectiveCooldown;
			}
			terminalObj.TerminalCodeCooldownReached();
			((Graphic)terminalObj.mapRadarText).color = Color.green;
			((Graphic)terminalObj.mapRadarBox).color = Color.green;
			cooldownTimer = 1.5f;
			int frameNum = 0;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = Mathf.Abs(cooldownTimer / 1.5f - 1f);
				frameNum++;
				if (frameNum % 7 == 0)
				{
					((Behaviour)terminalObj.mapRadarText).enabled = !((Behaviour)terminalObj.mapRadarText).enabled;
				}
			}
			((Behaviour)terminalObj.mapRadarText).enabled = true;
			((Behaviour)cooldownBar).enabled = false;
			terminalObj.inCooldown = false;
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SpikesZapper";
		}
	}
	public class TurretZapper : NetworkBehaviour, IShockableWithGun
	{
		private Turret turret;

		private TerminalAccessibleObject terminalObj;

		public bool panicMode = false;

		public float cooldown = 7f;

		private float cooldownTimer;

		private float startTime;

		private float effectiveCooldown;

		public Quaternion savedRot;

		public float savedTimer;

		private bool restoredRot = true;

		public bool masterZappable = true;

		public float multiplier = 0.25f;

		private void Start()
		{
			turret = ((Component)this).GetComponent<Turret>();
			terminalObj = ((Component)this).GetComponent<TerminalAccessibleObject>();
			ScienceBirdTweaks.Logger.LogDebug((object)turret);
			masterZappable = ScienceBirdTweaks.ZappableTurrets.Value && ScienceBirdTweaks.ZapGunRework.Value;
			cooldown = ScienceBirdTweaks.TurretZapBaseCooldown.Value;
			multiplier = ScienceBirdTweaks.ZapScalingFactor.Value;
		}

		bool IShockableWithGun.CanBeShocked()
		{
			return turret.turretActive && !panicMode && !terminalObj.inCooldown && masterZappable;
		}

		float IShockableWithGun.GetDifficultyMultiplier()
		{
			return 1f;
		}

		NetworkObject IShockableWithGun.GetNetworkObject()
		{
			return ((NetworkBehaviour)this).NetworkObject;
		}

		Vector3 IShockableWithGun.GetShockablePosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).gameObject.transform.position;
		}

		Transform IShockableWithGun.GetShockableTransform()
		{
			return ((Component)this).gameObject.transform;
		}

		void IShockableWithGun.ShockWithGun(PlayerControllerB shockedByPlayer)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Invalid comparison between Unknown and I4
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			if (terminalObj.inCooldown || panicMode || !((Object)(object)terminalObj != (Object)null))
			{
				return;
			}
			startTime = Time.realtimeSinceStartup;
			if ((int)turret.turretMode > 0)
			{
				turret.rotatingClockwise = false;
				turret.SwitchTurretMode(0);
				turret.turretAnimator.SetInteger("TurretMode", 1);
				if (turret.fadeBulletAudioCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(turret.fadeBulletAudioCoroutine);
				}
				turret.fadeBulletAudioCoroutine = ((MonoBehaviour)this).StartCoroutine(turret.FadeBulletAudio());
				turret.bulletParticles.Stop(true, (ParticleSystemStopBehavior)1);
			}
			terminalObj.inCooldown = true;
			turret.mainAudio.Stop();
			turret.farAudio.Stop();
			turret.turretActive = false;
			turret.berserkAudio.Play();
			turret.rotationSpeed = 336f;
			turret.rotatingSmoothly = true;
			turret.wasTargetingPlayerLastFrame = false;
			turret.targetPlayerWithRotation = null;
			savedTimer = turret.switchRotationTimer;
			savedRot = turret.turretRod.rotation;
			panicMode = true;
		}

		void IShockableWithGun.StopShockingWithGun()
		{
			if (terminalObj.inCooldown && panicMode)
			{
				panicMode = false;
				float num = Time.realtimeSinceStartup - startTime;
				turret.turretActive = true;
				turret.berserkAudio.Stop();
				restoredRot = false;
				turret.rotationSpeed = 28f;
				((UnityEvent<PlayerControllerB>)(object)terminalObj.terminalCodeEvent).Invoke(GameNetworkManager.Instance.localPlayerController);
				effectiveCooldown = cooldown * (num * multiplier);
				cooldownTimer = effectiveCooldown;
				ScienceBirdTweaks.Logger.LogDebug((object)$"Freezing for {cooldownTimer}s ({num * multiplier}x normal)");
				((MonoBehaviour)this).StartCoroutine(turretCoolDown());
			}
		}

		private void Update()
		{
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			if (panicMode && terminalObj.inCooldown)
			{
				if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost)
				{
					if (turret.switchRotationTimer >= 7f)
					{
						turret.switchRotationTimer = 0f;
						bool flag = !turret.rotatingRight;
						turret.SwitchRotationClientRpc(flag);
						turret.SwitchRotationOnInterval(flag);
					}
					else
					{
						Turret obj = turret;
						obj.switchRotationTimer += Time.deltaTime * 12f;
					}
				}
				if (turret.rotatingClockwise)
				{
					turret.turnTowardsObjectCompass.localEulerAngles = new Vector3(-180f, turret.turretRod.localEulerAngles.y - Time.deltaTime * 20f, 180f);
					turret.turretRod.rotation = Quaternion.RotateTowards(turret.turretRod.rotation, turret.turnTowardsObjectCompass.rotation, turret.rotationSpeed * Time.deltaTime);
					return;
				}
				if (turret.rotatingSmoothly)
				{
					turret.turnTowardsObjectCompass.localEulerAngles = new Vector3(-180f, Mathf.Clamp(turret.targetRotation, 0f - turret.rotationRange, turret.rotationRange), 180f);
				}
				turret.turretRod.rotation = Quaternion.RotateTowards(turret.turretRod.rotation, turret.turnTowardsObjectCompass.rotation, turret.rotationSpeed * Time.deltaTime);
			}
			else if (!restoredRot && terminalObj.inCooldown)
			{
				turret.turretRod.rotation = Quaternion.Slerp(turret.turretRod.rotation, savedRot, Time.deltaTime / cooldownTimer);
			}
		}

		private IEnumerator turretCoolDown()
		{
			if (!((Object)(object)terminalObj != (Object)null))
			{
				yield break;
			}
			if (!terminalObj.initializedValues)
			{
				terminalObj.InitializeValues();
			}
			Image cooldownBar = terminalObj.mapRadarBox;
			Image[] componentsInChildren = ((Component)terminalObj.mapRadarText).gameObject.GetComponentsInChildren<Image>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if ((int)componentsInChildren[i].type == 3)
				{
					cooldownBar = componentsInChildren[i];
				}
			}
			((Behaviour)cooldownBar).enabled = true;
			((Graphic)terminalObj.mapRadarText).color = Color.red;
			((Graphic)terminalObj.mapRadarBox).color = Color.red;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = cooldownTimer / effectiveCooldown;
			}
			terminalObj.TerminalCodeCooldownReached();
			((Graphic)terminalObj.mapRadarText).color = Color.green;
			((Graphic)terminalObj.mapRadarBox).color = Color.green;
			cooldownTimer = 1.5f;
			int frameNum = 0;
			while (cooldownTimer > 0f)
			{
				yield return null;
				cooldownTimer -= Time.deltaTime;
				cooldownBar.fillAmount = Mathf.Abs(cooldownTimer / 1.5f - 1f);
				frameNum++;
				if (frameNum % 7 == 0)
				{
					((Behaviour)terminalObj.mapRadarText).enabled = !((Behaviour)terminalObj.mapRadarText).enabled;
				}
			}
			((Behaviour)terminalObj.mapRadarText).enabled = true;
			((Behaviour)cooldownBar).enabled = false;
			terminalObj.inCooldown = false;
			turret.turretRod.rotation = savedRot;
			if (((NetworkBehaviour)this).IsServer)
			{
				turret.switchRotationTimer = savedTimer;
			}
			restoredRot = true;
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "TurretZapper";
		}
	}
	[HarmonyPatch]
	public class ZapPatches
	{
		public static bool goingRight;

		public static bool goingLeft;

		public static GameObject leftArrow;

		public static GameObject rightArrow;

		public static bool doTutorialOverride = false;

		public static int tutorialCount = 2;

		public static Dictionary<int, int> layerDict;

		public static int layersLength;

		public static RectTransform image1;

		public static RectTransform image2;

		public static PatcherTool currentZapInstance;

		public static float tVal = 0f;

		public static float bendInterpolate = 0f;

		[HarmonyPatch(typeof(Landmine), "Start")]
		[HarmonyPostfix]
		private static void MinePatch(ref Landmine __instance)
		{
			if (ScienceBirdTweaks.ZapGunRework.Value || ScienceBirdTweaks.MineDisableAnimation.Value)
			{
				((Component)__instance).gameObject.AddComponent<MineZapper>();
				MineAudio mineAudio = ((Component)__instance).gameObject.AddComponent<MineAudio>();
				mineAudio.audioSource = ((Component)__instance).gameObject.GetComponent<AudioSource>();
				mineAudio.beepClip = HazardPatches.disabledBeep;
			}
		}

		[HarmonyPatch(typeof(Turret), "Start")]
		[HarmonyPostfix]
		private static void TurretPatch(ref Turret __instance)
		{
			if (ScienceBirdTweaks.ZapGunRework.Value)
			{
				((Component)__instance).gameObject.AddComponent<TurretZapper>();
			}
		}

		[HarmonyPatch(typeof(SpikeRoofTrap), "Start")]
		[HarmonyPostfix]
		private static void SpikesPatch(ref SpikeRoofTrap __instance)
		{
			if (ScienceBirdTweaks.ZapGunRework.Value || ScienceBirdTweaks.SpikeTrapDisableAnimation.Value)
			{
				GameObject gameObject = ((Component)((Component)__instance).gameObject.transform.parent).gameObject;
				gameObject.layer = 21;
				Light componentInChildren = gameObject.GetComponentInChildren<Light>();
				((Component)componentInChildren).gameObject.layer = 21;
				((Component)componentInChildren).gameObject.AddComponent<SpikesZapper>();
				BoxCollider val = ((Component)componentInChildren).gameObject.AddComponent<BoxCollider>();
				((Collider)val).isTrigger = true;
			}
		}

		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		[HarmonyPostfix]
		private static void SetZapGunProperties(GameNetworkManager __instance)
		{
			Item val = (from x in Resources.FindObjectsOfTypeAll<Item>()
				where x.itemName == "Zap gun"
				select x).First();
			if ((Object)(object)val != (Object)null)
			{
				val.batteryUsage = ScienceBirdTweaks.ZapGunBattery.Value;
			}
		}

		[HarmonyPatch(typeof(GameNetworkManager), "SaveLocalPlayerValues")]
		[HarmonyPostfix]
		private static void FixShockMinigameSave(GameNetworkManager __instance)
		{
			if (ScienceBirdTweaks.ZapGunTutorialMode.Value == "Vanilla")
			{
				return;
			}
			try
			{
				if ((Object)(object)HUDManager.Instance != (Object)null)
				{
					ES3.Save<int>("FinishedShockMinigame", PatcherTool.finishedShockMinigame, "LCGeneralSaveData");
				}
			}
			catch (Exception arg)
			{
				ScienceBirdTweaks.Logger.LogError((object)$"ERROR occured while saving local player shockminigame values!: {arg}");
			}
		}

		[HarmonyPatch(typeof(HUDManager), "SetSavedValues")]
		[HarmonyPostfix]
		private static void FixShockMinigameLoad(HUDManager __instance)
		{
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Expected O, but got Unknown
			if (ScienceBirdTweaks.ZapGunRework.Value)
			{
				string[] array = ScienceBirdTweaks.ZapScanPriority.Value.ToLower().Replace(" ", "").Split(",");
				layerDict = new Dictionary<int, int>();
				for (int i = 0; i < array.Length; i++)
				{
					int num = 0;
					switch (array[i])
					{
					case "doors":
						num = -1;
						break;
					case "enemies"