diff --git a/constants/battle_tower_constants.asm b/constants/battle_tower_constants.asm index 852ebf297..58853da3a 100755 --- a/constants/battle_tower_constants.asm +++ b/constants/battle_tower_constants.asm @@ -1,4 +1,13 @@ -; BattleTowerAction arguments (see mobile/battle_tower_5c.asm) +BATTLETOWER_NROFPKMNS EQU 3 +BATTLETOWER_NROFTRAINERS EQU 7 + +BATTLETOWER_NUM_UNIQUE_PKMN EQU 21 +BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70 + +BATTLETOWER_TRAINERDATALENGTH EQU $24 +BATTLE_TOWER_STRUCT_LENGTH EQU $e0 ; NAME_LENGTH + BATTLETOWER_NROFPKMNS * (PARTYMON_STRUCT_LENGTH + PKMN_NAME_LENGTH) + BATTLETOWER_TRAINERDATALENGTH + +; BattleTowerAction writebyte arguments (see engine/events/battle_tower/battle_tower.asm) const_def const BATTLETOWERACTION_CHECK_EXPLANATION_READ const BATTLETOWERACTION_SET_EXPLANATION_READ @@ -33,22 +42,20 @@ const BATTLETOWERACTION_CHOOSEREWARD ; save options const BATTLETOWERACTION_SAVEOPTIONS -; sBattleTowerChallengeState +; BattleTowerAction return values +; - from BATTLETOWERACTION_CHECKMOBILEEVENT +MOBILE_EVENT_OBJECT_GS_BALL EQU $b + +; BattleTowerText arguments (see engine/events/battle_tower/trainer_text.asm) +const_value set 1 + const BATTLETOWERTEXT_INTRO + const BATTLETOWERTEXT_WIN_TEXT + const BATTLETOWERTEXT_LOSS_TEXT + +; sBattleTowerChallengeState values const_def const BATTLETOWER_NO_CHALLENGE const BATTLETOWER_SAVED_AND_LEFT const BATTLETOWER_CHALLENGE_IN_PROGESS const BATTLETOWER_WON_CHALLENGE const BATTLETOWER_RECEIVED_REWARD - -BATTLETOWER_NROFPKMNS EQU 3 -BATTLETOWER_NROFTRAINERS EQU 7 - -BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70 -BATTLETOWER_NUM_UNIQUE_PKMN EQU 21 - -BATTLETOWER_TRAINERDATALENGTH EQU $24 -BATTLE_TOWER_STRUCT_LENGTH EQU $e0 ; NAME_LENGTH + BATTLETOWER_NROFPKMNS * (PARTYMON_STRUCT_LENGTH + PKMN_NAME_LENGTH) + BATTLETOWER_TRAINERDATALENGTH - -; return value from BattleTowerAction(BATTLETOWERACTION_CHECKMOBILEEVENT) -MOBILE_EVENT_OBJECT_GS_BALL EQU $b diff --git a/constants/script_constants.asm b/constants/script_constants.asm index fcda68744..fd5affce6 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -240,14 +240,14 @@ CMDQUEUE_STONETABLE EQU 2 const BUGCONTEST_BOXED_MON ; 1 const BUGCONTEST_NO_CATCH ; 2 -; used by HealMachineAnim +; HealMachineAnim writebyte arguments ; HealMachineAnim.Pointers indexes (see engine/events/heal_machine_anim.asm) const_def const HEALMACHINE_POKECENTER ; 0 const HEALMACHINE_ELMS_LAB ; 1 const HEALMACHINE_HALL_OF_FAME ; 2 -; used by Special_UnownPuzzle +; Special_UnownPuzzle writebyte arguments ; LoadUnownPuzzlePiecesGFX.LZPointers indexes (see engine/unown_puzzle.asm) const_def const UNOWNPUZZLE_KABUTO ; 0 @@ -256,7 +256,7 @@ CMDQUEUE_STONETABLE EQU 2 const UNOWNPUZZLE_HO_OH ; 3 NUM_UNOWN_PUZZLES EQU const_value -; used by Special_DisplayUnownWords +; Special_DisplayUnownWords writebyte arguments ; UnownWalls and MenuDataHeaders_UnownWalls indexes (see data/unown_walls.asm) const_def const UNOWNWORDS_ESCAPE ; 0 @@ -264,7 +264,7 @@ NUM_UNOWN_PUZZLES EQU const_value const UNOWNWORDS_WATER ; 2 const UNOWNWORDS_HO_OH ; 3 -; used by Special_MoveTutor +; Special_MoveTutor writebyte arguments const_value set 1 const MOVETUTOR_FLAMETHROWER ; 1 const MOVETUTOR_THUNDERBOLT ; 2 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 35d2098bc..a604bc37a 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2452,7 +2452,7 @@ WinTrainerBattle: ; 3cfa4 ld c, 40 call DelayFrames call EmptyBattleTextBox - ld c, $3 + ld c, BATTLETOWERTEXT_LOSS_TEXT farcall BattleTowerText call WaitPressAorB_BlinkCursor ld hl, wPayDayMoney @@ -3022,7 +3022,7 @@ LostBattle: ; 3d38e call DelayFrames call EmptyBattleTextBox - ld c, 2 + ld c, BATTLETOWERTEXT_WIN_TEXT farcall BattleTowerText call WaitPressAorB_BlinkCursor call ClearTileMap diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 5a132a2cb..d3a292811 100755 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -1659,11 +1659,11 @@ ret_170bd2: ; 170bd2 SpecialCheckForBattleTowerRules: ; 170bd3 farcall CheckForBattleTowerRules jr c, .asm_170bde - xor a + xor a ; FALSE jr .asm_170be0 .asm_170bde - ld a, $1 + ld a, TRUE .asm_170be0 ld [ScriptVar], a diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm index aafa5698c..ddf0e3c8e 100644 --- a/maps/BattleTower1F.asm +++ b/maps/BattleTower1F.asm @@ -67,17 +67,17 @@ ReceptionistScript_0x9e3e2: Script_Menu_ChallengeExplanationCancel: ; 0x9e3fc writetext Text_WantToGoIntoABattleRoom - writebyte $1 + writebyte TRUE special Special_Menu_ChallengeExplanationCancel - if_equal $1, Script_ChooseChallenge - if_equal $2, Script_BattleTowerExplanation + if_equal 1, Script_ChooseChallenge + if_equal 2, Script_BattleTowerExplanation jump Script_BattleTowerHopeToServeYouAgain Script_ChooseChallenge: ; 0x9e40f writebyte BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM special BattleTowerAction special SpecialCheckForBattleTowerRules - if_not_equal $0, Script_WaitButton + if_not_equal FALSE, Script_WaitButton writetext Text_SaveBeforeEnteringBattleRoom yesorno iffalse Script_Menu_ChallengeExplanationCancel @@ -193,7 +193,7 @@ UnreferencedScript_0x9e4ea: special BattleTowerAction if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70 special SpecialCheckForBattleTowerRules - if_not_equal $0, Script_WaitButton + if_not_equal FALSE, Script_WaitButton writebyte BATTLETOWERACTION_05 special BattleTowerAction if_equal $0, .zero diff --git a/maps/BattleTowerBattleRoom.asm b/maps/BattleTowerBattleRoom.asm index e74b9634c..6a23dbcc1 100644 --- a/maps/BattleTowerBattleRoom.asm +++ b/maps/BattleTowerBattleRoom.asm @@ -29,7 +29,7 @@ Script_BattleRoomLoop: ; 0x9f425 waitsfx applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn opentext - battletowertext $1 + battletowertext BATTLETOWERTEXT_INTRO buttonsound closetext special BattleTowerBattle ; calls predef startbattle diff --git a/maps/BurnedTower1F.asm b/maps/BurnedTower1F.asm index 89fd33e5d..d35fd0a00 100644 --- a/maps/BurnedTower1F.asm +++ b/maps/BurnedTower1F.asm @@ -33,7 +33,7 @@ BurnedTower1F_MapScriptHeader: .Next: checkevent EVENT_RELEASED_THE_BEASTS iftrue .Done - changeblock 6, 14, $9 ; ladder + changeblock 6, 14, $09 ; ladder .Done: return diff --git a/maps/BurnedTowerB1F.asm b/maps/BurnedTowerB1F.asm index 1a3aac3d3..0f0846d2a 100644 --- a/maps/BurnedTowerB1F.asm +++ b/maps/BurnedTowerB1F.asm @@ -28,7 +28,7 @@ BurnedTowerB1F_MapScriptHeader: .LadderCallback: checkevent EVENT_RELEASED_THE_BEASTS iftrue .NoChange - changeblock 6, 14, $2 + changeblock 6, 14, $02 .NoChange: return diff --git a/maps/GoldenrodDeptStoreB1F.asm b/maps/GoldenrodDeptStoreB1F.asm index 035bc1107..7922e4185 100644 --- a/maps/GoldenrodDeptStoreB1F.asm +++ b/maps/GoldenrodDeptStoreB1F.asm @@ -23,7 +23,7 @@ UnknownScript_0x7d781: jump UnknownScript_0x7d791 UnknownScript_0x7d78a: - changeblock 16, 4, $d + changeblock 16, 4, $0d jump UnknownScript_0x7d791 UnknownScript_0x7d791: @@ -31,15 +31,15 @@ UnknownScript_0x7d791: iftrue .Layout2 checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_3 iftrue .Layout3 - changeblock 10, 8, $d + changeblock 10, 8, $0d return .Layout2: - changeblock 4, 10, $d + changeblock 4, 10, $0d return .Layout3: - changeblock 10, 12, $d + changeblock 10, 12, $0d return UnknownScript_0x7d7ac: diff --git a/maps/GoldenrodDeptStoreRoof.asm b/maps/GoldenrodDeptStoreRoof.asm index 24fc33ded..8fcadbb3f 100644 --- a/maps/GoldenrodDeptStoreRoof.asm +++ b/maps/GoldenrodDeptStoreRoof.asm @@ -24,7 +24,7 @@ GoldenrodDeptStoreRoof_MapScriptHeader: .ChangeBlock: changeblock 0, 2, $3f - changeblock 0, 4, $f + changeblock 0, 4, $0f return .CheckSaleChangeClerk: diff --git a/maps/LancesRoom.asm b/maps/LancesRoom.asm index 330943b8c..b181e419e 100644 --- a/maps/LancesRoom.asm +++ b/maps/LancesRoom.asm @@ -27,7 +27,7 @@ LancesRoom_MapScriptHeader: .KeepDoorsClosed: checkevent EVENT_LANCES_ROOM_EXIT_OPEN iffalse .OpenDoors - changeblock 4, 0, $b + changeblock 4, 0, $0b .OpenDoors: return @@ -69,7 +69,7 @@ LanceScript_0x180e7b: waitbutton closetext playsound SFX_ENTER_DOOR - changeblock 4, 0, $b + changeblock 4, 0, $0b reloadmappart closetext setevent EVENT_LANCES_ROOM_ENTRANCE_CLOSED diff --git a/maps/RadioTower3F.asm b/maps/RadioTower3F.asm index 3b62ec884..7c2862e80 100644 --- a/maps/RadioTower3F.asm +++ b/maps/RadioTower3F.asm @@ -22,7 +22,7 @@ RadioTower3F_MapScriptHeader: .Change: changeblock 14, 2, $2a - changeblock 14, 4, $1 + changeblock 14, 4, $01 return RadioTower3FSuperNerdScript: @@ -144,7 +144,7 @@ UnknownScript_0x5e605: setevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER playsound SFX_ENTER_DOOR changeblock 14, 2, $2a - changeblock 14, 4, $1 + changeblock 14, 4, $01 reloadmappart closetext waitsfx diff --git a/maps/Route26.asm b/maps/Route26.asm index bb6774f27..148d5e96c 100644 --- a/maps/Route26.asm +++ b/maps/Route26.asm @@ -153,8 +153,8 @@ UnknownScript_0x1a4e1e: scall UnknownScript_0x1a4e7f UnknownScript_0x1a4e21: askforphonenumber PHONE_COOLTRAINERF_BETH - if_equal $1, UnknownScript_0x1a4e8f - if_equal $2, UnknownScript_0x1a4e8b + if_equal PHONE_CONTACTS_FULL, UnknownScript_0x1a4e8f + if_equal PHONE_CONTACT_REFUSED, UnknownScript_0x1a4e8b trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0 scall UnknownScript_0x1a4e83 jump UnknownScript_0x1a4e87 diff --git a/maps/RuinsOfAlphAerodactylChamber.asm b/maps/RuinsOfAlphAerodactylChamber.asm index 216c079e7..8ed3c6a65 100644 --- a/maps/RuinsOfAlphAerodactylChamber.asm +++ b/maps/RuinsOfAlphAerodactylChamber.asm @@ -30,8 +30,8 @@ RuinsOfAlphAerodactylChamber_MapScriptHeader: return .FloorClosed: - changeblock 2, 2, $1 - changeblock 4, 2, $2 + changeblock 2, 2, $01 + changeblock 4, 2, $02 return .WallOpenScript: diff --git a/maps/RuinsOfAlphHoOhChamber.asm b/maps/RuinsOfAlphHoOhChamber.asm index 16a978cbf..0aeee9f56 100644 --- a/maps/RuinsOfAlphHoOhChamber.asm +++ b/maps/RuinsOfAlphHoOhChamber.asm @@ -31,8 +31,8 @@ RuinsOfAlphHoOhChamber_MapScriptHeader: return .FloorClosed: - changeblock 2, 2, $1 - changeblock 4, 2, $2 + changeblock 2, 2, $01 + changeblock 4, 2, $02 return .WallOpenScript: diff --git a/maps/RuinsOfAlphKabutoChamber.asm b/maps/RuinsOfAlphKabutoChamber.asm index 14e096b58..1b82d9e40 100644 --- a/maps/RuinsOfAlphKabutoChamber.asm +++ b/maps/RuinsOfAlphKabutoChamber.asm @@ -34,8 +34,8 @@ RuinsOfAlphKabutoChamber_MapScriptHeader: return .FloorClosed: - changeblock 2, 2, $1 - changeblock 4, 2, $2 + changeblock 2, 2, $01 + changeblock 4, 2, $02 return .WallOpenScript: diff --git a/maps/RuinsOfAlphOmanyteChamber.asm b/maps/RuinsOfAlphOmanyteChamber.asm index 1bfa3b076..902f4a1e1 100644 --- a/maps/RuinsOfAlphOmanyteChamber.asm +++ b/maps/RuinsOfAlphOmanyteChamber.asm @@ -31,8 +31,8 @@ RuinsOfAlphOmanyteChamber_MapScriptHeader: return .FloorClosed: - changeblock 2, 2, $1 - changeblock 4, 2, $2 + changeblock 2, 2, $01 + changeblock 4, 2, $02 return .WallOpenScript: diff --git a/maps/TinTower1F.asm b/maps/TinTower1F.asm index 7c6f1aee8..7e19d0ef2 100644 --- a/maps/TinTower1F.asm +++ b/maps/TinTower1F.asm @@ -79,7 +79,7 @@ TinTower1F_MapScriptHeader: .StairsCallback: checkevent EVENT_GOT_RAINBOW_WING iftrue .DontHideStairs - changeblock 10, 2, $9 + changeblock 10, 2, $09 .DontHideStairs: return diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index f03b7416a..ffd3202a8 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -429,10 +429,10 @@ Function17d1f1: ; 17d1f1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Parameter: [ScriptVar] = 0..1 ; -; if [ScriptVar] == 0 +; if [ScriptVar] == FALSE ; Show japanese menu options ; - News - News - ??? - Cancel -; if [ScriptVar] == 1 +; if [ScriptVar] == TRUE ; Show BattleTower-Menu with 3 options in english language ; - Challenge - Explanation - Cancel Special_Menu_ChallengeExplanationCancel: ; 17d224