Decompiled source of HardcoreEquipments v1.0.6

HardcoreEquipments.dll

Decompiled 6 days 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 HarmonyLib;
using Microsoft.CodeAnalysis;
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: AssemblyCompany("blacks7ar")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.6")]
[assembly: AssemblyInformationalVersion("1.0.0+ea97976ee5ba5c1bf91ba0db5667678881d9bed0")]
[assembly: AssemblyProduct("HardcoreEquipments")]
[assembly: AssemblyTitle("HardcoreEquipments")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.6.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 HardcoreEquipments
{
	[BepInPlugin("blacks7ar.HardcoreEquipments", "HardcoreEquipments", "1.0.6")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch]
		public static class Patches
		{
			[HarmonyPostfix]
			[HarmonyPatch(typeof(ItemDrop), "Awake")]
			private static void Awake_Postfix(ItemDrop __instance)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Expected I4, but got Unknown
				if (!((Object)(object)__instance == (Object)null))
				{
					ItemType itemType = __instance.m_itemData.m_shared.m_itemType;
					bool flag;
					switch (itemType - 3)
					{
					case 0:
					case 1:
					case 2:
					case 3:
					case 4:
					case 8:
					case 9:
					case 11:
					case 12:
					case 14:
					case 15:
					case 16:
					case 17:
					case 19:
					case 21:
						flag = true;
						break;
					default:
						flag = false;
						break;
					}
					if (flag)
					{
						__instance.m_itemData.m_shared.m_destroyBroken = true;
					}
				}
			}
		}

		private const string modGUID = "blacks7ar.HardcoreEquipments";

		public const string modName = "HardcoreEquipments";

		public const string modAuthor = "blacks7ar";

		public const string modVersion = "1.0.6";

		private static readonly Harmony _harmony = new Harmony("blacks7ar.HardcoreEquipments");

		public void Awake()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			_harmony.PatchAll(executingAssembly);
		}
	}
}