Esempio n. 1
0
 public static bool Prefix1(AmongUsClient __instance, AMGMAKBHCMN NEPMFBMGGLF, bool FBEKDLNKNLL)
 {
     if (FBEKDLNKNLL)
     {
         LoveCoupleMod.log.LogInfo("Love couple wins");
         PlayerControlPatch.LoveCoupleWins();
         FBEKDLNKNLL = false;
     }
     return(true);
 }
Esempio n. 2
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);
                    }
                }
            }
        }
        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);
        }