use of net.runelite.api.Projectile in project runelite by runelite.
the class RSClientMixin method getProjectiles.
@Inject
@Override
public List<Projectile> getProjectiles() {
List<Projectile> projectiles = new ArrayList<Projectile>();
RSDeque projectileDeque = this.getProjectilesDeque();
Node head = projectileDeque.getHead();
for (Node node = head.getNext(); node != head; node = node.getNext()) {
projectiles.add((Projectile) node);
}
return projectiles;
}
use of net.runelite.api.Projectile in project runelite by runelite.
the class DevToolsOverlay method renderProjectiles.
private void renderProjectiles(Graphics2D graphics) {
List<Projectile> projectiles = client.getProjectiles();
for (Projectile projectile : projectiles) {
int originX = projectile.getX1();
int originY = projectile.getY1();
LocalPoint tilePoint = new LocalPoint(originX, originY);
Polygon poly = Perspective.getCanvasTilePoly(client, tilePoint);
if (poly != null) {
OverlayUtil.renderPolygon(graphics, poly, Color.RED);
}
int projectileId = projectile.getId();
Actor projectileInteracting = projectile.getInteracting();
String infoString = "";
if (projectileInteracting == null) {
infoString += "AoE";
} else {
infoString += "Targeted (T: " + projectileInteracting.getName() + ")";
}
infoString += " (ID: " + projectileId + ")";
if (projectileInteracting != null) {
OverlayUtil.renderActorOverlay(graphics, projectile.getInteracting(), infoString, Color.RED);
}
}
}
Aggregations