Decompiled source of AtomMine v1.0.0

AtomMine.dll

Decompiled 4 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BoplFixedMath;
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("AtomMine")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AtomMine")]
[assembly: AssemblyTitle("AtomMine")]
[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 AtomMine
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class mine_texture
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("AtomMine.mine_texture", typeof(mine_texture).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static Bitmap mine_new_tex
		{
			get
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Expected O, but got Unknown
				object @object = ResourceManager.GetObject("mine_new_tex", resourceCulture);
				return (Bitmap)@object;
			}
		}

		internal mine_texture()
		{
		}
	}
	[BepInPlugin("com.erwer.AtomMine", "AtomMine", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_GUID = "com.erwer.AtomMine";

		public const string PLUGIN_NAME = "AtomMine";

		public const string PLUGIN_VERSION = "1.0.0";

		internal static ConfigFile config;

		internal static ConfigEntry<float> multiplier;

		private void Awake()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.erwer.AtomMine is loaded!");
			multiplier = config.Bind<float>("Settings", "Explosion Multiplier", 12f, new ConfigDescription("Increases the size of Mine Explosions", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 12f), Array.Empty<object>()));
			if (multiplier.Value < 1f)
			{
				multiplier.Value = 1f;
			}
			if (multiplier.Value > 12f)
			{
				multiplier.Value = 12f;
			}
			Harmony val = new Harmony("com.erwer.AtomMine");
			val.PatchAll(typeof(Patches));
		}
	}
	public class Patches
	{
		[HarmonyPatch(typeof(Mine), "Detonate")]
		[HarmonyPrefix]
		public static bool Detonate(Mine __instance, ref Explosion ___Explosion, ref BoplBody ___body, ref IPhysicsCollider ___physicsCollider)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Explosion val = FixTransform.InstantiateFixed<Explosion>(___Explosion, ___body.position);
			((Component)val).GetComponent<IPhysicsCollider>().Scale = ___physicsCollider.Scale * (Fix)Plugin.multiplier.Value;
			val.PlayerOwnerId = ((Component)__instance).GetComponent<Item>().OwnerId;
			if (__instance.SoundToPlayOnDetonation != null)
			{
				AudioManager.Get().Play(__instance.SoundToPlayOnDetonation);
			}
			Updater.DestroyFix(((Component)__instance).gameObject);
			return false;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "AtomMine";

		public const string PLUGIN_NAME = "AtomMine";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}