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

Battle

Placed Enemies on a Classic Map

reactor_fight_classic.js · 496 lines · 31 public functions

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

What This Module Does

On a map whose battle mode in force is Classic, the enemy units the map's start rule takes open the battle screen (Scene_Battle) as a troop made for that one battle. The troop's record stands at the end of $dataTroops while the battle runs, so $gameTroop.troop() and $dataTroops[id] are real for every reader; it is taken out again when the battle scene has ended.

Classes & Namespaces

Design Notes from the Source Code

On a map whose battle mode in force is Classic, the enemy units the map's start rule takes open the battle screen (Scene_Battle) as a troop made for that one battle. The troop's record stands at the end of $dataTroops while the battle runs, so $gameTroop.troop() and $dataTroops[id] are real for every reader; it is taken out again when the battle scene has ended.

A Classic battle has no joining, so a group is fought whole: an enemy row standing within C.GROUP tiles of one the rule takes comes with it.

The flow is a random encounter's: BattleManager.setup, onEncounter, the count to the next random encounter, the battle scene pushed. The Battle Start sound, the encounter effect, the stage, the music, the rewards and the victory step are the battle screen's own.

When the battle is won or escaped, every member that fell is a defeated unit: its event is erased and, unless it comes back (F.staysDefeated), remembered in the list defeated units are kept in ($gameFight). A lost battle changes nothing on the map.

Two rules here serve the battle screen whoever opened it (Battle Processing, a random encounter, a battle made here):

  • The stage. A stock battleback chosen by terrain that the project does not have is left out, so the battle stands on the map behind it.
  • The hold. After the battle screen the map starts no battle of its own until the leader has been out of every enemy's reach once.

Nothing here runs per frame.

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