2019-01-01 20:06:23 +00:00
|
|
|
CeladonMartRoof_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
jp EnableAutoTextBoxDrawing
|
|
|
|
|
2016-04-09 01:04:36 +00:00
|
|
|
CeladonMartRoofScript_GetDrinksInBag:
|
2015-08-13 05:14:31 +00:00
|
|
|
; construct a list of all drinks in the player's bag
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld [wFilteredBagItemsCount], a
|
|
|
|
ld de, wFilteredBagItems
|
2015-07-03 19:38:12 +00:00
|
|
|
ld hl, CeladonMartRoofDrinkList
|
2015-08-13 05:14:31 +00:00
|
|
|
.loop
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
2015-08-13 05:14:31 +00:00
|
|
|
jr z, .done
|
2014-05-18 18:19:10 +00:00
|
|
|
push hl
|
|
|
|
push de
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd11e], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld b, a
|
2015-08-13 05:14:31 +00:00
|
|
|
predef GetQuantityOfItemInBag
|
2014-05-18 18:19:10 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
|
|
|
and a
|
2015-08-13 05:14:31 +00:00
|
|
|
jr z, .loop ; if the item isn't in the bag
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wd11e]
|
2014-05-18 18:19:10 +00:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
push hl
|
2015-08-13 05:14:31 +00:00
|
|
|
ld hl, wFilteredBagItemsCount
|
2014-05-18 18:19:10 +00:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
2015-08-13 05:14:31 +00:00
|
|
|
jr .loop
|
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $ff
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
2016-04-09 01:04:36 +00:00
|
|
|
CeladonMartRoofDrinkList:
|
2014-05-18 18:19:10 +00:00
|
|
|
db FRESH_WATER
|
|
|
|
db SODA_POP
|
|
|
|
db LEMONADE
|
2020-07-16 16:32:19 +00:00
|
|
|
db 0 ; end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-04-09 01:04:36 +00:00
|
|
|
CeladonMartRoofScript_GiveDrinkToGirl:
|
2024-07-16 17:02:54 +00:00
|
|
|
ld hl, wStatusFlags5
|
|
|
|
set BIT_NO_TEXT_DELAY, [hl]
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlGiveHerWhichDrinkText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
xor a
|
2015-07-03 19:38:12 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
2015-08-11 05:34:32 +00:00
|
|
|
ld a, A_BUTTON | B_BUTTON
|
2015-07-03 19:38:12 +00:00
|
|
|
ld [wMenuWatchedKeys], a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld a, [wFilteredBagItemsCount]
|
2014-05-18 18:19:10 +00:00
|
|
|
dec a
|
2015-07-03 19:38:12 +00:00
|
|
|
ld [wMaxMenuItem], a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld a, 2
|
2015-07-03 19:38:12 +00:00
|
|
|
ld [wTopMenuItemY], a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld a, 1
|
2015-07-03 19:38:12 +00:00
|
|
|
ld [wTopMenuItemX], a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld a, [wFilteredBagItemsCount]
|
2014-05-18 18:19:10 +00:00
|
|
|
dec a
|
2015-08-13 05:14:31 +00:00
|
|
|
ld bc, 2
|
|
|
|
ld hl, 3
|
2014-05-18 18:19:10 +00:00
|
|
|
call AddNTimes
|
|
|
|
dec l
|
|
|
|
ld b, l
|
2015-08-13 05:14:31 +00:00
|
|
|
ld c, 12
|
2020-07-07 15:30:10 +00:00
|
|
|
hlcoord 0, 0
|
2014-05-18 18:19:10 +00:00
|
|
|
call TextBoxBorder
|
|
|
|
call UpdateSprites
|
2015-08-13 05:14:31 +00:00
|
|
|
call CeladonMartRoofScript_PrintDrinksInBag
|
2024-07-16 17:02:54 +00:00
|
|
|
ld hl, wStatusFlags5
|
|
|
|
res BIT_NO_TEXT_DELAY, [hl]
|
2014-05-18 18:19:10 +00:00
|
|
|
call HandleMenuInput
|
2020-11-06 15:33:58 +00:00
|
|
|
bit BIT_B_BUTTON, a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret nz
|
2015-08-13 05:14:31 +00:00
|
|
|
ld hl, wFilteredBagItems
|
2015-07-03 19:38:12 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2015-08-13 05:14:31 +00:00
|
|
|
ld d, 0
|
2014-05-18 18:19:10 +00:00
|
|
|
ld e, a
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hItemToRemoveID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
cp FRESH_WATER
|
2015-08-13 05:14:31 +00:00
|
|
|
jr z, .gaveFreshWater
|
2014-05-18 18:19:10 +00:00
|
|
|
cp SODA_POP
|
2015-08-13 05:14:31 +00:00
|
|
|
jr z, .gaveSodaPop
|
|
|
|
; gave Lemonade
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_TM49
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nz, .alreadyGaveDrink
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlYayLemonadeText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call RemoveItemByIDBank12
|
2020-07-06 02:52:27 +00:00
|
|
|
lb bc, TM_TRI_ATTACK, 1
|
2014-05-18 18:19:10 +00:00
|
|
|
call GiveItem
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nc, .bagFull
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlReceivedTM49Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_GOT_TM49
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-08-13 05:14:31 +00:00
|
|
|
.gaveSodaPop
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_TM48
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nz, .alreadyGaveDrink
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlYaySodaPopText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call RemoveItemByIDBank12
|
2020-07-06 02:52:27 +00:00
|
|
|
lb bc, TM_ROCK_SLIDE, 1
|
2014-05-18 18:19:10 +00:00
|
|
|
call GiveItem
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nc, .bagFull
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlReceivedTM48Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_GOT_TM48
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-08-13 05:14:31 +00:00
|
|
|
.gaveFreshWater
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_TM13
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nz, .alreadyGaveDrink
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlYayFreshWaterText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
call RemoveItemByIDBank12
|
2020-07-06 02:52:27 +00:00
|
|
|
lb bc, TM_ICE_BEAM, 1
|
2014-05-18 18:19:10 +00:00
|
|
|
call GiveItem
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nc, .bagFull
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlReceivedTM13Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_GOT_TM13
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-08-13 05:14:31 +00:00
|
|
|
.bagFull
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlNoRoomText
|
2014-05-18 18:19:10 +00:00
|
|
|
jp PrintText
|
2015-08-13 05:14:31 +00:00
|
|
|
.alreadyGaveDrink
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, CeladonMartRoofLittleGirlImNotThirstyText
|
2014-05-18 18:19:10 +00:00
|
|
|
jp PrintText
|
|
|
|
|
2016-04-09 01:04:36 +00:00
|
|
|
RemoveItemByIDBank12:
|
2020-07-07 01:18:22 +00:00
|
|
|
farjp RemoveItemByID
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
CeladonMartRoofLittleGirlGiveHerWhichDrinkText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlGiveHerWhichDrinkText
|
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
|
|
|
CeladonMartRoofLittleGirlYayFreshWaterText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlYayFreshWaterText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlReceivedTM13Text:
|
|
|
|
text_far _CeladonMartRoofLittleGirlReceivedTM13Text
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_item_1
|
2023-07-14 01:27:56 +00:00
|
|
|
text_far _CeladonMartRoofLittleGirlTM13ExplanationText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlYaySodaPopText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlYaySodaPopText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlReceivedTM48Text:
|
|
|
|
text_far _CeladonMartRoofLittleGirlReceivedTM48Text
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_item_1
|
2023-07-14 01:27:56 +00:00
|
|
|
text_far _CeladonMartRoofLittleGirlTM48ExplanationText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlYayLemonadeText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlYayLemonadeText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlReceivedTM49Text:
|
|
|
|
text_far _CeladonMartRoofLittleGirlReceivedTM49Text
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_item_1
|
2023-07-14 01:27:56 +00:00
|
|
|
text_far _CeladonMartRoofLittleGirlTM49ExplanationText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlNoRoomText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlNoRoomText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
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
|
|
|
CeladonMartRoofLittleGirlImNotThirstyText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlImNotThirstyText
|
2020-07-06 16:39:29 +00:00
|
|
|
text_waitbutton
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-04-09 01:04:36 +00:00
|
|
|
CeladonMartRoofScript_PrintDrinksInBag:
|
2015-08-13 05:14:31 +00:00
|
|
|
ld hl, wFilteredBagItems
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hItemCounter], a
|
2015-08-13 05:14:31 +00:00
|
|
|
.loop
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, [hli]
|
|
|
|
cp $ff
|
|
|
|
ret z
|
|
|
|
push hl
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd11e], a
|
2014-05-18 18:19:10 +00:00
|
|
|
call GetItemName
|
2020-07-07 15:30:10 +00:00
|
|
|
hlcoord 2, 2
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh a, [hItemCounter]
|
2015-07-14 07:16:19 +00:00
|
|
|
ld bc, SCREEN_WIDTH * 2
|
2014-05-18 18:19:10 +00:00
|
|
|
call AddNTimes
|
2024-07-24 16:21:59 +00:00
|
|
|
ld de, wNameBuffer
|
2014-05-18 18:19:10 +00:00
|
|
|
call PlaceString
|
2015-08-13 05:14:31 +00:00
|
|
|
ld hl, hItemCounter
|
2014-05-18 18:19:10 +00:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
2015-08-13 05:14:31 +00:00
|
|
|
jr .loop
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
CeladonMartRoof_TextPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_text_pointers
|
|
|
|
dw_const CeladonMartRoofSuperNerdText, TEXT_CELADONMARTROOF_SUPER_NERD
|
|
|
|
dw_const CeladonMartRoofLittleGirlText, TEXT_CELADONMARTROOF_LITTLE_GIRL
|
|
|
|
dw_const CeladonMartRoofVendingMachineText, TEXT_CELADONMARTROOF_VENDING_MACHINE1
|
|
|
|
dw_const CeladonMartRoofVendingMachineText, TEXT_CELADONMARTROOF_VENDING_MACHINE2
|
|
|
|
dw_const CeladonMartRoofVendingMachineText, TEXT_CELADONMARTROOF_VENDING_MACHINE3
|
|
|
|
dw_const CeladonMartRoofCurrentFloorSignText, TEXT_CELADONMARTROOF_CURRENT_FLOOR_SIGN
|
|
|
|
|
|
|
|
CeladonMartRoofSuperNerdText:
|
|
|
|
text_far _CeladonMartRoofSuperNerdText
|
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
|
|
|
CeladonMartRoofLittleGirlText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-08-13 05:14:31 +00:00
|
|
|
call CeladonMartRoofScript_GetDrinksInBag
|
|
|
|
ld a, [wFilteredBagItemsCount]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
2015-08-13 05:14:31 +00:00
|
|
|
jr z, .noDrinksInBag
|
|
|
|
ld a, 1
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .GiveHerADrinkText
|
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
|
2015-08-13 05:14:31 +00:00
|
|
|
jr nz, .done
|
|
|
|
call CeladonMartRoofScript_GiveDrinkToGirl
|
|
|
|
jr .done
|
|
|
|
.noDrinksInBag
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .ImThirstyText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
2015-08-13 05:14:31 +00:00
|
|
|
.done
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.ImThirstyText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlImThirstyText
|
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
|
|
|
.GiveHerADrinkText:
|
|
|
|
text_far _CeladonMartRoofLittleGirlGiveHerADrinkText
|
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
|
|
|
CeladonMartRoofVendingMachineText:
|
2020-07-04 21:09:35 +00:00
|
|
|
script_vending_machine
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
CeladonMartRoofCurrentFloorSignText:
|
|
|
|
text_far _CeladonMartRoofCurrentFloorSignText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|