> 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-mega-evolution.md).

# Rules: Mega Evolution

These are rules related to Mega Evolution.

<details>

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

You can use this rule to flag wild Pokemon encountered in this battle as capable of using Mega Evolution if they are holding the appropriate Mega Stone, even though they don't have a trainer with a Mega Ring. Wild Pokemon will always Mega Evolve immediately upon being encountered, prior to any commands even being entered.\
\
This is entered as `setBattleRule("wildMegaEvolution")`

When this rule is enabled, the <mark style="background-color:green;">"disablePokeBalls"</mark> Battle Rule is also enabled. This will persist until the wild Mega Pokemon reaches its damage threshold and its Mega Evolved state ends. After which, Poke Balls will become useable again.

If the SOS Battles plugin is installed, the <mark style="background-color:green;">"SOSBattle"</mark> and <mark style="background-color:green;">"totemBattle"</mark> rules are ignored and turned off for this battle.

</details>

<details>

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

You can use this rule to disable the ability to use Mega Evolution for certain trainers in this battle, even if they meet all the criteria otherwise. You can disable this for the player's side of the field, the opponent's, or for all trainers.\
\
This is entered as `setBattleRule("noMegaEvolution", Symbol)`, where "Symbol" can be any one of the following:

* <mark style="background-color:yellow;">:Player</mark>\
  All trainers on the player's side will be unable to use Mega Evolution.
* <mark style="background-color:yellow;">:Opponent</mark>\
  All trainers on the opponent's side will be unable to use Mega Evolution.
* <mark style="background-color:yellow;">:All</mark>\
  All trainers on both sides in this battle will be unable to use Mega Evolution.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/deluxe-battle-rules/rules-mega-evolution.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
