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) )); } } } }
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) )); } } } }
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; } } } } }
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; } } } } }