hedgewars/uGears.pas
changeset 815 82ff416301bd
parent 814 7fb4417b7bc1
child 821 e6c0408b54ed
equal deleted inserted replaced
814:7fb4417b7bc1 815:82ff416301bd
   375    AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
   375    AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
   376 end;
   376 end;
   377 
   377 
   378 procedure ProcessGears;
   378 procedure ProcessGears;
   379 const delay: LongWord = 0;
   379 const delay: LongWord = 0;
   380       step: (stDelay, stChDmg, stChWin, stTurnReact, stSpawn, stNTurn) = stDelay;
   380       step: (stDelay, stChDmg, stChWin, stTurnReact,
       
   381              stAfterDelay, stSpawn, stNTurn) = stDelay;
   381 var Gear, t: PGear;
   382 var Gear, t: PGear;
   382 begin
   383 begin
   383 AllInactive:= true;
   384 AllInactive:= true;
   384 t:= GearsList;
   385 t:= GearsList;
   385 while t<>nil do
   386 while t<>nil do
   401                     inc(step)
   402                     inc(step)
   402                  end;
   403                  end;
   403         stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
   404         stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
   404         stChWin: if not CheckForWin then inc(step) else step:= stDelay;
   405         stChWin: if not CheckForWin then inc(step) else step:= stDelay;
   405     stTurnReact: begin
   406     stTurnReact: begin
   406                  TurnReaction;
   407                  if not isInMultiShoot then uStats.TurnReaction;
   407                  inc(step)
   408                  inc(step)
       
   409                  end;
       
   410    stAfterDelay: begin
       
   411                  if delay = 0 then
       
   412                     delay:= cInactDelay
       
   413                  else
       
   414                     dec(delay);
       
   415 
       
   416                  if delay = 0 then
       
   417                     inc(step)
   408                  end;
   418                  end;
   409         stSpawn: begin
   419         stSpawn: begin
   410                  if not isInMultiShoot then SpawnBoxOfSmth;
   420                  if not isInMultiShoot then SpawnBoxOfSmth;
   411                  inc(step)
   421                  inc(step)
   412                  end;
   422                  end;