hedgewars/uAIMisc.pas
changeset 7651 4cd85eebc54b
parent 7471 ce5d3e39361e
child 7716 95117607b81a
equal deleted inserted replaced
7650:ffa26ebdf8ae 7651:4cd85eebc54b
   427         if abs(Point.x - x) + abs(Point.y - y) < dmgBase then
   427         if abs(Point.x - x) + abs(Point.y - y) < dmgBase then
   428             dmg:= trunc(dmgMod * min((dmgBase - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)))) div 2, r));
   428             dmg:= trunc(dmgMod * min((dmgBase - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)))) div 2, r));
   429 
   429 
   430         if dmg > 0 then
   430         if dmg > 0 then
   431             begin
   431             begin
   432             if Flags and afTrackFall <> 0 then
   432             if (Flags and afTrackFall <> 0) and (dmg < abs(Score)) then
   433                 begin
   433                 begin
   434                 dX:= 0.005 * dmg + 0.01;
   434                 dX:= 0.005 * dmg + 0.01;
   435                 dY:= dX;
   435                 dY:= dX;
   436                 if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and 
   436                 if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and 
   437                    (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then
   437                    (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then