hedgewars/uAIMisc.pas
changeset 2716 b9ca1bfca24f
parent 2695 ed789a7ef68d
child 2948 3f21a9dc93d0
equal deleted inserted replaced
2715:0e4e0db79e2a 2716:b9ca1bfca24f
    35                Ticks: Longword;
    35                Ticks: Longword;
    36                FallPix: Longword;
    36                FallPix: Longword;
    37                JumpType: TJumpType;
    37                JumpType: TJumpType;
    38                end;
    38                end;
    39 
    39 
       
    40 procedure init_uAIMisc;
       
    41 procedure free_uAIMisc;
       
    42 
    40 procedure FillTargets;
    43 procedure FillTargets;
    41 procedure FillBonuses(isAfterAttack: boolean);
    44 procedure FillBonuses(isAfterAttack: boolean);
    42 procedure AwareOfExplosion(x, y, r: LongInt);
    45 procedure AwareOfExplosion(x, y, r: LongInt);
    43 function RatePlace(Gear: PGear): LongInt;
    46 function RatePlace(Gear: PGear): LongInt;
    44 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean;
    47 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean;
    52 var ThinkingHH: PGear;
    55 var ThinkingHH: PGear;
    53     Targets: TTargets;
    56     Targets: TTargets;
    54 
    57 
    55 implementation
    58 implementation
    56 uses uTeams, uMisc, uLand, uCollisions;
    59 uses uTeams, uMisc, uLand, uCollisions;
    57 const KillScore = 200;
       
    58       MAXBONUS = 1024;
       
    59       friendlyfactor: LongInt = 300;
       
    60 
    60 
    61 type TBonus = record
    61 type TBonus = record
    62               X, Y: LongInt;
    62               X, Y: LongInt;
    63               Radius: LongInt;
    63               Radius: LongInt;
    64               Score: LongInt;
    64               Score: LongInt;
    65               end;
    65               end;
    66 var bonuses: record
    66 
       
    67 const KillScore = 200;
       
    68       MAXBONUS = 1024;
       
    69 
       
    70 var friendlyfactor: LongInt = 300;
       
    71     KnownExplosion: record
       
    72                     X, Y, Radius: LongInt
       
    73                     end = (X: 0; Y: 0; Radius: 0);
       
    74     bonuses: record
    67              Count: Longword;
    75              Count: Longword;
    68              ar: array[0..Pred(MAXBONUS)] of TBonus;
    76              ar: array[0..Pred(MAXBONUS)] of TBonus;
    69              end;
    77              end;
    70     KnownExplosion: record
    78 
    71                     X, Y, Radius: LongInt
       
    72                     end = (X: 0; Y: 0; Radius: 0);
       
    73 
    79 
    74 procedure FillTargets;
    80 procedure FillTargets;
    75 var i, t: Longword;
    81 var i, t: Longword;
    76     f, e: Longword;
    82     f, e: Longword;
    77 begin
    83 begin
   457 begin
   463 begin
   458 if random(2) = 0 then AIrndSign:=   num
   464 if random(2) = 0 then AIrndSign:=   num
   459                  else AIrndSign:= - num
   465                  else AIrndSign:= - num
   460 end;
   466 end;
   461 
   467 
       
   468 procedure init_uAIMisc;
       
   469 begin
       
   470 	friendlyfactor:= 300;
       
   471 	KnownExplosion.X:= 0;
       
   472 	KnownExplosion.Y:= 0;
       
   473 	KnownExplosion.Radius:= 0;
       
   474 end;
       
   475 
       
   476 procedure free_uAIMisc;
       
   477 begin
       
   478 
       
   479 end;
       
   480 
   462 end.
   481 end.