# HG changeset patch # User Wuzzy # Date 1547436631 -3600 # Node ID 6e5cda26f6769be3f30952d242e6af173cd9a180 # Parent 9be988a01565ceabbc14cfdab1779d59e70a1548 Tweak bounce effects of some gears This adds bounce effects for gtSMine, gtMine and gtCluster diff -r 9be988a01565 -r 6e5cda26f676 hedgewars/uGearsHandlersMess.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; diff -r 9be988a01565 -r 6e5cda26f676 hedgewars/uGearsUtils.pas --- 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