Exemplo n.º 1
0
        private static void Postfix(Scp173 __instance, int __state)
        {
            var peanut = __instance.GetPlayer();

            foreach (var ply in __instance._observingPlayers)
            {
                var player = ply.GetPlayer();
                var flag   = false;

                if (player.Invisible || (player.RealTeam == Team.SCP && !Server.Get.Configs.synapseConfiguration.ScpTrigger173) || Server.Get.Configs.synapseConfiguration.CantLookAt173.Contains(player.RoleID))
                {
                    flag = true;
                }

                if (peanut.Scp173Controller.IgnoredPlayers.Contains(player) || player.Scp173Controller.TurnedPlayers.Contains(player))
                {
                    flag = true;
                }

                if (flag)
                {
                    __instance._observingPlayers.Remove(player.Hub);
                    __instance._isObserved = __instance._observingPlayers.Count > 0;
                    if (__state != __instance._observingPlayers.Count && __instance._blinkCooldownRemaining > 0f)
                    {
                        __instance._blinkCooldownRemaining = Mathf.Max(0f, __instance._blinkCooldownRemaining + (__instance._observingPlayers.Count - __state));
                        if (__instance._blinkCooldownRemaining <= 0f)
                        {
                            __instance.BlinkReady = true;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 private static void Prefix(Scp173 __instance, out int __state) => __state = __instance._observingPlayers.Count;