mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Add hide and seek end logic and cooldown checks
This commit is contained in:
1 parent
1c097b47df
commit
eef098317e
1 file changed
+22
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using AmongUs.Data;
|
||||||
using AmongUs.GameOptions;
|
using AmongUs.GameOptions;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using InnerNet;
|
using InnerNet;
|
||||||
@@ -34,6 +35,8 @@ public class HideAndSeekMode : AbstractGameMode
|
|||||||
public override bool ShowGameModeIntroCutscene => true;
|
public override bool ShowGameModeIntroCutscene => true;
|
||||||
public override bool GameModeBodyTypeOverride => true;
|
public override bool GameModeBodyTypeOverride => true;
|
||||||
public override bool ShowNormalGameSettings => false;
|
public override bool ShowNormalGameSettings => false;
|
||||||
|
public override bool ShowNormalRoleSettings => false;
|
||||||
|
public override float DefaultImpostorKillCooldown => 1f;
|
||||||
|
|
||||||
public static int ImpostorPlayerID()
|
public static int ImpostorPlayerID()
|
||||||
{
|
{
|
||||||
@@ -395,6 +398,25 @@ public class HideAndSeekMode : AbstractGameMode
|
|||||||
{
|
{
|
||||||
deadPlayerCount = 0;
|
deadPlayerCount = 0;
|
||||||
ShipStatus.Instance.BreakEmergencyButton();
|
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)
|
public override PlayerBodyTypes GetBodyType(PlayerControl player)
|
||||||
|
|||||||
Reference in new issue
Block a user