diff --git a/include/constants/generational_changes.h b/include/constants/generational_changes.h index 94fd2c2a8e..57627c79bb 100644 --- a/include/constants/generational_changes.h +++ b/include/constants/generational_changes.h @@ -12,7 +12,7 @@ F(WHITEOUT_MONEY, whiteoutMoney, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ F(LIGHT_BALL_ATTACK_BOOST, lightBallAttackBoost, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ /* Experience settings */ \ - F(EXP_CATCH, expCatch, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ + F(EXP_CATCH, expCatch, (u32, GEN_COUNT - 1)) \ F(TRAINER_EXP_MULTIPLIER, trainerExpMultiplier, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ F(SPLIT_EXP, splitExp, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ F(SCALED_EXP, scaledExp, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \ diff --git a/src/battle_main.c b/src/battle_main.c index 5e00d6213d..3aac0e4e1a 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3009,7 +3009,7 @@ static void ClearSetBScriptingStruct(void) gBattleScripting.battleStyle = OPTIONS_BATTLE_STYLE_SET; else gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; - gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6); + gBattleScripting.expOnCatch = (GetConfig(CONFIG_EXP_CATCH) >= GEN_6); gBattleScripting.specialTrainerBattleType = specialBattleType; } diff --git a/test/battle/exp.c b/test/battle/exp.c index 12c9c1e9bd..c22b7fa2f5 100644 --- a/test/battle/exp.c +++ b/test/battle/exp.c @@ -1,16 +1,17 @@ #include "global.h" #include "test/battle.h" -#if B_EXP_CATCH >= GEN_6 - -WILD_BATTLE_TEST("Pokemon gain exp after catching a Pokemon") +WILD_BATTLE_TEST("Pokemon gain experience after catching a Pokemon (Gen6+)") { u8 level = 0; + u32 config = 0; - PARAMETRIZE { level = 50; } - PARAMETRIZE { level = MAX_LEVEL; } + PARAMETRIZE { level = MAX_LEVEL; config = GEN_5; } + PARAMETRIZE { level = 50; config = GEN_5; } + PARAMETRIZE { level = 50; config = GEN_6; } GIVEN { + WITH_CONFIG(CONFIG_EXP_CATCH, config); PLAYER(SPECIES_WOBBUFFET) { Level(level); } OPPONENT(SPECIES_CATERPIE) { HP(1); } } WHEN { @@ -18,14 +19,14 @@ WILD_BATTLE_TEST("Pokemon gain exp after catching a Pokemon") } SCENE { MESSAGE("You used Ultra Ball!"); ANIMATION(ANIM_TYPE_SPECIAL, B_ANIM_BALL_THROW, player); - if (level != MAX_LEVEL) { + if (level != MAX_LEVEL && config >= GEN_6) { EXPERIENCE_BAR(player); + } else { + NOT EXPERIENCE_BAR(player); } } } -#endif // B_EXP_CATCH - WILD_BATTLE_TEST("Higher leveled Pokemon give more exp", s32 exp) { u8 level = 0;