if (!entity.hasRearArmor(loc)) { warning.append("The entity, ") .append(entity.getShortName())
/** * Prior to TacOps errata 3.3, armor was rounded up to the nearest half ton * As of TacOps errata 3.3, patchwork armor is not rounded by location. Previous editions * of the rules required it to be rounded up to the nearest half ton by location. * Note: * Unless overridden, this should <em>only</em> be called on units with * patchwork armor, as rounding behavior is not guaranteed to be correct or * even the same for others and units with a single overall armor type have * no real reason to specifically care about weight per location anyway. * * @param loc The code value for the location in question (unit * type-specific). * @return The weight of the armor in the location in tons. */ public double getArmorWeight(int loc) { double armorPerTon = 16.0 * EquipmentType.getArmorPointMultiplier( armorType[loc], armorTechLevel[loc]); double points = getOArmor(loc) + (hasRearArmor(loc) ? getOArmor(loc, true) : 0); return points / armorPerTon; }
gridBagConstraints.gridx = 2; panArmor.add(spnArmor[i], gridBagConstraints); if (entity.hasRearArmor(i)) { int rear = Math.max(entity.getArmor(i, true), 0); spnRear[i] = new JSpinner(new SpinnerNumberModel(rear, 0,
/** * Returns the abbreviated name of the location specified. */ public String getLocationAbbr(HitData hit) { return getLocationAbbr(hit.getLocation()) + (hit.isRear() && hasRearArmor(hit.getLocation()) ? "R" : "") + (((hit.getEffect() & HitData.EFFECT_CRITICAL) == HitData.EFFECT_CRITICAL) ? " (critical)" : ""); }
/** * Returns the total amount of armor on the entity. */ public int getTotalOArmor() { int totalArmor = 0; for (int i = 0; i < locations(); i++) { if (getOArmor(i) > 0) { totalArmor += getOArmor(i); } if (hasRearArmor(i) && (getOArmor(i, true) > 0)) { totalArmor += getOArmor(i, true); } } return totalArmor; }
/** * Returns the total amount of armor on the entity. */ public int getTotalArmor() { int totalArmor = 0; for (int i = 0; i < locations(); i++) { if (getArmor(i) > 0) { totalArmor += getArmor(i); } if (hasRearArmor(i) && (getArmor(i, true) > 0)) { totalArmor += getArmor(i, true); } } return totalArmor; }
if (entity.hasRearArmor(loc)) { sIntArm.append(String.format("%1$-20s %2$8s %3$8d\n", entity.getLocationName(loc) + " (rear)", "",
if(specDamage.rear && damagePlan.entity.hasRearArmor(specDamage.loc)) { if(damagePlan.entity.getOArmor(specDamage.loc, true) > specDamage.setArmorTo) { System.out.println(String.format("\tSet armor value for (rear %s) to %d", //$NON-NLS-1$
thisLoc.append(CommonConstants.NL); if (entity.hasRearArmor(loc) && (entity.getOArmor(loc, true) != entity .getArmorForReal(loc, true))) {
/** * Marks all equipment in a location on an <code>Entity<code> as destroyed. * * @param en * - the <code>Entity</code> whose location is destroyed. * @param loc * - the <code>int</code> index of the destroyed location. */ private void destroyLocation(Entity en, int loc) { // mark armor, internal as destroyed en.setArmor(IArmorState.ARMOR_DESTROYED, loc, false); en.setInternal(IArmorState.ARMOR_DESTROYED, loc); if (en.hasRearArmor(loc)) { en.setArmor(IArmorState.ARMOR_DESTROYED, loc, true); } // equipment marked missing for (Mounted mounted : en.getEquipment()) { if (mounted.getLocation() == loc) { mounted.setDestroyed(true); } } // all critical slots set as missing for (int i = 0; i < en.getNumberOfCriticals(loc); i++) { final CriticalSlot cs = en.getCritical(loc, i); if (cs != null) { cs.setDestroyed(true); } } }
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.hasRearArmor(loc)) { row = new String[] { entity.getLocationName(loc) + " (rear)", "", renderArmor(entity.getArmorForReal(loc, true),
public String printArmorLocation(int loc) { if (getEntity().hasRearArmor(loc)) { return StringUtil.makeLength( getEntity().getLocationAbbr(loc) + ":", 5) + StringUtil.makeLength(getEntity().getOInternal(loc), 4) + StringUtil.makeLength(getEntity().getOArmor(loc), 3) + " / " + StringUtil .makeLength(getEntity().getOArmor(loc, true), 2); } return StringUtil.makeLength(getEntity().getLocationAbbr(loc) + ":", 5) + StringUtil.makeLength(getEntity().getOInternal(loc), 4) + StringUtil.makeLength(getEntity().getOArmor(loc), 6) + " "; }
if (entity.hasRearArmor(loc)) { addToTT("ArmorMiniPanelPartRear", BR, entity.getLocationAbbr(loc), fontSize); for (int a = 0; a <= (entity.getOArmor(loc, true)/visUnit); a++) {
|| (unit.getEntity().hasRearArmor(loc) && unit.getEntity().getArmor(loc, true) > 0 )) { return "You must first remove the armor from this location before you scrap it";
|| (unit.getEntity().hasRearArmor(loc) && unit.getEntity().getArmor(loc, true) > 0 )) { return "You must first remove the armor from this location before you scrap it";
|| (unit.getEntity().hasRearArmor(loc) && unit.getEntity().getArmorForReal(loc, true) > 0 )) { return "must salvage armor in this location first";
if (hasRearArmor(loc)) { setArmor(IArmorState.ARMOR_DOOMED, loc, true);
if (entity.hasRearArmor(i) && (null != spnRear[i])) { int rear = (Integer) spnRear[i].getModel().getValue(); if (rear <= 0) {
|| (unit.getEntity().hasRearArmor(loc) && unit.getEntity().getArmorForReal(loc, true) > 0 )) { return "must salvage armor in this location first";