Merge pull request #1561 from ultima-soul/item_id_revamp

Item ID Revamp
This commit is contained in:
Eduardo Quezada D'Ottone 2021-11-11 06:23:58 -03:00 committed by GitHub
commit 6f728f2fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 13830 additions and 11100 deletions

View File

@ -11,37 +11,6 @@
.section script_data, "aw", %progbits
.align 2
gBattlescriptsForBallThrow::
.4byte BattleScript_BallThrow @ ITEM_NONE
.4byte BattleScript_BallThrow @ ITEM_MASTER_BALL
.4byte BattleScript_BallThrow @ ITEM_ULTRA_BALL
.4byte BattleScript_BallThrow @ ITEM_GREAT_BALL
.4byte BattleScript_BallThrow @ ITEM_POKE_BALL
.4byte BattleScript_SafariBallThrow @ ITEM_SAFARI_BALL
.4byte BattleScript_BallThrow @ ITEM_NET_BALL
.4byte BattleScript_BallThrow @ ITEM_DIVE_BALL
.4byte BattleScript_BallThrow @ ITEM_NEST_BALL
.4byte BattleScript_BallThrow @ ITEM_REPEAT_BALL
.4byte BattleScript_BallThrow @ ITEM_TIMER_BALL
.4byte BattleScript_BallThrow @ ITEM_LUXURY_BALL
.4byte BattleScript_BallThrow @ ITEM_DUSK_BALL
.4byte BattleScript_BallThrow @ ITEM_HEAL_BALL
.4byte BattleScript_BallThrow @ ITEM_QUICK_BALL
.4byte BattleScript_BallThrow @ ITEM_CHERISH_BALL
.4byte BattleScript_BallThrow @ ITEM_FAST_BALL
.4byte BattleScript_BallThrow @ ITEM_LEVEL_BALL
.4byte BattleScript_BallThrow @ ITEM_LURE_BALL
.4byte BattleScript_BallThrow @ ITEM_HEAVY_BALL
.4byte BattleScript_BallThrow @ ITEM_LOVE_BALL
.4byte BattleScript_BallThrow @ ITEM_FRIEND_BALL
.4byte BattleScript_BallThrow @ ITEM_MOON_BALL
.4byte BattleScript_BallThrow @ ITEM_SPORT_BALL
.4byte BattleScript_BallThrow @ ITEM_PARK_BALL
.4byte BattleScript_BallThrow @ ITEM_DREAM_BALL
.4byte BattleScript_BallThrow @ ITEM_BEAST_BALL
.4byte BattleScript_BallThrow @ ITEM_PREMIER_BALL
.align 2
gBattlescriptsForUsingItem::
.4byte BattleScript_PlayerUsesItem
@ -77,7 +46,6 @@ BattleScript_SafariBallThrow::
handleballthrow
BattleScript_SuccessBallThrow::
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT

View File

@ -53,12 +53,12 @@ AbandonedShip_HiddenFloorCorridors_EventScript_LockRoom6::
AbandonedShip_HiddenFloorCorridors_EventScript_Room1Door::
lockall
goto_if_set FLAG_USED_ROOM_1_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen
checkitem ITEM_ROOM_1_KEY, 1
checkitem ITEM_KEY_TO_ROOM_1, 1
compare VAR_RESULT, FALSE
goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm1IsLocked
msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT
playse SE_PIN
removeitem ITEM_ROOM_1_KEY
removeitem ITEM_KEY_TO_ROOM_1
setflag FLAG_USED_ROOM_1_KEY
call AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom1
special DrawWholeMapView
@ -68,12 +68,12 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room1Door::
AbandonedShip_HiddenFloorCorridors_EventScript_Room2Door::
lockall
goto_if_set FLAG_USED_ROOM_2_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen
checkitem ITEM_ROOM_2_KEY, 1
checkitem ITEM_KEY_TO_ROOM_2, 1
compare VAR_RESULT, FALSE
goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm2IsLocked
msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT
playse SE_PIN
removeitem ITEM_ROOM_2_KEY
removeitem ITEM_KEY_TO_ROOM_2
setflag FLAG_USED_ROOM_2_KEY
call AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom2
special DrawWholeMapView
@ -83,12 +83,12 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room2Door::
AbandonedShip_HiddenFloorCorridors_EventScript_Room4Door::
lockall
goto_if_set FLAG_USED_ROOM_4_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen
checkitem ITEM_ROOM_4_KEY, 1
checkitem ITEM_KEY_TO_ROOM_4, 1
compare VAR_RESULT, FALSE
goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm4IsLocked
msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT
playse SE_PIN
removeitem ITEM_ROOM_4_KEY
removeitem ITEM_KEY_TO_ROOM_4
setflag FLAG_USED_ROOM_4_KEY
call AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom4
special DrawWholeMapView
@ -98,12 +98,12 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room4Door::
AbandonedShip_HiddenFloorCorridors_EventScript_Room6Door::
lockall
goto_if_set FLAG_USED_ROOM_6_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen
checkitem ITEM_ROOM_6_KEY, 1
checkitem ITEM_KEY_TO_ROOM_6, 1
compare VAR_RESULT, FALSE
goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm6IsLocked
msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT
playse SE_PIN
removeitem ITEM_ROOM_6_KEY
removeitem ITEM_KEY_TO_ROOM_6
setflag FLAG_USED_ROOM_6_KEY
call AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom6
special DrawWholeMapView

View File

@ -139,7 +139,7 @@
"x": 42,
"y": 10,
"elevation": 3,
"item": "ITEM_ROOM_1_KEY",
"item": "ITEM_KEY_TO_ROOM_1",
"flag": "FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_1_KEY"
},
{
@ -147,7 +147,7 @@
"x": 20,
"y": 5,
"elevation": 3,
"item": "ITEM_ROOM_2_KEY",
"item": "ITEM_KEY_TO_ROOM_2",
"flag": "FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_2_KEY"
},
{
@ -155,7 +155,7 @@
"x": 1,
"y": 12,
"elevation": 3,
"item": "ITEM_ROOM_4_KEY",
"item": "ITEM_KEY_TO_ROOM_4",
"flag": "FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_4_KEY"
},
{
@ -163,7 +163,7 @@
"x": 1,
"y": 2,
"elevation": 0,
"item": "ITEM_ROOM_6_KEY",
"item": "ITEM_KEY_TO_ROOM_6",
"flag": "FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_6_KEY"
},
{

View File

@ -366,7 +366,6 @@ LilycoveCity_ContestLobby_EventScript_SetMasterContestType::
LilycoveCity_ContestLobby_EventScript_SetDebug::
setflag FLAG_HIDE_LILYCOVE_MUSEUM_CURATOR
copyvar VAR_LILYCOVE_MUSEUM_2F_STATE, 1
additem ITEM_CONTEST_PASS
setvar VAR_0x800B, 8
setvar VAR_CONTEST_RANK, CONTEST_RANK_MASTER
setvar VAR_LILYCOVE_CONTEST_LOBBY_STATE, 1

View File

@ -383,10 +383,10 @@ PetalburgCity_Gym_EventScript_ShouldGiveEnigmaBerry::
specialvar VAR_RESULT, IsEnigmaBerryValid
compare VAR_RESULT, FALSE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
checkitem ITEM_ENIGMA_BERRY, 1
checkitem ITEM_ENIGMA_BERRY_E_READER, 1
compare VAR_RESULT, TRUE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
checkpcitem ITEM_ENIGMA_BERRY, 1
checkpcitem ITEM_ENIGMA_BERRY_E_READER, 1
compare VAR_RESULT, TRUE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
compare VAR_ENIGMA_BERRY_AVAILABLE, 0
@ -400,7 +400,7 @@ PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry::
return
PetalburgCity_Gym_EventScript_GiveEnigmaBerry::
giveitem ITEM_ENIGMA_BERRY
giveitem ITEM_ENIGMA_BERRY_E_READER
compare VAR_RESULT, FALSE
goto_if_eq Common_EventScript_ShowBagIsFull
setvar VAR_ENIGMA_BERRY_AVAILABLE, 0

View File

@ -478,7 +478,7 @@ Route110_EventScript_BrendanDefeated::
end
Route110_EventScript_GiveItemfinder::
giveitem ITEM_ITEMFINDER
giveitem ITEM_DOWSING_MACHINE
return
Route110_EventScript_RivalExit::

View File

@ -320,7 +320,7 @@ RusturfTunnel_EventScript_Grunt::
msgbox RusturfTunnel_Text_GruntIntro, MSGBOX_DEFAULT
trainerbattle_no_intro TRAINER_GRUNT_RUSTURF_TUNNEL, RusturfTunnel_Text_GruntDefeat
msgbox RusturfTunnel_Text_GruntTakePackage, MSGBOX_DEFAULT
giveitem ITEM_DEVON_GOODS
giveitem ITEM_DEVON_PARTS
closemessage
applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PushPlayerAsideForGrunt
applymovement LOCALID_GRUNT, RusturfTunnel_Movement_GruntEscape

View File

@ -76,7 +76,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern::
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight
waitmovement 0
msgbox SlateportCity_OceanicMuseum_2F_Text_SternThankYouForSavingUs, MSGBOX_DEFAULT
setvar VAR_0x8004, ITEM_DEVON_GOODS
setvar VAR_0x8004, ITEM_DEVON_PARTS
call Common_EventScript_PlayerHandedOverTheItem
msgbox SlateportCity_OceanicMuseum_2F_Text_SternIveGotToGo, MSGBOX_DEFAULT
closemessage

View File

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

View File

@ -242,7 +242,6 @@ struct BattleResults
u8 numHealingItemsUsed; // 0x3
u8 numRevivesUsed; // 0x4
u8 playerMonWasDamaged:1; // 0x5
u8 usedMasterBall:1; // 0x5
u8 caughtMonBall:4; // 0x5
u8 shinyWildMon:1; // 0x5
u16 playerMon1Species; // 0x6
@ -257,7 +256,7 @@ struct BattleResults
u16 caughtMonSpecies; // 0x28
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; // 0x2A
u8 filler35; // 0x35
u8 catchAttempts[POKEBALL_COUNT - 1]; // 0x36 Doesn't include Master ball
u8 catchAttempts[POKEBALL_COUNT]; // 0x36
};
struct BattleTv_Side

View File

@ -171,7 +171,7 @@
#define BATTLE_FRONTIER_ITEM_APICOT_BERRY 50
#define BATTLE_FRONTIER_ITEM_STARF_BERRY 51
#define BATTLE_FRONTIER_ITEM_LIECHI_BERRY 52
#define BATTLE_FRONTIER_ITEM_STICK 53
#define BATTLE_FRONTIER_ITEM_LEEK 53
#define BATTLE_FRONTIER_ITEM_LAX_INCENSE 54
#define BATTLE_FRONTIER_ITEM_AGUAV_BERRY 55
#define BATTLE_FRONTIER_ITEM_FIGY_BERRY 56

View File

@ -62,12 +62,12 @@
#define HOLD_EFFECT_FIRE_POWER 58
#define HOLD_EFFECT_DRAGON_POWER 59
#define HOLD_EFFECT_NORMAL_POWER 60
#define HOLD_EFFECT_UP_GRADE 61
#define HOLD_EFFECT_UPGRADE 61
#define HOLD_EFFECT_SHELL_BELL 62
#define HOLD_EFFECT_LUCKY_PUNCH 63
#define HOLD_EFFECT_METAL_POWDER 64
#define HOLD_EFFECT_THICK_CLUB 65
#define HOLD_EFFECT_STICK 66
#define HOLD_EFFECT_LEEK 66
// Gen4 hold effects.
#define HOLD_EFFECT_CHOICE_SCARF 67

View File

@ -18,18 +18,5 @@
#define I_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts.
#define I_LEGACY_HEALING_ITEMS GEN_7 // In Gen7+, certain healing items recover less HP than they used to.
#define I_SITRUS_BERRY_HEAL GEN_7 // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP.
#define I_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts Lati@s' Sp. Atk and Sp. Def by 50%. In Gen7+ it boosts the power of their Psychic and Dragon type moves by 20% instead.
// Ball config
#define I_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3.
#define I_NET_BALL_MODIFIER GEN_7 // In Gen7+, Net Ball's catch multiplier is x5 instead of x3.
#define I_REPEAT_BALL_MODIFIER GEN_7 // In Gen7+, Repeat Ball's catch multiplier is x3.5 instead of x3.
#define I_DUSK_BALL_MODIFIER GEN_7 // In Gen7+, Dusk Ball's catch multiplier is x3 instead of x3.5.
#define I_QUICK_BALL_MODIFIER GEN_7 // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4.
#define I_DREAM_BALL_MODIFIER GEN_8 // In Gen8+, Dream Ball's catch multiplier is x4 when the target is asleep.
#define I_TIMER_BALL_MODIFIER GEN_7 // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1
#define I_DIVE_BALL_MODIFIER GEN_7 // In Gen4+, Dive Ball's effectiveness increases by when Surfing or Fishing.
#define I_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow.
#define I_NEST_BALL_MODIFIER GEN_7 // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow.
#endif // GUARD_CONSTANTS_ITEM_CONFIG_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,31 +5,31 @@ enum
{
BALL_POKE,
BALL_GREAT,
BALL_SAFARI,
BALL_ULTRA,
BALL_MASTER,
BALL_NET,
BALL_DIVE,
BALL_NEST,
BALL_REPEAT,
BALL_TIMER,
BALL_LUXURY,
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_HEAVY,
BALL_FAST,
BALL_SPORT,
BALL_DUSK,
BALL_QUICK,
BALL_HEAL,
BALL_CHERISH,
BALL_PARK,
BALL_HEAVY,
BALL_DREAM,
BALL_SAFARI,
BALL_SPORT,
BALL_PARK,
BALL_BEAST,
BALL_CHERISH,
POKEBALL_COUNT
};

View File

@ -29,9 +29,6 @@ struct WildPokemonHeader
const struct WildPokemonInfo *fishingMonsInfo;
};
extern bool8 gIsFishingEncounter;
extern bool8 gIsSurfingEncounter;
extern const struct WildPokemonHeader gWildMonHeaders[];
void DisableWildEncounters(bool8 disabled);

View File

@ -834,7 +834,7 @@ static bool8 ShouldUseItem(void)
if (gItemEffectTable[item - ITEM_POTION] == NULL)
continue;
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffects = gItemEffectTable[item - ITEM_POTION];

View File

@ -129,31 +129,31 @@ static const struct CaptureStar sCaptureStars[] =
#define TAG_PARTICLES_POKEBALL 65030
#define TAG_PARTICLES_GREATBALL 65031
#define TAG_PARTICLES_SAFARIBALL 65032
#define TAG_PARTICLES_ULTRABALL 65033
#define TAG_PARTICLES_MASTERBALL 65034
#define TAG_PARTICLES_NETBALL 65035
#define TAG_PARTICLES_DIVEBALL 65036
#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_REPEATBALL 65038
#define TAG_PARTICLES_TIMERBALL 65039
#define TAG_PARTICLES_LUXURYBALL 65040
#define TAG_PARTICLES_PREMIERBALL 65041
#define TAG_PARTICLES_LEVELBALL 65042
#define TAG_PARTICLES_LUREBALL 65043
#define TAG_PARTICLES_MOONBALL 65044
#define TAG_PARTICLES_FRIENDBALL 65045
#define TAG_PARTICLES_LOVEBALL 65046
#define TAG_PARTICLES_HEAVYBALL 65047
#define TAG_PARTICLES_FASTBALL 65048
#define TAG_PARTICLES_SPORTBALL 65049
#define TAG_PARTICLES_DUSKBALL 65050
#define TAG_PARTICLES_QUICKBALL 65051
#define TAG_PARTICLES_HEALBALL 65052
#define TAG_PARTICLES_CHERISHBALL 65053
#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_DREAMBALL 65065
#define TAG_PARTICLES_BEASTBALL 65056
#define TAG_PARTICLES_BEASTBALL 65065
#define TAG_PARTICLES_CHERISHBALL 65056
static const u32 sNewParticlesGfx[] = INCBIN_U32("graphics/interface/ball/particles2.4bpp.lz");
static const u32 sNewParticlesPal[] = INCBIN_U32("graphics/interface/ball/particles2.gbapal.lz");
@ -162,62 +162,62 @@ static const struct CompressedSpriteSheet sBallParticleSpriteSheets[] =
{
[BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL},
[BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL},
[BALL_SAFARI] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL},
[BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL},
[BALL_MASTER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_MASTERBALL},
[BALL_NET] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL},
[BALL_DIVE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL},
[BALL_NEST] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL},
[BALL_REPEAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL},
[BALL_TIMER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL},
[BALL_LUXURY] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL},
[BALL_PREMIER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PREMIERBALL},
[BALL_HEAL] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_HEALBALL},
[BALL_NET] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL},
[BALL_NEST] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL},
[BALL_DIVE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL},
[BALL_DUSK] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_DUSKBALL},
[BALL_TIMER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL},
[BALL_QUICK] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_QUICKBALL},
[BALL_REPEAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL},
[BALL_LUXURY] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL},
[BALL_LEVEL] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_LEVELBALL},
[BALL_LURE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUREBALL},
[BALL_MOON] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_MOONBALL},
[BALL_FRIEND] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_FRIENDBALL},
[BALL_LOVE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LOVEBALL},
[BALL_HEAVY] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_HEAVYBALL},
[BALL_FAST] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_FASTBALL},
[BALL_SPORT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SPORTBALL},
[BALL_DUSK] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_DUSKBALL},
[BALL_QUICK] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_QUICKBALL},
[BALL_HEAL] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_HEALBALL},
[BALL_CHERISH] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_CHERISHBALL},
[BALL_PARK] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PARKBALL},
[BALL_HEAVY] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_HEAVYBALL},
[BALL_DREAM] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DREAMBALL},
[BALL_SAFARI] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL},
[BALL_SPORT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SPORTBALL},
[BALL_PARK] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PARKBALL},
[BALL_BEAST] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_BEASTBALL},
[BALL_CHERISH] = {sNewParticlesGfx, 0x100, TAG_PARTICLES_CHERISHBALL},
};
static const struct CompressedSpritePalette sBallParticlePalettes[] =
{
[BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL},
[BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL},
[BALL_SAFARI] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL},
[BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL},
[BALL_MASTER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_MASTERBALL},
[BALL_NET] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL},
[BALL_DIVE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL},
[BALL_NEST] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL},
[BALL_REPEAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL},
[BALL_TIMER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL},
[BALL_LUXURY] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL},
[BALL_PREMIER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PREMIERBALL},
[BALL_HEAL] = {sNewParticlesPal, TAG_PARTICLES_HEALBALL},
[BALL_NET] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL},
[BALL_NEST] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL},
[BALL_DIVE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL},
[BALL_DUSK] = {sNewParticlesPal, TAG_PARTICLES_DUSKBALL},
[BALL_TIMER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL},
[BALL_QUICK] = {sNewParticlesPal, TAG_PARTICLES_QUICKBALL},
[BALL_REPEAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL},
[BALL_LUXURY] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL},
[BALL_LEVEL] = {sNewParticlesPal, TAG_PARTICLES_LEVELBALL},
[BALL_LURE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUREBALL},
[BALL_MOON] = {sNewParticlesPal, TAG_PARTICLES_MOONBALL},
[BALL_FRIEND] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_FRIENDBALL},
[BALL_LOVE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LOVEBALL},
[BALL_HEAVY] = {sNewParticlesPal, TAG_PARTICLES_HEAVYBALL},
[BALL_FAST] = {sNewParticlesPal, TAG_PARTICLES_FASTBALL},
[BALL_SPORT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SPORTBALL},
[BALL_DUSK] = {sNewParticlesPal, TAG_PARTICLES_DUSKBALL},
[BALL_QUICK] = {sNewParticlesPal, TAG_PARTICLES_QUICKBALL},
[BALL_HEAL] = {sNewParticlesPal, TAG_PARTICLES_HEALBALL},
[BALL_CHERISH] = {sNewParticlesPal, TAG_PARTICLES_CHERISHBALL},
[BALL_PARK] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PARKBALL},
[BALL_HEAVY] = {sNewParticlesPal, TAG_PARTICLES_HEAVYBALL},
[BALL_DREAM] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DREAMBALL},
[BALL_SAFARI] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL},
[BALL_SPORT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SPORTBALL},
[BALL_PARK] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PARKBALL},
[BALL_BEAST] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_BEASTBALL},
[BALL_CHERISH] = {sNewParticlesPal, TAG_PARTICLES_CHERISHBALL},
};
static const union AnimCmd sAnim_RegularBall[] =
@ -276,65 +276,63 @@ static const u8 sBallParticleAnimNums[POKEBALL_COUNT] =
{
[BALL_POKE] = 0,
[BALL_GREAT] = 0,
[BALL_SAFARI] = 0,
[BALL_ULTRA] = 5,
[BALL_MASTER] = 1,
[BALL_NET] = 2,
[BALL_DIVE] = 2,
[BALL_NEST] = 3,
[BALL_REPEAT] = 5,
[BALL_TIMER] = 5,
[BALL_LUXURY] = 4,
[BALL_PREMIER] = 4,
[BALL_LEVEL] = 5,
[BALL_LURE] = 2,
[BALL_MOON] = 4,
[BALL_FRIEND] = 3,
[BALL_LOVE] = 3,
[BALL_HEAVY] = 0,
[BALL_FAST] = 4,
[BALL_SPORT] = 0,
[BALL_DUSK] = 2,
[BALL_QUICK] = 4,
[BALL_HEAL] = 0,
[BALL_HEAL] = 0,
[BALL_NET] = 2,
[BALL_NEST] = 3,
[BALL_DIVE] = 2,
[BALL_DUSK] = 2,
[BALL_TIMER] = 5,
[BALL_QUICK] = 4,
[BALL_REPEAT] = 5,
[BALL_LUXURY] = 4,
[BALL_LEVEL] = 5,
[BALL_LURE] = 2,
[BALL_MOON] = 4,
[BALL_FRIEND] = 3,
[BALL_LOVE] = 3,
[BALL_FAST] = 4,
[BALL_HEAVY] = 0,
[BALL_DREAM] = 5,
[BALL_SAFARI] = 0,
[BALL_SPORT] = 0,
[BALL_PARK] = 5,
[BALL_BEAST] = 5,
[BALL_CHERISH] = 0,
[BALL_PARK] = 5,
[BALL_DREAM] = 5,
[BALL_BEAST] = 5,
};
static const TaskFunc sBallParticleAnimationFuncs[] =
static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] =
{
[BALL_POKE] = PokeBallOpenParticleAnimation,
[BALL_GREAT] = GreatBallOpenParticleAnimation,
[BALL_SAFARI] = SafariBallOpenParticleAnimation,
[BALL_ULTRA] = UltraBallOpenParticleAnimation,
[BALL_MASTER] = MasterBallOpenParticleAnimation,
[BALL_NET] = SafariBallOpenParticleAnimation,
[BALL_DIVE] = DiveBallOpenParticleAnimation,
[BALL_NEST] = UltraBallOpenParticleAnimation,
[BALL_REPEAT] = RepeatBallOpenParticleAnimation,
[BALL_TIMER] = TimerBallOpenParticleAnimation,
[BALL_LUXURY] = GreatBallOpenParticleAnimation,
[BALL_PREMIER] = PremierBallOpenParticleAnimation,
// Todo: assign and possibly create different particles
[BALL_LEVEL] = SafariBallOpenParticleAnimation,
[BALL_LURE] = GreatBallOpenParticleAnimation,
[BALL_MOON] = UltraBallOpenParticleAnimation,
[BALL_FRIEND] = UltraBallOpenParticleAnimation,
[BALL_LOVE] = GreatBallOpenParticleAnimation,
[BALL_HEAVY] = GreatBallOpenParticleAnimation,
[BALL_FAST] = GreatBallOpenParticleAnimation,
[BALL_SPORT] = UltraBallOpenParticleAnimation,
[BALL_DUSK] = UltraBallOpenParticleAnimation,
[BALL_QUICK] = UltraBallOpenParticleAnimation,
[BALL_HEAL] = PokeBallOpenParticleAnimation,
[BALL_POKE] = PokeBallOpenParticleAnimation,
[BALL_GREAT] = GreatBallOpenParticleAnimation,
[BALL_ULTRA] = UltraBallOpenParticleAnimation,
[BALL_MASTER] = MasterBallOpenParticleAnimation,
[BALL_PREMIER] = PremierBallOpenParticleAnimation,
[BALL_HEAL] = PokeBallOpenParticleAnimation,
[BALL_NET] = SafariBallOpenParticleAnimation,
[BALL_NEST] = UltraBallOpenParticleAnimation,
[BALL_DIVE] = DiveBallOpenParticleAnimation,
[BALL_DUSK] = UltraBallOpenParticleAnimation,
[BALL_TIMER] = TimerBallOpenParticleAnimation,
[BALL_QUICK] = UltraBallOpenParticleAnimation,
[BALL_REPEAT] = RepeatBallOpenParticleAnimation,
[BALL_LUXURY] = GreatBallOpenParticleAnimation,
[BALL_LEVEL] = SafariBallOpenParticleAnimation,
[BALL_LURE] = GreatBallOpenParticleAnimation,
[BALL_MOON] = UltraBallOpenParticleAnimation,
[BALL_FRIEND] = UltraBallOpenParticleAnimation,
[BALL_LOVE] = GreatBallOpenParticleAnimation,
[BALL_FAST] = GreatBallOpenParticleAnimation,
[BALL_HEAVY] = GreatBallOpenParticleAnimation,
[BALL_DREAM] = UltraBallOpenParticleAnimation,
[BALL_SAFARI] = SafariBallOpenParticleAnimation,
[BALL_SPORT] = UltraBallOpenParticleAnimation,
[BALL_PARK] = UltraBallOpenParticleAnimation,
[BALL_BEAST] = UltraBallOpenParticleAnimation,
[BALL_CHERISH] = MasterBallOpenParticleAnimation,
[BALL_PARK] = UltraBallOpenParticleAnimation,
[BALL_DREAM] = UltraBallOpenParticleAnimation,
[BALL_BEAST] = UltraBallOpenParticleAnimation
};
static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT] =
@ -357,15 +355,6 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_SAFARI] = {
.tileTag = TAG_PARTICLES_SAFARIBALL,
.paletteTag = TAG_PARTICLES_SAFARIBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_ULTRA] = {
.tileTag = TAG_PARTICLES_ULTRABALL,
.paletteTag = TAG_PARTICLES_ULTRABALL,
@ -384,18 +373,27 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_NET] = {
.tileTag = TAG_PARTICLES_NETBALL,
.paletteTag = TAG_PARTICLES_NETBALL,
[BALL_PREMIER] = {
.tileTag = TAG_PARTICLES_PREMIERBALL,
.paletteTag = TAG_PARTICLES_PREMIERBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_DIVE] = {
.tileTag = TAG_PARTICLES_DIVEBALL,
.paletteTag = TAG_PARTICLES_DIVEBALL,
[BALL_HEAL] = {
.tileTag = TAG_PARTICLES_HEALBALL,
.paletteTag = TAG_PARTICLES_HEALBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_NET] = {
.tileTag = TAG_PARTICLES_NETBALL,
.paletteTag = TAG_PARTICLES_NETBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
@ -411,9 +409,18 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_REPEAT] = {
.tileTag = TAG_PARTICLES_REPEATBALL,
.paletteTag = TAG_PARTICLES_REPEATBALL,
[BALL_DIVE] = {
.tileTag = TAG_PARTICLES_DIVEBALL,
.paletteTag = TAG_PARTICLES_DIVEBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_DUSK] = {
.tileTag = TAG_PARTICLES_DUSKBALL,
.paletteTag = TAG_PARTICLES_DUSKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
@ -429,6 +436,24 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_QUICK] = {
.tileTag = TAG_PARTICLES_QUICKBALL,
.paletteTag = TAG_PARTICLES_QUICKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_REPEAT] = {
.tileTag = TAG_PARTICLES_REPEATBALL,
.paletteTag = TAG_PARTICLES_REPEATBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_LUXURY] = {
.tileTag = TAG_PARTICLES_LUXURYBALL,
.paletteTag = TAG_PARTICLES_LUXURYBALL,
@ -438,16 +463,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_PREMIER] = {
.tileTag = TAG_PARTICLES_PREMIERBALL,
.paletteTag = TAG_PARTICLES_PREMIERBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_LEVEL] = {
.tileTag = TAG_PARTICLES_LEVELBALL,
.paletteTag = TAG_PARTICLES_LEVELBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -456,7 +472,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_LURE] = {
.tileTag = TAG_PARTICLES_LUREBALL,
.paletteTag = TAG_PARTICLES_LUREBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -465,7 +481,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_MOON] = {
.tileTag = TAG_PARTICLES_MOONBALL,
.paletteTag = TAG_PARTICLES_MOONBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -474,7 +490,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_FRIEND] = {
.tileTag = TAG_PARTICLES_FRIENDBALL,
.paletteTag = TAG_PARTICLES_FRIENDBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -483,7 +499,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_LOVE] = {
.tileTag = TAG_PARTICLES_LOVEBALL,
.paletteTag = TAG_PARTICLES_LOVEBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -492,16 +508,7 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_HEAVYBALL,
.paletteTag = TAG_PARTICLES_HEAVYBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_FAST] = {
.tileTag = TAG_PARTICLES_FASTBALL,
.paletteTag = TAG_PARTICLES_FASTBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -510,61 +517,16 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_SPORTBALL,
.paletteTag = TAG_PARTICLES_SPORTBALL,
[BALL_HEAVY] = {
.tileTag = TAG_PARTICLES_HEAVYBALL,
.paletteTag = TAG_PARTICLES_HEAVYBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_DUSKBALL,
.paletteTag = TAG_PARTICLES_DUSKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_QUICKBALL,
.paletteTag = TAG_PARTICLES_QUICKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_HEALBALL,
.paletteTag = TAG_PARTICLES_HEALBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_CHERISHBALL,
.paletteTag = TAG_PARTICLES_CHERISHBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
.tileTag = TAG_PARTICLES_PARKBALL,
.paletteTag = TAG_PARTICLES_PARKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_DREAM] = {
.tileTag = TAG_PARTICLES_DREAMBALL,
.paletteTag = TAG_PARTICLES_DREAMBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -573,7 +535,34 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
{
[BALL_SAFARI] = {
.tileTag = TAG_PARTICLES_SAFARIBALL,
.paletteTag = TAG_PARTICLES_SAFARIBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_SPORT] = {
.tileTag = TAG_PARTICLES_SPORTBALL,
.paletteTag = TAG_PARTICLES_SPORTBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_PARK] = {
.tileTag = TAG_PARTICLES_PARKBALL,
.paletteTag = TAG_PARTICLES_PARKBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_BEAST] = {
.tileTag = TAG_PARTICLES_BEASTBALL,
.paletteTag = TAG_PARTICLES_BEASTBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
@ -582,39 +571,47 @@ static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT]
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
[BALL_CHERISH] = {
.tileTag = TAG_PARTICLES_CHERISHBALL,
.paletteTag = TAG_PARTICLES_CHERISHBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = sAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
},
};
const u16 gBallOpenFadeColors[] =
{
// Todo, assign different colors
[BALL_POKE] = RGB(31, 22, 30),
[BALL_GREAT] = RGB(16, 23, 30),
[BALL_SAFARI] = RGB(23, 30, 20),
[BALL_ULTRA] = RGB(31, 31, 15),
[BALL_MASTER] = RGB(23, 20, 28),
[BALL_NET] = RGB(21, 31, 25),
[BALL_DIVE] = RGB(12, 25, 30),
[BALL_NEST] = RGB(30, 27, 10),
[BALL_REPEAT] = RGB(31, 24, 16),
[BALL_TIMER] = RGB(29, 30, 30),
[BALL_LUXURY] = RGB(31, 17, 10),
[BALL_PREMIER] = RGB(31, 9, 10),
// Todo, assign different colors
[BALL_HEAL] = RGB(31, 23, 27),
[BALL_NET] = RGB(21, 31, 25),
[BALL_NEST] = RGB(30, 27, 10),
[BALL_DIVE] = RGB(12, 25, 30),
[BALL_DUSK] = RGB(7, 1, 13),
[BALL_TIMER] = RGB(29, 30, 30),
[BALL_QUICK] = RGB(16, 25, 30),
[BALL_REPEAT] = RGB(31, 24, 16),
[BALL_LUXURY] = RGB(31, 17, 10),
[BALL_LEVEL] = RGB(24, 4, 4),
[BALL_LURE] = RGB(9, 22, 27),
[BALL_MOON] = RGB(30, 25, 8),
[BALL_FRIEND] = RGB(17, 24, 7),
[BALL_LOVE] = RGB(31, 19, 26),
[BALL_HEAVY] = RGB(7, 11, 20),
[BALL_FAST] = RGB(29, 17, 8),
[BALL_SPORT] = RGB(31, 31, 15),
[BALL_DUSK] = RGB(7, 1, 13),
[BALL_QUICK] = RGB(16, 25, 30),
[BALL_HEAL] = RGB(31, 23, 27),
[BALL_CHERISH] = RGB(25, 4, 3),
[BALL_PARK] = RGB(31, 31, 15),
[BALL_HEAVY] = RGB(7, 11, 20),
[BALL_DREAM] = RGB(31, 31, 15),
[BALL_SAFARI] = RGB(23, 30, 20),
[BALL_SPORT] = RGB(31, 31, 15),
[BALL_PARK] = RGB(31, 31, 15),
[BALL_BEAST] = RGB(31, 31, 15),
[BALL_CHERISH] = RGB(25, 4, 3),
};
const struct SpriteTemplate gPokeblockSpriteTemplate =
@ -952,30 +949,34 @@ u8 ItemIdToBallId(u16 ballItem)
{
switch (ballItem)
{
case ITEM_MASTER_BALL:
return BALL_MASTER;
case ITEM_ULTRA_BALL:
return BALL_ULTRA;
case ITEM_GREAT_BALL:
return BALL_GREAT;
case ITEM_SAFARI_BALL:
return BALL_SAFARI;
case ITEM_NET_BALL:
return BALL_NET;
case ITEM_DIVE_BALL:
return BALL_DIVE;
case ITEM_NEST_BALL:
return BALL_NEST;
case ITEM_REPEAT_BALL:
return BALL_REPEAT;
case ITEM_TIMER_BALL:
return BALL_TIMER;
case ITEM_LUXURY_BALL:
return BALL_LUXURY;
case ITEM_PREMIER_BALL:
return BALL_PREMIER;
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:
@ -986,26 +987,22 @@ u8 ItemIdToBallId(u16 ballItem)
return BALL_FRIEND;
case ITEM_LOVE_BALL:
return BALL_LOVE;
case ITEM_HEAVY_BALL:
return BALL_HEAVY;
case ITEM_FAST_BALL:
return BALL_FAST;
case ITEM_SPORT_BALL:
return BALL_SPORT;
case ITEM_DUSK_BALL:
return BALL_DUSK;
case ITEM_QUICK_BALL:
return BALL_QUICK;
case ITEM_HEAL_BALL:
return BALL_HEAL;
case ITEM_CHERISH_BALL:
return BALL_CHERISH;
case ITEM_PARK_BALL:
return BALL_PARK;
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;
}

View File

@ -48,7 +48,6 @@
#include "trig.h"
#include "tv.h"
#include "util.h"
#include "wild_encounter.h"
#include "window.h"
#include "constants/abilities.h"
#include "constants/battle_move_effects.h"
@ -759,7 +758,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
}
else
{
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY));
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER));
for (i = 0; i < BERRY_NAME_LENGTH; i++)
battleBerry->name[i] = berryData->name[i];
@ -803,7 +802,7 @@ static void SetAllPlayersBerryData(void)
}
else
{
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY));
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER));
for (i = 0; i < BERRY_NAME_LENGTH; i++)
{
@ -3937,7 +3936,7 @@ u8 IsRunningFromBattleImpossible(void)
u8 side;
s32 i;
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item);
@ -4548,7 +4547,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
* (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][0])
/ (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][1]);
if (gBattleMons[battler1].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battler1].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[battler1].holdEffect;
holdEffectParam = gEnigmaBerries[battler1].holdEffectParam;
@ -4582,7 +4581,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
* (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][0])
/ (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][1]);
if (gBattleMons[battler2].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battler2].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[battler2].holdEffect;
holdEffectParam = gEnigmaBerries[battler2].holdEffectParam;
@ -5073,8 +5072,6 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
{
if (!gPaletteFade.active)
{
gIsFishingEncounter = FALSE;
gIsSurfingEncounter = FALSE;
ResetSpriteData();
if (gLeveledUpInBattle == 0 || gBattleOutcome != B_OUTCOME_WON)
{

View File

@ -2559,7 +2559,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_LAST_ITEM: // last used item
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{
if (gLastUsedItem == ITEM_ENIGMA_BERRY)
if (gLastUsedItem == ITEM_ENIGMA_BERRY_E_READER)
{
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
@ -2940,7 +2940,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
hword = T1_READ_16(&src[srcID + 1]);
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{
if (hword == ITEM_ENIGMA_BERRY)
if (hword == ITEM_ENIGMA_BERRY_E_READER)
{
if (gLinkPlayers[gBattleScripting.multiplayerId].id == gPotentialItemEffectBattler)
{

View File

@ -41,8 +41,6 @@
#include "constants/battle_string_ids.h"
#include "battle_setup.h"
#include "overworld.h"
#include "wild_encounter.h"
#include "rtc.h"
#include "party_menu.h"
#include "battle_arena.h"
#include "battle_pike.h"
@ -55,7 +53,6 @@
#include "data.h"
#include "constants/party_menu.h"
extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const u8* const gBattleScriptsForMoveEffects[];
@ -833,15 +830,6 @@ static const u8 sTerrainToType[] =
[BATTLE_TERRAIN_PLAIN] = TYPE_NORMAL,
};
// - ITEM_ULTRA_BALL skips Master Ball and ITEM_NONE
static const u8 sBallCatchBonuses[] =
{
[ITEM_ULTRA_BALL - ITEM_ULTRA_BALL] = 20,
[ITEM_GREAT_BALL - ITEM_ULTRA_BALL] = 15,
[ITEM_POKE_BALL - ITEM_ULTRA_BALL] = 10,
[ITEM_SAFARI_BALL - ITEM_ULTRA_BALL] = 15
};
// In Battle Palace, moves are chosen based on the pokemons nature rather than by the player
// Moves are grouped into "Attack", "Defense", or "Support" (see PALACE_MOVE_GROUP_*)
// Each nature has a certain percent chance of selecting a move from a particular group
@ -1152,7 +1140,7 @@ static void Cmd_accuracycheck(void)
if (gBattleMons[gBattlerAttacker].ability == ABILITY_HUSTLE && IS_TYPE_PHYSICAL(type))
calc = (calc * 80) / 100; // 1.2 hustle loss
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -1251,7 +1239,7 @@ static void Cmd_critcalc(void)
item = gBattleMons[gBattlerAttacker].item;
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gEnigmaBerries[gBattlerAttacker].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(item);
@ -1265,7 +1253,7 @@ static void Cmd_critcalc(void)
+ (gBattleMoves[gCurrentMove].effect == EFFECT_POISON_TAIL)
+ (holdEffect == HOLD_EFFECT_SCOPE_LENS)
+ 2 * (holdEffect == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY)
+ 2 * (holdEffect == HOLD_EFFECT_STICK && gBattleMons[gBattlerAttacker].species == SPECIES_FARFETCHD);
+ 2 * (holdEffect == HOLD_EFFECT_LEEK && gBattleMons[gBattlerAttacker].species == SPECIES_FARFETCHD);
if (critChance >= ARRAY_COUNT(sCriticalHitChance))
critChance = ARRAY_COUNT(sCriticalHitChance) - 1;
@ -1654,7 +1642,7 @@ static void Cmd_adjustnormaldamage(void)
ApplyRandomDmgMultiplier();
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -1696,7 +1684,7 @@ static void Cmd_adjustnormaldamage2(void) // The same as adjustnormaldamage exce
ApplyRandomDmgMultiplier();
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -2740,7 +2728,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
else if (gBattleMons[gBattlerAttacker].item != 0
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item)
|| gBattleMons[gBattlerTarget].item == 0)
{
@ -3259,7 +3247,7 @@ static void Cmd_getexp(void)
item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else
holdEffect = ItemId_GetHoldEffect(item);
@ -3298,7 +3286,7 @@ static void Cmd_getexp(void)
{
item = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HELD_ITEM);
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else
holdEffect = ItemId_GetHoldEffect(item);
@ -4188,7 +4176,7 @@ static void Cmd_moveend(void)
arg1 = gBattlescriptCurrInstr[1];
arg2 = gBattlescriptCurrInstr[2];
if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY_E_READER)
holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect;
else
holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item);
@ -5817,7 +5805,7 @@ static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except
{
u8 holdEffect, param;
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -7391,7 +7379,7 @@ static void Cmd_tryKO(void)
{
u8 holdEffect, param;
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER)
{
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -9081,8 +9069,8 @@ static void Cmd_tryswapitems(void) // trick
// can't swap if two pokemon don't have an item
// or if either of them is an enigma berry or a mail
else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0)
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY_E_READER
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER
|| IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item)
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item))
{
@ -9758,7 +9746,6 @@ static void Cmd_removelightscreenreflect(void) // brick break
static void Cmd_handleballthrow(void)
{
u8 ballMultiplier = 10;
s8 ballAddition = 0;
if (gBattleControllerExecFlags)
return;
@ -9780,213 +9767,49 @@ static void Cmd_handleballthrow(void)
}
else
{
u32 odds, i;
u32 odds;
u8 catchRate;
if (gLastUsedItem == ITEM_SAFARI_BALL)
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
else
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;
#ifdef POKEMON_EXPANSION
if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & F_ULTRA_BEAST)
switch (gLastUsedItem)
{
if (gLastUsedItem == ITEM_BEAST_BALL)
ballMultiplier = 50;
else
ballMultiplier = 1;
}
else
{
#endif
if (gLastUsedItem > ITEM_SAFARI_BALL)
{
switch (gLastUsedItem)
case ITEM_ULTRA_BALL:
ballMultiplier = 20;
case ITEM_GREAT_BALL:
case ITEM_SAFARI_BALL:
ballMultiplier = 15;
case ITEM_NET_BALL:
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
ballMultiplier = 30;
break;
case ITEM_DIVE_BALL:
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER)
ballMultiplier = 35;
break;
case ITEM_NEST_BALL:
if (gBattleMons[gBattlerTarget].level < 40)
{
case ITEM_NET_BALL:
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
#if I_NET_BALL_MODIFIER >= GEN_7
ballMultiplier = 50;
#else
ballMultiplier = 30;
#endif
break;
case ITEM_DIVE_BALL:
#if I_DIVE_BALL_MODIFIER >= GEN_4
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER || gIsFishingEncounter || gIsSurfingEncounter)
ballMultiplier = 35;
#else
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER)
ballMultiplier = 35;
#endif
break;
case ITEM_NEST_BALL:
#if I_NEST_BALL_MODIFIER >= GEN_6
//((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise.
if (gBattleMons[gBattlerTarget].level < 30)
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
#elif I_NEST_BALL_MODIFIER == GEN_5
//((41 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 31)
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
#else
//((40 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 40)
{
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
if (ballMultiplier <= 9)
ballMultiplier = 10;
}
#endif
break;
case ITEM_REPEAT_BALL:
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
#if I_REPEAT_BALL_MODIFIER >= GEN_7
ballMultiplier = 35;
#else
ballMultiplier = 30;
#endif
break;
case ITEM_TIMER_BALL:
#if I_TIMER_BALL_MODIFIER >= GEN_5
ballMultiplier = (gBattleResults.battleTurnCounter * 3) + 10;
#else
ballMultiplier = gBattleResults.battleTurnCounter + 10;
#endif
if (ballMultiplier > 40)
ballMultiplier = 40;
break;
case ITEM_LUXURY_BALL:
case ITEM_PREMIER_BALL:
case ITEM_FRIEND_BALL:
case ITEM_HEAL_BALL:
case ITEM_CHERISH_BALL:
ballMultiplier = 10;
break;
case ITEM_SPORT_BALL:
ballMultiplier = 15;
break;
case ITEM_LEVEL_BALL:
if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level)
ballMultiplier = 80;
else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level)
ballMultiplier = 40;
else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level)
ballMultiplier = 20;
break;
case ITEM_LURE_BALL:
if (gIsFishingEncounter)
#if I_LURE_BALL_MODIFIER >= GEN_7
ballMultiplier = 50;
#else
ballMultiplier = 30;
#endif
break;
case ITEM_MOON_BALL:
for (i = 0; i < EVOS_PER_MON; i++)
{
if (gEvolutionTable[gBattleMons[gBattlerTarget].species][i].method == EVO_ITEM
&& gEvolutionTable[gBattleMons[gBattlerTarget].species][i].param == ITEM_MOON_STONE)
ballMultiplier = 40;
}
break;
case ITEM_LOVE_BALL:
if (gBattleMons[gBattlerTarget].species == gBattleMons[gBattlerAttacker].species)
{
u8 gender1 = GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
u8 gender2 = GetMonGender(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]);
if (gender1 != gender2 && gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS)
ballMultiplier = 80;
}
break;
case ITEM_HEAVY_BALL:
i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1);
#if I_HEAVY_BALL_MODIFIER >= GEN_7
if (i < 1000)
ballAddition = -20;
else if (i < 2000)
ballAddition = 0;
else if (i < 3000)
ballAddition = 20;
else
ballAddition = 30;
#elif I_HEAVY_BALL_MODIFIER >= GEN_4
if (i < 2048)
ballAddition = -20;
else if (i < 3072)
ballAddition = 20;
else if (i < 4096)
ballAddition = 30;
else
ballAddition = 40;
#else
if (i < 1024)
ballAddition = -20;
else if (i < 2048)
ballAddition = 0;
else if (i < 3072)
ballAddition = 20;
else if (i < 4096)
ballAddition = 30;
else
ballAddition = 40;
#endif
break;
case ITEM_FAST_BALL:
if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
ballMultiplier = 40;
break;
case ITEM_QUICK_BALL:
if (gBattleResults.battleTurnCounter == 0)
#if I_QUICK_BALL_MODIFIER >= GEN_5
ballMultiplier = 50;
#else
ballMultiplier = 40;
#endif
break;
case ITEM_DUSK_BALL:
RtcCalcLocalTime();
if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
#if I_DUSK_BALL_MODIFIER >= GEN_7
ballMultiplier = 30;
#else
ballMultiplier = 35;
#endif
break;
case ITEM_DREAM_BALL:
#if I_DREAM_BALL_MODIFIER >= GEN_8
#ifdef BATTLE_ENGINE
if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)
#else
if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP)
ballMultiplier = 40;
#endif
#else
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
if (ballMultiplier <= 9)
ballMultiplier = 10;
#endif
break;
case ITEM_BEAST_BALL:
ballMultiplier = 1;
break;
}
break;
case ITEM_REPEAT_BALL:
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
ballMultiplier = 30;
break;
case ITEM_TIMER_BALL:
ballMultiplier = gBattleResults.battleTurnCounter + 10;
if (ballMultiplier > 40)
ballMultiplier = 40;
break;
}
else
ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL];
#ifdef POKEMON_EXPANSION
}
#endif
// catchRate is unsigned, which means that it may potentially overflow if sum is applied directly.
if (catchRate < 21 && ballAddition == -20)
catchRate = 1;
else
catchRate = catchRate + ballAddition;
odds = ((catchRate) * ballMultiplier / 10)
odds = (catchRate * ballMultiplier / 10)
* (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2)
/ (3 * gBattleMons[gBattlerTarget].maxHP);
@ -9995,18 +9818,8 @@ static void Cmd_handleballthrow(void)
if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON))
odds = (odds * 15) / 10;
if (gLastUsedItem != ITEM_SAFARI_BALL)
{
if (gLastUsedItem == ITEM_MASTER_BALL)
{
gBattleResults.usedMasterBall = TRUE;
}
else
{
if (gBattleResults.catchAttempts[gLastUsedItem - ITEM_ULTRA_BALL] < 0xFF)
gBattleResults.catchAttempts[gLastUsedItem - ITEM_ULTRA_BALL]++;
}
}
if (gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL] < 0xFF)
gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL]++;
if (odds > 254) // mon caught
{
@ -10044,14 +9857,6 @@ static void Cmd_handleballthrow(void)
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
else
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
if (gLastUsedItem == ITEM_HEAL_BALL)
{
MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]);
HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], gBattlerPartyIndexes[gBattlerTarget], STATUS1_ANY, gBattlerTarget);
gBattleMons[gBattlerTarget].hp = gBattleMons[gBattlerTarget].maxHP;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_HP, &gBattleMons[gBattlerTarget].hp);
}
}
else // not caught
{

View File

@ -135,7 +135,7 @@ const u16 gBattleFrontierHeldItems[] =
ITEM_APICOT_BERRY,
ITEM_STARF_BERRY,
ITEM_LIECHI_BERRY,
ITEM_STICK,
ITEM_LEEK,
ITEM_LAX_INCENSE,
ITEM_AGUAV_BERRY,
ITEM_FIGY_BERRY,

View File

@ -44,7 +44,6 @@ functions instead of at the top of the file with the other declarations.
*/
extern const u8 *const gBattleScriptsForMoveEffects[];
extern const u8 *const gBattlescriptsForBallThrow[];
extern const u8 *const gBattlescriptsForRunningByItem[];
extern const u8 *const gBattlescriptsForUsingItem[];
extern const u8 *const gBattlescriptsForSafariActions[];
@ -319,7 +318,7 @@ void HandleAction_UseItem(void)
if (gLastUsedItem <= LAST_BALL) // is ball
{
gBattlescriptCurrInstr = gBattlescriptsForBallThrow[gLastUsedItem];
gBattlescriptCurrInstr = BattleScript_BallThrow;
}
else if (gLastUsedItem == ITEM_POKE_DOLL || gLastUsedItem == ITEM_FLUFFY_TAIL)
{
@ -407,7 +406,7 @@ bool8 TryRunFromBattle(u8 battler)
u8 pyramidMultiplier;
u8 speedVar;
if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gEnigmaBerries[battler].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(gBattleMons[battler].item);
@ -550,7 +549,7 @@ void HandleAction_SafariZoneBallThrow(void)
gBattle_BG0_Y = 0;
gNumSafariBalls--;
gLastUsedItem = ITEM_SAFARI_BALL;
gBattlescriptCurrInstr = gBattlescriptsForBallThrow[ITEM_SAFARI_BALL];
gBattlescriptCurrInstr = BattleScript_SafariBallThrow;
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
}
@ -1029,7 +1028,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
}
}
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item);
@ -1073,7 +1072,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
u16 *choicedMove = &gBattleStruct->choicedMove[battlerId];
s32 i;
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gEnigmaBerries[battlerId].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(gBattleMons[battlerId].item);
@ -3218,7 +3217,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
u16 atkItem, defItem;
gLastUsedItem = gBattleMons[battlerId].item;
if (gLastUsedItem == ITEM_ENIGMA_BERRY)
if (gLastUsedItem == ITEM_ENIGMA_BERRY_E_READER)
{
battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect;
battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam;
@ -3230,7 +3229,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
}
atkItem = gBattleMons[gBattlerAttacker].item;
if (atkItem == ITEM_ENIGMA_BERRY)
if (atkItem == ITEM_ENIGMA_BERRY_E_READER)
{
atkHoldEffect = gEnigmaBerries[gBattlerAttacker].holdEffect;
atkHoldEffectParam = gEnigmaBerries[gBattlerAttacker].holdEffectParam;
@ -3243,7 +3242,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
// def variables are unused
defItem = gBattleMons[gBattlerTarget].item;
if (defItem == ITEM_ENIGMA_BERRY)
if (defItem == ITEM_ENIGMA_BERRY_E_READER)
{
defHoldEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
defHoldEffectParam = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -3702,7 +3701,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
{
gLastUsedItem = gBattleMons[battlerId].item;
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER)
{
battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect;
battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam;

View File

@ -1460,7 +1460,7 @@ bool32 IsEnigmaBerryValid(void)
const struct Berry *GetBerryInfo(u8 berry)
{
if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY_E_READER) && IsEnigmaBerryValid())
return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry);
else
{

View File

@ -1538,7 +1538,7 @@ static void SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum, struct B
u16 berryMasterDiff;
u16 i;
if (playerBerryItemId == ITEM_ENIGMA_BERRY)
if (playerBerryItemId == ITEM_ENIGMA_BERRY_E_READER)
{
for (i = 0; i < FLAVOR_COUNT; i++)
{
@ -2286,7 +2286,7 @@ static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16* _flavors,
for (j = 0; j < numPlayers; j++)
{
if (berries[i].itemId == berries[j].itemId && i != j
&& (berries[i].itemId != ITEM_ENIGMA_BERRY || AreBlenderBerriesSame(berries, i, j)))
&& (berries[i].itemId != ITEM_ENIGMA_BERRY_E_READER || AreBlenderBerriesSame(berries, i, j)))
return PBLOCK_CLR_BLACK;
}
}

View File

@ -962,7 +962,7 @@ const struct FacilityMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
[FRONTIER_MON_FARFETCHD] = {
.species = SPECIES_FARFETCHD,
.moves = {MOVE_SLASH, MOVE_KNOCK_OFF, MOVE_SWORDS_DANCE, MOVE_AGILITY},
.itemTableId = BATTLE_FRONTIER_ITEM_STICK,
.itemTableId = BATTLE_FRONTIER_ITEM_LEEK,
.evSpread = F_EV_SPREAD_SP_DEFENSE | F_EV_SPREAD_DEFENSE | F_EV_SPREAD_HP,
.nature = NATURE_RELAXED
},

View File

@ -4,36 +4,42 @@ const u32 gInterfacePal_PokeBall[] = INCBIN_U32("graphics/interface/ball/poke.gb
const u32 gInterfaceGfx_GreatBall[] = INCBIN_U32("graphics/interface/ball/great.4bpp.lz");
const u32 gInterfacePal_GreatBall[] = INCBIN_U32("graphics/interface/ball/great.gbapal.lz");
const u32 gInterfaceGfx_SafariBall[] = INCBIN_U32("graphics/interface/ball/safari.4bpp.lz");
const u32 gInterfacePal_SafariBall[] = INCBIN_U32("graphics/interface/ball/safari.gbapal.lz");
const u32 gInterfaceGfx_UltraBall[] = INCBIN_U32("graphics/interface/ball/ultra.4bpp.lz");
const u32 gInterfacePal_UltraBall[] = INCBIN_U32("graphics/interface/ball/ultra.gbapal.lz");
const u32 gInterfaceGfx_MasterBall[] = INCBIN_U32("graphics/interface/ball/master.4bpp.lz");
const u32 gInterfacePal_MasterBall[] = INCBIN_U32("graphics/interface/ball/master.gbapal.lz");
const u32 gInterfaceGfx_PremierBall[] = INCBIN_U32("graphics/interface/ball/premier.4bpp.lz");
const u32 gInterfacePal_PremierBall[] = INCBIN_U32("graphics/interface/ball/premier.gbapal.lz");
const u32 gInterfaceGfx_HealBall[] = INCBIN_U32("graphics/interface/ball/heal.4bpp.lz");
const u32 gInterfacePal_HealBall[] = INCBIN_U32("graphics/interface/ball/heal.gbapal.lz");
const u32 gInterfaceGfx_NetBall[] = INCBIN_U32("graphics/interface/ball/net.4bpp.lz");
const u32 gInterfacePal_NetBall[] = INCBIN_U32("graphics/interface/ball/net.gbapal.lz");
const u32 gInterfaceGfx_DiveBall[] = INCBIN_U32("graphics/interface/ball/dive.4bpp.lz");
const u32 gInterfacePal_DiveBall[] = INCBIN_U32("graphics/interface/ball/dive.gbapal.lz");
const u32 gInterfaceGfx_NestBall[] = INCBIN_U32("graphics/interface/ball/nest.4bpp.lz");
const u32 gInterfacePal_NestBall[] = INCBIN_U32("graphics/interface/ball/nest.gbapal.lz");
const u32 gInterfaceGfx_RepeatBall[] = INCBIN_U32("graphics/interface/ball/repeat.4bpp.lz");
const u32 gInterfacePal_RepeatBall[] = INCBIN_U32("graphics/interface/ball/repeat.gbapal.lz");
const u32 gInterfaceGfx_DiveBall[] = INCBIN_U32("graphics/interface/ball/dive.4bpp.lz");
const u32 gInterfacePal_DiveBall[] = INCBIN_U32("graphics/interface/ball/dive.gbapal.lz");
const u32 gInterfaceGfx_DuskBall[] = INCBIN_U32("graphics/interface/ball/dusk.4bpp.lz");
const u32 gInterfacePal_DuskBall[] = INCBIN_U32("graphics/interface/ball/dusk.gbapal.lz");
const u32 gInterfaceGfx_TimerBall[] = INCBIN_U32("graphics/interface/ball/timer.4bpp.lz");
const u32 gInterfacePal_TimerBall[] = INCBIN_U32("graphics/interface/ball/timer.gbapal.lz");
const u32 gInterfaceGfx_QuickBall[] = INCBIN_U32("graphics/interface/ball/quick.4bpp.lz");
const u32 gInterfacePal_QuickBall[] = INCBIN_U32("graphics/interface/ball/quick.gbapal.lz");
const u32 gInterfaceGfx_RepeatBall[] = INCBIN_U32("graphics/interface/ball/repeat.4bpp.lz");
const u32 gInterfacePal_RepeatBall[] = INCBIN_U32("graphics/interface/ball/repeat.gbapal.lz");
const u32 gInterfaceGfx_LuxuryBall[] = INCBIN_U32("graphics/interface/ball/luxury.4bpp.lz");
const u32 gInterfacePal_LuxuryBall[] = INCBIN_U32("graphics/interface/ball/luxury.gbapal.lz");
const u32 gInterfaceGfx_PremierBall[] = INCBIN_U32("graphics/interface/ball/premier.4bpp.lz");
const u32 gInterfacePal_PremierBall[] = INCBIN_U32("graphics/interface/ball/premier.gbapal.lz");
const u32 gInterfaceGfx_LevelBall[] = INCBIN_U32("graphics/interface/ball/level.4bpp.lz");
const u32 gInterfacePal_LevelBall[] = INCBIN_U32("graphics/interface/ball/level.gbapal.lz");
@ -49,34 +55,28 @@ const u32 gInterfacePal_FriendBall[] = INCBIN_U32("graphics/interface/ball/frien
const u32 gInterfaceGfx_LoveBall[] = INCBIN_U32("graphics/interface/ball/love.4bpp.lz");
const u32 gInterfacePal_LoveBall[] = INCBIN_U32("graphics/interface/ball/love.gbapal.lz");
const u32 gInterfaceGfx_HeavyBall[] = INCBIN_U32("graphics/interface/ball/heavy.4bpp.lz");
const u32 gInterfacePal_HeavyBall[] = INCBIN_U32("graphics/interface/ball/heavy.gbapal.lz");
const u32 gInterfaceGfx_FastBall[] = INCBIN_U32("graphics/interface/ball/fast.4bpp.lz");
const u32 gInterfacePal_FastBall[] = INCBIN_U32("graphics/interface/ball/fast.gbapal.lz");
const u32 gInterfaceGfx_SportBall[] = INCBIN_U32("graphics/interface/ball/sport.4bpp.lz");
const u32 gInterfacePal_SportBall[] = INCBIN_U32("graphics/interface/ball/sport.gbapal.lz");
const u32 gInterfaceGfx_DuskBall[] = INCBIN_U32("graphics/interface/ball/dusk.4bpp.lz");
const u32 gInterfacePal_DuskBall[] = INCBIN_U32("graphics/interface/ball/dusk.gbapal.lz");
const u32 gInterfaceGfx_QuickBall[] = INCBIN_U32("graphics/interface/ball/quick.4bpp.lz");
const u32 gInterfacePal_QuickBall[] = INCBIN_U32("graphics/interface/ball/quick.gbapal.lz");
const u32 gInterfaceGfx_HealBall[] = INCBIN_U32("graphics/interface/ball/heal.4bpp.lz");
const u32 gInterfacePal_HealBall[] = INCBIN_U32("graphics/interface/ball/heal.gbapal.lz");
const u32 gInterfaceGfx_CherishBall[] = INCBIN_U32("graphics/interface/ball/cherish.4bpp.lz");
const u32 gInterfacePal_CherishBall[] = INCBIN_U32("graphics/interface/ball/cherish.gbapal.lz");
const u32 gInterfaceGfx_ParkBall[] = INCBIN_U32("graphics/interface/ball/park.4bpp.lz");
const u32 gInterfacePal_ParkBall[] = INCBIN_U32("graphics/interface/ball/park.gbapal.lz");
const u32 gInterfaceGfx_HeavyBall[] = INCBIN_U32("graphics/interface/ball/heavy.4bpp.lz");
const u32 gInterfacePal_HeavyBall[] = INCBIN_U32("graphics/interface/ball/heavy.gbapal.lz");
const u32 gInterfaceGfx_DreamBall[] = INCBIN_U32("graphics/interface/ball/dream.4bpp.lz");
const u32 gInterfacePal_DreamBall[] = INCBIN_U32("graphics/interface/ball/dream.gbapal.lz");
const u32 gInterfaceGfx_SafariBall[] = INCBIN_U32("graphics/interface/ball/safari.4bpp.lz");
const u32 gInterfacePal_SafariBall[] = INCBIN_U32("graphics/interface/ball/safari.gbapal.lz");
const u32 gInterfaceGfx_SportBall[] = INCBIN_U32("graphics/interface/ball/sport.4bpp.lz");
const u32 gInterfacePal_SportBall[] = INCBIN_U32("graphics/interface/ball/sport.gbapal.lz");
const u32 gInterfaceGfx_ParkBall[] = INCBIN_U32("graphics/interface/ball/park.4bpp.lz");
const u32 gInterfacePal_ParkBall[] = INCBIN_U32("graphics/interface/ball/park.gbapal.lz");
const u32 gInterfaceGfx_BeastBall[] = INCBIN_U32("graphics/interface/ball/beast.4bpp.lz");
const u32 gInterfacePal_BeastBall[] = INCBIN_U32("graphics/interface/ball/beast.gbapal.lz");
const u32 gInterfaceGfx_CherishBall[] = INCBIN_U32("graphics/interface/ball/cherish.4bpp.lz");
const u32 gInterfacePal_CherishBall[] = INCBIN_U32("graphics/interface/ball/cherish.gbapal.lz");
const u32 gOpenPokeballGfx[] = INCBIN_U32("graphics/interface/ball_open.4bpp.lz");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1244,6 +1244,56 @@ static const u16 sTMHMMoves[] =
[ITEM_TM48 - ITEM_TM01] = MOVE_SKILL_SWAP,
[ITEM_TM49 - ITEM_TM01] = MOVE_SNATCH,
[ITEM_TM50 - ITEM_TM01] = MOVE_OVERHEAT,
[ITEM_TM51 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM52 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM53 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM54 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM55 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM56 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM57 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM58 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM59 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM60 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM61 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM62 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM63 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM64 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM65 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM66 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM67 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM68 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM69 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM70 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM71 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM72 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM73 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM74 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM75 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM76 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM77 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM78 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM79 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM80 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM81 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM82 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM83 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM84 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM85 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM86 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM87 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM88 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM89 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM90 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM91 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM92 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM93 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM94 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM95 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM96 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM97 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM98 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM99 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_TM100 - ITEM_TM01] = MOVE_NONE, // Todo
[ITEM_HM01 - ITEM_TM01] = MOVE_CUT,
[ITEM_HM02 - ITEM_TM01] = MOVE_FLY,
[ITEM_HM03 - ITEM_TM01] = MOVE_SURF,

View File

@ -2681,7 +2681,7 @@ const struct BaseStats gBaseStats[] =
.evYield_SpAttack = 0,
.evYield_SpDefense = 0,
.item1 = ITEM_NONE,
.item2 = ITEM_STICK,
.item2 = ITEM_LEEK,
.genderRatio = PERCENT_FEMALE(50),
.eggCycles = 20,
.friendship = 70,

View File

@ -78,7 +78,7 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
{EVO_ITEM, ITEM_FIRE_STONE, SPECIES_FLAREON},
{EVO_FRIENDSHIP_DAY, 0, SPECIES_ESPEON},
{EVO_FRIENDSHIP_NIGHT, 0, SPECIES_UMBREON}},
[SPECIES_PORYGON] = {{EVO_TRADE_ITEM, ITEM_UP_GRADE, SPECIES_PORYGON2}},
[SPECIES_PORYGON] = {{EVO_TRADE_ITEM, ITEM_UPGRADE, SPECIES_PORYGON2}},
[SPECIES_OMANYTE] = {{EVO_LEVEL, 40, SPECIES_OMASTAR}},
[SPECIES_KABUTO] = {{EVO_LEVEL, 40, SPECIES_KABUTOPS}},
[SPECIES_DRATINI] = {{EVO_LEVEL, 30, SPECIES_DRAGONAIR}},

View File

@ -1,5 +1,5 @@
#define TMHM_LEARNSET(moves) {(u32)(moves), ((u64)(moves) >> 32)}
#define TMHM(tmhm) ((u64)1 << (ITEM_##tmhm - ITEM_TM01_FOCUS_PUNCH))
#define TMHM(tmhm) ((u64)1 << (ITEM_##tmhm - ITEM_TM01_FOCUS_PUNCH - ((ITEM_##tmhm > ITEM_TM100) ? 50 : 0)))
// This table determines which TMs and HMs a species is capable of learning.
// Each entry is a 64-bit bit array spread across two 32-bit values, with

File diff suppressed because it is too large Load Diff

View File

@ -165,7 +165,7 @@ bool8 HasAtLeastOneBerry(void)
{
u16 i;
for (i = FIRST_BERRY_INDEX; i < ITEM_BRIGHT_POWDER; i++)
for (i = FIRST_BERRY_INDEX; i <= LAST_BERRY_INDEX; i++)
{
if (CheckBagHasItem(i, 1) == TRUE)
{

View File

@ -1549,7 +1549,7 @@ static void OpenContextMenu(u8 taskId)
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_BerryBlenderCrush);
break;
case ITEMMENULOCATION_APPRENTICE:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER)
{
gBagMenu->contextMenuItemsPtr = sContextMenuItems_Apprentice;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_Apprentice);
@ -1561,7 +1561,7 @@ static void OpenContextMenu(u8 taskId)
}
break;
case ITEMMENULOCATION_FAVOR_LADY:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER)
{
gBagMenu->contextMenuItemsPtr = sContextMenuItems_FavorLady;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_FavorLady);
@ -1573,7 +1573,7 @@ static void OpenContextMenu(u8 taskId)
}
break;
case ITEMMENULOCATION_QUIZ_LADY:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER)
{
gBagMenu->contextMenuItemsPtr = sContextMenuItems_QuizLady;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_QuizLady);

View File

@ -610,7 +610,7 @@ static void LoadBerryGfx(u8 berryId)
{
struct CompressedSpritePalette pal;
if (berryId == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) - 1 && IsEnigmaBerryValid())
if (berryId == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY_E_READER) - 1 && IsEnigmaBerryValid())
{
// unknown empty if statement
}

View File

@ -98,7 +98,7 @@ static const struct YesNoFuncTable sUseTMHMYesNoFuncTable =
static void SetUpItemUseCallback(u8 taskId)
{
u8 type;
if (gSpecialVar_ItemId == ITEM_ENIGMA_BERRY)
if (gSpecialVar_ItemId == ITEM_ENIGMA_BERRY_E_READER)
type = gTasks[taskId].tEnigmaBerryType - 1;
else
type = ItemId_GetType(gSpecialVar_ItemId) - 1;

View File

@ -278,7 +278,7 @@ u8 GetLRKeysPressedAndHeld(void)
bool8 IsHoldingItemAllowed(u16 itemId)
{
// Enigma Berry can't be held in link areas
if (itemId != ITEM_ENIGMA_BERRY)
if (itemId != ITEM_ENIGMA_BERRY_E_READER)
return TRUE;
else if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRADE_CENTER)
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRADE_CENTER))

View File

@ -1963,7 +1963,9 @@ static u8 CanMonLearnTMTutor(struct Pokemon *mon, u16 item, u8 tutor)
if (item >= ITEM_TM01)
{
if (!CanMonLearnTMHM(mon, item - ITEM_TM01))
if (item > ITEM_TM50 && item < ITEM_HM01)
return CANNOT_LEARN_MOVE;
else if (!CanMonLearnTMHM(mon, item - ITEM_TM01 - ((item > ITEM_TM100) ? 50 : 0)))
return CANNOT_LEARN_MOVE;
else
move = ItemIdToBattleMoveId(item);
@ -4220,7 +4222,7 @@ static bool8 IsHPRecoveryItem(u16 item)
{
const u8 *effect;
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
effect = gItemEffectTable[item - ITEM_POTION];
@ -4637,7 +4639,7 @@ void ItemUseCB_PPRecovery(u8 taskId, TaskFunc task)
const u8 *effect;
u16 item = gSpecialVar_ItemId;
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
effect = gItemEffectTable[item - ITEM_POTION];
@ -5279,7 +5281,7 @@ u8 GetItemEffectType(u16 item)
return ITEM_EFFECT_NONE;
// Read the item's effect properties.
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffect = gItemEffectTable[item - ITEM_POTION];

View File

@ -49,92 +49,92 @@ static u16 GetBattlerPokeballItemId(u8 battlerId);
#define GFX_TAG_POKEBALL 55000
#define GFX_TAG_GREATBALL 55001
#define GFX_TAG_SAFARIBALL 55002
#define GFX_TAG_ULTRABALL 55003
#define GFX_TAG_MASTERBALL 55004
#define GFX_TAG_NETBALL 55005
#define GFX_TAG_DIVEBALL 55006
#define GFX_TAG_ULTRABALL 55002
#define GFX_TAG_MASTERBALL 55003
#define GFX_TAG_PREMIERBALL 55004
#define GFX_TAG_HEALBALL 55005
#define GFX_TAG_NETBALL 55006
#define GFX_TAG_NESTBALL 55007
#define GFX_TAG_REPEATBALL 55008
#define GFX_TAG_TIMERBALL 55009
#define GFX_TAG_LUXURYBALL 55010
#define GFX_TAG_PREMIERBALL 55011
#define GFX_TAG_LEVELBALL 55012
#define GFX_TAG_LUREBALL 55013
#define GFX_TAG_MOONBALL 55014
#define GFX_TAG_FRIENDBALL 55015
#define GFX_TAG_LOVEBALL 55016
#define GFX_TAG_HEAVYBALL 55017
#define GFX_TAG_FASTBALL 55018
#define GFX_TAG_SPORTBALL 55019
#define GFX_TAG_DUSKBALL 55020
#define GFX_TAG_QUICKBALL 55021
#define GFX_TAG_HEALBALL 55022
#define GFX_TAG_CHERISHBALL 55023
#define GFX_TAG_DIVEBALL 55008
#define GFX_TAG_DUSKBALL 55009
#define GFX_TAG_TIMERBALL 55010
#define GFX_TAG_QUICKBALL 55011
#define GFX_TAG_REPEATBALL 55012
#define GFX_TAG_LUXURYBALL 55013
#define GFX_TAG_LEVELBALL 55014
#define GFX_TAG_LUREBALL 55015
#define GFX_TAG_MOONBALL 55016
#define GFX_TAG_FRIENDBALL 55017
#define GFX_TAG_LOVEBALL 55018
#define GFX_TAG_FASTBALL 55019
#define GFX_TAG_HEAVYBALL 55020
#define GFX_TAG_DREAMBALL 55021
#define GFX_TAG_SAFARIBALL 55022
#define GFX_TAG_SPORTBALL 55023
#define GFX_TAG_PARKBALL 55024
#define GFX_TAG_DREAMBALL 55025
#define GFX_TAG_BEASTBALL 55026
#define GFX_TAG_BEASTBALL 55025
#define GFX_TAG_CHERISHBALL 55026
const struct CompressedSpriteSheet gBallSpriteSheets[POKEBALL_COUNT] =
{
[BALL_POKE] = {gInterfaceGfx_PokeBall, 384, GFX_TAG_POKEBALL},
[BALL_GREAT] = {gInterfaceGfx_GreatBall, 384, GFX_TAG_GREATBALL},
[BALL_SAFARI] = {gInterfaceGfx_SafariBall, 384, GFX_TAG_SAFARIBALL},
[BALL_ULTRA] = {gInterfaceGfx_UltraBall, 384, GFX_TAG_ULTRABALL},
[BALL_MASTER] = {gInterfaceGfx_MasterBall, 384, GFX_TAG_MASTERBALL},
[BALL_NET] = {gInterfaceGfx_NetBall, 384, GFX_TAG_NETBALL},
[BALL_DIVE] = {gInterfaceGfx_DiveBall, 384, GFX_TAG_DIVEBALL},
[BALL_NEST] = {gInterfaceGfx_NestBall, 384, GFX_TAG_NESTBALL},
[BALL_REPEAT] = {gInterfaceGfx_RepeatBall, 384, GFX_TAG_REPEATBALL},
[BALL_TIMER] = {gInterfaceGfx_TimerBall, 384, GFX_TAG_TIMERBALL},
[BALL_LUXURY] = {gInterfaceGfx_LuxuryBall, 384, GFX_TAG_LUXURYBALL},
[BALL_PREMIER] = {gInterfaceGfx_PremierBall, 384, GFX_TAG_PREMIERBALL},
[BALL_HEAL] = {gInterfaceGfx_HealBall, 384, GFX_TAG_HEALBALL},
[BALL_NET] = {gInterfaceGfx_NetBall, 384, GFX_TAG_NETBALL},
[BALL_NEST] = {gInterfaceGfx_NestBall, 384, GFX_TAG_NESTBALL},
[BALL_DIVE] = {gInterfaceGfx_DiveBall, 384, GFX_TAG_DIVEBALL},
[BALL_DUSK] = {gInterfaceGfx_DuskBall, 384, GFX_TAG_DUSKBALL},
[BALL_TIMER] = {gInterfaceGfx_TimerBall, 384, GFX_TAG_TIMERBALL},
[BALL_QUICK] = {gInterfaceGfx_QuickBall, 384, GFX_TAG_QUICKBALL},
[BALL_REPEAT] = {gInterfaceGfx_RepeatBall, 384, GFX_TAG_REPEATBALL},
[BALL_LUXURY] = {gInterfaceGfx_LuxuryBall, 384, GFX_TAG_LUXURYBALL},
[BALL_LEVEL] = {gInterfaceGfx_LevelBall, 384, GFX_TAG_LEVELBALL},
[BALL_LURE] = {gInterfaceGfx_LureBall, 384, GFX_TAG_LUREBALL},
[BALL_MOON] = {gInterfaceGfx_MoonBall, 384, GFX_TAG_MOONBALL},
[BALL_FRIEND] = {gInterfaceGfx_FriendBall, 384, GFX_TAG_FRIENDBALL},
[BALL_LOVE] = {gInterfaceGfx_LoveBall, 384, GFX_TAG_LOVEBALL},
[BALL_HEAVY] = {gInterfaceGfx_HeavyBall, 384, GFX_TAG_HEAVYBALL},
[BALL_FAST] = {gInterfaceGfx_FastBall, 384, GFX_TAG_FASTBALL},
[BALL_SPORT] = {gInterfaceGfx_SportBall, 384, GFX_TAG_SPORTBALL},
[BALL_DUSK] = {gInterfaceGfx_DuskBall, 384, GFX_TAG_DUSKBALL},
[BALL_QUICK] = {gInterfaceGfx_QuickBall, 384, GFX_TAG_QUICKBALL},
[BALL_HEAL] = {gInterfaceGfx_HealBall, 384, GFX_TAG_HEALBALL},
[BALL_CHERISH] = {gInterfaceGfx_CherishBall, 384, GFX_TAG_CHERISHBALL},
[BALL_PARK] = {gInterfaceGfx_ParkBall, 384, GFX_TAG_PARKBALL},
[BALL_HEAVY] = {gInterfaceGfx_HeavyBall, 384, GFX_TAG_HEAVYBALL},
[BALL_DREAM] = {gInterfaceGfx_DreamBall, 384, GFX_TAG_DREAMBALL},
[BALL_SAFARI] = {gInterfaceGfx_SafariBall, 384, GFX_TAG_SAFARIBALL},
[BALL_SPORT] = {gInterfaceGfx_SportBall, 384, GFX_TAG_SPORTBALL},
[BALL_PARK] = {gInterfaceGfx_ParkBall, 384, GFX_TAG_PARKBALL},
[BALL_BEAST] = {gInterfaceGfx_BeastBall, 384, GFX_TAG_BEASTBALL},
[BALL_CHERISH] = {gInterfaceGfx_CherishBall, 384, GFX_TAG_CHERISHBALL},
};
const struct CompressedSpritePalette gBallSpritePalettes[POKEBALL_COUNT] =
{
[BALL_POKE] = {gInterfacePal_PokeBall, GFX_TAG_POKEBALL},
[BALL_GREAT] = {gInterfacePal_GreatBall, GFX_TAG_GREATBALL},
[BALL_SAFARI] = {gInterfacePal_SafariBall, GFX_TAG_SAFARIBALL},
[BALL_ULTRA] = {gInterfacePal_UltraBall, GFX_TAG_ULTRABALL},
[BALL_MASTER] = {gInterfacePal_MasterBall, GFX_TAG_MASTERBALL},
[BALL_NET] = {gInterfacePal_NetBall, GFX_TAG_NETBALL},
[BALL_DIVE] = {gInterfacePal_DiveBall, GFX_TAG_DIVEBALL},
[BALL_NEST] = {gInterfacePal_NestBall, GFX_TAG_NESTBALL},
[BALL_REPEAT] = {gInterfacePal_RepeatBall, GFX_TAG_REPEATBALL},
[BALL_TIMER] = {gInterfacePal_TimerBall, GFX_TAG_TIMERBALL},
[BALL_LUXURY] = {gInterfacePal_LuxuryBall, GFX_TAG_LUXURYBALL},
[BALL_PREMIER] = {gInterfacePal_PremierBall, GFX_TAG_PREMIERBALL},
[BALL_HEAL] = {gInterfacePal_HealBall, GFX_TAG_HEALBALL},
[BALL_NET] = {gInterfacePal_NetBall, GFX_TAG_NETBALL},
[BALL_NEST] = {gInterfacePal_NestBall, GFX_TAG_NESTBALL},
[BALL_DIVE] = {gInterfacePal_DiveBall, GFX_TAG_DIVEBALL},
[BALL_DUSK] = {gInterfacePal_DuskBall, GFX_TAG_DUSKBALL},
[BALL_TIMER] = {gInterfacePal_TimerBall, GFX_TAG_TIMERBALL},
[BALL_QUICK] = {gInterfacePal_QuickBall, GFX_TAG_QUICKBALL},
[BALL_REPEAT] = {gInterfacePal_RepeatBall, GFX_TAG_REPEATBALL},
[BALL_LUXURY] = {gInterfacePal_LuxuryBall, GFX_TAG_LUXURYBALL},
[BALL_LEVEL] = {gInterfacePal_LevelBall, GFX_TAG_LEVELBALL},
[BALL_LURE] = {gInterfacePal_LureBall, GFX_TAG_LUREBALL},
[BALL_MOON] = {gInterfacePal_MoonBall, GFX_TAG_MOONBALL},
[BALL_FRIEND] = {gInterfacePal_FriendBall, GFX_TAG_FRIENDBALL},
[BALL_LOVE] = {gInterfacePal_LoveBall, GFX_TAG_LOVEBALL},
[BALL_HEAVY] = {gInterfacePal_HeavyBall, GFX_TAG_HEAVYBALL},
[BALL_FAST] = {gInterfacePal_FastBall, GFX_TAG_FASTBALL},
[BALL_SPORT] = {gInterfacePal_SportBall, GFX_TAG_SPORTBALL},
[BALL_DUSK] = {gInterfacePal_DuskBall, GFX_TAG_DUSKBALL},
[BALL_QUICK] = {gInterfacePal_QuickBall, GFX_TAG_QUICKBALL},
[BALL_HEAL] = {gInterfacePal_HealBall, GFX_TAG_HEALBALL},
[BALL_CHERISH] = {gInterfacePal_CherishBall, GFX_TAG_CHERISHBALL},
[BALL_PARK] = {gInterfacePal_ParkBall, GFX_TAG_PARKBALL},
[BALL_HEAVY] = {gInterfacePal_HeavyBall, GFX_TAG_HEAVYBALL},
[BALL_DREAM] = {gInterfacePal_DreamBall, GFX_TAG_DREAMBALL},
[BALL_SAFARI] = {gInterfacePal_SafariBall, GFX_TAG_SAFARIBALL},
[BALL_SPORT] = {gInterfacePal_SportBall, GFX_TAG_SPORTBALL},
[BALL_PARK] = {gInterfacePal_ParkBall, GFX_TAG_PARKBALL},
[BALL_BEAST] = {gInterfacePal_BeastBall, GFX_TAG_BEASTBALL},
[BALL_CHERISH] = {gInterfacePal_CherishBall, GFX_TAG_CHERISHBALL},
};
static const struct OamData sBallOamData =
@ -270,15 +270,6 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_SAFARIBALL,
.paletteTag = GFX_TAG_SAFARIBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_ULTRABALL,
.paletteTag = GFX_TAG_ULTRABALL,
@ -298,8 +289,8 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_NETBALL,
.paletteTag = GFX_TAG_NETBALL,
.tileTag = GFX_TAG_PREMIERBALL,
.paletteTag = GFX_TAG_PREMIERBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
@ -307,8 +298,17 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_DIVEBALL,
.paletteTag = GFX_TAG_DIVEBALL,
.tileTag = GFX_TAG_HEALBALL,
.paletteTag = GFX_TAG_HEALBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_NETBALL,
.paletteTag = GFX_TAG_NETBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
@ -325,8 +325,17 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_REPEATBALL,
.paletteTag = GFX_TAG_REPEATBALL,
.tileTag = GFX_TAG_DIVEBALL,
.paletteTag = GFX_TAG_DIVEBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_DUSKBALL,
.paletteTag = GFX_TAG_DUSKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
@ -342,6 +351,24 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_QUICKBALL,
.paletteTag = GFX_TAG_QUICKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_REPEATBALL,
.paletteTag = GFX_TAG_REPEATBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_LUXURYBALL,
.paletteTag = GFX_TAG_LUXURYBALL,
@ -352,15 +379,6 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_PREMIERBALL,
.paletteTag = GFX_TAG_PREMIERBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_LEVELBALL,
.paletteTag = GFX_TAG_LEVELBALL,
.oam = &sBallOamData,
@ -369,7 +387,7 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_LUREBALL,
.paletteTag = GFX_TAG_LUREBALL,
.oam = &sBallOamData,
@ -378,7 +396,7 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_MOONBALL,
.paletteTag = GFX_TAG_MOONBALL,
.oam = &sBallOamData,
@ -387,7 +405,7 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_FRIENDBALL,
.paletteTag = GFX_TAG_FRIENDBALL,
.oam = &sBallOamData,
@ -396,7 +414,7 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_LOVEBALL,
.paletteTag = GFX_TAG_LOVEBALL,
.oam = &sBallOamData,
@ -405,16 +423,7 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_HEAVYBALL,
.paletteTag = GFX_TAG_HEAVYBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_FASTBALL,
.paletteTag = GFX_TAG_FASTBALL,
.oam = &sBallOamData,
@ -423,61 +432,16 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_SPORTBALL,
.paletteTag = GFX_TAG_SPORTBALL,
{
.tileTag = GFX_TAG_HEAVYBALL,
.paletteTag = GFX_TAG_HEAVYBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_DUSKBALL,
.paletteTag = GFX_TAG_DUSKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_QUICKBALL,
.paletteTag = GFX_TAG_QUICKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_HEALBALL,
.paletteTag = GFX_TAG_HEALBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_CHERISHBALL,
.paletteTag = GFX_TAG_CHERISHBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_PARKBALL,
.paletteTag = GFX_TAG_PARKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_DREAMBALL,
.paletteTag = GFX_TAG_DREAMBALL,
.oam = &sBallOamData,
@ -486,7 +450,34 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
{
.tileTag = GFX_TAG_SAFARIBALL,
.paletteTag = GFX_TAG_SAFARIBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_SPORTBALL,
.paletteTag = GFX_TAG_SPORTBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_PARKBALL,
.paletteTag = GFX_TAG_PARKBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_BEASTBALL,
.paletteTag = GFX_TAG_BEASTBALL,
.oam = &sBallOamData,
@ -495,6 +486,15 @@ const struct SpriteTemplate gBallSpriteTemplates[POKEBALL_COUNT] =
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
{
.tileTag = GFX_TAG_CHERISHBALL,
.paletteTag = GFX_TAG_CHERISHBALL,
.oam = &sBallOamData,
.anims = sBallAnimSequences,
.images = NULL,
.affineAnims = sAffineAnim_BallRotate,
.callback = SpriteCB_BallThrow,
},
};
#define tFrames data[0]
@ -1449,12 +1449,10 @@ void LoadBallGfx(u8 ballId)
switch (ballId)
{
case BALL_DIVE:
case BALL_LUXURY:
case BALL_PREMIER:
case BALL_LEVEL ... POKEBALL_COUNT:
break;
default:
case BALL_POKE ... BALL_MASTER:
case BALL_NET ... BALL_NEST:
case BALL_REPEAT:
case BALL_SAFARI:
var = GetSpriteTileStartByTag(gBallSpriteSheets[ballId].tag);
LZDecompressVram(gOpenPokeballGfx, (void *)(OBJ_VRAM0 + 0x100 + var * 32));
break;

View File

@ -2574,7 +2574,7 @@ void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerP
dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY)
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
heldItem = ITEM_NONE;
dest->heldItem = heldItem;
@ -3099,7 +3099,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
spAttack = attacker->spAttack;
spDefense = defender->spDefense;
if (attacker->item == ITEM_ENIGMA_BERRY)
if (attacker->item == ITEM_ENIGMA_BERRY_E_READER)
{
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
@ -3110,7 +3110,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item);
}
if (defender->item == ITEM_ENIGMA_BERRY)
if (defender->item == ITEM_ENIGMA_BERRY_E_READER)
{
defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
@ -4679,7 +4679,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// Get item hold effect
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY)
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
@ -4716,11 +4716,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// Skip using the item if it won't do anything
if (!ITEM_HAS_EFFECT(item))
return TRUE;
if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY)
if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY_E_READER)
return TRUE;
// Get item effect
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
@ -5265,10 +5265,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
temp = gItemEffectTable[itemId - ITEM_POTION];
if (!temp && itemId != ITEM_ENIGMA_BERRY)
if (!temp && itemId != ITEM_ENIGMA_BERRY_E_READER)
return 0;
if (itemId == ITEM_ENIGMA_BERRY)
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
{
temp = gEnigmaBerries[gActiveBattler].itemEffect;
}
@ -5379,7 +5379,7 @@ u8 *UseStatIncreaseItem(u16 itemId)
int i;
const u8 *itemEffect;
if (itemId == ITEM_ENIGMA_BERRY)
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
@ -5444,7 +5444,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
u16 upperPersonality = personality >> 16;
u8 holdEffect;
if (heldItem == ITEM_ENIGMA_BERRY)
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else
holdEffect = ItemId_GetHoldEffect(heldItem);
@ -5807,7 +5807,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
species = GetMonData(mon, MON_DATA_SPECIES2, 0);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY)
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect;
@ -5900,7 +5900,7 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
}
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY)
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect;

View File

@ -3317,11 +3317,11 @@ static void PrintHeldItemName(void)
const u8 *text;
int x;
if (sMonSummaryScreen->summary.item == ITEM_ENIGMA_BERRY
if (sMonSummaryScreen->summary.item == ITEM_ENIGMA_BERRY_E_READER
&& IsMultiBattle() == TRUE
&& (sMonSummaryScreen->curMonIndex == 1 || sMonSummaryScreen->curMonIndex == 4 || sMonSummaryScreen->curMonIndex == 5))
{
text = ItemId_GetName(ITEM_ENIGMA_BERRY);
text = ItemId_GetName(ITEM_ENIGMA_BERRY_E_READER);
}
else if (sMonSummaryScreen->summary.item == ITEM_NONE)
{

View File

@ -126,9 +126,9 @@ static bool8 CheckPartyMonHasHeldItem(u16 item)
bool8 DoesPartyHaveEnigmaBerry(void)
{
bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY);
bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY_E_READER);
if (hasItem == TRUE)
GetBerryNameByBerryType(ItemIdToBerryType(ITEM_ENIGMA_BERRY), gStringVar1);
GetBerryNameByBerryType(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER), gStringVar1);
return hasItem;
}

View File

@ -956,22 +956,14 @@ void GabbyAndTyBeforeInterview(void)
else
gSaveBlock1Ptr->gabbyAndTyData.playerUsedHealingItem = FALSE;
if (!gBattleResults.usedMasterBall)
for (i = 0; i < POKEBALL_COUNT; i++)
{
for (i = 0; i < POKEBALL_COUNT - 1; i++)
if (gBattleResults.catchAttempts[i])
{
if (gBattleResults.catchAttempts[i])
{
gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = TRUE;
break;
}
gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = TRUE;
break;
}
}
else
{
// Player threw a Master Ball at Gabby and Ty
gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = TRUE;
}
TakeGabbyAndTyOffTheAir();
if (gSaveBlock1Ptr->gabbyAndTyData.lastMove == MOVE_NONE)
@ -1129,28 +1121,20 @@ void TryPutPokemonTodayOnAir(void)
sCurTVShowSlot = FindFirstEmptyRecordMixTVShowSlot(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1 && IsRecordMixShowAlreadySpawned(TVSHOW_POKEMON_TODAY_CAUGHT, FALSE) != TRUE)
{
for (i = 0; i < POKEBALL_COUNT - 1; i++)
for (i = 0; i < POKEBALL_COUNT; i++)
ballsUsed += gBattleResults.catchAttempts[i];
if (ballsUsed != 0 || gBattleResults.usedMasterBall)
if (ballsUsed != 0)
{
ballsUsed = 0;
show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
show->pokemonToday.kind = TVSHOW_POKEMON_TODAY_CAUGHT;
show->pokemonToday.active = FALSE; // NOTE: Show is not active until passed via Record Mix.
if (gBattleResults.usedMasterBall)
{
ballsUsed = 1;
itemLastUsed = ITEM_MASTER_BALL;
}
else
{
for (i = 0; i < POKEBALL_COUNT - 1; i++)
ballsUsed += gBattleResults.catchAttempts[i];
if (ballsUsed > 255)
ballsUsed = 255;
itemLastUsed = gLastUsedItem;
}
for (i = 0; i < POKEBALL_COUNT; i++)
ballsUsed += gBattleResults.catchAttempts[i];
if (ballsUsed > 255)
ballsUsed = 255;
itemLastUsed = gLastUsedItem;
show->pokemonToday.nBallsUsed = ballsUsed;
show->pokemonToday.ball = itemLastUsed;
StringCopy(show->pokemonToday.playerName, gSaveBlock2Ptr->playerName);
@ -1192,7 +1176,7 @@ static void TryPutPokemonTodayFailedOnTheAir(void)
if (!rbernoulli(1, 1))
{
for (i = 0, ballsUsed = 0; i < POKEBALL_COUNT - 1; i++)
for (i = 0, ballsUsed = 0; i < POKEBALL_COUNT; i++)
ballsUsed += gBattleResults.catchAttempts[i];
if (ballsUsed > 255)
ballsUsed = 255;
@ -2124,11 +2108,8 @@ void TryPutBreakingNewsOnAir(void)
show->breakingNews.kind = TVSHOW_BREAKING_NEWS;
show->breakingNews.active = FALSE; // NOTE: Show is not active until passed via Record Mix.
balls = 0;
for (i = 0; i < POKEBALL_COUNT - 1; i++)
for (i = 0; i < POKEBALL_COUNT; i++)
balls += gBattleResults.catchAttempts[i];
if (gBattleResults.usedMasterBall)
balls++;
show->breakingNews.location = gMapHeader.regionMapSectionId;
StringCopy(show->breakingNews.playerName, gSaveBlock2Ptr->playerName);
show->breakingNews.poke1Species = gBattleResults.playerMon1Species;
@ -2158,10 +2139,7 @@ void TryPutBreakingNewsOnAir(void)
switch (show->breakingNews.outcome)
{
case 0:
if (gBattleResults.usedMasterBall)
show->breakingNews.caughtMonBall = ITEM_MASTER_BALL;
else
show->breakingNews.caughtMonBall = gBattleResults.caughtMonBall;
show->breakingNews.caughtMonBall = gBattleResults.caughtMonBall;
show->breakingNews.balls = balls;
break;
case 1:

View File

@ -38,8 +38,6 @@ static bool8 IsAbilityAllowingEncounter(u8 level);
// EWRAM vars
EWRAM_DATA static u8 sWildEncountersDisabled = 0;
EWRAM_DATA bool8 gIsFishingEncounter = 0;
EWRAM_DATA bool8 gIsSurfingEncounter = 0;
EWRAM_DATA static u32 sFeebasRngValue = 0;
#include "data/wild_encounters.h"
@ -616,7 +614,6 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
{
if (TryGenerateWildMon(gWildMonHeaders[headerId].waterMonsInfo, WILD_AREA_WATER, WILD_CHECK_REPEL | WILD_CHECK_KEEN_EYE) == TRUE)
{
gIsSurfingEncounter = TRUE;
BattleSetup_StartWildBattle();
return TRUE;
}
@ -758,7 +755,6 @@ void FishingWildEncounter(u8 rod)
}
IncrementGameStat(GAME_STAT_FISHING_CAPTURES);
SetPokemonAnglerSpecies(species);
gIsFishingEncounter = TRUE;
BattleSetup_StartWildBattle();
}