namespace Aeshnidae.Healing; /// /// Heals that keep up with the vital they heal - healing and stamina kits, Heal and Revitalize spells, /// never below retail (Settings.cs, Scaling.cs). Tom, 2026-09-29. /// public class Mod : IHarmonyMod { public static readonly string Name = typeof(Mod).Assembly.GetName().Name!; public static readonly string HarmonyId = $"mod.{Name.ToLowerInvariant()}"; public static readonly string ModPath = Path.Combine(ModManager.ModPath, Name); public static ModContainer? Container => ModManager.GetModContainerByPath(ModPath); public static Settings Settings { get; internal set; } = new(); private static Harmony? _harmony; private bool _disposed; public void Initialize() { try { Settings = Settings.Load(ModPath); _harmony = new Harmony(HarmonyId); // Explicit assembly: the parameterless overload walks the stack and can land on ACE.Server. _harmony.PatchAllUncategorized(typeof(Mod).Assembly); ModManager.Log($"[{Name}] loaded - {(Settings.Enabled ? "ON" : "off")}: references health {Settings.ReferenceHealth:N0}, stamina {Settings.ReferenceStamina:N0}"); } catch (Exception ex) { ModManager.Log($"[{Name}] failed to start: {ex}", ModManager.LogLevel.Error); } } public static void ReloadSettings() => Settings = Settings.Load(ModPath); public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (_disposed) return; if (disposing) { _harmony?.UnpatchAll(HarmonyId); _harmony = null; ModManager.Log($"[{Name}] shut down"); } _disposed = true; } }