Esempio 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();
 }
Esempio n. 2
0
        public static void clearAndReloadRoles()
        {
            Morphling.clearAndReload();
            Camouflager.clearAndReload();
            Shifter.clearAndReload();
            Swapper.clearAndReload();
            GM.clearAndReload();

            Lovers.Clear();
            Opportunist.Clear();
            Ninja.Clear();
            Madmate.Clear();
            CreatedMadmate.Clear();
            PlagueDoctor.Clear();
            Lighter.Clear();
            SerialKiller.Clear();
            Fox.Clear();
            Immoralist.Clear();
            FortuneTeller.Clear();
            LastImpostor.Clear();
            SoulPlayer.Clear();
            Munou.Clear();
            SchrodingersCat.Clear();
            Trapper.Clear();
            BomberA.Clear();
            BomberB.Clear();
            EvilTracker.Clear();
            Puppeteer.Clear();
            MimicK.Clear();
            MimicA.Clear();
            Mini.Clear();
            AntiTeleport.Clear();
            Role.ClearAll();
        }
Esempio n. 3
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();
            }
        }
Esempio n. 4
0
        public static void shifterShift(byte targetId)
        {
            PlayerControl oldShifter = Shifter.shifter;
            PlayerControl player     = Helpers.playerById(targetId);

            if (player == null || oldShifter == null)
            {
                return;
            }

            Shifter.futureShift = null;
            Shifter.clearAndReload();

            // Suicide (exile) when impostor or impostor variants
            if (player.Data.IsImpostor || player == Jackal.jackal || player == Sidekick.sidekick)
            {
                oldShifter.Exiled();
                return;
            }

            // Switch shield
            if (Medic.shielded != null && Medic.shielded == player)
            {
                Medic.shielded = oldShifter;
            }
            else if (Medic.shielded != null && Medic.shielded == oldShifter)
            {
                Medic.shielded = player;
            }

            // Shift role
            if (Jester.jester != null && Jester.jester == player)
            {
                Jester.jester = oldShifter;
            }
            else if (Mayor.mayor != null && Mayor.mayor == player)
            {
                Mayor.mayor = oldShifter;
            }
            else if (Engineer.engineer != null && Engineer.engineer == player)
            {
                Engineer.engineer = oldShifter;
            }
            else if (Sheriff.sheriff != null && Sheriff.sheriff == player)
            {
                Sheriff.sheriff = oldShifter;
            }
            else if (Lighter.lighter != null && Lighter.lighter == player)
            {
                Lighter.lighter = oldShifter;
            }
            else if (Detective.detective != null && Detective.detective == player)
            {
                Detective.detective = oldShifter;
            }
            else if (TimeMaster.timeMaster != null && TimeMaster.timeMaster == player)
            {
                TimeMaster.timeMaster = oldShifter;
            }
            else if (Medic.medic != null && Medic.medic == player)
            {
                Medic.medic = oldShifter;
            }
            else if (Swapper.swapper != null && Swapper.swapper == player)
            {
                Swapper.swapper = oldShifter;
            }
            else if (Lovers.lover1 != null && Lovers.lover1 == player)
            {
                Lovers.lover1 = oldShifter;
            }
            else if (Lovers.lover2 != null && Lovers.lover2 == player)
            {
                Lovers.lover2 = oldShifter;
            }
            else if (Seer.seer != null && Seer.seer == player)
            {
                Seer.seer = oldShifter;
            }
            else if (Hacker.hacker != null && Hacker.hacker == player)
            {
                Hacker.hacker = oldShifter;
            }
            else if (Child.child != null && Child.child == player)
            {
                Child.child = oldShifter;
            }
            else if (Tracker.tracker != null && Tracker.tracker == player)
            {
                Tracker.tracker = oldShifter;
            }
            else if (Snitch.snitch != null && Snitch.snitch == player)
            {
                Snitch.snitch = oldShifter;
            }
            else if (Spy.spy != null && Spy.spy == player)
            {
                Spy.spy = oldShifter;
            }
            else     // Crewmate
            {
            }

            // Set cooldowns to max for both players
            if (PlayerControl.LocalPlayer == oldShifter || PlayerControl.LocalPlayer == player)
            {
                CustomButton.ResetAllCooldowns();
            }
        }
Esempio 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;
                }
            }
        }
Esempio n. 6
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();
                }
            }
        }