public static void EndBattleByDeath(Room room,SLOT killer,bool isBotMode,bool isSuicide)
 {
     if ((room.room_type == 1 || room.room_type == 8 || room.room_type == 13) && !isBotMode)
     {
         AllUtils.BattleEndKills(room,isBotMode);
     }
     else if (!killer.specGM && (room.room_type == 2 || room.room_type == 4)) //Destruição e Supressão
     {
         int redDeaths,blueDeaths,allRed,allBlue,winner = 0;
         room.getPlayingPlayers(true,out allRed,out allBlue,out redDeaths,out blueDeaths);
         if (redDeaths == allRed && killer._team == 0 && isSuicide && !room.C4_actived)
         {
             winner = 1;
             room.blue_rounds++;
             AllUtils.BattleEndRound(room,winner,true);
         }
         else if (blueDeaths == allBlue && killer._team == 1)
         {
             room.red_rounds++;
             AllUtils.BattleEndRound(room,winner,true);
         }
         else if (redDeaths == allRed && killer._team == 1)
         {
             if (!room.C4_actived)
             {
                 winner = 1;
                 room.blue_rounds++;
             }
             else if (isSuicide)
             {
                 room.red_rounds++;
             }
             AllUtils.BattleEndRound(room,winner,false);
         }
         else if (blueDeaths == allBlue && killer._team == 0)
         {
             if (!isSuicide || !room.C4_actived)
             {
                 room.red_rounds++;
             }
             else
             {
                 winner = 1;
                 room.blue_rounds++;
             }
             AllUtils.BattleEndRound(room,winner,true);
         }
     }
 }
Exemplo n.º 2
0
 public static void EndBattleByDeath(Room room,SLOT killer,bool isBotMode,bool isSuicide)
 {
     if ((room.room_type == (byte)1 || room.room_type == (byte)8 || room.room_type == (byte)13) && !isBotMode)
     {
         AllUtils.BattleEndKills(room,isBotMode);
     }
     else
     {
         if (killer.specGM || room.room_type != (byte)2 && room.room_type != (byte)4)
         {
             return;
         }
         int winner1 = 0;
         int RedPlayers;
         int BluePlayers;
         int RedDeaths;
         int BlueDeaths;
         room.getPlayingPlayers(true,out RedPlayers,out BluePlayers,out RedDeaths,out BlueDeaths);
         if (((RedDeaths != RedPlayers ? 0 : (killer._team == 0 ? 1 : 0)) & (isSuicide ? 1 : 0)) != 0 && !room.C4_actived)
         {
             int winner2 = 1;
             ++room.blue_rounds;
             AllUtils.BattleEndRound(room,winner2,true);
         }
         else if (BlueDeaths == BluePlayers && killer._team == 1)
         {
             ++room.red_rounds;
             AllUtils.BattleEndRound(room,winner1,true);
         }
         else if (RedDeaths == RedPlayers && killer._team == 1)
         {
             if (!room.C4_actived)
             {
                 winner1 = 1;
                 ++room.blue_rounds;
             }
             else if (isSuicide)
             {
                 ++room.red_rounds;
             }
             AllUtils.BattleEndRound(room,winner1,false);
         }
         else
         {
             if (BlueDeaths != BluePlayers || killer._team != 0)
             {
                 return;
             }
             if (!isSuicide || !room.C4_actived)
             {
                 ++room.red_rounds;
             }
             else
             {
                 winner1 = 1;
                 ++room.blue_rounds;
             }
             AllUtils.BattleEndRound(room,winner1,true);
         }
     }
 }