From 07f96a6abbe828db793c7d27e0d154f7606fe9fe Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 14 Jan 2022 17:16:42 -0500 Subject: [PATCH] api: add projectile target and end cycle setter --- .../java/net/runelite/api/Projectile.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Projectile.java b/runelite-api/src/main/java/net/runelite/api/Projectile.java index a4b98cecfd..4a18937c7a 100644 --- a/runelite-api/src/main/java/net/runelite/api/Projectile.java +++ b/runelite-api/src/main/java/net/runelite/api/Projectile.java @@ -24,6 +24,8 @@ */ package net.runelite.api; +import net.runelite.api.coords.LocalPoint; + /** * Represents a projectile entity. (ie. cannonball, arrow) */ @@ -37,6 +39,21 @@ public interface Projectile extends Renderable */ int getId(); + /** + * Gets the actor that is targeted by this projectile. + * + * @return the target actor, or null if this projectile is an AoE attack + */ + Actor getInteracting(); + + /** + * Get the target point of the projectile. For projectiles with an actor target, + * this is updated each frame to the actor position. + * + * @return + */ + LocalPoint getTarget(); + /** * Gets the original x-axis coordinate that this projectile started from. * @@ -77,7 +94,7 @@ public interface Projectile extends Renderable * * @return the start game cycle */ - int getStartMovementCycle(); + int getStartCycle(); /** * Gets the game cycle that the projectile will reach its target at. @@ -86,6 +103,15 @@ public interface Projectile extends Renderable */ int getEndCycle(); + /** + * Sets the game cycle the projectile will reach its target at. The + * projectile automatically despawns after this time, and setting the + * end cycle to a time in the past is an effective way of removing the + * projectile. + * @param cycle + */ + void setEndCycle(int cycle); + /** * Gets the remaining game cycles until the projectile reaches its * target and despawns.