GoldenrodSwitches_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

GoldenrodSwitches_Switch1:
	writebyte 1
	scall GoldenrodSwitches_ShowSwitchLabel
	sif true, then
		playsound SFX_ENTER_DOOR
		checkevent EVENT_0
		sif true, then
			changeblock 2, 6, $3e
			clearevent EVENT_0
		selse
			changeblock 2, 6, $2d
			setevent EVENT_0
		sendif
		checkevent EVENT_2
		sif true, then
			changeblock 16, 6, $3e
			clearevent EVENT_2
		selse
			changeblock 16, 6, $2d
			setevent EVENT_2
		sendif
		checkevent EVENT_4
		sif true, then
			changeblock 10, 10, $3e
			clearevent EVENT_4
		selse
			changeblock 10, 10, $2d
			setevent EVENT_4
		sendif
		checkevent EVENT_6
		sif true, then
			changeblock 6, 8, $3d
			clearevent EVENT_6
		selse
			changeblock 6, 8, $2d
			setevent EVENT_6
		sendif
		reloadmappart
	sendif
	closetextend

GoldenrodSwitches_Switch2:
	writebyte 2
	scall GoldenrodSwitches_ShowSwitchLabel
	sif true, then
		playsound SFX_ENTER_DOOR
		checkevent EVENT_0
		sif true, then
			changeblock 2, 6, $3e
			clearevent EVENT_0
		selse
			changeblock 2, 6, $2d
			setevent EVENT_0
		sendif
		checkevent EVENT_1
		sif true, then
			changeblock 10, 6, $3e
			clearevent EVENT_1
		selse
			changeblock 10, 6, $2d
			clearevent EVENT_1
		sendif
		checkevent EVENT_6
		sif true, then
			changeblock 6, 8, $3d
			clearevent EVENT_6
		selse
			changeblock 6, 8, $2d
			setevent EVENT_6
		sendif
		checkevent EVENT_7
		sif true, then
			changeblock 18, 12, $3d
			clearevent EVENT_7
		selse
			changeblock 18, 12, $2d
			setevent EVENT_7
		sendif
		reloadmappart
	sendif
	closetextend

GoldenrodSwitches_Switch3:
	writebyte 3
	scall GoldenrodSwitches_ShowSwitchLabel
	sif true, then
		playsound SFX_ENTER_DOOR
		checkevent EVENT_2
		sif true, then
			changeblock 16, 6, $3e
			clearevent EVENT_2
		selse
			changeblock 16, 6, $2d
			setevent EVENT_2
		sendif
		checkevent EVENT_3
		sif true, then
			changeblock 1, 5, $3e	; FIXME: I have a feeling that they should change the same block...
			clearevent EVENT_3
		selse
			changeblock 2, 10, $2d
			setevent EVENT_3
		sendif
		checkevent EVENT_4
		sif true, then
			changeblock 10, 10, $3e
			clearevent EVENT_4
		selse
			changeblock 10, 10, $2d
			setevent EVENT_4
		sendif
		checkevent EVENT_5
		sif true, then
			changeblock 16, 10, $3e
			clearevent EVENT_5
		selse
			changeblock 16, 10, $2d
			setevent EVENT_5
		sendif
		reloadmappart
	sendif
	closetextend

GoldenrodSwitches_Switch4:
	writebyte 4
	scall GoldenrodSwitches_ShowSwitchLabel
	sif true, then
		playsound SFX_ENTER_DOOR
		checkevent EVENT_2
		sif true, then
			changeblock 16, 6, $3e
			clearevent EVENT_2
		selse
			changeblock 16, 6, $2d
			setevent EVENT_2
		sendif
		checkevent EVENT_5
		sif true, then
			changeblock 16, 10, $3e
			clearevent EVENT_5
		selse
			changeblock 16, 10, $2d
			setevent EVENT_5
		sendif
		checkevent EVENT_7
		sif true, then
			changeblock 18, 12, $3d
			clearevent EVENT_7
		selse
			changeblock 18, 12, $2d
			setevent EVENT_7
		sendif
		reloadmappart
	sendif
	closetextend

GoldenrodSwitches_ShowSwitchLabel:
	opentext
	writetext .text
	yesorno
	end

.text
	db TX_COMPRESSED, $75, $78, $a7, $75, $59, $f4
	db $f2, $f0, $9a, $cf, $54, $54, $3b, $65, $31, $cc, $00
	deciram hScriptVar, 1, 1
	db TX_COMPRESSED, $13, $59, $ef
	
	db $80, $70, $ac, $d0, $88, $3b, $a5
	db $a6, $80

GoldenrodSwitches_MapEventHeader:: db 0, 0

.Warps
	db 3
	warp_def $3, $17, 6, GOLDENROD_UNDERGROUND
	warp_def $a, $16, 1, GOLDENROD_STORAGE
	warp_def $a, $17, 2, GOLDENROD_STORAGE

.CoordEvents
	db 0

.BGEvents
	db 4
	signpost 1, 16, SIGNPOST_READ, GoldenrodSwitches_Switch1
	signpost 1, 10, SIGNPOST_READ, GoldenrodSwitches_Switch2
	signpost 1, 2, SIGNPOST_READ, GoldenrodSwitches_Switch3
	signpost 11, 20, SIGNPOST_READ, GoldenrodSwitches_Switch4

.ObjectEvents
	db 1
	person_event SPRITE_POKE_BALL, 13, 0, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, METAL_COAT, EVENT_GOLDENROD_SWITCHES_ITEM_METAL_COAT

