AcquaTutorial_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

AcquaTutorialHiddenItem:
	dw EVENT_ACQUA_TUTORIAL_HIDDENITEM_GOLD_TOKEN
	db GOLD_TOKEN

AcquaTutorial_Potion:
	db POTION, 1

AcquaTutorialSmallCaveExit:
	opentext
	writetext .text
	yesorno
	sif false, then
		closetext
		end
	sendif
	restorecustchar
	clearflag ENGINE_POKEMON_MODE
	warp ACQUA_TUTORIAL, 26, 20
	closetext
	blackoutmod ACQUA_START
	checkevent EVENT_ACQUA_MOVED_BOULDER
	sif false
		end
	playsound SFX_EMBER
	earthquake 40
	waitsfx
	end

.text
	db TX_COMPRESSED, $72, $1d, $b4, $b2, $4b, $0c, $04, $16
	db $96, $f1, $4b, $d1, $90, $d7
	db $4b, $4d

AcquaTutorialButton:
	checkevent EVENT_ACQUA_MOVED_BOULDER
	sif true
		end
	showtext .found_button_text
	playsound SFX_STRENGTH
	earthquake 16
	showtext .pressed_button_text
	setevent EVENT_ACQUA_MOVED_BOULDER
	end

.found_button_text
	db TX_COMPRESSED, $6e, $9d, $b8, $34, $4b, $48
	db $d0, $f2, $b6, $ae, $c2, $48, $93, $59, $cc, $02, $ba
	db $5a, $78, $80

.pressed_button_text
	db TX_COMPRESSED, $50, $16, $89, $94, $4e, $8d, $48
	db $de, $40, $5f, $3b, $48, $c9, $cc, $7c, $20, $c7, $9f
	db $53, $c4

AcquaTutorialSmallCaveEntrance:
	checkevent EVENT_ACQUA_MOVED_BOULDER
	sif true
		jumptext .room_collapsed_text
	opentext
	writetext .send_larvitar_instead
	yesorno
	closetext
	sif false
		end
	backupcustchar
	setflag ENGINE_POKEMON_MODE
	warp ACQUA_TUTORIAL, 30, 42
	blackoutmod ACQUA_TUTORIAL
	end

.send_larvitar_instead
	db TX_COMPRESSED, $75, $78, $a5, $84, $31, $0f, $ef, $7b, $30, $0a
	db $de, $04, $16, $a5, $86, $19, $2c, $d7, $4f

	db $00, $05, $06, $4c, $c7, $30
	text_from_ram wPartyMonNicknames
	db TX_COMPRESSED
	db $78, $64, $45, $9e, $e6
	db $96, $9a

.room_collapsed_text
	db TX_COMPRESSED, $29, $27, $16, $10
	db $be, $f3, $21, $ef, $74, $42, $0f, $3e
	db $a6, $80

AcquaTutorialBoulder:
	jumptext .text

.text
	db TX_COMPRESSED, $29, $27, $15, $85, $ae, $e4, $d7, $06
	db $87, $ac, $21, $89, $3d, $06, $05, $2c, $31, $f0, $83, $1f
	db $1a, $68

AcquaTutorialFirstSoil:
	showtext AcquaTutorialFirstSoil_Text
AcquaTutorialSoil:
	pause 12
	playsound SFX_DOUBLE_KICK
	disappear LAST_TALKED
	end

AcquaTutorialFirstSoil_Text:
	text_from_ram wPartyMonNicknames
	db TX_COMPRESSED, $87, $bc, $9a, $fa
	db $09, $ec, $98, $30, $5a, $59, $e6, $5a, $4e, $20, $23, $ef
	db $a9, $e2

AcquaTutorialLarvitarInCave:
	faceplayer
	opentext
	writetext .met_other_larvitar_text
	callasm .give_item
	sif true
		jumptext .no_room_text
	writetext .gave_soft_sand_text
	playwaitsfx SFX_ITEM
	writetext .other_larvitar_leaves_text
	closetext
	applymovement PLAYER, .step_aside
	applymovement 9, .larvitar_leaves
	disappear 9
	end

.give_item
	ld hl, PartyMon1Item
	ld a, [hl]
	ld [hScriptVar], a
	and a
	ret nz
	ld [hl], SOFT_SAND
	ret

.step_aside
	step_left
	step_up
	step_up
	step_right
	turn_head_left
	step_end

.larvitar_leaves
	step_left
	step_left
	step_up
	step_up
	step_up
	step_left
	step_left
	step_left
	step_left
	step_left
	step_left
	step_end

.met_other_larvitar_text
	db TX_COMPRESSED, $a7

	db $80, $03, $b4, $f1, $8c, $4f, $bd, $0f

	db $10, $0e, $8b, $22, $02, $b5, $82, $8e, $a2, $f4
	db $8f, $6d, $5a, $0a, $53, $8d, $22, $e1, $03, $55, $3c

	db $00, $1d, $16, $45, $9e, $f7, $a0, $a2, $12, $0a, $9e

	db $00, $0e, $b0, $80, $82, $d4, $52, $33, $11, $01, $05, $a5
	db $bc, $52, $f4, $64, $35, $cd, $ab, $41
	db $7c, $03, $a7, $0f, $67, $23, $06, $38, $08, $2d, $4d
	db $7b, $91, $e1, $7f, $9a, $89, $69, $d2, $29, $23
	db $88, $39, $80

.gave_soft_sand_text
	db TX_COMPRESSED, $29, $27, $31, $f5, $60, $c3, $bd, $5c, $e4, $60, $c6
	db $87, $81, $05, $a8, $a0, $38, $5c, $51, $a4, $cf
	db $1a, $68

.no_room_text
	db TX_COMPRESSED, $76, $9f, $c0, $41, $68, $b8, $e2, $43, $dc, $8c, $9c
	db $bd, $a4, $83, $b3, $7e, $6f, $56, $7b, $90, $5e

	db $00, $e9, $c3, $d8, $ac, $e2, $2f, $41, $0c, $9c
	db $bc, $93, $59, $cd, $8a, $c7, $73, $a1, $27, $26, $b2
	db $f0, $03, $c2, $02, $0b, $51, $94, $e9, $39, $38, $08, $2d
	db $2d, $e7, $c6, $4c, $fe, $3a, $8c, $e9, $27, $23, $06
	db $35, $40, $82, $d4, $b4, $9c, $e4, $78, $5f
	db $a9, $a0

.other_larvitar_leaves_text
	db TX_COMPRESSED, $75, $39, $68, $d0, $88, $ea, $21, $21, $6b, $b9
	db $79, $23, $c9, $c4, $05, $f3, $a9, $26, $b3
	db $54, $7d, $41, $cc, $02, $b8, $40, $d5, $4f
	db $05, $3c, $40

AcquaTutorialLarvitarOutsideCave:
	faceplayer
	showtext .found_other_larvitar_text
	playsound SFX_RUN
	applymovement 10, .other_larvitar_goes_in
	disappear 10
	playwaitsfx SFX_EXIT_BUILDING
	jumptext .larvitar_fled_text

.other_larvitar_goes_in
	fast_slide_step_up
	fast_slide_step_up
	fast_slide_step_left
	fast_slide_step_down
	fast_slide_step_right
	fast_slide_step_up
	fast_slide_step_left
	fast_slide_step_down
	fast_slide_step_right
	fast_slide_step_up
	fast_slide_step_left
	fast_slide_step_down
	fast_slide_step_right
	fast_slide_step_up
	fast_slide_step_left
	fast_slide_step_up
	step_end

.found_other_larvitar_text
	db TX_COMPRESSED, $62, $fb, $f4, $f0, $4d, $20, $6d, $26
	db $b7, $b1, $f5, $60, $c3, $bd, $5f
	db $a9, $e2

.larvitar_fled_text
	db TX_COMPRESSED, $29, $27, $31, $f5, $60, $c3, $bd, $5c, $c3, $a7, $9e
	db $34, $d0

AcquaTutorial_MapEventHeader::	db 0, 0

.Warps
	db 2
	warp_def 19, 21, 1, ACQUA_START
	warp_def 25, 26, 2, ACQUA_EXITCHAMBER

.CoordEvents
	db 0

.BGEvents
	db 4
	signpost 41, 30, SIGNPOST_READ, AcquaTutorialSmallCaveExit
	signpost 16, 33, SIGNPOST_ITEM, AcquaTutorialHiddenItem
	signpost 51, 43, SIGNPOST_READ, AcquaTutorialButton
	signpost 19, 26, SIGNPOST_READ, AcquaTutorialSmallCaveEntrance

.ObjectEvents
	db 10
	person_event SPRITE_BOULDER, 25, 26, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialBoulder, EVENT_ACQUA_MOVED_BOULDER
	person_event SPRITE_ROCK, 54, 31, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialSoil, -1
	person_event SPRITE_ROCK, 44, 41, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialSoil, -1
	person_event SPRITE_ROCK, 46, 35, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialSoil, -1
	person_event SPRITE_ROCK, 44, 32, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialFirstSoil, -1
	person_event SPRITE_ROCK, 54, 42, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialSoil, -1
	person_event SPRITE_ROCK, 52, 43, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, AcquaTutorialSoil, -1
	person_event SPRITE_LARVITAR, 47, 43, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, AcquaTutorialLarvitarInCave, EVENT_ACQUA_TUTORIAL_SCARED_LARVITAR_INSIDE
	person_event SPRITE_LARVITAR, 22, 27, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, AcquaTutorialLarvitarOutsideCave, EVENT_ACQUA_TUTORIAL_SCARED_LARVITAR_OUTSIDE
	person_event SPRITE_POKE_BALL, 7, 30, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 0, AcquaTutorial_Potion, EVENT_ACQUA_TUTORIAL_ITEM_1

