Package dev.twilite.game.facade
Class Avatar
java.lang.Object
dev.twilite.game.facade.Avatar
Convenience facade for reading state from the local player.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns whether the local player is currently animating.static intReturns the local player's current animation id, or-1when unavailable.static Rectarea()Returns the local player's occupied area, or a one-tile null area when unavailable.static Coordcoord()Returns the local player's coordinate, or(-1, -1, 0)when unavailable.static intdistanceTo(Coord coord) Returns Chebyshev distance from the local player to a coordinate, orInteger.MAX_VALUEwhen unavailable.static intdistanceTo(Rect rect) Returns Chebyshev distance from the local player to a rectangle, orInteger.MAX_VALUEwhen unavailable.static intdistanceTo(Unit unit) Returns Chebyshev distance from the local player to a unit, orInteger.MAX_VALUEwhen unavailable.static IntStreameffects()Returns active effect ids on the local player.faceUnit()Returns the unit currently faced by the local player, when available.static booleanReturns whether the local player is facing any unit.static booleanfacingUnit(Unit other) Returns whether the local player is facing the supplied unit.static intheadbarPercent(int id) Returns the rendered percent for a local-player headbar, or-1when unavailable.static booleanheadbarRendered(int id) Returns whether a local-player headbar is currently rendered.static IntStreamheadbars()Returns active headbar ids on the local player.static StringReturns the local player's overhead chat message, or an empty string when unavailable.static intReturns the local player's rendered health percent, or-1when unavailable.static booleanReturns whether the local player's health bar is currently rendered.hitmarks()Returns active hitmarks on the local player.static intindex()Returns the local player's player index, or-1when unavailable.static intReturns the equipped appearance kit id for a body part, or-1when unavailable.static booleanlineOfSightTo(Coord coord) Returns whether the local player has line of sight to a coordinate.static booleanlineOfSightTo(Rect rect) Returns whether the local player has line of sight to a rectangle.static booleanlineOfSightTo(Unit unit) Returns whether the local player has line of sight to a unit.static booleanlineOfWalkTo(Coord coord) Returns whether the local player has line of walk to a coordinate.static booleanlineOfWalkTo(Rect rect) Returns whether the local player has line of walk to a rectangle.static booleanlineOfWalkTo(Unit unit) Returns whether the local player has line of walk to a unit.static intmanhattanDistanceTo(Coord coord) Returns Manhattan distance from the local player to a coordinate, orInteger.MAX_VALUEwhen unavailable.static intmanhattanDistanceTo(Rect rect) Returns Manhattan distance from the local player to a rectangle, orInteger.MAX_VALUEwhen unavailable.static intmanhattanDistanceTo(Unit unit) Returns Manhattan distance from the local player to a unit, orInteger.MAX_VALUEwhen unavailable.static booleanmoving()Returns whether the local player is currently moving.static Stringname()Returns the local player's display name, or an empty string when unavailable.static intReturns the local player's orientation, or-1when unavailable.static intprayer()Returns the local player's overhead prayer icon id, or-1when unavailable.static intskull()Returns the local player's skull icon id, or-1when unavailable.static intstance()Returns the local player's stance id, or-1when unavailable.
-
Constructor Details
-
Avatar
public Avatar()
-
-
Method Details
-
kit
Returns the equipped appearance kit id for a body part, or-1when unavailable. -
skull
public static int skull()Returns the local player's skull icon id, or-1when unavailable. -
prayer
public static int prayer()Returns the local player's overhead prayer icon id, or-1when unavailable. -
coord
Returns the local player's coordinate, or(-1, -1, 0)when unavailable. -
area
Returns the local player's occupied area, or a one-tile null area when unavailable. -
animation
public static int animation()Returns the local player's current animation id, or-1when unavailable. -
animating
public static boolean animating()Returns whether the local player is currently animating. -
moving
public static boolean moving()Returns whether the local player is currently moving. -
orientation
public static int orientation()Returns the local player's orientation, or-1when unavailable. -
index
public static int index()Returns the local player's player index, or-1when unavailable. -
stance
public static int stance()Returns the local player's stance id, or-1when unavailable. -
name
Returns the local player's display name, or an empty string when unavailable. -
effects
Returns active effect ids on the local player. -
headMessage
Returns the local player's overhead chat message, or an empty string when unavailable. -
hitmarks
Returns active hitmarks on the local player. -
headbars
Returns active headbar ids on the local player. -
headbarPercent
public static int headbarPercent(int id) Returns the rendered percent for a local-player headbar, or-1when unavailable. -
headbarRendered
public static boolean headbarRendered(int id) Returns whether a local-player headbar is currently rendered. -
healthPercent
public static int healthPercent()Returns the local player's rendered health percent, or-1when unavailable. -
healthRendered
public static boolean healthRendered()Returns whether the local player's health bar is currently rendered. -
facingUnit
public static boolean facingUnit()Returns whether the local player is facing any unit. -
facingUnit
Returns whether the local player is facing the supplied unit. -
faceUnit
Returns the unit currently faced by the local player, when available. -
distanceTo
Returns Chebyshev distance from the local player to a coordinate, orInteger.MAX_VALUEwhen unavailable. -
distanceTo
Returns Chebyshev distance from the local player to a unit, orInteger.MAX_VALUEwhen unavailable. -
distanceTo
Returns Chebyshev distance from the local player to a rectangle, orInteger.MAX_VALUEwhen unavailable. -
manhattanDistanceTo
Returns Manhattan distance from the local player to a coordinate, orInteger.MAX_VALUEwhen unavailable. -
manhattanDistanceTo
Returns Manhattan distance from the local player to a unit, orInteger.MAX_VALUEwhen unavailable. -
manhattanDistanceTo
Returns Manhattan distance from the local player to a rectangle, orInteger.MAX_VALUEwhen unavailable. -
lineOfSightTo
Returns whether the local player has line of sight to a coordinate. -
lineOfSightTo
Returns whether the local player has line of sight to a unit. -
lineOfSightTo
Returns whether the local player has line of sight to a rectangle. -
lineOfWalkTo
Returns whether the local player has line of walk to a coordinate. -
lineOfWalkTo
Returns whether the local player has line of walk to a unit. -
lineOfWalkTo
Returns whether the local player has line of walk to a rectangle.
-