pokered/scripts/FuchsiaGym.asm

292 lines
7.3 KiB
NASM
Raw Permalink Normal View History

FuchsiaGym_Script:
2020-07-18 18:01:13 +00:00
call .LoadNames
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, FuchsiaGymTrainerHeaders
ld de, FuchsiaGym_ScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wFuchsiaGymCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
2015-08-31 02:38:41 +00:00
ld [wFuchsiaGymCurScript], a
2014-05-18 18:19:10 +00:00
ret
2020-07-18 18:01:13 +00:00
.LoadNames:
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
bit BIT_CUR_MAP_LOADED_2, [hl]
res BIT_CUR_MAP_LOADED_2, [hl]
2014-05-18 18:19:10 +00:00
ret z
2020-07-18 18:01:13 +00:00
ld hl, .CityName
ld de, .LeaderName
2014-05-18 18:19:10 +00:00
call LoadGymLeaderAndCityName
ret
2020-07-18 18:01:13 +00:00
.CityName:
2014-05-18 18:19:10 +00:00
db "FUCHSIA CITY@"
2020-07-18 18:01:13 +00:00
.LeaderName:
2014-05-18 18:19:10 +00:00
db "KOGA@"
FuchsiaGymResetScripts:
xor a ; SCRIPT_FUCHSIAGYM_DEFAULT
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld [wFuchsiaGymCurScript], a
ld [wCurMapScript], a
2014-05-18 18:19:10 +00:00
ret
FuchsiaGym_ScriptPointers:
def_script_pointers
dw_const CheckFightingMapTrainers, SCRIPT_FUCHSIAGYM_DEFAULT
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_FUCHSIAGYM_START_BATTLE
dw_const EndTrainerBattle, SCRIPT_FUCHSIAGYM_END_BATTLE
dw_const FuchsiaGymKogaPostBattleScript, SCRIPT_FUCHSIAGYM_KOGA_POST_BATTLE
2014-05-18 18:19:10 +00:00
FuchsiaGymKogaPostBattleScript:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, FuchsiaGymResetScripts
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
; fallthrough
FuchsiaGymReceiveTM06:
ld a, TEXT_FUCHSIAGYM_KOGA_SOUL_BADGE_INFO
ldh [hTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2015-07-21 02:41:23 +00:00
SetEvent EVENT_BEAT_KOGA
2020-07-06 02:52:27 +00:00
lb bc, TM_TOXIC, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .BagFull
ld a, TEXT_FUCHSIAGYM_KOGA_RECEIVED_TM06
ldh [hTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
2015-07-21 02:41:23 +00:00
SetEvent EVENT_GOT_TM06
2019-10-07 05:23:57 +00:00
jr .gymVictory
2014-05-18 18:19:10 +00:00
.BagFull
ld a, TEXT_FUCHSIAGYM_KOGA_TM06_NO_ROOM
ldh [hTextID], 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
set BIT_SOULBADGE, [hl]
2015-07-26 02:26:54 +00:00
ld hl, wBeatGymFlags
set BIT_SOULBADGE, [hl]
2014-05-18 18:19:10 +00:00
; deactivate gym trainers
SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
2014-05-18 18:19:10 +00:00
jp FuchsiaGymResetScripts
2014-05-18 18:19:10 +00:00
FuchsiaGym_TextPointers:
def_text_pointers
dw_const FuchsiaGymKogaText, TEXT_FUCHSIAGYM_KOGA
dw_const FuchsiaGymRocker1Text, TEXT_FUCHSIAGYM_ROCKER1
dw_const FuchsiaGymRocker2Text, TEXT_FUCHSIAGYM_ROCKER2
dw_const FuchsiaGymRocker3Text, TEXT_FUCHSIAGYM_ROCKER3
dw_const FuchsiaGymRocker4Text, TEXT_FUCHSIAGYM_ROCKER4
dw_const FuchsiaGymRocker5Text, TEXT_FUCHSIAGYM_ROCKER5
dw_const FuchsiaGymRocker6Text, TEXT_FUCHSIAGYM_ROCKER6
dw_const FuchsiaGymGymGuideText, TEXT_FUCHSIAGYM_GYM_GUIDE
dw_const FuchsiaGymKogaSoulBadgeInfoText, TEXT_FUCHSIAGYM_KOGA_SOUL_BADGE_INFO
dw_const FuchsiaGymKogaReceivedTM06Text, TEXT_FUCHSIAGYM_KOGA_RECEIVED_TM06
dw_const FuchsiaGymKogaTM06NoRoomText, TEXT_FUCHSIAGYM_KOGA_TM06_NO_ROOM
2014-05-18 18:19:10 +00:00
FuchsiaGymTrainerHeaders:
def_trainers 2
2016-06-12 00:24:04 +00:00
FuchsiaGymTrainerHeader0:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, 2, FuchsiaGymRocker1BattleText, FuchsiaGymRocker1EndBattleText, FuchsiaGymRocker1AfterBattleText
FuchsiaGymTrainerHeader1:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_1, 2, FuchsiaGymRocker2BattleText, FuchsiaGymRocker2EndBattleText, FuchsiaGymRocker2AfterBattleText
FuchsiaGymTrainerHeader2:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_2, 4, FuchsiaGymRocker3BattleText, FuchsiaGymRocker3EndBattleText, FuchsiaGymRocker3AfterBattleText
FuchsiaGymTrainerHeader3:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_3, 2, FuchsiaGymRocker4BattleText, FuchsiaGymRocker4EndBattleText, FuchsiaGymRocker4AfterBattleText
FuchsiaGymTrainerHeader4:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_4, 2, FuchsiaGymRocker5BattleText, FuchsiaGymRocker5EndBattleText, FuchsiaGymRocker5AfterBattleText
FuchsiaGymTrainerHeader5:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_5, 2, FuchsiaGymRocker6BattleText, FuchsiaGymRocker6EndBattleText, FuchsiaGymRocker6AfterBattleText
db -1 ; end
2014-05-18 18:19:10 +00:00
FuchsiaGymKogaText:
text_asm
2015-07-21 02:41:23 +00:00
CheckEvent EVENT_BEAT_KOGA
jr z, .beforeBeat
2015-07-21 02:41:23 +00:00
CheckEventReuseA EVENT_GOT_TM06
jr nz, .afterBeat
call z, FuchsiaGymReceiveTM06
2014-05-18 18:19:10 +00:00
call DisableWaitingAfterTextDisplay
2019-10-07 05:23:57 +00:00
jr .done
.afterBeat
ld hl, .PostBattleAdviceText
2014-05-18 18:19:10 +00:00
call PrintText
2019-10-07 05:23:57 +00:00
jr .done
.beforeBeat
ld hl, .BeforeBattleText
2014-05-18 18:19:10 +00:00
call PrintText
ld hl, wStatusFlags3
set BIT_TALKED_TO_TRAINER, [hl]
set BIT_PRINT_END_BATTLE_TEXT, [hl]
ld hl, .ReceivedSoulBadgeText
ld de, .ReceivedSoulBadgeText
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
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, $5
2015-08-31 02:38:41 +00:00
ld [wGymLeaderNo], a
2014-05-18 18:19:10 +00:00
xor a
ldh [hJoyHeld], a
ld a, SCRIPT_FUCHSIAGYM_KOGA_POST_BATTLE
2015-08-31 02:38:41 +00:00
ld [wFuchsiaGymCurScript], a
2019-10-07 05:23:57 +00:00
.done
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.BeforeBattleText:
text_far _FuchsiaGymKogaBeforeBattleText
text_end
2014-05-18 18:19:10 +00:00
.ReceivedSoulBadgeText:
text_far _FuchsiaGymKogaReceivedSoulBadgeText
text_end
2014-05-18 18:19:10 +00:00
.PostBattleAdviceText:
text_far _FuchsiaGymKogaPostBattleAdviceText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymKogaSoulBadgeInfoText:
text_far _FuchsiaGymKogaSoulBadgeInfoText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymKogaReceivedTM06Text:
text_far _FuchsiaGymKogaReceivedTM06Text
sound_get_key_item
text_far _FuchsiaGymKogaTM06ExplanationText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymKogaTM06NoRoomText:
text_far _FuchsiaGymKogaTM06NoRoomText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker1Text:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, FuchsiaGymTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker1BattleText:
text_far _FuchsiaGymRocker1BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker1EndBattleText:
text_far _FuchsiaGymRocker1EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker1AfterBattleText:
text_far _FuchsiaGymRocker1AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker2Text:
text_asm
ld hl, FuchsiaGymTrainerHeader1
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker2BattleText:
text_far _FuchsiaGymRocker2BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker2EndBattleText:
text_far _FuchsiaGymRocker2EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker2AfterBattleText:
text_far _FuchsiaGymRocker2AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker3Text:
text_asm
ld hl, FuchsiaGymTrainerHeader2
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker3BattleText:
text_far _FuchsiaGymRocker3BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker3EndBattleText:
text_far _FuchsiaGymRocker3EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker3AfterBattleText:
text_far _FuchsiaGymRocker3AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker4Text:
text_asm
ld hl, FuchsiaGymTrainerHeader3
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker4BattleText:
text_far _FuchsiaGymRocker4BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker4EndBattleText:
text_far _FuchsiaGymRocker4EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker4AfterBattleText:
text_far _FuchsiaGymRocker4AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker5Text:
text_asm
ld hl, FuchsiaGymTrainerHeader4
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker5BattleText:
text_far _FuchsiaGymRocker5BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker5EndBattleText:
text_far _FuchsiaGymRocker5EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker5AfterBattleText:
text_far _FuchsiaGymRocker5AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker6Text:
text_asm
ld hl, FuchsiaGymTrainerHeader5
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
FuchsiaGymRocker6BattleText:
text_far _FuchsiaGymRocker6BattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker6EndBattleText:
text_far _FuchsiaGymRocker6EndBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymRocker6AfterBattleText:
text_far _FuchsiaGymRocker6AfterBattleText
text_end
2014-05-18 18:19:10 +00:00
FuchsiaGymGymGuideText:
text_asm
2015-07-21 02:41:23 +00:00
CheckEvent EVENT_BEAT_KOGA
ld hl, .BeatKogaText
jr nz, .afterBeat
ld hl, .ChampInMakingText
.afterBeat
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
.ChampInMakingText:
text_far _FuchsiaGymGymGuideChampInMakingText
text_end
2014-05-18 18:19:10 +00:00
.BeatKogaText:
text_far _FuchsiaGymGymGuideBeatKogaText
text_end