Namespace: BattleManager

BattleManager

The static class that manages battle progress.

Methods

BattleManager.abort()static

Set the battle phase to aborting

BattleManager.actor()Game_Actor | nullstatic

Get the current actor
Returns:
TypeDescription
Game_Actor|nullThe current selected actor, or null if no current actor

BattleManager.allBattleMembers()Arraystatic

Gets all the battle members (troops and party)
Returns:
TypeDescription
ArrayArray of all the battle members

BattleManager.applySubstitute(target)Game_Battlerstatic

Check if there is a substitute that will replace the target
NameTypeDescription
targetGame_BattlerThe original target
Returns:
TypeDescription
Game_BattlerThe new target (possibly just the original target if no substitute found)

BattleManager.canEscape()booleanstatic

Check if the battle can be escaped from
Returns:
TypeDescription
booleanTrue if can escape

BattleManager.canLose()booleanstatic

Check if the battle can be lost without gameover
Returns:
TypeDescription
booleanTrue if can lose

BattleManager.cancelActorInput()static

Handles cancelling of actor input

BattleManager.changeCurrentActor(forward)static

Changes the currently selected actor
NameTypeDescription
forwardbooleanIf the select moves forward through the battle actors

BattleManager.checkAbort()booleanstatic

Check if the battle is aborting
Returns:
TypeDescription
booleanTrue if aborting the battle

BattleManager.checkBattleEnd()booleanstatic

Check if the battle is over (escaped, game party dead, troop dead, etc).
Returns:
TypeDescription
booleanTrue if the battle is over

BattleManager.checkSubstitute(target)booleanstatic

Check if should try to substitute the target
NameTypeDescription
targetGame_BattlerThe original target
Returns:
TypeDescription
booleanTrue if should attempt to substitute

BattleManager.checkTpbInputClose()static

Handles when TPB input closes

BattleManager.checkTpbInputOpen()static

Handles when TPB input opens

BattleManager.checkTpbTurnEnd()static

Check for if TPB turn should end

BattleManager.displayBattlerStatus(battler, current)static

Displays the battler's status in the log window
NameTypeDescription
battlerGame_BattlerThe battler to display
currentbooleanIf displays current state too

BattleManager.displayDefeatMessage()static

Displays the defeat message

BattleManager.displayDropItems()static

Displays the item rewards

BattleManager.displayEscapeFailureMessage()static

Displays the escape failure message

BattleManager.displayEscapeSuccessMessage()static

Displays the escape success message

BattleManager.displayExp()static

Displays the exp reward

BattleManager.displayGold()static

Displays the gold reward

BattleManager.displayRewards()static

Displays the various reward types

BattleManager.displayStartMessages()static

Displays the messages shown at the start of the battle

BattleManager.displayVictoryMessage()static

Displays the victory message

BattleManager.endAction()static

End a battle action

BattleManager.endAllBattlersTurn()static

Ends each battler's turn

BattleManager.endBattle(result)static

Handles ending the battle
NameTypeDescription
resultnumberThe result of the battle. 0 = win, 1 = escape, 2 = loss

BattleManager.endBattlerActions(battler)static

Handling for the end of the battler's actions
NameTypeDescription
battlerGame_BattlerThe battler ending their actions

BattleManager.endTurn()static

Set the phase to turn end

BattleManager.finishActorInput()static

Handles end of actor input

BattleManager.forceAction(battler)static

Force an action for a battler
NameTypeDescription
battlerGame_BattlerThe battler to force an action

BattleManager.gainDropItems()static

Gives the reward items to the party

BattleManager.gainExp()static

Gives the exp to the actors

BattleManager.gainGold()static

Gives the gold to the party

BattleManager.gainRewards()static

Gives the various rewards to the party

BattleManager.getNextSubject()Game_Battler | nullstatic

Get the next subject
Returns:
TypeDescription
Game_Battler|nullThe battler that is the next subject, can be null if none exist

BattleManager.initMembers()static

Initializes battle parameters

BattleManager.inputtingAction()Game_Action | nullstatic

Gets the input action
Returns:
TypeDescription
Game_Action|nullThe Game Action input if current actor exists, else null

BattleManager.invokeAction(subject, target)static

Invokes an action
NameTypeDescription
subjectGame_BattlerThe action's subject
targetGame_BattlerThe action's target

BattleManager.invokeCounterAttack(subject, target)static

Invokes a counter attack
NameTypeDescription
subjectGame_BattlerThe action's subject
targetGame_BattlerThe action's target

BattleManager.invokeMagicReflection(subject, target)static

Invokes a magic reflection
NameTypeDescription
subjectGame_BattlerThe action's subject
targetGame_BattlerThe action's target

BattleManager.invokeNormalAction(subject, target)static

Invokes a normal action
NameTypeDescription
subjectGame_BattlerThe action's subject
targetGame_BattlerThe action's target

BattleManager.isAborting()booleanstatic

Check if currently in the aborting phase
Returns:
TypeDescription
booleanTrue if aborting

BattleManager.isActionForced()booleanstatic

Check if action is forced
Returns:
TypeDescription
booleanTrue if action is forced

BattleManager.isActiveTpb()booleanstatic

Check if the battle system is Active Tpb
Returns:
TypeDescription
booleanTrue if battle system is active tpb

BattleManager.isBattleEnd()booleanstatic

Check if currently in the battle end phase
Returns:
TypeDescription
booleanTrue if battle end phase

BattleManager.isBattleTest()booleanstatic

Check if the battle is just a test battle
Returns:
TypeDescription
booleanTrue if battle test

BattleManager.isBusy()booleanstatic

Check if the battle is currently busy
Returns:
TypeDescription
booleanReturns true when the battle is busy

BattleManager.isEscaped()booleanstatic

Check if the battle is escaped
Returns:
TypeDescription
booleanTrue if escaped

BattleManager.isInTurn()booleanstatic

Check if currently in the turn phase
Returns:
TypeDescription
booleanTrue if in turn phase

BattleManager.isInputting()booleanstatic

Check if currently inputting
Returns:
TypeDescription
booleanTrue if inputting

BattleManager.isPartyTpbInputtable()booleanstatic

Check if TPB can accept input
Returns:
TypeDescription
booleanTrue if TPB can accept input

BattleManager.isTpb()booleanstatic

Check if the battle system is Tpb (wait or active)
Returns:
TypeDescription
booleanTrue if battle system is tpb

BattleManager.isTpbMainPhase()booleanstatic

Check if it is a main TPB phase
Returns:
TypeDescription
booleanTrue if main phase

BattleManager.isTurnEnd()booleanstatic

Check if currently in the turn end phase
Returns:
TypeDescription
booleanTrue if in turn end phase

BattleManager.makeActionOrders()static

Determine the orders actions will execute

BattleManager.makeEscapeRatio()static

Sets up the escape ratio for the battle

BattleManager.makeRewards()static

Create the reward object for the battle (gold, exp, items)

BattleManager.needsActorInputCancel()booleanstatic

Check if need to allow to cancel from the current actor
Returns:
TypeDescription
booleanTrue if can cancel from actor

BattleManager.onEncounter()static

Handling for when the encounter starts

BattleManager.onEscapeFailure()static

When an escape attempt fails

BattleManager.onEscapeSuccess()static

When an escape attempt succeeds

BattleManager.playBattleBgm()static

Starts playing the battle BGM

BattleManager.playDefeatMe()static

Starts playing the battle defeat ME

BattleManager.playVictoryMe()static

Starts playing the battle victory ME

BattleManager.processAbort()static

Processing for aborting the battle

BattleManager.processDefeat()static

Processing for a battle defeat

BattleManager.processEscape()booleanstatic

Processing for an escape attempt
Returns:
TypeDescription
booleanTrue if the escape succeeded

BattleManager.processForcedAction()static

Process a forced action

BattleManager.processPartyEscape()static

Processing for the party escape
Since:
  • Version 1.4.0

BattleManager.processTurn()static

Processing for the turn phase of battle

BattleManager.processVictory()static

Processing for a battle victory

BattleManager.ratePreemptive()numberstatic

Get the preemptive rate
Returns:
TypeDescription
numberThe preemptive rate of the party

BattleManager.rateSurprise()numberstatic

Get the surprise rate
Returns:
TypeDescription
numberThe surprise rate of the party

BattleManager.replayBgmAndBgs()static

Replays the saved BGM and BGS

BattleManager.saveBgmAndBgs()static

Save the currently playing BGM and BGS. Used to replay them later once battle ends.

BattleManager.selectNextActor()static

Selects the next actor

BattleManager.selectNextCommand()static

Selects the next command

BattleManager.selectPreviousActor()static

Selects the previous actor

BattleManager.selectPreviousCommand()static

Selects the previous command

BattleManager.setBattleTest(battleTest)static

Set the battle test parameter for test battles
NameTypeDescription
battleTestbooleanIf the battle is a test battle or not

BattleManager.setEventCallback(callback)static

Sets a callback function for when the battle is over
NameTypeDescription
callbackfunctionCallback function to call when the battle ends

BattleManager.setLogWindow(logWindow)static

Sets the battle log window
NameTypeDescription
logWindowWindowThe battle log window

BattleManager.setSpriteset(spriteset)static

Sets the battle spriteset
NameTypeDescription
spritesetSpritesetThe battle spriteset

BattleManager.setup(troopId, canEscape, canLose)static

Set up the battle
NameTypeDescription
troopIdnumberThe troop ID to fight
canEscapebooleanIf the player can escape from the battle
canLosebooleanIf the player can lose the battle without gameover

BattleManager.startAction()static

Start a battle action

BattleManager.startActorInput()static

Handles start of actor input

BattleManager.startBattle()static

Handling for the start of the battle

BattleManager.startInput()static

Starts the input phase of battle

BattleManager.startTurn()static

Starts the turn phase of the battle

BattleManager.update(timeActive)static

Updates the battle
NameTypeDescription
timeActivebooleanWhether time is currently active for the battle

BattleManager.updateAction()static

Update for a battle action

BattleManager.updateAllTpbBattlers()static

Update all battlers for TPB

BattleManager.updateBattleEnd()static

Update for the end of the battle

BattleManager.updateEvent()booleanstatic

Updates battle events
Returns:
TypeDescription
booleanReturns false when aborting battle

BattleManager.updateEventMain()booleanstatic

Updates main battle events
Returns:
TypeDescription
booleanReturns true when events are running

BattleManager.updatePhase(timeActive)static

Updates the battle phase
NameTypeDescription
timeActivebooleanWhether time is currently active for the battle

BattleManager.updateStart()static

Handles updating for the start phase of battle

BattleManager.updateTpb()static

Update for TPB

BattleManager.updateTpbBattler(battler)static

Update a specific battler for TPB
NameTypeDescription
battlerGame_BattlerThe battler to update

BattleManager.updateTpbInput()static

Updates input for TPB battle system

BattleManager.updateTurn(timeActive)static

Update the turn phase of the battle
NameTypeDescription
timeActivebooleanIf battle time is active

BattleManager.updateTurnEnd()static

Update for when phase is turn end