hedgewars/uAIMisc.pas
changeset 7214 befce0edf527
parent 7210 2ff30b79d2b0
child 7274 a07777b818f1
equal deleted inserted replaced
7212:ab60dbe8fd0c 7214:befce0edf527
   341     while true do
   341     while true do
   342     begin
   342     begin
   343         x:= x + dX;
   343         x:= x + dX;
   344         y:= y + dY;
   344         y:= y + dY;
   345         dY:= dY + cGravityf;
   345         dY:= dY + cGravityf;
   346 
   346 (*
   347         if ((trunc(y) and LAND_HEIGHT_MASK) = 0) and ((trunc(x) and LAND_WIDTH_MASK) = 0) then 
   347         if ((trunc(y) and LAND_HEIGHT_MASK) = 0) and ((trunc(x) and LAND_WIDTH_MASK) = 0) then 
   348             begin
   348             begin
   349             LandPixels[trunc(y), trunc(x)]:= v;
   349             LandPixels[trunc(y), trunc(x)]:= v;
   350             UpdateLandTexture(trunc(X), 1, trunc(Y), 1, true);
   350             UpdateLandTexture(trunc(X), 1, trunc(Y), 1, true);
   351             end;
   351             end;
       
   352 *)
   352 
   353 
   353         // consider adding dX/dY calc here for fall damage
   354         // consider adding dX/dY calc here for fall damage
   354         if TestCollExcludingObjects(trunc(x), trunc(y), cHHRadius) then
   355         if TestCollExcludingObjects(trunc(x), trunc(y), cHHRadius) then
   355         begin
   356         begin
   356             if 0.4 < dY then
   357             if 0.4 < dY then
   444             dmg:= r - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)));
   445             dmg:= r - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)));
   445 
   446 
   446         if dmg > 0 then
   447         if dmg > 0 then
   447             begin
   448             begin
   448             if (Flags and afSetSkip <> 0) then skip:= true;
   449             if (Flags and afSetSkip <> 0) then skip:= true;
   449             if (Flags and afTrackFall <> 0) then 
   450             if (Flags and afTrackFall <> 0) and (Score > 0) then 
   450                 fallDmg:= trunc(TraceShoveFall(Point.x, Point.y - 2, dX, dY) * dmgMod);
   451                 fallDmg:= trunc(TraceShoveFall(Point.x, Point.y - 2, dX, dY) * dmgMod);
   451             if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI
   452             if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI
   452                 if Score > 0 then
   453                 if Score > 0 then
   453                     inc(rate, KillScore + Score div 10)   // Add a bit of a bonus for bigger hog drownings
   454                     inc(rate, KillScore + Score div 10)   // Add a bit of a bonus for bigger hog drownings
   454                 else
   455                 else