Decompiled source of MoreShopItems v1.3.4

MoreShopItem.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreShopItems.Compatability;
using MoreShopItems.Config;
using Photon.Pun;
using REPOLib.Modules;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("MoreShopItem")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MoreShopItem")]
[assembly: AssemblyTitle("MoreShopItem")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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 MoreShopItems
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "MoreShopItems";

		public const string PLUGIN_NAME = "More Shop Items";

		public const string PLUGIN_VERSION = "1.3.4";
	}
	[BepInPlugin("MoreShopItems", "More Shop Items", "1.3.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony _harmony = new Harmony("MoreShopItems");

		internal Dictionary<string, ConfigEntry<int>> intConfigEntries = new Dictionary<string, ConfigEntry<int>>();

		internal Dictionary<string, ConfigEntry<bool>> boolConfigEntries = new Dictionary<string, ConfigEntry<bool>>();

		internal static GameObject CustomItemShelf;

		internal static Plugin Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			Instance = CheckInstance();
			Logger = ((BaseUnityPlugin)this).Logger;
			LoadConfig();
			AssetBundle bundle = LoadAssetBundle("moreshopitems_assets.file");
			CustomItemShelf = LoadAssetFromBundle(bundle, "custom_soda_shelf");
			NetworkPrefabs.RegisterNetworkPrefab(CustomItemShelf);
			_harmony.PatchAll(typeof(ShopManagerPatch));
			_harmony.PatchAll(typeof(PunManagerPatch));
			Logger.LogInfo((object)"\n __  __               ___ _               ___ _                \n|  \\/  |___ _ _ ___  / __| |_  ___ _ __  |_ _| |_ ___ _ __  ___\n| |\\/| / _ \\ '_/ -_) \\__ \\ ' \\/ _ \\ '_ \\  | ||  _/ -_) '  \\(_-<\n|_|  |_\\___/_| \\___| |___/_||_\\___/ .__/ |___|\\__\\___|_|_|_/__/\n                                  |_|                    v1.3.4\n");
		}

		private Plugin CheckInstance()
		{
			if (!((Object)(object)Instance != (Object)null))
			{
				return this;
			}
			return Instance;
		}

		private AssetBundle LoadAssetBundle(string filename)
		{
			return AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), filename));
		}

		private GameObject LoadAssetFromBundle(AssetBundle bundle, string name)
		{
			return bundle.LoadAsset<GameObject>(name);
		}

		private void LoadConfig()
		{
			string[] configDescriptions = ConfigEntries.GetConfigDescriptions();
			intConfigEntries.Add("Max Upgrades In Shop", ConfigHelper.CreateConfig("Upgrades", "Max Upgrades In Shop", 5, configDescriptions[0], -1, 20));
			intConfigEntries.Add("Max Upgrade Purchase Amount", ConfigHelper.CreateConfig("Upgrades", "Max Upgrade Purchase Amount", 0, configDescriptions[1], 0, 1000));
			intConfigEntries.Add("Max Melee Weapons In Shop", ConfigHelper.CreateConfig("Weapons", "Max Melee Weapons In Shop", 5, configDescriptions[2], -1, 20));
			intConfigEntries.Add("Max Melee Weapon Purchase Amount", ConfigHelper.CreateConfig("Weapons", "Max Melee Weapon Purchase Amount", 0, configDescriptions[3], 0, 1000));
			intConfigEntries.Add("Max Guns In Shop", ConfigHelper.CreateConfig("Weapons", "Max Guns In Shop", 5, configDescriptions[4], -1, 20));
			intConfigEntries.Add("Max Gun Purchase Amount", ConfigHelper.CreateConfig("Weapons", "Max Gun Purchase Amount", 0, configDescriptions[5], 0, 1000));
			intConfigEntries.Add("Max Grenades In Shop", ConfigHelper.CreateConfig("Weapons", "Max Grenades In Shop", 5, configDescriptions[6], -1, 20));
			intConfigEntries.Add("Max Grenade Purchase Amount", ConfigHelper.CreateConfig("Weapons", "Max Grenade Purchase Amount", 0, configDescriptions[7], 0, 1000));
			intConfigEntries.Add("Max Mines In Shop", ConfigHelper.CreateConfig("Weapons", "Max Mines In Shop", 5, configDescriptions[8], -1, 20));
			intConfigEntries.Add("Max Mine Purchase Amount", ConfigHelper.CreateConfig("Weapons", "Max Mine Purchase Amount", 0, configDescriptions[9], 0, 1000));
			intConfigEntries.Add("Max Health-Packs In Shop", ConfigHelper.CreateConfig("Health-Packs", "Max Health-Packs In Shop", 15, configDescriptions[10], -1, 20));
			intConfigEntries.Add("Max Health-Pack Purchase Amount", ConfigHelper.CreateConfig("Health-Packs", "Max Health-Pack Purchase Amount", 0, configDescriptions[11], 0, 1000));
			intConfigEntries.Add("Max Drones In Shop", ConfigHelper.CreateConfig("Utilities", "Max Drones In Shop", 5, configDescriptions[12], -1, 20));
			intConfigEntries.Add("Max Drone Purchase Amount", ConfigHelper.CreateConfig("Utilities", "Max Drone Purchase Amount", 0, configDescriptions[13], 0, 1000));
			intConfigEntries.Add("Max Orbs In Shop", ConfigHelper.CreateConfig("Utilities", "Max Orbs In Shop", 5, configDescriptions[14], -1, 20));
			intConfigEntries.Add("Max Orb Purchase Amount", ConfigHelper.CreateConfig("Utilities", "Max Orb Purchase Amount", 0, configDescriptions[15], 0, 1000));
			intConfigEntries.Add("Max Crystals In Shop", ConfigHelper.CreateConfig("Utilities", "Max Crystals In Shop", 5, configDescriptions[16], -1, 20));
			intConfigEntries.Add("Max Crystal Purchase Amount", ConfigHelper.CreateConfig("Utilities", "Max Crystal Purchase Amount", 0, configDescriptions[17], 0, 1000));
			intConfigEntries.Add("Max Trackers In Shop", ConfigHelper.CreateConfig("Utilities", "Max Trackers In Shop", 5, configDescriptions[18], -1, 20));
			intConfigEntries.Add("Max Tracker Purchase Amount", ConfigHelper.CreateConfig("Utilities", "Max Tracker Purchase Amount", 0, configDescriptions[19], 0, 1000));
			boolConfigEntries.Add("Override Modded Items", ConfigHelper.CreateConfig("General", "Override Modded Items", value: true, configDescriptions[20], -1, -1));
			boolConfigEntries.Add("Override Single-Use Upgrades", ConfigHelper.CreateConfig("General", "Override Single-Use Upgrades", value: false, configDescriptions[21], -1, -1));
			boolConfigEntries.Add("Spawn Additional Shelving", ConfigHelper.CreateConfig("General", "Spawn Additional Shelving", value: true, configDescriptions[22], -1, -1));
		}
	}
	[HarmonyPatch(typeof(PunManager))]
	internal static class PunManagerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("TruckPopulateItemVolumes")]
		private static void RemoveNullValues()
		{
			if ((Object)(object)ItemManager.instance != (Object)null && (SemiFunc.IsMasterClient() || !SemiFunc.IsMultiplayer()))
			{
				Predicate<ItemVolume> match = (ItemVolume volume) => (Object)(object)volume == (Object)null;
				ItemManager.instance.itemVolumes.RemoveAll(match);
			}
		}
	}
	[HarmonyPatch(typeof(ShopManager))]
	internal static class ShopManagerPatch
	{
		private static readonly FieldRef<ShopManager, int> itemSpawnTargetAmount_ref = AccessTools.FieldRefAccess<ShopManager, int>("itemSpawnTargetAmount");

		private static readonly FieldRef<ShopManager, int> itemConsumablesAmount_ref = AccessTools.FieldRefAccess<ShopManager, int>("itemConsumablesAmount");

		private static readonly FieldRef<ShopManager, int> itemUpgradesAmount_ref = AccessTools.FieldRefAccess<ShopManager, int>("itemUpgradesAmount");

		private static readonly FieldRef<ShopManager, int> itemHealthPacksAmount_ref = AccessTools.FieldRefAccess<ShopManager, int>("itemHealthPacksAmount");

		private static GameObject shelf;

		internal static bool isMoreUpgrades = false;

		[HarmonyPrefix]
		[HarmonyPatch("ShopInitialize")]
		private static void AdjustItems()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected I4, but got Unknown
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Invalid comparison between Unknown and I4
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Invalid comparison between Unknown and I4
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Invalid comparison between Unknown and I4
			if (!(RunManager.instance.levelCurrent.ResourcePath == "Shop") || !((Object)(object)StatsManager.instance != (Object)null) || (!SemiFunc.IsMasterClient() && SemiFunc.IsMultiplayer()))
			{
				return;
			}
			Dictionary<string, ConfigEntry<int>> intConfigEntries = Plugin.Instance.intConfigEntries;
			Dictionary<string, ConfigEntry<bool>> boolConfigEntries = Plugin.Instance.boolConfigEntries;
			Plugin.Logger.LogInfo((object)("Override modded items = " + boolConfigEntries["Override Modded Items"].Value));
			foreach (Item value in StatsManager.instance.itemDictionary.Values)
			{
				int num = -2;
				int maxPurchaseAmount = -2;
				itemType itemType = value.itemType;
				switch ((int)itemType)
				{
				case 0:
					if (intConfigEntries["Max Drones In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Drones In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Drone Purchase Amount"].Value;
					}
					break;
				case 1:
					if (intConfigEntries["Max Orbs In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Orbs In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Orb Purchase Amount"].Value;
					}
					break;
				case 3:
					if (intConfigEntries["Max Upgrades In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Upgrades In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Upgrade Purchase Amount"].Value;
					}
					break;
				case 5:
					if (intConfigEntries["Max Crystals In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Crystals In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Crystal Purchase Amount"].Value;
					}
					break;
				case 6:
					if (intConfigEntries["Max Grenades In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Grenades In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Grenade Purchase Amount"].Value;
					}
					break;
				case 7:
					if (intConfigEntries["Max Melee Weapons In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Melee Weapons In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Melee Weapon Purchase Amount"].Value;
					}
					break;
				case 8:
					if (intConfigEntries["Max Health-Packs In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Health-Packs In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Health-Pack Purchase Amount"].Value;
					}
					break;
				case 9:
					if (intConfigEntries["Max Guns In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Guns In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Gun Purchase Amount"].Value;
					}
					break;
				case 10:
					if (intConfigEntries["Max Trackers In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Trackers In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Tracker Purchase Amount"].Value;
					}
					break;
				case 11:
					if (intConfigEntries["Max Mines In Shop"].Value != -1)
					{
						num = intConfigEntries["Max Mines In Shop"].Value;
						maxPurchaseAmount = intConfigEntries["Max Mine Purchase Amount"].Value;
					}
					break;
				default:
					continue;
				}
				bool flag = (int)value.itemType == 3;
				if ((int)value.itemType == 2 || (int)value.itemType == 12 || num == -2)
				{
					continue;
				}
				if (boolConfigEntries["Override Modded Items"].Value)
				{
					if (boolConfigEntries["Override Single-Use Upgrades"].Value && flag)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
					else if (!value.maxPurchase)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
					else if (!flag)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
				}
				else if ((!MoreUpgradesMOD.isLoaded() || !value.itemAssetName.Contains("Modded")) && !(VanillaUpgradesMOD.isLoaded() && flag))
				{
					if (boolConfigEntries["Override Single-Use Upgrades"].Value && flag)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
					else if (flag && !value.maxPurchase)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
					else if (!flag)
					{
						SetItemValues(value, num, maxPurchaseAmount);
					}
				}
			}
		}

		private static void SetItemValues(Item item, int maxInShop, int maxPurchaseAmount)
		{
			item.maxAmountInShop = (item.maxAmount = maxInShop);
			item.maxPurchase = maxPurchaseAmount > 0;
			item.maxPurchaseAmount = maxPurchaseAmount;
		}

		[PunRPC]
		public static void SetParent(Transform parent, GameObject gameObj)
		{
			gameObj.transform.SetParent(parent);
		}

		[HarmonyPrefix]
		[HarmonyPatch("Awake")]
		private static void SetValues(ShopManager __instance)
		{
			ref int reference = ref itemConsumablesAmount_ref.Invoke(__instance);
			ref int reference2 = ref itemUpgradesAmount_ref.Invoke(__instance);
			ref int reference3 = ref itemHealthPacksAmount_ref.Invoke(__instance);
			itemSpawnTargetAmount_ref.Invoke(__instance) = 250;
			reference = 100;
			reference2 = 50;
			reference3 = 50;
		}

		[HarmonyPrefix]
		[HarmonyPatch("ShopInitialize")]
		private static void SpawnShelf()
		{
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			if (!(RunManager.instance.levelCurrent.ResourcePath == "Shop") || !Plugin.Instance.boolConfigEntries["Spawn Additional Shelving"].Value)
			{
				return;
			}
			GameObject val = GameObject.Find("Soda Shelf");
			GameObject val2 = GameObject.Find("Module Switch BOT");
			if ((Object)(object)val == (Object)null || val2.GetComponent<ModulePropSwitch>().ConnectedParent.activeSelf)
			{
				GameObject val3 = GameObject.Find("Shop Magazine Stand (1)");
				GameObject val4 = GameObject.Find("Shop Magazine Stand");
				GameObject val5 = GameObject.Find("Module Switch (1) top");
				if ((Object)(object)val3 == (Object)null || val5.GetComponent<ModulePropSwitch>().ConnectedParent.activeSelf)
				{
					GameObject val6 = GameObject.Find("Module Switch (2) left");
					GameObject val7 = GameObject.Find("Candy Shelf");
					if ((Object)(object)val6 == (Object)null || val6.GetComponent<ModulePropSwitch>().ConnectedParent.activeSelf)
					{
						Plugin.Logger.LogInfo((object)"Edge case found. Temporarily preventing spawn of custom shelf.");
						return;
					}
					if (SemiFunc.IsMultiplayer())
					{
						if (!SemiFunc.IsMasterClient())
						{
							if ((Object)(object)val7 != (Object)null)
							{
								val7.SetActive(false);
							}
							return;
						}
						shelf = PhotonNetwork.Instantiate(((Object)Plugin.CustomItemShelf).name, val6.transform.position + val6.transform.right * 0.5f - val6.transform.forward * 0.8f, val6.transform.rotation * Quaternion.Euler(0f, 180f, 0f), (byte)0, (object[])null);
						SetParent(val6.transform, shelf);
					}
					else
					{
						shelf = Object.Instantiate<GameObject>(Plugin.CustomItemShelf, val6.transform.position + val6.transform.right * 0.5f - val6.transform.forward * 0.8f, val6.transform.rotation * Quaternion.Euler(0f, 180f, 0f), val5.transform.parent);
					}
					if ((Object)(object)val7 != (Object)null)
					{
						val7.SetActive(false);
					}
				}
				else
				{
					if (SemiFunc.IsMultiplayer())
					{
						if (!SemiFunc.IsMasterClient())
						{
							val3.SetActive(false);
							if ((Object)(object)val4 != (Object)null)
							{
								val4.SetActive(false);
							}
							return;
						}
						shelf = PhotonNetwork.Instantiate(((Object)Plugin.CustomItemShelf).name, val3.transform.position, val3.transform.rotation * Quaternion.Euler(0f, 90f, 0f), (byte)0, (object[])null);
						SetParent(val5.transform, shelf);
					}
					else
					{
						shelf = Object.Instantiate<GameObject>(Plugin.CustomItemShelf, val3.transform.position, val3.transform.rotation * Quaternion.Euler(0f, 90f, 0f), val5.transform.parent);
					}
					val3.SetActive(false);
					if ((Object)(object)val4 != (Object)null)
					{
						val4.SetActive(false);
					}
				}
			}
			else
			{
				if (SemiFunc.IsMultiplayer())
				{
					if (!SemiFunc.IsMasterClient())
					{
						val.SetActive(false);
						return;
					}
					shelf = PhotonNetwork.Instantiate(((Object)Plugin.CustomItemShelf).name, val.transform.position, val.transform.rotation, (byte)0, (object[])null);
					SetParent(val2.transform, shelf);
				}
				else
				{
					shelf = Object.Instantiate<GameObject>(Plugin.CustomItemShelf, val.transform.position, val.transform.rotation, val2.transform);
				}
				val.SetActive(false);
			}
			Plugin.Logger.LogInfo((object)"Successfully spawned the shelf!");
		}
	}
}
namespace MoreShopItems.Constants
{
	public static class Values
	{
		public const int TargetSpawnAmount = 250;

		public const int UpgradesAmount = 50;

		public const int HealthPacksAmount = 50;

		public const int ConsumablesAmount = 100;
	}
}
namespace MoreShopItems.Config
{
	public static class ConfigEntries
	{
		private static string[] DESCRIPTIONS;

		static ConfigEntries()
		{
			DESCRIPTIONS = new string[23]
			{
				"How many of each upgrade to spawn in the shop.", "How many upgrades you can purchase total. Set 0 to disable", "How many of each melee weapon to spawn in the shop.", "How many melee weapons you can purchase total. Set 0 to disable", "How many of each gun to spawn in the shop.", "How many guns you can purchase total. Set 0 to disable", "How many of each grenade to spawn in the shop.", "How many grenades you can purchase total. Set 0 to disable", "How many of each mine to spawn in the shop.", "How many mines you can purchase total. Set 0 to disable",
				"How many of each health-pack to spawn in the shop.", "How many health-packs you can purchase total. Set 0 to disable", "How many of each drone to spawn in the shop.", "How many drones you can purchase total. Set 0 to disable", "How many of each orb to spawn in the shop.", "How many orbs you can purchase total. Set 0 to disable", "How many of each crystal to spawn in the shop.", "How many crystals you can purchase total. Set 0 to disable", "How many trackers to spawn in the shop.", "How many trackers you can purchase total. Set 0 to disable",
				"Overrides the values (MaxAmountInShop, MaxPurchaseAmount) set by other item/upgrade mods.", "Overrides the values (MaxAmountInShop, MaxPurchaseAmount) of single-use upgrades.", "Spawns the additional shelving into the shop (set false to disable the shelf spawning)."
			};
		}

		public static string[] GetConfigDescriptions()
		{
			return DESCRIPTIONS;
		}
	}
	public class ConfigHelper
	{
		public static ConfigEntry<bool> CreateConfig(string section, string name, bool value, string desc, int min, int max)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			return ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>(section, name, value, new ConfigDescription(desc, (AcceptableValueBase)null, Array.Empty<object>()));
		}

		public static ConfigEntry<int> CreateConfig(string section, string name, int value, string desc, int min, int max)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			return ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>(section, name, value, new ConfigDescription(desc, (AcceptableValueBase)(object)new AcceptableValueRange<int>(min, max), Array.Empty<object>()));
		}
	}
}
namespace MoreShopItems.Compatability
{
	internal class MoreUpgradesMOD
	{
		internal const string modGUID = "bulletbot.moreupgrades";

		public static bool isLoaded()
		{
			return Chainloader.PluginInfos.ContainsKey("bulletbot.moreupgrades");
		}
	}
	internal class VanillaUpgradesMOD
	{
		internal const string modGUID = "bulletbot.vanillaupgrades";

		public static bool isLoaded()
		{
			return Chainloader.PluginInfos.ContainsKey("bulletbot.vanillaupgrades");
		}
	}
}