Namespace in reactor_fight_classic.js

C

25 functions in 5 groups · hide internal

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

Quick Reference

Setup & Creation 1

makeTroop() The troop record for rows (C.take's), with the id it will stand at: the end of $dataTroops.

Checks (True / False) 2

isRunning() Whether a battle made here is running (from start until its battle scene has ended).
isSideView() Whether it is side view.

Actions 6

take() The rows that fight. With a list (events: Game_Events or event ids): the enemy rows among them and, unless gr…
start() Open the battle screen against the rows C.take gives for events.
removeRecord() Takes the made record out of $dataTroops: off the end of the list, or its place left empty when another recor…
close() Ends the battle made here.
leave() The battle screen is left for good, whoever opened it: a battle made here ends, the stage tried for it is dro…
drop() Forgets a battle made here whose scene never ended: when the game is made anew (New Game, a loaded save), and…

Events, Commands & Input 1

onResult() The battle's own word for its end (BattleManager's event callback).

Other 15

sceneUp() Whether a battle screen is up, about to be, or under a scene pushed over it.
unitNow() The unit a live event is now, where the battle core has no one answer yet: its row, on the side Change Unit S…
rowOf() The enemy row an event is: { event, eventId, enemyId, remembered }, or null.
troopName() The members' names as a troop is named: each name once, in order, with its count ("Raider*2, Raider Cutter").
troopLine() The line troops stand on in this project, as a part of the battle field's height: the middle of the heights t…
positions() Where count members stand, nearest first, in the battle field's own units (width by height).
fieldSize() The battle field's size: the area troop members are placed in.
emptyPage() One troop page that never runs: no condition is set.
tryStage() Tries the pictures the stock choice by terrain names for the party's place: [{ name, state, image } | null, ……
stagePending() Whether a tried picture has not answered yet and the wait for it is not over.
stageName() The battleback to show: name, or none where it is the stock picture tried for this battle and the project doe…
resultNow() The result of a battle that ended without saying so, read from who is left: the party fallen, the troop falle…
settle() Takes the result: after a win or an escape the members that fell are defeated units.
defeat() A member that fell: its event leaves the map as Erase Event has it leave, and a row that is remembered goes o…
comesBack() Whether the battle scene is left for a scene that returns to it (one pushed over it): the battle goes on.

Setup & Creation

makeTroop

static source
C.makeTroop(rows)

The troop record for rows (C.take's), with the id it will stand at: the end of $dataTroops.

Checks (True / False)

isRunning

static source
C.isRunning()

Whether a battle made here is running (from start until its battle scene has ended).

isSideView

static source
C.isSideView()

Whether it is side view.

Actions

take

static source
C.take(events, group)

The rows that fight. With a list (events: Game_Events or event ids): the enemy rows among them and, unless group is false, every enemy row of the map within C.GROUP tiles of one of those.

Details

The rows that fight. With a list (events: Game_Events or event ids): the enemy rows among them and, unless group is false, every enemy row of the map within C.GROUP tiles of one of those. With no list: every enemy row of the map. In order of their straight-line distance from the leader's tile, the nearest C.MAX of them; the rest stay on the map.

start

static source
C.start(events, options)

Open the battle screen against the rows C.take gives for events.

Details

Open the battle screen against the rows C.take gives for events. Options: group (true unless false: the rows standing with the ones named fight too), canEscape (true unless false), canLose (false unless true: a loss is Game Over), encounter (true unless false: the party may strike first or be surprised, as in a random encounter), onResult (called once with 0 won, 1 escaped, 2 lost, when the battle ends and before the map is back). Returns the made troop's id, or 0 when nothing started: no enemy row to fight, a battle already running here or on the map, or the scene already changing.

removeRecord

static source
C.removeRecord(session)

Takes the made record out of $dataTroops: off the end of the list, or its place left empty when another record stands after it.

close

static source
C.close()

Ends the battle made here.

Details

Ends the battle made here. A battle that never gave its result has it read from who is left, and whoever waits for it is told. The record leaves $dataTroops and $gameTroop is cleared (a save made from here on holds no troop id past the list's end).

leave

static source
C.leave()

The battle screen is left for good, whoever opened it: a battle made here ends, the stage tried for it is dropped, and the map starts no battle of its own until the leader has been out of every enemy's reach once.

drop

static source
C.drop()

Forgets a battle made here whose scene never ended: when the game is made anew (New Game, a loaded save), and at the next start when its battle screen never opened.

Details

Forgets a battle made here whose scene never ended: when the game is made anew (New Game, a loaded save), and at the next start when its battle screen never opened. It had no result.

Events, Commands & Input

onResult

static source
C.onResult(result)

The battle's own word for its end (BattleManager's event callback).

Other

sceneUp

static source
C.sceneUp()

Whether a battle screen is up, about to be, or under a scene pushed over it.

Details

Whether a battle screen is up, about to be, or under a scene pushed over it. A battle made here whose battle screen is none of these never opened (another scene was asked for in its place): it is not running, and the next start forgets it. Before the first scene there is nothing to judge by.

unitNow

static source
C.unitNow(event)

The unit a live event is now, where the battle core has no one answer yet: its row, on the side Change Unit Side last gave it.

rowOf

static source
C.rowOf(event)

The enemy row an event is: { event, eventId, enemyId, remembered }, or null.

Details

The enemy row an event is: { event, eventId, enemyId, remembered }, or null. A row is the event's own In battle setting (rrUnit); it counts while the event is on the map, on the Enemy side, with an enemy record that exists. Tag units, allies, bystanders, actor records and units a command spawned are no part of a Classic battle. remembered: it stays defeated once it falls (F.staysDefeated).

troopName

static source
C.troopName(enemyIds)

The members' names as a troop is named: each name once, in order, with its count ("Raider*2, Raider Cutter").

troopLine

static source
C.troopLine(height)

The line troops stand on in this project, as a part of the battle field's height: the middle of the heights the members of the project's own troops stand at, where the author's battle screen leaves them room.

Details

The line troops stand on in this project, as a part of the battle field's height: the middle of the heights the members of the project's own troops stand at, where the author's battle screen leaves them room. Between C.TOP_Y and C.ROW_Y; C.ROW_Y for a project none of whose troops has a placed member. Members left at the field's top edge and troops that fight on the map are not counted.

positions

static source
C.positions(count, sideView, width, height, line)

Where count members stand, nearest first, in the battle field's own units (width by height).

Details

Where count members stand, nearest first, in the battle field's own units (width by height). line is the line one row stands on, as a part of the height (C.ROW_Y when left out). Up to C.ONE_ROW in one row, spread evenly. More in two rows: the nearer half in front, the rest behind, each standing in a gap of the front row. A side-view game uses the left C.SIDE_WIDTH of the field.

fieldSize

static source
C.fieldSize()

The battle field's size: the area troop members are placed in.

emptyPage

static source
C.emptyPage()

One troop page that never runs: no condition is set.

tryStage

static source
C.tryStage()

Tries the pictures the stock choice by terrain names for the party's place: [{ name, state, image } | null, …].

stagePending

static source
C.stagePending()

Whether a tried picture has not answered yet and the wait for it is not over.

stageName

static source
C.stageName(index, name)

The battleback to show: name, or none where it is the stock picture tried for this battle and the project does not have it.

resultNow

static source
C.resultNow()

The result of a battle that ended without saying so, read from who is left: the party fallen, the troop fallen, or neither.

settle

static source
C.settle(session, result)

Takes the result: after a win or an escape the members that fell are defeated units.

defeat

static source
C.defeat(mapId, member)

A member that fell: its event leaves the map as Erase Event has it leave, and a row that is remembered goes on the list of the defeated, so it stays gone when the map is entered again.

comesBack

static source
C.comesBack(scene)

Whether the battle scene is left for a scene that returns to it (one pushed over it): the battle goes on.