hedgewars/uGears.pas
changeset 954 0cc31e998f4e
parent 943 a0c36a0b3ad9
child 955 474afaab0365
equal deleted inserted replaced
953:237fc147950c 954:0cc31e998f4e
   207     gtHedgehog: begin
   207     gtHedgehog: begin
   208                 Result^.Radius:= cHHRadius;
   208                 Result^.Radius:= cHHRadius;
   209                 Result^.Elasticity:= _0_35;
   209                 Result^.Elasticity:= _0_35;
   210                 Result^.Friction:= _0_999;
   210                 Result^.Friction:= _0_999;
   211                 Result^.Angle:= cMaxAngle div 2;
   211                 Result^.Angle:= cMaxAngle div 2;
       
   212                 Result^.Pos:= GetRandom(19);
   212                 Result^.Z:= cHHZ;
   213                 Result^.Z:= cHHZ;
   213                 end;
   214                 end;
   214 gtAmmo_Grenade: begin
   215 gtAmmo_Grenade: begin
   215                 Result^.Radius:= 4;
   216                 Result^.Radius:= 4;
   216                 end;
   217                 end;
   588 				1,
   589 				1,
   589 				0);
   590 				0);
   590 			defaultPos:= false
   591 			defaultPos:= false
   591 		end else
   592 		end else
   592 
   593 
   593 	if (Gear^.Message and (gm_Left or gm_Right) <> 0)
   594 	if (Gear^.Message and (gm_Left or gm_Right) <> 0) then
   594        or ((Gear^.State and gstAttacked) <> 0) then
       
   595 		begin
   595 		begin
   596 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   596 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   597 			hwSign(Gear^.dX),
   597 			hwSign(Gear^.dX),
   598 			0,
   598 			0,
   599 			PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   599 			PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   600 			0);
   600 			0);
   601 			defaultPos:= false
   601 			defaultPos:= false
   602 		end
   602 		end
   603     else
   603     else
   604 
   604 
       
   605 	if ((Gear^.State and gstAttacked) = 0) then
   605 	begin
   606 	begin
   606 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
   607 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
   607 		case amt of
   608 		case amt of
   608 			amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
   609 			amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
   609 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
   610 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
   643 		defaultPos:= false
   644 		defaultPos:= false
   644 	end
   645 	end
   645 end;
   646 end;
   646 
   647 
   647 if defaultPos then
   648 if defaultPos then
   648 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   649 	DrawRotatedF(sprHHIdle,
       
   650 		hwRound(Gear^.X) + 1 + WorldDx,
       
   651 		hwRound(Gear^.Y) - 3 + WorldDy,
       
   652 		(RealTicks div 256 + Gear^.Pos) mod 19,
   649 		hwSign(Gear^.dX),
   653 		hwSign(Gear^.dX),
   650 		0,
       
   651 		3,
       
   652 		0);
   654 		0);
   653 
   655 
   654 with PHedgehog(Gear^.Hedgehog)^ do
   656 with PHedgehog(Gear^.Hedgehog)^ do
   655      if (Gear^.State{ and not gstAnimation}) = 0 then
   657      if (Gear^.State{ and not gstAnimation}) = 0 then
   656         begin
   658         begin