pokered/scripts/route16gate.asm

122 lines
2 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
Route16GateScript:
ld hl, wd732
2014-05-18 18:19:10 +00:00
res 5, [hl]
call EnableAutoTextBoxDrawing
2015-08-31 02:38:41 +00:00
ld a, [wRoute16GateCurScript]
2014-05-18 18:19:10 +00:00
ld hl, Route16GateScriptPointers
jp CallFunctionInTable
2016-06-12 00:24:04 +00:00
Route16GateScriptPointers:
2014-05-18 18:19:10 +00:00
dw Route16GateScript0
dw Route16GateScript1
dw Route16GateScript2
dw Route16GateScript3
2016-06-12 00:24:04 +00:00
Route16GateScript0:
call Route16GateScript_49755
2014-05-18 18:19:10 +00:00
ret nz
ld hl, CoordsData_49714
call ArePlayerCoordsInArray
ret nc
ld a, $3
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
xor a
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
2015-07-18 15:17:29 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
cp $1
jr z, .asm_4970e
2015-07-18 15:17:29 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
dec a
ld [wSimulatedJoypadStatesIndex], a
2014-05-18 18:19:10 +00:00
ld b, $0
ld c, a
ld a, D_UP
ld hl, wSimulatedJoypadStatesEnd
2014-05-18 18:19:10 +00:00
call FillMemory
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $1
2015-08-31 02:38:41 +00:00
ld [wRoute16GateCurScript], a
2014-05-18 18:19:10 +00:00
ret
.asm_4970e
ld a, $2
2015-08-31 02:38:41 +00:00
ld [wRoute16GateCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
CoordsData_49714:
2014-05-18 18:19:10 +00:00
db $07,$04
db $08,$04
db $09,$04
db $0A,$04
db $FF
2016-06-12 00:24:04 +00:00
Route16GateScript1:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Route16GateScript2:
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, D_RIGHT
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wRoute16GateCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
Route16GateScript3:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
ld hl, wd730
2014-05-18 18:19:10 +00:00
res 7, [hl]
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wRoute16GateCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
Route16GateScript_49755:
2014-05-18 18:19:10 +00:00
ld b, BICYCLE
jp IsItemInBag
2016-06-12 00:24:04 +00:00
Route16GateTextPointers:
2014-05-18 18:19:10 +00:00
dw Route16GateText1
dw Route16GateText2
dw Route16GateText3
2016-06-12 00:24:04 +00:00
Route16GateText1:
2015-07-03 19:58:50 +00:00
TX_ASM
call Route16GateScript_49755
jr z, .asm_0bdf3
2014-05-18 18:19:10 +00:00
ld hl, Route16GateText_4977c
call PrintText
jr .asm_56c9d
.asm_0bdf3
2014-05-18 18:19:10 +00:00
ld hl, Route16GateText_49777
call PrintText
.asm_56c9d
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Route16GateText_49777:
2014-05-18 18:19:10 +00:00
TX_FAR _Route16GateText_49777
db "@"
2016-06-12 00:24:04 +00:00
Route16GateText_4977c:
2014-05-18 18:19:10 +00:00
TX_FAR _Route16GateText_4977c
db "@"
2016-06-12 00:24:04 +00:00
Route16GateText3:
2014-05-18 18:19:10 +00:00
TX_FAR _Route16GateText_49781
db "@"
2016-06-12 00:24:04 +00:00
Route16GateText2:
2014-05-18 18:19:10 +00:00
TX_FAR _Route16GateText2
db "@"