function OnWarpEnter() 

	SetMarker("cs\\Warp_0027.wp" , 0 , 0) 
	SetMarker("cs\\Warp_0002.wp" , 0 , 0) 

	-- cuillère
	PutObject("aha1")
	-- pelle à farine
	PutObject("aia1")
	-- pétrin
	AnimationSetToStart("aga1",false)

	if not Part2 then
		SetMarker("Sugar", 1 , 0)
		SetMarker("Cinamon", 1 , 0)
		SetMarker("zoomRecette", 4, 0)
		SetMarker("Pot", 4, 0)
	end
	
----------------------------------------------------------------------------- puits
	if Rope_Ready_027  then
		if Bucket_up_full then
			-- corde en bon état
			AnimationSetToStart("cna1",true)
			AnimationSetToEnd("coa1")
		elseif Bucket_up_empty then
			-- corde en bon état
			AnimationSetToStart("cna1",true)
			AnimationSetToStart("coa1",false)
		elseif Bucket_down then
			-- corde en bon état
			StartAnimationPart("cna1",2,3,-1,true)
		end
	else
		if Rope_Changed_027 then
			-- corde en bon état
			AnimationSetToStart("cna1",true)
		else
			StartAnimationPart("cna1",3,4,-1,true)
		end
	end
----------------------------------------------------------------------------- 

	if fireCookingW01 then 
		-- allumage du feu de cheminée
		StartAnimationPart("ada1", 60, 90, -1)
		SetMarker("Wood", 4 , 0)
	else
		SetMarker("Wood", 4 , 0)
	end




--DAY1	
	if ETAT_DAY == "D1" then 
		-- bouteilles
		if not O_containers_001 then
			SetMarker("aoa1", 2, 0)
			PutObject("aoa1")
		end
	end 
	
--DAY2
	if ETAT_DAY == "D2" then 

	end 

--DAY3
	if ETAT_DAY == "D3" then 
		if not BREAD_TAKEN_D3 then
			-- plateau à pain
			StartAnimationPart("aba1",2,3,-1,true)
			SetMarker("aba1",2,0)
		else
			-- plateau à pain
			AnimationSetToStart("aba1",false)
		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 

	end 

--DAY5
	if ETAT_DAY == "D5" then 

	end 
end

function OnWarpLeave()
end

function OnDialogFinished(dialogName) 

	if not Part2 then
		if dialogName == "Ma1099" or dialogName == "Ma1034" then 
			SetMarker("Wood",4,0)
		end
	end
end

function OnCookingAnswered(magic)

PrintDebugMessage(magic)
	if magic == "24" then
		readyforfruit = true
	end
	if magic == "600"  then
		readyJam = true
		if fireCooking then
			heatedJam = true
			-- pot bouillant
			StartAnimationPart("aea1", 0, 60, 1)
			DrawText("Ma1101", "Ma1101.ogg",0) -- Ça doit être prêt.
		end
	end
end

function OnAnimationFinished(animName)

	-- allumage du feu de cheminée
	if animName == "ada1" then
		fireCookingW01 = true
		if readyJam then
			DrawText("Ma1101", "Ma1101.ogg") -- Ça doit être prêt.
			-- allumage du feu de cheminée
			StartAnimationPart("ada1" , 60, 90, -1)
			-- pot bouillant
			StartAnimationPart("aea1", 0, 60, 1)
			heatedJam = true
			SetMarker("Wood", 4 , 0)
			SetMarker("Pot", 4, 0)
		else
			-- allumage du feu de cheminée
			StartAnimationPart("ada1" , 60, 90, -1)
			SetMarker("Wood", 4 , 0)
			SetMarker("Pot", 4, 0)
		end
	end
	if animName == "aea1" then
		-- pot bouillant
		StartAnimationPart("aea1", 30, 60, -1)
	end


end

function OnAskToResetOrAddIngredientAnswered(cooking, ingredient, response)
	PrintDebugMessage("OnAskToResetOrAddIngredientAnswered("..cooking..", "..ingredient..", "..response..")\n")

	if response == "reset" then
		ResetIngredients("cooking0")
		readyJam = false
		if PumpkinOnPot then
			PumpkinOnPot = false
			AddToBag("A_courges")
		end
		if ApplesOnPot then
			ApplesOnPot = false
			AddToBag("A_pommes")
		end
	elseif response == "add" then
		if ingredient == "Sugar" then
			AddIngredient("cooking0", "Sugar")
			ResetIngredientsToTest()
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Cinamon")
			PushIngredientToTest("A_pommes")
			PushIngredientToTest("A_courges")
			if CheckCookingFinished("cooking0") then
				readyJam = true
				DrawText("Ma1097","Ma1097.ogg",0) -- Il ne me reste plus qu'à chauffer tout ça.
			end
		elseif ingredient == "Cinamon" then
			AddIngredient("cooking0", "Cinamon")
			ResetIngredientsToTest()
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Cinamon")
			PushIngredientToTest("A_pommes")
			PushIngredientToTest("A_courges")
			if CheckCookingFinished("cooking0") then
				readyJam = true
				DrawText("Ma1097","Ma1097.ogg",0) -- Il ne me reste plus qu'à chauffer tout ça.
			end
		elseif ingredient == "A_pommes" then
			AddIngredient("cooking0", "A_pommes")
			RemoveFromBag()	
			ApplesOnPot = true
			ResetIngredientsToTest()
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Cinamon")
			PushIngredientToTest("A_pommes")
			PushIngredientToTest("A_courges")
			if CheckCookingFinished("cooking0") then
				readyJam = true
				DrawText("Ma1097","Ma1097.ogg",0) -- Il ne me reste plus qu'à chauffer tout ça.
			end
		elseif ingredient == "A_courges" then
			AddIngredient("cooking0", "A_courges")
			RemoveFromBag()	
			PumpkinOnPot = true
			ResetIngredientsToTest()
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Sugar")
			PushIngredientToTest("Cinamon")
			PushIngredientToTest("A_pommes")
			PushIngredientToTest("A_courges")
			if CheckCookingFinished("cooking0") then
				readyJam = true
				DrawText("Ma1097","Ma1097.ogg",0) -- Il ne me reste plus qu'à chauffer tout ça.
			end
		end
	end
end

function OnWarpObjectHit(objectName)

	if objectName == "3D\\cs\\Warp_0027.wp" then 
		ChangeWarp(objectName)
	end

	if objectName == "3D\\zoomRecette" then 
		ShowDocument("RecetteCompote")
	end

	if objectName == "3D\\cs\\Warp_0002.wp" then 
		ChangeWarp(objectName)
	end

	if objectName == "3D\\Wood" and not Part2 then 
		SetMarker("Wood",-1,0)
		if not fireCookingW01 and readyJam and not heatedJam then
			-- allumage du feu de cheminée
			StartAnimationPart("ada1", 0 , 90, 1)
			PlaySound("Sounds/SFX/E_bo_feu_SAllume.ogg",1)
			SetMarker("Pot", -1, 0)
			heatedJam = true
		elseif not fireCookingW01 and not readyJam then
			DrawText("Ma1099","Ma1099.ogg",0) -- Pas encore.
		else
			DrawText("Ma1034","Ma1034.ogg",0) -- Il y en a suffisamment.
		end
	end

	if objectName == "3D\\Pot"  and not Part2 then 
		if Selected("A_recipient") and readyJam and fireCookingW01 and heatedJam and not JamDone then
			JamDone = true	
			AnimationSetToStart("aea1")
			AddToBag("A_pots_confiture")
			PlaySound("Sounds/SFX/J_Cle.ogg",1)
		elseif Selected("A_courges") then
			if JamDone then
				DrawText("Ma0216","Ma0216.ogg",0) -- Plus besoin de faire ça.
			else
				AskToResetOrAddIngredient("cooking0", "A_courges");
			end
		elseif Selected("A_pommes") then
			if JamDone then
				DrawText("Ma0216", "Ma0216.ogg",0) -- Plus besoin de faire ça.
			else
				AskToResetOrAddIngredient("cooking0", "A_pommes");
			end
		elseif not heatedJam then
			AskToResetOrAddIngredient("cooking0");
		elseif heatedJam and not JamDone then
			DrawText("Ma0211", "Ma0211.ogg",0) -- Il faudrait un récipient.
		elseif JamDone then
			DrawText("Ma0216","Ma0216.ogg",0) -- Plus besoin de faire ça.
		end
	end


	if objectName == "3D\\Cinamon" and not Part2 then 
		if JamDone then
			DrawText("Ma0216", "Ma0216.ogg",0) -- Plus besoin de faire ça.
		else
			if readyJam then
				DrawText("Ma1095","Ma1095.ogg",0)  -- Il y a déjà tout ce qu'il faut.
			else
				AskToResetOrAddIngredient("cooking0", "Cinamon");
			end
		end
	end


	if objectName == "3D\\Sugar" and not Part2 then 
		if JamDone then
			DrawText("Ma0216", "Ma0216.ogg",0) -- Plus besoin de faire ça.
		else
			if readyJam then
				DrawText("Ma1095","Ma1095.ogg",0)  -- Il y a déjà tout ce qu'il faut.
			else
				AskToResetOrAddIngredient("cooking0", "Sugar");
			end
		end
	end


--DAY1
	if ETAT_DAY == "D1" then 
		if objectName == "aha1" then

		elseif objectName == "aia1" then

		-- bout de pétrin cassé
		elseif objectName == "aja1" then

		elseif objectName == "ajan" then

		-- bouteilles
		elseif objectName == "aoa1" then
			SetMarker("aoa1", -1, 0)
			RemoveObject ("aoa1")
			AddToBag("A_recipient")
			O_containers_001 = true

		-- feu du pétrin
		elseif objectName == "aaa1" then

		-- feu du pétrin
		elseif objectName == "aaan" then

		-- plateau à pain
		elseif objectName == "aba1" then

		-- plateau à pain (bis)
		elseif objectName == "aban" then

		-- pain dans le four
		elseif objectName == "aca1" then

		-- allumage du feu de cheminée
		elseif objectName == "ada1" then

		-- pot bouillant
		elseif objectName == "aea1" then

		-- pétrin en action (avec pâte)
		elseif objectName == "aga1" then

		-- pétrin en action (sans pâte)
		elseif objectName == "agan" then

		-- flamme bougie table
		elseif objectName == "ana1" then

		-- corde puits
		elseif objectName == "cna1" then

		-- corde puits
		elseif objectName == "cnan" then

		-- corde et sceau du puits
		elseif objectName == "coa1" then

		-- corde et sceau du puits
		elseif objectName == "coan" then

		end
	end 

--DAY2
	if ETAT_DAY == "D2" then 

	end 

--DAY3
	if ETAT_DAY == "D3" then 

		if objectName == "aba1" then
			if not BREAD_TAKEN_D3 then
				BREAD_TAKEN_D3 = true
				AnimationSetToStart("aba1",false)
				AddToBag("A_pain")
				AddToBag("A_pain")
				SetMarker("aba1",-1,0)
			end

		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 

	end  

--DAY5
	if ETAT_DAY == "D5" then 

	end 
end 