@Override protected int calcDamagePerHit() { int damage = 0; if (ae instanceof BattleArmor) { BattleArmor ba = (BattleArmor) ae; damage = ba.calculateSwarmDamage(); } // should this be affected by direct blows? // assume so for now if (bDirect) { damage = Math.min(damage + (toHit.getMoS() / 3), damage * 2); } return damage; }
@Override protected int calcDamagePerHit() { if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { int damage; int numDice = 1; if (bDirect) { numDice += (toHit.getMoS() / 3); } damage = Compute.d6(numDice); if (bGlancing) { damage /= 2; } // Burst fire damage rounds up return (int) Math.ceil(damage); } return 1; }
@Override protected int calcDamagePerHit() { if ((target instanceof Mech) || (target instanceof Aero)) { return 0; } int toReturn = 1; if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { toReturn = Compute.d6(3); // pain shunted infantry get half damage if (bDirect) { toReturn += toHit.getMoS() / 3; } if (((Entity) target).hasAbility(OptionsConstants.MD_PAIN_SHUNT)) { toReturn = Math.max(toReturn / 2, 1); } } else if (bDirect) { toReturn = Math.min(toReturn + (toHit.getMoS() / 3), toReturn * 2); } if (bGlancing) { toReturn = (int) Math.floor(toReturn / 2.0); } return toReturn; }
/** * Calculate the attack value based on range * * @return an <code>int</code> representing the attack value at that range. */ @Override protected int calcAttackValue() { int[] payload = waa.getBombPayload(); if (null == payload) { return 0; } int nbombs = 0; for (int i = 0; i < payload.length; i++) { nbombs += payload[i]; } if (bDirect) { nbombs = Math.min(nbombs + (toHit.getMoS() / 3), nbombs * 2); } if (bGlancing) { nbombs = (int) Math.floor(nbombs / 2.0); } return nbombs; }
protected int calcAttackValue() { int av = 0; //Sigh, another rules oversight - nobody bothered to figure this out //To be consistent with other cluster weapons we will assume 60% hit double damage = ((InfantryWeapon)wtype).getInfantryDamage(); if((ae instanceof Infantry) && !(ae instanceof BattleArmor)) { damage = ((Infantry)ae).getDamagePerTrooper(); av = (int) Math.round(damage * 0.6 * ((Infantry)ae).getShootingStrength()); } if(bDirect) { av = Math.min(av+(toHit.getMoS()/3), av*2); } if(bGlancing) { av = (int) Math.floor(av / 2.0); } return av; }
/** * Calculate the attack value based on range * * @return an <code>int</code> representing the attack value at that range. */ @Override protected int calcAttackValue() { int av = super.calcAttackValue(); if (usesClusterTable()) { // basically 60% of normal return (int) Math.floor(0.6 * av); } 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() { 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; }
/** * 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() { 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() * 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() { 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(), 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 = 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() { 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; }
@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; }