hedgewars/GSHandlers.inc
changeset 5128 3c65326bb713
parent 5121 2d34ec60992c
child 5137 b6140f35735f
equal deleted inserted replaced
5127:b0b6f17a6a3c 5128:3c65326bb713
  1928 
  1928 
  1929     if not Gear^.dY.isNegative and (Gear^.dY < _0_001) and TestCollisionYwithGear(Gear, 1) then Gear
  1929     if not Gear^.dY.isNegative and (Gear^.dY < _0_001) and TestCollisionYwithGear(Gear, 1) then Gear
  1930         ^.dY := _0;
  1930         ^.dY := _0;
  1931     if hwAbs(Gear^.dX) < _0_001 then Gear^.dX := _0;
  1931     if hwAbs(Gear^.dX) < _0_001 then Gear^.dX := _0;
  1932 
  1932 
  1933     if ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1933     if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1934         if (cBarrelHealth div Gear^.Health) > 2 then
  1934         if (cBarrelHealth div Gear^.Health) > 2 then
  1935             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1935             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1936     else
  1936     else
  1937         AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  1937         AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  1938     dec(Gear^.Health, Gear^.Damage);
  1938     dec(Gear^.Health, Gear^.Damage);
  1968     begin
  1968     begin
  1969         //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation;
  1969         //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation;
  1970         if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02))
  1970         if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02))
  1971             then Gear^.doStep := @doStepRollingBarrel;
  1971             then Gear^.doStep := @doStepRollingBarrel;
  1972 
  1972 
  1973         if ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1973         if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1974             if (cBarrelHealth div Gear^.Health) > 2 then
  1974             if (cBarrelHealth div Gear^.Health) > 2 then
  1975                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1975                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1976         else
  1976         else
  1977             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  1977             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  1978         dec(Gear^.Health, Gear^.Damage);
  1978         dec(Gear^.Health, Gear^.Damage);