Exemple #1
0
 public string CheckEnd()
 {
     if (resistanceWin == 3)
     {
         Spies = Spies.Remove(Spies.Length - 2, 2);
         return("R");
     }
     else if (spyWin == 3)
     {
         Spies = Spies.Remove(Spies.Length - 2, 2);
         return("S");
     }
     else
     {
         string playersname = "";
         foreach (int i in SelectedPlayers)
         {
             playersname += playerlist[i].name + " ";
         }
         GameResultName[CurrentRound - 1] = playersname;
         GameResultFail[CurrentRound - 1] = FailCount;
         LeaderPos++;
         ResetSuccessFail();
         CurrentRound++;
         return("N");
     }
 }
Exemple #2
0
 public int StageTwo(Callback StatusUpdate, Callback StatusUpdate_phone, int VoteNoCount)
 {
     if (VoteNoCount >= (int)Math.Ceiling((double)No_of_players / 2))
     {
         CountFailMission++;
         if (CountFailMission == 5)
         {
             StatusUpdate("Mission failed consecutively for 5 times. Spy wins!");//SPY WIN
             StatusUpdate_phone("Mission failed consecutively for 5 times. Spy wins!");
             Spies = Spies.Remove(Spies.Length - 2, 2);
             return(-1);
         }
         LeaderPos++;
         SetMissionLeader();
         return(0);
     }
     else
     {
         StatusUpdate("---Turn in Success of Fail---");
         StatusUpdate_phone("---Turn in Success of Fail---");
         return(3);
     }
 }