Exemplo n.º 1
0
 public static void clearAndReloadRoles()
 {
     Jester.clearAndReload();
     Mayor.clearAndReload();
     Engineer.clearAndReload();
     Sheriff.clearAndReload();
     Lighter.clearAndReload();
     Godfather.clearAndReload();
     Mafioso.clearAndReload();
     Janitor.clearAndReload();
     Detective.clearAndReload();
     TimeMaster.clearAndReload();
     Medic.clearAndReload();
     Shifter.clearAndReload();
     Swapper.clearAndReload();
     Lovers.clearAndReload();
     Seer.clearAndReload();
     Morphling.clearAndReload();
     Camouflager.clearAndReload();
     Hacker.clearAndReload();
     Child.clearAndReload();
     Tracker.clearAndReload();
     Vampire.clearAndReload();
     Snitch.clearAndReload();
     Jackal.clearAndReload();
     Sidekick.clearAndReload();
     Eraser.clearAndReload();
     Spy.clearAndReload();
     Trickster.clearAndReload();
 }
Exemplo n.º 2
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;
        }
Exemplo 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();
            return;
        }
Exemplo n.º 4
0
        public static void erasePlayerRole(byte playerId)
        {
            PlayerControl player = Helpers.playerById(playerId);

            if (player == null)
            {
                return;
            }

            // Crewmate roles
            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 == Hacker.hacker)
            {
                Hacker.clearAndReload();
            }
            if (player == Child.child)
            {
                Child.clearAndReload();
            }
            if (player == Tracker.tracker)
            {
                Tracker.clearAndReload();
            }
            if (player == Snitch.snitch)
            {
                Snitch.clearAndReload();
            }
            if (player == Swapper.swapper)
            {
                Swapper.clearAndReload();
            }
            if (player == Spy.spy)
            {
                Spy.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();
            }
            if (player == Eraser.eraser)
            {
                Eraser.clearAndReload();
            }
            if (player == Trickster.trickster)
            {
                Trickster.clearAndReload();
            }
            if (player == Cleaner.cleaner)
            {
                Cleaner.clearAndReload();
            }
            if (player == Warlock.warlock)
            {
                Warlock.clearAndReload();
            }

            // Other roles
            if (player == Jester.jester)
            {
                Jester.clearAndReload();
            }
            if (player == Lovers.lover1 || player == Lovers.lover2)   // The whole Lover couple is being erased
            {
                Lovers.clearAndReload();
            }
            if (player == Jackal.jackal)   // Promote Sidekick and hence override the the Jackal or erase Jackal
            {
                if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead)
                {
                    RPCProcedure.sidekickPromotes();
                }
                else
                {
                    Jackal.clearAndReload();
                }
            }
            if (player == Sidekick.sidekick)
            {
                Sidekick.clearAndReload();
            }
        }
Exemplo n.º 5
0
        public static void eraseAllRoles(this PlayerControl player)
        {
            foreach (var t in RoleData.allRoleTypes)
            {
                t.Value.GetMethod("eraseRole", BindingFlags.Public | BindingFlags.Static)?.Invoke(null, new object[] { player });
            }

            // Crewmate roles
            if (player.isRole(RoleType.Mayor))
            {
                Mayor.clearAndReload();
            }
            if (player.isRole(RoleType.Engineer))
            {
                Engineer.clearAndReload();
            }
            if (player.isRole(RoleType.Detective))
            {
                Detective.clearAndReload();
            }
            if (player.isRole(RoleType.TimeMaster))
            {
                TimeMaster.clearAndReload();
            }
            if (player.isRole(RoleType.Medic))
            {
                Medic.clearAndReload();
            }
            if (player.isRole(RoleType.Shifter))
            {
                Shifter.clearAndReload();
            }
            if (player.isRole(RoleType.Seer))
            {
                Seer.clearAndReload();
            }
            if (player.isRole(RoleType.Hacker))
            {
                Hacker.clearAndReload();
            }
            if (player.isRole(RoleType.Tracker))
            {
                Tracker.clearAndReload();
            }
            if (player.isRole(RoleType.Snitch))
            {
                Snitch.clearAndReload();
            }
            if (player.isRole(RoleType.Swapper))
            {
                Swapper.clearAndReload();
            }
            if (player.isRole(RoleType.Spy))
            {
                Spy.clearAndReload();
            }
            if (player.isRole(RoleType.SecurityGuard))
            {
                SecurityGuard.clearAndReload();
            }
            if (player.isRole(RoleType.Bait))
            {
                Bait.clearAndReload();
            }
            if (player.isRole(RoleType.Medium))
            {
                Medium.clearAndReload();
            }

            // Impostor roles
            if (player.isRole(RoleType.Morphling))
            {
                Morphling.clearAndReload();
            }
            if (player.isRole(RoleType.Camouflager))
            {
                Camouflager.clearAndReload();
            }
            if (player.isRole(RoleType.Godfather))
            {
                Godfather.clearAndReload();
            }
            if (player.isRole(RoleType.Mafioso))
            {
                Mafioso.clearAndReload();
            }
            if (player.isRole(RoleType.Janitor))
            {
                Janitor.clearAndReload();
            }
            if (player.isRole(RoleType.Vampire))
            {
                Vampire.clearAndReload();
            }
            if (player.isRole(RoleType.Eraser))
            {
                Eraser.clearAndReload();
            }
            if (player.isRole(RoleType.Trickster))
            {
                Trickster.clearAndReload();
            }
            if (player.isRole(RoleType.Cleaner))
            {
                Cleaner.clearAndReload();
            }
            if (player.isRole(RoleType.Warlock))
            {
                Warlock.clearAndReload();
            }
            if (player.isRole(RoleType.Witch))
            {
                Witch.clearAndReload();
            }
            if (player.isRole(RoleType.Assassin))
            {
                Assassin.clearAndReload();
            }
            if (player.isRole(RoleType.EvilHacker))
            {
                EvilHacker.clearAndReload();
            }

            // Other roles
            if (player.isRole(RoleType.Jester))
            {
                Jester.clearAndReload();
            }
            if (player.isRole(RoleType.Arsonist))
            {
                Arsonist.clearAndReload();
            }
            if (player.isRole(RoleType.Sidekick))
            {
                Sidekick.clearAndReload();
            }
            if (player.isRole(RoleType.BountyHunter))
            {
                BountyHunter.clearAndReload();
            }
            if (player.isRole(RoleType.Vulture))
            {
                Vulture.clearAndReload();
            }
            if (player.isRole(RoleType.Lawyer))
            {
                Lawyer.clearAndReload();
            }
            if (player.isRole(RoleType.Pursuer))
            {
                Pursuer.clearAndReload();
            }
            if (Guesser.isGuesser(player.PlayerId))
            {
                Guesser.clear(player.PlayerId);
            }


            if (player.isRole(RoleType.Jackal))
            { // Promote Sidekick and hence override the the Jackal or erase Jackal
                if (Sidekick.promotesToJackal && Sidekick.sidekick != null && Sidekick.sidekick.isAlive())
                {
                    RPCProcedure.sidekickPromotes();
                }
                else
                {
                    Jackal.clearAndReload();
                }
            }
        }