From 3264c3c87a3dc68d1aac4c549ba12b729a25303e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Aug 2022 09:05:51 -0400 Subject: [PATCH] Shows amount of Exp gained. --- include/pokemon.h | 1 + src/party_menu.c | 1 + src/pokemon.c | 2 +- src/strings.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 94fdff91d2..34065c6cc5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -406,6 +406,7 @@ extern const u16 gLinkPlayerFacilityClasses[]; extern const struct SpriteTemplate gBattlerSpriteTemplates[]; extern const s8 gNatureStatTable[][5]; extern const u16 *const gFormSpeciesIdTables[NUM_SPECIES]; +extern const u32 sExpCandyExperienceTable[]; void ZeroBoxMonData(struct BoxPokemon *boxMon); void ZeroMonData(struct Pokemon *mon); diff --git a/src/party_menu.c b/src/party_menu.c index 73937b966c..e94bfb9284 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5187,6 +5187,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { PlaySE(SE_USE_ITEM); gPartyMenuUseExitCallback = FALSE; + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[ItemId_GetHoldEffectParam(*itemPtr)], STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); DisplayPartyMenuMessage(gStringVar4, FALSE); ScheduleBgCopyTilemapToVram(2); diff --git a/src/pokemon.c b/src/pokemon.c index 8b3938aa51..bca560175d 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5507,7 +5507,7 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, } // EXP candies store an index for this table in their holdEffectParam. -static const u32 sExpCandyExperienceTable[] = { +const u32 sExpCandyExperienceTable[] = { [EXP_100 - 1] = 100, [EXP_800 - 1] = 800, [EXP_3000 - 1] = 3000, diff --git a/src/strings.c b/src/strings.c index d199b92d4b..52f1b6be71 100644 --- a/src/strings.c +++ b/src/strings.c @@ -417,7 +417,7 @@ const u8 gText_PkmnRegainhedHealth[] = _("{STR_VAR_1} regained health.{PAUSE_UNT const u8 gText_PkmnBecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}"); const u8 gText_MovesPPIncreased[] = _("{STR_VAR_1}'s PP increased.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnElevatedToLvVar2[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); -const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained Exp. Points!{PAUSE_UNTIL_PRESS}"); +const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnBaseVar2StatIncreased[] = _("{STR_VAR_1}'s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnFriendlyBaseVar2Fell[] = _("{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAdoresBaseVar2Fell[] = _("{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}");