Route85_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

Route85DirectionsSign:
	db TX_COMPRESSED, $13, $59, $e4, $e1, $4e, $b2, $7d, $1e, $c2, $83, $51
	db $29, $e1, $09, $ad, $5e, $29, $8d, $67, $d1, $f2, $9b
	db $13, $58, $1c, $8d, $ba, $0c, $6b, $22
	db $29, $a0

Route85EntranceSign:
	db TX_COMPRESSED, $17, $12, $d7, $a4, $64
	db $e9, $a0

Route85_Item:
	db DRAGON_FANG, 1

Route85FruitTree:
	fruittree 19

Route85_Trainer_1:
	trainer EVENT_ROUTE_85_TRAINER_1, BIRD_KEEPER, 3, .before_battle_text, .battle_won_text, $0000, .Script

.Script:
	end_if_just_battled
	opentext
	checkevent EVENT_ARRESTED_PALETTE_BLACK
	sif false
		jumptext .after_battle_undercover_text
	jumptext .after_battle_not_undercover_text

.before_battle_text
	db TX_COMPRESSED, $62, $d2, $7f, $10, $18, $08, $2d, $17, $1c
	db $d7, $b8, $77, $a7, $76, $73, $87, $6d, $61, $ef, $4d, $74
	db $b4, $d0

.battle_won_text
	db TX_COMPRESSED, $75, $19, $d2, $53, $22, $b3, $e8, $cc, $18, $e3
	db $a7, $ba, $14, $5c, $b0, $cd, $9c, $3b, $d3, $bb
	db $35, $5c, $3b, $6b, $0f, $7a, $6b
	db $e3, $4d

.after_battle_not_undercover_text
	db TX_COMPRESSED, $74, $59, $2a, $0a, $c9, $02, $d5
	db $bd, $b8, $59, $ae, $6c, $57, $b7, $7d
	db $30, $15, $0e, $d3, $36, $70, $ef, $4e, $ec
	db $de, $e1, $db, $58, $7b, $d3, $5f
	db $1a, $68

.after_battle_undercover_text
	db TX_COMPRESSED, $75, $71, $06, $6f, $a2, $74, $6a, $47, $2d
	db $26, $f0, $86, $96, $20, $28, $38, $1c, $20, $20, $b4
	db $b0, $0c, $ac, $ea, $83, $44, $09, $3a, $0a, $58
	db $5e, $ab, $51, $67, $2c, $6f, $9f

	db $80, $53

	db $c0, $02, $9e, $08, $df, $47, $7e

	db $00, $52, $4c, $92, $a4, $82, $9a, $b3, $96, $93
	db $79, $90, $88, $44, $e8, $42, $a4, $32, $73, $30, $0a
	db $d5, $02, $0b, $53, $96, $81, $22
	db $96, $9a

Route85_Trainer_2:
	trainer EVENT_ROUTE_85_TRAINER_2, PSYCHIC_T, 3, .before_battle_text, .battle_won_text, $0000, .Script

.Script:
	end_if_just_battled
	checkevent EVENT_ARRESTED_PALETTE_BLACK
	sif false
		jumptext .after_battle_undercover_text
	jumptext .after_battle_not_undercover_text

.before_battle_text
	db TX_COMPRESSED, $ad, $67, $01, $05, $a9, $d0, $85, $48, $64
	db $e5, $ec, $02, $b8, $08, $2d, $2e, $2b, $6b, $39, $05
	db $4b, $4d

.battle_won_text
	db TX_COMPRESSED, $53, $19, $0f, $f1, $d3, $87, $b1, $17, $a0
	db $9e, $0b, $57, $03, $84, $04, $16, $97, $2a, $d0, $5e
	db $a6, $80

.after_battle_not_undercover_text
	db TX_COMPRESSED, $74, $59, $10, $ce, $ac, $f3, $03
	db $83, $d6, $90, $a0, $e7, $0e, $f4, $ee
	db $cd, $57, $0e, $da, $c3, $de, $9a, $d1

	db $e0, $0e, $98, $0e, $24, $f5, $79, $96, $9d
	db $b7, $ad, $26, $0a, $64, $32, $a4, $ed, $cb, $49, $82
	db $01, $56, $92, $e5, $43, $b4, $85, $ab
	db $7a, $a0, $ad, $60, $86, $4e, $66, $ab, $0b
	db $56, $a9, $90, $91, $06, $2c, $da, $32, $32, $68
	db $f5, $34

.after_battle_undercover_text
	db TX_COMPRESSED, $ad, $13, $a1, $27, $33, $51, $07
	db $6f, $64, $26, $82, $53, $20, $c8, $0c, $1e, $83
	db $18, $07, $cf, $f1, $d4, $a8, $24, $a6, $45
	db $66, $f2, $cc, $40, $57, $63, $27, $30, $10, $5a
	db $5a, $a4, $24, $c9, $a4, $1f, $3a, $44
	db $7a, $9a

Route85Officer:
	faceplayer
	opentext
	writetext .officer_text
	writetext .black_text
	stopfollow
	warp PHACELIA_POLICE_F2, 3, 1
	spriteface PLAYER, LEFT
	spriteface 2, RIGHT
	opentext
	writetext .need_suit_back_text
	callasm .restore_sprite
	setevent EVENT_ROUTE_85_POLICEMAN_GONE
	clearevent EVENT_IN_UNDERCOVER_MISSION
	clearevent EVENT_PALETTE_BLACK_FOLLOWING
	setevent EVENT_ARRESTED_PALETTE_BLACK
	closetext
	callasm CancelMapSign
	opentext
	writetext .after_arrest_text
	givetm HM_ROCK_SMASH + RECEIVED_TM
	jumptext .after_giving_HM_text

.restore_sprite
	ld a, [wSavedPlayerCharacteristics2]
	ld [wPlayerGender], a
	ret

.officer_text
	db TX_COMPRESSED, $77, $86, $03, $64, $d6, $e3, $18, $4b, $3d
	db $b7, $a9, $c0, $ab, $fc, $75, $14, $88, $75, $40, $41
	db $69, $53, $21, $6b, $b9, $99, $0c, $1d
	db $fa, $9e, $20

.black_text
	db TX_COMPRESSED, $12, $ee, $b2, $a4, $e3, $1b, $a4, $14, $c8, $f3, $1d
	db $3d, $86, $f7, $b3, $00, $ae, $5a, $76, $e9
	db $69, $e2

.need_suit_back_text
	db TX_COMPRESSED, $74, $e1, $ec, $21, $9e, $65, $a7
	db $6d, $e4, $34, $3b, $8a, $f5, $95, $2f
	db $53, $c4

.after_arrest_text
	db TX_COMPRESSED, $29, $27, $39, $6b, $57, $98, $32, $4c, $16, $12
	db $5b, $c1, $c2, $5a, $4e, $0b, $36, $b5, $6b, $05
	db $88, $07, $20, $9f, $95, $0f, $bd, $9d, $3b, $80, $82
	db $d3, $d6, $95, $85, $ae, $53, $08, $1a

	db $bc, $03, $87, $a7, $a8, $39, $bd, $40, $65, $ea, $91
	db $bd, $69, $1a, $27, $23, $c2
	db $fd, $4f, $10

.after_giving_HM_text
	db TX_COMPRESSED, $62, $2a, $2c, $0b, $70, $68, $8e, $40, $b2
	db $a4, $f2, $87, $f5, $09
	
	db $f0, $07, $28, $5a, $70, $f6, $2b, $39, $aa, $fa, $72
	db $c2, $f2, $b5, $9e, $a9, $4e, $84, $28, $38, $b0, $b2, $a4
	db $85, $55, $0e, $d3, $2d, $23, $47
	
	db $80, $31, $0d, $46, $0c, $6b, $fc, $04, $16, $9c, $3d
	db $78, $86, $79, $96, $93, $8c, $8e, $c1, $62
	
	db $00, $af, $73, $c9, $c5, $67, $80, $56, $70, $10, $5a
	db $79, $9d, $24, $69, $07, $2d, $23, $47
	db $1a, $68

Route85PaletteBlack:
	faceplayer
	opentext
	checkevent EVENT_PALETTE_BLACK_FOLLOWING
	sif true
		jumptext .already_following_text
	setevent EVENT_PALETTE_BLACK_FOLLOWING
	clearevent EVENT_ROUTE_85_POLICEMAN_GONE
	follow PLAYER, 6
	appear 3
	jumptext .text

.text
	db TX_COMPRESSED, $62, $60

	db $bc, $00, $4c, $b4, $8b, $97, $aa, $43, $27, $33
	db $5e, $43, $e1, $52, $38, $ad, $67, $aa, $5e

	db $01, $4f

	db $00, $07, $69, $fc, $a9, $3b, $74

	db $a0, $1c, $a1, $6a, $60, $16, $89, $98, $16
	db $96, $f7, $4f, $72, $6b, $fc, $59, $ef, $7a, $0a

	db $94, $06, $39, $ee, $65, $a4, $e5, $5a, $0b
	db $d4, $d0

.already_following_text
	db TX_COMPRESSED, $50, $1f, $cd, $59, $ca, $8e, $72, $11, $93
	db $97, $82, $b9, $52, $76, $e9
	db $69, $a0

Route85_MapEventHeader:: db 0, 0

.Warps: db 3
	warp_def 7, 7, 2, PHACELIA_EAST_EXIT
	warp_def 6, 61, 2, ROUTE_82_MONKEY
	warp_def 3, 57, 1, FIRELIGHT_F1

.CoordEvents: db 0

.BGEvents: db 2
	signpost 11, 16, SIGNPOST_LOAD, Route85DirectionsSign
	signpost 7, 56, SIGNPOST_LOAD, Route85EntranceSign

.ObjectEvents: db 9
	person_event SPRITE_BIRDKEEPER, 8, 30, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, PERSONTYPE_TRAINER, 3, Route85_Trainer_1, -1
	person_event SPRITE_OFFICER, 8, 7, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 5, Route85Officer, EVENT_ROUTE_85_POLICEMAN_GONE
	person_event SPRITE_ROCK, 7, 57, SPRITEMOVEDATA_SUDOWOODO, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_JUMPSTD, 0, smashrock, -1
	person_event SPRITE_ROCK, 15, 40, SPRITEMOVEDATA_SUDOWOODO, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_JUMPSTD, 0, smashrock, -1
	person_event SPRITE_PALETTE_PATROLLER, 9, 52, SPRITEMOVEDATA_WANDER, 2, 2, -1, -1, PAL_OW_SILVER, PERSONTYPE_SCRIPT, 5, Route85PaletteBlack, EVENT_ARRESTED_PALETTE_BLACK
	person_event SPRITE_PSYCHIC, 9, 44, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 8, PERSONTYPE_TRAINER, 2, Route85_Trainer_2, -1
	person_event SPRITE_POKE_BALL, 13, 61, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 0, Route85_Item, EVENT_ROUTE_85_ITEM_1
	person_event SPRITE_POKE_BALL, 15, 43, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_TMHMBALL, TM_ROLLOUT, 0, EVENT_ROUTE_85_TM
	person_event SPRITE_FRUIT_TREE, 6, 44, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 3, Route85FruitTree, -1

