hedgewars/uGears.pas
changeset 1895 7ba647a88b2f
parent 1892 fddc1201df25
child 1906 644f93d8f148
equal deleted inserted replaced
1894:ba54441631da 1895:7ba647a88b2f
   603 //Purpose, to reset all transient attributes toggled by a utility.
   603 //Purpose, to reset all transient attributes toggled by a utility.
   604 //If any of these are set as permanent toggles in the frontend, that needs to be checked and skipped here.
   604 //If any of these are set as permanent toggles in the frontend, that needs to be checked and skipped here.
   605 procedure ResetUtilities;
   605 procedure ResetUtilities;
   606 var  i: LongInt;
   606 var  i: LongInt;
   607 begin
   607 begin
   608     cGravity:= cMaxWindSpeed;
   608     if (GameFlags and gfLowGravity) = 0 then
       
   609         cGravity:= cMaxWindSpeed;
       
   610 
   609     cDamageModifier:= _1;
   611     cDamageModifier:= _1;
   610     cLaserSighting:= false;
   612 
       
   613     if (GameFlags and gfLaserSight) = 0 then
       
   614         cLaserSighting:= false;
   611     // have to sweep *all* current team hedgehogs since it is theoretically possible if you have enough invulnerabilities and switch turns to make your entire team invulnerable
   615     // have to sweep *all* current team hedgehogs since it is theoretically possible if you have enough invulnerabilities and switch turns to make your entire team invulnerable
   612 
   616 
   613     if (CurrentTeam <> nil) then
   617    if (GameFlags and gfInvulnerable) = 0 then
   614        with CurrentTeam^ do
   618        if (CurrentTeam <> nil) then
   615           for i:= 0 to cMaxHHIndex do
   619           with CurrentTeam^ do
   616               with Hedgehogs[i] do
   620              for i:= 0 to cMaxHHIndex do
   617                   if (Gear <> nil) then
   621                  with Hedgehogs[i] do
   618                       Gear^.Invulnerable:= false;
   622                      if (Gear <> nil) then
       
   623                          Gear^.Invulnerable:= false;
   619 end;
   624 end;
   620 
   625 
   621 procedure SetAllToActive;
   626 procedure SetAllToActive;
   622 var t: PGear;
   627 var t: PGear;
   623 begin
   628 begin
  1288 var i: LongInt;
  1293 var i: LongInt;
  1289 	Gear: PGear;
  1294 	Gear: PGear;
  1290 begin
  1295 begin
  1291 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
  1296 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
  1292 
  1297 
  1293 if (GameFlags and gfForts) = 0 then
  1298 if ((GameFlags and gfForts) = 0) and ((GameFlags and gfMines) <> 0) then
  1294 	for i:= 0 to Pred(cLandAdditions) do
  1299 	for i:= 0 to Pred(cLandAdditions) do
  1295 		begin
  1300 		begin
  1296 		Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0);
  1301 		Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0);
  1297 		FindPlace(Gear, false, 0, LAND_WIDTH)
  1302 		FindPlace(Gear, false, 0, LAND_WIDTH)
  1298 		end
  1303 		end;
       
  1304 
       
  1305 if (GameFlags and gfLowGravity) <> 0 then
       
  1306     cGravity:= cMaxWindSpeed / 2;
       
  1307 
       
  1308 Gear:= GearsList;
       
  1309 if (GameFlags and gfInvulnerable) <> 0 then
       
  1310    while Gear <> nil do
       
  1311        begin
       
  1312        Gear^.Invulnerable:= true;  // this is only checked on hogs right now, so no need for gear type check
       
  1313        Gear:= Gear^.NextGear
       
  1314        end;
       
  1315 
       
  1316 if (GameFlags and gfLaserSight) <> 0 then
       
  1317     cLaserSighting:= true
  1299 end;
  1318 end;
  1300 
  1319 
  1301 procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord);
  1320 procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord);
  1302 var Gear: PGear;
  1321 var Gear: PGear;
  1303     dmg, dmgRadius: LongInt;
  1322     dmg, dmgRadius: LongInt;