SpurgeGymB2F_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SpurgeGymB2FSignpost1:
	checkevent EVENT_SPURGE_GYM_SWITCH_ENABLED
	iftrue SpurgeGymB2F_2fc112
	playsound SFX_ENTER_DOOR
	setevent EVENT_SPURGE_GYM_SWITCH_ENABLED
	jumptext SpurgeGymB2FSignpost1_Text_2fc113

SpurgeGymB2F_2fc112:
	jumptext SpurgeGymB2FSignpost1_Text_ButtonAlreadyPushed

SpurgeGymPokeball2:
	setevent EVENT_SPURGE_GYM_POKEMON_4
	jump SpurgeGymGetPokemon

SpurgeGymPokeball1:
	setevent EVENT_SPURGE_GYM_POKEMON_1

SpurgeGymGetPokemon:
	callasm SpurgeGymNextPokemon
	opentext
	writetext SpurgeGymB2FNPC1_Text_2ff222
	cry 0
	disappear LAST_TALKED
	closetext
	end

SpurgeGymNextPokemon:
	ld hl, wPartyCount
	inc [hl]
	ld c, [hl]
	ld b, 0
	add hl, bc
	ld de, wBackupSecondPartySpecies
	ld a, [de]
	ld [hli], a
	ld [hScriptVar], a
	ld a, [hl]
	ld [de], a
	ld [hl], $ff
	ld a, c
	dec a
	ld hl, wPartyMonNicknames
	call SkipNames
	ld d, h
	ld e, l
	ld hl, wStringBuffer1
	jp CopyName2

SpurgeGymB2FNPC3:
	checkcode VAR_PARTYCOUNT
	if_not_equal 6, .didntGetAllPokes

	faceplayer
	opentext
	writetext SpurgeGymB2FNPC3_Text_2fc64c
	waitbutton
	winlosstext SpurgeGymB2FNPC3Text_2fc6f8, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer BRUCE, 1
	startbattle
	reloadmapafterbattle
	playmapmusic
	opentext
	writetext SpurgeGymB2FNPC3_Text_2fc71a
	playwaitsfx SFX_TCG2_DIDDLY_5
	setflag ENGINE_NALJOBADGE
	special RestartMapMusic
	writetext SpurgeGymB2FNPC3_Text_2fc733
	waitbutton
	givetm 43 + RECEIVED_TM
	opentext
	writetext SpurgeGymB2FNPC3_Text_2fc75c
	waitbutton
	writetext SpurgeGymB2FNPC3_Text_2fc7c6
	waitbutton
	setevent EVENT_SPURGE_GYM_DEFEATED
	special Special_BattleTowerFade
	playwaitsfx SFX_WARP_FROM
	clearevent EVENT_ENTERED_SPURGE_GYM
	warp SPURGE_CITY, 34, 6
	end

.didntGetAllPokes
	jumptextfaceplayer FoundBruceDidntGetAllPokeText

FoundBruceDidntGetAllPokeText:
	db TX_COMPRESSED, $50, $1f, $c0, $41, $6a, $64, $79, $8f, $e9, $00
	db $bd, $bc, $9c, $b0, $cc, $06, $4c, $c7, $cf

	db $88, $06, $21, $a8, $c1, $8d, $7f, $80, $82, $d4, $c8, $f2, $4a
	db $63, $d8, $0c, $99, $9b, $de, $c0, $e1, $01, $05, $a5
	db $aa, $07, $2b, $e1, $24, $04, $77

	db $c4, $03, $68, $5f, $38, $af, $59, $52, $95, $24, $c9, $01, $05
	db $a7, $b0, $19, $33, $2d, $26, $fc, $de, $f7
	db $d4, $d0

SpurgeGymB2FSignpost1_Text_2fc113:
	db TX_COMPRESSED, $e1, $69, $09, $3c, $cb, $49
	db $bc, $ad, $ab, $b0, $93

	db $c0, $01, $e1, $b8, $86, $96, $72, $a4, $ed
	db $bd, $69, $db, $99, $1e, $69, $e0
	db $a6, $80

SpurgeGymB2FSignpost1_Text_ButtonAlreadyPushed:
	db TX_COMPRESSED, $29, $27, $15, $b5, $76, $12, $44, $ea
	db $1e, $de, $ac, $f7, $20, $a2, $b3, $32
	db $2a, $10, $d2, $12, $79
	db $f5, $34

SpurgeGymB2FNPC1_Text_2ff222:
	db TX_COMPRESSED, $a7, $8e, $60, $16, $89
	db $97, $81, $c8
	db $e3, $4d

SpurgeGymB2FNPC3_Text_2fc64c:
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9c, $29, $7a, $32, $1a, $f8

	db $80, $12, $36, $75, $a4, $1c, $0e, $10, $10, $5a
	db $5b, $ca, $d7, $a0, $c6, $b0, $51, $09, $0d, $44
	db $55, $69, $58, $5a, $e5, $31, $f0, $50, $43, $42, $6c, $4d, $f4

	db $fe, $01, $d4, $4e, $83, $1c, $c9, $b2, $3c, $9e, $65
	db $85, $e4, $b4, $fa, $be, $82, $9a, $cb, $26, $22, $e0, $20, $b4
	db $b5, $4c, $a7, $7b, $d3, $27, $27, $36, $e7, $75, $17

	db $c4, $03, $a9, $af, $c1, $25, $b4, $c9, $fe, $5a
	db $4d, $e1, $0b, $0b, $59, $8a, $2c, $cf, $b1, $84, $09
	db $f5, $58, $e7, $b9, $35, $c0, $e1, $01, $fb, $da, $70, $3c

	db $40, $14, $93, $99, $3c, $0c, $88, $38, $ce, $88, $d0
	db $2f, $2b, $1f, $47, $63, $34, $40, $e1, $11, $66, $7d

	db $00, $0e, $57, $c2, $48, $ce, $92, $10, $c1, $8d
	db $6f, $2b, $38, $fe, $db, $29, $3c, $f1

	db $01, $5a, $ce, $02, $0b, $51, $67, $b9, $05
	db $4b, $4d

SpurgeGymB2FNPC3Text_2fc6f8:
	db TX_COMPRESSED, $63, $4f, $02, $43, $55

	db $28, $06, $e7, $de, $fe, $10, $31, $fd, $bb, $35

	db $f8, $03, $94, $2d, $44, $e8, $31, $c3, $d5, $90
	db $f2, $f3, $e0, $a0, $96, $e7, $93, $fc, $d2, $66, $5a

	db $4c, $00, $44, $08, $0a, $ed, $a2, $0e, $c1, $4b
	db $0b, $cc, $85, $f1, $07, $67, $06, $49, $69
	db $35, $4e, $41, $d3, $81, $24, $c7, $3d, $e5, $a3
	db $e3, $4d

SpurgeGymB2FNPC3_Text_2fc71a:
	db TX_COMPRESSED, $a7, $8e, $2c, $d9, $31, $83, $1e
	db $5e, $07, $ef, $69, $c0, $c1, $2d, $cf, $27
	db $c6, $9a

SpurgeGymB2FNPC3_Text_2fc733:
	db TX_COMPRESSED, $75, $10, $d0, $81, $01, $41, $c7, $51, $90, $b5, $dc
	db $bd, $c8, $c1, $8e, $02, $0b, $52, $d2, $34, $4b, $08
	db $7d, $4d

SpurgeGymB2FNPC3_Text_2fc75c:
	db TX_COMPRESSED, $29, $23, $44, $28, $56, $0d
	db $0f, $29, $f7, $50, $98, $db, $a4, $20, $49

	db $c4, $03, $ab, $c5, $36, $08, $0d, $46, $bc, $1a
	db $eb, $ca, $2c, $cf, $b1, $f0, $83, $1c, $b4, $ed

	db $80, $4e, $a2, $5a, $4e, $32, $9d, $23
	db $26, $f0, $70, $9d, $0d, $46, $b1, $93, $99, $69

	db $30, $18, $04, $f1, $44, $08, $36, $47, $bd
	db $7b, $27, $81, $91, $07, $36, $2b, $1d, $f1
	db $a6, $80

SpurgeGymB2FNPC3_Text_2fc7c6:
	db TX_COMPRESSED, $6e, $7d, $ef, $e1, $03, $54, $1d, $e2
	db $7a, $c6, $f9, $cc, $02, $b8, $d2, $25
	db $85, $53, $fa, $a4, $70, $2d, $2e, $1d, $3a, $3b

	db $f0, $07, $51, $58, $f3, $01, $05
	db $a7, $b0, $d5, $9d, $47, $de
	db $fa, $9a

SpurgeGymB2F_MapEventHeader:: db 0, 0

.Warps: db 4
	warp_def 33, 3, 2, SPURGE_GYM_B2F_SIDESCROLL
	warp_def 3, 3, 3, SPURGE_GYM_B1F
	warp_def 3, 13, 4, SPURGE_GYM_B1F
	warp_def 15, 7, 5, SPURGE_GYM_B1F

.CoordEvents: db 0

.BGEvents: db 1
	signpost 1, 3, SIGNPOST_READ, SpurgeGymB2FSignpost1

.ObjectEvents: db 3
	person_event SPRITE_POKE_BALL, 24, 7, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeGymPokeball1, EVENT_SPURGE_GYM_POKEMON_1
	person_event SPRITE_POKE_BALL, 2, 12, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeGymPokeball2, EVENT_SPURGE_GYM_POKEMON_4
	person_event SPRITE_CLAIR, 13, 8, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BLUE, 0, 0, SpurgeGymB2FNPC3, -1

