hedgewars/uAIAmmoTests.pas
changeset 9137 d987230b85ed
parent 9080 9b42757d7e71
child 9145 6b51a32e48ed
equal deleted inserted replaced
9134:9330bacf2569 9137:d987230b85ed
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uAIAmmoTests;
    21 unit uAIAmmoTests;
    22 interface
    22 interface
    23 uses SDLh, uConsts, uFloat, uTypes, uAIMisc;
    23 uses uConsts, uFloat, uTypes, uAIMisc;
    24 const
    24 const
    25     amtest_Rare     = $00000001; // check only several positions
    25     amtest_Rare     = $00000001; // check only several positions
    26     amtest_NoTarget = $00000002; // each pos, but no targetting
    26     amtest_NoTarget = $00000002; // each pos, but no targetting
    27 
    27 
    28 var windSpeed: real;
    28 var windSpeed: real;
   679 end;
   679 end;
   680 
   680 
   681 function TestDesertEagle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt;
   681 function TestDesertEagle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt;
   682 var Vx, Vy, x, y, t: real;
   682 var Vx, Vy, x, y, t: real;
   683     d: Longword;
   683     d: Longword;
   684     fallDmg, valueResult: LongInt;
   684     {fallDmg, }valueResult: LongInt;
   685 begin
   685 begin
   686 if (Level > 4) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
   686 if (Level > 4) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
   687 Level:= Level; // avoid compiler hint
   687 Level:= Level; // avoid compiler hint
   688 ap.ExplR:= 1;
   688 ap.ExplR:= 1;
   689 ap.Time:= 0;
   689 ap.Time:= 0;
   722 
   722 
   723 
   723 
   724 function TestSniperRifle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt;
   724 function TestSniperRifle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt;
   725 var Vx, Vy, x, y, t, dmg: real;
   725 var Vx, Vy, x, y, t, dmg: real;
   726     d: Longword;
   726     d: Longword;
   727     fallDmg: LongInt;
   727     //fallDmg: LongInt;
   728 begin
   728 begin
   729 if (Level > 3) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
   729 if (Level > 3) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
   730 Level:= Level; // avoid compiler hint
   730 Level:= Level; // avoid compiler hint
   731 ap.ExplR:= 0;
   731 ap.ExplR:= 0;
   732 ap.Time:= 0;
   732 ap.Time:= 0;