77 Score:= AmmoTests[a](Me, Targets.ar[i].Point, BotLevel, Time, Angle, Power, ExplX, ExplY, ExplR); |
77 Score:= AmmoTests[a](Me, Targets.ar[i].Point, BotLevel, Time, Angle, Power, ExplX, ExplY, ExplR); |
78 if Actions.Score + Score > BestActions.Score then |
78 if Actions.Score + Score > BestActions.Score then |
79 begin |
79 begin |
80 BestActions:= Actions; |
80 BestActions:= Actions; |
81 inc(BestActions.Score, Score); |
81 inc(BestActions.Score, Score); |
|
82 |
82 AddAction(BestActions, aia_Weapon, Longword(a), 500); |
83 AddAction(BestActions, aia_Weapon, Longword(a), 500); |
83 if Time <> 0 then AddAction(BestActions, aia_Timer, Time div 1000, 400); |
84 if Time <> 0 then AddAction(BestActions, aia_Timer, Time div 1000, 400); |
84 if (Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200) |
85 if (Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200) |
85 else if (Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200); |
86 else if (Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200); |
86 if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then |
87 if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then |
248 if (Me.State and gstAttacked) = 0 then |
249 if (Me.State and gstAttacked) = 0 then |
249 if Targets.Count > 0 then |
250 if Targets.Count > 0 then |
250 begin |
251 begin |
251 Walk(@WalkMe); |
252 Walk(@WalkMe); |
252 if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(2000); |
253 if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(2000); |
253 if BestActions.Score = BadTurn then AddAction(BestActions, aia_Skip, 0, 250); |
254 if BestActions.Score < -1023 then |
|
255 begin |
|
256 BestActions.Count:= 0; |
|
257 AddAction(BestActions, aia_Skip, 0, 250); |
|
258 end; |
254 end else |
259 end else |
255 else begin |
260 else begin |
256 Walk(@WalkMe); |
261 Walk(@WalkMe); |
257 while (not StopThinking) and (BestActions.Count = 0) do |
262 while (not StopThinking) and (BestActions.Count = 0) do |
258 begin |
263 begin |