Core runtime: data, input and the ReactorEvents feed.

Core

Reactor_core

reactor_core.js · 5,945 lines · 138 public functions

Core runtime: data, input and the ReactorEvents feed.

What This Module Does

The heart of the runtime: utilities, graphics setup, input and the ReactorEvents feed. ReactorEvents tells plugins when a battle starts or ends, when HP changes, when a door opens or a vehicle is boarded, so you can react without wrapping engine methods.

Example

// React to battles without patching engine code
const off = ReactorEvents.on("battleEnd", ({ result, escaped }) => {
    if (result === 0) $gameVariables.setValue(10, $gameVariables.value(10) + 1); // count wins
});

// Listen once, then unsubscribe automatically
ReactorEvents.once("battleStart", ({ preemptive }) => {
    if (preemptive) $gameMessage.add("You caught them off guard!");
});

Classes & Namespaces

Design Notes from the Source Code

reactor_core.js v1.7.0 Continued in these parts, which reactor_main.js loads next in this order: reactor_core_display.js reactor_core_io.js

This section contains some methods that will be added to the standard Javascript objects.

@namespace JsExtensions

Makes a shallow copy of the array.

@memberof JsExtensions @returns {array} A shallow copy of the array.

View reactor_core.js on GitHub · Show internal (_) functions