From fdae25eab21128a7ec8074e6cb6fab27b3a263fe Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Dec 2019 09:52:16 -0500 Subject: [PATCH] Set up Battle Pyramid macros --- asm/macros/battle_frontier/battle_pyramid.inc | 98 ++++++++++++++++++- data/event_scripts.s | 15 --- .../scripts.inc | 49 +++------- .../scripts.inc | 70 ++++--------- .../scripts.inc | 12 +-- .../scripts.inc | 3 +- data/maps/BattlePyramidSquare01/scripts.inc | 1 + data/maps/BattlePyramidSquare02/map.json | 1 + data/maps/BattlePyramidSquare02/scripts.inc | 1 - data/maps/BattlePyramidSquare03/map.json | 1 + data/maps/BattlePyramidSquare03/scripts.inc | 1 - data/maps/BattlePyramidSquare04/map.json | 1 + data/maps/BattlePyramidSquare04/scripts.inc | 1 - data/maps/BattlePyramidSquare05/map.json | 1 + data/maps/BattlePyramidSquare05/scripts.inc | 1 - data/maps/BattlePyramidSquare06/map.json | 1 + data/maps/BattlePyramidSquare06/scripts.inc | 1 - data/maps/BattlePyramidSquare07/map.json | 1 + data/maps/BattlePyramidSquare07/scripts.inc | 1 - data/maps/BattlePyramidSquare08/map.json | 1 + data/maps/BattlePyramidSquare08/scripts.inc | 1 - data/maps/BattlePyramidSquare09/map.json | 1 + data/maps/BattlePyramidSquare09/scripts.inc | 1 - data/maps/BattlePyramidSquare10/map.json | 1 + data/maps/BattlePyramidSquare10/scripts.inc | 1 - data/maps/BattlePyramidSquare11/map.json | 1 + data/maps/BattlePyramidSquare11/scripts.inc | 1 - data/maps/BattlePyramidSquare12/map.json | 1 + data/maps/BattlePyramidSquare12/scripts.inc | 1 - data/maps/BattlePyramidSquare13/map.json | 1 + data/maps/BattlePyramidSquare13/scripts.inc | 1 - data/maps/BattlePyramidSquare14/map.json | 1 + data/maps/BattlePyramidSquare14/scripts.inc | 1 - data/maps/BattlePyramidSquare15/map.json | 1 + data/maps/BattlePyramidSquare15/scripts.inc | 1 - data/maps/BattlePyramidSquare16/map.json | 1 + data/maps/BattlePyramidSquare16/scripts.inc | 3 - data/scripts/field_poison.inc | 7 +- data/scripts/obtain_item.inc | 3 +- include/constants/battle_pyramid.h | 24 +++-- src/battle_pyramid.c | 63 ++++++------ 41 files changed, 204 insertions(+), 173 deletions(-) delete mode 100644 data/maps/BattlePyramidSquare02/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare03/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare04/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare05/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare06/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare07/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare08/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare09/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare10/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare11/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare12/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare13/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare14/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare15/scripts.inc delete mode 100644 data/maps/BattlePyramidSquare16/scripts.inc diff --git a/asm/macros/battle_frontier/battle_pyramid.inc b/asm/macros/battle_frontier/battle_pyramid.inc index e23a819c08..a7b7afb892 100644 --- a/asm/macros/battle_frontier/battle_pyramid.inc +++ b/asm/macros/battle_frontier/battle_pyramid.inc @@ -1 +1,97 @@ -@ To be populated with macros for CallBattlePyramidFunction +@ TODO: Add explanatory comments + + @ + .macro pyramid_init + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_get data:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_set data:req, val:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_setprize + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_seedfloor + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_setitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_hideitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_inittrainers + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_showhint + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT + special CallBattlePyramidFunction + .endm + + @ VAR_RESULT is 1 if on a Pyramid floor, 2 if on the Pyramid peak + .macro pyramid_inchallenge + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_updatelight radius:req, mode:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT + setvar VAR_0x8005, \radius + setvar VAR_0x8006, \mode + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_clearhelditems + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS + special CallBattlePyramidFunction + .endm + + @ BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE + .macro pyramid_setfloorpal + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_healparty + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY + special CallBattlePyramidFunction + .endm diff --git a/data/event_scripts.s b/data/event_scripts.s index 56ca475bc8..651e4d832d 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -455,21 +455,6 @@ gStdScripts_End:: @ 81DC2CC .include "data/maps/SSTidalLowerDeck/scripts.inc" .include "data/maps/SSTidalRooms/scripts.inc" .include "data/maps/BattlePyramidSquare01/scripts.inc" - .include "data/maps/BattlePyramidSquare02/scripts.inc" - .include "data/maps/BattlePyramidSquare03/scripts.inc" - .include "data/maps/BattlePyramidSquare04/scripts.inc" - .include "data/maps/BattlePyramidSquare05/scripts.inc" - .include "data/maps/BattlePyramidSquare06/scripts.inc" - .include "data/maps/BattlePyramidSquare07/scripts.inc" - .include "data/maps/BattlePyramidSquare08/scripts.inc" - .include "data/maps/BattlePyramidSquare09/scripts.inc" - .include "data/maps/BattlePyramidSquare10/scripts.inc" - .include "data/maps/BattlePyramidSquare11/scripts.inc" - .include "data/maps/BattlePyramidSquare12/scripts.inc" - .include "data/maps/BattlePyramidSquare13/scripts.inc" - .include "data/maps/BattlePyramidSquare14/scripts.inc" - .include "data/maps/BattlePyramidSquare15/scripts.inc" - .include "data/maps/BattlePyramidSquare16/scripts.inc" .include "data/maps/UnionRoom/scripts.inc" .include "data/maps/SafariZone_Northwest/scripts.inc" .include "data/maps/SafariZone_North/scripts.inc" diff --git a/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc b/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc index 02384c332e..e73b9d9173 100644 --- a/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc @@ -14,8 +14,8 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252A5D:: @ 8252A5D lockall setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT setvar VAR_0x8005, 4 - setvar VAR_0x8006, 1 - setvar VAR_0x8007, 55 + setvar VAR_0x8006, PYRAMID_LIGHT_INCR_RADIUS + setvar VAR_0x8007, SE_SAVE setvar VAR_RESULT, 0 BattleFrontier_BattlePyramidEmptySquare_EventScript_252A77:: @ 8252A77 special CallBattlePyramidFunction @@ -37,8 +37,7 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252A98:: @ 8252A98 end BattleFrontier_BattlePyramidEmptySquare_MapScript1_252AA2: @ 8252AA2 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE - special CallBattlePyramidFunction + pyramid_setfloorpal frontier_getstatus switch VAR_TEMP_0 case 0, BattleFrontier_BattlePyramidEmptySquare_EventScript_252B8D @@ -60,39 +59,27 @@ BattleFrontier_BattlePyramidEmptySquare_MapScript1_252AA2: @ 8252AA2 frontier_isbattletype BATTLE_TYPE_TRAINER @ VAR_RESULT seems to be ignored here setvar VAR_TEMP_D, 1 BattleFrontier_BattlePyramidEmptySquare_EventScript_252B39:: @ 8252B39 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY - special CallBattlePyramidFunction + pyramid_healparty end BattleFrontier_BattlePyramidEmptySquare_EventScript_252B42:: @ 8252B42 BattleFrontier_BattlePyramidTop_EventScript_252B42:: @ 8252B42 frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, 7 - setvar VAR_0x8006, 255 - special CallBattlePyramidFunction - + pyramid_set PYRAMID_DATA_TRAINER_FLAGS, 255 BattleFrontier_BattlePyramidEmptySquare_EventScript_252B66:: @ 8252B66 BattleFrontier_BattlePyramidTop_EventScript_252B66:: @ 8252B66 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT - setvar VAR_0x8005, 0 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS - special CallBattlePyramidFunction + pyramid_updatelight 0, PYRAMID_LIGHT_SET_RADIUS + pyramid_clearhelditems special HealPlayerParty warpsilent MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 255, 7, 13 waitstate end BattleFrontier_BattlePyramidEmptySquare_EventScript_252B8D:: @ 8252B8D - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_3 - setvar VAR_0x8005, 1 - special CallBattlePyramidFunction + pyramid_save CHALLENGE_STATUS_SAVING special SavePlayerParty frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS - special CallBattlePyramidFunction + pyramid_inittrainers frontier_setpartyorder FRONTIER_PARTY_SIZE setvar VAR_TEMP_F, 1 end @@ -103,10 +90,7 @@ BattleFrontier_BattlePyramidEmptySquare_MapScript1_252BCA: @ 8252BCA end BattleFrontier_BattlePyramidEmptySquare_EventScript_252BD5:: @ 8252BD5 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT - setvar VAR_0x8005, 32 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction + pyramid_updatelight 32, PYRAMID_LIGHT_SET_RADIUS return BattleFrontier_BattlePyramidEmptySquare_EventScript_252BE8:: @ 8252BE8 @@ -116,8 +100,7 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252BE8:: @ 8252BE8 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT compare VAR_RESULT, 7 goto_if_eq BattleFrontier_BattlePyramidEmptySquare_EventScript_252C45 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR - special CallBattlePyramidFunction + pyramid_seedfloor frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 setvar VAR_RESULT, 0 warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE, 255, 1, 1 @@ -132,8 +115,7 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252C45:: @ 8252C45 @ TRAINER_PHILLIP is used as a placeholder BattlePyramid_TrainerBattle:: @ 8252C4F trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, 0, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT - special CallBattlePyramidFunction + pyramid_showhint waitmessage waitbuttonpress closemessage @@ -141,14 +123,11 @@ BattlePyramid_TrainerBattle:: @ 8252C4F end BattlePyramid_FindItemBall:: @ 8252C6A - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM - special CallBattlePyramidFunction + pyramid_setitem callstd STD_FIND_ITEM compare VAR_0x8007, 0 goto_if_eq BattlePyramid_FindItemBall_End - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM - special CallBattlePyramidFunction - + pyramid_hideitem BattlePyramid_FindItemBall_End:: @ 8252C87 end diff --git a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc index f5f4b0c295..e7db4a4595 100644 --- a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc @@ -31,14 +31,8 @@ BattleFrontier_BattlePyramidLobby_EventScript_250768:: @ 8250768 playse SE_EXPMAX waitse closemessage - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, 1 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, 2 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction + pyramid_set PYRAMID_DATA_WIN_STREAK, 0 + pyramid_set PYRAMID_DATA_WIN_STREAK_ACTIVE, FALSE frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 setvar VAR_TEMP_0, 255 releaseall @@ -61,8 +55,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_2507DA:: @ 82507DA clearflag FLAG_STORING_ITEMS_IN_PYRAMID_BAG frontier_checkairshow special LoadPlayerParty - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS - special CallBattlePyramidFunction + pyramid_clearhelditems special HealPlayerParty message BattleFrontier_BattlePyramidLobby_Text_2519F8 waitmessage @@ -73,11 +66,8 @@ BattleFrontier_BattlePyramidLobby_EventScript_2507DA:: @ 82507DA msgbox BattleFrontier_Text_ObtainedXBattlePoints, MSGBOX_GETPOINTS message BattleFrontier_BattlePyramidLobby_Text_251A77 waitmessage - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_REWARD - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_3 - setvar VAR_0x8005, 0 - special CallBattlePyramidFunction + pyramid_setprize + pyramid_save 0 playse SE_SAVE waitse msgbox BattleFrontier_BattlePyramidLobby_Text_251BB6, MSGBOX_DEFAULT @@ -89,8 +79,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_2507DA:: @ 82507DA BattleFrontier_BattlePyramidLobby_EventScript_250852:: @ 8250852 frontier_checkairshow special LoadPlayerParty - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS - special CallBattlePyramidFunction + pyramid_clearhelditems special HealPlayerParty lockall message BattleFrontier_BattlePyramidLobby_Text_251B5A @@ -99,13 +88,8 @@ BattleFrontier_BattlePyramidLobby_EventScript_250852:: @ 8250852 waitse message BattleFrontier_BattlePyramidLobby_Text_251A77 waitmessage - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, 2 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_3 - setvar VAR_0x8005, 0 - special CallBattlePyramidFunction + pyramid_set PYRAMID_DATA_WIN_STREAK_ACTIVE, FALSE + pyramid_save 0 playse SE_SAVE waitse msgbox BattleFrontier_BattlePyramidLobby_Text_251BB6, MSGBOX_DEFAULT @@ -164,18 +148,12 @@ BattleFrontier_BattlePyramidLobby_EventScript_250904:: @ 8250904 BattleFrontier_BattlePyramidLobby_EventScript_2509A5:: @ 82509A5 setvar VAR_TEMP_0, 0 frontier_set FRONTIER_DATA_SELECTED_MON_ORDER - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_CHALLENGE - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, 2 - setvar VAR_0x8006, 1 - special CallBattlePyramidFunction + pyramid_init + pyramid_set PYRAMID_DATA_WIN_STREAK_ACTIVE, TRUE frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_SAVING frontier_set FRONTIER_DATA_PAUSED, FALSE - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR - special CallBattlePyramidFunction - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS - special CallBattlePyramidFunction + pyramid_seedfloor + pyramid_inittrainers special LoadPlayerParty closemessage delay 2 @@ -251,37 +229,29 @@ BattleFrontier_BattlePyramidLobby_EventScript_250B27:: @ 8250B27 BattleFrontier_BattlePyramidLobby_EventScript_250B28:: @ 8250B28 msgbox BattleFrontier_BattlePyramidLobby_Text_251C8A, MSGBOX_DEFAULT - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, 5 - special CallBattlePyramidFunction - compare VAR_RESULT, 0 + pyramid_get PYRAMID_DATA_WIN_STREAK_ACTIVE_50 + compare VAR_RESULT, FALSE goto_if_ne BattleFrontier_BattlePyramidLobby_EventScript_250B53 setvar VAR_RESULT, 0 goto BattleFrontier_BattlePyramidLobby_EventScript_250BA4 return BattleFrontier_BattlePyramidLobby_EventScript_250B53:: @ 8250B53 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, 3 - special CallBattlePyramidFunction + pyramid_get PYRAMID_DATA_WIN_STREAK_50 goto BattleFrontier_BattlePyramidLobby_EventScript_250BA4 return BattleFrontier_BattlePyramidLobby_EventScript_250B66:: @ 8250B66 msgbox BattleFrontier_BattlePyramidLobby_Text_251C8A, MSGBOX_DEFAULT - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, 6 - special CallBattlePyramidFunction - compare VAR_RESULT, 0 + pyramid_get PYRAMID_DATA_WIN_STREAK_ACTIVE_OPEN + compare VAR_RESULT, FALSE goto_if_ne BattleFrontier_BattlePyramidLobby_EventScript_250B91 setvar VAR_RESULT, 0 goto BattleFrontier_BattlePyramidLobby_EventScript_250BA4 return BattleFrontier_BattlePyramidLobby_EventScript_250B91:: @ 8250B91 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, 4 - special CallBattlePyramidFunction + pyramid_get PYRAMID_DATA_WIN_STREAK_OPEN goto BattleFrontier_BattlePyramidLobby_EventScript_250BA4 return @@ -404,9 +374,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_250D56:: @ 8250D56 applymovement EVENT_OBJ_ID_PLAYER, BattleFrontier_BattlePyramidLobby_Movement_250DCD waitmovement 0 msgbox BattleFrontier_BattlePyramidLobby_Text_251569, MSGBOX_DEFAULT - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, 1 - special CallBattlePyramidFunction + pyramid_get PYRAMID_DATA_WIN_STREAK compare VAR_RESULT, 0 goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_250D94 msgbox BattleFrontier_BattlePyramidLobby_Text_2515AD, MSGBOX_DEFAULT diff --git a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc index 0a48184b31..2e6b8f3a27 100644 --- a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc @@ -6,10 +6,7 @@ BattleFrontier_BattlePyramidTop_MapScripts:: @ 82550A1 .byte 0 BattleFrontier_BattlePyramidTop_MapScript1_2550B6: @ 82550B6 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT - setvar VAR_0x8005, 200 - setvar VAR_0x8006, 0 - special CallBattlePyramidFunction + pyramid_updatelight 200, PYRAMID_LIGHT_SET_RADIUS setvar VAR_TEMP_F, 1 end @@ -64,13 +61,10 @@ BattleFrontier_BattlePyramidTop_EventScript_25518A:: @ 825518A end BattleFrontier_BattlePyramidTop_EventScript_255193:: @ 8255193 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_3 - setvar VAR_0x8005, 1 - special CallBattlePyramidFunction + pyramid_save CHALLENGE_STATUS_SAVING special SavePlayerParty frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS - special CallBattlePyramidFunction + pyramid_inittrainers frontier_setpartyorder FRONTIER_PARTY_SIZE setvar VAR_TEMP_F, 1 end diff --git a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc index 62fe2de98f..4a3d9cb96c 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc @@ -6,8 +6,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_MapScripts:: @ 8243D92 .byte 0 BattleFrontier_BattleTowerMultiBattleRoom_MapScript1_243DA7: @ 8243DA7 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY - special CallBattlePyramidFunction + pyramid_healparty end BattleFrontier_BattleTowerMultiBattleRoom_MapScript1_243DB0: @ 8243DB0 diff --git a/data/maps/BattlePyramidSquare01/scripts.inc b/data/maps/BattlePyramidSquare01/scripts.inc index c51e49ba75..c547b1b81d 100644 --- a/data/maps/BattlePyramidSquare01/scripts.inc +++ b/data/maps/BattlePyramidSquare01/scripts.inc @@ -1 +1,2 @@ BattlePyramidSquare01_MapScripts:: @ 823D1A5 + .byte 0 diff --git a/data/maps/BattlePyramidSquare02/map.json b/data/maps/BattlePyramidSquare02/map.json index e68b71284f..5d8f32f253 100644 --- a/data/maps/BattlePyramidSquare02/map.json +++ b/data/maps/BattlePyramidSquare02/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_BOY_3", diff --git a/data/maps/BattlePyramidSquare02/scripts.inc b/data/maps/BattlePyramidSquare02/scripts.inc deleted file mode 100644 index a694b03bf6..0000000000 --- a/data/maps/BattlePyramidSquare02/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare02_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare03/map.json b/data/maps/BattlePyramidSquare03/map.json index 8a495158e7..c69bd0b15c 100644 --- a/data/maps/BattlePyramidSquare03/map.json +++ b/data/maps/BattlePyramidSquare03/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_BOY_1", diff --git a/data/maps/BattlePyramidSquare03/scripts.inc b/data/maps/BattlePyramidSquare03/scripts.inc deleted file mode 100644 index 229dd5a28d..0000000000 --- a/data/maps/BattlePyramidSquare03/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare03_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare04/map.json b/data/maps/BattlePyramidSquare04/map.json index e413a7e5fc..18319c6809 100644 --- a/data/maps/BattlePyramidSquare04/map.json +++ b/data/maps/BattlePyramidSquare04/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_WOMAN_2", diff --git a/data/maps/BattlePyramidSquare04/scripts.inc b/data/maps/BattlePyramidSquare04/scripts.inc deleted file mode 100644 index a231965b5f..0000000000 --- a/data/maps/BattlePyramidSquare04/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare04_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare05/map.json b/data/maps/BattlePyramidSquare05/map.json index d16a87646e..b00e173673 100644 --- a/data/maps/BattlePyramidSquare05/map.json +++ b/data/maps/BattlePyramidSquare05/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_BOY_2", diff --git a/data/maps/BattlePyramidSquare05/scripts.inc b/data/maps/BattlePyramidSquare05/scripts.inc deleted file mode 100644 index e4670f78c3..0000000000 --- a/data/maps/BattlePyramidSquare05/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare05_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare06/map.json b/data/maps/BattlePyramidSquare06/map.json index ddf011814a..e06449a127 100644 --- a/data/maps/BattlePyramidSquare06/map.json +++ b/data/maps/BattlePyramidSquare06/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_GIRL_2", diff --git a/data/maps/BattlePyramidSquare06/scripts.inc b/data/maps/BattlePyramidSquare06/scripts.inc deleted file mode 100644 index 6c0d38e416..0000000000 --- a/data/maps/BattlePyramidSquare06/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare06_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare07/map.json b/data/maps/BattlePyramidSquare07/map.json index 8719c6d25c..a8514304fb 100644 --- a/data/maps/BattlePyramidSquare07/map.json +++ b/data/maps/BattlePyramidSquare07/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_LITTLE_BOY", diff --git a/data/maps/BattlePyramidSquare07/scripts.inc b/data/maps/BattlePyramidSquare07/scripts.inc deleted file mode 100644 index 8603a69165..0000000000 --- a/data/maps/BattlePyramidSquare07/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare07_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare08/map.json b/data/maps/BattlePyramidSquare08/map.json index 54cfa4fe80..0f6f51539c 100644 --- a/data/maps/BattlePyramidSquare08/map.json +++ b/data/maps/BattlePyramidSquare08/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_LITTLE_GIRL", diff --git a/data/maps/BattlePyramidSquare08/scripts.inc b/data/maps/BattlePyramidSquare08/scripts.inc deleted file mode 100644 index 68a055f0e2..0000000000 --- a/data/maps/BattlePyramidSquare08/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare08_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare09/map.json b/data/maps/BattlePyramidSquare09/map.json index 67b9ceb1fe..c12ac3a26d 100644 --- a/data/maps/BattlePyramidSquare09/map.json +++ b/data/maps/BattlePyramidSquare09/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_LITTLE_GIRL", diff --git a/data/maps/BattlePyramidSquare09/scripts.inc b/data/maps/BattlePyramidSquare09/scripts.inc deleted file mode 100644 index e937349887..0000000000 --- a/data/maps/BattlePyramidSquare09/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare09_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare10/map.json b/data/maps/BattlePyramidSquare10/map.json index 0a5e88bf7f..32fe28258e 100644 --- a/data/maps/BattlePyramidSquare10/map.json +++ b/data/maps/BattlePyramidSquare10/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_GIRL_3", diff --git a/data/maps/BattlePyramidSquare10/scripts.inc b/data/maps/BattlePyramidSquare10/scripts.inc deleted file mode 100644 index 412e608e7b..0000000000 --- a/data/maps/BattlePyramidSquare10/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare10_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare11/map.json b/data/maps/BattlePyramidSquare11/map.json index 5dc7736a3a..99edaca3ba 100644 --- a/data/maps/BattlePyramidSquare11/map.json +++ b/data/maps/BattlePyramidSquare11/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_RICH_BOY", diff --git a/data/maps/BattlePyramidSquare11/scripts.inc b/data/maps/BattlePyramidSquare11/scripts.inc deleted file mode 100644 index 3b82fb925a..0000000000 --- a/data/maps/BattlePyramidSquare11/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare11_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare12/map.json b/data/maps/BattlePyramidSquare12/map.json index dcb57812d9..e7142a1668 100644 --- a/data/maps/BattlePyramidSquare12/map.json +++ b/data/maps/BattlePyramidSquare12/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_WOMAN_1", diff --git a/data/maps/BattlePyramidSquare12/scripts.inc b/data/maps/BattlePyramidSquare12/scripts.inc deleted file mode 100644 index 87a38213bf..0000000000 --- a/data/maps/BattlePyramidSquare12/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare12_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare13/map.json b/data/maps/BattlePyramidSquare13/map.json index d277c5b1bc..3945ca4f5d 100644 --- a/data/maps/BattlePyramidSquare13/map.json +++ b/data/maps/BattlePyramidSquare13/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_FAT_MAN", diff --git a/data/maps/BattlePyramidSquare13/scripts.inc b/data/maps/BattlePyramidSquare13/scripts.inc deleted file mode 100644 index 1881093053..0000000000 --- a/data/maps/BattlePyramidSquare13/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare13_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare14/map.json b/data/maps/BattlePyramidSquare14/map.json index 5727356edb..4f90bfe6bd 100644 --- a/data/maps/BattlePyramidSquare14/map.json +++ b/data/maps/BattlePyramidSquare14/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_POKEFAN_F", diff --git a/data/maps/BattlePyramidSquare14/scripts.inc b/data/maps/BattlePyramidSquare14/scripts.inc deleted file mode 100644 index 5ae39cb8a4..0000000000 --- a/data/maps/BattlePyramidSquare14/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare14_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare15/map.json b/data/maps/BattlePyramidSquare15/map.json index 62c7e34f33..7f1900dbc5 100644 --- a/data/maps/BattlePyramidSquare15/map.json +++ b/data/maps/BattlePyramidSquare15/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_POKEFAN_F", diff --git a/data/maps/BattlePyramidSquare15/scripts.inc b/data/maps/BattlePyramidSquare15/scripts.inc deleted file mode 100644 index f1b7782d79..0000000000 --- a/data/maps/BattlePyramidSquare15/scripts.inc +++ /dev/null @@ -1 +0,0 @@ -BattlePyramidSquare15_MapScripts:: @ 823D1A5 diff --git a/data/maps/BattlePyramidSquare16/map.json b/data/maps/BattlePyramidSquare16/map.json index a69a0ed5a3..bb0d02316b 100644 --- a/data/maps/BattlePyramidSquare16/map.json +++ b/data/maps/BattlePyramidSquare16/map.json @@ -13,6 +13,7 @@ "show_map_name": false, "battle_scene": "MAP_BATTLE_SCENE_GYM", "connections": null, + "shared_scripts_map": "BattlePyramidSquare01", "object_events": [ { "graphics_id": "EVENT_OBJ_GFX_POKEFAN_F", diff --git a/data/maps/BattlePyramidSquare16/scripts.inc b/data/maps/BattlePyramidSquare16/scripts.inc deleted file mode 100644 index 9308930d1b..0000000000 --- a/data/maps/BattlePyramidSquare16/scripts.inc +++ /dev/null @@ -1,3 +0,0 @@ -BattlePyramidSquare16_MapScripts:: @ 823D1A5 - .byte 0 - diff --git a/data/scripts/field_poison.inc b/data/scripts/field_poison.inc index 80e1a1ed8d..d15da33994 100644 --- a/data/scripts/field_poison.inc +++ b/data/scripts/field_poison.inc @@ -32,11 +32,10 @@ EventScript_FrontierFieldWhiteOut:: @ 82736F8 pike_inchallenge compare VAR_RESULT, TRUE goto_if_eq BattleFrontier_BattlePike_EventScript_Retire - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN - special CallBattlePyramidFunction - compare VAR_RESULT, 1 + pyramid_inchallenge + compare VAR_RESULT, 1 @ On Pyramid floor goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_252B42 - compare VAR_RESULT, 2 + compare VAR_RESULT, 2 @ On Pyramid peak goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_252B42 trainerhill_inchallenge compare VAR_RESULT, TRUE diff --git a/data/scripts/obtain_item.inc b/data/scripts/obtain_item.inc index 206277cb77..77b795f602 100644 --- a/data/scripts/obtain_item.inc +++ b/data/scripts/obtain_item.inc @@ -128,8 +128,7 @@ EventScript_PickUpItem:: @ 8271C3A waitfanfare waitmessage bufferitemnameplural 1, VAR_0x8004, VAR_0x8005 - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN - special CallBattlePyramidFunction + pyramid_inchallenge compare VAR_RESULT, 1 goto_if_eq EventScript_PutBattlePyramidItemInBag msgbox gText_PutItemInPocket, MSGBOX_DEFAULT diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index 0d59ae94d9..cfe6e891e0 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -27,23 +27,35 @@ #define OBJ_POSITIONS_NEAR_EXIT 4 // Functions IDs for sBattlePyramidFunctions / CallBattlePyramidFunction -#define BATTLE_PYRAMID_FUNC_INIT_CHALLENGE 0 +#define BATTLE_PYRAMID_FUNC_INIT 0 #define BATTLE_PYRAMID_FUNC_GET_DATA 1 #define BATTLE_PYRAMID_FUNC_SET_DATA 2 -#define BATTLE_PYRAMID_FUNC_3 3 -#define BATTLE_PYRAMID_FUNC_SET_REWARD 4 -#define BATTLE_PYRAMID_FUNC_GIVE_REWARD 5 +#define BATTLE_PYRAMID_FUNC_SAVE 3 +#define BATTLE_PYRAMID_FUNC_SET_PRIZE 4 +#define BATTLE_PYRAMID_FUNC_GIVE_PRIZE 5 // unused #define BATTLE_PYRAMID_FUNC_SEED_FLOOR 6 #define BATTLE_PYRAMID_FUNC_SET_ITEM 7 #define BATTLE_PYRAMID_FUNC_HIDE_ITEM 8 #define BATTLE_PYRAMID_FUNC_INIT_TRAINERS 9 #define BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT 10 -#define BATTLE_PYRAMID_FUNC_UPDATE_STREAK 11 +#define BATTLE_PYRAMID_FUNC_UPDATE_STREAK 11 // unused #define BATTLE_PYRAMID_FUNC_IS_IN 12 #define BATTLE_PYRAMID_FUNC_UPDATE_LIGHT 13 #define BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS 14 #define BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE 15 -#define BATTLE_PYRAMID_FUNC_16 16 +#define BATTLE_PYRAMID_FUNC_16 16 // unused #define BATTLE_PYRAMID_FUNC_RESTORE_PARTY 17 +#define PYRAMID_DATA_PRIZE 0 +#define PYRAMID_DATA_WIN_STREAK 1 +#define PYRAMID_DATA_WIN_STREAK_ACTIVE 2 +#define PYRAMID_DATA_WIN_STREAK_50 3 // the below streak data are redundant with the above when frontier.lvlMode is correct +#define PYRAMID_DATA_WIN_STREAK_OPEN 4 +#define PYRAMID_DATA_WIN_STREAK_ACTIVE_50 5 +#define PYRAMID_DATA_WIN_STREAK_ACTIVE_OPEN 6 +#define PYRAMID_DATA_TRAINER_FLAGS 7 + +#define PYRAMID_LIGHT_SET_RADIUS 0 +#define PYRAMID_LIGHT_INCR_RADIUS 1 + #endif // GUARD_CONSTANTS_BATTLE_PYRAMID_H diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 43b1836f37..e876b6e172 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -787,24 +787,24 @@ static const u8 sHintTextTypes[] = static void (* const sBattlePyramidFunctions[])(void) = { - InitPyramidChallenge, - GetBattlePyramidData, - SetBattlePyramidData, - SavePyramidChallenge, - SetBattlePyramidPrize, - GiveBattlePyramidPrize, - SeedPyramidFloor, - SetPickupItem, - HidePyramidItem, - InitPyramidFacilityTrainers, - ShowPostBattleHintText, - UpdatePyramidWinStreak, - GetInBattlePyramid, - UpdatePyramidLightRadius, - ClearPyramidPartyHeldItems, - SetPyramidFloorPalette, - sub_81A9828, - RestorePyramidPlayerParty, + [BATTLE_PYRAMID_FUNC_INIT] = InitPyramidChallenge, + [BATTLE_PYRAMID_FUNC_GET_DATA] = GetBattlePyramidData, + [BATTLE_PYRAMID_FUNC_SET_DATA] = SetBattlePyramidData, + [BATTLE_PYRAMID_FUNC_SAVE] = SavePyramidChallenge, + [BATTLE_PYRAMID_FUNC_SET_PRIZE] = SetBattlePyramidPrize, + [BATTLE_PYRAMID_FUNC_GIVE_PRIZE] = GiveBattlePyramidPrize, + [BATTLE_PYRAMID_FUNC_SEED_FLOOR] = SeedPyramidFloor, + [BATTLE_PYRAMID_FUNC_SET_ITEM] = SetPickupItem, + [BATTLE_PYRAMID_FUNC_HIDE_ITEM] = HidePyramidItem, + [BATTLE_PYRAMID_FUNC_INIT_TRAINERS] = InitPyramidFacilityTrainers, + [BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT] = ShowPostBattleHintText, + [BATTLE_PYRAMID_FUNC_UPDATE_STREAK] = UpdatePyramidWinStreak, + [BATTLE_PYRAMID_FUNC_IS_IN] = GetInBattlePyramid, + [BATTLE_PYRAMID_FUNC_UPDATE_LIGHT] = UpdatePyramidLightRadius, + [BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS] = ClearPyramidPartyHeldItems, + [BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE] = SetPyramidFloorPalette, + [BATTLE_PYRAMID_FUNC_16] = sub_81A9828, + [BATTLE_PYRAMID_FUNC_RESTORE_PARTY] = RestorePyramidPlayerParty, }; static const u16 sShortStreakRewardItems[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC}; @@ -868,28 +868,28 @@ static void GetBattlePyramidData(void) switch (gSpecialVar_0x8005) { - case 0: + case PYRAMID_DATA_PRIZE: gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidPrize; break; - case 1: + case PYRAMID_DATA_WIN_STREAK: gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode]; break; - case 2: + case PYRAMID_DATA_WIN_STREAK_ACTIVE: if (lvlMode != FRONTIER_LVL_50) gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_OPEN; else gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_50; break; - case 3: + case PYRAMID_DATA_WIN_STREAK_50: gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[FRONTIER_LVL_50]; break; - case 4: + case PYRAMID_DATA_WIN_STREAK_OPEN: gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[FRONTIER_LVL_OPEN]; break; - case 5: + case PYRAMID_DATA_WIN_STREAK_ACTIVE_50: gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_50; break; - case 6: + case PYRAMID_DATA_WIN_STREAK_ACTIVE_OPEN: gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_OPEN; break; } @@ -901,13 +901,13 @@ static void SetBattlePyramidData(void) switch (gSpecialVar_0x8005) { - case 0: + case PYRAMID_DATA_PRIZE: gSaveBlock2Ptr->frontier.pyramidPrize = gSpecialVar_0x8006; break; - case 1: + case PYRAMID_DATA_WIN_STREAK: gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] = gSpecialVar_0x8006; break; - case 2: + case PYRAMID_DATA_WIN_STREAK_ACTIVE: if (lvlMode != FRONTIER_LVL_50) { if (gSpecialVar_0x8006) @@ -923,7 +923,7 @@ static void SetBattlePyramidData(void) gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_PYRAMID_50); } break; - case 7: + case PYRAMID_DATA_TRAINER_FLAGS: gSaveBlock2Ptr->frontier.pyramidTrainerFlags = gSpecialVar_0x8006; break; } @@ -1004,6 +1004,7 @@ static void SetPickupItem(void) else gSpecialVar_0x8000 = sPickupItemsLvl50[round][sPickupItemSlots[i][1]]; + // Quantity of item to give gSpecialVar_0x8001 = 1; } @@ -1122,10 +1123,10 @@ static void UpdatePyramidLightRadius(void) { switch (gSpecialVar_0x8006) { - case 0: + case PYRAMID_LIGHT_SET_RADIUS: gSaveBlock2Ptr->frontier.pyramidLightRadius = gSpecialVar_0x8005; break; - case 1: + case PYRAMID_LIGHT_INCR_RADIUS: switch (gSpecialVar_Result) { case 0: