From eef098317e92662e05e7e755dbc3183b16e3fe6b Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Wed, 12 Aug 2026 23:20:19 -0500 Subject: [PATCH] Add hide and seek end logic and cooldown checks --- MiraAPI/GameModes/HideAndSeekMode.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/MiraAPI/GameModes/HideAndSeekMode.cs b/MiraAPI/GameModes/HideAndSeekMode.cs index fe5cf41..952a268 100644 --- a/MiraAPI/GameModes/HideAndSeekMode.cs +++ b/MiraAPI/GameModes/HideAndSeekMode.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using AmongUs.Data; using AmongUs.GameOptions; using HarmonyLib; using InnerNet; @@ -34,7 +35,9 @@ public class HideAndSeekMode : AbstractGameMode public override bool ShowGameModeIntroCutscene => true; public override bool GameModeBodyTypeOverride => true; public override bool ShowNormalGameSettings => false; - + public override bool ShowNormalRoleSettings => false; + public override float DefaultImpostorKillCooldown => 1f; + public static int ImpostorPlayerID() { return OptionGroupSingleton.Instance.SelectedSeeker.Value; @@ -395,6 +398,25 @@ public class HideAndSeekMode : AbstractGameMode { deadPlayerCount = 0; ShipStatus.Instance.BreakEmergencyButton(); + PlayerControl.LocalPlayer.SetKillTimer(0.01f); + } + + public override void CheckGameEnd(out bool runOriginal, LogicGameFlowNormal instance) + { + runOriginal = false; + if (Helpers.GetAlivePlayers().Count(x => x.Data.Role.IsImpostor) == 0) + { + instance.Manager.RpcEndGame(GameOverReason.ImpostorDisconnect, !DataManager.Player.Ads.HasPurchasedAdRemoval); + } + if (Helpers.GetAlivePlayers().Count(x => !x.Data.Role.IsImpostor) != 0) + { + /*if (instance.AllTimersExpired()) + { + instance.Manager.RpcEndGame(GameOverReason.HideAndSeek_CrewmatesByTimer, !DataManager.Player.Ads.HasPurchasedAdRemoval); + }*/ + return; + } + instance.Manager.RpcEndGame(GameOverReason.HideAndSeek_ImpostorsByKills, !DataManager.Player.Ads.HasPurchasedAdRemoval); } public override PlayerBodyTypes GetBodyType(PlayerControl player)