summaryrefslogtreecommitdiff
path: root/maps/BattleTowerBattleRoom.asm
blob: 53e6b791492802a3c12c4635938bda8f0521acd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
BattleTowerBattleRoom_MapScriptHeader:
.MapTriggers:
	db 2

	; triggers
	dw Script_EnterBattleRoom, 0
	dw UnknownScript_0x9f420, 0

.MapCallbacks:
	db 0

Script_EnterBattleRoom: ; 0x9f419
	disappear $2
	priorityjump Script_BattleRoom
	dotrigger $1
UnknownScript_0x9f420:
	end

Script_BattleRoom: ; 0x9f421
	applymovement PLAYER, MovementData_0x9e58c
; beat all 7 opponents in a row
Script_BattleRoomLoop: ; 0x9f425
	writebyte $2
	special Function_LoadOpponentTrainerAndPokemonsWithOTSprite
	appear $2
	warpsound
	waitsfx
	applymovement $2, MovementData_0x9e592
	loadfont
	battletowertext 1
	keeptextopen
	closetext
	special BattleTowerBattle ; calls predef startbattle
	special RotatePalettesRightPalettes
	reloadmap
	if_not_equal $0, Script_FailedBattleTowerChallenge
	copybytetovar wNrOfBeatenBattleTowerTrainers ; wcf64
	if_equal BATTLETOWER_NROFTRAINERS, Script_BeatenAllTrainers
	applymovement $2, MovementData_0x9e597
	warpsound
	disappear $2
	applymovement $3, MovementData_0x9e59c
	applymovement PLAYER, MovementData_0x9e5a7
	loadfont
	writetext Text_YourPkmnWillBeHealedToFullHealth
	waitbutton
	closetext
	playmusic MUSIC_HEAL
	special RotatePalettesRightPalettes
	special LoadMapPalettes
	pause 60
	special RotatePalettesLeftPalettes
	special RestartMapMusic
	loadfont
	writetext Text_NextUpOpponentNo
	yesorno
	iffalse Script_DontBattleNextOpponent
Script_ContinueAndBattleNextOpponent: ; 0x9f477
	closetext
	applymovement PLAYER, MovementData_0x9e5a9
	applymovement $3, MovementData_0x9e5a1
	jump Script_BattleRoomLoop

Script_DontBattleNextOpponent: ; 0x9f483
	writetext Text_SaveAndEndTheSession
	yesorno
	iffalse Script_DontSaveAndEndTheSession
	writebyte BATTLE_TOWER_ACTION_07
	special BattleTowerAction
	writebyte BATTLE_TOWER_ACTION_1F
	special BattleTowerAction
	writebyte BATTLE_TOWER_ACTION_03
	special BattleTowerAction
	playsound SFX_SAVE
	waitsfx
	special RotatePalettesRightPalettes
	special Reset
Script_DontSaveAndEndTheSession: ; 0x9f4a3
	writetext Text_CancelYourBattleRoomChallenge
	yesorno
	iffalse Script_ContinueAndBattleNextOpponent
	writebyte BATTLE_TOWER_ACTION_04
	special BattleTowerAction
	writebyte BATTLE_TOWER_ACTION_06
	special BattleTowerAction
	closetext
	special RotatePalettesRightPalettes
	warpfacing UP, BATTLE_TOWER_1F, $7, $7
	loadfont
	jump UnknownScript_0x9e4b0

Script_FailedBattleTowerChallenge:
	pause 60
	special Special_BattleTowerFade
	warpfacing UP, BATTLE_TOWER_1F, $7, $7
	writebyte BATTLE_TOWER_ACTION_04
	special BattleTowerAction
	loadfont
	writetext Text_ThanksForVisiting
	waitbutton
	closetext
	end

Script_BeatenAllTrainers: ; 0x9f4d9
	pause 60
	special Special_BattleTowerFade
	warpfacing UP, BATTLE_TOWER_1F, $7, $7
BattleTowerBattleRoomScript_0x9f4e4:
	loadfont
	writetext Text_CongratulationsYouveBeatenAllTheTrainers
	jump Script_GivePlayerHisPrize

UnknownScript_0x9f4eb:
	writebyte BATTLE_TOWER_ACTION_04
	special BattleTowerAction
	loadfont
	writetext Text_TooMuchTimeElapsedNoRegister
	waitbutton
	closetext
	end

UnknownScript_0x9f4f7:
	writebyte BATTLE_TOWER_ACTION_04
	special BattleTowerAction
	writebyte BATTLE_TOWER_ACTION_06
	special BattleTowerAction
	loadfont
	writetext Text_ThanksForVisiting
	writetext Text_WeHopeToServeYouAgain
	waitbutton
	closetext
	end


UnknownText_0x9f50b:
	text "You'll be returned"
	line "after you SAVE."
	done


BattleTowerBattleRoom_MapEventHeader:
	; filler
	db 0, 0

.Warps:
	db 2
	warp_def $7, $3, 4, BATTLE_TOWER_HALLWAY
	warp_def $7, $4, 4, BATTLE_TOWER_HALLWAY

.XYTriggers:
	db 0

.Signposts:
	db 0

.PersonEvents:
	db 2
	person_event SPRITE_YOUNGSTER, 0, 4, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER
	person_event SPRITE_RECEPTIONIST, 6, 1, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, ObjectEvent, -1