using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("GnoMoGnome")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GnoMoGnome")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("564ff281-6f3a-4a16-8ee1-6b7fe3deb463")]
[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 GnoMoGnome;
[BepInPlugin("oofie.repo.gnomognome", "GnoMoGnome", "1.0.0")]
public class GnoMoGnome : BaseUnityPlugin
{
private const string pluginGuid = "oofie.repo.gnomognome";
private const string pluginName = "GnoMoGnome";
private const string pluginVersion = "1.0.0";
public void Awake()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"GnoMoGnome version 1.0.0 loaded :3");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Hi Spiffers");
Harmony val = new Harmony("oofie.repo.gnomognome");
MethodInfo methodInfo = AccessTools.Method(typeof(EnemyGnomeDirector), "StateAttackSet", (Type[])null, (Type[])null);
MethodInfo methodInfo2 = AccessTools.Method(typeof(MyPatches), "StateAttackSet_Patch", (Type[])null, (Type[])null);
val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
}
}
[HarmonyPatch(typeof(EnemyGnomeDirector), "StateAttackSet")]
public class MyPatches
{
public static bool StateAttackSet_Patch(EnemyGnomeDirector __instance, ref bool ___stateImpulse)
{
if (___stateImpulse)
{
___stateImpulse = false;
MethodInfo methodInfo = AccessTools.Method(typeof(EnemyGnomeDirector), "UpdateState", (Type[])null, (Type[])null);
if (methodInfo != null)
{
methodInfo.Invoke(__instance, new object[1] { (object)(State)5 });
}
else
{
Debug.LogError((object)"Failed to find UpdateState method.");
}
}
return false;
}
}