# HG changeset patch # User Wuzzy # Date 1508290741 -7200 # Node ID 8673892ebf2422c593a276b3c4c27146fb6818dc # Parent 5ef6780b1c051cfd9f0c899b017c980e592139d1 AI doesn't use extra damage/vampirism/invulnerable again if already active diff -r 5ef6780b1c05 -r 8673892ebf24 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Wed Oct 18 03:19:43 2017 +0200 +++ b/hedgewars/uAI.pas Wed Oct 18 03:39:01 2017 +0200 @@ -150,20 +150,20 @@ // if not between shots, activate invulnerability/vampirism if available if CurrentHedgehog^.MultiShootAttacks = 0 then begin - if HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0 then + if (HHHasAmmo(Me^.Hedgehog^, amInvulnerable) > 0) and (Me^.Hedgehog^.Effects[heInvulnerable] = 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 + if (HHHasAmmo(Me^.Hedgehog^, amExtraDamage) > 0) and (cDamageModifier <> _1_5) 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; - if HHHasAmmo(Me^.Hedgehog^, amVampiric) > 0 then + if (HHHasAmmo(Me^.Hedgehog^, amVampiric) > 0) and (not cVampiric) then begin AddAction(BestActions, aia_Weapon, Longword(amVampiric), 80, 0, 0); AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);