using System.Collections.Generic;
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 SmugJugCoilhead.AssetManager;
using SmugJugCoilhead.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("SmugJugCoilhead")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SmugJugCoilhead")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2efcf0b3-f77e-466c-a8e9-7bcfca7a263a")]
[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 SmugJugCoilhead
{
[BepInPlugin("SmugJugCoilhead", "SmugJugCoilhead", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public Harmony harmony;
private static Plugin Instance;
internal static ManualLogSource mls;
private void Awake()
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("SmugJugCoilhead");
mls.LogInfo((object)"SmugJugCoilhead has awakened");
harmony = new Harmony("SmugJugCoilhead");
harmony.PatchAll(typeof(Plugin));
Assets.LoadAssets();
harmony.PatchAll(typeof(ModPatches));
mls.LogInfo((object)"patched patches");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "SmugJugCoilhead";
public const string PLUGIN_NAME = "SmugJugCoilhead";
public const string PLUGIN_VERSION = "1.0.0";
public const string ASSET_BUNDLE_NAME = "smugjugcoilhead";
}
}
namespace SmugJugCoilhead.Patches
{
[HarmonyPatch]
internal class ModPatches
{
private static ManualLogSource mls33;
[HarmonyPatch(typeof(EnemyAI), "Start")]
[HarmonyPostfix]
public static void ReplaceHead(EnemyAI __instance)
{
SpringManAI val = (SpringManAI)(object)((__instance is SpringManAI) ? __instance : null);
if (val != null)
{
mls33 = Plugin.mls;
Transform val2 = ((Component)((Component)val).transform.Find("SpringManModel")).transform.Find("Head");
mls33.LogInfo((object)"Replacing model");
GameObject val3 = Object.Instantiate<GameObject>(Assets.NewHead, val2);
((Object)val3).name = "NewHeadModel";
mls33.LogInfo((object)"Crashed?");
}
}
}
}
namespace SmugJugCoilhead.AssetManager
{
public static class Assets
{
public static List<string> FileNames = new List<string>();
private static ManualLogSource mls33;
public static AssetBundle AssetBundle { get; private set; }
public static GameObject NewHead { get; private set; }
public static void LoadAssets()
{
mls33 = Plugin.mls;
mls33.LogInfo((object)"Attempting to start importing assetbundle");
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "smugjugcoilhead");
mls33.LogInfo((object)("Loading AssetBundle " + text));
AssetBundle = AssetBundle.LoadFromFile(text);
NewHead = AssetBundle.LoadAsset<GameObject>("Assets/smugjug/smugjughead.prefab");
mls33.LogInfo((object)"Crashed?");
}
}
}