using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
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: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace DronesNreFix;
[BepInProcess("ULTRAKILL.exe")]
[BepInPlugin("dev.flazhik.drones-nre-fix", "Drones NRE fix", "1.0.0")]
public class DronesNreFixPlugin : BaseUnityPlugin
{
[HarmonyPatch(typeof(Drone))]
public static class DronePatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(Drone), "Awake")]
public static bool Drone_Awake_Prefix(Drone __instance, ref BloodsplatterManager ___bsm, ref GoreZone ___gz)
{
___bsm = MonoSingleton<BloodsplatterManager>.Instance;
___gz = GoreZone.ResolveGoreZone(((Component)__instance).transform);
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Drone), "Explode")]
public static bool Drone_Explode_Prefix(Drone __instance, ref EnemyIdentifier ___eid)
{
___eid.drillers.RemoveAll((Harpoon h) => (Object)(object)h == (Object)null);
return true;
}
}
private static Harmony _harmony;
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
_harmony = new Harmony("dev.flazhik.drones-nre-fix");
_harmony.PatchAll();
}
}