hedgewars/uGearsUtils.pas
changeset 11556 aefc770feb65
parent 11555 881231c1ba46
child 11756 20e0a72e0e2c
equal deleted inserted replaced
11555:881231c1ba46 11556:aefc770feb65
  1168     Ammo^.Health:= 0;
  1168     Ammo^.Health:= 0;
  1169 while i > 0 do
  1169 while i > 0 do
  1170     begin
  1170     begin
  1171     dec(i);
  1171     dec(i);
  1172     Gear:= t^.ar[i];
  1172     Gear:= t^.ar[i];
  1173     if (Ammo^.Data <> nil) and (Ammo^.Kind in [gtShotgunShot, gtDEagleShot, gtSniperRifleShot, gtSineGunShot]) and (PGear(Ammo^.Data) = Gear) then
  1173     if (Ammo^.Data <> nil) and (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot]) and (PGear(Ammo^.Data) = Gear) then
  1174         continue;
  1174         continue;
  1175     if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and
  1175     if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and
  1176        (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then
  1176        (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then
  1177         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1177         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1178     tmpDmg:= ModifyDamage(Damage, Gear);
  1178     tmpDmg:= ModifyDamage(Damage, Gear);
  1511 if WorldEdge = weNone then exit(false);
  1511 if WorldEdge = weNone then exit(false);
  1512 if (hwRound(Gear^.X) < LongInt(leftX)) or
  1512 if (hwRound(Gear^.X) < LongInt(leftX)) or
  1513    (hwRound(Gear^.X) > LongInt(rightX)) then
  1513    (hwRound(Gear^.X) > LongInt(rightX)) then
  1514     begin
  1514     begin
  1515     // bullets can now hurt the hog that fired them
  1515     // bullets can now hurt the hog that fired them
  1516     if (WorldEdge <> weSea) and (Gear^.Kind in [gtShotgunShot, gtDEagleShot, gtSniperRifleShot, gtSineGunShot]) then
  1516     if (WorldEdge <> weSea) and (Gear^.Kind in [gtDEagleShot, gtSniperRifleShot]) then
  1517         Gear^.Data:= nil;
  1517         Gear^.Data:= nil;
  1518     if WorldEdge = weWrap then
  1518     if WorldEdge = weWrap then
  1519         begin
  1519         begin
  1520         if (hwRound(Gear^.X) < LongInt(leftX)) then
  1520         if (hwRound(Gear^.X) < LongInt(leftX)) then
  1521              Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX)
  1521              Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX)