コード例 #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_();
        }
    }
コード例 #2
0
 /// <summary>
 /// Sets the values to display
 /// </summary>
 /// <param name="pl">The player info to display</param>
 internal void Initialise(FollowBackInputHandler pl)
 {
     TxtNumFollowers.text     = pl.GetFollowerCount().ToString();
     TxtPlayerName.text       = "@" + pl.GetPlayerName();
     PlayerSprite.sprite      = FollowBackController.Instance.CharacterSprites[pl.GetCharacterIndex()];
     PlayerSpriteBg.color     = ColourFetcher.GetColour(pl.GetPlayerIndex());
     PlayerSpriteBgRing.color = ColourFetcher.GetColour(pl.GetPlayerIndex());
 }
コード例 #3
0
 /// <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));
     }
 }
コード例 #4
0
 /// <summary>
 /// Updates the UI display of the player
 /// </summary>
 /// <param name="player">The player to update</param>
 public void UpdatePlayerUIs(FollowBackInputHandler player)
 {
     // update UIs
     PlayerUiDisplays[player.GetPlayerIndex()].SetFollowerCount(player.GetFollowerCount());
 }