dofile("script/layouts/entrance_hall.lua")
dofile("script/shifts/intro2_animations.lua")

levelDesc.name = "Intro 2"
levelDesc.layoutId = 3
levelDesc.areaId = 0
levelDesc.levelId = 2
levelDesc.music = "SELECTION"
levelDesc.isGamePlayLevel = false
levelDesc.hideGUI = true

function levelDesc:handleTrigger(trigger, meta)
	CareLevel.handleTrigger(self, trigger, meta)
	if (trigger == "end intro2") then
		self:onLevelEndContinue()
	end
end

function levelDesc:onShiftStartBegin()
	self.timerActive = false
	self:shiftStartEnd() -- Start shift without start shift dialog.

	local black = self:add({class="SpriteExt", x=0, y=0, width=1024, height=768, color=0xff000000, draw="color", floor=300})
	local hospital = self:add({class="SpriteExt", baseAnimation="HOSPITAL", defaultSection="default", floor=200})

	local atEnd = 
	black:animate({
		{alpha=0, duration=2000},
		{delay=2000},
		{alpha=1, duration=2000},
		{alpha=0, duration=1000},
		{remove=true},
	})
	hospital:animate({
		{delay=3000},
		{x=-145, y=-248, scale=1.8, duration=3000, style="easeIn"},
		{remove=true, call=function()
			taskSystem:createAnimation("welcomeSarah")
		end},
	})
end

