示例#1
0
 public void CreateGame(Client client)
 {
     GameLeader = client;
     GameState  = CTFGameState.WaitingForPlayers;
     AddToGame(client);
     Messenger.PlayerMsg(client, "You have created a new game of Capture The Flag! Say /ctfstart to start!", Text.Yellow);
     Messenger.MapMsg(MapManager.GenerateMapID(HUBMAP), client.Player.Name + " has created a new game of Capture The Flag!", Text.Yellow);
 }
示例#2
0
 public void StartGame()
 {
     if (RedTeamPlayers >= MINTEAMCOUNT && BlueTeamPlayers >= MINTEAMCOUNT)
     {
         for (int i = 0; i < MAXTEAMCOUNT; i++)
         {
             try {
                 if (BlueTeam[i] != null)
                 {
                     Messenger.PlayerMsg(BlueTeam[i], "You are on the Blue Team", Text.Yellow);
                     Messenger.PlayerWarp(BlueTeam[i], BLUEMAP, BLUEX, BLUEY);
                     BlueTeam[i].Player.Status = "Blue";
                     Messenger.SendPlayerData(BlueTeam[i]);
                 }
                 if (RedTeam[i] != null)
                 {
                     Messenger.PlayerMsg(RedTeam[i], "You are on the Red Team", Text.Yellow);
                     Messenger.PlayerWarp(RedTeam[i], REDMAP, REDX, REDY);
                     RedTeam[i].Player.Status = "Red";
                     Messenger.SendPlayerData(RedTeam[i]);
                 }
             } catch (Exception ex) {
             }
         }
         GameState = CTFGameState.Started;
     }
     else
     {
         int needed = (MINTEAMCOUNT * 2) - (RedTeamPlayers + BlueTeamPlayers);
         if (needed == 1)
         {
             Messenger.PlayerMsg(GameLeader, "There are not enough players on each team! 1 more player needs to join before the game can start!", Text.BrightRed);
         }
         else
         {
             Messenger.PlayerMsg(GameLeader, "There are not enough players on each team! " + needed.ToString() + " more players need to join before the game can start!", Text.BrightRed);
         }
     }
 }
示例#3
0
        public void Init(CTFGameState newGameState)
        {
            RedTeam  = new Client[MAXTEAMCOUNT];
            BlueTeam = new Client[MAXTEAMCOUNT];

            for (int i = 0; i < MAXTEAMCOUNT; i++)
            {
                RedTeam[i]  = null;
                BlueTeam[i] = null;
            }
            RedTeamPlayers  = 0;
            BlueTeamPlayers = 0;
            GameState       = newGameState;
            RedScore        = 0;
            BlueScore       = 0;
            RedFlags        = 5;
            BlueFlags       = 5;
            PlayerCount     = 0;
            GameLeader      = null;
            RedFlagHolder   = null;
            BlueFlagHolder  = null;
            LastAdded       = Teams.Red;
        }
示例#4
0
 public CTF(CTFGameState newGameState)
 {
     Init(newGameState);
 }
示例#5
0
文件: CTF.cs 项目: Festivo/Scripts
 public CTF(CTFGameState newGameState)
 {
     Init(newGameState);
 }
示例#6
0
文件: CTF.cs 项目: Festivo/Scripts
 public void StartGame()
 {
     if (RedTeamPlayers >= MINTEAMCOUNT && BlueTeamPlayers >= MINTEAMCOUNT) {
         for (int i = 0; i < MAXTEAMCOUNT; i++) {
             try {
                 if (BlueTeam[i] != null) {
                     Messenger.PlayerMsg(BlueTeam[i], "You are on the Blue Team", Text.Yellow);
                     Messenger.PlayerWarp(BlueTeam[i], BLUEMAP, BLUEX, BLUEY);
                     BlueTeam[i].Player.Status = "Blue";
                     Messenger.SendPlayerData(BlueTeam[i]);
                 }
                 if (RedTeam[i] != null) {
                     Messenger.PlayerMsg(RedTeam[i], "You are on the Red Team", Text.Yellow);
                     Messenger.PlayerWarp(RedTeam[i], REDMAP, REDX, REDY);
                     RedTeam[i].Player.Status = "Red";
                     Messenger.SendPlayerData(RedTeam[i]);
                 }
             } catch (Exception ex) {
             }
         }
         GameState = CTFGameState.Started;
     } else {
         int needed = (MINTEAMCOUNT * 2) - (RedTeamPlayers + BlueTeamPlayers);
         if (needed == 1) {
             Messenger.PlayerMsg(GameLeader, "There are not enough players on each team! 1 more player needs to join before the game can start!", Text.BrightRed);
         } else {
             Messenger.PlayerMsg(GameLeader, "There are not enough players on each team! " + needed.ToString() + " more players need to join before the game can start!", Text.BrightRed);
         }
     }
 }
示例#7
0
文件: CTF.cs 项目: Festivo/Scripts
        public void Init(CTFGameState newGameState)
        {
            RedTeam = new Client[MAXTEAMCOUNT];
            BlueTeam = new Client[MAXTEAMCOUNT];

            for (int i = 0; i < MAXTEAMCOUNT; i++) {
                RedTeam[i] = null;
                BlueTeam[i] = null;
            }
            RedTeamPlayers = 0;
            BlueTeamPlayers = 0;
            GameState = newGameState;
            RedScore = 0;
            BlueScore = 0;
            RedFlags = 5;
            BlueFlags = 5;
            PlayerCount = 0;
            GameLeader = null;
            RedFlagHolder = null;
            BlueFlagHolder = null;
            LastAdded = Teams.Red;
        }
示例#8
0
文件: CTF.cs 项目: Festivo/Scripts
 public void CreateGame(Client client)
 {
     GameLeader = client;
     GameState = CTFGameState.WaitingForPlayers;
     AddToGame(client);
     Messenger.PlayerMsg(client, "You have created a new game of Capture The Flag! Say /ctfstart to start!", Text.Yellow);
     Messenger.MapMsg(MapManager.GenerateMapID(HUBMAP), client.Player.Name + " has created a new game of Capture The Flag!", Text.Yellow);
 }