Dynamax: Mid-Battle Scripting

Section 7.E.6

This plugin adds various new keys to be used by the Deluxe Battle Kit's mid-battle scripting functionality.


Trigger Keys

These are keys which trigger upon a battler utilizing Dynamax.

  • "BeforeDynamax" Triggers when a battler is going to Dynamax this turn, but before that Pokemon actually Dynamaxes.

  • "BeforeGigantamax" Triggers when a battler is going to Gigantamax this turn, but before that Pokemon actually Gigantamaxes.

  • "AfterDynamax" Triggers after a battler successfully Dynamaxes.

  • "AfterGigantamax" Triggers after a battler successfully Gigantamaxes.

Trigger Extensions: You may extend these keys with a species ID or a type ID to specify that they should only trigger when a specific species or species of a specific type triggers Dynamax. For example, "BeforeDynamax_PIKACHU" would trigger only when a Pikachu is about to Dynamax, where "AfterGigantamax_ELECTRIC" would trigger only after an Electric-type has Gigantamaxed.


Command Keys

These are keys which trigger certain actions related to Dynamax to take place during battle, such as forcing a trainer to use Dynamax, or disabling its use.

"dynamax" => Boolean or String

Forces the battler to Dynamax when set to true, as long as they are able to. If set to a string instead, you can customize a message that will display upon this Dynamax triggering. Note that this can even be used to force a wild Pokemon to Dynamax, as long as they are capable of it. If the Pokemon is forced to Dynamax prior to using their move that turn, their selected move will be converted to the Dynamaxed version of that move. Unlike using Dynamax naturally, you can use this to force it to happen at any point in battle, even at the end of the turn or after the battler has already attacked. This cannot happen if a different action with this battler has been chosen however, such as switching it out or using an item.

"disableDynamax" => Boolean

Toggles the availability of Dynamax for the owner of the battler. If set to true, Dynamax will be disabled for this trainer. If set to false, Dynamax will no longer be disabled, allowing this trainer to use it again even if they've already used Dynamax earlier in this battle.


Hardcoding

Here's a list of methods and/or properties that you might want to reference when hardcoding a midbattle script, since this plugin adds a lot of new custom content which you may need to call on to make certain things happen:

Battle Class
  • pbHasDynamaxBand?(idxBattler) Returns true if the trainer who owns the battler at index idxBattler has an item in their inventory flagged as a Dynamax Band.

  • pbGetDynamaxBandName(idxBattler) Returns the name of the specific item in a trainer's inventory flagged as a Dynamax Band. The specific trainer's inventory checked for is the one who owns the battler at index idxBattler.

  • pbCanDynamax?(idxBattler) Returns true if the battler at index idxBattler is capable of using Dynamax.

  • pbDynamax(idxBattler) Begins the Dynamax process for the battler at index idxBattler.

Battle::Battler Class
  • dynamax? Returns true if this battler is in the Dynamax state.

  • gmax? Returns true if this battler is currently Gigantamaxed.

  • emax? Returns true if this battler is currently Eternamaxed.

  • dynamax_able? Returns true if this battler is not flagged in some way as being ineligible for Dynamax.

  • gmax_factor? Returns true if this battler has G-Max Factor.

  • hasDynamax? Returns true if this battler meets all of the necessary conditions to use Dynamax.

  • hasGmax? Returns true if this battler has a Gigantamax form.

  • hasEmax? Returns true if this battler has an Eternamax form.

  • unDynamax Forces a battler's Dynamax state to end, and reverts them back to their original form if necessary.

  • display_dynamax_moves This converts all of the battler's moves into their compatible Max Move equivalents to be displayed in the Fight menu.

Last updated