hedgewars/uGearsHandlersMess.pas
changeset 10650 7f23971bd9db
parent 10645 b8c73bacb31e
child 10652 4456836514ed
equal deleted inserted replaced
10649:d83897fed816 10650:7f23971bd9db
  1265         begin
  1265         begin
  1266         DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1);
  1266         DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1);
  1267         dec(Gear^.Health, Gear^.Damage);
  1267         dec(Gear^.Health, Gear^.Damage);
  1268         Gear^.Damage := 0
  1268         Gear^.Damage := 0
  1269         end;
  1269         end;
  1270     if ((Gear^.State and gstDrowning) <> 0) and (Gear^.Damage < Gear^.Health) and ((not SuddenDeathDmg and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF))) then
  1270 
  1271         begin
  1271     if ((Gear^.State and gstDrowning) <> 0) and (Gear^.Health > 0) then
  1272         for i:=(Gear^.Health - Gear^.Damage) * 4 downto 0 do
  1272         begin
  1273             begin
  1273         // draw bubbles
  1274             if Random(6) = 0 then
  1274         if (not SuddenDeathDmg and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF)) then
  1275                 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble);
  1275             begin
  1276             Gear^.X := Gear^.X + Gear^.dX;
  1276             for i:=(Gear^.Health * 4) downto 0 do
  1277             Gear^.Y := Gear^.Y + Gear^.dY;
  1277                 begin
  1278             end;
  1278                 if Random(6) = 0 then
       
  1279                     AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble);
       
  1280                 Gear^.X := Gear^.X + Gear^.dX;
       
  1281                 Gear^.Y := Gear^.Y + Gear^.dY;
       
  1282                 end;
       
  1283             end;
       
  1284         // bullet dies underwater
       
  1285         Gear^.Health:= 0;
  1279         end;
  1286         end;
  1280 
  1287 
  1281     if (Gear^.Health <= 0)
  1288     if (Gear^.Health <= 0)
  1282         or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
  1289         or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
  1283         or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
  1290         or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
  1286                 cLaserSighting := false;
  1293                 cLaserSighting := false;
  1287             if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and ((GameFlags and gfArtillery) = 0) then
  1294             if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and ((GameFlags and gfArtillery) = 0) then
  1288                 cArtillery := false;
  1295                 cArtillery := false;
  1289 
  1296 
  1290         // Bullet Hit
  1297         // Bullet Hit
  1291             if (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
  1298             if ((Gear^.State and gstDrowning) = 0) and (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
  1292                 begin
  1299                 begin
  1293                 VGear := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBulletHit);
  1300                 VGear := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBulletHit);
  1294                 if VGear <> nil then
  1301                 if VGear <> nil then
  1295                     begin
  1302                     begin
  1296                     VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);
  1303                     VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);