hedgewars/GSHandlers.inc
changeset 2965 2a8c76b23e2c
parent 2963 0f0789204802
child 2974 f3fa665f0874
equal deleted inserted replaced
2964:312e74a21603 2965:2a8c76b23e2c
  1268         inc(Gear^.Damage, hwRound(Gear^.dX * _40))
  1268         inc(Gear^.Damage, hwRound(Gear^.dX * _40))
  1269     else if Gear^.dY.isNegative and (Gear^.dY < -_0_03) and TestCollisionYwithGear(Gear, -1) then
  1269     else if Gear^.dY.isNegative and (Gear^.dY < -_0_03) and TestCollisionYwithGear(Gear, -1) then
  1270         inc(Gear^.Damage, hwRound(Gear^.dY * -_40))
  1270         inc(Gear^.Damage, hwRound(Gear^.dY * -_40))
  1271     else if Gear^.dX.isNegative and (Gear^.dX < -_0_03) and TestCollisionXwithGear(Gear, -1) then
  1271     else if Gear^.dX.isNegative and (Gear^.dX < -_0_03) and TestCollisionXwithGear(Gear, -1) then
  1272         inc(Gear^.Damage, hwRound(Gear^.dX * -_40));
  1272         inc(Gear^.Damage, hwRound(Gear^.dX * -_40));
  1273     if Gear^.Damage <> 0 then PlaySound(sndGraveImpact);
  1273     if Gear^.Damage <> 0 then PlaySound(sndGrenadeImpact);
  1274     doStepFallingGear(Gear);
  1274     doStepFallingGear(Gear);
  1275     CalcRotationDirAngle(Gear);
  1275     CalcRotationDirAngle(Gear);
  1276     CheckGearDrowning(Gear)
  1276     CheckGearDrowning(Gear)
  1277     end
  1277     end
  1278 else 
  1278 else 
  1330     end;
  1330     end;
  1331 
  1331 
  1332 if k = gtExplosives then
  1332 if k = gtExplosives then
  1333     begin
  1333     begin
  1334     //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation;
  1334     //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation;
  1335     if hwAbs(Gear^.dX) > _0_15 then Gear^.doStep:= @doStepRollingBarrel;
  1335     if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02)) then Gear^.doStep:= @doStepRollingBarrel;
  1336     
  1336     
  1337     if ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1337     if ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  1338         if (cBarrelHealth div Gear^.Health) > 2 then 
  1338         if (cBarrelHealth div Gear^.Health) > 2 then 
  1339             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1339             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  1340         else
  1340         else
  1386         if Gear^.dY > _0_2 then
  1386         if Gear^.dY > _0_2 then
  1387             for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do 
  1387             for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do 
  1388                 AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
  1388                 AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
  1389         Gear^.dY:= - Gear^.dY * Gear^.Elasticity;
  1389         Gear^.dY:= - Gear^.dY * Gear^.Elasticity;
  1390         if Gear^.dY > - _0_001 then Gear^.dY:= _0
  1390         if Gear^.dY > - _0_001 then Gear^.dY:= _0
  1391             else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact)
  1391             else if Gear^.dY < - _0_03 then
       
  1392                 if Gear^.Kind = gtExplosives then
       
  1393                     PlaySound(sndGrenadeImpact)
       
  1394                 else
       
  1395                     PlaySound(sndGraveImpact);
  1392         end;
  1396         end;
  1393     //if Gear^.dY > - _0_001 then Gear^.dY:= _0
  1397     //if Gear^.dY > - _0_001 then Gear^.dY:= _0
  1394     CheckGearDrowning(Gear);
  1398     CheckGearDrowning(Gear);
  1395     end;
  1399     end;
  1396 
  1400