pokered/scripts/route24.asm

320 lines
6.3 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
Route24Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, Route24TrainerHeader0
2014-05-18 18:19:10 +00:00
ld de, Route24ScriptPointers
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
2016-06-12 00:24:04 +00:00
Route24ScriptPointers:
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
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [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:
2014-05-18 18:19:10 +00:00
db $0F,$0A,$FF
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
2015-07-18 15:17:29 +00:00
ld [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
2016-06-12 00:24:04 +00:00
Route24TextPointers:
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
2016-06-12 00:24:04 +00:00
Route24TrainerHeader0:
2015-07-21 01:32:02 +00:00
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0
2014-05-18 18:19:10 +00:00
db ($4 << 4) ; trainer's view range
2015-07-21 01:32:02 +00:00
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0
dw Route24BattleText1 ; TextBeforeBattle
dw Route24AfterBattleText1 ; TextAfterBattle
dw Route24EndBattleText1 ; TextEndBattle
dw Route24EndBattleText1 ; TextEndBattle
2014-05-18 18:19:10 +00:00
Route24TrainerHeader1:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_1
2014-05-18 18:19:10 +00:00
db ($1 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_1
dw Route24BattleText2 ; TextBeforeBattle
dw Route24AfterBattleText2 ; TextAfterBattle
dw Route24EndBattleText2 ; TextEndBattle
dw Route24EndBattleText2 ; TextEndBattle
2014-05-18 18:19:10 +00:00
Route24TrainerHeader2:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2
2014-05-18 18:19:10 +00:00
db ($1 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2
dw Route24BattleText3 ; TextBeforeBattle
dw Route24AfterBattleText3 ; TextAfterBattle
dw Route24EndBattleText3 ; TextEndBattle
dw Route24EndBattleText3 ; TextEndBattle
2014-05-18 18:19:10 +00:00
Route24TrainerHeader3:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3
2014-05-18 18:19:10 +00:00
db ($1 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3
dw Route24BattleText4 ; TextBeforeBattle
dw Route24AfterBattleText4 ; TextAfterBattle
dw Route24EndBattleText4 ; TextEndBattle
dw Route24EndBattleText4 ; TextEndBattle
2014-05-18 18:19:10 +00:00
Route24TrainerHeader4:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4
2014-05-18 18:19:10 +00:00
db ($1 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4
dw Route24BattleText5 ; TextBeforeBattle
dw Route24AfterBattleText5 ; TextAfterBattle
dw Route24EndBattleText5 ; TextEndBattle
dw Route24EndBattleText5 ; TextEndBattle
2014-05-18 18:19:10 +00:00
Route24TrainerHeader5:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5
2014-05-18 18:19:10 +00:00
db ($1 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5
dw Route24BattleText6 ; TextBeforeBattle
dw Route24AfterBattleText6 ; TextAfterBattle
dw Route24EndBattleText6 ; TextEndBattle
dw Route24EndBattleText6 ; TextEndBattle
2014-05-18 18:19:10 +00:00
db $ff
2016-06-12 00:24:04 +00:00
Route24Text1:
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 17:36:03 +00:00
ResetEvent EVENT_NUGGET_REWARD_AVAILABLE
CheckEvent EVENT_GOT_NUGGET
jr nz, .asm_514f9
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, .BagFull
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
2015-07-18 15:17:29 +00:00
ld 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
2014-05-25 17:51:53 +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 [wRoute24CurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.asm_514f9
2014-05-18 18:19:10 +00:00
ld hl, Route24Text_51530
call PrintText
jp TextScriptEnd
.BagFull
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:
TX_FAR _Route24Text_51510
2016-07-18 06:17:03 +00:00
TX_SFX_ITEM_1
TX_FAR _Route24Text_51515
2014-05-18 18:19:10 +00:00
db "@"
2016-06-12 00:24:04 +00:00
Route24Text_5151a:
TX_FAR _Route24Text_5151a
2016-07-18 06:17:03 +00:00
TX_SFX_ITEM_1
TX_BLINK
db "@"
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route24Text_51521:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24Text_51521
db "@"
2016-06-12 00:24:04 +00:00
Route24Text_51526:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24Text_51526
db "@"
2016-06-12 00:24:04 +00:00
Route24Text_5152b:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24Text_5152b
db "@"
2016-06-12 00:24:04 +00:00
Route24Text_51530:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24Text_51530
db "@"
2016-06-12 00:24:04 +00:00
Route24Text2:
2015-07-03 19:58:50 +00:00
TX_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:
2015-07-03 19:58:50 +00:00
TX_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:
2015-07-03 19:58:50 +00:00
TX_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:
2015-07-03 19:58:50 +00:00
TX_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:
2015-07-03 19:58:50 +00:00
TX_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:
2015-07-03 19:58:50 +00:00
TX_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:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText1
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText1:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText1
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText1:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText1
db "@"
2016-06-12 00:24:04 +00:00
Route24BattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText2
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText2
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText2:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText2
db "@"
2016-06-12 00:24:04 +00:00
Route24BattleText3:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText3
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText3:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText3
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText3:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText3
db "@"
2016-06-12 00:24:04 +00:00
Route24BattleText4:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText4
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText4:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText4
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText4:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText4
db "@"
2016-06-12 00:24:04 +00:00
Route24BattleText5:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText5
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText5:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText5
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText5:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText5
db "@"
2016-06-12 00:24:04 +00:00
Route24BattleText6:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24BattleText6
db "@"
2016-06-12 00:24:04 +00:00
Route24EndBattleText6:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24EndBattleText6
db "@"
2016-06-12 00:24:04 +00:00
Route24AfterBattleText6:
2014-05-18 18:19:10 +00:00
TX_FAR _Route24AfterBattleText6
db "@"