pokeyellow/scripts/PokemonTower7F.asm

322 lines
8.6 KiB
NASM
Raw Permalink 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
PokemonTower7FSetDefaultScript:
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
PokemonTower7FSetScript:
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:
def_script_pointers
dw_const PokemonTower7FScript0, SCRIPT_POKEMONTOWER7F_SCRIPT0
dw_const PokemonTower7FScript1, SCRIPT_POKEMONTOWER7F_SCRIPT1
dw_const PokemonTower7FScript2, SCRIPT_POKEMONTOWER7F_SCRIPT2
dw_const PokemonTower7FScript3, SCRIPT_POKEMONTOWER7F_SCRIPT3
dw_const PokemonTower7FScript4, SCRIPT_POKEMONTOWER7F_SCRIPT4
dw_const PokemonTower7FScript5, SCRIPT_POKEMONTOWER7F_SCRIPT5
dw_const PokemonTower7FScript6, SCRIPT_POKEMONTOWER7F_SCRIPT6
dw_const PokemonTower7FScript7, SCRIPT_POKEMONTOWER7F_SCRIPT7
dw_const PokemonTower7FScript8, SCRIPT_POKEMONTOWER7F_SCRIPT8
dw_const PokemonTower7FScript9, SCRIPT_POKEMONTOWER7F_SCRIPT9
dw_const PokemonTower7FScript10, SCRIPT_POKEMONTOWER7F_SCRIPT10
dw_const PokemonTower7FWarpToMrFujiHouseScript, SCRIPT_POKEMONTOWER7F_WARP_TO_MR_FUJI_HOUSE
2016-06-01 21:24:31 +00:00
PokemonTower7FScript0:
2020-11-07 20:35:40 +00:00
IF DEF(_DEBUG)
call DebugPressedOrHeldB
ret nz
ENDC
CheckEvent EVENT_BEAT_POKEMONTOWER_7_JESSIE_JAMES
call z, PokemonTower7FScript_60d2a
2016-06-01 21:24:31 +00:00
ret
2014-05-18 18:19:10 +00:00
PokemonTower7FScript_60d2a:
2016-06-01 21:24:31 +00:00
ld a, [wYCoord]
cp $c
ret nz
ResetEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
ld a, [wXCoord]
cp $a
jr z, .asm_60d47
ld a, [wXCoord] ; why?
cp $b
ret nz
SetEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
.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
2020-11-04 06:06:44 +00:00
ldh [hJoyHeld], a
ld a, ~(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
call PokemonTower7FScript_ShowObject
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JAMES
call PokemonTower7FScript_ShowObject
2016-06-01 21:24:31 +00:00
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, TEXT_POKEMONTOWER7F_TEXT4
ldh [hTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT1
call PokemonTower7FSetScript
2014-05-18 18:19:10 +00:00
ret
PokemonTower7FMovementData_60d7a:
2016-06-01 21:24:31 +00:00
db $4
PokemonTower7FMovementData_60d7b:
2016-06-01 21:24:31 +00:00
db $4
db $4
db $4
db $FF
PokemonTower7FScript1:
ld de, PokemonTower7FMovementData_60d7b
CheckEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
jr z, .asm_60d8c
ld de, PokemonTower7FMovementData_60d7a
2016-06-01 21:24:31 +00:00
.asm_60d8c
ld a, POKEMONTOWER7F_JESSIE
ldh [hSpriteIndex], a
2016-06-01 21:24:31 +00:00
call MoveSprite
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT2
call PokemonTower7FSetScript
2016-06-01 21:24:31 +00:00
ret
PokemonTower7FScript2:
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, [wStatusFlags5]
bit BIT_SCRIPTED_NPC_MOVEMENT, a
2014-05-18 18:19:10 +00:00
ret nz
PokemonTower7FScript3:
ld a, SPRITE_FACING_DOWN
ld [wSprite01StateData1FacingDirection], a
CheckEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
jr z, .asm_60dba
ld a, SPRITE_FACING_RIGHT
ld [wSprite01StateData1FacingDirection], a
2016-06-01 21:24:31 +00:00
.asm_60dba
ld a, $2
ld [wSprite01StateData1MovementStatus], a
PokemonTower7FScript4:
ld de, PokemonTower7FMovementData_60d7a
CheckEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
jr z, .asm_60dcc
ld de, PokemonTower7FMovementData_60d7b
2016-06-01 21:24:31 +00:00
.asm_60dcc
ld a, POKEMONTOWER7F_JAMES
ldh [hSpriteIndex], a
2016-06-01 21:24:31 +00:00
call MoveSprite
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT5
call PokemonTower7FSetScript
2016-06-01 21:24:31 +00:00
ret
PokemonTower7FScript5:
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, [wStatusFlags5]
bit BIT_SCRIPTED_NPC_MOVEMENT, a
2016-06-01 21:24:31 +00:00
ret nz
PokemonTower7FScript6:
2016-06-01 21:24:31 +00:00
ld a, $2
ld [wSprite02StateData1MovementStatus], a
ld a, SPRITE_FACING_LEFT
ld [wSprite02StateData1FacingDirection], a
CheckEvent EVENT_POKEMONTOWER_7_JESSIE_JAMES_ON_LEFT
2016-06-01 21:24:31 +00:00
jr z, .asm_60dff
ld a, SPRITE_FACING_DOWN
ld [wSprite02StateData1FacingDirection], a
2016-06-01 21:24:31 +00:00
.asm_60dff
call Delay3
ld a, ~(A_BUTTON | B_BUTTON)
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, TEXT_POKEMONTOWER7F_TEXT5
ldh [hTextID], a
2016-06-01 21:24:31 +00:00
call DisplayTextID
PokemonTower7FScript7:
ld hl, wStatusFlags3
set BIT_TALKED_TO_TRAINER, [hl]
set BIT_PRINT_END_BATTLE_TEXT, [hl]
ld hl, PokemonTower7FJessieJamesEndBattleText
ld de, PokemonTower7FJessieJamesEndBattleText
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
2020-11-04 06:06:44 +00:00
ldh [hJoyHeld], a
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT8
call PokemonTower7FSetScript
2016-06-01 21:24:31 +00:00
ret
PokemonTower7FScript8:
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower7FSetDefaultScript
2016-06-01 21:24:31 +00:00
ld a, $2
ld [wSprite01StateData1MovementStatus], a
ld [wSprite02StateData1MovementStatus], a
2016-06-01 21:24:31 +00:00
xor a
ld [wSprite01StateData1FacingDirection], a
ld [wSprite02StateData1FacingDirection], a
ld a, ~(A_BUTTON | B_BUTTON)
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, TEXT_POKEMONTOWER7F_TEXT6
ldh [hTextID], a
2016-06-01 21:24:31 +00:00
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, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT9
call PokemonTower7FSetScript
2016-06-01 21:24:31 +00:00
ret
PokemonTower7FScript9:
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
2016-06-01 21:24:31 +00:00
ld [wJoyIgnore], a
call GBFadeOutToBlack
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JESSIE
call PokemonTower7FScript_HideObject
2020-05-21 00:40:33 +00:00
ld a, HS_POKEMON_TOWER_7F_JAMES
call PokemonTower7FScript_HideObject
2016-06-01 21:24:31 +00:00
call UpdateSprites
call Delay3
call GBFadeInFromBlack
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT10
call PokemonTower7FSetScript
2016-06-01 21:24:31 +00:00
ret
PokemonTower7FScript10:
2016-06-01 21:24:31 +00:00
call PlayDefaultMusic
2014-05-18 18:19:10 +00:00
xor a
2020-11-04 06:06:44 +00:00
ldh [hJoyHeld], a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
SetEvent EVENT_BEAT_POKEMONTOWER_7_JESSIE_JAMES
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT0
call PokemonTower7FSetScript
2014-05-18 18:19:10 +00:00
ret
PokemonTower7FScript_ShowObject:
2016-06-01 21:24:31 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
call UpdateSprites
call Delay3
ret
PokemonTower7FScript_HideObject:
2016-06-01 21:24:31 +00:00
ld [wMissableObjectIndex], a
predef HideObject
ret
PokemonTower7FWarpToMrFujiHouseScript:
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
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
2020-11-04 06:06:44 +00:00
ldh [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, wStatusFlags3
set BIT_WARP_FROM_CUR_SCRIPT, [hl]
ld a, SCRIPT_POKEMONTOWER7F_SCRIPT0
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:
def_text_pointers
dw_const PokemonTower7FJessieJamesText, TEXT_POKEMONTOWER7F_JESSIE
dw_const PokemonTower7FJessieJamesText, TEXT_POKEMONTOWER7F_JAMES
dw_const PokemonTower7FMrFujiText, TEXT_POKEMONTOWER7F_MR_FUJI
dw_const PokemonTower7FText4, TEXT_POKEMONTOWER7F_TEXT4
dw_const PokemonTower7FText5, TEXT_POKEMONTOWER7F_TEXT5
dw_const PokemonTower7FText6, TEXT_POKEMONTOWER7F_TEXT6
2014-05-18 18:19:10 +00:00
PokemonTower7FJessieJamesText:
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
PokemonTower7FText4:
2020-11-04 06:06:44 +00:00
text_far _PokemonTowerJessieJamesText1
text_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
PokemonTower7FText5:
2020-11-04 06:06:44 +00:00
text_far _PokemonTowerJessieJamesText2
text_end
2014-05-18 18:19:10 +00:00
PokemonTower7FJessieJamesEndBattleText:
2020-11-04 06:06:44 +00:00
text_far _PokemonTowerJessieJamesText3
text_end
2016-06-01 21:24:31 +00:00
PokemonTower7FText6:
2020-11-04 06:06:44 +00:00
text_far _PokemonTowerJessieJamesText4
text_asm
2016-06-01 21:24:31 +00:00
ld c, 64
call DelayFrames
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
PokemonTower7FMrFujiText:
2020-11-04 06:06:44 +00:00
text_asm
ld hl, .RescueText
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
ld a, SCRIPT_POKEMONTOWER7F_WARP_TO_MR_FUJI_HOUSE
2020-05-21 00:40:33 +00:00
ld [wPokemonTower7FCurScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.RescueText:
text_far _PokemonTower7FMrFujiRescueText
2020-11-04 06:06:44 +00:00
text_end