hedgewars/uGears.pas
changeset 3908 1429c303858d
parent 3894 9abce5468583
child 3946 41e06b74c991
equal deleted inserted replaced
3907:5b516f0d9957 3908:1429c303858d
   668     begin
   668     begin
   669         if Gear^.Kind = gtHedgehog then
   669         if Gear^.Kind = gtHedgehog then
   670             begin
   670             begin
   671             tmp:= 0;
   671             tmp:= 0;
   672             if PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] then
   672             if PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] then
   673                 inc(tmp, ModifyDamage(cHealthDecrease, Gear));
   673                 inc(tmp, ModifyDamage(5, Gear));
   674             inc(tmp, cHealthDecrease);
   674             inc(tmp, cHealthDecrease);
   675             if PHedgehog(Gear^.Hedgehog)^.King then
   675             if PHedgehog(Gear^.Hedgehog)^.King then
   676                 begin
   676                 begin
   677                 flag:= false;
   677                 flag:= false;
   678                 team:= PHedgehog(Gear^.Hedgehog)^.Team;
   678                 team:= PHedgehog(Gear^.Hedgehog)^.Team;
   679                 for i:= 0 to Pred(team^.HedgehogsNumber) do
   679                 for i:= 0 to Pred(team^.HedgehogsNumber) do
   680                     if (team^.Hedgehogs[i].Gear <> nil) and
   680                     if (team^.Hedgehogs[i].Gear <> nil) and
   681                         (not team^.Hedgehogs[i].King) and
   681                         (not team^.Hedgehogs[i].King) and
   682                         (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage)
   682                         (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage)
   683                     then flag:= true;
   683                     then flag:= true;
   684                 if not flag then inc(tmp, cHealthDecrease)
   684                 if not flag then inc(tmp, 5)
   685                 end;
   685                 end;
   686             if tmp > 0 then 
   686             if tmp > 0 then 
   687                 begin
   687                 begin
   688                 inc(Gear^.Damage, min(tmp, max(0,Gear^.Health - 1 - Gear^.Damage)));
   688                 inc(Gear^.Damage, min(tmp, max(0,Gear^.Health - 1 - Gear^.Damage)));
   689                 HHHurt(Gear^.Hedgehog, dsPoison);
   689                 HHHurt(Gear^.Hedgehog, dsPoison);