예제 #1
0
        public static void seerReveal(byte targetId, byte targetOrMistakeId)
        {
            if (Seer.seer == null)
            {
                return;
            }

            PlayerControl target          = Helpers.playerById(targetId);
            PlayerControl targetOrMistake = Helpers.playerById(targetOrMistakeId);

            if (target != null && targetOrMistake != null && !Seer.revealedPlayers.Keys.Any(p => p.Data.PlayerId == targetId))
            {
                Seer.revealedPlayers.Add(target, targetOrMistake);

                if (PlayerControl.LocalPlayer == target && HudManager.Instance?.FullScreen != null)
                {
                    SeerInfo si = SeerInfo.getSeerInfoForPlayer(target); // Use SeerInfo for target here, because we need the isGood of the targets role
                    bool     showNotification = false;
                    if (Seer.playersWithNotification == 0)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 1 && si.isGood)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 2 && !si.isGood)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 3)
                    {
                        showNotification = false;
                    }

                    if (showNotification)
                    {
                        HudManager.Instance.FullScreen.enabled = true;
                        Reactor.Coroutines.Start(Helpers.CoFlashAndDisable(
                                                     HudManager.Instance.FullScreen,
                                                     0.5f,
                                                     new Color(42f / 255f, 187f / 255f, 245f / 255f, 0f),
                                                     new Color(42f / 255f, 187f / 255f, 245f / 255f, 0.75f)
                                                     ));
                    }
                }
            }
        }
예제 #2
0
        public static void seerReveal(byte playerId)
        {
            if (Seer.seer == null)
            {
                return;
            }

            PlayerControl player = Helpers.playerById(playerId);

            if (player != null && !Seer.revealedPlayers.Any(p => p.Data.PlayerId == playerId))
            {
                Seer.revealedPlayers.Add(player);

                if (PlayerControl.LocalPlayer == player && HudManager.Instance?.FullScreen != null)
                {
                    SeerInfo si = SeerInfo.getSeerInfoForPlayer(player);
                    bool     showNotification = false;
                    if (Seer.playersWithNotification == 0)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 1 && si.isGood)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 2 && !si.isGood)
                    {
                        showNotification = true;
                    }
                    else if (Seer.playersWithNotification == 3)
                    {
                        showNotification = false;
                    }

                    if (showNotification)
                    {
                        HudManager.Instance.FullScreen.enabled = true;
                        Reactor.Coroutines.Start(Helpers.CoFlashAndDisable(
                                                     HudManager.Instance.FullScreen,
                                                     0.5f,
                                                     new Color(42f / 255f, 187f / 255f, 245f / 255f, 0f),
                                                     new Color(42f / 255f, 187f / 255f, 245f / 255f, 0.75f)
                                                     ));
                    }
                }
            }
        }
예제 #3
0
        static void seerUpdate()
        {
            if (Seer.seer == null || Seer.seer != PlayerControl.LocalPlayer)
            {
                return;
            }

            // Update revealed players
            foreach (KeyValuePair <PlayerControl, PlayerControl> entry in Seer.revealedPlayers)
            {
                PlayerControl target          = entry.Key;
                PlayerControl targetOrMistake = entry.Value;

                if (target == null || targetOrMistake == null)
                {
                    continue;
                }

                // Update color and name regarding settings and given info
                string   result = target.Data.PlayerName;
                SeerInfo si     = SeerInfo.getSeerInfoForPlayer(targetOrMistake);
                if (Seer.kindOfInfo == 0)
                {
                    result = target.Data.PlayerName + " (" + si.roleName + ")";
                }
                else if (Seer.kindOfInfo == 1)
                {
                    si.color = si.isGood ? new Color(250f / 255f, 217f / 255f, 52f / 255f, 1) : new Color(51f / 255f, 61f / 255f, 54f / 255f, 1);
                }

                // Set color and name
                target.nameText.Color = si.color;
                target.nameText.Text  = result;
                if (MeetingHud.Instance != null)
                {
                    foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
                    {
                        if (target.PlayerId == player.TargetPlayerId)
                        {
                            player.NameText.Text  = result;
                            player.NameText.Color = si.color;
                            break;
                        }
                    }
                }
            }
        }
예제 #4
0
        static void seerUpdate()
        {
            if (Seer.seer == null || Seer.seer != PlayerControl.LocalPlayer)
            {
                return;
            }

            // Update revealed players
            foreach (PlayerControl p in Seer.revealedPlayers)
            {
                // Update color and name regarding settings and given info
                string   result = p.Data.PlayerName;
                SeerInfo si     = SeerInfo.getSeerInfoForPlayer(p);
                if (Seer.kindOfInfo == 0)
                {
                    result = p.Data.PlayerName + " (" + si.roleName + ")";
                }
                else if (Seer.kindOfInfo == 1)
                {
                    si.color = si.isGood ? new Color(250f / 255f, 217f / 255f, 52f / 255f, 1) : new Color(51f / 255f, 61f / 255f, 54f / 255f, 1);
                }

                // Set color and name
                p.nameText.Color = si.color;
                p.nameText.Text  = result;
                if (MeetingHud.Instance != null)
                {
                    foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
                    {
                        if (p.PlayerId == player.TargetPlayerId)
                        {
                            player.NameText.Text  = result;
                            player.NameText.Color = si.color;
                            break;
                        }
                    }
                }
            }
        }
예제 #5
0
        public static SeerInfo getSeerInfoForPlayer(PlayerControl p)
        {
            string r = "";
            bool   g = true;
            Color  c = Color.white;

            if (Jester.jester != null && p == Jester.jester)
            {
                r = "Jester";
                c = Jester.color;
                g = false;
            }
            else if (Mayor.mayor != null && p == Mayor.mayor)
            {
                r = "Mayor";
                c = Mayor.color;
            }
            else if (Engineer.engineer != null && p == Engineer.engineer)
            {
                r = "Engineer";
                c = Engineer.color;
            }
            else if (Sheriff.sheriff != null && p == Sheriff.sheriff)
            {
                r = "Sheriff";
                c = Sheriff.color;
            }
            else if (Lighter.lighter != null && p == Lighter.lighter)
            {
                r = "Lighter";
                c = Lighter.color;
            }
            else if (Godfather.godfather != null && p == Godfather.godfather)
            {
                r = "Godfather";
                c = Godfather.color;
                g = false;
            }
            else if (Mafioso.mafioso != null && p == Mafioso.mafioso)
            {
                r = "Mafioso";
                c = Mafioso.color;
                g = false;
            }
            else if (Janitor.janitor != null && p == Janitor.janitor)
            {
                r = "Janitor";
                c = Janitor.color;
                g = false;
            }
            else if (Morphling.morphling != null && p == Morphling.morphling)
            {
                r = "Morphling";
                c = Morphling.color;
                g = false;
            }
            else if (Camouflager.camouflager != null && p == Camouflager.camouflager)
            {
                r = "Camouflager";
                c = Camouflager.color;
                g = false;
            }
            else if (Detective.detective != null && p == Detective.detective)
            {
                r = "Detective";
                c = Detective.color;
            }
            else if (TimeMaster.timeMaster != null && p == TimeMaster.timeMaster)
            {
                r = "Time Master";
                c = TimeMaster.color;
            }
            else if (Medic.medic != null && p == Medic.medic)
            {
                r = "Medic";
                c = Medic.color;
            }
            else if (Shifter.shifter != null && p == Shifter.shifter)
            {
                r = "Shifter";
                c = Shifter.color;
                g = false;
            }
            else if (Swapper.swapper != null && p == Swapper.swapper)
            {
                r = "Swapper";
                c = Swapper.color;
            }
            else if (Lovers.lover1 != null && p == Lovers.lover1)
            {
                r = Lovers.lover1.Data.IsImpostor ? "ImpLover" : "Lover";
                c = Lovers.lover1.Data.IsImpostor ? Palette.ImpostorRed : Lovers.color;
                g = !Lovers.lover1.Data.IsImpostor;
            }
            else if (Lovers.lover2 != null && p == Lovers.lover2)
            {
                r = Lovers.lover2.Data.IsImpostor ? "ImpLover" : "Lover";
                c = Lovers.lover2.Data.IsImpostor ? Palette.ImpostorRed : Lovers.color;
                g = !Lovers.lover2.Data.IsImpostor;
            }
            else if (Seer.seer != null && p == Seer.seer)
            {
                r = "Seer";
                c = Seer.color;
            }
            else if (Spy.spy != null && p == Spy.spy)
            {
                r = "Spy";
                c = Spy.color;
            }
            else if (Child.child != null && p == Child.child)
            {
                r = "Child";
                c = Child.color;
            }
            else if (p.Data.IsImpostor)   // Just Impostor
            {
                r = "Impostor";
                c = Palette.ImpostorRed;
                g = false;
            }
            else if (!p.Data.IsImpostor)   // Just Crewmate
            {
                r = "Crewmate";
                c = Color.white;
            }

            SeerInfo result = new SeerInfo();

            result.roleName = r;
            result.color    = c;
            result.isGood   = g;

            return(result);
        }