hedgewars/uGears.pas
changeset 1792 c30c6944bd49
parent 1784 dfe9bafb4590
child 1794 8ae48e3b02d9
equal deleted inserted replaced
1791:7c9d645d2591 1792:c30c6944bd49
   420 end;
   420 end;
   421 
   421 
   422 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
   422 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
   423 var Gear: PGear;
   423 var Gear: PGear;
   424 begin
   424 begin
   425 SweepDirty; // convenient place to clean up pixels after damage is run 
       
   426 CheckNoDamage:= true;
   425 CheckNoDamage:= true;
   427 Gear:= GearsList;
   426 Gear:= GearsList;
   428 while Gear <> nil do
   427 while Gear <> nil do
   429 	begin
   428 	begin
   430 	if Gear^.Kind = gtHedgehog then
   429 	if Gear^.Kind = gtHedgehog then
   492 			dec(delay);
   491 			dec(delay);
   493 
   492 
   494 		if delay = 0 then
   493 		if delay = 0 then
   495 			inc(step)
   494 			inc(step)
   496 		end;
   495 		end;
   497 	stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
   496 	stChDmg: begin
       
   497 			if CheckNoDamage then inc(step) else step:= stDelay;
       
   498 			if SweepDirty then
       
   499 				begin
       
   500 				SetAllToActive;
       
   501 				step:= stChDmg
       
   502 				end;
       
   503 			end;
   498 	stTurnReact: begin
   504 	stTurnReact: begin
   499 		if (not bBetweenTurns) and (not isInMultiShoot) then
   505 		if (not bBetweenTurns) and (not isInMultiShoot) then
   500 			begin
   506 			begin
   501 			uStats.TurnReaction;
   507 			uStats.TurnReaction;
   502 			inc(step)
   508 			inc(step)
  1365 					begin
  1371 					begin
  1366 					ar[Count]:= @Hedgehogs[i];
  1372 					ar[Count]:= @Hedgehogs[i];
  1367 					inc(Count)
  1373 					inc(Count)
  1368 					end;
  1374 					end;
  1369 		end;
  1375 		end;
  1370 
  1376     // unC0Rr, while it is true user can watch value on map screen, IMO this (and check above) should be enforced in UI
       
  1377     // - is there a good place to put values for the different widgets to check?  Right now they are kind of disconnected.
       
  1378     //it'd be nice if divide teams, forts mode and hh per map could all be checked by the team widget, or maybe disable start button
       
  1379 	TryDo(Count <= MaxHedgehogs, 'Too many hedgehogs for this map!', true);
  1371 	while (Count > 0) do
  1380 	while (Count > 0) do
  1372 		begin
  1381 		begin
  1373 		i:= GetRandom(Count);
  1382 		i:= GetRandom(Count);
  1374 		FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH);
  1383 		FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH);
  1375 		if ar[i]^.Gear <> nil then
  1384 		if ar[i]^.Gear <> nil then