Esempio n. 1
0
        public static void Postfix(HudManager __instance)
        {
            HUD = __instance;



            CustomGameObjectManager.Update();
            PlayerController.Update();
            var localplayer = PlayerController.getLocalPlayer();

            if (localplayer != null)
            {
                if (localplayer.hasComponent("Love"))
                {
                    if (!HUD.Chat.isActiveAndEnabled)
                    {
                        HUD.Chat.SetVisible(true);
                    }

                    Love love = (Love)localplayer.GetComponentByName("Love");
                    if (love.lover.isAlive())
                    {
                        HUD.TaskText.text = "<color=#FF80D5FF>Primary objective:</color>\n"
                                            + "<color=#FFFFFFFF>Stay alive with your love </color><color=#FF80D5FF>" + love.lover.playerdata.name + "\n</color>and win together"
                                            + "\n\nSecondary objective: \n" + HUD.FGIFCILIPEH.ToString();
                    }
                }
            }
        }
Esempio n. 2
0
        public static void Postfix(PlayerControl __instance, PlayerControl DGDGDKCCKHJ)
        {
            Player player = PlayerController.getPlayerById(__instance.PlayerId);
            Love   love   = (Love)player.GetComponentByName("Love");

            if (love != null)
            {
                if (love.spawnedAsImpostor == false)
                {
                    player.setImpostor(false);
                }
            }
        }
Esempio n. 3
0
        public static void LoveCoupleWins()
        {
            Player[] lovers = Love.getLovers();
            foreach (Player player in PlayerController.getImpostors())
            {
                player.setImpostor(false);
            }
            foreach (Player player in lovers)
            {
                player.setImpostor(true);
            }

            EndGameManagerPatch.LoveCoupleWins = true;
        }
Esempio n. 4
0
        public static void Postfix1(MeetingHud __instance)
        {
            if (PlayerController.getLocalPlayer().hasComponent("Love"))
            {
                Love love = (Love)PlayerController.getLocalPlayer().GetComponentByName("Love");

                foreach (VoteArea votearea in __instance.GBKFCOAKLAH)
                {
                    if (votearea.NameText.text == love.parent.playerdata.name |
                        votearea.NameText.text == love.lover.playerdata.name)
                    {
                        SpriteRenderer rend = votearea.gameObject.AddComponent <SpriteRenderer>();

                        rend.sprite = Heart.heartsmall;
                    }
                }
            }
            MeetingHUDopen = true;
        }
Esempio n. 5
0
        public static bool Prefix(InnerPlayerControl __instance, EGHDCAKGMKI AMGCOJNIHLM)
        {
            if (AmongUsClient.Instance.ClientId == AmongUsClient.Instance.HostId)
            {
                __instance.FIMGDJOCIGD.IAGJEKLJCCI = true;

                Player player = PlayerController.getPlayerById(__instance.PlayerId);

                if (player.hasComponent("Love") && CustomGameOptions.BothLoversDie)
                {
                    Love          love   = (Love)player.GetComponentByName("Love");
                    MessageWriter writer = AmongUsClient.Instance.StartRpc(InnerPlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoveSuicide, Hazel.SendOption.Reliable);
                    writer.Write((byte)love.lover.playerdata.PlayerId);
                    writer.EndMessage();
                    love.lover.playerdata.MurderPlayer(love.lover.playerdata);
                }
            }


            return(true);
        }
Esempio n. 6
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);
                    }
                }
            }
        }
Esempio n. 7
0
        public static void Postfix(IntroCutscene.EMGDLDOHGCK __instance)
        {
            var localplayer = PlayerController.LocalPlayer;

            if (localplayer == null)
            {
                return;
            }
            if (localplayer.hasComponent("Love"))
            {
                Love love = (Love)localplayer.GetComponentByName("Love");
                __instance.__4__this.Title.text = "Lover";
                if (PlayerController.getLocalPlayer().isImpostor())
                {
                    __instance.__4__this.Title.text = "Loving Impostor";
                    __instance.__4__this.Title.gameObject.transform.localScale = new Vector3(0.5f, 0.5f, 1);
                }
                __instance.__4__this.Title.color = Love.color;
                __instance.__4__this.ImpostorText.gameObject.SetActive(true);
                __instance.__4__this.ImpostorText.color           = new Color(1, 1, 1, 1);
                __instance.__4__this.ImpostorText.text            = "You are in <color=#FF66CCFF>Love</color> with <color=#FF66CCFF>" + love.lover.playerdata.name + "</color>";
                __instance.__4__this.BackgroundBar.material.color = Love.color;
            }
        }
        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);
        }