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

levelDesc.name = "Shift 2.3"
levelDesc.levelId = 23
levelDesc.musicMood = "4"
levelDesc.trigger =
{
	class = "TriggerSystem",
	triggers =
	{
		{ trigger = "spawn", delay=1, hearts=3, diseaseDesc = { class="Disease", steps={"GERM_MATCH"} } },
		{ trigger = "spawn", delay=5000, hearts=3, diseaseDesc = { class="Disease", steps={"PILLS1", } } },
		{ trigger = "spawn", delay=5000, hearts=3, diseaseDesc = { class="Disease", steps={"PILLS2", } } },
		{ trigger = "spawn", delay=10000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "GERM_MATCH" } } },
 		{ trigger = "spawn", delay=25000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "PILLS2", } } },
 		{ trigger = "spawn", delay=1000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS2" , "PUT_ON_CREAM" } } },
 		{ trigger = "spawn", delay=10000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS3", "XRAY_MINIGAME", } } },
		{ trigger = "spawn", delay=27000, hearts=3, diseaseDesc = { class="Disease", steps={"PILLS2", } } },
 		{ trigger = "spawn", delay=3000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS3", "GERM_MATCH"} } },
 		{ trigger = "spawn", delay=3000, hearts=2, diseaseDesc = { class="Disease", steps={"XRAY_MINIGAME", "GIVE_BLOOD" } } },
		{ trigger = "spawn", delay=25000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "PILLS3", } } },
 		{ trigger = "spawn", delay=1000, hearts=3, diseaseDesc = { class="Disease", steps={"PILLS2" ,} } },
 		{ trigger = "spawn", delay=1000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "GERM_MATCH", } } },
		{ trigger = "spawn", delay=20000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "PILLS2", } } },
		{ trigger = "spawn", delay=15000, hearts=1, diseaseDesc = { class="Disease", steps={"PILLS3", "XRAY_MINIGAME" } } },
		{ trigger = "spawn", delay=5000, hearts=2, diseaseDesc = { class="Disease", steps={"PILLS1", "GERM_MATCH", } } },
	}
}
levelDesc.patientList =
{
	p2 = { weight = 50,
		base = "mother",
	},
	p3 = { weight = 25,
		base = "teen",
	},
	p4 = { weight = 25,
		base = "gran",
	},
	p5 = { weight = 50,
		base = "local_male",
	},
}

levelDesc.eventDesc =
{
 	class="DanceEvent",
	eventBarImage = "EVENTBAR_ICON_R2_S3:icons",
	mainCharacter = "oldman",
	playCharacter = "hero",
	scores = {1,2,4,},
	scoreGotAll = 3,
	eventBarText = "TEXT_EVENT_DANCE",
}

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

function levelDesc:onShiftFinish()
	self:fireTrigger("startEvent")
end

function levelDesc:eventThanks()
    local oldman = level:getCharacter("oldman")
    oldman:addTask({class="PlayAnimationTask", animation="THUMBS_UP", cycles=-1, whenFinished="stay"})
    oldman:addTask({class="Task", duration=1000})
end
