Decompiled source of IronStash v0.1.2

IronStash.dll

Decompiled 15 hours ago
using System;
using System.Diagnostics;
using System.Linq;
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("IronStash")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Stash those lockers")]
[assembly: AssemblyFileVersion("0.1.2.0")]
[assembly: AssemblyInformationalVersion("0.1.2+4d7e9deb6cfe9a22f4f2b01f9019c4ca42bc10d2")]
[assembly: AssemblyProduct("IronStash")]
[assembly: AssemblyTitle("IronStash")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.2.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 IronStash
{
	[BepInPlugin("dotlake.IronStash", "IronStash", "0.1.2")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Logger;

		public void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("dotlake.ironstash");
			val.PatchAll();
			Logger.LogInfo((object)"dotlake.IronStash is loaded");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "dotlake.IronStash";

		public const string PLUGIN_NAME = "IronStash";

		public const string PLUGIN_VERSION = "0.1.2";
	}
}
namespace IronStash.Patches
{
	[HarmonyPatch(typeof(CL_GameManager), "Start")]
	public class AddStash
	{
		[HarmonyPostfix]
		public static void Postfix(CL_GameManager __instance)
		{
			string[] source = new string[4] { "item_injector", "item_pillbottle", "denizen_sluggrub", "item_food_bar" };
			if (!CL_GameManager.GetBaseGamemode().IsIronKnuckle())
			{
				return;
			}
			for (int i = 0; i < SettingsManager.settings.competitiveSettings.lockerItems.Count; i++)
			{
				Item_Object itemObjectPrefab = CL_AssetManager.GetItemObjectPrefab(SettingsManager.settings.competitiveSettings.lockerItems[i], "");
				if ((Object)(object)itemObjectPrefab != (Object)null && source.Contains(itemObjectPrefab.itemData.itemName))
				{
					string text = SettingsManager.settings.competitiveSettings.lockerItems[i];
					CL_GameManager.SetGameFlag("equiplocker-" + CL_GameManager.GetBaseGamemode().GetGamemodeName(true) + "local" + (i + 1), true, text, false, false);
				}
			}
		}
	}
}