Namespace in reactor_fight_stage.js

Stage

69 public functions in 6 groups · show internal (_) functions

A Battle Room: a classic battle staged in 3D.

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 source
Stage.makeState(run, ctx)

Makes the state. (Same as the RPG Maker MZ method of this name.)

makeBody

static source
Stage.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 source
Stage.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 source
Stage.heightOf(character)

Height of. (Same as the RPG Maker MZ method of this name.)

Checks (True / False)

isBusy

static source
Stage.isBusy()

Whether it is busy. (Same as the RPG Maker MZ method of this name.)

supports

static source
Stage.supports(step)

Supports. (Same as the RPG Maker MZ method of this name.)

Actions

put

static source
Stage.put(claim, x, y, z, yaw)

Draws a claimed character at a place: tiles, a height above its ground, a facing.

release

static source
Stage.release(claim, snap)

Lets a character go: back on its cell as it stood, at once (snap) or eased there.

restore

static source
Stage.restore(claim)

Restore. (Same as the RPG Maker MZ method of this name.)

playMotion

static source
Stage.playMotion(claim, step, from, cast)

Plays the motion. (Same as the RPG Maker MZ method of this name.)

releasePose

static source
Stage.releasePose(claim, snap)

A model eases out of the pose the run left it in; true when it has one to leave.

clearPose

static source
Stage.clearPose(claim)

Clears the pose. (Same as the RPG Maker MZ method of this name.)

flash

static source
Stage.flash(character, color, duration)

A flash on a struck unit: the model's own, or the sprite's blend colour.

begin

static source
Stage.begin(run, ctx)

Begin. (Same as the RPG Maker MZ method of this name.)

end

static source
Stage.end(run, ctx, interrupted)

End. (Same as the RPG Maker MZ method of this name.)

dropState

static source
Stage.dropState(state, snap)

Drop state. (Same as the RPG Maker MZ method of this name.)

placeBody

static source
Stage.placeBody(flight)

Places a flight's body for this frame: at its point, along its way, tumbling by its spin.

dropBody

static source
Stage.dropBody(body)

Drop body. (Same as the RPG Maker MZ method of this name.)

placeAnchor

static source
Stage.placeAnchor(entry)

Place anchor. (Same as the RPG Maker MZ method of this name.)

dropOverlay

static source
Stage.dropOverlay(entry)

Drop overlay. (Same as the RPG Maker MZ method of this name.)

Updating & Drawing

update

static source
Stage.update(ctx)

Update. (Same as the RPG Maker MZ method of this name.)

animate

static source
Stage.animate(character, id, where, struck)

Animate. (Same as the RPG Maker MZ method of this name.)

updateAnchors

static source
Stage.updateAnchors()

Updates the anchors each frame. (Same as the RPG Maker MZ method of this name.)

drawOverlays

static source
Stage.drawOverlays()

Places every overlay for this frame; called as the map's sprites update.

tick

static source
Stage.tick()

Tick. (Same as the RPG Maker MZ method of this name.)

Other

yawOfDirection

static source
Stage.yawOfDirection(direction)

Yaw of direction. (Same as the RPG Maker MZ method of this name.)

dir8OfYaw

static source
Stage.dir8OfYaw(yaw)

Dir8 of yaw. (Same as the RPG Maker MZ method of this name.)

dir4OfYaw

static source
Stage.dir4OfYaw(yaw)

Dir4 of yaw. (Same as the RPG Maker MZ method of this name.)

face

static source
Stage.face(character, yaw)

Face. (Same as the RPG Maker MZ method of this name.)

is3D

static source
Stage.is3D()

Whether the map is drawn through the 3D camera.

mapSequence

static source
Stage.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 source
Stage.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 source
Stage.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 source
Stage.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 source
Stage.reach(character, battler, ux, uy)

How far a unit strikes from its middle: an arm, and the weapon in it.

clearance

static source
Stage.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 source
Stage.kindOf(action, info = {})

What an action is, for the sequence it gets: melee, ranged, magic, item, recovery or area.

defaultSequence

static source
Stage.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 source
Stage.sequenceFor(ctx)

The sequence a run plays: what the records assign (as a Classic battle resolves it), else the built-in one.

claim

static source
Stage.claim(character)

Takes a character onto the stage, remembering how it stood.

lift

static source
Stage.lift(claim, z)

Lift. (Same as the RPG Maker MZ method of this name.)

sweep

static source
Stage.sweep()

Characters a save or a dropped run left staged go back to their cells.

holderOf

static source
Stage.holderOf(character)

Holder of. (Same as the RPG Maker MZ method of this name.)

beat

static source
Stage.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 source
Stage.groundOf(character)

Ground of. (Same as the RPG Maker MZ method of this name.)

bodyPoint

static source
Stage.bodyPoint(character, height, out)

A point on a character's body, height tiles up it.

launchPoint

static source
Stage.launchPoint(character, step, out)

Where a shot leaves a unit: the held weapon's tip, the hand, else beside the body.

screenOf

static source
Stage.screenOf(x, y, z, out)

A point on the screen, with how large a tile is drawn there.

clearanceOf

static source
Stage.clearanceOf(state, key)

The room a unit of a run leaves when it closes on the one it faces.

sequenceInfo

static source
Stage.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 source
Stage.homeOf(character)

Home of. (Same as the RPG Maker MZ method of this name.)

cue

static source
Stage.cue(step, ctx)

One step on a unit outside a run (a motion, an animation, a sound): ctx.character plays it.

projectile

static source
Stage.projectile()

The projectile in flight, for the camera: the middle of its cell, its height, how far along it is.

adapter

static source
Stage.adapter(state)

Adapter. (Same as the RPG Maker MZ method of this name.)

flight

static source
Stage.flight(state, step, battler, owner, target, start)

Flight. (Same as the RPG Maker MZ method of this name.)

mapScene

static source
Stage.mapScene()

The map's 3D scene, when the map is drawn through it.

projectileSpec

static source
Stage.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 source
Stage.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 source
Stage.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 source
Stage.advanceFlight(flight, time)

Advance flight. (Same as the RPG Maker MZ method of this name.)

layer

static source
Stage.layer(state, step, chosen, characters, start)

A Picture or Icon step: shown on its units (or the screen), moved, cleared.

react

static source
Stage.react(payload)

A unit struck, missed or healed: the flinch, the sidestep, the flash.

warm

static source
Stage.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 source
Stage.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 source
Stage.warmKey(battler, skillId)

Warm key. (Same as the RPG Maker MZ method of this name.)

mapRecords

static source
Stage.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 source
Stage.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 source
Stage.warmSome(count)

Warm some. (Same as the RPG Maker MZ method of this name.)

warmAnimation

static source
Stage.warmAnimation(animation)

Warm animation. (Same as the RPG Maker MZ method of this name.)