@Override public void prepare() { if ((entity instanceof IBomber) && ((IBomber)entity).isVTOLBombing()) { targets = Collections.singletonList(((IBomber)entity).getVTOLBombTarget().getPosition()); } else if (entity instanceof VTOL) { targets = new ArrayList<>(((VTOL)entity).getStrafingCoords()); } else { targets = Collections.emptyList(); } int x1 = 0, y1 = 0, x2 = 0, y2 = 0; if (targets.size() > 0) { x1 = x2 = (int)bv.getHexLocation(targets.get(0)).getX(); y1 = y2 = (int)bv.getHexLocation(targets.get(0)).getX(); } if (targets.size() > 1) { for (int i = 1; i < targets.size(); i++) { x1 = Math.min(x1, (int)bv.getHexLocation(targets.get(i)).getX()); y1 = Math.min(y1, (int)bv.getHexLocation(targets.get(i)).getY()); x2 = Math.max(x2, (int)bv.getHexLocation(targets.get(i)).getX()); y2 = Math.max(y2, (int)bv.getHexLocation(targets.get(i)).getY()); } } Shape hex = HexDrawUtilities.getHexFullBorderArea(3); bounds = new Rectangle(x1 - 1, y1 - 1, x2 + (int)hex.getBounds().getWidth() + 1, y2 + (int)hex.getBounds().getHeight() + 1); }
/** * A VTOL or LAM in airmech mode making a bombing or strafing attack already has the target set * during the movement phase. */ void updateVTOLGroundTarget() { clientgui.bv.clearStrafingCoords(); target(null); isStrafing = false; strafingCoords.clear(); if (ce().isBomber() && ((IBomber)ce()).isVTOLBombing()) { target(((IBomber)ce()).getVTOLBombTarget()); clientgui.bv.addStrafingCoords(target.getPosition()); } else if ((ce() instanceof VTOL) && ((VTOL)ce()).getStrafingCoords().size() > 0) { strafingCoords.addAll(((VTOL)ce()).getStrafingCoords()); strafingCoords.forEach(c -> clientgui.bv.addStrafingCoords(c)); isStrafing = true; } }
|| isAttackerBA)) && !(ae.isAirborne()) && !(ae.isBomber() && ((IBomber)ae).isVTOLBombing()) && !((ae instanceof Dropship) && ((Dropship) ae).isSpheroid() && !ae.isAirborne() && !ae.isSpaceborne())
|| (ae.isBomber() && ((IBomber)ae).isVTOLBombing())) { toHit.addModifier(+2, "air to ground strike");