Class SpellEffects
Lifted from ElorinPvP's engine/Vengeance and engine/FreezeMemo (the cast and freeze graphics),
FreezeClock (the duration rounding) and tasks/TeleblockNode (the Tele Block graphic), without their
fight-state types. This tracker only sees graphics, animations and (optionally) damage; it never sees movement, so
a freeze that BROKE early (the target teleported, or the freeze splashed and the graphic was someone else's) still
reads frozen until its full length. Every length here is an upper bound.
Ids. Graphic ids are OSRS ids and are compared as they are read: no translation. Animation ids go through
the constructor's animationToServer, which maps an OSRS animation id to this server's id. ctx.pvp
.effects() supplies it from ctx.ids' animation translation for Elorin and refuses servers whose effect
cues are not verified. A
cast animation matches its translated id OR the OSRS id itself: ElorinPvP saw the Lunar cast as 4410 unchanged on
Elorin (Vengeance.java:16, the 2026-09-25 capture), where the +19000 animation offset holds only for OSRS-era ids
(ElorinPvPConstants.java:326). A translator that throws, or answers a negative id, is treated as "cannot translate".
Unreadable is unknown. A null graphic, animation, name or damage does not update an effect or count as
"no graphic", so the same graphic read on both sides of an unreadable tick is one cast, not two. A supplied tick
still advances that actor's event ordering; older events are ignored, including after an unreadable sample.
The boolean accessors describe this tracker's observed history, not authoritative current game state: false can
mean that a cue was missed, while true can be stale after an early break or an unobserved hit. In particular,
vengeanceReady(int) is not proof that the spell is ready when no cast was observed. Callers must obtain
independent evidence before using these estimates for safety-critical decisions.
Thread rule: mutable, single-owner. Feed it once per tick from the thread that reads the snapshot.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTicks after a freeze ends during which a new freeze does not land.Freeze hit graphics (OSRS ids) to the seconds each holds for: Ice Rush 361 5, Ice Burst 363 10, Ice Blitz 367 15, Ice Barrage 369 20; Bind 181 5, Snare 180 10, Entangle 179 15.static final int"Never happened".static final intTele Block hit graphic.static final intTele Block length: 300 s (ElorinPvPElorinPvPConstants.TELEBLOCK_SECONDS, ElorinPvPConstants.java:187), 500 ticks.static final intLunar self-cast animation, OSRS id.static final intTicks before Vengeance can be cast again (30 s).static final intVengeance cast graphic. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforgetOpponent(String name) Drops what is known about one opponent (a new fight).booleanfreezeImmune(int tick) Whethertickis in the estimated immunity window after an observed freeze.booleanfrozen(int tick) Whether an observed freeze's estimated upper-bound window includestick.intThe estimated upper-bound end of the last observed freeze, orNEVER.voidobserveLocal(int tick, Integer graphic, Integer animation) One tick's reading of our own graphic and animation; null is unreadable.voidobserveLocalDamage(int tick, Integer damage) A hit on us this tick.voidobserveOpponent(String name, int tick, Integer graphic, Integer animation) One tick's reading of an opponent's graphic and animation; a null name, graphic or animation changes nothing.voidobserveOpponentDamage(String name, int tick, Integer damage) Our hit on an opponent this tick.booleanopponentFreezeImmune(String name, int tick) booleanopponentFrozen(String name, int tick) booleanopponentTeleblocked(String name, int tick) booleanopponentVengeance(String name, int tick) Whether the opponent's Vengeance is up: seen cast, and not yet used by our damaging hit on them.booleanteleblocked(int tick) Whether we are tele-blocked attick(upper bound:TELEBLOCK_TICKSfrom the graphic).intThe estimated upper-bound end of the last observed Tele Block, orNEVER.booleanvengeanceReady(int tick) Whether Vengeance can be cast attick: never seen cast, orVENGEANCE_COOLDOWN_TICKShave passed.intThe first tick Vengeance can be cast again, orNEVERwhen it has not been seen cast.booleanvengeanceUp(int tick) Whether our Vengeance is up: cast seen, and not yet used by a damaging hit reported throughobserveLocalDamage(int, java.lang.Integer)on a later tick.
-
Field Details
-
NEVER
public static final int NEVER"Never happened".- See Also:
-
FREEZE_SECONDS_BY_GRAPHIC
Freeze hit graphics (OSRS ids) to the seconds each holds for: Ice Rush 361 5, Ice Burst 363 10, Ice Blitz 367 15, Ice Barrage 369 20; Bind 181 5, Snare 180 10, Entangle 179 15. Source: ElorinPvPElorinPvPConstants.FREEZE_GRAPHICSandFREEZE_SECONDS_BY_GRAPHIC(ElorinPvPConstants.java:173, :179). The Blood, Shadow and Smoke Barrage graphics (377, 383, 391) do not freeze and are not here. -
FREEZE_IMMUNITY_TICKS
public static final int FREEZE_IMMUNITY_TICKSTicks after a freeze ends during which a new freeze does not land. Source: ElorinPvPPvPSettings.Builder.freezeImmunityTicks = 5(PvPSettings.java:415; config default ElorinPvPConfig.java:399).- See Also:
-
VENGEANCE_GRAPHIC
public static final int VENGEANCE_GRAPHICVengeance cast graphic. Source: ElorinPvPVengeance.GRAPHIC(Vengeance.java:41).- See Also:
-
VENGEANCE_ANIMATION
public static final int VENGEANCE_ANIMATIONLunar self-cast animation, OSRS id. Source: ElorinPvPVengeance.ANIMATION(Vengeance.java:42).- See Also:
-
VENGEANCE_COOLDOWN_TICKS
public static final int VENGEANCE_COOLDOWN_TICKSTicks before Vengeance can be cast again (30 s). Source: ElorinPvPVengeance.COOLDOWN_TICKS(Vengeance.java:43).- See Also:
-
TELEBLOCK_GRAPHIC
public static final int TELEBLOCK_GRAPHICTele Block hit graphic. Source: ElorinPvPElorinPvPConstants.TELEBLOCK_GRAPHICS(ElorinPvPConstants.java:185).- See Also:
-
TELEBLOCK_TICKS
public static final int TELEBLOCK_TICKSTele Block length: 300 s (ElorinPvPElorinPvPConstants.TELEBLOCK_SECONDS, ElorinPvPConstants.java:187), 500 ticks. It is halved when the target prays Protect from Magic as it lands, which this tracker cannot know, so 500 is an upper bound.- See Also:
-
-
Constructor Details
-
SpellEffects
- Parameters:
animationToServer- maps an OSRS animation id to this server's id; null is the identity function.ctx.pvp.effects()suppliesctx.ids' animation translation.
-
-
Method Details
-
observeLocal
-
observeOpponent
-
observeLocalDamage
A hit on us this tick. A damaging hit on a tick after our Vengeance cast uses it; null is unreadable. -
observeOpponentDamage
-
forgetOpponent
Drops what is known about one opponent (a new fight). -
frozen
public boolean frozen(int tick) Whether an observed freeze's estimated upper-bound window includestick. -
frozenUntil
public int frozenUntil()The estimated upper-bound end of the last observed freeze, orNEVER. -
freezeImmune
public boolean freezeImmune(int tick) Whethertickis in the estimated immunity window after an observed freeze. -
opponentFrozen
-
opponentFreezeImmune
-
vengeanceUp
public boolean vengeanceUp(int tick) Whether our Vengeance is up: cast seen, and not yet used by a damaging hit reported throughobserveLocalDamage(int, java.lang.Integer)on a later tick. Without damage reports it stays up once cast. -
vengeanceReady
public boolean vengeanceReady(int tick) Whether Vengeance can be cast attick: never seen cast, orVENGEANCE_COOLDOWN_TICKShave passed. -
vengeanceReadyAt
public int vengeanceReadyAt()The first tick Vengeance can be cast again, orNEVERwhen it has not been seen cast. -
opponentVengeance
Whether the opponent's Vengeance is up: seen cast, and not yet used by our damaging hit on them. -
teleblocked
public boolean teleblocked(int tick) Whether we are tele-blocked attick(upper bound:TELEBLOCK_TICKSfrom the graphic). -
teleblockedUntil
public int teleblockedUntil()The estimated upper-bound end of the last observed Tele Block, orNEVER. -
opponentTeleblocked
-