hedgewars/uAI.pas
changeset 12714 8673892ebf24
parent 11830 bb6503b9847e
child 12715 1ab53b945140
equal deleted inserted replaced
12713:5ef6780b1c05 12714:8673892ebf24
   148                     BestActions.Score:= Actions.Score + Score;
   148                     BestActions.Score:= Actions.Score + Score;
   149 
   149 
   150                     // if not between shots, activate invulnerability/vampirism if available
   150                     // if not between shots, activate invulnerability/vampirism if available
   151                     if CurrentHedgehog^.MultiShootAttacks = 0 then
   151                     if CurrentHedgehog^.MultiShootAttacks = 0 then
   152                         begin
   152                         begin
   153                         if HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0 then
   153                         if (HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0) and (Me^.Hedgehog^.Effects[heInvulnerable] = 0) then
   154                             begin
   154                             begin
   155                             AddAction(BestActions, aia_Weapon, Longword(amInvulnerable), 80, 0, 0);
   155                             AddAction(BestActions, aia_Weapon, Longword(amInvulnerable), 80, 0, 0);
   156                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   156                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   157                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   157                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   158                             end;
   158                             end;
   159 
   159 
   160                         if HHHasAmmo(Me^.Hedgehog^, amExtraDamage) > 0 then
   160                         if (HHHasAmmo(Me^.Hedgehog^, amExtraDamage) > 0) and (cDamageModifier <> _1_5) then
   161                             begin
   161                             begin
   162                             AddAction(BestActions, aia_Weapon, Longword(amExtraDamage), 80, 0, 0);
   162                             AddAction(BestActions, aia_Weapon, Longword(amExtraDamage), 80, 0, 0);
   163                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   163                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   164                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   164                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   165                             end;
   165                             end;
   166                         if HHHasAmmo(Me^.Hedgehog^, amVampiric) > 0 then
   166                         if (HHHasAmmo(Me^.Hedgehog^, amVampiric) > 0) and (not cVampiric) then
   167                             begin
   167                             begin
   168                             AddAction(BestActions, aia_Weapon, Longword(amVampiric), 80, 0, 0);
   168                             AddAction(BestActions, aia_Weapon, Longword(amVampiric), 80, 0, 0);
   169                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   169                             AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   170                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   170                             AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   171                             end;
   171                             end;