# HG changeset patch # User unc0rr # Date 1184356789 0 # Node ID 49675457d76ee5e6bd8603c5cb742dc528027b76 # Parent 0376fdcc6322fc0a6ef9a7163c0fb2b2fbc7789e Bots aims not directly at the center of enemy hedgehog diff -r 0376fdcc6322 -r 49675457d76e hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Thu Jul 12 14:44:41 2007 +0000 +++ b/hedgewars/uAIAmmoTests.pas Fri Jul 13 19:59:49 2007 +0000 @@ -113,7 +113,7 @@ Result:= BadTurn; repeat rTime:= rTime + 300 + Level * 50 + random(300); - Vx:= - cWindSpeed * rTime * _0_5 + (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(rTime); + Vx:= - cWindSpeed * rTime * _0_5 + (int2hwFloat(Targ.X + AIrndSign(2)) - Me^.X) / int2hwFloat(rTime); Vy:= cGravity * rTime * _0_5 - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(rTime); r:= Distance(Vx, Vy); if not (r > _1) then @@ -281,6 +281,7 @@ end; function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +const cShift = 4; var X, Y, dY: hwFloat; b: array[0..9] of boolean; dmg: array[0..9] of LongInt; @@ -294,7 +295,7 @@ ap.AttackPutX:= Targ.X; ap.AttackPutY:= Targ.Y; -X:= int2hwFloat(Targ.X - 135); +X:= int2hwFloat(Targ.X - 135 - cShift); // hh center - cShift X:= X - cBombsSpeed * hwSqrt(int2hwFloat((Targ.Y + 128) * 2) / cGravity); Y:= -_128; dY:= _0; @@ -336,7 +337,7 @@ if t > Result then begin Result:= t; - ap.AttackPutX:= Targ.X - 30 + i * 30 + ap.AttackPutX:= Targ.X - 30 - cShift + i * 30 end end;