Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2022-01-16 04:02:05 +01:00
11 changed files with 161 additions and 20 deletions

View File

@@ -280,6 +280,18 @@ public interface Actor extends Renderable, Locatable
*/ */
void setGraphic(int graphic); void setGraphic(int graphic);
/**
* Get the height of the graphic/spotanim on the actor
* @return
*/
int getGraphicHeight();
/**
* Set the height of the graphic/spotanim on the actor
* @param height
*/
void setGraphicHeight(int height);
/** /**
* Get the frame of the currently playing spotanim * Get the frame of the currently playing spotanim
* *

View File

@@ -1091,19 +1091,39 @@ public interface Client extends GameEngine
@Nullable @Nullable
LocalPoint getLocalDestinationLocation(); LocalPoint getLocalDestinationLocation();
/**
* Create a projectile.
* @param id projectile/spotanim id
* @param plane plane the projectile is on
* @param startX local x coordinate the projectile starts at
* @param startY local y coordinate the projectile starts at
* @param startZ local z coordinate the projectile starts at - includes tile height
* @param startCycle cycle the project starts
* @param endCycle cycle the projectile ends
* @param slope
* @param startHeight start height of projectile - excludes tile height
* @param endHeight end height of projectile - excludes tile height
* @param target optional actor target
* @param targetX target x - if an actor target is supplied should be the target x
* @param targetY taret y - if an actor target is supplied should be the target y
* @return the new projectile
*/
Projectile createProjectile(int id, int plane, int startX, int startY, int startZ, int startCycle, int endCycle,
int slope, int startHeight, int endHeight, @Nullable Actor target, int targetX, int targetY);
/** /**
* Gets a list of all projectiles currently spawned. * Gets a list of all projectiles currently spawned.
* *
* @return all projectiles * @return all projectiles
*/ */
List<Projectile> getProjectiles(); Deque<Projectile> getProjectiles();
/** /**
* Gets a list of all graphics objects currently drawn. * Gets a list of all graphics objects currently drawn.
* *
* @return all graphics objects * @return all graphics objects
*/ */
List<GraphicsObject> getGraphicsObjects(); Deque<GraphicsObject> getGraphicsObjects();
/** /**
* Creates a RuneLiteObject, which is a modified {@link GraphicsObject} * Creates a RuneLiteObject, which is a modified {@link GraphicsObject}

View File

@@ -29,6 +29,12 @@ package net.runelite.api;
*/ */
public interface Deque<T> extends Iterable<T> public interface Deque<T> extends Iterable<T>
{ {
/**
* Add a new element to the end of the deque
* @param t the element
*/
void addLast(T t);
/** /**
* clear the deque * clear the deque
*/ */

View File

@@ -28,9 +28,11 @@ package net.runelite.api;
public final class GraphicID public final class GraphicID
{ {
public static final int WINE_MAKE = 47; public static final int WINE_MAKE = 47;
public static final int CANNONBALL = 53;
public static final int SPLASH = 85; public static final int SPLASH = 85;
public static final int GREY_BUBBLE_TELEPORT = 86; public static final int GREY_BUBBLE_TELEPORT = 86;
public static final int TELEPORT = 111; public static final int TELEPORT = 111;
public static final int TELEKINETIC_SPELL = 143;
public static final int ENTANGLE = 179; public static final int ENTANGLE = 179;
public static final int SNARE = 180; public static final int SNARE = 180;
public static final int BIND = 181; public static final int BIND = 181;
@@ -54,8 +56,93 @@ public final class GraphicID
public static final int OLM_LIGHTNING = 1356; public static final int OLM_LIGHTNING = 1356;
public static final int OLM_TELEPORT = 1359; public static final int OLM_TELEPORT = 1359;
public static final int OLM_HEAL = 1363; public static final int OLM_HEAL = 1363;
public static final int GRANITE_CANNONBALL = 1443;
public static final int OLM_CRYSTAL = 1447; public static final int OLM_CRYSTAL = 1447;
public static final int XERIC_TELEPORT = 1612; public static final int XERIC_TELEPORT = 1612;
public static final int HYDRA_LIGHTNING = 1666;
public static final int GRAPHICS_OBJECT_ROCKFALL = 1727; public static final int GRAPHICS_OBJECT_ROCKFALL = 1727;
public static final int ZALCANO_PROJECTILE_FIREBALL = 1728;
public static final int LIZARDMAN_SHAMAN_AOE = 1293;
public static final int CRAZY_ARCHAEOLOGIST_AOE = 1260;
public static final int ICE_DEMON_RANGED_AOE = 1324;
public static final int ICE_DEMON_ICE_BARRAGE_AOE = 366;
public static final int VASA_AWAKEN_AOE = 1327;
public static final int VASA_RANGED_AOE = 1329;
public static final int TEKTON_METEOR_AOE = 660;
public static final int OLM_FALLING_CRYSTAL = 1357;
public static final int OLM_BURNING = 1349;
public static final int OLM_FALLING_CRYSTAL_TRAIL = 1352;
public static final int OLM_ACID_TRAIL = 1354;
public static final int OLM_FIRE_LINE = 1347;
public static final int OLM_MAGE_ATTACK = 1339;
public static final int OLM_RANGE_ATTACK = 1340;
public static final int VORKATH_BOMB_AOE = 1481;
public static final int VORKATH_POISON_POOL_AOE = 1483;
public static final int VORKATH_TICK_FIRE_AOE = 1482;
public static final int VORKATH_SPAWN_AOE = 1484;
public static final int ADDY_DRAG_POISON = 1486;
public static final int GALVEK_MINE = 1495;
public static final int GALVEK_BOMB = 1491;
public static final int DAWN_FREEZE = 1445;
public static final int DUSK_CEILING = 1435;
public static final int VETION_LIGHTNING = 280;
public static final int CHAOS_FANATIC_AOE = 551;
public static final int CORPOREAL_BEAST_AOE = 315;
public static final int CORPOREAL_BEAST_DARK_CORE_AOE = 319;
public static final int WINTERTODT_SNOW_FALL_AOE = 1310;
public static final int DEMONIC_GORILLA_RANGED = 1302;
public static final int DEMONIC_GORILLA_MAGIC = 1304;
public static final int DEMONIC_GORILLA_BOULDER = 856;
public static final int XARPUS_ACID = 1555;
public static final int VERZIK_PURPLE_SPAWN = 1586;
public static final int CERB_FIRE = 1247;
public static final int DERWEN_HEALING_BALL = 1512;
public static final int JUSTICIAR_LEASH = 1515;
public static final int MAGE_ARENA_BOSS_FREEZE = 368;
/**
* missing: superior dark beast
*/
public static final int MARBLE_GARGOYLE_AOE = 1453;
/**
* non AOE, regular projectiles
*/
public static final int VORKATH_DRAGONBREATH = 393;
public static final int VORKATH_RANGED = 1477;
public static final int VORKATH_MAGIC = 1479;
public static final int VORKATH_PRAYER_DISABLE = 1471;
public static final int VORKATH_VENOM = 1470;
public static final int VORKATH_ICE = 395;
public static final int SOTETSEG_BOMB = 1604;
public static final int SOTETSEG_RANGE = 1607;
public static final int SOTETSEG_MAGE = 1606;
public static final int HYDRA_MAGIC = 1662;
public static final int HYDRA_RANGED = 1663;
public static final int HYDRA_POISON = 1644;
public static final int HYDRA_LIGHTNING = 1664;
public static final int HYDRA_LIGHTNING_2 = 1665;
public static final int DRAKE_BREATH = 1637;
public static final int HUNLLEF_MAGE_ATTACK = 1707;
public static final int HUNLLEF_CORRUPTED_MAGE_ATTACK = 1708;
public static final int HUNLLEF_RANGE_ATTACK = 1711;
public static final int HUNLLEF_CORRUPTED_RANGE_ATTACK = 1712;
public static final int HUNLLEF_PRAYER_ATTACK = 1713;
public static final int HUNLLEF_CORRUPTED_PRAYER_ATTACK = 1714;
public static final int PORAZDIR_ENERGY_BALL = 1514;
} }

View File

@@ -72,4 +72,10 @@ public interface GraphicsObject extends Renderable
* @return * @return
*/ */
boolean finished(); boolean finished();
/**
* Set if this spotanim is done animating. If finished, the spotanim will despawn next frame.
* @param finished
*/
void setFinished(boolean finished);
} }

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)
*/ */
@@ -33,7 +35,7 @@ public interface Projectile extends Renderable
* Gets the ID of the projectile. * Gets the ID of the projectile.
* *
* @return the projectile ID * @return the projectile ID
* @see ProjectileID * @see GraphicID
*/ */
int getId(); int getId();
@@ -44,6 +46,14 @@ public interface Projectile extends Renderable
*/ */
Actor getInteracting(); 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.
* *
@@ -84,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.
@@ -93,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.

View File

@@ -29,6 +29,7 @@ package net.runelite.api;
* <p> * <p>
* Note: This class is not complete and may be missing mapped IDs. * Note: This class is not complete and may be missing mapped IDs.
*/ */
@Deprecated
public final class ProjectileID public final class ProjectileID
{ {
public static final int CANNONBALL = 53; public static final int CANNONBALL = 53;

View File

@@ -37,12 +37,6 @@ public interface TileItem extends Renderable
int getQuantity(); int getQuantity();
/**
* Time in game ticks when the item spawned (relative to us)
* @return
*/
int getSpawnTime();
/** /**
* @return the tile this item is on * @return the tile this item is on
*/ */

View File

@@ -37,6 +37,8 @@ import net.runelite.api.ChatMessageType;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.GameObject; import net.runelite.api.GameObject;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import static net.runelite.api.GraphicID.CANNONBALL;
import static net.runelite.api.GraphicID.GRANITE_CANNONBALL;
import net.runelite.api.InventoryID; import net.runelite.api.InventoryID;
import net.runelite.api.Item; import net.runelite.api.Item;
import net.runelite.api.ItemContainer; import net.runelite.api.ItemContainer;
@@ -46,8 +48,6 @@ import net.runelite.api.ObjectID;
import static net.runelite.api.ObjectID.CANNON_BASE; import static net.runelite.api.ObjectID.CANNON_BASE;
import net.runelite.api.Player; import net.runelite.api.Player;
import net.runelite.api.Projectile; import net.runelite.api.Projectile;
import static net.runelite.api.ProjectileID.CANNONBALL;
import static net.runelite.api.ProjectileID.GRANITE_CANNONBALL;
import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ChatMessage; import net.runelite.api.events.ChatMessage;

View File

@@ -427,9 +427,7 @@ class DevToolsOverlay extends Overlay
private void renderProjectiles(Graphics2D graphics) private void renderProjectiles(Graphics2D graphics)
{ {
List<Projectile> projectiles = client.getProjectiles(); for (Projectile projectile : client.getProjectiles())
for (Projectile projectile : projectiles)
{ {
int projectileId = projectile.getId(); int projectileId = projectile.getId();
String text = "(ID: " + projectileId + ")"; String text = "(ID: " + projectileId + ")";
@@ -446,9 +444,7 @@ class DevToolsOverlay extends Overlay
private void renderGraphicsObjects(Graphics2D graphics) private void renderGraphicsObjects(Graphics2D graphics)
{ {
List<GraphicsObject> graphicsObjects = client.getGraphicsObjects(); for (GraphicsObject graphicsObject : client.getGraphicsObjects())
for (GraphicsObject graphicsObject : graphicsObjects)
{ {
LocalPoint lp = graphicsObject.getLocation(); LocalPoint lp = graphicsObject.getLocation();
Polygon poly = Perspective.getCanvasTilePoly(client, lp); Polygon poly = Perspective.getCanvasTilePoly(client, lp);

View File

@@ -33,6 +33,7 @@ import net.runelite.api.Client;
import net.runelite.api.GameObject; import net.runelite.api.GameObject;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import static net.runelite.api.GraphicID.GRAPHICS_OBJECT_ROCKFALL; import static net.runelite.api.GraphicID.GRAPHICS_OBJECT_ROCKFALL;
import static net.runelite.api.GraphicID.ZALCANO_PROJECTILE_FIREBALL;
import net.runelite.api.GraphicsObject; import net.runelite.api.GraphicsObject;
import net.runelite.api.Hitsplat; import net.runelite.api.Hitsplat;
import net.runelite.api.NPC; import net.runelite.api.NPC;
@@ -40,7 +41,6 @@ import net.runelite.api.NpcID;
import static net.runelite.api.NpcID.ZALCANO; import static net.runelite.api.NpcID.ZALCANO;
import net.runelite.api.ObjectID; import net.runelite.api.ObjectID;
import net.runelite.api.Projectile; import net.runelite.api.Projectile;
import static net.runelite.api.ProjectileID.ZALCANO_PROJECTILE_FIREBALL;
import net.runelite.api.VarPlayer; import net.runelite.api.VarPlayer;
import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;