if (target != null && !target.equals(ce()) && (!target.getOwner().equals(ce().getOwner()) || client.gameSettings.friendlyFire)) { if (gear == Compute.GEAR_JUMP && Compute.isValidDFA(client.game, cen,  md)) {  client.doAlertDialog("Death From Above!", "Do you want to execute a DFA?"); } else if (gear == Compute.GEAR_LAND && Compute.isValidCharge(client.game, cen, md)) {  client.doAlertDialog("Charge!", "Do you want to charge?"); md.clipToPossible(); md.addStep(MovementData.STEP_CHARGE); moveTo(md);
if (gear == Compute.GEAR_CHARGE) {  if (target == null) { client.doAlertDialog("Can't perform charge", "No target!"); clearAllMoves(); return; }   ToHitData toHit = Compute.toHitCharge(client.game, cen, target.getId(), md); if (toHit.getValue() != ToHitData.IMPOSSIBLE) {    moveTo(md); return;   } else {  client.doAlertDialog("Can't perform charge", toHit.getDesc()); clearAllMoves();
    public void boardHexMoused(BoardEvent b) {        if (!client.isMyTurn()             || (b.getModifiers() & MouseEvent.BUTTON1_MASK) == 0) {            return;        }        if (b.getType() == b.BOARD_HEX_DRAGGED) {            if (!b.getCoords().equals(client.game.board.lastCursor)) {                client.game.board.cursor(b.getCoords());                // either turn or move                client.bv.clearMovementData();                cmd = md.getAppended(currentMove(md.getFinalCoords(ce().getPosition(), ce().getFacing()), md.getFinalFacing(ce().getFacing()), b.getCoords()));                client.bv.drawMovementData(ce(), cmd);            }        } else if (b.getType() == b.BOARD_HEX_CLICKED) {            final Entity target = client.game.getEntity(b.getCoords());            client.game.board.select(b.getCoords());            client.bv.clearMovementData();            Coords moveto = b.getCoords();            client.bv.drawMovementData(ce(), cmd);            md = new MovementData(cmd);                        // check for charge/dfa            if (target != null && !target.equals(ce())                    && (!target.getOwner().equals(ce().getOwner())                        || client.gameSettings.friendlyFire)) {                if (gear == Compute.GEAR_JUMP                         && Compute.isValidDFA(client.game, cen,  md)) {                    // prompt for DFA                    client.doAlertDialog("Death From Above!", "Do you want to execute a DFA?");                } else if (gear == Compute.GEAR_LAND                         && Compute.isValidCharge(client.game, cen, md)) {                    // prompt for charge                    client.doAlertDialog("Charge!", "Do you want to charge?");                    md.clipToPossible();                    md.addStep(MovementData.STEP_CHARGE);                    moveTo(md);                }            }                        butMove.setLabel("Move");            butMove.setEnabled(true);        }    }