HaywardMartF6_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

HaywardMartF6Signpost1:
	jumptext HaywardMartF6Signpost1_Text_17895a

HaywardMartVendingMachine:
	opentext
HaywardMartF6_1787a0:
	writetext HaywardMartF6Signpost2_Text_17886c
	special PlaceMoneyTopRight
	menuanonjumptable .VendingMachineMenu
	dw .quit
	dw HaywardMartF6_1787b6
	dw HaywardMartF6_1787d0
	dw HaywardMartF6_1787ea
.quit
	closetext
	end

.VendingMachineMenu
	db $40 ; flags
	db 03, 00 ; start coords
	db 10, 13 ; end coords
	dw .MenuData2
	db 1 ; default option

.MenuData2: ; 17d297
	db %10000000 ; flags
	db 3
	db "Fresh Water@"
	db "Soda Pop@"
	db "Lemonade@"

HaywardMartF6NPC1:
	faceplayer
	opentext
	clearevent EVENT_0
	checkevent EVENT_EXPLAIN_EGGS
	iftrue SecretEggExplanation
	writetext HaywardMartF6NPC1_Text_17b214
	setevent EVENT_EXPLAIN_EGGS
	waitbutton
SecretEggExplanation:
	checkitem RUBY_EGG
	iftrue HaywardMartF6_17b1a3
CheckSapphireEgg:
	checkitem SAPPHIRE_EGG
	iftrue HaywardMartF6_17b1c2
CheckEmeraldEgg:
	checkitem EMERALD_EGG
	iftrue HaywardMartF6_17b1e1
CheckIfLastEgg:
	checkevent EVENT_GAVE_RUBY_EGG
	iffalse .didntGetAll
	checkevent EVENT_GAVE_SAPPHIRE_EGG
	iffalse .didntGetAll
	checkevent EVENT_GAVE_EMERALD_EGG
	iffalse .didntGetAll
	jumptext HaywardMartF6_17b19b_Text_17b2b4

.didntGetAll
	jumptext HaywardMartF6_NoEggs

HaywardMartF6NPC2:
	jumptextfaceplayer HaywardMartF6NPC2_Text_17892c

HaywardMartF6_1787b6:
	checkmoney 0, 200
	if_equal 2, HaywardMartF6_178811
	giveitem FRESH_WATER, 1
	iffalse HaywardMartF6_178818
	takemoney 0, 200
	itemtotext FRESH_WATER, 0
	jump HaywardMartF6_178804

HaywardMartF6_1787d0:
	checkmoney 0, 300
	if_equal 2, HaywardMartF6_178811
	giveitem SODA_POP, 1
	iffalse HaywardMartF6_178818
	takemoney 0, 300
	itemtotext SODA_POP, 0
	jump HaywardMartF6_178804

HaywardMartF6_1787ea:
	checkmoney 0, 350
	if_equal 2, HaywardMartF6_178811
	giveitem LEMONADE, 1
	iffalse HaywardMartF6_178818
	takemoney 0, 350
	itemtotext LEMONADE, 0
	jump HaywardMartF6_178804

HaywardMartF6_17b1a3:
	writetext HaywardMartF6_17b1a3_Text_17b30a
	yesorno
	iffalse HaywardMartF6_17b200
	takeitem RUBY_EGG, 1
	giveitem RED_ORB, 1
	writetext HaywardMartF6_17b1a3_Text_17b35b
	waitbutton
	setevent EVENT_GAVE_RUBY_EGG
	playwaitsfx SFX_DEX_FANFARE_200_229
	jump CheckSapphireEgg

HaywardMartF6_17b1c2:
	writetext HaywardMartF6_17b1c2_Text_17b377
	yesorno
	iffalse HaywardMartF6_17b207
	takeitem SAPPHIRE_EGG, 1
	giveitem BLUE_ORB, 1
	writetext HaywardMartF6_17b1c2_Text_17b3cd
	waitbutton
	setevent EVENT_GAVE_SAPPHIRE_EGG
	playwaitsfx SFX_DEX_FANFARE_200_229
	jump CheckEmeraldEgg

HaywardMartF6_17b1e1:
	writetext HaywardMartF6_17b1e1_Text_17b3ee
	yesorno
	iffalse HaywardMartF6_17b20e
	takeitem EMERALD_EGG, 1
	giveitem GREEN_ORB, 1
	writetext HaywardMartF6_17b1e1_Text_17b440
	waitbutton
	setevent EVENT_GAVE_EMERALD_EGG
	playwaitsfx SFX_DEX_FANFARE_200_229
	jump CheckIfLastEgg

HaywardMartF6_17b183:
	jumptext HaywardMartF6_17b183_Text_17b28a

HaywardMartF6_178811:
	writetext HaywardMartF6_178811_Text_1788aa
	waitbutton
	jump HaywardMartF6_1787a0

HaywardMartF6_178818:
	writetext HaywardMartF6_178818_Text_1788c3
	waitbutton
	jump HaywardMartF6_1787a0

HaywardMartF6_178804:
	pause 10
	playsound SFX_ENTER_DOOR
	writetext HaywardMartF6_178804_Text_178890
	buttonsound
	itemnotify
	waitbutton
	jump HaywardMartF6_1787a0

HaywardMartF6_17b200:
	writetext HaywardMartF6_17b200_Text_17b45d
	waitbutton
	jump CheckSapphireEgg

HaywardMartF6_17b207:
	writetext HaywardMartF6_17b200_Text_17b45d
	waitbutton
	jump CheckEmeraldEgg

HaywardMartF6_17b20e:
	writetext HaywardMartF6_17b200_Text_17b45d
	waitbutton
	jump CheckIfLastEgg

HaywardMartF6Signpost1_Text_17895a:
	db TX_COMPRESSED, $13, $45, $37, $18, $e4, $08, $70, $b0, $88, $8a, $05, $9b, $5a, $b3
	db $78, $1c, $19, $32, $32, $73, $05, $75, $94, $8c, $86
	db $8a, $68

HaywardMartF6Signpost2_Text_17886c:
	db TX_COMPRESSED, $ae, $03, $19, $32, $32, $73, $1f, $d6, $52, $32, $1f
	db $17, $98, $9a, $cf, $14, $b4, $9c, $7c, $c8, $d7
	db $a9, $a0

HaywardMartF6NPC1_Text_17b214:
	db TX_COMPRESSED, $76, $98, $93, $ef, $43

	db $e0, $0e, $8b, $27, $42, $15, $21, $93, $99, $80
	db $56, $f2, $02, $f9, $c4, $08, $36, $47, $bd, $87, $cf, $28

	db $f0, $00, $78, $6e, $03, $95, $f0, $92, $1f, $3c, $a3
	db $ef, $2b, $6a, $e2, $0d, $95, $9d, $c3, $e7, $94

	db $78, $01, $49, $30, $45, $c7, $32, $3c, $30, $1b, $2d, $76
	db $de, $b0, $cc, $06, $4c

	db $f8, $03, $ac, $20, $20, $b5, $30, $19, $33, $02, $43
	db $7a, $d3, $b7, $1d, $4a, $b4, $97, $f8, $e9, $c3

	db $d0, $1c, $8c, $18, $e0, $20, $b5, $36, $21, $23, $20
	db $27, $82, $b5, $71, $d4, $59, $b2, $63, $06, $3c
	db $aa, $c0, $60, $c7, $01, $1e, $ad, $13, $79, $0f

	db $80, $14, $93, $85, $2f, $46, $43, $5c, $ee, $d9
	db $ad, $e5, $66, $ce, $be, $72, $d2, $71, $c8, $3a, $70, $24
	db $54, $da, $9d, $7c, $40, $c2, $4a, $78

	db $00, $53, $c0, $ad, $ab, $89, $38, $0d, $a4, $1a, $12, $79
	db $7b, $60, $23, $d5, $ce, $ed, $9a
	db $fd, $4d

HaywardMartF6NPC2_Text_17892c:
	db TX_COMPRESSED, $29, $3b, $73, $91, $af, $b2, $d2, $6b
	db $37, $86, $89, $6b, $04, $32, $73, $2c, $33, $93
	db $b5, $4b, $1e, $60, $70, $89, $35, $c0, $ad, $5a

	db $3c, $01, $d6, $11, $d4, $a8, $d6, $71, $26, $bf, $c7, $58
	db $cf, $24, $3d, $cc, $09, $2c, $32, $d2, $6f
	db $fa, $9a

HaywardMartF6_17b1a3_Text_17b30a:
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $39
	db $af, $75, $aa, $75, $a5, $8c, $2d, $22, $39, $1a, $56
	db $09, $50, $bb, $9e, $78

	db $80, $74, $e1, $ec, $b5, $ee, $4e, $02, $0b, $50
	db $76, $f6, $01, $5c, $7c, $14, $72, $1e, $63, $b5, $ab

	db $e2, $01, $b8, $fb, $d8, $08, $2d, $4b, $5e, $e4, $e9
	db $69, $a0

HaywardMartF6_17b1a3_Text_17b35b:
	db TX_COMPRESSED, $61, $2c, $f6, $ff, $12, $6b, $3c
	db $4f, $02, $0b, $4b, $8e, $43, $cc, $76, $b5, $7c
	db $69, $a0

HaywardMartF6_17b1c2_Text_17b377:
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $39
	db $af, $2b, $3d, $6a, $c7, $83, $5d
	db $54, $a3, $44, $08, $48, $d6, $70, $5d, $cf, $3c

	db $40, $3a, $70, $f6, $5a, $f7, $27, $01, $05, $a8, $3b
	db $7b, $00, $ae, $3e, $0a, $09, $75, $a3, $8e, $d6, $af

	db $88, $06, $fa, $4b, $80, $82, $d4, $b5, $ee, $4e
	db $96, $9a

HaywardMartF6_17b1c2_Text_17b3cd:
	db TX_COMPRESSED, $6e, $12, $64, $d7, $83, $5d, $fc, $49, $ac, $f1
	db $3c, $08, $2d, $2e, $09, $75, $a3, $8e, $d6, $af
	db $8d, $34

HaywardMartF6_17b1e1_Text_17b3ee:
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $39, $b1, $09, $19, $01
	db $3c, $2e, $7c, $d7, $bd, $cc, $17, $73, $cf

	db $10, $0e, $9c, $3d, $96, $bd, $c9, $c0, $41, $6a, $0e
	db $de, $c0, $2b, $8f, $82, $8c, $25, $99
	db $91, $53, $b5, $ab

	db $e2, $01, $be, $92, $e0, $20, $b5, $2d, $7b, $93, $a5
	db $a6, $80

HaywardMartF6_17b1e1_Text_17b440:
	db TX_COMPRESSED, $07, $8d, $93, $fc, $49, $ac, $f1, $40, $41, $69
	db $6f, $30, $96, $66, $48, $ed, $6a, $f8
	db $d3, $40

HaywardMartF6_17b183_Text_17b28a:
	db TX_COMPRESSED, $72, $85, $a9, $90, $92, $99, $13, $a0
	db $c6, $f6, $90, $14, $3e, $79, $44, $b4, $ed, $c7
	db $4a, $aa, $d2, $5f

	db $80, $36, $85, $f3, $8a, $f5, $95, $29, $52, $4c, $90, $10, $5a
	db $7b, $21
	db $f5, $34

HaywardMartF6_178811_Text_1788aa:
	db TX_COMPRESSED, $76, $11, $08, $fc, $20, $6e, $19, $02, $d7, $29
	db $79, $f0, $90, $c1, $53
	db $c1, $4d

HaywardMartF6_178818_Text_1788c3:
	db TX_COMPRESSED, $29, $26, $b3, $c5, $08, $18, $f8, $56
	db $6f, $2c, $21, $7e, $60, $15, $c4, $5b, $58, $61, $4f
	db $05, $34

HaywardMartF6_178804_Text_178890:
	db TX_COMPRESSED, $6d, $ee, $93, $9e

	db $20, $01, $c8
	db $78, $40, $44, $08, $3c, $c0, $b5, $7e
	db $a6, $80

HaywardMartF6_17b200_Text_17b45d:
	db TX_COMPRESSED, $6d, $0b, $e7, $02, $4f, $cb, $4e, $dc, $3e, $79
	db $78, $68, $25, $32, $69, $01, $46, $90, $72
	db $c2, $a8, $10, $5a
	db $e3, $4d

HaywardMartF6_NoEggs:
	db TX_COMPRESSED, $6d, $0b, $e7, $15, $eb, $2a, $52, $a4, $99
	db $1e, $04, $16, $a2, $74, $18, $e3, $e1, $59
	db $aa, $40, $83, $64, $7b, $d8, $7c, $f2, $8f
	db $53, $40

HaywardMartF6_17b19b_Text_17b2b4:
	db TX_COMPRESSED, $6e, $9d, $ba, $58, $e8, $b2, $6f, $7b, $02, $d5
	db $bc, $1c, $20, $56, $ad, $1e

	db $00, $ea, $6f, $56, $7b, $90, $51, $3a, $0c, $73, $7b
	db $d7, $ad, $27, $0f, $9e, $51, $2d, $3b, $71
	db $d2, $aa, $b4, $97
	db $ea, $68

HaywardMartF6_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $0, $10, 2, HAYWARD_MART_F5
	warp_def $0, $2, 2, HAYWARD_MART_ELEVATOR

	;xy triggers
	db 0

	;signposts
	db 4
	signpost 1, 12, SIGNPOST_UP, HaywardMartVendingMachine
	signpost 1, 13, SIGNPOST_UP, HaywardMartVendingMachine
	signpost 1, 14, SIGNPOST_UP, HaywardMartVendingMachine
	signpost 1, 15, SIGNPOST_UP, HaywardMartVendingMachine

	;people-events
	db 2
	person_event SPRITE_LASS, 4, 9, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, HaywardMartF6NPC1, -1
	person_event SPRITE_YOUNGSTER, 5, 13, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, PERSONTYPE_SCRIPT, 0, HaywardMartF6NPC2, -1

