dofile("script/layouts/room2_defaults.lua")
dofile("script/shifts/shift2_2_animations.lua")

levelDesc.name = "Shift 2.2"
levelDesc.levelId = 22
levelDesc.musicMood = "3"
levelDesc.trigger =
{
	class = "TriggerSystem",
	triggers =
	{
		{ trigger = "spawn", delay=1, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS1", "XRAY_MINIGAME", "GIVE_BLOOD" } } },
		{ trigger = "spawn", delay=12000, hearts=2, diseaseDesc = { class="Disease", steps={"XRAY", "PUT_ON_CREAM" } } },
		{ trigger = "spawn", delay=17000, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS2", "PILLS3", "XRAY_MINIGAME", } } },
		{ trigger = "startEvent", delay=10000, },
		{ trigger = "spawn", delay=20000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "GIVE_BLOOD", } } },
 		{ trigger = "spawn", delay=5000, hearts=3, diseaseDesc = { class="Disease", steps={"XRAY", "PUT_ON_CREAM" } } },
		{ trigger = "spawn", delay=2000, hearts=2, diseaseDesc = { class="Disease", steps={"XRAY_MINIGAME", "PUT_ON_CREAM" } } },
		{ trigger = "spawn", delay=25000, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS2", "GIVE_BLOOD", } } },
		{ trigger = "spawn", delay=10000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS3", "XRAY_MINIGAME" } } },
		{ trigger = "spawn", delay=5000, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS1", "XRAY", "PUT_ON_CREAM" } } },
		{ trigger = "spawn", delay=20000, hearts=2, diseaseDesc = { class="Disease", steps={"XRAY_MINIGAME" } } },
		{ trigger = "spawn", delay=10000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS2", "GIVE_BLOOD" } } },
		{ trigger = "spawn", delay=20000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS3", "XRAY" } } },
		{ trigger = "spawn", delay=7000, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS2", "XRAY" } } },
	}
}
levelDesc.patientList =
{
	p0 = { weight = 50,
		base = "axel",
	},
	p1 = { weight = 50,
		base = "lady",
	},
	p2 = { weight = 25,
		base = "mother",
	},
	p3 = { weight = 25,
		base = "teen",
	},
}

function onObjectFound(event, obj)
	-- Fade out object
	obj:animate({alpha = 0.0, duration = 100})
end

levelDesc.eventDesc =
{
	class="HiddenObjectEvent",
	eventBarImage = "EVENTBAR_ICON_R2_S2:icons",
	funcFound = onObjectFound,
	hideAllObjects = true,
	scoreOneDone=1,
	scoreAllDone=1,
	eventBarText = "TEXT_EVENT_BEADS",
	hintArrowObjectId = "HIDDEN_BEAD_9",
}

function levelDesc:onInitialized(desc)
	PigRace.initShift(self)
end

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