This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pokemontower6.asm
212 lines (185 loc) · 4.43 KB
/
pokemontower6.asm
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
PokemonTower6Script:
call EnableAutoTextBoxDrawing
ld hl, PokemonTower6TrainerHeader0
ld de, PokemonTower6ScriptPointers
ld a, [wPokemonTower6CurScript]
call ExecuteCurMapScriptInTable
ld [wPokemonTower6CurScript], a
ret
PokemonTower6Script_60b02:
xor a
ld [wJoyIgnore], a
ld [wPokemonTower6CurScript], a
ld [wCurMapScript], a
ret
PokemonTower6ScriptPointers:
dw PokemonTower6Script0
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
dw PokemonTower6Script3
dw PokemonTower6Script4
PokemonTower6Script0:
CheckEvent EVENT_BEAT_GHOST_MAROWAK
jp nz, CheckFightingMapTrainers
ld hl, CoordsData_60b45
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
xor a
ld [hJoyHeld], a
ld a, $6
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, MAROWAK
ld [wCurOpponent], a
ld a, 30
ld [wCurEnemyLVL], a
ld a, $4
ld [wPokemonTower6CurScript], a
ld [wCurMapScript], a
ret
CoordsData_60b45:
db $10,$0A,$FF
PokemonTower6Script4:
ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower6Script_60b02
ld a, $ff
ld [wJoyIgnore], a
ld a, [wd72d]
bit 6, a
ret nz
call UpdateSprites
ld a, $f0
ld [wJoyIgnore], a
ld a, [wBattleResult]
and a
jr nz, .asm_60b82
SetEvent EVENT_BEAT_GHOST_MAROWAK
ld a, $7
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
ld a, $0
ld [wPokemonTower6CurScript], a
ld [wCurMapScript], a
ret
.asm_60b82
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, $10
ld [wSimulatedJoypadStatesEnd], a
xor a
ld [wSpriteStateData2 + $06], a
ld [wOverrideSimulatedJoypadStatesMask], a
ld hl, wd730
set 7, [hl]
ld a, $3
ld [wPokemonTower6CurScript], a
ld [wCurMapScript], a
ret
PokemonTower6Script3:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
xor a
ld [wPokemonTower6CurScript], a
ld [wCurMapScript], a
ret
PokemonTower6TextPointers:
dw PokemonTower6Text1
dw PokemonTower6Text2
dw PokemonTower6Text3
dw PickUpItemText
dw PickUpItemText
dw PokemonTower6Text6
dw PokemonTower6Text7
PokemonTower6TrainerHeader0:
dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
db ($3 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
dw PokemonTower6BattleText1 ; TextBeforeBattle
dw PokemonTower6AfterBattleText1 ; TextAfterBattle
dw PokemonTower6EndBattleText1 ; TextEndBattle
dw PokemonTower6EndBattleText1 ; TextEndBattle
PokemonTower6TrainerHeader1:
dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
db ($3 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
dw PokemonTower6BattleText2 ; TextBeforeBattle
dw PokemonTower6AfterBattleText2 ; TextAfterBattle
dw PokemonTower6EndBattleText2 ; TextEndBattle
dw PokemonTower6EndBattleText2 ; TextEndBattle
PokemonTower6TrainerHeader2:
dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
db ($2 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
dw PokemonTower6BattleText3 ; TextBeforeBattle
dw PokemonTower6AfterBattleText3 ; TextAfterBattle
dw PokemonTower6EndBattleText3 ; TextEndBattle
dw PokemonTower6EndBattleText3 ; TextEndBattle
db $ff
PokemonTower6Text1:
TX_ASM
ld hl, PokemonTower6TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
PokemonTower6Text2:
TX_ASM
ld hl, PokemonTower6TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
PokemonTower6Text3:
TX_ASM
ld hl, PokemonTower6TrainerHeader2
call TalkToTrainer
jp TextScriptEnd
PokemonTower6Text7:
TX_ASM
ld hl, PokemonTower2Text_60c1f
call PrintText
ld a, MAROWAK
call PlayCry
call WaitForSoundToFinish
ld c, 30
call DelayFrames
ld hl, PokemonTower2Text_60c24
call PrintText
jp TextScriptEnd
PokemonTower2Text_60c1f:
TX_FAR _PokemonTower2Text_60c1f
db "@"
PokemonTower2Text_60c24:
TX_FAR _PokemonTower2Text_60c24
db "@"
PokemonTower6BattleText1:
TX_FAR _PokemonTower6BattleText1
db "@"
PokemonTower6EndBattleText1:
TX_FAR _PokemonTower6EndBattleText1
db "@"
PokemonTower6AfterBattleText1:
TX_FAR _PokemonTower6AfterBattleText1
db "@"
PokemonTower6BattleText2:
TX_FAR _PokemonTower6BattleText2
db "@"
PokemonTower6EndBattleText2:
TX_FAR _PokemonTower6EndBattleText2
db "@"
PokemonTower6AfterBattleText2:
TX_FAR _PokemonTower6AfterBattleText2
db "@"
PokemonTower6BattleText3:
TX_FAR _PokemonTower6BattleText3
db "@"
PokemonTower6EndBattleText3:
TX_FAR _PokemonTower6EndBattleText3
db "@"
PokemonTower6AfterBattleText3:
TX_FAR _PokemonTower6AfterBattleText3
db "@"
PokemonTower6Text6:
TX_FAR _PokemonTower6Text6
db "@"