Class AttackCues

java.lang.Object
privbot.mechanics.AttackCues

public final class AttackCues extends Object
Maps the cues an NPC shows when it attacks (its animation id, its projectile id) to the CombatStyle the attack demands, plus the animation ids that are known to be harmless and how many cycles pass between an animation and its projectile launching.

What it proves: only what the plugin author declared. An id that was not declared is unknown, and an unknown id answers null, never a guessed style. Callers must act only on a known attack cue, because animation reads can briefly report ids that are not attacks.

Unreadable looks like: null from animation(int) or projectile(int); there is no default style.

Thread rule: immutable and pure. It reads nothing from the client and is safe on any thread.

  • Method Details

    • builder

      public static AttackCues.Builder builder()
    • none

      public static AttackCues none()
      Cues that know nothing: every lookup answers unknown.
    • animation

      public CombatStyle animation(int id)
      Returns:
      the style for animation id, or null if it is not a declared attack animation.
    • projectile

      public CombatStyle projectile(int id)
      Returns:
      the style for projectile id, or null if it is not a declared attack projectile.
    • passive

      public boolean passive(int animationId)
      Returns:
      true when animationId was declared as a harmless (non-attack) animation.
    • launchOffsetCycles

      public int launchOffsetCycles()
      Returns:
      cycles between an attack animation and its projectile launching (0 unless declared).