pokered/scripts/ceruleancity.asm

454 lines
7.8 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
CeruleanCityScript:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, CeruleanCityScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wCeruleanCityCurScript]
2014-05-18 18:19:10 +00:00
jp CallFunctionInTable
2016-06-12 00:24:04 +00:00
CeruleanCityScript_1948c:
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
ld a, HS_CERULEAN_RIVAL
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef_jump HideObject
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanCityScriptPointers:
2014-05-18 18:19:10 +00:00
dw CeruleanCityScript0
dw CeruleanCityScript1
dw CeruleanCityScript2
dw CeruleanCityScript3
dw CeruleanCityScript4
2016-06-12 00:24:04 +00:00
CeruleanCityScript4:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, CeruleanCityScript_1948c
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
2014-05-18 18:19:10 +00:00
ld a, $2
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanCityScript0:
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
jr nz, .asm_194f7
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityCoords1
call ArePlayerCoordsInArray
jr nc, .asm_194f7
2015-07-19 03:49:52 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
cp $1
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN
jr nz, .asm_194e6
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_DOWN
ld b, SPRITE_FACING_UP
2014-05-18 18:19:10 +00:00
.asm_194e6
2015-07-20 00:52:26 +00:00
ld [wPlayerMovingDirection], a
2014-05-18 18:19:10 +00:00
ld a, b
2015-07-20 00:52:26 +00:00
ld [wSpriteStateData1 + 2 * $10 + $9], a
2014-05-18 18:19:10 +00:00
call Delay3
ld a, $2
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
jp DisplayTextID
.asm_194f7
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_CERULEAN_RIVAL
2014-05-18 18:19:10 +00:00
ret nz
ld hl, CeruleanCityCoords2
call ArePlayerCoordsInArray
ret nc
2014-09-13 07:50:56 +00:00
ld a, [wWalkBikeSurfState]
2014-05-18 18:19:10 +00:00
and a
jr z, .asm_19512
2014-05-18 18:19:10 +00:00
ld a, $ff
2015-08-09 05:32:44 +00:00
ld [wNewSoundID], a
2014-05-18 18:19:10 +00:00
call PlaySound
.asm_19512
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
xor a
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
2014-05-18 18:19:10 +00:00
cp $14
jr z, .asm_19535
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
ld a, $5
2015-07-18 15:17:29 +00:00
ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData2
2014-05-18 18:19:10 +00:00
ld [hl], $19
.asm_19535
ld a, HS_CERULEAN_RIVAL
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
2014-05-18 18:19:10 +00:00
ld de, CeruleanCityMovement1
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call MoveSprite
ld a, $1
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanCityCoords1:
2014-05-18 18:19:10 +00:00
db $07,$1e
db $09,$1e
db $ff
2016-06-12 00:24:04 +00:00
CeruleanCityCoords2:
2014-05-18 18:19:10 +00:00
db $06,$14
db $06,$15
db $ff
2016-06-12 00:24:04 +00:00
CeruleanCityMovement1:
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db $FF
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanCityScript_1955d:
2014-05-18 18:19:10 +00:00
ld a,1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX],a
xor a ; SPRITE_FACING_DOWN
2015-07-18 15:17:29 +00:00
ld [hSpriteFacingDirection],a
jp SetSpriteFacingDirectionAndDelay ; face object
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanCityScript1:
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, CeruleanCityText_1966d
ld de, CeruleanCityText_19672
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
ld a, OPP_SONY1
2015-08-31 02:38:41 +00:00
ld [wCurOpponent], a
2014-05-18 18:19:10 +00:00
; select which team to use during the encounter
2015-08-31 02:38:41 +00:00
ld a, [wRivalStarter]
2014-05-21 12:48:30 +00:00
cp STARTER2
jr nz, .NotSquirtle
2014-05-18 18:19:10 +00:00
ld a, $7
jr .done
.NotSquirtle
2014-05-21 12:48:30 +00:00
cp STARTER3
jr nz, .Charmander
2014-05-18 18:19:10 +00:00
ld a, $8
jr .done
.Charmander
ld a, $9
.done
2015-08-31 02:38:41 +00:00
ld [wTrainerNo], a
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
2014-05-18 18:19:10 +00:00
call CeruleanCityScript_1955d
ld a, $2
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanCityScript2:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, CeruleanCityScript_1948c
call CeruleanCityScript_1955d
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BEAT_CERULEAN_RIVAL
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, $ff
2015-08-09 05:32:44 +00:00
ld [wNewSoundID], a
2014-05-18 18:19:10 +00:00
call PlaySound
callba Music_RivalAlternateStart
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call SetSpriteMovementBytesToFF
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
2014-05-18 18:19:10 +00:00
cp $14
jr nz, .asm_195f0
2014-05-18 18:19:10 +00:00
ld de, CeruleanCityMovement4
jr .asm_195f3
2014-05-18 18:19:10 +00:00
.asm_195f0
ld de, CeruleanCityMovement3
.asm_195f3
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call MoveSprite
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanCityMovement3:
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db $FF
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanCityMovement4:
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db $FF
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanCityScript3:
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
ld a, HS_CERULEAN_RIVAL
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
call PlayDefaultMusic
2014-05-18 18:19:10 +00:00
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanCityTextPointers:
2014-05-18 18:19:10 +00:00
dw CeruleanCityText1
dw CeruleanCityText2
dw CeruleanCityText3
dw CeruleanCityText4
dw CeruleanCityText5
dw CeruleanCityText6
dw CeruleanCityText7
dw CeruleanCityText8
dw CeruleanCityText9
dw CeruleanCityText10
dw CeruleanCityText11
dw CeruleanCityText12
dw CeruleanCityText13
dw MartSignText
dw PokeCenterSignText
dw CeruleanCityText16
dw CeruleanCityText17
2016-06-12 00:24:04 +00:00
CeruleanCityText1:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_CERULEAN_RIVAL
2014-05-18 18:19:10 +00:00
; do pre-battle text
jr z, .PreBattleText
; or talk about bill
ld hl, CeruleanCityText_19677
call PrintText
jr .end
.PreBattleText
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_19668
call PrintText
.end
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanCityText_19668:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19668
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_1966d:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_1966d
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_19672:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19672
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_19677:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19677
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText2:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
jr nz, .asm_4ca20
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_196d9
call PrintText
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, CeruleanCityText_196ee
ld de, CeruleanCityText_196ee
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
2015-07-18 15:17:29 +00:00
ld a, [hSpriteIndexOrTextID]
2014-09-13 07:50:56 +00:00
ld [wSpriteIndex], a
2014-05-18 18:19:10 +00:00
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $4
2015-08-31 02:38:41 +00:00
ld [wCeruleanCityCurScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.asm_4ca20
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_196f3
call PrintText
2015-08-05 21:20:29 +00:00
lb bc, TM_28, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr c, .Success
ld hl, TM28NoRoomText
call PrintText
jr .Done
.Success
ld a, $1
2014-09-13 07:50:56 +00:00
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
2014-05-18 18:19:10 +00:00
ld hl, ReceivedTM28Text
call PrintText
callba CeruleanHideRocket
2014-05-18 18:19:10 +00:00
.Done
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanCityText_196d9:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_196d9
db "@"
2016-06-12 00:24:04 +00:00
ReceivedTM28Text:
2014-05-18 18:19:10 +00:00
TX_FAR _ReceivedTM28Text
2016-07-18 06:17:03 +00:00
TX_SFX_ITEM_1
2014-05-18 18:19:10 +00:00
TX_FAR _ReceivedTM28Text2
2016-07-18 06:17:03 +00:00
TX_WAIT
db "@"
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
TM28NoRoomText:
2014-05-18 18:19:10 +00:00
TX_FAR _TM28NoRoomText
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_196ee:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_196ee
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_196f3:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_196f3
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText3:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText3
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText4:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText4
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText5:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText5
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText11:
CeruleanCityText6:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText6
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText7:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-03 20:13:35 +00:00
ld a, [hRandomAdd]
2016-07-18 06:17:03 +00:00
cp 180
jr c, .asm_e9fc9
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_19730
call PrintText
jr .asm_d486e
.asm_e9fc9
2016-07-18 06:17:03 +00:00
cp 100
jr c, .asm_df99b
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_19735
call PrintText
jr .asm_d486e
.asm_df99b
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_1973a
call PrintText
.asm_d486e
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanCityText_19730:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19730
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_19735:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19735
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_1973a:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_1973a
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText8:
2015-07-03 19:58:50 +00:00
TX_ASM
ld a, [hRandomAdd]
2016-07-18 06:17:03 +00:00
cp 180
jr c, .asm_e28da
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_1976f
call PrintText
jr .asm_f2f38
.asm_e28da
2016-07-18 06:17:03 +00:00
cp 120
jr c, .asm_15d08
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_19774
call PrintText
jr .asm_f2f38
.asm_15d08
2016-07-18 06:17:03 +00:00
cp 60
jr c, .asm_d7fea
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_19779
call PrintText
jr .asm_f2f38
.asm_d7fea
2014-05-18 18:19:10 +00:00
ld hl, CeruleanCityText_1977e
call PrintText
.asm_f2f38
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanCityText_1976f:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_1976f
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_19774:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19774
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_19779:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_19779
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText_1977e:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText_1977e
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText9:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText9
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText10:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText10
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText12:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText12
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText13:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText13
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText16:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText16
db "@"
2016-06-12 00:24:04 +00:00
CeruleanCityText17:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanCityText17
db "@"