@Override public void autoSetInternal() { // should be no internals because only one SI // It doesn't seem to be screwing anything up yet. // Need to figure out how destruction of entity is determined int nInternal = (int) Math.ceil(weight / 10.0); nInternal = 0; // I need to look at safe thrust as well at some point for (int x = 0; x < locations(); x++) { initializeInternal(nInternal, x); } }
public void autoSetThresh() { for (int x = 0; x < locations(); x++) { initializeThresh(x); } }
/** * check to see if case is available anywhere * * @return */ @Override public boolean hasCase() { boolean hasCase = false; for (int x = 0; x < locations(); x++) { if (!hasCase) { hasCase = locationHasCase(x); } } return hasCase; }
/** * Checks to see if this unit has valid armor assignment. * * @param buff * @return */ public boolean correctArmor(StringBuffer buff) { boolean correct = true; int maxArmorPoints = maxArmorPoints(aero,aero.getWeight()); int armorTotal = 0; for (int loc = 0; loc < aero.locations(); loc++) { if (aero.getOArmor(loc) > maxArmorPoints) { buff.append(printArmorLocation(loc)) .append(printArmorLocProp(loc, maxArmorPoints)).append("\n"); correct = false; } armorTotal += aero.getOArmor(loc); } if (armorTotal > maxArmorPoints){ buff.append("Total armor," + armorTotal + ", is greater than the maximum: " + maxArmorPoints + "\n"); correct = false; } return correct ; }
/** * Adds clan CASE in every location */ public void addClanCase() { boolean explosiveFound = false; EquipmentType clCase = EquipmentType.get("CLCASE"); for (int i = 0; i < locations(); i++) { // Ignore wings location: it's not a valid loc to put equipment in if (i == LOC_WINGS) { continue; } explosiveFound = false; for (Mounted m : getEquipment()) { if (m.getType().isExplosive(m) && (m.getLocation() == i)) { explosiveFound = true; } } if (explosiveFound) { try { addEquipment(new Mounted(this, clCase), i, false); } catch (LocationFullException ex) { // um, that's impossible. } } } }
int numWeapons[] = new int[aero.locations()]; int numBombs = 0;
for (int loc = 0; loc < locations(); loc++) { cost += getArmorWeight(loc) * EquipmentType.getArmorCost(armorType[loc]);
int a = 1; int a0 = 1; for(int i = 0; i < t.locations(); i++){ a = t.getArmor(i); a0 = t.getOArmor(i);
int a0 = 1; for (int i = 0; i < t.locations(); i++) { if (i == Aero.LOC_FUSELAGE) { continue;
for (int i = 0; i < (a.locations() - 1); i++) { a.setArmorType(dataFile.getDataAsInt(a.getLocationName(i) + "_armor_type")[0], i); a.setArmorTechLevel(dataFile.getDataAsInt(a.getLocationName(i) + "_armor_type")[0], i); for (int loc = 0; loc < a.locations(); loc++) { loadEquipment(a, a.getLocationName(loc), loc);