Decompiled source of StealthMines v1.0.0

StealthMines.dll

Decompiled 4 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 BepInEx.Configuration;
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(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("StealthMines")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Makes mines harder to see when they are armed.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3d19f54d8da727f757b5490806dfa5cdb800199e")]
[assembly: AssemblyProduct("StealthMines")]
[assembly: AssemblyTitle("StealthMines")]
[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 StealthMines
{
	[BepInPlugin("dev.cmax.StealthMines", "StealthMines", "1.0.0")]
	[BepInProcess("BoplBattle.exe")]
	public class Plugin : BaseUnityPlugin
	{
		internal static Harmony harmony;

		internal static ManualLogSource logger;

		internal static ConfigFile config;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
			logger = ((BaseUnityPlugin)this).Logger;
			config = ((BaseUnityPlugin)this).Config;
			((BaseUnityPlugin)this).Logger.LogMessage((object)$"guid: {((BaseUnityPlugin)this).Info.Metadata.GUID}, name: {((BaseUnityPlugin)this).Info.Metadata.Name}, version: {((BaseUnityPlugin)this).Info.Metadata.Version}");
			harmony.Patch((MethodBase)AccessTools.Method(typeof(Mine), "UpdateSim", (Type[])null, (Type[])null), new HarmonyMethod(typeof(Patches), "MineUpdate_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}
	internal class Patches
	{
		internal static void MineUpdate_Prefix(Mine __instance)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			SpriteRenderer component = ((Component)__instance).gameObject.GetComponent<SpriteRenderer>();
			if ((int)__instance.state == 1)
			{
				((Component)__instance).gameObject.GetComponent<Renderer>().enabled = false;
				__instance.lightPeriod = 0.6f;
				__instance.maxAlpha = 0.2f;
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "StealthMines";

		public const string PLUGIN_NAME = "StealthMines";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}