Allow hammer to bash mines/barrels too, increase escape time to 3s
authornemo
Sun, 21 Aug 2011 11:37:39 -0400
changeset 5624 b6f70f6335ee
parent 5622 93e97d3a2c10
child 5626 82e1811c5e70
Allow hammer to bash mines/barrels too, increase escape time to 3s
hedgewars/GSHandlers.inc
hedgewars/uVariables.pas
--- a/hedgewars/GSHandlers.inc	Sun Aug 21 11:24:20 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Sun Aug 21 11:37:39 2011 -0400
@@ -4582,13 +4582,13 @@
     dec(i);
     tmp:= t^.ar[i];
     if (tmp^.State and gstNoDamage) = 0 then
-        if (tmp^.Kind = gtHedgehog) then
+        if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then
             begin
             //tmp^.State:= tmp^.State or gstFlatened;
             ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
             //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3);
             tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0);
-            tmp2^.Hedgehog:= tmp^.Hedgehog;
+            tmp2^.IntersectGear:= tmp;
             SetAllToActive
             end
         else
@@ -4604,12 +4604,12 @@
 procedure doStepHammerHitWork(Gear: PGear);
 var 
     i, ei: LongInt;
-    HHGear: PGear;
+    HitGear: PGear;
 begin
     AllInactive := false;
-    HHGear := Gear^.Hedgehog^.Gear;
+    HitGear := Gear^.IntersectGear;
     dec(Gear^.Timer);
-    if (HHGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then
+    if (HitGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then
     begin
         DeleteGear(Gear);
         exit
@@ -4638,8 +4638,8 @@
     if TestCollisionYwithGear(Gear, 1) then
     begin
         Gear^.dY := _0;
-        SetLittle(HHGear^.dX);
-        HHGear^.dY := _0;
+        SetLittle(HitGear^.dX);
+        HitGear^.dY := _0;
     end
     else
     begin
@@ -4648,9 +4648,9 @@
         if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1
     end;
 
-    Gear^.X := Gear^.X + HHGear^.dX;
-    HHGear^.X := Gear^.X;
-    HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius);
+    Gear^.X := Gear^.X + HitGear^.dX;
+    HitGear^.X := Gear^.X;
+    HitGear^.Y := Gear^.Y - int2hwFloat(cHHRadius);
 end;
 
 procedure doStepHammerHit(Gear: PGear);
--- a/hedgewars/uVariables.pas	Sun Aug 21 11:24:20 2011 -0400
+++ b/hedgewars/uVariables.pas	Sun Aug 21 11:37:39 2011 -0400
@@ -2001,7 +2001,7 @@
                 AttackVoice: sndNone;
                 Bounciness: 1000);
             Slot: 3;
-            TimeAfterTurn: 1000;
+            TimeAfterTurn: 3000;
             MinAngle: 0;
             maxAngle: 0;
             isDamaging: true;