private void fieldGoalAtt(Team offense,Team defense){
  double fgDistRatio=Math.pow((110 - gameYardLine) / 50,2);
  double fgAccRatio=Math.pow((110 - gameYardLine) / 50,1.25);
  double fgDistChance=(getHFadv() + offense.getK(0).ratKickPow - fgDistRatio * 80);
  double fgAccChance=(getHFadv() + offense.getK(0).ratKickAcc - fgAccRatio * 80);
  if (fgDistChance > 20 && fgAccChance * Math.random() > 15) {
    if (gamePoss) {
      homeScore+=3;
      HomeKStats[3]++;
      HomeKStats[2]++;
    }
 else {
      awayScore+=3;
      AwayKStats[3]++;
      AwayKStats[2]++;
    }
    gameEventLog+=getEventPrefix() + offense.abbr + " K "+ offense.getK(0).name+ " made the "+ (110 - gameYardLine)+ " yard FG.";
    addPointsQuarter(3);
    offense.getK(0).statsFGMade++;
    offense.getK(0).statsFGAtt++;
    if (!playingOT)     kickOff(offense);
 else     resetForOT();
  }
 else {
    gameEventLog+=getEventPrefix() + offense.abbr + " K "+ offense.getK(0).name+ " missed the "+ (110 - gameYardLine)+ " yard FG.";
    offense.getK(0).statsFGAtt++;
    if (!playingOT) {
      gameYardLine=Math.max(100 - gameYardLine,20);
      gameDown=1;
      gameYardsNeed=10;
      if (gamePoss) {
        HomeKStats[3]++;
      }
 else {
        AwayKStats[3]++;
      }
      gamePoss=!gamePoss;
    }
 else     resetForOT();
  }
  gameTime-=20;
}

private void fieldGoalAtt ( Team offense , Team defense ) { double fgDistRatio = Math . pow ( ( 110 - gameYardLine ) / 50 , 2 ) ; double fgAccRatio = Math . pow ( ( 110 - gameYardLine ) / 50 , 1.25 ) ; double fgDistChance = ( getHFadv ( ) + offense . getK ( 0 ) . ratKickPow - fgDistRatio * 80 ) ; double fgAccChance = ( getHFadv ( ) + offense . getK ( 0 ) . ratKickAcc - fgAccRatio * 80 ) ; if ( fgDistChance > 20 && fgAccChance * Math . random ( ) > 15 ) { if ( gamePoss ) { homeScore += 3 ; HomeKStats [ 3 ] ++ ; HomeKStats [ 2 ] ++ ; } else { awayScore += 3 ; AwayKStats [ 3 ] ++ ; AwayKStats [ 2 ] ++ ; } gameEventLog += getEventPrefix ( ) + offense . abbr + " K " + offense . getK ( 0 ) . name + " made the " + ( 110 - gameYardLine ) + " yard FG." ; addPointsQuarter ( 3 ) ; offense . getK ( 0 ) . statsFGMade ++ ; offense . getK ( 0 ) . statsFGAtt ++ ; if ( ! playingOT ) kickOff ( offense ) ; else resetForOT ( ) ; } else { gameEventLog += getEventPrefix ( ) + offense . abbr + " K " + offense . getK ( 0 ) . name + " missed the " + ( 110 - gameYardLine ) + " yard FG." ; offense . getK ( 0 ) . statsFGAtt ++ ; if ( ! playingOT ) { gameYardLine = Math . max ( 100 - gameYardLine , 20 ) ; gameDown = 1 ; gameYardsNeed = 10 ; if ( gamePoss ) { HomeKStats [ 3 ] ++ ; } else { AwayKStats [ 3 ] ++ ; } gamePoss = ! gamePoss ; } else resetForOT ( ) ; } gameTime -= 20 ; }
attempt a field goal using the offense ' s kicker . if successful , add 3 points and kick off . if not , turn the ball over .
