Decompiled source of MoreShopItems v1.3.3

MoreShopItems.dll

Decompiled 2 weeks 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MoreShopItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyInformationalVersion("1.3.3")]
[assembly: AssemblyProduct("More Shop Items")]
[assembly: AssemblyTitle("MoreShopItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.3.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace MoreShopItems
{
	[BepInPlugin("MoreShopItems", "More Shop Items", "1.3.3")]
	[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.3\n");
		}

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

		private void LoadConfig()
		{
			string[] configDescriptions = ConfigEntries.GetConfigDescriptions();
			intConfigEntries.Add("Max Upgrades In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Upgrades", "Max Upgrades In Shop", 5, configDescriptions[0], -1, 20));
			intConfigEntries.Add("Max Upgrade Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Upgrades", "Max Upgrade Purchase Amount", 0, configDescriptions[1], 0, 1000));
			intConfigEntries.Add("Max Melee Weapons In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Melee Weapons In Shop", 5, configDescriptions[2], -1, 20));
			intConfigEntries.Add("Max Melee Weapon Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Melee Weapon Purchase Amount", 0, configDescriptions[3], 0, 1000));
			intConfigEntries.Add("Max Guns In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Guns In Shop", 5, configDescriptions[4], -1, 20));
			intConfigEntries.Add("Max Gun Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Gun Purchase Amount", 0, configDescriptions[5], 0, 1000));
			intConfigEntries.Add("Max Grenades In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Grenades In Shop", 5, configDescriptions[6], -1, 20));
			intConfigEntries.Add("Max Grenade Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Grenade Purchase Amount", 0, configDescriptions[7], 0, 1000));
			intConfigEntries.Add("Max Mines In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Mines In Shop", 5, configDescriptions[8], -1, 20));
			intConfigEntries.Add("Max Mine Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Weapons", "Max Mine Purchase Amount", 0, configDescriptions[9], 0, 1000));
			intConfigEntries.Add("Max Health-Packs In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Health-Packs", "Max Health-Packs In Shop", 15, configDescriptions[10], -1, 20));
			intConfigEntries.Add("Max Health-Pack Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Health-Packs", "Max Health-Pack Purchase Amount", 0, configDescriptions[11], 0, 1000));
			intConfigEntries.Add("Max Drones In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Drones In Shop", 5, configDescriptions[12], -1, 20));
			intConfigEntries.Add("Max Drone Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Drone Purchase Amount", 0, configDescriptions[13], 0, 1000));
			intConfigEntries.Add("Max Orbs In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Orbs In Shop", 5, configDescriptions[14], -1, 20));
			intConfigEntries.Add("Max Orb Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Orb Purchase Amount", 0, configDescriptions[15], 0, 1000));
			intConfigEntries.Add("Max Crystals In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Crystals In Shop", 5, configDescriptions[16], -1, 20));
			intConfigEntries.Add("Max Crystal Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Crystal Purchase Amount", 0, configDescriptions[17], 0, 1000));
			intConfigEntries.Add("Max Trackers In Shop", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Trackers In Shop", 5, configDescriptions[18], -1, 20));
			intConfigEntries.Add("Max Tracker Purchase Amount", ConfigHelper.CreateConfig<ConfigEntry<int>>("Utilities", "Max Tracker Purchase Amount", 0, configDescriptions[19], 0, 1000));
			boolConfigEntries.Add("Override Modded Items", ConfigHelper.CreateConfig<ConfigEntry<bool>>("General", "Override Modded Items", true, configDescriptions[20], -1, -1));
			boolConfigEntries.Add("Override Single-Use Upgrades", ConfigHelper.CreateConfig<ConfigEntry<bool>>("General", "Override Single-Use Upgrades", false, configDescriptions[21], -1, -1));
			boolConfigEntries.Add("Spawn Additional Shelving", ConfigHelper.CreateConfig<ConfigEntry<bool>>("General", "Spawn Additional Shelving", true, configDescriptions[22], -1, -1));
		}

		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);
		}
	}
	[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("Awake")]
		private static void SetValues(ShopManager __instance)
		{
			ref int reference = ref itemSpawnTargetAmount_ref.Invoke(__instance);
			ref int reference2 = ref itemConsumablesAmount_ref.Invoke(__instance);
			ref int reference3 = ref itemUpgradesAmount_ref.Invoke(__instance);
			ref int reference4 = ref itemHealthPacksAmount_ref.Invoke(__instance);
			reference = 250;
			reference2 = 100;
			reference3 = 50;
			reference4 = 50;
		}

		[HarmonyPrefix]
		[HarmonyPatch("ShopInitialize")]
		private static void SpawnShelf()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: 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_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: 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)
			{
				if (!SemiFunc.IsMultiplayer())
				{
					shelf = Object.Instantiate<GameObject>(Plugin.CustomItemShelf, val.transform.position, val.transform.rotation, val2.transform);
				}
				else
				{
					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);
				}
				val.SetActive(false);
			}
			else
			{
				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)
				{
					if (!SemiFunc.IsMultiplayer())
					{
						shelf = Object.Instantiate<GameObject>(Plugin.CustomItemShelf, val3.transform.position, val3.transform.rotation * Quaternion.Euler(0f, 90f, 0f), val5.transform.parent);
					}
					else
					{
						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);
					}
					val3.SetActive(false);
					if ((Object)(object)val4 != (Object)null)
					{
						val4.SetActive(false);
					}
				}
				else
				{
					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())
					{
						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);
					}
					else
					{
						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);
					}
					if ((Object)(object)val7 != (Object)null)
					{
						val7.SetActive(false);
					}
				}
			}
			Plugin.Logger.LogInfo((object)"Successfully spawned the shelf!");
		}

		[HarmonyPrefix]
		[HarmonyPatch("ShopInitialize")]
		private static void AdjustItems()
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected I4, but got Unknown
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Invalid comparison between Unknown and I4
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Invalid comparison between Unknown and I4
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: 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;
				itemType val = itemType;
				switch ((int)val)
				{
				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)
					{
						if (!flag)
						{
							SetItemValues(value, num, maxPurchaseAmount);
						}
					}
					else
					{
						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);
		}
	}
	[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()))
			{
				ItemManager.instance.itemVolumes.RemoveAll((ItemVolume volume) => (Object)(object)volume == (Object)null);
			}
		}
	}
	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.3";
	}
}
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");
		}
	}
}
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 = 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 T CreateConfig<T>(string section, string name, object value, string desc, int min, int max)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if (value is int)
			{
				return (T)(object)((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>(section, name, (int)value, new ConfigDescription(desc, (AcceptableValueBase)(object)new AcceptableValueRange<int>(min, max), Array.Empty<object>()));
			}
			return (T)(object)((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>(section, name, (bool)value, new ConfigDescription(desc, (AcceptableValueBase)null, Array.Empty<object>()));
		}
	}
}