hedgewars/uGears.pas
changeset 2568 e654cbfb23ba
parent 2537 aceebf0653f7
child 2597 f777ac80ffef
equal deleted inserted replaced
2567:02ff5f9510b5 2568:e654cbfb23ba
  1237 	begin
  1237 	begin
  1238 	if ((Gear^.State and not gstWinner) = 0)
  1238 	if ((Gear^.State and not gstWinner) = 0)
  1239 		or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
  1239 		or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
  1240 		begin
  1240 		begin
  1241 		t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
  1241 		t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
  1242 		if (cTagsMask and 1) <> 0 then
  1242 		if (cTagsMasks[cTagsMaskIndex] and htTransparent) <> 0 then
       
  1243 			glColor4f(1, 1, 1, 0.5);
       
  1244 		if ((cTagsMasks[cTagsMaskIndex] and htHealth) <> 0) and ((GameFlags and gfInvulnerable) = 0) then
  1243 			begin
  1245 			begin
  1244 			dec(t, HealthTagTex^.h + 2);
  1246 			dec(t, HealthTagTex^.h + 2);
  1245 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
  1247 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
  1246 			end;
  1248 			end;
  1247 		if (cTagsMask and 2) <> 0 then
  1249 		if (cTagsMasks[cTagsMaskIndex] and htName) <> 0 then
  1248 			begin
  1250 			begin
  1249 			dec(t, NameTagTex^.h + 2);
  1251 			dec(t, NameTagTex^.h + 2);
  1250 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
  1252 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
  1251 			end;
  1253 			end;
  1252 		if (cTagsMask and 4) <> 0 then
  1254 		if (cTagsMasks[cTagsMaskIndex] and htTeamName) <> 0 then
  1253 			begin
  1255 			begin
  1254 			dec(t, Team^.NameTagTex^.h + 2);
  1256 			dec(t, Team^.NameTagTex^.h + 2);
  1255 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
  1257 			DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
  1256 			end
  1258 			end;
       
  1259 		if (cTagsMasks[cTagsMaskIndex] and htTransparent) <> 0 then
       
  1260 			glColor4f(1, 1, 1, 1)
  1257 		end;
  1261 		end;
  1258 	if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
  1262 	if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
  1259 		begin
  1263 		begin
  1260 		if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
  1264 		if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
  1261 			DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy,
  1265 			DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy,
  1862 if shoppa then  // FIXME -  TEMPORARY  REMOVE WHEN CRATE PROBABILITY IS ADDED
  1866 if shoppa then  // FIXME -  TEMPORARY  REMOVE WHEN CRATE PROBABILITY IS ADDED
  1863     t:= 7
  1867     t:= 7
  1864 else
  1868 else
  1865     t:= getrandom(20);
  1869     t:= getrandom(20);
  1866 
  1870 
       
  1871 // avoid health crates if all hogs are invulnerable
       
  1872 if (t < 13) and ((GameFlags and gfInvulnerable) <> 0) then t:= t * 13 div 20 + 7;
       
  1873 	
  1867 //case getrandom(20) of
  1874 //case getrandom(20) of
  1868 case t of
  1875 case t of
  1869      0..6: begin
  1876      0..6: begin
  1870         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1877         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1871         FollowGear^.Health:= 25;
  1878         FollowGear^.Health:= 25;