Decompiled source of RoaringMoonThumper v1.0.0

BepInEx/plugins/RoaringMoonThumper.dll

Decompiled a year ago
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 RaccoonLib.Modules;
using RoaringMoonThumper.Patches;
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("RoaringMoonThumper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RoaringMoonThumper")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8cd4648e-2f4e-4e0d-98b5-6b488a977624")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RoaringMoonThumper
{
	[BepInPlugin("Brew.RoaringMoonThumper", "RoaringMoonThumper", "1.0.0")]
	public class RMThumperBase : BaseUnityPlugin
	{
		private const string modGUID = "Brew.RoaringMoonThumper";

		private const string modName = "RoaringMoonThumper";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Brew.RoaringMoonThumper");

		public static RMThumperBase Instance;

		internal ManualLogSource mls;

		public static GameObject RM_Model;

		public static BaseUnityPlugin plugin;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Brew.RoaringMoonThumper");
			plugin = (BaseUnityPlugin)(object)Instance;
			mls.LogInfo((object)"Regigigas bracken mod initialised");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "RoaringMoonThumper.dll";
			string text2 = "thumper";
			AssetBundle val = ContentLoader.FetchAssetBundle((BaseUnityPlugin)(object)Instance, text, text2);
			RM_Model = val.LoadAsset<GameObject>("Assets/AssetBundlesWanted/NewThumper 2.prefab");
			Debug.Log((object)"Roaring Moon Thumper Model loaded");
			harmony.PatchAll(typeof(RMThumperBase));
			harmony.PatchAll(typeof(CrawlerAIPatch));
		}
	}
}
namespace RoaringMoonThumper.Patches
{
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class CrawlerAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void startPatch(CrawlerAI __instance)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Roaring Moon has awoken");
			GameObject val = EnemyReskinner.ReskinThumper(__instance, RMThumperBase.RM_Model);
			if (Object.op_Implicit((Object)(object)val))
			{
				GameObject gameObject = ((Component)val.transform.Find("Roaring Moon SV")).gameObject;
				val.transform.localPosition = new Vector3(0f, 0f, 0f);
				gameObject.transform.localPosition = new Vector3(0f, 0.5f, 0f);
				gameObject.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
			}
		}
	}
}