-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove badge boosts
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.
- Remove badge boosts from damage calculations
- Remove badge boost from speed calculation
- Update obedience levels
- Update Gym Leaders' dialogue
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 CalculateBaseDamage
function. 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.
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!
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!
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:
-
data/maps/MauvilleCity_Gym/scripts.inc, at
MauvilleCity_Gym_Text_ExplainDynamoBadgeTakeThis
: Speed boost → Lv 40 obedience -
data/maps/PetalburgCity_Gym/scripts.inc, at
PetalburgCity_Gym_Text_ExplainBalanceBadgeTakeThis
: Defense boost → Lv 60 obedience -
data/maps/MossdeepCity_Gym/scripts.inc, at
MossdeepCity_Gym_Text_ExplainMindBadgeTakeThis
: Sp. Atk/Sp. Def boost → Lv 80 obedience