dofile("script/layouts/room_outro.lua")
dofile("script/shifts/outro_animations.lua")

levelDesc.name = "Outro"
levelDesc.layoutId = 15
levelDesc.areaId = 0
levelDesc.levelId = 155
levelDesc.music = "GAME"
levelDesc.musicMood = "SUSPENSE"
levelDesc.ambientLoop = ""
levelDesc.dispatchEnabled = false
levelDesc.isGamePlayLevel = false
levelDesc.hideGUI = true

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

function levelDesc:handleTrigger(trigger, meta)
	CareLevel.handleTrigger(self, trigger, meta)
	if (trigger == "end outro") then
	    player.trophyManager:awardTrophy(25,1)	
		self:onLevelEndContinue()
	elseif (trigger == "dobin speak") then
		level:getObject("dobin"):addTask({class="MessageTask", duration=4000, textId="TEXT_R5_SH6_2"})
		hero:addTask({class="Task", duration=4000})
		hero:addTask({class="MessageTask", duration=4000, textId="TEXT_R5_SH6_21", offset={x=0, y=100}})
	elseif (trigger == "goto idle") then
		level:getChild("john_cpr"):playAnimation("IDLE")
	end
end

levelDesc.heroDesc =
{
	name = "hero",
	base = "sarah",
	x = 1200,
}

levelDesc.eventDesc =
{
	class="GestureEvent",
	eventBarImage = "EVENTBAR_ICON_GESTURE:icons",
	doGestureObject = "john_cpr",
	noHearts = true,
	overheadPosition = {x=-10, y=-89},
	playObjectsDefaultAnimations = false,
	gestures = {
		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="CHECKPULSE", gestureLocation={x=468, y=385}},
		{desc=3, objectId="john_cpr", animation="MOVEHEAD", gestureLocation={x=468, y=385}, trigger="dobin speak"},

		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, timeBeforeStart=9000},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},

		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},
		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},

		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},

		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},
		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},

		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},
		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
		{desc=9, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}, invert=true},

		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},
		{desc=16, drainSpeed=20, growSpeed=20, objectId="john_cpr", animation="BREATH", gestureLocation={x=468, y=385}, trigger="goto idle"},

		{desc=10, objectId="john_cpr", animation="HEARTPUSH", gestureLocation={x=468, y=385}},
	},
}
