Decouple Poke Ball ids from item ids (#5560)
This commit is contained in:
parent
0b66f52ead
commit
76eae8ed00
26 changed files with 300 additions and 296 deletions
BIN
graphics/balls/strange.png
Normal file
BIN
graphics/balls/strange.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 358 B |
19
graphics/items/icon_palettes/strange_ball.pal
Normal file
19
graphics/items/icon_palettes/strange_ball.pal
Normal file
|
@ -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
|
BIN
graphics/items/icons/strange_ball.png
Normal file
BIN
graphics/items/icons/strange_ball.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 304 B |
|
@ -235,7 +235,6 @@ extern const union AffineAnimCmd *const gAffineAnims_SpinningBone[];
|
||||||
|
|
||||||
// battle_anim_throw.c
|
// battle_anim_throw.c
|
||||||
void TryShinyAnimation(u8 battler, struct Pokemon *mon);
|
void TryShinyAnimation(u8 battler, struct Pokemon *mon);
|
||||||
u8 ItemIdToBallId(u16 itemId);
|
|
||||||
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
|
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
|
||||||
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId);
|
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId);
|
||||||
bool32 IsCriticalCapture(void);
|
bool32 IsCriticalCapture(void);
|
||||||
|
|
|
@ -32,12 +32,6 @@
|
||||||
#define ITEM_BEAST_BALL 26
|
#define ITEM_BEAST_BALL 26
|
||||||
#define ITEM_CHERISH_BALL 27
|
#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
|
// Medicine
|
||||||
#define ITEM_POTION 28
|
#define ITEM_POTION 28
|
||||||
#define ITEM_SUPER_POTION 29
|
#define ITEM_SUPER_POTION 29
|
||||||
|
@ -998,10 +992,12 @@
|
||||||
#define ITEM_TWICE_SPICED_RADISH 826
|
#define ITEM_TWICE_SPICED_RADISH 826
|
||||||
#define ITEM_POKESHI_DOLL 827
|
#define ITEM_POKESHI_DOLL 827
|
||||||
|
|
||||||
|
#define ITEM_STRANGE_BALL 828
|
||||||
|
|
||||||
// HOPO BERRY
|
// HOPO BERRY
|
||||||
// LEGEND PLATE
|
// LEGEND PLATE
|
||||||
|
|
||||||
#define ITEMS_COUNT 828
|
#define ITEMS_COUNT 829
|
||||||
#define ITEM_FIELD_ARROW ITEMS_COUNT
|
#define ITEM_FIELD_ARROW ITEMS_COUNT
|
||||||
|
|
||||||
// A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations
|
// A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations
|
||||||
|
|
|
@ -7,6 +7,8 @@ extern const u32 gMessageBox_Gfx[];
|
||||||
extern const u16 gMessageBox_Pal[];
|
extern const u16 gMessageBox_Pal[];
|
||||||
|
|
||||||
// pokeballs
|
// pokeballs
|
||||||
|
extern const u32 gBallGfx_Strange[];
|
||||||
|
extern const u32 gBallPal_Strange[];
|
||||||
extern const u32 gBallGfx_Poke[];
|
extern const u32 gBallGfx_Poke[];
|
||||||
extern const u32 gBallPal_Poke[];
|
extern const u32 gBallPal_Poke[];
|
||||||
extern const u32 gBallGfx_Great[];
|
extern const u32 gBallGfx_Great[];
|
||||||
|
@ -360,6 +362,8 @@ extern const u32 gRaySceneChasesAway_Light_Gfx[];
|
||||||
extern const u32 gRaySceneChasesAway_Ring_Gfx[];
|
extern const u32 gRaySceneChasesAway_Ring_Gfx[];
|
||||||
|
|
||||||
// Poké Balls
|
// Poké Balls
|
||||||
|
extern const u32 gItemIcon_StrangeBall[];
|
||||||
|
extern const u32 gItemIconPalette_StrangeBall[];
|
||||||
extern const u32 gItemIcon_PokeBall[];
|
extern const u32 gItemIcon_PokeBall[];
|
||||||
extern const u32 gItemIconPalette_PokeBall[];
|
extern const u32 gItemIconPalette_PokeBall[];
|
||||||
extern const u32 gItemIcon_GreatBall[];
|
extern const u32 gItemIcon_GreatBall[];
|
||||||
|
|
|
@ -80,7 +80,7 @@ u8 ItemId_GetPocket(u16 itemId);
|
||||||
u8 ItemId_GetType(u16 itemId);
|
u8 ItemId_GetType(u16 itemId);
|
||||||
ItemUseFunc ItemId_GetFieldFunc(u16 itemId);
|
ItemUseFunc ItemId_GetFieldFunc(u16 itemId);
|
||||||
u8 ItemId_GetBattleUsage(u16 itemId);
|
u8 ItemId_GetBattleUsage(u16 itemId);
|
||||||
u8 ItemId_GetSecondaryId(u16 itemId);
|
u32 ItemId_GetSecondaryId(u32 itemId);
|
||||||
u32 ItemId_GetFlingPower(u32 itemId);
|
u32 ItemId_GetFlingPower(u32 itemId);
|
||||||
u32 GetItemStatus1Mask(u16 itemId);
|
u32 GetItemStatus1Mask(u16 itemId);
|
||||||
u32 GetItemStatus2Mask(u16 itemId);
|
u32 GetItemStatus2Mask(u16 itemId);
|
||||||
|
|
|
@ -1,35 +1,36 @@
|
||||||
#ifndef GUARD_POKEBALL_H
|
#ifndef GUARD_POKEBALL_H
|
||||||
#define GUARD_POKEBALL_H
|
#define GUARD_POKEBALL_H
|
||||||
|
|
||||||
enum
|
enum PokeBall
|
||||||
{
|
{
|
||||||
BALL_POKE,
|
BALL_STRANGE = 0,
|
||||||
BALL_GREAT,
|
BALL_POKE = 1,
|
||||||
BALL_ULTRA,
|
BALL_GREAT = 2,
|
||||||
BALL_MASTER,
|
BALL_ULTRA = 3,
|
||||||
BALL_PREMIER,
|
BALL_MASTER = 4,
|
||||||
BALL_HEAL,
|
BALL_PREMIER = 5,
|
||||||
BALL_NET,
|
BALL_HEAL = 6,
|
||||||
BALL_NEST,
|
BALL_NET = 7,
|
||||||
BALL_DIVE,
|
BALL_NEST = 8,
|
||||||
BALL_DUSK,
|
BALL_DIVE = 9,
|
||||||
BALL_TIMER,
|
BALL_DUSK = 10,
|
||||||
BALL_QUICK,
|
BALL_TIMER = 11,
|
||||||
BALL_REPEAT,
|
BALL_QUICK = 12,
|
||||||
BALL_LUXURY,
|
BALL_REPEAT = 13,
|
||||||
BALL_LEVEL,
|
BALL_LUXURY = 14,
|
||||||
BALL_LURE,
|
BALL_LEVEL = 15,
|
||||||
BALL_MOON,
|
BALL_LURE = 16,
|
||||||
BALL_FRIEND,
|
BALL_MOON = 17,
|
||||||
BALL_LOVE,
|
BALL_FRIEND = 18,
|
||||||
BALL_FAST,
|
BALL_LOVE = 19,
|
||||||
BALL_HEAVY,
|
BALL_FAST = 20,
|
||||||
BALL_DREAM,
|
BALL_HEAVY = 21,
|
||||||
BALL_SAFARI,
|
BALL_DREAM = 22,
|
||||||
BALL_SPORT,
|
BALL_SAFARI = 23,
|
||||||
BALL_PARK,
|
BALL_SPORT = 24,
|
||||||
BALL_BEAST,
|
BALL_PARK = 25,
|
||||||
BALL_CHERISH,
|
BALL_BEAST = 26,
|
||||||
|
BALL_CHERISH = 27,
|
||||||
POKEBALL_COUNT
|
POKEBALL_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,5 +57,6 @@ void StartHealthboxSlideIn(u8 battler);
|
||||||
void DoHitAnimHealthboxEffect(u8 battler);
|
void DoHitAnimHealthboxEffect(u8 battler);
|
||||||
void LoadBallGfx(u8 ballId);
|
void LoadBallGfx(u8 ballId);
|
||||||
void FreeBallGfx(u8 ballId);
|
void FreeBallGfx(u8 ballId);
|
||||||
|
enum PokeBall ItemIdToBallId(u32 ballItem);
|
||||||
|
|
||||||
#endif // GUARD_POKEBALL_H
|
#endif // GUARD_POKEBALL_H
|
||||||
|
|
|
@ -88,7 +88,7 @@ Moves all information from `gItemIconTable` to `gItemsInfo`.
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_POKE_BALL - FIRST_BALL,
|
.secondaryId = BALL_POKE,
|
||||||
+ .iconSprite = gItemIcon_PokeBall,
|
+ .iconSprite = gItemIcon_PokeBall,
|
||||||
+ .iconPalette = gItemIconPalette_PokeBall,
|
+ .iconPalette = gItemIconPalette_PokeBall,
|
||||||
},
|
},
|
||||||
|
|
|
@ -128,36 +128,38 @@ static const struct CaptureStar sCaptureStars[] =
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TAG_PARTICLES_POKEBALL 65030
|
#define TAG_PARTICLES_STRANGEBALL 65030
|
||||||
#define TAG_PARTICLES_GREATBALL 65031
|
#define TAG_PARTICLES_POKEBALL 65031
|
||||||
#define TAG_PARTICLES_ULTRABALL 65032
|
#define TAG_PARTICLES_GREATBALL 65032
|
||||||
#define TAG_PARTICLES_MASTERBALL 65033
|
#define TAG_PARTICLES_ULTRABALL 65033
|
||||||
#define TAG_PARTICLES_PREMIERBALL 65034
|
#define TAG_PARTICLES_MASTERBALL 65034
|
||||||
#define TAG_PARTICLES_HEALBALL 65035
|
#define TAG_PARTICLES_PREMIERBALL 65035
|
||||||
#define TAG_PARTICLES_NETBALL 65036
|
#define TAG_PARTICLES_HEALBALL 65036
|
||||||
#define TAG_PARTICLES_NESTBALL 65037
|
#define TAG_PARTICLES_NETBALL 65037
|
||||||
#define TAG_PARTICLES_DIVEBALL 65038
|
#define TAG_PARTICLES_NESTBALL 65038
|
||||||
#define TAG_PARTICLES_DUSKBALL 65039
|
#define TAG_PARTICLES_DIVEBALL 65039
|
||||||
#define TAG_PARTICLES_TIMERBALL 65040
|
#define TAG_PARTICLES_DUSKBALL 65040
|
||||||
#define TAG_PARTICLES_QUICKBALL 65041
|
#define TAG_PARTICLES_TIMERBALL 65041
|
||||||
#define TAG_PARTICLES_REPEATBALL 65042
|
#define TAG_PARTICLES_QUICKBALL 65042
|
||||||
#define TAG_PARTICLES_LUXURYBALL 65043
|
#define TAG_PARTICLES_REPEATBALL 65043
|
||||||
#define TAG_PARTICLES_LEVELBALL 65044
|
#define TAG_PARTICLES_LUXURYBALL 65044
|
||||||
#define TAG_PARTICLES_LUREBALL 65045
|
#define TAG_PARTICLES_LEVELBALL 65045
|
||||||
#define TAG_PARTICLES_MOONBALL 65046
|
#define TAG_PARTICLES_LUREBALL 65046
|
||||||
#define TAG_PARTICLES_FRIENDBALL 65047
|
#define TAG_PARTICLES_MOONBALL 65047
|
||||||
#define TAG_PARTICLES_LOVEBALL 65048
|
#define TAG_PARTICLES_FRIENDBALL 65048
|
||||||
#define TAG_PARTICLES_FASTBALL 65049
|
#define TAG_PARTICLES_LOVEBALL 65049
|
||||||
#define TAG_PARTICLES_HEAVYBALL 65050
|
#define TAG_PARTICLES_FASTBALL 65050
|
||||||
#define TAG_PARTICLES_DREAMBALL 65051
|
#define TAG_PARTICLES_HEAVYBALL 65051
|
||||||
#define TAG_PARTICLES_SAFARIBALL 65052
|
#define TAG_PARTICLES_DREAMBALL 65052
|
||||||
#define TAG_PARTICLES_SPORTBALL 65053
|
#define TAG_PARTICLES_SAFARIBALL 65053
|
||||||
#define TAG_PARTICLES_PARKBALL 65054
|
#define TAG_PARTICLES_SPORTBALL 65054
|
||||||
#define TAG_PARTICLES_BEASTBALL 65055
|
#define TAG_PARTICLES_PARKBALL 65055
|
||||||
#define TAG_PARTICLES_CHERISHBALL 65056
|
#define TAG_PARTICLES_BEASTBALL 65056
|
||||||
|
#define TAG_PARTICLES_CHERISHBALL 65057
|
||||||
|
|
||||||
static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] =
|
static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] =
|
||||||
{
|
{
|
||||||
|
[BALL_STRANGE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_STRANGEBALL},
|
||||||
[BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL},
|
[BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL},
|
||||||
[BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL},
|
[BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL},
|
||||||
[BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL},
|
[BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL},
|
||||||
|
@ -189,6 +191,7 @@ static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] =
|
||||||
|
|
||||||
static const struct CompressedSpritePalette sBallParticlePalettes[] =
|
static const struct CompressedSpritePalette sBallParticlePalettes[] =
|
||||||
{
|
{
|
||||||
|
[BALL_STRANGE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_STRANGEBALL},
|
||||||
[BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL},
|
[BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL},
|
||||||
[BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL},
|
[BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL},
|
||||||
[BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL},
|
[BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL},
|
||||||
|
@ -272,6 +275,7 @@ static const union AnimCmd *const sAnims_BallParticles[] =
|
||||||
|
|
||||||
static const u8 sBallParticleAnimNums[POKEBALL_COUNT] =
|
static const u8 sBallParticleAnimNums[POKEBALL_COUNT] =
|
||||||
{
|
{
|
||||||
|
[BALL_STRANGE] = 0,
|
||||||
[BALL_POKE] = 0,
|
[BALL_POKE] = 0,
|
||||||
[BALL_GREAT] = 0,
|
[BALL_GREAT] = 0,
|
||||||
[BALL_ULTRA] = 5,
|
[BALL_ULTRA] = 5,
|
||||||
|
@ -304,6 +308,7 @@ static const u8 sBallParticleAnimNums[POKEBALL_COUNT] =
|
||||||
static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] =
|
static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] =
|
||||||
{
|
{
|
||||||
// Todo: assign and possibly create different particles
|
// Todo: assign and possibly create different particles
|
||||||
|
[BALL_STRANGE] = GreatBallOpenParticleAnimation,
|
||||||
[BALL_POKE] = PokeBallOpenParticleAnimation,
|
[BALL_POKE] = PokeBallOpenParticleAnimation,
|
||||||
[BALL_GREAT] = GreatBallOpenParticleAnimation,
|
[BALL_GREAT] = GreatBallOpenParticleAnimation,
|
||||||
[BALL_ULTRA] = UltraBallOpenParticleAnimation,
|
[BALL_ULTRA] = UltraBallOpenParticleAnimation,
|
||||||
|
@ -335,6 +340,15 @@ static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] =
|
||||||
|
|
||||||
static const struct SpriteTemplate sBallParticleSpriteTemplates[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] = {
|
[BALL_POKE] = {
|
||||||
.tileTag = TAG_PARTICLES_POKEBALL,
|
.tileTag = TAG_PARTICLES_POKEBALL,
|
||||||
.paletteTag = TAG_PARTICLES_POKEBALL,
|
.paletteTag = TAG_PARTICLES_POKEBALL,
|
||||||
|
@ -583,6 +597,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
|
||||||
const u16 gBallOpenFadeColors[] =
|
const u16 gBallOpenFadeColors[] =
|
||||||
{
|
{
|
||||||
// Todo, assign different colors
|
// Todo, assign different colors
|
||||||
|
[BALL_STRANGE] = RGB(16, 23, 30),
|
||||||
[BALL_POKE] = RGB(31, 22, 30),
|
[BALL_POKE] = RGB(31, 22, 30),
|
||||||
[BALL_GREAT] = RGB(16, 23, 30),
|
[BALL_GREAT] = RGB(16, 23, 30),
|
||||||
[BALL_ULTRA] = RGB(31, 31, 15),
|
[BALL_ULTRA] = RGB(31, 31, 15),
|
||||||
|
@ -887,19 +902,17 @@ void AnimTask_SwitchOutShrinkMon(u8 taskId)
|
||||||
void AnimTask_SwitchOutBallEffect(u8 taskId)
|
void AnimTask_SwitchOutBallEffect(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
u16 ball;
|
enum PokeBall ballId;
|
||||||
u8 ballId;
|
|
||||||
u8 x, y;
|
u8 x, y;
|
||||||
u8 priority, subpriority;
|
u8 priority, subpriority;
|
||||||
u32 selectedPalettes;
|
u32 selectedPalettes;
|
||||||
|
|
||||||
spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
|
spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
|
||||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||||
ball = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL);
|
ballId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_POKEBALL);
|
||||||
else
|
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])
|
switch (gTasks[taskId].data[0])
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -921,14 +934,14 @@ void AnimTask_SwitchOutBallEffect(u8 taskId)
|
||||||
|
|
||||||
void AnimTask_LoadBallGfx(u8 taskId)
|
void AnimTask_LoadBallGfx(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 ballId = ItemIdToBallId(gLastUsedItem);
|
enum PokeBall ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
LoadBallGfx(ballId);
|
LoadBallGfx(ballId);
|
||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimTask_FreeBallGfx(u8 taskId)
|
void AnimTask_FreeBallGfx(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 ballId = ItemIdToBallId(gLastUsedItem);
|
enum PokeBall ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
FreeBallGfx(ballId);
|
FreeBallGfx(ballId);
|
||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
|
@ -943,69 +956,6 @@ void AnimTask_IsBallBlockedByTrainer(u8 taskId)
|
||||||
DestroyAnimVisualTask(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 tSpriteId data[0]
|
||||||
|
|
||||||
#define sDuration data[0]
|
#define sDuration data[0]
|
||||||
|
@ -1014,10 +964,9 @@ u8 ItemIdToBallId(u16 ballItem)
|
||||||
|
|
||||||
void AnimTask_ThrowBall(u8 taskId)
|
void AnimTask_ThrowBall(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 ballId;
|
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
|
|
||||||
ballId = ItemIdToBallId(gLastUsedItem);
|
enum PokeBall ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
spriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29);
|
spriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29);
|
||||||
gSprites[spriteId].sDuration = 34;
|
gSprites[spriteId].sDuration = 34;
|
||||||
gSprites[spriteId].sTargetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
|
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)
|
void AnimTask_ThrowBall_StandingTrainer(u8 taskId)
|
||||||
{
|
{
|
||||||
s16 x, y;
|
s16 x, y;
|
||||||
u8 ballId;
|
enum PokeBall ballId;
|
||||||
u8 subpriority;
|
u8 subpriority;
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
|
|
||||||
|
@ -1128,8 +1077,7 @@ static void SpriteCB_Ball_Throw(struct Sprite *sprite)
|
||||||
|
|
||||||
static void SpriteCB_Ball_Arc(struct Sprite *sprite)
|
static void SpriteCB_Ball_Arc(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
s32 i;
|
u32 i;
|
||||||
u8 ballId;
|
|
||||||
|
|
||||||
if (TranslateAnimHorizontalArc(sprite))
|
if (TranslateAnimHorizontalArc(sprite))
|
||||||
{
|
{
|
||||||
|
@ -1151,14 +1099,9 @@ static void SpriteCB_Ball_Arc(struct Sprite *sprite)
|
||||||
sprite->sTimer = 0;
|
sprite->sTimer = 0;
|
||||||
sprite->callback = SpriteCB_Ball_MonShrink;
|
sprite->callback = SpriteCB_Ball_MonShrink;
|
||||||
|
|
||||||
ballId = ItemIdToBallId(gLastUsedItem);
|
enum PokeBall ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
switch (ballId)
|
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
||||||
{
|
LaunchBallFadeMonTask(FALSE, gBattleAnimTarget, 14, ballId);
|
||||||
case 0 ... POKEBALL_COUNT - 1:
|
|
||||||
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
|
||||||
LaunchBallFadeMonTask(FALSE, gBattleAnimTarget, 14, ballId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1720,20 +1663,13 @@ static void SpriteCB_CaptureStar_Flicker(struct Sprite *sprite)
|
||||||
// - Wild mon emerge from Poké Ball
|
// - Wild mon emerge from Poké Ball
|
||||||
static void SpriteCB_Ball_Release_Step(struct Sprite *sprite)
|
static void SpriteCB_Ball_Release_Step(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
u8 ballId;
|
|
||||||
|
|
||||||
StartSpriteAnim(sprite, 1);
|
StartSpriteAnim(sprite, 1);
|
||||||
StartSpriteAffineAnim(sprite, 0);
|
StartSpriteAffineAnim(sprite, 0);
|
||||||
sprite->callback = SpriteCB_Ball_Release_Wait;
|
sprite->callback = SpriteCB_Ball_Release_Wait;
|
||||||
|
|
||||||
ballId = ItemIdToBallId(gLastUsedItem);
|
enum PokeBall ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
switch (ballId)
|
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
||||||
{
|
LaunchBallFadeMonTask(TRUE, gBattleAnimTarget, 14, ballId);
|
||||||
case 0 ... POKEBALL_COUNT - 1:
|
|
||||||
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
|
||||||
LaunchBallFadeMonTask(TRUE, gBattleAnimTarget, 14, ballId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Animate Pokémon emerging from Poké Ball
|
// Animate Pokémon emerging from Poké Ball
|
||||||
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = FALSE;
|
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = FALSE;
|
||||||
|
|
|
@ -320,15 +320,15 @@ const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] =
|
||||||
TRAINER_CLASS(TRAINER_CLASS_HIKER, "HIKER", 10),
|
TRAINER_CLASS(TRAINER_CLASS_HIKER, "HIKER", 10),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_TEAM_AQUA, "TEAM AQUA"),
|
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_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_BIRD_KEEPER, "BIRD KEEPER", 8),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL),
|
TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, BALL_PREMIER),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL),
|
TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, BALL_DIVE),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_TEAM_MAGMA, "TEAM MAGMA"),
|
TRAINER_CLASS(TRAINER_CLASS_TEAM_MAGMA, "TEAM MAGMA"),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_EXPERT, "EXPERT", 10),
|
TRAINER_CLASS(TRAINER_CLASS_EXPERT, "EXPERT", 10),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_AQUA_ADMIN, "AQUA ADMIN", 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_BLACK_BELT, "BLACK BELT", 8, BALL_ULTRA),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL),
|
TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, BALL_MASTER),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_HEX_MANIAC, "HEX MANIAC", 6),
|
TRAINER_CLASS(TRAINER_CLASS_HEX_MANIAC, "HEX MANIAC", 6),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_AROMA_LADY, "AROMA LADY", 10),
|
TRAINER_CLASS(TRAINER_CLASS_AROMA_LADY, "AROMA LADY", 10),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_RUIN_MANIAC, "RUIN MANIAC", 15),
|
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_PICNICKER, "PICNICKER", 4),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_BUG_MANIAC, "BUG MANIAC", 15),
|
TRAINER_CLASS(TRAINER_CLASS_BUG_MANIAC, "BUG MANIAC", 15),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_PSYCHIC, "PSYCHIC", 6),
|
TRAINER_CLASS(TRAINER_CLASS_PSYCHIC, "PSYCHIC", 6),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL),
|
TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, BALL_LUXURY),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL),
|
TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, BALL_ULTRA),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_LEADER, "LEADER", 25),
|
TRAINER_CLASS(TRAINER_CLASS_LEADER, "LEADER", 25),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_SCHOOL_KID, "SCHOOL KID"),
|
TRAINER_CLASS(TRAINER_CLASS_SCHOOL_KID, "SCHOOL KID"),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_SR_AND_JR, "SR. AND JR.", 4),
|
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_POKEFAN, "POKéFAN", 20),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_YOUNGSTER, "YOUNGSTER", 4),
|
TRAINER_CLASS(TRAINER_CLASS_YOUNGSTER, "YOUNGSTER", 4),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_CHAMPION, "CHAMPION", 50),
|
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_TRIATHLETE, "TRIATHLETE", 10),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_DRAGON_TAMER, "DRAGON TAMER", 12),
|
TRAINER_CLASS(TRAINER_CLASS_DRAGON_TAMER, "DRAGON TAMER", 12),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_NINJA_BOY, "NINJA BOY", 3),
|
TRAINER_CLASS(TRAINER_CLASS_NINJA_BOY, "NINJA BOY", 3),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_BATTLE_GIRL, "BATTLE GIRL", 6),
|
TRAINER_CLASS(TRAINER_CLASS_BATTLE_GIRL, "BATTLE GIRL", 6),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_PARASOL_LADY, "PARASOL LADY", 10),
|
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_TWINS, "TWINS", 3),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_SAILOR, "SAILOR", 8),
|
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_MAGMA_ADMIN, "MAGMA ADMIN", 10),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_RIVAL, "{PKMN} TRAINER", 15),
|
TRAINER_CLASS(TRAINER_CLASS_RIVAL, "{PKMN} TRAINER", 15),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_BUG_CATCHER, "BUG CATCHER", 4),
|
TRAINER_CLASS(TRAINER_CLASS_BUG_CATCHER, "BUG CATCHER", 4),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_PKMN_RANGER, "{PKMN} RANGER", 12),
|
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_LASS, "LASS", 4),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_YOUNG_COUPLE, "YOUNG COUPLE", 8),
|
TRAINER_CLASS(TRAINER_CLASS_YOUNG_COUPLE, "YOUNG COUPLE", 8),
|
||||||
TRAINER_CLASS(TRAINER_CLASS_OLD_COUPLE, "OLD COUPLE", 10),
|
TRAINER_CLASS(TRAINER_CLASS_OLD_COUPLE, "OLD COUPLE", 10),
|
||||||
|
|
|
@ -15173,10 +15173,10 @@ static void Cmd_handleballthrow(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u32 odds, i;
|
u32 odds, i;
|
||||||
u8 catchRate;
|
u32 catchRate;
|
||||||
|
u32 ballId = ItemIdToBallId(gLastUsedItem);
|
||||||
|
|
||||||
gLastThrownBall = gLastUsedItem;
|
gBallToDisplay = gLastThrownBall = gLastUsedItem;
|
||||||
gBallToDisplay = gLastThrownBall;
|
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||||
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
|
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
|
||||||
else
|
else
|
||||||
|
@ -15184,39 +15184,39 @@ static void Cmd_handleballthrow(void)
|
||||||
|
|
||||||
if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].isUltraBeast)
|
if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].isUltraBeast)
|
||||||
{
|
{
|
||||||
if (gLastUsedItem == ITEM_BEAST_BALL)
|
if (ballId == BALL_BEAST)
|
||||||
ballMultiplier = 500;
|
ballMultiplier = 500;
|
||||||
else
|
else
|
||||||
ballMultiplier = 10;
|
ballMultiplier = 10;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (gLastUsedItem)
|
switch (ballId)
|
||||||
{
|
{
|
||||||
case ITEM_ULTRA_BALL:
|
case BALL_ULTRA:
|
||||||
ballMultiplier = 200;
|
ballMultiplier = 200;
|
||||||
break;
|
break;
|
||||||
case ITEM_SPORT_BALL:
|
case BALL_SPORT:
|
||||||
if (B_SPORT_BALL_MODIFIER <= GEN_7)
|
if (B_SPORT_BALL_MODIFIER <= GEN_7)
|
||||||
ballMultiplier = 150;
|
ballMultiplier = 150;
|
||||||
break;
|
break;
|
||||||
case ITEM_GREAT_BALL:
|
case BALL_GREAT:
|
||||||
ballMultiplier = 150;
|
ballMultiplier = 150;
|
||||||
break;
|
break;
|
||||||
case ITEM_SAFARI_BALL:
|
case BALL_SAFARI:
|
||||||
if (B_SAFARI_BALL_MODIFIER <= GEN_7)
|
if (B_SAFARI_BALL_MODIFIER <= GEN_7)
|
||||||
ballMultiplier = 150;
|
ballMultiplier = 150;
|
||||||
break;
|
break;
|
||||||
case ITEM_NET_BALL:
|
case BALL_NET:
|
||||||
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
|
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
|
||||||
ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300;
|
ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300;
|
||||||
break;
|
break;
|
||||||
case ITEM_DIVE_BALL:
|
case BALL_DIVE:
|
||||||
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER
|
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER
|
||||||
|| (B_DIVE_BALL_MODIFIER >= GEN_4 && (gIsFishingEncounter || gIsSurfingEncounter)))
|
|| (B_DIVE_BALL_MODIFIER >= GEN_4 && (gIsFishingEncounter || gIsSurfingEncounter)))
|
||||||
ballMultiplier = 350;
|
ballMultiplier = 350;
|
||||||
break;
|
break;
|
||||||
case ITEM_NEST_BALL:
|
case BALL_NEST:
|
||||||
if (B_NEST_BALL_MODIFIER >= GEN_6)
|
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.
|
//((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;
|
ballMultiplier = 100;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_REPEAT_BALL:
|
case BALL_REPEAT:
|
||||||
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
|
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
|
||||||
ballMultiplier = (B_REPEAT_BALL_MODIFIER >= GEN_7 ? 350 : 300);
|
ballMultiplier = (B_REPEAT_BALL_MODIFIER >= GEN_7 ? 350 : 300);
|
||||||
break;
|
break;
|
||||||
case ITEM_TIMER_BALL:
|
case BALL_TIMER:
|
||||||
ballMultiplier = 100 + (gBattleResults.battleTurnCounter * (B_TIMER_BALL_MODIFIER >= GEN_5 ? 30 : 10));
|
ballMultiplier = 100 + (gBattleResults.battleTurnCounter * (B_TIMER_BALL_MODIFIER >= GEN_5 ? 30 : 10));
|
||||||
if (ballMultiplier > 400)
|
if (ballMultiplier > 400)
|
||||||
ballMultiplier = 400;
|
ballMultiplier = 400;
|
||||||
break;
|
break;
|
||||||
case ITEM_DUSK_BALL:
|
case BALL_DUSK:
|
||||||
i = GetTimeOfDay();
|
i = GetTimeOfDay();
|
||||||
if (i == TIME_EVENING || i == TIME_NIGHT || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
if (i == TIME_EVENING || i == TIME_NIGHT || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
||||||
ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350);
|
ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350);
|
||||||
break;
|
break;
|
||||||
case ITEM_QUICK_BALL:
|
case BALL_QUICK:
|
||||||
if (gBattleResults.battleTurnCounter == 0)
|
if (gBattleResults.battleTurnCounter == 0)
|
||||||
ballMultiplier = (B_QUICK_BALL_MODIFIER >= GEN_5 ? 500 : 400);
|
ballMultiplier = (B_QUICK_BALL_MODIFIER >= GEN_5 ? 500 : 400);
|
||||||
break;
|
break;
|
||||||
case ITEM_LEVEL_BALL:
|
case BALL_LEVEL:
|
||||||
if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level)
|
if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level)
|
||||||
ballMultiplier = 800;
|
ballMultiplier = 800;
|
||||||
else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level)
|
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)
|
else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level)
|
||||||
ballMultiplier = 200;
|
ballMultiplier = 200;
|
||||||
break;
|
break;
|
||||||
case ITEM_LURE_BALL:
|
case BALL_LURE:
|
||||||
if (gIsFishingEncounter)
|
if (gIsFishingEncounter)
|
||||||
{
|
{
|
||||||
if (B_LURE_BALL_MODIFIER >= GEN_8)
|
if (B_LURE_BALL_MODIFIER >= GEN_8)
|
||||||
|
@ -15274,7 +15274,7 @@ static void Cmd_handleballthrow(void)
|
||||||
ballMultiplier = 300;
|
ballMultiplier = 300;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_MOON_BALL:
|
case BALL_MOON:
|
||||||
{
|
{
|
||||||
const struct Evolution *evolutions = GetSpeciesEvolutions(gBattleMons[gBattlerTarget].species);
|
const struct Evolution *evolutions = GetSpeciesEvolutions(gBattleMons[gBattlerTarget].species);
|
||||||
if (evolutions == NULL)
|
if (evolutions == NULL)
|
||||||
|
@ -15287,7 +15287,7 @@ static void Cmd_handleballthrow(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_LOVE_BALL:
|
case BALL_LOVE:
|
||||||
if (gBattleMons[gBattlerTarget].species == gBattleMons[gBattlerAttacker].species)
|
if (gBattleMons[gBattlerTarget].species == gBattleMons[gBattlerAttacker].species)
|
||||||
{
|
{
|
||||||
u8 gender1 = GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
u8 gender1 = GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
||||||
|
@ -15297,11 +15297,11 @@ static void Cmd_handleballthrow(void)
|
||||||
ballMultiplier = 800;
|
ballMultiplier = 800;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_FAST_BALL:
|
case BALL_FAST:
|
||||||
if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
|
if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
|
||||||
ballMultiplier = 400;
|
ballMultiplier = 400;
|
||||||
break;
|
break;
|
||||||
case ITEM_HEAVY_BALL:
|
case BALL_HEAVY:
|
||||||
i = GetSpeciesWeight(gBattleMons[gBattlerTarget].species);
|
i = GetSpeciesWeight(gBattleMons[gBattlerTarget].species);
|
||||||
if (B_HEAVY_BALL_MODIFIER >= GEN_7)
|
if (B_HEAVY_BALL_MODIFIER >= GEN_7)
|
||||||
{
|
{
|
||||||
|
@ -15339,11 +15339,11 @@ static void Cmd_handleballthrow(void)
|
||||||
ballAddition = 40;
|
ballAddition = 40;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_DREAM_BALL:
|
case BALL_DREAM:
|
||||||
if (B_DREAM_BALL_MODIFIER >= GEN_8 && (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE))
|
if (B_DREAM_BALL_MODIFIER >= GEN_8 && (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE))
|
||||||
ballMultiplier = 400;
|
ballMultiplier = 400;
|
||||||
break;
|
break;
|
||||||
case ITEM_BEAST_BALL:
|
case BALL_BEAST:
|
||||||
ballMultiplier = 10;
|
ballMultiplier = 10;
|
||||||
break;
|
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))
|
if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE))
|
||||||
odds = (odds * 15) / 10;
|
odds = (odds * 15) / 10;
|
||||||
|
|
||||||
if (gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL] < 255)
|
if (gBattleResults.catchAttempts[ballId] < 255)
|
||||||
gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL]++;
|
gBattleResults.catchAttempts[ballId]++;
|
||||||
|
|
||||||
if (odds > 254) // mon caught
|
if (odds > 254) // mon caught
|
||||||
{
|
{
|
||||||
|
@ -15373,14 +15373,14 @@ static void Cmd_handleballthrow(void)
|
||||||
MarkBattlerForControllerExec(gBattlerAttacker);
|
MarkBattlerForControllerExec(gBattlerAttacker);
|
||||||
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
|
||||||
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
|
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
|
||||||
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
|
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &ballId);
|
||||||
|
|
||||||
if (CalculatePlayerPartyCount() == PARTY_SIZE)
|
if (CalculatePlayerPartyCount() == PARTY_SIZE)
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||||
else
|
else
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||||
|
|
||||||
if (gLastUsedItem == ITEM_HEAL_BALL)
|
if (gLastUsedItem == BALL_HEAL)
|
||||||
{
|
{
|
||||||
MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
||||||
HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget);
|
HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget);
|
||||||
|
@ -15406,7 +15406,7 @@ static void Cmd_handleballthrow(void)
|
||||||
maxShakes = BALL_3_SHAKES_SUCCESS;
|
maxShakes = BALL_3_SHAKES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gLastUsedItem == ITEM_MASTER_BALL)
|
if (ballId == BALL_MASTER)
|
||||||
{
|
{
|
||||||
shakes = maxShakes;
|
shakes = maxShakes;
|
||||||
}
|
}
|
||||||
|
@ -15427,14 +15427,14 @@ static void Cmd_handleballthrow(void)
|
||||||
|
|
||||||
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
|
||||||
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
|
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
|
||||||
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
|
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &ballId);
|
||||||
|
|
||||||
if (CalculatePlayerPartyCount() == PARTY_SIZE)
|
if (CalculatePlayerPartyCount() == PARTY_SIZE)
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||||
else
|
else
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||||
|
|
||||||
if (gLastUsedItem == ITEM_HEAL_BALL)
|
if (ballId == BALL_HEAL)
|
||||||
{
|
{
|
||||||
MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
|
||||||
HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget);
|
HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget);
|
||||||
|
|
|
@ -6,6 +6,9 @@ const u32 gItemIconPalette_ReturnToFieldArrow[] = INCBIN_U32("graphics/items/ico
|
||||||
|
|
||||||
// Poké Balls
|
// 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 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");
|
const u32 gItemIconPalette_PokeBall[] = INCBIN_U32("graphics/items/icon_palettes/poke_ball.gbapal.lz");
|
||||||
|
|
||||||
|
|
|
@ -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 gBallGfx_Poke[] = INCBIN_U32("graphics/balls/poke.4bpp.lz");
|
||||||
const u32 gBallPal_Poke[] = INCBIN_U32("graphics/balls/poke.gbapal.lz");
|
const u32 gBallPal_Poke[] = INCBIN_U32("graphics/balls/poke.gbapal.lz");
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,22 @@ const struct Item gItemsInfo[] =
|
||||||
|
|
||||||
// Poké Balls
|
// 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] =
|
[ITEM_POKE_BALL] =
|
||||||
{
|
{
|
||||||
.name = _("Poké Ball"),
|
.name = _("Poké Ball"),
|
||||||
|
@ -165,7 +181,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_POKE_BALL - FIRST_BALL,
|
.secondaryId = BALL_POKE,
|
||||||
.iconPic = gItemIcon_PokeBall,
|
.iconPic = gItemIcon_PokeBall,
|
||||||
.iconPalette = gItemIconPalette_PokeBall,
|
.iconPalette = gItemIconPalette_PokeBall,
|
||||||
},
|
},
|
||||||
|
@ -181,7 +197,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_GREAT_BALL - FIRST_BALL,
|
.secondaryId = BALL_GREAT,
|
||||||
.iconPic = gItemIcon_GreatBall,
|
.iconPic = gItemIcon_GreatBall,
|
||||||
.iconPalette = gItemIconPalette_GreatBall,
|
.iconPalette = gItemIconPalette_GreatBall,
|
||||||
},
|
},
|
||||||
|
@ -197,7 +213,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_ULTRA_BALL - FIRST_BALL,
|
.secondaryId = BALL_ULTRA,
|
||||||
.iconPic = gItemIcon_UltraBall,
|
.iconPic = gItemIcon_UltraBall,
|
||||||
.iconPalette = gItemIconPalette_UltraBall,
|
.iconPalette = gItemIconPalette_UltraBall,
|
||||||
},
|
},
|
||||||
|
@ -213,7 +229,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_MASTER_BALL - FIRST_BALL,
|
.secondaryId = BALL_MASTER,
|
||||||
.iconPic = gItemIcon_MasterBall,
|
.iconPic = gItemIcon_MasterBall,
|
||||||
.iconPalette = gItemIconPalette_MasterBall,
|
.iconPalette = gItemIconPalette_MasterBall,
|
||||||
},
|
},
|
||||||
|
@ -229,7 +245,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_PREMIER_BALL - FIRST_BALL,
|
.secondaryId = BALL_PREMIER,
|
||||||
.iconPic = gItemIcon_PremierBall,
|
.iconPic = gItemIcon_PremierBall,
|
||||||
.iconPalette = gItemIconPalette_LuxuryBall,
|
.iconPalette = gItemIconPalette_LuxuryBall,
|
||||||
},
|
},
|
||||||
|
@ -245,7 +261,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_HEAL_BALL - FIRST_BALL,
|
.secondaryId = BALL_HEAL,
|
||||||
.iconPic = gItemIcon_HealBall,
|
.iconPic = gItemIcon_HealBall,
|
||||||
.iconPalette = gItemIconPalette_HealBall,
|
.iconPalette = gItemIconPalette_HealBall,
|
||||||
},
|
},
|
||||||
|
@ -261,7 +277,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_NET_BALL - FIRST_BALL,
|
.secondaryId = BALL_NET,
|
||||||
.iconPic = gItemIcon_NetBall,
|
.iconPic = gItemIcon_NetBall,
|
||||||
.iconPalette = gItemIconPalette_NetBall,
|
.iconPalette = gItemIconPalette_NetBall,
|
||||||
},
|
},
|
||||||
|
@ -277,7 +293,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_NEST_BALL - FIRST_BALL,
|
.secondaryId = BALL_NEST,
|
||||||
.iconPic = gItemIcon_NestBall,
|
.iconPic = gItemIcon_NestBall,
|
||||||
.iconPalette = gItemIconPalette_NestBall,
|
.iconPalette = gItemIconPalette_NestBall,
|
||||||
},
|
},
|
||||||
|
@ -293,7 +309,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_DIVE_BALL - FIRST_BALL,
|
.secondaryId = BALL_DIVE,
|
||||||
.iconPic = gItemIcon_DiveBall,
|
.iconPic = gItemIcon_DiveBall,
|
||||||
.iconPalette = gItemIconPalette_DiveBall,
|
.iconPalette = gItemIconPalette_DiveBall,
|
||||||
},
|
},
|
||||||
|
@ -309,7 +325,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_DUSK_BALL - FIRST_BALL,
|
.secondaryId = BALL_DUSK,
|
||||||
.iconPic = gItemIcon_DuskBall,
|
.iconPic = gItemIcon_DuskBall,
|
||||||
.iconPalette = gItemIconPalette_DuskBall,
|
.iconPalette = gItemIconPalette_DuskBall,
|
||||||
},
|
},
|
||||||
|
@ -325,7 +341,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_TIMER_BALL - FIRST_BALL,
|
.secondaryId = BALL_TIMER,
|
||||||
.iconPic = gItemIcon_TimerBall,
|
.iconPic = gItemIcon_TimerBall,
|
||||||
.iconPalette = gItemIconPalette_RepeatBall,
|
.iconPalette = gItemIconPalette_RepeatBall,
|
||||||
},
|
},
|
||||||
|
@ -341,7 +357,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_QUICK_BALL - FIRST_BALL,
|
.secondaryId = BALL_QUICK,
|
||||||
.iconPic = gItemIcon_QuickBall,
|
.iconPic = gItemIcon_QuickBall,
|
||||||
.iconPalette = gItemIconPalette_QuickBall,
|
.iconPalette = gItemIconPalette_QuickBall,
|
||||||
},
|
},
|
||||||
|
@ -357,7 +373,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_REPEAT_BALL - FIRST_BALL,
|
.secondaryId = BALL_REPEAT,
|
||||||
.iconPic = gItemIcon_RepeatBall,
|
.iconPic = gItemIcon_RepeatBall,
|
||||||
.iconPalette = gItemIconPalette_RepeatBall,
|
.iconPalette = gItemIconPalette_RepeatBall,
|
||||||
},
|
},
|
||||||
|
@ -373,7 +389,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_LUXURY_BALL - FIRST_BALL,
|
.secondaryId = BALL_LUXURY,
|
||||||
.iconPic = gItemIcon_LuxuryBall,
|
.iconPic = gItemIcon_LuxuryBall,
|
||||||
.iconPalette = gItemIconPalette_LuxuryBall,
|
.iconPalette = gItemIconPalette_LuxuryBall,
|
||||||
},
|
},
|
||||||
|
@ -389,7 +405,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_LEVEL_BALL - FIRST_BALL,
|
.secondaryId = BALL_LEVEL,
|
||||||
.iconPic = gItemIcon_LevelBall,
|
.iconPic = gItemIcon_LevelBall,
|
||||||
.iconPalette = gItemIconPalette_LevelBall,
|
.iconPalette = gItemIconPalette_LevelBall,
|
||||||
},
|
},
|
||||||
|
@ -405,7 +421,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_LURE_BALL - FIRST_BALL,
|
.secondaryId = BALL_LURE,
|
||||||
.iconPic = gItemIcon_LureBall,
|
.iconPic = gItemIcon_LureBall,
|
||||||
.iconPalette = gItemIconPalette_LureBall,
|
.iconPalette = gItemIconPalette_LureBall,
|
||||||
},
|
},
|
||||||
|
@ -421,7 +437,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_MOON_BALL - FIRST_BALL,
|
.secondaryId = BALL_MOON,
|
||||||
.iconPic = gItemIcon_MoonBall,
|
.iconPic = gItemIcon_MoonBall,
|
||||||
.iconPalette = gItemIconPalette_MoonBall,
|
.iconPalette = gItemIconPalette_MoonBall,
|
||||||
},
|
},
|
||||||
|
@ -437,7 +453,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_FRIEND_BALL - FIRST_BALL,
|
.secondaryId = BALL_FRIEND,
|
||||||
.iconPic = gItemIcon_FriendBall,
|
.iconPic = gItemIcon_FriendBall,
|
||||||
.iconPalette = gItemIconPalette_FriendBall,
|
.iconPalette = gItemIconPalette_FriendBall,
|
||||||
},
|
},
|
||||||
|
@ -453,7 +469,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_LOVE_BALL - FIRST_BALL,
|
.secondaryId = BALL_LOVE,
|
||||||
.iconPic = gItemIcon_LoveBall,
|
.iconPic = gItemIcon_LoveBall,
|
||||||
.iconPalette = gItemIconPalette_LoveBall,
|
.iconPalette = gItemIconPalette_LoveBall,
|
||||||
},
|
},
|
||||||
|
@ -469,7 +485,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_FAST_BALL - FIRST_BALL,
|
.secondaryId = BALL_FAST,
|
||||||
.iconPic = gItemIcon_FastBall,
|
.iconPic = gItemIcon_FastBall,
|
||||||
.iconPalette = gItemIconPalette_FastBall,
|
.iconPalette = gItemIconPalette_FastBall,
|
||||||
},
|
},
|
||||||
|
@ -485,7 +501,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_HEAVY_BALL - FIRST_BALL,
|
.secondaryId = BALL_HEAVY,
|
||||||
.iconPic = gItemIcon_HeavyBall,
|
.iconPic = gItemIcon_HeavyBall,
|
||||||
.iconPalette = gItemIconPalette_HeavyBall,
|
.iconPalette = gItemIconPalette_HeavyBall,
|
||||||
},
|
},
|
||||||
|
@ -506,7 +522,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_DREAM_BALL - FIRST_BALL,
|
.secondaryId = BALL_DREAM,
|
||||||
.iconPic = gItemIcon_DreamBall,
|
.iconPic = gItemIcon_DreamBall,
|
||||||
.iconPalette = gItemIconPalette_DreamBall,
|
.iconPalette = gItemIconPalette_DreamBall,
|
||||||
},
|
},
|
||||||
|
@ -522,7 +538,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_SAFARI_BALL - FIRST_BALL,
|
.secondaryId = BALL_SAFARI,
|
||||||
.iconPic = gItemIcon_SafariBall,
|
.iconPic = gItemIcon_SafariBall,
|
||||||
.iconPalette = gItemIconPalette_SafariBall,
|
.iconPalette = gItemIconPalette_SafariBall,
|
||||||
},
|
},
|
||||||
|
@ -538,7 +554,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_SPORT_BALL - FIRST_BALL,
|
.secondaryId = BALL_SPORT,
|
||||||
.iconPic = gItemIcon_SportBall,
|
.iconPic = gItemIcon_SportBall,
|
||||||
.iconPalette = gItemIconPalette_SportBall,
|
.iconPalette = gItemIconPalette_SportBall,
|
||||||
},
|
},
|
||||||
|
@ -553,7 +569,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_PARK_BALL - FIRST_BALL,
|
.secondaryId = BALL_PARK,
|
||||||
.iconPic = gItemIcon_ParkBall,
|
.iconPic = gItemIcon_ParkBall,
|
||||||
.iconPalette = gItemIconPalette_ParkBall,
|
.iconPalette = gItemIconPalette_ParkBall,
|
||||||
},
|
},
|
||||||
|
@ -568,7 +584,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_BEAST_BALL - FIRST_BALL,
|
.secondaryId = BALL_BEAST,
|
||||||
.iconPic = gItemIcon_BeastBall,
|
.iconPic = gItemIcon_BeastBall,
|
||||||
.iconPalette = gItemIconPalette_BeastBall,
|
.iconPalette = gItemIconPalette_BeastBall,
|
||||||
},
|
},
|
||||||
|
@ -584,7 +600,7 @@ const struct Item gItemsInfo[] =
|
||||||
.pocket = POCKET_POKE_BALLS,
|
.pocket = POCKET_POKE_BALLS,
|
||||||
.type = ITEM_USE_BAG_MENU,
|
.type = ITEM_USE_BAG_MENU,
|
||||||
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
.battleUsage = EFFECT_ITEM_THROW_BALL,
|
||||||
.secondaryId = ITEM_CHERISH_BALL - FIRST_BALL,
|
.secondaryId = BALL_CHERISH,
|
||||||
.iconPic = gItemIcon_CherishBall,
|
.iconPic = gItemIcon_CherishBall,
|
||||||
.iconPalette = gItemIconPalette_CherishBall,
|
.iconPalette = gItemIconPalette_CherishBall,
|
||||||
},
|
},
|
||||||
|
|
|
@ -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)
|
static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, struct BoxPokemon *mother)
|
||||||
{
|
{
|
||||||
u16 inheritBall = ITEM_POKE_BALL;
|
enum PokeBall inheritBall = BALL_POKE;
|
||||||
u16 fatherBall = GetBoxMonData(father, MON_DATA_POKEBALL);
|
enum PokeBall fatherBall = GetBoxMonData(father, MON_DATA_POKEBALL);
|
||||||
u16 motherBall = GetBoxMonData(mother, MON_DATA_POKEBALL);
|
enum PokeBall motherBall = GetBoxMonData(mother, MON_DATA_POKEBALL);
|
||||||
u16 fatherSpecies = GetBoxMonData(father, MON_DATA_SPECIES);
|
u16 fatherSpecies = GetBoxMonData(father, MON_DATA_SPECIES);
|
||||||
u16 motherSpecies = GetBoxMonData(mother, MON_DATA_SPECIES);
|
u16 motherSpecies = GetBoxMonData(mother, MON_DATA_SPECIES);
|
||||||
|
|
||||||
if (fatherBall == ITEM_MASTER_BALL || fatherBall == ITEM_CHERISH_BALL)
|
if (fatherBall == BALL_MASTER || fatherBall == BALL_CHERISH || fatherBall == BALL_STRANGE)
|
||||||
fatherBall = ITEM_POKE_BALL;
|
fatherBall = BALL_POKE;
|
||||||
|
|
||||||
if (motherBall == ITEM_MASTER_BALL || motherBall == ITEM_CHERISH_BALL)
|
if (motherBall == BALL_MASTER || motherBall == BALL_CHERISH || motherBall == BALL_STRANGE)
|
||||||
motherBall = ITEM_POKE_BALL;
|
motherBall = BALL_POKE;
|
||||||
|
|
||||||
if (P_BALL_INHERITING >= GEN_7)
|
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)
|
void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
|
||||||
{
|
{
|
||||||
u8 metLevel;
|
u8 metLevel;
|
||||||
u16 ball;
|
enum PokeBall ball;
|
||||||
u8 language;
|
u8 language;
|
||||||
u8 metLocation;
|
u8 metLocation;
|
||||||
u8 isEgg;
|
u8 isEgg;
|
||||||
|
|
||||||
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
||||||
metLevel = 0;
|
metLevel = 0;
|
||||||
ball = ITEM_POKE_BALL;
|
ball = BALL_POKE;
|
||||||
language = LANGUAGE_JAPANESE;
|
language = LANGUAGE_JAPANESE;
|
||||||
SetMonData(mon, MON_DATA_POKEBALL, &ball);
|
SetMonData(mon, MON_DATA_POKEBALL, &ball);
|
||||||
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
|
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)
|
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare)
|
||||||
{
|
{
|
||||||
u32 personality;
|
u32 personality;
|
||||||
u16 ball;
|
enum PokeBall ball;
|
||||||
u8 metLevel;
|
u8 metLevel;
|
||||||
u8 language;
|
u8 language;
|
||||||
|
|
||||||
personality = daycare->offspringPersonality;
|
personality = daycare->offspringPersonality;
|
||||||
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
|
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
|
||||||
metLevel = 0;
|
metLevel = 0;
|
||||||
ball = ITEM_POKE_BALL;
|
ball = BALL_POKE;
|
||||||
language = LANGUAGE_JAPANESE;
|
language = LANGUAGE_JAPANESE;
|
||||||
SetMonData(mon, MON_DATA_POKEBALL, &ball);
|
SetMonData(mon, MON_DATA_POKEBALL, &ball);
|
||||||
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
|
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
|
||||||
|
|
|
@ -4174,12 +4174,12 @@ static void DebugAction_PCBag_Fill_PocketItems(u8 taskId)
|
||||||
|
|
||||||
static void DebugAction_PCBag_Fill_PocketPokeBalls(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))
|
if (CheckBagHasSpace(ballId, MAX_BAG_ITEM_CAPACITY))
|
||||||
AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY);
|
AddBagItem(ballId, MAX_BAG_ITEM_CAPACITY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,8 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
|
||||||
{
|
{
|
||||||
u16 species;
|
u16 species;
|
||||||
u32 personality, pokerus;
|
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];
|
u16 moves[MAX_MON_MOVES];
|
||||||
u32 ivs[NUM_STATS];
|
u32 ivs[NUM_STATS];
|
||||||
|
|
||||||
|
|
|
@ -7344,12 +7344,12 @@ static u8 LoadFillColorPalette(u16 color, u16 paletteTag, struct Sprite *sprite)
|
||||||
static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent)
|
static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent)
|
||||||
{
|
{
|
||||||
#if OW_FOLLOWERS_POKEBALLS
|
#if OW_FOLLOWERS_POKEBALLS
|
||||||
u32 ball = BALL_POKE;
|
enum PokeBall ball = BALL_STRANGE;
|
||||||
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
|
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
|
||||||
{
|
{
|
||||||
struct Pokemon *mon = GetFirstLiveMon();
|
struct Pokemon *mon = GetFirstLiveMon();
|
||||||
if (mon)
|
if (mon)
|
||||||
ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL));
|
ball = GetMonData(mon, MON_DATA_POKEBALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ball != BALL_POKE && ball < POKEBALL_COUNT)
|
if (ball != BALL_POKE && ball < POKEBALL_COUNT)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "berry.h"
|
#include "berry.h"
|
||||||
|
#include "pokeball.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
|
@ -166,11 +167,11 @@ bool8 HasAtLeastOneBerry(void)
|
||||||
|
|
||||||
bool8 HasAtLeastOnePokeBall(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 TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -968,7 +969,7 @@ u8 ItemId_GetBattleUsage(u16 itemId)
|
||||||
return gItemsInfo[item].battleUsage;
|
return gItemsInfo[item].battleUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 ItemId_GetSecondaryId(u16 itemId)
|
u32 ItemId_GetSecondaryId(u32 itemId)
|
||||||
{
|
{
|
||||||
return gItemsInfo[SanitizeItemId(itemId)].secondaryId;
|
return gItemsInfo[SanitizeItemId(itemId)].secondaryId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "trig.h"
|
#include "trig.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
|
#include "item.h"
|
||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
|
|
||||||
static void Task_DoPokeballSendOutAnim(u8 taskId);
|
static void Task_DoPokeballSendOutAnim(u8 taskId);
|
||||||
|
@ -47,36 +48,38 @@ static u16 GetBattlerPokeballItemId(u8 battlerId);
|
||||||
|
|
||||||
// rom const data
|
// rom const data
|
||||||
|
|
||||||
#define GFX_TAG_POKE_BALL 55000
|
#define GFX_TAG_STRANGE_BALL 55000
|
||||||
#define GFX_TAG_GREAT_BALL 55001
|
#define GFX_TAG_POKE_BALL 55001
|
||||||
#define GFX_TAG_ULTRA_BALL 55002
|
#define GFX_TAG_GREAT_BALL 55002
|
||||||
#define GFX_TAG_MASTER_BALL 55003
|
#define GFX_TAG_ULTRA_BALL 55003
|
||||||
#define GFX_TAG_PREMIER_BALL 55004
|
#define GFX_TAG_MASTER_BALL 55004
|
||||||
#define GFX_TAG_HEAL_BALL 55005
|
#define GFX_TAG_PREMIER_BALL 55005
|
||||||
#define GFX_TAG_NET_BALL 55006
|
#define GFX_TAG_HEAL_BALL 55006
|
||||||
#define GFX_TAG_NEST_BALL 55007
|
#define GFX_TAG_NET_BALL 55007
|
||||||
#define GFX_TAG_DIVE_BALL 55008
|
#define GFX_TAG_NEST_BALL 55008
|
||||||
#define GFX_TAG_DUSK_BALL 55009
|
#define GFX_TAG_DIVE_BALL 55009
|
||||||
#define GFX_TAG_TIMER_BALL 55010
|
#define GFX_TAG_DUSK_BALL 55010
|
||||||
#define GFX_TAG_QUICK_BALL 55011
|
#define GFX_TAG_TIMER_BALL 55011
|
||||||
#define GFX_TAG_REPEAT_BALL 55012
|
#define GFX_TAG_QUICK_BALL 55012
|
||||||
#define GFX_TAG_LUXURY_BALL 55013
|
#define GFX_TAG_REPEAT_BALL 55013
|
||||||
#define GFX_TAG_LEVEL_BALL 55014
|
#define GFX_TAG_LUXURY_BALL 55014
|
||||||
#define GFX_TAG_LURE_BALL 55015
|
#define GFX_TAG_LEVEL_BALL 55015
|
||||||
#define GFX_TAG_MOON_BALL 55016
|
#define GFX_TAG_LURE_BALL 55016
|
||||||
#define GFX_TAG_FRIEND_BALL 55017
|
#define GFX_TAG_MOON_BALL 55017
|
||||||
#define GFX_TAG_LOVE_BALL 55018
|
#define GFX_TAG_FRIEND_BALL 55018
|
||||||
#define GFX_TAG_FAST_BALL 55019
|
#define GFX_TAG_LOVE_BALL 55019
|
||||||
#define GFX_TAG_HEAVY_BALL 55020
|
#define GFX_TAG_FAST_BALL 55020
|
||||||
#define GFX_TAG_DREAM_BALL 55021
|
#define GFX_TAG_HEAVY_BALL 55021
|
||||||
#define GFX_TAG_SAFARI_BALL 55022
|
#define GFX_TAG_DREAM_BALL 55022
|
||||||
#define GFX_TAG_SPORT_BALL 55023
|
#define GFX_TAG_SAFARI_BALL 55023
|
||||||
#define GFX_TAG_PARK_BALL 55024
|
#define GFX_TAG_SPORT_BALL 55024
|
||||||
#define GFX_TAG_BEAST_BALL 55025
|
#define GFX_TAG_PARK_BALL 55025
|
||||||
#define GFX_TAG_CHERISH_BALL 55026
|
#define GFX_TAG_BEAST_BALL 55026
|
||||||
|
#define GFX_TAG_CHERISH_BALL 55027
|
||||||
|
|
||||||
const struct CompressedSpriteSheet gBallSpriteSheets[POKEBALL_COUNT] =
|
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_POKE] = {gBallGfx_Poke, 384, GFX_TAG_POKE_BALL},
|
||||||
[BALL_GREAT] = {gBallGfx_Great, 384, GFX_TAG_GREAT_BALL},
|
[BALL_GREAT] = {gBallGfx_Great, 384, GFX_TAG_GREAT_BALL},
|
||||||
[BALL_ULTRA] = {gBallGfx_Ultra, 384, GFX_TAG_ULTRA_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] =
|
const struct CompressedSpritePalette gBallSpritePalettes[POKEBALL_COUNT] =
|
||||||
{
|
{
|
||||||
|
[BALL_STRANGE] = {gBallPal_Strange, GFX_TAG_STRANGE_BALL},
|
||||||
[BALL_POKE] = {gBallPal_Poke, GFX_TAG_POKE_BALL},
|
[BALL_POKE] = {gBallPal_Poke, GFX_TAG_POKE_BALL},
|
||||||
[BALL_GREAT] = {gBallPal_Great, GFX_TAG_GREAT_BALL},
|
[BALL_GREAT] = {gBallPal_Great, GFX_TAG_GREAT_BALL},
|
||||||
[BALL_ULTRA] = {gBallPal_Ultra, GFX_TAG_ULTRA_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] =
|
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] =
|
[BALL_POKE] =
|
||||||
{
|
{
|
||||||
.tileTag = GFX_TAG_POKE_BALL,
|
.tileTag = GFX_TAG_POKE_BALL,
|
||||||
|
@ -562,7 +576,7 @@ static void Task_DoPokeballSendOutAnim(u8 taskId)
|
||||||
|
|
||||||
throwCaseId = gTasks[taskId].tThrowId;
|
throwCaseId = gTasks[taskId].tThrowId;
|
||||||
battlerId = gTasks[taskId].tBattler;
|
battlerId = gTasks[taskId].tBattler;
|
||||||
ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId));
|
ballId = GetBattlerPokeballItemId(battlerId);
|
||||||
LoadBallGfx(ballId);
|
LoadBallGfx(ballId);
|
||||||
ballSpriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29);
|
ballSpriteId = CreateSprite(&gBallSpriteTemplates[ballId], 32, 80, 29);
|
||||||
gSprites[ballSpriteId].data[0] = 0x80;
|
gSprites[ballSpriteId].data[0] = 0x80;
|
||||||
|
@ -651,7 +665,7 @@ static void SpriteCB_BallThrow(struct Sprite *sprite)
|
||||||
sprite->x2 = 0;
|
sprite->x2 = 0;
|
||||||
sprite->y2 = 0;
|
sprite->y2 = 0;
|
||||||
sprite->data[5] = 0;
|
sprite->data[5] = 0;
|
||||||
ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler));
|
ballId = GetBattlerPokeballItemId(opponentBattler);
|
||||||
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
||||||
sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId);
|
sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId);
|
||||||
sprite->sBattler = opponentBattler;
|
sprite->sBattler = opponentBattler;
|
||||||
|
@ -967,7 +981,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite)
|
||||||
u32 ballId;
|
u32 ballId;
|
||||||
|
|
||||||
StartSpriteAnim(sprite, 1);
|
StartSpriteAnim(sprite, 1);
|
||||||
ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId));
|
ballId = GetBattlerPokeballItemId(battlerId);
|
||||||
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
|
||||||
sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId);
|
sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId);
|
||||||
sprite->callback = HandleBallAnimEnd;
|
sprite->callback = HandleBallAnimEnd;
|
||||||
|
@ -1580,3 +1594,13 @@ static u16 GetBattlerPokeballItemId(u8 battlerId)
|
||||||
|
|
||||||
return GetMonData(mon, MON_DATA_POKEBALL);
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -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(NUMBER_OF_MON_TYPES + 1 <= (1 << 5), PokemonSubstruct0_teraType_TooSmall);
|
||||||
STATIC_ASSERT(ITEMS_COUNT < (1 << 10), PokemonSubstruct0_heldItem_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(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(MOVES_COUNT_ALL < (1 << 11), PokemonSubstruct1_moves_TooSmall);
|
||||||
STATIC_ASSERT(ARRAY_COUNT(sCompressedStatuses) <= (1 << 4), PokemonSubstruct3_compressedStatus_TooSmall);
|
STATIC_ASSERT(ARRAY_COUNT(sCompressedStatuses) <= (1 << 4), PokemonSubstruct3_compressedStatus_TooSmall);
|
||||||
STATIC_ASSERT(MAX_LEVEL < (1 << 7), PokemonSubstruct3_metLevel_TooSmall);
|
STATIC_ASSERT(MAX_LEVEL < (1 << 7), PokemonSubstruct3_metLevel_TooSmall);
|
||||||
|
|
|
@ -1579,8 +1579,8 @@ static void SetDefaultTilemaps(void)
|
||||||
SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]);
|
SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]);
|
||||||
SetBgAttribute(1, BG_ATTR_PRIORITY, 2);
|
SetBgAttribute(1, BG_ATTR_PRIORITY, 2);
|
||||||
SetBgAttribute(2, BG_ATTR_PRIORITY, 1);
|
SetBgAttribute(2, BG_ATTR_PRIORITY, 1);
|
||||||
ChangeBgX(1, 0x10000, BG_COORD_ADD);
|
ChangeBgX(1, 0x10000, BG_COORD_ADD);
|
||||||
ChangeBgX(2, 0x10000, BG_COORD_ADD);
|
ChangeBgX(2, 0x10000, BG_COORD_ADD);
|
||||||
ShowBg(1);
|
ShowBg(1);
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
}
|
}
|
||||||
|
@ -1591,8 +1591,8 @@ static void SetDefaultTilemaps(void)
|
||||||
SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]);
|
SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]);
|
||||||
SetBgAttribute(1, BG_ATTR_PRIORITY, 1);
|
SetBgAttribute(1, BG_ATTR_PRIORITY, 1);
|
||||||
SetBgAttribute(2, BG_ATTR_PRIORITY, 2);
|
SetBgAttribute(2, BG_ATTR_PRIORITY, 2);
|
||||||
ChangeBgX(1, 0x10000, BG_COORD_ADD);
|
ChangeBgX(1, 0x10000, BG_COORD_ADD);
|
||||||
ChangeBgX(2, 0x10000, BG_COORD_ADD);
|
ChangeBgX(2, 0x10000, BG_COORD_ADD);
|
||||||
ShowBg(1);
|
ShowBg(1);
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
}
|
}
|
||||||
|
@ -4271,7 +4271,7 @@ static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *mon)
|
||||||
|
|
||||||
static void CreateCaughtBallSprite(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);
|
LoadBallGfx(ball);
|
||||||
sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_BALL] = CreateSprite(&gBallSpriteTemplates[ball], 16, 136, 0);
|
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
|
||||||
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR
|
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR
|
||||||
&& sMonSummaryScreen->relearnableMovesNum > 0
|
&& sMonSummaryScreen->relearnableMovesNum > 0
|
||||||
&& !InBattleFactory()
|
&& !InBattleFactory()
|
||||||
&& !InSlateportBattleTent());
|
&& !InSlateportBattleTent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4403,7 +4403,7 @@ static inline bool32 ShouldShowRename(void)
|
||||||
&& !sMonSummaryScreen->summary.isEgg
|
&& !sMonSummaryScreen->summary.isEgg
|
||||||
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX
|
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX
|
||||||
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR
|
&& sMonSummaryScreen->mode != SUMMARY_MODE_BOX_CURSOR
|
||||||
&& !InBattleFactory()
|
&& !InBattleFactory()
|
||||||
&& !InSlateportBattleTent()
|
&& !InSlateportBattleTent()
|
||||||
&& GetPlayerIDAsU32() == sMonSummaryScreen->summary.OTID);
|
&& 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, gStringVar3);
|
||||||
GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2);
|
GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2);
|
||||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, 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),
|
GetMonGender(&gPlayerParty[gSpecialVar_0x8004]), GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL),
|
||||||
CB2_ReturnToSummaryScreenFromNamingScreen);
|
CB2_ReturnToSummaryScreenFromNamingScreen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 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
|
* 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;
|
u16 nationalDexNum;
|
||||||
int sentToPc;
|
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);
|
SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum);
|
||||||
|
|
||||||
// ball
|
// ball
|
||||||
if (ball > LAST_BALL)
|
if (ball > POKEBALL_COUNT)
|
||||||
ball = ITEM_POKE_BALL;
|
ball = BALL_POKE;
|
||||||
SetMonData(&mon, MON_DATA_POKEBALL, &ball);
|
SetMonData(&mon, MON_DATA_POKEBALL, &ball);
|
||||||
|
|
||||||
// held item
|
// held item
|
||||||
|
|
|
@ -24,8 +24,8 @@ TEST("CreateNPCTrainerPartyForTrainer generates customized Pokémon")
|
||||||
EXPECT(IsMonShiny(&testParty[0]));
|
EXPECT(IsMonShiny(&testParty[0]));
|
||||||
EXPECT(!IsMonShiny(&testParty[1]));
|
EXPECT(!IsMonShiny(&testParty[1]));
|
||||||
|
|
||||||
EXPECT(GetMonData(&testParty[0], MON_DATA_POKEBALL, 0) == ITEM_MASTER_BALL);
|
EXPECT(GetMonData(&testParty[0], MON_DATA_POKEBALL, 0) == BALL_MASTER);
|
||||||
EXPECT(GetMonData(&testParty[1], MON_DATA_POKEBALL, 0) == ITEM_POKE_BALL);
|
EXPECT(GetMonData(&testParty[1], MON_DATA_POKEBALL, 0) == BALL_POKE);
|
||||||
|
|
||||||
EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET);
|
EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET);
|
||||||
EXPECT(GetMonData(&testParty[1], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET);
|
EXPECT(GetMonData(&testParty[1], MON_DATA_SPECIES, 0) == SPECIES_WOBBUFFET);
|
||||||
|
|
|
@ -237,7 +237,7 @@ TEST("givemon [all]")
|
||||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET);
|
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_LEVEL), 100);
|
||||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_HELD_ITEM), ITEM_LEFTOVERS);
|
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(GetNature(&gPlayerParty[0]), NATURE_BOLD);
|
||||||
EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]);
|
EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]);
|
||||||
EXPECT_EQ(GetMonGender(&gPlayerParty[0]), MON_MALE);
|
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_SPECIES), SPECIES_WOBBUFFET);
|
||||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100);
|
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_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(GetNature(&gPlayerParty[0]), NATURE_BOLD);
|
||||||
EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]);
|
EXPECT_EQ(GetMonAbility(&gPlayerParty[0]), gSpeciesInfo[SPECIES_WOBBUFFET].abilities[2]);
|
||||||
EXPECT_EQ(GetMonGender(&gPlayerParty[0]), MON_MALE);
|
EXPECT_EQ(GetMonGender(&gPlayerParty[0]), MON_MALE);
|
||||||
|
|
Loading…
Reference in a new issue