api: add projectile target and end cycle setter

This commit is contained in:
Adam
2022-01-14 17:16:42 -05:00
parent 28a694f69f
commit 07f96a6abb

View File

@@ -24,6 +24,8 @@
*/ */
package net.runelite.api; package net.runelite.api;
import net.runelite.api.coords.LocalPoint;
/** /**
* Represents a projectile entity. (ie. cannonball, arrow) * Represents a projectile entity. (ie. cannonball, arrow)
*/ */
@@ -37,6 +39,21 @@ public interface Projectile extends Renderable
*/ */
int getId(); 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. * 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 * @return the start game cycle
*/ */
int getStartMovementCycle(); int getStartCycle();
/** /**
* Gets the game cycle that the projectile will reach its target at. * Gets the game cycle that the projectile will reach its target at.
@@ -86,6 +103,15 @@ public interface Projectile extends Renderable
*/ */
int getEndCycle(); 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 * Gets the remaining game cycles until the projectile reaches its
* target and despawns. * target and despawns.