Expanded B_EXP_CATCH test (#8527)

This commit is contained in:
Eduardo Quezada 2025-12-14 12:38:22 -03:00 committed by GitHub
parent a0a5947590
commit a3a16acd72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 10 deletions

View File

@ -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 */ \

View File

@ -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;
}

View File

@ -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;