pokered/scripts/PewterPokecenter.asm

88 lines
2 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:
def_text_pointers
dw_const PewterPokecenterNurseText, TEXT_PEWTERPOKECENTER_NURSE
dw_const PewterPokecenterGentlemanText, TEXT_PEWTERPOKECENTER_GENTLEMAN
dw_const PewterPokecenterJigglypuffText, TEXT_PEWTERPOKECENTER_JIGGLYPUFF
dw_const PewterPokecenterLinkReceptionistText, TEXT_PEWTERPOKECENTER_LINK_RECEPTIONIST
2014-05-18 18:19:10 +00:00
PewterPokecenterNurseText:
script_pokecenter_nurse
2014-05-18 18:19:10 +00:00
PewterPokecenterGentlemanText:
text_far _PewterPokecenterGentlemanText
text_end
2014-05-18 18:19:10 +00:00
PewterPokecenterJigglypuffText:
text_asm
ld a, TRUE
2014-09-13 07:50:56 +00:00
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, .Text
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
ld hl, .FacingDirections
2015-07-19 03:49:52 +00:00
ld de, wJigglypuffFacingDirections
ld bc, .FacingDirectionsEnd - .FacingDirections
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
ld bc, .FacingDirectionsEnd - .FacingDirections
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
.Text:
text_far _PewterPokecenterJigglypuffText
text_end
2014-05-18 18:19:10 +00:00
.FacingDirections:
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
.FacingDirectionsEnd:
2014-05-18 18:19:10 +00:00
PewterPokecenterLinkReceptionistText:
script_cable_club_receptionist