@Override public int getBattleForceArmorPoints() { double armor = 0; for (int i = 1; i < locations(); i++) { if (armorType[i] == EquipmentType.T_ARMOR_BA_REACTIVE || armorType[i] == EquipmentType.T_ARMOR_BA_REFLECTIVE) { armor += getArmor(i) * 0.75; } else { armor += getArmor(i); } } return (int)Math.round(armor / 30.0); }
private static String formatArmorBattleArmor(BattleArmor b) { StringBuffer sb = new StringBuffer(32); for (int i = 1; i < b.locations(); i++) { sb.append("Trooper ").append(i).append(": ") .append(renderArmor(b.getArmor(i))).append(" / ") .append(renderArmor(b.getInternal(i))); sb.append(CommonConstants.NL); } return sb.toString(); }
/** * Returns the value of the armor in the indicated location. Conventional * infantry and battle armor behave differently than other units. Armor is * in integer units. */ protected int getArmorValue(int loc, boolean rear) { int result = entity.getArmor(loc, rear); // Conventional infantry don't have armor (yet), so use the number of // troopers // TODO: This will probably need some revamping when Total Warfare is // released. if ((entity instanceof Infantry) & !(entity instanceof BattleArmor)) { result = ((Infantry) entity).getShootingStrength(); } // Battle armor has armor per trooper; treat each trooper as a // "location" if (entity instanceof BattleArmor) { result = ((BattleArmor) entity).getArmor(loc, false); } if (result <= 0) { result = 0; } return result; }
Mockito.when(mockBA.getArmor(Mockito.anyInt())).thenReturn(5); Mockito.when(mockBA.getCrew()).thenReturn(mockCrew); Mockito.when(mockBA.getHeatCapacity()).thenReturn(999);
blk.writeBlockData("armor", new int[] { ba.getArmor(1) }); blk.writeBlockData("Trooper Count", (int) t.getWeight()); blk.writeBlockData("weightclass", ba.getWeightClass());
armorBV = 3.5; dBV += (getArmor(i) * armorBV) + 1;