hedgewars/uAIAmmoTests.pas
changeset 5164 a2a67433633d
parent 5151 cbadb9fa52fc
child 5642 0ce9e01bae56
equal deleted inserted replaced
5163:1620a02d5282 5164:a2a67433633d
   465             x:= x + Vx;
   465             x:= x + Vx;
   466             y:= y + dY;
   466             y:= y + dY;
   467             dY:= dY + cGravity;
   467             dY:= dY + cGravity;
   468             EX:= hwRound(x);
   468             EX:= hwRound(x);
   469             EY:= hwRound(y);
   469             EY:= hwRound(y);
   470         until TestCollExcludingMe(Me, EX, EY, 5) or (EY > 1000);
   470         until TestCollExcludingMe(Me, EX, EY, 5) or (EY > cWaterLine);
   471 
   471 
   472         if (EY < 1000) and not dY.isNegative then
   472         if (EY < cWaterLine) and not dY.isNegative then
   473             begin
   473             begin
   474             value:= RateExplosion(Me, EX, EY, 91);
   474             value:= RateExplosion(Me, EX, EY, 91);
   475             if (value = 0) then
   475             if (value = 0) then
   476                 if (dY > _0_15) then
   476                 if (dY > _0_15) then
   477                     value:= - abs(Targ.Y - EY) div 32
   477                     value:= - abs(Targ.Y - EY) div 32
   620 ap.Time:= 0;
   620 ap.Time:= 0;
   621 ap.Power:= 1;
   621 ap.Power:= 1;
   622 x:= Me^.X;
   622 x:= Me^.X;
   623 y:= Me^.Y;
   623 y:= Me^.Y;
   624 if (Targ.X) - hwRound(x) >= 0 then ap.Angle:=   cMaxAngle div 4
   624 if (Targ.X) - hwRound(x) >= 0 then ap.Angle:=   cMaxAngle div 4
   625                                   else ap.Angle:= - cMaxAngle div 4;
   625                               else ap.Angle:= - cMaxAngle div 4;
   626 valueResult:= RateShove(Me, hwRound(x) + 10 * hwSign(int2hwFloat(Targ.X) - x), hwRound(y), 15, 30);
   626 valueResult:= RateShove(Me, hwRound(x) + 10 * hwSign(int2hwFloat(Targ.X) - x), hwRound(y), 15, 30);
   627 if valueResult <= 0 then valueResult:= BadTurn else inc(valueResult);
   627 if valueResult <= 0 then valueResult:= BadTurn else inc(valueResult);
   628 TestBaseballBat:= valueResult;
   628 TestBaseballBat:= valueResult;
   629 end;
   629 end;
   630 
   630 
   704           b[i]:= false;
   704           b[i]:= false;
   705           dmg[i]:= RateExplosion(Me, hwRound(X) + i * 30, hwRound(Y), 58)
   705           dmg[i]:= RateExplosion(Me, hwRound(X) + i * 30, hwRound(Y), 58)
   706           // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
   706           // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
   707           end
   707           end
   708        end;
   708        end;
   709 until fexit or (Y > _1024);
   709 until fexit or (Y.Round > cWaterLine);
   710 
   710 
   711 for i:= 0 to 5 do inc(valueResult, dmg[i]);
   711 for i:= 0 to 5 do inc(valueResult, dmg[i]);
   712 t:= valueResult;
   712 t:= valueResult;
   713 ap.AttackPutX:= Targ.X - 60;
   713 ap.AttackPutX:= Targ.X - 60;
   714 
   714