Exemplo n.º 1
0
        public async Task CheckRole(IUser user = null)
        {
            if (_game.IsCommandValid("signs", Context.Channel.Id))
            {
                if (user == null || _game.IsUserPlaying(user.Id))
                {
                    await _game.ResolveVisionPhase(user);

                    await _game.StartDayPhase();

                    await _game.StartPhaseCounter(PhaseType.Day);
                }
                else
                {
                    await ReplyAsync(ErrorView.PlayerNotPlaying(user.Username));
                }
            }
        }
Exemplo n.º 2
0
 public async Task VoteToExcommunicate(IUser user)
 {
     if (user != null && _game.IsCommandValid("excommunicate", Context.Channel.Id))
     {
         if (!_game.IsUserPlaying(user.Id))
         {
             await ReplyAsync(ErrorView.PlayerNotPlaying(user.Username));
         }
         else if (!_game.IsUserAlive(user.Id))
         {
             await ReplyAsync(ErrorView.PlayerAlreadyInactive(user.Username));
         }
         else
         {
             await _game.StartExcommunicatePoll(target : user, author : Context.User);
         }
     }
 }
Exemplo n.º 3
0
 public async Task VoteToSacrifice(IUser user)
 {
     if (user != null && _game.IsCommandValid("sacrifice", Context.Channel.Id))
     {
         if (!_game.IsUserPlaying(user.Id))
         {
             await ReplyAsync(ErrorView.PlayerNotPlaying(user.Username));
         }
         else if (!_game.IsUserInTeam(user.Id, GroupType.Uninformed))
         {
             await ReplyAsync(ErrorView.InvalidSacrificeTarget(user.Username));
         }
         else if (!_game.IsUserAlive(user.Id))
         {
             await ReplyAsync(ErrorView.RepeatedSacrifice(user.Username));
         }
         else
         {
             await _game.StartSacrificePoll(target : user, author : Context.User);
         }
     }
 }