MilosB2F_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1
	dbw MAPCALLBACK_TILES, .set_blocks

.set_blocks
	checkevent EVENT_0
	sif true
		scall MilosB2F_RedOff
	checkevent EVENT_1
	sif true
		scall MilosB2F_YellowOff
	checkevent EVENT_2
	sif true
		scall MilosB2F_GreenOff
	checkevent EVENT_3
	sif true
		scall MilosB2F_BrownOff
	return

MilosB2F_GreenOff:
	changeblock 26, 10, $36
	changeblock 30, 12, $51
	changeblock 30, 10, $52
	changeblock 32, 22, $50
	end

MilosB2F_RedOff:
	changeblock 12, 16, $51
	changeblock 12, 14, $52
	changeblock 0, 16, $6b
	end

MilosB2F_YellowOff:
	changeblock 14, 22, $77
	changeblock 22, 10, $51
	changeblock 22, 8, $52
	changeblock 24, 16, $50
	changeblock 26, 16, $50
	end

MilosB2F_BrownOff:
	changeblock 30, 4, $32
	changeblock 32, 8, $82
	changeblock 32, 12, $82
	changeblock 30, 20, $52
	changeblock 30, 22, $51
	changeblock 36, 14, $52
	changeblock 36, 16, $51
	end

MilosB2F_GreenOn:
	changeblock 26, 10, $7b
	changeblock 30, 12, $2f
	changeblock 30, 10, $30
	changeblock 32, 22, $4c
	end

MilosB2F_RedOn:
	changeblock 12, 16, $68
	changeblock 12, 14, $67
	changeblock 0, 16, $6a
	end

MilosB2F_YellowOn:
	changeblock 14, 22, $76
	changeblock 22, 10, $7e
	changeblock 22, 8, $7d
	changeblock 24, 16, $2e
	changeblock 26, 16, $2e
	end

MilosB2F_BrownOn:
	changeblock 30, 4, $33
	changeblock 32, 8, $4d
	changeblock 32, 12, $4d
	changeblock 30, 20, $49
	changeblock 30, 22, $48
	changeblock 36, 14, $49
	changeblock 36, 16, $48
	end

MilosB2F_Movement_SlideDown6:
	fast_slide_step_down
	fast_slide_step_down
MilosB2F_Movement_SlideDown4:
	fast_slide_step_down
	fast_slide_step_down
	fast_slide_step_down
	fast_slide_step_down
	step_end

MilosB2FHole1:
	spriteface 0, 0
	playsound SFX_RETURN
	showemote 0, 0, 32
	applymovement 0, MilosB2F_Movement_SlideDown6
	playsound SFX_STRENGTH
	earthquake 16
	end

MilosB2FHole2:
	spriteface 0, 0
	playsound SFX_RETURN
	showemote 0, 0, 32
	applymovement 0, MilosB2F_Movement_SlideDown4
	playsound SFX_STRENGTH
	earthquake 16
	end

MilosB2FHole3:
	spriteface 0, 0
	playsound SFX_RETURN
	showemote 0, 0, 32
	applymovement 0, MilosB2F_Movement_SlideDown6
	playsound SFX_STRENGTH
	earthquake 16
	end

MilosB2FColorSwitchExplanationSign:
	jumptext .text

.text
	db TX_COMPRESSED, $6d, $0f, $42, $b3, $cc, $45, $43, $b6, $52, $68
	db $7a, $a1, $f7, $b1, $94, $e9, $39
	db $30, $15, $24, $ed, $26, $b8, $af, $a1, $65, $49, $10, $38
	db $3d, $69, $38, $8d, $7c, $e3, $21, $e8
	db $56, $ab, $44, $08, $3d, $5c, $0a, $e1, $03, $7e
	db $a6, $80

MilosB2FGreenSwitch:
	opentext
	writetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_2, MilosB2F_GreenOff, MilosB2F_GreenOn
	reloadmappart
	closetextend

MilosB2FRedSwitch:
	opentext
	writetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_0, MilosB2F_RedOff, MilosB2F_RedOn
	reloadmappart
	closetextend

MilosB2FYellowSwitch:
	opentext
	writetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_1, MilosB2F_YellowOff, MilosB2F_YellowOn
	reloadmappart
	closetextend

MilosB2FBrownSwitch:
	opentext
	writetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_3, MilosB2F_BrownOff, MilosB2F_BrownOn
	reloadmappart
	closetextend

MilosB2F_Text_PulledSwitch::
	db TX_COMPRESSED, $a7, $8e, $08, $6b, $bd, $3c
	db $bd, $69, $38, $8a, $87, $6c, $a7
	db $8d, $3c, $40

MilosB2FLatinSign1:
	jumptext .text

.text
	db TX_COMPRESSED, $53, $ad, $b6, $29, $bb, $72, $14, $ea, $b8, $2e
	db $29, $ee, $1a, $ca, $17, $39, $05
	db $d4, $d0

MilosB2FLatinSign2:
	jumptext .text

.text
	text "SIC PARVIS MAGNA"
	done

MilosB2FLatinSign3:
	jumptext .text

.text
	db TX_COMPRESSED, $12, $74, $a2, $70, $56, $54, $13, $50, $38, $75, $1b, $5d, $14
	db $ed, $ee, $0a, $ca
	db $a6, $80

MilosB2FJump:
	playsound SFX_JUMP_OVER_LEDGE
	checkcode VAR_FACING
	sif >, 3
		writebyte 0
	anonjumptable
	dw .facing_down
	dw .facing_up
	dw .facing_left
	dw .facing_right

.facing_left
	applymovement PLAYER, .left_movement
	end

.facing_right
	applymovement PLAYER, .right_movement
.facing_down
.facing_up
	end

.left_movement
	jump_step_left
	step_end
.right_movement
	jump_step_right
	step_end

MilosB2F_PurplePatroller:
	trainer EVENT_MILOS_B2F_PURPLE_PATROLLER, PATROLLER, 7, .before_battle_text, .battle_won_text

	db TX_COMPRESSED, $72, $1e, $60, $d1, $2d, $60, $86, $4e, $65
	db $85, $e6, $43, $de, $9b, $37, $11, $6b, $d2, $72
	db $60, $02, $b5, $71, $09, $d5, $e5, $13, $05, $85
	db $f7, $b5, $61, $68, $99, $96, $93, $8b, $3e, $46, $12
	db $7a, $9a

.before_battle_text
	db TX_COMPRESSED, $29, $26, $b3, $c5, $36, $2f, $56
	db $6f, $0e, $cd, $f8, $80, $be, $75, $24, $d6
	db $6a, $86, $49, $69, $1a, $26, $5a, $7c, $47

	db $10, $0e, $b0, $95, $1c, $e4, $ee, $5a, $76
	db $fe, $f3, $90, $f3, $2a, $1f, $7b, $15, $9c, $06, $35, $82
	db $54, $23, $a7, $a8, $3c, $ca, $87, $69, $8d, $23
	db $d4, $d0

.battle_won_text
	db TX_COMPRESSED, $75, $32, $12, $53, $27, $27, $70, $77

	db $e0, $0e, $50, $b5, $32, $12, $53, $21, $83, $19, $22, $0c
	db $de, $69, $13, $51, $36, $5a, $56, $7b, $74, $f0
	db $53, $40

MilosB2F_BluePatroller:
	trainer EVENT_MILOS_B2F_BLUE_PATROLLER, PATROLLER, 10, .before_battle_text, .battle_won_text

	db TX_COMPRESSED, $75, $2a, $09, $29, $93, $9d, $19, $26, $90
	db $13, $cb, $34, $08, $36, $6e, $0f, $08, $ea, $29, $19, $88
	db $55, $d0, $a0, $64, $e6, $58, $62, $90, $f2, $8e
	db $34, $d0

.before_battle_text
	db TX_COMPRESSED, $74, $59, $1f, $69, $94, $c5, $67, $76, $6b
	db $78, $42, $cc, $46, $ac, $f3, $2d, $23
	db $42, $ab, $1b, $e7, $35, $61, $68, $99

	db $f0, $07, $28, $5a, $8a, $ce, $ec, $d7, $11, $61
	db $10, $f0, $83, $45, $9a, $c6, $4e, $63, $48, $fc, $40
	db $40, $39, $0f, $31, $fd, $05, $19, $09, $2c, $64, $68
	db $de, $a8, $76, $98, $91, $a2, $08, $ee, $91, $1e
	db $a6, $80

.battle_won_text
	db TX_COMPRESSED, $6d, $d2, $53, $20, $20, $b5, $29, $c6, $91
	db $6f, $74, $ee, $3e, $72, $a1, $92

	db $94, $03, $a9, $90, $92, $99, $2a, $d2, $13, $62, $b3
	db $7b, $49, $06, $4b, $35, $92, $60, $15, $98, $31, $af
	db $d4, $d0

MilosB2F_MapEventHeader:: db 0, 0

.Warps: db 3
	warp_def 5, 1, 2, MILOS_B1F
	warp_def 5, 39, 7, MILOS_F1
	warp_def 4, 15, 5, MILOS_B1F

.CoordEvents: db 3
	xy_trigger 0, 4, 21, 0, MilosB2FHole1, 0, 0
	xy_trigger 0, 8, 37, 0, MilosB2FHole2, 0, 0
	xy_trigger 0, 4, 13, 0, MilosB2FHole3, 0, 0

.BGEvents: db 12
	signpost 6, 7, SIGNPOST_READ, MilosB2FColorSwitchExplanationSign
	signpost 5, 7, SIGNPOST_UP, MilosB2FColorSwitchExplanationSign
	signpost 10, 27, SIGNPOST_RIGHT, MilosB2FGreenSwitch
	signpost 16, 0, SIGNPOST_LEFT, MilosB2FRedSwitch
	signpost 22, 14, SIGNPOST_LEFT, MilosB2FYellowSwitch
	signpost 4, 31, SIGNPOST_RIGHT, MilosB2FBrownSwitch
	signpost 4, 23, SIGNPOST_READ, MilosB2FLatinSign1
	signpost 3, 23, SIGNPOST_UP, MilosB2FLatinSign1
	signpost 16, 17, SIGNPOST_READ, MilosB2FLatinSign2
	signpost 15, 17, SIGNPOST_UP, MilosB2FLatinSign2
	signpost 24, 1, SIGNPOST_READ, MilosB2FLatinSign3
	signpost 23, 1, SIGNPOST_UP, MilosB2FLatinSign3

.ObjectEvents: db 5
	person_event SPRITE_POKE_BALL, 24, 0, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, PROTECTOR, EVENT_MILOS_B2F_ITEM_PROTECTOR
	person_event SPRITE_POKE_BALL, 12, 18, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, RAZOR_CLAW, EVENT_MILOS_B2F_ITEM_RAZOR_CLAW
	person_event SPRITE_PALETTE_PATROLLER, 24, 21, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_PURPLE, PERSONTYPE_GENERICTRAINER, 1, MilosB2F_PurplePatroller, EVENT_MILOS_B2F_PURPLE_PATROLLER
	person_event SPRITE_PALETTE_PATROLLER, 12, 28, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_GENERICTRAINER, 1, MilosB2F_BluePatroller, EVENT_MILOS_B2F_BLUE_PATROLLER
	person_event SPRITE_POKE_BALL, 4, 16, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_TMHMBALL, TM_SEISMIC_TOSS, 0, EVENT_MILOS_B2F_TM_SEISMIC_TOSS

