CastroGym_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

CastroGym_TripleSpinMovement:
	turn_head_down
	turn_head_left
	turn_head_up
	turn_head_right
	turn_head_down
	turn_head_left
	turn_head_up
	turn_head_right
	turn_head_down
	turn_head_left
	turn_head_up
	turn_head_right
	turn_head_down
	step_end

CastroGymHelperGuy:
	db TX_COMPRESSED, $6e, $9d, $bc, $51, $a1, $14

	db $a0, $2b, $ef, $65, $a4, $d0, $70, $a5, $e8, $c8, $6b
	db $43, $dd, $08, $54, $a5, $a4, $e2, $35, $f3, $fc, $56, $d5
	db $80, $09, $3a, $0a, $04, $87, $06, $89, $69
	db $37, $ba, $7b, $93, $5f
	db $1a, $68

CastroGymLeader:
	checkflag ENGINE_FISTBADGE
	sif false, then
		applymovement 2, CastroGym_TripleSpinMovement
		faceplayer
		showtext .before_battle_text
		winlosstext .battle_won_text, 0
		loadtrainer KOJI, 1
		startbattle
		reloadmapafterbattle
		variablesprite SPRITE_CASTRO_GYM_1, SPRITE_LASS
		variablesprite SPRITE_CASTRO_GYM_2, SPRITE_LASS
		variablesprite SPRITE_CASTRO_GYM_3, SPRITE_LASS
		variablesprite SPRITE_CASTRO_GYM_4, SPRITE_YOUNGSTER
		special RunSpritesCallback
		opentext
		writetext .got_badge_text
		playwaitsfx SFX_GET_BADGE
		setflag ENGINE_FISTBADGE
		writetext .give_TM_text
		givetm TM_COUNTER + RECEIVED_TM
	sendif
	jumptextfaceplayer .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $ad, $f8, $ea, $09, $80, $d3, $83, $a5

	db $00, $dd, $20, $bf, $01, $1a, $3f, $1d, $4d, $7f
	db $8d, $3c, $40

.battle_won_text
	db TX_COMPRESSED, $6e, $7d, $ec, $c8, $48, $7c

	db $40, $31, $35, $9f

	db $10, $05, $24, $e2, $98, $d1, $70, $4b, $73, $c9, $f1
	db $a6, $80

.got_badge_text
	db TX_COMPRESSED, $a7, $8e, $2c, $d9, $31, $83, $1e
	db $5e, $53, $1a, $2e, $09, $6e, $79, $3f
	db $53, $40

.give_TM_text
	db TX_COMPRESSED, $62, $6b, $3e

	db $20, $0a, $d5, $23, $96, $91, $a2, $14, $2b
	db $c6, $9e, $20

.after_battle_text
	db TX_COMPRESSED, $63, $a9

	db $e2, $00, $a4, $ed, $ca, $b5, $12, $9c, $08, $2c, $1a
	db $eb, $c8, $11, $ab, $58, $c9, $cf
	db $1a, $68

CastroGymTrainer1:
	checkevent EVENT_CASTRO_GYM_TRAINER_1
	sif true
		jumptextfaceplayer .after_battle_text
	applymovement 3, CastroGym_TripleSpinMovement
	faceplayer
	variablesprite SPRITE_CASTRO_GYM_1, SPRITE_LASS
	special RunSpritesCallback
	faceplayer
	showtext .before_battle_text
	winlosstext .battle_won_text, 0
	loadtrainer LASS, 9
	startbattle
	sif true
		variablesprite SPRITE_CASTRO_GYM_1, SPRITE_KOJI
	reloadmapafterbattle
	setevent EVENT_CASTRO_GYM_TRAINER_1
	end

.before_battle_text
	db TX_COMPRESSED, $13, $3a, $23, $48, $68
	db $37, $82, $40, $bf, $b6, $11, $01, $31
	db $ea, $a1, $a2, $20, $31, $4b, $6a, $d1, $8f
	db $8d, $3c, $40

.battle_won_text
	db TX_COMPRESSED, $62, $35, $8e, $24, $6b, $1f
	db $1a, $68

.after_battle_text
	db TX_COMPRESSED, $73, $d5, $bb, $bb
	db $c6, $9a

CastroGymTrainer2:
	checkevent EVENT_CASTRO_GYM_TRAINER_2
	sif true
		jumptextfaceplayer .after_battle_text
	applymovement 4, CastroGym_TripleSpinMovement
	faceplayer
	variablesprite SPRITE_CASTRO_GYM_2, SPRITE_LASS
	special RunSpritesCallback
	faceplayer
	showtext .before_battle_text
	winlosstext .battle_won_text, 0
	loadtrainer LASS, 10
	startbattle
	sif true
		variablesprite SPRITE_CASTRO_GYM_2, SPRITE_KOJI
	reloadmapafterbattle
	setevent EVENT_CASTRO_GYM_TRAINER_2
	end

.before_battle_text
	db TX_COMPRESSED, $6e, $7d, $ef, $e0, $20, $b5, $19, $48, $50
	db $6f, $34, $4a, $86, $83, $e8, $2f
	db $53, $c4

.battle_won_text
	text "Ack!"
	done

.after_battle_text
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $38, $f8, $56
	db $6f, $32, $9d, $23, $26, $8f
	db $53, $40

CastroGymTrainer3:
	checkevent EVENT_CASTRO_GYM_TRAINER_3
	sif true
		jumptextfaceplayer .after_battle_text
	applymovement 5, CastroGym_TripleSpinMovement
	faceplayer
	variablesprite SPRITE_CASTRO_GYM_3, SPRITE_LASS
	special RunSpritesCallback
	faceplayer
	showtext .before_battle_text
	winlosstext .battle_won_text, 0
	loadtrainer PICNICKER, 5
	startbattle
	sif true
		variablesprite SPRITE_CASTRO_GYM_3, SPRITE_KOJI
	reloadmapafterbattle
	setevent EVENT_CASTRO_GYM_TRAINER_3
	end

.before_battle_text
	db TX_COMPRESSED, $13, $01, $a7, $07, $06, $88, $90, $df

	db $80, $70, $2c, $d0, $81, $93, $99, $d1, $a9, $1c, $48, $df
	db $78, $68, $a7

	db $80, $05, $41, $26, $4d, $78, $35, $de
	db $34, $f1, $00

.battle_won_text
	db TX_COMPRESSED, $6f, $a8, $25, $32, $21, $a1, $02, $02, $83
	db $cb, $d6, $18, $9d, $10, $20, $c9
	db $c6, $9a

.after_battle_text
	db TX_COMPRESSED, $6d, $d2, $53, $25, $5a, $3b, $98, $05
	db $6f, $31, $de, $f4, $35, $19, $93
	db $8d, $34

CastroGymTrainer4:
	checkevent EVENT_CASTRO_GYM_TRAINER_4
	sif true
		jumptextfaceplayer .after_battle_text
	applymovement 6, CastroGym_TripleSpinMovement
	faceplayer
	variablesprite SPRITE_CASTRO_GYM_4, SPRITE_YOUNGSTER
	special RunSpritesCallback
	faceplayer
	showtext .before_battle_text
	winlosstext .battle_won_text, 0
	loadtrainer CAMPER, 6
	startbattle
	sif true
		variablesprite SPRITE_CASTRO_GYM_4, SPRITE_KOJI
	reloadmapafterbattle
	setevent EVENT_CASTRO_GYM_TRAINER_4
	end

.before_battle_text
	db TX_COMPRESSED, $07, $8c, $94, $e6, $a2, $6a, $ce, $20
	db $2f, $32, $10, $f7
	db $8d, $3c, $40

.battle_won_text
	db TX_COMPRESSED, $07, $86, $e2, $14, $87, $de, $9e
	db $5e, $32, $05, $ae, $53
	db $c6, $9a

.after_battle_text
	db TX_COMPRESSED, $28, $6f, $9c, $b0, $c4, $5b, $59
	db $04, $f1, $06, $4a, $71, $ab, $43, $50, $64, $45, $9e
	db $e5, $50, $70, $82, $16, $76, $64, $c8, $c9, $cf
	db $a9, $a0

CastroGym_MapEventHeader:: db 0, 0

.Warps
	db 2
	warp_def $11, $3, 1, CASTRO_VALLEY
	warp_def $11, $4, 1, CASTRO_VALLEY

.CoordEvents
	db 0

.BGEvents
	db 0

.ObjectEvents
	db 6
	person_event SPRITE_KOJI, 10, 8, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, CastroGymLeader, -1
	person_event SPRITE_KOJI, 13, 2, SPRITEMOVEDATA_SPINRANDOM_FAST, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, CastroGymTrainer1, -1
	person_event SPRITE_KOJI, 7, 4, SPRITEMOVEDATA_SPINRANDOM_FAST, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, CastroGymTrainer2, -1
	person_event SPRITE_KOJI, 6, 26, SPRITEMOVEDATA_SPINRANDOM_FAST, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, CastroGymTrainer3, -1
	person_event SPRITE_KOJI, 1, 6, SPRITEMOVEDATA_SPINRANDOM_FAST, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, CastroGymTrainer4, -1
	person_event SPRITE_GYM_GUY, 15, 7, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_TEXTFP, 0, CastroGymHelperGuy, -1

