hedgewars/uAIAmmoTests.pas
changeset 2616 6e2b341dc408
parent 2457 ecf0c7e7995b
child 2630 079ef82eac75
equal deleted inserted replaced
2615:b86abe068708 2616:6e2b341dc408
   118       x:= x + dX;
   118       x:= x + dX;
   119       y:= y + dY;
   119       y:= y + dY;
   120       dX:= dX + cWindSpeed;
   120       dX:= dX + cWindSpeed;
   121       dY:= dY + cGravity;
   121       dY:= dY + cGravity;
   122       dec(t)
   122       dec(t)
   123     until TestColl(hwRound(x), hwRound(y), 5) or (t <= 0);
   123     until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t <= 0);
   124     EX:= hwRound(x);
   124     EX:= hwRound(x);
   125     EY:= hwRound(y);
   125     EY:= hwRound(y);
   126     Result:= RateExplosion(Me, EX, EY, 101);
   126     Result:= RateExplosion(Me, EX, EY, 101);
   127     if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
   127     if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
   128     CheckTrace:= Result
   128     CheckTrace:= Result
   172     repeat
   172     repeat
   173       x:= x + Vx;
   173       x:= x + Vx;
   174       y:= y + dY;
   174       y:= y + dY;
   175       dY:= dY + cGravity;
   175       dY:= dY + cGravity;
   176       dec(t)
   176       dec(t)
   177     until TestColl(hwRound(x), hwRound(y), 5) or (t = 0);
   177     until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t = 0);
   178     EX:= hwRound(x);
   178     EX:= hwRound(x);
   179     EY:= hwRound(y);
   179     EY:= hwRound(y);
   180     if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 101)
   180     if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 101)
   181               else CheckTrace:= BadTurn
   181               else CheckTrace:= BadTurn
   182     end;
   182     end;
   226 			x:= x + Vx;
   226 			x:= x + Vx;
   227 			y:= y + dY;
   227 			y:= y + dY;
   228 			dY:= dY + cGravity;
   228 			dY:= dY + cGravity;
   229 			EX:= hwRound(x);
   229 			EX:= hwRound(x);
   230 			EY:= hwRound(y);
   230 			EY:= hwRound(y);
   231 		until TestColl(EX, EY, 5) or (EY > 1000);
   231 		until TestCollExcludingMe(Me, EX, EY, 5) or (EY > 1000);
   232 
   232 
   233 		if (EY < 1000) and not dY.isNegative then
   233 		if (EY < 1000) and not dY.isNegative then
   234 			begin
   234 			begin
   235 			Result:= RateExplosion(Me, EX, EY, 91);
   235 			Result:= RateExplosion(Me, EX, EY, 91);
   236 			if (Result = 0) then
   236 			if (Result = 0) then
   313 repeat
   313 repeat
   314   x:= x + vX;
   314   x:= x + vX;
   315   y:= y + vY;
   315   y:= y + vY;
   316   rx:= hwRound(x);
   316   rx:= hwRound(x);
   317   ry:= hwRound(y);
   317   ry:= hwRound(y);
   318   if TestColl(rx, ry, 2) then
   318   if TestCollExcludingMe(Me, rx, ry, 2) then
   319      begin
   319      begin
   320      x:= x + vX * 8;
   320      x:= x + vX * 8;
   321      y:= y + vY * 8;
   321      y:= y + vY * 8;
   322      Result:= RateShotgun(Me, rx, ry) * 2;
   322      Result:= RateShotgun(Me, rx, ry) * 2;
   323      if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, rx, ry) div 64
   323      if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, rx, ry) div 64