Launcher: Mid-Battle Scripting

Section 7.H.4

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 at various points when a trainer's total LP changes.

  • "TrainerGainedLP" Triggers when a trainer's LP total increases.

  • "TrainerLostLP" Triggers when a trainer's LP total decreases


Command Keys

These are keys which trigger certain actions during Wonder Launcher battles.

"setLP" => Integer or Array

This may be used to manipulate the total LP a trainer has. When set as an integer, that number will be added to the total LP total of whichever trainer owns the Pokemon who triggered this midbattle key.

If set as an array, you can input two numbers - the first of which is the number of LP points to add, and the second number being the index number of a particular battler. Whichever trainers owns the Pokemon at that index will have their LP increased by the value of that first number.

"disableLP" => Boolean

Toggles the ability of a trainer to gain, spend, or accrue any LP during this battle. If set to true, a trainer's LP will be locked and disabled. When set to false, this flag is removed, allowing the trainer to gain and use LP again, if they are able to.


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
  • launcherBattle? Returns true if the current battle is a Wonder Launcher battle and returns false otherwise.

  • pbCanUseLauncher?(idxBattler) Returns true if the trainer who owns the battler at the entered index is capable of using the Wonder Launcher.

  • pbToggleLauncher(idxBattler, toggle = nil) Toggles the ability to use the Wonder Launcher for the trainer who owns the battler at the entered index. Set toggle to true or false to set whether the trainer's ability to launch items on or off, respectively. If you leave toggle as nil, then the trainer's launcher availability will just be inverted from its current availability.

  • pbIncreaseLauncherPoints(idxBattler, points, showBar = false) Increases the LP of the trainer who owns the battler at the entered index. Set points to the value you want to raise the trainer's LP by. If showBar is set to true, then the trainer's LP splash bar will animate upon increasing LP. If left false, LP will be increased silently.

  • pbReduceLauncherPoints(idxBattler, item, showBar = false) Reduces the LP of the trainer who owns the battler at the entered index. Set item to an eligible launcher item to reduce the trainer's LP by that item's LP cost. If showBar is set to true, then the trainer's LP splash bar will animate upon reducing LP. If left false, LP will be increased silently.

  • pbSetLauncherItems(idxSide, idxTrainer) Replaces a trainer's inventory with the Wonder Launcher inventory. Set idxSide to the index of the side of the field that the target trainer is on (0 for player side, 1 for foes), and idxTrainer to the index of that specific trainer on that side.

Last updated