4 Remove badge boosts
surtr-games edited this page 2024-11-21 00:29:55 -05:00
This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
  2. Remove badge boost from speed calculation
  3. Update obedience levels
  4. Update Gym Leaders' dialogue

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:

-static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
-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 CalculateBaseDamagefunction. Let's remove these too.

-    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, 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:

-    // 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;
-    }
-    // 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, there is this block of code in the function IsMonDisobedient:

        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):

        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!

4. Update Gym Leaders' dialogue

The last step is to update some dialogues with the Gym Leaders after receiving a badge because they mention the stat boosts instead of the new obedience levels. The list of affected dialogues is below but the rephrasing is left to the reader.

In data/maps/RustboroCity_Gym/scripts.inc, at RustboroCity_Gym_Text_StoneBadgeInfoTakeThis: remove the mention to the Attack boost and inform about the Lv 20 obedience threshold.

And do the same for: