summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 00:52:49 -0500
committerExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 00:52:49 -0500
commit4e6508e1124a84f34ce90fbbbcfbd37b650d57a6 (patch)
tree4af865ce699811b646a6a1ed1bcae994c00ab94f
parent25dd86824862ffa7bd333eeea1cc31d126fa4881 (diff)
Created Remove badge boosts (markdown)
-rw-r--r--Remove-badge-boosts.md96
1 files changed, 96 insertions, 0 deletions
diff --git a/Remove-badge-boosts.md b/Remove-badge-boosts.md
new file mode 100644
index 0000000..ad2a50f
--- /dev/null
+++ b/Remove-badge-boosts.md
@@ -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! \ No newline at end of file