Ejemplo n.º 1
0
    public void RemoveBot(PlType type, Team team)
    {
        var bot = PlayerViews.FirstOrDefault(a => a.team == team && a.plType == type);

        shareds[bot.id].CallRPC(shareds[bot.id].Die, PhotonTargets.All);
        RemovePlayerView(bot.id);
    }
Ejemplo n.º 2
0
    private void DrawScoreBoard()
    {
        var sb = new StringBuilder();

        sb.AppendLine("Counter Strike 1.6                               " + (GameStarted ? "Game Started" : ""));
        sb.AppendLine();
        const string tabl  = "                         x       Score          Deaths         Ping     FPS  ";
        var          templ = CreateTable(tabl);

        sb.AppendLine(tabl);
        sb.AppendLine();
        sb.AppendLine();
        sb.AppendLine("Terrorists  " + TScore);
        sb.AppendLine("_______________________________________________________________________________");
        PrintPls(sb, templ, PlayerViews.Where(a => a.team == Team.Terrorists));
        sb.AppendLine();
        sb.AppendLine();
        sb.AppendLine("Counter - Terrorists  " + CTScore);
        sb.AppendLine("_______________________________________________________________________________");
        PrintPls(sb, templ, PlayerViews.Where(a => a.team == Team.CounterTerrorists));
        sb.AppendLine();
        sb.AppendLine("Spectators");
        foreach (var p in PlayerViews.Where(a => a.team == Team.Spectators))
        {
            sb.AppendLine(p.PlayerName);
        }
        _Hud.ScoreBoard.text = sb.ToString();
    }
Ejemplo n.º 3
0
        public bool CheckGuess()
        {
            PlayerView bestPlayer = PlayerViews.OrderByDescending(x => x.CurrentPlayer.fppg).FirstOrDefault();

            if (bestPlayer.CurrentPlayer.id == SelectedPlayer.id)
            {
                // Winner
                Score += 1;
                return(true);
            }
            else
            {
                // Loser
                return(false);
            }
        }
Ejemplo n.º 4
0
 private void CheckForWins()
 {
     if (!GameStarted)
     {
         if (PlayerViews.Any(a => a.team == Team.Terrorists) &&
             PlayerViews.Any(a => a.team == Team.CounterTerrorists) && ResetGameTime == float.MaxValue)
         {
             CallRPC(RPCPrint, PhotonTargets.All, "Game Started");
             ResetGameTime = Time.time;
         }
         if (Time.time - ResetGameTime > 3)
         {
             CallRPC(StartGame, PhotonTargets.All);
         }
     }
     else if (GameStarted)
     {
         if (!PlayerViews.Any(a => a.team == Team.Terrorists) || !PlayerViews.Any(a => a.team == Team.CounterTerrorists))
         {
             CallRPC(SetGameStarted, PhotonTargets.All, false);
         }
         else
         {
             if (ResetGameTime == float.MaxValue)
             {
                 if (!Shareds.Any(a => a.pv.team == Team.CounterTerrorists) || (_Bomb != null && _Bomb.bombTime < 0))
                 {
                     CallRPC(SetTScore, PhotonTargets.All, TScore + 1);
                     CallRPC(TerWin, PhotonTargets.All);
                     ResetGameTime = Time.time;
                 }
                 if (!Shareds.Any(a => a.pv.team == Team.Terrorists) || (_Bomb != null && _Bomb.difused))
                 {
                     CallRPC(SetCTScore, PhotonTargets.All, CTScore + 1);
                     ResetGameTime = Time.time;
                     CallRPC(CTerWin, PhotonTargets.All);
                 }
             }
             if (Time.time - ResetGameTime > 3)
             {
                 CallRPC(StartGame, PhotonTargets.All);
             }
         }
     }
 }
Ejemplo n.º 5
0
        public List <PlayerView> GetOrderOfPlayers()
        {
            List <PlayerView> playersInOrder = PlayerViews.OrderByDescending(x => x.CurrentPlayer.fppg).ToList();

            return(playersInOrder);
        }