/**
* Punch the target!
*/
public void punch() {
final ToHitData leftArm = PunchAttackAction.toHit(client.game, cen,
target, PunchAttackAction.LEFT);
final ToHitData rightArm = PunchAttackAction.toHit(client.game, cen,
target, PunchAttackAction.RIGHT);
String title = Messages
.getString(
"PhysicalDisplay.PunchDialog.title", new Object[] { target.getDisplayName() }); //$NON-NLS-1$
String message = Messages.getString(
"PhysicalDisplay.PunchDialog.message", new Object[] { //$NON-NLS-1$
rightArm.getValueAsString(),
new Double(Compute.oddsAbove(rightArm.getValue())),
rightArm.getDesc(),
new Integer(PunchAttackAction.getDamageFor(ce(),
PunchAttackAction.RIGHT,
(target instanceof Infantry)
&& !(target instanceof BattleArmor))),
rightArm.getTableDesc(),
leftArm.getValueAsString(),
new Double(Compute.oddsAbove(leftArm.getValue())),
leftArm.getDesc(),
new Integer(PunchAttackAction.getDamageFor(ce(),
PunchAttackAction.LEFT,
(target instanceof Infantry)
&& !(target instanceof BattleArmor))),
leftArm.getTableDesc() });
if (clientgui.doYesNoDialog(title, message)) {
//check for retractable blade that can be extended in each arm
boolean leftBladeExtend = false;
boolean rightBladeExtend = false;
if((ce() instanceof Mech)
&& (target instanceof Entity)
&& clientgui.client.game.getOptions().booleanOption("tacops_retractable_blades")
&& (leftArm.getValue() != TargetRoll.IMPOSSIBLE)
&& ((Mech)ce()).hasRetractedBlade(Mech.LOC_LARM)) {
leftBladeExtend = clientgui.doYesNoDialog(Messages.getString("PhysicalDisplay.ExtendBladeDialog.title"), Messages.getString("PhysicalDisplay.ExtendBladeDialog.message", new Object[] { ce().getLocationName(Mech.LOC_LARM) }));
}
if((ce() instanceof Mech)
&& (target instanceof Entity)
&& clientgui.client.game.getOptions().booleanOption("tacops_retractable_blades")
&& (rightArm.getValue() != TargetRoll.IMPOSSIBLE)
&& ((Mech)ce()).hasRetractedBlade(Mech.LOC_RARM)) {
rightBladeExtend = clientgui.doYesNoDialog(Messages.getString("PhysicalDisplay.ExtendBladeDialog.title"), Messages.getString("PhysicalDisplay.ExtendBladeDialog.message", new Object[] { ce().getLocationName(Mech.LOC_RARM) }));
}
disableButtons();
// declare searchlight, if possible
if (GUIPreferences.getInstance().getAutoDeclareSearchlight()) {
doSearchlight();
}
if ((leftArm.getValue() != TargetRoll.IMPOSSIBLE)
&& (rightArm.getValue() != TargetRoll.IMPOSSIBLE)) {
attacks.addElement(new PunchAttackAction(cen, target
.getTargetType(), target.getTargetId(),
PunchAttackAction.BOTH, leftBladeExtend, rightBladeExtend));
} else if (leftArm.getValue() < rightArm.getValue()) {
attacks.addElement(new PunchAttackAction(cen, target
.getTargetType(), target.getTargetId(),
PunchAttackAction.LEFT, leftBladeExtend, rightBladeExtend));
} else {
attacks.addElement(new PunchAttackAction(cen, target