using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("UltimateLethal.ScannerCooldown")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("UltimateLethal.ScannerCooldown")] [assembly: AssemblyTitle("UltimateLethal.ScannerCooldown")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace UltimateLethal.ScannerCooldown { [BepInPlugin("ultimatelethal.scannercooldown", "Ultimate Lethal Scanner Cooldown", "1.0.1")] public sealed class ScannerCooldownPlugin : BaseUnityPlugin { public const string PluginGuid = "ultimatelethal.scannercooldown"; public const string PluginName = "Ultimate Lethal Scanner Cooldown"; public const string PluginVersion = "1.0.1"; internal static ConfigEntry CooldownSeconds; private Harmony _harmony; private void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown CooldownSeconds = ((BaseUnityPlugin)this).Config.Bind("Scanner", "CooldownSeconds", 8f, new ConfigDescription("Minimum time in seconds between successful HUD scans.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 60f), Array.Empty())); _harmony = new Harmony("ultimatelethal.scannercooldown"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Ultimate Lethal Scanner Cooldown 1.0.1 loaded. Cooldown: " + CooldownSeconds.Value.ToString("0.0") + "s")); } private void OnDestroy() { if (_harmony != null) { _harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] internal static class PingScanCooldownPatch { private static float _nextAllowedScanTime; [HarmonyPrefix] private static bool Prefix() { float unscaledTime = Time.unscaledTime; if (unscaledTime < _nextAllowedScanTime) { return false; } _nextAllowedScanTime = unscaledTime + ScannerCooldownPlugin.CooldownSeconds.Value; return true; } } }