public void drawDistanceAttack(final Graphics2D g2d,final RPEntity entity,final RPEntity target,final int x,final int y,final int width,final int height){
  Nature nature=entity.getShownDamageType();
  int startX=x + width / 2;
  int startY=y + height / 2;
  int endX=(int)(TILE_SIZE * (target.getX() + target.getWidth() / 2));
  int endY=(int)(TILE_SIZE * target.getY());
  int yLength=(endY - startY) / NUM_ATTACK_FRAMES;
  int xLength=(endX - startX) / NUM_ATTACK_FRAMES;
  startY+=frame * yLength;
  endY=startY + yLength;
  startX+=frame * xLength;
  endX=startX + xLength;
  g2d.setColor(ARROW_COLOR.get(nature));
  Stroke oldStroke=g2d.getStroke();
  g2d.setStroke(ARROW_STROKE);
  g2d.drawLine(startX,startY,endX,endY);
  g2d.setStroke(oldStroke);
  drawAttackSprite(g2d,rangedSprites,entity.getDirection(),x,y,width,height);
  frame++;
}

public void drawDistanceAttack ( final Graphics2D g2d , final RPEntity entity , final RPEntity target , final int x , final int y , final int width , final int height ) { Nature nature = entity . getShownDamageType ( ) ; int startX = x + width / 2 ; int startY = y + height / 2 ; int endX = ( int ) ( TILE_SIZE * ( target . getX ( ) + target . getWidth ( ) / 2 ) ) ; int endY = ( int ) ( TILE_SIZE * target . getY ( ) ) ; int yLength = ( endY - startY ) / NUM_ATTACK_FRAMES ; int xLength = ( endX - startX ) / NUM_ATTACK_FRAMES ; startY += frame * yLength ; endY = startY + yLength ; startX += frame * xLength ; endX = startX + xLength ; g2d . setColor ( ARROW_COLOR . get ( nature ) ) ; Stroke oldStroke = g2d . getStroke ( ) ; g2d . setStroke ( ARROW_STROKE ) ; g2d . drawLine ( startX , startY , endX , endY ) ; g2d . setStroke ( oldStroke ) ; drawAttackSprite ( g2d , rangedSprites , entity . getDirection ( ) , x , y , width , height ) ; frame ++ ; }
draw a distance attack line .
