Interface CombatCollision
public interface CombatCollision
One detached collision read from the local player's tile, returned by
ctx.combat.collision() and reusable
for every candidate target of one decision. It checks a conservative corridor that rejects movement and projectile
walls; it does not promise the server will accept an attack. Pair it with ctx.travel.reachability() for
"can I get to a tile I can hit from".-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe facade that hands out collision reads:ctx.combat. -
Method Summary
Modifier and TypeMethodDescriptionnet.runelite.api.coords.WorldPointapproachTile(net.runelite.api.coords.WorldPoint target, int size, SceneReachability reachable) A standable cardinal tile from which a melee attack reaches the target, preferring tiles the reachability read can walk to.booleanhasAttackCorridor(net.runelite.api.coords.WorldPoint target, int size, int range) booleanhasReachableApproach(net.runelite.api.coords.WorldPoint target, int size, SceneReachability reachable) booleannet.runelite.api.coords.WorldPointorigin()
-
Method Details
-
isAvailable
boolean isAvailable()- Returns:
- false when the scene could not be read: every check below then answers false or null
-
origin
net.runelite.api.coords.WorldPoint origin()- Returns:
- the local player's tile the read was taken from, or null when unavailable
-
hasAttackCorridor
boolean hasAttackCorridor(net.runelite.api.coords.WorldPoint target, int size, int range) - Parameters:
target- the target's south-west tilesize- the target's footprint in tiles (1 to 64)range- the attack range in tiles; 1 is melee, which needs a cardinal neighbour- Returns:
- whether an attack from
origin()has a clear line to the target
-
approachTile
net.runelite.api.coords.WorldPoint approachTile(net.runelite.api.coords.WorldPoint target, int size, SceneReachability reachable) A standable cardinal tile from which a melee attack reaches the target, preferring tiles the reachability read can walk to.- Parameters:
target- the target's south-west tilesize- the target's footprint in tiles (1 to 64)reachable- a reachability read from the same tile, or null- Returns:
- the tile, or null when there is none or the read is unavailable
-
hasReachableApproach
boolean hasReachableApproach(net.runelite.api.coords.WorldPoint target, int size, SceneReachability reachable) - Parameters:
target- the target's south-west tilesize- the target's footprint in tiles (1 to 64)reachable- a reachability read taken from the same tile- Returns:
- true only when collision and the flood fill agree on a reachable cardinal attack tile
-