A Tactical battle: climbing onto a roof. What This Module Does
The framework for battles on the map: Tactical, Action and First Person. It tracks the units, turns, objectives and results; the reactor_fight_* modules add each mode. $gameFight is the running battle.
Example
// Start a Tactical battle against troop 3 right here on the map
$gameFight.start({ mode: "tactical", troopId: 3, canEscape: true });
// Who is still standing on the enemy side?
const foes = $gameFight.units({ team: "enemy", alive: true });
// Be told when it ends
ReactorEvents.on("mapBattleEnd", payload => console.log("Battle over", payload));
Classes & Namespaces
F
86 functions →
Game_Fight
113 functions →
Game_Event
2 functions →
Game_Followers
5 functions →
Game_Player
5 functions →
Game_Follower
1 function →
Game_BattlerBase
1 function →
Game_Actor
1 function →
Game_Map
3 functions →
Scene_Map
3 functions →
Game_Interpreter
2 functions →
Game_Party
1 function →
BattleManager
1 function →
DataManager
3 functions →
Spriteset_Map
3 functions →
Reactor3D
1 function →
Design Notes from the Source Code
Classic battles stay the separate battle scene (Scene_Battle). Tactical, Action and First Person battles happen on the map itself: the fight is a state object beside the map ($gameFight), Scene_Map keeps running, map events keep running, and every unit is an ordinary character (the player, a follower or an event) carrying a Database battler. Damage, skills, items and states go through the stock Game_Action and Game_Battler math.
This file is the framework the three map modes share (docs/DESIGN-BATTLE- MODES.md, phase 1): the mode switch, units, hooks, outcomes and rewards, save and load mid-battle, and a minimal team-turn driver in which every unit approaches its nearest opponent and attacks or uses a skill.
View reactor_fight.js on GitHub · Hide internal (_) functions