diff --git a/graphics/balls/strange.png b/graphics/balls/strange.png new file mode 100644 index 0000000000..a4d141bead Binary files /dev/null and b/graphics/balls/strange.png differ diff --git a/graphics/items/icon_palettes/strange_ball.pal b/graphics/items/icon_palettes/strange_ball.pal new file mode 100644 index 0000000000..9e32134d45 --- /dev/null +++ b/graphics/items/icon_palettes/strange_ball.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +180 180 180 +164 226 197 +238 242 230 +139 170 180 +8 113 115 +0 157 156 +106 222 172 +41 182 189 +90 206 172 +90 182 180 +8 0 0 +65 190 189 +115 194 189 +0 117 131 +0 129 131 +0 12 0 diff --git a/graphics/items/icons/strange_ball.png b/graphics/items/icons/strange_ball.png new file mode 100644 index 0000000000..a794d54abe Binary files /dev/null and b/graphics/items/icons/strange_ball.png differ diff --git a/include/battle_anim.h b/include/battle_anim.h index 34aad8e94b..96ba0c52ab 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -235,7 +235,6 @@ extern const union AffineAnimCmd *const gAffineAnims_SpinningBone[]; // battle_anim_throw.c void TryShinyAnimation(u8 battler, struct Pokemon *mon); -u8 ItemIdToBallId(u16 itemId); u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId); bool32 IsCriticalCapture(void); diff --git a/include/constants/items.h b/include/constants/items.h index d57a53fb05..0abfc31a44 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -32,12 +32,6 @@ #define ITEM_BEAST_BALL 26 #define ITEM_CHERISH_BALL 27 -// Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient -// Several places expect the ball IDs to be first and contiguous (e.g. MON_DATA_POKEBALL) -// If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example) -#define FIRST_BALL ITEM_POKE_BALL -#define LAST_BALL ITEM_CHERISH_BALL - // Medicine #define ITEM_POTION 28 #define ITEM_SUPER_POTION 29 @@ -998,10 +992,12 @@ #define ITEM_TWICE_SPICED_RADISH 826 #define ITEM_POKESHI_DOLL 827 +#define ITEM_STRANGE_BALL 828 + // HOPO BERRY // LEGEND PLATE -#define ITEMS_COUNT 828 +#define ITEMS_COUNT 829 #define ITEM_FIELD_ARROW ITEMS_COUNT // A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations diff --git a/include/graphics.h b/include/graphics.h index 06b5ab1b2d..527f793d37 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -7,6 +7,8 @@ extern const u32 gMessageBox_Gfx[]; extern const u16 gMessageBox_Pal[]; // pokeballs +extern const u32 gBallGfx_Strange[]; +extern const u32 gBallPal_Strange[]; extern const u32 gBallGfx_Poke[]; extern const u32 gBallPal_Poke[]; extern const u32 gBallGfx_Great[]; @@ -360,6 +362,8 @@ extern const u32 gRaySceneChasesAway_Light_Gfx[]; extern const u32 gRaySceneChasesAway_Ring_Gfx[]; // Poké Balls +extern const u32 gItemIcon_StrangeBall[]; +extern const u32 gItemIconPalette_StrangeBall[]; extern const u32 gItemIcon_PokeBall[]; extern const u32 gItemIconPalette_PokeBall[]; extern const u32 gItemIcon_GreatBall[]; diff --git a/include/item.h b/include/item.h index f75142a34e..b99a6f30c2 100644 --- a/include/item.h +++ b/include/item.h @@ -80,7 +80,7 @@ u8 ItemId_GetPocket(u16 itemId); u8 ItemId_GetType(u16 itemId); ItemUseFunc ItemId_GetFieldFunc(u16 itemId); u8 ItemId_GetBattleUsage(u16 itemId); -u8 ItemId_GetSecondaryId(u16 itemId); +u32 ItemId_GetSecondaryId(u32 itemId); u32 ItemId_GetFlingPower(u32 itemId); u32 GetItemStatus1Mask(u16 itemId); u32 GetItemStatus2Mask(u16 itemId); diff --git a/include/pokeball.h b/include/pokeball.h index 01d995a458..d327df5d99 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -1,35 +1,36 @@ #ifndef GUARD_POKEBALL_H #define GUARD_POKEBALL_H -enum +enum PokeBall { - BALL_POKE, - BALL_GREAT, - BALL_ULTRA, - BALL_MASTER, - BALL_PREMIER, - BALL_HEAL, - BALL_NET, - BALL_NEST, - BALL_DIVE, - BALL_DUSK, - BALL_TIMER, - BALL_QUICK, - BALL_REPEAT, - BALL_LUXURY, - BALL_LEVEL, - BALL_LURE, - BALL_MOON, - BALL_FRIEND, - BALL_LOVE, - BALL_FAST, - BALL_HEAVY, - BALL_DREAM, - BALL_SAFARI, - BALL_SPORT, - BALL_PARK, - BALL_BEAST, - BALL_CHERISH, + BALL_STRANGE = 0, + BALL_POKE = 1, + BALL_GREAT = 2, + BALL_ULTRA = 3, + BALL_MASTER = 4, + BALL_PREMIER = 5, + BALL_HEAL = 6, + BALL_NET = 7, + BALL_NEST = 8, + BALL_DIVE = 9, + BALL_DUSK = 10, + BALL_TIMER = 11, + BALL_QUICK = 12, + BALL_REPEAT = 13, + BALL_LUXURY = 14, + BALL_LEVEL = 15, + BALL_LURE = 16, + BALL_MOON = 17, + BALL_FRIEND = 18, + BALL_LOVE = 19, + BALL_FAST = 20, + BALL_HEAVY = 21, + BALL_DREAM = 22, + BALL_SAFARI = 23, + BALL_SPORT = 24, + BALL_PARK = 25, + BALL_BEAST = 26, + BALL_CHERISH = 27, POKEBALL_COUNT }; @@ -56,5 +57,6 @@ void StartHealthboxSlideIn(u8 battler); void DoHitAnimHealthboxEffect(u8 battler); void LoadBallGfx(u8 ballId); void FreeBallGfx(u8 ballId); +enum PokeBall ItemIdToBallId(u32 ballItem); #endif // GUARD_POKEBALL_H diff --git a/migration_scripts/README.md b/migration_scripts/README.md index 5ff925d8ef..696f146f14 100644 --- a/migration_scripts/README.md +++ b/migration_scripts/README.md @@ -88,7 +88,7 @@ Moves all information from `gItemIconTable` to `gItemsInfo`. .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_POKE_BALL - FIRST_BALL, + .secondaryId = BALL_POKE, + .iconSprite = gItemIcon_PokeBall, + .iconPalette = gItemIconPalette_PokeBall, }, diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 81407824fa..611d12be56 100644 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -128,36 +128,38 @@ static const struct CaptureStar sCaptureStars[] = }, }; -#define TAG_PARTICLES_POKEBALL 65030 -#define TAG_PARTICLES_GREATBALL 65031 -#define TAG_PARTICLES_ULTRABALL 65032 -#define TAG_PARTICLES_MASTERBALL 65033 -#define TAG_PARTICLES_PREMIERBALL 65034 -#define TAG_PARTICLES_HEALBALL 65035 -#define TAG_PARTICLES_NETBALL 65036 -#define TAG_PARTICLES_NESTBALL 65037 -#define TAG_PARTICLES_DIVEBALL 65038 -#define TAG_PARTICLES_DUSKBALL 65039 -#define TAG_PARTICLES_TIMERBALL 65040 -#define TAG_PARTICLES_QUICKBALL 65041 -#define TAG_PARTICLES_REPEATBALL 65042 -#define TAG_PARTICLES_LUXURYBALL 65043 -#define TAG_PARTICLES_LEVELBALL 65044 -#define TAG_PARTICLES_LUREBALL 65045 -#define TAG_PARTICLES_MOONBALL 65046 -#define TAG_PARTICLES_FRIENDBALL 65047 -#define TAG_PARTICLES_LOVEBALL 65048 -#define TAG_PARTICLES_FASTBALL 65049 -#define TAG_PARTICLES_HEAVYBALL 65050 -#define TAG_PARTICLES_DREAMBALL 65051 -#define TAG_PARTICLES_SAFARIBALL 65052 -#define TAG_PARTICLES_SPORTBALL 65053 -#define TAG_PARTICLES_PARKBALL 65054 -#define TAG_PARTICLES_BEASTBALL 65055 -#define TAG_PARTICLES_CHERISHBALL 65056 +#define TAG_PARTICLES_STRANGEBALL 65030 +#define TAG_PARTICLES_POKEBALL 65031 +#define TAG_PARTICLES_GREATBALL 65032 +#define TAG_PARTICLES_ULTRABALL 65033 +#define TAG_PARTICLES_MASTERBALL 65034 +#define TAG_PARTICLES_PREMIERBALL 65035 +#define TAG_PARTICLES_HEALBALL 65036 +#define TAG_PARTICLES_NETBALL 65037 +#define TAG_PARTICLES_NESTBALL 65038 +#define TAG_PARTICLES_DIVEBALL 65039 +#define TAG_PARTICLES_DUSKBALL 65040 +#define TAG_PARTICLES_TIMERBALL 65041 +#define TAG_PARTICLES_QUICKBALL 65042 +#define TAG_PARTICLES_REPEATBALL 65043 +#define TAG_PARTICLES_LUXURYBALL 65044 +#define TAG_PARTICLES_LEVELBALL 65045 +#define TAG_PARTICLES_LUREBALL 65046 +#define TAG_PARTICLES_MOONBALL 65047 +#define TAG_PARTICLES_FRIENDBALL 65048 +#define TAG_PARTICLES_LOVEBALL 65049 +#define TAG_PARTICLES_FASTBALL 65050 +#define TAG_PARTICLES_HEAVYBALL 65051 +#define TAG_PARTICLES_DREAMBALL 65052 +#define TAG_PARTICLES_SAFARIBALL 65053 +#define TAG_PARTICLES_SPORTBALL 65054 +#define TAG_PARTICLES_PARKBALL 65055 +#define TAG_PARTICLES_BEASTBALL 65056 +#define TAG_PARTICLES_CHERISHBALL 65057 static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] = { + [BALL_STRANGE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_STRANGEBALL}, [BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL}, [BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL}, [BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL}, @@ -189,6 +191,7 @@ static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] = static const struct CompressedSpritePalette sBallParticlePalettes[] = { + [BALL_STRANGE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_STRANGEBALL}, [BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL}, [BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL}, [BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL}, @@ -272,6 +275,7 @@ static const union AnimCmd *const sAnims_BallParticles[] = static const u8 sBallParticleAnimNums[POKEBALL_COUNT] = { + [BALL_STRANGE] = 0, [BALL_POKE] = 0, [BALL_GREAT] = 0, [BALL_ULTRA] = 5, @@ -304,6 +308,7 @@ static const u8 sBallParticleAnimNums[POKEBALL_COUNT] = static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] = { // Todo: assign and possibly create different particles + [BALL_STRANGE] = GreatBallOpenParticleAnimation, [BALL_POKE] = PokeBallOpenParticleAnimation, [BALL_GREAT] = GreatBallOpenParticleAnimation, [BALL_ULTRA] = UltraBallOpenParticleAnimation, @@ -335,6 +340,15 @@ static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] = static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT] = { + [BALL_STRANGE] = { + .tileTag = TAG_PARTICLES_STRANGEBALL, + .paletteTag = TAG_PARTICLES_STRANGEBALL, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = sAnims_BallParticles, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, [BALL_POKE] = { .tileTag = TAG_PARTICLES_POKEBALL, .paletteTag = TAG_PARTICLES_POKEBALL, @@ -583,6 +597,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT] const u16 gBallOpenFadeColors[] = { // Todo, assign different colors + [BALL_STRANGE] = RGB(16, 23, 30), [BALL_POKE] = RGB(31, 22, 30), [BALL_GREAT] = RGB(16, 23, 30), [BALL_ULTRA] = RGB(31, 31, 15), @@ -887,19 +902,17 @@ void AnimTask_SwitchOutShrinkMon(u8 taskId) void AnimTask_SwitchOutBallEffect(u8 taskId) { u8 spriteId; - u16 ball; - u8 ballId; + enum PokeBall ballId; u8 x, y; u8 priority, subpriority; u32 selectedPalettes; spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) - ball = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL); + ballId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL); else - ball = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL); + ballId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL); - ballId = ItemIdToBallId(ball); switch (gTasks[taskId].data[0]) { case 0: @@ -921,14 +934,14 @@ void AnimTask_SwitchOutBallEffect(u8 taskId) void AnimTask_LoadBallGfx(u8 taskId) { - u8 ballId = ItemIdToBallId(gLastUsedItem); + enum PokeBall ballId = ItemIdToBallId(gLastUsedItem); LoadBallGfx(ballId); DestroyAnimVisualTask(taskId); } void AnimTask_FreeBallGfx(u8 taskId) { - u8 ballId = ItemIdToBallId(gLastUsedItem); + enum PokeBall ballId = ItemIdToBallId(gLastUsedItem); FreeBallGfx(ballId); DestroyAnimVisualTask(taskId); } @@ -943,69 +956,6 @@ void AnimTask_IsBallBlockedByTrainer(u8 taskId) DestroyAnimVisualTask(taskId); } -u8 ItemIdToBallId(u16 ballItem) -{ - switch (ballItem) - { - case ITEM_POKE_BALL: - return BALL_POKE; - case ITEM_GREAT_BALL: - return BALL_GREAT; - case ITEM_ULTRA_BALL: - return BALL_ULTRA; - case ITEM_MASTER_BALL: - return BALL_MASTER; - case ITEM_PREMIER_BALL: - return BALL_PREMIER; - case ITEM_HEAL_BALL: - return BALL_HEAL; - case ITEM_NET_BALL: - return BALL_NET; - case ITEM_NEST_BALL: - return BALL_NEST; - case ITEM_DIVE_BALL: - return BALL_DIVE; - case ITEM_DUSK_BALL: - return BALL_DUSK; - case ITEM_TIMER_BALL: - return BALL_TIMER; - case ITEM_QUICK_BALL: - return BALL_QUICK; - case ITEM_REPEAT_BALL: - return BALL_REPEAT; - case ITEM_LUXURY_BALL: - return BALL_LUXURY; - case ITEM_LEVEL_BALL: - return BALL_LEVEL; - case ITEM_LURE_BALL: - return BALL_LURE; - case ITEM_MOON_BALL: - return BALL_MOON; - case ITEM_FRIEND_BALL: - return BALL_FRIEND; - case ITEM_LOVE_BALL: - return BALL_LOVE; - case ITEM_FAST_BALL: - return BALL_FAST; - case ITEM_HEAVY_BALL: - return BALL_HEAVY; - case ITEM_DREAM_BALL: - return BALL_DREAM; - case ITEM_SAFARI_BALL: - return BALL_SAFARI; - case ITEM_SPORT_BALL: - return BALL_SPORT; - case ITEM_PARK_BALL: - return BALL_PARK; - case ITEM_BEAST_BALL: - return BALL_BEAST; - case ITEM_CHERISH_BALL: - return BALL_CHERISH; - default: - return BALL_POKE; - } -} - #define tSpriteId data[0] #define sDuration data[0] @@ -1014,10 +964,9 @@ u8 ItemIdToBallId(u16 ballItem) void AnimTask_ThrowBall(u8 taskId) { - u8 ballId; u8 spriteId; - ballId = ItemIdToBallId(gLastUsedItem); + enum PokeBall ballId = ItemIdToBallId(gLastUsedItem); spriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29); gSprites[spriteId].sDuration = 34; gSprites[spriteId].sTargetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); @@ -1039,7 +988,7 @@ static void AnimTask_ThrowBall_Step(u8 taskId) void AnimTask_ThrowBall_StandingTrainer(u8 taskId) { s16 x, y; - u8 ballId; + enum PokeBall ballId; u8 subpriority; u8 spriteId; @@ -1128,8 +1077,7 @@ static void SpriteCB_Ball_Throw(struct Sprite *sprite) static void SpriteCB_Ball_Arc(struct Sprite *sprite) { - s32 i; - u8 ballId; + u32 i; if (TranslateAnimHorizontalArc(sprite)) { @@ -1151,14 +1099,9 @@ static void SpriteCB_Ball_Arc(struct Sprite *sprite) sprite->sTimer = 0; sprite->callback = SpriteCB_Ball_MonShrink; - ballId = ItemIdToBallId(gLastUsedItem); - switch (ballId) - { - case 0 ... POKEBALL_COUNT - 1: - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); - LaunchBallFadeMonTask(FALSE, gBattleAnimTarget, 14, ballId); - break; - } + enum PokeBall ballId = ItemIdToBallId(gLastUsedItem); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); + LaunchBallFadeMonTask(FALSE, gBattleAnimTarget, 14, ballId); } } } @@ -1720,20 +1663,13 @@ static void SpriteCB_CaptureStar_Flicker(struct Sprite *sprite) // - Wild mon emerge from Poké Ball static void SpriteCB_Ball_Release_Step(struct Sprite *sprite) { - u8 ballId; - StartSpriteAnim(sprite, 1); StartSpriteAffineAnim(sprite, 0); sprite->callback = SpriteCB_Ball_Release_Wait; - ballId = ItemIdToBallId(gLastUsedItem); - switch (ballId) - { - case 0 ... POKEBALL_COUNT - 1: - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); - LaunchBallFadeMonTask(TRUE, gBattleAnimTarget, 14, ballId); - break; - } + enum PokeBall ballId = ItemIdToBallId(gLastUsedItem); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); + LaunchBallFadeMonTask(TRUE, gBattleAnimTarget, 14, ballId); // Animate Pokémon emerging from Poké Ball gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = FALSE; diff --git a/src/battle_main.c b/src/battle_main.c index d60b239981..7b71b8449d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -320,15 +320,15 @@ const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] = TRAINER_CLASS(TRAINER_CLASS_HIKER, "HIKER", 10), TRAINER_CLASS(TRAINER_CLASS_TEAM_AQUA, "TEAM AQUA"), TRAINER_CLASS(TRAINER_CLASS_PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL), - TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER, "COOLTRAINER", 12, BALL_ULTRA), TRAINER_CLASS(TRAINER_CLASS_BIRD_KEEPER, "BIRD KEEPER", 8), - TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL), - TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, BALL_PREMIER), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, BALL_DIVE), TRAINER_CLASS(TRAINER_CLASS_TEAM_MAGMA, "TEAM MAGMA"), TRAINER_CLASS(TRAINER_CLASS_EXPERT, "EXPERT", 10), TRAINER_CLASS(TRAINER_CLASS_AQUA_ADMIN, "AQUA ADMIN", 10), - TRAINER_CLASS(TRAINER_CLASS_BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL), - TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_BLACK_BELT, "BLACK BELT", 8, BALL_ULTRA), + TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, BALL_MASTER), TRAINER_CLASS(TRAINER_CLASS_HEX_MANIAC, "HEX MANIAC", 6), TRAINER_CLASS(TRAINER_CLASS_AROMA_LADY, "AROMA LADY", 10), TRAINER_CLASS(TRAINER_CLASS_RUIN_MANIAC, "RUIN MANIAC", 15), @@ -345,8 +345,8 @@ const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] = TRAINER_CLASS(TRAINER_CLASS_PICNICKER, "PICNICKER", 4), TRAINER_CLASS(TRAINER_CLASS_BUG_MANIAC, "BUG MANIAC", 15), TRAINER_CLASS(TRAINER_CLASS_PSYCHIC, "PSYCHIC", 6), - TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL), - TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, BALL_LUXURY), + TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, BALL_ULTRA), TRAINER_CLASS(TRAINER_CLASS_LEADER, "LEADER", 25), TRAINER_CLASS(TRAINER_CLASS_SCHOOL_KID, "SCHOOL KID"), TRAINER_CLASS(TRAINER_CLASS_SR_AND_JR, "SR. AND JR.", 4), @@ -354,21 +354,21 @@ const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] = TRAINER_CLASS(TRAINER_CLASS_POKEFAN, "POKéFAN", 20), TRAINER_CLASS(TRAINER_CLASS_YOUNGSTER, "YOUNGSTER", 4), TRAINER_CLASS(TRAINER_CLASS_CHAMPION, "CHAMPION", 50), - TRAINER_CLASS(TRAINER_CLASS_FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL), + TRAINER_CLASS(TRAINER_CLASS_FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? BALL_DIVE : BALL_LURE), TRAINER_CLASS(TRAINER_CLASS_TRIATHLETE, "TRIATHLETE", 10), TRAINER_CLASS(TRAINER_CLASS_DRAGON_TAMER, "DRAGON TAMER", 12), TRAINER_CLASS(TRAINER_CLASS_NINJA_BOY, "NINJA BOY", 3), TRAINER_CLASS(TRAINER_CLASS_BATTLE_GIRL, "BATTLE GIRL", 6), TRAINER_CLASS(TRAINER_CLASS_PARASOL_LADY, "PARASOL LADY", 10), - TRAINER_CLASS(TRAINER_CLASS_SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_F, "SWIMMER♀", 2, BALL_DIVE), TRAINER_CLASS(TRAINER_CLASS_TWINS, "TWINS", 3), TRAINER_CLASS(TRAINER_CLASS_SAILOR, "SAILOR", 8), - TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER_2, "COOLTRAINER", 5, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER_2, "COOLTRAINER", 5, BALL_ULTRA), TRAINER_CLASS(TRAINER_CLASS_MAGMA_ADMIN, "MAGMA ADMIN", 10), TRAINER_CLASS(TRAINER_CLASS_RIVAL, "{PKMN} TRAINER", 15), TRAINER_CLASS(TRAINER_CLASS_BUG_CATCHER, "BUG CATCHER", 4), TRAINER_CLASS(TRAINER_CLASS_PKMN_RANGER, "{PKMN} RANGER", 12), - TRAINER_CLASS(TRAINER_CLASS_MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_MAGMA_LEADER, "MAGMA LEADER", 20, BALL_MASTER), TRAINER_CLASS(TRAINER_CLASS_LASS, "LASS", 4), TRAINER_CLASS(TRAINER_CLASS_YOUNG_COUPLE, "YOUNG COUPLE", 8), TRAINER_CLASS(TRAINER_CLASS_OLD_COUPLE, "OLD COUPLE", 10), diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 005ee855a5..5424d1b499 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -15173,10 +15173,10 @@ static void Cmd_handleballthrow(void) else { u32 odds, i; - u8 catchRate; + u32 catchRate; + u32 ballId = ItemIdToBallId(gLastUsedItem); - gLastThrownBall = gLastUsedItem; - gBallToDisplay = gLastThrownBall; + gBallToDisplay = gLastThrownBall = gLastUsedItem; if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) catchRate = gBattleStruct->safariCatchFactor * 1275 / 100; else @@ -15184,39 +15184,39 @@ static void Cmd_handleballthrow(void) if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].isUltraBeast) { - if (gLastUsedItem == ITEM_BEAST_BALL) + if (ballId == BALL_BEAST) ballMultiplier = 500; else ballMultiplier = 10; } else { - switch (gLastUsedItem) + switch (ballId) { - case ITEM_ULTRA_BALL: + case BALL_ULTRA: ballMultiplier = 200; break; - case ITEM_SPORT_BALL: + case BALL_SPORT: if (B_SPORT_BALL_MODIFIER <= GEN_7) ballMultiplier = 150; break; - case ITEM_GREAT_BALL: + case BALL_GREAT: ballMultiplier = 150; break; - case ITEM_SAFARI_BALL: + case BALL_SAFARI: if (B_SAFARI_BALL_MODIFIER <= GEN_7) ballMultiplier = 150; break; - case ITEM_NET_BALL: + case BALL_NET: if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG)) ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300; break; - case ITEM_DIVE_BALL: + case BALL_DIVE: if (GetCurrentMapType() == MAP_TYPE_UNDERWATER || (B_DIVE_BALL_MODIFIER >= GEN_4 && (gIsFishingEncounter || gIsSurfingEncounter))) ballMultiplier = 350; break; - case ITEM_NEST_BALL: + case BALL_NEST: if (B_NEST_BALL_MODIFIER >= GEN_6) { //((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise. @@ -15237,25 +15237,25 @@ static void Cmd_handleballthrow(void) ballMultiplier = 100; } break; - case ITEM_REPEAT_BALL: + case BALL_REPEAT: if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT)) ballMultiplier = (B_REPEAT_BALL_MODIFIER >= GEN_7 ? 350 : 300); break; - case ITEM_TIMER_BALL: + case BALL_TIMER: ballMultiplier = 100 + (gBattleResults.battleTurnCounter * (B_TIMER_BALL_MODIFIER >= GEN_5 ? 30 : 10)); if (ballMultiplier > 400) ballMultiplier = 400; break; - case ITEM_DUSK_BALL: + case BALL_DUSK: i = GetTimeOfDay(); if (i == TIME_EVENING || i == TIME_NIGHT || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND) ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350); break; - case ITEM_QUICK_BALL: + case BALL_QUICK: if (gBattleResults.battleTurnCounter == 0) ballMultiplier = (B_QUICK_BALL_MODIFIER >= GEN_5 ? 500 : 400); break; - case ITEM_LEVEL_BALL: + case BALL_LEVEL: if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level) ballMultiplier = 800; else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level) @@ -15263,7 +15263,7 @@ static void Cmd_handleballthrow(void) else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level) ballMultiplier = 200; break; - case ITEM_LURE_BALL: + case BALL_LURE: if (gIsFishingEncounter) { if (B_LURE_BALL_MODIFIER >= GEN_8) @@ -15274,7 +15274,7 @@ static void Cmd_handleballthrow(void) ballMultiplier = 300; } break; - case ITEM_MOON_BALL: + case BALL_MOON: { const struct Evolution *evolutions = GetSpeciesEvolutions(gBattleMons[gBattlerTarget].species); if (evolutions == NULL) @@ -15287,7 +15287,7 @@ static void Cmd_handleballthrow(void) } } break; - case ITEM_LOVE_BALL: + case BALL_LOVE: if (gBattleMons[gBattlerTarget].species == gBattleMons[gBattlerAttacker].species) { u8 gender1 = GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); @@ -15297,11 +15297,11 @@ static void Cmd_handleballthrow(void) ballMultiplier = 800; } break; - case ITEM_FAST_BALL: + case BALL_FAST: if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseSpeed >= 100) ballMultiplier = 400; break; - case ITEM_HEAVY_BALL: + case BALL_HEAVY: i = GetSpeciesWeight(gBattleMons[gBattlerTarget].species); if (B_HEAVY_BALL_MODIFIER >= GEN_7) { @@ -15339,11 +15339,11 @@ static void Cmd_handleballthrow(void) ballAddition = 40; } break; - case ITEM_DREAM_BALL: + case BALL_DREAM: if (B_DREAM_BALL_MODIFIER >= GEN_8 && (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)) ballMultiplier = 400; break; - case ITEM_BEAST_BALL: + case BALL_BEAST: ballMultiplier = 10; break; } @@ -15364,8 +15364,8 @@ static void Cmd_handleballthrow(void) if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) odds = (odds * 15) / 10; - if (gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL] < 255) - gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL]++; + if (gBattleResults.catchAttempts[ballId] < 255) + gBattleResults.catchAttempts[ballId]++; if (odds > 254) // mon caught { @@ -15373,14 +15373,14 @@ static void Cmd_handleballthrow(void) MarkBattlerForControllerExec(gBattlerAttacker); TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE); gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; - SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); + SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &ballId); if (CalculatePlayerPartyCount() == PARTY_SIZE) gBattleCommunication[MULTISTRING_CHOOSER] = 0; else gBattleCommunication[MULTISTRING_CHOOSER] = 1; - if (gLastUsedItem == ITEM_HEAL_BALL) + if (gLastUsedItem == BALL_HEAL) { MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget); @@ -15406,7 +15406,7 @@ static void Cmd_handleballthrow(void) maxShakes = BALL_3_SHAKES_SUCCESS; } - if (gLastUsedItem == ITEM_MASTER_BALL) + if (ballId == BALL_MASTER) { shakes = maxShakes; } @@ -15427,14 +15427,14 @@ static void Cmd_handleballthrow(void) TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE); gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; - SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); + SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &ballId); if (CalculatePlayerPartyCount() == PARTY_SIZE) gBattleCommunication[MULTISTRING_CHOOSER] = 0; else gBattleCommunication[MULTISTRING_CHOOSER] = 1; - if (gLastUsedItem == ITEM_HEAL_BALL) + if (ballId == BALL_HEAL) { MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget); diff --git a/src/data/graphics/items.h b/src/data/graphics/items.h index 45e3ec0e2c..b508df90a1 100644 --- a/src/data/graphics/items.h +++ b/src/data/graphics/items.h @@ -6,6 +6,9 @@ const u32 gItemIconPalette_ReturnToFieldArrow[] = INCBIN_U32("graphics/items/ico // Poké Balls +const u32 gItemIcon_StrangeBall[] = INCBIN_U32("graphics/items/icons/strange_ball.4bpp.lz"); +const u32 gItemIconPalette_StrangeBall[] = INCBIN_U32("graphics/items/icon_palettes/strange_ball.gbapal.lz"); + const u32 gItemIcon_PokeBall[] = INCBIN_U32("graphics/items/icons/poke_ball.4bpp.lz"); const u32 gItemIconPalette_PokeBall[] = INCBIN_U32("graphics/items/icon_palettes/poke_ball.gbapal.lz"); diff --git a/src/data/graphics/pokeballs.h b/src/data/graphics/pokeballs.h index 44f47cde48..f09d635d21 100644 --- a/src/data/graphics/pokeballs.h +++ b/src/data/graphics/pokeballs.h @@ -1,3 +1,6 @@ +const u32 gBallGfx_Strange[] = INCBIN_U32("graphics/balls/strange.4bpp.lz"); +const u32 gBallPal_Strange[] = INCBIN_U32("graphics/balls/strange.gbapal.lz"); + const u32 gBallGfx_Poke[] = INCBIN_U32("graphics/balls/poke.4bpp.lz"); const u32 gBallPal_Poke[] = INCBIN_U32("graphics/balls/poke.gbapal.lz"); diff --git a/src/data/items.h b/src/data/items.h index 88a46efd7d..2b560ad9d5 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -154,6 +154,22 @@ const struct Item gItemsInfo[] = // Poké Balls + [ITEM_STRANGE_BALL] = + { + .name = _("Strange Ball"), + .price = 0, + .description = COMPOUND_STRING( + "An unusual Ball\n" + "warped through\n" + "space and time."), + .pocket = POCKET_POKE_BALLS, + .type = ITEM_USE_BAG_MENU, + .battleUsage = EFFECT_ITEM_THROW_BALL, + .secondaryId = BALL_STRANGE, + .iconPic = gItemIcon_StrangeBall, + .iconPalette = gItemIconPalette_StrangeBall, + }, + [ITEM_POKE_BALL] = { .name = _("Poké Ball"), @@ -165,7 +181,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_POKE_BALL - FIRST_BALL, + .secondaryId = BALL_POKE, .iconPic = gItemIcon_PokeBall, .iconPalette = gItemIconPalette_PokeBall, }, @@ -181,7 +197,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_GREAT_BALL - FIRST_BALL, + .secondaryId = BALL_GREAT, .iconPic = gItemIcon_GreatBall, .iconPalette = gItemIconPalette_GreatBall, }, @@ -197,7 +213,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_ULTRA_BALL - FIRST_BALL, + .secondaryId = BALL_ULTRA, .iconPic = gItemIcon_UltraBall, .iconPalette = gItemIconPalette_UltraBall, }, @@ -213,7 +229,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_MASTER_BALL - FIRST_BALL, + .secondaryId = BALL_MASTER, .iconPic = gItemIcon_MasterBall, .iconPalette = gItemIconPalette_MasterBall, }, @@ -229,7 +245,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_PREMIER_BALL - FIRST_BALL, + .secondaryId = BALL_PREMIER, .iconPic = gItemIcon_PremierBall, .iconPalette = gItemIconPalette_LuxuryBall, }, @@ -245,7 +261,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_HEAL_BALL - FIRST_BALL, + .secondaryId = BALL_HEAL, .iconPic = gItemIcon_HealBall, .iconPalette = gItemIconPalette_HealBall, }, @@ -261,7 +277,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_NET_BALL - FIRST_BALL, + .secondaryId = BALL_NET, .iconPic = gItemIcon_NetBall, .iconPalette = gItemIconPalette_NetBall, }, @@ -277,7 +293,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_NEST_BALL - FIRST_BALL, + .secondaryId = BALL_NEST, .iconPic = gItemIcon_NestBall, .iconPalette = gItemIconPalette_NestBall, }, @@ -293,7 +309,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_DIVE_BALL - FIRST_BALL, + .secondaryId = BALL_DIVE, .iconPic = gItemIcon_DiveBall, .iconPalette = gItemIconPalette_DiveBall, }, @@ -309,7 +325,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_DUSK_BALL - FIRST_BALL, + .secondaryId = BALL_DUSK, .iconPic = gItemIcon_DuskBall, .iconPalette = gItemIconPalette_DuskBall, }, @@ -325,7 +341,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_TIMER_BALL - FIRST_BALL, + .secondaryId = BALL_TIMER, .iconPic = gItemIcon_TimerBall, .iconPalette = gItemIconPalette_RepeatBall, }, @@ -341,7 +357,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_QUICK_BALL - FIRST_BALL, + .secondaryId = BALL_QUICK, .iconPic = gItemIcon_QuickBall, .iconPalette = gItemIconPalette_QuickBall, }, @@ -357,7 +373,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_REPEAT_BALL - FIRST_BALL, + .secondaryId = BALL_REPEAT, .iconPic = gItemIcon_RepeatBall, .iconPalette = gItemIconPalette_RepeatBall, }, @@ -373,7 +389,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_LUXURY_BALL - FIRST_BALL, + .secondaryId = BALL_LUXURY, .iconPic = gItemIcon_LuxuryBall, .iconPalette = gItemIconPalette_LuxuryBall, }, @@ -389,7 +405,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_LEVEL_BALL - FIRST_BALL, + .secondaryId = BALL_LEVEL, .iconPic = gItemIcon_LevelBall, .iconPalette = gItemIconPalette_LevelBall, }, @@ -405,7 +421,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_LURE_BALL - FIRST_BALL, + .secondaryId = BALL_LURE, .iconPic = gItemIcon_LureBall, .iconPalette = gItemIconPalette_LureBall, }, @@ -421,7 +437,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_MOON_BALL - FIRST_BALL, + .secondaryId = BALL_MOON, .iconPic = gItemIcon_MoonBall, .iconPalette = gItemIconPalette_MoonBall, }, @@ -437,7 +453,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_FRIEND_BALL - FIRST_BALL, + .secondaryId = BALL_FRIEND, .iconPic = gItemIcon_FriendBall, .iconPalette = gItemIconPalette_FriendBall, }, @@ -453,7 +469,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_LOVE_BALL - FIRST_BALL, + .secondaryId = BALL_LOVE, .iconPic = gItemIcon_LoveBall, .iconPalette = gItemIconPalette_LoveBall, }, @@ -469,7 +485,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_FAST_BALL - FIRST_BALL, + .secondaryId = BALL_FAST, .iconPic = gItemIcon_FastBall, .iconPalette = gItemIconPalette_FastBall, }, @@ -485,7 +501,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_HEAVY_BALL - FIRST_BALL, + .secondaryId = BALL_HEAVY, .iconPic = gItemIcon_HeavyBall, .iconPalette = gItemIconPalette_HeavyBall, }, @@ -506,7 +522,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_DREAM_BALL - FIRST_BALL, + .secondaryId = BALL_DREAM, .iconPic = gItemIcon_DreamBall, .iconPalette = gItemIconPalette_DreamBall, }, @@ -522,7 +538,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_SAFARI_BALL - FIRST_BALL, + .secondaryId = BALL_SAFARI, .iconPic = gItemIcon_SafariBall, .iconPalette = gItemIconPalette_SafariBall, }, @@ -538,7 +554,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_SPORT_BALL - FIRST_BALL, + .secondaryId = BALL_SPORT, .iconPic = gItemIcon_SportBall, .iconPalette = gItemIconPalette_SportBall, }, @@ -553,7 +569,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_PARK_BALL - FIRST_BALL, + .secondaryId = BALL_PARK, .iconPic = gItemIcon_ParkBall, .iconPalette = gItemIconPalette_ParkBall, }, @@ -568,7 +584,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_BEAST_BALL - FIRST_BALL, + .secondaryId = BALL_BEAST, .iconPic = gItemIcon_BeastBall, .iconPalette = gItemIconPalette_BeastBall, }, @@ -584,7 +600,7 @@ const struct Item gItemsInfo[] = .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, - .secondaryId = ITEM_CHERISH_BALL - FIRST_BALL, + .secondaryId = BALL_CHERISH, .iconPic = gItemIcon_CherishBall, .iconPalette = gItemIconPalette_CherishBall, }, diff --git a/src/daycare.c b/src/daycare.c index 780e69e44d..013e0b05ba 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -716,17 +716,17 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare) static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, struct BoxPokemon *mother) { - u16 inheritBall = ITEM_POKE_BALL; - u16 fatherBall = GetBoxMonData(father, MON_DATA_POKEBALL); - u16 motherBall = GetBoxMonData(mother, MON_DATA_POKEBALL); + enum PokeBall inheritBall = BALL_POKE; + enum PokeBall fatherBall = GetBoxMonData(father, MON_DATA_POKEBALL); + enum PokeBall motherBall = GetBoxMonData(mother, MON_DATA_POKEBALL); u16 fatherSpecies = GetBoxMonData(father, MON_DATA_SPECIES); u16 motherSpecies = GetBoxMonData(mother, MON_DATA_SPECIES); - if (fatherBall == ITEM_MASTER_BALL || fatherBall == ITEM_CHERISH_BALL) - fatherBall = ITEM_POKE_BALL; + if (fatherBall == BALL_MASTER || fatherBall == BALL_CHERISH || fatherBall == BALL_STRANGE) + fatherBall = BALL_POKE; - if (motherBall == ITEM_MASTER_BALL || motherBall == ITEM_CHERISH_BALL) - motherBall = ITEM_POKE_BALL; + if (motherBall == BALL_MASTER || motherBall == BALL_CHERISH || motherBall == BALL_STRANGE) + motherBall = BALL_POKE; if (P_BALL_INHERITING >= GEN_7) { @@ -1087,14 +1087,14 @@ static void _GiveEggFromDaycare(struct DayCare *daycare) void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation) { u8 metLevel; - u16 ball; + enum PokeBall ball; u8 language; u8 metLocation; u8 isEgg; CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0); metLevel = 0; - ball = ITEM_POKE_BALL; + ball = BALL_POKE; language = LANGUAGE_JAPANESE; SetMonData(mon, MON_DATA_POKEBALL, &ball); SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); @@ -1114,14 +1114,14 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation) static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare) { u32 personality; - u16 ball; + enum PokeBall ball; u8 metLevel; u8 language; personality = daycare->offspringPersonality; CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0); metLevel = 0; - ball = ITEM_POKE_BALL; + ball = BALL_POKE; language = LANGUAGE_JAPANESE; SetMonData(mon, MON_DATA_POKEBALL, &ball); SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); diff --git a/src/debug.c b/src/debug.c index a3978fbd40..f1c403fc1e 100644 --- a/src/debug.c +++ b/src/debug.c @@ -4174,12 +4174,12 @@ static void DebugAction_PCBag_Fill_PocketItems(u8 taskId) static void DebugAction_PCBag_Fill_PocketPokeBalls(u8 taskId) { - u16 itemId; + u16 ballId; - for (itemId = FIRST_BALL; itemId < LAST_BALL; itemId++) + for (ballId = BALL_STRANGE; ballId < POKEBALL_COUNT; ballId++) { - if (CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) - AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); + if (CheckBagHasSpace(ballId, MAX_BAG_ITEM_CAPACITY)) + AddBagItem(ballId, MAX_BAG_ITEM_CAPACITY); } } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 88f2b329e9..ee45635ce7 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -314,7 +314,8 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) { u16 species; u32 personality, pokerus; - u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter, ball; + enum PokeBall ball; + u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter; u16 moves[MAX_MON_MOVES]; u32 ivs[NUM_STATS]; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 9a4f9980f5..f1aefbb046 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -7344,12 +7344,12 @@ static u8 LoadFillColorPalette(u16 color, u16 paletteTag, struct Sprite *sprite) static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent) { #if OW_FOLLOWERS_POKEBALLS - u32 ball = BALL_POKE; + enum PokeBall ball = BALL_STRANGE; if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER) { struct Pokemon *mon = GetFirstLiveMon(); if (mon) - ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL)); + ball = GetMonData(mon, MON_DATA_POKEBALL); } if (ball != BALL_POKE && ball < POKEBALL_COUNT) diff --git a/src/item.c b/src/item.c index 36114e1591..b0135d8f83 100644 --- a/src/item.c +++ b/src/item.c @@ -1,6 +1,7 @@ #include "global.h" #include "item.h" #include "berry.h" +#include "pokeball.h" #include "string_util.h" #include "text.h" #include "event_data.h" @@ -166,11 +167,11 @@ bool8 HasAtLeastOneBerry(void) bool8 HasAtLeastOnePokeBall(void) { - u16 i; + u16 ballId; - for (i = FIRST_BALL; i <= LAST_BALL; i++) + for (ballId = BALL_STRANGE; ballId < POKEBALL_COUNT; ballId++) { - if (CheckBagHasItem(i, 1) == TRUE) + if (CheckBagHasItem(ballId, 1) == TRUE) return TRUE; } return FALSE; @@ -968,7 +969,7 @@ u8 ItemId_GetBattleUsage(u16 itemId) return gItemsInfo[item].battleUsage; } -u8 ItemId_GetSecondaryId(u16 itemId) +u32 ItemId_GetSecondaryId(u32 itemId) { return gItemsInfo[SanitizeItemId(itemId)].secondaryId; } diff --git a/src/pokeball.c b/src/pokeball.c index 21557d973a..2b168cd7e3 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -13,6 +13,7 @@ #include "trig.h" #include "util.h" #include "data.h" +#include "item.h" #include "constants/songs.h" static void Task_DoPokeballSendOutAnim(u8 taskId); @@ -47,36 +48,38 @@ static u16 GetBattlerPokeballItemId(u8 battlerId); // rom const data -#define GFX_TAG_POKE_BALL 55000 -#define GFX_TAG_GREAT_BALL 55001 -#define GFX_TAG_ULTRA_BALL 55002 -#define GFX_TAG_MASTER_BALL 55003 -#define GFX_TAG_PREMIER_BALL 55004 -#define GFX_TAG_HEAL_BALL 55005 -#define GFX_TAG_NET_BALL 55006 -#define GFX_TAG_NEST_BALL 55007 -#define GFX_TAG_DIVE_BALL 55008 -#define GFX_TAG_DUSK_BALL 55009 -#define GFX_TAG_TIMER_BALL 55010 -#define GFX_TAG_QUICK_BALL 55011 -#define GFX_TAG_REPEAT_BALL 55012 -#define GFX_TAG_LUXURY_BALL 55013 -#define GFX_TAG_LEVEL_BALL 55014 -#define GFX_TAG_LURE_BALL 55015 -#define GFX_TAG_MOON_BALL 55016 -#define GFX_TAG_FRIEND_BALL 55017 -#define GFX_TAG_LOVE_BALL 55018 -#define GFX_TAG_FAST_BALL 55019 -#define GFX_TAG_HEAVY_BALL 55020 -#define GFX_TAG_DREAM_BALL 55021 -#define GFX_TAG_SAFARI_BALL 55022 -#define GFX_TAG_SPORT_BALL 55023 -#define GFX_TAG_PARK_BALL 55024 -#define GFX_TAG_BEAST_BALL 55025 -#define GFX_TAG_CHERISH_BALL 55026 +#define GFX_TAG_STRANGE_BALL 55000 +#define GFX_TAG_POKE_BALL 55001 +#define GFX_TAG_GREAT_BALL 55002 +#define GFX_TAG_ULTRA_BALL 55003 +#define GFX_TAG_MASTER_BALL 55004 +#define GFX_TAG_PREMIER_BALL 55005 +#define GFX_TAG_HEAL_BALL 55006 +#define GFX_TAG_NET_BALL 55007 +#define GFX_TAG_NEST_BALL 55008 +#define GFX_TAG_DIVE_BALL 55009 +#define GFX_TAG_DUSK_BALL 55010 +#define GFX_TAG_TIMER_BALL 55011 +#define GFX_TAG_QUICK_BALL 55012 +#define GFX_TAG_REPEAT_BALL 55013 +#define GFX_TAG_LUXURY_BALL 55014 +#define GFX_TAG_LEVEL_BALL 55015 +#define GFX_TAG_LURE_BALL 55016 +#define GFX_TAG_MOON_BALL 55017 +#define GFX_TAG_FRIEND_BALL 55018 +#define GFX_TAG_LOVE_BALL 55019 +#define GFX_TAG_FAST_BALL 55020 +#define GFX_TAG_HEAVY_BALL 55021 +#define GFX_TAG_DREAM_BALL 55022 +#define GFX_TAG_SAFARI_BALL 55023 +#define GFX_TAG_SPORT_BALL 55024 +#define GFX_TAG_PARK_BALL 55025 +#define GFX_TAG_BEAST_BALL 55026 +#define GFX_TAG_CHERISH_BALL 55027 const struct CompressedSpriteSheet gBallSpriteSheets[POKEBALL_COUNT] = { + [BALL_STRANGE] = {gBallGfx_Strange, 384, GFX_TAG_STRANGE_BALL}, [BALL_POKE] = {gBallGfx_Poke, 384, GFX_TAG_POKE_BALL}, [BALL_GREAT] = {gBallGfx_Great, 384, GFX_TAG_GREAT_BALL}, [BALL_ULTRA] = {gBallGfx_Ultra, 384, GFX_TAG_ULTRA_BALL}, @@ -108,6 +111,7 @@ const struct CompressedSpriteSheet gBallSpriteSheets[POKEBALL_COUNT] = const struct CompressedSpritePalette gBallSpritePalettes[POKEBALL_COUNT] = { + [BALL_STRANGE] = {gBallPal_Strange, GFX_TAG_STRANGE_BALL}, [BALL_POKE] = {gBallPal_Poke, GFX_TAG_POKE_BALL}, [BALL_GREAT] = {gBallPal_Great, GFX_TAG_GREAT_BALL}, [BALL_ULTRA] = {gBallPal_Ultra, GFX_TAG_ULTRA_BALL}, @@ -252,6 +256,16 @@ static const union AffineAnimCmd *const sAffineAnim_BallRotate[] = const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] = { + [BALL_STRANGE] = + { + .tileTag = GFX_TAG_STRANGE_BALL, + .paletteTag = GFX_TAG_STRANGE_BALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sAffineAnim_BallRotate, + .callback = SpriteCB_BallThrow, + }, [BALL_POKE] = { .tileTag = GFX_TAG_POKE_BALL, @@ -562,7 +576,7 @@ static void Task_DoPokeballSendOutAnim(u8 taskId) throwCaseId = gTasks[taskId].tThrowId; battlerId = gTasks[taskId].tBattler; - ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId)); + ballId = GetBattlerPokeballItemId(battlerId); LoadBallGfx(ballId); ballSpriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29); gSprites[ballSpriteId].data[0] = 0x80; @@ -651,7 +665,7 @@ static void SpriteCB_BallThrow(struct Sprite *sprite) sprite->x2 = 0; sprite->y2 = 0; sprite->data[5] = 0; - ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler)); + ballId = GetBattlerPokeballItemId(opponentBattler); AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId); sprite->sBattler = opponentBattler; @@ -967,7 +981,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) u32 ballId; StartSpriteAnim(sprite, 1); - ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId)); + ballId = GetBattlerPokeballItemId(battlerId); AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId); sprite->callback = HandleBallAnimEnd; @@ -1580,3 +1594,13 @@ static u16 GetBattlerPokeballItemId(u8 battlerId) return GetMonData(mon, MON_DATA_POKEBALL); } + +enum PokeBall ItemIdToBallId(u32 ballItem) +{ + enum PokeBall secondaryId = ItemId_GetSecondaryId(ballItem); + + if (secondaryId <= BALL_STRANGE || secondaryId >= POKEBALL_COUNT) + return BALL_STRANGE; + + return secondaryId; +} diff --git a/src/pokemon.c b/src/pokemon.c index c5dcbb1903..242d28d664 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1022,7 +1022,7 @@ STATIC_ASSERT(NUM_SPECIES < (1 << 11), PokemonSubstruct0_species_TooSmall); STATIC_ASSERT(NUMBER_OF_MON_TYPES + 1 <= (1 << 5), PokemonSubstruct0_teraType_TooSmall); STATIC_ASSERT(ITEMS_COUNT < (1 << 10), PokemonSubstruct0_heldItem_TooSmall); STATIC_ASSERT(MAX_LEVEL <= 100, PokemonSubstruct0_experience_PotentiallTooSmall); // Maximum of ~2 million exp. -STATIC_ASSERT(LAST_BALL < (1 << 6), PokemonSubstruct0_pokeball_TooSmall); +STATIC_ASSERT(POKEBALL_COUNT <= (1 << 6), PokemonSubstruct0_pokeball_TooSmall); STATIC_ASSERT(MOVES_COUNT_ALL < (1 << 11), PokemonSubstruct1_moves_TooSmall); STATIC_ASSERT(ARRAY_COUNT(sCompressedStatuses) <= (1 << 4), PokemonSubstruct3_compressedStatus_TooSmall); STATIC_ASSERT(MAX_LEVEL < (1 << 7), PokemonSubstruct3_metLevel_TooSmall); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index d20e3299d2..4cfc17c707 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1579,8 +1579,8 @@ static void SetDefaultTilemaps(void) SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]); SetBgAttribute(1, BG_ATTR_PRIORITY, 2); SetBgAttribute(2, BG_ATTR_PRIORITY, 1); - ChangeBgX(1, 0x10000, BG_COORD_ADD); - ChangeBgX(2, 0x10000, BG_COORD_ADD); + ChangeBgX(1, 0x10000, BG_COORD_ADD); + ChangeBgX(2, 0x10000, BG_COORD_ADD); ShowBg(1); ShowBg(2); } @@ -1591,8 +1591,8 @@ static void SetDefaultTilemaps(void) SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]); SetBgAttribute(1, BG_ATTR_PRIORITY, 1); SetBgAttribute(2, BG_ATTR_PRIORITY, 2); - ChangeBgX(1, 0x10000, BG_COORD_ADD); - ChangeBgX(2, 0x10000, BG_COORD_ADD); + ChangeBgX(1, 0x10000, BG_COORD_ADD); + ChangeBgX(2, 0x10000, BG_COORD_ADD); ShowBg(1); ShowBg(2); } @@ -4271,7 +4271,7 @@ static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *mon) static void CreateCaughtBallSprite(struct Pokemon *mon) { - u8 ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL)); + enum PokeBall ball = GetMonData(mon, MON_DATA_POKEBALL); LoadBallGfx(ball); sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_BALL] = CreateSprite(&gBallSpriteTemplates[ball], 16, 136, 0); @@ -4392,7 +4392,7 @@ static inline bool32 ShouldShowMoveRelearner(void) && sMonSummaryScreen->mode != SUMMARY_MODE_BOX && sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR && sMonSummaryScreen->relearnableMovesNum > 0 - && !InBattleFactory() + && !InBattleFactory() && !InSlateportBattleTent()); } @@ -4403,7 +4403,7 @@ static inline bool32 ShouldShowRename(void) && !sMonSummaryScreen->summary.isEgg && sMonSummaryScreen->mode != SUMMARY_MODE_BOX && sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR - && !InBattleFactory() + && !InBattleFactory() && !InSlateportBattleTent() && GetPlayerIDAsU32() == sMonSummaryScreen->summary.OTID); } @@ -4431,7 +4431,7 @@ static void CB2_PssChangePokemonNickname(void) { GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3); GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2); - DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL), - GetMonGender(&gPlayerParty[gSpecialVar_0x8004]), GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL), + DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL), + GetMonGender(&gPlayerParty[gSpecialVar_0x8004]), GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL), CB2_ReturnToSummaryScreenFromNamingScreen); } diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 3d2c7d640c..020094389a 100644 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -317,7 +317,7 @@ void SetTeraType(struct ScriptContext *ctx) * if side/slot are assigned, it will create the mon at the assigned party location * if slot == PARTY_SIZE, it will give the mon to first available party or storage slot */ -static u32 ScriptGiveMonParameterized(u8 side, u8 slot, u16 species, u8 level, u16 item, u8 ball, u8 nature, u8 abilityNum, u8 gender, u8 *evs, u8 *ivs, u16 *moves, bool8 isShiny, bool8 ggMaxFactor, u8 teraType) +static u32 ScriptGiveMonParameterized(u8 side, u8 slot, u16 species, u8 level, u16 item, enum PokeBall ball, u8 nature, u8 abilityNum, u8 gender, u8 *evs, u8 *ivs, u16 *moves, bool8 isShiny, bool8 ggMaxFactor, u8 teraType) { u16 nationalDexNum; int sentToPc; @@ -396,8 +396,8 @@ static u32 ScriptGiveMonParameterized(u8 side, u8 slot, u16 species, u8 level, u SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum); // ball - if (ball > LAST_BALL) - ball = ITEM_POKE_BALL; + if (ball > POKEBALL_COUNT) + ball = BALL_POKE; SetMonData(&mon, MON_DATA_POKEBALL, &ball); // held item diff --git a/test/battle/trainer_control.c b/test/battle/trainer_control.c index e31d281efe..5344a26596 100644 --- a/test/battle/trainer_control.c +++ b/test/battle/trainer_control.c @@ -24,8 +24,8 @@ TEST("CreateNPCTrainerPartyForTrainer generates customized Pokémon") EXPECT(IsMonShiny(&testParty[0])); EXPECT(!IsMonShiny(&testParty[1])); - EXPECT(GetMonData(&testParty[0], MON_DATA_POKEBALL, 0) == ITEM_MASTER_BALL); - EXPECT(GetMonData(&testParty[1], MON_DATA_POKEBALL, 0) == ITEM_POKE_BALL); + EXPECT(GetMonData(&testParty[0], MON_DATA_POKEBALL, 0) == BALL_MASTER); + EXPECT(GetMonData(&testParty[1], MON_DATA_POKEBALL, 0) == BALL_POKE); EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET); EXPECT(GetMonData(&testParty[1], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET); diff --git a/test/pokemon.c b/test/pokemon.c index 8419b9c7e1..f5431559ee 100644 --- a/test/pokemon.c +++ b/test/pokemon.c @@ -237,7 +237,7 @@ TEST("givemon [all]") EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET); EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100); EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_HELD_ITEM), ITEM_LEFTOVERS); - EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_POKEBALL), ITEM_MASTER_BALL); + EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_POKEBALL), BALL_MASTER); EXPECT_EQ(GetNature(&gPlayerParty[0]), NATURE_BOLD); EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]); EXPECT_EQ(GetMonGender(&gPlayerParty[0]), MON_MALE); @@ -300,7 +300,7 @@ TEST("givemon [vars]") EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET); EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100); EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_HELD_ITEM), ITEM_LEFTOVERS); - EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_POKEBALL), ITEM_MASTER_BALL); + EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_POKEBALL), BALL_MASTER); EXPECT_EQ(GetNature(&gPlayerParty[0]), NATURE_BOLD); EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]); EXPECT_EQ(GetMonGender(&gPlayerParty[0]), MON_MALE);