hedgewars/uAIMisc.pas
changeset 4977 c89cca0a8785
parent 4976 088d40d8aba2
child 5244 1b408b965c01
equal deleted inserted replaced
4976:088d40d8aba2 4977:c89cca0a8785
     1 (*
     1 (*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
   137 	if (filter = []) or (Gear^.Kind in filter) then
   137 	if (filter = []) or (Gear^.Kind in filter) then
   138       case Gear^.Kind of
   138       case Gear^.Kind of
   139           gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
   139           gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
   140           gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then
   140           gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then
   141                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 20, -50);
   141                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 20, -50);
   142           gtMine: if (Gear^.State and gstAttacking) = 0 then
   142 // avoid mines unless they are very likely to be duds, or are duds. also avoid if they are about to blow 
   143                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -50)
   143           gtMine:  if ((Gear^.State and gstAttacking) = 0) and 
   144               else
   144                       (((cMineDudPercent < 90) and (Gear^.Health <> 0)) or
   145                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, -50); // mine is on
   145                        ((Gear^.Health = 0) and (Gear^.Damage > 30))) then
       
   146                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -50)
       
   147                       else if (Gear^.State and gstAttacking) <> 0 then
       
   148                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, -50); // mine is on
   146           gtDynamite: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -75);
   149           gtDynamite: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -75);
   147           gtHedgehog: begin
   150           gtHedgehog: begin
   148                       if Gear^.Damage >= Gear^.Health then
   151                       if Gear^.Damage >= Gear^.Health then
   149                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
   152                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
   150                       else
   153                       else