pokeyellow/scripts/CinnabarIsland.asm

88 lines
2.3 KiB
NASM
Raw Normal View History

CinnabarIsland_Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
2014-05-18 18:19:10 +00:00
set 5, [hl]
2015-07-21 17:36:03 +00:00
ResetEvent EVENT_MANSION_SWITCH_ON
ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL
ld hl, CinnabarIsland_ScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wCinnabarIslandCurScript]
2014-05-18 18:19:10 +00:00
jp CallFunctionInTable
CinnabarIsland_ScriptPointers:
def_script_pointers
dw_const CinnabarIslandDefaultScript, SCRIPT_CINNABARISLAND_DEFAULT
dw_const CinnabarIslandPlayerMovingScript, SCRIPT_CINNABARISLAND_PLAYER_MOVING
2014-05-18 18:19:10 +00:00
CinnabarIslandDefaultScript:
2014-05-18 18:19:10 +00:00
ld b, SECRET_KEY
call IsItemInBag
ret nz
2015-08-31 02:38:41 +00:00
ld a, [wYCoord]
cp 4
2014-05-18 18:19:10 +00:00
ret nz
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
cp 18
2014-05-18 18:19:10 +00:00
ret nz
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
ld a, TEXT_CINNABARISLAND_DOOR_IS_LOCKED
ldh [hTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
xor a
ldh [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
xor a
ld [wSpritePlayerStateData1FacingDirection], a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
ld a, SCRIPT_CINNABARISLAND_PLAYER_MOVING
2015-08-31 02:38:41 +00:00
ld [wCinnabarIslandCurScript], a
2014-05-18 18:19:10 +00:00
ret
CinnabarIslandPlayerMovingScript:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
call Delay3
ld a, SCRIPT_CINNABARISLAND_DEFAULT
2015-08-31 02:38:41 +00:00
ld [wCinnabarIslandCurScript], a
2014-05-18 18:19:10 +00:00
ret
CinnabarIsland_TextPointers:
def_text_pointers
dw_const CinnabarIslandGirlText, TEXT_CINNABARISLAND_GIRL
dw_const CinnabarIslandGamblerText, TEXT_CINNABARISLAND_GAMBLER
dw_const CinnabarIslandSignText, TEXT_CINNABARISLAND_SIGN
dw_const MartSignText, TEXT_CINNABARISLAND_MART_SIGN
dw_const PokeCenterSignText, TEXT_CINNABARISLAND_POKECENTER_SIGN
dw_const CinnabarIslandPokemonLabSignText, TEXT_CINNABARISLAND_POKEMONLAB_SIGN
dw_const CinnabarIslandGymSignText, TEXT_CINNABARISLAND_GYM_SIGN
dw_const CinnabarIslandDoorIsLockedText, TEXT_CINNABARISLAND_DOOR_IS_LOCKED
2014-05-18 18:19:10 +00:00
CinnabarIslandDoorIsLockedText:
text_far _CinnabarIslandDoorIsLockedText
text_end
2014-05-18 18:19:10 +00:00
CinnabarIslandGirlText:
text_far _CinnabarIslandGirlText
text_end
2014-05-18 18:19:10 +00:00
CinnabarIslandGamblerText:
text_far _CinnabarIslandGamblerText
text_end
2014-05-18 18:19:10 +00:00
CinnabarIslandSignText:
text_far _CinnabarIslandSignText
text_end
2014-05-18 18:19:10 +00:00
CinnabarIslandPokemonLabSignText:
text_far _CinnabarIslandPokemonLabSignText
text_end
2014-05-18 18:19:10 +00:00
CinnabarIslandGymSignText:
text_far _CinnabarIslandGymSignText
text_end