Mission = {

	Briefing = 0,
	Objective1  = 0,
	Objective2  = 0,
};


function Mission:OnInit()
	-- you may want to load a string-table etc. here...
System:SetConsoleImage("levels/light4/loadscreen.dds",0);
end

function Mission:Event_Jones01()
	--Jones begruesst mich

Movie:PlaySequence('JonesFace')
	--Laesst Jones nach meiner vorgefertigten CutScene winken
end

function Mission:Event_Intro()
Movie:PlaySequence('intro')

end

function Mission:Event_BlastDoorOne()
Movie:PlaySequence('BlastDoorOne')

end

function Mission:Event_MonsterWallRunner()
Movie:PlaySequence('monsterwallrunner')

end

function Mission:Event_GhostPassingBy()
Movie:PlaySequence('ghostpassingby')

end

function Mission:Event_crazydepp()
Movie:PlaySequence('crazydepp')

end

function Mission:Event_deadpeople1()
Movie:PlaySequence('deadpeople1')

end

function Mission:Event_test21()
Movie:PlaySequence('test2')

end

function Mission:Event_OverHere()
Movie:PlaySequence('overhere')

end

function Mission:Event_scheisserei()
Movie:PlaySequence('scheisserei')

end

function Mission:Event_generator()
Movie:PlaySequence('generator')

end

function Mission:Event_zombie()
Movie:PlaySequence('zombie')

end

function Mission:Event_Survival()
Movie:PlaySequence('survival')

end

function Mission:Event_generatorleft()
Movie:PlaySequence('generatorleft')

end

function Mission:Event_generatorright()
Movie:PlaySequence('generatorright')

end

function Mission:Event_LastCutscene_FINAL()
Movie:PlaySequence('LastCutscene_FINAL')

end

function Mission:Event_DynamoFlyBy()
Movie:PlaySequence('DynamoFlyBy')

end

function Mission:Event_Objective001()
	--die Benamung meiner ersten Mission

Hud:PushObjective({},"Finde lebendig aus dem Komplex heraus!");
	--das steht im Missionsfenster des Huds

Hud:AddMessage("Neuer Auftrag!",10);
	--Zeigt mir fuer 10 Sekunden den Auftrag unten links im HUD an

end

function Mission:Event_Objective002()
	--die Benamung meiner zweiten Mission

Hud:CompleteObjective("Finde lebendig aus dem Komplex heraus!");
	--Graut den Auftrag aus meiner ersten Mission im HUD aus (wird also als erledigt markiert)

Hud:AddMessage("Ziel erreicht!",10);
	--Zeigt mir fuer 10 Sekunden die Komplettierung des Auftrages an

Hud:PushObjective({},"Du kannst Dich gerne umschauen. Aber fass bloss nix an!");
	--das steht im Missionsfenster des Huds

Hud:AddMessage("Information im Missionsfenster!",10);
	--Zeigt mir fuer 10 Sekunden den Auftrag unten links im HUD an

end



--------------------------------------------------------------------------------------------------------
--CAMERAS FOR RESIDENT EVIL STYLE--
--------------------------------------------------------------------------------------------------------


function Mission:Event_cam01()
Movie:PlaySequence('cam01')

end

function Mission:Event_cam002()
Movie:PlaySequence('cam002')

end


function Mission:OnUpdate()
	local i;
	local bFinished=1;
	for i,objective in Mission do
		if (type(objective)~="function") then
			if (objective==0) then 
				bFinished=0;				
			else
			end
		end	
	end
	if (bFinished==1) then	
		self.Finish();
	end
end

function Mission:Event_MissionFinished()
   _localplayer.cnt:SavePlayerElements();
   Game:SendMessage('StartLevelFade Bunker');
   -- Hud:AddMessage(Localize("MissionComplete"));
end

function Mission:Event_OutsideMap()
--System:Log("setting timetodie to 1");
	_localplayer.timetodie=1;	
	_localplayer:SetTimer(100);
end
----------------------------------------------------------------------------
-- HudMessage

function Mission:Event_Message010()
	Hud:FlashObjectives({},"");
	Hud:SetRadarObjective("nil");	
end

function Mission:Event_Message020()
	Hud:AddMessage(Localize("NewObjective"),10);
	Hud:PushObjective({},Localize("GoToTheScientist"));
	Hud:SetRadarObjective("MissionObjective_1");	 	 	
end

function Mission:Event_Message021()
	Hud:AddMessage(Localize("NewObjective"),10);
	Hud:CompleteObjective(Localize("GoToTheScientist")); 
	Hud:PushObjective({},Localize("EnterTheBunker"));
	Hud:SetRadarObjective("MissionObjective_5");	 	 	
end

function Mission:Event_Message030()
	Hud:AddMessage(Localize("HintThisGateIsCl"),10);
--	Hud:AddMessage('Maybe I can open it from the supervision. ',10);
end

function Mission:Event_Message040()
	Hud:AddMessage(Localize("HintTheGateToThe"),10);
end

function Mission:Event_Message060()
	Hud:AddMessage(Localize("ClosedYouCanNotO"),10);
end

function Mission:Event_Message061()
--	Hud:AddMessage('Objective: Get explosives from the tower.',10);
--	Hud:AddMessage('Objective: Plant explosives at the back of the compound wall!',10);
	Hud:AddMessage(Localize("NewObjective"),10);
	Hud:PushObjective({},Localize("GetExplosivesFro"));	 
	Hud:PushObjective({},Localize("PlantExplosivesA"));	 
	Hud:SetRadarObjective("MissionObjective_3");	 	 	
end

function Mission:Event_Message062()
--	Hud:AddMessage('You will find explosives close to that tower',10);
	Hud:AddMessage(Localize("NewObjective"),10);
	Hud:PushObjective({},Localize("GetExplosivesFro"))	 
end

function Mission:Event_Message063()
	Hud:AddMessage(Localize("PlantTheExplosiv"),10);
end

function Mission:Event_Message070()
--	Hud:AddMessage('Completed: Get explosives from the tower.',15);
	Hud:CompleteObjective(Localize("GetExplosivesFro")); 
	Hud:SetRadarObjective("MissionObjective_4");	 	 	
end

function Mission:Event_Message080()
--	Hud:AddMessage('Completed: Plant explosives at the back of the compound wall!',15);
	Hud:CompleteObjective(Localize("PlantExplosivesA")); 
end

function Mission:Event_Message081()
	Hud:SetRadarObjective("MissionObjective_5");	 	 	
end

function Mission:Event_Message090()
	Hud:CompleteObjective(Localize("EnterTheBunker_2")); 
end

function Mission:Finish()
end