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
|
object_const_def
const BATTLETOWERBATTLEROOM_YOUNGSTER
const BATTLETOWERBATTLEROOM_RECEPTIONIST
BattleTowerBattleRoom_MapScripts:
def_scene_scripts
scene_script .EnterBattleRoom ; SCENE_DEFAULT
scene_script .DummyScene ; SCENE_FINISHED
def_callbacks
.EnterBattleRoom:
disappear BATTLETOWERBATTLEROOM_YOUNGSTER
sdefer Script_BattleRoom
setscene SCENE_FINISHED
.DummyScene:
end
Script_BattleRoom:
applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerWalksIn
; beat all 7 opponents in a row
Script_BattleRoomLoop:
setval BATTLETOWERBATTLEROOM_YOUNGSTER
special LoadOpponentTrainerAndPokemonWithOTSprite
appear BATTLETOWERBATTLEROOM_YOUNGSTER
warpsound
waitsfx
applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn
opentext
battletowertext BATTLETOWERTEXT_INTRO
promptbutton
closetext
special BattleTowerBattle ; predef StartBattle
special FadeOutPalettes
reloadmap
ifnotequal $0, Script_FailedBattleTowerChallenge
readmem wNrOfBeatenBattleTowerTrainers
ifequal BATTLETOWER_STREAK_LENGTH, Script_BeatenAllTrainers
applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksOut
warpsound
disappear BATTLETOWERBATTLEROOM_YOUNGSTER
applymovement BATTLETOWERBATTLEROOM_RECEPTIONIST, MovementData_BattleTowerBattleRoomReceptionistWalksToPlayer
applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceReceptionist
opentext
writetext Text_YourMonWillBeHealedToFullHealth
waitbutton
closetext
playmusic MUSIC_HEAL
special FadeOutPalettes
special LoadMapPalettes
pause 60
special FadeInPalettes
special RestartMapMusic
opentext
writetext Text_NextUpOpponentNo
yesorno
iffalse Script_DontBattleNextOpponent
Script_ContinueAndBattleNextOpponent:
closetext
applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceNextOpponent
applymovement BATTLETOWERBATTLEROOM_RECEPTIONIST, MovementData_BattleTowerBattleRoomReceptionistWalksAway
sjump Script_BattleRoomLoop
Script_DontBattleNextOpponent:
writetext Text_SaveAndEndTheSession
yesorno
iffalse Script_DontSaveAndEndTheSession
setval BATTLETOWERACTION_SAVELEVELGROUP ; save level group
special BattleTowerAction
setval BATTLETOWERACTION_SAVEOPTIONS ; choose reward
special BattleTowerAction
setval BATTLETOWERACTION_SAVE_AND_QUIT ; quicksave
special BattleTowerAction
playsound SFX_SAVE
waitsfx
special FadeOutPalettes
special Reset
Script_DontSaveAndEndTheSession:
writetext Text_CancelYourBattleRoomChallenge
yesorno
iffalse Script_ContinueAndBattleNextOpponent
setval BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
setval BATTLETOWERACTION_06
special BattleTowerAction
closetext
special FadeOutPalettes
warpfacing UP, BATTLE_TOWER_1F, 7, 7
opentext
sjump Script_BattleTowerHopeToServeYouAgain
Script_FailedBattleTowerChallenge:
pause 60
special BattleTowerFade
warpfacing UP, BATTLE_TOWER_1F, 7, 7
setval BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
opentext
writetext Text_ThanksForVisiting
waitbutton
closetext
end
Script_BeatenAllTrainers:
pause 60
special BattleTowerFade
warpfacing UP, BATTLE_TOWER_1F, 7, 7
Script_BeatenAllTrainers2:
opentext
writetext Text_CongratulationsYouveBeatenAllTheTrainers
sjump Script_GivePlayerHisPrize
Script_TooMuchTimeElapsedNoRegister: ; unreferenced
setval BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
opentext
writetext Text_TooMuchTimeElapsedNoRegister
waitbutton
closetext
end
Script_ChallengeCanceled: ; unreferenced
setval BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction
setval BATTLETOWERACTION_06
special BattleTowerAction
opentext
writetext Text_ThanksForVisiting
writetext Text_WeHopeToServeYouAgain
waitbutton
closetext
end
Text_ReturnedAfterSave_Mobile: ; unreferenced
text "You'll be returned"
line "after you SAVE."
done
BattleTowerBattleRoom_MapEvents:
db 0, 0 ; filler
def_warp_events
warp_event 3, 7, BATTLE_TOWER_HALLWAY, 4
warp_event 4, 7, BATTLE_TOWER_HALLWAY, 4
def_coord_events
def_bg_events
def_object_events
object_event 4, 0, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER
object_event 1, 6, SPRITE_RECEPTIONIST, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, -1
|