Exemplo n.º 1
0
    /// <summary>
    /// Attack the player
    /// <summary>
    IEnumerator Attack_()
    {
        while (_active && _victim.GetFollowerCount() > 0)
        {
            // remove a follower every so often
            _victim.LoseFollower(true, 1);
            FollowBackController.Instance.UpdatePlayerUIs(_victim);
            yield return(new WaitForSeconds(ATTACK_RATE));
        }

        // if the player ran out of followers, trolls just run off
        if (_victim.GetFollowerCount() <= 0)
        {
            PlayerReachedZero_();
        }
    }
 /// <summary>
 /// Checks which players are in the VIP zone, and assigns followers accordingly
 /// </summary>
 IEnumerator CheckZone_()
 {
     // stop when turn ends
     while (_turnRunning && _gameActive)
     {
         // loop through all players in the zone
         foreach (var player in _playersInZone)
         {
             // don't allow influencer to go to negative numbers
             if (_currentInfluencer.GetFollowerCount() > 0)
             {
                 // move a follower from the influencer to the player
                 if (!player.TrollsActive())
                 {
                     player.AddFollower(true);
                     _currentInfluencer.LoseFollower(true);
                     UpdatePlayerUIs(player);
                     UpdatePlayerUIs(_currentInfluencer);
                 }
             }
         }
         yield return(new WaitForSeconds(0.1f));
     }
 }