	const_def 2 ; object constants
	const MOUNTAIN_PASTURE_SHEPERD
	const MOUNTAIN_PASTURE_LOST_FLAAFFY
	const MOUNTAIN_PASTURE_HERD1
	const MOUNTAIN_PASTURE_HERD2
	const MOUNTAIN_PASTURE_HERD3
	const MOUNTAIN_PASTURE_HERD4
	const MOUNTAIN_PASTURE_HERD5
	const MOUNTAIN_PASTURE_ITEMBALL1
	const MOUNTAIN_PASTURE_NPC1
	const MOUNTAIN_PASTURE_MEWTWO
	const MOUNTAIN_PASTURE_PLAYERF_CUTSCENE
	const MOUNTAIN_PASTURE_PLAYERM_CUTSCENE

MountainPasture_MapScripts:
	db 2 ; scene scripts
	scene_script .DummyScript         ; SCENE_MOUNTAIN_PASTURE_DEFAULT
	scene_script MewtwoReturnsScript ; SCENE_MOUNTAIN_PASTURE_MEWTWO_RETURNS

	db 0 ; callbacks

.DummyScript:
	end

MewtwoReturnsScript:
	checkflag ENGINE_PLAYER_IS_FEMALE
	iftrue .female
.male
	appear MOUNTAIN_PASTURE_PLAYERM_CUTSCENE
	jump .continue
.female
	appear MOUNTAIN_PASTURE_PLAYERF_CUTSCENE
.continue
	disappear MOUNTAIN_PASTURE_NPC1
	moveobject MOUNTAIN_PASTURE_MEWTWO, 23, 6
	pause 15
	applymovement PLAYER, .HidePlayerForCutscene
	pause 30
	applymovement MOUNTAIN_PASTURE_MEWTWO, .MewtwoReturnsMovements
	earthquake 5
	pause 25
	applymovement PLAYER, .ShowPlayerAfterCutscene
	disappear MOUNTAIN_PASTURE_PLAYERM_CUTSCENE
	disappear MOUNTAIN_PASTURE_PLAYERF_CUTSCENE
	setscene SCENE_MOUNTAIN_PASTURE_DEFAULT
	moveobject MOUNTAIN_PASTURE_MEWTWO, 18, 10
	end

.HidePlayerForCutscene:
	hide_object
	rept 7
		fast_slide_step LEFT
		endr
	rept 17
		fast_slide_step UP
		endr
	step_end

.ShowPlayerAfterCutscene:
	rept 17
		fast_slide_step DOWN
		endr
	rept 7
		fast_slide_step RIGHT
		endr
	turn_head UP
	show_object
	step_end

.MewtwoReturnsMovements:
	flyover_step DOWN
	flyover_step DOWN
	rept 5
		flyover_step LEFT
		endr
	set_sliding
	flyover_land DOWN
	step DOWN
	step_end

MountainPastureSheperdScript:
	faceplayer
	opentext
	checkevent EVENT_FALLEN_SPARKY
	iftrue .BeCareful
	writetext .HelpMeText
	yesorno
	iffalse .NoProblem
	writetext .ThanksText
	waitbutton
	setevent EVENT_FALLEN_SPARKY
	; FALLTHROUGH

.BeCareful:
	writetext .BeCarefulText
	jump .Done

.NoProblem:
	writetext .NoProblemText
	jump .Done

.Done:
	waitbutton
	closetext
	turnobject MOUNTAIN_PASTURE_SHEPERD, LEFT
	end

.HelpMeText:
	text "My FLAAFFY fell"
	line "down that cliff!"

	para "I need to lead the"
	line "herd back to the"
	cont "ranch, so I can't"
	cont "go help it."

	para "Can you help me?"

	done

.ThanksText:
	text "Thanks a lot!"
	para "Please take it"
	line "back to the ranch"
	cont "safe and sound!"
	done

.BeCarefulText:
	text "Make sure you have"
	line "an empty slot in"
	cont "your party for my"
	cont "FLAAFY!"
	done

.NoProblemText:
	text "Alright, I'll find"
	line "another way."
	done

MountainPastureLostFlaafyScript:
	opentext
	writetext .FlaaffyStuckText
	yesorno
	iffalse .done
	checkcode VAR_PARTYCOUNT
	ifequal PARTY_LENGTH, .partyfull
	givepoke FLAAFFY, 40, NO_ITEM, TRUE, LostFlaaffyName, LostFlaaffyOTName
	disappear MOUNTAIN_PASTURE_LOST_FLAAFFY
	writetext .FlaaffyTakenText
	waitbutton
	closetext
	setevent EVENT_RESCUED_SPARKY
	applymovement MOUNTAIN_PASTURE_SHEPERD, .BackToHerd
	disappear MOUNTAIN_PASTURE_SHEPERD
	end
.done:
	closetext
	end

.partyfull:
	writetext .AnotherMonText
	waitbutton
	closetext
	end

.BackToHerd:
	step RIGHT
	step UP
	step RIGHT
	step RIGHT
	step RIGHT
	step_end

.AnotherMonText:
	text "You can't carry"
	line "another #MON…"
	done

.FlaaffyStuckText:
	text "Hey <PLAYER>!"
	para "Can you take my"
	line "FLAAFY with you?"
	done
.FlaaffyTakenText:
	text "Thanks!"
	para "I'll take the herd"
	line "back to the Ranch."
	para "Meet me there!"
	done

LostFlaaffyName:
	db "SPARKY@"

LostFlaaffyOTName:
	db "Eddy@"
	db 0

MountainPastureMareepScript:
	opentext
	writetext .MareepText
	waitbutton
	closetext
	end
.MareepText:
	text "MAREEP: M-MMAAA!"
	done

MountainPastureFlaaffyScript:
	opentext
	writetext .FlaaffyText
	waitbutton
	closetext
	end
.FlaaffyText:
	text "FLAAFY: <…>"
	para "It is grazing."
	done

MountainPastureMiltankScript:
	opentext
	writetext .MiltankText
	waitbutton
	closetext
	end
.MiltankText:
	text "MILTANK: MMMmmm!"
	done

MountainPastureHikerScript:
	checkevent EVENT_GOT_SCOPE_LENS
	iftrue .NiceView
	faceplayer
	opentext
	writetext .ScopeLensText1
	waitbutton
	verbosegiveitem SCOPE_LENS
	setevent EVENT_GOT_SCOPE_LENS
	writetext .ScopeLensText2
	waitbutton
	closetext
	turnobject MOUNTAIN_PASTURE_NPC1, UP
	end

.NiceView:
	jumptextfaceplayer .NiceViewText
	turnobject MOUNTAIN_PASTURE_NPC1, UP
	end
.ScopeLensText1:
	text "Hey my friend!"
	para "So you're the kind"
	line "person that fixed"
	cont "the bridge?"
	para "Thank you!"
	line "I could finally"
	cont "climb up here and"
	cont "enjoy the view!"
	para "Please take that!"
	done
.ScopeLensText2:
	text "I don't need that"
	line "to enjoy the view."
	para "Take care!"
	done
.NiceViewText:
	text "What a view!"
	para "This is the Vaast"
	line "region."
	para "It looks much more"
	line "green, right?"
	para "Maybe you'll get"
	line "to visit it in"
	cont "another ROM Hack?"
	done

MountainPastureItemball1:
	itemball TM_SLUDGE_BOMB
	end

MountainPastureMewtwoScript:
	faceplayer
	opentext
	writetext .BeforeBattleText
	yesorno
	iftrue .AnswerYes
.AnswerNo
	writetext .AnswerNoText
	jump .continue
.AnswerYes
	writetext .AnswerYesText
	; FALLTHROUGH
.continue
	waitbutton
	closetext
	winlosstext .WinText, .LossText
	loadtrainer CHAMPION, MEWTWO_T
	writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE
	startbattle
	dontrestartmapmusic
	reloadmap
	ifequal LOSE, .LostBattle
	; FALLTHROUGH
.WonBattle:
	playmusic MUSIC_RIVAL_AFTER
	opentext
	writetext .WonBattleText
	jump .MewtwoLeaves
.LostBattle:
	playmusic MUSIC_RIVAL_AFTER
	opentext
	writetext .LostBattleText
	jump .MewtwoLeaves
.MewtwoLeaves:
	waitbutton
	writetext .AfterBattleText
	waitbutton
	closetext
	checkevent EVENT_KILLED_MAGIKARP
	iffalse .MagikarpAlive
	turnobject MOUNTAIN_PASTURE_MEWTWO, UP
	pause 30
	opentext
	writetext .EasterEggText
	waitbutton
	closetext
.MagikarpAlive:
	playsound SFX_KINESIS
	applymovement MOUNTAIN_PASTURE_MEWTWO, .MewtwoLeavesMovement
	disappear MOUNTAIN_PASTURE_MEWTWO
	waitsfx
	setscene SCENE_MOUNTAIN_PASTURE_DEFAULT
	special HealParty
	playmapmusic
	end

.BeforeBattleText:
	text "Hello, <PLAYER>."
	para "I am Mewtwo, a"
	line "#MON created by"
	cont "mankind to serve"
	cont "their bad deeds."
	para "But my destiny go-"
	line "es beyond that!"
	para "I decided to use"
	line "my power to prot-"
	cont "tect #MONs from"
	cont "humanity."
	para "This is why, years"
	line "ago, I cleared the"
	cont "region and gave it"
	cont "back to #MONs."
	para "I later concluded"
	line "a pact with Azmov"
	cont "and asked her to"
	cont "make sure people"
	cont "would respect"
	cont "#MONs."
	para "And she did it in"
	line "a very interesting"
	cont "way!"
	para "She organized bat-"
	line "tles between the"
	cont "two species, to"
	cont "remind humans how"
	cont "weak they are!"
	para "But since you def-"
	line "feated her, I had"
	cont "to come back and"
	cont "make sure you'd"
	cont "continue her"
	cont "legacy."
	para "So <PLAYER>,"
	line "Will you continue"
	cont "Azmov's work for"
	cont "me?"
	done
.AnswerYesText:
	text "Then prove me your"
	line "strength!"
	done
.AnswerNoText:
	text "How dare you…?"
	done

.WinText:
	text "What a surprise…"
	done
.WonBattleText:
	text "You're very strong"
	line "<PLAYER>."
	para "I understand why"
	line "Azmov lost to you."
	done
.LossText:
	text "You're weak!"
	para "But there's some-"
	line "thing different"
	cont "about you…"
	done
.LostBattleText:
	text "Don't be ashamed."
	para "I was created to"
	line "be the strongest"
	cont "#MON!"
	done

.AfterBattleText:
	text "During our battle,"
	line "I read through"
	cont "your mind."
	para "I must admit I'm"
	line "confused…"
	para "All this time, you"
	line "only thought about"
	cont "the well-being of"
	cont "your #MONs, not"
	cont "about winning."
	para "The bond between"
	line "you and them is"
	cont "something I've ne-"
	cont "ver seen before…"
	para "I've always though"
	line "that fear was the"
	cont "best way to keep"
	cont "people from harm-"
	cont "ing #MONs."
	para "…"
	para "I'll give you a"
	line "chance <PLAYER>."
	para "Take care of all"
	line "living creatures"
	cont "of this place, and"
	cont "prove me wrong!"
	done
.EasterEggText:
	text "…"
	para "One last thing."
	para "Kill a MAGIKARP"
	line "once again, and I"
	cont "annihilate you!"
	done

.MewtwoLeavesMovement:
	fix_facing
	set_sliding
	flyover_step UP
	flyover_step UP
	remove_fixed_facing
	remove_sliding
	step_sleep 10
	rept 10
		flyover_step LEFT
		endr
	step_end


MountainPasture_MapEvents:
	db 0, 0 ; filler
	db 4 ; warp events
	warp_event 25, 27, MOUNTAIN_TUNNEL, 1
	warp_event 24,  7, MOUNTAIN_GATE1, 1
	warp_event  6, 13, MOUNTAIN_GATE2, 1
	warp_event  2, 23, MOUNTAIN_GATE3, 1
	db 0 ; coord events
	db 0 ; bg events
	db 12 ; object events
	object_event 14, 19, SPRITE_CHUCK,   SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_BROWN, OBJECTTYPE_SCRIPT, 0, MountainPastureSheperdScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 12, 19, SPRITE_FLAAFFY, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_PINK, OBJECTTYPE_SCRIPT, 0, MountainPastureLostFlaafyScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 21, 10, SPRITE_MAREEP,  SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_BLUE, OBJECTTYPE_SCRIPT, 0, MountainPastureMareepScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 16, 11, SPRITE_MAREEP,  SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_BLUE, OBJECTTYPE_SCRIPT, 0, MountainPastureMareepScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 20, 14, SPRITE_FLAAFFY, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_PINK, OBJECTTYPE_SCRIPT, 0, MountainPastureFlaaffyScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 18, 13, SPRITE_MILTANK, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_PINK, OBJECTTYPE_SCRIPT, 0, MountainPastureMiltankScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event 20,  8, SPRITE_MILTANK, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_PINK, OBJECTTYPE_SCRIPT, 0, MountainPastureMiltankScript, EVENT_MOUNTAIN_HERD_VISIBLE
	object_event  3, 27, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, MountainPastureItemball1, EVENT_MOUNTAIN_TM28_DIG
	object_event 18,  4, SPRITE_BRUNO, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BROWN, OBJECTTYPE_SCRIPT, 0, MountainPastureHikerScript, EVENT_MEWTWO_RETURNED
	object_event 18, 10, SPRITE_MEWTWO, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_PURPLE, OBJECTTYPE_SCRIPT, 0, MountainPastureMewtwoScript, EVENT_MEWTWO_VISIBLE
	object_event 25, 27, SPRITE_KRIS, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, -1, EVENT_MOUNTAIN_PLAYERF_CUTSCENE_VISIBLE
	object_event 25, 27, SPRITE_CHRIS, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, -1, EVENT_MOUNTAIN_PLAYERM_CUTSCENE_VISIBLE
