Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-expansion into rhhupcomingdev

This commit is contained in:
Bassoonian 2023-03-23 23:04:23 +01:00
commit 80d0efae0c
23 changed files with 2049 additions and 1835 deletions

View File

@ -805,7 +805,7 @@ MUS_LITTLEROOT = 95 01
MUS_MT_CHIMNEY = 96 01
MUS_ENCOUNTER_FEMALE = 97 01
MUS_LILYCOVE = 98 01
MUS_ROUTE111 = 99 01
MUS_DESERT = 99 01
MUS_HELP = 9A 01
MUS_UNDERWATER = 9B 01
MUS_VICTORY_TRAINER = 9C 01

View File

@ -8654,6 +8654,7 @@ BattleScript_IntimidateLoopIncrement:
addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_IntimidateLoop
BattleScript_IntimidateEnd:
copybyte sBATTLER, gBattlerAttacker
destroyabilitypopup
pause B_WAIT_TIME_MED
end3

View File

@ -50,7 +50,7 @@ BattleScript_SuccessBallThrow::
setbyte sMON_CAUGHT, TRUE
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT
printstring STRINGID_GOTCHAPKMNCAUGHTPLAYER
jumpifbyte CMP_NOT_EQUAL, sEXP_CATCH, TRUE, BattleScript_TryPrintCaughtMonInfo
setbyte sGIVEEXP_STATE, 0
getexp BS_TARGET
@ -77,7 +77,7 @@ BattleScript_SuccessBallThrowEnd::
finishturn
BattleScript_WallyBallThrow::
printstring STRINGID_GOTCHAPKMNCAUGHT2
printstring STRINGID_GOTCHAPKMNCAUGHTWALLY
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn

View File

@ -26,26 +26,26 @@ MossdeepCity_Gym_EventScript_CheckSwitch4::
@ All the below set metatile scripts are leftover from RS and are functionally unused
MossdeepCity_Gym_EventScript_SetSwitch1Metatiles::
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch2
end
MossdeepCity_Gym_EventScript_SetSwitch2Metatiles::
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch3
end
MossdeepCity_Gym_EventScript_SetSwitch3Metatiles::
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch4
end
MossdeepCity_Gym_EventScript_SetSwitch4Metatiles::
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Down, TRUE
end
MossdeepCity_Gym_EventScript_TateAndLiza::
@ -116,8 +116,8 @@ MossdeepCity_Gym_EventScript_Switch1::
setflag FLAG_MOSSDEEP_GYM_SWITCH_1
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -131,8 +131,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch1::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_1
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -142,8 +142,8 @@ MossdeepCity_Gym_EventScript_Switch2::
setflag FLAG_MOSSDEEP_GYM_SWITCH_2
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -151,8 +151,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch2::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_2
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Down, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Down, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -162,8 +162,8 @@ MossdeepCity_Gym_EventScript_Switch3::
setflag FLAG_MOSSDEEP_GYM_SWITCH_3
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -171,8 +171,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch3::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_3
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -182,8 +182,8 @@ MossdeepCity_Gym_EventScript_Switch4::
setflag FLAG_MOSSDEEP_GYM_SWITCH_4
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@ -191,8 +191,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch4::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_4
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end

View File

@ -260,7 +260,7 @@ Route111_EventScript_SunTrigger::
Route111_EventScript_SandstormTrigger::
setweather WEATHER_SANDSTORM
fadenewbgm MUS_ROUTE111
fadenewbgm MUS_DESERT
doweather
end

View File

@ -265,8 +265,8 @@
#define STRINGID_ITAPPEAREDCAUGHT 264
#define STRINGID_AARGHALMOSTHADIT 265
#define STRINGID_SHOOTSOCLOSE 266
#define STRINGID_GOTCHAPKMNCAUGHT 267
#define STRINGID_GOTCHAPKMNCAUGHT2 268
#define STRINGID_GOTCHAPKMNCAUGHTPLAYER 267
#define STRINGID_GOTCHAPKMNCAUGHTWALLY 268
#define STRINGID_GIVENICKNAMECAPTURED 269
#define STRINGID_PKMNSENTTOPC 270
#define STRINGID_PKMNDATAADDEDTODEX 271

View File

@ -1032,7 +1032,4 @@
#define ITEM_B_USE_MEDICINE 1
#define ITEM_B_USE_OTHER 2
// Check if the item is one that can be used on a Pokemon.
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= LAST_BERRY_INDEX)
#endif // GUARD_CONSTANTS_ITEMS_H

File diff suppressed because it is too large Load Diff

View File

@ -191,6 +191,9 @@
#define FRIENDSHIP_200_TO_254 5
#define FRIENDSHIP_MAX 6
// Friendship value that the majority of species use. This was changed in Generation 8 to 50.
#define STANDARD_FRIENDSHIP 70
#define MAX_FRIENDSHIP 255
#define MAX_SHEEN 255
#define MAX_CONDITION 255

View File

@ -280,47 +280,47 @@
// Music
#define START_MUS 350
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI // Unused, likely a test track.
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13 // Unused, likely a test track.
#define MUS_CAUGHT 352 // MUS_KACHI22
#define MUS_VICTORY_WILD 353 // MUS_KACHI2
#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3
#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3 // Also used in Frontier Brain victories.
#define MUS_VICTORY_LEAGUE 355 // MUS_KACHI5
#define MUS_C_COMM_CENTER 356 // MUS_PCC
#define MUS_GSC_PEWTER 357 // MUS_NIBI
#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN
#define MUS_ROUTE101 359 // MUS_DOORO1
#define MUS_ROUTE110 360 // MUS_DOORO_X1
#define MUS_ROUTE120 361 // MUS_DOORO_X3
#define MUS_PETALBURG 362 // MUS_MACHI_S2
#define MUS_OLDALE 363 // MUS_MACHI_S4
#define MUS_C_COMM_CENTER 356 // MUS_PCC // Unused, likely a test track.
#define MUS_GSC_PEWTER 357 // MUS_NIBI // Used in unused Contest Halls.
#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN // Unused, likely a test track.
#define MUS_ROUTE101 359 // MUS_DOORO1 // Also used in Routes 102 and 103.
#define MUS_ROUTE110 360 // MUS_DOORO_X1 // Also used in Routes 112, 114, 117, 111's non-desert section and 118's west half.
#define MUS_ROUTE120 361 // MUS_DOORO_X3 // Also used in Routes 121, 124, 125, 126, 127 and 128.
#define MUS_PETALBURG 362 // MUS_MACHI_S2 // Also used in Mr. Briney's House and Pretty Petal Flower Shop.
#define MUS_OLDALE 363 // MUS_MACHI_S4 // Also used in Lavaridge Town.
#define MUS_GYM 364 // MUS_GIM
#define MUS_SURF 365 // MUS_NAMINORI
#define MUS_PETALBURG_WOODS 366 // MUS_DAN01
#define MUS_PETALBURG_WOODS 366 // MUS_DAN01 // Also used in Artisan Cave, Fiery Path, Granite Cave, Jagged Pass, Marine Cave, Rusturf Tunnel, Scorched Slab and Terra Cave.
#define MUS_LEVEL_UP 367 // MUS_FANFA1
#define MUS_HEAL 368 // MUS_ME_ASA
#define MUS_OBTAIN_BADGE 369 // MUS_ME_BACHI
#define MUS_OBTAIN_ITEM 370 // MUS_FANFA4
#define MUS_EVOLVED 371 // MUS_FANFA5
#define MUS_EVOLVED 371 // MUS_FANFA5 // Also used in egg hatching, trades and upon catching.
#define MUS_OBTAIN_TMHM 372 // MUS_ME_WAZA
#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU
#define MUS_ROUTE122 374 // MUS_DOORO_X4
#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU // Also used in the Battle Frontier's Ranking Hall.
#define MUS_ROUTE122 374 // MUS_DOORO_X4 // Also used in Route 123 and Birch's intro speech.
#define MUS_OCEANIC_MUSEUM 375 // MUS_FUNE_KAN
#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA
#define MUS_EVOLUTION 377 // MUS_SHINKA
#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA // Also used in egg hatching.
#define MUS_EVOLUTION 377 // MUS_SHINKA // Also used in egg hatching and trades.
#define MUS_MOVE_DELETED 378 // MUS_ME_WASURE
#define MUS_ENCOUNTER_GIRL 379 // MUS_SYOUJOEYE
#define MUS_ENCOUNTER_MALE 380 // MUS_BOYEYE
#define MUS_ABANDONED_SHIP 381 // MUS_DAN02
#define MUS_FORTREE 382 // MUS_MACHI_S3
#define MUS_ABANDONED_SHIP 381 // MUS_DAN02 // Also used in Faraway and Southern Islands.
#define MUS_FORTREE 382 // MUS_MACHI_S3 // Also used in Secret Bases and the Safari Zone's entrance.
#define MUS_BIRCH_LAB 383 // MUS_ODAMAKI
#define MUS_B_TOWER_RS 384 // MUS_B_TOWER
#define MUS_B_TOWER_RS 384 // MUS_B_TOWER // Used in Battle Tents, Trainer Hill and Battle Frontier's lounges and Exchange Service Corner.
#define MUS_ENCOUNTER_SWIMMER 385 // MUS_SWIMEYE
#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03
#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03 // Also used in Meteor Falls.
#define MUS_OBTAIN_BERRY 387 // MUS_ME_KINOMI
#define MUS_AWAKEN_LEGEND 388 // MUS_ME_TAMA
#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG
#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL
#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG // Also used in the Roulette.
#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL // Also used in the Roulette.
#define MUS_TOO_BAD 391 // MUS_ME_ZANNEN
#define MUS_ROULETTE 392 // MUS_BD_TIME
#define MUS_LINK_CONTEST_P1 393 // MUS_TEST1
@ -329,17 +329,17 @@
#define MUS_LINK_CONTEST_P4 396 // MUS_TEST4
#define MUS_ENCOUNTER_RICH 397 // MUS_TEST
#define MUS_VERDANTURF 398 // MUS_GOMACHI0
#define MUS_RUSTBORO 399 // MUS_GOTOWN
#define MUS_POKE_CENTER 400 // MUS_POKECEN
#define MUS_ROUTE104 401 // MUS_NEXTROAD
#define MUS_ROUTE119 402 // MUS_GRANROAD
#define MUS_RUSTBORO 399 // MUS_GOTOWN // Also used in Mauville City, Mossdeep City, Daycare, Weather Institute and several Route houses.
#define MUS_POKE_CENTER 400 // MUS_POKECEN // Also used in the Pokémon League's lobby.
#define MUS_ROUTE104 401 // MUS_NEXTROAD // Also used in Routes 105, 106, 107, 108, 109, 115 and 116.
#define MUS_ROUTE119 402 // MUS_GRANROAD // Also used in Routes 129, 130, 131, 132, 133, 134 and 118's east half.
#define MUS_CYCLING 403 // MUS_CYCLING
#define MUS_POKE_MART 404 // MUS_FRIENDLY
#define MUS_POKE_MART 404 // MUS_FRIENDLY // Also used in Lilycove's Department Store.
#define MUS_LITTLEROOT 405 // MUS_MISHIRO
#define MUS_MT_CHIMNEY 406 // MUS_TOZAN
#define MUS_MT_CHIMNEY 406 // MUS_TOZAN // Also used in Desert Underpass, Mirage Tower, Seafloor Cavern and Sky Pillar.
#define MUS_ENCOUNTER_FEMALE 407 // MUS_GIRLEYE
#define MUS_LILYCOVE 408 // MUS_MINAMO
#define MUS_ROUTE111 409 // MUS_ASHROAD
#define MUS_LILYCOVE 408 // MUS_MINAMO // Also used in Pacifidlog Town and the Diving Treasure Hunter's house.
#define MUS_DESERT 409 // MUS_ASHROAD
#define MUS_HELP 410 // MUS_EVENT0
#define MUS_UNDERWATER 411 // MUS_DEEPDEEP
#define MUS_VICTORY_TRAINER 412 // MUS_KACHI1
@ -352,29 +352,29 @@
#define MUS_ENCOUNTER_AQUA 419 // MUS_AQA_0
#define MUS_FOLLOW_ME 420 // MUS_TSURETEK
#define MUS_ENCOUNTER_BRENDAN 421 // MUS_BOY_SUP
#define MUS_EVER_GRANDE 422 // MUS_RAINBOW
#define MUS_EVER_GRANDE 422 // MUS_RAINBOW // Also used in link rooms.
#define MUS_ENCOUNTER_SUSPICIOUS 423 // MUS_AYASII
#define MUS_VICTORY_AQUA_MAGMA 424 // MUS_KACHI4
#define MUS_CABLE_CAR 425 // MUS_ROPEWAY
#define MUS_GAME_CORNER 426 // MUS_CASINO
#define MUS_DEWFORD 427 // MUS_HIGHTOWN
#define MUS_DEWFORD 427 // MUS_HIGHTOWN // Also used in Route 109's Seashore house.
#define MUS_SAFARI_ZONE 428 // MUS_SAFARI
#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD
#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD // Also used in Pokémon League's E4/Champion rooms and halls.
#define MUS_AQUA_MAGMA_HIDEOUT 430 // MUS_AJITO
#define MUS_SAILING 431 // MUS_M_BOAT
#define MUS_MT_PYRE 432 // MUS_M_DUNGON
#define MUS_SLATEPORT 433 // MUS_FINECITY
#define MUS_MT_PYRE 432 // MUS_M_DUNGON // Also used in New Mauville and Shoal Cave.
#define MUS_SLATEPORT 433 // MUS_FINECITY // Also used in Cycling Road's entrances.
#define MUS_MT_PYRE_EXTERIOR 434 // MUS_MACHUPI
#define MUS_SCHOOL 435 // MUS_P_SCHOOL
#define MUS_HALL_OF_FAME 436 // MUS_DENDOU
#define MUS_FALLARBOR 437 // MUS_TONEKUSA
#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI
#define MUS_FALLARBOR 437 // MUS_TONEKUSA // Also used in Route 114's houses.
#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI // Also used in Ancient Tomb, Desert Ruins and Island Cave.
#define MUS_CONTEST_WINNER 439 // MUS_CON_FAN
#define MUS_CONTEST 440 // MUS_CONTEST0
#define MUS_ENCOUNTER_MAGMA 441 // MUS_MGM0
#define MUS_INTRO_BATTLE 442 // MUS_T_BATTLE
#define MUS_ABNORMAL_WEATHER 443 // MUS_OOAME (Replaces MUS_WEATHER_KYOGRE from R/S)
#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI (Unused, from R/S)
#define MUS_ABNORMAL_WEATHER 443 // MUS_OOAME // Replaces MUS_WEATHER_KYOGRE from R/S.
#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI // Unused, from R/S.
#define MUS_SOOTOPOLIS 445 // MUS_RUNECITY
#define MUS_CONTEST_RESULTS 446 // MUS_CON_K
#define MUS_HALL_OF_FAME_ROOM 447 // MUS_EIKOU_R
@ -383,7 +383,7 @@
#define MUS_ENCOUNTER_ELITE_FOUR 450 // MUS_SITENNOU
#define MUS_ENCOUNTER_HIKER 451 // MUS_YAMA_EYE
#define MUS_CONTEST_LOBBY 452 // MUS_CONLOBBY
#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V
#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V // Also used during Petalburg City report at the beginning of the game.
#define MUS_ENCOUNTER_CHAMPION 454 // MUS_DAIGO
#define MUS_CREDITS 455 // MUS_THANKFOR
#define MUS_END 456 // MUS_END
@ -400,7 +400,7 @@
#define MUS_B_DOME 467 // MUS_B_DOME
#define MUS_B_PIKE 468 // MUS_B_TUBE
#define MUS_B_FACTORY 469 // MUS_B_FACTORY
#define MUS_VS_RAYQUAZA 470 // MUS_VS_REKKU (Identical to MUS_VS_KYOGRE_GROUDON)
#define MUS_VS_RAYQUAZA 470 // MUS_VS_REKKU // Identical to MUS_VS_KYOGRE_GROUDON.
#define MUS_VS_FRONTIER_BRAIN 471 // MUS_VS_FRONT
#define MUS_VS_MEW 472 // MUS_VS_MEW
#define MUS_B_DOME_LOBBY 473 // MUS_B_DOME1
@ -453,9 +453,9 @@
#define MUS_RG_SILPH 519 // MUS_RG_SHIRUHU
#define MUS_RG_FUCHSIA 520 // MUS_RG_HANADA
#define MUS_RG_CELADON 521 // MUS_RG_TAMAMUSI
#define MUS_RG_VICTORY_TRAINER 522 // MUS_RG_WIN_TRE (Identical to MUS_VICTORY_TRAINER)
#define MUS_RG_VICTORY_WILD 523 // MUS_RG_WIN_YASEI (Identical to MUS_VICTORY_WILD)
#define MUS_RG_VICTORY_GYM_LEADER 524 // MUS_RG_WIN_GYM (Identical to MUS_VICTORY_GYM_LEADER)
#define MUS_RG_VICTORY_TRAINER 522 // MUS_RG_WIN_TRE // Identical to MUS_VICTORY_TRAINER.
#define MUS_RG_VICTORY_WILD 523 // MUS_RG_WIN_YASEI // Identical to MUS_VICTORY_WILD.
#define MUS_RG_VICTORY_GYM_LEADER 524 // MUS_RG_WIN_GYM // Identical to MUS_VICTORY_GYM_LEADER.
#define MUS_RG_VERMILLION 525 // MUS_RG_KUCHIBA
#define MUS_RG_PEWTER 526 // MUS_RG_NIBI
#define MUS_RG_ENCOUNTER_RIVAL 527 // MUS_RG_RIVAL1
@ -474,11 +474,11 @@
#define MUS_RG_NET_CENTER 540 // MUS_RG_NETWORK
#define MUS_RG_MYSTERY_GIFT 541 // MUS_RG_OKURIMONO
#define MUS_RG_BERRY_PICK 542 // MUS_RG_KINOMIKUI
#define MUS_RG_SEVII_CAVE 543 // MUS_RG_NANADUNGEON (Identical to MUS_RG_MT_MOON)
#define MUS_RG_TEACHY_TV_SHOW 544 // MUS_RG_OSHIE_TV (Identical to MUS_RG_FOLLOW_ME)
#define MUS_RG_SEVII_CAVE 543 // MUS_RG_NANADUNGEON // Identical to MUS_RG_MT_MOON.
#define MUS_RG_TEACHY_TV_SHOW 544 // MUS_RG_OSHIE_TV // Identical to MUS_RG_FOLLOW_ME.
#define MUS_RG_SEVII_ROUTE 545 // MUS_RG_NANASHIMA
#define MUS_RG_SEVII_DUNGEON 546 // MUS_RG_NANAISEKI (Identical to MUS_RG_VIRIDIAN_FOREST)
#define MUS_RG_SEVII_123 547 // MUS_RG_NANA123 (Identical to MUS_RG_PEWTER)
#define MUS_RG_SEVII_DUNGEON 546 // MUS_RG_NANAISEKI // Identical to MUS_RG_VIRIDIAN_FOREST.
#define MUS_RG_SEVII_123 547 // MUS_RG_NANA123 // Identical to MUS_RG_PEWTER
#define MUS_RG_SEVII_45 548 // MUS_RG_NANA45
#define MUS_RG_SEVII_67 549 // MUS_RG_NANA67
#define MUS_RG_POKE_FLUTE 550 // MUS_RG_POKEFUE

View File

@ -27,8 +27,8 @@
/// IDE support
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__INTELLISENSE__)
// We define these when using certain IDEs to fool preproc
#define _(x) (x)
#define __(x) (x)
#define _(x) {x}
#define __(x) {x}
#define INCBIN(...) {0}
#define INCBIN_U8 INCBIN
#define INCBIN_U16 INCBIN

View File

@ -2,6 +2,7 @@
#define GUARD_POKEMON_H
#include "sprite.h"
#include "constants/items.h"
#include "constants/region_map_sections.h"
#include "constants/map_groups.h"
@ -401,7 +402,7 @@ extern const struct BattleMove gBattleMoves[];
extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
extern const struct SpeciesInfo gSpeciesInfo[];
extern const u8 *const gItemEffectTable[];
extern const u8 *const gItemEffectTable[ITEMS_COUNT];
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const struct LevelUpMove *const gLevelUpLearnsets[];
extern const u16 *const gTeachableLearnsets[];

View File

@ -1085,13 +1085,13 @@ static bool8 ShouldUseItem(void)
item = gBattleResources->battleHistory->trainerItems[i];
if (item == ITEM_NONE)
continue;
if (gItemEffectTable[item - ITEM_POTION] == NULL)
if (gItemEffectTable[item] == NULL)
continue;
if (item == ITEM_ENIGMA_BERRY_E_READER)
itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffects = gItemEffectTable[item - ITEM_POTION];
itemEffects = gItemEffectTable[item];
*(gBattleStruct->AI_itemType + gActiveBattler / 2) = GetAI_ItemType(item, itemEffects);

View File

@ -476,8 +476,8 @@ static const u8 sText_PkmnBrokeFree[] = _("Oh, no!\nThe POKéMON broke free!");
static const u8 sText_ItAppearedCaught[] = _("Aww!\nIt appeared to be caught!");
static const u8 sText_AarghAlmostHadIt[] = _("Aargh!\nAlmost had it!");
static const u8 sText_ShootSoClose[] = _("Shoot!\nIt was so close, too!");
static const u8 sText_GotchaPkmnCaught[] = _("Gotcha!\n{B_DEF_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}\p");
static const u8 sText_GotchaPkmnCaught2[] = _("Gotcha!\n{B_DEF_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}{PAUSE 127}");
static const u8 sText_GotchaPkmnCaughtPlayer[] = _("Gotcha!\n{B_DEF_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}\p");
static const u8 sText_GotchaPkmnCaughtWally[] = _("Gotcha!\n{B_DEF_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}{PAUSE 127}");
static const u8 sText_GiveNicknameCaptured[] = _("Give a nickname to the\ncaptured {B_DEF_NAME}?");
static const u8 sText_PkmnSentToPC[] = _("{B_DEF_NAME} was sent to\n{B_PC_CREATOR_NAME} PC.");
static const u8 sText_Someones[] = _("someone's");
@ -1145,8 +1145,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_ITAPPEAREDCAUGHT - BATTLESTRINGS_TABLE_START] = sText_ItAppearedCaught,
[STRINGID_AARGHALMOSTHADIT - BATTLESTRINGS_TABLE_START] = sText_AarghAlmostHadIt,
[STRINGID_SHOOTSOCLOSE - BATTLESTRINGS_TABLE_START] = sText_ShootSoClose,
[STRINGID_GOTCHAPKMNCAUGHT - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaught,
[STRINGID_GOTCHAPKMNCAUGHT2 - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaught2,
[STRINGID_GOTCHAPKMNCAUGHTPLAYER - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaughtPlayer,
[STRINGID_GOTCHAPKMNCAUGHTWALLY - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaughtWally,
[STRINGID_GIVENICKNAMECAPTURED - BATTLESTRINGS_TABLE_START] = sText_GiveNicknameCaptured,
[STRINGID_PKMNSENTTOPC - BATTLESTRINGS_TABLE_START] = sText_PkmnSentToPC,
[STRINGID_PKMNDATAADDEDTODEX - BATTLESTRINGS_TABLE_START] = sText_PkmnDataAddedToDex,

View File

@ -6546,8 +6546,8 @@ bool32 CanBeFrozen(u8 battlerId)
bool32 CanBeConfused(u8 battlerId)
{
if (GetBattlerAbility(gEffectBattler) == ABILITY_OWN_TEMPO
|| gBattleMons[gEffectBattler].status2 & STATUS2_CONFUSION
if (GetBattlerAbility(battlerId) == ABILITY_OWN_TEMPO
|| gBattleMons[battlerId].status2 & STATUS2_CONFUSION
|| IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN))
return FALSE;
return TRUE;
@ -8194,7 +8194,7 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating)
return gBattleStruct->debugHoldEffects[battlerId];
else
#endif
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER)
return gEnigmaBerries[battlerId].holdEffect;
else
return ItemId_GetHoldEffect(gBattleMons[battlerId].item);
@ -8203,7 +8203,7 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating)
//
static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item)
{
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
return gEnigmaBerries[battlerId].holdEffectParam;
else
return ItemId_GetHoldEffectParam(item);
@ -8211,7 +8211,7 @@ static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item)
u32 GetBattlerHoldEffectParam(u8 battlerId)
{
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER)
return gEnigmaBerries[battlerId].holdEffectParam;
else
return ItemId_GetHoldEffectParam(gBattleMons[battlerId].item);

View File

@ -199,7 +199,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move)
holdEffect = gBattleStruct->debugHoldEffects[battlerId];
else
#endif
if (item == ITEM_ENIGMA_BERRY)
if (item == ITEM_ENIGMA_BERRY_E_READER)
return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect;
else
holdEffect = ItemId_GetHoldEffect(item);

View File

@ -447,128 +447,128 @@ const u8 gItemEffect_TamatoBerry[10] = {
EV_BERRY_FRIENDSHIP_CHANGE,
};
const u8 *const gItemEffectTable[] =
const u8 *const gItemEffectTable[ITEMS_COUNT] =
{
// Medicine
[ITEM_POTION - ITEM_POTION] = gItemEffect_Potion,
[ITEM_SUPER_POTION - ITEM_POTION] = gItemEffect_SuperPotion,
[ITEM_HYPER_POTION - ITEM_POTION] = gItemEffect_HyperPotion,
[ITEM_MAX_POTION - ITEM_POTION] = gItemEffect_MaxPotion,
[ITEM_FULL_RESTORE - ITEM_POTION] = gItemEffect_FullRestore,
[ITEM_REVIVE - ITEM_POTION] = gItemEffect_Revive,
[ITEM_MAX_REVIVE - ITEM_POTION] = gItemEffect_MaxRevive,
[ITEM_FRESH_WATER - ITEM_POTION] = gItemEffect_FreshWater,
[ITEM_SODA_POP - ITEM_POTION] = gItemEffect_SodaPop,
[ITEM_LEMONADE - ITEM_POTION] = gItemEffect_Lemonade,
[ITEM_MOOMOO_MILK - ITEM_POTION] = gItemEffect_MoomooMilk,
[ITEM_ENERGY_POWDER - ITEM_POTION] = gItemEffect_EnergyPowder,
[ITEM_ENERGY_ROOT - ITEM_POTION] = gItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER - ITEM_POTION] = gItemEffect_HealPowder,
[ITEM_REVIVAL_HERB - ITEM_POTION] = gItemEffect_RevivalHerb,
[ITEM_ANTIDOTE - ITEM_POTION] = gItemEffect_Antidote,
[ITEM_PARALYZE_HEAL - ITEM_POTION] = gItemEffect_ParalyzeHeal,
[ITEM_BURN_HEAL - ITEM_POTION] = gItemEffect_BurnHeal,
[ITEM_ICE_HEAL - ITEM_POTION] = gItemEffect_IceHeal,
[ITEM_AWAKENING - ITEM_POTION] = gItemEffect_Awakening,
[ITEM_FULL_HEAL - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_ETHER - ITEM_POTION] = gItemEffect_Ether,
[ITEM_MAX_ETHER - ITEM_POTION] = gItemEffect_MaxEther,
[ITEM_ELIXIR - ITEM_POTION] = gItemEffect_Elixir,
[ITEM_MAX_ELIXIR - ITEM_POTION] = gItemEffect_MaxElixir,
[ITEM_BERRY_JUICE - ITEM_POTION] = gItemEffect_BerryJuice,
[ITEM_SACRED_ASH - ITEM_POTION] = gItemEffect_SacredAsh,
[ITEM_SWEET_HEART - ITEM_POTION] = gItemEffect_Potion,
[ITEM_MAX_HONEY - ITEM_POTION] = gItemEffect_MaxRevive,
[ITEM_POTION] = gItemEffect_Potion,
[ITEM_SUPER_POTION] = gItemEffect_SuperPotion,
[ITEM_HYPER_POTION] = gItemEffect_HyperPotion,
[ITEM_MAX_POTION] = gItemEffect_MaxPotion,
[ITEM_FULL_RESTORE] = gItemEffect_FullRestore,
[ITEM_REVIVE] = gItemEffect_Revive,
[ITEM_MAX_REVIVE] = gItemEffect_MaxRevive,
[ITEM_FRESH_WATER] = gItemEffect_FreshWater,
[ITEM_SODA_POP] = gItemEffect_SodaPop,
[ITEM_LEMONADE] = gItemEffect_Lemonade,
[ITEM_MOOMOO_MILK] = gItemEffect_MoomooMilk,
[ITEM_ENERGY_POWDER] = gItemEffect_EnergyPowder,
[ITEM_ENERGY_ROOT] = gItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER] = gItemEffect_HealPowder,
[ITEM_REVIVAL_HERB] = gItemEffect_RevivalHerb,
[ITEM_ANTIDOTE] = gItemEffect_Antidote,
[ITEM_PARALYZE_HEAL] = gItemEffect_ParalyzeHeal,
[ITEM_BURN_HEAL] = gItemEffect_BurnHeal,
[ITEM_ICE_HEAL] = gItemEffect_IceHeal,
[ITEM_AWAKENING] = gItemEffect_Awakening,
[ITEM_FULL_HEAL] = gItemEffect_FullHeal,
[ITEM_ETHER] = gItemEffect_Ether,
[ITEM_MAX_ETHER] = gItemEffect_MaxEther,
[ITEM_ELIXIR] = gItemEffect_Elixir,
[ITEM_MAX_ELIXIR] = gItemEffect_MaxElixir,
[ITEM_BERRY_JUICE] = gItemEffect_BerryJuice,
[ITEM_SACRED_ASH] = gItemEffect_SacredAsh,
[ITEM_SWEET_HEART] = gItemEffect_Potion,
[ITEM_MAX_HONEY] = gItemEffect_MaxRevive,
// Regional Specialties
[ITEM_PEWTER_CRUNCHIES - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_RAGE_CANDY_BAR - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_LAVA_COOKIE - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_OLD_GATEAU - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_CASTELIACONE - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_LUMIOSE_GALETTE - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_SHALOUR_SABLE - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_BIG_MALASADA - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_PEWTER_CRUNCHIES] = gItemEffect_FullHeal,
[ITEM_RAGE_CANDY_BAR] = gItemEffect_FullHeal,
[ITEM_LAVA_COOKIE] = gItemEffect_FullHeal,
[ITEM_OLD_GATEAU] = gItemEffect_FullHeal,
[ITEM_CASTELIACONE] = gItemEffect_FullHeal,
[ITEM_LUMIOSE_GALETTE] = gItemEffect_FullHeal,
[ITEM_SHALOUR_SABLE] = gItemEffect_FullHeal,
[ITEM_BIG_MALASADA] = gItemEffect_FullHeal,
// Vitamins
[ITEM_HP_UP - ITEM_POTION] = gItemEffect_HPUp,
[ITEM_PROTEIN - ITEM_POTION] = gItemEffect_Protein,
[ITEM_IRON - ITEM_POTION] = gItemEffect_Iron,
[ITEM_CALCIUM - ITEM_POTION] = gItemEffect_Calcium,
[ITEM_ZINC - ITEM_POTION] = gItemEffect_Zinc,
[ITEM_CARBOS - ITEM_POTION] = gItemEffect_Carbos,
[ITEM_PP_UP - ITEM_POTION] = gItemEffect_PPUp,
[ITEM_PP_MAX - ITEM_POTION] = gItemEffect_PPMax,
[ITEM_HP_UP] = gItemEffect_HPUp,
[ITEM_PROTEIN] = gItemEffect_Protein,
[ITEM_IRON] = gItemEffect_Iron,
[ITEM_CALCIUM] = gItemEffect_Calcium,
[ITEM_ZINC] = gItemEffect_Zinc,
[ITEM_CARBOS] = gItemEffect_Carbos,
[ITEM_PP_UP] = gItemEffect_PPUp,
[ITEM_PP_MAX] = gItemEffect_PPMax,
// EV Feathers
[ITEM_HEALTH_FEATHER - ITEM_POTION] = gItemEffect_HpFeather,
[ITEM_MUSCLE_FEATHER - ITEM_POTION] = gItemEffect_AtkFeather,
[ITEM_RESIST_FEATHER - ITEM_POTION] = gItemEffect_DefFeather,
[ITEM_GENIUS_FEATHER - ITEM_POTION] = gItemEffect_SpatkFeather,
[ITEM_CLEVER_FEATHER - ITEM_POTION] = gItemEffect_SpdefFeather,
[ITEM_SWIFT_FEATHER - ITEM_POTION] = gItemEffect_SpeedFeather,
[ITEM_HEALTH_FEATHER] = gItemEffect_HpFeather,
[ITEM_MUSCLE_FEATHER] = gItemEffect_AtkFeather,
[ITEM_RESIST_FEATHER] = gItemEffect_DefFeather,
[ITEM_GENIUS_FEATHER] = gItemEffect_SpatkFeather,
[ITEM_CLEVER_FEATHER] = gItemEffect_SpdefFeather,
[ITEM_SWIFT_FEATHER] = gItemEffect_SpeedFeather,
// Candy
[ITEM_RARE_CANDY - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_XS - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_S - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_M - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_L - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_XL - ITEM_POTION] = gItemEffect_RareCandy,
//[ITEM_DYNAMAX_CANDY - ITEM_POTION] = gItemEffect_DynamaxCandy, // Todo
[ITEM_RARE_CANDY] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_XS] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_S] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_M] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_L] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_XL] = gItemEffect_RareCandy,
//[ITEM_DYNAMAX_CANDY] = gItemEffect_DynamaxCandy, // Todo
// Medicinal Flutes
[ITEM_BLUE_FLUTE - ITEM_POTION] = gItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE - ITEM_POTION] = gItemEffect_YellowFlute,
[ITEM_RED_FLUTE - ITEM_POTION] = gItemEffect_RedFlute,
[ITEM_BLUE_FLUTE] = gItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE] = gItemEffect_YellowFlute,
[ITEM_RED_FLUTE] = gItemEffect_RedFlute,
// X Items
[ITEM_X_ATTACK - ITEM_POTION] = gItemEffect_XAttack,
[ITEM_X_DEFENSE - ITEM_POTION] = gItemEffect_XDefense,
[ITEM_X_SPEED - ITEM_POTION] = gItemEffect_XSpeed,
[ITEM_X_ACCURACY - ITEM_POTION] = gItemEffect_XAccuracy,
[ITEM_X_SP_ATK - ITEM_POTION] = gItemEffect_XSpecialAttack,
[ITEM_X_SP_DEF - ITEM_POTION] = gItemEffect_XSpecialDefense,
[ITEM_X_ATTACK] = gItemEffect_XAttack,
[ITEM_X_DEFENSE] = gItemEffect_XDefense,
[ITEM_X_SPEED] = gItemEffect_XSpeed,
[ITEM_X_ACCURACY] = gItemEffect_XAccuracy,
[ITEM_X_SP_ATK] = gItemEffect_XSpecialAttack,
[ITEM_X_SP_DEF] = gItemEffect_XSpecialDefense,
[ITEM_DIRE_HIT - ITEM_POTION] = gItemEffect_DireHit,
[ITEM_GUARD_SPEC - ITEM_POTION] = gItemEffect_GuardSpec,
[ITEM_DIRE_HIT] = gItemEffect_DireHit,
[ITEM_GUARD_SPEC] = gItemEffect_GuardSpec,
//[ITEM_MAX_MUSHROOMS - ITEM_POTION] = gItemEffect_MaxMushrooms, // Todo
//[ITEM_MAX_MUSHROOMS] = gItemEffect_MaxMushrooms, // Todo
// Evolution Items
[ITEM_FIRE_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_WATER_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_THUNDER_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_LEAF_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_ICE_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_SUN_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_MOON_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_SHINY_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_DUSK_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_DAWN_STONE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_SWEET_APPLE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_TART_APPLE - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_CRACKED_POT - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_CHIPPED_POT - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_GALARICA_CUFF - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_GALARICA_WREATH - ITEM_POTION] = gItemEffect_EvoItem,
[ITEM_FIRE_STONE] = gItemEffect_EvoItem,
[ITEM_WATER_STONE] = gItemEffect_EvoItem,
[ITEM_THUNDER_STONE] = gItemEffect_EvoItem,
[ITEM_LEAF_STONE] = gItemEffect_EvoItem,
[ITEM_ICE_STONE] = gItemEffect_EvoItem,
[ITEM_SUN_STONE] = gItemEffect_EvoItem,
[ITEM_MOON_STONE] = gItemEffect_EvoItem,
[ITEM_SHINY_STONE] = gItemEffect_EvoItem,
[ITEM_DUSK_STONE] = gItemEffect_EvoItem,
[ITEM_DAWN_STONE] = gItemEffect_EvoItem,
[ITEM_SWEET_APPLE] = gItemEffect_EvoItem,
[ITEM_TART_APPLE] = gItemEffect_EvoItem,
[ITEM_CRACKED_POT] = gItemEffect_EvoItem,
[ITEM_CHIPPED_POT] = gItemEffect_EvoItem,
[ITEM_GALARICA_CUFF] = gItemEffect_EvoItem,
[ITEM_GALARICA_WREATH] = gItemEffect_EvoItem,
// Berries
[ITEM_CHERI_BERRY - ITEM_POTION] = gItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY - ITEM_POTION] = gItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY - ITEM_POTION] = gItemEffect_PechaBerry,
[ITEM_RAWST_BERRY - ITEM_POTION] = gItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY - ITEM_POTION] = gItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY - ITEM_POTION] = gItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY - ITEM_POTION] = gItemEffect_OranBerry,
[ITEM_PERSIM_BERRY - ITEM_POTION] = gItemEffect_PersimBerry,
[ITEM_LUM_BERRY - ITEM_POTION] = gItemEffect_FullHeal,
[ITEM_SITRUS_BERRY - ITEM_POTION] = gItemEffect_SitrusBerry,
[ITEM_POMEG_BERRY - ITEM_POTION] = gItemEffect_PomegBerry,
[ITEM_KELPSY_BERRY - ITEM_POTION] = gItemEffect_KelpsyBerry,
[ITEM_QUALOT_BERRY - ITEM_POTION] = gItemEffect_QualotBerry,
[ITEM_HONDEW_BERRY - ITEM_POTION] = gItemEffect_HondewBerry,
[ITEM_GREPA_BERRY - ITEM_POTION] = gItemEffect_GrepaBerry,
[ITEM_TAMATO_BERRY - ITEM_POTION] = gItemEffect_TamatoBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
[ITEM_CHERI_BERRY] = gItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY] = gItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY] = gItemEffect_PechaBerry,
[ITEM_RAWST_BERRY] = gItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY] = gItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY] = gItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY] = gItemEffect_OranBerry,
[ITEM_PERSIM_BERRY] = gItemEffect_PersimBerry,
[ITEM_LUM_BERRY] = gItemEffect_FullHeal,
[ITEM_SITRUS_BERRY] = gItemEffect_SitrusBerry,
[ITEM_POMEG_BERRY] = gItemEffect_PomegBerry,
[ITEM_KELPSY_BERRY] = gItemEffect_KelpsyBerry,
[ITEM_QUALOT_BERRY] = gItemEffect_QualotBerry,
[ITEM_HONDEW_BERRY] = gItemEffect_HondewBerry,
[ITEM_GREPA_BERRY] = gItemEffect_GrepaBerry,
[ITEM_TAMATO_BERRY] = gItemEffect_TamatoBerry,
[LAST_BERRY_INDEX] = NULL,
};

File diff suppressed because it is too large Load Diff

View File

@ -1109,7 +1109,7 @@ u16 GetCurrLocationDefaultMusic(void)
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE111)
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE111)
&& GetSavedWeather() == WEATHER_SANDSTORM)
return MUS_ROUTE111;
return MUS_DESERT;
music = GetLocationMusic(&gSaveBlock1Ptr->location);
if (music != MUS_ROUTE118)

View File

@ -4287,7 +4287,10 @@ static bool8 IsHPRecoveryItem(u16 item)
if (item == ITEM_ENIGMA_BERRY_E_READER)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
effect = gItemEffectTable[item - ITEM_POTION];
effect = gItemEffectTable[item];
if (effect == NULL)
return FALSE;
if (effect[4] & ITEM4_HEAL_HP)
return TRUE;
@ -4798,9 +4801,9 @@ void ItemUseCB_PPRecovery(u8 taskId, TaskFunc task)
if (item == ITEM_ENIGMA_BERRY_E_READER)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
effect = gItemEffectTable[item - ITEM_POTION];
effect = gItemEffectTable[item];
if (!(effect[4] & ITEM4_HEAL_PP_ONE))
if (effect == NULL || !(effect[4] & ITEM4_HEAL_PP_ONE))
{
gPartyMenu.data1 = 0;
TryUsePPItem(taskId);
@ -5673,14 +5676,14 @@ u8 GetItemEffectType(u16 item)
const u8 *itemEffect;
u32 statusCure;
if (!ITEM_HAS_EFFECT(item))
return ITEM_EFFECT_NONE;
// Read the item's effect properties.
if (item == ITEM_ENIGMA_BERRY_E_READER)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffect = gItemEffectTable[item - ITEM_POTION];
itemEffect = gItemEffectTable[item];
if (itemEffect == NULL)
return ITEM_EFFECT_NONE;
if ((itemEffect[0] & ITEM0_DIRE_HIT) || itemEffect[1] || (itemEffect[3] & ITEM3_GUARD_SPEC))
return ITEM_EFFECT_X_ITEM;

View File

@ -1919,33 +1919,32 @@ const struct SpindaSpot gSpindaSpotGraphics[] =
#include "data/pokemon/item_effects.h"
const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] =
{
// Atk Def Spd Sp.Atk Sp.Def
[NATURE_HARDY] = { 0, 0, 0, 0, 0},
[NATURE_LONELY] = { +1, -1, 0, 0, 0},
[NATURE_BRAVE] = { +1, 0, -1, 0, 0},
[NATURE_ADAMANT] = { +1, 0, 0, -1, 0},
[NATURE_NAUGHTY] = { +1, 0, 0, 0, -1},
[NATURE_BOLD] = { -1, +1, 0, 0, 0},
[NATURE_DOCILE] = { 0, 0, 0, 0, 0},
[NATURE_RELAXED] = { 0, +1, -1, 0, 0},
[NATURE_IMPISH] = { 0, +1, 0, -1, 0},
[NATURE_LAX] = { 0, +1, 0, 0, -1},
[NATURE_TIMID] = { -1, 0, +1, 0, 0},
[NATURE_HASTY] = { 0, -1, +1, 0, 0},
[NATURE_SERIOUS] = { 0, 0, 0, 0, 0},
[NATURE_JOLLY] = { 0, 0, +1, -1, 0},
[NATURE_NAIVE] = { 0, 0, +1, 0, -1},
[NATURE_MODEST] = { -1, 0, 0, +1, 0},
[NATURE_MILD] = { 0, -1, 0, +1, 0},
[NATURE_QUIET] = { 0, 0, -1, +1, 0},
[NATURE_BASHFUL] = { 0, 0, 0, 0, 0},
[NATURE_RASH] = { 0, 0, 0, +1, -1},
[NATURE_CALM] = { -1, 0, 0, 0, +1},
[NATURE_GENTLE] = { 0, -1, 0, 0, +1},
[NATURE_SASSY] = { 0, 0, -1, 0, +1},
[NATURE_CAREFUL] = { 0, 0, 0, -1, +1},
[NATURE_QUIRKY] = { 0, 0, 0, 0, 0},
{ // Attack Defense Speed Sp.Atk Sp.Def
[NATURE_HARDY] = { 0, 0, 0, 0, 0 },
[NATURE_LONELY] = { +1, -1, 0, 0, 0 },
[NATURE_BRAVE] = { +1, 0, -1, 0, 0 },
[NATURE_ADAMANT] = { +1, 0, 0, -1, 0 },
[NATURE_NAUGHTY] = { +1, 0, 0, 0, -1 },
[NATURE_BOLD] = { -1, +1, 0, 0, 0 },
[NATURE_DOCILE] = { 0, 0, 0, 0, 0 },
[NATURE_RELAXED] = { 0, +1, -1, 0, 0 },
[NATURE_IMPISH] = { 0, +1, 0, -1, 0 },
[NATURE_LAX] = { 0, +1, 0, 0, -1 },
[NATURE_TIMID] = { -1, 0, +1, 0, 0 },
[NATURE_HASTY] = { 0, -1, +1, 0, 0 },
[NATURE_SERIOUS] = { 0, 0, 0, 0, 0 },
[NATURE_JOLLY] = { 0, 0, +1, -1, 0 },
[NATURE_NAIVE] = { 0, 0, +1, 0, -1 },
[NATURE_MODEST] = { -1, 0, 0, +1, 0 },
[NATURE_MILD] = { 0, -1, 0, +1, 0 },
[NATURE_QUIET] = { 0, 0, -1, +1, 0 },
[NATURE_BASHFUL] = { 0, 0, 0, 0, 0 },
[NATURE_RASH] = { 0, 0, 0, +1, -1 },
[NATURE_CALM] = { -1, 0, 0, 0, +1 },
[NATURE_GENTLE] = { 0, -1, 0, 0, +1 },
[NATURE_SASSY] = { 0, 0, -1, 0, +1 },
[NATURE_CAREFUL] = { 0, 0, 0, -1, +1 },
[NATURE_QUIRKY] = { 0, 0, 0, 0, 0 },
};
#include "data/pokemon/trainer_class_lookups.h"
@ -5771,9 +5770,7 @@ 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_E_READER)
if (gItemEffectTable[item] == NULL && item != ITEM_ENIGMA_BERRY_E_READER)
return TRUE;
// Get item effect
@ -5786,7 +5783,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
}
else
{
itemEffect = gItemEffectTable[item - ITEM_POTION];
itemEffect = gItemEffectTable[item];
}
// Do item effect
@ -6340,9 +6337,9 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
offset = ITEM_EFFECT_ARG_START;
temp = gItemEffectTable[itemId - ITEM_POTION];
temp = gItemEffectTable[itemId];
if (!temp && itemId != ITEM_ENIGMA_BERRY_E_READER)
if (temp != NULL && !temp && itemId != ITEM_ENIGMA_BERRY_E_READER)
return 0;
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
@ -6470,7 +6467,7 @@ u8 *UseStatIncreaseItem(u16 itemId)
}
else
{
itemEffect = gItemEffectTable[itemId - ITEM_POTION];
itemEffect = gItemEffectTable[itemId];
}
gPotentialItemEffectBattler = gBattlerInMenuId;
@ -6544,7 +6541,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
partnerSpecies = GetMonData(tradePartner, MON_DATA_SPECIES, 0);
partnerHeldItem = GetMonData(tradePartner, MON_DATA_HELD_ITEM, 0);
if (partnerHeldItem == ITEM_ENIGMA_BERRY)
if (partnerHeldItem == ITEM_ENIGMA_BERRY_E_READER)
partnerHoldEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else
partnerHoldEffect = ItemId_GetHoldEffect(partnerHeldItem);
@ -7214,7 +7211,7 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
u8 bonus;
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

@ -95,3 +95,30 @@ DOUBLE_BATTLE_TEST("Intimidate doesn't activate on an empty field in a double ba
MESSAGE("Foe Arbok's Intimidate cuts Abra's attack!");
}
}
SINGLE_BATTLE_TEST("Intimidate and Eject Button force the opponent to Attack")
{
GIVEN {
ASSUME(gItems[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_HITMONTOP) { Moves(MOVE_TACKLE); };
} WHEN {
TURN {
MOVE(player, MOVE_QUICK_ATTACK);
MOVE(opponent, MOVE_TACKLE);
SEND_OUT(opponent, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
MESSAGE("2 sent out Hitmontop!");
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
MESSAGE("Foe Hitmontop's Intimidate cuts Wobbuffet's attack!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
MESSAGE("Foe Hitmontop used Tackle!");
}
}
}

View File

@ -0,0 +1,189 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON);
}
SINGLE_BATTLE_TEST("Eject Button is not triggered when there is nothing to switch in")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET) { HP(0); };
} WHEN {
TURN {
MOVE(player, MOVE_QUICK_ATTACK);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, player);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}
SINGLE_BATTLE_TEST("Eject Button is not activated by a Sheer Force boosted move")
{
GIVEN {
PLAYER(SPECIES_NIDOKING) { Ability(ABILITY_SHEER_FORCE); };
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_FLAMETHROWER);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_FLAMETHROWER, player);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}
SINGLE_BATTLE_TEST("Eject Button will not activate under Substitute")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_RAICHU) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(opponent, MOVE_SUBSTITUTE);
MOVE(player, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBSTITUTE, opponent);
MESSAGE("Foe Raichu made a SUBSTITUTE!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
MESSAGE("The SUBSTITUTE took damage for Foe Raichu!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Raichu is switched out with the Eject Button!");
}
}
}
SINGLE_BATTLE_TEST("Eject Button is not blocked by trapping abilities or moves")
{
GIVEN {
PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_ARENA_TRAP); };
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_TACKLE);
SEND_OUT(opponent, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
MESSAGE("2 sent out Wobbuffet!");
}
}
SINGLE_BATTLE_TEST("Eject Button is not triggered after the mon loses Eject Button")
{
GIVEN {
PLAYER(SPECIES_RAICHU);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_KNOCK_OFF);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}
SINGLE_BATTLE_TEST("Eject Button is not triggered after given to player by Picketpocket")
{
GIVEN {
PLAYER(SPECIES_REGIELEKI) { Item(ITEM_EJECT_BUTTON); };
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SNEASEL) { Ability(ABILITY_PICKPOCKET); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_TACKLE);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
ABILITY_POPUP(opponent, ABILITY_PICKPOCKET);
MESSAGE("Foe Sneasel stole Regieleki's Eject Button!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}
SINGLE_BATTLE_TEST("Eject Button has no chance to activate after Dragon Tail")
{
GIVEN {
PLAYER(SPECIES_KOMMO_O);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_CHANSEY);
} WHEN {
TURN {
MOVE(player, MOVE_DRAGON_TAIL);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, player);
MESSAGE("Foe Chansey was dragged out!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Chansey is switched out with the Eject Button!");
}
}
}
SINGLE_BATTLE_TEST("Eject Button prevents Volt Switch / U-Turn from activating")
{
GIVEN {
PLAYER(SPECIES_MANECTRIC);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN {
MOVE(player, MOVE_VOLT_SWITCH);
SEND_OUT(opponent, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_VOLT_SWITCH, player);
MESSAGE("Foe Wobbuffet is switched out with the Eject Button!");
}
}
SINGLE_BATTLE_TEST("Eject Button is activated before Emergency Exit")
{
GIVEN {
PLAYER(SPECIES_LATIAS);
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); Item(ITEM_EJECT_BUTTON); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_THUNDERBOLT);
SEND_OUT(opponent, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Golisopod is switched out with the Eject Button!");
}
}