mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
54 lines
1014 B
NASM
Executable File
54 lines
1014 B
NASM
Executable File
BoardSpaceScripts:: ; used only for BANK(BoardSpaceScripts)
|
|
|
|
BlueSpaceScript::
|
|
scall ArriveToRegularSpaceScript
|
|
iftrue .not_landed
|
|
scall LandedInRegularSpaceScript
|
|
.not_landed
|
|
end
|
|
|
|
RedSpaceScript::
|
|
scall ArriveToRegularSpaceScript
|
|
iftrue .not_landed
|
|
scall LandedInRegularSpaceScript
|
|
.not_landed
|
|
end
|
|
|
|
GreySpaceScript::
|
|
scall ArriveToRegularSpaceScript
|
|
iftrue .not_landed
|
|
scall LandedInRegularSpaceScript
|
|
.not_landed
|
|
end
|
|
|
|
ArriveToRegularSpaceScript:
|
|
playsound SFX_PRESENT
|
|
callasm ArriveToRegularSpace
|
|
end
|
|
|
|
ArriveToRegularSpace:
|
|
; load new space
|
|
ld a, [wCurSpaceNextSpace]
|
|
ld [wCurSpace], a
|
|
call LoadCurSpaceData
|
|
; decrease wSpacesLeft and copy to hScriptVar
|
|
ld hl, wSpacesLeft
|
|
dec [hl]
|
|
ld a, [hl]
|
|
ld [hScriptVar], a
|
|
; if landed, clear spaces left sprites
|
|
and a
|
|
ret nz
|
|
ld hl, wDisplaySecondarySprites
|
|
res SECONDARYSPRITES_SPACES_LEFT_F, [hl]
|
|
ret
|
|
|
|
LandedInRegularSpaceScript:
|
|
callasm LandedInRegularSpace
|
|
end
|
|
|
|
LandedInRegularSpace:
|
|
ld a, BOARDEVENT_END_TURN
|
|
ldh [hCurBoardEvent], a
|
|
ret
|