2019-01-01 20:06:23 +00:00
|
|
|
Route22Gate_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
call EnableAutoTextBoxDrawing
|
2019-01-01 20:06:23 +00:00
|
|
|
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]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 4
|
2014-05-19 14:38:20 +00:00
|
|
|
ld a, ROUTE_23
|
2023-07-14 01:27:56 +00:00
|
|
|
jr c, .set_last_map
|
2014-05-19 14:38:20 +00:00
|
|
|
ld a, ROUTE_22
|
2023-07-14 01:27:56 +00:00
|
|
|
.set_last_map
|
2014-05-19 14:38:20 +00:00
|
|
|
ld [wLastMap], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
Route22Gate_ScriptPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateDefaultScript:
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, Route22GateScriptCoords
|
|
|
|
call ArePlayerCoordsInArray
|
|
|
|
ret nc
|
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2023-07-14 01:27:56 +00:00
|
|
|
ld a, TEXT_ROUTE22GATE_GUARD
|
2024-09-19 01:01:18 +00:00
|
|
|
ldh [hTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
jp DisplayTextID
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Route22GateScriptCoords:
|
2020-07-16 16:32:19 +00:00
|
|
|
dbmapcoord 4, 2
|
|
|
|
dbmapcoord 5, 2
|
|
|
|
db -1 ; end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateMovePlayerDownScript:
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $1
|
2014-09-10 03:55:19 +00:00
|
|
|
ld [wSimulatedJoypadStatesIndex], a
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_DOWN
|
2014-09-10 03:55:19 +00:00
|
|
|
ld [wSimulatedJoypadStatesEnd], a
|
2020-07-05 21:29:11 +00:00
|
|
|
ld [wSpritePlayerStateData1FacingDirection], a
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-09-10 03:55:19 +00:00
|
|
|
jp StartSimulatingJoypadStates
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GatePlayerMovingScript:
|
2014-09-10 03:55:19 +00:00
|
|
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
ld a, SCRIPT_ROUTE22GATE_DEFAULT
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wRoute22GateCurScript], a
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateNoopScript:
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
Route22Gate_TextPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_text_pointers
|
|
|
|
dw_const Route22GateGuardText, TEXT_ROUTE22GATE_GUARD
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateGuardText:
|
2020-07-04 21:09:35 +00:00
|
|
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .has_boulderbadge
|
|
|
|
ld hl, Route22GateGuardNoBoulderbadgeText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateGuardNoBoulderbadgeText:
|
|
|
|
text_far _Route22GateGuardNoBoulderbadgeText
|
2020-07-04 21:09:35 +00:00
|
|
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, Route22GateGuardICantLetYouPassText
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateGuardICantLetYouPassText:
|
|
|
|
text_far _Route22GateGuardICantLetYouPassText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Route22GateGuardGoRightAheadText:
|
|
|
|
text_far _Route22GateGuardGoRightAheadText
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_item_1
|
|
|
|
text_end
|