Beispiel #1
0
        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.PJPCCFAPCKJ)
                {
                case DeathReason.Exile:
                    endReason = GameOverReason.ImpostorByVote;
                    break;

                case DeathReason.Kill:
                    endReason = GameOverReason.ImpostorByKill;
                    break;

                default:
                    endReason = GameOverReason.ImpostorByVote;
                    break;
                }
                ShipStatus.EABBNOODFGL(endReason, false);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        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> .BMHJGNNOGDM)
                {
                    __instance.enabled = false;
                    GameOverReason endReason;
                    switch (TempData.PJPCCFAPCKJ)
                    {
                    case DeathReason.Exile:
                        endReason = GameOverReason.ImpostorByVote;
                        break;

                    case DeathReason.Kill:
                        endReason = GameOverReason.ImpostorByKill;
                        break;

                    default:
                        endReason = GameOverReason.ImpostorByVote;
                        break;
                    }
                    ShipStatus.EABBNOODFGL(endReason, false);
                    return(true);
                }
                DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverImpostorKills, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

                ReviveEveryone();
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        private static bool CheckAndEndGameForTaskWin(ShipStatus __instance)
        {
            bool localCompletedAllTasks = true;

            foreach (PlayerTask t in PlayerControl.LocalPlayer.myTasks)
            {
                localCompletedAllTasks = localCompletedAllTasks && t.FDIIBNGHCAK;
            }

            if (!DestroyableSingleton <TutorialManager> .BMHJGNNOGDM)
            {
                if (GameData.Instance.TotalTasks <= GameData.Instance.CompletedTasks)
                {
                    __instance.enabled = false;
                    ShipStatus.EABBNOODFGL(GameOverReason.HumansByTask, false);
                    return(true);
                }
            }
            else if (localCompletedAllTasks)
            {
                DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverTaskWin, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

                __instance.Begin();
                return(true);
            }
            return(false);
        }
Beispiel #4
0
 private static bool CheckAndEndGameForCrewmateWin(ShipStatus __instance, PlayerStatistics statistics)
 {
     if (statistics.TeamImpostorsAlive == 0 && statistics.TeamJackalAlive == 0)
     {
         __instance.enabled = false;
         ShipStatus.EABBNOODFGL(GameOverReason.HumansByVote, false);
         return(true);
     }
     return(false);
 }
Beispiel #5
0
 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.EABBNOODFGL((GameOverReason)CustomGameOverReason.TeamJackalWin, false);
         return(true);
     }
     return(false);
 }
Beispiel #6
0
 private static bool CheckAndEndGameForLoverWin(ShipStatus __instance, PlayerStatistics statistics)
 {
     if (statistics.TeamLoversAlive == 2 && statistics.TotalAlive <= 3)
     {
         __instance.enabled = false;
         ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.LoversWin, false);
         return(true);
     }
     return(false);
 }
Beispiel #7
0
 private static bool CheckAndEndGameForTaskWin(ShipStatus __instance)
 {
     if (GameData.Instance.TotalTasks <= GameData.Instance.CompletedTasks)
     {
         __instance.enabled = false;
         ShipStatus.EABBNOODFGL(GameOverReason.HumansByTask, false);
         return(true);
     }
     return(false);
 }
Beispiel #8
0
 private static bool CheckAndEndGameForJesterWin(ShipStatus __instance)
 {
     if (Jester.triggerJesterWin)
     {
         __instance.enabled = false;
         ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false);
         return(true);
     }
     return(false);
 }
Beispiel #9
0
 private static bool CheckAndEndGameForChildLose(ShipStatus __instance)
 {
     if (Child.triggerChildLose)
     {
         __instance.enabled = false;
         ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.ChildLose, false);
         return(true);
     }
     return(false);
 }
Beispiel #10
0
        private static void EndGameForSabotage(ShipStatus __instance)
        {
            if (!DestroyableSingleton <TutorialManager> .BMHJGNNOGDM)
            {
                __instance.enabled = false;
                ShipStatus.EABBNOODFGL(GameOverReason.ImpostorBySabotage, false);
                return;
            }
            DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverSabotage, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

            ReviveEveryone();
        }
Beispiel #11
0
        private static bool CheckAndEndGameForCrewmateWin(ShipStatus __instance, PlayerStatistics statistics)
        {
            if (statistics.TeamImpostorsAlive == 0 && statistics.TeamJackalAlive == 0)
            {
                if (!DestroyableSingleton <TutorialManager> .BMHJGNNOGDM)
                {
                    __instance.enabled = false;
                    ShipStatus.EABBNOODFGL(GameOverReason.HumansByVote, false);
                    return(true);
                }
                DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

                ReviveEveryone();
                return(true);
            }
            return(false);
        }
Beispiel #12
0
        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> .BMHJGNNOGDM)
                {
                    __instance.enabled = false;
                    ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.TeamJackalWin, false);
                    return(true);
                }
                DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverImpostorKills, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

                ReviveEveryone();
                return(true);
            }
            return(false);
        }
Beispiel #13
0
        private static bool CheckAndEndGameForJesterWin(ShipStatus __instance)
        {
            if (Jester.triggerJesterWin)
            {
                if (!DestroyableSingleton <TutorialManager> .BMHJGNNOGDM)
                {
                    __instance.enabled = false;
                    ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false);
                    return(true);
                }
                DestroyableSingleton <HudManager> .CHNDKKBEIDG.ShowPopUp(DestroyableSingleton <TranslationController> .CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray <Il2CppSystem.Object>(0)));

                ReviveEveryone();
                return(true);
            }
            return(false);
        }
Beispiel #14
0
        public static void Postfix1(AmongUsClient __instance, ClientData MLPPNIKICPC, GABADEGMIHF AMGCOJNIHLM)
        {
            MLPPNIKICPC.Character.FIMGDJOCIGD.IAGJEKLJCCI = true;

            if (PlayerController.players != null)
            {
                if (AmongUsClient.Instance.ClientId == AmongUsClient.Instance.HostId)
                {
                    EndReason reason = Love.CheckWin();

                    if (reason == EndReason.LoveWin)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(InnerPlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoveWin, Hazel.SendOption.Reliable, -1);
                        writer.Write((byte)reason);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);

                        PlayerControlPatch.LoveCoupleWins();
                        ShipStatus.EABBNOODFGL(AMGMAKBHCMN.ImpostorByVote, false);
                    }
                }
            }
        }
Beispiel #15
0
 private static void EndGameForSabotage(ShipStatus __instance)
 {
     __instance.enabled = false;
     ShipStatus.EABBNOODFGL(GameOverReason.ImpostorBySabotage, false);
     return;
 }
        public static bool Prefix(ShipStatus __instance)
        {
            if (__instance.CheckTaskCompletion())
            {
                return(true);
            }
            if (__instance.Systems.ContainsKey(SystemType.Reactor))
            {
                if (__instance.GetIl2CppType() == AirshipStatus.Il2CppType)
                {
                    HeliSabotageSystem Reactor = __instance.Systems[SystemType.Reactor].Cast <HeliSabotageSystem>();
                    if (Reactor.LEJABJDEHPE & Reactor.GPBBPGOINOF <= 0)
                    {
                        return(true);
                    }
                }
                else
                {
                    ReactorSystem Reactor = __instance.Systems[SystemType.Reactor].Cast <ReactorSystem>();
                    if (Reactor.LEJABJDEHPE & Reactor.GPBBPGOINOF <= 0)
                    {
                        return(true);
                    }
                }
            }
            if (__instance.Systems.ContainsKey(SystemType.LifeSupp))
            {
                OxygenSystem oxygen = __instance.Systems[SystemType.LifeSupp].Cast <OxygenSystem>();
                if (oxygen.LEJABJDEHPE & oxygen.GPBBPGOINOF <= 0)
                {
                    return(true);
                }
            }
            if (__instance.Systems.ContainsKey(SystemType.Laboratory))
            {
                ReactorSystem Reactor = __instance.Systems[SystemType.Laboratory].Cast <ReactorSystem>();
                if (Reactor.LEJABJDEHPE & Reactor.GPBBPGOINOF <= 0)
                {
                    return(true);
                }
            }

            EndReason reason = Love.CheckWin();

            if (reason == EndReason.IgnoreEndReason)
            {
                return(true);
            }
            if (reason == EndReason.NoWin)
            {
                return(false);
            }


            if (reason == EndReason.LoveWin)
            {
                MessageWriter writer = AmongUsClient.Instance.StartRpc(InnerPlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoveWin, Hazel.SendOption.Reliable);
                writer.Write((byte)reason);
                writer.EndMessage();

                PlayerControlPatch.LoveCoupleWins();
                ShipStatus.EABBNOODFGL(AMGMAKBHCMN.ImpostorByVote, true);
                return(false);
            }
            return(true);
        }