private bool TakeBomb( Mobile m, BRTeamInfo team, string verb ) { if ( !m.Player || !m.Alive || m.NetState == null ) return false; if ( m.PlaceInBackpack( this ) ) { m.RevealingAction(); m.LocalOverheadMessage( MessageType.Regular, 0x59, false, "You got the bomb!" ); m_Game.Alert( "{1} ({2}) {0} the bomb!", verb, m.Name, team.Name ); m.Target = new BombTarget( this, m ); if ( m_Helpers.Contains( m ) ) m_Helpers.Remove( m ); if ( m_Helpers.Count > 0 ) { Mobile last = (Mobile)m_Helpers[0]; if ( m_Game.GetTeamInfo( last ) != team ) m_Helpers.Clear(); } m_Helpers.Add( m ); return true; } else { return false; } }
public BRBoardGump( Mobile mob, BRGame game, BRTeamInfo section ) : base(60, 60) { m_Game = game; BRTeamInfo ourTeam = game.GetTeamInfo( mob ); ArrayList entries = new ArrayList(); if ( section == null ) { for ( int i = 0; i < game.Context.Participants.Count; ++i ) { BRTeamInfo teamInfo = game.Controller.TeamInfo[i % game.Controller.TeamInfo.Length]; if ( teamInfo == null ) continue; entries.Add( teamInfo ); } } else { foreach ( BRPlayerInfo 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( "BR 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 ) { BRTeamInfo teamInfo = entries[i] as BRTeamInfo; 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}", 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, "Points:", 0xFFC000, BlackColor32 ); AddBorderedText( 160 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Captures.ToString( "N0" ), 0xFFC000, BlackColor32 ); BRPlayerInfo 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 ); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_BombHome = reader.ReadPoint3D(); m_Duration = reader.ReadTimeSpan(); m_TeamInfo = new BRTeamInfo[reader.ReadEncodedInt()]; for ( int i = 0; i < m_TeamInfo.Length; ++i ) m_TeamInfo[i] = new BRTeamInfo( i, reader ); break; } } }
public BRPlayerInfo( BRTeamInfo teamInfo, Mobile player ) { m_TeamInfo = teamInfo; m_Player = player; }
public BRController() { Visible = false; Movable = false; Name = "Bombing Run Controller"; m_Duration = TimeSpan.FromMinutes( 30.0 ); m_BombHome = Point3D.Zero; m_TeamInfo = new BRTeamInfo[4]; for ( int i = 0; i < m_TeamInfo.Length; ++i ) m_TeamInfo[i] = new BRTeamInfo( i ); }