diff --git a/Directory.Build.props b/Directory.Build.props index 5460560..ac800b3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ true - 0.2.2 + 0.3.0 dev All Of Us, XtraCube, Angxl diff --git a/MiraAPI/Patches/Events/EndGamePatches.cs b/MiraAPI/Patches/Events/EndGamePatches.cs index 558c468..fe5a7bb 100644 --- a/MiraAPI/Patches/Events/EndGamePatches.cs +++ b/MiraAPI/Patches/Events/EndGamePatches.cs @@ -7,8 +7,17 @@ namespace MiraAPI.Patches.Events; internal static class EndGamePatches { + [HarmonyPatch(typeof(GameManager), nameof(GameManager.Awake))] + public static class GameManagerAwakePatch + { + public static void Postfix(GameManager __instance) + { + __instance.enabled = true; + } + } + [HarmonyPatch(typeof(GameManager), nameof(GameManager.RpcEndGame))] - public static class GameManagerPatches + public static class GameManagerRpcEndGamePatch { public static bool Prefix(GameOverReason endReason) { diff --git a/MiraAPI/Patches/Roles/EjectionPatches.cs b/MiraAPI/Patches/Roles/EjectionPatches.cs index 009da27..d37b550 100644 --- a/MiraAPI/Patches/Roles/EjectionPatches.cs +++ b/MiraAPI/Patches/Roles/EjectionPatches.cs @@ -33,8 +33,8 @@ internal static class EjectionPatches __instance.completeString = role.GetCustomEjectionMessage(__instance.initData.networkedPlayer); } - [HarmonyPatch(typeof(ExileController), nameof(ExileController.WrapUp))] - public static class WrapUpPatch + [HarmonyPatch(typeof(ExileController), nameof(ExileController.ReEnableGameplay))] + public static class ReEnableGameplayPatch { public static void Postfix() { diff --git a/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs b/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs index 7f53b0a..25143c9 100644 --- a/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs +++ b/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs @@ -13,7 +13,7 @@ namespace MiraAPI.Patches.Roles; public static class RoleOptionsCollectionPatch { /// - /// This patch fixes GetNumPerGame being inlined (2025.5.20) in the original code. + /// This patch fixes GetNumPerGame being inlined (2025.9.9) in the original code. /// [HarmonyPrefix] [HarmonyPatch(nameof(RoleOptionsCollectionV10.AnyRolesEnabled))] diff --git a/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs b/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs index fe04962..356bf68 100644 --- a/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs +++ b/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs @@ -1,5 +1,6 @@ using System.Runtime.CompilerServices; using HarmonyLib; +using Hazel; using Il2CppSystem.Text; namespace MiraAPI.Patches.Stubs; @@ -229,4 +230,76 @@ public static class RoleBehaviourStubs { // nothing needed } + + /// + /// Stub method for RoleBehaviour.UseSecondaryAbility. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.UseSecondaryAbility))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void UseSecondaryAbility(RoleBehaviour instance) + { + // nothing needed + } + + /// + /// Stub method for RoleBehaviour.OnRoleSet. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.OnRoleSet))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void OnRoleSet(RoleBehaviour instance) + { + // nothing needed + } + + /// + /// Stub method for RoleBehaviour.InitializeMeetingAbilityButton. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.InitializeMeetingAbilityButton))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void InitializeMeetingAbilityButton(RoleBehaviour instance) + { + // nothing needed + } + + /// + /// Stub method for RoleBehaviour.FindClosestBody. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.FindClosestBody))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static DeadBody FindClosestBody(RoleBehaviour instance) + { + return null!; + } + + /// + /// Stub method for RoleBehaviour.HandleRoleRpc. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.HandleRoleRpc))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void HandleRoleRpc(RoleBehaviour instance, byte callId, MessageReader reader) + { + // nothing needed + } + + /// + /// Stub method for RoleBehaviour.KillAnimSpecialSetup. + /// + /// The RoleBehaviour object. + [HarmonyReversePatch] + [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.KillAnimSpecialSetup))] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void KillAnimSpecialSetup(RoleBehaviour instance, DeadBody deadBody, PlayerControl killer, PlayerControl victim) + { + // nothing needed + } }