hedgewars/uAIMisc.pas
changeset 6888 32a54322d262
parent 6785 a8aa5984185f
child 6952 7f70f37bbf08
equal deleted inserted replaced
6887:19d77932ea91 6888:32a54322d262
    46 
    46 
    47 procedure initModule;
    47 procedure initModule;
    48 procedure freeModule;
    48 procedure freeModule;
    49 
    49 
    50 procedure FillTargets;
    50 procedure FillTargets;
    51 procedure FillBonuses(isAfterAttack: boolean; filter: TGearsType = []);
    51 procedure FillBonuses(isAfterAttack: boolean);
    52 procedure AwareOfExplosion(x, y, r: LongInt); inline;
    52 procedure AwareOfExplosion(x, y, r: LongInt); inline;
    53 function RatePlace(Gear: PGear): LongInt;
    53 function RatePlace(Gear: PGear): LongInt;
    54 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline;
    54 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline;
    55 function TestColl(x, y, r: LongInt): boolean; inline;
    55 function TestColl(x, y, r: LongInt): boolean; inline;
    56 function TraceShoveFall(Me: PGear; x, y, dX, dY: Real): LongInt;
    56 function TraceShoveFall(Me: PGear; x, y, dX, dY: Real): LongInt;
   124 bonuses.ar[bonuses.Count].Score:= s;
   124 bonuses.ar[bonuses.Count].Score:= s;
   125 inc(bonuses.Count);
   125 inc(bonuses.Count);
   126 TryDo(bonuses.Count <= MAXBONUS, 'Bonuses overflow', true)
   126 TryDo(bonuses.Count <= MAXBONUS, 'Bonuses overflow', true)
   127 end;
   127 end;
   128 
   128 
   129 procedure FillBonuses(isAfterAttack: boolean; filter: TGearsType);
   129 procedure FillBonuses(isAfterAttack: boolean);
   130 var Gear: PGear;
   130 var Gear: PGear;
   131     MyClan: PClan;
   131     MyClan: PClan;
   132 begin
   132 begin
   133 bonuses.Count:= 0;
   133 bonuses.Count:= 0;
   134 MyClan:= ThinkingHH^.Hedgehog^.Team^.Clan;
   134 MyClan:= ThinkingHH^.Hedgehog^.Team^.Clan;
   135 Gear:= GearsList;
   135 Gear:= GearsList;
   136 while Gear <> nil do
   136 while Gear <> nil do
   137     begin
   137     begin
   138     if (filter = []) or (Gear^.Kind in filter) then
       
   139         case Gear^.Kind of
   138         case Gear^.Kind of
   140             gtCase:
   139             gtCase:
   141             AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
   140             AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
   142             gtFlame:
   141             gtFlame:
   143                 if (Gear^.State and gsttmpFlag) <> 0 then
   142                 if (Gear^.State and gsttmpFlag) <> 0 then