hedgewars/uAI.pas
branchios-develop
changeset 13418 ba39a1d396c0
parent 13138 733f3154198c
child 14231 545b85c0f2e3
equal deleted inserted replaced
13416:6e8b807bda4b 13418:ba39a1d396c0
   286 // switch to 'skip' if we cannot move because of mouse cursor being shown
   286 // switch to 'skip' if we cannot move because of mouse cursor being shown
   287 if (Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
   287 if (Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
   288     AddAction(Actions, aia_Weapon, Longword(amSkip), 100 + random(200), 0, 0);
   288     AddAction(Actions, aia_Weapon, Longword(amSkip), 100 + random(200), 0, 0);
   289 
   289 
   290 if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0))
   290 if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0))
   291     and (GameFlags and gfArtillery = 0) and (cGravityf <> 0) then
   291     and (CurrentHedgehog^.Effects[heArtillery] = 0) and (cGravityf <> 0) then
   292     begin
   292     begin
   293     tmp:= random(2) + 1;
   293     tmp:= random(2) + 1;
   294     Push(0, Actions, Me^, tmp);
   294     Push(0, Actions, Me^, tmp);
   295     Push(0, Actions, Me^, tmp xor 3);
   295     Push(0, Actions, Me^, tmp xor 3);
   296 
   296 
   472 
   472 
   473             FillBonuses(false);
   473             FillBonuses(false);
   474 
   474 
   475             // Hog has no idea what to do. Use tardis or skip
   475             // Hog has no idea what to do. Use tardis or skip
   476             if not bonuses.activity then
   476             if not bonuses.activity then
   477                 if ((HHHasAmmo(Me^.Hedgehog^, amTardis) > 0)) and (CanUseTardis(Me^.Hedgehog^.Gear)) and (random(4) < 3) then
   477                 if (((GameFlags and gfInfAttack) <> 0) or (not isInMultiShoot)) and ((HHHasAmmo(Me^.Hedgehog^, amTardis) > 0)) and (CanUseTardis(Me^.Hedgehog^.Gear)) and (random(4) < 3) then
   478                     // Tardis brings hog to a random place. Perfect for clueless AI
   478                     // Tardis brings hog to a random place. Perfect for clueless AI
   479                     begin
   479                     begin
   480                     AddAction(BestActions, aia_Weapon, Longword(amTardis), 80, 0, 0);
   480                     AddAction(BestActions, aia_Weapon, Longword(amTardis), 80, 0, 0);
   481                     AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   481                     AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
   482                     AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
   482                     AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);