hedgewars/uGears.pas
changeset 1797 fedd8649fdd9
parent 1795 2457fcc0dcd9
child 1849 2a989e5abda6
equal deleted inserted replaced
1796:4bcdf0bf58b8 1797:fedd8649fdd9
   463 	end;
   463 	end;
   464 end;
   464 end;
   465 
   465 
   466 procedure ProcessGears;
   466 procedure ProcessGears;
   467 const delay: LongWord = 0;
   467 const delay: LongWord = 0;
   468 	step: (stDelay, stChDmg, stTurnReact,
   468 	step: (stDelay, stChDmg, stSweep, stTurnReact,
   469 			stAfterDelay, stChWin, stWater, stChWin2, stHealth,
   469 			stAfterDelay, stChWin, stWater, stChWin2, stHealth,
   470 			stSpawn, stNTurn) = stDelay;
   470 			stSpawn, stNTurn) = stDelay;
   471 
   471 
   472 var Gear, t: PGear;
   472 var Gear, t: PGear;
   473 begin
   473 begin
   491 			dec(delay);
   491 			dec(delay);
   492 
   492 
   493 		if delay = 0 then
   493 		if delay = 0 then
   494 			inc(step)
   494 			inc(step)
   495 		end;
   495 		end;
   496 	stChDmg: begin
   496 	stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
   497 			if CheckNoDamage then inc(step) else step:= stDelay;
   497 	stSweep: if SweepDirty then
   498 			if SweepDirty then
       
   499 				begin
   498 				begin
   500 				SetAllToActive;
   499 				SetAllToActive;
   501 				step:= stChDmg
   500 				step:= stChDmg
   502 				end;
   501 				end else inc(step);
   503 			end;
       
   504 	stTurnReact: begin
   502 	stTurnReact: begin
   505 		if (not bBetweenTurns) and (not isInMultiShoot) then
   503 		if (not bBetweenTurns) and (not isInMultiShoot) then
   506 			begin
   504 			begin
   507 			uStats.TurnReaction;
   505 			uStats.TurnReaction;
   508 			inc(step)
   506 			inc(step)