hedgewars/uAI.pas
changeset 11475 1d478892cf1c
parent 11367 a91c4c4fd85c
child 11532 bf86c6cb9341
equal deleted inserted replaced
11474:67ae276ba229 11475:1d478892cf1c
   164                             end;
   164                             end;
   165                         end;
   165                         end;
   166 
   166 
   167                     AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
   167                     AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
   168 
   168 
       
   169                     if (Ammoz[a].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
       
   170                         begin
       
   171                         AddAction(BestActions, aia_Put, 0, 8, ap.AttackPutX, ap.AttackPutY)
       
   172                         end;
       
   173 
   169                     if (ap.Angle > 0) then
   174                     if (ap.Angle > 0) then
   170                         AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
   175                         AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
   171                     else if (ap.Angle < 0) then
   176                     else if (ap.Angle < 0) then
   172                         AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
   177                         AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
   173 
   178 
   185                         else if dAngle < 0 then
   190                         else if dAngle < 0 then
   186                             begin
   191                             begin
   187                             AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
   192                             AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
   188                             AddAction(BestActions, aia_Down, aim_release, -dAngle, 0, 0)
   193                             AddAction(BestActions, aia_Down, aim_release, -dAngle, 0, 0)
   189                             end
   194                             end
   190                         end;
       
   191 
       
   192                     if (Ammoz[a].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
       
   193                         begin
       
   194                         AddAction(BestActions, aia_Put, 0, 1, ap.AttackPutX, ap.AttackPutY)
       
   195                         end;
   195                         end;
   196 
   196 
   197                     if (Ammoz[a].Ammo.Propz and ammoprop_OscAim) <> 0 then
   197                     if (Ammoz[a].Ammo.Propz and ammoprop_OscAim) <> 0 then
   198                         begin
   198                         begin
   199                         AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0);
   199                         AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0);