예제 #1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * megamek.common.weapons.WeaponHandler#handleEntityDamage(megamek.common
  * .Entity, java.util.Vector, megamek.common.Building, int, int, int, int)
  */
 @Override
 protected void handleEntityDamage(
     Entity entityTarget,
     Vector<Report> vPhaseReport,
     Building bldg,
     int hits,
     int nCluster,
     int bldgAbsorbs) {
   super.handleEntityDamage(entityTarget, vPhaseReport, bldg, hits, nCluster, bldgAbsorbs);
   if (!missed && ((entityTarget instanceof Mech) || (entityTarget instanceof Aero))) {
     Report r = new Report(3400);
     r.subject = subjectId;
     r.indent(2);
     int extraHeat = 0;
     // if this is a fighter squadron, we need to account for number of
     // weapons
     // should default to one for non squadrons
     for (int i = 0; i < nweaponsHit; i++) {
       extraHeat += Compute.d6();
     }
     if (entityTarget.getArmor(hit) > 0
         && (entityTarget.getArmorType(hit.getLocation()) == EquipmentType.T_ARMOR_REFLECTIVE)) {
       entityTarget.heatFromExternal += Math.max(1, extraHeat / 2);
       r.add(Math.max(1, extraHeat / 2));
       r.choose(true);
       r.messageId = 3406;
       r.add(extraHeat);
       r.add(EquipmentType.armorNames[entityTarget.getArmorType(hit.getLocation())]);
     } else if (entityTarget.getArmor(hit) > 0
         && (entityTarget.getArmorType(hit.getLocation())
             == EquipmentType.T_ARMOR_HEAT_DISSIPATING)) {
       entityTarget.heatFromExternal += extraHeat / 2;
       r.add(extraHeat / 2);
       r.choose(true);
       r.messageId = 3406;
       r.add(extraHeat);
       r.add(EquipmentType.armorNames[entityTarget.getArmorType(hit.getLocation())]);
     } else {
       entityTarget.heatFromExternal += extraHeat;
       r.add(extraHeat);
       r.choose(true);
     }
     vPhaseReport.addElement(r);
   }
 }
예제 #2
0
 @Override
 protected void handleBuildingDamage(
     Vector<Report> vPhaseReport, Building bldg, int nDamage, Coords coords) {
   // Plasma weapons deal double damage to buildings.
   super.handleBuildingDamage(vPhaseReport, bldg, nDamage * 2, coords);
 }