Ejemplo n.º 1
0
        private static IEnumerator <float> _Coroutine(InfectedPlayer player)
        {
            for (; ;)
            {
                yield return(Timing.WaitForSeconds(Time));

                if (player.IsInfected)
                {
                    if (!player.IsAnySCP && player.IsAlive && player.Role != RoleType.Tutorial)
                    {
                        if (player.Health <= Damage)
                        {
                            if (Change)
                            {
                                player.Hub.characterClassManager.SetPlayersClass(RoleType.Scp0492, player.GameObject, true, false);
                            }
                            else
                            {
                                player.Kill();
                            }
                        }
                        else
                        {
                            player.Health -= Damage;
                        }
                    }
                }
                else
                {
                    yield break;
                }
            }
        }
Ejemplo n.º 2
0
 public static void OnStart(InfectedPlayer player)
 {
     if (Time > 0 && Damage > 0 && Enabled)
     {
         player.IsInfected = true;
         _coroutines.Add(Timing.RunCoroutine(_Coroutine(player)));
     }
 }
Ejemplo n.º 3
0
 public static void OnPlayerHurt(Player target, Player attacker)
 {
     if (attacker.Role == RoleType.Scp0492)
     {
         InfectedPlayer player = null;
         if (!InfectedPlayer.Players.TryGetValue(target, out player))
         {
             player = new InfectedPlayer(target);
             player.Infect();
         }
     }
 }
Ejemplo n.º 4
0
        public static void OnPlayerDie(Player ply)
        {
            InfectedPlayer player = null;

            if (!InfectedPlayer.Players.TryGetValue(ply, out player))
            {
                player = new InfectedPlayer(ply);
                if (player.IsInfected)
                {
                    if (Change)
                    {
                        player.Cure();
                        player.Hub.characterClassManager.SetPlayersClass(RoleType.Scp0492, player.GameObject, true, false);
                    }
                    else
                    {
                        player.Cure();
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public static void OnStop(InfectedPlayer player)
 {
     player.IsInfected = false;
 }
Ejemplo n.º 6
0
 public static void OnDestroy()
 {
     InfectedPlayer.OnRoundEnd();
     Timing.KillCoroutines(_coroutines);
     _coroutines.Clear();
 }