private void kickXP(Team offense,Team defense){
  if (playingOT && bottomOT && (((numOT % 2 == 0) && awayScore > homeScore) || ((numOT % 2 != 0) && homeScore > awayScore))) {
    gameEventLog+=getEventPrefix() + " " + tdInfo+ "\n"+ offense.abbr+ " wins on a walk-off touchdown!";
  }
 else   if (!playingOT && gameTime <= 0 && ((homeScore - awayScore > 2) || (awayScore - homeScore > 2))) {
    if ((Math.abs(homeScore - awayScore) < 7) && ((gamePoss && homeScore > awayScore) || (!gamePoss && awayScore > homeScore)))     gameEventLog+=getEventPrefix() + " " + tdInfo+ "\n"+ offense.abbr+ " wins on a walk-off touchdown!";
 else     gameEventLog+=getEventPrefix() + " " + tdInfo;
  }
 else {
    if ((numOT >= 3) || (((gamePoss && (awayScore - homeScore) == 2) || (!gamePoss && (homeScore - awayScore) == 2)) && gameTime < 300)) {
      boolean successConversion=false;
      if (Math.random() <= 0.50) {
        int blockAdv=offense.getCompositeOLRush() - defense.getCompositeF7Rush();
        int yardsGain=(int)((offense.getRB(0).ratRushSpd + blockAdv) * Math.random() / 6);
        if (yardsGain > 5) {
          successConversion=true;
          if (gamePoss) {
            homeScore+=2;
          }
 else {
            awayScore+=2;
          }
          addPointsQuarter(2);
          gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getRB(0).name+ " rushed for the 2pt conversion.";
        }
 else {
          gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getRB(0).name+ " stopped at the line of scrimmage, failed the 2pt conversion.";
        }
      }
 else {
        int pressureOnQB=defense.getCompositeF7Pass() * 2 - offense.getCompositeOLPass();
        double completion=(normalize(offense.getQB(0).ratPassAcc) + offense.getWR(0).ratRecCat - defense.getCB(0).ratCBCov) / 2 + 25 - pressureOnQB / 20;
        if (100 * Math.random() < completion) {
          successConversion=true;
          if (gamePoss) {
            homeScore+=2;
          }
 else {
            awayScore+=2;
          }
          addPointsQuarter(2);
          gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getQB(0).name+ " completed the pass to "+ offense.getWR(0).name+ " for the 2pt conversion.";
        }
 else {
          gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getQB(0).name+ "'s pass incomplete to "+ offense.getWR(0).name+ " for the failed 2pt conversion.";
        }
      }
    }
 else {
      if (Math.random() * 100 < 23 + offense.getK(0).ratKickAcc && Math.random() > 0.01) {
        if (gamePoss) {
          homeScore+=1;
          HomeKStats[0]++;
          HomeKStats[1]++;
        }
 else {
          awayScore+=1;
          AwayKStats[0]++;
          AwayKStats[1]++;
        }
        gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getK(0).name+ " made the XP.";
        addPointsQuarter(1);
        offense.getK(0).statsXPMade++;
      }
 else {
        gameEventLog+=getEventPrefix() + " " + tdInfo+ " "+ offense.getK(0).name+ " missed the XP.";
        if (gamePoss) {
          HomeKStats[1]++;
        }
 else {
          AwayKStats[1]++;
        }
      }
      offense.getK(0).statsXPAtt++;
    }
  }
}

private void kickXP ( Team offense , Team defense ) { if ( playingOT && bottomOT && ( ( ( numOT % 2 == 0 ) && awayScore > homeScore ) || ( ( numOT % 2 != 0 ) && homeScore > awayScore ) ) ) { gameEventLog += getEventPrefix ( ) + " " + tdInfo + "\n" + offense . abbr + " wins on a walk-off touchdown!" ; } else if ( ! playingOT && gameTime <= 0 && ( ( homeScore - awayScore > 2 ) || ( awayScore - homeScore > 2 ) ) ) { if ( ( Math . abs ( homeScore - awayScore ) < 7 ) && ( ( gamePoss && homeScore > awayScore ) || ( ! gamePoss && awayScore > homeScore ) ) ) gameEventLog += getEventPrefix ( ) + " " + tdInfo + "\n" + offense . abbr + " wins on a walk-off touchdown!" ; else gameEventLog += getEventPrefix ( ) + " " + tdInfo ; } else { if ( ( numOT >= 3 ) || ( ( ( gamePoss && ( awayScore - homeScore ) == 2 ) || ( ! gamePoss && ( homeScore - awayScore ) == 2 ) ) && gameTime < 300 ) ) { boolean successConversion = false ; if ( Math . random ( ) <= 0.50 ) { int blockAdv = offense . getCompositeOLRush ( ) - defense . getCompositeF7Rush ( ) ; int yardsGain = ( int ) ( ( offense . getRB ( 0 ) . ratRushSpd + blockAdv ) * Math . random ( ) / 6 ) ; if ( yardsGain > 5 ) { successConversion = true ; if ( gamePoss ) { homeScore += 2 ; } else { awayScore += 2 ; } addPointsQuarter ( 2 ) ; gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getRB ( 0 ) . name + " rushed for the 2pt conversion." ; } else { gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getRB ( 0 ) . name + " stopped at the line of scrimmage, failed the 2pt conversion." ; } } else { int pressureOnQB = defense . getCompositeF7Pass ( ) * 2 - offense . getCompositeOLPass ( ) ; double completion = ( normalize ( offense . getQB ( 0 ) . ratPassAcc ) + offense . getWR ( 0 ) . ratRecCat - defense . getCB ( 0 ) . ratCBCov ) / 2 + 25 - pressureOnQB / 20 ; if ( 100 * Math . random ( ) < completion ) { successConversion = true ; if ( gamePoss ) { homeScore += 2 ; } else { awayScore += 2 ; } addPointsQuarter ( 2 ) ; gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getQB ( 0 ) . name + " completed the pass to " + offense . getWR ( 0 ) . name + " for the 2pt conversion." ; } else { gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getQB ( 0 ) . name + "'s pass incomplete to " + offense . getWR ( 0 ) . name + " for the failed 2pt conversion." ; } } } else { if ( Math . random ( ) * 100 < 23 + offense . getK ( 0 ) . ratKickAcc && Math . random ( ) > 0.01 ) { if ( gamePoss ) { homeScore += 1 ; HomeKStats [ 0 ] ++ ; HomeKStats [ 1 ] ++ ; } else { awayScore += 1 ; AwayKStats [ 0 ] ++ ; AwayKStats [ 1 ] ++ ; } gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getK ( 0 ) . name + " made the XP." ; addPointsQuarter ( 1 ) ; offense . getK ( 0 ) . statsXPMade ++ ; } else { gameEventLog += getEventPrefix ( ) + " " + tdInfo + " " + offense . getK ( 0 ) . name + " missed the XP." ; if ( gamePoss ) { HomeKStats [ 1 ] ++ ; } else { AwayKStats [ 1 ] ++ ; } } offense . getK ( 0 ) . statsXPAtt ++ ; } } }
kick the extra point after the touchdown . will decide to go for 2 under certain circumstances .
