diff options
-rw-r--r-- | Force-Set-battle-style-or-forbid-item-usage-in-battle.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Force-Set-battle-style-or-forbid-item-usage-in-battle.md b/Force-Set-battle-style-or-forbid-item-usage-in-battle.md index 9b6dc15..801850c 100644 --- a/Force-Set-battle-style-or-forbid-item-usage-in-battle.md +++ b/Force-Set-battle-style-or-forbid-item-usage-in-battle.md @@ -31,7 +31,7 @@ Edit [constants/battle_constants.asm](../blob/master/constants/battle_constants. + const BATTLETYPE_SET ``` -Here we are adding a new battle type to be used in trainer scripts. In fact, we are technically not forcing a battle style. Rather than directly changing the battle style option to Set, as is done in the Battle Tower, we are simply using a battle type to make an exception for the Pokemon switch check that takes place after defeating a Pokemon. This will be explained further below. +Here we are adding the `BATTLETYPE_SET` constant to be used in trainer scripts. In fact, we are technically not forcing a battle style. Rather than directly changing the battle style option to Set, as it's done in the Battle Tower, we are simply using a battle type to make an exception for the Pokémon switch check that takes place after defeating a Pokémon. This will be explained further below. Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm): @@ -55,7 +55,7 @@ CheckWhetherToAskSwitch: + jr z, .return_nc ``` -This function checks, as its name implies, whether to ask to switch Pokemon after the player defeats a Pokemon in battle. As mentioned above, we are not checking for the actual battle style option selected by the player, but simply checking if `BATTLETYPE_SET` is being used for the battle in question. If it is, then the check ends and the switch question is skipped. +This function checks, as its name implies, whether to ask to switch Pokémon after the player defeats a Pokémon in battle. As mentioned above, we are not checking for the actual battle style option selected by the player, but simply checking if `BATTLETYPE_SET` is being used for the battle in question. If it is, then the check ends and the switch question is skipped. ## 2. Forbid item usage @@ -104,12 +104,11 @@ CheckWhetherToAskSwitch: ld a, [wBattleType] cp BATTLETYPE_SET jr z, .return_nc -+ ld a, [wBattleType] + cp BATTLETYPE_SETNOITEMS + jr z, .return_nc ``` -As we did in the second part of step 1, we are adding the check for our second new battle type, which will also be forcing the Set battle style. If you made a third constant that forbid items but did not force Set, you would not run a check for that third constant here. +As we did in the second part of step 1, we're adding the check for our second new battle type, which will also be forcing the Set battle style. If you made a third constant that forbid items but didn't force Set, you wouldn't run a check for that third constant here. Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm) one last time: @@ -124,11 +123,12 @@ BattleMenu_Pack: + jp z, .ItemsCantBeUsed ``` -Here, we are adding a check in order to skip the battle pack call, which would load the pack once selected. Similar to the link battle check already in the code, this new check will check whether we are using `BATTLETYPE_SETNOITEMS`. If so, we jump to `.ItemsCantBeUsed`, which skips the pack call and loads text saying that items can't be used. If you added the third constant, you would want the same check for that battle type here as well. +Here, we are adding a check in order to skip the Battle Pack call, which would load the pack once selected. Similar to the link battle check already in the code, this new one will check whether we are using `BATTLETYPE_SETNOITEMS`. If so, we jump to `.ItemsCantBeUsed`, which skips the pack call and loads text saying that items can't be used. If you added the third constant, you would want the same check for that battle type here as well. + ## 3. Implement the new battle types in a trainer battle -Now that the battle types and checks have been implemented, it's time to add one to a trainer battle script. We will use the battle with Red as an example. +Now that the battle types and checks have been implemented, it's time to add one to a trainer battle script. We'll use the battle with Red as an example. Edit [maps/SilverCaveRoom3.asm](../blob/master/maps/SilverCaveRoom3.asm): @@ -146,4 +146,4 @@ Red: startbattle ``` -Voilà! With that battle type set, the player will not be asked whether they would like to switch Pokemon after defeating one, regardless of which battle style has been selected in Options. If you would like to have both this and forbidden items in the same battle, swap out `BATTLETYPE_SET` for `BATTLETYPE_SETNOITEMS`.
\ No newline at end of file +Voilà! With that battle type set, the player won't be asked whether they would like to switch Pokémon after defeating one, regardless of which battle style has been selected in Options. If you would like to have both this and forbidden items in the same battle, swap out `BATTLETYPE_SET` for `BATTLETYPE_SETNOITEMS`.
\ No newline at end of file |