Beispiel #1
0
        public void Add(StageTraits traits)
        {
            var s = new Stage(traits);
            s.GetTraits().Ruleset = new Deathmatch(s);

            _stages.Add(s);
        }
Beispiel #2
0
        public void CreateClanwar(List<Client> red, List<Client> blue)
        {
            var traits = new StageTraits();

            traits.StageId = Globals.StageCounter.GetNext();
            traits.Name = "LADDER_GAME";
            traits.MaxPlayers = (byte)(red.Count + blue.Count);
            traits.RoundCount = 4;
            traits.Locked = true;
            traits.Gametype = ObjectStageGameType.TeamDeathMatch;
            traits.Password = "******";
            traits.Master = red[0];
            traits.Map = "Town"; //default for now
            traits.CurrentMap = Globals.Maps.GetMap(traits.Map);
            traits.WinThePoint = true;

            var stage = new Stage(traits);
            traits.Ruleset = new TeamDeathmatch(stage);

            foreach (var client in red)
            {
                client.ClientPlayer.PlayerTeam = Team.Red;
                stage.Join(client);
                StagePackets.LadderPrepare(client, (int)Team.Red);
            }
            StagePackets.ResponseSettings(red, traits);
            foreach (var client in blue)
            {
                client.ClientPlayer.PlayerTeam = Team.Blue;
                stage.Join(client);
                StagePackets.LadderPrepare(client, (int)Team.Blue);
            }
            StagePackets.ResponseSettings(blue, traits);

            traits.Ruleset.GameStartCallback(red[0], true);
        }
Beispiel #3
0
 public BaseGametype(Stage stage, ObjectStageGameType gameType)
 {
     _stage = stage;
     _gameType = gameType;
 }
Beispiel #4
0
 public Deathmatch(Stage stage)
     : base(stage, ObjectStageGameType.DeathMatch)
 {
 }
Beispiel #5
0
        public static void ResponseStageMaster(List<Client> clients, Stage stage)
        {
            using (var packet = new PacketWriter(Operation.StageMaster, CryptFlags.Encrypt))
            {
                packet.Write(stage.GetTraits().StageId);
                packet.Write(stage.GetTraits().Master.GetMuid());

                clients.ForEach(c => c.Send(packet));
            }
        }
Beispiel #6
0
 public Quest(Stage stage)
     : base(stage, ObjectStageGameType.Quest)
 {
 }
Beispiel #7
0
 public Berserker(Stage stage)
     : base(stage, ObjectStageGameType.Berserker)
 {
 }
Beispiel #8
0
 public Assassination(Stage currentStage)
     : base(currentStage, ObjectStageGameType.Assassination)
 {
 }
Beispiel #9
0
 public void Remove(Stage stage)
 {
     _stages.Remove(stage);
 }
Beispiel #10
0
 public int Index(Stage stage)
 {
     return _stages.IndexOf(stage);
 }
Beispiel #11
0
 public Duel(Stage stage)
     : base(stage, ObjectStageGameType.Duel)
 {
 }
Beispiel #12
0
 public TeamDeathmatch(Stage currentStage)
     : base(currentStage, ObjectStageGameType.TeamDeathMatch)
 {
 }
Beispiel #13
0
 public bool StageExists(Stage stage)
 {
     return _stages.Find(stage.GetTraits().StageId) != null;
 }
Beispiel #14
0
 public void Remove(Stage stage)
 {
     lock (_objectLock)
     {
         _stages.Remove(stage);
     }
 }