mirror of
https://github.com/pret/pokeemerald.git
synced 2026-03-21 17:54:57 -05:00
Created Remove badge boosts (markdown)
parent
25dd868248
commit
4e6508e112
96
Remove-badge-boosts.md
Normal file
96
Remove-badge-boosts.md
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
Credit to Ketsuban for posting this in the Simple Modifications Pokecommunity thread.
|
||||
|
||||
This tutorial will remove the stat boosts given from badges and replace them with increasing obedience levels for each badge.
|
||||
|
||||
## Contents
|
||||
1. [Remove badge boosts from damage calculations](#1-remove-badge-boosts-from-damage-calculations)
|
||||
2. [Remove badge boost from speed calculation](#2-remove-badge-boosts-from-speed-calculations)
|
||||
3. [Update obedience levels](#3-update-obedience-levels)
|
||||
|
||||
## 1. Remove badge boosts from damage calculations
|
||||
First, we need to remove the badge boost function and every place that calls the badge boost function. That way, badges will not affect how damage is calculated.
|
||||
|
||||
First, let's remove the function. Edit [src/pokemon.c](../blob/master/src/pokemon.c):
|
||||
```diff
|
||||
-static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
|
||||
```
|
||||
```diff
|
||||
-static bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
|
||||
-{
|
||||
- if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
- return FALSE;
|
||||
- else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
|
||||
- return FALSE;
|
||||
- else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
|
||||
- return FALSE;
|
||||
- else if (FlagGet(badgeFlag))
|
||||
- return TRUE;
|
||||
- else
|
||||
- return FALSE;
|
||||
-}
|
||||
```
|
||||
Now, we need to remove all the calls to the function. The function is called 4 times in the `CalculateBaseDamage`function. Let's remove these too.
|
||||
```diff
|
||||
- if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerIdAtk))
|
||||
- attack = (110 * attack) / 100;
|
||||
- if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerIdDef))
|
||||
- defense = (110 * defense) / 100;
|
||||
- if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdAtk))
|
||||
- spAttack = (110 * spAttack) / 100;
|
||||
- if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdDef))
|
||||
- spDefense = (110 * spDefense) / 100;
|
||||
```
|
||||
That takes care of most of the boosts, but there is still the badge boost for speed, which we will handle next.
|
||||
|
||||
## 2. Remove badge boost from speed calculation
|
||||
In the `GetWhoStrikesFirst` function of [src/battle_main.c](../blob/src/battle_main.c), there are 2 blocks of code with the comment `// badge boost`. These modify the speed during the calculation to take into account the badge boosts. Delete them:
|
||||
```diff
|
||||
- // badge boost
|
||||
- if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
- && FlagGet(FLAG_BADGE03_GET)
|
||||
- && GetBattlerSide(battler1) == B_SIDE_PLAYER)
|
||||
- {
|
||||
- speedBattler1 = (speedBattler1 * 110) / 100;
|
||||
- }
|
||||
```
|
||||
```diff
|
||||
- // badge boost
|
||||
- if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
- && FlagGet(FLAG_BADGE03_GET)
|
||||
- && GetBattlerSide(battler2) == B_SIDE_PLAYER)
|
||||
- {
|
||||
- speedBattler2 = (speedBattler2 * 110) / 100;
|
||||
- }
|
||||
```
|
||||
This is the same check, but done for both battlers. And now that they are gone, all the badge boosts have been removed!
|
||||
|
||||
## 3. Update obedience levels
|
||||
In [src/battle_util.c](../blob/master/src/battle_util.c), there is this block of code in the function `IsMonDisobedient`:
|
||||
```c
|
||||
if (FlagGet(FLAG_BADGE02_GET))
|
||||
obedienceLevel = 30;
|
||||
if (FlagGet(FLAG_BADGE04_GET))
|
||||
obedienceLevel = 50;
|
||||
if (FlagGet(FLAG_BADGE06_GET))
|
||||
obedienceLevel = 70;
|
||||
```
|
||||
This can be replaced with whatever you like (it can even be removed if you want to remove this mechanic entirely!).
|
||||
|
||||
This is how it works for Omega Ruby/Alpha Sapphire, Gen 7, and the Let's Go games (for XY style, increase all the levels by 10):
|
||||
```c
|
||||
if (FlagGet(FLAG_BADGE01_GET))
|
||||
obedienceLevel = 20;
|
||||
if (FlagGet(FLAG_BADGE02_GET))
|
||||
obedienceLevel = 30;
|
||||
if (FlagGet(FLAG_BADGE03_GET))
|
||||
obedienceLevel = 40;
|
||||
if (FlagGet(FLAG_BADGE04_GET))
|
||||
obedienceLevel = 50;
|
||||
if (FlagGet(FLAG_BADGE05_GET))
|
||||
obedienceLevel = 60;
|
||||
if (FlagGet(FLAG_BADGE06_GET))
|
||||
obedienceLevel = 70;
|
||||
if (FlagGet(FLAG_BADGE07_GET))
|
||||
obedienceLevel = 80;
|
||||
```
|
||||
Now, badge boosts are gone, and obedience has been updated to modern levels!
|
||||
Loading…
Reference in New Issue
Block a user