pokered/scripts/Route24.asm

281 lines
5.4 KiB
NASM
Raw Normal View History

Route24_Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, Route24TrainerHeaders
ld de, Route24_ScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wRoute24CurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
2015-08-31 02:38:41 +00:00
ld [wRoute24CurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
Route24Script_513c0:
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 [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
Route24_ScriptPointers:
2014-05-18 18:19:10 +00:00
dw Route24Script0
2014-09-14 18:29:18 +00:00
dw DisplayEnemyTrainerTextAndStartBattle
2014-05-18 18:19:10 +00:00
dw EndTrainerBattle
dw Route24Script3
dw Route24Script4
2016-06-12 00:24:04 +00:00
Route24Script0:
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_NUGGET
2014-05-18 18:19:10 +00:00
jp nz, CheckFightingMapTrainers
ld hl, CoordsData_5140e
2014-05-18 18:19:10 +00:00
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
xor a
ldh [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $1
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2015-07-21 17:36:03 +00:00
CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE
2014-05-18 18:19:10 +00:00
ret z
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
2014-05-18 18:19:10 +00:00
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $4
2015-08-31 02:38:41 +00:00
ld [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CoordsData_5140e:
dbmapcoord 10, 15
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Script4:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
call Delay3
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
Route24Script3:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, Route24Script_513c0
call UpdateSprites
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BEAT_ROUTE24_ROCKET
2014-05-18 18:19:10 +00:00
ld a, $1
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
Route24_TextPointers:
2014-05-18 18:19:10 +00:00
dw Route24Text1
dw Route24Text2
dw Route24Text3
dw Route24Text4
dw Route24Text5
dw Route24Text6
dw Route24Text7
2015-07-18 15:17:29 +00:00
dw PickUpItemText
2014-05-18 18:19:10 +00:00
Route24TrainerHeaders:
def_trainers 2
2016-06-12 00:24:04 +00:00
Route24TrainerHeader0:
trainer EVENT_BEAT_ROUTE_24_TRAINER_0, 4, Route24BattleText1, Route24EndBattleText1, Route24AfterBattleText1
Route24TrainerHeader1:
trainer EVENT_BEAT_ROUTE_24_TRAINER_1, 1, Route24BattleText2, Route24EndBattleText2, Route24AfterBattleText2
Route24TrainerHeader2:
trainer EVENT_BEAT_ROUTE_24_TRAINER_2, 1, Route24BattleText3, Route24EndBattleText3, Route24AfterBattleText3
Route24TrainerHeader3:
trainer EVENT_BEAT_ROUTE_24_TRAINER_3, 1, Route24BattleText4, Route24EndBattleText4, Route24AfterBattleText4
Route24TrainerHeader4:
trainer EVENT_BEAT_ROUTE_24_TRAINER_4, 1, Route24BattleText5, Route24EndBattleText5, Route24AfterBattleText5
Route24TrainerHeader5:
trainer EVENT_BEAT_ROUTE_24_TRAINER_5, 1, Route24BattleText6, Route24EndBattleText6, Route24AfterBattleText6
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text1:
text_asm
2015-07-21 17:36:03 +00:00
ResetEvent EVENT_NUGGET_REWARD_AVAILABLE
CheckEvent EVENT_GOT_NUGGET
jr nz, .got_item
2014-05-18 18:19:10 +00:00
ld hl, Route24Text_51510
call PrintText
2015-08-05 21:20:29 +00:00
lb bc, NUGGET, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .bag_full
2015-07-21 17:36:03 +00:00
SetEvent EVENT_GOT_NUGGET
2014-05-18 18:19:10 +00:00
ld hl, Route24Text_5151a
call PrintText
ld hl, Route24Text_51526
call PrintText
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, Route24Text_5152b
ld de, Route24Text_5152b
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
ldh a, [hSpriteIndexOrTextID]
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
ldh [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.got_item
2014-05-18 18:19:10 +00:00
ld hl, Route24Text_51530
call PrintText
jp TextScriptEnd
.bag_full
2014-05-18 18:19:10 +00:00
ld hl, Route24Text_51521
call PrintText
2015-07-21 17:36:03 +00:00
SetEvent EVENT_NUGGET_REWARD_AVAILABLE
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text_51510:
text_far _Route24Text_51510
sound_get_item_1
text_far _Route24Text_51515
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_5151a:
text_far _Route24Text_5151a
sound_get_item_1
text_promptbutton
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_51521:
text_far _Route24Text_51521
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_51526:
text_far _Route24Text_51526
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_5152b:
text_far _Route24Text_5152b
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_51530:
text_far _Route24Text_51530
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text2:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, Route24TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text3:
text_asm
ld hl, Route24TrainerHeader1
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text4:
text_asm
ld hl, Route24TrainerHeader2
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text5:
text_asm
ld hl, Route24TrainerHeader3
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text6:
text_asm
ld hl, Route24TrainerHeader4
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24Text7:
text_asm
ld hl, Route24TrainerHeader5
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route24BattleText1:
text_far _Route24BattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText1:
text_far _Route24EndBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText1:
text_far _Route24AfterBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24BattleText2:
text_far _Route24BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText2:
text_far _Route24EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText2:
text_far _Route24AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24BattleText3:
text_far _Route24BattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText3:
text_far _Route24EndBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText3:
text_far _Route24AfterBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24BattleText4:
text_far _Route24BattleText4
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText4:
text_far _Route24EndBattleText4
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText4:
text_far _Route24AfterBattleText4
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24BattleText5:
text_far _Route24BattleText5
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText5:
text_far _Route24EndBattleText5
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText5:
text_far _Route24AfterBattleText5
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24BattleText6:
text_far _Route24BattleText6
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24EndBattleText6:
text_far _Route24EndBattleText6
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24AfterBattleText6:
text_far _Route24AfterBattleText6
text_end