summaryrefslogtreecommitdiff
path: root/scripts/PewterPokecenter.asm
diff options
context:
space:
mode:
authorDaniel Harding <33dannye@gmail.com>2019-01-13 22:38:16 -0600
committerGitHub <noreply@github.com>2019-01-13 22:38:16 -0600
commit725b86ebbec23bd1f53fd60bf0201c904fee951d (patch)
treea37f4d33c5b77635c7ff72b91a73fcd90c4af915 /scripts/PewterPokecenter.asm
parent108245cb21abb3abac051b7db84ed6c694192a61 (diff)
parentc7796024590fec48ac79756793c1a6e3b54daf8f (diff)
Merge pull request #196 from Rangi42/polishedmaps
Rename map files, labels, and constants to be consistent and work with Polished Map
Diffstat (limited to 'scripts/PewterPokecenter.asm')
-rwxr-xr-xscripts/PewterPokecenter.asm84
1 files changed, 84 insertions, 0 deletions
diff --git a/scripts/PewterPokecenter.asm b/scripts/PewterPokecenter.asm
new file mode 100755
index 00000000..68115050
--- /dev/null
+++ b/scripts/PewterPokecenter.asm
@@ -0,0 +1,84 @@
+PewterPokecenter_Script:
+ call Serial_TryEstablishingExternallyClockedConnection
+ jp EnableAutoTextBoxDrawing
+
+PewterPokecenter_TextPointers:
+ dw PewterHealNurseText
+ dw PewterPokecenterText2
+ dw PewterJigglypuffText
+ dw PewterTradeNurseText
+
+PewterHealNurseText:
+ TX_POKECENTER_NURSE
+
+PewterPokecenterText2:
+ TX_FAR _PewterPokecenterText2
+ db "@"
+
+PewterJigglypuffText:
+ TX_ASM
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .Text
+ call PrintText
+ StopAllMusic
+ ld c, 32
+ call DelayFrames
+ ld hl, JigglypuffFacingDirections
+ ld de, wJigglypuffFacingDirections
+ ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
+ call CopyData
+
+ ld a, [wSprite03StateData1ImageIndex]
+ ld hl, wJigglypuffFacingDirections
+.findMatchingFacingDirectionLoop
+ cp [hl]
+ inc hl
+ jr nz, .findMatchingFacingDirectionLoop
+ dec hl
+ push hl
+ ld c, BANK(Music_JigglypuffSong)
+ ld a, MUSIC_JIGGLYPUFF_SONG
+ call PlayMusic
+ pop hl
+.loop
+ ld a, [hl]
+ ld [wSprite03StateData1ImageIndex], a
+
+; rotate the array
+ push hl
+ ld hl, wJigglypuffFacingDirections
+ ld de, wJigglypuffFacingDirections - 1
+ ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
+ call CopyData
+ ld a, [wJigglypuffFacingDirections - 1]
+ ld [wJigglypuffFacingDirections + 3], a
+ pop hl
+
+ ld c, 24
+ call DelayFrames
+
+ ld a, [wChannelSoundIDs]
+ ld b, a
+ ld a, [wChannelSoundIDs + Ch1]
+ or b
+ jr nz, .loop
+
+ ld c, 48
+ call DelayFrames
+ call PlayDefaultMusic
+ jp TextScriptEnd
+
+.Text
+ TX_FAR _PewterJigglypuffText
+ db "@"
+
+JigglypuffFacingDirections:
+ db $30 | SPRITE_FACING_DOWN
+ db $30 | SPRITE_FACING_LEFT
+ db $30 | SPRITE_FACING_UP
+ db $30 | SPRITE_FACING_RIGHT
+JigglypuffFacingDirectionsEnd:
+
+PewterTradeNurseText:
+ TX_CABLE_CLUB_RECEPTIONIST