SpurgeGymB2FSidescroll_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SpurgeGymB2FSidescrollSecondMon:
	setevent EVENT_SPURGE_GYM_POKEMON_2
	jump SpurgeGymGetPokemon

SpurgeGymB2FSidescrollFifthMon:
	setevent EVENT_SPURGE_GYM_POKEMON_5
	jump SpurgeGymGetPokemon

SpurgeGymB2FSidescrollSwitch:
	opentext
	checkevent EVENT_SPURGE_GYM_SWITCH_ENABLED
	sif false
		jumptext .switch_disabled_text
	writetext .pull_the_switch_text
	yesorno
	sif true, then
		playsound SFX_ENTER_DOOR
		checkevent EVENT_0
		sif true, then
			changeblock 18, 10, $67
			changeblock 18, 12, $68
			changeblock 2, 12, $6a
			clearevent EVENT_0
		selse
			changeblock 18, 10, $52
			changeblock 18, 12, $51
			changeblock 2, 12, $6b
			setevent EVENT_0
		sendif
		reloadmappart
	sendif
	closetextend

.pull_the_switch_text
	ctxt "Want to pull the"
	line "switch?"
	done

.switch_disabled_text
	ctxt "This switch is"
	line "disabled!"
	done

SpurgeGymB2FSidescroll_MapEventHeader:: db 0, 0

.Warps: db 2
	warp_def 5, 25, 2, SPURGE_GYM_B1F
	warp_def 5, 5, 1, SPURGE_GYM_B2F

.CoordEvents: db 0

.BGEvents: db 1
	signpost 12, 2, SIGNPOST_READ, SpurgeGymB2FSidescrollSwitch

.ObjectEvents: db 2
	person_event SPRITE_POKE_BALL, 12, 20, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SpurgeGymB2FSidescrollSecondMon, EVENT_SPURGE_GYM_POKEMON_2
	person_event SPRITE_POKE_BALL, 14, 23, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SpurgeGymB2FSidescrollFifthMon, EVENT_SPURGE_GYM_POKEMON_5
