/** * does this unit have stealth armor? * * @return */ public boolean hasStealth() { // only non-patchwork stealth actually works as stealth if (((getArmorType(1) == EquipmentType.T_ARMOR_STEALTH) || (getArmorType(1) == EquipmentType .T_ARMOR_STEALTH_VEHICLE)) && !hasPatchworkArmor()) { return true; } return false; }
public boolean isClanArmor() { return getEntity().isClanArmor(0) && !getEntity().hasPatchworkArmor(); }
/** * The total weight of the armor on this unit. This is guaranteed to be * rounded properly for both single-type and patchwork armor. * * @return The armor weight in tons. */ public double getArmorWeight() { if (!hasPatchworkArmor()) { // this roundabout method is actually necessary to avoid rounding // weirdness. Yeah, it's dumb. double armorPerTon = 16.0 * EquipmentType.getArmorPointMultiplier( armorType[0], armorTechLevel[0]); double points = getTotalOArmor(); double armorWeight = points / armorPerTon; armorWeight = Math.ceil(armorWeight * 2.0) / 2.0; return armorWeight; } else { double total = 0; for (int loc = 0; loc < locations(); loc++) { total += getArmorWeight(loc); } return Math.ceil(total * 2.0) / 2.0; } }
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; }
if (!entity.hasPatchworkArmor()) { sIntArm.append(Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity.getArmorType(1))
.append(maxArmor); if (!isInf && !isProto && !entity.hasPatchworkArmor()) { sIntArm.append(Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity.getArmorType(1))
public String printWeightArmor() { if (!getEntity().hasPatchworkArmor()) { return StringUtil.makeLength( "Armor: " + Integer.toString(getTotalOArmor()) + " " + armor[0].getShortName(), getPrintSize() - 5) + TestEntity.makeWeightString(getWeightArmor()) + "\n"; } else { return StringUtil.makeLength( "Armor: " + Integer.toString(getTotalOArmor()) + " " + "Patchwork", getPrintSize() - 5) + TestEntity.makeWeightString(getWeightArmor()) + "\n"; } }
if (!entity.hasPatchworkArmor() && entity.hasBARArmor(1)) { sBasic.append(Messages.getString("MechView.BARRating")); //$NON-NLS-1$ sBasic.append(entity.getBARRating(0));
if (!hasPatchworkArmor()) { switch (getArmorType(0)) { case EquipmentType.T_ARMOR_COMMERCIAL:
public boolean checkMiscSpreadAllocation(Entity entity, Mounted mounted, StringBuffer buff) { MiscType mt = (MiscType) mounted.getType(); if (mt.hasFlag(MiscType.F_STEALTH) && !entity.hasPatchworkArmor()) {
armor += Messages.getString("MechView.CapitalArmor"); if (!entity.hasPatchworkArmor()) { armor += Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity.getArmorType(1)) entity.getOArmor(loc), html); if (entity.hasPatchworkArmor()) { row[2] = Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity
if (!entity.hasPatchworkArmor() && entity.hasBARArmor(1)) { sBasic.add(new LabeledElement(Messages.getString("MechView.BARRating"), //$NON-NLS-1$ String.valueOf(entity.getBARRating(0))));
if (!getEntity().hasPatchworkArmor()) { armors = Collections.singleton(EquipmentType.getArmorTypeName(getEntity().getArmorType(1), TechConstants.isClan(getEntity().getArmorTechLevel(1))));
if (!getEntity().hasPatchworkArmor()) { armors = Collections.singleton(EquipmentType.getArmorTypeName(getEntity().getArmorType(1), TechConstants.isClan(getEntity().getArmorTechLevel(1))));
armor += "/" + maxArmor;//$NON-NLS-1$ if (!isInf && !isProto && !entity.hasPatchworkArmor()) { armor += Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity.getArmorType(1)) entity.getOArmor(loc), html); if (entity.hasPatchworkArmor()) { row[3] = Messages.getString("MechView." + EquipmentType.getArmorTypeName(entity
public double getWeightAllocatedArmor() { if (!getEntity().hasPatchworkArmor()) { return (armor[0].getWeightArmor(getTotalOArmor(), getWeightCeilingArmor())); } else { double armorWeight = 0; for (int i = 0; i < armor.length; i++) { int points = getEntity().getOArmor(i); if (getEntity().hasRearArmor(i) && (getEntity().getOArmor(i, true) > 0)) { points += getEntity().getOArmor(i, true); } armorWeight += armor[i].getRawWeightArmor(points); } return TestEntity.ceilMaxHalf(armorWeight, getWeightCeilingArmor()); } }
if (entity.isClanArmor(1) && !entity.hasPatchworkArmor()) { if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) { return 4; } else if (entity.hasPatchworkArmor()) { int slots = 0; for (int i = 0; i < entity.locations(); i++) { if (entity.isClanArmor(1) && !entity.hasPatchworkArmor()) { if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) { return 3; } else if (entity.hasPatchworkArmor()) { int slots = 0; for (int i = 0; i < entity.locations(); i++) { if (!entity.hasPatchworkArmor()) { if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) { return 4; if (!entity.hasPatchworkArmor()) { if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) { return 11; if (!entity.hasPatchworkArmor()) { if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) { return 6; if (!entity.hasPatchworkArmor()) {
/** * Incorporate dates for components that are not in the equipment list, such as engines and structure. */ protected void addSystemTechAdvancement(CompositeTechLevel ctl) { if (hasEngine()) { ctl.addComponent(getEngine()); } if (isOmni()) { ctl.addComponent(TA_OMNI); } if (hasPatchworkArmor()) { ctl.addComponent(TA_PATCHWORK_ARMOR); for (int loc = 0; loc < locations(); loc++) { ctl.addComponent(EquipmentType.getArmorTechAdvancement(armorType[loc], TechConstants.isClan(armorTechLevel[loc]))); } } else { ctl.addComponent(EquipmentType.getArmorTechAdvancement(armorType[0], TechConstants.isClan(armorTechLevel[0]))); } if (isMixedTech()) { ctl.addComponent(TA_MIXED_TECH); } ctl.addComponent(EquipmentType.getStructureTechAdvancement(structureType, TechConstants.isClan(structureTechLevel))); }
if (!t.hasPatchworkArmor() && (t.getArmorType(1) != 0)) { blk.writeBlockData("armor_type", t.getArmorType(1)); blk.writeBlockData("armor_tech", t.getArmorTechLevel(1)); } else if (t.hasPatchworkArmor()) { blk.writeBlockData("armor_type", EquipmentType.T_ARMOR_PATCHWORK); if (!t.hasPatchworkArmor() && t.hasBARArmor(1)) { blk.writeBlockData("barrating", t.getBARRating(1));
&& !getEntity(entNum).hasPatchworkArmor()) { for (Mounted test_equip : getEntity(entNum).getMisc()) { MiscType test_type = (MiscType) test_equip.getType();