2019-01-01 20:06:23 +00:00
|
|
|
Museum1F_Script:
|
2024-09-24 03:51:44 +00:00
|
|
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wAutoTextBoxDrawingControl], a
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
2019-01-01 20:06:23 +00:00
|
|
|
ld hl, Museum1F_ScriptPointers
|
|
|
|
ld a, [wMuseum1FCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
jp CallFunctionInTable
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
Museum1F_ScriptPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_script_pointers
|
|
|
|
dw_const Museum1FDefaultScript, SCRIPT_MUSEUM1F_DEFAULT
|
|
|
|
dw_const Museum1FNoopScript, SCRIPT_MUSEUM1F_NOOP
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FDefaultScript:
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wYCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 4
|
2014-05-18 18:19:10 +00:00
|
|
|
ret nz
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wXCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 9
|
2023-07-14 01:27:56 +00:00
|
|
|
jr z, .continue
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wXCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 10
|
2014-05-18 18:19:10 +00:00
|
|
|
ret nz
|
2023-07-14 01:27:56 +00:00
|
|
|
.continue
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2023-07-14 01:27:56 +00:00
|
|
|
ld a, TEXT_MUSEUM1F_SCIENTIST1
|
2024-09-19 01:01:18 +00:00
|
|
|
ldh [hTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
jp DisplayTextID
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FNoopScript:
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
Museum1F_TextPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_text_pointers
|
|
|
|
dw_const Museum1FScientist1Text, TEXT_MUSEUM1F_SCIENTIST1
|
|
|
|
dw_const Museum1FGamblerText, TEXT_MUSEUM1F_GAMBLER
|
|
|
|
dw_const Museum1FScientist2Text, TEXT_MUSEUM1F_SCIENTIST2
|
|
|
|
dw_const Museum1FScientist3Text, TEXT_MUSEUM1F_SCIENTIST3
|
|
|
|
dw_const Museum1FOldAmberText, TEXT_MUSEUM1F_OLD_AMBER
|
|
|
|
|
|
|
|
Museum1FScientist1Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wYCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 4
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .not_right_of_scientist
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wXCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 13
|
2023-07-14 01:27:56 +00:00
|
|
|
jp z, .behind_counter
|
|
|
|
jr .check_ticket
|
|
|
|
.not_right_of_scientist
|
|
|
|
cp 3
|
|
|
|
jr nz, .not_behind_counter
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wXCoord]
|
2020-08-28 16:10:55 +00:00
|
|
|
cp 12
|
2023-07-14 01:27:56 +00:00
|
|
|
jp z, .behind_counter
|
|
|
|
.not_behind_counter
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .already_bought_ticket
|
|
|
|
ld hl, .GoToOtherSideText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
jp .done
|
|
|
|
.check_ticket
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
|
2023-07-14 01:27:56 +00:00
|
|
|
jr z, .no_ticket
|
|
|
|
.already_bought_ticket
|
|
|
|
ld hl, .TakePlentyOfTimeText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
jp .done
|
|
|
|
.no_ticket
|
2015-07-18 15:17:29 +00:00
|
|
|
ld a, MONEY_BOX
|
2015-02-07 10:43:08 +00:00
|
|
|
ld [wTextBoxID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextBoxID
|
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hJoyHeld], a
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .WouldYouLikeToComeInText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoChoice
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .deny_entry
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hMoney], a
|
|
|
|
ldh [hMoney + 1], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $50
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hMoney + 2], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call HasEnoughMoney
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nc, .buy_ticket
|
|
|
|
ld hl, .DontHaveEnoughMoneyText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
jp .deny_entry
|
|
|
|
.buy_ticket
|
|
|
|
ld hl, .ThankYouText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_BOUGHT_MUSEUM_TICKET
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2015-07-19 03:49:52 +00:00
|
|
|
ld [wPriceTemp], a
|
|
|
|
ld [wPriceTemp + 1], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $50
|
2015-07-19 03:49:52 +00:00
|
|
|
ld [wPriceTemp + 2], a
|
|
|
|
ld hl, wPriceTemp + 2
|
2014-05-26 21:04:56 +00:00
|
|
|
ld de, wPlayerMoney + 2
|
2014-05-18 18:19:10 +00:00
|
|
|
ld c, $3
|
2014-06-16 20:57:26 +00:00
|
|
|
predef SubBCDPredef
|
2015-07-18 15:17:29 +00:00
|
|
|
ld a, MONEY_BOX
|
2015-02-07 10:43:08 +00:00
|
|
|
ld [wTextBoxID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call DisplayTextBoxID
|
2015-07-19 08:46:12 +00:00
|
|
|
ld a, SFX_PURCHASE
|
2014-05-18 18:19:10 +00:00
|
|
|
call PlaySoundWaitForCurrent
|
|
|
|
call WaitForSoundToFinish
|
2023-07-14 01:27:56 +00:00
|
|
|
jr .allow_entry
|
|
|
|
.deny_entry
|
|
|
|
ld hl, .ComeAgainText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
ld a, $1
|
2014-09-10 03:55:19 +00:00
|
|
|
ld [wSimulatedJoypadStatesIndex], a
|
2015-07-17 07:52:25 +00:00
|
|
|
ld a, D_DOWN
|
2014-09-10 03:55:19 +00:00
|
|
|
ld [wSimulatedJoypadStatesEnd], a
|
|
|
|
call StartSimulatingJoypadStates
|
2014-05-18 18:19:10 +00:00
|
|
|
call UpdateSprites
|
2023-07-14 01:27:56 +00:00
|
|
|
jr .done
|
|
|
|
.allow_entry
|
|
|
|
ld a, SCRIPT_MUSEUM1F_NOOP
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wMuseum1FCurScript], a
|
2023-07-14 01:27:56 +00:00
|
|
|
jr .done
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.behind_counter
|
|
|
|
ld hl, .DoYouKnowWhatAmberIsText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoChoice
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-18 18:19:10 +00:00
|
|
|
cp $0
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .explain_amber
|
|
|
|
ld hl, .TheresALabSomewhereText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
jr .done
|
|
|
|
.explain_amber
|
|
|
|
ld hl, .AmberIsFossilizedTreeSapText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2023-07-14 01:27:56 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.ComeAgainText:
|
|
|
|
text_far _Museum1FScientist1ComeAgainText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.WouldYouLikeToComeInText:
|
|
|
|
text_far _Museum1FScientist1WouldYouLikeToComeInText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.ThankYouText:
|
|
|
|
text_far _Museum1FScientist1ThankYouText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.DontHaveEnoughMoneyText:
|
|
|
|
text_far _Museum1FScientist1DontHaveEnoughMoneyText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.DoYouKnowWhatAmberIsText:
|
|
|
|
text_far _Museum1FScientist1DoYouKnowWhatAmberIsText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.TheresALabSomewhereText:
|
|
|
|
text_far _Museum1FScientist1TheresALabSomewhereText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.AmberIsFossilizedTreeSapText:
|
|
|
|
text_far _Museum1FScientist1AmberIsFossilizedTreeSapText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.GoToOtherSideText:
|
|
|
|
text_far _Museum1FScientist1GoToOtherSideText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.TakePlentyOfTimeText:
|
|
|
|
text_far _Museum1FScientist1TakePlentyOfTimeText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FGamblerText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.Text:
|
|
|
|
text_far _Museum1FGamblerText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FScientist2Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_OLD_AMBER
|
2020-07-16 15:19:05 +00:00
|
|
|
jr nz, .got_item
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .TakeThisToAPokemonLabText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, OLD_AMBER, 1
|
2014-05-18 18:19:10 +00:00
|
|
|
call GiveItem
|
2020-07-16 15:19:05 +00:00
|
|
|
jr nc, .bag_full
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_GOT_OLD_AMBER
|
2014-09-25 23:21:49 +00:00
|
|
|
ld a, HS_OLD_AMBER
|
2015-07-25 03:27:59 +00:00
|
|
|
ld [wMissableObjectIndex], a
|
2014-06-16 20:57:26 +00:00
|
|
|
predef HideObject
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .ReceivedOldAmberText
|
2020-07-16 15:19:05 +00:00
|
|
|
jr .done
|
|
|
|
.bag_full
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .YouDontHaveSpaceText
|
2020-07-16 15:19:05 +00:00
|
|
|
jr .done
|
|
|
|
.got_item
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .GetTheOldAmberCheckText
|
2020-07-16 15:19:05 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.TakeThisToAPokemonLabText:
|
|
|
|
text_far _Museum1FScientist2TakeThisToAPokemonLabText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.ReceivedOldAmberText:
|
|
|
|
text_far _Museum1FScientist2ReceivedOldAmberText
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_item_1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.GetTheOldAmberCheckText:
|
|
|
|
text_far _Museum1FScientist2GetTheOldAmberCheckText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.YouDontHaveSpaceText:
|
|
|
|
text_far _Museum1FScientist2YouDontHaveSpaceText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FScientist3Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.Text:
|
|
|
|
text_far _Museum1FScientist3Text
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
Museum1FOldAmberText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.Text:
|
|
|
|
text_far _Museum1FOldAmberText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|