protected String numDoorsString() { return "(" + getCurrentDoors() + ((getCurrentDoors() == 1)?" door":" doors") + ")"; }
public void destroyDoor() { if (getCurrentDoors() > 0) setCurrentDoors(getCurrentDoors() - 1); }
/** * @return get the bays separately */ public Vector<Bay> getFighterBays() { Vector<Bay> result = new Vector<Bay>(); for (Transporter next : transports) { if (((next instanceof ASFBay) || (next instanceof SmallCraftBay)) && (((Bay) next).getCurrentDoors() > 0)) { result.addElement((Bay) next); } } // Return the list. return result; }
public void restoreDoor() { if (getCurrentDoors() < getDoors()) { setCurrentDoors(getCurrentDoors() + 1); } }
/** * @return only entities in that can be combat dropped */ public Vector<Entity> getDroppableUnits() { Vector<Entity> result = new Vector<Entity>(); // Walk through this entity's transport components; // add all of their lists to ours. // I should only add entities in bays that are functional for (Transporter next : transports) { if ((next instanceof Bay) && (((Bay) next).getCurrentDoors() > 0)) { Bay nextbay = (Bay) next; for (Entity e : nextbay.getDroppableUnits()) { result.addElement(e); } } } // Return the list. return result; }
/** * Damages a randomly determined bay door on the entity, if one exists */ public String damageBayDoor() { String bayType = "none"; Vector<Bay> potential; potential = new Vector<Bay>(); Enumeration<Transporter> iter = transports.elements(); while (iter.hasMoreElements()) { Transporter next = iter.nextElement(); if (next instanceof Bay) { Bay nextBay = (Bay) next; if (nextBay.getCurrentDoors() > 0) { potential.add(nextBay); } } } if (potential.size() > 0) { Bay chosenBay = potential.elementAt(Compute.randomInt(potential .size())); chosenBay.destroyDoor(); chosenBay.resetDoors(); chosenBay.setCurrentDoors(chosenBay.getCurrentDoors() - 1); bayType = chosenBay.getType(); } return bayType; }
@Override public void fix() { super.fix(); Part bayPart = campaign.getPart(parentPartId); if (null != bayPart) { Bay bay = ((TransportBayPart) bayPart).getBay(); if (null != bay) { bay.setCurrentDoors(Math.min(bay.getCurrentDoors() + 1, bay.getDoors())); } } }
if (prevDoorHits < bay.getDoors() - bay.getCurrentDoors()) { if (prevDoorHits >= bay.getDoors() - bay.getCurrentDoors()) { break;
.collect(Collectors.toList()); doors = currentBay.getCurrentDoors(); if ((currentUnits.size() > 0) && (doors > 0)) { String[] names = new String[currentUnits.size()];
+ "</b><br></html>"), gridBagConstraints); CheckCritPanel doorCrit = new CheckCritPanel(nextbay.getDoors(), (nextbay.getDoors() - nextbay.getCurrentDoors())); bayDoorCrit[b] = doorCrit; gridBagConstraints.gridx = 1;
output.write(indentStr(indentLvl + 2) + "<damage>" + nextbay.getBayDamage() + "</damage>"); output.write(CommonConstants.NL); output.write(indentStr(indentLvl + 2) + "<doors>" + nextbay.getCurrentDoors() + "</doors>"); output.write(CommonConstants.NL); output.write(indentStr(indentLvl+1) + "</transportBay>");
doors = currentBay.getCurrentDoors(); if (currentFighters.size() == 0) { bayNum++;
first = false; if (next.getCurrentDoors() < next.getDoors()) { if (!first) { toReturn += ", "; toReturn += next.getType() + " Bay #" + next.getBayNumber() + " Doors (" + (next.getDoors() - next.getCurrentDoors()) + ")"; first = false;
continue; if ((bay.getCurrentDoors() > 0) && (doorCrit.getHits() > 0)) { bay.setCurrentDoors(bay.getDoors() - doorCrit.getHits());