Example #1
0
 public TeamConfirmGump(Mobile from, Tournament tournament, Teams fullteam)
     : this()
 {
     caller = from;
     t = tournament;
     team = fullteam;
     size = team.getOwners().Count-1;
     TeamInfo();
 }
Example #2
0
        /// <summary>
        /// Removes a team from the tournament list
        /// </summary>
        /// <param name="m">team to be removed</param>
        public void RemoveTeam(Teams m)
        {
            List<Teams> remove = new List<Teams>();
            foreach (PlayerMobile pm in m.getOwners())
            {
                remove.Add(GetTeam(pm));
            }

            foreach (Teams team in remove)
            {
                foreach(PlayerMobile pm in team.getOwners())
                {
                    if (Manager.IsOnline(pm))
                        pm.SendMessage(String.Format("You have been removed from the {0} tournament on {1} at {2}.", TeamSize, Date.ToString("MM/dd/yy"), Date.ToString("hh:mm tt")));
                }
                Teams.Remove(team);
            }

            XMLDates.Save();
        }
Example #3
0
        /// <summary>
        /// Adds a team to the tournament list
        /// </summary>
        /// <param name="m">team to add</param>
        /// <returns>did the team add?</returns>
        public bool AddTeam(Teams m)
        {
            bool Add = true;

            foreach(PlayerMobile pm in m.getOwners())
                if (IsRegistered(pm))
                    Add = false;

            if (Add)
            {
                Teams.Add(m);
                XMLDates.Save();
            }

            return Add;
        }
Example #4
0
 public bool hasLostTo( Teams team )
 {
     if( this.curLosses.Contains(team) )
         return true;
     else
         return false;
 }
Example #5
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 0:
                {
                    break;
                }
                case 1:
                {
                    if (((size + 1) == team.Count) && (size == 0))
                    {
                        Teams fullteam = new Teams(team);
                        t.AddTeam(fullteam);
                        from.SendGump(new UpcomingEventsGump(from));
                    }
                    else if ((size + 1) == team.Count && size > 0)
                    {
                        Teams fullteam = new Teams(team);
                        for (int i = 1; i < team.Count; i++ )
                            team[i].SendGump(new TeamConfirmGump(team[i], t, fullteam));
                    }
                    else
                        from.SendMessage("There are not enough members on the team.");
                    break;
                }
                default:
                {
                    if (info.ButtonID % 2 == 0)
                    {
                        int position = info.ButtonID / 2;
                        from.Target = new InternalTarget(t, team, position);
                    }
                    else
                    {
                        int position = (info.ButtonID-1) / 2;
                        if ((position) < team.Count)
                            team.Remove(team[position]);
                        from.SendGump(new UpcomingEventsGump(from));
                    }
                    break;
                }
            }
        }
Example #6
0
 /// <summary>
 /// Adds a team that this team has beaten to the list
 /// </summary>
 /// <param name="team">the team that this team beat</param>
 public void addWin( Teams team )
 {
     this.wins.Add( team );
     this.curWins.Add( team );
 }
Example #7
0
 /// <summary>
 /// Returns of this team has fought the team to be fought
 /// </summary>
 /// <param name="team"> The team to be checked</param>
 /// <returns>boolean stating if the team has been fought</returns>
 public bool hasFought( Teams team )
 {
     if( this.curLosses.Contains( team ) || this.curWins.Contains( team ) )
         return true;
     else
         return false;
 }
Example #8
0
        /// <summary>
        /// Rewards the top 3 place winners by giving the specified item(s) and
        /// placing them in thier banks.Notifies the winners that thier winnings
        /// have been placed in thier bank.
        /// Loads the previous tournaments.xml file
        /// Saves the results to the tournaments.xml file
        /// Removes the spectator gates.
        /// Moves the winners so they may leave.
        /// Stops the tournament timer to officially end the tournament.
        /// </summary>
        /// <param name="first"> First place contestant</param>
        /// <param name="second"> Second place contestant</param>
        /// <param name="third"> Third place contestant</param>
        public static void TournamentReward(Tournament t, string place, Teams team)
        {
            BankBox bank;
            Item prize = (Item)Activator.CreateInstance(t.Prizes[place].GetType(), false);
            Dupe.CopyProperties(prize,t.Prizes[place]);

            foreach(Mobile m in team.getOwners())
            {
                bank = m.BankBox;
                bank.AddItem(prize);
                m.SendMessage("Your winnings have been sent to your bankbox.");
                if (place.Contains("first"))
                    World.Broadcast(0,false, m.Name+" has won the " + t.TeamSize + " tournament.");
            }
        }
Example #9
0
 /// <summary>
 /// Adds a team to this teams loss record
 /// </summary>
 /// <param name="team">the team that this team lost to</param>
 public void addLoss( Teams team )
 {
     this.losses.Add( team );
     this.curLosses.Add( team );
 }
Example #10
0
 /// <summary>
 /// Sets a bout between two teams
 /// </summary>
 /// <param name="team1">the first team</param>
 /// <param name="team2">the second team</param>
 public Match( Teams team1, Teams team2)
 {
     m_Team1 = team1;
     m_Team2 = team2;
 }
Example #11
0
 /// <summary>
 /// Sets a bout between two teams
 /// </summary>
 /// <param name="team1">the first team</param>
 /// <param name="team2">the second team</param>
 public Match(Teams team1, ref Match refmatch1, bool winners)
 {
     refWinners = winners;
     m_Team1 = team1;
     m_refMatch1 = refmatch1;
 }
Example #12
0
 public AnnouncerTimer(MatchTimer timer, Teams team1, Teams team2)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     Priority = TimerPriority.OneSecond;
     t = timer;
     Team1 = team1;
     Team2 = team2;
     countdown = 6;
 }
Example #13
0
 /// <summary>
 /// Move the selected team
 /// </summary>
 /// <param name="team">Team to be moved</param>
 /// <param name="map">Map to be moved to</param>
 /// <param name="location">List of Point3D Locations to be moved to</param>
 /// <param name="msg">Message to tell the players being moved</param>
 /// <param name="paralyze">Should they be paralyzed after the move</param>
 public void MoveTeam(Teams team, Map map, List<Point3D> location, string msg, bool paralyze)
 {
     Mobile m;
     for (int i = 0; i < team.getOwners().Count; i++)
     {
         m = team.getOwners()[i];
         m.MoveToWorld(location[i], map); //Arena Area
         Manager.RefreshPlayer((PlayerMobile)m);
         if (msg.Length > 0 && (Manager.IsOnline((PlayerMobile)m)))
             m.SendMessage(msg);
         if (paralyze)
             m.Paralyzed = true;
     }
 }
Example #14
0
            /// <summary>
            /// Grab the fighters and place them into
            /// the staging area
            /// </summary>
            public void BeginStage()
            {
                if (b.Team1 != null && b.Team2 != null)
                {
                    m_Team1 = b.Team1;
                    m_Team2 = b.Team2;
                }
                else if (b.Team1 != null && b.refWinners)
                {
                    m_Team1 = b.Team1;
                    m_Team2 = b.refMatch1.Winner;
                }
                else if (b.Team1 != null && !b.refWinners)
                {
                    m_Team1 = b.Team1;
                    m_Team2 = b.refMatch1.Loser;
                }
                else if (b.refWinners)
                {
                    m_Team1 = b.refMatch1.Winner;
                    m_Team2 = b.refMatch2.Winner;
                }
                else
                {
                    m_Team1 = b.refMatch1.Loser;
                    m_Team2 = b.refMatch2.Loser;
                }

                MoveTeam(m_Team1, a.Map, a.StagingAreaOne, String.Format("You will have {0} seconds to suit up.", staging.Seconds), false);
                MoveTeam(m_Team2, a.Map, a.StagingAreaTwo, String.Format("You will have {0} seconds to suit up.", staging.Seconds), false);
                stagedelay = DateTime.Now + staging;
                timer = new AnnouncerTimer(this, m_Team1, m_Team2);

                this.Start();
            }
Example #15
0
 /// <summary>
 /// Adds a team that this team has beaten to the list
 /// </summary>
 /// <param name="team">the team that this team beat</param>
 public void addWin(Teams team)
 {
     this.wins.Add(team);
     this.curWins.Add(team);
 }
Example #16
0
 /// <summary>
 /// Adds a team to this teams loss record
 /// </summary>
 /// <param name="team">the team that this team lost to</param>
 public void addLoss(Teams team)
 {
     this.losses.Add(team);
     this.curLosses.Add(team);
 }