More Battle Tower map script constants, fewer raw hex values

This commit is contained in:
Remy Oukaour
2018-01-14 19:26:55 -05:00
parent 2ab60fa8a4
commit eb3102200f
19 changed files with 59 additions and 52 deletions

View File

@@ -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_def
const BATTLETOWERACTION_CHECK_EXPLANATION_READ const BATTLETOWERACTION_CHECK_EXPLANATION_READ
const BATTLETOWERACTION_SET_EXPLANATION_READ const BATTLETOWERACTION_SET_EXPLANATION_READ
@@ -33,22 +42,20 @@
const BATTLETOWERACTION_CHOOSEREWARD ; save options const BATTLETOWERACTION_CHOOSEREWARD ; save options
const BATTLETOWERACTION_SAVEOPTIONS 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_def
const BATTLETOWER_NO_CHALLENGE const BATTLETOWER_NO_CHALLENGE
const BATTLETOWER_SAVED_AND_LEFT const BATTLETOWER_SAVED_AND_LEFT
const BATTLETOWER_CHALLENGE_IN_PROGESS const BATTLETOWER_CHALLENGE_IN_PROGESS
const BATTLETOWER_WON_CHALLENGE const BATTLETOWER_WON_CHALLENGE
const BATTLETOWER_RECEIVED_REWARD 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

View File

@@ -240,14 +240,14 @@ CMDQUEUE_STONETABLE EQU 2
const BUGCONTEST_BOXED_MON ; 1 const BUGCONTEST_BOXED_MON ; 1
const BUGCONTEST_NO_CATCH ; 2 const BUGCONTEST_NO_CATCH ; 2
; used by HealMachineAnim ; HealMachineAnim writebyte arguments
; HealMachineAnim.Pointers indexes (see engine/events/heal_machine_anim.asm) ; HealMachineAnim.Pointers indexes (see engine/events/heal_machine_anim.asm)
const_def const_def
const HEALMACHINE_POKECENTER ; 0 const HEALMACHINE_POKECENTER ; 0
const HEALMACHINE_ELMS_LAB ; 1 const HEALMACHINE_ELMS_LAB ; 1
const HEALMACHINE_HALL_OF_FAME ; 2 const HEALMACHINE_HALL_OF_FAME ; 2
; used by Special_UnownPuzzle ; Special_UnownPuzzle writebyte arguments
; LoadUnownPuzzlePiecesGFX.LZPointers indexes (see engine/unown_puzzle.asm) ; LoadUnownPuzzlePiecesGFX.LZPointers indexes (see engine/unown_puzzle.asm)
const_def const_def
const UNOWNPUZZLE_KABUTO ; 0 const UNOWNPUZZLE_KABUTO ; 0
@@ -256,7 +256,7 @@ CMDQUEUE_STONETABLE EQU 2
const UNOWNPUZZLE_HO_OH ; 3 const UNOWNPUZZLE_HO_OH ; 3
NUM_UNOWN_PUZZLES EQU const_value NUM_UNOWN_PUZZLES EQU const_value
; used by Special_DisplayUnownWords ; Special_DisplayUnownWords writebyte arguments
; UnownWalls and MenuDataHeaders_UnownWalls indexes (see data/unown_walls.asm) ; UnownWalls and MenuDataHeaders_UnownWalls indexes (see data/unown_walls.asm)
const_def const_def
const UNOWNWORDS_ESCAPE ; 0 const UNOWNWORDS_ESCAPE ; 0
@@ -264,7 +264,7 @@ NUM_UNOWN_PUZZLES EQU const_value
const UNOWNWORDS_WATER ; 2 const UNOWNWORDS_WATER ; 2
const UNOWNWORDS_HO_OH ; 3 const UNOWNWORDS_HO_OH ; 3
; used by Special_MoveTutor ; Special_MoveTutor writebyte arguments
const_value set 1 const_value set 1
const MOVETUTOR_FLAMETHROWER ; 1 const MOVETUTOR_FLAMETHROWER ; 1
const MOVETUTOR_THUNDERBOLT ; 2 const MOVETUTOR_THUNDERBOLT ; 2

View File

@@ -2452,7 +2452,7 @@ WinTrainerBattle: ; 3cfa4
ld c, 40 ld c, 40
call DelayFrames call DelayFrames
call EmptyBattleTextBox call EmptyBattleTextBox
ld c, $3 ld c, BATTLETOWERTEXT_LOSS_TEXT
farcall BattleTowerText farcall BattleTowerText
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
ld hl, wPayDayMoney ld hl, wPayDayMoney
@@ -3022,7 +3022,7 @@ LostBattle: ; 3d38e
call DelayFrames call DelayFrames
call EmptyBattleTextBox call EmptyBattleTextBox
ld c, 2 ld c, BATTLETOWERTEXT_WIN_TEXT
farcall BattleTowerText farcall BattleTowerText
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
call ClearTileMap call ClearTileMap

View File

@@ -1659,11 +1659,11 @@ ret_170bd2: ; 170bd2
SpecialCheckForBattleTowerRules: ; 170bd3 SpecialCheckForBattleTowerRules: ; 170bd3
farcall CheckForBattleTowerRules farcall CheckForBattleTowerRules
jr c, .asm_170bde jr c, .asm_170bde
xor a xor a ; FALSE
jr .asm_170be0 jr .asm_170be0
.asm_170bde .asm_170bde
ld a, $1 ld a, TRUE
.asm_170be0 .asm_170be0
ld [ScriptVar], a ld [ScriptVar], a

View File

@@ -67,17 +67,17 @@ ReceptionistScript_0x9e3e2:
Script_Menu_ChallengeExplanationCancel: ; 0x9e3fc Script_Menu_ChallengeExplanationCancel: ; 0x9e3fc
writetext Text_WantToGoIntoABattleRoom writetext Text_WantToGoIntoABattleRoom
writebyte $1 writebyte TRUE
special Special_Menu_ChallengeExplanationCancel special Special_Menu_ChallengeExplanationCancel
if_equal $1, Script_ChooseChallenge if_equal 1, Script_ChooseChallenge
if_equal $2, Script_BattleTowerExplanation if_equal 2, Script_BattleTowerExplanation
jump Script_BattleTowerHopeToServeYouAgain jump Script_BattleTowerHopeToServeYouAgain
Script_ChooseChallenge: ; 0x9e40f Script_ChooseChallenge: ; 0x9e40f
writebyte BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM writebyte BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM
special BattleTowerAction special BattleTowerAction
special SpecialCheckForBattleTowerRules special SpecialCheckForBattleTowerRules
if_not_equal $0, Script_WaitButton if_not_equal FALSE, Script_WaitButton
writetext Text_SaveBeforeEnteringBattleRoom writetext Text_SaveBeforeEnteringBattleRoom
yesorno yesorno
iffalse Script_Menu_ChallengeExplanationCancel iffalse Script_Menu_ChallengeExplanationCancel
@@ -193,7 +193,7 @@ UnreferencedScript_0x9e4ea:
special BattleTowerAction special BattleTowerAction
if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70 if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70
special SpecialCheckForBattleTowerRules special SpecialCheckForBattleTowerRules
if_not_equal $0, Script_WaitButton if_not_equal FALSE, Script_WaitButton
writebyte BATTLETOWERACTION_05 writebyte BATTLETOWERACTION_05
special BattleTowerAction special BattleTowerAction
if_equal $0, .zero if_equal $0, .zero

View File

@@ -29,7 +29,7 @@ Script_BattleRoomLoop: ; 0x9f425
waitsfx waitsfx
applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn
opentext opentext
battletowertext $1 battletowertext BATTLETOWERTEXT_INTRO
buttonsound buttonsound
closetext closetext
special BattleTowerBattle ; calls predef startbattle special BattleTowerBattle ; calls predef startbattle

View File

@@ -33,7 +33,7 @@ BurnedTower1F_MapScriptHeader:
.Next: .Next:
checkevent EVENT_RELEASED_THE_BEASTS checkevent EVENT_RELEASED_THE_BEASTS
iftrue .Done iftrue .Done
changeblock 6, 14, $9 ; ladder changeblock 6, 14, $09 ; ladder
.Done: .Done:
return return

View File

@@ -28,7 +28,7 @@ BurnedTowerB1F_MapScriptHeader:
.LadderCallback: .LadderCallback:
checkevent EVENT_RELEASED_THE_BEASTS checkevent EVENT_RELEASED_THE_BEASTS
iftrue .NoChange iftrue .NoChange
changeblock 6, 14, $2 changeblock 6, 14, $02
.NoChange: .NoChange:
return return

View File

@@ -23,7 +23,7 @@ UnknownScript_0x7d781:
jump UnknownScript_0x7d791 jump UnknownScript_0x7d791
UnknownScript_0x7d78a: UnknownScript_0x7d78a:
changeblock 16, 4, $d changeblock 16, 4, $0d
jump UnknownScript_0x7d791 jump UnknownScript_0x7d791
UnknownScript_0x7d791: UnknownScript_0x7d791:
@@ -31,15 +31,15 @@ UnknownScript_0x7d791:
iftrue .Layout2 iftrue .Layout2
checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_3 checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_3
iftrue .Layout3 iftrue .Layout3
changeblock 10, 8, $d changeblock 10, 8, $0d
return return
.Layout2: .Layout2:
changeblock 4, 10, $d changeblock 4, 10, $0d
return return
.Layout3: .Layout3:
changeblock 10, 12, $d changeblock 10, 12, $0d
return return
UnknownScript_0x7d7ac: UnknownScript_0x7d7ac:

View File

@@ -24,7 +24,7 @@ GoldenrodDeptStoreRoof_MapScriptHeader:
.ChangeBlock: .ChangeBlock:
changeblock 0, 2, $3f changeblock 0, 2, $3f
changeblock 0, 4, $f changeblock 0, 4, $0f
return return
.CheckSaleChangeClerk: .CheckSaleChangeClerk:

View File

@@ -27,7 +27,7 @@ LancesRoom_MapScriptHeader:
.KeepDoorsClosed: .KeepDoorsClosed:
checkevent EVENT_LANCES_ROOM_EXIT_OPEN checkevent EVENT_LANCES_ROOM_EXIT_OPEN
iffalse .OpenDoors iffalse .OpenDoors
changeblock 4, 0, $b changeblock 4, 0, $0b
.OpenDoors: .OpenDoors:
return return
@@ -69,7 +69,7 @@ LanceScript_0x180e7b:
waitbutton waitbutton
closetext closetext
playsound SFX_ENTER_DOOR playsound SFX_ENTER_DOOR
changeblock 4, 0, $b changeblock 4, 0, $0b
reloadmappart reloadmappart
closetext closetext
setevent EVENT_LANCES_ROOM_ENTRANCE_CLOSED setevent EVENT_LANCES_ROOM_ENTRANCE_CLOSED

View File

@@ -22,7 +22,7 @@ RadioTower3F_MapScriptHeader:
.Change: .Change:
changeblock 14, 2, $2a changeblock 14, 2, $2a
changeblock 14, 4, $1 changeblock 14, 4, $01
return return
RadioTower3FSuperNerdScript: RadioTower3FSuperNerdScript:
@@ -144,7 +144,7 @@ UnknownScript_0x5e605:
setevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER setevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
playsound SFX_ENTER_DOOR playsound SFX_ENTER_DOOR
changeblock 14, 2, $2a changeblock 14, 2, $2a
changeblock 14, 4, $1 changeblock 14, 4, $01
reloadmappart reloadmappart
closetext closetext
waitsfx waitsfx

View File

@@ -153,8 +153,8 @@ UnknownScript_0x1a4e1e:
scall UnknownScript_0x1a4e7f scall UnknownScript_0x1a4e7f
UnknownScript_0x1a4e21: UnknownScript_0x1a4e21:
askforphonenumber PHONE_COOLTRAINERF_BETH askforphonenumber PHONE_COOLTRAINERF_BETH
if_equal $1, UnknownScript_0x1a4e8f if_equal PHONE_CONTACTS_FULL, UnknownScript_0x1a4e8f
if_equal $2, UnknownScript_0x1a4e8b if_equal PHONE_CONTACT_REFUSED, UnknownScript_0x1a4e8b
trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0 trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0
scall UnknownScript_0x1a4e83 scall UnknownScript_0x1a4e83
jump UnknownScript_0x1a4e87 jump UnknownScript_0x1a4e87

View File

@@ -30,8 +30,8 @@ RuinsOfAlphAerodactylChamber_MapScriptHeader:
return return
.FloorClosed: .FloorClosed:
changeblock 2, 2, $1 changeblock 2, 2, $01
changeblock 4, 2, $2 changeblock 4, 2, $02
return return
.WallOpenScript: .WallOpenScript:

View File

@@ -31,8 +31,8 @@ RuinsOfAlphHoOhChamber_MapScriptHeader:
return return
.FloorClosed: .FloorClosed:
changeblock 2, 2, $1 changeblock 2, 2, $01
changeblock 4, 2, $2 changeblock 4, 2, $02
return return
.WallOpenScript: .WallOpenScript:

View File

@@ -34,8 +34,8 @@ RuinsOfAlphKabutoChamber_MapScriptHeader:
return return
.FloorClosed: .FloorClosed:
changeblock 2, 2, $1 changeblock 2, 2, $01
changeblock 4, 2, $2 changeblock 4, 2, $02
return return
.WallOpenScript: .WallOpenScript:

View File

@@ -31,8 +31,8 @@ RuinsOfAlphOmanyteChamber_MapScriptHeader:
return return
.FloorClosed: .FloorClosed:
changeblock 2, 2, $1 changeblock 2, 2, $01
changeblock 4, 2, $2 changeblock 4, 2, $02
return return
.WallOpenScript: .WallOpenScript:

View File

@@ -79,7 +79,7 @@ TinTower1F_MapScriptHeader:
.StairsCallback: .StairsCallback:
checkevent EVENT_GOT_RAINBOW_WING checkevent EVENT_GOT_RAINBOW_WING
iftrue .DontHideStairs iftrue .DontHideStairs
changeblock 10, 2, $9 changeblock 10, 2, $09
.DontHideStairs: .DontHideStairs:
return return

View File

@@ -429,10 +429,10 @@ Function17d1f1: ; 17d1f1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Parameter: [ScriptVar] = 0..1 ; Parameter: [ScriptVar] = 0..1
; ;
; if [ScriptVar] == 0 ; if [ScriptVar] == FALSE
; Show japanese menu options ; Show japanese menu options
; - News - News - ??? - Cancel ; - News - News - ??? - Cancel
; if [ScriptVar] == 1 ; if [ScriptVar] == TRUE
; Show BattleTower-Menu with 3 options in english language ; Show BattleTower-Menu with 3 options in english language
; - Challenge - Explanation - Cancel ; - Challenge - Explanation - Cancel
Special_Menu_ChallengeExplanationCancel: ; 17d224 Special_Menu_ChallengeExplanationCancel: ; 17d224