/** * does this Entity have BAR armor? * * @return */ public boolean hasBARArmor(int loc) { return getBARRating(loc) < 10; }
protected String formatArmorType(Entity entity, boolean trim) { if (entity.hasETypeFlag(Entity.ETYPE_SUPPORT_TANK) || entity.hasETypeFlag(Entity.ETYPE_SUPPORT_VTOL) || entity.hasETypeFlag(Entity.ETYPE_FIXED_WING_SUPPORT)) { return "BAR " + entity.getBARRating(Tank.LOC_FRONT); } if (entity.hasPatchworkArmor()) { return EquipmentType.getArmorTypeName(EquipmentType.T_ARMOR_PATCHWORK); } // Some types do not have armor on the first location, and others have only a // single location final int at = entity.getArmorType(Math.min(1, entity.locations() - 1)); if (trim && (at == EquipmentType.T_ARMOR_STANDARD)) { return ""; } String name = EquipmentType.getArmorTypeName(at); if (trim) { name = name.replace("-Fibrous", "").replace("-Aluminum", ""); if (at == EquipmentType.T_ARMOR_EDP) { name = "EDP"; } } return name; }
sBasic.append(entity.getBARRating(0)); sBasic.append("\n"); //$NON-NLS-1$
case EquipmentType.T_ARMOR_INDUSTRIAL: case EquipmentType.T_ARMOR_HEAVY_INDUSTRIAL: armorMod = getBARRating(0) / 10; break; case EquipmentType.T_ARMOR_FERRO_LAMELLOR:
@Override public double getWeightArmor() { int totalArmorPoints = 0; for (int loc = 0; loc < getEntity().locations(); loc++) { totalArmorPoints += getEntity().getOArmor(loc); } int bar = getEntity().getBARRating(Tank.LOC_BODY); int techRating = getEntity().getArmorTechRating(); double weight = totalArmorPoints * SV_ARMOR_WEIGHT[bar][techRating]; if (getEntity().getWeight() < 5) { return TestEntity.floor(weight, Ceil.KILO); } else { return TestEntity.ceil(weight, Ceil.HALFTON); } }
&& !(te instanceof Infantry) && (!te.hasBARArmor(hit.getLocation()) || (te .getBARRating(hit.getLocation()) >= 8))) { toReturn = Math.max(0, toReturn - 3);
if (entity.hasBARArmor(loc)) { row[2] += Messages.getString("MechView.BARRating") //$NON-NLS-1$ + entity.getBARRating(loc);
String.valueOf(entity.getBARRating(0))));
r.indent(2); dmgReports.add(r); } else if (entTarget.getBARRating(hit.getLocation()) < 5) { int dmg = 5 - entTarget.getBARRating(hit.getLocation()); dmgReports = server.damageEntity(entTarget, hit, dmg); } else {
if (entity.hasBARArmor(loc)) { row[3] += " " + Messages.getString("MechView.BARRating") //$NON-NLS-1$ + entity.getBARRating(loc);
toHit.getSideTable(), waa.getAimedLocation(), waa.getAimingMode(), toHit.getCover()); if (target.getBARRating(hit.getLocation()) <= 6) { hit.setGeneralDamageType(generalDamageType); hit.setCapital(wtype.isCapital());
blk.writeBlockData("barrating", t.getBARRating(1));