Namespace in reactor_fight_stage.js
Stage
69 public functions in 6 groups · show internal (_) functions
Familiar territory. Stage keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.
Quick Reference
Setup & Creation 3
| makeState() | Makes the state. |
| makeBody() | What flies on a 3D map, in the map's own scene so walls hide it: the step's 3D model, or for a plain shot a t… |
| makeSprite() | The picture a flying or shown thing is drawn as: a colored dot, an icon, a picture. |
Getting Information 1
| heightOf() | Height of. |
Checks (True / False) 2
| isBusy() | Whether it is busy. |
| supports() | Supports. |
Actions 14
| put() | Draws a claimed character at a place: tiles, a height above its ground, a facing. |
| release() | Lets a character go: back on its cell as it stood, at once (snap) or eased there. |
| restore() | Restore. |
| playMotion() | Plays the motion. |
| releasePose() | A model eases out of the pose the run left it in; true when it has one to leave. |
| clearPose() | Clears the pose. |
| flash() | A flash on a struck unit: the model's own, or the sprite's blend colour. |
| begin() | Begin. |
| end() | End. |
| dropState() | Drop state. |
| placeBody() | Places a flight's body for this frame: at its point, along its way, tumbling by its spin. |
| dropBody() | Drop body. |
| placeAnchor() | Place anchor. |
| dropOverlay() | Drop overlay. |
Updating & Drawing 5
| update() | Update. |
| animate() | Animate. |
| updateAnchors() | Updates the anchors each frame. |
| drawOverlays() | Places every overlay for this frame; called as the map's sprites update. |
| tick() | Tick. |
Other 44
| yawOfDirection() | Yaw of direction. |
| dir8OfYaw() | Dir8 of yaw. |
| dir4OfYaw() | Dir4 of yaw. |
| face() | Face. |
| is3D() | Whether the map is drawn through the 3D camera. |
| mapSequence() | The sequence as the map plays it: every move of one unit becomes a move to a point worked out by the rules at… |
| mapGoal() | Where one move ends on the grid: from where the unit is, home its cell, facing the cell it faces, clear how n… |
| bodyRadius() | How much room a body takes toward (ux, uy), in tiles from its middle: a standing figure its depth (arms held… |
| stands() | Whether a model is a standing figure (taller than it is wide or deep) rather than a vehicle or a beast. |
| reach() | How far a unit strikes from its middle: an arm, and the weapon in it. |
| clearance() | How near character comes to other to strike it, middle to middle: its reach to the other's body, never inside… |
| kindOf() | What an action is, for the sequence it gets: melee, ranged, magic, item, recovery or area. |
| defaultSequence() | The sequence an action of that kind plays when it has none: the same steps an authored one is made of. |
| sequenceFor() | The sequence a run plays: what the records assign (as a Classic battle resolves it), else the built-in one. |
| claim() | Takes a character onto the stage, remembering how it stood. |
| lift() | Lift. |
| sweep() | Characters a save or a dropped run left staged go back to their cells. |
| holderOf() | Holder of. |
| beat() | A beat in place, over whatever else moves the character: a short lunge toward toward and back, a hop, a flinc… |
| groundOf() | Ground of. |
| bodyPoint() | A point on a character's body, height tiles up it. |
| launchPoint() | Where a shot leaves a unit: the held weapon's tip, the hand, else beside the body. |
| screenOf() | A point on the screen, with how large a tile is drawn there. |
| clearanceOf() | The room a unit of a run leaves when it closes on the one it faces. |
| sequenceInfo() | What a run of that action would be, without starting it, for the camera: how many camera steps its sequence h… |
| homeOf() | Home of. |
| cue() | One step on a unit outside a run (a motion, an animation, a sound): ctx.character plays it. |
| projectile() | The projectile in flight, for the camera: the middle of its cell, its height, how far along it is. |
| adapter() | Adapter. |
| flight() | Flight. |
| mapScene() | The map's 3D scene, when the map is drawn through it. |
| projectileSpec() | The 3D model a projectile step flies: the weapon's, the skill's or item's, or the one the step names. |
| throughEyes() | Whether a battle is seen through this character's own eyes (an Action or First Person battle, the camera in t… |
| hitHeight() | How far up a body something lands: the step's height when it gives one of its own, else mid-body (a sequence'… |
| advanceFlight() | Advance flight. |
| layer() | A Picture or Icon step: shown on its units (or the screen), moved, cleared. |
| react() | A unit struck, missed or healed: the flinch, the sidestep, the flash. |
| warm() | Before the first blow: the sequences the units present can play are resolved a few a frame, and their animati… |
| queueSkills() | The skills a battler can play (its attack, and up to twelve it knows or uses), queued unless readied this ses… |
| warmKey() | Warm key. |
| mapRecords() | The records a battle on this map can bring: its unit events (card, note or page comment), what its events spa… |
| warmMap() | With the map, before any battle: what its units and the party can play is resolved one action a frame while t… |
| warmSome() | Warm some. |
| warmAnimation() | Warm animation. |
Setup & Creation
makeState
static sourceStage.makeState(run, ctx)
Makes the state. (Same as the RPG Maker MZ method of this name.)
makeBody
static sourceStage.makeBody(step, battler, action)
What flies on a 3D map, in the map's own scene so walls hide it: the step's 3D model, or for a plain shot a tracer, a short bright streak.
Details
What flies on a 3D map, in the map's own scene so walls hide it: the step's 3D model, or for a plain shot a tracer, a short bright streak. Null on a flat map and for icons and pictures, which fly as sprites.
makeSprite
static sourceStage.makeSprite(step, battler, action)
The picture a flying or shown thing is drawn as: a colored dot, an icon, a picture.
Details
The picture a flying or shown thing is drawn as: a colored dot, an icon, a picture. Null where nothing draws.
Getting Information
heightOf
static sourceStage.heightOf(character)
Height of. (Same as the RPG Maker MZ method of this name.)
Checks (True / False)
isBusy
static sourceStage.isBusy()
Whether it is busy. (Same as the RPG Maker MZ method of this name.)
supports
static sourceStage.supports(step)
Supports. (Same as the RPG Maker MZ method of this name.)
Actions
put
static sourceStage.put(claim, x, y, z, yaw)
Draws a claimed character at a place: tiles, a height above its ground, a facing.
release
static sourceStage.release(claim, snap)
Lets a character go: back on its cell as it stood, at once (snap) or eased there.
restore
static sourceStage.restore(claim)
Restore. (Same as the RPG Maker MZ method of this name.)
playMotion
static sourceStage.playMotion(claim, step, from, cast)
Plays the motion. (Same as the RPG Maker MZ method of this name.)
releasePose
static sourceStage.releasePose(claim, snap)
A model eases out of the pose the run left it in; true when it has one to leave.
clearPose
static sourceStage.clearPose(claim)
Clears the pose. (Same as the RPG Maker MZ method of this name.)
flash
static sourceStage.flash(character, color, duration)
A flash on a struck unit: the model's own, or the sprite's blend colour.
begin
static sourceStage.begin(run, ctx)
Begin. (Same as the RPG Maker MZ method of this name.)
end
static sourceStage.end(run, ctx, interrupted)
End. (Same as the RPG Maker MZ method of this name.)
dropState
static sourceStage.dropState(state, snap)
Drop state. (Same as the RPG Maker MZ method of this name.)
placeBody
static sourceStage.placeBody(flight)
Places a flight's body for this frame: at its point, along its way, tumbling by its spin.
dropBody
static sourceStage.dropBody(body)
Drop body. (Same as the RPG Maker MZ method of this name.)
placeAnchor
static sourceStage.placeAnchor(entry)
Place anchor. (Same as the RPG Maker MZ method of this name.)
dropOverlay
static sourceStage.dropOverlay(entry)
Drop overlay. (Same as the RPG Maker MZ method of this name.)
Updating & Drawing
update
static sourceStage.update(ctx)
Update. (Same as the RPG Maker MZ method of this name.)
animate
static sourceStage.animate(character, id, where, struck)
Animate. (Same as the RPG Maker MZ method of this name.)
updateAnchors
static sourceStage.updateAnchors()
Updates the anchors each frame. (Same as the RPG Maker MZ method of this name.)
drawOverlays
static sourceStage.drawOverlays()
Places every overlay for this frame; called as the map's sprites update.
tick
static sourceStage.tick()
Tick. (Same as the RPG Maker MZ method of this name.)
Other
yawOfDirection
static sourceStage.yawOfDirection(direction)
Yaw of direction. (Same as the RPG Maker MZ method of this name.)
dir8OfYaw
static sourceStage.dir8OfYaw(yaw)
Dir8 of yaw. (Same as the RPG Maker MZ method of this name.)
dir4OfYaw
static sourceStage.dir4OfYaw(yaw)
Dir4 of yaw. (Same as the RPG Maker MZ method of this name.)
face
static sourceStage.face(character, yaw)
Face. (Same as the RPG Maker MZ method of this name.)
is3D
static sourceStage.is3D()
Whether the map is drawn through the 3D camera.
mapSequence
static sourceStage.mapSequence(sequence, homes, clear)
The sequence as the map plays it: every move of one unit becomes a move to a point worked out by the rules at the top of this file.
Details
The sequence as the map plays it: every move of one unit becomes a move
to a point worked out by the rules at the top of this file. homes are
the units' cells by role (user, target, target0…).
mapGoal
static sourceStage.mapGoal(step, from, home, facing, clear)
Where one move ends on the grid: from where the unit is, home its cell, facing the cell it faces, clear how near the two may come (middle to middle; TILE_STANDOFF when not given).
Details
Where one move ends on the grid: from where the unit is, home its
cell, facing the cell it faces, clear how near the two may come
(middle to middle; TILE_STANDOFF when not given).
bodyRadius
static sourceStage.bodyRadius(character, ux, uy)
How much room a body takes toward (ux, uy), in tiles from its middle: a standing figure its depth (arms held out at rest are not its body), anything else its footprint that way; a sprite a third of a tile.
stands
static sourceStage.stands(character, foot)
Whether a model is a standing figure (taller than it is wide or deep) rather than a vehicle or a beast.
reach
static sourceStage.reach(character, battler, ux, uy)
How far a unit strikes from its middle: an arm, and the weapon in it.
clearance
static sourceStage.clearance(character, battler, other)
How near character comes to other to strike it, middle to middle: its reach to the other's body, never inside either.
kindOf
static sourceStage.kindOf(action, info = {})
What an action is, for the sequence it gets: melee, ranged, magic, item, recovery or area.
defaultSequence
static sourceStage.defaultSequence(kind, info = {})
The sequence an action of that kind plays when it has none: the same steps an authored one is made of.
Details
The sequence an action of that kind plays when it has none: the same
steps an authored one is made of. info: reach (tiles to the
target), self (the user is the only target), magical.
sequenceFor
static sourceStage.sequenceFor(ctx)
The sequence a run plays: what the records assign (as a Classic battle resolves it), else the built-in one.
claim
static sourceStage.claim(character)
Takes a character onto the stage, remembering how it stood.
lift
static sourceStage.lift(claim, z)
Lift. (Same as the RPG Maker MZ method of this name.)
sweep
static sourceStage.sweep()
Characters a save or a dropped run left staged go back to their cells.
holderOf
static sourceStage.holderOf(character)
Holder of. (Same as the RPG Maker MZ method of this name.)
beat
static sourceStage.beat(character, kind, toward)
A beat in place, over whatever else moves the character: a short lunge toward toward and back, a hop, a flinch, a sidestep.
Details
A beat in place, over whatever else moves the character: a short lunge
toward toward and back, a hop, a flinch, a sidestep. Claims the
character for as long as it lasts.
groundOf
static sourceStage.groundOf(character)
Ground of. (Same as the RPG Maker MZ method of this name.)
bodyPoint
static sourceStage.bodyPoint(character, height, out)
A point on a character's body, height tiles up it.
launchPoint
static sourceStage.launchPoint(character, step, out)
Where a shot leaves a unit: the held weapon's tip, the hand, else beside the body.
screenOf
static sourceStage.screenOf(x, y, z, out)
A point on the screen, with how large a tile is drawn there.
clearanceOf
static sourceStage.clearanceOf(state, key)
The room a unit of a run leaves when it closes on the one it faces.
sequenceInfo
static sourceStage.sequenceInfo(info)
What a run of that action would be, without starting it, for the camera: how many camera steps its sequence has, the frames its results land on, its length.
Details
What a run of that action would be, without starting it, for the camera:
how many camera steps its sequence has, the frames its results land on,
its length. info: { unitId, kind, itemId, targetIds }. Null when it cannot be told.
homeOf
static sourceStage.homeOf(character)
Home of. (Same as the RPG Maker MZ method of this name.)
cue
static sourceStage.cue(step, ctx)
One step on a unit outside a run (a motion, an animation, a sound): ctx.character plays it.
projectile
static sourceStage.projectile()
The projectile in flight, for the camera: the middle of its cell, its height, how far along it is.
adapter
static sourceStage.adapter(state)
Adapter. (Same as the RPG Maker MZ method of this name.)
flight
static sourceStage.flight(state, step, battler, owner, target, start)
Flight. (Same as the RPG Maker MZ method of this name.)
mapScene
static sourceStage.mapScene()
The map's 3D scene, when the map is drawn through it.
projectileSpec
static sourceStage.projectileSpec(step, battler, action)
The 3D model a projectile step flies: the weapon's, the skill's or item's, or the one the step names.
throughEyes
static sourceStage.throughEyes(character)
Whether a battle is seen through this character's own eyes (an Action or First Person battle, the camera in the player's head).
hitHeight
static sourceStage.hitHeight(character, authored)
How far up a body something lands: the step's height when it gives one of its own, else mid-body (a sequence's one tile is a shin on a tall model).
advanceFlight
static sourceStage.advanceFlight(flight, time)
Advance flight. (Same as the RPG Maker MZ method of this name.)
layer
static sourceStage.layer(state, step, chosen, characters, start)
A Picture or Icon step: shown on its units (or the screen), moved, cleared.
react
static sourceStage.react(payload)
A unit struck, missed or healed: the flinch, the sidestep, the flash.
warm
static sourceStage.warm()
Before the first blow: the sequences the units present can play are resolved a few a frame, and their animations, pictures and motions made ready, so the first action does not load anything.
queueSkills
static sourceStage.queueSkills(battler, character)
The skills a battler can play (its attack, and up to twelve it knows or uses), queued unless readied this session.
warmKey
static sourceStage.warmKey(battler, skillId)
Warm key. (Same as the RPG Maker MZ method of this name.)
mapRecords
static sourceStage.mapRecords(mapData)
The records a battle on this map can bring: its unit events (card, note or page comment), what its events spawn.
Details
The records a battle on this map can bring: its unit events (card, note or page comment), what its events spawn. [{ record, id }].
warmMap
static sourceStage.warmMap()
With the map, before any battle: what its units and the party can play is resolved one action a frame while the map is quiet, so a battle's first frames load nothing (a sequence's projectile model took 50 ms to build there).
Details
With the map, before any battle: what its units and the party can play is resolved one action a frame while the map is quiet, so a battle's first frames load nothing (a sequence's projectile model took 50 ms to build there). Readied once a session per record, skill and weapons.
warmSome
static sourceStage.warmSome(count)
Warm some. (Same as the RPG Maker MZ method of this name.)
warmAnimation
static sourceStage.warmAnimation(animation)
Warm animation. (Same as the RPG Maker MZ method of this name.)