private void dumpBombs() {
if (!(ce() instanceof Aero)) {
return;
}
Aero a = (Aero) ce();
int overallMoveType = IEntityMovementType.MOVE_NONE;
if (null != cmd) {
overallMoveType = cmd.getLastStepMovementType();
}
// bring up dialog to dump bombs, then make a control roll and report
// success or failure
// should update mp available
BombPayloadDialog dumpBombsDialog = new BombPayloadDialog(
clientgui.frame, Messages
.getString("MovementDisplay.BombDumpDialog.title"), //$NON-NLS-1$
a.getBombChoices(), false, true);
dumpBombsDialog.setVisible(true);
if (dumpBombsDialog.getAnswer()) {
int[] bombsDumped = dumpBombsDialog.getChoices();
// first make a control roll
PilotingRollData psr = ce().getBasePilotingRoll(overallMoveType);
int ctrlroll = Compute.d6(2);
Report r = new Report(9500);
r.subject = ce().getId();
r.add(ce().getDisplayName());
r.add(psr.getValue());
r.add(ctrlroll);
r.newlines = 0;
r.indent(1);
if (ctrlroll < psr.getValue()) {
r.choose(false);
// addReport(r);
String title = Messages
.getString("MovementDisplay.DumpingBombs.title"); //$NON-NLS-1$
String body = Messages
.getString("MovementDisplay.DumpFailure.message"); //$NON-NLS-1$
clientgui.doAlertDialog(title, body);
// failed the roll, so dump all bombs
bombsDumped = a.getBombChoices();
} else {
// avoided damage
r.choose(true);
String title = Messages
.getString("MovementDisplay.DumpingBombs.title"); //$NON-NLS-1$