summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-29 16:24:41 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-29 16:24:41 -0400
commit9abb62033819774d7b256ee0222f7c6ece987bfe (patch)
treeade69ea7b4186c8438592bca84c1968c2d41fcbd
parent92f3f9119ee7e0a1c70fcc483888baf048d7e6d9 (diff)
Pewter Pokecenter
-rwxr-xr-xdata/mapObjects/pewterpokecenter.asm6
-rw-r--r--data/map_header_banks.asm2
-rw-r--r--data/map_header_pointers.asm2
-rw-r--r--engine/bank3c.asm5
-rw-r--r--engine/bank3f.asm6
-rwxr-xr-xengine/items/items.asm2
-rw-r--r--engine/menu/bills_pc.asm2
-rwxr-xr-xengine/menu/party_menu.asm2
-rwxr-xr-xengine/overworld/cable_club_npc.asm2
-rwxr-xr-xengine/overworld/pokecenter.asm8
-rwxr-xr-xengine/pikachu_pic_animation.asm10
-rw-r--r--home.asm2
-rw-r--r--home/overworld.asm2
-rwxr-xr-xhome/pikachu.asm6
-rwxr-xr-xmain.asm12
-rwxr-xr-xscripts/billshouse2.asm4
-rwxr-xr-xscripts/pewterpokecenter.asm80
-rwxr-xr-xwram.asm4
18 files changed, 63 insertions, 94 deletions
diff --git a/data/mapObjects/pewterpokecenter.asm b/data/mapObjects/pewterpokecenter.asm
index 86757244..d3f87326 100755
--- a/data/mapObjects/pewterpokecenter.asm
+++ b/data/mapObjects/pewterpokecenter.asm
@@ -7,11 +7,13 @@ PewterPokecenterObject: ; 0x5c60d (size=44)
db $0 ; signs
- db $4 ; objects
+ db $6 ; objects
object SPRITE_NURSE, $3, $1, STAY, DOWN, $1 ; person
object SPRITE_GENTLEMAN, $b, $7, STAY, LEFT, $2 ; person
- object SPRITE_CLEFAIRY, $1, $3, STAY, DOWN, $3 ; person
+ object SPRITE_JIGGLYPUFF, $1, $3, STAY, DOWN, $3 ; person
object SPRITE_CABLE_CLUB_WOMAN, $b, $2, STAY, DOWN, $4 ; person
+ object SPRITE_LASS, $4, $3, STAY, UP, $5 ; person
+ object SPRITE_CHANSEY, $4, $1, STAY, DOWN, $6 ; person
; warp-to
EVENT_DISP PEWTER_POKECENTER_WIDTH, $7, $3
diff --git a/data/map_header_banks.asm b/data/map_header_banks.asm
index 0dd10719..c840cd82 100644
--- a/data/map_header_banks.asm
+++ b/data/map_header_banks.asm
@@ -58,7 +58,7 @@ MapHeaderBanks:: ; fc3e4 (3f:43e4)
db BANK(PewterHouse1_h)
db BANK(PewterMart_h)
db BANK(PewterHouse2_h)
- db $17 ; db BANK(PewterPokecenter_h)
+ db BANK(PewterPokecenter_h)
db $12 ; db BANK(MtMoon1_h)
db $14 ; db BANK(MtMoon2_h)
db $12 ; db BANK(MtMoon3_h)
diff --git a/data/map_header_pointers.asm b/data/map_header_pointers.asm
index a7a0763d..cc700617 100644
--- a/data/map_header_pointers.asm
+++ b/data/map_header_pointers.asm
@@ -58,7 +58,7 @@ MapHeaderPointers:: ; fc1f2 (3f:41f2)
dw PewterHouse1_h
dw PewterMart_h
dw PewterHouse2_h
- dw $446e ; dw PewterPokecenter_h
+ dw PewterPokecenter_h
dw $5953 ; dw MtMoon1_h
dw $5a78 ; dw MtMoon2_h ;id=60
dw $5c7e ; dw MtMoon3_h
diff --git a/engine/bank3c.asm b/engine/bank3c.asm
index 097dfd3e..9274b8b7 100644
--- a/engine/bank3c.asm
+++ b/engine/bank3c.asm
@@ -352,7 +352,10 @@ INCLUDE "scripts/redshouse1f2.asm"
INCLUDE "scripts/oakslab2.asm"
INCLUDE "scripts/school2.asm"
INCLUDE "scripts/museum1f2.asm"
- dr $f1d98, $f220e
+INCLUDE "scripts/pewterpokecenter2.asm"
+
+Func_f1e22:
+ dr $f1e22, $f220e
INCLUDE "data/mapHeaders/beach_house.asm"
INCLUDE "scripts/beach_house.asm"
diff --git a/engine/bank3f.asm b/engine/bank3f.asm
index c8041a3a..c31fc986 100644
--- a/engine/bank3f.asm
+++ b/engine/bank3f.asm
@@ -27,7 +27,7 @@ Func_fc4fa:: ; fc4fa (3f:44fa)
bit 4, [hl]
res 4, [hl]
jr nz, .asm_fc515
- call Func_1542
+ call ResetPikachuAsleep
call Func_fc523
ld a, $ff
ld [wSpriteStateData1 + $f2], a
@@ -344,7 +344,7 @@ Func_fc6d5:: ; fc6d5 (3f:46d5)
ld a, [wFontLoaded]
bit 0, a
jp nz, asm_fc76a
- call Func_154a
+ call CheckPikachuAsleep
jp nz, asm_fc76a
ld a, [hl]
and $7f
@@ -408,7 +408,7 @@ asm_fc745: ; fc745 (3f:4745)
ld hl, wSpriteStateData2 - wSpriteStateData1
add hl, bc
ld [hl], a
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .asm_fc75f
ld a, [wSpriteStateData1 + $9]
xor $4
diff --git a/engine/items/items.asm b/engine/items/items.asm
index 5d76c37e..eca9eaef 100755
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -1765,7 +1765,7 @@ ItemUsePokeflute: ; dfbd (3:5fbd)
.notRoute16
cp a,PEWTER_POKECENTER
jr nz,.noSnorlaxOrPikachuToWakeUp
- call Func_154a
+ call CheckPikachuAsleep
jr z,.noSnorlaxOrPikachuToWakeUp
callab Func_fcb01
jr nc,.noSnorlaxOrPikachuToWakeUp
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index ce9ca5a8..97a65517 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -227,7 +227,7 @@ BillsPCDeposit: ; 2156d (8:556d)
jp c, BillsPCMenu
callab IsThisPartymonStarterPikachu_Party
jr nc, .asm_215ad
- call Func_154a
+ call CheckPikachuAsleep
jr z, .asm_215ad
ld hl, SleepingPikachuText2
call PrintText
diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm
index 3ec0029e..8683d3cb 100755
--- a/engine/menu/party_menu.asm
+++ b/engine/menu/party_menu.asm
@@ -53,7 +53,7 @@ RedrawPartyMenu_: ; 11886 (4:5886)
ld [wWhichPokemon],a
callab IsThisPartymonStarterPikachu_Party
jr nc, .regularMon
- call Func_154a
+ call CheckPikachuAsleep
jr z, .regularMon
ld a, $ff
ld [hPartyMonIndex], a
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm
index 8f279759..4170a936 100755
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/cable_club_npc.asm
@@ -1,7 +1,7 @@
CableClubNPC: ; 7035 (1:7035)
ld hl, CableClubNPCWelcomeText
call PrintText
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .asm_7048
CheckEvent EVENT_GOT_POKEDEX
jp nz, .receivedPokedex
diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm
index 779d852c..3024ff7b 100755
--- a/engine/overworld/pokecenter.asm
+++ b/engine/overworld/pokecenter.asm
@@ -2,7 +2,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
ld a, [wCurMap]
cp PEWTER_POKECENTER
jr nz, .regularCenter
- call Func_154a
+ call CheckPikachuAsleep
jr z, .regularCenter
ld hl, LooksContentText ; if pikachu is sleeping, don't heal
call PrintText
@@ -27,7 +27,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call SetLastBlackoutMap
callab IsStarterPikachuInOurParty
jr nc, .notHealingPlayerPikachu
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .notHealingPlayerPikachu
call LoadCurrentMapView
call Delay3
@@ -38,7 +38,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call PrintText
ld c, 64
call DelayFrames
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .playerPikachuNotOnScreen
call Func_152d
callab IsStarterPikachuInOurParty
@@ -58,7 +58,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
ld [wLastMusicSoundID], a
ld [wNewSoundID], a
call PlaySound
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .doNotReturnPikachu
callab IsStarterPikachuInOurParty
call c, Func_6eaa
diff --git a/engine/pikachu_pic_animation.asm b/engine/pikachu_pic_animation.asm
index d95eb538..c16e3e5f 100755
--- a/engine/pikachu_pic_animation.asm
+++ b/engine/pikachu_pic_animation.asm
@@ -247,7 +247,7 @@ Func_fd05e: ; fd05e (3f:505e)
bit 7, [hl]
ld a, $1d
jr z, .asm_fd0c9
- call Func_154a
+ call CheckPikachuAsleep
ld a, $1e
jr nz, .asm_fd0c9
jr .asm_fd096
@@ -255,7 +255,7 @@ Func_fd05e: ; fd05e (3f:505e)
ld a, [wCurMap]
cp PEWTER_POKECENTER
jr nz, .notPewterPokecenter
- call Func_154a
+ call CheckPikachuAsleep
ld a, $1a
jr nz, .asm_fd0c9
jr .asm_fd096
@@ -1636,7 +1636,7 @@ PikachuPewterPokecenterCheck: ; fd8d4 (3f:58d4)
ld a, [wCurMap]
cp PEWTER_POKECENTER
ret nz
- call Func_1542
+ call ResetPikachuAsleep
call Func_fcff2
ret
@@ -1644,7 +1644,7 @@ PikachuFanClubCheck: ; fd8e1 (3f:58e1)
ld a, [wCurMap]
cp POKEMON_FAN_CLUB
ret nz
- call Func_1542
+ call ResetPikachuAsleep
call Func_fcff2
ret
@@ -1652,7 +1652,7 @@ PikachuBillsHouseCheck: ; fd8ee (3f:58ee)
ld a, [wCurMap]
cp BILLS_HOUSE
ret nz
- call Func_1542
+ call ResetPikachuAsleep
ret
Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3: ; fd8f8 (3f:58f8)
diff --git a/home.asm b/home.asm
index 5f924a40..6fb3e08b 100644
--- a/home.asm
+++ b/home.asm
@@ -477,7 +477,7 @@ HandlePartyMenuInput:: ; 1226 (0:1226)
ld [wWhichPokemon], a
callab IsThisPartymonStarterPikachu_Party ; 3f:4e18
jr nc, .asm_1258
- call Func_154a
+ call CheckPikachuAsleep
jr nz, .asm_128f
.asm_1258
pop af
diff --git a/home/overworld.asm b/home/overworld.asm
index 3a9708d9..bc7ae029 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -1222,7 +1222,7 @@ CollisionCheckOnLand:: ; 0a1c (0:0a1c)
; if no sprite collision
cp $f
jr nz,.collision
- call Func_154a
+ call CheckPikachuAsleep
jr nz,.collision
ld a,[hJoyHeld]
and $2
diff --git a/home/pikachu.asm b/home/pikachu.asm
index 5239873c..9e0ab541 100755
--- a/home/pikachu.asm
+++ b/home/pikachu.asm
@@ -30,21 +30,21 @@ Func_152d:: ; 152d (0:152d)
pop hl
ret
-Func_153a:: ; 153a (0:153a)
+SetPikachuAsleep:: ; 153a (0:153a)
push hl
ld hl, wPikachuOverworldStateFlags
set 1, [hl]
pop hl
ret
-Func_1542:: ; 1542 (0:1542)
+ResetPikachuAsleep:: ; 1542 (0:1542)
push hl
ld hl, wPikachuOverworldStateFlags
res 1, [hl]
pop hl
ret
-Func_154a:: ; 154a (0:154a)
+CheckPikachuAsleep:: ; 154a (0:154a)
push hl
ld hl, wPikachuOverworldStateFlags
bit 1, [hl]
diff --git a/main.asm b/main.asm
index 3ba53669..33332dff 100755
--- a/main.asm
+++ b/main.asm
@@ -746,7 +746,6 @@ INCLUDE "data/mapObjects/lavendertown.asm"
LavenderTownBlocks:
INCBIN "maps/lavendertown.blk"
ViridianPokecenterBlocks:
-PewterPokecenterBlocks:
CeruleanPokecenterBlocks:
VermilionPokecenterBlocks:
SaffronPokecenterBlocks:
@@ -1059,7 +1058,9 @@ Museum1FBlocks:
INCBIN "maps/museum1f.blk"
Museum2FBlocks:
INCBIN "maps/museum2f.blk"
- dr $5c064,$5c090
+PewterPokecenterBlocks:
+INCBIN "maps/pewterpokecenter.blk"
+ dr $5c080,$5c090
ViridianForestEntranceBlocks:
ViridianForestExitBlocks:
Route2GateBlocks:
@@ -1083,7 +1084,12 @@ INCLUDE "scripts/pewtergym.asm"
INCLUDE "data/mapObjects/pewtergym.asm"
PewterGymBlocks:
INCBIN "maps/pewtergym.blk"
- dr $5c46e,$5d485
+
+INCLUDE "data/mapHeaders/pewterpokecenter.asm"
+INCLUDE "scripts/pewterpokecenter.asm"
+INCLUDE "data/mapObjects/pewterpokecenter.asm"
+
+ dr $5c4f5,$5d485
INCLUDE "data/mapHeaders/viridianforestexit.asm"
INCLUDE "scripts/viridianforestexit.asm"
diff --git a/scripts/billshouse2.asm b/scripts/billshouse2.asm
index 48205029..6f62a79f 100755
--- a/scripts/billshouse2.asm
+++ b/scripts/billshouse2.asm
@@ -87,7 +87,7 @@ Func_f24ae: ; f24ae
ld a, [wCurMap]
cp BILLS_HOUSE
jr nz, .asm_f24d2
- call Func_154a
+ call CheckPikachuAsleep
jr z, .asm_f24d2
ld a, [W_BILLSHOUSECURSCRIPT]
cp $5
@@ -120,7 +120,7 @@ Func_f24d5:
ld a, $1
ld [wWhichEmotionBubble], a
predef EmotionBubble
- call Func_153a
+ call SetPikachuAsleep
callab InitializePikachuTextID
ret
diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm
index 46d4d509..90f5e2b9 100755
--- a/scripts/pewterpokecenter.asm
+++ b/scripts/pewterpokecenter.asm
@@ -1,12 +1,17 @@
PewterPokecenterScript: ; 5c587 (17:4587)
+ ld hl, wPreventBlackout
+ set 7, [hl]
call Serial_TryEstablishingExternallyClockedConnection
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
PewterPokecenterTextPointers: ; 5c58d (17:458d)
dw PewterPokecenterText1
dw PewterPokecenterText2
dw PewterPokecenterText3
dw PewterPokecenterText4
+ dw PewterPokecenterText5
+ dw PewterPokecenterText6
PewterPokecenterText1: ; 5c595 (17:4595)
db $ff
@@ -17,69 +22,18 @@ PewterPokecenterText2: ; 5c596 (17:4596)
PewterPokecenterText3: ; 5c59b (17:459b)
TX_ASM
- ld a, $1
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, PewterPokecenterText5
- call PrintText
- ld a, $ff
- call PlaySound
- ld c, 32
- call DelayFrames
- ld hl, JigglypuffFacingDirections
- ld de, wJigglypuffFacingDirections
- ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
- call CopyData
-
- ld a, [wSpriteStateData1 + 3 * $10 + $2]
- 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 [wSpriteStateData1 + 3 * $10 + $2], 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
+ callba Func_f1da4
jp TextScriptEnd
-PewterPokecenterText5: ; 5c603 (17:4603)
- TX_FAR _PewterPokecenterText5
- db "@"
-
-JigglypuffFacingDirections: ; 5c608 (17:4608)
- db $30 | SPRITE_FACING_DOWN
- db $30 | SPRITE_FACING_LEFT
- db $30 | SPRITE_FACING_UP
- db $30 | SPRITE_FACING_RIGHT
-JigglypuffFacingDirectionsEnd:
-
PewterPokecenterText4: ; 5c60c (17:460c)
db $f6
+
+PewterPokecenterText5: ; 5c603 (17:4603)
+ TX_ASM
+ callba Func_f1d98
+ jp TextScriptEnd
+
+PewterPokecenterText6:
+ TX_ASM
+ callab Func_f0f12
+ jp TextScriptEnd
diff --git a/wram.asm b/wram.asm
index 64a394ed..821c4957 100755
--- a/wram.asm
+++ b/wram.asm
@@ -960,6 +960,8 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY:: ; cd3e
wHiddenObjectFunctionRomBank:: ; cd3e
wTrainerEngageDistance:: ; cd3e
+
+wJigglypuffFacingDirections2:: ; cd3e
ds 1
wHUDGraphicsTiles:: ; cd3f
@@ -1040,6 +1042,8 @@ wHoFTeamNo:: ; cd42
wSlotMachineWheel1MiddleTile:: ; cd42
wFieldMovesLeftmostXCoord:: ; cd42
+
+wcd42:: ; cd42
ds 1
wLastFieldMoveID:: ; cd43