Decompiled source of GokuSpiders v1.0.1

BepInEx/GokuSpiders.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalCompanyGokuSpiders;
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("GokuSpiders")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("GokuSpiders")]
[assembly: AssemblyCopyright("Copyright © HP 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("97e220e6-98a7-4a53-9470-2546a962ab77")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Goku.Patches
{
	[HarmonyPatch]
	internal class EnemyTypes
	{
		[HarmonyPatch(typeof(SandSpiderAI), "Start")]
		[HarmonyPostfix]
		public static void SummonGoku(SandSpiderAI __instance)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Expected O, but got Unknown
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			ManualLogSource val = new ManualLogSource("GokuSpiders");
			Logger.Sources.Add((ILogSource)val);
			string text = "null";
			text = "Assets/gok.prefab";
			try
			{
				Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("MeshContainer").Find("MeshRenderer")).gameObject.GetComponent<SkinnedMeshRenderer>());
				Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("MeshContainer").Find("AnimContainer").Find("Armature")
					.Find("Head")
					.Find("RightFang")).gameObject.GetComponent<MeshRenderer>());
				Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("MeshContainer").Find("AnimContainer").Find("Armature")
					.Find("Head")
					.Find("RightFang")).gameObject.GetComponent<MeshFilter>());
				Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("MeshContainer").Find("AnimContainer").Find("Armature")
					.Find("Head")
					.Find("LeftFang")).gameObject.GetComponent<MeshRenderer>());
				Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("MeshContainer").Find("AnimContainer").Find("Armature")
					.Find("Head")
					.Find("LeftFang")).gameObject.GetComponent<MeshFilter>());
				GameObject val2 = Plugin.LoadedBundle.LoadAsset<GameObject>(text);
				if ((Object)val2 == (Object)null)
				{
					Debug.LogError((object)"Goku prefab not loaded!");
					return;
				}
				GameObject val3 = Object.Instantiate<GameObject>(Plugin.LoadedBundle.LoadAsset<GameObject>(text), ((Component)__instance).gameObject.transform);
				Debug.Log((object)"SPAWNED GOKU AEAEAEE");
				val3.transform.SetParent(((Component)__instance).transform, false);
				val3.transform.localPosition = new Vector3(0f, 2.2f, 0f);
			}
			catch (Exception arg)
			{
				Debug.LogError((object)$"Exception: {arg}");
			}
		}
	}
}
namespace LethalCompanyGokuSpiders
{
	[BepInPlugin("GokuSpiders", "GokuSpiders", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		public Harmony harmonymain;

		public static AssetBundle LoadedBundle;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			harmonymain = new Harmony("GokuSpiders");
			harmonymain.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin GokuSpiders is loaded!");
			string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Gok");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			if ((Object)val == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load GokuSpiders AssetBundle! (Bundle should be located in the same folder as mod!)");
				return;
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Successfully loaded GokuSpiders AssetBundle!");
			LoadedBundle = val;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "GokuSpiders";

		public const string PLUGIN_NAME = "GokuSpiders";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}