

{.$DEFINE FEED}
{.$DEFINE RES_HOUSES}
{.$DEFINE PATROL}
{.$DEFINE DIFFICULTY}
{.$DEFINE REBUILD}
{.$DEFINE ANIMATION}

{$I HKS_Functions.script}


procedure ShowMissionObjectives;
var HH : KD_HouseStats;
begin
	A.OverlayTextSet(PLAYER, '');
	HH := SetHouse(S.HouseAt(84, 18), true);
	If HH.aID = -1 then
	begin
		A.OverlayTextAppend(PLAYER, '<$6>');
		Exit;
	end;
	
	A.OverlayTextAppend(PLAYER, '<$5>');
	with HH do 
	begin
	A.OverlayTextAppendFormatted(PLAYER, '| %s : %d / %d', [S.WareTypeName(8), Wares[8], 20]);
	A.OverlayTextAppendFormatted(PLAYER, '| %s : %d / %d', [S.WareTypeName(10), Wares[10], 20]);
	A.OverlayTextAppendFormatted(PLAYER, '| %s : %d / %d', [S.WareTypeName(13), Wares[13], 30]);
	If Wares[8] >= 20 then 
		If Wares[10] >= 20 then 
			If Wares[13] >= 30 then 
				A.PlayerWin([0], true);
	end;
end;

procedure OnTick;
begin
	If GT mod 50 = 0 then 
		ShowMissionObjectives;
		
     If States.GameTime = 10 then
	begin
		 Actions.OverlayTextSetFormatted(-1, '0', []);
		 Actions.OverlayTextAppendFormatted(-1, '<$0>', []);
		 A.PlayOgg(0, '01', 1);
	end;
     If States.GameTime = 670 then
	begin
	   Actions.OverlayTextSetFormatted(-1, '1', []);
	   Actions.OverlayTextAppendFormatted(-1, '<$1>', []);
	   A.PlayOgg(0, '02', 1);
	end;
     If States.GameTime = 3600 then
	begin
	   Actions.OverlayTextSetFormatted(-1, '2', []);
	   Actions.OverlayTextAppendFormatted(-1, '<$2>', []);
	   A.PlayOgg(0, '03', 1);
	end;    
     If States.GameTime = 4800 then
	begin
	   Actions.OverlayTextSetFormatted(-1, '3', []);
	   Actions.OverlayTextAppendFormatted(-1, '<$3>', []);
	   A.PlayOgg(0, '04', 1);
	end;
     If States.GameTime = 800 then
	begin
	   Actions.OverlayTextSetFormatted(-1, '4', []);
	   Actions.OverlayTextAppendFormatted(-1, '<$2>', []);
	   A.PlayOgg(0, '05', 1);
	end;
end;