From 9dfb40d7bf8492ba1329a08771d19942b264be32 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 24 Sep 2025 07:12:34 -0400 Subject: [PATCH 1/5] add new role stubs --- MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs | 73 +++++++++++++++++++++ 1 file changed, 73 insertions(+) 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 + } } From 59f30586857c0b7309ee47d1b9835953ac08a988 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 24 Sep 2025 07:21:31 -0400 Subject: [PATCH 2/5] update comment --- MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))] From 6d387cae96a7cf77bb9aa20724ab22733f6450b4 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 24 Sep 2025 07:35:50 -0400 Subject: [PATCH 3/5] fix round start events for airship --- MiraAPI/Patches/Roles/EjectionPatches.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() { From e5cfd8a2fcfe74fabedcde9b90ba985612b11505 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 24 Sep 2025 08:24:14 -0400 Subject: [PATCH 4/5] fix game never ending --- MiraAPI/Patches/Events/EndGamePatches.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) { From 4dd2554b38666836a4996c999f3b4dae781c0391 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 24 Sep 2025 08:53:09 -0400 Subject: [PATCH 5/5] bump version --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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