	const_def 2 ; object constants
	const SKIDRAW_CAVE_MICKEY
	const SKIDRAW_CAVE_POKEBALL
	const SKIDRAW_CAVE_POKEDEX

MickeysCave_MapScripts:
	db 3 ; scene scripts
	scene_script .WelcomeScene, SCENE_MICKEYS_CAVE_GET_EQUIPPED
	scene_script .DummyScene, SCENE_MICKEYS_CAVE_CANT_LEAVE
	scene_script .DummyScene, SCENE_MICKEYS_CAVE_NOTHING

        db 1 ; callbacks
	callback MAPCALLBACK_OBJECTS, .MoveMickeyCallback

.WelcomeScene:
	priorityjump SkidrawMickeyEquiPlayer
	end

.DummyScene:
	end

.MoveMickeyCallback:
	checkscene
	iftrue .Skip ; not SCENE_DEFAULT
	disappear SKIDRAW_CAVE_POKEBALL
	moveobject SKIDRAW_CAVE_MICKEY, 9, 2
.Skip:
	return

SkidrawMickeyEquiPlayer:
	follow SKIDRAW_CAVE_MICKEY, PLAYER
	applymovement SKIDRAW_CAVE_MICKEY, .MoveToPCMovement
	stopfollow
	faceplayer SKIDRAW_CAVE_MICKEY
	opentext
	writetext .WelcomeToTheCaveText
	waitbutton
	writetext .InviteGetStarter
	waitbutton
	closetext
	turnobject SKIDRAW_CAVE_MICKEY, UP
	setscene SCENE_MICKEYS_CAVE_CANT_LEAVE
	end

.WelcomeToTheCaveText:
	text "Welcome to my lair"
	line "kiddo!"

	para "This is where I"
	line "keep my #MONs."
	cont "I almost have them"
	cont "all!"

	para "I'll give you one"
	line "of mine to protect"
	cont "you."
	done

.MoveToPCMovement:
	rept 10
		step DOWN
	endr
	rept 4
		step LEFT
	endr
	turn_head UP
	step_end

.InviteGetStarter:
	text "Go to the table,"
	line "I'll pop a ball"
	cont "out."

	para "Oh, and take the"
	line "#DEX with you! I"
	cont "already have one."
	done

SkidrawCaveMickeyTalk:
	faceplayer
	opentext
	writetext .Text
	waitbutton
	closetext
	turnobject SKIDRAW_CAVE_MICKEY, UP
	end

.Text:
	text "Good luck finding"
	line "your friend back."
	para "I hope he's fine!"
	done

SkidrawCaveCantLeave:
	opentext
	writetext .DudeComeBackText
	waitbutton
	closetext
	applymovement PLAYER, .StepBack
	end


.DudeComeBackText:
	text "Dude! Come back!"

	para "You didn't get"
	line "your stuff!"
	done

.StepBack:
	step DOWN
	step_end

SkidrawCaveStarterPopOut:
	checkevent EVENT_STARTER_AVAILABLE
	iftrue .Skip
	turnobject PLAYER, UP
	pause 30
	earthquake 30
	appear SKIDRAW_CAVE_POKEBALL
	setevent EVENT_STARTER_AVAILABLE
.Skip:
	end

SkidrawCaveGetStarter:
	refreshscreen
	checkflag ENGINE_PLAYER_IS_FEMALE
	iftrue .Female

.Male:
	pokepic NIDORINA
	cry NIDORINA
	waitbutton
	closepokepic
	disappear SKIDRAW_CAVE_POKEBALL
	refreshscreen
	givepoke NIDORINA, 30, GOLD_BERRY
	jump .done

.Female:
	pokepic NIDORINO
	cry NIDORINO
	waitbutton
	closepokepic
	disappear SKIDRAW_CAVE_POKEBALL
	refreshscreen
	givepoke NIDORINO, 30, GOLD_BERRY

.done:
	closetext
	setscene SCENE_MICKEYS_CAVE_NOTHING
	setmapscene MICKEYS_HOUSE, SCENE_FINISHED
	setmapscene SKIDRAW_CAMP, SCENE_FINISHED
	end


SkidrawCaveGetDex:
	disappear SKIDRAW_CAVE_POKEDEX
	opentext
	writetext .GetDexText
        playsound SFX_ITEM
        waitsfx
	closetext
        setflag ENGINE_POKEDEX
	end

.GetDexText:
	text "You got a #DEX!"
	done

MickeysCave_MapEvents:
	db 0, 0 ; filler

	db 1 ; warp events
	warp_event 9, 0, MICKEYS_HOUSE, 3

	db 2 ; coord events
	coord_event 9, 1, SCENE_MICKEYS_CAVE_CANT_LEAVE, SkidrawCaveCantLeave
	coord_event 0, 13, SCENE_MICKEYS_CAVE_CANT_LEAVE, SkidrawCaveStarterPopOut

	db 0 ; bg events

	db 3 ; object events
	object_event 5, 12, SPRITE_SUPER_NERD, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, SkidrawCaveMickeyTalk, -1
	object_event 0, 12, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, SkidrawCaveGetStarter, EVENT_GOT_STARTER
	object_event 1, 12, SPRITE_POKEDEX, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, SkidrawCaveGetDex, EVENT_GOT_POKEDEX
