2019-01-01 20:06:23 +00:00
|
|
|
VermilionGym_Script:
|
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]
|
|
|
|
push hl
|
2020-05-06 01:28:19 +00:00
|
|
|
call nz, VermilionGymLoadName
|
2014-05-18 18:19:10 +00:00
|
|
|
pop hl
|
|
|
|
bit 6, [hl]
|
|
|
|
res 6, [hl]
|
2020-05-06 01:28:19 +00:00
|
|
|
call nz, VermilionGymSetDoorTile
|
2014-05-18 18:19:10 +00:00
|
|
|
call EnableAutoTextBoxDrawing
|
|
|
|
ld hl, VermilionGymTrainerHeader0
|
2019-01-01 20:06:23 +00:00
|
|
|
ld de, VermilionGym_ScriptPointers
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wVermilionGymCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
call ExecuteCurMapScriptInTable
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wVermilionGymCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymLoadName:
|
2015-07-03 19:38:12 +00:00
|
|
|
ld hl, Gym3CityName
|
|
|
|
ld de, Gym3LeaderName
|
2014-05-18 18:19:10 +00:00
|
|
|
jp LoadGymLeaderAndCityName
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Gym3CityName:
|
2014-05-18 18:19:10 +00:00
|
|
|
db "VERMILION CITY@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Gym3LeaderName:
|
2014-05-18 18:19:10 +00:00
|
|
|
db "LT.SURGE@"
|
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymSetDoorTile:
|
2015-07-21 01:32:02 +00:00
|
|
|
CheckEvent EVENT_2ND_LOCK_OPENED
|
2019-10-07 05:23:57 +00:00
|
|
|
jr nz, .doorsOpen
|
2020-05-06 01:28:19 +00:00
|
|
|
ld a, $24 ; double door tile ID
|
2019-10-07 05:23:57 +00:00
|
|
|
jr .replaceTile
|
|
|
|
.doorsOpen
|
2015-07-19 08:46:12 +00:00
|
|
|
ld a, SFX_GO_INSIDE
|
2014-05-18 18:19:10 +00:00
|
|
|
call PlaySound
|
2020-05-06 01:28:19 +00:00
|
|
|
ld a, $5 ; clear floor tile ID
|
2019-10-07 05:23:57 +00:00
|
|
|
.replaceTile
|
2015-07-24 21:39:45 +00:00
|
|
|
ld [wNewTileBlockID], a
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 2, 2
|
2014-09-14 18:29:18 +00:00
|
|
|
predef_jump ReplaceTileBlock
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymResetScripts:
|
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 [wVermilionGymCurScript], a
|
|
|
|
ld [wCurMapScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
VermilionGym_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
|
2020-05-06 01:28:19 +00:00
|
|
|
dw VermilionGymLTSurgePostBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymLTSurgePostBattle:
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wIsInBattle]
|
2020-05-06 01:28:19 +00:00
|
|
|
cp $ff ; did we lose?
|
|
|
|
jp z, VermilionGymResetScripts
|
2020-05-06 01:42:40 +00:00
|
|
|
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymReceiveTM24:
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $6
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
2015-07-21 02:41:23 +00:00
|
|
|
SetEvent EVENT_BEAT_LT_SURGE
|
2020-07-06 02:52:27 +00:00
|
|
|
lb bc, TM_THUNDERBOLT, 1
|
2014-05-18 18:19:10 +00:00
|
|
|
call GiveItem
|
|
|
|
jr nc, .BagFull
|
|
|
|
ld a, $7
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
2015-07-21 02:41:23 +00:00
|
|
|
SetEvent EVENT_GOT_TM24
|
2019-10-07 05:23:57 +00:00
|
|
|
jr .gymVictory
|
2014-05-18 18:19:10 +00:00
|
|
|
.BagFull
|
|
|
|
ld a, $8
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [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 2, [hl]
|
2015-07-26 02:26:54 +00:00
|
|
|
ld hl, wBeatGymFlags
|
2014-05-18 18:19:10 +00:00
|
|
|
set 2, [hl]
|
|
|
|
|
|
|
|
; deactivate gym trainers
|
2015-07-21 01:32:02 +00:00
|
|
|
SetEventRange EVENT_BEAT_VERMILION_GYM_TRAINER_0, EVENT_BEAT_VERMILION_GYM_TRAINER_2
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
jp VermilionGymResetScripts
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
VermilionGym_TextPointers:
|
2020-05-06 01:28:19 +00:00
|
|
|
dw LTSurgeText
|
|
|
|
dw VermilionGymTrainerText1
|
|
|
|
dw VermilionGymTrainerText2
|
|
|
|
dw VermilionGymTrainerText3
|
|
|
|
dw VermilionGymFanText
|
|
|
|
dw LTSurgeThunderbadgeInfoText
|
|
|
|
dw ReceivedTM24Text
|
|
|
|
dw TM24NoRoomText
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymTrainerHeader0:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_VERMILION_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_VERMILION_GYM_TRAINER_0
|
2015-07-03 19:38:12 +00:00
|
|
|
dw VermilionGymBattleText1 ; TextBeforeBattle
|
|
|
|
dw VermilionGymAfterBattleText1 ; TextAfterBattle
|
|
|
|
dw VermilionGymEndBattleText1 ; TextEndBattle
|
|
|
|
dw VermilionGymEndBattleText1 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymTrainerHeader1:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_1
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($2 << 4) ; trainer's view range
|
2015-07-21 01:32:02 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_1
|
2015-07-03 19:38:12 +00:00
|
|
|
dw VermilionGymBattleText2 ; TextBeforeBattle
|
|
|
|
dw VermilionGymAfterBattleText2 ; TextAfterBattle
|
|
|
|
dw VermilionGymEndBattleText2 ; TextEndBattle
|
|
|
|
dw VermilionGymEndBattleText2 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymTrainerHeader2:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_2
|
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_VERMILION_GYM_TRAINER_2
|
2015-07-03 19:38:12 +00:00
|
|
|
dw VermilionGymBattleText3 ; TextBeforeBattle
|
|
|
|
dw VermilionGymAfterBattleText3 ; TextAfterBattle
|
|
|
|
dw VermilionGymEndBattleText3 ; TextEndBattle
|
|
|
|
dw VermilionGymEndBattleText3 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
|
|
|
db $ff
|
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
LTSurgeText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 02:41:23 +00:00
|
|
|
CheckEvent EVENT_BEAT_LT_SURGE
|
2019-10-07 05:23:57 +00:00
|
|
|
jr z, .beforeBeat
|
2015-07-21 02:41:23 +00:00
|
|
|
CheckEventReuseA EVENT_GOT_TM24
|
2019-10-07 05:23:57 +00:00
|
|
|
jr nz, .afterBeat
|
2020-05-06 01:28:19 +00:00
|
|
|
call z, VermilionGymReceiveTM24
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisableWaitingAfterTextDisplay
|
2019-10-07 05:23:57 +00:00
|
|
|
jr .done
|
|
|
|
.afterBeat
|
2020-05-06 01:28:19 +00:00
|
|
|
ld hl, LTSurgePostBattleAdviceText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2019-10-07 05:23:57 +00:00
|
|
|
jr .done
|
|
|
|
.beforeBeat
|
2020-05-06 01:28:19 +00:00
|
|
|
ld hl, LTSurgePreBattleText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd72d
|
2014-05-18 18:19:10 +00:00
|
|
|
set 6, [hl]
|
|
|
|
set 7, [hl]
|
|
|
|
ld hl, ReceivedThunderbadgeText
|
|
|
|
ld de, ReceivedThunderbadgeText
|
2014-09-14 18:29:18 +00:00
|
|
|
call SaveEndBattleTextPointers
|
2020-07-06 23:03:05 +00:00
|
|
|
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
|
|
|
|
ld a, $3
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wGymLeaderNo], a
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2020-05-06 01:28:19 +00:00
|
|
|
ld a, $3 ; set script index to LT Surge post-battle script
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wVermilionGymCurScript], a
|
|
|
|
ld [wCurMapScript], a
|
2019-10-07 05:23:57 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
LTSurgePreBattleText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _LTSurgePreBattleText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
LTSurgePostBattleAdviceText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _LTSurgePostBattleAdviceText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
LTSurgeThunderbadgeInfoText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _LTSurgeThunderbadgeInfoText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
ReceivedTM24Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _ReceivedTM24Text
|
|
|
|
sound_get_key_item
|
|
|
|
text_far _TM24ExplanationText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
TM24NoRoomText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _TM24NoRoomText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
ReceivedThunderbadgeText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _ReceivedThunderbadgeText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymTrainerText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, VermilionGymTrainerHeader0
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymEndBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymEndBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymAfterBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymAfterBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymTrainerText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, VermilionGymTrainerHeader1
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymEndBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymEndBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymAfterBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymAfterBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymTrainerText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, VermilionGymTrainerHeader2
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymBattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymBattleText3
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymEndBattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymEndBattleText3
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
VermilionGymAfterBattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymAfterBattleText3
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymFanText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-26 02:26:54 +00:00
|
|
|
ld a, [wBeatGymFlags]
|
2014-05-18 18:19:10 +00:00
|
|
|
bit 2, a
|
2020-05-06 01:28:19 +00:00
|
|
|
jr nz, .afterBeat
|
|
|
|
ld hl, VermilionGymFanPreBattleText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2020-05-06 01:28:19 +00:00
|
|
|
jr .done
|
|
|
|
.afterBeat
|
|
|
|
ld hl, VermilionGymFanPostBattleText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2020-05-06 01:28:19 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymFanPreBattleText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymFanPreBattleText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2020-05-06 01:28:19 +00:00
|
|
|
VermilionGymFanPostBattleText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _VermilionGymFanPostBattleText
|
|
|
|
text_end
|