Merge with master

This commit is contained in:
DizzyEggg 2020-04-11 19:48:24 +02:00
commit 060b795d8e
139 changed files with 8405 additions and 8305 deletions

View File

@ -14,8 +14,10 @@ cache:
apt: true
install:
- pushd $HOME
- travis_retry wget https://github.com/devkitPro/buildscripts/releases/download/devkitARM_r50/devkitARM_r50-linux.tar.xz
- travis_retry wget https://github.com/devkitPro/buildscripts/releases/download/devkitARM_r52/devkitARM_r52-linux.tar.xz
- tar xJf devkitARM*.tar.xz
- travis_retry wget https://github.com/devkitPro/devkitarm-rules/releases/download/v1.0.0/devkitarm-rules-1.0.0.tar.xz
- tar xJf devkitarm-rules-*.tar.xz -C $DEVKITARM
- travis_retry git clone https://github.com/pret/agbcc.git
- cd agbcc && ./build.sh && ./install.sh $TRAVIS_BUILD_DIR
- popd

View File

@ -1,2 +1,2 @@
gUnusedPokedexU8
gUnknown_030060B4
gPokedexVBlankCB

View File

@ -3,7 +3,7 @@
"name": "AlteringCave",
"layout": "LAYOUT_ALTERING_CAVE",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_ALTERING_CAVE_2",
"region_map_section": "MAPSEC_ALTERING_CAVE",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "BirthIsland_Exterior",
"layout": "LAYOUT_BIRTH_ISLAND_EXTERIOR",
"music": "MUS_NONE",
"region_map_section": "MAPSEC_BIRTH_ISLAND_2",
"region_map_section": "MAPSEC_BIRTH_ISLAND",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_INDOOR",

View File

@ -3,7 +3,7 @@
"name": "BirthIsland_Harbor",
"layout": "LAYOUT_ISLAND_HARBOR",
"music": "MUS_NONE",
"region_map_section": "MAPSEC_BIRTH_ISLAND_2",
"region_map_section": "MAPSEC_BIRTH_ISLAND",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_INDOOR",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_B1F",
"layout": "LAYOUT_NAVEL_ROCK_B1F",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Bottom",
"layout": "LAYOUT_NAVEL_ROCK_BOTTOM",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down01",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down02",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down03",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down04",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down05",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down06",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down07",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down08",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down09",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down10",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Down11",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Entrance",
"layout": "LAYOUT_NAVEL_ROCK_ENTRANCE",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Exterior",
"layout": "LAYOUT_NAVEL_ROCK_EXTERIOR",
"music": "MUS_RG_NANASHIMA",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_INDOOR",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Fork",
"layout": "LAYOUT_NAVEL_ROCK_FORK",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Harbor",
"layout": "LAYOUT_ISLAND_HARBOR",
"music": "MUS_RG_NANASHIMA",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_INDOOR",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Top",
"layout": "LAYOUT_NAVEL_ROCK_TOP",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_SHADE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Up1",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Up2",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Up3",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM1",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -3,7 +3,7 @@
"name": "NavelRock_Up4",
"layout": "LAYOUT_NAVEL_ROCK_LADDER_ROOM2",
"music": "MUS_RG_NANADUNGEON",
"region_map_section": "MAPSEC_NAVEL_ROCK2",
"region_map_section": "MAPSEC_NAVEL_ROCK",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",

View File

@ -172,7 +172,7 @@ AbnormalWeather_StartGroudonWeather:: @ 8273D1B
AbnormalWeather_EventScript_EndEventAndCleanup_1:: @ 8273D1F
lockall
compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START
compare VAR_ABNORMAL_WEATHER_LOCATION, MARINE_CAVE_LOCATIONS_START
goto_if_ge AbnormalWeather_EventScript_ShowRainEndedMessage
goto AbnormalWeather_EventScript_ShowSunEndedMessage
end

View File

@ -301,7 +301,7 @@ SecretBase_EventScript_PutAwayDecoration:: @ 8275D2E
end
SecretBase_EventScript_PutAwayDecorationLoop:: @ 8275D39
special sub_8129708
special PutAwayDecorationIteration
compare VAR_RESULT, 1
goto_if_eq SecretBase_EventScript_PutAwayDecorationEnd
addvar VAR_0x8004, 1

View File

@ -31,7 +31,7 @@ gSpecials:: @ 81DBA64
def_special GetObjectEventLocalIdByFlag
def_special GetSecretBaseTypeInFrontOfPlayer
def_special SetSecretBaseOwnerGfxId
def_special sub_8129708
def_special PutAwayDecorationIteration
def_special EnterNewlyCreatedSecretBase
def_special SetBattledOwnerFromResult
def_special DoSecretBasePCTurnOffEffect

View File

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 815 B

View File

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 778 B

View File

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 536 B

View File

@ -67,6 +67,7 @@
#define FRONTIER_DOUBLES_PARTY_SIZE 4
#define FRONTIER_MULTI_PARTY_SIZE 2
#define MAX_FRONTIER_PARTY_SIZE FRONTIER_DOUBLES_PARTY_SIZE
#define UNION_ROOM_PARTY_SIZE 2
// string lengths
#define ITEM_NAME_LENGTH 14

View File

@ -175,7 +175,7 @@
#define MAPSEC_SEVII_ISLE_22 0xAB
#define MAPSEC_SEVII_ISLE_23 0xAC
#define MAPSEC_SEVII_ISLE_24 0xAD
#define MAPSEC_NAVEL_ROCK 0xAE
#define MAPSEC_NAVEL_ROCK_FRLG 0xAE
#define MAPSEC_MT_EMBER 0xAF
#define MAPSEC_BERRY_FOREST 0xB0
#define MAPSEC_ICEFALL_CAVE 0xB1
@ -184,11 +184,11 @@
#define MAPSEC_DOTTED_HOLE 0xB4
#define MAPSEC_LOST_CAVE 0xB5
#define MAPSEC_PATTERN_BUSH 0xB6
#define MAPSEC_ALTERING_CAVE 0xB7
#define MAPSEC_ALTERING_CAVE_FRLG 0xB7
#define MAPSEC_TANOBY_CHAMBERS 0xB8
#define MAPSEC_THREE_ISLE_PATH 0xB9
#define MAPSEC_TANOBY_KEY 0xBA
#define MAPSEC_BIRTH_ISLAND 0xBB
#define MAPSEC_BIRTH_ISLAND_FRLG 0xBB
#define MAPSEC_MONEAN_CHAMBER 0xBC
#define MAPSEC_LIPTOO_CHAMBER 0xBD
#define MAPSEC_WEEPTH_CHAMBER 0xBE
@ -201,7 +201,7 @@
#define MAPSEC_AQUA_HIDEOUT 0xC5
#define MAPSEC_MAGMA_HIDEOUT 0xC6
#define MAPSEC_MIRAGE_TOWER 0xC7
#define MAPSEC_BIRTH_ISLAND_2 0xC8
#define MAPSEC_BIRTH_ISLAND 0xC8
#define MAPSEC_FARAWAY_ISLAND 0xC9
#define MAPSEC_ARTISAN_CAVE 0xCA
#define MAPSEC_MARINE_CAVE 0xCB
@ -211,8 +211,8 @@
#define MAPSEC_UNDERWATER_UNK1 0xCF
#define MAPSEC_UNDERWATER_129 0xD0
#define MAPSEC_DESERT_UNDERPASS 0xD1
#define MAPSEC_ALTERING_CAVE_2 0xD2
#define MAPSEC_NAVEL_ROCK2 0xD3
#define MAPSEC_ALTERING_CAVE 0xD2
#define MAPSEC_NAVEL_ROCK 0xD3
#define MAPSEC_TRAINER_HILL 0xD4
#define MAPSEC_NONE 0xD5

View File

@ -601,6 +601,9 @@
#define NATIONAL_DEX_DRAGONITE 149
#define NATIONAL_DEX_MEWTWO 150
#define NATIONAL_DEX_MEW 151
#define KANTO_DEX_COUNT NATIONAL_DEX_MEW
#define NATIONAL_DEX_CHIKORITA 152
#define NATIONAL_DEX_BAYLEEF 153
#define NATIONAL_DEX_MEGANIUM 154
@ -702,6 +705,146 @@
#define NATIONAL_DEX_HO_OH 250
#define NATIONAL_DEX_CELEBI 251
#define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI
#define NATIONAL_DEX_TREECKO 252
#define NATIONAL_DEX_GROVYLE 253
#define NATIONAL_DEX_SCEPTILE 254
#define NATIONAL_DEX_TORCHIC 255
#define NATIONAL_DEX_COMBUSKEN 256
#define NATIONAL_DEX_BLAZIKEN 257
#define NATIONAL_DEX_MUDKIP 258
#define NATIONAL_DEX_MARSHTOMP 259
#define NATIONAL_DEX_SWAMPERT 260
#define NATIONAL_DEX_POOCHYENA 261
#define NATIONAL_DEX_MIGHTYENA 262
#define NATIONAL_DEX_ZIGZAGOON 263
#define NATIONAL_DEX_LINOONE 264
#define NATIONAL_DEX_WURMPLE 265
#define NATIONAL_DEX_SILCOON 266
#define NATIONAL_DEX_BEAUTIFLY 267
#define NATIONAL_DEX_CASCOON 268
#define NATIONAL_DEX_DUSTOX 269
#define NATIONAL_DEX_LOTAD 270
#define NATIONAL_DEX_LOMBRE 271
#define NATIONAL_DEX_LUDICOLO 272
#define NATIONAL_DEX_SEEDOT 273
#define NATIONAL_DEX_NUZLEAF 274
#define NATIONAL_DEX_SHIFTRY 275
#define NATIONAL_DEX_TAILLOW 276
#define NATIONAL_DEX_SWELLOW 277
#define NATIONAL_DEX_WINGULL 278
#define NATIONAL_DEX_PELIPPER 279
#define NATIONAL_DEX_RALTS 280
#define NATIONAL_DEX_KIRLIA 281
#define NATIONAL_DEX_GARDEVOIR 282
#define NATIONAL_DEX_SURSKIT 283
#define NATIONAL_DEX_MASQUERAIN 284
#define NATIONAL_DEX_SHROOMISH 285
#define NATIONAL_DEX_BRELOOM 286
#define NATIONAL_DEX_SLAKOTH 287
#define NATIONAL_DEX_VIGOROTH 288
#define NATIONAL_DEX_SLAKING 289
#define NATIONAL_DEX_NINCADA 290
#define NATIONAL_DEX_NINJASK 291
#define NATIONAL_DEX_SHEDINJA 292
#define NATIONAL_DEX_WHISMUR 293
#define NATIONAL_DEX_LOUDRED 294
#define NATIONAL_DEX_EXPLOUD 295
#define NATIONAL_DEX_MAKUHITA 296
#define NATIONAL_DEX_HARIYAMA 297
#define NATIONAL_DEX_AZURILL 298
#define NATIONAL_DEX_NOSEPASS 299
#define NATIONAL_DEX_SKITTY 300
#define NATIONAL_DEX_DELCATTY 301
#define NATIONAL_DEX_SABLEYE 302
#define NATIONAL_DEX_MAWILE 303
#define NATIONAL_DEX_ARON 304
#define NATIONAL_DEX_LAIRON 305
#define NATIONAL_DEX_AGGRON 306
#define NATIONAL_DEX_MEDITITE 307
#define NATIONAL_DEX_MEDICHAM 308
#define NATIONAL_DEX_ELECTRIKE 309
#define NATIONAL_DEX_MANECTRIC 310
#define NATIONAL_DEX_PLUSLE 311
#define NATIONAL_DEX_MINUN 312
#define NATIONAL_DEX_VOLBEAT 313
#define NATIONAL_DEX_ILLUMISE 314
#define NATIONAL_DEX_ROSELIA 315
#define NATIONAL_DEX_GULPIN 316
#define NATIONAL_DEX_SWALOT 317
#define NATIONAL_DEX_CARVANHA 318
#define NATIONAL_DEX_SHARPEDO 319
#define NATIONAL_DEX_WAILMER 320
#define NATIONAL_DEX_WAILORD 321
#define NATIONAL_DEX_NUMEL 322
#define NATIONAL_DEX_CAMERUPT 323
#define NATIONAL_DEX_TORKOAL 324
#define NATIONAL_DEX_SPOINK 325
#define NATIONAL_DEX_GRUMPIG 326
#define NATIONAL_DEX_SPINDA 327
#define NATIONAL_DEX_TRAPINCH 328
#define NATIONAL_DEX_VIBRAVA 329
#define NATIONAL_DEX_FLYGON 330
#define NATIONAL_DEX_CACNEA 331
#define NATIONAL_DEX_CACTURNE 332
#define NATIONAL_DEX_SWABLU 333
#define NATIONAL_DEX_ALTARIA 334
#define NATIONAL_DEX_ZANGOOSE 335
#define NATIONAL_DEX_SEVIPER 336
#define NATIONAL_DEX_LUNATONE 337
#define NATIONAL_DEX_SOLROCK 338
#define NATIONAL_DEX_BARBOACH 339
#define NATIONAL_DEX_WHISCASH 340
#define NATIONAL_DEX_CORPHISH 341
#define NATIONAL_DEX_CRAWDAUNT 342
#define NATIONAL_DEX_BALTOY 343
#define NATIONAL_DEX_CLAYDOL 344
#define NATIONAL_DEX_LILEEP 345
#define NATIONAL_DEX_CRADILY 346
#define NATIONAL_DEX_ANORITH 347
#define NATIONAL_DEX_ARMALDO 348
#define NATIONAL_DEX_FEEBAS 349
#define NATIONAL_DEX_MILOTIC 350
#define NATIONAL_DEX_CASTFORM 351
#define NATIONAL_DEX_KECLEON 352
#define NATIONAL_DEX_SHUPPET 353
#define NATIONAL_DEX_BANETTE 354
#define NATIONAL_DEX_DUSKULL 355
#define NATIONAL_DEX_DUSCLOPS 356
#define NATIONAL_DEX_TROPIUS 357
#define NATIONAL_DEX_CHIMECHO 358
#define NATIONAL_DEX_ABSOL 359
#define NATIONAL_DEX_WYNAUT 360
#define NATIONAL_DEX_SNORUNT 361
#define NATIONAL_DEX_GLALIE 362
#define NATIONAL_DEX_SPHEAL 363
#define NATIONAL_DEX_SEALEO 364
#define NATIONAL_DEX_WALREIN 365
#define NATIONAL_DEX_CLAMPERL 366
#define NATIONAL_DEX_HUNTAIL 367
#define NATIONAL_DEX_GOREBYSS 368
#define NATIONAL_DEX_RELICANTH 369
#define NATIONAL_DEX_LUVDISC 370
#define NATIONAL_DEX_BAGON 371
#define NATIONAL_DEX_SHELGON 372
#define NATIONAL_DEX_SALAMENCE 373
#define NATIONAL_DEX_BELDUM 374
#define NATIONAL_DEX_METANG 375
#define NATIONAL_DEX_METAGROSS 376
#define NATIONAL_DEX_REGIROCK 377
#define NATIONAL_DEX_REGICE 378
#define NATIONAL_DEX_REGISTEEL 379
#define NATIONAL_DEX_LATIAS 380
#define NATIONAL_DEX_LATIOS 381
#define NATIONAL_DEX_KYOGRE 382
#define NATIONAL_DEX_GROUDON 383
#define NATIONAL_DEX_RAYQUAZA 384
#define NATIONAL_DEX_JIRACHI 385
#define NATIONAL_DEX_DEOXYS 386
#define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS
#define NATIONAL_DEX_OLD_UNOWN_B 387
#define NATIONAL_DEX_OLD_UNOWN_C 388
#define NATIONAL_DEX_OLD_UNOWN_D 389
@ -728,145 +871,214 @@
#define NATIONAL_DEX_OLD_UNOWN_Y 410
#define NATIONAL_DEX_OLD_UNOWN_Z 411
#define NATIONAL_DEX_TREECKO 252
#define NATIONAL_DEX_GROVYLE 253
#define NATIONAL_DEX_SCEPTILE 254
#define NATIONAL_DEX_TORCHIC 255
#define NATIONAL_DEX_COMBUSKEN 256
#define NATIONAL_DEX_BLAZIKEN 257
#define NATIONAL_DEX_MUDKIP 258
#define NATIONAL_DEX_MARSHTOMP 259
#define NATIONAL_DEX_SWAMPERT 260
#define NATIONAL_DEX_POOCHYENA 261
#define NATIONAL_DEX_MIGHTYENA 262
#define NATIONAL_DEX_ZIGZAGOON 263
#define NATIONAL_DEX_LINOONE 264
#define NATIONAL_DEX_WURMPLE 265
#define NATIONAL_DEX_SILCOON 266
#define NATIONAL_DEX_BEAUTIFLY 267
#define NATIONAL_DEX_CASCOON 268
#define NATIONAL_DEX_DUSTOX 269
#define NATIONAL_DEX_LOTAD 270
#define NATIONAL_DEX_LOMBRE 271
#define NATIONAL_DEX_LUDICOLO 272
#define NATIONAL_DEX_SEEDOT 273
#define NATIONAL_DEX_NUZLEAF 274
#define NATIONAL_DEX_SHIFTRY 275
#define NATIONAL_DEX_NINCADA 290
#define NATIONAL_DEX_NINJASK 291
#define NATIONAL_DEX_SHEDINJA 292
#define NATIONAL_DEX_TAILLOW 276
#define NATIONAL_DEX_SWELLOW 277
#define NATIONAL_DEX_SHROOMISH 285
#define NATIONAL_DEX_BRELOOM 286
#define NATIONAL_DEX_SPINDA 327
#define NATIONAL_DEX_WINGULL 278
#define NATIONAL_DEX_PELIPPER 279
#define NATIONAL_DEX_SURSKIT 283
#define NATIONAL_DEX_MASQUERAIN 284
#define NATIONAL_DEX_WAILMER 320
#define NATIONAL_DEX_WAILORD 321
#define NATIONAL_DEX_SKITTY 300
#define NATIONAL_DEX_DELCATTY 301
#define NATIONAL_DEX_KECLEON 352
#define NATIONAL_DEX_BALTOY 343
#define NATIONAL_DEX_CLAYDOL 344
#define NATIONAL_DEX_NOSEPASS 299
#define NATIONAL_DEX_TORKOAL 324
#define NATIONAL_DEX_SABLEYE 302
#define NATIONAL_DEX_BARBOACH 339
#define NATIONAL_DEX_WHISCASH 340
#define NATIONAL_DEX_LUVDISC 370
#define NATIONAL_DEX_CORPHISH 341
#define NATIONAL_DEX_CRAWDAUNT 342
#define NATIONAL_DEX_FEEBAS 349
#define NATIONAL_DEX_MILOTIC 350
#define NATIONAL_DEX_CARVANHA 318
#define NATIONAL_DEX_SHARPEDO 319
#define NATIONAL_DEX_TRAPINCH 328
#define NATIONAL_DEX_VIBRAVA 329
#define NATIONAL_DEX_FLYGON 330
#define NATIONAL_DEX_MAKUHITA 296
#define NATIONAL_DEX_HARIYAMA 297
#define NATIONAL_DEX_ELECTRIKE 309
#define NATIONAL_DEX_MANECTRIC 310
#define NATIONAL_DEX_NUMEL 322
#define NATIONAL_DEX_CAMERUPT 323
#define NATIONAL_DEX_SPHEAL 363
#define NATIONAL_DEX_SEALEO 364
#define NATIONAL_DEX_WALREIN 365
#define NATIONAL_DEX_CACNEA 331
#define NATIONAL_DEX_CACTURNE 332
#define NATIONAL_DEX_SNORUNT 361
#define NATIONAL_DEX_GLALIE 362
#define NATIONAL_DEX_LUNATONE 337
#define NATIONAL_DEX_SOLROCK 338
#define NATIONAL_DEX_AZURILL 298
#define NATIONAL_DEX_SPOINK 325
#define NATIONAL_DEX_GRUMPIG 326
#define NATIONAL_DEX_PLUSLE 311
#define NATIONAL_DEX_MINUN 312
#define NATIONAL_DEX_MAWILE 303
#define NATIONAL_DEX_MEDITITE 307
#define NATIONAL_DEX_MEDICHAM 308
#define NATIONAL_DEX_SWABLU 333
#define NATIONAL_DEX_ALTARIA 334
#define NATIONAL_DEX_WYNAUT 360
#define NATIONAL_DEX_DUSKULL 355
#define NATIONAL_DEX_DUSCLOPS 356
#define NATIONAL_DEX_ROSELIA 315
#define NATIONAL_DEX_SLAKOTH 287
#define NATIONAL_DEX_VIGOROTH 288
#define NATIONAL_DEX_SLAKING 289
#define NATIONAL_DEX_GULPIN 316
#define NATIONAL_DEX_SWALOT 317
#define NATIONAL_DEX_TROPIUS 357
#define NATIONAL_DEX_WHISMUR 293
#define NATIONAL_DEX_LOUDRED 294
#define NATIONAL_DEX_EXPLOUD 295
#define NATIONAL_DEX_CLAMPERL 366
#define NATIONAL_DEX_HUNTAIL 367
#define NATIONAL_DEX_GOREBYSS 368
#define NATIONAL_DEX_ABSOL 359
#define NATIONAL_DEX_SHUPPET 353
#define NATIONAL_DEX_BANETTE 354
#define NATIONAL_DEX_SEVIPER 336
#define NATIONAL_DEX_ZANGOOSE 335
#define NATIONAL_DEX_RELICANTH 369
#define NATIONAL_DEX_ARON 304
#define NATIONAL_DEX_LAIRON 305
#define NATIONAL_DEX_AGGRON 306
#define NATIONAL_DEX_CASTFORM 351
#define NATIONAL_DEX_VOLBEAT 313
#define NATIONAL_DEX_ILLUMISE 314
#define NATIONAL_DEX_LILEEP 345
#define NATIONAL_DEX_CRADILY 346
#define NATIONAL_DEX_ANORITH 347
#define NATIONAL_DEX_ARMALDO 348
#define NATIONAL_DEX_RALTS 280
#define NATIONAL_DEX_KIRLIA 281
#define NATIONAL_DEX_GARDEVOIR 282
#define NATIONAL_DEX_BAGON 371
#define NATIONAL_DEX_SHELGON 372
#define NATIONAL_DEX_SALAMENCE 373
#define NATIONAL_DEX_BELDUM 374
#define NATIONAL_DEX_METANG 375
#define NATIONAL_DEX_METAGROSS 376
#define NATIONAL_DEX_REGIROCK 377
#define NATIONAL_DEX_REGICE 378
#define NATIONAL_DEX_REGISTEEL 379
#define NATIONAL_DEX_KYOGRE 382
#define NATIONAL_DEX_GROUDON 383
#define NATIONAL_DEX_RAYQUAZA 384
#define NATIONAL_DEX_LATIAS 380
#define NATIONAL_DEX_LATIOS 381
#define NATIONAL_DEX_JIRACHI 385
#define NATIONAL_DEX_DEOXYS 386
#define NATIONAL_DEX_CHIMECHO 358
// Hoenn Dex Index Defines
#define HOENN_DEX_NONE 0
#define HOENN_DEX_TREECKO 1
#define HOENN_DEX_GROVYLE 2
#define HOENN_DEX_SCEPTILE 3
#define HOENN_DEX_TORCHIC 4
#define HOENN_DEX_COMBUSKEN 5
#define HOENN_DEX_BLAZIKEN 6
#define HOENN_DEX_MUDKIP 7
#define HOENN_DEX_MARSHTOMP 8
#define HOENN_DEX_SWAMPERT 9
#define HOENN_DEX_POOCHYENA 10
#define HOENN_DEX_MIGHTYENA 11
#define HOENN_DEX_ZIGZAGOON 12
#define HOENN_DEX_LINOONE 13
#define HOENN_DEX_WURMPLE 14
#define HOENN_DEX_SILCOON 15
#define HOENN_DEX_BEAUTIFLY 16
#define HOENN_DEX_CASCOON 17
#define HOENN_DEX_DUSTOX 18
#define HOENN_DEX_LOTAD 19
#define HOENN_DEX_LOMBRE 20
#define HOENN_DEX_LUDICOLO 21
#define HOENN_DEX_SEEDOT 22
#define HOENN_DEX_NUZLEAF 23
#define HOENN_DEX_SHIFTRY 24
#define HOENN_DEX_TAILLOW 25
#define HOENN_DEX_SWELLOW 26
#define HOENN_DEX_WINGULL 27
#define HOENN_DEX_PELIPPER 28
#define HOENN_DEX_RALTS 29
#define HOENN_DEX_KIRLIA 30
#define HOENN_DEX_GARDEVOIR 31
#define HOENN_DEX_SURSKIT 32
#define HOENN_DEX_MASQUERAIN 33
#define HOENN_DEX_SHROOMISH 34
#define HOENN_DEX_BRELOOM 35
#define HOENN_DEX_SLAKOTH 36
#define HOENN_DEX_VIGOROTH 37
#define HOENN_DEX_SLAKING 38
#define HOENN_DEX_ABRA 39
#define HOENN_DEX_KADABRA 40
#define HOENN_DEX_ALAKAZAM 41
#define HOENN_DEX_NINCADA 42
#define HOENN_DEX_NINJASK 43
#define HOENN_DEX_SHEDINJA 44
#define HOENN_DEX_WHISMUR 45
#define HOENN_DEX_LOUDRED 46
#define HOENN_DEX_EXPLOUD 47
#define HOENN_DEX_MAKUHITA 48
#define HOENN_DEX_HARIYAMA 49
#define HOENN_DEX_GOLDEEN 50
#define HOENN_DEX_SEAKING 51
#define HOENN_DEX_MAGIKARP 52
#define HOENN_DEX_GYARADOS 53
#define HOENN_DEX_AZURILL 54
#define HOENN_DEX_MARILL 55
#define HOENN_DEX_AZUMARILL 56
#define HOENN_DEX_GEODUDE 57
#define HOENN_DEX_GRAVELER 58
#define HOENN_DEX_GOLEM 59
#define HOENN_DEX_NOSEPASS 60
#define HOENN_DEX_SKITTY 61
#define HOENN_DEX_DELCATTY 62
#define HOENN_DEX_ZUBAT 63
#define HOENN_DEX_GOLBAT 64
#define HOENN_DEX_CROBAT 65
#define HOENN_DEX_TENTACOOL 66
#define HOENN_DEX_TENTACRUEL 67
#define HOENN_DEX_SABLEYE 68
#define HOENN_DEX_MAWILE 69
#define HOENN_DEX_ARON 70
#define HOENN_DEX_LAIRON 71
#define HOENN_DEX_AGGRON 72
#define HOENN_DEX_MACHOP 73
#define HOENN_DEX_MACHOKE 74
#define HOENN_DEX_MACHAMP 75
#define HOENN_DEX_MEDITITE 76
#define HOENN_DEX_MEDICHAM 77
#define HOENN_DEX_ELECTRIKE 78
#define HOENN_DEX_MANECTRIC 79
#define HOENN_DEX_PLUSLE 80
#define HOENN_DEX_MINUN 81
#define HOENN_DEX_MAGNEMITE 82
#define HOENN_DEX_MAGNETON 83
#define HOENN_DEX_VOLTORB 84
#define HOENN_DEX_ELECTRODE 85
#define HOENN_DEX_VOLBEAT 86
#define HOENN_DEX_ILLUMISE 87
#define HOENN_DEX_ODDISH 88
#define HOENN_DEX_GLOOM 89
#define HOENN_DEX_VILEPLUME 90
#define HOENN_DEX_BELLOSSOM 91
#define HOENN_DEX_DODUO 92
#define HOENN_DEX_DODRIO 93
#define HOENN_DEX_ROSELIA 94
#define HOENN_DEX_GULPIN 95
#define HOENN_DEX_SWALOT 96
#define HOENN_DEX_CARVANHA 97
#define HOENN_DEX_SHARPEDO 98
#define HOENN_DEX_WAILMER 99
#define HOENN_DEX_WAILORD 100
#define HOENN_DEX_NUMEL 101
#define HOENN_DEX_CAMERUPT 102
#define HOENN_DEX_SLUGMA 103
#define HOENN_DEX_MAGCARGO 104
#define HOENN_DEX_TORKOAL 105
#define HOENN_DEX_GRIMER 106
#define HOENN_DEX_MUK 107
#define HOENN_DEX_KOFFING 108
#define HOENN_DEX_WEEZING 109
#define HOENN_DEX_SPOINK 110
#define HOENN_DEX_GRUMPIG 111
#define HOENN_DEX_SANDSHREW 112
#define HOENN_DEX_SANDSLASH 113
#define HOENN_DEX_SPINDA 114
#define HOENN_DEX_SKARMORY 115
#define HOENN_DEX_TRAPINCH 116
#define HOENN_DEX_VIBRAVA 117
#define HOENN_DEX_FLYGON 118
#define HOENN_DEX_CACNEA 119
#define HOENN_DEX_CACTURNE 120
#define HOENN_DEX_SWABLU 121
#define HOENN_DEX_ALTARIA 122
#define HOENN_DEX_ZANGOOSE 123
#define HOENN_DEX_SEVIPER 124
#define HOENN_DEX_LUNATONE 125
#define HOENN_DEX_SOLROCK 126
#define HOENN_DEX_BARBOACH 127
#define HOENN_DEX_WHISCASH 128
#define HOENN_DEX_CORPHISH 129
#define HOENN_DEX_CRAWDAUNT 130
#define HOENN_DEX_BALTOY 131
#define HOENN_DEX_CLAYDOL 132
#define HOENN_DEX_LILEEP 133
#define HOENN_DEX_CRADILY 134
#define HOENN_DEX_ANORITH 135
#define HOENN_DEX_ARMALDO 136
#define HOENN_DEX_IGGLYBUFF 137
#define HOENN_DEX_JIGGLYPUFF 138
#define HOENN_DEX_WIGGLYTUFF 139
#define HOENN_DEX_FEEBAS 140
#define HOENN_DEX_MILOTIC 141
#define HOENN_DEX_CASTFORM 142
#define HOENN_DEX_STARYU 143
#define HOENN_DEX_STARMIE 144
#define HOENN_DEX_KECLEON 145
#define HOENN_DEX_SHUPPET 146
#define HOENN_DEX_BANETTE 147
#define HOENN_DEX_DUSKULL 148
#define HOENN_DEX_DUSCLOPS 149
#define HOENN_DEX_TROPIUS 150
#define HOENN_DEX_CHIMECHO 151
#define HOENN_DEX_ABSOL 152
#define HOENN_DEX_VULPIX 153
#define HOENN_DEX_NINETALES 154
#define HOENN_DEX_PICHU 155
#define HOENN_DEX_PIKACHU 156
#define HOENN_DEX_RAICHU 157
#define HOENN_DEX_PSYDUCK 158
#define HOENN_DEX_GOLDUCK 159
#define HOENN_DEX_WYNAUT 160
#define HOENN_DEX_WOBBUFFET 161
#define HOENN_DEX_NATU 162
#define HOENN_DEX_XATU 163
#define HOENN_DEX_GIRAFARIG 164
#define HOENN_DEX_PHANPY 165
#define HOENN_DEX_DONPHAN 166
#define HOENN_DEX_PINSIR 167
#define HOENN_DEX_HERACROSS 168
#define HOENN_DEX_RHYHORN 169
#define HOENN_DEX_RHYDON 170
#define HOENN_DEX_SNORUNT 171
#define HOENN_DEX_GLALIE 172
#define HOENN_DEX_SPHEAL 173
#define HOENN_DEX_SEALEO 174
#define HOENN_DEX_WALREIN 175
#define HOENN_DEX_CLAMPERL 176
#define HOENN_DEX_HUNTAIL 177
#define HOENN_DEX_GOREBYSS 178
#define HOENN_DEX_RELICANTH 179
#define HOENN_DEX_CORSOLA 180
#define HOENN_DEX_CHINCHOU 181
#define HOENN_DEX_LANTURN 182
#define HOENN_DEX_LUVDISC 183
#define HOENN_DEX_HORSEA 184
#define HOENN_DEX_SEADRA 185
#define HOENN_DEX_KINGDRA 186
#define HOENN_DEX_BAGON 187
#define HOENN_DEX_SHELGON 188
#define HOENN_DEX_SALAMENCE 189
#define HOENN_DEX_BELDUM 190
#define HOENN_DEX_METANG 191
#define HOENN_DEX_METAGROSS 192
#define HOENN_DEX_REGIROCK 193
#define HOENN_DEX_REGICE 194
#define HOENN_DEX_REGISTEEL 195
#define HOENN_DEX_LATIAS 196
#define HOENN_DEX_LATIOS 197
#define HOENN_DEX_KYOGRE 198
#define HOENN_DEX_GROUDON 199
#define HOENN_DEX_RAYQUAZA 200
#define HOENN_DEX_JIRACHI 201
#define HOENN_DEX_DEOXYS 202
#define HOENN_DEX_COUNT HOENN_DEX_DEOXYS
#define HOENN_DEX_BULBASAUR 203
#define HOENN_DEX_IVYSAUR 204
#define HOENN_DEX_VENUSAUR 205
@ -891,10 +1103,6 @@
#define HOENN_DEX_FEAROW 224
#define HOENN_DEX_EKANS 225
#define HOENN_DEX_ARBOK 226
#define HOENN_DEX_PIKACHU 156
#define HOENN_DEX_RAICHU 157
#define HOENN_DEX_SANDSHREW 112
#define HOENN_DEX_SANDSLASH 113
#define HOENN_DEX_NIDORAN_F 227
#define HOENN_DEX_NIDORINA 228
#define HOENN_DEX_NIDOQUEEN 229
@ -903,15 +1111,6 @@
#define HOENN_DEX_NIDOKING 232
#define HOENN_DEX_CLEFAIRY 233
#define HOENN_DEX_CLEFABLE 234
#define HOENN_DEX_VULPIX 153
#define HOENN_DEX_NINETALES 154
#define HOENN_DEX_JIGGLYPUFF 138
#define HOENN_DEX_WIGGLYTUFF 139
#define HOENN_DEX_ZUBAT 63
#define HOENN_DEX_GOLBAT 64
#define HOENN_DEX_ODDISH 88
#define HOENN_DEX_GLOOM 89
#define HOENN_DEX_VILEPLUME 90
#define HOENN_DEX_PARAS 235
#define HOENN_DEX_PARASECT 236
#define HOENN_DEX_VENONAT 237
@ -920,8 +1119,6 @@
#define HOENN_DEX_DUGTRIO 240
#define HOENN_DEX_MEOWTH 241
#define HOENN_DEX_PERSIAN 242
#define HOENN_DEX_PSYDUCK 158
#define HOENN_DEX_GOLDUCK 159
#define HOENN_DEX_MANKEY 243
#define HOENN_DEX_PRIMEAPE 244
#define HOENN_DEX_GROWLITHE 245
@ -929,33 +1126,16 @@
#define HOENN_DEX_POLIWAG 247
#define HOENN_DEX_POLIWHIRL 248
#define HOENN_DEX_POLIWRATH 249
#define HOENN_DEX_ABRA 39
#define HOENN_DEX_KADABRA 40
#define HOENN_DEX_ALAKAZAM 41
#define HOENN_DEX_MACHOP 73
#define HOENN_DEX_MACHOKE 74
#define HOENN_DEX_MACHAMP 75
#define HOENN_DEX_BELLSPROUT 250
#define HOENN_DEX_WEEPINBELL 251
#define HOENN_DEX_VICTREEBEL 252
#define HOENN_DEX_TENTACOOL 66
#define HOENN_DEX_TENTACRUEL 67
#define HOENN_DEX_GEODUDE 57
#define HOENN_DEX_GRAVELER 58
#define HOENN_DEX_GOLEM 59
#define HOENN_DEX_PONYTA 253
#define HOENN_DEX_RAPIDASH 254
#define HOENN_DEX_SLOWPOKE 255
#define HOENN_DEX_SLOWBRO 256
#define HOENN_DEX_MAGNEMITE 82
#define HOENN_DEX_MAGNETON 83
#define HOENN_DEX_FARFETCHD 257
#define HOENN_DEX_DODUO 92
#define HOENN_DEX_DODRIO 93
#define HOENN_DEX_SEEL 258
#define HOENN_DEX_DEWGONG 259
#define HOENN_DEX_GRIMER 106
#define HOENN_DEX_MUK 107
#define HOENN_DEX_SHELLDER 260
#define HOENN_DEX_CLOYSTER 261
#define HOENN_DEX_GASTLY 262
@ -966,8 +1146,6 @@
#define HOENN_DEX_HYPNO 267
#define HOENN_DEX_KRABBY 268
#define HOENN_DEX_KINGLER 269
#define HOENN_DEX_VOLTORB 84
#define HOENN_DEX_ELECTRODE 85
#define HOENN_DEX_EXEGGCUTE 270
#define HOENN_DEX_EXEGGUTOR 271
#define HOENN_DEX_CUBONE 272
@ -975,28 +1153,15 @@
#define HOENN_DEX_HITMONLEE 274
#define HOENN_DEX_HITMONCHAN 275
#define HOENN_DEX_LICKITUNG 276
#define HOENN_DEX_KOFFING 108
#define HOENN_DEX_WEEZING 109
#define HOENN_DEX_RHYHORN 169
#define HOENN_DEX_RHYDON 170
#define HOENN_DEX_CHANSEY 277
#define HOENN_DEX_TANGELA 278
#define HOENN_DEX_KANGASKHAN 279
#define HOENN_DEX_HORSEA 184
#define HOENN_DEX_SEADRA 185
#define HOENN_DEX_GOLDEEN 50
#define HOENN_DEX_SEAKING 51
#define HOENN_DEX_STARYU 143
#define HOENN_DEX_STARMIE 144
#define HOENN_DEX_MR_MIME 280
#define HOENN_DEX_SCYTHER 281
#define HOENN_DEX_JYNX 282
#define HOENN_DEX_ELECTABUZZ 283
#define HOENN_DEX_MAGMAR 284
#define HOENN_DEX_PINSIR 167
#define HOENN_DEX_TAUROS 285
#define HOENN_DEX_MAGIKARP 52
#define HOENN_DEX_GYARADOS 53
#define HOENN_DEX_LAPRAS 286
#define HOENN_DEX_DITTO 287
#define HOENN_DEX_EEVEE 288
@ -1035,22 +1200,12 @@
#define HOENN_DEX_LEDIAN 321
#define HOENN_DEX_SPINARAK 322
#define HOENN_DEX_ARIADOS 323
#define HOENN_DEX_CROBAT 65
#define HOENN_DEX_CHINCHOU 181
#define HOENN_DEX_LANTURN 182
#define HOENN_DEX_PICHU 155
#define HOENN_DEX_CLEFFA 324
#define HOENN_DEX_IGGLYBUFF 137
#define HOENN_DEX_TOGEPI 325
#define HOENN_DEX_TOGETIC 326
#define HOENN_DEX_NATU 162
#define HOENN_DEX_XATU 163
#define HOENN_DEX_MAREEP 327
#define HOENN_DEX_FLAAFFY 328
#define HOENN_DEX_AMPHAROS 329
#define HOENN_DEX_BELLOSSOM 91
#define HOENN_DEX_MARILL 55
#define HOENN_DEX_AZUMARILL 56
#define HOENN_DEX_SUDOWOODO 330
#define HOENN_DEX_POLITOED 331
#define HOENN_DEX_HOPPIP 332
@ -1068,8 +1223,6 @@
#define HOENN_DEX_SLOWKING 344
#define HOENN_DEX_MISDREAVUS 345
#define HOENN_DEX_UNOWN 346
#define HOENN_DEX_WOBBUFFET 161
#define HOENN_DEX_GIRAFARIG 164
#define HOENN_DEX_PINECO 347
#define HOENN_DEX_FORRETRESS 348
#define HOENN_DEX_DUNSPARCE 349
@ -1080,25 +1233,17 @@
#define HOENN_DEX_QWILFISH 354
#define HOENN_DEX_SCIZOR 355
#define HOENN_DEX_SHUCKLE 356
#define HOENN_DEX_HERACROSS 168
#define HOENN_DEX_SNEASEL 357
#define HOENN_DEX_TEDDIURSA 358
#define HOENN_DEX_URSARING 359
#define HOENN_DEX_SLUGMA 103
#define HOENN_DEX_MAGCARGO 104
#define HOENN_DEX_SWINUB 360
#define HOENN_DEX_PILOSWINE 361
#define HOENN_DEX_CORSOLA 180
#define HOENN_DEX_REMORAID 362
#define HOENN_DEX_OCTILLERY 363
#define HOENN_DEX_DELIBIRD 364
#define HOENN_DEX_MANTINE 365
#define HOENN_DEX_SKARMORY 115
#define HOENN_DEX_HOUNDOUR 366
#define HOENN_DEX_HOUNDOOM 367
#define HOENN_DEX_KINGDRA 186
#define HOENN_DEX_PHANPY 165
#define HOENN_DEX_DONPHAN 166
#define HOENN_DEX_PORYGON2 368
#define HOENN_DEX_STANTLER 369
#define HOENN_DEX_SMEARGLE 370
@ -1145,140 +1290,4 @@
#define HOENN_DEX_OLD_UNOWN_Y 410
#define HOENN_DEX_OLD_UNOWN_Z 411
#define HOENN_DEX_TREECKO 1
#define HOENN_DEX_GROVYLE 2
#define HOENN_DEX_SCEPTILE 3
#define HOENN_DEX_TORCHIC 4
#define HOENN_DEX_COMBUSKEN 5
#define HOENN_DEX_BLAZIKEN 6
#define HOENN_DEX_MUDKIP 7
#define HOENN_DEX_MARSHTOMP 8
#define HOENN_DEX_SWAMPERT 9
#define HOENN_DEX_POOCHYENA 10
#define HOENN_DEX_MIGHTYENA 11
#define HOENN_DEX_ZIGZAGOON 12
#define HOENN_DEX_LINOONE 13
#define HOENN_DEX_WURMPLE 14
#define HOENN_DEX_SILCOON 15
#define HOENN_DEX_BEAUTIFLY 16
#define HOENN_DEX_CASCOON 17
#define HOENN_DEX_DUSTOX 18
#define HOENN_DEX_LOTAD 19
#define HOENN_DEX_LOMBRE 20
#define HOENN_DEX_LUDICOLO 21
#define HOENN_DEX_SEEDOT 22
#define HOENN_DEX_NUZLEAF 23
#define HOENN_DEX_SHIFTRY 24
#define HOENN_DEX_NINCADA 42
#define HOENN_DEX_NINJASK 43
#define HOENN_DEX_SHEDINJA 44
#define HOENN_DEX_TAILLOW 25
#define HOENN_DEX_SWELLOW 26
#define HOENN_DEX_SHROOMISH 34
#define HOENN_DEX_BRELOOM 35
#define HOENN_DEX_SPINDA 114
#define HOENN_DEX_WINGULL 27
#define HOENN_DEX_PELIPPER 28
#define HOENN_DEX_SURSKIT 32
#define HOENN_DEX_MASQUERAIN 33
#define HOENN_DEX_WAILMER 99
#define HOENN_DEX_WAILORD 100
#define HOENN_DEX_SKITTY 61
#define HOENN_DEX_DELCATTY 62
#define HOENN_DEX_KECLEON 145
#define HOENN_DEX_BALTOY 131
#define HOENN_DEX_CLAYDOL 132
#define HOENN_DEX_NOSEPASS 60
#define HOENN_DEX_TORKOAL 105
#define HOENN_DEX_SABLEYE 68
#define HOENN_DEX_BARBOACH 127
#define HOENN_DEX_WHISCASH 128
#define HOENN_DEX_LUVDISC 183
#define HOENN_DEX_CORPHISH 129
#define HOENN_DEX_CRAWDAUNT 130
#define HOENN_DEX_FEEBAS 140
#define HOENN_DEX_MILOTIC 141
#define HOENN_DEX_CARVANHA 97
#define HOENN_DEX_SHARPEDO 98
#define HOENN_DEX_TRAPINCH 116
#define HOENN_DEX_VIBRAVA 117
#define HOENN_DEX_FLYGON 118
#define HOENN_DEX_MAKUHITA 48
#define HOENN_DEX_HARIYAMA 49
#define HOENN_DEX_ELECTRIKE 78
#define HOENN_DEX_MANECTRIC 79
#define HOENN_DEX_NUMEL 101
#define HOENN_DEX_CAMERUPT 102
#define HOENN_DEX_SPHEAL 173
#define HOENN_DEX_SEALEO 174
#define HOENN_DEX_WALREIN 175
#define HOENN_DEX_CACNEA 119
#define HOENN_DEX_CACTURNE 120
#define HOENN_DEX_SNORUNT 171
#define HOENN_DEX_GLALIE 172
#define HOENN_DEX_LUNATONE 125
#define HOENN_DEX_SOLROCK 126
#define HOENN_DEX_AZURILL 54
#define HOENN_DEX_SPOINK 110
#define HOENN_DEX_GRUMPIG 111
#define HOENN_DEX_PLUSLE 80
#define HOENN_DEX_MINUN 81
#define HOENN_DEX_MAWILE 69
#define HOENN_DEX_MEDITITE 76
#define HOENN_DEX_MEDICHAM 77
#define HOENN_DEX_SWABLU 121
#define HOENN_DEX_ALTARIA 122
#define HOENN_DEX_WYNAUT 160
#define HOENN_DEX_DUSKULL 148
#define HOENN_DEX_DUSCLOPS 149
#define HOENN_DEX_ROSELIA 94
#define HOENN_DEX_SLAKOTH 36
#define HOENN_DEX_VIGOROTH 37
#define HOENN_DEX_SLAKING 38
#define HOENN_DEX_GULPIN 95
#define HOENN_DEX_SWALOT 96
#define HOENN_DEX_TROPIUS 150
#define HOENN_DEX_WHISMUR 45
#define HOENN_DEX_LOUDRED 46
#define HOENN_DEX_EXPLOUD 47
#define HOENN_DEX_CLAMPERL 176
#define HOENN_DEX_HUNTAIL 177
#define HOENN_DEX_GOREBYSS 178
#define HOENN_DEX_ABSOL 152
#define HOENN_DEX_SHUPPET 146
#define HOENN_DEX_BANETTE 147
#define HOENN_DEX_SEVIPER 124
#define HOENN_DEX_ZANGOOSE 123
#define HOENN_DEX_RELICANTH 179
#define HOENN_DEX_ARON 70
#define HOENN_DEX_LAIRON 71
#define HOENN_DEX_AGGRON 72
#define HOENN_DEX_CASTFORM 142
#define HOENN_DEX_VOLBEAT 86
#define HOENN_DEX_ILLUMISE 87
#define HOENN_DEX_LILEEP 133
#define HOENN_DEX_CRADILY 134
#define HOENN_DEX_ANORITH 135
#define HOENN_DEX_ARMALDO 136
#define HOENN_DEX_RALTS 29
#define HOENN_DEX_KIRLIA 30
#define HOENN_DEX_GARDEVOIR 31
#define HOENN_DEX_BAGON 187
#define HOENN_DEX_SHELGON 188
#define HOENN_DEX_SALAMENCE 189
#define HOENN_DEX_BELDUM 190
#define HOENN_DEX_METANG 191
#define HOENN_DEX_METAGROSS 192
#define HOENN_DEX_REGIROCK 193
#define HOENN_DEX_REGICE 194
#define HOENN_DEX_REGISTEEL 195
#define HOENN_DEX_KYOGRE 198
#define HOENN_DEX_GROUDON 199
#define HOENN_DEX_RAYQUAZA 200
#define HOENN_DEX_LATIAS 196
#define HOENN_DEX_LATIOS 197
#define HOENN_DEX_JIRACHI 201
#define HOENN_DEX_DEOXYS 202
#define HOENN_DEX_CHIMECHO 151
#endif // GUARD_CONSTANTS_SPECIES_H

View File

@ -39,28 +39,31 @@
// These are the "abnormal weather events" that are used
// to find Kyogre and Groudon.
#define ABNORMAL_WEATHER_COUNT_PER_LEGENDARY 8
#define ABNORMAL_WEATHER_GROUDON_LOCATIONS_START 1
#define ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START 1 + ABNORMAL_WEATHER_COUNT_PER_LEGENDARY
#define ABNORMAL_WEATHER_LOCATIONS (MARINE_CAVE_LOCATIONS + TERRA_CAVE_LOCATIONS)
#define ABNORMAL_WEATHER_NONE 0
// Groudon locations
#define ABNORMAL_WEATHER_ROUTE_114_NORTH 1
#define ABNORMAL_WEATHER_ROUTE_114_SOUTH 2
#define ABNORMAL_WEATHER_ROUTE_115_WEST 3
#define ABNORMAL_WEATHER_ROUTE_115_EAST 4
#define ABNORMAL_WEATHER_ROUTE_116_NORTH 5
#define ABNORMAL_WEATHER_ROUTE_116_SOUTH 6
#define ABNORMAL_WEATHER_ROUTE_118_EAST 7
#define ABNORMAL_WEATHER_ROUTE_118_WEST 8
// Kyogre locations
#define ABNORMAL_WEATHER_ROUTE_105_NORTH 9
#define ABNORMAL_WEATHER_ROUTE_105_SOUTH 10
#define ABNORMAL_WEATHER_ROUTE_125_WEST 11
#define ABNORMAL_WEATHER_ROUTE_125_EAST 12
#define ABNORMAL_WEATHER_ROUTE_127_NORTH 13
#define ABNORMAL_WEATHER_ROUTE_127_SOUTH 14
#define ABNORMAL_WEATHER_ROUTE_129_WEST 15
#define ABNORMAL_WEATHER_ROUTE_129_EAST 16
// Groudon/Terra Cave locations
#define TERRA_CAVE_LOCATIONS_START 1
#define ABNORMAL_WEATHER_ROUTE_114_NORTH (TERRA_CAVE_LOCATIONS_START + 0)
#define ABNORMAL_WEATHER_ROUTE_114_SOUTH (TERRA_CAVE_LOCATIONS_START + 1)
#define ABNORMAL_WEATHER_ROUTE_115_WEST (TERRA_CAVE_LOCATIONS_START + 2)
#define ABNORMAL_WEATHER_ROUTE_115_EAST (TERRA_CAVE_LOCATIONS_START + 3)
#define ABNORMAL_WEATHER_ROUTE_116_NORTH (TERRA_CAVE_LOCATIONS_START + 4)
#define ABNORMAL_WEATHER_ROUTE_116_SOUTH (TERRA_CAVE_LOCATIONS_START + 5)
#define ABNORMAL_WEATHER_ROUTE_118_EAST (TERRA_CAVE_LOCATIONS_START + 6)
#define ABNORMAL_WEATHER_ROUTE_118_WEST (TERRA_CAVE_LOCATIONS_START + 7)
#define TERRA_CAVE_LOCATIONS 8
// Kyogre/Marina Cave locations
#define MARINE_CAVE_LOCATIONS_START (TERRA_CAVE_LOCATIONS_START + TERRA_CAVE_LOCATIONS)
#define ABNORMAL_WEATHER_ROUTE_105_NORTH (MARINE_CAVE_LOCATIONS_START + 0)
#define ABNORMAL_WEATHER_ROUTE_105_SOUTH (MARINE_CAVE_LOCATIONS_START + 1)
#define ABNORMAL_WEATHER_ROUTE_125_WEST (MARINE_CAVE_LOCATIONS_START + 2)
#define ABNORMAL_WEATHER_ROUTE_125_EAST (MARINE_CAVE_LOCATIONS_START + 3)
#define ABNORMAL_WEATHER_ROUTE_127_NORTH (MARINE_CAVE_LOCATIONS_START + 4)
#define ABNORMAL_WEATHER_ROUTE_127_SOUTH (MARINE_CAVE_LOCATIONS_START + 5)
#define ABNORMAL_WEATHER_ROUTE_129_WEST (MARINE_CAVE_LOCATIONS_START + 6)
#define ABNORMAL_WEATHER_ROUTE_129_EAST (MARINE_CAVE_LOCATIONS_START + 7)
#define MARINE_CAVE_LOCATIONS 8
#endif // GUARD_CONSTANTS_WEATHER_H

View File

@ -52,14 +52,6 @@ struct Decoration
const u16 *tiles;
};
struct DecorationPCContext
{
u8 *items;
u8 *pos;
u8 size;
u8 isPlayerRoom;
};
extern const struct Decoration gDecorations[];
extern EWRAM_DATA u8 *gCurDecorationItems;
extern EWRAM_DATA u8 gCurDecorationIndex;

View File

@ -12,10 +12,10 @@ extern struct DecorationInventory gDecorationInventories[];
void SetDecorationInventoriesPointers(void);
void ClearDecorationInventories(void);
s8 GetFirstEmptyDecorSlot(u8 category);
u8 CheckHasDecoration(u8);
u8 DecorationAdd(u8);
u8 DecorationCheckSpace(u8);
s8 DecorationRemove(u8);
u8 CheckHasDecoration(u8 decor);
u8 DecorationAdd(u8 decor);
u8 DecorationCheckSpace(u8 decor);
s8 DecorationRemove(u8 decor);
void CondenseDecorationsInCategory(u8 category);
u8 GetNumOwnedDecorationsInCategory(u8 category);
u8 GetNumOwnedDecorations(void);

26
include/digit_obj_util.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef GUARD_DIGIT_OBJ_UTIL_H
#define GUARD_DIGIT_OBJ_UTIL_H
struct DigitObjUtilTemplate
{
u8 strConvMode:2;
u8 shape:2;
u8 size:2;
u8 priority:2;
u8 oamCount;
u8 xDelta;
s16 x;
s16 y;
const struct SpriteSheet *spriteSheet;
const struct SpritePalette *spritePal;
};
bool32 DigitObjUtil_Init(u32 count);
void DigitObjUtil_Free(void);
bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template);
void DigitObjUtil_PrintNumOn(u32 id, s32 arg1);
void DigitObjUtil_DeletePrinter(u32 id);
void DigitObjUtil_HideOrShow(u32 id, bool32 arg1);
u8 GetTilesPerImage(u32 shape, u32 size);
#endif // GUARD_DIGIT_OBJ_UTIL_H

View File

@ -48,7 +48,7 @@ bool8 PartyHasMonWithSurf(void);
bool8 IsPlayerFacingSurfableFishableWater(void);
bool8 IsPlayerSurfingNorth(void);
void sub_808C228(u8 direction);
u8 sub_808BCD0(void);
u8 GetPlayerAvatarFlags(void);
void sub_808B578(void);
u8 GetFRLGAvatarGraphicsIdByGender(u8);
u8 GetRSAvatarGraphicsIdByGender(u8);

View File

@ -304,7 +304,7 @@ enum
struct PlayerAvatar
{
/*0x00*/ u8 flags;
/*0x01*/ u8 unk1; // used to be named bike, but its definitely not that. seems to be some transition flags
/*0x01*/ u8 transitionFlags; // used to be named bike, but its definitely not that. seems to be some transition flags
/*0x02*/ u8 runningState; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving.
/*0x03*/ u8 tileTransitionState; // this is a transition running state: 00 is not moving, 01 is transition between tiles, 02 means you are on the frame in which you have centered on a tile but are about to keep moving, even if changing directions. 2 is also used for a ledge hop, since you are transitioning.
/*0x04*/ u8 spriteId;

View File

@ -643,7 +643,7 @@ struct MauvilleManHipster
struct MauvilleOldManTrader
{
u8 id;
u8 decorIds[NUM_TRADER_ITEMS];
u8 decorations[NUM_TRADER_ITEMS];
u8 playerNames[NUM_TRADER_ITEMS][11];
u8 alreadyTraded;
u8 language[NUM_TRADER_ITEMS];
@ -934,16 +934,16 @@ struct SaveBlock1
/*0x159C*/ u32 gameStats[NUM_GAME_STATS];
/*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT];
/*0x1A9C*/ struct SecretBase secretBases[SECRET_BASES_COUNT];
/*0x271C*/ u8 playerRoomDecor[DECOR_MAX_PLAYERS_HOUSE];
/*0x2728*/ u8 playerRoomDecorPos[DECOR_MAX_PLAYERS_HOUSE];
/*0x2734*/ u8 decorDesk[10];
/*0x273E*/ u8 decorChair[10];
/*0x2748*/ u8 decorPlant[10];
/*0x2752*/ u8 decorOrnament[30];
/*0x2770*/ u8 decorMat[30];
/*0x278E*/ u8 decorPoster[10];
/*0x2798*/ u8 decorDoll[40];
/*0x27C0*/ u8 decorCushion[10];
/*0x271C*/ u8 playerRoomDecorations[DECOR_MAX_PLAYERS_HOUSE];
/*0x2728*/ u8 playerRoomDecorationPositions[DECOR_MAX_PLAYERS_HOUSE];
/*0x2734*/ u8 decorationDesks[10];
/*0x273E*/ u8 decorationChairs[10];
/*0x2748*/ u8 decorationPlants[10];
/*0x2752*/ u8 decorationOrnaments[30];
/*0x2770*/ u8 decorationMats[30];
/*0x278E*/ u8 decorationPosters[10];
/*0x2798*/ u8 decorationDolls[40];
/*0x27C0*/ u8 decorationCushions[10];
/*0x27CA*/ u8 padding_27CA[2];
/*0x27CC*/ TVShow tvShows[TV_SHOWS_COUNT];
/*0x2B50*/ PokeNews pokeNews[POKE_NEWS_COUNT];

View File

@ -3282,25 +3282,24 @@ extern const u32 gBattleTerrainPalette_StadiumDrake[];
extern const u32 gBattleTerrainPalette_StadiumWallace[];
// pokedex
extern const u32 gPokedexMenu2_Gfx[];
extern const u16 gPokedexText_Pal[];
extern const u32 gPokedexInterface_Gfx[];
extern const u16 gPokedexBgHoenn_Pal[];
extern const u32 gPokedexMenu_Gfx[];
extern const u8 gPokedexTilemap_Main[];
extern const u8 gPokedexTilemap_MainUnderlay[];
extern const u8 gPokedexTilemap_StartMenu1[];
extern const u8 gPokedexTilemap_StartMenu2[];
extern const u16 gPokedexHoennBg_Pal[];
extern const u16 gPokedexText_Pal[];
extern const u16 gPokedexNationalBg_Pal[];
extern const u8 gPokedexTilemap_DescriptionScreen[];
extern const u8 gPokedexTilemap_CryScreen[];
extern const u8 gPokedexTilemap_SizeScreen[];
extern const u8 gPokedexTilemap_ScreenSelectBar1[];
extern const u8 gPokedexTilemap_ScreenSelectBar2[];
extern const u16 gPokedexCaughtScreenFade_Pal[];
extern const u8 gPokedexList_Tilemap[];
extern const u8 gPokedexListUnderlay_Tilemap[];
extern const u8 gPokedexStartMenuMain_Tilemap[];
extern const u8 gPokedexStartMenuSearchResults_Tilemap[];
extern const u16 gPokedexSearchResults_Pal[];
extern const u16 gPokedexBgNational_Pal[];
extern const u8 gPokedexInfoScreen_Tilemap[];
extern const u8 gPokedexCryScreen_Tilemap[];
extern const u8 gPokedexSizeScreen_Tilemap[];
extern const u8 gPokedexScreenSelectBarMain_Tilemap[];
extern const u8 gPokedexScreenSelectBarSubmenu_Tilemap[];
extern const u16 gPokedexCaughtScreen_Pal[];
extern const u32 gPokedexSearchMenu_Gfx[];
extern const u32 gPokedexSearch2_Tilemap[];
extern const u32 gPokedexSearch1_Tilemap[];
extern const u32 gPokedexSearchMenuHoenn_Tilemap[];
extern const u32 gPokedexSearchMenuNational_Tilemap[];
extern const u16 gPokedexSearchMenu_Pal[];
// berry tag screen

View File

@ -0,0 +1,7 @@
#ifndef GUARD_MINIGAME_COUNTDOWN_H
#define GUARD_MINIGAME_COUNTDOWN_H
void StartMinigameCountdown(u16 tilesTag, u16 palTag, s16 x, s16 y, u8 subpriority);
bool32 IsMinigameCountdownRunning(void);
#endif //GUARD_MINIGAME_COUNTDOWN_H

View File

@ -24,8 +24,8 @@ extern struct PartyMenu gPartyMenu;
extern bool8 gPartyMenuUseExitCallback;
extern u8 gSelectedMonPartyId;
extern MainCallback gPostMenuFieldCallback;
extern u8 gSelectedOrderFromParty[4];
extern u8 gBattlePartyCurrentOrder[3];
extern u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE];
extern u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2];
extern void (*gItemUseCB)(u8, TaskFunc);

View File

@ -2,11 +2,7 @@
#define GUARD_POKEDEX_H
extern u8 gUnusedPokedexU8;
extern void (*gUnknown_030060B4)(void);
#define KANTO_DEX_COUNT 151
#define HOENN_DEX_COUNT 202
#define NATIONAL_DEX_COUNT 386
extern void (*gPokedexVBlankCB)(void);
enum
{
@ -39,12 +35,12 @@ void ResetPokedex(void);
u16 GetPokedexHeightWeight(u16 dexNum, u8 data);
u16 GetNationalPokedexCount(u8);
u16 GetHoennPokedexCount(u8);
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
u8 DisplayCaughtMonDexPage(u16 dexNum, u32 otId, u32 personality);
s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void);
void ResetPokedexScrollPositions(void);
bool16 HasAllMons(void);
void CB2_Pokedex(void);
void CB2_OpenPokedex(void);
#endif // GUARD_POKEDEX_H

View File

@ -0,0 +1,17 @@
#ifndef GUARD_POKEDEX_AREA_REGION_MAP_H
#define GUARD_POKEDEX_AREA_REGION_MAP_H
struct PokedexAreaMapTemplate
{
u32 bg:2;
u32 offset:8;
u32 mode:2;
u32 unk:20; // never read
};
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *);
bool32 sub_81C4E90(void);
void PokedexAreaMapChangeBgY(u32);
void FreePokedexAreaMapBgNum(void);
#endif // GUARD_POKEDEX_AREA_REGION_MAP_H

View File

@ -1,10 +1,10 @@
#ifndef GUARD_POKEDEX_CRY_SCREEN_H
#define GUARD_POKEDEX_CRY_SCREEN_H
struct CryRelatedStruct
struct CryScreenWindow
{
u16 unk0;
u8 unk2;
u16 unk0; // Assigned to val that's never read
u8 unk2; // Never read
u8 paletteNo;
u8 xPos;
u8 yPos;
@ -12,10 +12,10 @@ struct CryRelatedStruct
extern u8 gDexCryScreenState;
bool8 sub_8145354(struct CryRelatedStruct*, u8);
void sub_814545C(u8);
void sub_8145534(u16);
bool8 sub_8145850(struct CryRelatedStruct*, u8);
void sub_8145914(void);
bool8 LoadCryWaveformWindow(struct CryScreenWindow*, u8);
void UpdateCryWaveformWindow(u8);
void CryScreenPlayButton(u16);
bool8 LoadCryMeter(struct CryScreenWindow*, u8);
void FreeCryScreen(void);
#endif

View File

@ -8,7 +8,5 @@ bool32 IsSpeciesAllowedInPokemonJump(u16 species);
void IsPokemonJumpSpeciesInParty(void);
void ResetPokeJumpResults(void);
void ShowPokemonJumpRecords(void);
void sub_802EB24(s16 tileTag, s16 palTag, s16 x, s16 y, u8 subpriority);
bool32 sub_802EB84(void);
#endif // GUARD_POKEMON_JUMP_H

View File

@ -65,24 +65,44 @@ enum
POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone
};
enum
{
POKENAV_GFX_MAIN_MENU,
POKENAV_GFX_CONDITION_MENU,
POKENAV_GFX_RIBBONS_MENU,
POKENAV_GFX_MATCH_CALL_MENU,
POKENAV_GFX_MAP_MENU_ZOOMED_OUT,
POKENAV_GFX_MAP_MENU_ZOOMED_IN,
POKENAV_GFX_PARTY_MENU,
POKENAV_GFX_SEARCH_MENU,
POKENAV_GFX_COOL_MENU,
POKENAV_GFX_BEAUTY_MENU,
POKENAV_GFX_CUTE_MENU,
POKENAV_GFX_SMART_MENU,
POKENAV_GFX_TOUGH_MENU,
POKENAV_GFX_MENUS_END,
};
#define POKENAV_GFX_SUBMENUS_START POKENAV_GFX_PARTY_MENU
#define POKENAV_MENU_IDS_START 100000
enum
{
POKENAV_MENU_0 = POKENAV_MENU_IDS_START,
POKENAV_MENU_1,
POKENAV_MENU_2,
POKENAV_MENU_3,
POKENAV_MENU_4,
POKENAV_MENU_5,
POKENAV_MENU_6,
POKENAV_MENU_7,
POKENAV_MENU_8,
POKENAV_MENU_9,
POKENAV_MENU_A,
POKENAV_MENU_B,
POKENAV_MENU_C,
POKENAV_MENU_D,
POKENAV_MENU_E,
POKENAV_MAIN_MENU = POKENAV_MENU_IDS_START,
POKENAV_MAIN_MENU_CURSOR_ON_MAP,
POKENAV_CONDITION_MENU,
POKENAV_CONDITION_SEARCH_MENU,
POKENAV_MAIN_MENU_CURSOR_ON_MATCH_CALL,
POKENAV_MAIN_MENU_CURSOR_ON_RIBBONS,
POKENAV_REGION_MAP,
POKENAV_CONDITION_PARTY,
POKENAV_CONDITION_SEARCH_RESULTS,
POKENAV_MENU_9, // Condition
POKENAV_MENU_A, // Condition
POKENAV_MATCH_CALL,
POKENAV_RIBBONS_MON_LIST,
POKENAV_MENU_D, // Ribbons
POKENAV_MENU_E, // Ribbons
};
enum
@ -220,6 +240,15 @@ enum
POKENAV_MC_FUNC_EXIT
};
enum
{
POKENAV_MAP_FUNC_NONE,
POKENAV_MAP_FUNC_CURSOR_MOVED,
POKENAV_MAP_FUNC_ZOOM_OUT,
POKENAV_MAP_FUNC_ZOOM_IN,
POKENAV_MAP_FUNC_EXIT,
};
// pokenav.c
void SetSelectedConditionSearch(u32);
u32 GetSelectedConditionSearch(void);
@ -275,7 +304,7 @@ void sub_81C7850(u32 a0);
u32 sub_81C786C(void);
void LoadLeftHeaderGfxForIndex(u32 arg0);
void sub_81C7FA0(u32 arg0, bool32 arg1, bool32 arg2);
void sub_81C7AC0(s32 a0);
void PokenavFadeScreen(s32 fadeType);
bool32 sub_81C8010(void);
void InitBgTemplates(const struct BgTemplate *templates, int count);
bool32 IsPaletteFadeActive(void);
@ -298,30 +327,30 @@ void sub_81C7834(void *func1, void *func2);
void ShutdownPokenav(void);
// pokenav_menu_handler_1.c
bool32 PokenavCallback_Init_0(void);
bool32 PokenavCallback_Init_4(void);
bool32 PokenavCallback_Init_5(void);
bool32 PokenavCallback_Init_2(void);
bool32 PokenavCallback_Init_3(void);
u32 sub_81C941C(void);
void sub_81C9430(void);
bool32 PokenavCallback_Init_MainMenuCursorOnMap(void);
bool32 PokenavCallback_Init_MainMenuCursorOnMatchCall(void);
bool32 PokenavCallback_Init_MainMenuCursorOnRibbons(void);
bool32 PokenavCallback_Init_ConditionMenu(void);
bool32 PokenavCallback_Init_ConditionSearchMenu(void);
u32 GetMenuHandlerCallback(void);
void FreeMenuHandlerSubstruct1(void);
int GetPokenavMenuType(void);
int GetPokenavCursorPos(void);
int GetCurrentMenuItemId(void);
u16 GetHelpBarTextId(void);
// pokenav_menu_handler_2.c
bool32 sub_81C9924(void);
bool32 sub_81C9940(void);
bool32 OpenPokenavMenuInitial(void);
bool32 OpenPokenavMenuNotInitial(void);
void CreateMenuHandlerLoopedTask(s32 ltIdx);
bool32 sub_81C99C0(void);
void sub_81C99D4(void);
bool32 IsMenuHandlerLoopedTaskActive(void);
void FreeMenuHandlerSubstruct2(void);
void sub_81CAADC(void);
// pokenav_match_call_1.c
bool32 PokenavCallback_Init_11(void);
u32 sub_81CAB24(void);
void sub_81CAB38(void);
bool32 PokenavCallback_Init_MatchCall(void);
u32 GetMatchCallCallback(void);
void FreeMatchCallSubstruct1(void);
int sub_81CAE28(void);
int GetNumberRegistered(void);
int sub_81CAE48(void);
@ -341,19 +370,19 @@ int GetIndexDeltaOfNextCheckPageUp(int index);
bool32 IsRematchEntryRegistered(int index);
// pokenav_match_call_2.c
bool32 sub_81CB260(void);
bool32 OpenMatchCall(void);
void CreateMatchCallLoopedTask(s32 index);
u32 sub_81CB2CC(void);
void sub_81CB2E0(void);
bool32 IsMatchCallLoopedTaskActive(void);
void FreeMatchCallSubstruct2(void);
// pokenav_region_map.c
u32 PokenavCallback_Init_6(void);
void sub_81CC524(void);
u32 sub_81CC554(void);
bool32 sub_81CC5F4(void);
void sub_81CC62C(s32);
u32 sub_81CC65C(void);
void sub_81CC670(void);
u32 PokenavCallback_Init_RegionMap(void);
u32 GetRegionMapCallback(void);
bool32 OpenPokenavRegionMap(void);
void CreateRegionMapLoopedTask(s32);
bool32 IsRegionMapLoopedTaskActive(void);
void FreeRegionMapSubstruct1(void);
void FreeRegionMapSubstruct2(void);
// pokenav_conditions_1.c
u32 PokenavCallback_Init_7(void);

View File

@ -4,20 +4,21 @@
#include "bg.h"
// Exported type declarations
#define MAP_NAME_LENGTH 16
enum
{
INPUT_EVENT_NONE,
INPUT_EVENT_MOVE_START,
INPUT_EVENT_MOVE_CONT,
INPUT_EVENT_MOVE_END,
INPUT_EVENT_A_BUTTON,
INPUT_EVENT_B_BUTTON,
MAP_INPUT_NONE,
MAP_INPUT_MOVE_START,
MAP_INPUT_MOVE_CONT,
MAP_INPUT_MOVE_END,
MAP_INPUT_A_BUTTON,
MAP_INPUT_B_BUTTON,
};
enum {
MAPSECTYPE_NONE,
MAPSECTYPE_PLAIN,
MAPSECTYPE_ROUTE,
MAPSECTYPE_CITY_CANFLY,
MAPSECTYPE_CITY_CANTFLY,
MAPSECTYPE_BATTLE_FRONTIER
@ -25,9 +26,9 @@ enum {
struct RegionMap {
/*0x000*/ u16 mapSecId;
/*0x002*/ u8 iconDrawType;
/*0x002*/ u8 mapSecType;
/*0x003*/ u8 posWithinMapSec;
/*0x004*/ u8 mapSecName[0x14];
/*0x004*/ u8 mapSecName[20];
/*0x018*/ u8 (*inputCallback)(void);
/*0x01c*/ struct Sprite *cursorSprite;
/*0x020*/ struct Sprite *playerIconSprite;
@ -90,28 +91,28 @@ struct RegionMapLocation
// Exported RAM declarations
// Exported ROM declarations
void sub_8122CF8(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed);
bool8 sub_8122DB0(void);
void InitRegionMapData(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed);
bool8 LoadRegionMapGfx(void);
void UpdateRegionMapVideoRegs(void);
void InitRegionMap(struct RegionMap *regionMap, u8 argument);
u8 sub_81230AC(void);
bool8 sub_8123514(void);
u8 DoRegionMapInputCallback(void);
bool8 UpdateRegionMapZoom(void);
void FreeRegionMapIconResources(void);
u16 GetRegionMapSectionIdAt(u16 x, u16 y);
u16 GetRegionMapSecIdAt(u16 x, u16 y);
void CreateRegionMapPlayerIcon(u16 x, u16 y);
void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);
bool32 IsEventIslandMapSecId(u8 mapSecId);
u8 *GetMapName(u8 *, u16, u16);
bool32 sub_8124668(u8 mapSecId);
u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId);
u8 *sub_8124610(u8 *dest, u16 mapSecId);
u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId);
u16 CorrectSpecialMapSecId(u16 mapSecId);
void sub_8122D88(struct RegionMap *regionMap);
void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap);
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
void MCB2_FlyMap(void);
bool8 sub_8124658(void);
void sub_812454C(void);
void sub_8123030(u16 a0, u32 a1);
void sub_8123418(void);
void CB2_OpenFlyMap(void);
bool8 IsRegionMapZoomed(void);
void TrySetPlayerIconBlink(void);
void sub_8123030(u16 color, u32 coeff);
void SetRegionMapDataForZoom(void);
extern const struct RegionMapLocation gRegionMapEntries[];

View File

@ -1,26 +0,0 @@
#ifndef GUARD_ROM_8034C54_H
#define GUARD_ROM_8034C54_H
struct UnkStruct3
{
u8 field_0_0:2;
u8 shape:2;
u8 size:2;
u8 priority:2;
u8 field_1;
u8 xDelta;
s16 x;
s16 y;
const struct SpriteSheet *spriteSheet;
const struct SpritePalette *spritePal;
};
bool32 sub_8034C54(u32 count);
void sub_8034CC8(void);
bool32 sub_8034D14(u32 id, s32 arg1, const struct UnkStruct3 *arg2);
void sub_8035044(u32 id, s32 arg1);
void sub_80353DC(u32 id);
void sub_803547C(u32 id, bool32 arg1);
u8 sub_80355F8(u32 shape, u32 size);
#endif // GUARD_ROM_8034C54_H

View File

@ -5,7 +5,7 @@
#ifndef GUARD_TRADER_H
#define GUARD_TRADER_H
void sub_8133DA0(u8 taskId);
void DecorationItemsMenuAction_Trade(u8 taskId);
void ExitTraderMenu(u8 taskId);
void TraderSetup(void);
void Trader_ResetFlag(void);

View File

@ -1,17 +0,0 @@
#ifndef GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H
#define GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H
struct UnkStruct_1C4D70
{
u32 bg:2;
u32 unk2:8;
u32 unk10:2;
u32 unk12:20;
};
void sub_81C4D70(const struct UnkStruct_1C4D70 *);
bool32 sub_81C4E90(void);
void sub_81C4ED0(u32);
void sub_81C4EB4(void);
#endif // GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H

View File

@ -77,11 +77,12 @@ SECTIONS {
src/berry_powder.o(.text);
src/dodrio_berry_picking.o(.text);
src/pokemon_jump.o(.text);
src/minigame_countdown.o(.text);
src/rtc.o(.text);
src/main_menu.o(.text);
src/battle_controllers.o(.text);
src/decompress.o(.text);
src/rom_8034C54.o(.text);
src/digit_obj_util.o(.text);
src/battle_bg.o(.text);
src/battle_main.o(.text);
src/battle_util.o(.text);
@ -305,7 +306,7 @@ SECTIONS {
src/mirage_tower.o(.text);
src/berry_fix_program.o(.text);
src/pokemon_summary_screen.o(.text);
src/unk_pokedex_area_screen_helper.o(.text);
src/pokedex_area_region_map.o(.text);
src/battle_pyramid_bag.o(.text);
src/pokenav.o(.text);
src/pokenav_main_menu.o(.text);
@ -461,10 +462,11 @@ SECTIONS {
src/berry_powder.o(.rodata);
src/dodrio_berry_picking.o(.rodata);
src/pokemon_jump.o(.rodata);
src/minigame_countdown.o(.rodata);
src/rtc.o(.rodata);
src/main_menu.o(.rodata);
src/battle_controllers.o(.rodata);
src/rom_8034C54.o(.rodata);
src/digit_obj_util.o(.rodata);
src/data.o(.rodata);
src/battle_bg.o(.rodata);
src/battle_main.o(.rodata);
@ -660,7 +662,7 @@ SECTIONS {
src/mirage_tower.o(.rodata);
src/berry_fix_program.o(.rodata);
src/pokemon_summary_screen.o(.rodata);
src/unk_pokedex_area_screen_helper.o(.rodata);
src/pokedex_area_region_map.o(.rodata);
src/battle_pyramid_bag.o(.rodata);
src/pokenav.o(.rodata);
src/pokenav_main_menu.o(.rodata);

View File

@ -79,8 +79,8 @@ static void AnimAngel(struct Sprite *);
static void AnimPinkHeart(struct Sprite *);
static void AnimDevil(struct Sprite *);
static void AnimFurySwipes(struct Sprite *);
static void AnimMovmentWaves(struct Sprite *);
static void AnimMovmentWaves_Step(struct Sprite *);
static void AnimMovementWaves(struct Sprite *);
static void AnimMovementWaves_Step(struct Sprite *);
static void AnimJaggedMusicNote(struct Sprite *);
static void AnimJaggedMusicNote_Step(struct Sprite *);
static void AnimPerishSongMusicNote2(struct Sprite *);
@ -1185,7 +1185,7 @@ const struct SpriteTemplate gMovementWavesSpriteTemplate =
.anims = gMovementWavesAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimMovmentWaves,
.callback = AnimMovementWaves,
};
static const union AffineAnimCmd sAffineAnims_UproarDistortion[] =
@ -3628,7 +3628,7 @@ static void AnimFurySwipes(struct Sprite *sprite)
}
}
static void AnimMovmentWaves(struct Sprite *sprite)
static void AnimMovementWaves(struct Sprite *sprite)
{
if (!gBattleAnimArgs[2])
{
@ -3655,11 +3655,11 @@ static void AnimMovmentWaves(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[1];
StartSpriteAnim(sprite, sprite->data[1]);
sprite->callback = AnimMovmentWaves_Step;
sprite->callback = AnimMovementWaves_Step;
}
}
static void AnimMovmentWaves_Step(struct Sprite *sprite)
static void AnimMovementWaves_Step(struct Sprite *sprite)
{
if (sprite->animEnded)
{

View File

@ -691,6 +691,25 @@ static const struct BattleBackground gBattleTerrainTable[] =
},
};
static void sub_8035648(void);
// Unused
static void sub_8035608(void)
{
u8 spriteId;
ResetSpriteData();
spriteId = CreateSprite(&gUnknown_0831AC88, 0, 0, 0);
gSprites[spriteId].invisible = TRUE;
SetMainCallback2(sub_8035648);
}
static void sub_8035648(void)
{
AnimateSprites();
BuildOamBuffer();
}
void BattleInitBgsAndWindows(void)
{
ResetBgsAndClearDma3BusyFlags(0);

View File

@ -2578,7 +2578,7 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId)
// Create mon if it was selected, starting from back
for (i = FRONTIER_PARTY_SIZE - 1; i >= 0; i--)
{
if (selectedMonBits & 4)
if (selectedMonBits & (1 << (FRONTIER_PARTY_SIZE - 1)))
{
CreateDomeOpponentMon(monsCount, tournamentTrainerId, i, otId);
monsCount++;

View File

@ -4011,7 +4011,7 @@ static void HandleTurnActionSelectionState(void)
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT;
*(gBattleStruct->selectionScriptFinished + gActiveBattler) = FALSE;
gBattleResources->bufferB[gActiveBattler][1] = 0;
gBattleResources->bufferB[gActiveBattler][1] = B_ACTION_USE_MOVE;
*(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_WAIT_ACTION_CHOSEN;
return;
}
@ -4146,7 +4146,7 @@ static void HandleTurnActionSelectionState(void)
case STATE_SELECTION_SCRIPT_MAY_RUN:
if (*(gBattleStruct->selectionScriptFinished + gActiveBattler))
{
if (gBattleResources->bufferB[gActiveBattler][1] == 13)
if (gBattleResources->bufferB[gActiveBattler][1] == B_ACTION_NOTHING_FAINTED)
{
gHitMarker |= HITMARKER_RUN;
gChosenActionByBattler[gActiveBattler] = B_ACTION_RUN;

View File

@ -874,20 +874,20 @@ static bool8 TryInflictRandomStatus(void)
{
u8 j, i;
u8 count;
u8 indices[3];
u8 indices[FRONTIER_PARTY_SIZE];
u32 status;
u16 species;
bool8 statusChosen;
struct Pokemon *mon;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
indices[i] = i;
for (j = 0; j < 10; j++)
{
u8 temp, id;
i = Random() % 3;
id = Random() % 3;
i = Random() % FRONTIER_PARTY_SIZE;
id = Random() % FRONTIER_PARTY_SIZE;
SWAP(indices[i], indices[id], temp);
}
@ -921,7 +921,7 @@ static bool8 TryInflictRandomStatus(void)
{
status = sStatusFlags;
j = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
mon = &gPlayerParty[indices[i]];
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
@ -963,7 +963,7 @@ static bool8 TryInflictRandomStatus(void)
}
j = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
mon = &gPlayerParty[indices[i]];
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
@ -995,7 +995,7 @@ static bool8 AtLeastOneHealthyMon(void)
count = 3;
healthyMonsCount = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
struct Pokemon *mon = &gPlayerParty[i];
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
@ -1262,23 +1262,23 @@ static void Task_DoStatusInflictionScreenFlash(u8 taskId)
static void TryHealMons(u8 healCount)
{
u8 j, i, k;
u8 indices[3];
u8 indices[FRONTIER_PARTY_SIZE];
if (healCount == 0)
return;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
indices[i] = i;
for (k = 0; k < 10; k++)
{
u8 temp;
i = Random() % 3;
j = Random() % 3;
i = Random() % FRONTIER_PARTY_SIZE;
j = Random() % FRONTIER_PARTY_SIZE;
SWAP(indices[i], indices[j], temp);
}
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
bool32 canBeHealed = FALSE;
struct Pokemon *mon = &gPlayerParty[indices[i]];
@ -1483,7 +1483,7 @@ static bool8 AtLeastTwoAliveMons(void)
mon = &gPlayerParty[0];
countDead = 0;
for (i = 0; i < 3; i++, mon++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++, mon++)
{
if (GetMonData(mon, MON_DATA_HP) == 0)
countDead++;

View File

@ -10043,7 +10043,7 @@ static void Cmd_jumpifnopursuitswitchdmg(void)
for (i = 0; i < gBattlersCount; i++)
{
if (gBattlerByTurnOrder[i] == gBattlerTarget)
gActionsByTurnOrder[i] = 11;
gActionsByTurnOrder[i] = B_ACTION_TRY_FINISH;
}
gCurrentMove = MOVE_PURSUIT;
@ -11184,7 +11184,7 @@ static void Cmd_pursuitrelated(void)
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler])
&& gChosenActionByBattler[gActiveBattler] == 0
&& gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE
&& gChosenMoveByBattler[gActiveBattler] == MOVE_PURSUIT)
{
gActionsByTurnOrder[gActiveBattler] = 11;
@ -11450,7 +11450,7 @@ static void Cmd_displaydexinfo(void)
if (!gPaletteFade.active)
{
FreeAllWindowBuffers();
gBattleCommunication[TASK_ID] = CreateDexDisplayMonDataTask(SpeciesToNationalPokedexNum(species),
gBattleCommunication[TASK_ID] = DisplayCaughtMonDexPage(SpeciesToNationalPokedexNum(species),
gBattleMons[GetCatchingBattler()].otId,
gBattleMons[GetCatchingBattler()].personality);
gBattleCommunication[0]++;

View File

@ -24,6 +24,7 @@
#include "tv.h"
#include "battle_factory.h"
#include "constants/apprentice.h"
#include "constants/battle_dome.h"
#include "constants/battle_frontier.h"
#include "constants/battle_frontier_mons.h"
#include "constants/battle_tent_mons.h"
@ -2070,7 +2071,7 @@ void DoSpecialTrainerBattle(void)
if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES)
gBattleTypeFlags |= BATTLE_TYPE_DOUBLE;
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
FillFrontierTrainerParty(2);
FillFrontierTrainerParty(DOME_BATTLE_PARTY_SIZE);
CreateTask(Task_StartBattleAfterTransition, 1);
sub_806E694(0);
BattleTransition_StartOnField(sub_80B100C(3));
@ -2255,12 +2256,12 @@ static void nullsub_116(void)
static void GetApprenticeMultiPartnerParty(u16 trainerId)
{
s32 i, count;
u32 validSpecies[3];
u32 validSpecies[MULTI_PARTY_SIZE];
u16 species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL);
u16 species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL);
count = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < MULTI_PARTY_SIZE; i++)
{
u16 apprenticeSpecies = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].party[i].species;
if (apprenticeSpecies != species1 && apprenticeSpecies != species2)
@ -2384,7 +2385,7 @@ static void LoadMultiPartnerCandidatesData(void)
&& gSaveBlock2Ptr->apprentices[i].lvlMode - 1 == lvlMode)
{
k = 0;
for (j = 0; j < 3; j++)
for (j = 0; j < MULTI_PARTY_SIZE; j++)
{
if (species1 != gSaveBlock2Ptr->apprentices[i].party[j].species
&& species2 != gSaveBlock2Ptr->apprentices[i].party[j].species)
@ -2992,26 +2993,26 @@ static void FillPartnerParty(u16 trainerId)
if (trainerId == TRAINER_STEVEN_PARTNER)
{
for (i = 0; i < 3; i++)
for (i = 0; i < MULTI_PARTY_SIZE; i++)
{
do
{
j = Random32();
} while (IsShinyOtIdPersonality(STEVEN_OTID, j) || sStevenMons[i].nature != GetNatureFromPersonality(j));
CreateMon(&gPlayerParty[3 + i],
CreateMon(&gPlayerParty[MULTI_PARTY_SIZE + i],
sStevenMons[i].species,
sStevenMons[i].level,
sStevenMons[i].fixedIV,
TRUE, i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures.
OT_ID_PRESET, STEVEN_OTID);
for (j = 0; j < PARTY_SIZE; j++)
SetMonData(&gPlayerParty[3 + i], MON_DATA_HP_EV + j, &sStevenMons[i].evs[j]);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_HP_EV + j, &sStevenMons[i].evs[j]);
for (j = 0; j < MAX_MON_MOVES; j++)
SetMonMoveSlot(&gPlayerParty[3 + i], sStevenMons[i].moves[j], j);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_NAME, gTrainers[TRAINER_STEVEN].trainerName);
SetMonMoveSlot(&gPlayerParty[MULTI_PARTY_SIZE + i], sStevenMons[i].moves[j], j);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_NAME, gTrainers[TRAINER_STEVEN].trainerName);
j = MALE;
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
CalculateMonStats(&gPlayerParty[3 + i]);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_GENDER, &j);
CalculateMonStats(&gPlayerParty[MULTI_PARTY_SIZE + i]);
}
}
else if (trainerId >= TRAINER_CUSTOM_PARTNER)
@ -3090,10 +3091,10 @@ static void FillPartnerParty(u16 trainerId)
level = SetFacilityPtrsGetLevel();
ivs = GetFrontierTrainerFixedIvs(trainerId);
otID = Random32();
for (i = 0; i < 2; i++)
for (i = 0; i < FRONTIER_MULTI_PARTY_SIZE; i++)
{
monId = gSaveBlock2Ptr->frontier.trainerIds[i + 18];
CreateMonWithEVSpreadNatureOTID(&gPlayerParty[3 + i],
CreateMonWithEVSpreadNatureOTID(&gPlayerParty[MULTI_PARTY_SIZE + i],
gFacilityTrainerMons[monId].species,
level,
gFacilityTrainerMons[monId].nature,
@ -3103,23 +3104,23 @@ static void FillPartnerParty(u16 trainerId)
friendship = MAX_FRIENDSHIP;
for (j = 0; j < MAX_MON_MOVES; j++)
{
SetMonMoveSlot(&gPlayerParty[3 + i], gFacilityTrainerMons[monId].moves[j], j);
SetMonMoveSlot(&gPlayerParty[MULTI_PARTY_SIZE + i], gFacilityTrainerMons[monId].moves[j], j);
if (gFacilityTrainerMons[monId].moves[j] == MOVE_FRUSTRATION)
friendship = 0;
}
SetMonData(&gPlayerParty[3 + i], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gPlayerParty[3 + i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++)
trainerName[j] = gFacilityTrainers[trainerId].trainerName[j];
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_NAME, &trainerName);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_NAME, &trainerName);
j = IsFrontierTrainerFemale(trainerId);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_GENDER, &j);
}
}
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
{
trainerId -= TRAINER_RECORD_MIXING_FRIEND;
for (i = 0; i < 2; i++)
for (i = 0; i < FRONTIER_MULTI_PARTY_SIZE; i++)
{
struct EmeraldBattleTowerRecord *record = &gSaveBlock2Ptr->frontier.towerRecords[trainerId];
struct BattleTowerPokemon monData = record->party[gSaveBlock2Ptr->frontier.trainerIds[18 + i]];
@ -3137,20 +3138,20 @@ static void FillPartnerParty(u16 trainerId)
if (monData.nickname[0] == EXT_CTRL_CODE_BEGIN && monData.nickname[1] == EXT_CTRL_CODE_JPN)
trainerName[5] = EOS;
}
CreateBattleTowerMon2(&gPlayerParty[3 + i], &monData, TRUE);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_NAME, trainerName);
CreateBattleTowerMon2(&gPlayerParty[MULTI_PARTY_SIZE + i], &monData, TRUE);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_NAME, trainerName);
j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_FRIEND);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_GENDER, &j);
}
}
else
{
trainerId -= TRAINER_RECORD_MIXING_APPRENTICE;
for (i = 0; i < 2; i++)
for (i = 0; i < FRONTIER_MULTI_PARTY_SIZE; i++)
{
CreateApprenticeMon(&gPlayerParty[3 + i], &gSaveBlock2Ptr->apprentices[trainerId], gSaveBlock2Ptr->frontier.trainerIds[18 + i]);
CreateApprenticeMon(&gPlayerParty[MULTI_PARTY_SIZE + i], &gSaveBlock2Ptr->apprentices[trainerId], gSaveBlock2Ptr->frontier.trainerIds[18 + i]);
j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_APPRENTICE);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_GENDER, &j);
}
}
}
@ -3461,7 +3462,7 @@ static void SetNextBattleTentOpponent(void)
static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
{
s32 i, j;
u16 chosenMonIndices[4];
u16 chosenMonIndices[MAX_FRONTIER_PARTY_SIZE];
u8 friendship;
u8 level = SetTentPtrsGetLevel();
u8 fixedIV = 0;

View File

@ -19,9 +19,9 @@
#include "menu.h"
#include "overworld.h"
#include "palette.h"
#include "pokemon_jump.h"
#include "minigame_countdown.h"
#include "random.h"
#include "rom_8034C54.h"
#include "digit_obj_util.h"
#include "save.h"
#include "scanline_effect.h"
#include "script.h"
@ -714,14 +714,14 @@ static const struct SpriteTemplate gUnknown_082F436C =
.callback = SpriteCallbackDummy
};
static const struct UnkStruct3 gUnknown_082F4384[] =
static const struct DigitObjUtilTemplate gUnknown_082F4384[] =
{
{
.field_0_0 = 1,
.strConvMode = 1,
.shape = 2,
.size = 0,
.priority = 0,
.field_1 = 2,
.oamCount = 2,
.xDelta = 8,
.x = 156,
.y = 0,
@ -729,11 +729,11 @@ static const struct UnkStruct3 gUnknown_082F4384[] =
.spritePal = gUnknown_082F422C,
},
{
.field_0_0 = 0,
.strConvMode = 0,
.shape = 2,
.size = 0,
.priority = 0,
.field_1 = 2,
.oamCount = 2,
.xDelta = 8,
.x = 180,
.y = 0,
@ -741,11 +741,11 @@ static const struct UnkStruct3 gUnknown_082F4384[] =
.spritePal = gUnknown_082F422C,
},
{
.field_0_0 = 0,
.strConvMode = 0,
.shape = 2,
.size = 0,
.priority = 0,
.field_1 = 2,
.oamCount = 2,
.xDelta = 8,
.x = 204,
.y = 0,
@ -1036,7 +1036,7 @@ int sub_802104C(void)
case 1:
CpuFill16(0, (void *)OAM, OAM_SIZE);
gReservedSpritePaletteCount = 0;
sub_8034C54(3);
DigitObjUtil_Init(3);
break;
case 2:
ResetPaletteFade();
@ -1165,7 +1165,7 @@ int sub_802130C(void)
case 6:
DestroyWirelessStatusIndicatorSprite();
sub_8022960(var0);
sub_8034CC8();
DigitObjUtil_Free();
break;
case 7:
var0->unkC = 0;
@ -1701,18 +1701,18 @@ void ShowBerryCrushRankings(void)
void sub_8022524(struct BerryCrushGame_138 *r4, u16 r1)
{
sub_8021944(r4, r1);
sub_8035044(0, r4->unk4);
sub_8035044(1, r4->unk6);
sub_8035044(2, r4->unk8);
DigitObjUtil_PrintNumOn(0, r4->unk4);
DigitObjUtil_PrintNumOn(1, r4->unk6);
DigitObjUtil_PrintNumOn(2, r4->unk8);
}
void sub_8022554(struct BerryCrushGame_138 *r0)
{
r0->unk78[0]->invisible = TRUE;
r0->unk78[1]->invisible = TRUE;
sub_803547C(2, 1);
sub_803547C(1, 1);
sub_803547C(0, 1);
DigitObjUtil_HideOrShow(2, 1);
DigitObjUtil_HideOrShow(1, 1);
DigitObjUtil_HideOrShow(0, 1);
}
void sub_8022588(struct BerryCrushGame *r5)
@ -1855,9 +1855,9 @@ void sub_8022730(struct BerryCrushGame *r6)
r6->unk138.unk78[r5]->invisible = FALSE;
r6->unk138.unk78[r5]->animPaused = FALSE;
}
sub_8034D14(0, 0, &gUnknown_082F4384[0]);
sub_8034D14(1, 0, &gUnknown_082F4384[1]);
sub_8034D14(2, 0, &gUnknown_082F4384[2]);
DigitObjUtil_CreatePrinter(0, 0, &gUnknown_082F4384[0]);
DigitObjUtil_CreatePrinter(1, 0, &gUnknown_082F4384[1]);
DigitObjUtil_CreatePrinter(2, 0, &gUnknown_082F4384[2]);
if (r6->unk12 == 1)
sub_8022554(&r6->unk138);
}
@ -1875,9 +1875,9 @@ void sub_8022960(struct BerryCrushGame *r5)
FreeSpritePaletteByTag(1);
for (; r4 < ARRAY_COUNT(r5->unk138.unk78); ++r4)
DestroySprite(r5->unk138.unk78[r4]);
sub_80353DC(2);
sub_80353DC(1);
sub_80353DC(0);
DigitObjUtil_DeletePrinter(2);
DigitObjUtil_DeletePrinter(1);
DigitObjUtil_DeletePrinter(0);
for (r4 = 0; r4 < ARRAY_COUNT(r5->unk138.unk4C); ++r4)
DestroySprite(r5->unk138.unk4C[r4]);
for (r4 = 0; r4 < r5->unk9; ++r4)
@ -2317,10 +2317,10 @@ static u32 sub_80232EC(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
case 1:
if (!IsLinkTaskFinished())
return 0;
sub_802EB24(0x1000, 0x1000, 120, 80, 0);
StartMinigameCountdown(0x1000, 0x1000, 120, 80, 0);
break;
case 2:
if (sub_802EB84())
if (IsMinigameCountdownRunning())
return 0;
// fallthrough
case 0:

View File

@ -23,6 +23,7 @@
#include "constants/vars.h"
#include "event_data.h"
#include "random.h"
#include "constants/species.h"
enum
{

View File

@ -7391,3 +7391,6 @@ const union AnimCmd *const *const gMonFrontAnimsPtrTable[] =
ANIM_CMD(UNOWN_EMARK),
ANIM_CMD(UNOWN_QMARK),
};
#undef ANIM_CMD
#undef ANIM_CMD_FULL

File diff suppressed because it is too large Load Diff

View File

@ -1,112 +1,112 @@
const struct CityMapEntry gPokenavCityMaps[] =
static const struct CityMapEntry sPokenavCityMaps[NUM_CITY_MAPS] =
{
{
.mapSecId = 0,
.mapSecId = MAPSEC_LITTLEROOT_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Littleroot_0,
},
{
.mapSecId = 1,
.mapSecId = MAPSEC_OLDALE_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Oldale_0,
},
{
.mapSecId = 2,
.mapSecId = MAPSEC_DEWFORD_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Dewford_0,
},
{
.mapSecId = 3,
.mapSecId = MAPSEC_LAVARIDGE_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Lavarige_0,
},
{
.mapSecId = 4,
.mapSecId = MAPSEC_FALLARBOR_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Fallarbor_0,
},
{
.mapSecId = 5,
.mapSecId = MAPSEC_VERDANTURF_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Verdanturf_0,
},
{
.mapSecId = 6,
.mapSecId = MAPSEC_PACIFIDLOG_TOWN,
.index = 0,
.tilemap = gPokenavCityMap_Pacifidlog_0,
},
{
.mapSecId = 7,
.mapSecId = MAPSEC_PETALBURG_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Petalburg_0,
},
{
.mapSecId = 8,
.mapSecId = MAPSEC_SLATEPORT_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Slateport_0,
},
{
.mapSecId = 8,
.mapSecId = MAPSEC_SLATEPORT_CITY,
.index = 1,
.tilemap = gPokenavCityMap_Slateport_1,
},
{
.mapSecId = 9,
.mapSecId = MAPSEC_MAUVILLE_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Mauville_0,
},
{
.mapSecId = 9,
.mapSecId = MAPSEC_MAUVILLE_CITY,
.index = 1,
.tilemap = gPokenavCityMap_Mauville_1,
},
{
.mapSecId = 10,
.mapSecId = MAPSEC_RUSTBORO_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Rustboro_0,
},
{
.mapSecId = 10,
.mapSecId = MAPSEC_RUSTBORO_CITY,
.index = 1,
.tilemap = gPokenavCityMap_Rustboro_1,
},
{
.mapSecId = 11,
.mapSecId = MAPSEC_FORTREE_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Fortree_0,
},
{
.mapSecId = 12,
.mapSecId = MAPSEC_LILYCOVE_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Lilycove_0,
},
{
.mapSecId = 12,
.mapSecId = MAPSEC_LILYCOVE_CITY,
.index = 1,
.tilemap = gPokenavCityMap_Lilycove_1,
},
{
.mapSecId = 13,
.mapSecId = MAPSEC_MOSSDEEP_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Mossdeep_0,
},
{
.mapSecId = 13,
.mapSecId = MAPSEC_MOSSDEEP_CITY,
.index = 1,
.tilemap = gPokenavCityMap_Mossdeep_1,
},
{
.mapSecId = 14,
.mapSecId = MAPSEC_SOOTOPOLIS_CITY,
.index = 0,
.tilemap = gPokenavCityMap_Sootopolis_0,
},
{
.mapSecId = 15,
.mapSecId = MAPSEC_EVER_GRANDE_CITY,
.index = 0,
.tilemap = gPokenavCityMap_EverGrande_0,
},
{
.mapSecId = 15,
.mapSecId = MAPSEC_EVER_GRANDE_CITY,
.index = 1,
.tilemap = gPokenavCityMap_EverGrande_1,
},

View File

@ -374,7 +374,7 @@ const struct RegionMapLocation gRegionMapEntries[] = {
[MAPSEC_SEVII_ISLE_22] = { 0, 0, 1, 1, sMapName_SeviiIsle22},
[MAPSEC_SEVII_ISLE_23] = { 0, 0, 1, 1, sMapName_SeviiIsle23},
[MAPSEC_SEVII_ISLE_24] = { 0, 0, 1, 1, sMapName_SeviiIsle24},
[MAPSEC_NAVEL_ROCK] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_NAVEL_ROCK_FRLG] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_MT_EMBER] = { 0, 0, 1, 1, sMapName_MtEmber},
[MAPSEC_BERRY_FOREST] = { 0, 0, 1, 1, sMapName_BerryForest},
[MAPSEC_ICEFALL_CAVE] = { 0, 0, 1, 1, sMapName_IcefallCave},
@ -383,11 +383,11 @@ const struct RegionMapLocation gRegionMapEntries[] = {
[MAPSEC_DOTTED_HOLE] = { 0, 0, 1, 1, sMapName_DottedHole},
[MAPSEC_LOST_CAVE] = { 0, 0, 1, 1, sMapName_LostCave},
[MAPSEC_PATTERN_BUSH] = { 0, 0, 1, 1, sMapName_PatternBush},
[MAPSEC_ALTERING_CAVE] = { 0, 0, 1, 1, sMapName_AlteringCave},
[MAPSEC_ALTERING_CAVE_FRLG] = { 0, 0, 1, 1, sMapName_AlteringCave},
[MAPSEC_TANOBY_CHAMBERS] = { 0, 0, 1, 1, sMapName_TanobyChambers},
[MAPSEC_THREE_ISLE_PATH] = { 0, 0, 1, 1, sMapName_ThreeIslePath},
[MAPSEC_TANOBY_KEY] = { 0, 0, 1, 1, sMapName_TanobyKey},
[MAPSEC_BIRTH_ISLAND] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_BIRTH_ISLAND_FRLG] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_MONEAN_CHAMBER] = { 0, 0, 1, 1, sMapName_MoneanChamber},
[MAPSEC_LIPTOO_CHAMBER] = { 0, 0, 1, 1, sMapName_LiptooChamber},
[MAPSEC_WEEPTH_CHAMBER] = { 0, 0, 1, 1, sMapName_WeepthChamber},
@ -400,7 +400,7 @@ const struct RegionMapLocation gRegionMapEntries[] = {
[MAPSEC_AQUA_HIDEOUT] = {19, 3, 1, 1, sMapName_AquaHideout},
[MAPSEC_MAGMA_HIDEOUT] = { 6, 3, 1, 1, sMapName_MagmaHideout},
[MAPSEC_MIRAGE_TOWER] = { 8, 2, 1, 1, sMapName_MirageTower},
[MAPSEC_BIRTH_ISLAND_2] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_BIRTH_ISLAND] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_FARAWAY_ISLAND] = { 0, 0, 1, 1, sMapName_FarawayIsland},
[MAPSEC_ARTISAN_CAVE] = {22, 12, 1, 1, sMapName_ArtisanCave},
[MAPSEC_MARINE_CAVE] = { 0, 0, 1, 1, sMapName_MarineCave},
@ -410,8 +410,8 @@ const struct RegionMapLocation gRegionMapEntries[] = {
[MAPSEC_UNDERWATER_UNK1] = {24, 3, 2, 2, sMapName_Underwater},
[MAPSEC_UNDERWATER_129] = {24, 10, 2, 1, sMapName_Underwater},
[MAPSEC_DESERT_UNDERPASS] = { 2, 0, 1, 1, sMapName_DesertUnderpass},
[MAPSEC_ALTERING_CAVE_2] = { 6, 8, 1, 1, sMapName_AlteringCave},
[MAPSEC_NAVEL_ROCK2] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_ALTERING_CAVE] = { 6, 8, 1, 1, sMapName_AlteringCave},
[MAPSEC_NAVEL_ROCK] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_TRAINER_HILL] = { 8, 4, 1, 1, sMapName_TrainerHill}
};

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +1,51 @@
// Includes
#include "global.h"
#include "constants/decorations.h"
#include "decoration.h"
#include "decoration_inventory.h"
// Static type declarations
// Static RAM declarations
EWRAM_DATA struct DecorationInventory gDecorationInventories[8] = {};
// Static ROM declarations
// .rodata
// .text
EWRAM_DATA struct DecorationInventory gDecorationInventories[DECORCAT_COUNT] = {};
#define SET_DECOR_INV(i, ptr) {\
gDecorationInventories[i].items = ptr;\
gDecorationInventories[i].size = sizeof(ptr);\
gDecorationInventories[i].size = ARRAY_COUNT(ptr);\
}
void SetDecorationInventoriesPointers(void)
{
SET_DECOR_INV(0, gSaveBlock1Ptr->decorDesk);
SET_DECOR_INV(1, gSaveBlock1Ptr->decorChair);
SET_DECOR_INV(2, gSaveBlock1Ptr->decorPlant);
SET_DECOR_INV(3, gSaveBlock1Ptr->decorOrnament);
SET_DECOR_INV(4, gSaveBlock1Ptr->decorMat);
SET_DECOR_INV(5, gSaveBlock1Ptr->decorPoster);
SET_DECOR_INV(6, gSaveBlock1Ptr->decorDoll);
SET_DECOR_INV(7, gSaveBlock1Ptr->decorCushion);
SET_DECOR_INV(DECORCAT_DESK, gSaveBlock1Ptr->decorationDesks);
SET_DECOR_INV(DECORCAT_CHAIR, gSaveBlock1Ptr->decorationChairs);
SET_DECOR_INV(DECORCAT_PLANT, gSaveBlock1Ptr->decorationPlants);
SET_DECOR_INV(DECORCAT_ORNAMENT, gSaveBlock1Ptr->decorationOrnaments);
SET_DECOR_INV(DECORCAT_MAT, gSaveBlock1Ptr->decorationMats);
SET_DECOR_INV(DECORCAT_POSTER, gSaveBlock1Ptr->decorationPosters);
SET_DECOR_INV(DECORCAT_DOLL, gSaveBlock1Ptr->decorationDolls);
SET_DECOR_INV(DECORCAT_CUSHION, gSaveBlock1Ptr->decorationCushions);
InitDecorationContextItems();
}
static void ClearDecorationInventory(u8 idx)
static void ClearDecorationInventory(u8 category)
{
u8 i;
for (i = 0; i < gDecorationInventories[idx].size; i ++)
{
gDecorationInventories[idx].items[i] = DECOR_NONE;
}
for (i = 0; i < gDecorationInventories[category].size; i ++)
gDecorationInventories[category].items[i] = DECOR_NONE;
}
void ClearDecorationInventories(void)
{
u8 idx;
for (idx = 0; idx < 8; idx ++)
{
ClearDecorationInventory(idx);
}
u8 category;
for (category = 0; category < 8; category++)
ClearDecorationInventory(category);
}
s8 GetFirstEmptyDecorSlot(u8 idx)
s8 GetFirstEmptyDecorSlot(u8 category)
{
s8 i;
for (i = 0; i < (s8)gDecorationInventories[idx].size; i ++)
{
if (gDecorationInventories[idx].items[i] == DECOR_NONE)
for (i = 0; i < (s8)gDecorationInventories[category].size; i++)
{
if (gDecorationInventories[category].items[i] == DECOR_NONE)
return i;
}
}
return -1;
}
@ -78,10 +58,9 @@ bool8 CheckHasDecoration(u8 decor)
for (i = 0; i < gDecorationInventories[category].size; i ++)
{
if (gDecorationInventories[category].items[i] == decor)
{
return TRUE;
}
}
return FALSE;
}
@ -91,15 +70,11 @@ bool8 DecorationAdd(u8 decor)
s8 idx;
if (decor == DECOR_NONE)
{
return FALSE;
}
category = gDecorations[decor].category;
idx = GetFirstEmptyDecorSlot(category);
if (idx == -1)
{
return FALSE;
}
gDecorationInventories[category].items[idx] = decor;
return TRUE;
}
@ -107,13 +82,9 @@ bool8 DecorationAdd(u8 decor)
bool8 DecorationCheckSpace(u8 decor)
{
if (decor == DECOR_NONE)
{
return FALSE;
}
if (GetFirstEmptyDecorSlot(gDecorations[decor].category) == -1)
{
return FALSE;
}
return TRUE;
}
@ -124,9 +95,8 @@ s8 DecorationRemove(u8 decor)
i = 0;
if (decor == DECOR_NONE)
{
return 0;
}
for (i = 0; i < gDecorationInventories[gDecorations[decor].category].size; i ++)
{
category = gDecorations[decor].category;
@ -137,6 +107,7 @@ s8 DecorationRemove(u8 decor)
return 1;
}
}
return 0;
}
@ -160,19 +131,18 @@ void CondenseDecorationsInCategory(u8 category)
}
}
u8 GetNumOwnedDecorationsInCategory(u8 idx)
u8 GetNumOwnedDecorationsInCategory(u8 category)
{
u8 i;
u8 ct;
ct = 0;
for (i = 0; i < gDecorationInventories[idx].size; i ++)
for (i = 0; i < gDecorationInventories[category].size; i++)
{
if (gDecorationInventories[idx].items[i] != DECOR_NONE)
{
ct ++;
}
if (gDecorationInventories[category].items[i] != DECOR_NONE)
ct++;
}
return ct;
}

450
src/digit_obj_util.c Normal file
View File

@ -0,0 +1,450 @@
#include "global.h"
#include "digit_obj_util.h"
#include "malloc.h"
#include "decompress.h"
#include "main.h"
#include "battle_main.h"
struct DigitPrinter
{
bool8 isActive;
u8 firstOamId;
u8 strConvMode;
u8 oamCount;
u8 palTagIndex;
u8 size;
u8 shape;
u8 priority;
u8 xDelta;
u8 tilesPerImage;
u16 tileStart;
s16 x;
s16 y;
u16 tileTag;
u16 palTag;
u32 pow10;
s32 lastPrinted;
};
struct DigitPrinterAlloc
{
u32 count;
struct DigitPrinter *array;
};
// this file's functions
static u8 GetFirstOamId(u8 oamCount);;
static void CopyWorkToOam(struct DigitPrinter *objWork);
static void DrawNumObjsLeadingZeros(struct DigitPrinter *objWork, s32 num, bool32 sign);
static void DrawNumObjsMinusInFront(struct DigitPrinter *objWork, s32 num, bool32 sign);
static void DrawNumObjsMinusInBack(struct DigitPrinter *objWork, s32 num, bool32 sign);
static bool32 SharesTileWithAnyActive(u32 id);
static bool32 SharesPalWithAnyActive(u32 id);
// ewram
static EWRAM_DATA struct DigitPrinterAlloc *sOamWork = {0};
// const rom data
static const u8 sTilesPerImage[4][4] =
{
[ST_OAM_SQUARE] = {
[ST_OAM_SIZE_0] = 0x01, // SPRITE_SIZE_8x8
[ST_OAM_SIZE_1] = 0x04, // SPRITE_SIZE_16x16
[ST_OAM_SIZE_2] = 0x10, // SPRITE_SIZE_32x32
[ST_OAM_SIZE_3] = 0x40 // SPRITE_SIZE_64x64
},
[ST_OAM_H_RECTANGLE] = {
[ST_OAM_SIZE_0] = 0x02, // SPRITE_SIZE_16x8
[ST_OAM_SIZE_1] = 0x04, // SPRITE_SIZE_32x8
[ST_OAM_SIZE_2] = 0x08, // SPRITE_SIZE_32x16
[ST_OAM_SIZE_3] = 0x20 // SPRITE_SIZE_64x32
},
[ST_OAM_V_RECTANGLE] = {
[ST_OAM_SIZE_0] = 0x02, // SPRITE_SIZE_8x16
[ST_OAM_SIZE_1] = 0x04, // SPRITE_SIZE_8x32
[ST_OAM_SIZE_2] = 0x08, // SPRITE_SIZE_16x32
[ST_OAM_SIZE_3] = 0x20 // SPRITE_SIZE_32x64
}
};
// code
bool32 DigitObjUtil_Init(u32 count)
{
u32 i;
if (sOamWork != NULL)
DigitObjUtil_Free();
sOamWork = Alloc(sizeof(*sOamWork));
if (sOamWork == NULL)
return FALSE;
sOamWork->array = Alloc(sizeof(struct DigitPrinter) * count);
if (sOamWork->array == NULL)
{
Free(sOamWork);
return FALSE;
}
sOamWork->count = count;
for (i = 0; i < count; i++)
{
sOamWork->array[i].isActive = FALSE;
sOamWork->array[i].firstOamId = 0xFF;
}
return TRUE;
}
void DigitObjUtil_Free(void)
{
if (sOamWork != NULL)
{
if (sOamWork->array != NULL)
{
u32 i;
for (i = 0; i < sOamWork->count; i++)
DigitObjUtil_DeletePrinter(i);
Free(sOamWork->array);
}
FREE_AND_SET_NULL(sOamWork);
}
}
bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template)
{
u32 i;
if (sOamWork == NULL)
return FALSE;
if (sOamWork->array[id].isActive)
return FALSE;
sOamWork->array[id].firstOamId = GetFirstOamId(template->oamCount);
if (sOamWork->array[id].firstOamId == 0xFF)
return FALSE;
sOamWork->array[id].tileStart = GetSpriteTileStartByTag(template->spriteSheet->tag);
if (sOamWork->array[id].tileStart == 0xFFFF)
{
if (template->spriteSheet->size != 0)
{
sOamWork->array[id].tileStart = LoadSpriteSheet(template->spriteSheet);
}
else
{
struct CompressedSpriteSheet compSpriteSheet;
compSpriteSheet = *(struct CompressedSpriteSheet*)(template->spriteSheet);
compSpriteSheet.size = GetDecompressedDataSize(template->spriteSheet->data);
sOamWork->array[id].tileStart = LoadCompressedSpriteSheet(&compSpriteSheet);
}
if (sOamWork->array[id].tileStart == 0xFFFF)
return FALSE;
}
sOamWork->array[id].palTagIndex = IndexOfSpritePaletteTag(template->spritePal->tag);
if (sOamWork->array[id].palTagIndex == 0xFF)
sOamWork->array[id].palTagIndex = LoadSpritePalette(template->spritePal);
sOamWork->array[id].strConvMode = template->strConvMode;
sOamWork->array[id].oamCount = template->oamCount;
sOamWork->array[id].x = template->x;
sOamWork->array[id].y = template->y;
sOamWork->array[id].shape = template->shape;
sOamWork->array[id].size = template->size;
sOamWork->array[id].priority = template->priority;
sOamWork->array[id].xDelta = template->xDelta;
sOamWork->array[id].tilesPerImage = GetTilesPerImage(template->shape, template->size);
sOamWork->array[id].tileTag = template->spriteSheet->tag;
sOamWork->array[id].palTag = template->spritePal->tag;
sOamWork->array[id].isActive = TRUE;
// Decimal left shift
sOamWork->array[id].pow10 = 1;
for (i = 1; i < template->oamCount; i++)
sOamWork->array[id].pow10 *= 10;
CopyWorkToOam(&sOamWork->array[id]);
DigitObjUtil_PrintNumOn(id, num);
return TRUE;
}
static void CopyWorkToOam(struct DigitPrinter *objWork)
{
u32 i;
u32 oamId = objWork->firstOamId;
u32 x = objWork->x;
u32 oamCount = objWork->oamCount + 1;
CpuFill16(0, &gMain.oamBuffer[oamId], sizeof(struct OamData) * oamCount);
for (i = 0, oamId = objWork->firstOamId; i < oamCount; i++, oamId++)
{
gMain.oamBuffer[oamId].y = objWork->y;
gMain.oamBuffer[oamId].x = x;
gMain.oamBuffer[oamId].shape = objWork->shape;
gMain.oamBuffer[oamId].size = objWork->size;
gMain.oamBuffer[oamId].tileNum = objWork->tileStart;
gMain.oamBuffer[oamId].priority = objWork->priority;
gMain.oamBuffer[oamId].paletteNum = objWork->palTagIndex;
x += objWork->xDelta;
}
oamId--;
gMain.oamBuffer[oamId].x = objWork->x - objWork->xDelta;
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
gMain.oamBuffer[oamId].tileNum = objWork->tileStart + (objWork->tilesPerImage * 10);
}
void DigitObjUtil_PrintNumOn(u32 id, s32 num)
{
bool32 sign;
if (sOamWork == NULL)
return;
if (!sOamWork->array[id].isActive)
return;
sOamWork->array[id].lastPrinted = num;
if (num < 0)
{
sign = TRUE;
num *= -1;
}
else
{
sign = FALSE;
}
switch (sOamWork->array[id].strConvMode)
{
case 0:
default:
DrawNumObjsLeadingZeros(&sOamWork->array[id], num, sign);
break;
case 1:
DrawNumObjsMinusInFront(&sOamWork->array[id], num, sign);
break;
case 2:
DrawNumObjsMinusInBack(&sOamWork->array[id], num, sign);
break;
}
}
static void DrawNumObjsLeadingZeros(struct DigitPrinter *objWork, s32 num, bool32 sign)
{
u32 pow10 = objWork->pow10;
u32 oamId = objWork->firstOamId;
while (pow10 != 0)
{
u32 digit = num / pow10;
num -= (digit * pow10);
pow10 /= 10;
gMain.oamBuffer[oamId].tileNum = (digit * objWork->tilesPerImage) + objWork->tileStart;
oamId++;
}
if (sign)
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
else
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
}
static void DrawNumObjsMinusInFront(struct DigitPrinter *objWork, s32 num, bool32 sign)
{
u32 pow10 = objWork->pow10;
static int oamId;
static int curDigit;
static int firstDigit;
oamId = objWork->firstOamId;
curDigit = 0;
firstDigit = -1;
while (pow10 != 0)
{
u32 digit = num / pow10;
num -= (digit * pow10);
pow10 /= 10;
if (digit != 0 || firstDigit != -1 || pow10 == 0)
{
gMain.oamBuffer[oamId].tileNum = (digit * objWork->tilesPerImage) + objWork->tileStart;
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
if (firstDigit == -1)
firstDigit = curDigit;
}
else
{
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
}
oamId++;
curDigit++;
}
if (sign)
{
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
gMain.oamBuffer[oamId].x = objWork->x + ((firstDigit - 1) * objWork->xDelta);
}
else
{
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
}
}
static void DrawNumObjsMinusInBack(struct DigitPrinter *objWork, s32 num, bool32 sign)
{
u32 pow10 = objWork->pow10;
u32 oamId = objWork->firstOamId;
bool32 printingDigits = FALSE;
s32 nsprites = 0;
while (pow10 != 0)
{
u32 digit = num / pow10;
num -= (digit * pow10);
pow10 /= 10;
if (digit != 0 || printingDigits || pow10 == 0)
{
printingDigits = TRUE;
gMain.oamBuffer[oamId].tileNum = (digit * objWork->tilesPerImage) + objWork->tileStart;
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
oamId++;
nsprites++;
}
}
while (nsprites < objWork->oamCount)
{
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
oamId++;
nsprites++;
}
if (sign)
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
else
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
}
void DigitObjUtil_DeletePrinter(u32 id)
{
s32 oamId, oamCount, i;
if (sOamWork == NULL)
return;
if (!sOamWork->array[id].isActive)
return;
oamCount = sOamWork->array[id].oamCount + 1;
oamId = sOamWork->array[id].firstOamId;
for (i = 0; i < oamCount; i++, oamId++)
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
if (!SharesTileWithAnyActive(id))
FreeSpriteTilesByTag(sOamWork->array[id].tileTag);
if (!SharesPalWithAnyActive(id))
FreeSpritePaletteByTag(sOamWork->array[id].palTag);
sOamWork->array[id].isActive = FALSE;
}
void DigitObjUtil_HideOrShow(u32 id, bool32 hide)
{
s32 oamId, oamCount, i;
if (sOamWork == NULL)
return;
if (!sOamWork->array[id].isActive)
return;
oamCount = sOamWork->array[id].oamCount + 1;
oamId = sOamWork->array[id].firstOamId;
if (hide)
{
for (i = 0; i < oamCount; i++, oamId++)
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE;
}
else
{
for (i = 0; i < oamCount; i++, oamId++)
gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF;
DigitObjUtil_PrintNumOn(id, sOamWork->array[id].lastPrinted);
}
}
static u8 GetFirstOamId(u8 oamCount)
{
u32 i;
u16 firstOamId = 64;
for (i = 0; i < sOamWork->count; i++)
{
if (!sOamWork->array[i].isActive)
{
if (sOamWork->array[i].firstOamId != 0xFF && sOamWork->array[i].oamCount <= oamCount)
return sOamWork->array[i].firstOamId;
}
else
{
firstOamId += 1 + sOamWork->array[i].oamCount;
}
}
if (firstOamId + oamCount + 1 > 128)
return 0xFF;
else
return firstOamId;
}
static bool32 SharesTileWithAnyActive(u32 id)
{
u32 i;
for (i = 0; i < sOamWork->count; i++)
{
if (sOamWork->array[i].isActive && i != id
&& sOamWork->array[i].tileTag == sOamWork->array[id].tileTag)
{
return TRUE;
}
}
return FALSE;
}
static bool32 SharesPalWithAnyActive(u32 id)
{
u32 i;
for (i = 0; i < sOamWork->count; i++)
{
if (sOamWork->array[i].isActive && i != id
&& sOamWork->array[i].palTag == sOamWork->array[id].palTag)
{
return TRUE;
}
}
return FALSE;
}
u8 GetTilesPerImage(u32 shape, u32 size)
{
return sTilesPerImage[shape][size];
}

View File

@ -12,7 +12,7 @@
#include "m4a.h"
#include "main.h"
#include "palette.h"
#include "pokemon_jump.h"
#include "minigame_countdown.h"
#include "random.h"
#include "save.h"
#include "script.h"
@ -667,7 +667,7 @@ static void sub_8024E38(void)
switch (gUnknown_02022C98->unk10)
{
case 0:
sub_802EB24(7, 8, 120, 80, 0);
StartMinigameCountdown(7, 8, 120, 80, 0);
gUnknown_02022C98->unk10++;
break;
case 1:
@ -682,7 +682,7 @@ static void sub_8024E38(void)
}
break;
case 3:
if (!sub_802EB84())
if (!IsMinigameCountdownRunning())
{
gUnknown_02022C98->unk10++;
}

View File

@ -1754,7 +1754,7 @@ static void SetPlayerAvatarObjectEventIdAndObjectId(u8 objectEventId, u8 spriteI
gPlayerAvatar.objectEventId = objectEventId;
gPlayerAvatar.spriteId = spriteId;
gPlayerAvatar.gender = GetPlayerAvatarGenderByGraphicsId(gObjectEvents[objectEventId].graphicsId);
SetPlayerAvatarExtraStateTransition(gObjectEvents[objectEventId].graphicsId, 0x20);
SetPlayerAvatarExtraStateTransition(gObjectEvents[objectEventId].graphicsId, PLAYER_AVATAR_FLAG_5);
}
void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 graphicsId)

View File

@ -59,8 +59,8 @@ static bool8 ForcedMovement_SlideSouth(void);
static bool8 ForcedMovement_SlideNorth(void);
static bool8 ForcedMovement_SlideWest(void);
static bool8 ForcedMovement_SlideEast(void);
static bool8 ForcedMovement_0xBB(void);
static bool8 ForcedMovement_0xBC(void);
static bool8 ForcedMovement_MatJump(void);
static bool8 ForcedMovement_MatSpin(void);
static bool8 ForcedMovement_MuddySlope(void);
static void MovePlayerNotOnBike(u8, u16);
@ -99,10 +99,10 @@ static void PlayCollisionSoundIfNotFacingWarp(u8 a);
static void sub_808C280(struct ObjectEvent *);
static void StartStrengthAnim(u8, u8);
static void Task_BumpBoulder(u8 taskId);
static u8 sub_808C3A4(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static u8 do_boulder_dust(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static u8 sub_808C484(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static void Task_PushBoulder(u8 taskId);
static u8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static u8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static u8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
static void DoPlayerMatJump(void);
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
@ -182,8 +182,8 @@ static bool8 (*const sForcedMovementFuncs[])(void) =
ForcedMovement_SlideWest,
ForcedMovement_SlideEast,
ForcedMovement_PushedSouthByCurrent,
ForcedMovement_0xBB,
ForcedMovement_0xBC,
ForcedMovement_MatJump,
ForcedMovement_MatSpin,
ForcedMovement_MuddySlope,
};
@ -211,16 +211,16 @@ static const u8 sAcroBikeTrickCollisionTypes[] = {
COLLISION_HORIZONTAL_RAIL,
};
static void (*const gUnknown_084974B8[])(struct ObjectEvent *) =
static void (*const sPlayerAvatarTransitionFuncs[])(struct ObjectEvent *) =
{
PlayerAvatarTransition_Normal,
PlayerAvatarTransition_MachBike,
PlayerAvatarTransition_AcroBike,
PlayerAvatarTransition_Surfing,
PlayerAvatarTransition_Underwater,
PlayerAvatarTransition_ReturnToField,
PlayerAvatarTransition_Dummy,
PlayerAvatarTransition_Dummy,
[PLAYER_AVATAR_STATE_NORMAL] = PlayerAvatarTransition_Normal,
[PLAYER_AVATAR_STATE_MACH_BIKE] = PlayerAvatarTransition_MachBike,
[PLAYER_AVATAR_STATE_ACRO_BIKE] = PlayerAvatarTransition_AcroBike,
[PLAYER_AVATAR_STATE_SURFING] = PlayerAvatarTransition_Surfing,
[PLAYER_AVATAR_STATE_UNDERWATER] = PlayerAvatarTransition_Underwater,
[PLAYER_AVATAR_STATE_FIELD_MOVE] = PlayerAvatarTransition_ReturnToField,
[PLAYER_AVATAR_STATE_FISHING] = PlayerAvatarTransition_Dummy,
[PLAYER_AVATAR_STATE_WATERING] = PlayerAvatarTransition_Dummy,
};
static bool8 (*const sArrowWarpMetatileBehaviorChecks[])(u8) =
@ -259,23 +259,23 @@ static const u8 sFRLGAvatarGfxIds[] = {OBJ_EVENT_GFX_RED, OBJ_EVENT_GFX_LEAF};
static const u8 sRSAvatarGfxIds[] = {OBJ_EVENT_GFX_LINK_RS_BRENDAN, OBJ_EVENT_GFX_LINK_RS_MAY};
static const u8 gUnknown_0849750C[2][5][2] =
static const u8 sPlayerAvatarGfxToStateFlag[2][5][2] =
{
//male
[MALE] =
{
{OBJ_EVENT_GFX_BRENDAN_NORMAL, 1},
{OBJ_EVENT_GFX_BRENDAN_MACH_BIKE, 2},
{OBJ_EVENT_GFX_BRENDAN_ACRO_BIKE, 4},
{OBJ_EVENT_GFX_BRENDAN_SURFING, 8},
{OBJ_EVENT_GFX_BRENDAN_UNDERWATER, 16},
{OBJ_EVENT_GFX_BRENDAN_NORMAL, PLAYER_AVATAR_FLAG_ON_FOOT},
{OBJ_EVENT_GFX_BRENDAN_MACH_BIKE, PLAYER_AVATAR_FLAG_MACH_BIKE},
{OBJ_EVENT_GFX_BRENDAN_ACRO_BIKE, PLAYER_AVATAR_FLAG_ACRO_BIKE},
{OBJ_EVENT_GFX_BRENDAN_SURFING, PLAYER_AVATAR_FLAG_SURFING},
{OBJ_EVENT_GFX_BRENDAN_UNDERWATER, PLAYER_AVATAR_FLAG_UNDERWATER},
},
//female
[FEMALE] =
{
{OBJ_EVENT_GFX_MAY_NORMAL, 1},
{OBJ_EVENT_GFX_MAY_MACH_BIKE, 2},
{OBJ_EVENT_GFX_MAY_ACRO_BIKE, 4},
{OBJ_EVENT_GFX_MAY_SURFING, 8},
{OBJ_EVENT_GFX_MAY_UNDERWATER, 16},
{OBJ_EVENT_GFX_MAY_NORMAL, PLAYER_AVATAR_FLAG_ON_FOOT},
{OBJ_EVENT_GFX_MAY_MACH_BIKE, PLAYER_AVATAR_FLAG_MACH_BIKE},
{OBJ_EVENT_GFX_MAY_ACRO_BIKE, PLAYER_AVATAR_FLAG_ACRO_BIKE},
{OBJ_EVENT_GFX_MAY_SURFING, PLAYER_AVATAR_FLAG_SURFING},
{OBJ_EVENT_GFX_MAY_UNDERWATER, PLAYER_AVATAR_FLAG_UNDERWATER},
}
};
@ -287,11 +287,11 @@ static bool8 (*const sArrowWarpMetatileBehaviorChecks2[])(u8) = //Duplicate of
MetatileBehavior_IsEastArrowWarp,
};
static bool8 (*const gUnknown_08497530[])(struct Task *, struct ObjectEvent *, struct ObjectEvent *) =
static bool8 (*const sPushBoulderFuncs[])(struct Task *, struct ObjectEvent *, struct ObjectEvent *) =
{
sub_808C3A4,
do_boulder_dust,
sub_808C484,
PushBoulder_Start,
PushBoulder_Move,
PushBoulder_End,
};
static bool8 (*const sPlayerAvatarSecretBaseMatJump[])(struct Task *, struct ObjectEvent *) =
@ -547,13 +547,13 @@ static bool8 ForcedMovement_SlideEast(void)
return ForcedMovement_Slide(DIR_EAST, PlayerGoSpeed2);
}
static bool8 ForcedMovement_0xBB(void)
static bool8 ForcedMovement_MatJump(void)
{
DoPlayerMatJump();
return TRUE;
}
static bool8 ForcedMovement_0xBC(void)
static bool8 ForcedMovement_MatSpin(void)
{
DoPlayerMatSpin();
return TRUE;
@ -807,23 +807,23 @@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction)
void SetPlayerAvatarTransitionFlags(u16 transitionFlags)
{
gPlayerAvatar.unk1 |= transitionFlags;
gPlayerAvatar.transitionFlags |= transitionFlags;
DoPlayerAvatarTransition();
}
static void DoPlayerAvatarTransition(void)
{
u8 i;
u8 flags = gPlayerAvatar.unk1;
u8 flags = gPlayerAvatar.transitionFlags;
if (flags != 0)
{
for (i = 0; i < 8; i++, flags >>= 1)
for (i = 0; i < ARRAY_COUNT(sPlayerAvatarTransitionFuncs); i++, flags >>= 1)
{
if (flags & 1)
gUnknown_084974B8[i](&gObjectEvents[gPlayerAvatar.objectEventId]);
sPlayerAvatarTransitionFuncs[i](&gObjectEvents[gPlayerAvatar.objectEventId]);
}
gPlayerAvatar.unk1 = 0;
gPlayerAvatar.transitionFlags = 0;
}
}
@ -1186,12 +1186,12 @@ void sub_808BC90(s16 x, s16 y)
MoveObjectEventToMapCoords(&gObjectEvents[gPlayerAvatar.objectEventId], x, y);
}
u8 TestPlayerAvatarFlags(u8 a)
u8 TestPlayerAvatarFlags(u8 flag)
{
return gPlayerAvatar.flags & a;
return gPlayerAvatar.flags & flag;
}
u8 sub_808BCD0(void)
u8 GetPlayerAvatarFlags(void)
{
return gPlayerAvatar.flags;
}
@ -1335,32 +1335,32 @@ static u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender)
{
u8 i;
for (i = 0; i < 5; i++)
for (i = 0; i < ARRAY_COUNT(sPlayerAvatarGfxToStateFlag[0]); i++)
{
if (gUnknown_0849750C[gender][i][0] == graphicsId)
return gUnknown_0849750C[gender][i][1];
if (sPlayerAvatarGfxToStateFlag[gender][i][0] == graphicsId)
return sPlayerAvatarGfxToStateFlag[gender][i][1];
}
return 1;
return PLAYER_AVATAR_FLAG_ON_FOOT;
}
u8 GetPlayerAvatarGraphicsIdByCurrentState(void)
{
u8 i;
u8 r5 = gPlayerAvatar.flags;
u8 flags = gPlayerAvatar.flags;
for (i = 0; i < 5; i++)
for (i = 0; i < ARRAY_COUNT(sPlayerAvatarGfxToStateFlag[0]); i++)
{
if (gUnknown_0849750C[gPlayerAvatar.gender][i][1] & r5)
return gUnknown_0849750C[gPlayerAvatar.gender][i][0];
if (sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i][1] & flags)
return sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i][0];
}
return 0;
}
void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 b)
void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 transitionFlag)
{
u8 unk = GetPlayerAvatarStateTransitionByGraphicsId(graphicsId, gPlayerAvatar.gender);
u8 stateFlag = GetPlayerAvatarStateTransitionByGraphicsId(graphicsId, gPlayerAvatar.gender);
gPlayerAvatar.unk1 |= unk | b;
gPlayerAvatar.transitionFlags |= stateFlag | transitionFlag;
DoPlayerAvatarTransition();
}
@ -1384,7 +1384,7 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender)
playerObjEventTemplate.flagId = 0;
objectEventId = SpawnSpecialObjectEvent(&playerObjEventTemplate);
objectEvent = &gObjectEvents[objectEventId];
objectEvent->isPlayer = 1;
objectEvent->isPlayer = TRUE;
objectEvent->warpArrowSpriteId = CreateWarpArrowSprite();
ObjectEventTurn(objectEvent, direction);
ClearPlayerAvatarInfo();
@ -1453,22 +1453,22 @@ static void sub_808C280(struct ObjectEvent *objectEvent)
static void StartStrengthAnim(u8 a, u8 b)
{
u8 taskId = CreateTask(Task_BumpBoulder, 0xFF);
u8 taskId = CreateTask(Task_PushBoulder, 0xFF);
gTasks[taskId].data[1] = a;
gTasks[taskId].data[2] = b;
Task_BumpBoulder(taskId);
Task_PushBoulder(taskId);
}
static void Task_BumpBoulder(u8 taskId)
static void Task_PushBoulder(u8 taskId)
{
while (gUnknown_08497530[gTasks[taskId].data[0]](&gTasks[taskId],
while (sPushBoulderFuncs[gTasks[taskId].data[0]](&gTasks[taskId],
&gObjectEvents[gPlayerAvatar.objectEventId],
&gObjectEvents[gTasks[taskId].data[1]]))
;
}
static bool8 sub_808C3A4(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
{
ScriptContext2_Enable();
gPlayerAvatar.preventStep = TRUE;
@ -1476,7 +1476,7 @@ static bool8 sub_808C3A4(struct Task *task, struct ObjectEvent *playerObject, st
return FALSE;
}
static bool8 do_boulder_dust(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
{
if (ObjectEventIsHeldMovementActive(playerObject))
{
@ -1506,7 +1506,7 @@ static bool8 do_boulder_dust(struct Task *task, struct ObjectEvent *playerObject
return FALSE;
}
static bool8 sub_808C484(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject)
{
if (ObjectEventCheckHeldMovementStatus(playerObject)
&& ObjectEventCheckHeldMovementStatus(strengthObject))
@ -1515,7 +1515,7 @@ static bool8 sub_808C484(struct Task *task, struct ObjectEvent *playerObject, st
ObjectEventClearHeldMovementIfFinished(strengthObject);
gPlayerAvatar.preventStep = FALSE;
ScriptContext2_Disable();
DestroyTask(FindTaskIdByFunc(Task_BumpBoulder));
DestroyTask(FindTaskIdByFunc(Task_PushBoulder));
}
return FALSE;
}
@ -1545,7 +1545,7 @@ static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct ObjectEvent
if (task->data[1] > 1)
{
gPlayerAvatar.preventStep = FALSE;
gPlayerAvatar.unk1 |= 0x20;
gPlayerAvatar.transitionFlags |= PLAYER_AVATAR_FLAG_5;
DestroyTask(FindTaskIdByFunc(DoPlayerAvatarSecretBaseMatJump));
}
}

View File

@ -13,13 +13,23 @@
#include "window.h"
#include "constants/rgb.h"
/*
* This is the type of map shown when interacting with the metatiles for
* a wall-mounted Region Map (on the wall of the Pokemon Centers near the PC)
* It does not zoom, and pressing A or B closes the map
*
* For the region map in the pokenav, see pokenav_region_map.c
* For the region map in the pokedex, see pokdex_area_screen.c/pokedex_area_region_map.c
* For the fly map, and utility functions all of the maps use, see region_map.c
*/
// Static type declarations
// Static RAM declarations
static EWRAM_DATA struct {
MainCallback callback;
u32 filler_004;
u32 unused;
struct RegionMap regionMap;
u16 state;
} *sFieldRegionMapHandler = NULL;
@ -34,7 +44,7 @@ static void PrintRegionMapSecName(void);
// .rodata
static const struct BgTemplate gUnknown_085E5068[] = {
static const struct BgTemplate sFieldRegionMapBgTemplates[] = {
{
.bg = 0,
.charBaseIndex = 0,
@ -54,7 +64,7 @@ static const struct BgTemplate gUnknown_085E5068[] = {
}
};
static const struct WindowTemplate gUnknown_085E5070[] =
static const struct WindowTemplate sFieldRegionMapWindowTemplates[] =
{
{
.bg = 0,
@ -102,8 +112,8 @@ static void MCB2_InitRegionMapRegisters(void)
ResetSpriteData();
FreeAllSpritePalettes();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(1, gUnknown_085E5068, 2);
InitWindows(gUnknown_085E5070);
InitBgsFromTemplates(1, sFieldRegionMapBgTemplates, ARRAY_COUNT(sFieldRegionMapBgTemplates));
InitWindows(sFieldRegionMapWindowTemplates);
DeactivateAllTextPrinters();
LoadUserWindowBorderGfx(0, 0x27, 0xd0);
clear_scheduled_bg_copies_to_vram();
@ -134,7 +144,7 @@ static void FieldUpdateRegionMap(void)
switch (sFieldRegionMapHandler->state)
{
case 0:
InitRegionMap(&sFieldRegionMapHandler->regionMap, 0);
InitRegionMap(&sFieldRegionMapHandler->regionMap, FALSE);
CreateRegionMapPlayerIcon(0, 0);
CreateRegionMapCursor(1, 1);
sFieldRegionMapHandler->state++;
@ -162,13 +172,13 @@ static void FieldUpdateRegionMap(void)
}
break;
case 4:
switch (sub_81230AC())
switch (DoRegionMapInputCallback())
{
case INPUT_EVENT_MOVE_END:
case MAP_INPUT_MOVE_END:
PrintRegionMapSecName();
break;
case INPUT_EVENT_A_BUTTON:
case INPUT_EVENT_B_BUTTON:
case MAP_INPUT_A_BUTTON:
case MAP_INPUT_B_BUTTON:
sFieldRegionMapHandler->state++;
break;
}
@ -184,8 +194,7 @@ static void FieldUpdateRegionMap(void)
SetMainCallback2(sFieldRegionMapHandler->callback);
if (sFieldRegionMapHandler != NULL)
{
free(sFieldRegionMapHandler);
sFieldRegionMapHandler = NULL;
FREE_AND_SET_NULL(sFieldRegionMapHandler);
}
FreeAllWindowBuffers();
}
@ -195,7 +204,7 @@ static void FieldUpdateRegionMap(void)
static void PrintRegionMapSecName(void)
{
if (sFieldRegionMapHandler->regionMap.iconDrawType != MAPSECTYPE_NONE)
if (sFieldRegionMapHandler->regionMap.mapSecType != MAPSECTYPE_NONE)
{
FillWindowPixelBuffer(0, PIXEL_FILL(1));
AddTextPrinterParameterized(0, 1, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL);

View File

@ -3550,21 +3550,21 @@ void CreateAbnormalWeatherEvent(void)
if (FlagGet(FLAG_DEFEATED_KYOGRE) == TRUE)
{
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % ABNORMAL_WEATHER_COUNT_PER_LEGENDARY) + ABNORMAL_WEATHER_GROUDON_LOCATIONS_START);
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % TERRA_CAVE_LOCATIONS) + TERRA_CAVE_LOCATIONS_START);
}
else if (FlagGet(FLAG_DEFEATED_GROUDON) == TRUE)
{
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % ABNORMAL_WEATHER_COUNT_PER_LEGENDARY) + ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START);
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % MARINE_CAVE_LOCATIONS) + MARINE_CAVE_LOCATIONS_START);
}
else if ((randomValue & 1) == 0)
{
randomValue = Random();
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % ABNORMAL_WEATHER_COUNT_PER_LEGENDARY) + ABNORMAL_WEATHER_GROUDON_LOCATIONS_START);
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % TERRA_CAVE_LOCATIONS) + TERRA_CAVE_LOCATIONS_START);
}
else
{
randomValue = Random();
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % ABNORMAL_WEATHER_COUNT_PER_LEGENDARY) + ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START);
VarSet(VAR_ABNORMAL_WEATHER_LOCATION, (randomValue % MARINE_CAVE_LOCATIONS) + MARINE_CAVE_LOCATIONS_START);
}
}
@ -3595,14 +3595,10 @@ bool32 GetAbnormalWeatherMapNameAndType(void)
GetMapName(gStringVar1, sAbnormalWeatherMapNumbers[abnormalWeather - 1], 0);
if (abnormalWeather < ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START)
{
if (abnormalWeather < MARINE_CAVE_LOCATIONS_START)
return FALSE;
}
else
{
return TRUE;
}
}
bool8 AbnormalWeatherHasExpired(void)

Some files were not shown because too many files have changed in this diff Show More