The static class that manages battle progress.
Methods
- Set the battle phase to aborting
BattleManager.actor()Game_Actor | nullstatic
- Get the current actor
Returns:
Type Description Game_Actor|null The current selected actor, or null if no current actor - Gets all the battle members (troops and party)
Returns:
Type Description Array Array of all the battle members BattleManager.applySubstitute(target)Game_Battlerstatic
- Check if there is a substitute that will replace the target
Name Type Description targetGame_Battler The original target Returns:
Type Description Game_Battler The new target (possibly just the original target if no substitute found) - Check if the battle can be escaped from
Returns:
Type Description boolean True if can escape - Check if the battle can be lost without gameover
Returns:
Type Description boolean True if can lose - Handles cancelling of actor input
- Changes the currently selected actor
Name Type Description forwardboolean If the select moves forward through the battle actors - Check if the battle is aborting
Returns:
Type Description boolean True if aborting the battle - Check if the battle is over (escaped, game party dead, troop dead, etc).
Returns:
Type Description boolean True if the battle is over - Check if should try to substitute the target
Name Type Description targetGame_Battler The original target Returns:
Type Description boolean True if should attempt to substitute - Handles when TPB input closes
- Handles when TPB input opens
- Check for if TPB turn should end
- Displays the battler's status in the log window
Name Type Description battlerGame_Battler The battler to display currentboolean If displays current state too - Displays the defeat message
- Displays the item rewards
- Displays the escape failure message
- Displays the escape success message
- Displays the exp reward
- Displays the gold reward
- Displays the various reward types
- Displays the messages shown at the start of the battle
- Displays the victory message
- End a battle action
- Ends each battler's turn
- Handles ending the battle
Name Type Description resultnumber The result of the battle. 0 = win, 1 = escape, 2 = loss - Handling for the end of the battler's actions
Name Type Description battlerGame_Battler The battler ending their actions - Set the phase to turn end
- Handles end of actor input
- Force an action for a battler
Name Type Description battlerGame_Battler The battler to force an action - Gives the reward items to the party
- Gives the exp to the actors
- Gives the gold to the party
- Gives the various rewards to the party
BattleManager.getNextSubject()Game_Battler | nullstatic
- Get the next subject
Returns:
Type Description Game_Battler|null The battler that is the next subject, can be null if none exist - Initializes battle parameters
BattleManager.inputtingAction()Game_Action | nullstatic
- Gets the input action
Returns:
Type Description Game_Action|null The Game Action input if current actor exists, else null - Invokes an action
Name Type Description subjectGame_Battler The action's subject targetGame_Battler The action's target - Invokes a counter attack
Name Type Description subjectGame_Battler The action's subject targetGame_Battler The action's target - Invokes a magic reflection
Name Type Description subjectGame_Battler The action's subject targetGame_Battler The action's target - Invokes a normal action
Name Type Description subjectGame_Battler The action's subject targetGame_Battler The action's target - Check if currently in the aborting phase
Returns:
Type Description boolean True if aborting - Check if action is forced
Returns:
Type Description boolean True if action is forced - Check if the battle system is Active Tpb
Returns:
Type Description boolean True if battle system is active tpb - Check if currently in the battle end phase
Returns:
Type Description boolean True if battle end phase - Check if the battle is just a test battle
Returns:
Type Description boolean True if battle test - Check if the battle is currently busy
Returns:
Type Description boolean Returns true when the battle is busy - Check if the battle is escaped
Returns:
Type Description boolean True if escaped - Check if currently in the turn phase
Returns:
Type Description boolean True if in turn phase - Check if currently inputting
Returns:
Type Description boolean True if inputting - Check if TPB can accept input
Returns:
Type Description boolean True if TPB can accept input - Check if the battle system is Tpb (wait or active)
Returns:
Type Description boolean True if battle system is tpb - Check if it is a main TPB phase
Returns:
Type Description boolean True if main phase - Check if currently in the turn end phase
Returns:
Type Description boolean True if in turn end phase - Determine the orders actions will execute
- Sets up the escape ratio for the battle
- Create the reward object for the battle (gold, exp, items)
- Check if need to allow to cancel from the current actor
Returns:
Type Description boolean True if can cancel from actor - Handling for when the encounter starts
- When an escape attempt fails
- When an escape attempt succeeds
- Starts playing the battle BGM
- Starts playing the battle defeat ME
- Starts playing the battle victory ME
- Processing for aborting the battle
- Processing for a battle defeat
- Processing for an escape attempt
Returns:
Type Description boolean True if the escape succeeded - Process a forced action
- Processing for the party escape
- Since:
- Version 1.4.0
- Processing for the turn phase of battle
- Processing for a battle victory
- Get the preemptive rate
Returns:
Type Description number The preemptive rate of the party - Get the surprise rate
Returns:
Type Description number The surprise rate of the party - Replays the saved BGM and BGS
- Save the currently playing BGM and BGS. Used to replay them later once battle ends.
- Selects the next actor
- Selects the next command
- Selects the previous actor
- Selects the previous command
- Set the battle test parameter for test battles
Name Type Description battleTestboolean If the battle is a test battle or not - Sets a callback function for when the battle is over
Name Type Description callbackfunction Callback function to call when the battle ends - Sets the battle log window
Name Type Description logWindowWindow The battle log window - Sets the battle spriteset
Name Type Description spritesetSpriteset The battle spriteset - Set up the battle
Name Type Description troopIdnumber The troop ID to fight canEscapeboolean If the player can escape from the battle canLoseboolean If the player can lose the battle without gameover - Start a battle action
- Handles start of actor input
- Handling for the start of the battle
- Starts the input phase of battle
- Starts the turn phase of the battle
- Updates the battle
Name Type Description timeActiveboolean Whether time is currently active for the battle - Update for a battle action
- Update all battlers for TPB
- Update for the end of the battle
- Updates battle events
Returns:
Type Description boolean Returns false when aborting battle - Updates main battle events
Returns:
Type Description boolean Returns true when events are running - Updates the battle phase
Name Type Description timeActiveboolean Whether time is currently active for the battle - Handles updating for the start phase of battle
- Update for TPB
- Update a specific battler for TPB
Name Type Description battlerGame_Battler The battler to update - Updates input for TPB battle system
- Update the turn phase of the battle
Name Type Description timeActiveboolean If battle time is active - Update for when phase is turn end