summaryrefslogtreecommitdiff
path: root/event/catch_tutorial.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-12-23 13:17:46 -0500
committerGitHub <noreply@github.com>2017-12-23 13:17:46 -0500
commit878092004956418bfd77bfdb9fc9dd7f640f80d2 (patch)
tree3a97e3eb15d5c545977038e67589f92158e5bf23 /event/catch_tutorial.asm
parenta6656a986bf9dde51561cab090648e0117b173ad (diff)
parent3c37bfc6fa2570a0a77c1230673910257ecf32df (diff)
Merge pull request #419 from roukaour/master
More reorganization and documentation
Diffstat (limited to 'event/catch_tutorial.asm')
-rw-r--r--event/catch_tutorial.asm81
1 files changed, 81 insertions, 0 deletions
diff --git a/event/catch_tutorial.asm b/event/catch_tutorial.asm
new file mode 100644
index 000000000..8340d8c13
--- /dev/null
+++ b/event/catch_tutorial.asm
@@ -0,0 +1,81 @@
+CatchTutorial:: ; 4e554
+ ld a, [BattleType]
+ 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
+
+.dw ; 4e564 (13:6564)
+ dw .DudeTutorial
+ dw .DudeTutorial
+ dw .DudeTutorial
+
+.DudeTutorial: ; 4e56a (13:656a)
+; Back up your name to your Mom's name.
+ ld hl, PlayerName
+ ld de, MomsName
+ ld bc, NAME_LENGTH
+ call CopyBytes
+; Copy Dude's name to your name
+ ld hl, .Dude
+ ld de, PlayerName
+ ld bc, NAME_LENGTH
+ call CopyBytes
+
+ call .LoadDudeData
+
+ xor a
+ ld [hJoyDown], a
+ ld [hJoyPressed], a
+ ld a, [Options]
+ push af
+ and $f8
+ add $3
+ ld [Options], a
+ ld hl, .AutoInput
+ ld a, BANK(.AutoInput)
+ call StartAutoInput
+ callab StartBattle
+ call StopAutoInput
+ pop af
+
+ ld [Options], a
+ ld hl, MomsName
+ ld de, PlayerName
+ ld bc, NAME_LENGTH
+ call CopyBytes
+ ret
+
+.LoadDudeData: ; 4e5b7 (13:65b7)
+ 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
+ ld a, POKE_BALL ; 5
+ ld [hli], a
+ ld [hli], a
+ ld [hl], -1
+ ret
+
+.Dude: ; 4e5da
+ db "DUDE@"
+
+.AutoInput: ; 4e5df
+ db NO_INPUT, $ff ; end