equal
deleted
inserted
replaced
198 t: LongInt; |
198 t: LongInt; |
199 value: LongInt; |
199 value: LongInt; |
200 t2: real; |
200 t2: real; |
201 timer: Longint; |
201 timer: Longint; |
202 begin |
202 begin |
|
203 if (Level > 3) then exit(BadTurn); |
|
204 |
203 mX:= hwFloat2Float(Me^.X); |
205 mX:= hwFloat2Float(Me^.X); |
204 mY:= hwFloat2Float(Me^.Y); |
206 mY:= hwFloat2Float(Me^.Y); |
205 ap.Time:= 0; |
207 ap.Time:= 0; |
206 rTime:= 350; |
208 rTime:= 350; |
207 ap.ExplR:= 0; |
209 ap.ExplR:= 0; |
248 EX:= trunc(x); |
250 EX:= trunc(x); |
249 EY:= trunc(y); |
251 EY:= trunc(y); |
250 if Level = 1 then |
252 if Level = 1 then |
251 value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand) |
253 value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand) |
252 else value:= RateExplosion(Me, EX, EY, 101); |
254 else value:= RateExplosion(Me, EX, EY, 101); |
253 if value = 0 then |
|
254 value:= 1024 - Metric(Targ.X, Targ.Y, EX, EY) div 64; |
|
255 if valueResult <= value then |
255 if valueResult <= value then |
256 begin |
256 begin |
257 ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9)); |
257 ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9)); |
258 ap.Power:= trunc(sqrt(r) * cMaxPower) - random((Level - 1) * 17 + 1); |
258 ap.Power:= trunc(sqrt(r) * cMaxPower) - random((Level - 1) * 17 + 1); |
259 ap.ExplR:= 100; |
259 ap.ExplR:= 100; |
260 ap.ExplX:= EX; |
260 ap.ExplX:= EX; |
261 ap.ExplY:= EY; |
261 ap.ExplY:= EY; |
262 valueResult:= value |
262 valueResult:= value-5 // trying to make it slightly less attractive than a bazooka, to prevent waste. AI could use awareness of weapon count |
263 end; |
263 end; |
264 end |
264 end |
265 until rTime > 4250; |
265 until rTime > 4250; |
266 TestDrillRocket:= valueResult |
266 TestDrillRocket:= valueResult |
267 end; |
267 end; |