forked from Vortyne/pureRGB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFuchsiaCity.asm
368 lines (324 loc) · 9.16 KB
/
FuchsiaCity.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
DEF FUCHSIA_OMANYTE_KABUTO_FOSSIL_TILE EQU $7C
FuchsiaCity_Script:
call FuchsiaCityDefaultScript
jp EnableAutoTextBoxDrawing
; PureRGBnote: ADDED: function that will remove all cut trees in fuchsia if we deleted them with the tree deleter
FuchsiaCityDefaultScript:
ld hl, wCurrentMapScriptFlags
bit 5, [hl] ; did we load the map from a save/warp/door/battle, etc?
res 5, [hl]
jr nz, .removeAddCutTiles
bit 4, [hl] ; did we enter the map by traversal from another route
res 4, [hl]
jr nz, .removeAddCutTilesNoRedraw
ret
.removeAddCutTiles
CheckEvent EVENT_DELETED_FUCHSIA_TREES
jr z, .firstLoadCommon
ld de, FuchsiaCityCutTreeTileBlockReplacements
callfar ReplaceMultipleTileBlocks
jr .firstLoadCommon
.removeAddCutTilesNoRedraw
; this guarantees avoiding redrawing the map because when going between areas these tiles are offscreen.
CheckEvent EVENT_DELETED_FUCHSIA_TREES
jr z, .firstLoadCommon
ld de, FuchsiaCityCutTreeTileBlockReplacements
callfar ReplaceMultipleTileBlocksNoRedraw
.firstLoadCommon
ResetEvent EVENT_FOSSIL_FAN_TEXT_TOGGLE ; this is just a good place to clear this event so the guy says the first text every time you reload the area.
; fall through
; PureRGBnote: ADDED: since we don't have enough space in the sprite sheet to add kabuto's icon,
; we just replace omanyte's with it when loading fuchsia city if kabuto is supposed to be in the zoo
CheckLoadKabutoShell::
ld a, [wSpriteOptions2]
bit BIT_MENU_ICON_SPRITES, a
ret z
CheckEvent EVENT_GOT_HELIX_FOSSIL
ret z
; fall through
LoadKabutoShellSprite:
ld hl, vSprites tile FUCHSIA_OMANYTE_KABUTO_FOSSIL_TILE
ld de, PartyMonSprites2 tile 66
lb bc, BANK(PartyMonSprites2), 4
predef_jump CopyMenuSpritesVideoDataFar
FuchsiaCity_TextPointers:
def_text_pointers
dw_const FuchsiaCityYoungster1Text, TEXT_FUCHSIACITY_YOUNGSTER1
dw_const FuchsiaCityGamblerText, TEXT_FUCHSIACITY_GAMBLER
dw_const FuchsiaCityErikText, TEXT_FUCHSIACITY_ERIK
dw_const FuchsiaCityYoungster2Text, TEXT_FUCHSIACITY_YOUNGSTER2
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_CHANSEY
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_VOLTORB
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_KANGASKHAN
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_SLOWPOKE
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_LAPRAS
dw_const FuchsiaCityPokemonText, TEXT_FUCHSIACITY_FOSSIL
dw_const FuchsiaCityFossilFanText, TEXT_FUCHSIACITY_FOSSIL_FAN
dw_const FuchsiaCitySignText, TEXT_FUCHSIACITY_SIGN1
dw_const FuchsiaCitySignText, TEXT_FUCHSIACITY_SIGN2
dw_const FuchsiaCitySafariGameSignText, TEXT_FUCHSIACITY_SAFARI_GAME_SIGN
dw_const MartSignText, TEXT_FUCHSIACITY_MART_SIGN
dw_const PokeCenterSignText, TEXT_FUCHSIACITY_POKECENTER_SIGN
dw_const FuchsiaCityWardensHomeSignText, TEXT_FUCHSIACITY_WARDENS_HOME_SIGN
dw_const FuchsiaCitySafariZoneSignText, TEXT_FUCHSIACITY_SAFARI_ZONE_SIGN
dw_const FuchsiaCityGymSignText, TEXT_FUCHSIACITY_GYM_SIGN
dw_const FuchsiaCityChanseySignText, TEXT_FUCHSIACITY_CHANSEY_SIGN
dw_const FuchsiaCityVoltorbSignText, TEXT_FUCHSIACITY_VOLTORB_SIGN
dw_const FuchsiaCityKangaskhanSignText, TEXT_FUCHSIACITY_KANGASKHAN_SIGN
dw_const FuchsiaCitySlowpokeSignText, TEXT_FUCHSIACITY_SLOWPOKE_SIGN
dw_const FuchsiaCityLaprasSignText, TEXT_FUCHSIACITY_LAPRAS_SIGN
dw_const FuchsiaCityFossilSignText, TEXT_FUCHSIACITY_FOSSIL_SIGN
; PureRGBnote: CHANGED: this NPC will point out how alt palette pokemon appear in the safari zone
; but only if we have alt palette pokemon enabled in the game options.
FuchsiaCityYoungster1Text:
text_asm
ld a, [wOptions2]
bit BIT_ALT_PKMN_PALETTES, a ; do we have alt palettes enabled
jr nz, .altPalettes
ld hl, .didYouTrySafariText
jr .done
.altPalettes
ld hl, .didYouTrySafariPromptText
rst _PrintText
ld hl, .manyHaveUniqueColorsText
.done
rst _PrintText
rst TextScriptEnd
.didYouTrySafariText:
text_far _FuchsiaCityYoungster1Text
text_end
.didYouTrySafariPromptText:
text_far _FuchsiaCityYoungster1Text
text_promptbutton
text_end
.manyHaveUniqueColorsText:
text_far _FuchsiaCityYoungster1TextColor
text_end
FuchsiaCityGamblerText:
text_far _FuchsiaCityGamblerText
text_end
FuchsiaCityErikText:
text_far _FuchsiaCityErikText
text_end
FuchsiaCityYoungster2Text:
text_asm
ld hl, .Text
rst _PrintText
;;;;;;;;;; PureRGBnote: ADDED: the voltorb will now move while talking to this NPC (but only if OGPlus icons option is turned on)
ld a, [wSpriteOptions2]
bit BIT_MENU_ICON_SPRITES, a
jr z, .done
ld de, vChars0 + VOLTORB_POKEBALL_TILE1
callfar LoadVoltorbSprite
ld c, 10
rst _DelayFrames
ld hl, vChars0 + VOLTORB_POKEBALL_TILE1
ld de, PokeBallSprite
lb bc, BANK(PokeBallSprite), 4
call CopyVideoData
.done
;;;;;;;;;;
rst TextScriptEnd
.Text:
text_far _FuchsiaCityYoungster2Text
text_end
FuchsiaCityPokemonText:
text_far _FuchsiaCityPokemonText
text_end
FuchsiaCitySignText:
text_far _FuchsiaCitySignText
text_end
FuchsiaCitySafariGameSignText:
text_far _FuchsiaCitySafariGameSignText
text_end
FuchsiaCityWardensHomeSignText:
text_far _FuchsiaCityWardensHomeSignText
text_end
FuchsiaCitySafariZoneSignText:
text_far _FuchsiaCitySafariZoneSignText
text_end
FuchsiaCityGymSignText:
text_far _FuchsiaCityGymSignText
text_end
FuchsiaCityChanseySignText:
text_asm
ld hl, .Text
rst _PrintText
ld a, CHANSEY
call DisplayPokedex
rst TextScriptEnd
.Text:
text_far _FuchsiaCityChanseySignText
text_end
FuchsiaCityVoltorbSignText:
text_asm
ld hl, .Text
rst _PrintText
ld a, VOLTORB
call DisplayPokedex
rst TextScriptEnd
.Text:
text_far _FuchsiaCityVoltorbSignText
text_end
FuchsiaCityKangaskhanSignText:
text_asm
ld hl, .Text
rst _PrintText
ld a, KANGASKHAN
call DisplayPokedex
rst TextScriptEnd
.Text:
text_far _FuchsiaCityKangaskhanSignText
text_end
FuchsiaCitySlowpokeSignText:
text_asm
ld hl, .Text
rst _PrintText
ld a, SLOWPOKE
call DisplayPokedex
rst TextScriptEnd
.Text:
text_far _FuchsiaCitySlowpokeSignText
text_end
FuchsiaCityLaprasSignText:
text_asm
ld hl, .Text
rst _PrintText
ld a, LAPRAS
call DisplayPokedex
rst TextScriptEnd
.Text:
text_far _FuchsiaCityLaprasSignText
text_end
FuchsiaCityFossilSignText:
text_asm
CheckEvent EVENT_GOT_DOME_FOSSIL
jr nz, .got_dome_fossil
CheckEventReuseA EVENT_GOT_HELIX_FOSSIL
jr nz, .got_helix_fossil
ld hl, .UndeterminedText
rst _PrintText
jr .done
.got_dome_fossil
ld hl, .OmanyteText
rst _PrintText
ld a, OMANYTE
jr .display
.got_helix_fossil
ld hl, .KabutoText
rst _PrintText
ld a, KABUTO
.display
call DisplayPokedex
.done
rst TextScriptEnd
.OmanyteText:
text_far _FuchsiaCityFossilSignOmanyteText
text_end
.KabutoText:
text_far _FuchsiaCityFossilSignKabutoText
text_end
.UndeterminedText:
text_far _FuchsiaCityFossilSignUndeterminedText
text_end
FuchsiaCityFossilFanText:
text_asm
CheckEvent EVENT_FOSSIL_FAN_TEXT_TOGGLE
jr nz, .moveFossil
ld a, [wSpriteOptions2]
bit BIT_MENU_ICON_SPRITES, a
jr z, .noEvent
CheckEitherEventSet EVENT_GOT_HELIX_FOSSIL, EVENT_GOT_DOME_FOSSIL
jr z, .noEvent
ld hl, FuchsiaCityFossilFanText1Prompt
rst _PrintText
ld hl, FuchsiaCityFossilFanText2
rst _PrintText
SetEvent EVENT_FOSSIL_FAN_TEXT_TOGGLE
jr .done
.moveFossil
ResetEvent EVENT_FOSSIL_FAN_TEXT_TOGGLE
ld a, [wSpriteOptions2]
bit BIT_MENU_ICON_SPRITES, a
jr z, .noEvent
call ShowFossilPokemon
ld a, 11
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_UP
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirection
ld hl, FuchsiaCityFossilFanText3
rst _PrintText
ld c, 20
rst _DelayFrames
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
call UpdateSprites
call MoveFossilPokemon
jr .done
.noEvent
ld hl, FuchsiaCityFossilFanText1
rst _PrintText
.done
rst TextScriptEnd
FuchsiaCityFossilFanText1:
text_far _FuchsiaCityFossilFanText
text_end
FuchsiaCityFossilFanText1Prompt:
text_far _FuchsiaCityFossilFanText
text_promptbutton
text_end
FuchsiaCityFossilFanText2:
text_far _FuchsiaCityFossilFanText2
text_end
FuchsiaCityFossilFanText3:
text_far _FuchsiaCityFossilFanText3
text_end
GetFossilSpriteData:
CheckEvent EVENT_GOT_HELIX_FOSSIL
jr nz, .domeFossil
ld de, PartyMonSprites1 tile 16
lb bc, BANK(PartyMonSprites1), 4
jr .showSprite
.domeFossil
ld de, PartyMonSprites2 tile 64
lb bc, BANK(PartyMonSprites2), 4
.showSprite
ld hl, vSprites tile FUCHSIA_OMANYTE_KABUTO_FOSSIL_TILE
ret
ShowFossilPokemon:
call GetFossilSpriteData
predef_jump CopyMenuSpritesVideoDataFar
GetOmanyteSpriteDataFrame2:
ld de, PartyMonSprites1 tile 18
lb bc, BANK(PartyMonSprites1), 4
ld hl, vSprites tile FUCHSIA_OMANYTE_KABUTO_FOSSIL_TILE
ret
MoveFossilPokemon:
CheckEvent EVENT_GOT_HELIX_FOSSIL
jr nz, .hideKabuto
; omanyte will wiggle a bit before hiding
ld a, 4
push af
; make it move a bit by alternating frames
.loop
call GetFossilSpriteData
predef CopyMenuSpritesVideoDataFar
call Delay3
call GetOmanyteSpriteDataFrame2
predef CopyMenuSpritesVideoDataFar
call Delay3
pop af
dec a
push af
jr nz, .loop
pop af
.hideOmanyte
ld de, FossilSprite
lb bc, BANK(FossilSprite), 4
ld hl, vSprites tile FUCHSIA_OMANYTE_KABUTO_FOSSIL_TILE
jp CopyVideoData
.hideKabuto:
ld c, 20
rst _DelayFrames
jp LoadKabutoShellSprite