Projectile

Methods
22
Fields
None

Methods

MethodReturnsDescription
getId()numberThe spot animation (SpotanimID).
getSourceLevel()numberThe plane it starts on.
getSourcePoint()WorldPointThe world tile it starts at.
getTargetLevel()numberThe plane it ends on.
getTargetPoint()WorldPointThe world tile it ends at.
getTarget()LocalPoint?The centre of its target tile as a local point of the top level (LocalPoint.fromWorld(topLevel, getTargetPoint())), nil when the tile i…
getTargetActor()Actor?The actor it is aimed at, looked up in the top-level world view, or nil when it is aimed at a tile (or the actor is gone).
getInteracting()Actor?The same as getTargetActor().
getSourceActor()Actor?The actor it was fired from, looked up in the top-level world view, or nil (fired from a tile, or the actor is gone).
getStartCycle()numberThe client cycle it starts moving at.
getEndCycle()numberThe client cycle it reaches its target (and despawns) at.
getRemainingCycles()numberClient cycles until it reaches its target: getEndCycle() minus the client's cycle now.
getX()numberIts local x now.
getY()numberIts local y now.
getZ()numberIts height now.
getOrientation()numberIts yaw (JAU, 0..2047).
getStartHeight()numberHow far above the ground at its source it starts, in the units of Perspective.getTileHeight: it starts at the tile height there minus thi…
getEndHeight()numberHow far above the ground at its target it ends, in the units of Perspective.getTileHeight: it ends at the tile height there minus this.
getAnimation()Animation?The animation it plays (its spot animation's), nil when it plays none.
getAnimationFrame()numberThe frame of its animation it is on; -1 when it plays none.
getSlope()number?How steeply it arcs: the angle it leaves at, larger for a higher arc. nil for a projectile sent without one (the class's note).
getStartPos()number?How far from its source, along the line to its target, it starts (128 to a tile). nil for a projectile sent without one (the class's note…

Returned by

MethodReturnsDescription
Client.getProjectiles{Projectile}Every projectile in flight.
ProjectileMoved.getProjectileProjectileThe projectile.

Method details

getTarget

getTarget: (Projectile) -> LocalPoint?

The centre of its target tile as a local point of the top level (LocalPoint.fromWorld(topLevel, getTargetPoint())), nil when the tile is outside the scene. It does not follow an aimed-at actor.

getTargetActor

getTargetActor: (Projectile) -> Actor?

The actor it is aimed at, looked up in the top-level world view, or nil when it is aimed at a tile (or the actor is gone).

getSourceActor

getSourceActor: (Projectile) -> Actor?

The actor it was fired from, looked up in the top-level world view, or nil (fired from a tile, or the actor is gone).

getRemainingCycles

getRemainingCycles: (Projectile) -> number

Client cycles until it reaches its target: getEndCycle() minus the client's cycle now.

getStartHeight

getStartHeight: (Projectile) -> number

How far above the ground at its source it starts, in the units of Perspective.getTileHeight: it starts at the tile height there minus this.

getEndHeight

getEndHeight: (Projectile) -> number

How far above the ground at its target it ends, in the units of Perspective.getTileHeight: it ends at the tile height there minus this.

getSlope

getSlope: (Projectile) -> number?

How steeply it arcs: the angle it leaves at, larger for a higher arc. nil for a projectile sent without one (the class's note).

getStartPos

getStartPos: (Projectile) -> number?

How far from its source, along the line to its target, it starts (128 to a tile). nil for a projectile sent without one (the class's note).