Пример #1
0
        public override void OnStop()
        {
            for (int i = 0; i < m_Controller.TeamInfo.Length; ++i)
            {
                CTFTeamInfo teamInfo = m_Controller.TeamInfo[i];

                if (teamInfo.Flag != null)
                {
                    teamInfo.Flag.SendHome();
                    teamInfo.Flag.m_TeamInfo = null;
                }

                if (teamInfo.Board != null)
                {
                    teamInfo.Board.m_TeamInfo = null;
                }

                teamInfo.Game = null;
            }

            for (int i = 0; i < m_Context.Participants.Count; ++i)
            {
                ApplyHues(m_Context.Participants[i] as Participant, -1);
            }

            if (m_FinishTimer != null)
            {
                m_FinishTimer.Stop();
            }

            m_FinishTimer = null;
        }
Пример #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_TeamInfo != null && m_TeamInfo.Game != null)
            {
                CTFTeamInfo ourTeam = m_TeamInfo;
                CTFTeamInfo useTeam = m_TeamInfo.Game.GetTeamInfo(from);

                if (ourTeam == null || useTeam == null)
                {
                    return;
                }

                if (IsChildOf(from.Backpack))
                {
                    from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(Flag_OnTarget));
                }
                else if (!from.InRange(this, 1) || !from.InLOS(this))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x26, 1019045); // I can't reach that
                }
                else if (ourTeam == useTeam)
                {
                    if (this.Location == m_TeamInfo.Origin && this.Map == m_TeamInfo.Game.Facet)
                    {
                        from.Send(new UnicodeMessage(this.Serial, this.ItemID, MessageType.Regular, 0x3B2, 3, "ENU", this.Name, "Touch me not for I am chaste."));
                    }
                    else
                    {
                        CTFPlayerInfo playerInfo = useTeam[from];

                        if (playerInfo != null)
                        {
                            playerInfo.Score += 4; // return
                        }
                        m_Returner   = from;
                        m_ReturnTime = DateTime.UtcNow;

                        SendHome();

                        from.LocalOverheadMessage(MessageType.Regular, 0x59, false, "You returned the cookies!");
                        m_TeamInfo.Game.Alert("The {1} cookies have been returned by {0}.", from.Name, ourTeam.Name);
                    }
                }
                else if (!from.PlaceInBackpack(this))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x26, false, "I can't hold that.");
                }
                else
                {
                    from.RevealingAction();

                    from.LocalOverheadMessage(MessageType.Regular, 0x59, false, "You stole the cookies!");
                    m_TeamInfo.Game.Alert("The {1} cookies have been stolen by {0} ({2}).", from.Name, ourTeam.Name, useTeam.Name);

                    BeginCountdown(120);
                }
            }
        }
Пример #3
0
        public int GetColor(Mobile mob)
        {
            CTFTeamInfo teamInfo = GetTeamInfo(mob);

            if (teamInfo != null)
            {
                return(teamInfo.Color);
            }

            return(-1);
        }
Пример #4
0
        public CTFController()
        {
            Visible = false;
            Movable = false;

            m_Duration = TimeSpan.FromMinutes(30.0);

            m_TeamInfo = new CTFTeamInfo[8];

            for (int i = 0; i < m_TeamInfo.Length; ++i)
            {
                m_TeamInfo[i] = new CTFTeamInfo(i);
            }
        }
Пример #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_Duration = reader.ReadTimeSpan();

                goto case 1;
            }

            case 1:
            {
                m_TeamInfo = new CTFTeamInfo[reader.ReadEncodedInt()];

                for (int i = 0; i < m_TeamInfo.Length; ++i)
                {
                    m_TeamInfo[i] = new CTFTeamInfo(i, reader);
                }

                break;
            }

            case 0:
            {
                m_TeamInfo = new CTFTeamInfo[8];

                for (int i = 0; i < m_TeamInfo.Length; ++i)
                {
                    m_TeamInfo[i] = new CTFTeamInfo(i);
                }

                break;
            }
            }

            if (version < 2)
            {
                m_Duration = TimeSpan.FromMinutes(30.0);
            }
        }
Пример #6
0
        public override void OnStart()
        {
            for (int i = 0; i < m_Controller.TeamInfo.Length; ++i)
            {
                CTFTeamInfo teamInfo = m_Controller.TeamInfo[i];

                teamInfo.Game = this;
                teamInfo.Reset();
            }

            for (int i = 0; i < m_Context.Participants.Count; ++i)
            {
                ApplyHues(m_Context.Participants[i] as Participant, m_Controller.TeamInfo[i % 8].Color);
            }

            if (m_FinishTimer != null)
            {
                m_FinishTimer.Stop();
            }

            m_FinishTimer = Timer.DelayCall(m_Controller.Duration, new TimerCallback(Finish_Callback));
        }
Пример #7
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2:
                {
                    m_Duration = reader.ReadTimeSpan();

                    goto case 1;
                }
                case 1:
                {
                    m_TeamInfo = new CTFTeamInfo[reader.ReadEncodedInt()];

                    for ( int i = 0; i < m_TeamInfo.Length; ++i )
                        m_TeamInfo[i] = new CTFTeamInfo( i, reader );

                    break;
                }
                case 0:
                {
                    m_TeamInfo = new CTFTeamInfo[8];

                    for ( int i = 0; i < m_TeamInfo.Length; ++i )
                        m_TeamInfo[i] = new CTFTeamInfo( i );

                    break;
                }
            }

            if ( version < 2 )
                m_Duration = TimeSpan.FromMinutes( 30.0 );
        }
Пример #8
0
        public CTFController()
        {
            Visible = false;
            Movable = false;

            m_Duration = TimeSpan.FromMinutes( 30.0 );

            m_TeamInfo = new CTFTeamInfo[8];

            for ( int i = 0; i < m_TeamInfo.Length; ++i )
                m_TeamInfo[i] = new CTFTeamInfo( i );
        }
Пример #9
0
 public CTFPlayerInfo( CTFTeamInfo teamInfo, Mobile player )
 {
     m_TeamInfo = teamInfo;
     m_Player = player;
 }
Пример #10
0
        public CTFBoardGump( Mobile mob, CTFGame game, CTFTeamInfo section )
            : base(60, 60)
        {
            m_Game = game;

            CTFTeamInfo ourTeam = game.GetTeamInfo( mob );

            List<IRankedCTF> entries = new List<IRankedCTF>();

            if ( section == null )
            {
                for ( int i = 0; i < game.Context.Participants.Count; ++i )
                {
                    CTFTeamInfo teamInfo = game.Controller.TeamInfo[i % 8];

                    if ( teamInfo == null || teamInfo.Flag == null )
                        continue;

                    entries.Add( teamInfo );
                }
            }
            else
            {
                foreach ( CTFPlayerInfo player in section.Players.Values )
                {
                    if ( player.Score > 0 )
                        entries.Add( player );
                }
            }

            entries.Sort( delegate( IRankedCTF a, IRankedCTF b )
            {
                return b.Score - a.Score;
            } );

            int height = 0;

            if ( section == null )
                height = 73 + ( entries.Count * 75 ) + 28;

            Closable = false;

            AddPage( 0 );

            AddBackground( 1, 1, 398, height, 3600 );

            AddImageTiled( 16, 15, 369, height - 29, 3604 );

            for ( int i = 0; i < entries.Count; i += 1 )
                AddImageTiled( 22, 58 + ( i * 75 ), 357, 70, 0x2430 );

            AddAlphaRegion( 16, 15, 369, height - 29 );

            AddImage( 215, -45, 0xEE40 );
            //AddImage( 330, 141, 0x8BA );

            AddBorderedText( 22, 22, 294, 20, Center( "CTF Scoreboard" ), LabelColor32, BlackColor32 );

            AddImageTiled( 32, 50, 264, 1, 9107 );
            AddImageTiled( 42, 52, 264, 1, 9157 );

            if ( section == null )
            {
                for ( int i = 0; i < entries.Count; ++i )
                {
                    CTFTeamInfo teamInfo = entries[i] as CTFTeamInfo;

                    AddImage( 30, 70 + ( i * 75 ), 10152 );
                    AddImage( 30, 85 + ( i * 75 ), 10151 );
                    AddImage( 30, 100 + ( i * 75 ), 10151 );
                    AddImage( 30, 106 + ( i * 75 ), 10154 );

                    AddImage( 24, 60 + ( i * 75 ), teamInfo == ourTeam ? 9730 : 9727, teamInfo.Color - 1 );

                    int nameColor = LabelColor32;
                    int borderColor = BlackColor32;

                    switch ( teamInfo.Color )
                    {
                        case 0x47E:
                            nameColor = 0xFFFFFF;
                            break;

                        case 0x4F2:
                            nameColor = 0x3399FF;
                            break;

                        case 0x4F7:
                            nameColor = 0x33FF33;
                            break;

                        case 0x4FC:
                            nameColor = 0xFF00FF;
                            break;

                        case 0x021:
                            nameColor = 0xFF3333;
                            break;

                        case 0x01A:
                            nameColor = 0xFF66FF;
                            break;

                        case 0x455:
                            nameColor = 0x333333;
                            borderColor = 0xFFFFFF;
                            break;
                    }

                    AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1} Team", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );

                    AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
                    AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );

                    AddBorderedText( 110 + 10, 85 + ( i * 75 ), 100, 20, "Kills:", 0xFFC000, BlackColor32 );
                    AddBorderedText( 110 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Kills.ToString( "N0" ), 0xFFC000, BlackColor32 );

                    AddBorderedText( 160 + 10, 85 + ( i * 75 ), 100, 20, "Captures:", 0xFFC000, BlackColor32 );
                    AddBorderedText( 160 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Captures.ToString( "N0" ), 0xFFC000, BlackColor32 );

                    CTFPlayerInfo pl = teamInfo.Leader;

                    AddBorderedText( 235 + 10, 85 + ( i * 75 ), 250, 20, "Leader:", 0xFFC000, BlackColor32 );

                    if ( pl != null )
                        AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
                }
            }
            else
            {
            }

            AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
        }
Пример #11
0
 public CTFPlayerInfo(CTFTeamInfo teamInfo, Mobile player)
 {
     m_TeamInfo = teamInfo;
     m_Player   = player;
 }
Пример #12
0
        private void Flag_OnTarget(Mobile from, object obj)
        {
            if (m_TeamInfo == null)
            {
                return;
            }

            if (!IsChildOf(from.Backpack))
            {
                return;
            }

            CTFTeamInfo ourTeam = m_TeamInfo;
            CTFTeamInfo useTeam = m_TeamInfo.Game.GetTeamInfo(from);

            if (obj is CTFFlag)
            {
                if (obj == useTeam.Flag)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x59, false, "You captured the cookies!");
                    m_TeamInfo.Game.Alert("{0} captured the {1} cookies!", from.Name, ourTeam.Name);

                    SendHome();

                    CTFPlayerInfo playerInfo = useTeam[from];

                    if (playerInfo != null)
                    {
                        playerInfo.Captures += 1;
                        playerInfo.Score    += 50; // capture

                        ConCTFFlag teamFlag = useTeam.Flag;

                        if (teamFlag.m_Fragger != null && DateTime.UtcNow < (teamFlag.m_FragTime + TimeSpan.FromSeconds(5.0)) && m_TeamInfo.Game.GetTeamInfo(teamFlag.m_Fragger) == useTeam)
                        {
                            CTFPlayerInfo assistInfo = useTeam[teamFlag.m_Fragger];

                            if (assistInfo != null)
                            {
                                assistInfo.Score += 6; // frag assist
                            }
                        }

                        if (teamFlag.m_Returner != null && DateTime.UtcNow < (teamFlag.m_ReturnTime + TimeSpan.FromSeconds(5.0)))
                        {
                            CTFPlayerInfo assistInfo = useTeam[teamFlag.m_Returner];

                            if (assistInfo != null)
                            {
                                assistInfo.Score += 4; // return assist
                            }
                        }
                    }
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x26, false, "Those are not my cookies.");
                }
            }
            else if (obj is Mobile)
            {
                Mobile passTo = obj as Mobile;

                CTFTeamInfo passTeam = m_TeamInfo.Game.GetTeamInfo(passTo);

                if (passTo == from)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x26, false, "I can't pass to them.");
                }
                else if (passTeam == useTeam && passTo.PlaceInBackpack(this))
                {
                    passTo.LocalOverheadMessage(MessageType.Regular, 0x59, false, String.Format("{0} has passed you the cookies!", from.Name));
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x26, false, "I can't pass to them.");
                }
            }
        }
Пример #13
0
        private void Finish_Callback()
        {
            List <CTFTeamInfo> teams = new List <CTFTeamInfo>();

            for (int i = 0; i < m_Context.Participants.Count; ++i)
            {
                CTFTeamInfo teamInfo = m_Controller.TeamInfo[i % 8];

                if (teamInfo == null || teamInfo.Flag == null)
                {
                    continue;
                }

                teams.Add(teamInfo);
            }

            teams.Sort(delegate(CTFTeamInfo a, CTFTeamInfo b)
            {
                return(b.Score - a.Score);
            });

            Tournament tourny = m_Context.m_Tournament;

            StringBuilder sb = new StringBuilder();

            if (tourny != null && tourny.TournyType == TournyType.FreeForAll)
            {
                sb.Append(m_Context.Participants.Count * tourny.PlayersPerParticipant);
                sb.Append("-man FFA");
            }
            else if (tourny != null && tourny.TournyType == TournyType.RandomTeam)
            {
                sb.Append(tourny.ParticipantsPerMatch);
                sb.Append("-team");
            }
            else if (tourny != null && tourny.TournyType == TournyType.RedVsBlue)
            {
                sb.Append("Red v Blue");
            }

            else if (tourny != null)
            {
                for (int i = 0; i < tourny.ParticipantsPerMatch; ++i)
                {
                    if (sb.Length > 0)
                    {
                        sb.Append('v');
                    }

                    sb.Append(tourny.PlayersPerParticipant);
                }
            }

            if (m_Controller != null)
            {
                sb.Append(' ').Append(m_Controller.Title);
            }

            string title = sb.ToString();

            CTFTeamInfo winner = (teams.Count > 0 ? teams[0] : null);

            for (int i = 0; i < teams.Count; ++i)
            {
                TrophyRank rank = TrophyRank.Bronze;

                if (i == 0)
                {
                    rank = TrophyRank.Gold;
                }
                else if (i == 1)
                {
                    rank = TrophyRank.Silver;
                }

                CTFPlayerInfo leader = teams[i].Leader;

                foreach (CTFPlayerInfo pl in teams[i].Players.Values)
                {
                    Mobile mob = pl.Player;

                    if (mob == null)
                    {
                        continue;
                    }

                    //"Red v Blue CTF Champion"

                    sb = new StringBuilder();

                    sb.Append(title);

                    if (pl == leader)
                    {
                        sb.Append(" Leader");
                    }

                    if (pl.Score > 0)
                    {
                        sb.Append(": ");

                        sb.Append(pl.Score.ToString("N0"));
                        sb.Append(pl.Score == 1 ? " point" : " points");

                        if (pl.Kills > 0)
                        {
                            sb.Append(", ");
                            sb.Append(pl.Kills.ToString("N0"));
                            sb.Append(pl.Kills == 1 ? " kill" : " kills");
                        }

                        if (pl.Captures > 0)
                        {
                            sb.Append(", ");
                            sb.Append(pl.Captures.ToString("N0"));
                            sb.Append(pl.Captures == 1 ? " capture" : " captures");
                        }
                    }

                    Item item = new Trophy(sb.ToString(), rank);

                    if (pl == leader)
                    {
                        item.ItemID = 4810;
                    }

                    item.Name = String.Format("{0}, {1} team", item.Name, teams[i].Name.ToLower());

                    if (!mob.PlaceInBackpack(item))
                    {
                        mob.BankBox.DropItem(item);
                    }

                    int cash = pl.Score * 250;

                    if (cash > 0)
                    {
                        item = new BankCheck(cash);

                        if (!mob.PlaceInBackpack(item))
                        {
                            mob.BankBox.DropItem(item);
                        }

                        mob.SendMessage("You have been awarded a {0} trophy and {1:N0}gp for your participation in this tournament.", rank.ToString().ToLower(), cash);
                    }
                    else
                    {
                        mob.SendMessage("You have been awarded a {0} trophy for your participation in this tournament.", rank.ToString().ToLower());
                    }
                }
            }

            for (int i = 0; i < m_Context.Participants.Count; ++i)
            {
                Participant p = m_Context.Participants[i] as Participant;

                for (int j = 0; j < p.Players.Length; ++j)
                {
                    DuelPlayer dp = p.Players[j];

                    if (dp != null && dp.Mobile != null)
                    {
                        dp.Mobile.CloseGump(typeof(CTFBoardGump));
                        dp.Mobile.SendGump(new CTFBoardGump(dp.Mobile, this));
                    }
                }

                if (i == winner.TeamID)
                {
                    continue;
                }

                for (int j = 0; j < p.Players.Length; ++j)
                {
                    if (p.Players[j] != null)
                    {
                        p.Players[j].Eliminated = true;
                    }
                }
            }

            m_Context.Finish(m_Context.Participants[winner.TeamID] as Participant);
        }
Пример #14
0
        public override bool OnDeath(Mobile mob, Container corpse)
        {
            Mobile killer = mob.FindMostRecentDamager(false);

            bool hadFlag = false;

            Item[] flags = corpse.FindItemsByType(typeof(CTFFlag), false);

            for (int i = 0; i < flags.Length; ++i)
            {
                (flags[i] as ConCTFFlag).DropTo(mob, killer);
            }

            hadFlag = (hadFlag || flags.Length > 0);

            if (mob.Backpack != null)
            {
                flags = mob.Backpack.FindItemsByType(typeof(CTFFlag), false);

                for (int i = 0; i < flags.Length; ++i)
                {
                    (flags[i] as ConCTFFlag).DropTo(mob, killer);
                }

                hadFlag = (hadFlag || flags.Length > 0);
            }

            if (killer != null && killer.Player)
            {
                CTFTeamInfo teamInfo = GetTeamInfo(killer);
                CTFTeamInfo victInfo = GetTeamInfo(mob);

                if (teamInfo != null && teamInfo != victInfo)
                {
                    CTFPlayerInfo playerInfo = teamInfo[killer];

                    if (playerInfo != null)
                    {
                        playerInfo.Kills += 1;
                        playerInfo.Score += 1; // base frag

                        if (hadFlag)
                        {
                            playerInfo.Score += 4; // fragged flag carrier
                        }
                        if (mob.InRange(teamInfo.Origin, 24) && mob.Map == this.Facet)
                        {
                            playerInfo.Score += 1; // fragged in base -- guarding
                        }
                        for (int i = 0; i < m_Controller.TeamInfo.Length; ++i)
                        {
                            if (m_Controller.TeamInfo[i] == teamInfo)
                            {
                                continue;
                            }

                            Mobile ourFlagCarrier = null;

                            if (m_Controller.TeamInfo[i].Flag != null)
                            {
                                ourFlagCarrier = m_Controller.TeamInfo[i].Flag.RootParent as Mobile;
                            }

                            if (ourFlagCarrier != null && GetTeamInfo(ourFlagCarrier) == teamInfo)
                            {
                                for (int j = 0; j < ourFlagCarrier.Aggressors.Count; ++j)
                                {
                                    AggressorInfo aggr = ourFlagCarrier.Aggressors[j] as AggressorInfo;

                                    if (aggr == null || aggr.Defender != ourFlagCarrier || aggr.Attacker != mob)
                                    {
                                        continue;
                                    }

                                    playerInfo.Score += 2; // helped defend guy capturing enemy flag
                                    break;
                                }

                                if (mob.Map == ourFlagCarrier.Map && ourFlagCarrier.InRange(mob, 12))
                                {
                                    playerInfo.Score += 1; // helped defend guy capturing enemy flag
                                }
                            }
                        }
                    }
                }
            }

            mob.CloseGump(typeof(CTFBoardGump));
            mob.SendGump(new CTFBoardGump(mob, this));

            m_Context.Requip(mob, corpse);
            DelayBounce(TimeSpan.FromSeconds(30.0), mob, corpse);

            return(false);
        }
Пример #15
0
        public CTFBoardGump(Mobile mob, CTFGame game, CTFTeamInfo section)
            : base(60, 60)
        {
            m_Game = game;

            CTFTeamInfo ourTeam = game.GetTeamInfo(mob);

            List <IRankedCTF> entries = new List <IRankedCTF>();

            if (section == null)
            {
                for (int i = 0; i < game.Context.Participants.Count; ++i)
                {
                    CTFTeamInfo teamInfo = game.Controller.TeamInfo[i % 8];

                    if (teamInfo == null || teamInfo.Flag == null)
                    {
                        continue;
                    }

                    entries.Add(teamInfo);
                }
            }
            else
            {
                foreach (CTFPlayerInfo player in section.Players.Values)
                {
                    if (player.Score > 0)
                    {
                        entries.Add(player);
                    }
                }
            }

            entries.Sort(delegate(IRankedCTF a, IRankedCTF b)
            {
                return(b.Score - a.Score);
            });

            int height = 0;

            if (section == null)
            {
                height = 73 + (entries.Count * 75) + 28;
            }

            Closable = false;

            AddPage(0);

            AddBackground(1, 1, 398, height, 3600);

            AddImageTiled(16, 15, 369, height - 29, 3604);

            for (int i = 0; i < entries.Count; i += 1)
            {
                AddImageTiled(22, 58 + (i * 75), 357, 70, 0x2430);
            }

            AddAlphaRegion(16, 15, 369, height - 29);

            AddImage(215, -45, 0xEE40);
            //AddImage( 330, 141, 0x8BA );

            AddBorderedText(22, 22, 294, 20, Center("CTF Scoreboard"), LabelColor32, BlackColor32);

            AddImageTiled(32, 50, 264, 1, 9107);
            AddImageTiled(42, 52, 264, 1, 9157);

            if (section == null)
            {
                for (int i = 0; i < entries.Count; ++i)
                {
                    CTFTeamInfo teamInfo = entries[i] as CTFTeamInfo;

                    AddImage(30, 70 + (i * 75), 10152);
                    AddImage(30, 85 + (i * 75), 10151);
                    AddImage(30, 100 + (i * 75), 10151);
                    AddImage(30, 106 + (i * 75), 10154);

                    AddImage(24, 60 + (i * 75), teamInfo == ourTeam ? 9730 : 9727, teamInfo.Color - 1);

                    int nameColor   = LabelColor32;
                    int borderColor = BlackColor32;

                    switch (teamInfo.Color)
                    {
                    case 0x47E:
                        nameColor = 0xFFFFFF;
                        break;

                    case 0x4F2:
                        nameColor = 0x3399FF;
                        break;

                    case 0x4F7:
                        nameColor = 0x33FF33;
                        break;

                    case 0x4FC:
                        nameColor = 0xFF00FF;
                        break;

                    case 0x021:
                        nameColor = 0xFF3333;
                        break;

                    case 0x01A:
                        nameColor = 0xFF66FF;
                        break;

                    case 0x455:
                        nameColor   = 0x333333;
                        borderColor = 0xFFFFFF;
                        break;
                    }

                    AddBorderedText(60, 65 + (i * 75), 250, 20, String.Format("{0}: {1} Team", LadderGump.Rank(1 + i), teamInfo.Name), nameColor, borderColor);

                    AddBorderedText(50 + 10, 85 + (i * 75), 100, 20, "Score:", 0xFFC000, BlackColor32);
                    AddBorderedText(50 + 15, 105 + (i * 75), 100, 20, teamInfo.Score.ToString("N0"), 0xFFC000, BlackColor32);

                    AddBorderedText(110 + 10, 85 + (i * 75), 100, 20, "Kills:", 0xFFC000, BlackColor32);
                    AddBorderedText(110 + 15, 105 + (i * 75), 100, 20, teamInfo.Kills.ToString("N0"), 0xFFC000, BlackColor32);

                    AddBorderedText(160 + 10, 85 + (i * 75), 100, 20, "Captures:", 0xFFC000, BlackColor32);
                    AddBorderedText(160 + 15, 105 + (i * 75), 100, 20, teamInfo.Captures.ToString("N0"), 0xFFC000, BlackColor32);

                    CTFPlayerInfo pl = teamInfo.Leader;

                    AddBorderedText(235 + 10, 85 + (i * 75), 250, 20, "Leader:", 0xFFC000, BlackColor32);

                    if (pl != null)
                    {
                        AddBorderedText(235 + 15, 105 + (i * 75), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32);
                    }
                }
            }
            else
            {
            }

            AddButton(314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0);
        }