diff options
-rw-r--r-- | constants/constants.s | 1 | ||||
-rw-r--r-- | constants/game_stat.s | 50 | ||||
-rw-r--r-- | data/event_scripts.s | 4 | ||||
-rw-r--r-- | data/scripts/berry_tree.s | 2 | ||||
-rw-r--r-- | data/scripts/contest_hall.s | 8 | ||||
-rw-r--r-- | data/scripts/day_care.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/BattleTower_Lobby.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/DewfordTown.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/LavaridgeTown.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/LilycoveCity_ContestLobby.s | 4 | ||||
-rw-r--r-- | data/scripts/maps/LilycoveCity_DepartmentStore_1F.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/MauvilleCity_BikeShop.s | 4 | ||||
-rw-r--r-- | data/scripts/maps/MtChimney_CableCarStation.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/Route112_CableCarStation.s | 2 | ||||
-rw-r--r-- | data/scripts/maps/UnknownMap_25_34.s | 8 | ||||
-rw-r--r-- | data/scripts/players_house.s | 4 | ||||
-rw-r--r-- | data/scripts/tv.s | 2 | ||||
-rw-r--r-- | include/fieldmap.h | 20 | ||||
-rw-r--r-- | include/game_stat.h | 56 | ||||
-rw-r--r-- | include/global.h | 9 |
20 files changed, 159 insertions, 27 deletions
diff --git a/constants/constants.s b/constants/constants.s index 42c9fa382..daca14090 100644 --- a/constants/constants.s +++ b/constants/constants.s @@ -26,3 +26,4 @@ .include "constants/battle_text.s" .include "constants/battle_move_effects.s" .include "constants/contest_move_effects.s" + .include "constants/game_stat.s" diff --git a/constants/game_stat.s b/constants/game_stat.s new file mode 100644 index 000000000..ff8b2df00 --- /dev/null +++ b/constants/game_stat.s @@ -0,0 +1,50 @@ + .equiv GAME_STAT_SAVED_GAME, 0 + .equiv GAME_STAT_FIRST_HOF_PLAY_TIME, 1 + .equiv GAME_STAT_STARTED_TRENDS, 2 + .equiv GAME_STAT_PLANTED_BERRIES, 3 + .equiv GAME_STAT_TRADED_BIKES, 4 + .equiv GAME_STAT_STEPS, 5 + .equiv GAME_STAT_GOT_INTERVIEWED, 6 + .equiv GAME_STAT_TOTAL_BATTLES, 7 + .equiv GAME_STAT_WILD_BATTLES, 8 + .equiv GAME_STAT_TRAINER_BATTLES, 9 + .equiv GAME_STAT_ENTERED_HOF, 10 + .equiv GAME_STAT_POKEMON_CAPTURES, 11 + .equiv GAME_STAT_FISHING_CAPTURES, 12 + .equiv GAME_STAT_HATCHED_EGGS, 13 + .equiv GAME_STAT_EVOLVED_POKEMON, 14 + .equiv GAME_STAT_USED_POKECENTER, 15 + .equiv GAME_STAT_RESTED_AT_HOME, 16 + .equiv GAME_STAT_ENTERED_SAFARI_ZONE, 17 + .equiv GAME_STAT_USED_CUT, 18 + .equiv GAME_STAT_USED_ROCK_SMASH, 19 + .equiv GAME_STAT_MOVED_SECRET_BASE, 20 + .equiv GAME_STAT_POKEMON_TRADES, 21 + .equiv GAME_STAT_UNKNOWN_22, 22 + .equiv GAME_STAT_LINK_BATTLE_WINS, 23 + .equiv GAME_STAT_LINK_BATTLE_LOSSES, 24 + .equiv GAME_STAT_LINK_BATTLE_DRAWS, 25 + .equiv GAME_STAT_USED_SPLASH, 26 + .equiv GAME_STAT_USED_STRUGGLE, 27 + .equiv GAME_STAT_SLOT_JACKPOTS, 28 + .equiv GAME_STAT_CONSECUTIVE_ROULETTE_WINS, 29 + .equiv GAME_STAT_ENTERED_BATTLE_TOWER, 30 + .equiv GAME_STAT_UNKNOWN_31, 31 + .equiv GAME_STAT_BATTLE_TOWER_BEST_STREAK, 32 + .equiv GAME_STAT_POKEBLOCKS, 33 + .equiv GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 34 + .equiv GAME_STAT_WON_LINK_CONTEST, 35 + .equiv GAME_STAT_ENTERED_CONTEST, 36 + .equiv GAME_STAT_WON_CONTEST, 37 + .equiv GAME_STAT_SHOPPED, 38 + .equiv GAME_STAT_USED_ITEMFINDER, 39 + .equiv GAME_STAT_GOT_RAINED_ON, 40 + .equiv GAME_STAT_CHECKED_POKEDEX, 41 + .equiv GAME_STAT_RECEIVED_RIBBONS, 42 + .equiv GAME_STAT_JUMPED_DOWN_LEDGES, 43 + .equiv GAME_STAT_WATCHED_TV, 44 + .equiv GAME_STAT_CHECKED_CLOCK, 45 + .equiv GAME_STAT_WON_POKEMON_LOTTERY, 46 + .equiv GAME_STAT_USED_DAYCARE, 47 + .equiv GAME_STAT_RODE_CABLE_CAR, 48 + .equiv GAME_STAT_ENTERED_HOT_SPRINGS, 49 diff --git a/data/event_scripts.s b/data/event_scripts.s index 0d28ca829..3b524572b 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1444,7 +1444,7 @@ VerdanturfTown_PokemonCenter_1F_EventScript_19FD5B:: @ 819FD5B end OldaleTown_PokemonCenter_1F_EventScript_19FD7C:: @ 819FD7C - inccounter 15 + inccounter GAME_STAT_USED_POKECENTER message OldaleTown_PokemonCenter_1F_Text_1A1245 waittext move 0x800b, OldaleTown_PokemonCenter_1F_Movement_1A083F @@ -4379,7 +4379,7 @@ FallarborTown_ContestLobby_EventScript_1ADE46:: @ 81ADE46 SlateportCity_OceanicMuseum_1F_EventScript_1ADE46:: @ 81ADE46 SlateportCity_PokemonFanClub_EventScript_1ADE46:: @ 81ADE46 special 68 - inccounter 6 + inccounter GAME_STAT_GOT_INTERVIEWED release end diff --git a/data/scripts/berry_tree.s b/data/scripts/berry_tree.s index 00d2f80a4..f6d98689e 100644 --- a/data/scripts/berry_tree.s +++ b/data/scripts/berry_tree.s @@ -176,7 +176,7 @@ Route102_EventScript_1A1693:: @ 81A1693 Route102_EventScript_1A16A9:: @ 81A16A9 special 45 - inccounter 3 + inccounter GAME_STAT_PLANTED_BERRIES message Route102_Text_1A16FB waittext waitbutton diff --git a/data/scripts/contest_hall.s b/data/scripts/contest_hall.s index d1ac8c776..14e684cb9 100644 --- a/data/scripts/contest_hall.s +++ b/data/scripts/contest_hall.s @@ -1012,7 +1012,7 @@ LinkContestRoom1_EventScript_1A5BAB:: @ 81A5BAB return LinkContestRoom1_EventScript_1A5BF6:: @ 81A5BF6 - inccounter 37 + inccounter GAME_STAT_WON_CONTEST msgbox LinkContestRoom1_Text_1A6DF1, 3 pause 90 special 134 @@ -1070,7 +1070,7 @@ LinkContestRoom1_EventScript_1A5C6A:: @ 81A5C6A return LinkContestRoom1_EventScript_1A5C7C:: @ 81A5C7C - inccounter 35 + inccounter GAME_STAT_WON_LINK_CONTEST return LinkContestRoom1_EventScript_1A5C7F:: @ 81A5C7F @@ -1119,7 +1119,7 @@ LinkContestRoom1_EventScript_1A5CE5:: @ 81A5CE5 LinkContestRoom1_EventScript_1A5CFC:: @ 81A5CFC compare 0x4088, 2 callif 1, LinkContestRoom1_EventScript_1A5C42 - inccounter 37 + inccounter GAME_STAT_WON_CONTEST specialval RESULT, 88 compare RESULT, 0 jumpeq LinkContestRoom1_EventScript_1A5D5B @@ -1142,7 +1142,7 @@ LinkContestRoom1_EventScript_1A5D3B:: @ 81A5D3B LinkContestRoom1_EventScript_1A5D5B:: @ 81A5D5B special 89 - inccounter 42 + inccounter GAME_STAT_RECEIVED_RIBBONS setflag 2107 lockall msgbox LinkContestRoom1_Text_1A6D6A, 4 diff --git a/data/scripts/day_care.s b/data/scripts/day_care.s index f83d5af97..1e248ba9f 100644 --- a/data/scripts/day_care.s +++ b/data/scripts/day_care.s @@ -114,7 +114,7 @@ Route117_PokemonDayCare_EventScript_1B236C:: @ 81B236C msgbox Route117_PokemonDayCare_Text_1B296E, 4 waitpokecry special 187 - inccounter 47 + inccounter GAME_STAT_USED_DAYCARE specialval RESULT, 182 compare RESULT, 2 jumpeq Route117_PokemonDayCare_EventScript_1B23DA diff --git a/data/scripts/maps/BattleTower_Lobby.s b/data/scripts/maps/BattleTower_Lobby.s index 7489dcc7b..cee3d7cec 100644 --- a/data/scripts/maps/BattleTower_Lobby.s +++ b/data/scripts/maps/BattleTower_Lobby.s @@ -247,7 +247,7 @@ BattleTower_Lobby_EventScript_160587:: @ 8160587 hidebox 0, 0, 15, 10 compare RESULT, 0 jumpeq BattleTower_Lobby_EventScript_160642 - inccounter 30 + inccounter GAME_STAT_ENTERED_BATTLE_TOWER special 39 special 239 setvar 0x40bc, 1 diff --git a/data/scripts/maps/DewfordTown.s b/data/scripts/maps/DewfordTown.s index a020c4aad..8ca2eb3df 100644 --- a/data/scripts/maps/DewfordTown.s +++ b/data/scripts/maps/DewfordTown.s @@ -623,7 +623,7 @@ DewfordTown_EventScript_14E443:: @ 814E443 end DewfordTown_EventScript_14E46E:: @ 814E46E - inccounter 2 + inccounter GAME_STAT_STARTED_TRENDS compare 0x8004, 0 jumpeq DewfordTown_EventScript_14E48F msgbox DewfordTown_Text_16BB44, 4 diff --git a/data/scripts/maps/LavaridgeTown.s b/data/scripts/maps/LavaridgeTown.s index 0af7a5823..a71bd4854 100644 --- a/data/scripts/maps/LavaridgeTown.s +++ b/data/scripts/maps/LavaridgeTown.s @@ -242,7 +242,7 @@ LavaridgeTown_EventScript_14E710:: @ 814E710 end LavaridgeTown_EventScript_14E721:: @ 814E721 - inccounter 49 + inccounter GAME_STAT_ENTERED_HOT_SPRINGS end LavaridgeTown_EventScript_14E724:: @ 814E724 diff --git a/data/scripts/maps/LilycoveCity_ContestLobby.s b/data/scripts/maps/LilycoveCity_ContestLobby.s index 948d3eb7c..ed12473b9 100644 --- a/data/scripts/maps/LilycoveCity_ContestLobby.s +++ b/data/scripts/maps/LilycoveCity_ContestLobby.s @@ -68,7 +68,7 @@ LilycoveCity_ContestLobby_EventScript_158918:: @ 8158918 end LilycoveCity_ContestLobby_EventScript_158948:: @ 8158948 - inccounter 42 + inccounter GAME_STAT_RECEIVED_RIBBONS special 80 move 4, LilycoveCity_ContestLobby_Movement_158A4E waitmove 0 @@ -241,7 +241,7 @@ LilycoveCity_ContestLobby_EventScript_158AE8:: @ 8158AE8 end LilycoveCity_ContestLobby_EventScript_158B18:: @ 8158B18 - inccounter 42 + inccounter GAME_STAT_RECEIVED_RIBBONS special 80 move 11, LilycoveCity_ContestLobby_Movement_158B78 waitmove 0 diff --git a/data/scripts/maps/LilycoveCity_DepartmentStore_1F.s b/data/scripts/maps/LilycoveCity_DepartmentStore_1F.s index c05921779..325c56330 100644 --- a/data/scripts/maps/LilycoveCity_DepartmentStore_1F.s +++ b/data/scripts/maps/LilycoveCity_DepartmentStore_1F.s @@ -35,7 +35,7 @@ LilycoveCity_DepartmentStore_1F_EventScript_159D5E:: @ 8159D5E waitmove 0 compare 0x8004, 0 jumpeq LilycoveCity_DepartmentStore_1F_EventScript_159E60 - inccounter 46 + inccounter GAME_STAT_WON_POKEMON_LOTTERY compare 0x8006, 0 callif 1, LilycoveCity_DepartmentStore_1F_EventScript_159E3A compare 0x8006, 1 diff --git a/data/scripts/maps/MauvilleCity_BikeShop.s b/data/scripts/maps/MauvilleCity_BikeShop.s index 09f5e4d37..cb3b8505b 100644 --- a/data/scripts/maps/MauvilleCity_BikeShop.s +++ b/data/scripts/maps/MauvilleCity_BikeShop.s @@ -88,7 +88,7 @@ MauvilleCity_BikeShop_EventScript_1568BF:: @ 81568BF end MauvilleCity_BikeShop_EventScript_1568C9:: @ 81568C9 - inccounter 4 + inccounter GAME_STAT_TRADED_BIKES msgbox MauvilleCity_BikeShop_Text_181439, 4 removeitem ITEM_ACRO_BIKE, 1 giveitem ITEM_MACH_BIKE @@ -96,7 +96,7 @@ MauvilleCity_BikeShop_EventScript_1568C9:: @ 81568C9 end MauvilleCity_BikeShop_EventScript_1568EA:: @ 81568EA - inccounter 4 + inccounter GAME_STAT_TRADED_BIKES msgbox MauvilleCity_BikeShop_Text_181408, 4 removeitem ITEM_MACH_BIKE, 1 giveitem ITEM_ACRO_BIKE diff --git a/data/scripts/maps/MtChimney_CableCarStation.s b/data/scripts/maps/MtChimney_CableCarStation.s index a9ab8ffe6..c00914f2e 100644 --- a/data/scripts/maps/MtChimney_CableCarStation.s +++ b/data/scripts/maps/MtChimney_CableCarStation.s @@ -46,7 +46,7 @@ MtChimney_CableCarStation_EventScript_15C16C:: @ 815C16C waitmove 0 setvar 0x8004, 1 setvar 0x40a3, 2 - inccounter 48 + inccounter GAME_STAT_RODE_CABLE_CAR special 151 special 152 waitstate diff --git a/data/scripts/maps/Route112_CableCarStation.s b/data/scripts/maps/Route112_CableCarStation.s index 8703bc2e0..3e5f75929 100644 --- a/data/scripts/maps/Route112_CableCarStation.s +++ b/data/scripts/maps/Route112_CableCarStation.s @@ -47,7 +47,7 @@ Route112_CableCarStation_EventScript_15C0AD:: @ 815C0AD waitmove 0 setvar 0x8004, 0 setvar 0x40a3, 1 - inccounter 48 + inccounter GAME_STAT_RODE_CABLE_CAR special 151 special 152 waitstate diff --git a/data/scripts/maps/UnknownMap_25_34.s b/data/scripts/maps/UnknownMap_25_34.s index 394c2ef2d..f4f1fe61c 100644 --- a/data/scripts/maps/UnknownMap_25_34.s +++ b/data/scripts/maps/UnknownMap_25_34.s @@ -381,25 +381,25 @@ LinkContestRoom1_EventScript_15FB64:: @ 815FB64 return LinkContestRoom1_EventScript_15FBA1:: @ 815FBA1 - inccounter 36 + inccounter GAME_STAT_ENTERED_CONTEST warp VerdanturfTown_ContestLobby, 255, 5, 4 waitstate end LinkContestRoom1_EventScript_15FBAD:: @ 815FBAD - inccounter 36 + inccounter GAME_STAT_ENTERED_CONTEST warp FallarborTown_ContestLobby, 255, 5, 4 waitstate end LinkContestRoom1_EventScript_15FBB9:: @ 815FBB9 - inccounter 36 + inccounter GAME_STAT_ENTERED_CONTEST warp SlateportCity_ContestLobby, 255, 5, 4 waitstate end LinkContestRoom1_EventScript_15FBC5:: @ 815FBC5 - inccounter 36 + inccounter GAME_STAT_ENTERED_CONTEST warp LilycoveCity_ContestLobby, 255, 6, 4 waitstate end diff --git a/data/scripts/players_house.s b/data/scripts/players_house.s index 556e8fcbe..9db432c2c 100644 --- a/data/scripts/players_house.s +++ b/data/scripts/players_house.s @@ -105,7 +105,7 @@ LittlerootTown_BrendansHouse_2F_EventScript_1B6A61:: @ 81B6A61 return LittlerootTown_BrendansHouse_2F_EventScript_1B6A91:: @ 81B6A91 - inccounter 45 + inccounter GAME_STAT_CHECKED_CLOCK fadescreen 1 special 155 waitstate @@ -298,7 +298,7 @@ LittlerootTown_BrendansHouse_1F_EventScript_1B6C80:: @ 81B6C80 LittlerootTown_BrendansHouse_1F_EventScript_1B6C8A:: @ 81B6C8A closebutton call LittlerootTown_BrendansHouse_1F_EventScript_1A02CA - inccounter 16 + inccounter GAME_STAT_RESTED_AT_HOME msgbox LittlerootTown_BrendansHouse_1F_Text_17276B, 4 release end diff --git a/data/scripts/tv.s b/data/scripts/tv.s index 353e8bcb8..2b317e725 100644 --- a/data/scripts/tv.s +++ b/data/scripts/tv.s @@ -1,6 +1,6 @@ Event_TV:: @ 81A6E72 lockall - inccounter 44 + inccounter GAME_STAT_WATCHED_TV special 75 specialval RESULT, 73 compare RESULT, 2 diff --git a/include/fieldmap.h b/include/fieldmap.h index 503b4b931..e60e4bbce 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -24,10 +24,28 @@ struct MapData struct Tileset *secondaryTileset; }; +struct MapObjectTemplate +{ + u8 filler[0x18]; +}; + +struct MapEvents +{ + u8 mapObjectCount; + u8 warpCount; + u8 coordEventCount; + u8 bgEventCount; + + struct MapObjectTemplate *mapObjects; + void *warps; + void *coordEvents; + void *bgEvents; +}; + struct MapHeader { struct MapData *mapData; - void *events; + struct MapEvents *events; u8 *mapScripts; // TODO: rest of struct }; diff --git a/include/game_stat.h b/include/game_stat.h new file mode 100644 index 000000000..70b6f51ce --- /dev/null +++ b/include/game_stat.h @@ -0,0 +1,56 @@ +#ifndef GUARD_GAME_STAT_H +#define GUARD_GAME_STAT_H + +#define GAME_STAT_SAVED_GAME 0 +#define GAME_STAT_FIRST_HOF_PLAY_TIME 1 +#define GAME_STAT_STARTED_TRENDS 2 +#define GAME_STAT_PLANTED_BERRIES 3 +#define GAME_STAT_TRADED_BIKES 4 +#define GAME_STAT_STEPS 5 +#define GAME_STAT_GOT_INTERVIEWED 6 +#define GAME_STAT_TOTAL_BATTLES 7 +#define GAME_STAT_WILD_BATTLES 8 +#define GAME_STAT_TRAINER_BATTLES 9 +#define GAME_STAT_ENTERED_HOF 10 +#define GAME_STAT_POKEMON_CAPTURES 11 +#define GAME_STAT_FISHING_CAPTURES 12 +#define GAME_STAT_HATCHED_EGGS 13 +#define GAME_STAT_EVOLVED_POKEMON 14 +#define GAME_STAT_USED_POKECENTER 15 +#define GAME_STAT_RESTED_AT_HOME 16 +#define GAME_STAT_ENTERED_SAFARI_ZONE 17 +#define GAME_STAT_USED_CUT 18 +#define GAME_STAT_USED_ROCK_SMASH 19 +#define GAME_STAT_MOVED_SECRET_BASE 20 +#define GAME_STAT_POKEMON_TRADES 21 +#define GAME_STAT_UNKNOWN_22 22 +#define GAME_STAT_LINK_BATTLE_WINS 23 +#define GAME_STAT_LINK_BATTLE_LOSSES 24 +#define GAME_STAT_LINK_BATTLE_DRAWS 25 +#define GAME_STAT_USED_SPLASH 26 +#define GAME_STAT_USED_STRUGGLE 27 +#define GAME_STAT_SLOT_JACKPOTS 28 +#define GAME_STAT_CONSECUTIVE_ROULETTE_WINS 29 +#define GAME_STAT_ENTERED_BATTLE_TOWER 30 +#define GAME_STAT_UNKNOWN_31 31 +#define GAME_STAT_BATTLE_TOWER_BEST_STREAK 32 +#define GAME_STAT_POKEBLOCKS 33 +#define GAME_STAT_POKEBLOCKS_WITH_FRIENDS 34 +#define GAME_STAT_WON_LINK_CONTEST 35 +#define GAME_STAT_ENTERED_CONTEST 36 +#define GAME_STAT_WON_CONTEST 37 +#define GAME_STAT_SHOPPED 38 +#define GAME_STAT_USED_ITEMFINDER 39 +#define GAME_STAT_GOT_RAINED_ON 40 +#define GAME_STAT_CHECKED_POKEDEX 41 +#define GAME_STAT_RECEIVED_RIBBONS 42 +#define GAME_STAT_JUMPED_DOWN_LEDGES 43 +#define GAME_STAT_WATCHED_TV 44 +#define GAME_STAT_CHECKED_CLOCK 45 +#define GAME_STAT_WON_POKEMON_LOTTERY 46 +#define GAME_STAT_USED_DAYCARE 47 +#define GAME_STAT_RODE_CABLE_CAR 48 +#define GAME_STAT_ENTERED_HOT_SPRINGS 49 +#define NUM_GAME_STATS 50 + +#endif // GUARD_GAME_STAT_H diff --git a/include/global.h b/include/global.h index 68ec7c6ca..ca3ae4509 100644 --- a/include/global.h +++ b/include/global.h @@ -91,6 +91,9 @@ struct SecretBaseRecord u8 partyEVs[6]; }; +#include "game_stat.h" +#include "fieldmap.h" + struct WarpData { s8 mapGroup; @@ -127,7 +130,11 @@ struct SaveBlock1 u32 money; u16 coins; u16 registeredItem; // registered for use with SELECT button - u8 filler_498[0x2A64]; + u8 filler_498[0x788]; + struct MapObjectTemplate mapObjectTemplates[64]; + u8 filler_1220[0x320]; + u32 gameStats[NUM_GAME_STATS]; + u8 filler_1608[0x18F4]; struct SB1_2EFC_Struct sb1_2EFC_struct[5]; u8 filler_2F9C[0x6F4]; struct RamScript ramScript; |