LaurelForestPokemonOnlyMotherButterfree:
	faceplayer
	cry BUTTERFREE
	opentext
	checkevent EVENT_POKEONLY_FINISHED_CATERPIE_QUEST
	sif true, then
		checkevent EVENT_BUTTERFREE_GAVE_CURO_SHARD
		sif true
			jumptext .after_rescuing_caterpie_text
		jump LaurelForestPokemonOnly_ButterfreeTryGiveCuroShard
	sendif
	writetext .cant_find_caterpie_text
	checkevent EVENT_POKEONLY_CATERPIE_IN_PARTY
	iftrue .returnCaterpieToButterfree
	buttonsound
	writetext .asking_for_help_text
	yesorno
	sif false
		jumptext .denied_butterfree_text
	writetext .lets_look_for_it_text
	checkcode VAR_PARTYCOUNT
	if_not_equal 1, LaurelForestPokemonOnly_NotEnoughRoomInParty
	writetext .butterfree_joined_party_text
	playwaitsfx SFX_CHOOSE_A_CARD
	waitbutton
	givepoke BUTTERFREE, 20, SILK, 1, .butterfree_name, LaurelForestOTName
	disappear 4
	setevent EVENT_POKEONLY_MOTHERBUTTERFREE_IN_PARTY
	closetextend

.after_rescuing_caterpie_text
	db TX_COMPRESSED, $75, $37, $b5, $68, $24, $4a, $82, $b5, $82
	db $7b, $55, $85, $ab, $8f, $82, $8a, $f5, $58, $2f

	db $00, $75, $32, $12, $53, $22, $91, $03, $54, $a9, $3b
	db $6f, $3a, $95, $05, $ae, $e6, $64, $30, $78
	db $2a, $40, $5f, $3b, $48, $c9, $cc, $da, $b0, $6b
	db $aa, $93, $a2, $04, $19, $0f, $32, $c3, $07, $7e
	db $a6, $80

.cant_find_caterpie_text
	db TX_COMPRESSED, $76, $98, $40, $f1

	db $00, $dd, $26, $b3, $83, $24, $b4, $9c, $a8, $2b, $ee
	db $5e, $c8, $f3, $1f, $05, $15, $ea, $b0, $53, $90, $d2
	db $d3, $40

.asking_for_help_text
	db TX_COMPRESSED, $e1, $e9, $ea, $0e, $24, $fa, $22, $3e
	db $6f, $60, $32, $66, $0e, $ff, $04, $74, $f5, $07
	db $c6, $9a

.denied_butterfree_text
	db TX_COMPRESSED, $07, $86

	db $94, $00, $93, $57, $34, $80, $ad, $23, $27, $31, $90, $b5, $dc
	db $bc, $ac, $e2, $74, $40, $83, $20, $c9, $cc, $b0
	db $aa, $7c, $14, $57, $aa, $c1, $45, $8f, $94, $dc, $20, $6a
	db $e3, $4d

.lets_look_for_it_text
	db TX_COMPRESSED, $76, $9f, $cb, $4e, $91, $4a, $02, $0b, $5e

	db $01, $8e, $77, $8a, $74, $21, $52, $98, $05, $71, $f0
	db $4f, $2b, $d5, $60, $b8
	db $d3, $c4

.butterfree_joined_party_text
	db TX_COMPRESSED, $12, $6a, $ec, $d7, $82, $cc, $e5, $38, $11, $90
	db $f2, $f5, $a4, $e0, $8d, $5d, $82
	db $e3, $4d

.butterfree_name
	db "Butterfree@"

.returnCaterpieToButterfree
	waitbutton
	closetext
	callasm RemoveSecondPartyMember
	pushvar
	assert METAPOD == (CATERPIE + 1)
	assert BUTTERFREE == (CATERPIE + 2)
	addvar -CATERPIE
	loadarray .CaterpieEndMovementArray
	readarray 0
	setlasttalked -1
	moveperson LAST_TALKED, 13, 31
	appear LAST_TALKED
	checkcode VAR_FACING
	sif =, UP, then
		spriteface LAST_TALKED, UP
	selse
		spriteface LAST_TALKED, LEFT
	sendif
	popvar
	cry 0
	showtext LaurelForestPokemonOnly_Text_ButterfreeFoundCaterpie
	checkcode VAR_FACING
	sif =, UP, then
		applymovement LAST_TALKED, .CaterpieMovesUp
	selse
		applymovement LAST_TALKED, .CaterpieMovesLeft
	sendif
	faceperson LAST_TALKED, 4
	faceperson 4, LAST_TALKED
	showtext .caterpie_explains_text
	faceperson 4, PLAYER
	cry BUTTERFREE
	scall LaurelForestPokemonOnly_ButterfreeTryGiveCuroShard
	checkcode VAR_FACING
	sif =, UP, then
		readarrayhalfword 1
	selse
		readarrayhalfword 3
	sendif
	applymovement LAST_TALKED, -1
	clearevent EVENT_POKEONLY_CATERPIE_IN_PARTY
	setevent EVENT_POKEONLY_FINISHED_CATERPIE_QUEST
	end

.caterpie_explains_text
	db TX_COMPRESSED, $15, $0b, $ef, $82, $e3, $0a, $48, $d1, $08, $36
	db $4d, $e0, $72, $be, $12, $44, $9f, $44, $1e, $63
	db $e6, $ab, $01, $93, $30, $10, $5a
	db $e3, $4f, $10

.CaterpieEndMovementArray
	dbww 14, .CaterpieEndMovement_Right, .CaterpieEndMovement_Bottom
.CaterpieEndMovementArrayEntrySizeEnd:
	dbww 5, .MetapodEndMovement_Right, .MetapodEndMovement_Bottom
	dbww 10, .ButterfreeEndMovement_Right, .ButterfreeEndMovement_Bottom

.CaterpieMovesUp
	step_up
	step_end
	
.CaterpieMovesLeft
	step_left
	step_end

.CaterpieEndMovement_Bottom
	step_right
	step_right
	step_up
	turn_head_down
	step_end

.CaterpieEndMovement_Right
	step_right
	turn_head_down
	step_end

.ButterfreeEndMovement_Bottom
	step_down
.MetapodEndMovement_Bottom
	step_right
	step_right
	turn_head_down
	step_end

.ButterfreeEndMovement_Right
	step_down
.MetapodEndMovement_Right
	step_right
	step_down
	step_end

LaurelForestPokemonOnlyCaterpie:
	faceplayer
	cry CATERPIE
	opentext
	writetext .cant_find_mommy_text
	checkevent EVENT_POKEONLY_MOTHERBUTTERFREE_IN_PARTY
	iftrue .broughtButterfreeToCaterpie
	buttonsound
	writetext .asking_for_help_text
	yesorno
	sif false
		jumptext .denied_text
	checkcode VAR_PARTYCOUNT
	sif >, 1
		jumptext .no_room_in_party_text
	writetext .joined_party_text
	playwaitsfx SFX_CHOOSE_A_CARD
	givepoke CATERPIE, 4, SILK, 1, .caterpie_name, LaurelForestOTName
	setevent EVENT_POKEONLY_CATERPIE_IN_PARTY
	setevent EVENT_POKEONLY_CATERPIE_PICKED_UP
	disappear 6
	closetextend

.cant_find_mommy_text
	db TX_COMPRESSED, $62, $7d, $11

	db $c4, $03, $a8, $ce, $92, $99, $30, $19, $33, $1f
	db $04, $f3, $e1, $7d, $f0, $53, $48, $0a, $a4, $9a, $cf
	db $8d, $34
	
.asking_for_help_text
	db TX_COMPRESSED, $6d, $d2, $40, $41, $6a, $08, $e9, $ea
	db $0d, $e4, $9f, $44, $47, $ce, $60, $32, $66, $3e
	db $09, $53, $e1, $7d, $f0, $54
	db $b4, $d0

.denied_text
	db TX_COMPRESSED, $07, $86, $96, $09, $35, $71, $d1, $64, $e8, $51, $7c

	db $40, $70, $f4, $f5, $07, $32, $12, $53, $27, $4f, $41
	db $8d, $e7, $ce, $24, $d6, $73, $7a, $12, $1f
	db $1a, $68

.no_room_in_party_text
	db TX_COMPRESSED, $76, $9f, $c7, $51, $9d, $25, $32, $53, $81, $19
	db $1e, $04, $16, $a0, $f0, $80, $82, $d1, $71, $ca, $87, $69
	db $54, $80, $be, $61, $21, $cd, $ea, $cf, $72, $0a, $9e
	db $0a, $68

.joined_party_text
	db TX_COMPRESSED, $76, $9f, $cb, $4e, $91, $4a, $02, $0b, $5c

	db $40, $70, $f4, $f5, $07, $30, $19, $33, $1f
	db $04, $f3, $e1, $7d, $f0, $53, $00, $ae, $3e, $7c
	
	db $40, $36, $ed, $9a, $c4, $0c, $e5, $38, $11, $90
	db $f2, $f5, $a4, $e0, $8d, $5d, $82
	db $e3, $4d

.caterpie_name
	db "Caterpie@"

.broughtButterfreeToCaterpie
	waitbutton
	closetext
	moveperson 4, 33, 51
	appear 4
	checkcode VAR_FACING
	sif =, RIGHT, then
		spriteface 4, RIGHT
	selse
		spriteface 4, DOWN
	sendif
	cry BUTTERFREE
	opentext
	writetext LaurelForestPokemonOnly_Text_ButterfreeFoundCaterpie
	closetext
	checkcode VAR_FACING
	sif =, RIGHT, then
		applymovement 4, .ButterfreeMovesRightMovement
	selse
		applymovement 4, .ButterfreeMovesDownMovement
	sendif
	faceperson 6, 4
	faceperson 4, 6
	cry CATERPIE
	showtext .mommy_you_found_me_text
	checkcode VAR_FACING
	sif =, RIGHT, then
		applymovement 4, .ButterfreeMovesLeftMovement
	selse
		applymovement 4, .ButterfreeMovesUpMovement
	sendif
	faceperson 4, PLAYER
	faceperson PLAYER, 4
	scall LaurelForestPokemonOnly_ButterfreeTryGiveCuroShard
	checkcode VAR_FACING
	sif =, UP, then
		applymovement 4, .ButterfreeMovesRightMovement
		follow 4, 6
		applymovement 4, .ButterfreeExits_AboveCaterpie
	selse
		applymovement 4, .ButterfreeMovesDownMovement
		follow 4, 6
		applymovement 4, .ButterfreeExits_LeftOfCaterpie
	sendif
	stopfollow
	clearevent EVENT_POKEONLY_CATERPIE_NOT_IN_NEST
	setevent EVENT_POKEONLY_CATERPIE_PICKED_UP
	setevent EVENT_POKEONLY_FINISHED_CATERPIE_QUEST
	callasm RemoveSecondPartyMember
	disappear 4
	moveperson 4, 12, 30
	appear 4
	appear 14
	disappear 6
	end

.ButterfreeMovesLeftMovement
	step_left
	step_end

.ButterfreeMovesUpMovement
	step_up
	step_end

.ButterfreeMovesRightMovement
	step_right
	step_end

.ButterfreeMovesDownMovement
	step_down
	step_end

.ButterfreeExits_AboveCaterpie
	step_left
	step_left
	step_left
	step_left
	step_left
	step_left
	step_left
	step_end
	
.ButterfreeExits_LeftOfCaterpie
	step_up
	step_left
	step_left
	step_left
	step_left
	step_left
	step_left
	step_end

.mommy_you_found_me_text
	db TX_COMPRESSED, $15, $0b, $ef, $82, $e3, $1c, $a1, $6a, $60, $16, $89
	db $97, $9f, $3e
	db $34, $f1, $00

LaurelForestPokemonOnly_ButterfreeTryGiveCuroShard:
	opentext
	writetext .thanks_text
	giveitem CURO_SHARD, 1
	sif false, then
		waitbutton
		writetext .no_room_text
	selse
		playwaitsfx SFX_ITEM
		waitbutton
		setevent EVENT_BUTTERFREE_GAVE_CURO_SHARD
	sendif
	closetextend

.thanks_text
	db TX_COMPRESSED, $29, $3a, $45, $28, $08, $2d, $4c, $02
	db $b7, $b0, $19, $32, $32, $73, $1f, $05, $15, $ea, $b0, $5c

	db $40, $3a, $95, $6a, $22, $03, $2a, $0a, $d6, $33, $cf

	db $80, $31, $35, $9c, $1a, $26, $c6, $d6, $96
	db $17, $94, $27, $57, $9e
	db $34, $d0

.no_room_text
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $38, $40, $c5, $84, $2f
	db $bd, $80, $57, $2d, $23, $44, $1d, $9b, $fe

	db $00, $da, $17, $ce, $58, $63, $e7, $3b, $b6, $6b
	db $7a, $a4, $99, $20, $20, $b5, $13, $a0
	db $c6, $a9, $02, $35, $93
	db $f5, $3c, $40

LaurelForestPokemonOnlyRescuedCaterpie:
	faceplayer
	cry CATERPIE
	jumptext .text

.text
	db TX_COMPRESSED, $75, $12, $11, $07, $02, $43, $99, $d0
	db $4f, $3a, $8c, $e9, $22, $b3, $64, $2f, $9c, $d4
	db $2a, $45, $ac, $24, $e6, $6a, $20, $20, $b5
	db $ea, $68

LaurelForestPokemonOnlyRescuedMetapod:
	faceplayer
	cry METAPOD
	jumptext .text

.text
	db TX_COMPRESSED, $75, $30, $33, $ec, $b4, $8d, $11, $3a, $bc
	db $bc, $84, $9f, $7b, $10, $d0, $ed, $11, $f3
	db $54, $ac, $ee, $cd, $73, $48, $0a, $ad, $05

	db $c4, $01, $49, $db, $95, $6a, $20, $48, $73, $95, $9e
	db $db, $db, $90, $63, $25, $b4, $b3, $fc, $d2
	db $64, $00, $ee, $21, $a5, $9c, $7f, $72, $71, $f3
	db $79, $16, $b0, $93, $93, $5f
	db $1a, $68

LaurelForestPokemonOnlyRescuedButterfree:
	faceplayer
	cry BUTTERFREE
	jumptext .text

.text
	db TX_COMPRESSED, $6e, $93, $3e

	db $20, $1d, $4e, $84, $18, $e5, $a4, $d0
	db $6f, $2b, $3d, $6a, $c7, $83, $5d, $95, $0c, $9c, $a3

	db $88, $07, $51, $9d, $24, $c3, $a0, $a6, $ac, $2d, $13
	db $2f, $53, $8d, $22, $e7, $46, $a4, $71, $f0, $be, $f8, $2e
	db $34, $d0

LaurelForestPokemonOnly_Text_ButterfreeFoundCaterpie:
	db TX_COMPRESSED, $76, $9e

	db $20, $1d, $5e, $28, $f8, $28, $af, $55, $82
	db $e3, $4f, $10

