summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2015-11-26 21:05:32 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2015-11-26 21:05:32 -0500
commitc7985e1f3cfe12c487229c34bbdf449a464c2711 (patch)
tree4f1aa761c103d1c8dda47fe8ccab3442f51aadf5
parent01792e00d2d1b0fc1e5550f13a8851c21917aa60 (diff)
Battle Tower scripts and text labels
-rwxr-xr-xconstants/battle_tower_constants.asm70
-rw-r--r--engine/credits.asm2
-rwxr-xr-xengine/evolution_animation.asm16
-rw-r--r--engine/map_setup.asm4
-rw-r--r--engine/save.asm18
-rw-r--r--engine/specials.asm6
-rw-r--r--engine/timeofdaypals.asm6
-rwxr-xr-xevent/field_moves.asm4
-rwxr-xr-xevent/halloffame.asm96
-rwxr-xr-xevent/sacred_ash.asm12
-rwxr-xr-xevent/whiteout.asm2
-rw-r--r--home/map.asm4
-rw-r--r--macros.asm4
-rw-r--r--maps/BattleTower1F.asm150
-rw-r--r--maps/BattleTowerBattleRoom.asm60
-rw-r--r--maps/BattleTowerElevator.asm28
-rw-r--r--maps/BattleTowerHallway.asm12
-rw-r--r--maps/BluesHouse.asm4
-rw-r--r--maps/EcruteakGym.asm2
-rw-r--r--maps/FastShip1F.asm4
-rw-r--r--maps/FastShipCabins_SE_SSE_CaptainsCabin.asm2
-rw-r--r--maps/FastShipCabins_SW_SSW_NW.asm2
-rw-r--r--maps/GoldenrodPokeCenter1F.asm4
-rw-r--r--maps/IndigoPlateauPokeCenter1F.asm2
-rw-r--r--maps/LancesRoom.asm2
-rw-r--r--maps/MobileBattleRoom.asm4
-rw-r--r--maps/MrPokemonsHouse.asm2
-rw-r--r--maps/OlivineLighthouse6F.asm12
-rw-r--r--maps/OlivinePort.asm2
-rw-r--r--maps/RadioTower5F.asm2
-rw-r--r--maps/Route24.asm2
-rw-r--r--maps/Route26HealSpeechHouse.asm2
-rw-r--r--maps/Route35NationalParkgate.asm4
-rw-r--r--maps/Route36NationalParkgate.asm6
-rw-r--r--maps/SilverCaveRoom3.asm2
-rw-r--r--maps/SlowpokeWellB1F.asm4
-rw-r--r--maps/SproutTower3F.asm2
-rw-r--r--maps/TeamRocketBaseB1F.asm12
-rw-r--r--maps/TeamRocketBaseB2F.asm6
-rw-r--r--maps/VermilionPort.asm2
-rw-r--r--maps/WarehouseEntrance.asm8
-rwxr-xr-xmisc/battle_tower_5c.asm118
-rw-r--r--misc/mobile_40.asm2
-rwxr-xr-xmisc/mobile_46.asm40
-rw-r--r--sram.asm33
-rw-r--r--wram.asm22
46 files changed, 434 insertions, 369 deletions
diff --git a/constants/battle_tower_constants.asm b/constants/battle_tower_constants.asm
index 49311f35d..3f368b085 100755
--- a/constants/battle_tower_constants.asm
+++ b/constants/battle_tower_constants.asm
@@ -1,33 +1,39 @@
const_def
- const BATTLE_TOWER_ACTION_00
- const BATTLE_TOWER_ACTION_01
- const BATTLE_TOWER_ACTION_02
- const BATTLE_TOWER_ACTION_03
- const BATTLE_TOWER_ACTION_04
- const BATTLE_TOWER_ACTION_05
- const BATTLE_TOWER_ACTION_06
- const BATTLE_TOWER_ACTION_07
- const BATTLE_TOWER_ACTION_08
- const BATTLE_TOWER_ACTION_09
- const BATTLE_TOWER_ACTION_0A
- const BATTLE_TOWER_ACTION_0B
- const BATTLE_TOWER_ACTION_0C
- const BATTLE_TOWER_ACTION_0D
- const BATTLE_TOWER_ACTION_0E
- const BATTLE_TOWER_ACTION_0F
- const BATTLE_TOWER_ACTION_10
- const BATTLE_TOWER_ACTION_11
- const BATTLE_TOWER_ACTION_12
- const BATTLE_TOWER_ACTION_13
- const BATTLE_TOWER_ACTION_14
- const BATTLE_TOWER_ACTION_15
- const BATTLE_TOWER_ACTION_16
- const BATTLE_TOWER_ACTION_17
- const BATTLE_TOWER_ACTION_18
- const BATTLE_TOWER_ACTION_19
- const BATTLE_TOWER_ACTION_1A
- const BATTLE_TOWER_ACTION_1B
- const BATTLE_TOWER_ACTION_1C
- const BATTLE_TOWER_ACTION_1D
- const BATTLE_TOWER_ACTION_1E
- const BATTLE_TOWER_ACTION_1F
+ const BATTLETOWERACTION_00
+ const BATTLETOWERACTION_01
+ const BATTLETOWERACTION_02
+ const BATTLETOWERACTION_03
+ const BATTLETOWERACTION_CHALLENGECANCELED
+ const BATTLETOWERACTION_05
+ const BATTLETOWERACTION_06 ; reset stuff in SRAM bank 5
+ const BATTLETOWERACTION_SAVELEVELGROUP
+ const BATTLETOWERACTION_LOADLEVELGROUP
+ const BATTLETOWERACTION_CHECKSAVEFILEISYOURS
+ const BATTLETOWERACTION_0A
+ const BATTLETOWERACTION_CHECKMOBILEEVENT
+ const BATTLETOWERACTION_0C ; more time stuff in SRAM bank 5
+ const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5
+ const BATTLETOWERACTION_0E ; egg ticket
+ const BATTLETOWERACTION_0F ; check w3_d090
+ const BATTLETOWERACTION_10 ; jumptable based on 5:a800
+ const BATTLETOWERACTION_11 ; store 0 in 5:aa8d
+ const BATTLETOWERACTION_12 ; store 1 in 5:aa8d
+ const BATTLETOWERACTION_13 ; check 5:aa8d
+ const BATTLETOWERACTION_14 ; if save file is yours: bit 0, [sbe4f]
+ const BATTLETOWERACTION_15 ; set 0, [sbe4f]
+ const BATTLETOWERACTION_16 ; update time in SRAM bank 5
+ const BATTLETOWERACTION_17 ; check time in SRAM bank 5
+ const BATTLETOWERACTION_18 ; level check
+ const BATTLETOWERACTION_19 ; ubers check
+ const BATTLETOWERACTION_RESETDATA ; clear data
+ const BATTLETOWERACTION_1B ; give reward
+ const BATTLETOWERACTION_1C ; set won challenge
+ const BATTLETOWERACTION_1D ; set received reward
+ const BATTLETOWERACTION_1E ; save options
+ const BATTLETOWERACTION_CHOOSEREWARD
+
+BATTLETOWER_NO_CHALLENGE EQU 0
+BATTLETOWER_SAVED_AND_LEFT EQU 1
+BATTLETOWER_CHALLENGE_IN_PROGESS EQU 2
+BATTLETOWER_WON_CHALLENGE EQU 3
+BATTLETOWER_RECEIVED_REWARD EQU 4
diff --git a/engine/credits.asm b/engine/credits.asm
index 6e2bef12d..41ee36920 100644
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -118,7 +118,7 @@ const_value SET -7
const CREDITS_END
-Function109847:: ; 109847
+Credits:: ; 109847
bit 6, b
ld a, $0
jr z, .asm_10984f
diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm
index 835db8b52..53abbfd23 100755
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -389,14 +389,14 @@ Function4e881: ; 4e881
ld [hSCY], a
ld [hSCX], a
call EnableLCD
- ld hl, UnknownText_0x4e8bd
+ ld hl, .SavingRecordDontTurnOff
call PrintText
call Function3200
call SetPalettes
ret
; 4e8bd
-UnknownText_0x4e8bd: ; 0x4e8bd
+.SavingRecordDontTurnOff: ; 0x4e8bd
; SAVING RECORD… DON'T TURN OFF!
text_jump UnknownText_0x1bd39e
db "@"
@@ -418,15 +418,15 @@ Function4e8c2: ; 4e8c2
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
- ld hl, wd000
- ld c, $40
-.asm_4e8ee
- ld a, -1
+ ld hl, wd000 ; UnknBGPals
+ ld c, 4 * $10
+.load_white_palettes
+ ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld [hli], a
- ld a, " "
+ ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld [hli], a
dec c
- jr nz, .asm_4e8ee
+ jr nz, .load_white_palettes
xor a
ld [hSCY], a
ld [hSCX], a
diff --git a/engine/map_setup.asm b/engine/map_setup.asm
index ef1ad715e..7444c7fbe 100644
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -272,8 +272,8 @@ MapSetupCommands: ; 15440
dba LoadMapAttributes ; 1a
dba LoadMapAttributes_SkipPeople ; 1b
dba ClearBGPalettes ; 1c
- dba RotatePalettesRightPalettes ; 1d
- dba RotatePalettesLeftPalettes ; 1e
+ dba FadeOutPalettes ; 1d
+ dba FadeInPalettes ; 1e
dba GetCoordOfUpperLeftCorner ; 1f
dba RestoreFacingAfterWarp ; 20
dba SpawnInFacingDown ; 21
diff --git a/engine/save.asm b/engine/save.asm
index 20f59c042..0feb9fd84 100644
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -182,7 +182,7 @@ AskOverwriteSaveFile: ; 14b89
ld a, [wSaveFileExists]
and a
jr z, .erase
- call Function14bcb
+ call CompareLoadedAndSavedPlayerID
jr z, .yoursavefile
ld hl, UnknownText_0x15297
call SaveTheGame_yesorno
@@ -223,7 +223,7 @@ SaveTheGame_yesorno: ; 14baf
ret
; 14bcb
-Function14bcb: ; 14bcb
+CompareLoadedAndSavedPlayerID: ; 14bcb
ld a, BANK(sPlayerData)
call GetSRAMBank
ld hl, sPlayerData + (PlayerID - wPlayerData)
@@ -291,7 +291,7 @@ SaveGameData_: ; 14c10
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
ld a, [sBattleTowerChallengeState]
- cp $4
+ cp BATTLETOWER_RECEIVED_REWARD
jr nz, .ok
xor a
ld [sBattleTowerChallengeState], a
@@ -373,7 +373,7 @@ ErasePreviousSave: ; 14cbb
call EraseLinkBattleStats
call EraseMysteryGift
call SaveData
- call Function14d5c
+ call EraseBattleTowerStatus
ld a, BANK(sStackTop)
call GetSRAMBank
xor a
@@ -437,7 +437,7 @@ Unknown_14d2c: ; 14d2c
db $11, $0c, $0c, $06, $06, $04
; 14d5c
-Function14d5c: ; 14d5c
+EraseBattleTowerStatus: ; 14d5c
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
xor a
@@ -486,7 +486,7 @@ Function14d93: ; 14d93
; 14da0
-Function14da0: ; 14da0
+HallOfFame_InitSaveIfNeeded: ; 14da0
ld a, [wSavedAtLeastOnce]
and a
ret nz
@@ -512,7 +512,7 @@ SaveOptions: ; 14dbb
ld bc, OptionsEnd - Options
call CopyBytes
ld a, [Options]
- and $ef
+ and $ff ^ (1 << NO_TEXT_SCROLL)
ld [sOptions], a
jp CloseSRAM
; 14dd7
@@ -791,9 +791,9 @@ LoadPlayerData: ; 14fd7 (5:4fd7)
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
ld a, [sBattleTowerChallengeState]
- cp $4
+ cp BATTLETOWER_RECEIVED_REWARD
jr nz, .not_4
- ld a, $3
+ ld a, BATTLETOWER_WON_CHALLENGE
ld [sBattleTowerChallengeState], a
.not_4
call CloseSRAM
diff --git a/engine/specials.asm b/engine/specials.asm
index e2b4e6195..09edbb263 100644
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -66,11 +66,11 @@ SpecialsPointers:: ; c029
add_special Special_CardFlip
add_special Special_DummyNonfunctionalGameCornerGame
add_special Special_ClearBGPalettesBufferScreen
- add_special RotatePalettesRightPalettes
+ add_special FadeOutPalettes
add_special Special_BattleTowerFade
add_special Special_FadeBlackQuickly
- add_special RotatePalettesLeftPalettes
- add_special Special_RotatePalettesLeftQuickly
+ add_special FadeInPalettes
+ add_special Special_FadeInQuickly
add_special Special_ReloadSpritesNoPalettes
add_special ClearBGPalettes
add_special UpdateTimePals
diff --git a/engine/timeofdaypals.asm b/engine/timeofdaypals.asm
index b977772eb..368636758 100644
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -116,7 +116,7 @@ _UpdateTimePals:: ; 8c070
ret
; 8c079
-RotatePalettesLeftPalettes:: ; 8c079
+FadeInPalettes:: ; 8c079
ld c, $12
call GetTimePalFade
ld b, $4
@@ -124,7 +124,7 @@ RotatePalettesLeftPalettes:: ; 8c079
ret
; 8c084
-RotatePalettesRightPalettes:: ; 8c084
+FadeOutPalettes:: ; 8c084
call Function8c0c1
ld c, $9
call GetTimePalFade
@@ -150,7 +150,7 @@ endr
ret
; 8c0ab
-Special_RotatePalettesLeftQuickly: ; 8c0ab
+Special_FadeInQuickly: ; 8c0ab
ld c, $0
call GetTimePalFade
ld b, $4
diff --git a/event/field_moves.asm b/event/field_moves.asm
index e12709b1e..d6fa4a0bb 100755
--- a/event/field_moves.asm
+++ b/event/field_moves.asm
@@ -7,7 +7,7 @@ PlayWhirlpoolSound: ; 8c7d4
; 8c7e1
BlindingFlash: ; 8c7e1
- callba RotatePalettesRightPalettes
+ callba FadeOutPalettes
ld hl, StatusFlags
set 2, [hl]
callba Function8c0e5
@@ -15,7 +15,7 @@ BlindingFlash: ; 8c7e1
ld b, SCGB_09
call GetSGBLayout
callba Function49409
- callba RotatePalettesLeftPalettes
+ callba FadeInPalettes
ret
; 8c80a
diff --git a/event/halloffame.asm b/event/halloffame.asm
index 9aa088495..e2c120102 100755
--- a/event/halloffame.asm
+++ b/event/halloffame.asm
@@ -1,5 +1,5 @@
HallOfFame:: ; 0x8640e
- call Function8648e
+ call HallOfFame_FadeOutMusic
ld a, [StatusFlags]
push af
ld a, 1
@@ -12,7 +12,7 @@ HallOfFame:: ; 0x8640e
ld hl, StatusFlags
set 6, [hl] ; hall of fame
- callba Function14da0
+ callba HallOfFame_InitSaveIfNeeded
ld hl, wHallOfFameCount
ld a, [hl]
@@ -26,10 +26,10 @@ HallOfFame:: ; 0x8640e
xor a
ld [wc2cd], a
- call Function864c3
+ call AnimateHallOfFame
pop af
ld b, a
- callba Function109847
+ callba Credits
ret
; 0x86455
@@ -38,9 +38,9 @@ RedCredits:: ; 86455
ld [MusicFadeIDLo], a
ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a
- ld a, $a
+ ld a, 10
ld [MusicFade], a
- callba RotatePalettesRightPalettes
+ callba FadeOutPalettes
xor a
ld [VramState], a
ld [hMapAnims], a
@@ -52,18 +52,18 @@ RedCredits:: ; 86455
ld [wSpawnAfterChampion], a
ld a, [StatusFlags]
ld b, a
- callba Function109847
+ callba Credits
ret
; 8648e
-Function8648e: ; 8648e
+HallOfFame_FadeOutMusic: ; 8648e
ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a
ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a
ld a, 10
ld [MusicFade], a
- callba RotatePalettesRightPalettes
+ callba FadeOutPalettes
xor a
ld [VramState], a
ld [hMapAnims], a
@@ -72,7 +72,7 @@ Function8648e: ; 8648e
jp DelayFrames
; 864b4
-Function864b4: ; 864b4
+HallOfFame_PlayMusicDE: ; 864b4
push de
ld de, MUSIC_NONE
call PlayMusic
@@ -82,29 +82,29 @@ Function864b4: ; 864b4
ret
; 864c3
-Function864c3: ; 864c3
+AnimateHallOfFame: ; 864c3
xor a
ld [wJumptableIndex], a
- call Function8671c
+ call LoadHOFTeam
jr c, .done
- ld de, SCREEN_WIDTH
- call Function864b4
+ ld de, MUSIC_HALL_OF_FAME
+ call HallOfFame_PlayMusicDE
xor a
ld [wcf64], a
.loop
ld a, [wcf64]
- cp 6
+ cp PARTY_LENGTH
jr nc, .done
- ld hl, wc608 + 1
- ld bc, $10
+ ld hl, wHallOfFameTempMon1
+ ld bc, wHallOfFameTempMon1End - wHallOfFameTempMon1
call AddNTimes
ld a, [hl]
cp -1
jr z, .done
push hl
- call Function865b5
+ call AnimateHOFMonEntrance
pop hl
- call Function8650c
+ call .DisplayNewHallOfFamer
jr c, .done
ld hl, wcf64
inc [hl]
@@ -120,9 +120,9 @@ Function864c3: ; 864c3
ret
; 8650c
-Function8650c: ; 8650c
- call Function86748
- ld de, String_8652c
+.DisplayNewHallOfFamer: ; 8650c
+ call DisplayHOFMon
+ ld de, .String_NewHallOfFamer
hlcoord 1, 2
call PlaceString
call WaitBGMap
@@ -135,7 +135,7 @@ Function8650c: ; 8650c
ret
; 8652c
-String_8652c:
+.String_NewHallOfFamer:
db "New Hall of Famer!@"
; 8653f
@@ -227,7 +227,7 @@ GetHallOfFameParty: ; 8653f
ret
; 865b5
-Function865b5: ; 865b5
+AnimateHOFMonEntrance: ; 865b5
push hl
call ClearBGPalettes
callba Function4e906
@@ -265,7 +265,7 @@ endr
ld b, SCGB_1A
call GetSGBLayout
call SetPalettes
- call Function86635
+ call HOF_SlideBackpic
xor a
ld [wc2c6], a
hlcoord 0, 0
@@ -278,23 +278,23 @@ endr
xor a
ld [hBGMapMode], a
ld [hSCY], a
- call Function86643
+ call HOF_SlideFrontpic
ret
; 86635
-Function86635: ; 86635
-.loop
+HOF_SlideBackpic:
+.backpicloop
ld a, [hSCX]
cp $70
ret z
add $4
ld [hSCX], a
call DelayFrame
- jr .loop
+ jr .backpicloop
; 86643
-Function86643: ; 86643
-.loop
+HOF_SlideFrontpic:
+.frontpicloop
ld a, [hSCX]
and a
ret z
@@ -303,7 +303,7 @@ rept 2
endr
ld [hSCX], a
call DelayFrame
- jr .loop
+ jr .frontpicloop
; 86650
_HallOfFamePC: ; 86650
@@ -311,7 +311,7 @@ _HallOfFamePC: ; 86650
xor a
ld [wJumptableIndex], a
.loop
- call Function8671c
+ call LoadHOFTeam
ret c
call Function86665
ret c
@@ -361,8 +361,8 @@ Function86692: ; 86692
ld a, [wcf64]
cp $6
jr nc, .fail
- ld hl, wc608 + 1
- ld bc, $10
+ ld hl, wHallOfFameTempMon1
+ ld bc, wHallOfFameTempMon1End - wHallOfFameTempMon1
call AddNTimes
ld a, [hl]
cp $ff
@@ -376,8 +376,8 @@ Function86692: ; 86692
push hl
call ClearBGPalettes
pop hl
- call Function86748
- ld a, [wc608]
+ call DisplayHOFMon
+ ld a, [wHallOfFameTempWinCount]
cp 200 + 1
jr c, .print_num_hof
ld de, String_866fc
@@ -391,7 +391,7 @@ Function86692: ; 86692
hlcoord 1, 2
call PlaceString
hlcoord 2, 2
- ld de, wc608
+ ld de, wHallOfFameTempWinCount
lb bc, 1, 3
call PrintNum
hlcoord 11, 2
@@ -423,10 +423,10 @@ String_8670c:
; 8671c
-Function8671c: ; 8671c
+LoadHOFTeam: ; 8671c
ld a, [wJumptableIndex]
cp NUM_HOF_TEAMS
- jr nc, .full
+ jr nc, .invalid
ld hl, sHallOfFame
ld bc, HOF_LENGTH
call AddNTimes
@@ -434,23 +434,23 @@ Function8671c: ; 8671c
call GetSRAMBank
ld a, [hl]
and a
- jr z, .fail
- ld de, wc608
+ jr z, .absent
+ ld de, wHallOfFameTemp
ld bc, HOF_LENGTH
call CopyBytes
call CloseSRAM
and a
ret
-.fail
+.absent
call CloseSRAM
-.full
+.invalid
scf
ret
; 86748
-Function86748: ; 86748
+DisplayHOFMon: ; 86748
xor a
ld [hBGMapMode], a
ld a, [hli]
@@ -466,7 +466,7 @@ Function86748: ; 86748
ld a, [hli]
ld [TempMonLevel], a
ld de, StringBuffer2
- ld bc, 10
+ ld bc, PKMN_NAME_LENGTH - 1
call CopyBytes
ld a, "@"
ld [StringBuffer2 + 10], a
@@ -564,7 +564,7 @@ Function86810: ; 86810
ld b, SCGB_1A
call GetSGBLayout
call SetPalettes
- call Function86635
+ call HOF_SlideBackpic
xor a
ld [wc2c6], a
hlcoord 0, 0
@@ -583,7 +583,7 @@ Function86810: ; 86810
xor a
ld [hBGMapMode], a
ld [hSCY], a
- call Function86643
+ call HOF_SlideFrontpic
xor a
ld [hBGMapMode], a
hlcoord 0, 2
diff --git a/event/sacred_ash.asm b/event/sacred_ash.asm
index 889467bee..88d49b935 100755
--- a/event/sacred_ash.asm
+++ b/event/sacred_ash.asm
@@ -52,12 +52,12 @@ SacredAshScript: ; 0x50821
special HealParty
reloadmappart
playsound SFX_WARP_TO
- special RotatePalettesRightPalettes
- special RotatePalettesLeftPalettes
- special RotatePalettesRightPalettes
- special RotatePalettesLeftPalettes
- special RotatePalettesRightPalettes
- special RotatePalettesLeftPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
waitsfx
writetext UnknownText_0x50845
playsound SFX_CAUGHT_MON
diff --git a/event/whiteout.asm b/event/whiteout.asm
index 05a4e3f82..01985c1c9 100755
--- a/event/whiteout.asm
+++ b/event/whiteout.asm
@@ -10,7 +10,7 @@ Script_OverworldWhiteout:: ; 0x124c8
Script_Whiteout: ; 0x124ce
writetext .WhitedOutText
waitbutton
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
pause 40
special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER
diff --git a/home/map.asm b/home/map.asm
index d50c99349..e385517a1 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -2007,7 +2007,7 @@ FadeToMenu:: ; 2b29
xor a
ld [hBGMapMode], a
call LoadStandardMenuDataHeader
- callba RotatePalettesRightPalettes
+ callba FadeOutPalettes
call ClearSprites
call DisableSpriteUpdates
ret
@@ -2034,7 +2034,7 @@ Function2b5c:: ; 2b5c
call GetSGBLayout
callba Function49409
call Function3200
- callba RotatePalettesLeftPalettes
+ callba FadeInPalettes
call EnableSpriteUpdates
ret
; 2b74
diff --git a/macros.asm b/macros.asm
index fcf3eb15f..3123fdebf 100644
--- a/macros.asm
+++ b/macros.asm
@@ -234,3 +234,7 @@ hlbgcoord EQUS "bgcoord hl,"
debgcoord EQUS "bgcoord de,"
bcbgcoord EQUS "bgcoord bc,"
bgrows EQUS "* $20"
+
+palred EQUS "$0400 *"
+palgreen EQUS "$0020 *"
+palblue EQUS "$0001 *"
diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm
index 1c5b6516e..bdeef6fb6 100644
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -10,27 +10,27 @@ BattleTower1F_MapScriptHeader:
db 0
.Trigger0:
- writebyte BATTLE_TOWER_ACTION_09
+ writebyte BATTLETOWERACTION_CHECKSAVEFILEISYOURS
special BattleTowerAction
iffalse .SkipEverything
- writebyte BATTLE_TOWER_ACTION_02
+ writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState
special BattleTowerAction
if_equal $0, .SkipEverything
if_equal $2, .priorityjump1
if_equal $3, .SkipEverything
if_equal $4, .SkipEverything
loadfont
- writetext UnknownText_0x9f037
+ writetext Text_WeveBeenWaitingForYou
waitbutton
closetext
- priorityjump UnknownScript_0x9e44e
+ priorityjump Script_ResumeBattleTowerChallenge
end
.priorityjump1:
priorityjump BattleTower_LeftWithoutSaving
- writebyte BATTLE_TOWER_ACTION_04
+ writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_06
+ writebyte BATTLETOWERACTION_06
special BattleTowerAction
.SkipEverything:
dotrigger $1
@@ -49,13 +49,13 @@ UnknownScript_0x9e3e0:
end
ReceptionistScript_0x9e3e2:
- writebyte BATTLE_TOWER_ACTION_02
+ writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState
special BattleTowerAction
- if_equal $3, BattleTowerBattleRoomScript_0x9f4e4 ; maps/BattleTowerBattleRoom.asm
+ if_equal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm
loadfont
writetext Text_BattleTowerWelcomesYou
keeptextopen
- writebyte BATTLE_TOWER_ACTION_00
+ writebyte BATTLETOWERACTION_00 ; if new save file: bit 1, [sbe4f]
special BattleTowerAction
if_not_equal $0, Script_Menu_ChallengeExplanationCancel
jump Script_BattleTowerIntroductionYesNo
@@ -66,10 +66,10 @@ Script_Menu_ChallengeExplanationCancel: ; 0x9e3fc
special Special_Menu_ChallengeExplanationCancel
if_equal $1, Script_ChoseChallenge
if_equal $2, Script_BattleTowerExplanation
- jump UnknownScript_0x9e4b0
+ jump Script_BattleTowerHopeToServeYouAgain
Script_ChoseChallenge: ; 0x9e40f
- writebyte BATTLE_TOWER_ACTION_1A ; ResetBattleTowerTrainerSRAM
+ writebyte BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM
special BattleTowerAction
special SpecialCheckForBattleTowerRules
if_not_equal $0, Script_WaitButton
@@ -80,50 +80,50 @@ Script_ChoseChallenge: ; 0x9e40f
special Special_TryQuickSave
iffalse Script_Menu_ChallengeExplanationCancel
dotrigger $1
- writebyte BATTLE_TOWER_ACTION_01
+ writebyte BATTLETOWERACTION_01 ; set 1, [sbe4f]
special BattleTowerAction
special Function1700b0
if_equal $a, Script_Menu_ChallengeExplanationCancel
if_not_equal $0, UnknownScript_0x9e550
- writebyte BATTLE_TOWER_ACTION_11
+ writebyte BATTLETOWERACTION_11
special BattleTowerAction
writetext Text_RightThisWayToYourBattleRoom
waitbutton
closetext
- writebyte BATTLE_TOWER_ACTION_1E
+ writebyte BATTLETOWERACTION_1E
special BattleTowerAction
- jump UnknownScript_0x9e454
+ jump Script_WalkToBattleTowerElevator
-UnknownScript_0x9e44e:
+Script_ResumeBattleTowerChallenge:
closetext
- writebyte BATTLE_TOWER_ACTION_08
+ writebyte BATTLETOWERACTION_LOADLEVELGROUP ; load choice of level group
special BattleTowerAction
-UnknownScript_0x9e454:
- musicfadeout MUSIC_NONE, $8
+Script_WalkToBattleTowerElevator:
+ musicfadeout MUSIC_NONE, 8
domaptrigger BATTLE_TOWER_BATTLE_ROOM, $0
domaptrigger BATTLE_TOWER_ELEVATOR, $0
domaptrigger BATTLE_TOWER_HALLWAY, $0
follow $2, PLAYER
- applymovement $2, MovementData_0x9e571
- writebyte BATTLE_TOWER_ACTION_0A
+ applymovement $2, MovementData_BattleTower1FWalkToElevator
+ writebyte BATTLETOWERACTION_0A
special BattleTowerAction
warpsound
disappear $2
stopfollow
- applymovement PLAYER, MovementData_0x9e576
+ applymovement PLAYER, MovementData_BattleTowerHallwayPlayerEntersBattleRoom
warpcheck
end
Script_GivePlayerHisPrize: ; 0x9e47a
- writebyte BATTLE_TOWER_ACTION_1C
+ writebyte BATTLETOWERACTION_1C
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_1B
+ writebyte BATTLETOWERACTION_1B
special BattleTowerAction
if_equal POTION, Script_YourPackIsStuffedFull
itemtotext $0, $1
giveitem ITEM_FROM_MEM, 5
writetext Text_PlayerGotFive
- writebyte BATTLE_TOWER_ACTION_1D
+ writebyte BATTLETOWERACTION_1D
special BattleTowerAction
closetext
end
@@ -137,21 +137,21 @@ Script_YourPackIsStuffedFull: ; 0x9e498
Script_BattleTowerIntroductionYesNo: ; 0x9e49e
writetext Text_WouldYouLikeToHearAboutTheBattleTower
yesorno
- iffalse UnknownScript_0x9e4a8
+ iffalse Script_BattleTowerSkipExplanation
Script_BattleTowerExplanation: ; 0x9e4a5
writetext Text_BattleTowerIntroduction_2
-UnknownScript_0x9e4a8:
- writebyte BATTLE_TOWER_ACTION_01
+Script_BattleTowerSkipExplanation:
+ writebyte BATTLETOWERACTION_01
special BattleTowerAction
jump Script_Menu_ChallengeExplanationCancel
-UnknownScript_0x9e4b0:
+Script_BattleTowerHopeToServeYouAgain:
writetext Text_WeHopeToServeYouAgain
waitbutton
closetext
end
-UnknownScript_0x9e4b6:
+UnreferencedScript_0x9e4b6:
special Function17f53d
closetext
end
@@ -162,13 +162,13 @@ Script_WaitButton: ; 0x9e4bb
end
-UnknownScript_0x9e4be:
+UnreferencedScript_0x9e4be:
writetext Text_SaveBeforeEnteringBattleRoom
yesorno
iffalse Script_Menu_ChallengeExplanationCancel
special Special_TryQuickSave
iffalse Script_Menu_ChallengeExplanationCancel
- writebyte BATTLE_TOWER_ACTION_01
+ writebyte BATTLETOWERACTION_01
special BattleTowerAction
special Function1700ba
if_equal $a, Script_Menu_ChallengeExplanationCancel
@@ -181,45 +181,45 @@ UnknownScript_0x9e4be:
closetext
end
-UnknownScript_0x9e4ea:
- writebyte BATTLE_TOWER_ACTION_18
+UnreferencedScript_0x9e4ea:
+ writebyte BATTLETOWERACTION_18
special BattleTowerAction
if_not_equal $0, Script_APkmnLevelExceeds
- writebyte BATTLE_TOWER_ACTION_19
+ writebyte BATTLETOWERACTION_19
special BattleTowerAction
if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70
special SpecialCheckForBattleTowerRules
if_not_equal $0, Script_WaitButton
- writebyte BATTLE_TOWER_ACTION_05
+ writebyte BATTLETOWERACTION_05
special BattleTowerAction
- if_equal $0, UnknownScript_0x9e512
- writetext UnknownText_0x9ecb0
- jump UnknownScript_0x9e515
+ if_equal $0, .zero
+ writetext Text_CantBeRegistered_PreviousRecordDeleted
+ jump continue
-UnknownScript_0x9e512:
- writetext UnknownText_0x9ec6d
-UnknownScript_0x9e515:
+.zero:
+ writetext Text_CantBeRegistered
+continue:
yesorno
iffalse Script_Menu_ChallengeExplanationCancel
- writetext UnknownText_0x9ef79
+ writetext Text_SaveBeforeReentry
yesorno
iffalse Script_Menu_ChallengeExplanationCancel
dotrigger $0
special Special_TryQuickSave
iffalse Script_Menu_ChallengeExplanationCancel
dotrigger $1
- writebyte BATTLE_TOWER_ACTION_06
+ writebyte BATTLETOWERACTION_06
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_12
+ writebyte BATTLETOWERACTION_12
special BattleTowerAction
writetext Text_RightThisWayToYourBattleRoom
waitbutton
- jump UnknownScript_0x9e44e
+ jump Script_ResumeBattleTowerChallenge
-UnknownScript_0x9e53b:
- writetext UnknownText_0x9f076
+UnreferencedScript_0x9e53b:
+ writetext Text_FiveDayBattleLimit_Mobile
waitbutton
- jump UnknownScript_0x9e4b0
+ jump Script_BattleTowerHopeToServeYouAgain
Script_APkmnLevelExceeds: ; 0x9e542
writetext Text_APkmnLevelExceeds
@@ -240,7 +240,7 @@ BattleTower_LeftWithoutSaving:
loadfont
writetext Text_BattleTower_LeftWithoutSaving
waitbutton
- jump UnknownScript_0x9e4b0
+ jump Script_BattleTowerHopeToServeYouAgain
YoungsterScript_0x9e55d:
faceplayer
@@ -260,24 +260,24 @@ BugCatcherScript_0x9e56b:
GrannyScript_0x9e56e:
jumptextfaceplayer Text_BattleTowerGranny
-MovementData_0x9e571:
+MovementData_BattleTower1FWalkToElevator:
step_up
step_up
step_up
step_up
step_up
-MovementData_0x9e576:
+MovementData_BattleTowerHallwayPlayerEntersBattleRoom:
step_up
step_end
-MovementData_0x9e578:
+MovementData_BattleTowerElevatorExitElevator:
step_down
step_end
-MovementData_0x9e57a:
+MovementData_BattleTowerHallwayWalkTo1020Room:
step_right
step_right
-MovementData_0x9e57c:
+MovementData_BattleTowerHallwayWalkTo3040Room:
step_right
step_right
step_up
@@ -285,13 +285,13 @@ MovementData_0x9e57c:
turn_head_left
step_end
-MovementData_0x9e582:
+MovementData_BattleTowerHallwayWalkTo90100Room:
step_left
step_left
-MovementData_0x9e584:
+MovementData_BattleTowerHallwayWalkTo7080Room:
step_left
step_left
-MovementData_0x9e586:
+MovementData_BattleTowerHallwayWalkTo5060Room:
step_left
step_left
step_up
@@ -299,7 +299,7 @@ MovementData_0x9e586:
turn_head_right
step_end
-MovementData_0x9e58c:
+MovementData_BattleTowerBattleRoomPlayerWalksIn:
step_up
step_up
step_up
@@ -307,28 +307,28 @@ MovementData_0x9e58c:
turn_head_right
step_end
-MovementData_0x9e592:
+MovementData_BattleTowerBattleRoomOpponentWalksIn:
slow_step_down
slow_step_down
slow_step_down
turn_head_left
step_end
-MovementData_0x9e597:
+MovementData_BattleTowerBattleRoomOpponentWalksOut:
turn_head_up
slow_step_up
slow_step_up
slow_step_up
step_end
-MovementData_0x9e59c:
+MovementData_BattleTowerBattleRoomReceptionistWalksToPlayer:
slow_step_right
slow_step_right
slow_step_up
slow_step_up
step_end
-MovementData_0x9e5a1:
+MovementData_BattleTowerBattleRoomReceptionistWalksAway:
slow_step_down
slow_step_down
slow_step_left
@@ -336,11 +336,11 @@ MovementData_0x9e5a1:
turn_head_right
step_end
-MovementData_0x9e5a7:
+MovementData_BattleTowerBattleRoomPlayerTurnsToFaceReceptionist:
turn_head_down
step_end
-MovementData_0x9e5a9:
+MovementData_BattleTowerBattleRoomPlayerTurnsToFaceNextOpponent:
turn_head_right
step_end
@@ -482,7 +482,7 @@ Text_ThanksForVisiting: ; 0x9ea49
line "visiting!"
done
-UnknownText_0x9ea5f:
+Text_BeatenAllTheTrainers_Mobile:
text "Congratulations!"
para "You've beaten all"
@@ -512,7 +512,7 @@ Text_CongratulationsYouveBeatenAllTheTrainers: ; 0x9eaef
para ""
done
-UnknownText_0x9eb45:
+Text_AskRegisterRecord_Mobile:
text "Would you like to"
line "register your"
@@ -560,7 +560,7 @@ Text_WouldYouLikeToHearAboutTheBattleTower: ; 0x9ec3d
cont "BATTLE TOWER?"
done
-UnknownText_0x9ec6d:
+Text_CantBeRegistered:
text "Your record from"
line "the previous"
@@ -568,7 +568,7 @@ UnknownText_0x9ec6d:
line "be registered. OK?"
done
-UnknownText_0x9ecb0:
+Text_CantBeRegistered_PreviousRecordDeleted:
text "Your record from"
line "the previous"
@@ -637,7 +637,7 @@ Text_NextUpOpponentNo: ; 0x9eebc
text ". Ready?"
done
-UnknownText_0x9eee0:
+Text_SaveBeforeConnecting_Mobile:
text "Your session will"
line "be SAVED before"
@@ -658,7 +658,7 @@ Text_SaveAndEndTheSession: ; 0x9ef5e
line "session?"
done
-UnknownText_0x9ef79:
+Text_SaveBeforeReentry:
text "Your record will"
line "be SAVED before"
@@ -671,7 +671,7 @@ Text_CancelYourBattleRoomChallenge: ; 0x9efbf
line "ROOM challenge?"
done
-UnknownText_0x9efe3:
+Text_RegisterRecordOnFile_Mobile:
text "We have your"
line "previous record on"
@@ -680,7 +680,7 @@ UnknownText_0x9efe3:
cont "it at the CENTER?"
done
-UnknownText_0x9f037:
+Text_WeveBeenWaitingForYou:
text "We've been waiting"
line "for you. This way"
@@ -688,7 +688,7 @@ UnknownText_0x9f037:
line "please."
done
-UnknownText_0x9f076:
+Text_FiveDayBattleLimit_Mobile:
text "You may enter only"
line "five BATTLE ROOMS"
cont "each day."
@@ -713,7 +713,7 @@ Text_TooMuchTimeElapsedNoRegister: ; 0x9f0c1
done
; a dupe?
-UnknownText_0x9f151:
+Text_RegisterRecordTimedOut_Mobile:
text "Sorry, but it's"
line "not possible to"
diff --git a/maps/BattleTowerBattleRoom.asm b/maps/BattleTowerBattleRoom.asm
index 53e6b7914..03c0a90e2 100644
--- a/maps/BattleTowerBattleRoom.asm
+++ b/maps/BattleTowerBattleRoom.asm
@@ -3,21 +3,21 @@ BattleTowerBattleRoom_MapScriptHeader:
db 2
; triggers
- dw Script_EnterBattleRoom, 0
- dw UnknownScript_0x9f420, 0
+ dw .EnterBattleRoom, 0
+ dw .DummyTrigger, 0
.MapCallbacks:
db 0
-Script_EnterBattleRoom: ; 0x9f419
+.EnterBattleRoom: ; 0x9f419
disappear $2
priorityjump Script_BattleRoom
dotrigger $1
-UnknownScript_0x9f420:
+.DummyTrigger:
end
Script_BattleRoom: ; 0x9f421
- applymovement PLAYER, MovementData_0x9e58c
+ applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerWalksIn
; beat all 7 opponents in a row
Script_BattleRoomLoop: ; 0x9f425
writebyte $2
@@ -25,31 +25,31 @@ Script_BattleRoomLoop: ; 0x9f425
appear $2
warpsound
waitsfx
- applymovement $2, MovementData_0x9e592
+ applymovement $2, MovementData_BattleTowerBattleRoomOpponentWalksIn
loadfont
battletowertext 1
keeptextopen
closetext
special BattleTowerBattle ; calls predef startbattle
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
reloadmap
if_not_equal $0, Script_FailedBattleTowerChallenge
copybytetovar wNrOfBeatenBattleTowerTrainers ; wcf64
if_equal BATTLETOWER_NROFTRAINERS, Script_BeatenAllTrainers
- applymovement $2, MovementData_0x9e597
+ applymovement $2, MovementData_BattleTowerBattleRoomOpponentWalksOut
warpsound
disappear $2
- applymovement $3, MovementData_0x9e59c
- applymovement PLAYER, MovementData_0x9e5a7
+ applymovement $3, MovementData_BattleTowerBattleRoomReceptionistWalksToPlayer
+ applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceReceptionist
loadfont
writetext Text_YourPkmnWillBeHealedToFullHealth
waitbutton
closetext
playmusic MUSIC_HEAL
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
special LoadMapPalettes
pause 60
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
special RestartMapMusic
loadfont
writetext Text_NextUpOpponentNo
@@ -57,43 +57,43 @@ Script_BattleRoomLoop: ; 0x9f425
iffalse Script_DontBattleNextOpponent
Script_ContinueAndBattleNextOpponent: ; 0x9f477
closetext
- applymovement PLAYER, MovementData_0x9e5a9
- applymovement $3, MovementData_0x9e5a1
+ applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceNextOpponent
+ applymovement $3, MovementData_BattleTowerBattleRoomReceptionistWalksAway
jump Script_BattleRoomLoop
Script_DontBattleNextOpponent: ; 0x9f483
writetext Text_SaveAndEndTheSession
yesorno
iffalse Script_DontSaveAndEndTheSession
- writebyte BATTLE_TOWER_ACTION_07
+ writebyte BATTLETOWERACTION_SAVELEVELGROUP ; save level group
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_1F
+ writebyte BATTLETOWERACTION_CHOOSEREWARD ; choose reward
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_03
+ writebyte BATTLETOWERACTION_03 ; quicksave
special BattleTowerAction
playsound SFX_SAVE
waitsfx
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
special Reset
Script_DontSaveAndEndTheSession: ; 0x9f4a3
writetext Text_CancelYourBattleRoomChallenge
yesorno
iffalse Script_ContinueAndBattleNextOpponent
- writebyte BATTLE_TOWER_ACTION_04
+ writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_06
+ writebyte BATTLETOWERACTION_06
special BattleTowerAction
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
warpfacing UP, BATTLE_TOWER_1F, $7, $7
loadfont
- jump UnknownScript_0x9e4b0
+ jump Script_BattleTowerHopeToServeYouAgain
Script_FailedBattleTowerChallenge:
pause 60
special Special_BattleTowerFade
warpfacing UP, BATTLE_TOWER_1F, $7, $7
- writebyte BATTLE_TOWER_ACTION_04
+ writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
loadfont
writetext Text_ThanksForVisiting
@@ -105,13 +105,13 @@ Script_BeatenAllTrainers: ; 0x9f4d9
pause 60
special Special_BattleTowerFade
warpfacing UP, BATTLE_TOWER_1F, $7, $7
-BattleTowerBattleRoomScript_0x9f4e4:
+Script_BeatenAllTrainers2:
loadfont
writetext Text_CongratulationsYouveBeatenAllTheTrainers
jump Script_GivePlayerHisPrize
-UnknownScript_0x9f4eb:
- writebyte BATTLE_TOWER_ACTION_04
+UnreferencedScript_0x9f4eb:
+ writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
loadfont
writetext Text_TooMuchTimeElapsedNoRegister
@@ -119,10 +119,10 @@ UnknownScript_0x9f4eb:
closetext
end
-UnknownScript_0x9f4f7:
- writebyte BATTLE_TOWER_ACTION_04
+UnreferencedScript_0x9f4f7:
+ writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
- writebyte BATTLE_TOWER_ACTION_06
+ writebyte BATTLETOWERACTION_06
special BattleTowerAction
loadfont
writetext Text_ThanksForVisiting
@@ -132,7 +132,7 @@ UnknownScript_0x9f4f7:
end
-UnknownText_0x9f50b:
+Text_ReturnedAfterSave_Mobile:
text "You'll be returned"
line "after you SAVE."
done
diff --git a/maps/BattleTowerElevator.asm b/maps/BattleTowerElevator.asm
index 158e42487..919857fba 100644
--- a/maps/BattleTowerElevator.asm
+++ b/maps/BattleTowerElevator.asm
@@ -3,43 +3,43 @@ BattleTowerElevator_MapScriptHeader:
db 2
; triggers
- dw UnknownScript_0x9f562, 0
- dw UnknownScript_0x9f567, 0
+ dw .Trigger0, 0
+ dw .Trigger1, 0
.MapCallbacks:
db 0
-UnknownScript_0x9f562:
- priorityjump UnknownScript_0x9f568
+.Trigger0:
+ priorityjump .RideElevator
dotrigger $1
-UnknownScript_0x9f567:
+.Trigger1:
end
-UnknownScript_0x9f568:
+.RideElevator:
follow $2, PLAYER
- applymovement $2, MovementData_0x9f58f
- applymovement PLAYER, MovementData_0x9f592
- writebyte BATTLE_TOWER_ACTION_0A
+ applymovement $2, MovementData_BattleTowerElevatorReceptionistWalksIn
+ applymovement PLAYER, MovementData_BattleTowerElevatorPlayerWalksIn
+ writebyte BATTLETOWERACTION_0A
special BattleTowerAction
playsound SFX_ELEVATOR
earthquake 60
waitsfx
follow $2, PLAYER
- applymovement $2, MovementData_0x9e578
+ applymovement $2, MovementData_BattleTowerElevatorExitElevator
stopfollow
warpsound
disappear $2
- applymovement PLAYER, MovementData_0x9e578
+ applymovement PLAYER, MovementData_BattleTowerElevatorExitElevator
warpcheck
end
-MovementData_0x9f58f:
+MovementData_BattleTowerElevatorReceptionistWalksIn:
step_right
turn_head_down
step_end
-MovementData_0x9f592:
+MovementData_BattleTowerElevatorPlayerWalksIn:
turn_head_down
step_end
@@ -60,4 +60,4 @@ BattleTowerElevator_MapEventHeader:
.PersonEvents:
db 1
- person_event SPRITE_RECEPTIONIST, 2, 1, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, MovementData_0x9f58f, -1
+ person_event SPRITE_RECEPTIONIST, 2, 1, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, MovementData_BattleTowerElevatorReceptionistWalksIn, -1
diff --git a/maps/BattleTowerHallway.asm b/maps/BattleTowerHallway.asm
index 717359117..b557cb17e 100644
--- a/maps/BattleTowerHallway.asm
+++ b/maps/BattleTowerHallway.asm
@@ -47,23 +47,23 @@ BattleTowerHallway_MapScriptHeader:
if_equal 8, .L70L80
if_equal 9, .L90L100
if_equal 10, .L90L100
- applymovement $2, MovementData_0x9e57a
+ applymovement $2, MovementData_BattleTowerHallwayWalkTo1020Room
jump .EnterBattleRoom
.L30L40: ; 0x9f603
- applymovement $2, MovementData_0x9e57c
+ applymovement $2, MovementData_BattleTowerHallwayWalkTo3040Room
jump .EnterBattleRoom
.L50L60: ; 0x9f60a
- applymovement $2, MovementData_0x9e586
+ applymovement $2, MovementData_BattleTowerHallwayWalkTo5060Room
jump .EnterBattleRoom
.L70L80: ; 0x9f611
- applymovement $2, MovementData_0x9e584
+ applymovement $2, MovementData_BattleTowerHallwayWalkTo7080Room
jump .EnterBattleRoom
.L90L100: ; 0x9f618
- applymovement $2, MovementData_0x9e582
+ applymovement $2, MovementData_BattleTowerHallwayWalkTo90100Room
jump .EnterBattleRoom
.EnterBattleRoom: ; 0x9f61f
@@ -73,7 +73,7 @@ BattleTowerHallway_MapScriptHeader:
waitbutton
closetext
stopfollow
- applymovement PLAYER, MovementData_0x9e576
+ applymovement PLAYER, MovementData_BattleTowerHallwayPlayerEntersBattleRoom
warpcheck
end
diff --git a/maps/BluesHouse.asm b/maps/BluesHouse.asm
index fca3a3e06..77409fde8 100644
--- a/maps/BluesHouse.asm
+++ b/maps/BluesHouse.asm
@@ -30,10 +30,10 @@ UnknownScript_0x19b0de:
writetext UnknownText_0x19b266
waitbutton
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
playmusic MUSIC_HEAL
pause 60
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
special RestartMapMusic
loadfont
writetext UnknownText_0x19b296
diff --git a/maps/EcruteakGym.asm b/maps/EcruteakGym.asm
index 23f95fcea..3509923b1 100644
--- a/maps/EcruteakGym.asm
+++ b/maps/EcruteakGym.asm
@@ -84,7 +84,7 @@ UnknownScript_0x99dc6:
follow PLAYER, $8
applymovement PLAYER, MovementData_0x99e5f
stopfollow
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
playsound SFX_ENTER_DOOR
waitsfx
warp ECRUTEAK_CITY, $6, $1b
diff --git a/maps/FastShip1F.asm b/maps/FastShip1F.asm
index 04ec4e9d7..c56df9dee 100644
--- a/maps/FastShip1F.asm
+++ b/maps/FastShip1F.asm
@@ -64,7 +64,7 @@ SailorScript_0x75160:
closetext
scall .LetThePlayerOut
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
setevent EVENT_VERMILION_PORT_SAILOR_AT_GANGWAY
domaptrigger VERMILION_PORT, $1
@@ -77,7 +77,7 @@ SailorScript_0x75160:
closetext
scall .LetThePlayerOut
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
setevent EVENT_OLIVINE_PORT_SAILOR_AT_GANGWAY
domaptrigger OLIVINE_PORT, $1
diff --git a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
index 049b7cc47..c6c9e70f8 100644
--- a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
+++ b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
@@ -43,7 +43,7 @@ TwinScript_0x75ebb:
appear $4
spriteface PLAYER, UP
spriteface $4, UP
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
spriteface $3, DOWN
showemote EMOTE_SHOCK, $3, 15
applymovement $4, MovementData_0x7600c
diff --git a/maps/FastShipCabins_SW_SSW_NW.asm b/maps/FastShipCabins_SW_SSW_NW.asm
index 0ce295648..5f78f7952 100644
--- a/maps/FastShipCabins_SW_SSW_NW.asm
+++ b/maps/FastShipCabins_SW_SSW_NW.asm
@@ -70,7 +70,7 @@ FastShipBed:
playmusic MUSIC_HEAL
pause 60
special RestartMapMusic
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
loadfont
writetext FastShipBedText2
waitbutton
diff --git a/maps/GoldenrodPokeCenter1F.asm b/maps/GoldenrodPokeCenter1F.asm
index f33cd06be..bfe4aa3e9 100644
--- a/maps/GoldenrodPokeCenter1F.asm
+++ b/maps/GoldenrodPokeCenter1F.asm
@@ -9,7 +9,7 @@ NurseScript_0x60f91:
jumpstd pokecenternurse
GoldenrodPokeCenter1F_GSBallTriggerLeft:
- writebyte BATTLE_TOWER_ACTION_0B
+ writebyte BATTLETOWERACTION_CHECKMOBILEEVENT
special BattleTowerAction
if_equal MOBILE_EVENT_OBJECT_GS_BALL, .gsball
end
@@ -41,7 +41,7 @@ GoldenrodPokeCenter1F_GSBallTriggerLeft:
end
GoldenrodPokeCenter1F_GSBallTriggerRight:
- writebyte BATTLE_TOWER_ACTION_0B
+ writebyte BATTLETOWERACTION_CHECKMOBILEEVENT
special BattleTowerAction
if_equal MOBILE_EVENT_OBJECT_GS_BALL, .gsball
end
diff --git a/maps/IndigoPlateauPokeCenter1F.asm b/maps/IndigoPlateauPokeCenter1F.asm
index 7676e242e..40a5f6518 100644
--- a/maps/IndigoPlateauPokeCenter1F.asm
+++ b/maps/IndigoPlateauPokeCenter1F.asm
@@ -154,7 +154,7 @@ TeleportGuyScript:
waitbutton
closetext
playsound SFX_WARP_TO
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
warp NEW_BARK_TOWN, $d, $6
end
diff --git a/maps/LancesRoom.asm b/maps/LancesRoom.asm
index d92d14c7e..5d08bd68c 100644
--- a/maps/LancesRoom.asm
+++ b/maps/LancesRoom.asm
@@ -125,7 +125,7 @@ LanceScript_0x180e7b:
pause 30
closetext
applymovement $3, MovementData_0x180f5b
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
pause 15
warpfacing UP, HALL_OF_FAME, $4, $d
end
diff --git a/maps/MobileBattleRoom.asm b/maps/MobileBattleRoom.asm
index 90eefc1ae..281482ff5 100644
--- a/maps/MobileBattleRoom.asm
+++ b/maps/MobileBattleRoom.asm
@@ -35,11 +35,11 @@ MapMobileBattleRoomSignpost0Script:
writetext MobileBattleRoom_HealText
pause 20
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
playmusic MUSIC_HEAL
special LoadMapPalettes
pause 60
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
special RestartMapMusic
refreshscreen $0
.two_:
diff --git a/maps/MrPokemonsHouse.asm b/maps/MrPokemonsHouse.asm
index e8187a03e..0f52116a4 100644
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -114,7 +114,7 @@ UnknownScript_0x196ec9:
special Mobile_HealParty
special HealParty
pause 60
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
special RestartMapMusic
loadfont
writetext UnknownText_0x197134
diff --git a/maps/OlivineLighthouse6F.asm b/maps/OlivineLighthouse6F.asm
index 3a2ac17f3..7cf2ea64c 100644
--- a/maps/OlivineLighthouse6F.asm
+++ b/maps/OlivineLighthouse6F.asm
@@ -42,9 +42,9 @@ UnknownScript_0x60bab:
closetext
special RestartMapMusic
cry AMPHAROS
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
pause 10
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
loadfont
writetext UnknownText_0x60f3d
waitbutton
@@ -116,10 +116,10 @@ UnknownScript_0x60c51:
cry AMPHAROS
waitbutton
closetext
- special RotatePalettesRightPalettes
- special RotatePalettesLeftPalettes
- special RotatePalettesRightPalettes
- special RotatePalettesLeftPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
end
ItemFragment_0x60c66:
diff --git a/maps/OlivinePort.asm b/maps/OlivinePort.asm
index 69bf62fc7..8066eddd5 100644
--- a/maps/OlivinePort.asm
+++ b/maps/OlivinePort.asm
@@ -39,7 +39,7 @@ SailorScript_0x748c0:
waitsfx
applymovement PLAYER, MovementData_0x74a30
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
checkevent EVENT_FAST_SHIP_FIRST_TIME
iffalse UnknownScript_0x7490a
diff --git a/maps/RadioTower5F.asm b/maps/RadioTower5F.asm
index 962483ee5..1c96c0124 100644
--- a/maps/RadioTower5F.asm
+++ b/maps/RadioTower5F.asm
@@ -95,7 +95,7 @@ UnknownScript_0x6006e:
disappear $3
disappear $4
pause 15
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
setevent EVENT_BEAT_ROCKET_EXECUTIVEM_1
setevent EVENT_CLEARED_RADIO_TOWER
clearflag ENGINE_ROCKETS_IN_RADIO_TOWER
diff --git a/maps/Route24.asm b/maps/Route24.asm
index b397f4664..a45a51902 100644
--- a/maps/Route24.asm
+++ b/maps/Route24.asm
@@ -29,7 +29,7 @@ RocketScript_0x1adbfa:
special Special_ReloadSpritesNoPalettes
disappear $2
pause 25
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
playmapmusic
end
diff --git a/maps/Route26HealSpeechHouse.asm b/maps/Route26HealSpeechHouse.asm
index 42e51c9a0..7fc8f5330 100644
--- a/maps/Route26HealSpeechHouse.asm
+++ b/maps/Route26HealSpeechHouse.asm
@@ -17,7 +17,7 @@ TeacherScript_0x7b125:
playmusic MUSIC_HEAL
special HealParty
pause 60
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
special RestartMapMusic
loadfont
writetext UnknownText_0x7b18b
diff --git a/maps/Route35NationalParkgate.asm b/maps/Route35NationalParkgate.asm
index 732bf6a9d..ba0a387ba 100644
--- a/maps/Route35NationalParkgate.asm
+++ b/maps/Route35NationalParkgate.asm
@@ -75,7 +75,7 @@ Route35NationalParkgate_GoBackIn:
closetext
scall Route35NationalParkgate_EnterContest
playsound SFX_ENTER_DOOR
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
warpfacing UP, NATIONAL_PARK_BUG_CONTEST, $a, $2f
end
@@ -112,7 +112,7 @@ Route35NationalParkgate_OkayToProceed:
special Special_GiveParkBalls
scall Route35NationalParkgate_EnterContest
playsound SFX_ENTER_DOOR
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
special Special_SelectRandomBugContestContestants
warpfacing UP, NATIONAL_PARK_BUG_CONTEST, $a, $2f
diff --git a/maps/Route36NationalParkgate.asm b/maps/Route36NationalParkgate.asm
index ff31456af..f8e57dc90 100644
--- a/maps/Route36NationalParkgate.asm
+++ b/maps/Route36NationalParkgate.asm
@@ -74,7 +74,7 @@ Route36NationalParkgate_MapScriptHeader:
appear $d
applymovement PLAYER, MovementData_0x6add1
pause 15
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
jumpstd bugcontestresults
.GoBackToContest:
@@ -83,7 +83,7 @@ Route36NationalParkgate_MapScriptHeader:
closetext
spriteface PLAYER, LEFT
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
warpfacing LEFT, NATIONAL_PARK_BUG_CONTEST, $21, $12
end
@@ -166,7 +166,7 @@ Route36OfficerScriptContest:
special Special_GiveParkBalls
spriteface PLAYER, LEFT
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
special Special_SelectRandomBugContestContestants
warpfacing LEFT, NATIONAL_PARK_BUG_CONTEST, $21, $12
diff --git a/maps/SilverCaveRoom3.asm b/maps/SilverCaveRoom3.asm
index d645de38a..14b5413b1 100644
--- a/maps/SilverCaveRoom3.asm
+++ b/maps/SilverCaveRoom3.asm
@@ -26,7 +26,7 @@ RedScript_0x18c603:
special Special_ReloadSpritesNoPalettes
disappear $2
pause 15
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
pause 30
special HealParty
refreshscreen $0
diff --git a/maps/SlowpokeWellB1F.asm b/maps/SlowpokeWellB1F.asm
index 4153c3a56..fd79ee7f9 100644
--- a/maps/SlowpokeWellB1F.asm
+++ b/maps/SlowpokeWellB1F.asm
@@ -34,7 +34,7 @@ GruntM1Script:
disappear $4
disappear $5
pause 15
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
disappear $8
moveperson $8, $b, $6
appear $8
@@ -56,7 +56,7 @@ GruntM1Script:
clearevent EVENT_AZALEA_TOWN_SLOWPOKES
clearevent EVENT_KURTS_HOUSE_SLOWPOKE
clearevent EVENT_KURTS_HOUSE_KURT_1
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
special HealParty
pause 15
warp KURTS_HOUSE, $3, $3
diff --git a/maps/SproutTower3F.asm b/maps/SproutTower3F.asm
index 15649fc8c..218ff1993 100644
--- a/maps/SproutTower3F.asm
+++ b/maps/SproutTower3F.asm
@@ -51,7 +51,7 @@ UnknownScript_0x184947:
special Special_ReloadSpritesNoPalettes
disappear $8
waitsfx
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
dotrigger $1
special RestartMapMusic
end
diff --git a/maps/TeamRocketBaseB1F.asm b/maps/TeamRocketBaseB1F.asm
index 05380185f..cf07a06df 100644
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -445,9 +445,9 @@ ExplodingTrap22:
end
VoltorbExplodingTrap:
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
cry VOLTORB
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
setlasttalked $ff
writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
scriptedpokedata VOLTORB, 23
@@ -455,9 +455,9 @@ VoltorbExplodingTrap:
end
GeodudeExplodingTrap:
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
cry GEODUDE
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
setlasttalked $ff
writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
scriptedpokedata GEODUDE, 21
@@ -465,9 +465,9 @@ GeodudeExplodingTrap:
end
KoffingExplodingTrap:
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
cry KOFFING
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
setlasttalked $ff
writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
scriptedpokedata KOFFING, 21
diff --git a/maps/TeamRocketBaseB2F.asm b/maps/TeamRocketBaseB2F.asm
index 909a6d08c..976cddfe2 100644
--- a/maps/TeamRocketBaseB2F.asm
+++ b/maps/TeamRocketBaseB2F.asm
@@ -106,7 +106,7 @@ UnknownScript_0x6cfac:
disappear $d
disappear $e
pause 15
- special Special_RotatePalettesLeftQuickly
+ special Special_FadeInQuickly
dotrigger $2
clearevent EVENT_TEAM_ROCKET_BASE_B2F_LANCE
spriteface $4, DOWN
@@ -155,11 +155,11 @@ UnknownScript_0x6d091:
writetext UnknownText_0x6da97
waitbutton
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
special Mobile_HealParty
playsound SFX_FULL_HEAL
special HealParty
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
loadfont
writetext UnknownText_0x6daf7
waitbutton
diff --git a/maps/VermilionPort.asm b/maps/VermilionPort.asm
index e5e963e0c..72efec242 100644
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -51,7 +51,7 @@ SailorScript_0x74dc4:
waitsfx
applymovement PLAYER, MovementData_0x74ef1
playsound SFX_EXIT_BUILDING
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
waitsfx
setevent EVENT_FAST_SHIP_PASSENGERS_EASTBOUND
clearevent EVENT_FAST_SHIP_PASSENGERS_WESTBOUND
diff --git a/maps/WarehouseEntrance.asm b/maps/WarehouseEntrance.asm
index 669947d5b..261df3c11 100644
--- a/maps/WarehouseEntrance.asm
+++ b/maps/WarehouseEntrance.asm
@@ -226,10 +226,10 @@ OlderHaircutBrotherScript:
writetext UnknownText_0x7c6b8
waitbutton
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
playmusic MUSIC_HEAL
pause 60
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
special RestartMapMusic
loadfont
writetext UnknownText_0x7c6d8
@@ -309,10 +309,10 @@ YoungerHaircutBrotherScript:
writetext UnknownText_0x7c80e
waitbutton
closetext
- special RotatePalettesRightPalettes
+ special FadeOutPalettes
playmusic MUSIC_HEAL
pause 60
- special RotatePalettesLeftPalettes
+ special FadeInPalettes
special RestartMapMusic
loadfont
writetext UnknownText_0x7c82a
diff --git a/misc/battle_tower_5c.asm b/misc/battle_tower_5c.asm
index 9fd5ef865..76a2eac44 100755
--- a/misc/battle_tower_5c.asm
+++ b/misc/battle_tower_5c.asm
@@ -627,7 +627,7 @@ CopyBTTrainer_FromBT_OT_TowBT_OTTemp: ; 1704a2
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
- ld a, $2
+ ld a, BATTLETOWER_CHALLENGE_IN_PROGESS
ld [sBattleTowerChallengeState], a
ld hl, sNrOfBeatenBattleTowerTrainers
inc [hl]
@@ -960,13 +960,13 @@ endr
dw Function17075f ; 0x00
dw Function170788 ; 0x01
dw Function170778 ; 0x02
- dw Function170799 ; 0x03
- dw Function17079d ; 0x04
+ dw BattleTowerAction_SetByteToQuickSaveChallenge ; 0x03
+ dw BattleTowerAction_SetByteToCancelChallenge ; 0x04
dw Function1707ac ; 0x05
dw Function1707f4 ; 0x06
- dw Function170868 ; 0x07
- dw Function170881 ; 0x08
- dw Function17089a ; 0x09
+ dw SaveBattleTowerLevelGroup ; 0x07
+ dw LoadBattleTowerLevelGroup ; 0x08
+ dw BattleTower_CheckSaveFileExistsAndIsYours ; 0x09
dw Function1708b1 ; 0x0a
dw CheckMobileEventIndex ; 0x0b
dw Function1708c8 ; 0x0c
@@ -987,7 +987,7 @@ endr
dw Function1706ee ; 0x1b
dw Function17071b ; 0x1c
dw Function170729 ; 0x1d
- dw Function17073e ; 0x1e
+ dw BattleTower_RandomlyChooseReward ; 0x1e
dw Function170737 ; 0x1f
@@ -1040,7 +1040,7 @@ Function1706ee: ; 1706ee (5c:46ee) BattleTowerAction $1b
Function17071b: ; 17071b (5c:471b) BattleTowerAction $1c
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
- ld a, $3
+ ld a, BATTLETOWER_WON_CHALLENGE
ld [sBattleTowerChallengeState], a
call CloseSRAM
ret
@@ -1048,7 +1048,7 @@ Function17071b: ; 17071b (5c:471b) BattleTowerAction $1c
Function170729: ; 170729 (5c:4729) BattleTowerAction $1d
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
- ld a, $4
+ ld a, BATTLETOWER_RECEIVED_REWARD
ld [sBattleTowerChallengeState], a
call CloseSRAM
ret
@@ -1057,7 +1057,7 @@ Function170737: ; 170737 (5c:4737) BattleTowerAction $1e
callba SaveOptions
ret
-Function17073e: ; 17073e (5c:473e) BattleTowerAction $1f
+BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1f
; Generate a random stat boosting item.
.loop
call Random
@@ -1079,7 +1079,7 @@ Function17073e: ; 17073e (5c:473e) BattleTowerAction $1f
ret
Function17075f: ; 17075f (5c:475f) BattleTowerAction $00
- call Function17089a
+ call BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar]
and a
ret z
@@ -1110,12 +1110,12 @@ Function170788: ; 170788 (5c:4788) BattleTowerAction $01
call CloseSRAM
ret
-Function170799: ; 170799 (5c:4799) BattleTowerAction $03
- ld c, $1
+BattleTowerAction_SetByteToQuickSaveChallenge: ; 170799 (5c:4799) BattleTowerAction $03
+ ld c, BATTLETOWER_SAVED_AND_LEFT
jr asm_17079f
-Function17079d: ; 17079d (5c:479d) BattleTowerAction $04
- ld c, $0
+BattleTowerAction_SetByteToCancelChallenge: ; 17079d (5c:479d) BattleTowerAction $04
+ ld c, BATTLETOWER_NO_CHALLENGE
asm_17079f: ; 17079f (5c:479f)
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
@@ -1210,9 +1210,10 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
and a
jr nz, .asm_170853
ret
+
.asm_170849
ld hl, CurDay
- ld a, $8c
+ ld a, 140
sub c
add [hl]
cp $b
@@ -1228,39 +1229,39 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
call CloseSRAM
ret
-Function170868: ; 170868 (5c:4868) BattleTowerAction $07
- ld a, BANK(sbe47)
+SaveBattleTowerLevelGroup: ; 170868 (5c:4868) BattleTowerAction $07
+ ld a, BANK(sBTChoiceOfLevelGroup)
call GetSRAMBank
ld a, [rSVBK]
push af
ld a, $3
ld [rSVBK], a
- ld a, [wd000 + $800]
- ld [sbe47], a
+ ld a, [wBTChoiceOfLvlGroup]
+ ld [sBTChoiceOfLevelGroup], a
pop af
ld [rSVBK], a
call CloseSRAM
ret
-Function170881: ; 170881 (5c:4881) BattleTowerAction $08
- ld a, BANK(sbe47)
+LoadBattleTowerLevelGroup: ; 170881 (5c:4881) BattleTowerAction $08 ; Load level group choice
+ ld a, BANK(sBTChoiceOfLevelGroup)
call GetSRAMBank
ld a, [rSVBK]
push af
ld a, $3
ld [rSVBK], a
- ld a, [sbe47]
- ld [wd000 + $800], a
+ ld a, [sBTChoiceOfLevelGroup]
+ ld [wBTChoiceOfLvlGroup], a
pop af
ld [rSVBK], a
call CloseSRAM
ret
-Function17089a: ; 17089a BattleTowerAction $09
+BattleTower_CheckSaveFileExistsAndIsYours: ; 17089a BattleTowerAction $09
ld a, [wSaveFileExists]
and a
jr z, .nope
- callba Function14bcb
+ callba CompareLoadedAndSavedPlayerID
jr z, .yes
xor a
jr .nope
@@ -1366,7 +1367,7 @@ Function17093c: ; 17093c (5c:493c) BattleTowerAction $0e
jr nz, .not_egg
push hl
ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
- ld de, $6
+ ld de, $6 ; NAME_LENGTH
ld a, b
and a
jr z, .skip
@@ -1376,38 +1377,38 @@ Function17093c: ; 17093c (5c:493c) BattleTowerAction $0e
jr nz, .loop2
.skip
ld de, String_1709a4
- ld a, $6
-.asm_17096e
+ ld a, $6 ; NAME_LENGTH
+.compare_loop
push af
ld a, [de]
inc de
cp [hl]
inc hl
- jr nz, .asm_17099d
+ jr nz, .different
pop af
dec a
- jr nz, .asm_17096e
+ jr nz, .compare_loop
rept 4
dec hl
endr
- ld a, $50
+ ld a, "@"
rept 2
ld [hli], a
endr
pop hl
ld a, EGG_TICKET
ld [CurItem], a
- ld a, $1
+ ld a, 1
ld [wItemQuantityChangeBuffer], a
- ld a, $ff
- ld [wd107], a
+ ld a, -1
+ ld [ItemCountBuffer], a
ld hl, NumItems
call TossItem
ld a, $1
ld [ScriptVar], a
ret
-.asm_17099d
+.different
pop af
pop hl
.not_egg
@@ -1461,26 +1462,26 @@ endr
; 1709e7 (5c:49e7)
Jumptable_1709e7: ; 1709e7
- dw Function170a00
- dw Function170a00
- dw Function1709f3
- dw Function1709f3
- dw Function170a01
- dw Function170a33
+ dw .NoAction
+ dw .NoAction
+ dw .DoAction1
+ dw .DoAction1
+ dw .Action4
+ dw .Action5
; 1709f3
-Function1709f3: ; 1709f3
+.DoAction1: ; 1709f3
ld a, $5
call GetSRAMBank
ld a, $1
ld [$a800], a
call CloseSRAM
-Function170a00: ; 170a00
+.NoAction: ; 170a00
ret
; 170a01
-Function170a01: ; 170a01
+.Action4: ; 170a01
ld a, $5
call GetSRAMBank
ld hl, $b023
@@ -1499,7 +1500,7 @@ Function170a01: ; 170a01
ret
; 170a33
-Function170a33: ; 170a33
+.Action5: ; 170a33
ld a, $0
call GetSRAMBank
ld hl, wRTC
@@ -1512,14 +1513,14 @@ Function170a33: ; 170a33
ld hl, $b08c
ld de, wMisc
ld c, $4
-.asm_170a54
+.compare_loop
ld a, [de]
inc de
cp [hl]
- jr nz, .asm_170a78
+ jr nz, .different
inc hl
dec c
- jr nz, .asm_170a54
+ jr nz, .compare_loop
call CloseSRAM
ld a, [MapGroup]
ld b, a
@@ -1528,17 +1529,17 @@ Function170a33: ; 170a33
call GetMapTrigger
ld a, d
or e
- jr z, .asm_170a72
+ jr z, .no_trigger
ld a, [de]
and a
ret nz
-.asm_170a72
+.no_trigger
ld a, $1
ld [ScriptVar], a
ret
-.asm_170a78
+.different
call CloseSRAM
ld a, $5
call GetSRAMBank
@@ -1553,11 +1554,11 @@ Function170a33: ; 170a33
call GetMapTrigger
ld a, d
or e
- jr z, .asm_170a9b
+ jr z, .no_trigger_2
xor a
ld [de], a
-.asm_170a9b
+.no_trigger_2
ret
; 170a9c
@@ -1584,10 +1585,11 @@ Function170aaf: ; 170aaf (5c:4aaf) BattleTowerAction $13
ret
Function170abe: ; 170abe (5c:4abe) BattleTowerAction $14
- call Function17089a
+ call BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar]
and a
ret z
+
ld a, BANK(sbe4f)
call GetSRAMBank
ld a, [sbe4f]
@@ -1610,13 +1612,13 @@ Function170ae8: ; 170ae8 (5c:4ae8) BattleTowerAction $18
call GetSRAMBank
ld a, [$b2fb]
call CloseSRAM
- ld c, $a
+ ld c, 10
call SimpleDivide
ld a, b
ld [wcd4f], a
xor a
ld [ScriptVar], a
- callba Function119d93
+ callba Function119d93 ; level check
ret nc
ld a, $5
call GetSRAMBank
@@ -1636,7 +1638,7 @@ Function170b16: ; 170b16 (5c:4b16) BattleTowerAction $19
ld [wcd4f], a
xor a
ld [ScriptVar], a
- callba Function119dd1
+ callba Function119dd1 ; ubers check
ret nc
ld a, $5
call GetSRAMBank
diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm
index cd990b686..8b6557789 100644
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -313,7 +313,7 @@ Function10016f: ; 10016f
Function10020b: ; 10020b
xor a
ld [wc303], a
- callba RotatePalettesRightPalettes
+ callba FadeOutPalettes
callba Function106464
call HideSprites
call DelayFrame
diff --git a/misc/mobile_46.asm b/misc/mobile_46.asm
index 836da4fa0..1488b40c3 100755
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -4108,7 +4108,7 @@ Function119d93: ; 119d93 (46:5d93)
ld bc, PARTYMON_STRUCT_LENGTH
ld de, PartyMon1Level
ld a, [PartyCount]
-.asm_119daf
+.party_loop
push af
ld a, [de]
push hl
@@ -4119,17 +4119,18 @@ Function119d93: ; 119d93 (46:5d93)
pop de
pop hl
cp [hl]
- jr z, .asm_119dbd
- jr nc, .asm_119dc6
-.asm_119dbd
+ jr z, .equal
+ jr nc, .exceeds
+.equal
pop af
dec a
- jr nz, .asm_119daf
+ jr nz, .party_loop
pop af
ld [rSVBK], a
and a
ret
-.asm_119dc6
+
+.exceeds
pop af
ld a, $4
ld [wcf66], a
@@ -4143,40 +4144,41 @@ Function119dd1: ; 119dd1 (46:5dd1)
push af
ld a, [wcd4f]
cp 70 / 10
- jr nc, .asm_119e08
+ jr nc, .level_70_or_more
ld a, $1
ld [rSVBK], a
ld hl, PartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
ld de, PartySpecies
ld a, [PartyCount]
-.asm_119deb
+.loop
push af
ld a, [de]
cp MEWTWO
- jr z, .asm_119dfd
+ jr z, .uber
cp MEW
- jr z, .asm_119dfd
+ jr z, .uber
cp LUGIA
- jr c, .asm_119e02
+ jr c, .next
cp NUM_POKEMON + 1
- jr nc, .asm_119e02
-.asm_119dfd
+ jr nc, .next
+.uber
ld a, [hl]
cp 70
- jr c, .asm_119e0d
-.asm_119e02
+ jr c, .uber_under_70
+.next
add hl, bc
inc de
pop af
dec a
- jr nz, .asm_119deb
-.asm_119e08
+ jr nz, .loop
+.level_70_or_more
pop af
ld [rSVBK], a
and a
ret
-.asm_119e0d
+
+.uber_under_70
pop af
ld a, [de]
ld [wd265], a
@@ -7707,7 +7709,7 @@ Function11b7e5: ; 11b7e5
; 11b879
Function11b879: ; 11b879
- callba Function17089a
+ callba BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar]
and a
ret z
diff --git a/sram.asm b/sram.asm
index b825813c0..10ae39cf9 100644
--- a/sram.asm
+++ b/sram.asm
@@ -135,7 +135,36 @@ s1_b277::
sLinkBattleStatsEnd::
sHallOfFame:: ; b2c0
- ds HOF_LENGTH * NUM_HOF_TEAMS
+sHallOfFame01:: hall_of_fame sHallOfFame01
+sHallOfFame02:: hall_of_fame sHallOfFame02
+sHallOfFame03:: hall_of_fame sHallOfFame03
+sHallOfFame04:: hall_of_fame sHallOfFame04
+sHallOfFame05:: hall_of_fame sHallOfFame05
+sHallOfFame06:: hall_of_fame sHallOfFame06
+sHallOfFame07:: hall_of_fame sHallOfFame07
+sHallOfFame08:: hall_of_fame sHallOfFame08
+sHallOfFame09:: hall_of_fame sHallOfFame09
+sHallOfFame10:: hall_of_fame sHallOfFame10
+sHallOfFame11:: hall_of_fame sHallOfFame11
+sHallOfFame12:: hall_of_fame sHallOfFame12
+sHallOfFame13:: hall_of_fame sHallOfFame13
+sHallOfFame14:: hall_of_fame sHallOfFame14
+sHallOfFame15:: hall_of_fame sHallOfFame15
+sHallOfFame16:: hall_of_fame sHallOfFame16
+sHallOfFame17:: hall_of_fame sHallOfFame17
+sHallOfFame18:: hall_of_fame sHallOfFame18
+sHallOfFame19:: hall_of_fame sHallOfFame19
+sHallOfFame20:: hall_of_fame sHallOfFame20
+sHallOfFame21:: hall_of_fame sHallOfFame21
+sHallOfFame22:: hall_of_fame sHallOfFame22
+sHallOfFame23:: hall_of_fame sHallOfFame23
+sHallOfFame24:: hall_of_fame sHallOfFame24
+sHallOfFame25:: hall_of_fame sHallOfFame25
+sHallOfFame26:: hall_of_fame sHallOfFame26
+sHallOfFame27:: hall_of_fame sHallOfFame27
+sHallOfFame28:: hall_of_fame sHallOfFame28
+sHallOfFame29:: hall_of_fame sHallOfFame29
+sHallOfFame30:: hall_of_fame sHallOfFame30
sHallOfFameEnd::
sMobileEventIndex:: ds 1
@@ -152,7 +181,7 @@ sBattleTowerChallengeState:: ds 1
sBattleTower:: ; be46
sNrOfBeatenBattleTowerTrainers:: ds 1
-sbe47:: ds 1
+sBTChoiceOfLevelGroup:: ds 1
; The 7 trainers of the BattleTower are saved here, so nobody appears more than once
sBTTrainers:: ; sbe48
ds 7
diff --git a/wram.asm b/wram.asm
index afd540b14..100dee0f0 100644
--- a/wram.asm
+++ b/wram.asm
@@ -156,6 +156,25 @@ mailmsg: MACRO
\1End::
endm
+hof_mon: MACRO
+\1Species:: ds 1
+\1ID:: ds 2
+\1DVs:: ds 2
+\1Level:: ds 1
+\1Nickname:: ds PKMN_NAME_LENGTH +- 1
+\1End::
+endm
+
+hall_of_fame: MACRO
+\1WinCount:: ds 1
+\1Mon1:: hof_mon \1Mon1
+\1Mon2:: hof_mon \1Mon2
+\1Mon3:: hof_mon \1Mon3
+\1Mon4:: hof_mon \1Mon4
+\1Mon5:: hof_mon \1Mon5
+\1Mon6:: hof_mon \1Mon6
+\1End:: ds 1
+ENDM
INCLUDE "vram.asm"
@@ -520,6 +539,9 @@ wOddEggOTName:: ds PKMN_NAME_LENGTH
wBT_OTTemp:: battle_tower_struct wBT_OTTemp
ds wBT_OTTemp - @
+wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
+ ds wHallOfFameTemp - @
+
wMisc:: ; ds $28 * 6
wBattle::
wc608::