namespace Aeshnidae.Challenge; /// /// Two hooks, and nothing else in ACE is touched. /// /// Creature.Die, so a boss's death is noticed the moment it happens. The same seam /// Aeshnidae.Invasions uses for its own boss, and for the same reason: it fires once, with /// the damage history intact, and ACE's own death handling is unaffected by a postfix. /// /// LandblockManager.Tick, only to sweep the record of runs whose copy has closed. The /// sweep itself returns immediately unless 30 seconds have passed and there is something /// to look at. /// /// Everything a player actually experiences - the roster, the missing corpses, the /// unscaled loot - is done by InstancesNoDat on this mod's behalf, through the filling /// hook. That is deliberate: those are hot paths in the most load-bearing mod on the /// server, and a second mod patching the same methods is a second place for them to go /// wrong. /// [HarmonyPatch] public static class Patches { [HarmonyPostfix] [HarmonyPatch(typeof(Creature), "Die", new[] { typeof(DamageHistoryInfo), typeof(DamageHistoryInfo) })] public static void PostCreatureDie(Creature __instance) { try { if (Mod.Settings.Enabled && __instance is not Player) Runs.OnCreatureDie(__instance); } catch (Exception ex) { ModManager.Log($"[{Mod.Name}] boss check failed: {ex.Message}", ModManager.LogLevel.Warn); } } [HarmonyPostfix] [HarmonyPatch(typeof(LandblockManager), nameof(LandblockManager.Tick))] public static void PostTick() { try { if (Mod.Settings.Enabled) Runs.Sweep(); } catch (Exception ex) { ModManager.Log($"[{Mod.Name}] sweep failed: {ex.Message}", ModManager.LogLevel.Warn); } } }