pokeyellow/scripts/PokemonTower7F.asm

316 lines
6.3 KiB
NASM
Raw Normal View History

2020-05-21 00:40:33 +00:00
PokemonTower7F_Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
2020-05-21 00:40:33 +00:00
ld hl, PokemonTower7F_ScriptPointers
ld a, [wPokemonTower7FCurScript]
call CallFunctionInTable
2014-05-18 18:19:10 +00:00
ret
2016-06-08 11:44:58 +00:00
PokemonTower7Script_60d01:
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2016-06-01 21:24:31 +00:00
PokemonTower7Script_60d05:
2020-05-21 00:40:33 +00:00
ld [wPokemonTower7FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2020-05-21 00:40:33 +00:00
PokemonTower7F_ScriptPointers:
2016-06-08 11:44:58 +00:00
dw PokemonTower7Script0
dw PokemonTower7Script1
dw PokemonTower7Script2
dw PokemonTower7Script3
dw PokemonTower7Script4
dw PokemonTower7Script5
dw PokemonTower7Script6
dw PokemonTower7Script7
dw PokemonTower7Script8
dw PokemonTower7Script9
dw PokemonTower7Script10
dw PokemonTower7Script11
2016-06-01 21:24:31 +00:00
PokemonTower7Script0:
CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
call z, PokemonTower7Script_60d2a
ret
2014-05-18 18:19:10 +00:00
2016-06-01 21:24:31 +00:00
PokemonTower7Script_60d2a:
ld a, [wYCoord]
cp $c
ret nz
ResetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
ld a, [wXCoord]
cp $a
jr z, .asm_60d47
ld a, [wXCoord] ; why?
cp $b
ret nz
SetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
.asm_60d47
call StopAllMusic
2016-06-06 08:22:40 +00:00
ld c, BANK(Music_MeetJessieJames)
ld a, MUSIC_MEET_JESSIE_JAMES
2016-06-01 21:24:31 +00:00
call PlayMusic
xor a
ld [hJoyHeld], a
ld a, $FF ^ (A_BUTTON | B_BUTTON)
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JESSIE
2016-06-01 21:24:31 +00:00
call PokemonTower7Script_60eaf
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JAMES
2016-06-01 21:24:31 +00:00
call PokemonTower7Script_60eaf
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $4
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2016-06-01 21:24:31 +00:00
ld a, $ff
ld [wJoyIgnore], a
ld a, $1
call PokemonTower7Script_60d05
2014-05-18 18:19:10 +00:00
ret
2016-06-01 21:24:31 +00:00
PokemonTower7MovementData_60d7a:
db $4
PokemonTower7MovementData_60d7b:
db $4
db $4
db $4
db $FF
PokemonTower7Script1:
ld de, PokemonTower7MovementData_60d7b
CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
jr z, .asm_60d8c
ld de, PokemonTower7MovementData_60d7a
.asm_60d8c
ld a, $1
ld [hSpriteIndexOrTextID], a
call MoveSprite
ld a, $ff
ld [wJoyIgnore], a
ld a, $2
call PokemonTower7Script_60d05
ret
PokemonTower7Script2:
ld a, $ff
ld [wJoyIgnore], a
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
2016-06-01 21:24:31 +00:00
PokemonTower7Script3:
ld a, $0
ld [wSpriteStateData1 + 1 * $10 + 9], a
CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
jr z, .asm_60dba
ld a, $c
ld [wSpriteStateData1 + 1 * $10 + 9], a
.asm_60dba
ld a, $2
ld [wSpriteStateData1 + 1 * $10 + 1], a
PokemonTower7Script4:
ld de, PokemonTower7MovementData_60d7a
CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
jr z, .asm_60dcc
ld de, PokemonTower7MovementData_60d7b
.asm_60dcc
ld a, $2
ld [hSpriteIndexOrTextID], a
call MoveSprite
ld a, $ff
ld [wJoyIgnore], a
ld a, $5
call PokemonTower7Script_60d05
ret
PokemonTower7Script5:
ld a, $ff
ld [wJoyIgnore], a
ld a, [wd730]
bit 0, a
ret nz
PokemonTower7Script6:
ld a, $2
ld [wSpriteStateData1 + $2 * $10 + $1], a
ld a, $8
ld [wSpriteStateData1 + $2 * $10 + $9], a
CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
jr z, .asm_60dff
ld a, $0
ld [wSpriteStateData1 + $2 * $10 + $9], a
.asm_60dff
call Delay3
ld a, $FF ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
ld a, $5
ld [hSpriteIndexOrTextID], a
call DisplayTextID
PokemonTower7Script7:
ld hl, wd72d
set 6, [hl]
set 7, [hl]
2016-06-08 11:44:58 +00:00
ld hl, PokemonTower7JessieJamesEndBattleText
ld de, PokemonTower7JessieJamesEndBattleText
2016-06-01 21:24:31 +00:00
call SaveEndBattleTextPointers
ld a, OPP_ROCKET
ld [wCurOpponent], a
ld a, $2c
ld [wTrainerNo], a
xor a
ld [hJoyHeld], a
ld [wJoyIgnore], a
ld a, $8
call PokemonTower7Script_60d05
ret
PokemonTower7Script8:
ld a, $ff
ld [wJoyIgnore], a
ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower7Script_60d01
ld a, $2
ld [wSpriteStateData1 + 1 * $10 + 1], a
ld [wSpriteStateData1 + 2 * $10 + 1], a
xor a
ld [wSpriteStateData1 + 1 * $10 + 9], a
ld [wSpriteStateData1 + 2 * $10 + 9], a
ld a, $FF ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $6
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call StopAllMusic
2016-06-06 08:22:40 +00:00
ld c, BANK(Music_MeetJessieJames)
ld a, MUSIC_MEET_JESSIE_JAMES
2016-06-01 21:24:31 +00:00
call PlayMusic
ld a, $ff
ld [wJoyIgnore], a
ld a, $9
call PokemonTower7Script_60d05
ret
PokemonTower7Script9:
ld a, $ff
ld [wJoyIgnore], a
call GBFadeOutToBlack
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JESSIE
2016-06-01 21:24:31 +00:00
call PokemonTower7Script_60ebe
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JAMES
2016-06-01 21:24:31 +00:00
call PokemonTower7Script_60ebe
call UpdateSprites
call Delay3
call GBFadeInFromBlack
ld a, $a
call PokemonTower7Script_60d05
ret
PokemonTower7Script10:
call PlayDefaultMusic
2014-05-18 18:19:10 +00:00
xor a
2016-06-01 21:24:31 +00:00
ld [hJoyHeld], a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2016-06-01 21:24:31 +00:00
SetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
2014-05-18 18:19:10 +00:00
ld a, $0
2016-06-01 21:24:31 +00:00
call PokemonTower7Script_60d05
2014-05-18 18:19:10 +00:00
ret
2016-06-01 21:24:31 +00:00
PokemonTower7Script_60eaf:
ld [wMissableObjectIndex], a
predef ShowObject
call UpdateSprites
call Delay3
ret
PokemonTower7Script_60ebe
ld [wMissableObjectIndex], a
predef HideObject
ret
PokemonTower7Script11:
2014-05-18 18:19:10 +00:00
ld a, $ff
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_MR_FUJI
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
ld a, SPRITE_FACING_UP
2018-11-19 00:24:53 +00:00
ld [wSpritePlayerStateData1FacingDirection], a
2020-05-21 00:40:33 +00:00
ld a, MR_FUJIS_HOUSE
2015-07-18 15:17:29 +00:00
ld [hWarpDestinationMap], a
2014-05-18 18:19:10 +00:00
ld a, $1
2014-09-13 07:50:56 +00:00
ld [wDestinationWarpID], a
ld a, LAVENDER_TOWN
ld [wLastMap], a
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 3, [hl]
ld a, $0
2020-05-21 00:40:33 +00:00
ld [wPokemonTower7FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2020-05-21 00:40:33 +00:00
PokemonTower7F_TextPointers:
2014-05-18 18:19:10 +00:00
dw PokemonTower7Text1
dw PokemonTower7Text2
dw PokemonTower7Text3
2016-06-01 21:24:31 +00:00
dw PokemonTower7Text4
dw PokemonTower7Text5
dw PokemonTower7Text6
2014-05-18 18:19:10 +00:00
2016-06-01 21:24:31 +00:00
PokemonTower7Text1:
PokemonTower7Text2:
db "@"
2014-05-18 18:19:10 +00:00
2016-06-01 21:24:31 +00:00
PokemonTower7Text4:
TX_FAR _PokemonTowerJessieJamesText1
2015-07-03 19:58:50 +00:00
TX_ASM
2016-06-01 21:24:31 +00:00
ld c, 10
call DelayFrames
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
ld a, $0
ld [wEmotionBubbleSpriteIndex], a
ld a, EXCLAMATION_BUBBLE
2016-06-01 21:24:31 +00:00
ld [wWhichEmotionBubble], a
predef EmotionBubble
ld c, 20
call DelayFrames
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-01 21:24:31 +00:00
PokemonTower7Text5:
TX_FAR _PokemonTowerJessieJamesText2
db "@"
2014-05-18 18:19:10 +00:00
2016-06-01 21:24:31 +00:00
PokemonTower7JessieJamesEndBattleText:
TX_FAR _PokemonTowerJessieJamesText3
db "@"
PokemonTower7Text6:
TX_FAR _PokemonTowerJessieJamesText4
2015-07-03 19:58:50 +00:00
TX_ASM
2016-06-01 21:24:31 +00:00
ld c, 64
call DelayFrames
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-01 21:24:31 +00:00
PokemonTower7Text3:
2015-07-04 03:49:20 +00:00
TX_ASM
2016-06-01 21:24:31 +00:00
ld hl, PokemonTower7Text_60f75
2014-05-18 18:19:10 +00:00
call PrintText
2015-07-21 17:36:03 +00:00
SetEvent EVENT_RESCUED_MR_FUJI
SetEvent EVENT_RESCUED_MR_FUJI_2
2020-05-21 00:40:33 +00:00
ld a, HS_MR_FUJIS_HOUSE_MR_FUJI
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
ld a, HS_SAFFRON_CITY_E
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
ld a, HS_SAFFRON_CITY_F
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
2016-06-01 21:24:31 +00:00
ld a, $b
2020-05-21 00:40:33 +00:00
ld [wPokemonTower7FCurScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-01 21:24:31 +00:00
PokemonTower7Text_60f75:
2014-10-27 03:00:29 +00:00
TX_FAR _TowerRescueFujiText
2014-05-18 18:19:10 +00:00
db "@"