public bool CheckScore( BRGoal goal, Mobile m, int points ) { if ( m_Game == null || m == null || goal == null ) return false; BRTeamInfo team = m_Game.GetTeamInfo( m ); if ( team == null || goal.Team == null || team == goal.Team ) return false; if ( points > 3 ) m_Game.Alert( "Touchdown {0} ({1})!", team.Name, m.Name ); else m_Game.Alert( "Field goal {0} ({1})!", team.Name, m.Name ); for (int i = m_Helpers.Count - 1; i >= 0; i--) { Mobile mob = (Mobile)m_Helpers[i]; BRPlayerInfo pi = team[mob]; if ( pi != null ) { if ( mob == m ) pi.Captures += points; pi.Score += points + 1; points /= 2; } } m_Game.ReturnBomb(); m_Flying = false; this.Visible = true; m_Path.Clear(); m_PathIdx = 0; Target.Cancel( m ); return true; }
public BRTeamInfo( int teamID, GenericReader ip ) { m_TeamID = teamID; m_Players = new Hashtable(); int version = ip.ReadEncodedInt(); switch ( version ) { case 0: { m_Board = ip.ReadItem() as BRBoard; m_Name = ip.ReadString(); m_Color = ip.ReadEncodedInt(); m_Goal = ip.ReadItem() as BRGoal; break; } } }