> For the complete documentation index, see [llms.txt](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/deluxe-battle-rules/rules-battle-visuals.md).

# Rules: Battle Visuals

Section 2.B

These rules edit or replace battle visuals, such as text and animations.

<details>

<summary><mark style="background-color:green;"><strong>"battleIntroText"</strong></mark></summary>

Intro text appears at the start of a battle to introduce the opponent. For example, wild battles typically begin with "A wild \_\_ appeared!", while Trainer battles typically begin with "You are challenged by \_\_!" Use this rule to display custom messages.\
\
This is entered as `setBattleRule("battleIntroText", String)`, where "String" is the message you want to be displayed.\
\
You can use `{1}` in this message text to display the opponent's name. If there are multiple opponents, you can use `{2}` and `{3}` to also display the second and third opponent's names, respectively.\
\
Example:\
`setBattleRule("battleIntroText", "You were ambushed by a wild {1}!")`

</details>

<details>

<summary><mark style="background-color:green;"><strong>"opponentLoseText"</strong></mark></summary>

Use this rule to customize an opponent's loss messages when the player defeats them. This overrides their normal loss messages.\
\
This is entered as `setBattleRule("opponentLoseText", Message)`, where "Message" is either a string or an array of strings. Each string in the array corresponds to an opponent, allowing you to edit the loss text of multiple opposing Trainers in Double or Triple Battles. If the battle has only one opponent, only one string is necessary.\
\
Example: `setBattleRule("opponentLoseText", "No fair! You must have cheated!")`

</details>

<details>

<summary><mark style="background-color:green;"><strong>"opponentWinText"</strong></mark></summary>

Use this rule to customize an opponent's victory messages when they defeat the player. This rule has no effect unless the <mark style="background-color:green;">"towerBattle"</mark> rule is also enabled, because NPC Trainers only display victory messages in Battle Tower-style battles.\
\
This is entered as `setBattleRule("opponentWinText", Message)`, where "Message" is either a string or an array of strings. Each string in the array corresponds to an opponent in this battle. If the battle has only one opponent, only one string is necessary.\
\
Example: `setBattleRule("opponentWinText", "Heh, I knew I'd win!")`

</details>

<details>

<summary><mark style="background-color:green;"><strong>"setSlideSprite"</strong></mark></summary>

Use this rule to customize how the opponent's sprite slides onto the screen at the start of a battle. Control the direction from which it slides and whether a base appears below it. You can emulate Giratina's entrance from above in *Pokémon Platinum* or create other unique scenarios.

This is entered as `setBattleRule("setSlideSprite", String)`, where "String" may be any one of the following strings:

* <mark style="background-color:yellow;">**"side"**</mark>\
  The opponent will slide in from the left side of the screen. This is the standard encounter method, and this will act as the default if no rule is set.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FHZ2BKRsiWB98N6PsHWLK%2Fdemo57.gif?alt=media\&token=067d1921-f425-46d9-b97b-348f6096f08c)
* <mark style="background-color:yellow;">**"top"**</mark>\
  The opponent will slide in from the top of the screen.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FvylASHZeBsOk409OcWuP%2Fdemo58.gif?alt=media\&token=68fa11c5-7328-4be3-835b-af110161c9b7)<br>
* <mark style="background-color:yellow;">**"bottom"**</mark>\
  The opponent will slide upwards, as if rising out of the ground.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FnCyVIsOfGuIr3e0q7Zfh%2Fdemo61.gif?alt=media\&token=0bfcd819-7150-430b-bbaf-5490b9149b6e)<br>
* <mark style="background-color:yellow;">**"still"**</mark>\
  The opponent will remain still, and not slide on screen at all.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FXzbnF3j0uLNoVsMaTn6C%2Fdemo60.gif?alt=media\&token=9914ec19-b544-4db3-9cf2-ecbf871a5f00)

Note: For any of the above strings, add <mark style="background-color:yellow;">"\_hideBase"</mark> to hide the opponent's base and shadow sprites. This can make the opponent appear to float in an abyss. For example, use <mark style="background-color:yellow;">"top\_hideBase"</mark> to emulate Giratina's entrance from above in *Pokémon Platinum*, without base or shadow sprites. The GIFs for each slide-in style show examples with and without a base.

</details>

<details>

<summary><mark style="background-color:green;"><strong>"databoxStyle"</strong></mark></summary>

Use this rule to customize battlers' databoxes during battle. This plugin includes two visual styles by default, and you can add more custom styles. These databoxes are designed primarily for boss encounters, so they omit elements normally shown on opponents' databoxes, such as gender and level.

To set this rule, you may enter `setBattleRule("databoxStyle", Style)`, where "Style" should be a symbol ID of the specific databox style you want to set. This plugin includes the following settable styles by default:

* `:Basic`\
  This applies simple, modernized databoxes to all battlers. The foe's HP bars are longer than normal, and the databoxes provide more space for names. This makes them suitable for special boss encounters.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2Fis348eq5AKW29Wfwl7vn%2F%5B2024-11-04%5D%2018_26_48.113.png?alt=media\&token=12c2b2e5-ecb4-436e-a73a-97166c9a9daf)\
  \
  These databoxes are more compact than Essentials' normal databoxes. They are ideal for Double and Triple Battles because they take up less screen space. However, the player's databoxes do not display HP totals, so this style may not be ideal for single battles. This is the default style when other styles are not eligible for a battler.
* `:Long`\
  This applies a long databox to the foe's side that runs across the top of the screen. It is designed for boss battles to give the opponent a more imposing presence.\
  ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FvhPt7uOE61cBTDrS9j91%2F%5B2024-11-04%5D%2018_27_32.082.png?alt=media\&token=286fa829-fcff-4bd9-8754-2dce768cf191)\
  \
  This databox style only applies to the opponent's side. The player's databoxes default to the `:Basic` style when this style is set. This style only applies if the opponent's side of the field contains one battler slot. If more than one battler slot is present, the opponent's databoxes default to the `:Basic` style.

***

<mark style="background-color:orange;">**Displaying Opponent Titles**</mark>

In *Pokémon Scarlet & Violet*, you can challenge wild Titan Pokémon that act as boss encounters. These Titans have unique titles displayed over their HP bars during battle. For example: "Klawf, the Stony Cliff Titan." You can replicate this mechanic by setting a databox style. However, it only works in wild battles.

Set a databox style and enter an array containing the symbol ID of the desired style, followed by a string that functions as the wild battler's display name on its databox. For example:

```ruby
setBattleRule("databoxStyle", [:Long, "{1} the Long Name-Haver"])
WildBattle.start(:CRABOMINABLE, 50)
```

![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2F1Td9nHrlZjpXyBIkvMsN%2F%5B2024-11-04%5D%2018_27_54.705.png?alt=media\&token=d132c499-1ace-4543-ae04-b78cb059af93)

This begins a battle with a wild Crabominable using the `:Long` style. However, the title set in the rule appears above the wild battler's HP bar instead of its normal name. Use `{1}` in this string to include the battler's actual name in the title. You do not need to include its name if you prefer a completely unique title.

To give each wild Pokémon a unique title in a Double or Triple Battle, add a string to the array for each additional wild battler. For example:

```
setBattleRule("databoxStyle", [:Basic,
  "{1} the First Champion",
  "{1} the Second Champion",
  "{1} the Third Champion"
])
WildBattle.start(:COBALION, 40, :TERRAKION, 40, :VIRIZION, 40)
```

![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2F46eUQ8iv8l7rIhwBFIeP%2F%5B2024-11-04%5D%2018_28_34.514.png?alt=media\&token=25b55c38-34e7-401b-a021-c363e0dd3d48)

This begins a wild Triple Battle against Cobalion, Terrakion, and Virizion using the `:Basic` style. Each wild battler has a unique title displayed above its HP bar.

To give titles only to the first and third opponents in a wild Triple Battle, set the second opponent's title to `"{1}"`. Only its name is then displayed.

***

<mark style="background-color:orange;">**Memento Titles**</mark>

In *Pokémon Scarlet & Violet*, wild Pokémon encountered in Tera Raids sometimes display a title when generated with a mark. For example, a raid Pokémon with the Mightiest Mark displays the title "the Unrivaled" alongside its name.

![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2F2q02IkhrmroFRKhJRaRv%2F%5B2024-11-04%5D%2018_28_12.401.png?alt=media\&token=d1e162c4-fdc5-4a12-b518-54b0e1986781)

This feature is replicated here when the [**Improved Mementos**](https://eeveeexpo.com/resources/1381/) plugin is installed to implement marks and titles. Any wild Pokémon encountered while a databox style is enabled displays its full title over its HP bar.

If you manually set a title through the battle rule, it takes priority over a memento title conferred by a ribbon or mark.

***

<mark style="background-color:orange;">**Adding Custom Databox Styles**</mark>

This plugin includes two databox styles by default, but you can add custom styles with little effort. To do so, implement the following:

<mark style="background-color:yellow;">**Graphics**</mark>

All of the graphics used for databox styles are stored in:\
`Graphics/Plugins/Deluxe Battle Kit/Databoxes`

In this folder, add a new folder containing the graphics for your custom databox style. Name the folder after the symbol ID that refers to the custom style. For example, the existing `Basic` and `Long` folders correspond to the two default styles.

Each folder should contain graphics with the following file names:

* `databox`
* `overlay_hp`
* `overlay_exp`
* `databox_foe`
* `overlay_hp_foe`

If databox graphics for the player or foe's side are missing, databoxes on that side default to the graphics in the `Basic` folder. For example, the `Long` folder contains graphics only for the foe's databox, because only enemy battlers can use that style. When the `Long` style is enabled, the player's databoxes use graphics from the `Basic` folder. If a custom databox style is meant for one side of the field, you do not need to include graphics for the opposing side.

<mark style="background-color:yellow;">**Game Data**</mark>

After setting the graphics, configure the display properties for the custom databox style. Do this in the plugin file `[001] Deluxe Utilities/[008] Databox Styles`.

At the top of the script is a class called `DataboxStyle`, which is included in the `GameData` module. This class stores the display properties for all databox styles. Add a handler for each new databox style alongside the existing `:Basic` and `:Long` handlers.

This section does not cover the implementation in more detail. Review the existing examples and comments in the script. Enter the coordinate values and other display properties in the handler. These are applied to the battle scene when the databoxes load.

</details>
