pokered/scripts/CeruleanGym.asm

220 lines
4.3 KiB
NASM
Raw Normal View History

CeruleanGym_Script:
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
2014-05-18 18:19:10 +00:00
bit 6, [hl]
res 6, [hl]
call nz, CeruleanGymScript_5c6d0
call EnableAutoTextBoxDrawing
ld hl, CeruleanGymTrainerHeader0
ld de, CeruleanGym_ScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wCeruleanGymCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
2015-08-31 02:38:41 +00:00
ld [wCeruleanGymCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CeruleanGymScript_5c6d0:
ld hl, Gym2CityName
ld de, Gym2LeaderName
2014-05-18 18:19:10 +00:00
jp LoadGymLeaderAndCityName
2016-06-12 00:24:04 +00:00
Gym2CityName:
2014-05-18 18:19:10 +00:00
db "CERULEAN CITY@"
2016-06-12 00:24:04 +00:00
Gym2LeaderName:
2014-05-18 18:19:10 +00:00
db "MISTY@"
2016-06-12 00:24:04 +00:00
CeruleanGymScript_5c6ed:
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 [wCeruleanGymCurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
CeruleanGym_ScriptPointers:
2014-05-18 18:19:10 +00:00
dw CheckFightingMapTrainers
2014-09-14 18:29:18 +00:00
dw DisplayEnemyTrainerTextAndStartBattle
2014-05-18 18:19:10 +00:00
dw EndTrainerBattle
dw CeruleanGymScript3
2016-06-12 00:24:04 +00:00
CeruleanGymScript3:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, CeruleanGymScript_5c6ed
ld a, $f0
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
CeruleanGymScript_5c70d:
2014-05-18 18:19:10 +00:00
ld a, $5
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2015-07-21 02:41:23 +00:00
SetEvent EVENT_BEAT_MISTY
2015-08-05 21:20:29 +00:00
lb bc, TM_11, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .BagFull
ld a, $6
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2015-07-21 02:41:23 +00:00
SetEvent EVENT_GOT_TM11
2019-10-07 05:23:57 +00:00
jr .gymVictory
2014-05-18 18:19:10 +00:00
.BagFull
ld a, $7
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2019-10-07 05:23:57 +00:00
.gymVictory
2015-08-31 02:38:41 +00:00
ld hl, wObtainedBadges
2014-05-18 18:19:10 +00:00
set 1, [hl]
2015-07-26 02:26:54 +00:00
ld hl, wBeatGymFlags
2014-05-18 18:19:10 +00:00
set 1, [hl]
; deactivate gym trainers
2015-07-21 01:32:02 +00:00
SetEvents EVENT_BEAT_CERULEAN_GYM_TRAINER_0, EVENT_BEAT_CERULEAN_GYM_TRAINER_1
2014-05-18 18:19:10 +00:00
jp CeruleanGymScript_5c6ed
CeruleanGym_TextPointers:
2014-05-18 18:19:10 +00:00
dw CeruleanGymText1
dw CeruleanGymText2
dw CeruleanGymText3
dw CeruleanGymText4
dw CeruleanGymText5
dw CeruleanGymText6
dw CeruleanGymText7
2016-06-12 00:24:04 +00:00
CeruleanGymTrainerHeader0:
2015-07-21 01:32:02 +00:00
dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_0
2014-05-18 18:19:10 +00:00
db ($3 << 4) ; trainer's view range
2015-07-21 01:32:02 +00:00
dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_0
dw CeruleanGymBattleText1 ; TextBeforeBattle
dw CeruleanGymAfterBattleText1 ; TextAfterBattle
dw CeruleanGymEndBattleText1 ; TextEndBattle
dw CeruleanGymEndBattleText1 ; TextEndBattle
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanGymTrainerHeader1:
2015-07-21 01:32:02 +00:00
dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_1
2014-05-18 18:19:10 +00:00
db ($3 << 4) ; trainer's view range
2015-07-21 01:32:02 +00:00
dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_1
dw CeruleanGymBattleText2 ; TextBeforeBattle
dw CeruleanGymAfterBattleText2 ; TextAfterBattle
dw CeruleanGymEndBattleText2 ; TextEndBattle
dw CeruleanGymEndBattleText2 ; TextEndBattle
2014-05-18 18:19:10 +00:00
db $ff
2016-06-12 00:24:04 +00:00
CeruleanGymText1:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 02:41:23 +00:00
CheckEvent EVENT_BEAT_MISTY
2019-10-07 05:23:57 +00:00
jr z, .beginBattle
2015-07-21 02:41:23 +00:00
CheckEventReuseA EVENT_GOT_TM11
2019-10-07 05:23:57 +00:00
jr nz, .afterVictory
2014-05-18 18:19:10 +00:00
call z, CeruleanGymScript_5c70d
call DisableWaitingAfterTextDisplay
2019-10-07 05:23:57 +00:00
jr .done
.afterVictory
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymText_5c7c3
call PrintText
2019-10-07 05:23:57 +00:00
jr .done
.beginBattle
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymText_5c7be
call PrintText
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, CeruleanGymText_5c7d8
ld de, CeruleanGymText_5c7d8
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
2015-07-03 20:13:35 +00:00
ld a, [H_SPRITEINDEX]
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, $2
2015-08-31 02:38:41 +00:00
ld [wGymLeaderNo], a
2014-05-18 18:19:10 +00:00
xor a
2015-07-03 20:13:35 +00:00
ld [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wCeruleanGymCurScript], a
2019-10-07 05:23:57 +00:00
.done
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanGymText_5c7be:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c7be
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText_5c7c3:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c7c3
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText5:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c7c8
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText6:
2014-05-18 18:19:10 +00:00
TX_FAR _ReceivedTM11Text
2016-07-18 06:17:03 +00:00
TX_SFX_ITEM_1
db "@"
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanGymText7:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c7d3
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText_5c7d8:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c7d8
2016-07-18 06:17:03 +00:00
TX_SFX_KEY_ITEM ; actually plays the second channel of SFX_BALL_POOF due to the wrong music bank being loaded
TX_BLINK
db "@"
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
CeruleanGymText2:
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanGymBattleText1:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymBattleText1
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymEndBattleText1:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymEndBattleText1
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymAfterBattleText1:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymAfterBattleText1
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText3:
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymTrainerHeader1
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanGymBattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymBattleText2
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymEndBattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymEndBattleText2
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymAfterBattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymAfterBattleText2
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText4:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 02:41:23 +00:00
CheckEvent EVENT_BEAT_MISTY
jr nz, .asm_5c821
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymText_5c82a
call PrintText
jr .asm_5c827
.asm_5c821
2014-05-18 18:19:10 +00:00
ld hl, CeruleanGymText_5c82f
call PrintText
.asm_5c827
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
CeruleanGymText_5c82a:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c82a
db "@"
2016-06-12 00:24:04 +00:00
CeruleanGymText_5c82f:
2014-05-18 18:19:10 +00:00
TX_FAR _CeruleanGymText_5c82f
db "@"