hedgewars/uGears.pas
changeset 1253 79f47495b346
parent 1251 1f545d9a10ca
child 1254 3ffaf75572dd
equal deleted inserted replaced
1252:2e2719c0a397 1253:79f47495b346
   590 procedure DrawHH(Gear: PGear);
   590 procedure DrawHH(Gear: PGear);
   591 var t: LongInt;
   591 var t: LongInt;
   592 	amt: TAmmoType;
   592 	amt: TAmmoType;
   593 	hx, hy, m: LongInt;
   593 	hx, hy, m: LongInt;
   594 	aAngle, dAngle: real;
   594 	aAngle, dAngle: real;
   595 	defaultPos: boolean;
   595 	defaultPos, HatVisible: boolean;
   596 begin
   596 begin
   597 if (Gear^.State and gstHHDeath) <> 0 then
   597 if (Gear^.State and gstHHDeath) <> 0 then
   598 	begin
   598 	begin
   599 	DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
   599 	DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
   600 	exit
   600 	exit
   601 	end;
   601 	end;
   602 
   602 
   603 defaultPos:= true;
   603 defaultPos:= true;
       
   604 HatVisible:= false;
   604 
   605 
   605 if (Gear^.State and gstDrowning) <> 0 then
   606 if (Gear^.State and gstDrowning) <> 0 then
   606 	begin
   607 	begin
   607 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   608 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   608 			hwSign(Gear^.dX),
   609 			hwSign(Gear^.dX),
   800 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   801 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   801 				hwSign(Gear^.dX),
   802 				hwSign(Gear^.dX),
   802 				0,
   803 				0,
   803 				4,
   804 				4,
   804 				0);
   805 				0);
       
   806 			
       
   807 			HatVisible:= true;
       
   808 			with PHedgehog(Gear^.Hedgehog)^ do
       
   809 				if HatVisibility > 0 then
       
   810 					DrawTextureF(HatTex,
       
   811 						HatVisibility,
       
   812 						hwRound(Gear^.X) + 1 + WorldDx,
       
   813 						hwRound(Gear^.Y) - 8 + WorldDy,
       
   814 						0,
       
   815 						hwSign(Gear^.dX),
       
   816 						32);
   805 		end;
   817 		end;
   806 
   818 
   807 		case amt of
   819 		case amt of
   808 			amBaseballBat: DrawRotated(sprHandBaseball,
   820 			amBaseballBat: DrawRotated(sprHandBaseball,
   809 					hwRound(Gear^.X) + 1 - 4 * hwSign(Gear^.dX) + WorldDx,
   821 					hwRound(Gear^.X) + 1 - 4 * hwSign(Gear^.dX) + WorldDx,
   851 			hwRound(Gear^.X) + 1 + WorldDx,
   863 			hwRound(Gear^.X) + 1 + WorldDx,
   852 			hwRound(Gear^.Y) - 3 + WorldDy,
   864 			hwRound(Gear^.Y) - 3 + WorldDy,
   853 			(RealTicks div 128 + Gear^.Pos) mod 19,
   865 			(RealTicks div 128 + Gear^.Pos) mod 19,
   854 			hwSign(Gear^.dX),
   866 			hwSign(Gear^.dX),
   855 			0);
   867 			0);
       
   868 		HatVisible:= true;
       
   869 		end;
       
   870 
       
   871 	if HatVisible then
   856 		if HatVisibility < 1.0 then
   872 		if HatVisibility < 1.0 then
   857 			HatVisibility:= HatVisibility + 0.05;
   873 			HatVisibility:= HatVisibility + 0.1
   858 		end
   874 		else
   859 	else
   875 	else
   860 		if HatVisibility > 0.0 then
   876 		if HatVisibility > 0.0 then
   861 			HatVisibility:= HatVisibility - 0.05;
   877 			HatVisibility:= HatVisibility - 0.1;
   862 
   878 	
   863 	if HatVisibility > 0 then
   879 	if HatVisibility > 0 then
   864 		DrawTextureF(HatTex,
   880 		DrawTextureF(HatTex,
   865 			HatVisibility,
   881 			HatVisibility,
   866 			hwRound(Gear^.X) + 1 + WorldDx,
   882 			hwRound(Gear^.X) + 1 + WorldDx,
   867 			hwRound(Gear^.Y) - 8 + WorldDy,
   883 			hwRound(Gear^.Y) - 8 + WorldDy,