2019-01-01 20:06:23 +00:00
|
|
|
SafariZoneGate_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
call EnableAutoTextBoxDrawing
|
2019-01-01 20:06:23 +00:00
|
|
|
ld hl, SafariZoneGate_ScriptPointers
|
|
|
|
ld a, [wSafariZoneGateCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
jp CallFunctionInTable
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SafariZoneGate_ScriptPointers:
|
2014-10-18 04:47:31 +00:00
|
|
|
dw .SafariZoneEntranceScript0
|
|
|
|
dw .SafariZoneEntranceScript1
|
|
|
|
dw .SafariZoneEntranceScript2
|
|
|
|
dw .SafariZoneEntranceScript3
|
|
|
|
dw .SafariZoneEntranceScript4
|
|
|
|
dw .SafariZoneEntranceScript5
|
|
|
|
dw .SafariZoneEntranceScript6
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript0
|
|
|
|
ld hl, .CoordsData_75221
|
2014-05-18 18:19:10 +00:00
|
|
|
call ArePlayerCoordsInArray
|
|
|
|
ret nc
|
|
|
|
ld a, $3
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
|
|
|
ld a, $ff
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2015-07-04 05:44:12 +00:00
|
|
|
ld a, SPRITE_FACING_RIGHT
|
2020-07-05 21:29:11 +00:00
|
|
|
ld [wSpritePlayerStateData1FacingDirection], a
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [wCoordIndex]
|
2014-05-18 18:19:10 +00:00
|
|
|
cp $1
|
2015-07-03 19:38:12 +00:00
|
|
|
jr z, .asm_7520f
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $2
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
.asm_7520f
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_RIGHT
|
2014-05-18 18:19:10 +00:00
|
|
|
ld c, $1
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $f0
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $1
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
.CoordsData_75221:
|
2014-05-18 18:19:10 +00:00
|
|
|
db $02,$03
|
|
|
|
db $02,$04
|
|
|
|
db $FF
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript1
|
2014-05-18 18:19:10 +00:00
|
|
|
call SafariZoneEntranceScript_752b4
|
|
|
|
ret nz
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript2
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call UpdateSprites
|
|
|
|
ld a, $4
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
|
|
|
ld a, $ff
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript3
|
2014-05-18 18:19:10 +00:00
|
|
|
call SafariZoneEntranceScript_752b4
|
|
|
|
ret nz
|
|
|
|
xor a
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $5
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript5
|
2015-07-20 00:52:26 +00:00
|
|
|
ld a, PLAYER_DIR_DOWN
|
|
|
|
ld [wPlayerMovingDirection], a
|
2015-07-21 01:32:02 +00:00
|
|
|
CheckAndResetEvent EVENT_SAFARI_GAME_OVER
|
2015-07-03 19:38:12 +00:00
|
|
|
jr z, .asm_7527f
|
2015-07-21 01:32:02 +00:00
|
|
|
ResetEventReuseHL EVENT_IN_SAFARI_ZONE
|
2014-05-18 18:19:10 +00:00
|
|
|
call UpdateSprites
|
|
|
|
ld a, $f0
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $6
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
|
|
|
xor a
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wNumSafariBalls], a
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_DOWN
|
2014-05-18 18:19:10 +00:00
|
|
|
ld c, $3
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $4
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2015-07-03 19:38:12 +00:00
|
|
|
jr .asm_75286
|
2014-05-18 18:19:10 +00:00
|
|
|
.asm_7527f
|
|
|
|
ld a, $5
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextID
|
|
|
|
.asm_75286
|
|
|
|
ret
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript4
|
2014-05-18 18:19:10 +00:00
|
|
|
call SafariZoneEntranceScript_752b4
|
|
|
|
ret nz
|
|
|
|
xor a
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [wJoyIgnore], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $0
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceScript6
|
2014-05-18 18:19:10 +00:00
|
|
|
call SafariZoneEntranceScript_752b4
|
|
|
|
ret nz
|
|
|
|
call Delay3
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wcf0d]
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
SafariZoneEntranceAutoWalk:
|
2014-05-18 18:19:10 +00:00
|
|
|
push af
|
2017-12-30 00:54:27 +00:00
|
|
|
ld b, 0
|
|
|
|
ld a, c
|
|
|
|
ld [wSimulatedJoypadStatesIndex], a
|
|
|
|
ld hl, wSimulatedJoypadStatesEnd
|
2014-05-18 18:19:10 +00:00
|
|
|
pop af
|
|
|
|
call FillMemory
|
2014-09-10 03:55:19 +00:00
|
|
|
jp StartSimulatingJoypadStates
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
SafariZoneEntranceScript_752b4:
|
2014-09-10 03:55:19 +00:00
|
|
|
ld a, [wSimulatedJoypadStatesIndex]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SafariZoneGate_TextPointers:
|
2014-10-18 04:47:31 +00:00
|
|
|
dw .SafariZoneEntranceText1
|
|
|
|
dw .SafariZoneEntranceText2
|
|
|
|
dw .SafariZoneEntranceText1
|
|
|
|
dw .SafariZoneEntranceText4
|
|
|
|
dw .SafariZoneEntranceText5
|
|
|
|
dw .SafariZoneEntranceText6
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText1
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText4
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far SafariZoneEntranceText_9e6e4
|
|
|
|
text_asm
|
2015-07-23 13:07:12 +00:00
|
|
|
ld a, MONEY_BOX
|
2017-12-30 00:54:27 +00:00
|
|
|
ld [wTextBoxID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextBoxID
|
|
|
|
call YesNoChoice
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
2017-12-30 00:54:27 +00:00
|
|
|
jp nz, .PleaseComeAgain
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hMoney], a
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, $05
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hMoney + 1], a
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, $00
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hMoney + 2], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call HasEnoughMoney
|
2017-12-30 00:54:27 +00:00
|
|
|
jr nc, .success
|
|
|
|
ld hl, .NotEnoughMoneyText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2014-10-18 04:47:31 +00:00
|
|
|
jr .CantPayWalkDown
|
|
|
|
|
|
|
|
.success
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2017-12-30 00:54:27 +00:00
|
|
|
ld [wPriceTemp], a
|
|
|
|
ld a, $05
|
|
|
|
ld [wPriceTemp + 1], a
|
|
|
|
ld a, $00
|
|
|
|
ld [wPriceTemp + 2], a
|
|
|
|
ld hl, wPriceTemp + 2
|
|
|
|
ld de, wPlayerMoney + 2
|
|
|
|
ld c, 3
|
2014-06-16 20:57:26 +00:00
|
|
|
predef SubBCDPredef
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, MONEY_BOX
|
|
|
|
ld [wTextBoxID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextBoxID
|
2017-12-30 00:54:27 +00:00
|
|
|
ld hl, .MakePaymentText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, 30
|
|
|
|
ld [wNumSafariBalls], a
|
|
|
|
ld a, 502 / $100
|
|
|
|
ld [wSafariSteps], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, 502 % $100
|
2017-12-30 00:54:27 +00:00
|
|
|
ld [wSafariSteps + 1], a
|
|
|
|
ld a, D_UP
|
|
|
|
ld c, 3
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2015-07-21 01:32:02 +00:00
|
|
|
SetEvent EVENT_IN_SAFARI_ZONE
|
|
|
|
ResetEventReuseHL EVENT_SAFARI_GAME_OVER
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, 3
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-10-18 04:47:31 +00:00
|
|
|
jr .done
|
|
|
|
|
|
|
|
.PleaseComeAgain
|
2017-12-30 00:54:27 +00:00
|
|
|
ld hl, .PleaseComeAgainText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2014-10-18 04:47:31 +00:00
|
|
|
.CantPayWalkDown
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, D_DOWN
|
|
|
|
ld c, 1
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, 4
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-10-18 04:47:31 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.MakePaymentText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far SafariZoneEntranceText_9e747
|
|
|
|
sound_get_item_1
|
|
|
|
text_far _SafariZoneEntranceText_75360
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.PleaseComeAgainText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_75365
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.NotEnoughMoneyText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_7536a
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText5
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far SafariZoneEntranceText_9e814
|
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
call YesNoChoice
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
2015-07-03 19:38:12 +00:00
|
|
|
jr nz, .asm_7539c
|
2014-10-18 04:47:31 +00:00
|
|
|
ld hl, .SafariZoneEntranceText_753bb
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
xor a
|
2020-07-05 21:29:11 +00:00
|
|
|
ld [wSpritePlayerStateData1FacingDirection], a
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_DOWN
|
2014-05-18 18:19:10 +00:00
|
|
|
ld c, $3
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2015-07-21 01:32:02 +00:00
|
|
|
ResetEvents EVENT_SAFARI_GAME_OVER, EVENT_IN_SAFARI_ZONE
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $0
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf0d], a
|
2015-07-03 19:38:12 +00:00
|
|
|
jr .asm_753b3
|
2014-05-18 18:19:10 +00:00
|
|
|
.asm_7539c
|
2014-10-18 04:47:31 +00:00
|
|
|
ld hl, .SafariZoneEntranceText_753c0
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-07-04 05:44:12 +00:00
|
|
|
ld a, SPRITE_FACING_UP
|
2020-07-05 21:29:11 +00:00
|
|
|
ld [wSpritePlayerStateData1FacingDirection], a
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_UP
|
2014-05-18 18:19:10 +00:00
|
|
|
ld c, $1
|
2014-10-18 04:47:31 +00:00
|
|
|
call SafariZoneEntranceAutoWalk
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $5
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf0d], a
|
2014-05-18 18:19:10 +00:00
|
|
|
.asm_753b3
|
|
|
|
ld a, $6
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSafariZoneGateCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText_753bb
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753bb
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText_753c0
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753c0
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText6
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753c5
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.SafariZoneEntranceText2
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2017-12-30 00:54:27 +00:00
|
|
|
ld hl, .FirstTimeQuestionText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoChoice
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
2017-12-30 00:54:27 +00:00
|
|
|
ld hl, .RegularText
|
|
|
|
jr nz, .Explanation
|
|
|
|
ld hl, .ExplanationText
|
2014-10-18 04:47:31 +00:00
|
|
|
.Explanation
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.FirstTimeQuestionText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753e6
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.ExplanationText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753eb
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2014-10-18 04:47:31 +00:00
|
|
|
.RegularText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SafariZoneEntranceText_753f0
|
|
|
|
text_end
|