pokered/scripts/Route22Gate.asm

96 lines
2.1 KiB
NASM
Raw Normal View History

Route22Gate_Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, Route22Gate_ScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wRoute22GateCurScript]
2014-05-18 18:19:10 +00:00
call CallFunctionInTable
2015-08-31 02:38:41 +00:00
ld a, [wYCoord]
cp 4
ld a, ROUTE_23
jr c, .set_last_map
ld a, ROUTE_22
.set_last_map
ld [wLastMap], a
2014-05-18 18:19:10 +00:00
ret
Route22Gate_ScriptPointers:
def_script_pointers
dw_const Route22GateDefaultScript, SCRIPT_ROUTE22GATE_DEFAULT
dw_const Route22GatePlayerMovingScript, SCRIPT_ROUTE22GATE_PLAYER_MOVING
dw_const Route22GateNoopScript, SCRIPT_ROUTE22GATE_NOOP
2014-05-18 18:19:10 +00:00
Route22GateDefaultScript:
2014-05-18 18:19:10 +00:00
ld hl, Route22GateScriptCoords
call ArePlayerCoordsInArray
ret nc
xor a
ldh [hJoyHeld], a
ld a, TEXT_ROUTE22GATE_GUARD
ldh [hTextID], a
2014-05-18 18:19:10 +00:00
jp DisplayTextID
2016-06-12 00:24:04 +00:00
Route22GateScriptCoords:
dbmapcoord 4, 2
dbmapcoord 5, 2
db -1 ; end
2014-05-18 18:19:10 +00:00
Route22GateMovePlayerDownScript:
2014-05-18 18:19:10 +00:00
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
ld [wSpritePlayerStateData1FacingDirection], a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
jp StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
Route22GatePlayerMovingScript:
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
2014-05-18 18:19:10 +00:00
call Delay3
ld a, SCRIPT_ROUTE22GATE_DEFAULT
2015-08-31 02:38:41 +00:00
ld [wRoute22GateCurScript], a
Route22GateNoopScript:
2014-05-18 18:19:10 +00:00
ret
Route22Gate_TextPointers:
def_text_pointers
dw_const Route22GateGuardText, TEXT_ROUTE22GATE_GUARD
2014-05-18 18:19:10 +00:00
Route22GateGuardText:
text_asm
2015-08-31 02:38:41 +00:00
ld a, [wObtainedBadges]
2020-11-06 15:33:58 +00:00
bit BIT_BOULDERBADGE, a
jr nz, .has_boulderbadge
ld hl, Route22GateGuardNoBoulderbadgeText
2014-05-18 18:19:10 +00:00
call PrintText
call Route22GateMovePlayerDownScript
ld a, SCRIPT_ROUTE22GATE_PLAYER_MOVING
jr .set_current_script
.has_boulderbadge
ld hl, Route22GateGuardGoRightAheadText
2014-05-18 18:19:10 +00:00
call PrintText
ld a, SCRIPT_ROUTE22GATE_NOOP
.set_current_script
2015-08-31 02:38:41 +00:00
ld [wRoute22GateCurScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
Route22GateGuardNoBoulderbadgeText:
text_far _Route22GateGuardNoBoulderbadgeText
text_asm
2015-07-19 08:46:12 +00:00
ld a, SFX_DENIED
2014-05-18 18:19:10 +00:00
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
ld hl, Route22GateGuardICantLetYouPassText
2014-05-18 18:19:10 +00:00
ret
Route22GateGuardICantLetYouPassText:
text_far _Route22GateGuardICantLetYouPassText
text_end
2014-05-18 18:19:10 +00:00
Route22GateGuardGoRightAheadText:
text_far _Route22GateGuardGoRightAheadText
sound_get_item_1
text_end