dofile("script/layouts/room1_defaults.lua")
dofile("script/shifts/shift1_2_animations.lua")

levelDesc.name = "Shift 1.2"
levelDesc.levelId = 12
levelDesc.musicMood = "2"
levelDesc.trigger =
{
	class = "TriggerSystem",
	triggers =
	{
		{ trigger = "spawn", delay=1000, hearts=2, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "STETHOSCOPE"} } },
		{ trigger = "spawn", delay=15000, hearts=1, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "FIND_SORE_SPOT", "CHECK_UP", } } },
		{ trigger = "spawn", delay=26000, hearts=3, diseaseDesc = { class="Disease", steps={"STETHOSCOPE" } } },
 		{ trigger = "startEvent", delay = 1000, },
		{ trigger = "spawn", delay=25000, hearts=3, diseaseDesc = { class="Disease", steps={"FIND_SORE_SPOT" } } },
		{ trigger = "spawn", delay=12000, hearts=1, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "PUT_ON_BANDAID", } } },
		{ trigger = "spawn", delay=20000, hearts=2, diseaseDesc = { class="Disease", steps={"STETHOSCOPE", "CHECK_UP", } } },
		{ trigger = "spawn", delay=15000, hearts=3, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "FIND_SORE_SPOT", } } },
		{ trigger = "spawn", delay=8000, hearts=2, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "STETHOSCOPE", } } },
		{ trigger = "spawn", delay=25000, hearts=2, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "PUT_ON_BANDAID", } } },
		{ trigger = "spawn", delay=20000, hearts=1, diseaseDesc = { class="Disease", steps={"DRESSING_ROOM", "FIND_SORE_SPOT", "CHECK_UP", } } },
		{ trigger = "spawn", delay=8000, hearts=2, diseaseDesc = { class="Disease", steps={"FIND_SORE_SPOT", "CHECK_UP", } } },
	}
}
levelDesc.patientList =
{
	p0 = { weight = 50,
		base = "axel",
	},
	p1 = { weight = 50,
		base = "lady",
	},
	p2 = { weight = 50,
		base = "mother",
	},
	p3 = { weight = 25,
		base = "gran",
	},
}

function onObjectFound(event, obj)
	-- Move cookie to tray
	local tray = level:getObject("EVENT_COOKIE_TRAY_DESK")
	local tray_x = tray.x + (tray.width - obj.width) / 2
	local tray_y = tray.y + (tray.height - obj.height) / 2
	level.topLayer:addChild(obj)
	obj:animate({{delay = 200}, {alpha = 0.0, duration = 300}})
	obj:animate(
		{x = tray_x, y = tray_y, style="easeInOut", duration = 500},
		{client=tray, frame=tray.frame + 1},
		{remove=true})
end

levelDesc.eventDesc =
{
	class="HiddenObjectEvent",
	eventBarImage = "EVENTBAR_ICON_R1_S2:icons",
	funcFound = onObjectFound,
	hideAllObjects = true,
	scoreOneDone = 1,
	scoreAllDone = 1,
	eventBarText = "TEXT_EVENT_COOKIES",
	hintArrowObjectId = "HIDDEN_COOKIE_8",
}

function levelDesc:onShiftFinish()
	hintManager:removeArrows({id="Hidden object event"})
    CareLevel.onShiftFinish(self)
end
