/** * Targets something */ void target(Targetable t) { target = t; updateTarget(); ash.showDialog(); }
public void closeDialog() { if (asd != null) { aimingAt = Entity.LOC_NONE; aimingMode = IAimingModes.AIM_MODE_NONE; asd.dispose(); asd = null; updateTarget(); } }
public void itemStateChanged(ItemEvent ev) { IndexedRadioButton icb = (IndexedRadioButton) ev.getSource(); aimingAt = icb.getIndex(); updateTarget(); }
/** * Clears all current actions */ @Override public void clear() { if (attacks.size() > 0) { attacks.removeAllElements(); } if (ce() != null) { clientgui.mechD.wPan.displayMech(ce()); } updateTarget(); Entity entity = clientgui.getClient().getGame().getEntity(cen); entity.dodging = true; }
private void doSearchlight() { // validate if ((ce() == null) || (target == null)) { throw new IllegalArgumentException( "current searchlight parameters are invalid"); //$NON-NLS-1$ } if (!SearchlightAttackAction.isPossible(clientgui.getClient().getGame(), cen, target, null)) { return; } // create and queue a searchlight action SearchlightAttackAction saa = new SearchlightAttackAction(cen, target .getTargetType(), target.getTargetId()); attacks.addElement(saa); // and add it into the game, temporarily clientgui.getClient().getGame().addAction(saa); clientgui.bv.addAttack(saa); clientgui.minimap.drawMap(); // and prevent duplicates setSearchlightEnabled(false); // refresh weapon panel, as bth will have changed updateTarget(); }
public void showDialog() { if ((ce() == null) || (target == null)) { return; } if (asd != null) { int oldAimingMode = aimingMode; closeDialog(); aimingMode = oldAimingMode; } if (canAim) { final int attackerElevation = ce().getElevation() + ce().getGame().getBoard().getHex(ce().getPosition()) .getLevel(); final int targetElevation = target.getElevation() + ce().getGame().getBoard() .getHex(target.getPosition()).getLevel(); if ((target instanceof Mech) && (ce() instanceof Mech) && (attackerElevation == targetElevation)) { String[] options = { "punch", "kick" }; boolean[] enabled = { true, true }; asd = new AimedShotDialog( clientgui.frame, Messages.getString("PhysicalDisplay.AimedShotDialog.title"), //$NON-NLS-1$ Messages.getString("PhysicalDisplay.AimedShotDialog.message"), //$NON-NLS-1$ options, enabled, aimingAt, this, this); asd.setVisible(true); updateTarget(); } } }