@Override public int getBattleForceStructurePoints() { return (int) Math.ceil(getSI() * 0.50); }
/** * Returns the percent of the SI remaining */ @Override public double getInternalRemainingPercent() { return ((double) getSI() / (double) get0SI()); }
public void doMaintenanceDamage(int d) { int points = ((Aero)unit.getEntity()).getSI(); points = Math.max(points - d, 1); ((Aero)unit.getEntity()).setSI(points); updateConditionFromEntity(false); }
gridBagConstraints); int si = Math.max(aero.getSI(), 0); spnInternal[0] = new JSpinner(new SpinnerNumberModel(si, 0, aero.get0SI(), 1));
@Override public void updateConditionFromEntity(boolean checkForDestruction) { if(null != unit && unit.getEntity() instanceof Aero) { pointsNeeded = ((Aero)unit.getEntity()).get0SI() - ((Aero)unit.getEntity()).getSI(); } }
public static boolean isRepairable(Entity en) { if (en instanceof Mech) { // you can repair anything so long as one point of CT is left if (en.getInternal(Mech.LOC_CT) <= 0) { return false; } } if (en instanceof Tank) { // can't repair a tank with a destroyed location for (int i = 0; i < en.locations(); i++) { if(i == Tank.LOC_TURRET || i == Tank.LOC_TURRET_2 || i == Tank.LOC_BODY) { continue; } if (en.getInternal(i) <= 0) { return false; } } } if(en instanceof Aero) { if(((Aero)en).getSI() <= 0) { return false; } } return true; }
/** * Calculate the structural integrity weight */ public double getWeightStructure() { double tonnage = 0; if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { tonnage = aero.getSI() * aero.getWeight(); if (aero.isSpheroid()) { tonnage /= 500; } else { tonnage /= 200; } } else if (aero.hasETypeFlag(Entity.ETYPE_SPACE_STATION)) { tonnage = aero.getWeight() / 100; } else if (aero.hasETypeFlag(Entity.ETYPE_WARSHIP)) { // SI * weight / 1000, rounded up to half ton tonnage = aero.getSI() * aero.getWeight() / 1000; } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { tonnage = aero.getWeight() / 150; } else { // Fighters do not allocate weight to structure return 0; } return Math.ceil(tonnage * 2) / 2.0; }
.append(a.getSI());
dealt = getArmor(loc); setArmor(0, loc); int finalSI = Math.min(getSI(), getSI() / 2); dealt += getSI() - finalSI; setSI(finalSI); setEngineHits(Math.max(3, getEngineHits())); if (getSI() > 1) { int si = getSI() + (getArmor(loc) / 2); si = Math.max(si, isDestroyed() || isDoomed() ? 0 : 1); setSI(si);
output.write(String.valueOf(a.getSI())); output.write("\"/>"); output.write(CommonConstants.NL);
renderArmor(a.getSI(), a.get0SI(), html)));
return false; if(((Aero)en).getSI() <= 0) { return false;
+ String.valueOf(a.getSI()) + "\"/>\n";
cost += 50000 * getSI();