From b197da077f6c14a1108f50aa643c556a12fc071e Mon Sep 17 00:00:00 2001 From: AgustinGDLV <103095241+AgustinGDLV@users.noreply.github.com> Date: Mon, 16 May 2022 16:08:26 -0700 Subject: [PATCH 1/3] Update src/strings.c Co-authored-by: LOuroboros --- src/strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings.c b/src/strings.c index 731cde1a36..edd9522072 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 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}"); From 2d25cd56b987062357806ca1ba652abe78b89e39 Mon Sep 17 00:00:00 2001 From: AgustinGDLV <103095241+AgustinGDLV@users.noreply.github.com> Date: Mon, 16 May 2022 16:58:08 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: sneed <56992013+Sneed69@users.noreply.github.com> --- src/pokemon.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 7cb72b37f6..095d7f414b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4885,9 +4885,13 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov if (ItemId_GetHoldEffectParam(item) & FULL_LEVEL) { dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; + SetMonData(mon, MON_DATA_EXP, &dataUnsigned); + CalculateMonStats(mon); } else { + u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + temp1 = ItemId_GetHoldEffectParam(item) & 0x0F; if (ItemId_GetHoldEffectParam(item) & ONE_HUNDRED) temp1 *= 100; @@ -4896,11 +4900,12 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov if (ItemId_GetHoldEffectParam(item) & TEN_THOUSAND) temp1 *= 10000; dataUnsigned = temp1 + GetMonData(mon, MON_DATA_EXP, NULL); - if (dataUnsigned > gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][MAX_LEVEL]) - dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][MAX_LEVEL]; + if (dataUnsigned > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) + dataUnsigned = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; + SetMonData(mon, MON_DATA_EXP, &dataUnsigned); + if (dataUnsigned >= gExperienceTables[gBaseStats[species].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]) + CalculateMonStats(mon); } - SetMonData(mon, MON_DATA_EXP, &dataUnsigned); - CalculateMonStats(mon); retVal = FALSE; } From e9669ccbfeaef5cfd03ae37298af0f88dd8d311a Mon Sep 17 00:00:00 2001 From: AgustinGDLV <103095241+AgustinGDLV@users.noreply.github.com> Date: Mon, 16 May 2022 17:41:18 -0700 Subject: [PATCH 3/3] Update src/pokemon.c Co-authored-by: sneed <56992013+Sneed69@users.noreply.github.com> --- src/pokemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pokemon.c b/src/pokemon.c index 095d7f414b..d0f4f8a717 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4892,6 +4892,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov { u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + gBattleScripting.levelUpHP = 0; // Prevents reviving mons that don't level up. temp1 = ItemId_GetHoldEffectParam(item) & 0x0F; if (ItemId_GetHoldEffectParam(item) & ONE_HUNDRED) temp1 *= 100;