public boolean canMakeAntiMekAttacks() { return !isMechanized(); }
/** * Calculate the damage per hit. * * @return an <code>int</code> representing the damage dealt per hit. */ @Override protected int calcDamagePerHit() { double toReturn = 0; // we default to direct fire weapons for anti-infantry damage if (target instanceof Infantry && !(target instanceof BattleArmor)) { toReturn = Compute.d6(); if (((Infantry) target).isMechanized()) { toReturn /= 3; } else { toReturn /= 2; } toReturn = Math.max(1, toReturn); } else if (target instanceof BattleArmor) { toReturn = 1; } return (int) toReturn; } }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getDamage(), bDirect ? toHit.getMoS() / 3 : 0, WeaponType.WEAPON_CLUSTER_BALLISTIC, ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 1; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 1; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize() * 2, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 1; }
@Override protected int calcDamagePerHit() { if (target instanceof Infantry && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize() * 2, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 2; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 2; }
@Override protected int calcDamagePerHit() { AmmoType atype = (AmmoType) ammo.getType(); double toReturn; if (atype.getAmmoType() == AmmoType.T_INARC) { toReturn = 6; } else { toReturn = 4; } if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { toReturn = Compute.directBlowInfantryDamage(toReturn, bDirect ? toHit.getMoS() / 3 : 0, WeaponType.WEAPON_DIRECT_FIRE, ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); toReturn = Math.ceil(toReturn); } if (bGlancing) { return (int) Math.floor(toReturn / 2.0); } return (int) toReturn; } }
@Override protected int calcDamagePerHit() { if (target instanceof Infantry && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize() * 3, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 3; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 2; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { double toReturn = wtype.getRackSize(); toReturn = Compute.directBlowInfantryDamage( toReturn, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } toReturn = Math.ceil(toReturn); return (int) toReturn; } return 1; }
@Override protected int calcDamagePerHit() { if (target instanceof Infantry && !(target instanceof BattleArmor)) { int toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); return toReturn; } return 1; }
public AlphaStrikeElement(Entity en) { super(en); asUnitType = ASUnitType.getUnitType(en); if (en.getEntityType() == Entity.ETYPE_INFANTRY) { double divisor = ((Infantry)en).getDamageDivisor(); if (((Infantry)en).isMechanized()) { divisor /= 2.0; } armor *= divisor; } //Armored Glove counts as an additional AP mounted weapon if (en instanceof BattleArmor && en.hasWorkingMisc(MiscType.F_ARMORED_GLOVE)) { double apDamage = AP_MOUNT_DAMAGE * (TROOP_FACTOR[Math.min(((BattleArmor)en).getShootingStrength(), 30)] + 0.5); weaponLocations[0].addDamage(0, apDamage); weaponLocations[0].addDamage(WeaponType.BFCLASS_STANDARD, 0, apDamage); } }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { int toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize() * 2, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); return toReturn; } return 2; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { int missiles = waa.isSwarmingMissiles() ? waa.getSwarmMissiles() : wtype.getRackSize(); double toReturn = Compute.directBlowInfantryDamage( missiles, bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } return (int) Math.floor(toReturn); } return 1; }
@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); } }
@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); }
@Override protected int calcDamagePerHit() { double toReturn; AmmoType atype = (AmmoType) ammo.getType(); if (atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE) { sSalvoType = " high-explosive missile(s) "; toReturn = 3; } else if (atype.getMunitionType() == AmmoType.M_EXTENDED_RANGE) { sSalvoType = " extended-range missile(s) "; toReturn = 1; } else { toReturn = 2; } if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { toReturn = Compute.directBlowInfantryDamage( wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) { toReturn /= 2; } } return (int) toReturn; }
@Override public boolean doomedInExtremeTemp() { if (getArmorKit() != null) { if (getArmorKit().hasSubType(MiscType.S_XCT_VACUUM)) { return false; } else if (getArmorKit().hasSubType(MiscType.S_COLD_WEATHER) && (game.getPlanetaryConditions().getTemperature() < -30)) { return false; } else if (getArmorKit().hasSubType(MiscType.S_HOT_WEATHER) && (game.getPlanetaryConditions().getTemperature() > 50)) { return false; } else { return true; } } if (hasSpaceSuit() || isMechanized()) { return false; } return true; }
wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0, wtype.getInfantryDamageClass(), ((Infantry) target).isMechanized(), toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport); if (bGlancing) {