hedgewars/uAIAmmoTests.pas
changeset 14546 7e4862823649
parent 14227 1d678dee55d1
child 14547 90893b397933
equal deleted inserted replaced
14545:adf3e7d94db0 14546:7e4862823649
  1147         ap.Angle:= DxDy2AttackAnglef(dx, -dy)
  1147         ap.Angle:= DxDy2AttackAnglef(dx, -dy)
  1148         end;
  1148         end;
  1149 
  1149 
  1150     if dx >= 0 then cx:= 0.45 else cx:= -0.45;
  1150     if dx >= 0 then cx:= 0.45 else cx:= -0.45;
  1151 
  1151 
  1152     for i:= 0 to 512 div step - 2 do
  1152     for i:= 1 to 512 div step - 2 do
  1153         begin
  1153         begin
       
  1154         x:= x + dx;
       
  1155         y:= y + dy;
       
  1156 
  1154         valueResult:= valueResult +
  1157         valueResult:= valueResult +
  1155             RateShove(Me, trunc(x), trunc(y)
  1158             RateShove(Me, trunc(x), trunc(y)
  1156                 , 30, 30, 25
  1159                 , 30, 30, 25
  1157                 , cx, -0.9, trackFall or afSetSkip);
  1160                 , cx, -0.9, trackFall or afSetSkip);
  1158 
  1161         end;
  1159         x:= x + dx;
  1162 
  1160         y:= y + dy;
  1163     if (d < 10) and (dx = 0) then
  1161         end;
       
  1162     if dx = 0 then
       
  1163         begin
  1164         begin
  1164         x:= hwFloat2Float(Me^.X);
  1165         x:= hwFloat2Float(Me^.X);
  1165         y:= hwFloat2Float(Me^.Y);
  1166         y:= hwFloat2Float(Me^.Y);
  1166         tx:= trunc(x);
  1167         tx:= trunc(x);
  1167         v:= RateShove(Me, tx, trunc(y)
  1168         v:= RateShove(Me, tx, trunc(y)
  1174                 RateShove(Me, tx, trunc(y)
  1175                 RateShove(Me, tx, trunc(y)
  1175                     , 30, 30, 25
  1176                     , 30, 30, 25
  1176                     , -cx, -0.9, trackFall or afSetSkip);
  1177                     , -cx, -0.9, trackFall or afSetSkip);
  1177             end
  1178             end
  1178         end;
  1179         end;
       
  1180 
  1179     if v > valueResult then
  1181     if v > valueResult then
  1180         begin
  1182     begin
       
  1183         cx:= -cx;
  1181         ap.Angle:= -2048;
  1184         ap.Angle:= -2048;
  1182         valueResult:= v
  1185         valueResult:= v
  1183         end;
  1186         end;
  1184 
  1187 
  1185     v:= RateShove(Me, trunc(x), trunc(y)
  1188     v:= RateShove(Me, trunc(x), trunc(y)