hedgewars/uGearsRender.pas
changeset 15204 7ae8ec7a9a8e
parent 15167 6b7d92fa4912
child 15206 9231247b1f83
equal deleted inserted replaced
15203:decb2f1c682b 15204:7ae8ec7a9a8e
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
     9 	 * This program is distributed in the hope that it will be useful,
     9      * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    12  * GNU General Public License for more details.
    13  *
    13  *
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
  1135 
  1135 
  1136     if (Gear^.State and gstHHDriven) <> 0 then
  1136     if (Gear^.State and gstHHDriven) <> 0 then
  1137         begin
  1137         begin
  1138         if (CurAmmoGear = nil) then
  1138         if (CurAmmoGear = nil) then
  1139             begin
  1139             begin
  1140                 if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0)
  1140             if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0)
  1141                 and (Gear^.Message and (gmLeft or gmRight) = 0) then
  1141             and (Gear^.Message and (gmLeft or gmRight) = 0) then
  1142                 begin
  1142                 begin
  1143                 amt:= CurrentHedgehog^.CurAmmoType;
  1143                 amt:= CurrentHedgehog^.CurAmmoType;
  1144                     case amt of
  1144                 case amt of
  1145                         amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
  1145                     amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
  1146                             sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle);
  1146                         sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle);
  1147                         amMinigun: DrawSpritePivotedF(sprMinigun,
  1147                     amMinigun: DrawSpritePivotedF(sprMinigun,
  1148                             sx + 20 * sign, sy + 4, 0, sign, -18, -2, aangle);
  1148                         sx + 20 * sign, sy + 4, 0, sign, -18, -2, aangle);
  1149                     end;
  1149                     end;
  1150                 end;
  1150                 end;
  1151             end
  1151             end
  1152         else
  1152         else
  1153             begin
  1153             begin
  1359                     else if Gear^.Health <> 0 then
  1359                     else if Gear^.Health <> 0 then
  1360                        DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
  1360                        DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
  1361                     else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
  1361                     else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
  1362                     end;
  1362                     end;
  1363          gtAirMine: 
  1363          gtAirMine: 
  1364 					if (Gear^.State and gstFrozen <> 0) then
  1364                     if (Gear^.State and gstFrozen <> 0) then
  1365                         DrawSprite(sprFrozenAirMine, x-16, y-16, 0)
  1365                         DrawSprite(sprFrozenAirMine, x-16, y-16, 0)
  1366 					else if (Gear^.Tag <> 0) then
  1366                     else if (Gear^.Tag <> 0) then
  1367                         DrawSprite(sprAirMine, x-16, y-16, 16 + ((RealTicks div 50 + Gear^.Uid) mod 16))
  1367                         DrawSprite(sprAirMine, x-16, y-16, 16 + ((RealTicks div 50 + Gear^.Uid) mod 16))
  1368 					else if (Gear^.State and gstTmpFlag = 0) then                // mine is inactive
  1368                     else if (Gear^.State and gstTmpFlag = 0) then                // mine is inactive
  1369                         begin
  1369                         begin
  1370 						if (Gear^.State and gstTmpFlag = 0) then Tint(150,150,150,255);
  1370                         if (Gear^.State and gstTmpFlag = 0) then Tint(150,150,150,255);
  1371                         DrawSprite(sprAirMine, x-16, y-16, 15);
  1371                         DrawSprite(sprAirMine, x-16, y-16, 15);
  1372                         untint
  1372                         untint
  1373                         end
  1373                         end
  1374                     else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then  // mine is chasing a hog
  1374                     else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then  // mine is chasing a hog
  1375                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25 + Gear^.Uid) mod 16)
  1375                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25 + Gear^.Uid) mod 16)
  1643                                     end;
  1643                                     end;
  1644                                 end
  1644                                 end
  1645                           end
  1645                           end
  1646                       end;
  1646                       end;
  1647             gtCreeper: if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then
  1647             gtCreeper: if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then
  1648 					     DrawSpriteRotatedF(sprCreeper, x, y, 1, hwRound(SignAs(_1,Gear^.Hedgehog^.Gear^.X-Gear^.X)), 0)
  1648                          DrawSpriteRotatedF(sprCreeper, x, y, 1, hwRound(SignAs(_1,Gear^.Hedgehog^.Gear^.X-Gear^.X)), 0)
  1649 					else DrawSpriteRotatedF(sprCreeper, x, y, 1, hwRound(SignAs(_1,Gear^.dX)), 0);
  1649                     else DrawSpriteRotatedF(sprCreeper, x, y, 1, hwRound(SignAs(_1,Gear^.dX)), 0);
  1650 
  1650 
  1651             gtGenericFaller: begin
  1651             gtGenericFaller: begin
  1652                              // DEBUG: draw gtGenericFaller
  1652                              // DEBUG: draw gtGenericFaller
  1653                              if Gear^.Tag <> 0 then
  1653                              if Gear^.Tag <> 0 then
  1654                                  DrawCircle(x, y, max(3, Gear^.Radius), 3, $FF, $00, $00, $FF)
  1654                                  DrawCircle(x, y, max(3, Gear^.Radius), 3, $FF, $00, $00, $FF)