Decompiled source of BiggerExplosives v2.0.0

plugins/BiggerExplosives/BiggerExplosives.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EquinoxsModUtils;
using HarmonyLib;

[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.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace BiggerExplosives;

[BepInPlugin("com.equinox.BiggerExplosives", "BiggerExplosives", "2.0.0")]
public class BiggerExplosivesPlugin : BaseUnityPlugin
{
	private const string MyGUID = "com.equinox.BiggerExplosives";

	private const string PluginName = "BiggerExplosives";

	private const string VersionString = "2.0.0";

	public static string ExplosionWidthKey = "Explosion Width";

	public static string ExplosionDepthKey = "Explosion Depth";

	public static ConfigEntry<int> ExplosionWidth;

	public static ConfigEntry<int> ExplosionDepth;

	private static readonly Harmony Harmony = new Harmony("com.equinox.BiggerExplosives");

	public static ManualLogSource Log = new ManualLogSource("BiggerExplosives");

	private void Awake()
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Expected O, but got Unknown
		ExplosionWidth = ((BaseUnityPlugin)this).Config.Bind<int>("General", ExplosionWidthKey, 11, new ConfigDescription("Width of the resulting tunnel", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 15), Array.Empty<object>()));
		ExplosionDepth = ((BaseUnityPlugin)this).Config.Bind<int>("General", ExplosionDepthKey, 20, new ConfigDescription("Distance from the explosive to dig.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 30), Array.Empty<object>()));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: BiggerExplosives, VersionString: 2.0.0 is loading...");
		Harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: BiggerExplosives, VersionString: 2.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
		Events.GameDefinesLoaded += OnGameDefinesLoaded;
	}

	private void OnGameDefinesLoaded()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		ResourceInfo resourceInfoByName = Resources.GetResourceInfoByName("Mining Charge", false);
		ExplosiveDefinition val = (ExplosiveDefinition)resourceInfoByName;
		val.explosionRadius = ExplosionWidth.Value;
		val.explosionDepth = ExplosionDepth.Value;
	}
}