Mission = {
};


function Mission:OnInit()
	-- you may want to load a string-table etc. here...
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:Finish()
	-- go to next mission...
end

function Mission:Event_Getin()
	Hud:AddMessage(Localize("NewObjective"),9);
	
	Hud:PushObjective({},Localize("Find the way to get in to the Ship"))
end

function Mission:Event_Inside()
	Hud:AddMessage(Localize("NewObjective"),9);
	
	Hud:CompleteObjective(Localize("Find the way to get in to the Ship"));
	Hud:PushObjective({},Localize("Find what this is all about"));
end

function Mission:Event_CrateCore()
	Hud:AddMessage(Localize("NewObjective"),9);
	
	Hud:CompleteObjective(Localize("Find what this is all about"));
	Hud:PushObjective({},Localize("Find the Fusion Core Reactor Room"));
end

function Mission:Event_FusionCore()
	Hud:AddMessage(Localize("NewObjective"),9);
	
	Hud:CompleteObjective(Localize("Find the Fusion Core Reactor Room"));
	Hud:PushObjective({},Localize("BLAST the Fusion Core Reactor and send this space ship to the HELL"));
end

function Mission:Event_Findkey()
	Hud:AddMessage(Localize("NewObjective"),9);
        Hud:PushObjective({},Localize("You've to shut down the Main ventilation System you'll need a keycard"));
end

function Mission:Event_Findkeydone()
	Hud:CompleteObjective(Localize("You've to shut down the Main ventilation System you'll need a keycard"));
end

function Mission:Event_Getout()
	Hud:AddMessage(Localize("NewObjective"),9);
	
	Hud:CompleteObjective(Localize("BLAST the Fusion Core Reactor and send this space ship to the HELL"));
	Hud:PushObjective({},Localize("Get the Hell Out Before the Contdown Stops"));
end

function Mission:Event_MissionFinished()	
	Game:SendMessage('StartLevelFade deltacomplex');
end

function Mission:Event_Advise1()
	Hud:AddMessage(Localize("The Fusion Core Reactor is Going Critical"),5);
end

function Mission:Event_Advise2()
	Hud:AddMessage(Localize("Plant the Bomb Before is Too Late"),5);
end

function Mission:Event_radar()
	Hud:AddMessage(Localize("jump out in the far side of the SpaceShip"),5);
        Hud:SetRadarObjective("back");
end

function Mission:Event_KillPlayer()
    --System:Log("setting timetodie to 1");
    _localplayer.timetodie=1;    
    _localplayer:SetTimer(500);
end
