📒
Deluxe Battle Kit Tutorial
  • Deluxe Battle Kit for v21.1
    • Deluxe Animations
      • Animation: Databoxes
      • Animation: Item Usage
      • Animation: Fleeing Pokemon
      • Animation: Mega Evolution
      • Animation: Primal Reversion
      • Animation: Shadow Pokemon
    • Deluxe Battle Rules
      • Rules: Battle Modes
      • Rules: Battle Visuals
      • Rules: Battle Audio
      • Rules: Editing the Player
      • Rules: Mega Evolution
      • Rules: Capturing Pokemon
      • Rules: Editing Wild Pokemon
    • Wild Boss Attributes
      • Attribute: Boosted HP
      • Attribute: Immunities
    • Mid-Battle Scripting
      • Trigger Keys
        • Triggers: Round Phases
        • Triggers: Battler Turns
        • Triggers: Item Usage
        • Triggers: Wild Capture
        • Triggers: Switching
        • Triggers: Megas & Primals
        • Triggers: Move Usage
        • Triggers: Damage Results
        • Triggers: Battler Condition
        • Triggers: End of Effects
        • Triggers: End of Battle
        • Triggers: Variable
        • Triggers: Choices
        • Triggers: Extensions
          • Extensions: User
          • Extensions: Frequency
      • Command Keys
        • Commands: Text & Speech
        • Commands: Audio & Animation
        • Commands: Utilities
        • Commands: Battle Mechanics
        • Commands: Battler Attributes
        • Commands: Battlefield Conditions
        • Commands: Extensions
      • Advanced Scripting
        • Advanced: Speech Utilities
          • Speech: General
          • Speech: Choices
          • Speech: Speakers
        • Advanced: Variable Utilities
        • Advanced: Storing Scripts
        • Advanced: Hardcoding
        • Advanced: Global Scripts
    • Example Battles
      • Examples: Wild Battles
      • Examples: Trainer Battles
    • Miscellaneous Utilities
    • Add-On Tutorials
      • Enhanced Battle UI
        • UI: Battler Info
        • UI: Poke Ball Shortcut
        • UI: Move Info
      • SOS Battles
        • SOS: Plugin Overview
        • SOS: PBS Data
        • SOS: Battle Rules
        • SOS: Mid-Battle Scripting
      • Raid Battles
      • Z-Power
        • Z-Power: Z-Moves
        • Z-Power: Ultra Burst
        • Z-Power: Animations
        • Z-Power: Battle Rules
        • Z-Power: Mid-Battle Scripting
      • Dynamax
        • Dynamax: Properties
        • Dynamax: Move Data
        • Dynamax: Form Data
        • Dynamax: Animations
        • Dynamax: Battle Rules
        • Dynamax: Mid-Battle Scripting
      • Terastallization
        • Terastal: Tera Types
        • Terastal: Tera Forms
        • Terastal: Animations
        • Terastal: Battle Rules
        • Terastal: Mid-Battle Scripting
      • Improved Item AI
        • Item AI: Handlers
      • Wonder Launcher
        • Launcher: Plugin Overview
        • Launcher: PBS Data
        • Launcher: Battle Rules
        • Launcher: Mid-Battle Scripting
      • Animated Pokemon System
        • Animated: Pokemon Sprites
        • Animated: Dynamic Sprite Effects
        • Animated: UI Sprites
        • Animated: Sprite Editor
        • Animated: Mid-Battle Scripting
      • Animated Trainer Intros
        • Intros: Trainer Sprites
        • Intros: Sprite Editor
        • Intros: UI Sprites
        • Intros: Battle Transitions
        • Intos: Mid-Battle Scripting
Powered by GitBook
On this page

Was this helpful?

  1. Deluxe Battle Kit for v21.1
  2. Example Battles

Examples: Trainer Battles

Section 5.B

Trainer Battle Example # 1

The example below demonstrates a 1v1 quiz battle vs Gym Leader Opal, as she appeared in Pokemon Sword & Shield. In this battle, the following rule is set:

  • "midbattleScript" is used to set a script to use for this battle which does the following:

    • At the end of the first round, Opal quizes the player on what her nickname is. If the player guesses right, their Pokemon's Speed is increased by 2 stages. If the player guesses wrong, their Pokemon's Speed is decreased by 2 stages.

    • At the end of the third round, Opal quizes the player on her favorite color. If the player guesses right, their Pokemon's defenses are increased by 2 stages. If the player guesses wrong, their Pokemon's defenses are decreased by 2 stages.

    • At the end of the fifth round, Opal quizes the player on her age. If the player guesses the answer she wants to hear, their Pokemon's offenses are increased by 2 stages. If the player guesses wrong, their Pokemon's offenses are decreased by 2 stages.

    • Before Opal speaks a message prior to sending out her final Pokemon.

setBattleRule("midbattleScript", {
  "RoundEnd_1_foe" => {
    "setChoices" => [:nickname, 2, {
                      "The magic-user" => "Bzzt! Too bad!",
                      "The wizard"     => "Ding ding ding! Congratulations, you're correct."
                    }],
    "speech"     => ["Question!", "You...\nDo you know my nickname?", :Choices]
  },
  "ChoiceRight_nickname" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:SPEED, 2]
  },
  "ChoiceWrong_nickname" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:SPEED, -2]
  },
  "RoundEnd_3_foe" => {
    "setChoices" => [:color, 2, {
                      "Pink"   => "That's what I like to see in other people, but it's not what I like for myself.",
                      "Purple" => "Yes, a nice, deep purple...\nTruly grand, don't you think?"
                    }],
    "speech"     => ["Question!", "What is my favorite color?", :Choices]
  },
  "ChoiceRight_color" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:DEFENSE, 2, :SPECIAL_DEFENSE, 2]
  },
  "ChoiceWrong_color" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:DEFENSE, -2, :SPECIAL_DEFENSE, -2]
  },
  "RoundEnd_5_foe" => {
    "setChoices" => [:age, 1, {
                      "16 years old" => "Hah!\nI like your answer!",
                      "88 years old" => "Well, you're not wrong. But you could've been a little more sensitive."
                    }],
    "speech"     => ["Question!", "All righty then... How old am I?", :Choices]
  },
  "ChoiceRight_age" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:ATTACK, 2, :SPECIAL_ATTACK, 2]
  },
  "ChoiceWrong_age" => {
    "setBattler"   => :Opposing,
    "battlerStats" => [:ATTACK, -2, :SPECIAL_ATTACK, -2]
  },
  "BeforeLastSwitchIn_foe" => "My morning tea is finally kicking in, and not a moment too soon!"
})
TrainerBattle.start(:LEADER_Opal, "Opal")

Trainer Battle Example # 2

The example below demonstrates a 1v1 battle vs a Team Rocket grunt who is blocking the exit of a collapsing cave. In this battle, the following rules are set:

  • "canLose" is used to allow the player to continue even if they lose the battle.

  • "victoryBGM" is used to set no victory music to play if you win this battle.

  • "battleIntroText" is used to customize the intro text at the start of the battle.

  • "opponentLoseText" is used to set custom lose text for this trainer when you beat them.

  • "midbattleScript" is used to set a script to use for this battle which does the following:

    • Informs the player at the start of the battle that the cave is collapsing and they have a limited number of turns to win the battle.

    • Plays a sound effect and displays a message at the end of each turn to indicate the cave is in the midst of collapsing.

    • When the HP of the opponent's final Pokemon is low, they will stand their ground to recover some HP, and increase both of their defenses by two stages.

    • At the end of the second round, a falling rock falls on your Pokemon's head, dealing damage to them and causing confusion.

    • At the end of the third round, a message is displayed indicating that the player is almost out of time.

    • At the end of the fourth round, the player has run out of time and is forced to recall their Pokemon and flee the battle to escape the cave.

    • Upon the player forfeiting the match, the opponent will speak a message taunting the player.

setBattleRule("canLose")
setBattleRule("victoryBGM", "")
setBattleRule("battleIntroText", "{1} blocks your escape!")
setBattleRule("opponentLoseText", "H-hey wait! Don't abandon me in here...")
setBattleRule("midbattleScript", {
  "RoundStartCommand_1_foe" => {
    "playSE"  => "Mining collapse",
    "text_A"  => "The cave ceiling begins to crumble down all around you!",
    "speech"  => ["I am not letting you escape!", "I don't care if this whole cave collapses down on the both of us...haha!"],
    "text_B"  => "Defeat your opponent before time runs out!"
  },
  "RoundEnd_player_repeat" => {
    "playSE" => "Mining collapse",
    "text"   => "The cave continues to collapse all around you!"
  },
  "RoundEnd_2_player" => {
    "text"          => "{1} was struck on the head by a falling rock!",
    "playAnim"      => [:ROCKSMASH, :Opposing, :Self],
    "battlerHP"     => -4,
    "battlerStatus" => :CONFUSED
  },
  "RoundEnd_3_player" => {
    "text" => ["You're running out of time!", "You need to escape immediately!"]
  },
  "RoundEnd_4_player" => {
    "text_A"    => "You failed to defeat your opponent in time!",
    "playAnim"  => ["Recall", :Self],
    "text_B"    => "You were forced to flee the battle!",
    "playSE"    => "Battle flee",
    "endBattle" => 3
  },
  "LastTargetHPLow_foe" => {
    "speech"       => "My {1} will never give up!",
    "endSpeech"    => true,
    "playAnim"     => [:BULKUP, :Self],
    "playCry"      => :Self,
    "battlerHP"    => [2, "{1} is standing its ground!"],
    "battlerStats" => [:DEFENSE, 2, :SPECIAL_DEFENSE, 2]
  },
  "BattleEndForfeit" => "Haha...you'll never make it out alive!"
})
TrainerBattle.start(:TEAMROCKET_M, "Grunt", 1)
PreviousExamples: Wild BattlesNextMiscellaneous Utilities

Last updated 10 months ago

Was this helpful?