From a00aa7d849dd528aa98fc3438e0379feb2dd99ef Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Tue, 2 Apr 2024 23:46:03 -0400 Subject: [PATCH] Added B_FAST_EXP_GROW Updated the denominator in MoveBattlerBar to be faster for more HP sizes --- include/config/battle.h | 3 ++- src/battle_interface.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index ffdfc40385e6..10b66e73541e 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -206,7 +206,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. diff --git a/src/battle_interface.c b/src/battle_interface.c index 50de6945a8aa..72475e604085 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -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, @@ -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)