equal
deleted
inserted
replaced
111 rTime:= 350; |
111 rTime:= 350; |
112 ap.ExplR:= 0; |
112 ap.ExplR:= 0; |
113 Result:= BadTurn; |
113 Result:= BadTurn; |
114 repeat |
114 repeat |
115 rTime:= rTime + 300 + Level * 50 + random(300); |
115 rTime:= rTime + 300 + Level * 50 + random(300); |
116 Vx:= - cWindSpeed * rTime * _0_5 + (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(rTime); |
116 Vx:= - cWindSpeed * rTime * _0_5 + (int2hwFloat(Targ.X + AIrndSign(2)) - Me^.X) / int2hwFloat(rTime); |
117 Vy:= cGravity * rTime * _0_5 - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(rTime); |
117 Vy:= cGravity * rTime * _0_5 - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(rTime); |
118 r:= Distance(Vx, Vy); |
118 r:= Distance(Vx, Vy); |
119 if not (r > _1) then |
119 if not (r > _1) then |
120 begin |
120 begin |
121 Score:= CheckTrace; |
121 Score:= CheckTrace; |
279 if Result <= 0 then Result:= BadTurn else inc(Result); |
279 if Result <= 0 then Result:= BadTurn else inc(Result); |
280 TestFirePunch:= Result |
280 TestFirePunch:= Result |
281 end; |
281 end; |
282 |
282 |
283 function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; |
283 function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; |
|
284 const cShift = 4; |
284 var X, Y, dY: hwFloat; |
285 var X, Y, dY: hwFloat; |
285 b: array[0..9] of boolean; |
286 b: array[0..9] of boolean; |
286 dmg: array[0..9] of LongInt; |
287 dmg: array[0..9] of LongInt; |
287 fexit: boolean; |
288 fexit: boolean; |
288 i, t, Result: LongInt; |
289 i, t, Result: LongInt; |
292 if (Level > 3) then exit(BadTurn); |
293 if (Level > 3) then exit(BadTurn); |
293 |
294 |
294 ap.AttackPutX:= Targ.X; |
295 ap.AttackPutX:= Targ.X; |
295 ap.AttackPutY:= Targ.Y; |
296 ap.AttackPutY:= Targ.Y; |
296 |
297 |
297 X:= int2hwFloat(Targ.X - 135); |
298 X:= int2hwFloat(Targ.X - 135 - cShift); // hh center - cShift |
298 X:= X - cBombsSpeed * hwSqrt(int2hwFloat((Targ.Y + 128) * 2) / cGravity); |
299 X:= X - cBombsSpeed * hwSqrt(int2hwFloat((Targ.Y + 128) * 2) / cGravity); |
299 Y:= -_128; |
300 Y:= -_128; |
300 dY:= _0; |
301 dY:= _0; |
301 |
302 |
302 for i:= 0 to 9 do |
303 for i:= 0 to 9 do |
334 dec(t, dmg[i]); |
335 dec(t, dmg[i]); |
335 inc(t, dmg[i + 6]); |
336 inc(t, dmg[i + 6]); |
336 if t > Result then |
337 if t > Result then |
337 begin |
338 begin |
338 Result:= t; |
339 Result:= t; |
339 ap.AttackPutX:= Targ.X - 30 + i * 30 |
340 ap.AttackPutX:= Targ.X - 30 - cShift + i * 30 |
340 end |
341 end |
341 end; |
342 end; |
342 |
343 |
343 if Result <= 0 then Result:= BadTurn; |
344 if Result <= 0 then Result:= BadTurn; |
344 TestAirAttack:= Result |
345 TestAirAttack:= Result |