From 8f2f6811fbd2d0e53e3ec1de5a7275b5c9545a29 Mon Sep 17 00:00:00 2001 From: psf <77138753+pkmnsnfrn@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:25:55 -0400 Subject: [PATCH] Added B_FAST_EXP_GROW (#4335) 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 427862534d..e497cf20bb 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -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. diff --git a/src/battle_interface.c b/src/battle_interface.c index 50de6945a8..72475e6040 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)