SpurgeGymB1F_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SpurgeGymB1FBoulder:
	db TX_COMPRESSED, $29, $26, $b3, $88, $48, $5a, $ee, $62, $b3
	db $9a, $f5, $5a, $0a, $58, $63, $e1, $06, $39, $69, $1a
	db $15, $54, $3b, $48, $5a, $b9, $b0, $1c, $af, $84, $9e
	db $a6, $80

SpurgeGymB1FExplodingRock:
	takeitem DYNAMITE
	sif false
		jumptext SpurgeGymB1FBoulder
	showtext .placed_dynamite_text
	applymovement PLAYER, .stand_back
	disappear 8
	playwaitsfx SFX_EGG_BOMB
	setevent EVENT_SPURGE_GYM_SMASHROCK
	end

.stand_back
	run_step_right
	run_step_right
	run_step_right
	run_step_down
	run_step_down
	run_step_down
	run_step_right
	run_step_right
	run_step_right
	step_end

.placed_dynamite_text
	db TX_COMPRESSED, $e1, $ee, $b2, $79, $96, $93, $99, $04, $4d
	db $02, $f3, $e3, $b3, $81, $24, $b4, $9c, $58, $59, $52
	db $55, $a4, $cc, $e8, $ee, $0e, $e3, $42, $38

	db $80, $51, $7a, $4c, $c5, $7a, $ca, $97
	db $1a, $78, $80

SpurgeGymB1FThirdMon:
	setevent EVENT_SPURGE_GYM_POKEMON_3
	jump SpurgeGymGetPokemon

SpurgeGymB1FSixthMon:
	setevent EVENT_SPURGE_GYM_POKEMON_6
	jump SpurgeGymGetPokemon

SpurgeGymB1FButton:
	checkevent EVENT_SPURGE_GYM_PUSHROCK
	sif true
		jumptext .already_pressed_text
	opentext
	writetext .pressed_text
	playwaitsfx SFX_EGG_BOMB
	waitbutton
	disappear 3
	setevent EVENT_SPURGE_GYM_PUSHROCK
	closetextend

.pressed_text
	db TX_COMPRESSED, $e1, $59, $a1, $07, $99, $69
	db $37, $95, $b5, $76, $12, $71
	db $a6, $80

.already_pressed_text
	db TX_COMPRESSED, $29, $27, $15, $b5, $76, $12, $44, $ea
	db $1e, $de, $ac, $f7, $20, $a2, $b3, $32
	db $2a, $10, $b3, $42, $0f, $3e
	db $a6, $80

SpurgeGymB1F_TrainerDisappears:
	teleport_from
	remove_person
	step_end

SpurgeGymB1FCadence:
	faceplayer
	checkcode VAR_PARTYCOUNT
	sif false
		jumptext .no_mons_text
	opentext
	writetext .before_battle_text
	winlosstext .battle_won_text, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer CADENCE, 2
	startbattle
	reloadmapafterbattle
	playmapmusic
	showtext .after_battle_text
	setevent EVENT_SPURGE_GYM_B1F_CADENCE
	playsound SFX_WARP_FROM
	applymovement 4, SpurgeGymB1F_TrainerDisappears
	disappear 4
	end

.no_mons_text
	db TX_COMPRESSED, $63, $a4, $e6, $04, $93, $62, $0d, $9e

	db $20, $1c, $a1, $6a, $33, $a4, $a6, $45, $7b, $77, $d3
	db $79, $f3, $95, $0e, $d2, $16, $ae
	db $6a, $a0, $72, $be, $12, $40, $92, $02, $0b, $5c
	db $69, $a0

.before_battle_text
	db TX_COMPRESSED, $72, $bb, $73, $f1

	db $00, $2e, $06, $35, $82, $96, $37, $ce, $6c, $61, $02
	db $7d, $ec, $73, $dc, $9a, $e7, $42, $83, $47, $e6
	db $80, $56, $3b, $81, $c2, $2c, $d0, $20, $d9
	db $b7, $b9, $09, $a2, $22, $d7, $a3, $e5, $37, $32, $1a
	db $88, $aa, $d2, $73, $2b, $d1, $93

	db $c0, $1d, $16, $3f, $b3, $93, $b8, $08, $2d
	db $3c, $af, $59, $52, $fc, $b4, $8d, $12, $c6, $f9
	db $80, $a8, $76, $98, $2e, $07, $02, $e7, $23, $94, $a6, $2e, $81, $ec
	db $27, $9d, $09, $ac, $f4, $1c, $0b, $a3, $09, $d9, $5c
	db $69, $e2

.battle_won_text
	db TX_COMPRESSED, $07, $84, $3c, $60, $3c, $37, $37, $9d, $19, $38
	db $d3, $40

.after_battle_text
	db TX_COMPRESSED, $76, $46, $4e, $6f, $3a, $32, $7e, $02, $0b, $4c
	db $06, $f2, $91, $02, $ca, $91, $e6, $64, $35, $12, $3e
	db $09, $53, $08, $13, $f8, $a0, $85, $9a, $2c, $7c, $9f
	db $a9, $e2

SpurgeGymB1FJosiah:
	faceplayer
	opentext
	checkcode VAR_PARTYCOUNT
	sif false
		jumptext .no_mons_text
	writetext .before_battle_text
	winlosstext .battle_won_text, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer JOSIAH, 2
	startbattle
	reloadmapafterbattle
	playmapmusic
	showtext .after_battle_text
	setevent EVENT_SPURGE_GYM_B1F_JOSIAH
	playsound SFX_WARP_FROM
	applymovement 5, SpurgeGymB1F_TrainerDisappears
	disappear 5
	end

.no_mons_text
	db TX_COMPRESSED, $6e, $90, $ef, $e2, $43, $dc, $c0, $92
	db $6b, $c8, $36, $78, $c7, $28, $5a, $8c, $e9, $29
	db $80, $15, $ed, $df, $4e, $3e, $71, $a2, $74, $d0
	db $87, $81, $05, $a8, $9d, $06, $39
	db $aa, $81, $ca, $f8, $49, $02, $48, $08, $2d, $71
	db $a6, $80

.before_battle_text
	db TX_COMPRESSED, $62, $1a, $a0, $20, $b5, $32, $11, $90, $4d, $67, $bf, $8f, $82
	db $79, $fd, $19, $20, $8d, $ef

	db $10, $0e, $50, $b5, $1f, $d0, $51, $3a, $0c
	db $6f, $58, $75, $16, $79, $8f, $9c, $57, $ac, $a9
	db $00, $a9, $26, $48, $08, $2d, $4a, $8d, $67, $29, $c6, $91
	db $6f, $6c, $21, $d4, $ac, $67, $f8, $ad, $ab, $8e
	db $80, $5a, $46, $45, $28, $3b, $95, $6a, $25, $38, $d2
	db $2d, $e5, $67, $c8, $c8, $43, $5e, $29, $d6, $99, $52

	db $f0, $07, $45, $90, $46, $b2, $a4, $32, $73, $2d
	db $26, $f2, $4f, $6e, $60, $15, $ac, $f7, $a2, $6e, $5a, $46
	db $85, $56, $37, $cf, $f1, $59, $dc, $09, $20, $ef
	db $8d, $3c, $40

.battle_won_text
	db TX_COMPRESSED, $72, $85, $a2, $e3, $82, $35, $95, $21, $90, $4d, $67
	db $af, $20, $2f, $9c, $41, $ac, $61, $69
	db $0a, $92, $7b, $7f, $99, $6b, $27
	db $c6, $9a

.after_battle_text
	db TX_COMPRESSED, $ad, $3f, $8a, $da, $59, $0f, $33, $79, $d1, $92, $9e
	db $0a, $78, $80

SpurgeGymB1FEdison:
	faceplayer
	checkcode VAR_PARTYCOUNT
	sif false
		jumptext SpurgeGymB1F_Text_GenericNeedOneMon
	opentext
	writetext .before_battle_text
	winlosstext .battle_won_text, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer EDISON, 2
	startbattle
	reloadmapafterbattle
	playmapmusic
	showtext .after_battle_text
	setevent EVENT_SPURGE_GYM_B1F_EDISON
	playsound SFX_WARP_FROM
	applymovement 6, SpurgeGymB1F_TrainerDisappears
	disappear 6
	end

.before_battle_text
	db TX_COMPRESSED, $ae, $2b, $db, $be, $9c, $1a, $26
	db $bc, $af, $6e, $fa, $7f, $9a, $4c, $cd, $99, $30
	db $2a, $b0, $3d, $b8, $34, $4d, $99, $3c, $0f, $6f

	db $c0, $1d, $30, $1c, $59, $83, $0c, $ea, $3c
	db $fd, $e6, $77, $ac, $b5, $dd, $b3, $cf, $e6, $93
	db $20, $04, $77, $48, $43, $cc, $56, $bd, $26, $61, $0e
	db $a7, $91, $6b, $db, $3e, $46, $68, $96, $18, $ac, $f6
	db $c0, $02, $0b, $4b, $80, $c6, $b0, $51, $a2, $0c, $59, $b4
	db $6f, $2b, $db, $be, $8c, $9c, $c4, $58, $2e, $9f

	db $80, $3a, $95, $0f, $bd, $84, $0d, $c5
	db $66, $f6, $4f, $03, $db, $3c, $cd, $e7, $46, $4e
	db $34, $f1, $00

.battle_won_text
	db TX_COMPRESSED, $12, $6a, $c0, $81, $48, $6a, $a5
	db $e3, $4d

.after_battle_text
	db TX_COMPRESSED, $62, $1a, $a3, $21, $6b, $b9, $8e, $a2, $74, $18
	db $de, $56, $66, $48, $80, $cc, $02, $1e, $8d, $09

	db $e2, $00, $a4, $9a, $ce, $3e, $d2, $2e, $27, $41
	db $8d, $e5, $66, $64, $9a, $48, $11, $06, $41, $93, $9a, $78
	db $15, $2b, $6a, $e5, $49, $35, $9d
	db $2d, $3c, $40

SpurgeGymB1FRinji:
	faceplayer
	checkcode VAR_PARTYCOUNT
	sif false
		jumptext SpurgeGymB1F_Text_GenericNeedOneMon
	opentext
	writetext .before_battle_text
	winlosstext .battle_won_text, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer RINJI, 2
	startbattle
	reloadmapafterbattle
	playmapmusic
	showtext .after_battle_text
	setevent EVENT_SPURGE_GYM_B1F_RINJI
	playsound SFX_WARP_FROM
	applymovement 7, SpurgeGymB1F_TrainerDisappears
	disappear 7
	end

.before_battle_text
	db TX_COMPRESSED, $61, $2c, $ce, $c6, $4e, $51

	db $e0, $0e, $af, $14, $56, $66, $49, $b2, $a4, $8f, $a7

	db $e0, $0e, $a3, $3a, $49, $67, $de, $c5, $60, $a5, $a4
	db $de, $ab, $41, $4b, $49, $ca, $82, $be, $e6, $03, $0d, $58
	db $10, $0b, $db, $34, $4d, $58, $5a, $26, $60, $20
	db $b4, $f5, $a7, $6e, $02, $0b, $53, $49, $98, $08, $2d
	db $2c, $00, $39, $5f, $09, $22, $74, $18, $e7, $2b, $0d, $44
	db $79, $01, $8f, $b4, $ca, $62, $2d, $61, $27, $26
	db $b0, $0a, $cd, $9d, $69, $07, $03, $84, $04, $16
	db $96, $f3, $44, $18, $b3, $68, $e2, $b0, $93, $3e

	db $01, $8e, $77, $8a, $59, $a2, $e5, $a7
	db $6d, $e5, $61, $26, $60, $85, $84, $41, $af, $a0
	db $bd, $4f, $10

.battle_won_text
	db TX_COMPRESSED, $50, $66, $32, $73, $2d, $27, $39, $58, $6a, $b4
	db $bc, $1c, $26, $c5, $61, $26, $62, $b3, $ba, $8c
	db $c8, $00, $1c, $af, $84, $93, $49
	db $97, $8a, $5e, $8c, $86, $b8, $34, $44, $34, $ca, $66
	db $90, $00, $df, $7c, $c8, $83, $e8, $28, $96, $9f, $57, $d1, $93
	db $97, $8e, $9d, $10, $6b, $19, $91, $93
	db $e3, $4d

.after_battle_text
	db TX_COMPRESSED, $e1, $e9, $ea, $34, $97, $29, $c0, $b4, $b2, $18, $24
	db $7d, $e7, $c1, $4c, $16, $33, $26, $78
	db $d3, $c4

SpurgeGymB1F_Text_GenericNeedOneMon:
	db TX_COMPRESSED, $74, $59, $10, $15, $ac, $17, $e2, $b6
	db $ad, $e0, $41, $6a, $10, $cf, $33, $6e, $74, $f5
	db $16, $00, $24, $38, $0e, $57, $c2, $49, $61
	db $79, $5e, $dd, $f4, $e5, $43, $b4, $c7, $cf
	db $8d, $34

SpurgeGymB1F_MapEventHeader:: db 0, 0

.Warps: db 5
	warp_def 37, 25, 1, SPURGE_GYM_HOUSE
	warp_def 29, 9, 1, SPURGE_GYM_B2F_SIDESCROLL
	warp_def 17, 31, 2, SPURGE_GYM_B2F
	warp_def 7, 37, 3, SPURGE_GYM_B2F
	warp_def 5, 7, 4, SPURGE_GYM_B2F

.CoordEvents: db 0

.BGEvents: db 1
	signpost 27, 37, SIGNPOST_READ, SpurgeGymB1FButton

.ObjectEvents: db 9
	person_event SPRITE_POKE_BALL, 10, 2, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FThirdMon, EVENT_SPURGE_GYM_POKEMON_3
	person_event SPRITE_BOULDER, 29, 19, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TEXT, 0, SpurgeGymB1FBoulder, EVENT_SPURGE_GYM_PUSHROCK
	person_event SPRITE_PRYCE, 8, 20, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FCadence, EVENT_SPURGE_GYM_B1F_CADENCE
	person_event SPRITE_FALKNER, 27, 32, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FJosiah, EVENT_SPURGE_GYM_B1F_JOSIAH
	person_event SPRITE_MORTY, 6, 7, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FEdison, EVENT_SPURGE_GYM_B1F_EDISON
	person_event SPRITE_BUGSY, 8, 37, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FRinji, EVENT_SPURGE_GYM_B1F_RINJI
	person_event SPRITE_ROCK, 33, 15, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FExplodingRock, EVENT_SPURGE_GYM_SMASHROCK
	person_event SPRITE_POKE_BALL, 26, 19, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_PURPLE, PERSONTYPE_ITEMBALL, 1, DYNAMITE, EVENT_SPURGE_GYM_B1F_DYNAMITE
	person_event SPRITE_POKE_BALL, 8, 16, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SpurgeGymB1FSixthMon, EVENT_SPURGE_GYM_POKEMON_6

