SaffronGym_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SaffronGymSignpost:
	jumptext SaffronGymSignpost_Text

SaffronGym_Trainer_1:
	trainer EVENT_SAFFRON_GYM_TRAINER_1, PSYCHIC_T, 6, SaffronGym_Trainer_1_Text_BeforeBattle, SaffronGym_Trainer_1_Text_BattleWon, $0000, .Script

.Script
	end_if_just_battled
	jumptextfaceplayer SaffronGym_Trainer_1_Text_AfterBattle

SaffronGym_Trainer_2:
	trainer EVENT_SAFFRON_GYM_TRAINER_2, MEDIUM, 6, SaffronGym_Trainer_2_Text_BeforeBattle, SaffronGym_Trainer_2_Text_BattleWon, $0000, .Script

.Script
	end_if_just_battled
	jumptextfaceplayer SaffronGym_Trainer_2_Text_AfterBattle

SaffronGym_Trainer_3:
	trainer EVENT_SAFFRON_GYM_TRAINER_3, MEDIUM, 7, SaffronGym_Trainer_3_Text_BeforeBattle, SaffronGym_Trainer_3_Text_BattleWon, $0000, .Script

.Script
	end_if_just_battled
	jumptextfaceplayer SaffronGym_Trainer_3_Text_AfterBattle

SaffronGymGuide:
	jumptextfaceplayer SaffronGymGuide_Text

SaffronGymSabrina:
	opentext
	checkflag ENGINE_MARSHBADGE
	sif true
		jumptextfaceplayer SaffronGymSabrina_Text_AfterGettingBadge
	faceplayer
	writetext SaffronGymSabrina_Text_BeforeBattle
	winlosstext SaffronGymSabrina_Text_BattleWon, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer SABRINA, 1
	startbattle
	reloadmapafterbattle
	playmapmusic
	opentext
	faceplayer
	writetext SaffronGymSabrina_Text_ReceivedBadge
	playwaitsfx SFX_TCG2_DIDDLY_5
	writetext SaffronGymSabrina_Text_BeforeTM
	waitbutton
	givetm 69 + RECEIVED_TM
	setflag ENGINE_MARSHBADGE
	jumptext SaffronGymSabrina_Text_AfterTM

SaffronGymSignpost_Text:
	db TX_COMPRESSED, $51, $b8, $60, $b0, $92, $30, $81

	db $3e, $03, $1c, $f7, $26, $b7, $18, $a3, $55, $ac, $64
	db $da, $68

SaffronGym_Trainer_1_Text_BeforeBattle:
	db TX_COMPRESSED, $6e, $9d, $b8, $34, $4b, $49, $c1, $01, $a8
	db $d6, $f0, $70, $80, $82, $d2, $e2, $02, $d7, $69
	db $69, $a0

SaffronGym_Trainer_1_Text_BattleWon:
	db TX_COMPRESSED, $50, $d3, $29, $9b, $11, $6b, $09, $39
	db $79, $01, $6b, $bc
	db $69, $a0

SaffronGym_Trainer_1_Text_AfterBattle:
	db TX_COMPRESSED, $72, $85, $a5, $c4, $05, $ae, $ce, $56, $1a
	db $90, $f2, $2d, $61, $27, $26, $bf
	db $53, $40

SaffronGym_Trainer_2_Text_BeforeBattle:
	db TX_COMPRESSED, $17, $03, $0f, $b1, $02, $06, $b1, $da, $29

	db $40, $09, $1f, $21, $21, $f1
	db $a6, $80

SaffronGym_Trainer_2_Text_BattleWon:
	db TX_COMPRESSED, $ac, $16, $82, $d0, $5a, $08, $16
	db $d3, $40

SaffronGym_Trainer_2_Text_AfterBattle:
	db TX_COMPRESSED, $e0, $09, $29, $91, $58, $6d, $26, $b8, $f9
	db $bd, $a4, $05, $1f, $0a, $cf, $f0, $c1, $87
	db $d5, $48, $10, $35, $8e, $f8
	db $d3, $40

SaffronGym_Trainer_3_Text_BeforeBattle:
	db TX_COMPRESSED, $29, $27, $04, $06, $a3, $5c, $0e, $13, $7b
	db $d7, $ad, $21, $41, $c0, $41, $6a, $64, $f0, $3d, $b3
	db $ca, $a6, $42, $f9, $a2, $60, $b0, $bf, $1f, $3e
	db $34, $d0

SaffronGym_Trainer_3_Text_BattleWon:
	db TX_COMPRESSED, $53, $d5, $cb, $08, $62, $2d, $61, $27, $3c
	db $69, $a0

SaffronGym_Trainer_3_Text_AfterBattle:
	db TX_COMPRESSED, $28, $fb, $d8, $f9, $c0, $41, $69
	db $6f, $08, $0d, $46, $b8, $80, $b4, $b6, $4f
	db $8d, $34

SaffronGymSabrina_Text_AfterGettingBadge:
	db TX_COMPRESSED, $72, $85, $a5, $ce, $84, $18, $e6, $01
	db $5b, $c0, $82, $d2, $e0, $39, $5f, $09

	db $00, $04, $18, $d7, $52, $4f, $af, $9e, $63, $e0
	db $9e, $10, $80, $4c, $a4, $6c, $c1, $01, $a8, $d7

	db $e0, $05, $24, $e0, $80, $d4, $6b, $81, $c2, $74, $20
	db $c6, $f3, $fa, $0a, $6f, $50, $18, $ac, $e6

	db $80, $52, $19, $33, $03, $84, $10, $80, $4c, $a4, $6c
	db $bc, $20, $35, $1a
	db $fd, $4d

SaffronGymGuide_Text:
	db TX_COMPRESSED, $62, $60, $b8

	db $80, $51, $aa, $d6, $32, $6c, $7f, $72
	db $6f, $32, $9d, $27, $26, $89, $61, $89, $35

	db $80, $ab, $56, $22, $20, $12, $2c, $df
	db $79, $66, $c9, $92, $fa, $0b, $f1, $01, $96, $b0
	db $4a, $88, $1b, $96, $19, $c9, $dc, $e8, $51, $7c
	db $69, $a0

SaffronGymSabrina_Text_BeforeBattle:
	db TX_COMPRESSED, $75, $14, $88, $75, $40, $41, $6a, $54, $6b
	db $37, $99, $0b, $e3, $27, $3e

	db $00, $ea, $27, $73, $36, $03, $0d, $03, $09, $20, $70
	db $78, $10, $5a, $5c, $d5, $ac, $60, $db

	db $d0, $08, $30, $63, $5e, $f6, $02, $3d, $5a
	db $1e, $de, $43

	db $e0, $0e, $af, $14, $7c, $14, $cb, $56, $0a, $6a, $26
	db $bc, $c2, $04, $fc, $c7, $3d, $c9, $ae, $58

	db $40, $08, $58, $41, $87, $93, $8a, $f7, $3c, $9a
	db $1e, $b0, $cd, $20, $20, $90, $e5, $49

	db $08, $04, $ea, $20, $85, $84, $18, $c9, $12, $37
	db $de, $0a, $e2, $4d, $68, $3e
	db $e0, $aa, $a0, $ae, $d2, $0b

	db $c0, $14, $0c, $8c, $9c, $04, $16, $a5, $5a, $4b, $96
	db $17, $95, $ed, $df, $4f, $f1, $d4, $a8, $7d

	db $e8, $04, $24, $35, $40, $41, $6a, $5a
	db $4d, $e3, $a7, $6c, $c9, $70, $38, $47, $c1
	db $2a, $10, $80, $4c, $a4, $6c, $cd, $56, $3e, $8e, $c6, $68
	db $f5, $34

SaffronGymSabrina_Text_BattleWon:
	db TX_COMPRESSED, $75, $2a, $d4, $46, $89, $aa, $fa, $72
	db $c2, $f6, $01, $59, $a0, $ce, $5a, $46
	db $85, $5a, $f8, $5a, $25, $c0, $e1, $04, $06, $a3, $5f

	db $80, $39, $42, $d4, $3d, $59, $0f, $32, $d2
	db $6f, $0a, $ea, $d0, $98, $25, $b9, $e4
	db $fd, $4d

SaffronGymSabrina_Text_ReceivedBadge:
	db TX_COMPRESSED, $a7, $8e, $2c, $d9, $31, $83, $1e
	db $5e, $15, $d5, $a1, $30, $4b, $73, $c9
	db $fa, $9a

SaffronGymSabrina_Text_BeforeTM:
	db TX_COMPRESSED, $e1, $e9, $ea, $0e, $5e, $a9, $1c, $b4, $8d
	db $0f, $72, $3c, $2e, $6a, $25, $47, $de
	db $fa, $9a

SaffronGymSabrina_Text_AfterTM:
	db TX_COMPRESSED, $29, $23, $44, $28, $56, $0d
	db $0f, $28, $dc, $0f, $96, $b5, $79

	db $f0, $02, $92, $34, $47, $c2, $0c, $70, $42, $cc, $18, $c9, $68
	db $78, $10, $5a, $5c, $11, $ab, $b0, $53, $05, $85

	db $f0, $0a, $cc, $64, $e6, $6e, $18, $1b, $36, $79, $8a, $c1
	db $3c, $c8, $5f, $7c, $24, $88, $bd, $b6

	db $90, $01, $90, $93, $23, $b1, $84, $88, $98, $05
	db $6f, $60, $30, $63, $96, $d2, $c8, $8f
	db $53, $40

SaffronGym_MapEventHeader ;filler
	db 0, 0

;warps
	db 35
	warp_def $f, $b, 10, SAFFRON_GYM
	warp_def $3, $1, 16, SAFFRON_GYM
	warp_def $3, $5, 22, SAFFRON_GYM
	warp_def $3, $9, 11, SAFFRON_GYM
	warp_def $3, $b, 17, SAFFRON_GYM
	warp_def $3, $f, 23, SAFFRON_GYM
	warp_def $3, $13, 12, SAFFRON_GYM
	warp_def $5, $1, 18, SAFFRON_GYM
	warp_def $5, $5, 24, SAFFRON_GYM
	warp_def $5, $9, 13, SAFFRON_GYM
	warp_def $5, $b, 19, SAFFRON_GYM
	warp_def $5, $f, 25, SAFFRON_GYM
	warp_def $5, $13, 14, SAFFRON_GYM
	warp_def $9, $1, 20, SAFFRON_GYM
	warp_def $9, $5, 26, SAFFRON_GYM
	warp_def $9, $f, 15, SAFFRON_GYM
	warp_def $9, $13, 21, SAFFRON_GYM
	warp_def $b, $1, 27, SAFFRON_GYM
	warp_def $b, $5, 28, SAFFRON_GYM
	warp_def $b, $f, 6, SAFFRON_GYM
	warp_def $b, $13, 5, SAFFRON_GYM
	warp_def $f, $1, 31, SAFFRON_GYM
	warp_def $f, $5, 4, SAFFRON_GYM
	warp_def $f, $f, 3, SAFFRON_GYM
	warp_def $f, $13, 30, SAFFRON_GYM
	warp_def $11, $1, 2, SAFFRON_GYM
	warp_def $11, $5, 1, SAFFRON_GYM
	warp_def $11, $f, 29, SAFFRON_GYM
	warp_def $11, $13, 7, SAFFRON_GYM
	warp_def $9, $b, 1, SAFFRON_GYM
	warp_def $11, $8, 2, SAFFRON_CITY
	warp_def $11, $9, 2, SAFFRON_CITY
	warp_def $0, $2, 33, SAFFRON_GYM
	warp_def $0, $1, 1, SAFFRON_GYM
	warp_def $0, $0, 1, SAFFRON_GYM

	;xy triggers
	db 0

	;signposts
	db 1
	signpost 15, 8, SIGNPOST_READ, SaffronGymSignpost

	;people-events
	db 5
	person_event SPRITE_YOUNGSTER, 4, 10, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_RED, 2, 2, SaffronGym_Trainer_1, -1
	person_event SPRITE_GRANNY, 10, 3, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_RED, 2, 2, SaffronGym_Trainer_2, -1
	person_event SPRITE_GRANNY, 10, 17, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_RED, 2, 2, SaffronGym_Trainer_3, -1
	person_event SPRITE_SABRINA, 8, 9, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SaffronGymSabrina, -1
	person_event SPRITE_GYM_GUY, 14, 9, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SaffronGymGuide, -1

