hedgewars/GSHandlers.inc
changeset 303 1659c4aad5ab
parent 302 7aca131ecd7f
child 304 8096e69e839e
--- a/hedgewars/GSHandlers.inc	Sun Dec 17 17:55:41 2006 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Dec 17 18:40:04 2006 +0000
@@ -425,21 +425,26 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-procedure doStepBlowTorch(Gear: PGear);
+procedure doStepBlowTorchWork(Gear: PGear);
 var HHGear: PGear;
 begin
 AllInactive:= false;
 dec(Gear.Timer);
 HHGear:= PHedgehog(Gear.Hedgehog).Gear;
+
+HedgehogChAngle(HHGear);
+
 if Gear.Timer mod cHHStepTicks = 0 then
    begin
-   DrawTunnel(HHGear.X, HHGear.Y - 1, Gear.dX, 0, cHHRadius * 2, cHHRadius * 2);
-   HHGear.State:= HHGear.State and not gstAttacking;
-   if Gear.dX < 0 then HHGear.Message:= gm_Left
-                  else HHGear.Message:= gm_Right;
+   DrawTunnel(HHGear.X, HHGear.Y - 3,
+              Gear.dX, Cos(HHGear.Angle*pi/cMaxAngle) * (-0.5),
+              cHHRadius * 3, cHHRadius * 2 + 4);
+   if Gear.dX < 0 then HHGear.Message:= (HHGear.Message or gm_Left) and not gm_Right
+                  else HHGear.Message:= (HHGear.Message or gm_Right) and not gm_Left;
    HedgehogStep(HHGear);
    if (HHGear.State and gstFalling) <> 0 then Gear.Timer:= 0
    end;
+   
 if Gear.Timer = 0 then
    begin
    HHGear.Message:= 0;
@@ -448,6 +453,14 @@
    end
 end;
 
+procedure doStepBlowTorch(Gear: PGear);
+var HHGear: PGear;
+begin
+HHGear:= PHedgehog(Gear.Hedgehog).Gear;
+HHGear.State:= HHGear.State and not gstAttacking;
+Gear.doStep:= doStepBlowTorchWork
+end;
+
 ////////////////////////////////////////////////////////////////////////////////
 
 procedure doStepRopeWork(Gear: PGear);