hedgewars/uAIActions.pas
changeset 70 82d93eeecebe
parent 66 9643d75baf1e
child 71 5f56c6979496
equal deleted inserted replaced
69:d8a526934b9f 70:82d93eeecebe
     4 const MAXACTIONS = 256;
     4 const MAXACTIONS = 256;
     5       aia_none       = 0;
     5       aia_none       = 0;
     6       aia_Left       = 1;
     6       aia_Left       = 1;
     7       aia_Right      = 2;
     7       aia_Right      = 2;
     8       aia_Timer      = 3;
     8       aia_Timer      = 3;
     9       aia_Slot       = 4;
     9       aia_attack     = 4;
    10       aia_attack     = 5;
    10       aia_Up         = 5;
    11       aia_Up         = 6;
    11       aia_Down       = 6;
    12       aia_Down       = 7;
       
    13 
    12 
    14       aia_Weapon     = $80000000;
    13       aia_Weapon     = $80000000;
    15       aia_WaitX      = $80000001;
    14       aia_WaitX      = $80000001;
    16       aia_WaitY      = $80000002;
    15       aia_WaitY      = $80000002;
    17       aia_LookLeft   = $80000003;
    16       aia_LookLeft   = $80000003;
    35 procedure ProcessAction(var Actions: TActions; Me: PGear);
    34 procedure ProcessAction(var Actions: TActions; Me: PGear);
    36 
    35 
    37 implementation
    36 implementation
    38 uses uMisc, uTeams, uConsts, uConsole;
    37 uses uMisc, uTeams, uConsts, uConsole;
    39 
    38 
    40 const ActionIdToStr: array[0..7] of string[16] = (
    39 const ActionIdToStr: array[0..6] of string[16] = (
    41 {aia_none}           '',
    40 {aia_none}           '',
    42 {aia_Left}           'left',
    41 {aia_Left}           'left',
    43 {aia_Right}          'right',
    42 {aia_Right}          'right',
    44 {aia_Timer}          'timer',
    43 {aia_Timer}          'timer',
    45 {aia_slot}           'slot',
       
    46 {aia_attack}         'attack',
    44 {aia_attack}         'attack',
    47 {aia_Up}             'up',
    45 {aia_Up}             'up',
    48 {aia_Down}           'down'
    46 {aia_Down}           'down'
    49                      );
    47                      );
    50 
    48 
    63 
    61 
    64 procedure SetWeapon(weap: Longword);
    62 procedure SetWeapon(weap: Longword);
    65 begin
    63 begin
    66 with CurrentTeam^ do
    64 with CurrentTeam^ do
    67      with Hedgehogs[CurrHedgehog] do
    65      with Hedgehogs[CurrHedgehog] do
    68           while Ammo[CurSlot, CurAmmo].AmmoType <> TAmmotype(weap) do
    66           while Ammo[CurSlot, CurAmmo].AmmoType <> TAmmoType(weap) do
    69                 ParseCommand('/slot ' + chr(49 + Ammoz[TAmmoType(weap)].Slot));
    67                 ParseCommand('/slot ' + chr(49 + Ammoz[TAmmoType(weap)].Slot));
    70 end;
    68 end;
    71 
    69 
    72 procedure ProcessAction(var Actions: TActions; Me: PGear);
    70 procedure ProcessAction(var Actions: TActions; Me: PGear);
    73 var s: shortstring;
    71 var s: shortstring;