pokeyellow/scripts/VictoryRoad2F.asm

209 lines
6.3 KiB
NASM
Raw Permalink Normal View History

2020-05-21 00:40:33 +00:00
VictoryRoad2F_Script:
ld hl, wCurrentMapScriptFlags
bit BIT_CUR_MAP_LOADED_2, [hl]
res BIT_CUR_MAP_LOADED_2, [hl]
call nz, VictoryRoad2FResetBoulderEventScript
ld hl, wCurrentMapScriptFlags
bit BIT_CUR_MAP_LOADED_1, [hl]
res BIT_CUR_MAP_LOADED_1, [hl]
call nz, VictoryRoad2FCheckBoulderEventScript
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad2TrainerHeaders
2020-05-21 00:40:33 +00:00
ld de, VictoryRoad2F_ScriptPointers
ld a, [wVictoryRoad2FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
2020-05-21 00:40:33 +00:00
ld [wVictoryRoad2FCurScript], a
2014-05-18 18:19:10 +00:00
ret
VictoryRoad2FResetBoulderEventScript:
2015-07-21 17:36:03 +00:00
ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
; fallthrough
VictoryRoad2FCheckBoulderEventScript:
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
jr z, .not_on_switch
2014-05-18 18:19:10 +00:00
push af
ld a, $15
2015-08-05 21:20:29 +00:00
lb bc, 4, 3
call VictoryRoad2FReplaceTileBlockScript
2014-05-18 18:19:10 +00:00
pop af
.not_on_switch
CheckEventReuseA EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2
2014-05-18 18:19:10 +00:00
ret z
ld a, $1d
2015-08-05 21:20:29 +00:00
lb bc, 7, 11
VictoryRoad2FReplaceTileBlockScript:
2015-07-24 21:39:45 +00:00
ld [wNewTileBlockID], a
2014-09-14 18:29:18 +00:00
predef ReplaceTileBlock
2014-05-18 18:19:10 +00:00
ret
2020-05-21 00:40:33 +00:00
VictoryRoad2F_ScriptPointers:
def_script_pointers
dw_const VictoryRoad2FDefaultScript, SCRIPT_VICTORYROAD2F_DEFAULT
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_VICTORYROAD2F_START_BATTLE
dw_const EndTrainerBattle, SCRIPT_VICTORYROAD2F_END_BATTLE
2014-05-18 18:19:10 +00:00
VictoryRoad2FDefaultScript:
ld hl, .SwitchCoords
2014-05-18 18:19:10 +00:00
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
ldh a, [hSpriteIndex]
2016-06-03 04:01:37 +00:00
cp $f
jp z, CheckFightingMapTrainers
2015-07-21 17:36:03 +00:00
EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
2015-07-19 03:49:52 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
cp $2
jr z, .second_switch
2015-07-21 17:36:03 +00:00
CheckEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
2014-05-18 18:19:10 +00:00
ret nz
jr .set_script_flag
.second_switch
2015-07-21 17:36:03 +00:00
CheckEventAfterBranchReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2
2014-05-18 18:19:10 +00:00
ret nz
.set_script_flag
ld hl, wCurrentMapScriptFlags
set BIT_CUR_MAP_LOADED_1, [hl]
2014-05-18 18:19:10 +00:00
ret
.SwitchCoords:
2020-11-04 06:06:44 +00:00
dbmapcoord 1, 16
dbmapcoord 9, 16
db -1 ; end
2014-05-18 18:19:10 +00:00
2020-05-21 00:40:33 +00:00
VictoryRoad2F_TextPointers:
def_text_pointers
dw_const VictoryRoad2FHikerText, TEXT_VICTORYROAD2F_HIKER
dw_const VictoryRoad2FSuperNerd1Text, TEXT_VICTORYROAD2F_SUPER_NERD1
dw_const VictoryRoad2FCooltrainerMText, TEXT_VICTORYROAD2F_COOLTRAINER_M
dw_const VictoryRoad2FSuperNerd2Text, TEXT_VICTORYROAD2F_SUPER_NERD2
dw_const VictoryRoad2FSuperNerd3Text, TEXT_VICTORYROAD2F_SUPER_NERD3
dw_const VictoryRoad2FMoltresText, TEXT_VICTORYROAD2F_MOLTRES
dw_const PickUpItemText, TEXT_VICTORYROAD2F_TM_SUBMISSION
dw_const PickUpItemText, TEXT_VICTORYROAD2F_FULL_HEAL
dw_const PickUpItemText, TEXT_VICTORYROAD2F_TM_MEGA_KICK
dw_const PickUpItemText, TEXT_VICTORYROAD2F_GUARD_SPEC
dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER1
dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER2
dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER3
2014-05-18 18:19:10 +00:00
VictoryRoad2TrainerHeaders:
def_trainers
VictoryRoad2TrainerHeader0:
trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0, 4, VictoryRoad2FHikerBattleText, VictoryRoad2FHikerEndBattleText, VictoryRoad2FHikerAfterBattleText
2020-05-21 00:40:33 +00:00
VictoryRoad2TrainerHeader1:
trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1, 3, VictoryRoad2FSuperNerd1BattleText, VictoryRoad2FSuperNerd1EndBattleText, VictoryRoad2FSuperNerd1AfterBattleText
2020-05-21 00:40:33 +00:00
VictoryRoad2TrainerHeader2:
trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2, 3, VictoryRoad2FCooltrainerMBattleText, VictoryRoad2FCooltrainerMEndBattleText, VictoryRoad2FCooltrainerMAfterBattleText
2020-05-21 00:40:33 +00:00
VictoryRoad2TrainerHeader3:
trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3, 1, VictoryRoad2FSuperNerd2BattleText, VictoryRoad2FSuperNerd2EndBattleText, VictoryRoad2FSuperNerd2AfterBattleText
2020-05-21 00:40:33 +00:00
VictoryRoad2TrainerHeader4:
trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4, 3, VictoryRoad2FSuperNerd3BattleText, VictoryRoad2FSuperNerd3EndBattleText, VictoryRoad2FSuperNerd3AfterBattleText
MoltresTrainerHeader:
trainer EVENT_BEAT_MOLTRES, 0, VictoryRoad2FMoltresBattleText, VictoryRoad2FMoltresBattleText, VictoryRoad2FMoltresBattleText
2020-11-04 06:06:44 +00:00
db -1 ; end
2014-05-18 18:19:10 +00:00
VictoryRoad2FHikerText:
2020-11-04 06:06:44 +00:00
text_asm
2014-05-18 18:19:10 +00:00
ld hl, VictoryRoad2TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FSuperNerd1Text:
2020-11-04 06:06:44 +00:00
text_asm
2020-05-21 00:40:33 +00:00
ld hl, VictoryRoad2TrainerHeader1
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FCooltrainerMText:
2020-11-04 06:06:44 +00:00
text_asm
2020-05-21 00:40:33 +00:00
ld hl, VictoryRoad2TrainerHeader2
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FSuperNerd2Text:
2020-11-04 06:06:44 +00:00
text_asm
2020-05-21 00:40:33 +00:00
ld hl, VictoryRoad2TrainerHeader3
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FSuperNerd3Text:
2020-11-04 06:06:44 +00:00
text_asm
2020-05-21 00:40:33 +00:00
ld hl, VictoryRoad2TrainerHeader4
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FMoltresText:
2020-11-04 06:06:44 +00:00
text_asm
ld hl, MoltresTrainerHeader
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
VictoryRoad2FMoltresBattleText:
text_far _VictoryRoad2FMoltresBattleText
2020-11-04 06:06:44 +00:00
text_asm
2014-05-18 18:19:10 +00:00
ld a, MOLTRES
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd
VictoryRoad2FHikerBattleText:
text_far _VictoryRoad2FHikerBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FHikerEndBattleText:
text_far _VictoryRoad2FHikerEndBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FHikerAfterBattleText:
text_far _VictoryRoad2FHikerAfterBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd1BattleText:
text_far _VictoryRoad2FSuperNerd1BattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd1EndBattleText:
text_far _VictoryRoad2FSuperNerd1EndBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd1AfterBattleText:
text_far _VictoryRoad2FSuperNerd1AfterBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FCooltrainerMBattleText:
text_far _VictoryRoad2FCooltrainerMBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FCooltrainerMEndBattleText:
text_far _VictoryRoad2FCooltrainerMEndBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FCooltrainerMAfterBattleText:
text_far _VictoryRoad2FCooltrainerMAfterBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd2BattleText:
text_far _VictoryRoad2FSuperNerd2BattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd2EndBattleText:
text_far _VictoryRoad2FSuperNerd2EndBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd2AfterBattleText:
text_far _VictoryRoad2FSuperNerd2AfterBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd3BattleText:
text_far _VictoryRoad2FSuperNerd3BattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd3EndBattleText:
text_far _VictoryRoad2FSuperNerd3EndBattleText
2020-11-04 06:06:44 +00:00
text_end
2014-05-18 18:19:10 +00:00
VictoryRoad2FSuperNerd3AfterBattleText:
text_far _VictoryRoad2FSuperNerd3AfterBattleText
2020-11-04 06:06:44 +00:00
text_end