pokecrystal-board/engine/events/catch_tutorial.asm

82 lines
1.1 KiB
NASM
Raw Normal View History

2018-06-24 07:09:41 -07:00
CatchTutorial::
2018-01-23 14:39:09 -08:00
ld a, [wBattleType]
dec a
ld c, a
ld hl, .dw
ld b, 0
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
2018-06-24 07:09:41 -07:00
.dw
dw .DudeTutorial
dw .DudeTutorial
dw .DudeTutorial
2018-06-24 07:09:41 -07:00
.DudeTutorial:
; Back up your name to your Mom's name.
2018-01-23 14:39:09 -08:00
ld hl, wPlayerName
ld de, wMomsName
ld bc, NAME_LENGTH
call CopyBytes
; Copy Dude's name to your name
ld hl, .Dude
2018-01-23 14:39:09 -08:00
ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
call .LoadDudeData
xor a
ldh [hJoyDown], a
ldh [hJoyPressed], a
2018-01-23 14:39:09 -08:00
ld a, [wOptions]
push af
2021-11-23 17:37:18 -08:00
and ~TEXT_DELAY_MASK
add TEXT_DELAY_MED
2018-01-23 14:39:09 -08:00
ld [wOptions], a
ld hl, .AutoInput
ld a, BANK(.AutoInput)
call StartAutoInput
2017-12-24 09:47:30 -08:00
callfar StartBattle
call StopAutoInput
pop af
2018-01-23 14:39:09 -08:00
ld [wOptions], a
ld hl, wMomsName
ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
ret
2018-06-24 07:09:41 -07:00
.LoadDudeData:
ld hl, wDudeNumItems
ld [hl], 1
inc hl
ld [hl], POTION
inc hl
ld [hl], 1
inc hl
ld [hl], -1
ld hl, wDudeNumKeyItems
ld [hl], 0
inc hl
ld [hl], -1
ld hl, wDudeNumBalls
ld a, 1
ld [hli], a
2018-06-24 07:09:41 -07:00
ld a, POKE_BALL
ld [hli], a
ld [hli], a
ld [hl], -1
ret
2018-06-24 07:09:41 -07:00
.Dude:
db "DUDE@"
2018-06-24 07:09:41 -07:00
.AutoInput:
db NO_INPUT, $ff ; end