hedgewars/uAIActions.pas
branch0.9.18
changeset 7901 a86ccf3da9ca
parent 7721 2b1ad418ba39
child 9080 9b42757d7e71
equal deleted inserted replaced
7900:e5e7678e4b2f 7901:a86ccf3da9ca
    70 uses uAIMisc, uAI, uAmmos, uVariables, uCommands, uUtils, uIO{$IFDEF TRACEAIACTIONS}, uConsole{$ENDIF};
    70 uses uAIMisc, uAI, uAmmos, uVariables, uCommands, uUtils, uIO{$IFDEF TRACEAIACTIONS}, uConsole{$ENDIF};
    71 
    71 
    72 var PrevX: LongInt = 0;
    72 var PrevX: LongInt = 0;
    73     timedelta: Longword = 0;
    73     timedelta: Longword = 0;
    74 
    74 
    75 const ActionIdToStr: array[0..8] of string[16] = (
    75 const ActionIdToStr: array[0..7] of string[16] = (
    76 {aia_none}           '',
    76 {aia_none}           '',
    77 {aia_Left}           'left',
    77 {aia_Left}           'left',
    78 {aia_Right}          'right',
    78 {aia_Right}          'right',
    79 {aia_Timer}          'timer',
    79 {aia_Timer}          'timer',
    80 {aia_attack}         'attack',
    80 {aia_attack}         'attack',
    81 {aia_Up}             'up',
    81 {aia_Up}             'up',
    82 {aia_Down}           'down',
    82 {aia_Down}           'down',
    83 {aia_Switch}         'switch',
    83 {aia_Switch}         'switch'
    84 {aia_waitAngle}      'waitAngle'
       
    85                      );
    84                      );
    86 
    85 
    87 {$IFDEF TRACEAIACTIONS}
    86 {$IFDEF TRACEAIACTIONS}
    88 const SpecActionIdToStr: array[$8000..$8009] of string[16] = (
    87 const SpecActionIdToStr: array[$8000..$800C] of string[16] = (
    89 {aia_Weapon}             'aia_Weapon',
    88 {aia_Weapon}             'aia_Weapon',
    90 {aia_WaitX}              'aia_WaitX',
    89 {aia_WaitX}              'aia_WaitX',
    91 {aia_WaitY}              'aia_WaitY',
    90 {aia_WaitY}              'aia_WaitY',
    92 {aia_LookLeft}           'aia_LookLeft',
    91 {aia_LookLeft}           'aia_LookLeft',
    93 {aia_LookRight}          'aia_LookRight',
    92 {aia_LookRight}          'aia_LookRight',
    94 {aia_AwareExpl}          'aia_AwareExpl',
    93 {aia_AwareExpl}          'aia_AwareExpl',
    95 {aia_HJump}              'aia_HJump',
    94 {aia_HJump}              'aia_HJump',
    96 {aia_LJump}              'aia_LJump',
    95 {aia_LJump}              'aia_LJump',
    97 {aia_Skip}               'aia_Skip',
    96 {aia_Skip}               'aia_Skip',
    98 {aia_Wait}               'aia_Wait'
    97 {aia_Wait}               'aia_Wait',
       
    98 {aia_Put}                'aia_Put',
       
    99 {aia_waitAngle}          'aia_waitAngle',
       
   100 {aia_waitAmmoXY}         'aia_waitAmmoXY'
    99 );
   101 );
   100 
   102 
   101 procedure DumpAction(Action: TAction; Me: PGear);
   103 procedure DumpAction(Action: TAction; Me: PGear);
   102 begin
   104 begin
   103 if (Action.Action and ai_specmask) = 0 then
   105 if (Action.Action and ai_specmask) = 0 then
   235                 
   237                 
   236             aia_waitAngle:
   238             aia_waitAngle:
   237                 if LongInt(Me^.Angle) <> Abs(Param) then exit;
   239                 if LongInt(Me^.Angle) <> Abs(Param) then exit;
   238 
   240 
   239             aia_waitAmmoXY:
   241             aia_waitAmmoXY:
   240                 if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then exit;
   242                 if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then 
   241 
   243                     exit;
   242             end
   244             end
   243         else
   245         else
   244             begin
   246             begin
   245             s:= ActionIdToStr[Action];
   247             s:= ActionIdToStr[Action];
   246             if (Param and ai_specmask) <> 0 then
   248             if (Param and ai_specmask) <> 0 then