private void kickOff(Team offense){
  if (gameTime <= 0)   return;
 else {
    if (gameTime < 180 && ((gamePoss && (awayScore - homeScore) <= 8 && (awayScore - homeScore) > 0) || (!gamePoss && (homeScore - awayScore) <= 8 && (homeScore - awayScore) > 0))) {
      if (offense.getK(0).ratKickFum * Math.random() > 60 || Math.random() < 0.1) {
        gameEventLog+=getEventPrefix() + offense.abbr + " K "+ offense.getK(0).name+ " successfully executes onside kick! "+ offense.abbr+ " has possession!";
      }
 else {
        gameEventLog+=getEventPrefix() + offense.abbr + " K "+ offense.getK(0).name+ " failed the onside kick and lost possession.";
        gamePoss=!gamePoss;
      }
      gameYardLine=50;
      gameDown=1;
      gameYardsNeed=10;
      gameTime-=4 + 5 * Math.random();
    }
 else {
      gameYardLine=(int)(100 - (offense.getK(0).ratKickPow + 20 - 40 * Math.random()));
      if (gameYardLine <= 0)       gameYardLine=25;
      gameDown=1;
      gameYardsNeed=10;
      gamePoss=!gamePoss;
    }
    gameTime-=15 * Math.random();
  }
}

private void kickOff ( Team offense ) { if ( gameTime <= 0 ) return ; else { if ( gameTime < 180 && ( ( gamePoss && ( awayScore - homeScore ) <= 8 && ( awayScore - homeScore ) > 0 ) || ( ! gamePoss && ( homeScore - awayScore ) <= 8 && ( homeScore - awayScore ) > 0 ) ) ) { if ( offense . getK ( 0 ) . ratKickFum * Math . random ( ) > 60 || Math . random ( ) < 0.1 ) { gameEventLog += getEventPrefix ( ) + offense . abbr + " K " + offense . getK ( 0 ) . name + " successfully executes onside kick! " + offense . abbr + " has possession!" ; } else { gameEventLog += getEventPrefix ( ) + offense . abbr + " K " + offense . getK ( 0 ) . name + " failed the onside kick and lost possession." ; gamePoss = ! gamePoss ; } gameYardLine = 50 ; gameDown = 1 ; gameYardsNeed = 10 ; gameTime -= 4 + 5 * Math . random ( ) ; } else { gameYardLine = ( int ) ( 100 - ( offense . getK ( 0 ) . ratKickPow + 20 - 40 * Math . random ( ) ) ) ; if ( gameYardLine <= 0 ) gameYardLine = 25 ; gameDown = 1 ; gameYardsNeed = 10 ; gamePoss = ! gamePoss ; } gameTime -= 15 * Math . random ( ) ; } }
kick the ball off , turning the ball over to the other team .
