/** * Calculate the attack value based on range * * @return an <code>int</code> representing the attack value at that range. */ @Override protected int calcAttackValue() { calcCounterAV(); int av = 0; int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); if (range == WeaponType.RANGE_SHORT) { av = wtype.getRoundShortAV(); } else if (range == WeaponType.RANGE_MED) { av = wtype.getRoundMedAV(); } else if (range == WeaponType.RANGE_LONG) { av = wtype.getRoundLongAV(); } else if (range == WeaponType.RANGE_EXT) { av = wtype.getRoundExtAV(); } if (bDirect) { av = Math.min(av + (toHit.getMoS() / 3), av * 2); } if (bGlancing) { av = (int) Math.floor(av / 2.0); } av = (int) Math.floor(getBracketingMultiplier() * av); return (av); }
@Override protected int calcDamagePerHit() { AmmoType atype = (AmmoType) ammo.getType(); double toReturn = atype.getDamagePerShot(); int minRange; if (ae.isAirborne()) { minRange = wtype.getATRanges()[RangeType.RANGE_MINIMUM]; } else { minRange = wtype.getMinimumRange(); } if ((nRange <= minRange) && !weapon.isHotLoaded()) { toReturn /= 2; toReturn = Math.floor(toReturn); } 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); } return (int) Math.ceil(toReturn); }
protected int calcAttackValue() { double av = 0; int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false);
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); if (range == WeaponType.RANGE_SHORT) {
int ranges[]; if (entity.isAero()) { ranges = wtype.getATRanges(); } else { ranges = wtype.getRanges(curWp);
protected int calcAttackValue() { int av = 0; int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); AmmoType atype = (AmmoType) ammo.getType(); if (atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE) {
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); if (range == WeaponType.RANGE_SHORT) {
int ranges[]; if (entity.isAero()) { ranges = wtype.getATRanges(); } else { ranges = wtype.getRanges(curWp);
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false);
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false);
int av = 0; int counterAV = 0; int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); if (range == WeaponType.RANGE_SHORT) { av = wtype.getRoundShortAV();
int armor = 0; int weaponarmor = 0; int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false);
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); int hits = 1; int nCluster = 1;
int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false); int hits = 1; int nCluster = 1;
weaponRanges = wtype.getATRanges();