Ejemplo n.º 1
0
 public MatchUp(string id, Tournament tournament, TournamentMember playerOne, TournamentMember playerTwo)
 {
     this.id = id;
     this.tournament = tournament;
     this.playerOne = playerOne;
     this.playerTwo = playerTwo;
 }
Ejemplo n.º 2
0
        public static Tournament CreateTournament(Client manager, string name, string hubMap, int hubStartX, int hubStartY)
        {
            Tournament tournament = new Tournament(GenerateUniqueID(), name,  new WarpDestination(hubMap, hubStartX, hubStartY));
            // Add the manager
            TournamentMember member = new TournamentMember(tournament, manager);
            member.Admin = true;
            member.Active = true;
            tournament.RegisterPlayer(member);

            tournaments.AddTournament(tournament);

            return tournament;
        }
Ejemplo n.º 3
0
 public TournamentMember(Tournament tournament, Client client)
 {
     this.tournament = tournament.ID;
     this.client = client;
 }
Ejemplo n.º 4
0
        public static TcpPacket CreateTournamentRulesPacket(Tournament tournament)
        {
            TcpPacket packet = new TcpPacket("tournamentrules");

            packet.AppendParameters(
                tournament.Rules.SleepClause.ToIntString(),
                 tournament.Rules.AccuracyClause.ToIntString(),
                 tournament.Rules.SpeciesClause.ToIntString(),
                 tournament.Rules.FreezeClause.ToIntString(),
                 tournament.Rules.OHKOClause.ToIntString(),
                 tournament.Rules.SelfKOClause.ToIntString());

            return packet;
        }
Ejemplo n.º 5
0
        public static void OnTournamentRoundComplete(Tournament tournament)
        {
            try {
                tournament.StartRound(new MatchUpRules());
                Story playerOneStory = new Story();
                StoryBuilderSegment playerOneSegment = StoryBuilder.BuildStory();
                StoryBuilder.AppendSaySegment(playerOneSegment, "Your match is ready to begin!", -1, 0, 0);
                StoryBuilder.AppendMovePlayerAction(playerOneSegment, 8, 2, Enums.Speed.Walking, true);
                playerOneSegment.AppendToStory(playerOneStory);

                Story playerTwoStory = new Story();
                StoryBuilderSegment playerTwoSegment = StoryBuilder.BuildStory();
                StoryBuilder.AppendSaySegment(playerTwoSegment, "Your match is ready to begin!", -1, 0, 0);
                StoryBuilder.AppendMovePlayerAction(playerTwoSegment, 11, 2, Enums.Speed.Walking, true);
                playerTwoSegment.AppendToStory(playerTwoStory);

                for (int i = 0; i < tournament.ActiveMatchups.Count; i++) {
                    StoryManager.PlayStory(tournament.ActiveMatchups[i].PlayerOne.Client, playerOneStory);
                    StoryManager.PlayStory(tournament.ActiveMatchups[i].PlayerTwo.Client, playerTwoStory);
                }
            } catch (Exception ex) {
                Messenger.AdminMsg("Error: OnTournamentRoundComplete", Text.Black);
            }
        }
Ejemplo n.º 6
0
 public static void OnTournamentComplete(Tournament tournament, TournamentMember member)
 {
     Messenger.AdminMsg("[Staff] The winner was " + member.Client.Player.Name + "!", Text.BrightBlue);
 }
Ejemplo n.º 7
0
        public static void OnTournamentCanceled(Tournament tournament, string reason)
        {
            try {
                Story story = new Story();
                StoryBuilderSegment segment = StoryBuilder.BuildStory();

                StoryBuilder.AppendSaySegment(segment, "The tournament was canceled! " + reason, -1, 0, 0);
                segment.AppendToStory(story);

                for (int i = 0; i < tournament.RegisteredMembers.Count; i++) {
                    StoryManager.PlayStory(tournament.RegisteredMembers[i].Client, story);
                }
            } catch (Exception ex) {
                Messenger.AdminMsg("Error: OnTournamentCanceled", Text.Black);
            }
        }
Ejemplo n.º 8
0
        public static void OnPlayerRegisteredInTournament(Tournament tournament, TournamentMember member, bool isSpectator)
        {
            try {
                if (member.Client.Player.MapID == MapManager.GenerateMapID(1192)) {
                    if (!isSpectator) {
                        Story story = new Story();
                        StoryBuilderSegment segment = StoryBuilder.BuildStory();

                        StoryBuilder.AppendSaySegment(segment, "Please step into the left door.", -1, 0, 0);
                        StoryBuilder.AppendMovePlayerAction(segment, 9, 1, Enums.Speed.Walking, true);

                        segment.AppendToStory(story);
                        StoryManager.PlayStory(member.Client, story);
                    } else {
                        // Player is a spectator
                        tournament.WarpToHub(member.Client);
                    }
                }
            } catch (Exception ex) {
                Messenger.AdminMsg("Error: OnPlayerRegisteredInTournament", Text.Black);
            }
        }
Ejemplo n.º 9
0
 public static void RemoveTournament(Tournament tournament)
 {
     tournaments.Remove(tournament);
 }
Ejemplo n.º 10
0
 public void Remove(Tournament tournament)
 {
     tournaments.RemoveAtValue(tournament);
 }
Ejemplo n.º 11
0
 public void Remove(Tournament tournament)
 {
     tournaments.RemoveAtValue(tournament);
 }
Ejemplo n.º 12
0
 public void AddTournament(Tournament tournament)
 {
     if (tournaments.Keys.Contains(tournament.ID) == false) {
         tournaments.Add(tournament.ID, tournament);
     }
 }
Ejemplo n.º 13
0
 public TournamentMember(Tournament tournament, Client client)
 {
     this.tournament = tournament.ID;
     this.client     = client;
 }
Ejemplo n.º 14
0
 public static void RemoveTournament(Tournament tournament)
 {
     tournaments.Remove(tournament);
 }