Skip to content

Commit

Permalink
Added B_FAST_EXP_GROW (#4335)
Browse files Browse the repository at this point in the history
Updated the denominator in MoveBattlerBar to be faster for more HP sizes
  • Loading branch information
pkmnsnfrn committed Apr 3, 2024
1 parent e8c05de commit 8f2f681
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
// Interface settings
#define B_ABILITY_POP_UP TRUE // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
#define B_FAST_INTRO TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end.
#define B_FAST_HP_DRAIN TRUE // If set to TRUE, HP bars will move faster to accomodate higher max HP amounts.
#define B_FAST_HP_DRAIN TRUE // If set to TRUE, HP bars will move faster.
#define B_FAST_EXP_GROW TRUE // If set to TRUE, EXP bars will move faster.
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
#define B_SHOW_CATEGORY_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category.
#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations.
Expand Down
4 changes: 2 additions & 2 deletions src/battle_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ s32 MoveBattleBar(u8 battlerId, u8 healthboxSpriteId, u8 whichBar, u8 unused)

if (whichBar == HEALTH_BAR) // health bar
{
u16 hpFraction = B_FAST_HP_DRAIN == FALSE ? 1 : max(gBattleSpritesDataPtr->battleBars[battlerId].maxValue / B_HEALTHBAR_PIXELS, 1);
u16 hpFraction = B_FAST_HP_DRAIN == FALSE ? 1 : max(gBattleSpritesDataPtr->battleBars[battlerId].maxValue / (B_HEALTHBAR_PIXELS / 2), 1);
currentBarValue = CalcNewBarValue(gBattleSpritesDataPtr->battleBars[battlerId].maxValue,
gBattleSpritesDataPtr->battleBars[battlerId].oldValue,
gBattleSpritesDataPtr->battleBars[battlerId].receivedValue,
Expand Down Expand Up @@ -2838,7 +2838,7 @@ static u8 GetScaledExpFraction(s32 oldValue, s32 receivedValue, s32 maxValue, u8
s32 newVal, result;
s8 oldToMax, newToMax;

scale *= 8;
scale *= (B_FAST_EXP_GROW) ? 2 : 8;
newVal = oldValue - receivedValue;

if (newVal < 0)
Expand Down

0 comments on commit 8f2f681

Please sign in to comment.