hedgewars/uGears.pas
changeset 9685 7d925e82e572
parent 9672 8663d299ba62
child 9764 8dc9d268330f
equal deleted inserted replaced
9683:a342837fc875 9685:7d925e82e572
    76     if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue)
    76     if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue)
    77     and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then
    77     and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then
    78         begin
    78         begin
    79         if (not isInMultiShoot) then
    79         if (not isInMultiShoot) then
    80             inc(Gear^.Damage, Gear^.Karma);
    80             inc(Gear^.Damage, Gear^.Karma);
    81         if (Gear^.Damage <> 0) and (not Gear^.Invulnerable) then
    81         if (Gear^.Damage <> 0) and ((Gear^.Hedgehog^.Effects[heInvulnerable] = 0)) then
    82             begin
    82             begin
    83             CheckNoDamage:= false;
    83             CheckNoDamage:= false;
    84 
    84 
    85             dmg:= Gear^.Damage;
    85             dmg:= Gear^.Damage;
    86             if Gear^.Health < dmg then
    86             if Gear^.Health < dmg then
   508 *)
   508 *)
   509 
   509 
   510                     if (Gear <> nil) then
   510                     if (Gear <> nil) then
   511                         begin
   511                         begin
   512                         if (GameFlags and gfInvulnerable) = 0 then
   512                         if (GameFlags and gfInvulnerable) = 0 then
   513                             Gear^.Invulnerable:= false;
   513                             Gear^.Hedgehog^.Effects[heInvulnerable]:= 0;
   514                         end;
   514                         end;
   515                     end;
   515                     end;
   516     t:= GearsList;
   516     t:= GearsList;
   517     while t <> nil do
   517     while t <> nil do
   518         begin
   518         begin
   562         Dispose(t)
   562         Dispose(t)
   563     end;
   563     end;
   564 end;
   564 end;
   565 
   565 
   566 procedure AddMiscGears;
   566 procedure AddMiscGears;
   567 var i,rx, ry: Longword;
   567 var p,i,j,rx, ry: Longword;
   568     rdx, rdy: hwFloat;
   568     rdx, rdy: hwFloat;
   569     Gear: PGear;
   569     Gear: PGear;
   570 begin
   570 begin
   571 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
   571 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
   572 
   572 
   597 if (GameFlags and gfVampiric) <> 0 then
   597 if (GameFlags and gfVampiric) <> 0 then
   598     cVampiric:= true;
   598     cVampiric:= true;
   599 
   599 
   600 Gear:= GearsList;
   600 Gear:= GearsList;
   601 if (GameFlags and gfInvulnerable) <> 0 then
   601 if (GameFlags and gfInvulnerable) <> 0 then
   602     while Gear <> nil do
   602     for p:= 0 to Pred(ClansCount) do
   603         begin
   603         with ClansArray[p]^ do
   604         Gear^.Invulnerable:= true;  // this is only checked on hogs right now, so no need for gear type check
   604             for j:= 0 to Pred(TeamsNumber) do
   605         Gear:= Gear^.NextGear
   605                 with Teams[j]^ do
   606         end;
   606                     for i:= 0 to cMaxHHIndex do
       
   607                         with Hedgehogs[i] do
       
   608                             Effects[heInvulnerable]:= 1;
   607 
   609 
   608 if (GameFlags and gfLaserSight) <> 0 then
   610 if (GameFlags and gfLaserSight) <> 0 then
   609     cLaserSighting:= true;
   611     cLaserSighting:= true;
   610 
   612 
   611 if (GameFlags and gfArtillery) <> 0 then
   613 if (GameFlags and gfArtillery) <> 0 then