hedgewars/uAIAmmoTests.pas
changeset 15840 8553c51a9ec8
parent 15836 f7875779d910
child 15900 128ace913837
equal deleted inserted replaced
15839:dd891c8e30c7 15840:8553c51a9ec8
   665         // Sanity check 2: Make sure we're not too close to impact location
   665         // Sanity check 2: Make sure we're not too close to impact location
   666         else if (range < 150) and (Level < 5) then
   666         else if (range < 150) and (Level < 5) then
   667             value:= BadTurn
   667             value:= BadTurn
   668         // Sanity check 3: If impact location is close, above us and wind blows
   668         // Sanity check 3: If impact location is close, above us and wind blows
   669         // towards us, there's a risk of fire flying towards us, so fail in this case.
   669         // towards us, there's a risk of fire flying towards us, so fail in this case.
   670         else if (Level < 3) and (range <= 600) and (trunc(meY) >= EX) and
   670         else if (Level < 3) and (range <= 1000) and (trunc(meY) >= EY) and
   671             (((ap.Angle < 0) and (aiWindSpeed > 0)) or ((ap.Angle > 0) and (aiWindSpeed < 0))) then
   671             ((ap.Angle < 0) <> (aiWindSpeed < 0)) then
   672             value:= BadTurn
   672             value:= BadTurn
   673         // Timeout
   673         // Timeout
   674         else if t < -timeLimit then
   674         else if t < -timeLimit then
   675             value:= BadTurn
   675             value:= BadTurn
   676         else
   676         else
  1673     for i:= 0 to 3 do
  1673     for i:= 0 to 3 do
  1674         if dmg[i] <> BadTurn then
  1674         if dmg[i] <> BadTurn then
  1675             begin
  1675             begin
  1676             dec(t, dmg[i]);
  1676             dec(t, dmg[i]);
  1677             inc(t, dmg[i + 6]);
  1677             inc(t, dmg[i + 6]);
  1678             if t > value then
  1678             if t >= value then
  1679                 begin
  1679                 begin
  1680                 value:= t;
  1680                 value:= t;
  1681                 targetX:= Targ.Point.X - 30 - cShift + i * 30
  1681                 targetX:= Targ.Point.X - 30 - cShift + i * 30
  1682                 end
  1682                 end
  1683             end;
  1683             end;