private static bool CheckAndEndGameForImpostorWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive && statistics.TeamJackalAlive == 0 && !(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2)) { __instance.enabled = false; GameOverReason endReason; switch (TempData.LastDeathReason) { case DeathReason.Exile: endReason = GameOverReason.ImpostorByVote; break; case DeathReason.Kill: endReason = GameOverReason.ImpostorByKill; break; default: endReason = GameOverReason.ImpostorByVote; break; } ShipStatus.RpcEndGame(endReason, false); return(true); } return(false); }
private static bool CheckAndEndGameForImpostorWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive && statistics.TeamJackalAlive == 0 && !(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2)) { if (!DestroyableSingleton <TutorialManager> .JECNDKBIOFO) { __instance.enabled = false; GameOverReason endReason; switch (TempData.EBGJMGKCIFN) { case DeathReason.Exile: endReason = GameOverReason.ImpostorByVote; break; case DeathReason.Kill: endReason = GameOverReason.ImpostorByKill; break; default: endReason = GameOverReason.ImpostorByVote; break; } ShipStatus.PBKIGLMJEDH(endReason, false); return(true); } DestroyableSingleton <HudManager> .CMJOLNCMAPD.ShowPopUp(DestroyableSingleton <TranslationController> .CMJOLNCMAPD.GetString(StringNames.GameOverImpostorKills, new Il2CppReferenceArray <Il2CppSystem.Object>(0))); ReviveEveryone(); return(true); } return(false); }
public static bool Prefix(ShipStatus __instance) { if (!GameData.Instance) { return(false); } var statistics = new PlayerStatistics(__instance); if (CheckAndEndGameForSabotageWin(__instance)) { return(false); } if (CheckAndEndGameForTaskWin(__instance)) { return(false); } if (CheckAndEndGameForLoverWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForJackalWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForImpostorWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForCrewmateWin(__instance, statistics)) { return(false); } return(false); }
private static bool CheckAndEndGameForCrewmateWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamImpostorsAlive == 0 && statistics.TeamJackalAlive == 0) { __instance.enabled = false; ShipStatus.RpcEndGame(GameOverReason.HumansByVote, false); return(true); } return(false); }
private static bool CheckAndEndGameForJackalWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamJackalAlive >= statistics.TotalAlive - statistics.TeamJackalAlive && statistics.TeamImpostorsAlive == 0 && !(statistics.TeamJackalHasAliveLover && statistics.TeamLoversAlive == 2)) { __instance.enabled = false; ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.TeamJackalWin, false); return(true); } return(false); }
private static bool CheckAndEndGameForLoverWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamLoversAlive == 2 && statistics.TotalAlive <= 3) { __instance.enabled = false; ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.LoversWin, false); return(true); } return(false); }
public static bool Prefix(ShipStatus __instance) { if (!GameData.Instance) { return(false); } if (DestroyableSingleton <TutorialManager> .InstanceExists) // InstanceExists | Don't check Custom Criteria when in Tutorial { return(true); } var statistics = new PlayerStatistics(__instance); if (CheckAndEndGameForChildLose(__instance)) { return(false); } if (CheckAndEndGameForJesterWin(__instance)) { return(false); } if (CheckAndEndGameForArsonistWin(__instance)) { return(false); } if (CheckAndEndGameForSabotageWin(__instance)) { return(false); } if (CheckAndEndGameForTaskWin(__instance)) { return(false); } if (CheckAndEndGameForLoverWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForJackalWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForImpostorWin(__instance, statistics)) { return(false); } if (CheckAndEndGameForCrewmateWin(__instance, statistics)) { return(false); } return(false); }
private static bool CheckAndEndGameForCrewmateWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamImpostorsAlive == 0 && statistics.TeamJackalAlive == 0) { if (!DestroyableSingleton <TutorialManager> .JECNDKBIOFO) { __instance.enabled = false; ShipStatus.PBKIGLMJEDH(GameOverReason.HumansByVote, false); return(true); } DestroyableSingleton <HudManager> .CMJOLNCMAPD.ShowPopUp(DestroyableSingleton <TranslationController> .CMJOLNCMAPD.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray <Il2CppSystem.Object>(0))); ReviveEveryone(); return(true); } return(false); }
private static bool CheckAndEndGameForJackalWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamJackalAlive >= statistics.TotalAlive - statistics.TeamJackalAlive && statistics.TeamImpostorsAlive == 0 && !(statistics.TeamJackalHasAliveLover && statistics.TeamLoversAlive == 2)) { if (!DestroyableSingleton <TutorialManager> .JECNDKBIOFO) { __instance.enabled = false; ShipStatus.PBKIGLMJEDH((GameOverReason)CustomGameOverReason.TeamJackalWin, false); return(true); } DestroyableSingleton <HudManager> .CMJOLNCMAPD.ShowPopUp(DestroyableSingleton <TranslationController> .CMJOLNCMAPD.GetString(StringNames.GameOverImpostorKills, new Il2CppReferenceArray <Il2CppSystem.Object>(0))); ReviveEveryone(); return(true); } return(false); }
private static bool CheckAndEndGameForLoverWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamLoversAlive == 2 && statistics.TotalAlive <= 3) { if (!DestroyableSingleton <TutorialManager> .InstanceExists) { __instance.enabled = false; ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.LoversWin, false); // should be implemented using a proper GameOverReason in the future return(true); } DestroyableSingleton <HudManager> .Instance.ShowPopUp(DestroyableSingleton <TranslationController> .Instance.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray <Il2CppSystem.Object>(0))); ReviveEveryone(); return(true); } return(false); }
private static bool CheckAndEndGameForLoverWin(ShipStatus __instance, PlayerStatistics statistics) { if (statistics.TeamLoversAlive == 2 && statistics.TotalAlive <= 3) { if (!DestroyableSingleton <TutorialManager> .BMHJGNNOGDM) { __instance.enabled = false; ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.LoversWin, false); return(true); } DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray <Il2CppSystem.Object>(0))); ReviveEveryone(); return(true); } return(false); }