Decompiled source of MoreShopItems v1.0.0

MoreShopItems.dll

Decompiled 20 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
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.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("More Shop Items")]
[assembly: AssemblyTitle("MoreShopItems")]
[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.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.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony _harmony = new Harmony("MoreShopItems");

		internal int itemtargetSpawnAmount;

		internal int itemConsumablesAmount;

		internal int itemUpgradesAmount;

		internal int itemHealthPacksAmount;

		internal static Plugin Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			if ((Object)Instance == (Object)null)
			{
				Instance = this;
			}
			itemtargetSpawnAmount = 50;
			itemConsumablesAmount = 28;
			itemUpgradesAmount = 14;
			itemHealthPacksAmount = 15;
			_harmony.PatchAll(typeof(ShopManagerPatch));
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin MoreShopItems is loaded!");
		}
	}
	[HarmonyPatch(typeof(ShopManager), "Awake")]
	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 void Postfix(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 = Plugin.Instance.itemtargetSpawnAmount;
			reference2 = Plugin.Instance.itemConsumablesAmount;
			reference3 = Plugin.Instance.itemUpgradesAmount;
			reference4 = Plugin.Instance.itemHealthPacksAmount;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "MoreShopItems";

		public const string PLUGIN_NAME = "More Shop Items";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}