using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
[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: AssemblyCompany("HookTimerReset")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HookTimerReset")]
[assembly: AssemblyTitle("HookTimerReset")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace HookTimerReset;
[BepInPlugin("trpg.uk.hooktimerreset", "HookTimerReset", "1.0.0")]
public class Core : BaseUnityPlugin
{
public const string PluginGUID = "trpg.uk.hooktimerreset";
public const string PluginName = "HookTimerReset";
public const string PluginVersion = "1.0.0";
public static ManualLogSource Logger = Logger.CreateLogSource("HookTimerReset");
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Harmony val = new Harmony("HookTimerReset");
val.PatchAll();
}
}
[HarmonyPatch(typeof(HookPoint), "TurnOff")]
public class HookPoint_TurnOff_Patch
{
public static void Postfix(HookPoint __instance)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
if ((int)__instance.type == 2)
{
__instance.active = true;
}
}
}
[HarmonyPatch(typeof(HookPoint), "SwitchPulled")]
public class HookPoint_SwitchPulled_Patch
{
public static bool Prefix(HookPoint __instance)
{
if (__instance.timer > 0f)
{
__instance.TimerStop();
return false;
}
return true;
}
}
[HarmonyPatch(typeof(HookPoint), "TimerStop")]
public class HookPoint_TimerStop_Patch
{
public static void Prefix(HookPoint __instance)
{
__instance.active = false;
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "HookTimerReset";
public const string PLUGIN_NAME = "HookTimerReset";
public const string PLUGIN_VERSION = "1.0.0";
}