@Override protected int calcDamagePerHit() { if ((target instanceof Mech) || (target instanceof Aero)) { int toReturn = 10; if (bGlancing) { toReturn = (int) Math.floor(toReturn / 2.0); } if (game.getOptions().booleanOption( OptionsConstants.ADVCOMBAT_TACOPS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG])) { toReturn -= 1; } if (game.getOptions().booleanOption( OptionsConstants.ADVCOMBAT_TACOPS_LOS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { toReturn = (int) Math.floor(toReturn / 2.0); } return toReturn; } return 1; }
/** * Calculate the damage per hit. * * @return an <code>int</code> representing the damage dealt per hit. */ @Override protected int calcDamagePerHit() { double toReturn = wtype.getDamage(); if (bDirect) { toReturn += toHit.getMoS() / 3; } else if (bGlancing) { toReturn = (int) Math.floor(toReturn / 2.0); } if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG])) { toReturn = (int) Math.floor(toReturn * .75); } if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_LOS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { toReturn = (int) Math.floor(toReturn * .5); } return (int) Math.ceil(toReturn); }
@Override protected int calcDamagePerHit() { double toReturn = wtype.getDamage(nRange); if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE) && nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG]) { toReturn -= 1; } if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_LOS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { toReturn = (int) Math.floor(toReturn * .75); } if (target instanceof Infantry && !(target instanceof BattleArmor)) { toReturn = Compute.directBlowInfantryDamage( toReturn, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); } else if (bDirect) { toReturn = Math.min(toReturn + (toHit.getMoS() / 3), toReturn * 2); } if (bGlancing) { toReturn = (int) Math.floor(toReturn / 2.0); } return (int) Math.ceil(toReturn); } }
/** * Calculates the maximum damage a unit can do at a given range. Chance to hit is not a factor. * * @param shooter The firing unit. * @param range The range to be checked. * @param useExtremeRange Is the extreme range optional rule in effect? * @return The most damage done at that range. */ // todo cluster and other variable damage. double getMaxDamageAtRange(final Entity shooter, final int range, final boolean useExtremeRange, final boolean useLOSRange) { double maxDamage = 0; // cycle through my weapons for (final Mounted weapon : shooter.getWeaponList()) { final WeaponType weaponType = (WeaponType) weapon.getType(); final int bracket = RangeType.rangeBracket(range, weaponType.getRanges(weapon), useExtremeRange, useLOSRange); if ((RangeType.RANGE_OUT != bracket) && (0 < weaponType.getDamage())) { maxDamage += weaponType.getDamage(); } } return maxDamage; }
shotsHit = wtype.getRackSize(); if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG])) { shotsHit = (int) Math.ceil(shotsHit * .75); && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { shotsHit = (int) Math.ceil(shotsHit * .5);
shotsHit = wtype.getRackSize(); if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE) && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG])) { shotsHit = (int) Math.ceil(shotsHit * .75); && (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { shotsHit = (int) Math.ceil(shotsHit * .5);
@Override protected int calcDamagePerHit() { int[] nRanges = wtype.getRanges(weapon); double toReturn = wtype.getDamage(nRange);
@Override protected int calcDamagePerHit() { int[] nRanges = wtype.getRanges(weapon); double toReturn = wtype.getDamage(nRange);
protected int getClusterModifiers(boolean clusterRangePenalty) { int nMissilesModifier = nSalvoBonus; int[] ranges = wtype.getRanges(weapon); if (clusterRangePenalty && game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_CLUSTERHITPEN)) { if (nRange <= 1) {
final WeaponType weaponType = (WeaponType) weapon.getType(); final int bracket = RangeType.rangeBracket(range, weaponType.getRanges(weapon), useExtremeRange, useLOSRange);