hedgewars/uGears.pas
changeset 853 0b4a23795530
parent 848 b31b72756927
child 854 fef7f2d908bf
equal deleted inserted replaced
852:f756a1d3324c 853:0b4a23795530
   501 						hwSign(Gear^.dX),
   501 						hwSign(Gear^.dX),
   502 						1,
   502 						1,
   503 						3,
   503 						3,
   504 						0);
   504 						0);
   505 				end;
   505 				end;
   506 
   506 			gtPickHammer,
   507 		else if (CurAmmoGear^.Kind = gtPickHammer) then
   507 			gtTeleport: defaultPos:= false;
   508 			defaultPos:= false
       
   509 		end
   508 		end
   510 	end else
   509 	end else
   511 	if ((Gear^.State and gstHHJumping) <> 0) then
   510 	if ((Gear^.State and gstHHJumping) <> 0) then
   512 		begin
   511 		begin
   513 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   512 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   558 			amBlowTorch: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   557 			amBlowTorch: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   559 						hwSign(Gear^.dX),
   558 						hwSign(Gear^.dX),
   560 						1,
   559 						1,
   561 						3,
   560 						3,
   562 						0);
   561 						0);
       
   562 			amTeleport: DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, 0, hwSign(Gear^.dX), 0);
   563 		else
   563 		else
   564 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   564 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   565 				hwSign(Gear^.dX),
   565 				hwSign(Gear^.dX),
   566 				0,
   566 				0,
   567 				4,
   567 				4,
   625                                 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle)
   625                                 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle)
   626         end;
   626         end;
   627 end;
   627 end;
   628 
   628 
   629 procedure DrawGears(Surface: PSDL_Surface);
   629 procedure DrawGears(Surface: PSDL_Surface);
   630 var Gear: PGear;
   630 var Gear, HHGear: PGear;
   631     i: Longword;
   631     i: Longword;
   632     roplen: LongInt;
   632     roplen: LongInt;
   633 
   633 
   634     procedure DrawRopeLine(X1, Y1, X2, Y2: LongInt);
   634     procedure DrawRopeLine(X1, Y1, X2, Y2: LongInt);
   635     var  eX, eY, dX, dY: LongInt;
   635     var  eX, eY, dX, dY: LongInt;
   744            gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Angle) mod 8);
   744            gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Angle) mod 8);
   745        gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0);
   745        gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0);
   746        gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0)
   746        gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0)
   747                                      else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1);
   747                                      else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1);
   748          gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   748          gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
       
   749         gtTeleport: begin
       
   750                     HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
       
   751                     DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, Gear^.Pos, hwSign(HHGear^.dX), 0);
       
   752                     DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
       
   753                     end;
   749         gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
   754         gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
   750           gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
   755           gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
   751               end;
   756               end;
   752       Gear:= Gear^.NextGear
   757       Gear:= Gear^.NextGear
   753       end;
   758       end;