public double getArmorPointsPerTon() { //if(null != unit) { // armor is checked for in 5-ton increments //int armorType = unit.getEntity().getArmorType(location); double armorPerTon = 16.0 * EquipmentType.getArmorPointMultiplier(type, clan); if (type == EquipmentType.T_ARMOR_HARDENED) { armorPerTon = 8.0; } return armorPerTon; //} //return 0.0; }
public static double getArmorPointMultiplier(int inArmor, int inTechLevel) { return EquipmentType .getArmorPointMultiplier( inArmor, ((inTechLevel == TechConstants.T_CLAN_TW) || (inTechLevel == TechConstants.T_CLAN_ADVANCED)) || (inTechLevel == TechConstants.T_CLAN_EXPERIMENTAL) || (inTechLevel == TechConstants.T_CLAN_UNOFFICIAL)); }
public static double getArmorPointMultiplier(int inArmor) { return EquipmentType.getArmorPointMultiplier(inArmor, TechConstants.T_IS_TW_NON_BOX); }
public static double getRawWeightArmor(int armorType, int armorFlags, int totalOArmor) { double points = totalOArmor; int techLevel; if ((armorFlags & CLAN_ARMOR) != 0) { techLevel = TechConstants.T_CLAN_TW; } else { techLevel = TechConstants.T_IS_TW_NON_BOX; } double multiplier = EquipmentType.getArmorPointMultiplier(armorType, techLevel); points /= multiplier; double pointsPerTon = 16.0f; return points / pointsPerTon; }
public int getLabTotalArmorPoints() { double armorPerTon = 16.0 * EquipmentType.getArmorPointMultiplier( armorType[0], armorTechLevel[0]); return (int) Math.floor(armorPerTon * armorTonnage); }
return base * EquipmentType.getArmorPointMultiplier(at, isClan);
public double getTonnageNeeded() { double armorPerTon = 16.0 * EquipmentType.getArmorPointMultiplier(type, isClanTechBase()); if (type == EquipmentType.T_ARMOR_HARDENED) { armorPerTon = 8.0; } return amountNeeded / armorPerTon; }
public double getArmorWeight(int points) { // from megamek.common.Entity.getArmorWeight() // this roundabout method is actually necessary to avoid rounding // weirdness. Yeah, it's dumb. double armorPointMultiplier = EquipmentType.getArmorPointMultiplier(getType(), isClanTechBase()); double armorPerTon = 16.0 * armorPointMultiplier; if (getType() == EquipmentType.T_ARMOR_HARDENED) { armorPerTon = 8.0; } double armorWeight = points / armorPerTon; armorWeight = Math.ceil(armorWeight * 2.0) / 2.0; return armorWeight; }
/** * 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; } }
/** * 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; }
parts.add(new BaArmor(0, amount, at, -1, false, c)); } else { amount = (int)(5.0 * 16.0 * EquipmentType.getArmorPointMultiplier(at, false)); parts.add(new Armor(0, at, amount, -1, false, false, c)); parts.add(new BaArmor(0, amount, at, -1, true, c)); } else { amount = (int)(5.0 * 16.0 * EquipmentType.getArmorPointMultiplier(at, true)); parts.add(new Armor(0, at, amount, -1, false, true, c));