mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
Create BOARDEVENT_END_TURN as a transition between turns after landing on space (#25)
This commit is contained in:
parent
b9ac41feb6
commit
7448da8380
@ -328,4 +328,5 @@ DEF NUM_UNOWN_PUZZLES EQU const_value
|
||||
const_def 1
|
||||
const BOARDEVENT_DISPLAY_MENU ; 1
|
||||
const BOARDEVENT_HANDLE_BOARD ; 2
|
||||
const BOARDEVENT_END_TURN ; 3
|
||||
DEF NUM_BOARD_EVENTS EQU const_value - 1
|
||||
|
@ -2,20 +2,23 @@ BoardSpaceScripts:: ; used only for BANK(BoardSpaceScripts)
|
||||
|
||||
BlueSpaceScript::
|
||||
scall ArriveToRegularSpaceScript
|
||||
iftrue .done
|
||||
.done
|
||||
iftrue .not_landed
|
||||
scall LandedInRegularSpaceScript
|
||||
.not_landed
|
||||
end
|
||||
|
||||
RedSpaceScript::
|
||||
scall ArriveToRegularSpaceScript
|
||||
iftrue .done
|
||||
.done
|
||||
iftrue .not_landed
|
||||
scall LandedInRegularSpaceScript
|
||||
.not_landed
|
||||
end
|
||||
|
||||
GreySpaceScript::
|
||||
scall ArriveToRegularSpaceScript
|
||||
iftrue .done
|
||||
.done
|
||||
iftrue .not_landed
|
||||
scall LandedInRegularSpaceScript
|
||||
.not_landed
|
||||
end
|
||||
|
||||
ArriveToRegularSpaceScript:
|
||||
@ -33,3 +36,12 @@ ArriveToRegularSpace:
|
||||
ld hl, wDisplaySecondarySprites
|
||||
res SECONDARYSPRITES_SPACES_LEFT_F, [hl]
|
||||
ret
|
||||
|
||||
LandedInRegularSpaceScript:
|
||||
callasm LandedInRegularSpace
|
||||
end
|
||||
|
||||
LandedInRegularSpace:
|
||||
ld a, BOARDEVENT_END_TURN
|
||||
ldh [hCurBoardEvent], a
|
||||
ret
|
||||
|
@ -266,7 +266,7 @@ PlayerEvents:
|
||||
call CheckBoardEvent
|
||||
jr c, .ok
|
||||
|
||||
call CheckTrainerBattle_GetPlayerEvent
|
||||
call CheckTrainerEvent
|
||||
jr c, .ok
|
||||
|
||||
call CheckTileEvent
|
||||
@ -281,6 +281,18 @@ PlayerEvents:
|
||||
call CheckTimeEvents
|
||||
jr c, .ok
|
||||
|
||||
; BOARDEVENT_END_TURN is used as turn cleanup after BOARDEVENT_HANDLE_BOARD.
|
||||
; when we make it here, it means there's finally nothing else to do (e.g. a trainer),
|
||||
; so return with BOARDEVENT_DISPLAY_MENU for the next MapEvents iteration.
|
||||
ldh a, [hCurBoardEvent]
|
||||
cp BOARDEVENT_END_TURN
|
||||
jr nz, .continue
|
||||
ld a, BOARDEVENT_DISPLAY_MENU
|
||||
ldh [hCurBoardEvent], a
|
||||
xor a
|
||||
ret
|
||||
|
||||
.continue
|
||||
call OWPlayerInput
|
||||
jr c, .ok
|
||||
|
||||
@ -305,6 +317,7 @@ CheckBoardEvent:
|
||||
dw .none
|
||||
dw .menu ; BOARDEVENT_DISPLAY_MENU
|
||||
dw .board ; BOARDEVENT_HANDLE_BOARD
|
||||
dw .none ; BOARDEVENT_END_TURN
|
||||
assert_table_length NUM_BOARD_EVENTS + 1
|
||||
|
||||
.none
|
||||
@ -352,7 +365,7 @@ CheckBoardEvent:
|
||||
dw GreySpaceScript ; COLL_GREY_SPACE
|
||||
assert_table_length NUM_COLL_SPACES
|
||||
|
||||
CheckTrainerBattle_GetPlayerEvent:
|
||||
CheckTrainerEvent:
|
||||
call CheckTrainerBattle
|
||||
jr nc, .nope
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user