Decompiled source of AdamanceRockRemoval v1.0.0

AdamanceRocks.dll

Decompiled 4 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AdamanceRocks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamanceRocks")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dc35941e-2b01-4fe0-abfa-1a97a871789f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AdamanceRocks;

[BepInPlugin("AdamanceRocksRemoval", "GoblinKingShmeesAdamanceRockRemoval", "1.0.0")]
public class AdamanceRock : BaseUnityPlugin
{
	private readonly Harmony harmony = new Harmony("AdamanceRocks");

	public static ManualLogSource mls;

	private static AdamanceRock Instance;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = ((BaseUnityPlugin)this).Logger;
		mls.LogInfo((object)"--===REMOVING THOSE ROCKS!===--");
		harmony.PatchAll(typeof(AdamanceRock));
	}

	[HarmonyPatch(typeof(StartOfRound), "Update")]
	[HarmonyPostfix]
	public static void TimeSwap()
	{
		if (!(((Object)StartOfRound.Instance.currentLevel).name == "AdamanceLevel"))
		{
			return;
		}
		try
		{
			GameObject val = GameObject.Find("Environment");
			if ((Object)(object)val != (Object)null)
			{
				((Component)val.transform.Find("Map").Find("GreyRockGrouping2 (7)")).gameObject.SetActive(false);
			}
		}
		catch (Exception)
		{
		}
	}
}