hedgewars/uAI.pas
changeset 10231 b2a68e75e55c
parent 10164 0570d4b22187
child 10510 9329dab04490
--- a/hedgewars/uAI.pas	Mon Apr 28 16:52:00 2014 +0200
+++ b/hedgewars/uAI.pas	Mon Apr 28 19:01:08 2014 +0400
@@ -146,19 +146,23 @@
 
                     BestActions.Score:= Actions.Score + Score;
 
-                    if HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0 then
+                    // if not between shots, activate invulnerability/vampirism if available
+                    if CurrentHedgehog^.MultiShootAttacks = 0 then
                         begin
-                        AddAction(BestActions, aia_Weapon, Longword(amInvulnerable), 80, 0, 0);
-                        AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
-                        AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
+                        if HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0 then
+                            begin
+                            AddAction(BestActions, aia_Weapon, Longword(amInvulnerable), 80, 0, 0);
+                            AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
+                            AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
+                            end;
+
+                        if HHHasAmmo(Me^.Hedgehog^, amExtraDamage) > 0 then
+                            begin
+                            AddAction(BestActions, aia_Weapon, Longword(amExtraDamage), 80, 0, 0);
+                            AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
+                            AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
+                            end; 
                         end;
-                        
-                    if HHHasAmmo(Me^.Hedgehog^, amExtraDamage) > 0 then
-                        begin
-                        AddAction(BestActions, aia_Weapon, Longword(amExtraDamage), 80, 0, 0);
-                        AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
-                        AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
-                        end; 
     
                     AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);