pokered/scripts/PewterPokecenter.asm

87 lines
1.8 KiB
NASM
Raw Normal View History

PewterPokecenter_Script:
2015-02-07 10:43:08 +00:00
call Serial_TryEstablishingExternallyClockedConnection
2014-05-18 18:19:10 +00:00
jp EnableAutoTextBoxDrawing
PewterPokecenter_TextPointers:
dw PewterHealNurseText
2014-05-18 18:19:10 +00:00
dw PewterPokecenterText2
dw PewterJigglypuffText
dw PewterTradeNurseText
2014-05-18 18:19:10 +00:00
PewterHealNurseText:
script_pokecenter_nurse
2014-05-18 18:19:10 +00:00
PewterPokecenterText2:
text_far _PewterPokecenterText2
text_end
2014-05-18 18:19:10 +00:00
PewterJigglypuffText:
text_asm
ld a, TRUE
2014-09-13 07:50:56 +00:00
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, .JigglypuffText
2014-05-18 18:19:10 +00:00
call PrintText
ld a, SFX_STOP_ALL_MUSIC
call PlaySound
ld c, 32
2014-05-18 18:19:10 +00:00
call DelayFrames
2015-06-12 16:00:48 +00:00
ld hl, JigglypuffFacingDirections
2015-07-19 03:49:52 +00:00
ld de, wJigglypuffFacingDirections
2015-08-10 04:56:20 +00:00
ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
2014-05-18 18:19:10 +00:00
call CopyData
2015-07-19 03:49:52 +00:00
ld a, [wSprite03StateData1ImageIndex]
2015-07-19 03:49:52 +00:00
ld hl, wJigglypuffFacingDirections
.findMatchingFacingDirectionLoop
2014-05-18 18:19:10 +00:00
cp [hl]
inc hl
2015-07-19 03:49:52 +00:00
jr nz, .findMatchingFacingDirectionLoop
2014-05-18 18:19:10 +00:00
dec hl
2014-05-18 18:19:10 +00:00
push hl
ld c, BANK(Music_JigglypuffSong)
ld a, MUSIC_JIGGLYPUFF_SONG
call PlayMusic
pop hl
.spinMovementLoop
2014-05-18 18:19:10 +00:00
ld a, [hl]
ld [wSprite03StateData1ImageIndex], a
2015-07-19 03:49:52 +00:00
; rotate the array
2014-05-18 18:19:10 +00:00
push hl
2015-07-19 03:49:52 +00:00
ld hl, wJigglypuffFacingDirections
ld de, wJigglypuffFacingDirections - 1
2015-08-10 04:56:20 +00:00
ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
2014-05-18 18:19:10 +00:00
call CopyData
2015-07-19 03:49:52 +00:00
ld a, [wJigglypuffFacingDirections - 1]
ld [wJigglypuffFacingDirections + 3], a
2014-05-18 18:19:10 +00:00
pop hl
ld c, 24
2014-05-18 18:19:10 +00:00
call DelayFrames
2015-08-09 05:32:44 +00:00
ld a, [wChannelSoundIDs]
2014-05-18 18:19:10 +00:00
ld b, a
ld a, [wChannelSoundIDs + CHAN2]
2014-05-18 18:19:10 +00:00
or b
jr nz, .spinMovementLoop
2015-07-19 03:49:52 +00:00
ld c, 48
2014-05-18 18:19:10 +00:00
call DelayFrames
call PlayDefaultMusic
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.JigglypuffText:
text_far _PewterJigglypuffText
text_end
2014-05-18 18:19:10 +00:00
JigglypuffFacingDirections:
2015-06-12 16:00:48 +00:00
db $30 | SPRITE_FACING_DOWN
db $30 | SPRITE_FACING_LEFT
db $30 | SPRITE_FACING_UP
db $30 | SPRITE_FACING_RIGHT
2015-08-10 04:56:20 +00:00
JigglypuffFacingDirectionsEnd:
2014-05-18 18:19:10 +00:00
PewterTradeNurseText:
script_cable_club_receptionist