summaryrefslogtreecommitdiff
path: root/scripts/Route22Gate.asm
diff options
context:
space:
mode:
authorDaniel Harding <33dannye@gmail.com>2019-01-13 22:38:16 -0600
committerGitHub <noreply@github.com>2019-01-13 22:38:16 -0600
commit725b86ebbec23bd1f53fd60bf0201c904fee951d (patch)
treea37f4d33c5b77635c7ff72b91a73fcd90c4af915 /scripts/Route22Gate.asm
parent108245cb21abb3abac051b7db84ed6c694192a61 (diff)
parentc7796024590fec48ac79756793c1a6e3b54daf8f (diff)
Merge pull request #196 from Rangi42/polishedmaps
Rename map files, labels, and constants to be consistent and work with Polished Map
Diffstat (limited to 'scripts/Route22Gate.asm')
-rwxr-xr-xscripts/Route22Gate.asm93
1 files changed, 93 insertions, 0 deletions
diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm
new file mode 100755
index 00000000..86b1220d
--- /dev/null
+++ b/scripts/Route22Gate.asm
@@ -0,0 +1,93 @@
+Route22Gate_Script:
+ call EnableAutoTextBoxDrawing
+ ld hl, Route22Gate_ScriptPointers
+ ld a, [wRoute22GateCurScript]
+ call CallFunctionInTable
+ ld a, [wYCoord]
+ cp $4
+ ld a, ROUTE_23
+ jr c, .asm_1e69a
+ ld a, ROUTE_22
+.asm_1e69a
+ ld [wLastMap], a
+ ret
+
+Route22Gate_ScriptPointers:
+ dw Route22GateScript0
+ dw Route22GateScript1
+ dw Route22GateScript2
+
+Route22GateScript0:
+ ld hl, Route22GateScriptCoords
+ call ArePlayerCoordsInArray
+ ret nc
+ xor a
+ ld [hJoyHeld], a
+ ld a, $1
+ ld [hSpriteIndexOrTextID], a
+ jp DisplayTextID
+
+Route22GateScriptCoords:
+ db 2,4
+ db 2,5
+ db $ff
+
+Route22GateScript_1e6ba:
+ ld a, $1
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_DOWN
+ ld [wSimulatedJoypadStatesEnd], a
+ ld [wSpriteStateData1 + 9], a
+ ld [wJoyIgnore], a
+ jp StartSimulatingJoypadStates
+
+Route22GateScript1:
+ ld a, [wSimulatedJoypadStatesIndex]
+ and a
+ ret nz
+ xor a
+ ld [wJoyIgnore], a
+ call Delay3
+ ld a, $0
+ ld [wRoute22GateCurScript], a
+Route22GateScript2:
+ ret
+
+Route22Gate_TextPointers:
+ dw Route22GateText1
+
+Route22GateText1:
+ TX_ASM
+ ld a, [wObtainedBadges]
+ bit 0, a
+ jr nz, .asm_1e6f6
+ ld hl, Route22GateText_1e704
+ call PrintText
+ call Route22GateScript_1e6ba
+ ld a, $1
+ jr .asm_1e6fe
+.asm_1e6f6
+ ld hl, Route22GateText_1e71a
+ call PrintText
+ ld a, $2
+.asm_1e6fe
+ ld [wRoute22GateCurScript], a
+ jp TextScriptEnd
+
+Route22GateText_1e704:
+ TX_FAR _Route22GateText_1e704
+ TX_ASM
+ ld a, SFX_DENIED
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
+ ld hl, Route22GateText_1e715
+ ret
+
+Route22GateText_1e715:
+ TX_FAR _Route22GateText_1e715
+ db "@"
+
+Route22GateText_1e71a:
+ TX_FAR _Route22GateText_1e71a
+ TX_SFX_ITEM_1
+ db "@"