Decompiled source of TenToor v0.1.0

ScoopysVarietyMod/ScoopysVarietyMod.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen.Graph;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using LethalLib.Modules;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LethalExtension")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalExtension")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("94d2de4e-bed1-40e3-b759-cf53352d4930")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace ScoopysVarietyMod
{
	[BepInPlugin("ScoopysVarietyMod", "Scoopy's Variety Mod", "1.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(QuicksandTrigger))]
		internal class QuicksandPatch
		{
			[HarmonyPatch("OnTriggerStay")]
			[HarmonyPrefix]
			private static bool FacilityQuicksand(Collider other, ref QuicksandTrigger __instance)
			{
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Expected O, but got Unknown
				//IL_007b: Expected O, but got Unknown
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Expected O, but got Unknown
				//IL_010c: Expected O, but got Unknown
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Expected O, but got Unknown
				//IL_00a2: Expected O, but got Unknown
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0168: Unknown result type (might be due to invalid IL or missing references)
				RoundManager obj = Object.FindObjectOfType<RoundManager>();
				PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
				if (((Object)obj.dungeonGenerator.Generator.DungeonFlow).name != "SewerFlow" || !GameNetworkManager.Instance.localPlayerController.isInsideFactory)
				{
					return true;
				}
				if (__instance.isWater)
				{
					if (!((Component)other).gameObject.CompareTag("Player"))
					{
						return true;
					}
					if ((Object)component != (Object)GameNetworkManager.Instance.localPlayerController && (Object)component != (Object)null && (Object)component.underwaterCollider != (Object)__instance)
					{
						component.underwaterCollider = ((Component)__instance).gameObject.GetComponent<Collider>();
						return true;
					}
				}
				if (GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom || (!__instance.isWater && !((Component)other).gameObject.CompareTag("Player")))
				{
					return true;
				}
				PlayerControllerB component2 = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
				if ((Object)component2 != (Object)GameNetworkManager.Instance.localPlayerController)
				{
					return true;
				}
				if (__instance.isWater && !component2.isUnderwater)
				{
					component2.underwaterCollider = ((Component)__instance).gameObject.GetComponent<Collider>();
					component2.isUnderwater = true;
				}
				component2.statusEffectAudioIndex = __instance.audioClipIndex;
				if (component2.isUnderwater)
				{
					Bounds bounds = component2.underwaterCollider.bounds;
					if (!((Bounds)(ref bounds)).Contains(((Component)component2.gameplayCamera).transform.position))
					{
						component2.statusEffectAudio.volume = component2.statusEffectAudio.volume * 0.25f;
					}
				}
				if (component2.isSinking)
				{
					return false;
				}
				if (__instance.sinkingLocalPlayer)
				{
					if (!component2.CheckConditionsForSinkingInQuicksand())
					{
						__instance.StopSinkingLocalPlayer(component2);
					}
				}
				else if (component2.CheckConditionsForSinkingInQuicksand())
				{
					__instance.sinkingLocalPlayer = true;
					component2.sourcesCausingSinking++;
					component2.isMovementHindered++;
					component2.hinderedMultiplier *= __instance.movementHinderance;
					if (__instance.isWater)
					{
						component2.sinkingSpeedMultiplier = 0f;
					}
					else
					{
						component2.sinkingSpeedMultiplier = __instance.sinkingSpeedMultiplier;
					}
				}
				return false;
			}
		}

		private const string modGUID = "ScoopysVarietyMod";

		private const string modName = "Scoopy's Variety Mod";

		private const string modVersion = "1.2.0";

		private static Plugin Instance;

		private readonly Harmony harmony = new Harmony("ScoopysVarietyMod");

		private ConfigEntry<int> configCastleRarity;

		private ConfigEntry<string> configCastleMoons;

		private ConfigEntry<string> configCastleMoonsList;

		private ConfigEntry<bool> configGuaranteeCastle;

		private ConfigEntry<float> configCastleSizeMultiplierMax;

		private ConfigEntry<float> configCastleSizeMultiplierMin;

		private ConfigEntry<int> configSewerRarity;

		private ConfigEntry<string> configSewerMoons;

		private ConfigEntry<string> configSewerMoonsList;

		private ConfigEntry<bool> configGuaranteeSewer;

		private ConfigEntry<float> configSewerSizeMultiplierMax;

		private ConfigEntry<float> configSewerSizeMultiplierMin;

		private ConfigEntry<int> configGuitarRarity;

		private ConfigEntry<int> configFireaxeRarity;

		private ConfigEntry<int> configFireaxeDamage;

		private string[] configMoonsValues = new string[5] { "vanilla", "modded", "all", "paid", "list" };

		internal ManualLogSource MLS;

		public static AssetBundle Assets;

		private void Awake()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Expected O, but got Unknown
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Expected O, but got Unknown
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Expected O, but got Unknown
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Expected O, but got Unknown
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Expected O, but got Unknown
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Expected O, but got Unknown
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Expected O, but got Unknown
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Expected O, but got Unknown
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Expected O, but got Unknown
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Expected O, but got Unknown
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Expected O, but got Unknown
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Expected O, but got Unknown
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Expected O, but got Unknown
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Expected O, but got Unknown
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			MLS = Logger.CreateLogSource("ScoopysVarietyMod");
			string? directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			configCastleRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Castle Interior", "CastleDungeonSpawnChance", 300, new ConfigDescription("Adjusts likelihood of the dungeon interior spawning. Higher values increases the chance of spawning. At a value of 300, the spawn chance would be approx 50% on vanilla moons", (AcceptableValueBase)new AcceptableValueRange<int>(0, 99999), Array.Empty<object>()));
			configCastleMoons = ((BaseUnityPlugin)this).Config.Bind<string>("Castle Interior", "CastleDungeonMoons", "vanilla", new ConfigDescription("Specifies the moons that the dungeon interior can spawn on. Vanilla moons can be selected using 'vanilla', or all modded moons using 'modded'. \nAll moons (vanilla & modded) can be selected using 'all'. Paid moons can be selected using 'paid'. \nIndividual moons (including modded) can be specified using 'list' and altering the CastleDungeonMoonsList config entry.", (AcceptableValueBase)new AcceptableValueList<string>(configMoonsValues), Array.Empty<object>()));
			configCastleMoonsList = ((BaseUnityPlugin)this).Config.Bind<string>("Castle Interior", "CastleDungeonMoonsList", (string)null, new ConfigDescription("Note: Requires 'CastleDungeonMoons' to be set to 'list'. \nCan be used to specify a list of moons with individual rarities for moons to spawn on. \nRarity values will override the default rarity value provided in CastleDungeonSpawnChance and will override CastleDungeonGuaranteed. To guarantee dungeon spawning on a moon, assign arbitrarily high rarity value (e.g. 99999). \nMoons and rarities should be provided as a comma seperated list in the following format: 'NameRarity' Example: rend300,dine20,experimentation13 \nNote: Moon names are checked by string matching, i.e. the moon name 'dine' would enable spawning on 'dine', 'diner' and 'undine'. Be careful with modded moon names.", (AcceptableValueBase)null, Array.Empty<object>()));
			configGuaranteeCastle = ((BaseUnityPlugin)this).Config.Bind<bool>("Castle Interior", "CastleDungeonGuaranteed", false, new ConfigDescription("If enabled, the dungeon interior will be effectively guaranteed to spawn on moons where it can spawn as per CastleDungeonMoons. Note: Using ", (AcceptableValueBase)null, Array.Empty<object>()));
			configCastleSizeMultiplierMax = ((BaseUnityPlugin)this).Config.Bind<float>("Castle Interior", "MaxCastleSizeMultiplier", 2f, new ConfigDescription("Defines the maximum castle size multiplier, reducing multipliers above this to this value. \nFor reference, the vanilla modifiers are as follows: Experimentation 1x, Assurance 1x, Vow 1.15x, Rend 1.2x, Offense 1.25x, Dine 1.3x, March 2x, Titan 2.35x, ", (AcceptableValueBase)new AcceptableValueRange<float>(0.1f, 300f), Array.Empty<object>()));
			configCastleSizeMultiplierMin = ((BaseUnityPlugin)this).Config.Bind<float>("Castle Interior", "MinCastleSizeMultiplier", 1f, new ConfigDescription("Defines the minimum castle size multiplier, increasing multipliers below this to this value. \nFor reference, the vanilla modifiers are as follows: Experimentation 1x, Assurance 1x, Vow 1.15x, Rend 1.2x, Offense 1.25x, Dine 1.3x, March 2x, Titan 2.35x, ", (AcceptableValueBase)new AcceptableValueRange<float>(0.1f, 300f), Array.Empty<object>()));
			configSewerRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Sewer Interior", "SewerDungeonSpawnChance", 300, new ConfigDescription("Adjusts likelihood of the sewer interior spawning. Higher values increases the chance of spawning. At a value of 300, the spawn chance would be approx 50% on vanilla moons", (AcceptableValueBase)new AcceptableValueRange<int>(0, 99999), Array.Empty<object>()));
			configSewerMoons = ((BaseUnityPlugin)this).Config.Bind<string>("Sewer Interior", "SewerDungeonMoons", "vanilla", new ConfigDescription("Specifies the moons that the sewer interior can spawn on. Vanilla moons can be selected using 'vanilla', or all modded moons using 'modded'. \nAll moons (vanilla & modded) can be selected using 'all'. Paid moons can be selected using 'paid'. \nIndividual moons (including modded) can be specified using 'list' and altering the SewerDungeonMoonsList config entry.", (AcceptableValueBase)new AcceptableValueList<string>(configMoonsValues), Array.Empty<object>()));
			configSewerMoonsList = ((BaseUnityPlugin)this).Config.Bind<string>("Sewer Interior", "SewerDungeonMoonsList", (string)null, new ConfigDescription("Note: Requires 'SewerDungeonMoons' to be set to 'list'. \nCan be used to specify a list of moons with individual rarities for moons to spawn on. \nRarity values will override the default rarity value provided in sewerDungeonSpawnChance and will override SewerDungeonGuaranteed. To guarantee dungeon spawning on a moon, assign arbitrarily high rarity value (e.g. 99999). \nMoons and rarities should be provided as a comma seperated list in the following format: 'NameRarity' Example: rend300,dine20,experimentation13 \nNote: Moon names are checked by string matching, i.e. the moon name 'dine' would enable spawning on 'dine', 'diner' and 'undine'. Be careful with modded moon names.", (AcceptableValueBase)null, Array.Empty<object>()));
			configGuaranteeSewer = ((BaseUnityPlugin)this).Config.Bind<bool>("Sewer Interior", "SewerDungeonGuaranteed", false, new ConfigDescription("If enabled, the sewer interior will be effectively guaranteed to spawn on moons where it can spawn as per SewerDungeonMoons. Note: Using ", (AcceptableValueBase)null, Array.Empty<object>()));
			configSewerSizeMultiplierMax = ((BaseUnityPlugin)this).Config.Bind<float>("Sewer Interior", "MaxSewerSizeMultiplier", 2f, new ConfigDescription("Defines the maximum sewer size multiplier, reducing multipliers above this to this value. \nFor reference, the vanilla modifiers are as follows: Experimentation 1x, Assurance 1x, Vow 1.15x, Rend 1.2x, Offense 1.25x, Dine 1.3x, March 2x, Titan 2.35x, ", (AcceptableValueBase)new AcceptableValueRange<float>(0.1f, 300f), Array.Empty<object>()));
			configSewerSizeMultiplierMin = ((BaseUnityPlugin)this).Config.Bind<float>("Sewer Interior", "MinSewerSizeMultiplier", 1f, new ConfigDescription("Defines the minimum sewer size multiplier, increasing multipliers below this to this value. \nFor reference, the vanilla modifiers are as follows: Experimentation 1x, Assurance 1x, Vow 1.15x, Rend 1.2x, Offense 1.25x, Dine 1.3x, March 2x, Titan 2.35x, ", (AcceptableValueBase)new AcceptableValueRange<float>(0.1f, 300f), Array.Empty<object>()));
			configGuitarRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "GuitarRarity", 10, new ConfigDescription("Frequency of Guitar scrap spawning. Higher values are more common. Set to 0 to disable spawns.", (AcceptableValueBase)new AcceptableValueRange<int>(0, 300), Array.Empty<object>()));
			configFireaxeRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "FireaxeRarity", 5, new ConfigDescription("Frequency of Fire Axe scrap spawning. Higher values are more common. Set to 0 to disable spawns.", (AcceptableValueBase)new AcceptableValueRange<int>(0, 300), Array.Empty<object>()));
			configFireaxeDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "FireaxeDamage", 4, new ConfigDescription("Damage of Fire Axe scrap spawning. Higher values are more damage. Damage of base game shovel is 1.", (AcceptableValueBase)new AcceptableValueRange<int>(0, 99999), Array.Empty<object>()));
			Assets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "ScoopysVarietyMod"));
			if ((Object)(object)Assets == (Object)null)
			{
				MLS.LogError((object)"Failed to unpack ScoopysVarietyMod assetbundle.");
			}
			Item val = Assets.LoadAsset<Item>("Assets/ScoopysVarietyMod/ScrapAssets/Guitar/WeezerGuitar.asset");
			Item val2 = Assets.LoadAsset<Item>("Assets/ScoopysVarietyMod/ScrapAssets/FireAxe/FireAxe.asset");
			Item val3 = Assets.LoadAsset<Item>("Assets/ScoopysVarietyMod/ScrapAssets/Crown/CrownItem.asset");
			Item[] array = (Item[])(object)new Item[3] { val, val2, val3 };
			foreach (Item val4 in array)
			{
				if ((Object)(object)val4 == (Object)null)
				{
					MLS.LogError((object)"An item prefab failed to load");
				}
				else
				{
					MLS.LogInfo((object)("Successfully loaded " + (object)val4));
				}
			}
			val2.spawnPrefab.GetComponent<Shovel>().shovelHitForce = configFireaxeDamage.Value;
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
			Items.RegisterScrap(val, configGuitarRarity.Value, (LevelTypes)(-1));
			Items.RegisterScrap(val2, configFireaxeRarity.Value, (LevelTypes)896);
			MLS.LogInfo((object)"Custom Scrap Loaded Successfully");
			DungeonFlow val5 = Assets.LoadAsset<DungeonFlow>("Assets/ScoopysVarietyMod/CastleAssets/CastleFlow.asset");
			DungeonFlow val6 = Assets.LoadAsset<DungeonFlow>("Assets/ScoopysVarietyMod/SewerAssets/SewerFlow.asset");
			if ((Object)(object)val5 == (Object)null || (Object)(object)val6 == (Object)null)
			{
				MLS.LogError((object)"Failed to load a Dungeon Flow. Did you install the assetbundle correctly?");
				return;
			}
			RegisterDungeon(val5, configCastleRarity.Value, configCastleMoons.Value, configCastleMoonsList.Value, configGuaranteeCastle.Value, configCastleSizeMultiplierMax.Value, configCastleSizeMultiplierMin.Value);
			RegisterDungeon(val6, configSewerRarity.Value, configSewerMoons.Value, configSewerMoonsList.Value, configGuaranteeSewer.Value, configSewerSizeMultiplierMax.Value, configSewerSizeMultiplierMin.Value);
			harmony.PatchAll(typeof(Plugin));
			MLS.LogInfo((object)"Initialised Successfully");
		}

		public static StringWithRarity ParseMoonString(string moonString)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			if (string.IsNullOrEmpty(moonString))
			{
				return null;
			}
			int num = moonString.Length - 1;
			while (num >= 0 && char.IsDigit(moonString[num]))
			{
				num--;
			}
			if (num < 0 || num == moonString.Length - 1)
			{
				return null;
			}
			try
			{
				string text = moonString.Substring(0, num + 1);
				int num2 = int.Parse(moonString.Substring(num + 1));
				return new StringWithRarity(text, num2);
			}
			catch (FormatException)
			{
				return null;
			}
		}

		public void RegisterDungeon(DungeonFlow dungeonFlow, int dungeonRarity, string dungeonMoons, string dungeonMoonsList, bool guaranteeDungeon, float dungeonSizeMax, float dungeonSizeMin)
		{
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Expected O, but got Unknown
			MLS.LogInfo((object)("Registering flow " + ((Object)dungeonFlow).name + " with:\ndungeonRarity: " + dungeonRarity + "\ndungeonMoons: " + dungeonMoons + "\nguaranteeDungeon: " + guaranteeDungeon + "\ndungeonSizeMax: " + dungeonSizeMax + "\ndungeonSizeMin:" + dungeonSizeMin));
			ExtendedDungeonFlow val = ScriptableObject.CreateInstance<ExtendedDungeonFlow>();
			val.dungeonFlow = dungeonFlow;
			val.dungeonFirstTimeAudio = null;
			val.dungeonDefaultRarity = 0;
			int num = (guaranteeDungeon ? 99999 : dungeonRarity);
			if (dungeonMoons.ToLowerInvariant() == "all")
			{
				val.manualContentSourceNameReferenceList.Add(new StringWithRarity("Lethal Company", num));
				val.manualContentSourceNameReferenceList.Add(new StringWithRarity("Custom", num));
				MLS.LogInfo((object)("Registered " + ((Object)dungeonFlow).name + " interior on all moons, including modded with rarity " + num + "."));
			}
			else if (dungeonMoons.ToLowerInvariant() == "vanilla")
			{
				val.manualContentSourceNameReferenceList.Add(new StringWithRarity("Lethal Company", num));
				MLS.LogInfo((object)("Registered " + ((Object)dungeonFlow).name + " dungeon interior on all vanilla moons with rarity" + num + "."));
			}
			else if (dungeonMoons.ToLowerInvariant() == "modded")
			{
				val.manualContentSourceNameReferenceList.Add(new StringWithRarity("Custom", num));
				MLS.LogInfo((object)("Registered " + ((Object)dungeonFlow).name + " dungeon interior on all modded moons with rarity " + num + "."));
			}
			else if (dungeonMoons.ToLowerInvariant() == "paid")
			{
				val.dynamicRoutePricesList.Add(new Vector2WithRarity(new Vector2(1f, 9999f), num));
				MLS.LogInfo((object)("Registered " + ((Object)dungeonFlow).name + " dungeon interior on all paid moons with rarity" + num + "."));
			}
			else if (dungeonMoons.ToLowerInvariant() == "list" && dungeonMoonsList != null)
			{
				string[] array = dungeonMoonsList.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries);
				foreach (string text in array)
				{
					StringWithRarity val2 = ParseMoonString(text);
					if (val2 != null)
					{
						val.manualPlanetNameReferenceList.Add(val2);
						MLS.LogInfo((object)("Registered " + ((Object)dungeonFlow).name + " on moon name " + val2.Name + " with rarity " + val2.Rarity));
					}
					else
					{
						MLS.LogError((object)("Invalid moon list value!: " + text));
					}
				}
			}
			else
			{
				MLS.LogError((object)("Invalid " + ((object)dungeonFlow).ToString() + " 'DungeonMoons' config value!"));
			}
			val.dungeonSizeMax = dungeonSizeMax;
			val.dungeonSizeMin = dungeonSizeMin;
			val.dungeonSizeLerpPercentage = 0f;
			PatchedContent.RegisterExtendedDungeonFlow(val);
		}
	}
}