Class in reactor_managers.js

BattleManager

104 public functions in 7 groups · show internal (_) functions

The Database: everything Core loads at boot.

Familiar territory. BattleManager 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 5

setup() Setup.
initMembers() Initializes the members.
makeEscapeRatio() Makes the escape ratio.
makeActionOrders() Makes the action orders.
makeRewards() Makes the rewards.

Getting Information 1

getNextSubject() Gets the next subject.

Checks (True / False) 16

isTpb() Whether it is tpb.
isActiveTpb() Whether it is active tpb.
isBattleTest() Whether it is battle test.
isBusy() Whether it is busy.
isPartyTpbInputtable() Whether it is party tpb inputtable.
needsActorInputCancel() Whether it needs actor input cancel.
isTpbMainPhase() Whether it is tpb main phase.
isInputting() Whether it is inputting.
isInTurn() Whether it is in turn.
isTurnEnd() Whether it is turn end.
isAborting() Whether it is aborting.
isBattleEnd() Whether it is battle end.
canEscape() Whether it can escape.
canLose() Whether it can lose.
isEscaped() Whether it is escaped.
isActionForced() Whether it is action forced.

Actions 30

setBattleTest() Sets the battle test.
setEventCallback() Sets the event callback.
setLogWindow() Sets the log window.
setSpriteset() Sets the spriteset.
saveBgmAndBgs() Saves the bgm and bgs.
playBattleBgm() Plays the battle bgm.
playVictoryMe() Plays the victory me.
playDefeatMe() Plays the defeat me.
startBattle() Starts the battle.
startInput() Starts the input.
selectNextCommand() Selects the next command.
selectNextActor() Selects the next actor.
selectPreviousCommand() Selects the previous command.
selectPreviousActor() Selects the previous actor.
changeCurrentActor() Changes the current actor.
startActorInput() Starts the actor input.
finishActorInput() Finish actor input.
startTurn() Starts the turn.
endBattlerActions() Ends the battler actions.
endTurn() Ends the turn.
endAllBattlersTurn() Ends the all battlers turn.
startAction() Starts the action.
endAction() Ends the action.
applySubstitute() Applies the substitute.
showVictoryInterface() Hands the rewards to the project's Victory interface; false where there is none in use (or a plugin words the…
endBattle() Ends the battle.
gainRewards() Gains the rewards.
gainExp() Gains the exp.
gainGold() Gains the gold.
gainDropItems() Gains the drop items.

Events, Commands & Input 10

onEncounter() Called when encounter happens.
processTurn() Handles the turn.
processForcedAction() Handles the forced action.
processVictory() Handles the victory.
processEscape() Handles the escape.
onEscapeSuccess() Called when escape success happens.
onEscapeFailure() Called when escape failure happens.
processPartyEscape() Handles the party escape.
processAbort() Handles the abort.
processDefeat() Handles the defeat.

Updating & Drawing 13

update() Update.
updatePhase() Updates the phase each frame.
updateEvent() Updates the event each frame.
updateEventMain() Updates the event main each frame.
updateTpbInput() Updates the tpb input each frame.
updateStart() Updates the start each frame.
updateTurn() Updates the turn each frame.
updateTpb() Updates the tpb each frame.
updateAllTpbBattlers() Updates the all tpb battlers each frame.
updateTpbBattler() Updates the tpb battler each frame.
updateTurnEnd() Updates the turn end each frame.
updateAction() Updates the action each frame.
updateBattleEnd() Updates the battle end each frame.

Other 29

ratePreemptive() Rate preemptive.
rateSurprise() Rate surprise.
replayBgmAndBgs() Replay bgm and bgs.
checkTpbInputClose() Check tpb input close.
checkTpbInputOpen() Check tpb input open.
actor() Actor.
displayStartMessages() Display start messages.
inputtingAction() Inputting action.
cancelActorInput() Cancel actor input.
checkTpbTurnEnd() Check tpb turn end.
displayBattlerStatus() Display battler status.
allBattleMembers() All battle members.
invokeAction() Invoke action.
invokeNormalAction() Invoke normal action.
invokeCounterAttack() Invoke counter attack.
invokeMagicReflection() Invoke magic reflection.
checkSubstitute() Check substitute.
forceAction() Force action.
abort() Abort.
checkBattleEnd() Check battle end.
checkAbort() Check abort.
displayVictoryMessage() Display victory message.
displayDefeatMessage() Display defeat message.
displayEscapeSuccessMessage() Display escape success message.
displayEscapeFailureMessage() Display escape failure message.
displayRewards() Display rewards.
displayExp() Display exp.
displayGold() Display gold.
displayDropItems() Display drop items.

Setup & Creation

setup

static source
BattleManager.setup(troopId, canEscape, canLose)

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

initMembers

static source
BattleManager.initMembers()

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

makeEscapeRatio

static source
BattleManager.makeEscapeRatio()

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

makeActionOrders

static source
BattleManager.makeActionOrders()

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

makeRewards

static source
BattleManager.makeRewards()

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

Getting Information

getNextSubject

static source
BattleManager.getNextSubject()

Gets the next subject. (Same as the RPG Maker MZ method of this name.)

Checks (True / False)

isTpb

static source
BattleManager.isTpb()

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

isActiveTpb

static source
BattleManager.isActiveTpb()

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

isBattleTest

static source
BattleManager.isBattleTest()

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

isBusy

static source
BattleManager.isBusy()

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

isPartyTpbInputtable

static source
BattleManager.isPartyTpbInputtable()

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

needsActorInputCancel

static source
BattleManager.needsActorInputCancel()

Whether it needs actor input cancel. (Same as the RPG Maker MZ method of this name.)

isTpbMainPhase

static source
BattleManager.isTpbMainPhase()

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

isInputting

static source
BattleManager.isInputting()

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

isInTurn

static source
BattleManager.isInTurn()

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

isTurnEnd

static source
BattleManager.isTurnEnd()

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

isAborting

static source
BattleManager.isAborting()

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

isBattleEnd

static source
BattleManager.isBattleEnd()

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

canEscape

static source
BattleManager.canEscape()

Whether it can escape. (Same as the RPG Maker MZ method of this name.)

canLose

static source
BattleManager.canLose()

Whether it can lose. (Same as the RPG Maker MZ method of this name.)

isEscaped

static source
BattleManager.isEscaped()

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

isActionForced

static source
BattleManager.isActionForced()

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

Actions

setBattleTest

static source
BattleManager.setBattleTest(battleTest)

Sets the battle test. (Same as the RPG Maker MZ method of this name.)

setEventCallback

static source
BattleManager.setEventCallback(callback)

Sets the event callback. (Same as the RPG Maker MZ method of this name.)

setLogWindow

static source
BattleManager.setLogWindow(logWindow)

Sets the log window. (Same as the RPG Maker MZ method of this name.)

setSpriteset

static source
BattleManager.setSpriteset(spriteset)

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

saveBgmAndBgs

static source
BattleManager.saveBgmAndBgs()

Saves the bgm and bgs. (Same as the RPG Maker MZ method of this name.)

playBattleBgm

static source
BattleManager.playBattleBgm()

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

playVictoryMe

static source
BattleManager.playVictoryMe()

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

playDefeatMe

static source
BattleManager.playDefeatMe()

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

startBattle

static source
BattleManager.startBattle()

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

startInput

static source
BattleManager.startInput()

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

selectNextCommand

static source
BattleManager.selectNextCommand()

Selects the next command. (Same as the RPG Maker MZ method of this name.)

selectNextActor

static source
BattleManager.selectNextActor()

Selects the next actor. (Same as the RPG Maker MZ method of this name.)

selectPreviousCommand

static source
BattleManager.selectPreviousCommand()

Selects the previous command. (Same as the RPG Maker MZ method of this name.)

selectPreviousActor

static source
BattleManager.selectPreviousActor()

Selects the previous actor. (Same as the RPG Maker MZ method of this name.)

changeCurrentActor

static source
BattleManager.changeCurrentActor(forward)

Changes the current actor. (Same as the RPG Maker MZ method of this name.)

startActorInput

static source
BattleManager.startActorInput()

Starts the actor input. (Same as the RPG Maker MZ method of this name.)

finishActorInput

static source
BattleManager.finishActorInput()

Finish actor input. (Same as the RPG Maker MZ method of this name.)

startTurn

static source
BattleManager.startTurn()

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

endBattlerActions

static source
BattleManager.endBattlerActions(battler)

Ends the battler actions. (Same as the RPG Maker MZ method of this name.)

endTurn

static source
BattleManager.endTurn()

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

endAllBattlersTurn

static source
BattleManager.endAllBattlersTurn()

Ends the all battlers turn. (Same as the RPG Maker MZ method of this name.)

startAction

static source
BattleManager.startAction()

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

endAction

static source
BattleManager.endAction()

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

applySubstitute

static source
BattleManager.applySubstitute(target)

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

showVictoryInterface

static source
BattleManager.showVictoryInterface()

Hands the rewards to the project's Victory interface; false where there is none in use (or a plugin words the rewards its own way).

endBattle

static source
BattleManager.endBattle(result)

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

gainRewards

static source
BattleManager.gainRewards()

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

gainExp

static source
BattleManager.gainExp()

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

gainGold

static source
BattleManager.gainGold()

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

gainDropItems

static source
BattleManager.gainDropItems()

Gains the drop items. (Same as the RPG Maker MZ method of this name.)

Events, Commands & Input

onEncounter

static source
BattleManager.onEncounter()

Called when encounter happens. (Same as the RPG Maker MZ method of this name.)

processTurn

static source
BattleManager.processTurn()

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

processForcedAction

static source
BattleManager.processForcedAction()

Handles the forced action. (Same as the RPG Maker MZ method of this name.)

processVictory

static source
BattleManager.processVictory()

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

processEscape

static source
BattleManager.processEscape()

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

onEscapeSuccess

static source
BattleManager.onEscapeSuccess()

Called when escape success happens. (Same as the RPG Maker MZ method of this name.)

onEscapeFailure

static source
BattleManager.onEscapeFailure()

Called when escape failure happens. (Same as the RPG Maker MZ method of this name.)

processPartyEscape

static source
BattleManager.processPartyEscape()

Handles the party escape. (Same as the RPG Maker MZ method of this name.)

processAbort

static source
BattleManager.processAbort()

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

processDefeat

static source
BattleManager.processDefeat()

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

Updating & Drawing

update

static source
BattleManager.update(timeActive)

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

updatePhase

static source
BattleManager.updatePhase(timeActive)

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

updateEvent

static source
BattleManager.updateEvent()

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

updateEventMain

static source
BattleManager.updateEventMain()

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

updateTpbInput

static source
BattleManager.updateTpbInput()

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

updateStart

static source
BattleManager.updateStart()

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

updateTurn

static source
BattleManager.updateTurn(timeActive)

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

updateTpb

static source
BattleManager.updateTpb()

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

updateAllTpbBattlers

static source
BattleManager.updateAllTpbBattlers()

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

updateTpbBattler

static source
BattleManager.updateTpbBattler(battler)

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

updateTurnEnd

static source
BattleManager.updateTurnEnd()

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

updateAction

static source
BattleManager.updateAction()

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

updateBattleEnd

static source
BattleManager.updateBattleEnd()

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

Other

ratePreemptive

static source
BattleManager.ratePreemptive()

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

rateSurprise

static source
BattleManager.rateSurprise()

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

replayBgmAndBgs

static source
BattleManager.replayBgmAndBgs()

Replay bgm and bgs. (Same as the RPG Maker MZ method of this name.)

checkTpbInputClose

static source
BattleManager.checkTpbInputClose()

Check tpb input close. (Same as the RPG Maker MZ method of this name.)

checkTpbInputOpen

static source
BattleManager.checkTpbInputOpen()

Check tpb input open. (Same as the RPG Maker MZ method of this name.)

actor

static source
BattleManager.actor()

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

displayStartMessages

static source
BattleManager.displayStartMessages()

Display start messages. (Same as the RPG Maker MZ method of this name.)

inputtingAction

static source
BattleManager.inputtingAction()

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

cancelActorInput

static source
BattleManager.cancelActorInput()

Cancel actor input. (Same as the RPG Maker MZ method of this name.)

checkTpbTurnEnd

static source
BattleManager.checkTpbTurnEnd()

Check tpb turn end. (Same as the RPG Maker MZ method of this name.)

displayBattlerStatus

static source
BattleManager.displayBattlerStatus(battler, current)

Display battler status. (Same as the RPG Maker MZ method of this name.)

allBattleMembers

static source
BattleManager.allBattleMembers()

All battle members. (Same as the RPG Maker MZ method of this name.)

invokeAction

static source
BattleManager.invokeAction(subject, target)

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

invokeNormalAction

static source
BattleManager.invokeNormalAction(subject, target)

Invoke normal action. (Same as the RPG Maker MZ method of this name.)

invokeCounterAttack

static source
BattleManager.invokeCounterAttack(subject, target)

Invoke counter attack. (Same as the RPG Maker MZ method of this name.)

invokeMagicReflection

static source
BattleManager.invokeMagicReflection(subject, target)

Invoke magic reflection. (Same as the RPG Maker MZ method of this name.)

checkSubstitute

static source
BattleManager.checkSubstitute(target)

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

forceAction

static source
BattleManager.forceAction(battler)

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

abort

static source
BattleManager.abort()

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

checkBattleEnd

static source
BattleManager.checkBattleEnd()

Check battle end. (Same as the RPG Maker MZ method of this name.)

checkAbort

static source
BattleManager.checkAbort()

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

displayVictoryMessage

static source
BattleManager.displayVictoryMessage()

Display victory message. (Same as the RPG Maker MZ method of this name.)

displayDefeatMessage

static source
BattleManager.displayDefeatMessage()

Display defeat message. (Same as the RPG Maker MZ method of this name.)

displayEscapeSuccessMessage

static source
BattleManager.displayEscapeSuccessMessage()

Display escape success message. (Same as the RPG Maker MZ method of this name.)

displayEscapeFailureMessage

static source
BattleManager.displayEscapeFailureMessage()

Display escape failure message. (Same as the RPG Maker MZ method of this name.)

displayRewards

static source
BattleManager.displayRewards()

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

displayExp

static source
BattleManager.displayExp()

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

displayGold

static source
BattleManager.displayGold()

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

displayDropItems

static source
BattleManager.displayDropItems()

Display drop items. (Same as the RPG Maker MZ method of this name.)