Tweak bounce effects of some gears
authorWuzzy <Wuzzy2@mail.ru>
Mon, 14 Jan 2019 04:30:31 +0100
changeset 14595 6e5cda26f676
parent 14594 9be988a01565
child 14596 28d00ceb8b54
Tweak bounce effects of some gears This adds bounce effects for gtSMine, gtMine and gtCluster
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHandlersMess.pas	Mon Jan 14 03:53:21 2019 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Jan 14 04:30:31 2019 +0100
@@ -540,7 +540,7 @@
     if ((xland or land) and lfBouncy <> 0) and (Gear^.dX.QWordValue < _0_15.QWordValue) and (Gear^.dY.QWordValue < _0_15.QWordValue) then
         Gear^.State := Gear^.State or gstCollision;
 
-    if ((xland or land) and lfBouncy <> 0) and (Gear^.Radius >= 3) and
+    if ((xland or land) and lfBouncy <> 0) and
        ((Gear^.dX.QWordValue > _0_15.QWordValue) or (Gear^.dY.QWordValue > _0_15.QWordValue)) then
         begin
         AddBounceEffectForGear(Gear);
@@ -3714,7 +3714,7 @@
         Gear^.Angle := (LongInt(Gear^.Angle) + 2) and 3;
 
         // Bounce effect
-        if (Gear^.Karma = 2) and (Gear^.Radius > 2) then
+        if (Gear^.Karma = 2) then
             AddBounceEffectForGear(Gear, 0.55);
 
         Gear^.Tag:= 0;
--- a/hedgewars/uGearsUtils.pas	Mon Jan 14 03:53:21 2019 +0100
+++ b/hedgewars/uGearsUtils.pas	Mon Jan 14 04:30:31 2019 +0100
@@ -1765,7 +1765,7 @@
         if (bounced) then
             begin
             WorldWrap:= true;
-            if (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then
+            if (Gear^.dX.QWordValue > _0_001.QWordValue) then
                AddBounceEffectForGear(Gear);
             end;
         end
@@ -1827,7 +1827,7 @@
 procedure AddBounceEffectForGear(Gear: PGear; imageScale: Single);
 var boing: PVisualGear;
 begin
-    if Gear^.Density < _0_01 then
+    if (Gear^.Density < _0_01) or (Gear^.Radius < 2) then
         exit;
     boing:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot, 0, false, 1);
     if boing <> nil then