hedgewars/uAIAmmoTests.pas
changeset 7206 ce46b56ae9f5
parent 7204 522f165cd2e7
child 7208 62e36dc45098
equal deleted inserted replaced
7204:522f165cd2e7 7206:ce46b56ae9f5
   650 if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 40 then
   650 if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 40 then
   651     exit(BadTurn);
   651     exit(BadTurn);
   652 
   652 
   653 dmg:= sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y));
   653 dmg:= sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y));
   654 t:= 1.5 / dmg;
   654 t:= 1.5 / dmg;
   655 dmg:= dmg * 0.025; // div 40
   655 dmg:= dmg * 0.05; // div 40
   656 Vx:= (Targ.X - x) * t;
   656 Vx:= (Targ.X - x) * t;
   657 Vy:= (Targ.Y - y) * t;
   657 Vy:= (Targ.Y - y) * t;
   658 ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
   658 ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
   659 d:= 0;
   659 d:= 0;
   660 
   660