diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/battle_tower.h | 2 | ||||
-rw-r--r-- | include/cereader_tool.h | 20 | ||||
-rw-r--r-- | include/constants/battle.h | 2 | ||||
-rw-r--r-- | include/constants/coins.h | 6 | ||||
-rw-r--r-- | include/constants/field_effects.h | 2 | ||||
-rw-r--r-- | include/constants/flags.h | 4 | ||||
-rw-r--r-- | include/constants/global.h | 2 | ||||
-rw-r--r-- | include/constants/layouts.h | 58 | ||||
-rw-r--r-- | include/constants/map_groups.h | 30 | ||||
-rw-r--r-- | include/constants/metatile_labels.h | 24 | ||||
-rw-r--r-- | include/constants/party_menu.h | 1 | ||||
-rw-r--r-- | include/constants/trainer_tower.h | 46 | ||||
-rw-r--r-- | include/global.h | 32 | ||||
-rw-r--r-- | include/renewable_hidden_items.h | 1 | ||||
-rw-r--r-- | include/script.h | 2 | ||||
-rw-r--r-- | include/trainer_tower.h | 6 |
16 files changed, 154 insertions, 84 deletions
diff --git a/include/battle_tower.h b/include/battle_tower.h index 87f847aa4..be07320c9 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -33,8 +33,6 @@ void ValidateEReaderTrainer(void); u8 GetBattleTowerTrainerFrontSpriteId(void); u8 GetEreaderTrainerFrontSpriteId(void); void CopyEReaderTrainerName5(u8 *dest); -void sub_815DC40(u8 *dest, u8 opponentIdx); -void sub_815DBF4(u8 *dest, u8 opponentIdx); void GetBattleTowerTrainerName(u8 *text); u8 GetEreaderTrainerClassId(void); u8 GetBattleTowerTrainerClassNameId(void); diff --git a/include/cereader_tool.h b/include/cereader_tool.h index 6275eaabf..dd1866fb3 100644 --- a/include/cereader_tool.h +++ b/include/cereader_tool.h @@ -2,6 +2,7 @@ #define GUARD_CEREADER_TOOL_H #include "global.h" +#include "constants/trainer_tower.h" struct TrainerTowerTrainer { @@ -21,30 +22,31 @@ struct TrainerTowerFloor /* 0x001 */ u8 floorIdx; /* 0x002 */ u8 challengeType; /* 0x003 */ u8 prize; - /* 0x004 */ struct TrainerTowerTrainer trainers[3]; + /* 0x004 */ struct TrainerTowerTrainer trainers[MAX_TRAINERS_PER_FLOOR]; /* 0x3DC */ u32 checksum; }; -struct EReaderTrainerHillSetSubstruct +struct EReaderTrainerTowerSetSubstruct { - u8 count; + u8 numFloors; u8 id; u16 dummy; u32 checksum; }; -struct EReaderTrainerHillSet +struct EReaderTrainerTowerSet { - u8 count; + u8 numFloors; u8 id; u16 dummy; u32 checksum; - struct TrainerTowerFloor floors[8]; + struct TrainerTowerFloor floors[MAX_TRAINER_TOWER_FLOORS]; }; -bool32 ValidateTrainerTowerData(struct EReaderTrainerHillSet * ttdata); -bool32 CEReaderTool_SaveTrainerTower(struct EReaderTrainerHillSet * ttdata); -bool32 CEReaderTool_LoadTrainerTower(struct EReaderTrainerHillSet * ttdata); +bool32 ValidateTrainerTowerData(struct EReaderTrainerTowerSet * ttdata); +bool32 CEReaderTool_SaveTrainerTower(struct EReaderTrainerTowerSet * ttdata); +bool32 CEReaderTool_LoadTrainerTower(struct EReaderTrainerTowerSet * ttdata); u8 sub_815D654(void); +bool32 ReadTrainerTowerAndValidate(void); #endif //GUARD_CEREADER_TOOL_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 63be37936..a80038f2c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -71,7 +71,7 @@ #define BATTLE_TYPE_x800000 0x800000 #define BATTLE_TYPE_RECORDED 0x1000000 #define BATTLE_TYPE_x2000000 0x2000000 -#define BATTLE_TYPE_TRAINER_HILL 0x4000000 +#define BATTLE_TYPE_x4000000 0x4000000 #define BATTLE_TYPE_SECRET_BASE 0x8000000 #define BATTLE_TYPE_GROUDON 0x10000000 #define BATTLE_TYPE_KYOGRE 0x20000000 diff --git a/include/constants/coins.h b/include/constants/coins.h new file mode 100644 index 000000000..3ae3bb23f --- /dev/null +++ b/include/constants/coins.h @@ -0,0 +1,6 @@ +#ifndef GUARD_CONSTANTS_COINS_H +#define GUARD_CONSTANTS_COINS_H + +#define MAX_COINS 9999 + +#endif // GUARD_CONSTANTS_COINS_H diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h index 3ed7d8ce2..1fd6777f0 100644 --- a/include/constants/field_effects.h +++ b/include/constants/field_effects.h @@ -65,7 +65,7 @@ #define FLDEFF_PCTURN_ON 61 #define FLDEFF_HALL_OF_FAME_RECORD 62 #define FLDEFF_USE_TELEPORT 63 -#define FLDEFF_UNK_40 64 +#define FLDEFF_UNK_40 64 // TODO: game corner smile icon? #define FLDEFF_UNK_41 65 // TODO: related to vs_seeker #define FLDEFF_UNK_42 66 // TODO: related to trainer see #define FLDEFF_UNK_43 67 // TODO: related to deoxys diff --git a/include/constants/flags.h b/include/constants/flags.h index 26ffa8a7c..7555f3c6b 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1046,7 +1046,7 @@ #define HIDDEN_ITEM_SAFARI_ZONE_WEST_REVIVE 23 #define HIDDEN_ITEM_SILPH_CO_5F_ELIXIR 24 #define HIDDEN_ITEM_SILPH_CO_9F_MAX_POTION 25 -#define HIDDEN_ITEM_SAFFRON_CITY_HOUSE1_2F_NUGGET 26 +#define HIDDEN_ITEM_SAFFRON_CITY_COPYCATS_HOUSE_2F_NUGGET 26 #define HIDDEN_ITEM_POWER_PLANT_MAX_ELIXIR 27 #define HIDDEN_ITEM_POWER_PLANT_THUNDER_STONE 28 #define HIDDEN_ITEM_SEAFOAM_ISLANDS_B3F_NUGGET 29 @@ -1415,7 +1415,7 @@ #define FLAG_WORLD_MAP_THREE_ISLAND_BERRY_FOREST (SYS_FLAGS + 0xB7) #define FLAG_WORLD_MAP_FOUR_ISLAND_ICEFALL_CAVE_ENTRANCE (SYS_FLAGS + 0xB8) #define FLAG_WORLD_MAP_FIVE_ISLAND_ROCKET_WAREHOUSE (SYS_FLAGS + 0xB9) -#define FLAG_WORLD_MAP_SEVEN_ISLAND_TRAINER_TOWER_LOBBY (SYS_FLAGS + 0xBA) +#define FLAG_WORLD_MAP_TRAINER_TOWER_LOBBY (SYS_FLAGS + 0xBA) #define FLAG_WORLD_MAP_SIX_ISLAND_DOTTED_HOLE_1F (SYS_FLAGS + 0xBB) #define FLAG_WORLD_MAP_FIVE_ISLAND_LOST_CAVE_ENTRANCE (SYS_FLAGS + 0xBC) #define FLAG_WORLD_MAP_SIX_ISLAND_PATTERN_BUSH (SYS_FLAGS + 0xBD) diff --git a/include/constants/global.h b/include/constants/global.h index 7f3c80bb4..ae9a0da3b 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -34,6 +34,8 @@ #define QUEST_LOG_SCENE_COUNT 4 +#define NUM_TOWER_CHALLENGE_TYPES 4 + #define MALE 0 #define FEMALE 1 #define GENDER_COUNT 2 diff --git a/include/constants/layouts.h b/include/constants/layouts.h index 657d531e8..5f9ae3107 100644 --- a/include/constants/layouts.h +++ b/include/constants/layouts.h @@ -208,8 +208,8 @@ #define LAYOUT_ROUTE16_NORTH_ENTRANCE_1F 223 #define LAYOUT_ENTRANCE_1F 224 #define LAYOUT_ROCKET_HIDEOUT_ELEVATOR 225 -#define LAYOUT_SAFFRON_CITY_HOUSE1_1F 226 -#define LAYOUT_SAFFRON_CITY_HOUSE1_2F 227 +#define LAYOUT_SAFFRON_CITY_COPYCATS_HOUSE_1F 226 +#define LAYOUT_SAFFRON_CITY_COPYCATS_HOUSE_2F 227 #define LAYOUT_SAFFRON_CITY_DOJO 228 #define LAYOUT_SILPH_CO_ELEVATOR 229 #define LAYOUT_ONE_ISLAND 230 @@ -279,17 +279,17 @@ #define LAYOUT_FOUR_ISLAND_ICEFALL_CAVE_1F 294 #define LAYOUT_FOUR_ISLAND_ICEFALL_CAVE_B1F 295 #define LAYOUT_FOUR_ISLAND_ICEFALL_CAVE_BACK 296 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_LOBBY 297 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_1F 298 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_2F 299 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_3F 300 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_4F 301 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_5F 302 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_6F 303 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_7F 304 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_8F 305 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_ROOF 306 -#define LAYOUT_SEVEN_ISLAND_TRAINER_TOWER_ELEVATOR 307 +#define LAYOUT_TRAINER_TOWER_LOBBY 297 +#define LAYOUT_TRAINER_TOWER_1F 298 +#define LAYOUT_TRAINER_TOWER_2F 299 +#define LAYOUT_TRAINER_TOWER_3F 300 +#define LAYOUT_TRAINER_TOWER_4F 301 +#define LAYOUT_TRAINER_TOWER_5F 302 +#define LAYOUT_TRAINER_TOWER_6F 303 +#define LAYOUT_TRAINER_TOWER_7F 304 +#define LAYOUT_TRAINER_TOWER_8F 305 +#define LAYOUT_TRAINER_TOWER_ROOF 306 +#define LAYOUT_TRAINER_TOWER_ELEVATOR 307 #define LAYOUT_CERULEAN_CITY_HOUSE5 308 #define LAYOUT_SIX_ISLAND_DOTTED_HOLE_1F 309 #define LAYOUT_SIX_ISLAND_DOTTED_HOLE_B1F 310 @@ -348,22 +348,22 @@ #define LAYOUT_SEVEN_ISLAND_TANOBY_RUINS_VIAPOIS_CHAMBER 363 #define LAYOUT_NAVEL_ROCK_B1F 364 #define LAYOUT_NAVEL_ROCK_FORK 365 -#define LAYOUT_UNUSED_LAYOUT_834BC2C 366 -#define LAYOUT_UNUSED_LAYOUT_834BEB4 367 -#define LAYOUT_UNUSED_LAYOUT_834C13C 368 -#define LAYOUT_UNUSED_LAYOUT_834C3C4 369 -#define LAYOUT_UNUSED_LAYOUT_834C64C 370 -#define LAYOUT_UNUSED_LAYOUT_834C8D4 371 -#define LAYOUT_UNUSED_LAYOUT_834CB5C 372 -#define LAYOUT_UNUSED_LAYOUT_834CDE4 373 -#define LAYOUT_UNUSED_LAYOUT_834D06C 374 -#define LAYOUT_UNUSED_LAYOUT_834D2F4 375 -#define LAYOUT_UNUSED_LAYOUT_834D57C 376 -#define LAYOUT_UNUSED_LAYOUT_834D804 377 -#define LAYOUT_UNUSED_LAYOUT_834DA8C 378 -#define LAYOUT_UNUSED_LAYOUT_834DD14 379 -#define LAYOUT_UNUSED_LAYOUT_834DF9C 380 -#define LAYOUT_UNUSED_LAYOUT_834E224 381 +#define LAYOUT_TRAINER_TOWER_1F_DOUBLES 366 +#define LAYOUT_TRAINER_TOWER_2F_DOUBLES 367 +#define LAYOUT_TRAINER_TOWER_3F_DOUBLES 368 +#define LAYOUT_TRAINER_TOWER_4F_DOUBLES 369 +#define LAYOUT_TRAINER_TOWER_5F_DOUBLES 370 +#define LAYOUT_TRAINER_TOWER_6F_DOUBLES 371 +#define LAYOUT_TRAINER_TOWER_7F_DOUBLES 372 +#define LAYOUT_TRAINER_TOWER_8F_DOUBLES 373 +#define LAYOUT_TRAINER_TOWER_1F_KNOCKOUT 374 +#define LAYOUT_TRAINER_TOWER_2F_KNOCKOUT 375 +#define LAYOUT_TRAINER_TOWER_3F_KNOCKOUT 376 +#define LAYOUT_TRAINER_TOWER_4F_KNOCKOUT 377 +#define LAYOUT_TRAINER_TOWER_5F_KNOCKOUT 378 +#define LAYOUT_TRAINER_TOWER_6F_KNOCKOUT 379 +#define LAYOUT_TRAINER_TOWER_7F_KNOCKOUT 380 +#define LAYOUT_TRAINER_TOWER_8F_KNOCKOUT 381 #define LAYOUT_SEVEN_ISLAND_HOUSE_ROOM1 382 #define LAYOUT_ONE_ISLAND_KINDLE_ROAD_EMBER_SPA 383 diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index 0cc1c27fb..fe7178dcf 100644 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -135,17 +135,17 @@ // Map Group 2 #define MAP_NAVEL_ROCK_EXTERIOR (0 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_1F (1 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_2F (2 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_3F (3 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_4F (4 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_5F (5 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_6F (6 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_7F (7 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_8F (8 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_ROOF (9 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_LOBBY (10 | (2 << 8)) -#define MAP_SEVEN_ISLAND_TRAINER_TOWER_ELEVATOR (11 | (2 << 8)) +#define MAP_TRAINER_TOWER_1F (1 | (2 << 8)) +#define MAP_TRAINER_TOWER_2F (2 | (2 << 8)) +#define MAP_TRAINER_TOWER_3F (3 | (2 << 8)) +#define MAP_TRAINER_TOWER_4F (4 | (2 << 8)) +#define MAP_TRAINER_TOWER_5F (5 | (2 << 8)) +#define MAP_TRAINER_TOWER_6F (6 | (2 << 8)) +#define MAP_TRAINER_TOWER_7F (7 | (2 << 8)) +#define MAP_TRAINER_TOWER_8F (8 | (2 << 8)) +#define MAP_TRAINER_TOWER_ROOF (9 | (2 << 8)) +#define MAP_TRAINER_TOWER_LOBBY (10 | (2 << 8)) +#define MAP_TRAINER_TOWER_ELEVATOR (11 | (2 << 8)) #define MAP_FIVE_ISLAND_LOST_CAVE_ENTRANCE (12 | (2 << 8)) #define MAP_FIVE_ISLAND_LOST_CAVE_ROOM1 (13 | (2 << 8)) #define MAP_FIVE_ISLAND_LOST_CAVE_ROOM2 (14 | (2 << 8)) @@ -366,15 +366,15 @@ #define MAP_INDIGO_PLATEAU_POKEMON_CENTER_2F (1 | (13 << 8)) // Map Group 14 -#define MAP_SAFFRON_CITY_HOUSE1_1F (0 | (14 << 8)) -#define MAP_SAFFRON_CITY_HOUSE1_2F (1 | (14 << 8)) +#define MAP_SAFFRON_CITY_COPYCATS_HOUSE_1F (0 | (14 << 8)) +#define MAP_SAFFRON_CITY_COPYCATS_HOUSE_2F (1 | (14 << 8)) #define MAP_SAFFRON_CITY_DOJO (2 | (14 << 8)) #define MAP_SAFFRON_CITY_GYM (3 | (14 << 8)) -#define MAP_SAFFRON_CITY_HOUSE2 (4 | (14 << 8)) +#define MAP_SAFFRON_CITY_HOUSE (4 | (14 << 8)) #define MAP_SAFFRON_CITY_MART (5 | (14 << 8)) #define MAP_SAFFRON_CITY_POKEMON_CENTER_1F (6 | (14 << 8)) #define MAP_SAFFRON_CITY_POKEMON_CENTER_2F (7 | (14 << 8)) -#define MAP_SAFFRON_CITY_HOUSE3 (8 | (14 << 8)) +#define MAP_SAFFRON_CITY_MR_PSYCHICS_HOUSE (8 | (14 << 8)) #define MAP_SAFFRON_CITY_POKEMON_TRAINER_FAN_CLUB (9 | (14 << 8)) // Map Group 15 diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 8726113f4..0ef192b73 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -39,6 +39,15 @@ #define METATILE_VermilionGym_Beam_Node_BottomRight_Edge_HalfOn 0x2C6 #define METATILE_VermilionGym_Beam_Node_BottomRight_HalfOn 0x2C7 +// Celadon Game Corner +#define METATILE_GameCorner_Floor_ShadeFull 0x292 +#define METATILE_GameCorner_Floor_StairsTop 0x29D +#define METATILE_GameCorner_StairsTop 0x29E +#define METATILE_GameCorner_StairsBottom 0x29F +#define METATILE_GameCorner_PurpleWall_Floor 0x2CF +#define METATILE_GameCorner_PurpleWall_StairsTop 0x2A6 +#define METATILE_GameCorner_PurpleWall_stairsBottom 0x2A7 + // Pokemon Mansion #define METATILE_PokemonMansion_Floor 0x284 #define METATILE_PokemonMansion_Floor_ShadeFull 0x285 @@ -72,6 +81,18 @@ #define METATILE_PokemonMansion_Statue_RedEyes_Shade 0x34E #define METATILE_PokemonMansion_Statue_RedEyes_Basement 0x34F +// Rocket Hideout, Rocket Warehouse, Silph Co, elevators +#define METATILE_Hideout_Arrow_Up 0x2A0 +#define METATILE_Hideout_Arrow_Left 0x2A1 +#define METATILE_Hideout_Arrow_Down 0x2A8 +#define METATILE_Hideout_Arrow_RIght 0x2A9 +#define METATILE_Hideout_Barrier_TopLeft_Floor 0x2CE +#define METATILE_Hideout_Barrier_TopRight_Floor 0x2CF +#define METATILE_Hideout_Barrier_BottomLeft 0x2D6 +#define METATILE_Hideout_Barrier_BottomRight 0x2D7 +#define METATILE_Hideout_Floor 0x281 +#define METATILE_Hideout_Floor_ShadeFull 0x282 + // Cinnabar Gym #define METATILE_CinnabarGym_Floor 0x281 #define METATILE_CinnabarGym_Floor_ShadeDiagonal 0x282 @@ -85,5 +106,8 @@ // gTileset_82D504C. Below metatile probably needs generic name #define METATILE_MtEmber_CaveEntrance 0x346 +// Trainer Tower +#define METATILE_TrainerTower_Floor_ShadeBottomLeft 0x287 +#define METATILE_TrainerTower_CounterBarrier 0x2B4 #endif // GUARD_METATILE_LABELS_H diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 28ce39cd3..0c958ccc5 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -64,7 +64,6 @@ #define PARTY_MENU_TYPE_UNION_ROOM_TRADE 9 // trading board #define PARTY_MENU_TYPE_SPIN_TRADE 10 // Unused beta for Gen IV's Spin Trade #define PARTY_MENU_TYPE_MINIGAME 11 -#define PARTY_MENU_TYPE_STORE_PYRAMID_HELD_ITEMS 12 #define PARTY_ACTION_CHOOSE_MON 0 #define PARTY_ACTION_SEND_OUT 1 diff --git a/include/constants/trainer_tower.h b/include/constants/trainer_tower.h new file mode 100644 index 000000000..6372a30e8 --- /dev/null +++ b/include/constants/trainer_tower.h @@ -0,0 +1,46 @@ +#ifndef GUARD_CONSTANTS_TRAINER_TOWER_H +#define GUARD_CONSTANTS_TRAINER_TOWER_H + +#define CHALLENGE_TYPE_SINGLE 0 +#define CHALLENGE_TYPE_DOUBLE 1 +#define CHALLENGE_TYPE_KNOCKOUT 2 +// Mixed challenges use one of the above 3 for each floor + +#define CHALLENGE_STATUS_LOST 0 +#define CHALLENGE_STATUS_UNK 1 // Never set, possibly e-Card related +#define CHALLENGE_STATUS_NORMAL 2 // Not started or ongoing + +#define MAX_TRAINER_TOWER_FLOORS 8 + +#define MAX_TRAINERS_PER_FLOOR 3 + +#define TRAINER_TOWER_FUNC_INIT_FLOOR 0 +#define TRAINER_TOWER_FUNC_GET_SPEECH 1 +#define TRAINER_TOWER_FUNC_DO_BATTLE 2 +#define TRAINER_TOWER_FUNC_GET_CHALLENGE_TYPE 3 +#define TRAINER_TOWER_FUNC_CLEARED_FLOOR 4 +#define TRAINER_TOWER_FUNC_GET_FLOOR_CLEARED 5 +#define TRAINER_TOWER_FUNC_START_CHALLENGE 6 +#define TRAINER_TOWER_FUNC_GET_OWNER_STATE 7 +#define TRAINER_TOWER_FUNC_GIVE_PRIZE 8 +#define TRAINER_TOWER_FUNC_CHECK_FINAL_TIME 9 +#define TRAINER_TOWER_FUNC_RESUME_TIMER 10 +#define TRAINER_TOWER_FUNC_SET_LOST 11 +#define TRAINER_TOWER_FUNC_GET_CHALLENGE_STATUS 12 +#define TRAINER_TOWER_FUNC_GET_TIME 13 +#define TRAINER_TOWER_FUNC_SHOW_RESULTS 14 +#define TRAINER_TOWER_FUNC_CLOSE_RESULTS 15 +#define TRAINER_TOWER_FUNC_CHECK_DOUBLES 16 +#define TRAINER_TOWER_FUNC_GET_NUM_FLOORS 17 +#define TRAINER_TOWER_FUNC_SHOULD_WARP_TO_COUNTER 18 +#define TRAINER_TOWER_FUNC_ENCOUNTER_MUSIC 19 +#define TRAINER_TOWER_FUNC_GET_BEAT_CHALLENGE 20 + +#define TRAINER_TOWER_TEXT_INTRO 2 +#define TRAINER_TOWER_TEXT_PLAYER_LOST 3 +#define TRAINER_TOWER_TEXT_PLAYER_WON 4 +#define TRAINER_TOWER_TEXT_AFTER 5 + +#define TRAINER_TOWER_MAX_TIME 215999 // 60 * 60 * 60 - 1 + +#endif //GUARD_CONSTANTS_TRAINER_TOWER_H diff --git a/include/global.h b/include/global.h index 8644fe364..54d8fdec3 100644 --- a/include/global.h +++ b/include/global.h @@ -168,13 +168,6 @@ struct BerryPickingResults // possibly used in the game itself? Size may be wron u8 field_F; }; -struct PyramidBag -{ - u16 items_Lvl50[10]; - u16 items_OpenLvl[10]; - u8 quantity[10]; -}; - struct BerryCrush { u16 berryCrushResults[4]; @@ -719,19 +712,18 @@ struct MEventBuffers /*0x344 0x3464*/ u32 unk_344[2][5]; }; // 0x36C 0x348C -struct TrainerTowerLog +struct TrainerTower { - u32 unk0; - u32 unk4; - u8 unk8; + u32 timer; + u32 bestTime; + u8 floorsCleared; u8 unk9; - u8 unkA_0:1; - u8 unkA_1:1; - u8 unkA_2:1; - u8 unkA_3:1; - u8 unkA_4:1; - u8 unkA_5:1; - u8 unkA_6:2; + bool8 receivedPrize:1; + bool8 checkedFinalTime:1; + bool8 spokeToOwner:1; + bool8 hasLost:1; + bool8 unkA_4:1; + bool8 validated:1; }; struct TrainerRematchState @@ -807,8 +799,8 @@ struct SaveBlock1 /*0x3BA8*/ struct TrainerNameRecord trainerNameRecords[20]; /*0x3C98*/ struct DaycareMon route5DayCareMon; /*0x3D24*/ u8 filler3D24[0x10]; - /*0x3D34*/ u32 unkArrayIdx; - /*0x3D38*/ struct TrainerTowerLog unkArray[4]; + /*0x3D34*/ u32 towerChallengeId; + /*0x3D38*/ struct TrainerTower trainerTower[NUM_TOWER_CHALLENGE_TYPES]; }; struct MapPosition diff --git a/include/renewable_hidden_items.h b/include/renewable_hidden_items.h index 0de109528..3a0385c00 100644 --- a/include/renewable_hidden_items.h +++ b/include/renewable_hidden_items.h @@ -1,7 +1,6 @@ #ifndef GUARD_RENEWABLE_HIDDEN_ITEMS_H #define GUARD_RENEWABLE_HIDDEN_ITEMS_H -bool32 sub_815D834(void); void IncrementRenewableHiddenItemStepCounter(void); void TryRegenerateRenewableHiddenItems(void); void SetAllRenewableItemFlags(void); diff --git a/include/script.h b/include/script.h index ad7094a9b..2fb732396 100644 --- a/include/script.h +++ b/include/script.h @@ -48,7 +48,7 @@ void ScriptContext2_RunNewScript(const u8 *ptr); u8 *mapheader_get_tagged_pointer(u8 tag); void mapheader_run_script_by_tag(u8 tag); u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag); -void mapheader_run_script_with_tag_x1(void); +void RunOnLoadMapScript(void); void mapheader_run_script_with_tag_x3(void); void mapheader_run_script_with_tag_x5(void); void mapheader_run_script_with_tag_x7(void); diff --git a/include/trainer_tower.h b/include/trainer_tower.h index 9c1ac0631..72c0f236c 100644 --- a/include/trainer_tower.h +++ b/include/trainer_tower.h @@ -6,7 +6,9 @@ void InitTrainerTowerBattleStruct(void); void FreeTrainerTowerBattleStruct(void); u8 GetTrainerTowerTrainerFrontSpriteId(void); void ResetTrainerTowerResults(void); -void sub_815DA28(u8 *text); -u8 sub_815DA10(void); +void GetTrainerTowerOpponentWinText(u8 *dest, u8 opponentIdx); +void GetTrainerTowerOpponentLoseText(u8 *dest, u8 opponentIdx); +void GetTrainerTowerOpponentName(u8 *text); +u8 GetTrainerTowerOpponentClass(void); #endif //GUARD_TRAINER_TOWER_H |