pokered/scripts/SilphCo11F.asm

392 lines
6.9 KiB
NASM
Raw Normal View History

SilphCo11F_Script:
2014-05-18 18:19:10 +00:00
call SilphCo11Script_62110
call EnableAutoTextBoxDrawing
ld hl, SilphCo11TrainerHeader0
ld de, SilphCo11F_ScriptPointers
ld a, [wSilphCo11FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
ld [wSilphCo11FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo11Script_62110:
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
2014-05-18 18:19:10 +00:00
bit 5, [hl]
res 5, [hl]
ret z
2015-08-05 21:20:29 +00:00
ld hl, SilphCo11GateCoords
2014-05-18 18:19:10 +00:00
call SilphCo11Script_62137
call SilphCo11Script_62163
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR
2014-05-18 18:19:10 +00:00
ret nz
ld a, $20
2015-07-24 21:39:45 +00:00
ld [wNewTileBlockID], a
2015-08-05 21:20:29 +00:00
lb bc, 6, 3
2014-09-14 18:29:18 +00:00
predef_jump ReplaceTileBlock
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11GateCoords:
2015-08-05 21:20:29 +00:00
db $06,$03
db $FF
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Script_62137:
2014-05-18 18:19:10 +00:00
push hl
2014-09-14 18:29:18 +00:00
ld hl, wCardKeyDoorY
2014-05-18 18:19:10 +00:00
ld a, [hli]
ld b, a
ld a, [hl]
ld c, a
xor a
ldh [hUnlockedSilphCoDoors], a
2014-05-18 18:19:10 +00:00
pop hl
.asm_62143
ld a, [hli]
cp $ff
jr z, .asm_6215f
push hl
ld hl, hUnlockedSilphCoDoors
2014-05-18 18:19:10 +00:00
inc [hl]
pop hl
cp b
jr z, .asm_62154
inc hl
jr .asm_62143
.asm_62154
ld a, [hli]
cp c
jr nz, .asm_62143
2014-09-14 18:29:18 +00:00
ld hl, wCardKeyDoorY
2014-05-18 18:19:10 +00:00
xor a
ld [hli], a
ld [hl], a
ret
.asm_6215f
xor a
ldh [hUnlockedSilphCoDoors], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo11Script_62163:
ldh a, [hUnlockedSilphCoDoors]
2014-05-18 18:19:10 +00:00
and a
ret z
2015-07-21 17:36:03 +00:00
SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo11Script_6216d:
ld hl, MissableObjectIDs_6219b
2014-05-18 18:19:10 +00:00
.asm_62170
ld a, [hli]
cp $ff
jr z, .asm_62181
push hl
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
2014-05-18 18:19:10 +00:00
pop hl
jr .asm_62170
.asm_62181
ld hl, MissableObjectIDs_62194
2014-05-18 18:19:10 +00:00
.asm_62184
ld a, [hli]
cp $ff
ret z
push hl
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
2014-05-18 18:19:10 +00:00
pop hl
jr .asm_62184
2016-06-12 00:24:04 +00:00
MissableObjectIDs_62194:
db HS_SAFFRON_CITY_8
db HS_SAFFRON_CITY_9
db HS_SAFFRON_CITY_A
db HS_SAFFRON_CITY_B
db HS_SAFFRON_CITY_C
db HS_SAFFRON_CITY_D
db $FF
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
MissableObjectIDs_6219b:
db HS_SAFFRON_CITY_1
db HS_SAFFRON_CITY_2
db HS_SAFFRON_CITY_3
db HS_SAFFRON_CITY_4
db HS_SAFFRON_CITY_5
db HS_SAFFRON_CITY_6
db HS_SAFFRON_CITY_7
db HS_SAFFRON_CITY_E
db HS_SAFFRON_CITY_F
db HS_SILPH_CO_2F_2
db HS_SILPH_CO_2F_3
db HS_SILPH_CO_2F_4
db HS_SILPH_CO_2F_5
db HS_SILPH_CO_3F_1
db HS_SILPH_CO_3F_2
db HS_SILPH_CO_4F_1
db HS_SILPH_CO_4F_2
db HS_SILPH_CO_4F_3
db HS_SILPH_CO_5F_1
db HS_SILPH_CO_5F_2
db HS_SILPH_CO_5F_3
db HS_SILPH_CO_5F_4
db HS_SILPH_CO_6F_1
db HS_SILPH_CO_6F_2
db HS_SILPH_CO_6F_3
db HS_SILPH_CO_7F_1
db HS_SILPH_CO_7F_2
db HS_SILPH_CO_7F_3
db HS_SILPH_CO_7F_4
db HS_SILPH_CO_8F_1
db HS_SILPH_CO_8F_2
db HS_SILPH_CO_8F_3
db HS_SILPH_CO_9F_1
db HS_SILPH_CO_9F_2
db HS_SILPH_CO_9F_3
db HS_SILPH_CO_10F_1
db HS_SILPH_CO_10F_2
db HS_SILPH_CO_11F_1
db HS_SILPH_CO_11F_2
db HS_SILPH_CO_11F_3
2014-05-18 18:19:10 +00:00
db $FF
2016-06-12 00:24:04 +00:00
SilphCo11Script_621c4:
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Script_621c8:
ld [wSilphCo11FCurScript], a
2015-08-31 02:38:41 +00:00
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
SilphCo11F_ScriptPointers:
2014-05-18 18:19:10 +00:00
dw SilphCo11Script0
2014-09-14 18:29:18 +00:00
dw DisplayEnemyTrainerTextAndStartBattle
2014-05-18 18:19:10 +00:00
dw EndTrainerBattle
dw SilphCo11Script3
dw SilphCo11Script4
dw SilphCo11Script5
2016-06-12 00:24:04 +00:00
SilphCo11Script0:
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
2014-05-18 18:19:10 +00:00
ret nz
ld hl, CoordsData_62211
2014-05-18 18:19:10 +00:00
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
2015-07-18 15:17:29 +00:00
ld a, [wCoordIndex]
ld [wcf0d], a
2014-05-18 18:19:10 +00:00
xor a
ldh [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $3
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, $3
ldh [hSpriteIndex], a
2014-05-18 18:19:10 +00:00
call SetSpriteMovementBytesToFF
ld de, MovementData_62216
call MoveSprite
ld a, $3
jp SilphCo11Script_621c8
2016-06-12 00:24:04 +00:00
CoordsData_62211:
2014-05-18 18:19:10 +00:00
db $0D,$06
db $0C,$07
db $FF
2016-06-12 00:24:04 +00:00
MovementData_62216:
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
SilphCo11Script_6221a:
2015-07-20 00:52:26 +00:00
ld [wPlayerMovingDirection], a
2014-05-18 18:19:10 +00:00
ld a, $3
ldh [hSpriteIndex], a
2014-05-18 18:19:10 +00:00
ld a, b
ldh [hSpriteFacingDirection], a
jp SetSpriteFacingDirectionAndDelay
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Script5:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, SilphCo11Script_621c4
ld a, [wcf0d]
2014-05-18 18:19:10 +00:00
cp $1
jr z, .asm_6223c
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_LEFT
2015-07-18 15:17:29 +00:00
ld b, SPRITE_FACING_RIGHT
2014-05-18 18:19:10 +00:00
jr .asm_62240
.asm_6223c
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_UP
2015-07-18 15:17:29 +00:00
ld b, SPRITE_FACING_DOWN
2014-05-18 18:19:10 +00:00
.asm_62240
call SilphCo11Script_6221a
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $6
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2014-09-13 07:50:56 +00:00
call GBFadeOutToBlack
2014-05-18 18:19:10 +00:00
call SilphCo11Script_6216d
call UpdateSprites
call Delay3
2014-09-13 07:50:56 +00:00
call GBFadeInFromBlack
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BEAT_SILPH_CO_GIOVANNI
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
jp SilphCo11Script_621c8
2016-06-12 00:24:04 +00:00
SilphCo11Script3:
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
ld a, $3
ldh [hSpriteIndex], a
2014-05-18 18:19:10 +00:00
call SetSpriteMovementBytesToFF
ld a, [wcf0d]
2014-05-18 18:19:10 +00:00
cp $1
jr z, .asm_62284
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_LEFT
2015-07-18 15:17:29 +00:00
ld b, SPRITE_FACING_RIGHT
2014-05-18 18:19:10 +00:00
jr .asm_62288
.asm_62284
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_UP
2015-07-18 15:17:29 +00:00
ld b, SPRITE_FACING_DOWN
2014-05-18 18:19:10 +00:00
.asm_62288
call SilphCo11Script_6221a
call Delay3
ld a, $4
jp SilphCo11Script_621c8
2016-06-12 00:24:04 +00:00
SilphCo11Script4:
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, SilphCo10Text_62330
ld de, SilphCo10Text_62330
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
2014-09-13 07:50:56 +00:00
ld [wSpriteIndex], a
2014-05-18 18:19:10 +00:00
call EngageMapTrainer
call InitBattleEnemyParameters
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $5
jp SilphCo11Script_621c8
SilphCo11F_TextPointers:
2014-05-18 18:19:10 +00:00
dw SilphCo11Text1
dw SilphCo11Text2
dw SilphCo11Text3
dw SilphCo11Text4
dw SilphCo11Text5
dw SilphCo11Text6
2016-06-12 00:24:04 +00:00
SilphCo11TrainerHeader0:
trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_0, 4, SilphCo11BattleText1, SilphCo11EndBattleText1, SilphCo11AfterBattleText1
2016-06-12 00:24:04 +00:00
SilphCo11TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_1, 3, SilphCo11BattleText2, SilphCo11EndBattleText2, SilphCo11AfterBattleText2
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text1:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_MASTER_BALL
jp nz, .got_item
2014-05-18 18:19:10 +00:00
ld hl, SilphCoPresidentText
call PrintText
2015-08-05 21:20:29 +00:00
lb bc, MASTER_BALL, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .bag_full
2014-05-18 18:19:10 +00:00
ld hl, ReceivedSilphCoMasterBallText
call PrintText
2015-07-21 17:36:03 +00:00
SetEvent EVENT_GOT_MASTER_BALL
jr .done
.bag_full
2014-05-18 18:19:10 +00:00
ld hl, SilphCoMasterBallNoRoomText
call PrintText
jr .done
.got_item
2014-05-18 18:19:10 +00:00
ld hl, SilphCo10Text_6231c
call PrintText
.done
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCoPresidentText:
text_far _SilphCoPresidentText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
ReceivedSilphCoMasterBallText:
text_far _ReceivedSilphCoMasterBallText
sound_get_key_item
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo10Text_6231c:
text_far _SilphCo10Text_6231c
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCoMasterBallNoRoomText:
text_far _SilphCoMasterBallNoRoomText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text2:
text_far _SilphCo11Text2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text3:
text_far _SilphCo11Text3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo10Text_62330:
text_far _SilphCo10Text_62330
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text6:
text_far _SilphCo10Text_62335
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text4:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo11TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo11BattleText1:
text_far _SilphCo11BattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11EndBattleText1:
text_far _SilphCo11EndBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11AfterBattleText1:
text_far _SilphCo11AfterBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11Text5:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo11TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo11BattleText2:
text_far _SilphCo11BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11EndBattleText2:
text_far _SilphCo11EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo11AfterBattleText2:
text_far _SilphCo11AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo10Text_6236c:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo10Text_6237b
call PrintText
ld a, PORYGON
call DisplayPokedex
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo10Text_6237b:
text_far _SilphCo10Text_6237b
text_end