MoundF1_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1

	dbw 5, .swap_map

.swap_map
	checkevent EVENT_BLEW_UP_DYNAMITE
	sif true
		changemap MoundF1_BlownUp_BlockData
	return

MoundF1Rival:
	showtext .during_phone_call_text
	faceplayer
	showemote 3, 6, 32
	spriteface 6, 2
	opentext
	writetext .noticed_player_text
	playwaitsfx SFX_HANG_UP
	closetext
	faceplayer
	playmusic MUSIC_RIVAL_ENCOUNTER
	opentext
	writetext .engaged_player_text
	loadtrainer RIVAL1, RIVAL1_2
	winlosstext .battle_won_text, 0
	startbattle
	reloadmapafterbattle
	playmusic MUSIC_RIVAL_ENCOUNTER
	showtext .after_battle_text
	applymovement 6, .leave
	special RestartMapMusic
	disappear 6
	setevent EVENT_MOUND_CAVE_RIVAL
	end

.leave
	step_left
	step_left
	step_left
	step_left
	step_left
	step_down
	step_down
	step_down
	step_end

.during_phone_call_text
	db TX_COMPRESSED, $75, $19, $d2, $53, $22, $4f, $57, $01, $05, $aa, $78

	db $00, $3b, $13, $1f, $84, $0d, $51, $d4, $e4, $ee, $02, $0b, $5e

	db $01, $5f, $56, $3e, $53, $7f, $80, $82, $d4, $ab, $49
	db $6f, $3e, $72, $c3, $39, $0c, $a9, $26, $b3, $a5
	db $a7, $88

.noticed_player_text
	db TX_COMPRESSED, $a7

	db $80, $03, $a7, $0f, $63, $3b, $de, $c0, $41, $6a, $2b, $d6, $54
	db $bd, $4d

.engaged_player_text
	db TX_COMPRESSED, $75, $2c, $3d, $cc, $04, $16, $a5, $86, $22, $f4
	db $13, $c1, $6a, $e0, $70, $8f, $82, $95, $68, $2f

	db $00, $6d, $d2, $53, $20, $20, $b5, $30, $0f, $7a, $1a
	db $9e, $b4, $9c, $7c, $28, $b8, $af, $50, $36
	db $55, $0c, $88, $b5, $b4, $cd, $8c, $24, $45

	db $28, $0a, $78

	db $00, $3a, $9c, $b4, $68, $44, $1d, $e2, $96, $37
	db $cd, $eb, $0c, $41, $9c, $1e, $12, $d2, $68
	db $30, $04, $3a, $a0, $39, $5f, $09, $23, $3a
	db $47, $91, $d1, $b2, $70, $10, $5a, $5c, $b3, $d7
	db $d5, $34, $22, $2c, $f7, $b3, $90, $87, $3c
	db $69, $e2

.battle_won_text
	db TX_COMPRESSED, $6e, $9d, $b9, $56, $a2, $5a, $76
	db $de, $c0, $2b, $fc, $4b, $49, $a5
	db $a6, $80

.after_battle_text
	db TX_COMPRESSED, $29, $26, $83, $95, $05, $76, $9e, $9a
	db $10, $f0, $83, $45, $a2, $6a, $ce, $53, $8d, $22, $e6
	db $aa, $ab, $51, $67, $03, $84, $7c, $14, $b1, $be, $7e

	db $00, $0f, $0d, $51, $d4, $d7, $e0, $70, $c2, $58
	db $5e, $c0, $64, $cc, $21, $d5, $01, $ca, $f8
	db $48, $02, $d3, $b7, $10, $d0, $ee, $3e
	db $09, $e4, $08, $36, $47, $80, $d9, $84, $33, $ca

	db $3c, $02, $9e

	db $00, $0d, $d3, $b7, $2d, $21, $41, $cd, $59, $d2

	db $80, $63, $a9, $e3, $0a, $4e, $de, $28, $40
	db $db, $c0, $82, $d2, $e3, $21, $23, $26, $b2
	db $7a, $9e, $20

MoundF1DynamiteGuy:
	opentext
	checkevent EVENT_SPOKE_DYNAMITE_GUY
	sif false, then
		writetext .intro_text
		setevent EVENT_SPOKE_DYNAMITE_GUY
	sendif
	takeitem DYNAMITE, 5
	sif false, then
		checkitem POKE_BALL
		sif true, then
			writetext .theres_dynamite_left_text
			jumptext .still_waiting_text
		selse
			writetext .no_balls_text
			verbosegiveitem POKE_BALL, 3
			closetextend
		sendif
	sendif
	giveitem DYNAMITE, 5
	writetext .need_fire_mon_text
	findpokemontype FIRE
	waitbutton
	sif false
		closetextend
	callasm ReadScriptVarMonName
	writetext .try_mon_text
	addvar -1
	copyvartobyte wCurPartyMon
	yesorno
	closetext
	sif false
		end
	fieldmovepokepic
	showtext .lit_the_fuse_text
	applymovement PLAYER, .player_steps_aside
	applymovement 3, .guy_steps_aside
	applymovement 3, .guy_moves_back
	showemote EMOTE_SHOCK, PLAYER, 32
	applymovement PLAYER, .player_moves_back
	changemap MoundF1_BlownUp_BlockData
	playsound SFX_EGG_BOMB
	earthquake 24
	playsound SFX_EGG_BOMB
	earthquake 24
	playsound SFX_EGG_BOMB
	earthquake 24
	playsound SFX_EGG_BOMB
	earthquake 24
	spriteface 3, 1
	spriteface PLAYER, LEFT
	loademote EMOTE_HAPPY
	showemote EMOTE_HAPPY, 3, 32
	showtext .after_blowing_up_text
	playsound SFX_JUMP_OVER_LEDGE
	applymovement 3, .guy_leaves
	takeitem DYNAMITE, 5
	setevent EVENT_BLEW_UP_DYNAMITE
	end

.player_steps_aside
	step_right
	step_end

.guy_moves_back
	run_step_down
	run_step_down
	run_step_right
	run_step_right
	run_step_right
	run_step_right
	run_step_right
	run_step_right
	run_step_up
	run_step_right
	run_step_right
	run_step_down
	step_end

.player_moves_back
	run_step_down
	run_step_down
	run_step_right
	run_step_right
	run_step_right
	run_step_right
	run_step_right
	run_step_up
	run_step_right
	run_step_right
	run_step_right
	step_end

.guy_leaves
	jump_step_left
	run_step_left
	run_step_left
	hide_person
	step_down
	step_down
	step_down
.guy_steps_aside
	step_down
	step_end

.intro_text
	db TX_COMPRESSED, $ad, $3f, $89, $3e, $f4, $32, $d2, $6b, $3e

	db $20, $1d, $63, $4e, $8d, $48, $e5, $86, $74, $f4, $18
	db $de, $b4, $8d, $10, $47, $75, $93

	db $f0, $06, $21, $a8, $c1, $8d, $74, $f0

	db $00, $29, $26, $83, $8b, $0b, $2a, $48, $9a, $b3
	db $79, $5f, $42, $ca, $90, $c9, $cc, $b4, $9c, $3a, $74, $77

	db $e0, $0e, $a6, $f5, $f0, $a2, $e2, $74, $18
	db $de, $32, $05, $ae, $53, $32, $08, $9a, $f8, $ec
	db $c0, $58, $67, $27, $71, $63, $cc, $0e
	db $0f, $5a, $4d, $07, $33, $ab, $24, $b4, $8c, $9c, $a3
	db $e0, $15, $b5, $71, $d6, $34, $21, $9e, $66, $ab, $0b
	db $56, $f0, $b7, $1f, $0a, $ce, $58, $67, $27, $72, $d2, $6f
	db $aa, $0b, $57, $03, $84, $7c, $14, $ab, $41, $53

	db $c0, $01, $4c, $2b, $30, $63, $5f, $a3, $13, $49
	db $fa, $9e, $20

.theres_dynamite_left_text
	db TX_COMPRESSED, $62, $fb, $fe, $8e, $b0, $8e, $8b, $21, $03
	db $6f, $3e, $34, $5e, $a9, $19, $3f, $2d, $26, $b3
	db $00, $84, $85, $ae, $e6, $2b, $38, $80, $be
	db $6f, $64, $11, $35, $f1, $d9, $ce, $9e, $17

	db $e0, $0e, $ae, $21, $21, $6b, $b9, $8a
	db $cd, $e4, $08, $59, $ee, $60, $5a, $b8, $12, $4b, $49
	db $aa, $56, $1b, $b0, $bf, $30, $e8, $42, $bf

	db $00, $62, $1a, $8c, $18, $d7, $f8, $ea, $23, $6a
	db $7b, $62, $b6, $88, $ca, $60, $70, $8f, $b5, $db, $18
	db $10, $0c, $87, $a1, $59, $e6, $60, $b3, $d5, $24
	db $3c, $9d, $27, $33, $56, $16, $89, $99, $69, $35, $9f

	db $80, $3a, $c2, $02, $0b, $52, $ad, $25, $cb
	db $0b, $c9, $3e, $88, $8f, $9c, $0b, $57, $34, $99
	db $01, $93, $de, $ca, $87, $69, $96, $93, $7f
	db $ef, $2b, $38, $f8, $29, $cb, $46, $8b
	db $f5, $3c, $40

.still_waiting_text
	db TX_COMPRESSED, $74, $59, $11, $63, $ef, $65, $5a, $3b, $19, $39
	db $7b, $00, $ae, $5a, $4e, $64, $11, $35, $f1, $d9

	db $f8, $03, $a8, $43, $3c, $c1, $6e, $22, $c6, $ca, $92, $25
	db $85, $e5, $7d, $d4, $5c, $69, $12, $d2, $b0, $b5, $ca
	db $7d, $4d

.no_balls_text
	db TX_COMPRESSED, $72, $85, $a9, $90, $92, $99, $13, $a0, $c7, $34, $80
	db $9e, $07, $2a, $bd, $ef, $51

	db $4a, $01, $b9, $f7, $b4, $f0

	db $00, $28, $33, $93, $b9, $69, $58, $5a, $e5, $32, $d2
	db $6f, $33, $a0, $c7, $f8, $08, $2d, $17, $1c, $e4, $23, $27
	db $20, $2c, $30, $86, $79, $82, $ee, $9b, $36, $b1
	db $b2, $f6, $93, $31, $4c, $6b, $38, $0e, $57, $c2, $4f

	db $00, $62, $6b, $3f

	db $00, $63, $a0, $c7, $36, $32, $16, $84, $74, $e0, $70
	db $78, $1c, $aa, $f7, $bd, $47
	db $1a, $78, $80

.need_fire_mon_text
	db TX_COMPRESSED, $61, $2c, $f6, $ff, $01, $05, $a9, $c8, $6e, $6f
	db $7a, $f0, $70, $96, $93, $88, $b1, $b2, $a4, $8e

	db $20, $18, $86, $a3, $06, $35, $fe, $54, $70, $86, $79
	db $79, $01, $7c, $e2, $cf, $7b, $30, $1a, $ce, $58
	db $55, $74, $7c, $a6, $e5, $a4, $e6, $0d, $20

	db $fc, $00, $57, $41, $2b, $39, $b1, $4c, $6b, $30, $36, $08, $41
	db $bc, $0e, $57, $c2, $48, $15, $c7, $c2, $0c
	db $6a, $99, $0b, $5d, $cc, $c8, $60, $ee, $9e
	db $0a, $68

.try_mon_text
	db TX_COMPRESSED, $29, $60, $a5, $43, $b4
	db $bc, $0e, $4d
	db $2d, $34

.lit_the_fuse_text
	db TX_COMPRESSED, $61, $2c, $f6, $ff, $07, $73, $a3
	db $b7, $ad, $27, $30, $69, $06, $5f, $3a, $77
	db $89, $52, $2f, $49, $98, $af, $59, $52
	db $e3, $4f, $10

.after_blowing_up_text
	db TX_COMPRESSED, $6e, $90, $86, $24, $21

	db $e2, $01, $d1, $64, $c1, $66, $7c

	db $40, $14, $9d, $22, $92, $3f, $14, $87, $9f
	db $53, $c4

MoundF1_BlownUp_BlockData: INCBIN "./maps/blk/MoundF1_BlownUp_BlockData.blk.lz"

MoundF1_MapEventHeader:: db 0, 0

.Warps: db 7
	warp_def 25, 17, 3, ROUTE_73
	warp_def 43, 3, 3, MOUND_F1
	warp_def 89, 3, 2, MOUND_F1
	warp_def 59, 17, 5, MOUND_F1
	warp_def 5, 15, 4, MOUND_F1
	warp_def 13, 17, 1, MOUND_B3F
	warp_def 49, 9, 1, MOUND_B1F

.CoordEvents: db 0

.BGEvents: db 0

.ObjectEvents: db 7
	person_event SPRITE_POKE_BALL, 31, 15, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_TMHMBALL, TM_AERIAL_ACE, 0, EVENT_MOUND_CAVE_TM43
	person_event SPRITE_R_HIKER, 2, 6, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, MoundF1DynamiteGuy, EVENT_BLEW_UP_DYNAMITE
	person_event SPRITE_POKE_BALL, 73, 14, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, MINING_PICK, EVENT_MOUND_F1_ITEM_MINING_PICK
	person_event SPRITE_ROCK, 37, 11, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, PAL_OW_BROWN, PERSONTYPE_JUMPSTD, 0, smashrock, -1
	person_event SPRITE_SILVER, 27, 11, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, MoundF1Rival, EVENT_MOUND_CAVE_RIVAL
	person_event SPRITE_POKE_BALL, 60, 4, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TMHMBALL, TM_PROTECT, 0, EVENT_MOUND_CAVE_TM17
	person_event SPRITE_POKE_BALL, 87, 8, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, SUPER_POTION, EVENT_MOUND_F1_ITEM_SUPER_POTION

