hedgewars/uGears.pas
changeset 3949 4c4c0a2507cc
parent 3946 41e06b74c991
child 3951 c9a63db3e603
equal deleted inserted replaced
3948:24daa33a3114 3949:4c4c0a2507cc
   694     end;
   694     end;
   695 end;
   695 end;
   696 
   696 
   697 procedure ProcessGears;
   697 procedure ProcessGears;
   698 const delay: LongWord = 0;
   698 const delay: LongWord = 0;
       
   699       delay2: LongWord = 0;
   699     step: (stDelay, stChDmg, stSweep, stTurnReact,
   700     step: (stDelay, stChDmg, stSweep, stTurnReact,
   700             stAfterDelay, stChWin, stWater, stChWin2, stHealth,
   701             stAfterDelay, stChWin, stWater, stChWin2, stHealth,
   701             stSpawn, stNTurn) = stDelay;
   702             stSpawn, stNTurn) = stDelay;
   702 var Gear, t: PGear;
   703 var Gear, t: PGear;
   703     i: LongInt;
   704     i: LongInt;
   839                 AfterSwitchHedgehog;
   840                 AfterSwitchHedgehog;
   840                 bBetweenTurns:= false
   841                 bBetweenTurns:= false
   841                 end;
   842                 end;
   842             step:= Low(step)
   843             step:= Low(step)
   843             end;
   844             end;
       
   845     end
       
   846 else if ((GameFlags and gfInfAttack) <> 0) then
       
   847     begin
       
   848     if delay2 = 0 then
       
   849         delay2:= cInactDelay 
       
   850     else
       
   851         dec(delay2);
       
   852 
       
   853     if delay2 = 0 then
       
   854         begin
       
   855         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked;
       
   856         CheckNoDamage;
       
   857         CheckForWin
       
   858         end
   844     end;
   859     end;
   845 
   860 
   846 if TurnTimeLeft > 0 then
   861 if TurnTimeLeft > 0 then
   847         if CurrentHedgehog^.Gear <> nil then
   862         if CurrentHedgehog^.Gear <> nil then
   848             if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
   863             if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)