mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 06:38:40 +13:00
Merge branch 'master' of https://github.com/pret/pokered
This commit is contained in:
commit
e8dd755e18
3702 changed files with 163333 additions and 159040 deletions
81
engine/events/hidden_objects/safari_game.asm
Normal file
81
engine/events/hidden_objects/safari_game.asm
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
SafariZoneCheck::
|
||||
CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone,
|
||||
jr z, SafariZoneGameStillGoing ; don't bother printing game over text
|
||||
ld a, [wNumSafariBalls]
|
||||
and a
|
||||
jr z, SafariZoneGameOver
|
||||
jr SafariZoneGameStillGoing
|
||||
|
||||
SafariZoneCheckSteps::
|
||||
IF DEF(_DEBUG)
|
||||
call DebugPressedOrHeldB
|
||||
ret nz
|
||||
ENDC
|
||||
ld a, [wSafariSteps]
|
||||
ld b, a
|
||||
ld a, [wSafariSteps + 1]
|
||||
ld c, a
|
||||
or b
|
||||
jr z, SafariZoneGameOver
|
||||
dec bc
|
||||
ld a, b
|
||||
ld [wSafariSteps], a
|
||||
ld a, c
|
||||
ld [wSafariSteps + 1], a
|
||||
SafariZoneGameStillGoing:
|
||||
xor a
|
||||
ld [wSafariZoneGameOver], a
|
||||
ret
|
||||
|
||||
SafariZoneGameOver:
|
||||
call EnableAutoTextBoxDrawing
|
||||
xor a
|
||||
ld [wAudioFadeOutControl], a
|
||||
dec a ; SFX_STOP_ALL_MUSIC
|
||||
call PlaySound
|
||||
ld c, 0 ; BANK(SFX_Safari_Zone_PA)
|
||||
ld a, SFX_SAFARI_ZONE_PA
|
||||
call PlaySound
|
||||
call WaitForSoundToFinish
|
||||
|
||||
ld a, TEXT_SAFARI_GAME_OVER
|
||||
ldh [hSpriteIndexOrTextID], a
|
||||
call DisplayTextID
|
||||
xor a
|
||||
ld [wPlayerMovingDirection], a
|
||||
ld a, SAFARI_ZONE_GATE
|
||||
ldh [hWarpDestinationMap], a
|
||||
ld a, $3
|
||||
ld [wDestinationWarpID], a
|
||||
ld a, $5
|
||||
ld [wSafariZoneGateCurScript], a
|
||||
SetEvent EVENT_SAFARI_GAME_OVER
|
||||
ld a, 1
|
||||
ld [wSafariZoneGameOver], a
|
||||
ret
|
||||
|
||||
PrintSafariGameOverText::
|
||||
xor a
|
||||
ld [wJoyIgnore], a
|
||||
ld hl, SafariGameOverText
|
||||
jp PrintText
|
||||
|
||||
SafariGameOverText:
|
||||
text_asm
|
||||
ld a, [wNumSafariBalls]
|
||||
and a
|
||||
jr z, .noMoreSafariBalls
|
||||
ld hl, TimesUpText
|
||||
call PrintText
|
||||
.noMoreSafariBalls
|
||||
ld hl, GameOverText
|
||||
call PrintText
|
||||
jp TextScriptEnd
|
||||
|
||||
TimesUpText:
|
||||
text_far _TimesUpText
|
||||
text_end
|
||||
|
||||
GameOverText:
|
||||
text_far _GameOverText
|
||||
text_end
|
||||
Loading…
Add table
Add a link
Reference in a new issue