Ejemplo n.º 1
0
        static void Postfix(HudManager __instance)
        {
            if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.CJDCOJJNIGL.Started)
            {
                return;
            }

            CustomButton.HudUpdate();
            resetNameTagsAndColors();
            setNameColors();
            updateShielded();

            // Mafia
            setMafiaNameTags();
            // Jester
            Helpers.removeTasksFromPlayer(Jester.jester);
            // Mafioso
            mafiosoDeactivateKillButtonIfNecessary(__instance);
            // Janitor
            janitorDeactivateKillButton(__instance);
            // Timer updates
            timerUpdate();
            // Camouflager and Morphling
            camouflageAndMorphActions();
            // Child
            childUpdate();
            // Vampire
            vampireDeactivateKillButton(__instance);
            // Snitch
            snitchUpdate();
            // Jackal
            Helpers.removeTasksFromPlayer(Jackal.jackal);
            // Sidekick
            Helpers.removeTasksFromPlayer(Sidekick.sidekick);
        }
Ejemplo n.º 2
0
        static void Postfix(HudManager __instance)
        {
            if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GCDONLGCMIL.Started)
            {
                return;
            }

            CustomButton.HudUpdate();
            resetNameTagsAndColors();
            setNameColors();
            updateShielded();

            // Mafia
            setMafiaNameTags();
            // Jester
            Helpers.removeTasksFromPlayer(Jester.jester);
            // Impostors
            updateImpostorKillButton(__instance);
            // Timer updates
            timerUpdate();
            // Camouflager and Morphling
            camouflageAndMorphActions();
            // Child
            childUpdate();
            // Snitch
            snitchUpdate();
            // Jackal
            Helpers.removeTasksFromPlayer(Jackal.jackal);
            // Sidekick
            Helpers.removeTasksFromPlayer(Sidekick.sidekick);
        }
Ejemplo n.º 3
0
        public static void sidekickPromotes()
        {
            var player = Sidekick.sidekick;

            Jackal.removeCurrentJackal();
            Jackal.jackal = player;
            if (Jackal.jackalPromotedFromSidekickCanCreateSidekick == false)
            {
                Jackal.canCreateSidekick = false;
            }
            Sidekick.clearAndReload();
            if (PlayerControl.LocalPlayer == null)
            {
                return;
            }
            if (PlayerControl.LocalPlayer == player)
            {
                Helpers.removeTasksFromPlayer(player, true);
                var textTask = new GameObject("RoleTask").AddComponent <ImportantTextTask>();
                textTask.transform.SetParent(player.transform, false);
                var getSidekickText = Jackal.canCreateSidekick ? " and recruit a Sidekick" : "";
                textTask.Text = $"[00B4EBFF]Jackal: Kill everyone{getSidekickText}";
                player.myTasks.Insert(0, textTask);
            }
            return;
        }
Ejemplo n.º 4
0
        public static void jackalCreatesSidekick(byte targetId)
        {
            foreach (PlayerControl player in PlayerControl.AllPlayerControls)
            {
                if (player.PlayerId == targetId)
                {
                    if (!Jackal.canCreateSidekickFromImpostor && player.PPMOEEPBHJO.FDNMBJOAPFL)
                    {
                        Jackal.fakeSidekick = player;
                        return;
                    }
                    player.RemoveInfected();
                    if (player != Lovers.lover1 && player != Lovers.lover2)
                    {
                        erasePlayerRole(player.PlayerId);
                    }

                    Sidekick.sidekick = player;
                    Helpers.removeTasksFromPlayer(player);
                    return;
                }
            }
        }
Ejemplo n.º 5
0
        public static void jackalCreatesSidekick(byte targetId)
        {
            foreach (PlayerControl player in PlayerControl.AllPlayerControls)
            {
                if (player.PlayerId == targetId)
                {
                    if (!Jackal.canCreateSidekickFromImpostor && player.Data.IsImpostor)
                    {
                        Jackal.fakeSidekick = player;
                        return;
                    }
                    Sidekick.sidekick = player;
                    player.RemoveInfected();

                    // Crewmate roles
                    if (player == Jester.jester)
                    {
                        Jester.clearAndReload();
                    }
                    if (player == Mayor.mayor)
                    {
                        Mayor.clearAndReload();
                    }
                    if (player == Engineer.engineer)
                    {
                        Engineer.clearAndReload();
                    }
                    if (player == Sheriff.sheriff)
                    {
                        Sheriff.clearAndReload();
                    }
                    if (player == Lighter.lighter)
                    {
                        Lighter.clearAndReload();
                    }
                    if (player == Detective.detective)
                    {
                        Detective.clearAndReload();
                    }
                    if (player == TimeMaster.timeMaster)
                    {
                        TimeMaster.clearAndReload();
                    }
                    if (player == Medic.medic)
                    {
                        Medic.clearAndReload();
                    }
                    if (player == Shifter.shifter)
                    {
                        Shifter.clearAndReload();
                    }
                    if (player == Seer.seer)
                    {
                        Seer.clearAndReload();
                    }
                    if (player == Spy.spy)
                    {
                        Spy.clearAndReload();
                    }
                    if (player == Child.child)
                    {
                        Child.clearAndReload();
                    }
                    if (player == Tracker.tracker)
                    {
                        Tracker.clearAndReload();
                    }
                    if (player == BountyHunter.bountyHunter)
                    {
                        BountyHunter.clearAndReload();
                    }
                    if (player == Snitch.snitch)
                    {
                        Snitch.clearAndReload();
                    }
                    if (player == Swapper.swapper)
                    {
                        Swapper.clearAndReload();
                    }

                    // Impostor roles
                    if (player == Morphling.morphling)
                    {
                        Morphling.clearAndReload();
                    }
                    if (player == Camouflager.camouflager)
                    {
                        Camouflager.clearAndReload();
                    }
                    if (player == Godfather.godfather)
                    {
                        Godfather.clearAndReload();
                    }
                    if (player == Mafioso.mafioso)
                    {
                        Mafioso.clearAndReload();
                    }
                    if (player == Janitor.janitor)
                    {
                        Janitor.clearAndReload();
                    }
                    if (player == Vampire.vampire)
                    {
                        Vampire.clearAndReload();
                    }

                    // The Sidekick stays a part of the lover couple!

                    if (PlayerControl.LocalPlayer == null)
                    {
                        return;
                    }
                    if (PlayerControl.LocalPlayer == player)
                    {
                        //Only the Lover keeps his ImportantTextTask
                        Helpers.removeTasksFromPlayer(player, player != Lovers.lover1 && player != Lovers.lover2);

                        var task = new GameObject("RoleTask").AddComponent <ImportantTextTask>();
                        task.transform.SetParent(player.transform, false);
                        task.Text = "[00B4EBFF]Sidekick: Help your Jackal to kill everyone";
                        player.myTasks.Insert(0, task);
                    }

                    return;
                }
            }
        }