Decompiled source of PermanentContrabandGats v1.0.0

BepInEx/plugins/PermanentContrabandGats.dll

Decompiled a day 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;

[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("PermanentContrabandGats")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0")]
[assembly: AssemblyProduct("Permanent Contraband Gats")]
[assembly: AssemblyTitle("PermanentContrabandGats")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.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 PermanentContrabandGats
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "PermanentContrabandGats";

		public const string PLUGIN_NAME = "Permanent Contraband Gats";

		public const string PLUGIN_VERSION = "0.0.0";
	}
}
namespace MycopunkMods
{
	[BepInPlugin("hed14.permanentcontrabandgats", "Permanent Contraband Gats", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("hed14.permanentcontrabandgats").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod Initialized: Single-file patch applied successfully!");
		}
	}
	[HarmonyPatch(typeof(OuroObjective))]
	public static class OuroResetPatch
	{
		[HarmonyPatch("SetupOnMissionStart")]
		[HarmonyPrefix]
		public static bool Prefix(OuroObjective __instance)
		{
			ref bool reference = ref AccessTools.FieldRefAccess<OuroObjective, bool>(__instance, "setupOnStart");
			if (reference)
			{
				return false;
			}
			reference = true;
			OuroObjective.ContrabandsCollected = 0;
			PlayerData.Instance.ouroData.lastOuroTime = 0f;
			PlayerData.Instance.ouroData.lastOuroRooms = 0;
			PlayerData.Instance.ouroData.lastOuroKills = 0;
			PlayerData.Instance.ouroData.lastOuroDamage = 0f;
			PlayerData.Instance.ouroData.lastOuroDeaths = 0;
			PlayerData.Instance.ouroData.lastOuroBosses = 0;
			PlayerData.Instance.ouroData.lastOuroLevels = 0;
			PlayerData.Instance.ouroData.lastOuroUpgrades = 0;
			PlayerData.DeleteMissionUpgrades((Rarity)(-1));
			return false;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}