hedgewars/uGears.pas
changeset 13735 8092b54ba19d
parent 13651 56a925256039
child 13746 1a26c472f5ef
equal deleted inserted replaced
13734:c6154fcb9420 13735:8092b54ba19d
    60 
    60 
    61 var skipFlag: boolean;
    61 var skipFlag: boolean;
    62 
    62 
    63 var delay: LongWord;
    63 var delay: LongWord;
    64     delay2: LongWord;
    64     delay2: LongWord;
    65     step: (stInit, stDelay, stChDmg, stSweep, stTurnReact,
    65     step: (stInit, stDelay, stChDmg, stSweep, stChWin1, stTurnReact,
    66     stAfterDelay, stChWin, stWater, stChWin2, stHealth,
    66     stAfterDelay, stChWin2, stWater, stChWin3, stHealth,
    67     stSpawn, stNTurn);
    67     stSpawn, stNTurn);
    68     NewTurnTick: LongWord;
    68     NewTurnTick: LongWord;
    69     //SDMusic: shortstring;
    69     //SDMusic: shortstring;
    70 
    70 
    71 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
    71 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
   287         step:= stChDmg
   287         step:= stChDmg
   288         end
   288         end
   289     else
   289     else
   290         inc(step);
   290         inc(step);
   291 
   291 
       
   292     stChWin1:
       
   293         begin
       
   294         CheckForWin();
       
   295         inc(step)
       
   296         end;
       
   297 
   292     stTurnReact:
   298     stTurnReact:
   293         begin
   299         begin
   294         if (not bBetweenTurns) and (not isInMultiShoot) then
   300         if (not bBetweenTurns) and (not isInMultiShoot) then
   295             begin
   301             begin
   296             uStats.TurnReaction;
   302             uStats.TurnReaction;
   308             dec(delay);
   314             dec(delay);
   309 
   315 
   310         if delay = 0 then
   316         if delay = 0 then
   311             inc(step)
   317             inc(step)
   312             end;
   318             end;
   313     stChWin:
   319     stChWin2:
   314         begin
   320         begin
   315         CheckForWin();
   321         CheckForWin();
   316         inc(step)
   322         inc(step)
   317         end;
   323         end;
   318     stWater:
   324     stWater:
   325             AddGear(0, 0, gtWaterUp, 0, _0, _0, 0)^.Tag:= cWaterRise;
   331             AddGear(0, 0, gtWaterUp, 0, _0, _0, 0)^.Tag:= cWaterRise;
   326         inc(step)
   332         inc(step)
   327         end
   333         end
   328     else // since we are not raising the water, a second win-check isn't needed
   334     else // since we are not raising the water, a second win-check isn't needed
   329         inc(step,2);
   335         inc(step,2);
   330     stChWin2:
   336     stChWin3:
   331         begin
   337         begin
   332         CheckForWin;
   338         CheckForWin;
   333         inc(step)
   339         inc(step)
   334         end;
   340         end;
   335 
   341