Increase minimum threshold for barrel damage to reduce likelihood of blowing one up on jumping out, increase damage to compensate (may need tweaking). Only apply dX for collision w/ kick if barrel is rolling.
authornemo
Mon, 17 May 2010 15:42:48 +0000
changeset 3473 f80431269806
parent 3472 b1832a3761e6
child 3474 c6d308f5a431
Increase minimum threshold for barrel damage to reduce likelihood of blowing one up on jumping out, increase damage to compensate (may need tweaking). Only apply dX for collision w/ kick if barrel is rolling.
hedgewars/GSHandlers.inc
hedgewars/uCollisions.pas
--- a/hedgewars/GSHandlers.inc	Mon May 17 09:45:46 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Mon May 17 15:42:48 2010 +0000
@@ -1405,10 +1405,10 @@
     begin
         DeleteCI(Gear);
         AllInactive := false;
-        if not Gear^.dY.isNegative and (Gear^.dY > _0_03) and TestCollisionYwithGear(Gear, 1) then
+        if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and TestCollisionYwithGear(Gear, 1) then
         begin
             Gear^.State := Gear^.State or gsttmpFlag;
-            inc(Gear^.Damage, hwRound(Gear^.dY * _50));
+            inc(Gear^.Damage, hwRound(Gear^.dY * _70));
             for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do
             begin
                 particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12,
@@ -1416,15 +1416,15 @@
                 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5)
             end
         end
-        else if not Gear^.dX.isNegative and (Gear^.dX > _0_03) and TestCollisionXwithGear(Gear, 1)
+        else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1)
                  then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * _50))
-        else if Gear^.dY.isNegative and (Gear^.dY < -_0_03) and TestCollisionYwithGear(Gear, -1)
+                 inc(Gear^.Damage, hwRound(Gear^.dX * _70))
+        else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and TestCollisionYwithGear(Gear, -1)
                  then
-                 inc(Gear^.Damage, hwRound(Gear^.dY * -_50))
-        else if Gear^.dX.isNegative and (Gear^.dX < -_0_03) and TestCollisionXwithGear(Gear, -1)
+                 inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
+        else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1)
                  then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * -_50));
+                 inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
 
         doStepFallingGear(Gear);
         CalcRotationDirAngle(Gear);
@@ -1542,8 +1542,8 @@
         if (Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, -1) then Gear^.dY := _0;
         if (not Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, 1) then
         begin
-            if (Gear^.dY > _0_02) and (k = gtExplosives) then
-                inc(Gear^.Damage, hwRound(Gear^.dY * _40));
+            if (Gear^.dY > _0_2) and (k = gtExplosives) then
+                inc(Gear^.Damage, hwRound(Gear^.dY * _70));
 
             if Gear^.dY > _0_2 then
                 for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do
--- a/hedgewars/uCollisions.pas	Mon May 17 09:45:46 2010 +0000
+++ b/hedgewars/uCollisions.pas	Mon May 17 15:42:48 2010 +0000
@@ -214,7 +214,7 @@
              begin
              with cGear^ do
                   begin
-                  dX:= Gear^.dX;
+                  if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then dX:= Gear^.dX;
                   dY:= Gear^.dY * _0_5;
                   State:= State or gstMoving;
                   Active:= true
@@ -266,7 +266,7 @@
              begin
              with cGear^ do
                   begin
-                  dX:= Gear^.dX * _0_5;
+                  if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then dX:= Gear^.dX * _0_5;
                   dY:= Gear^.dY;
                   State:= State or gstMoving;
                   Active:= true