hedgewars/GSHandlers.inc
changeset 303 1659c4aad5ab
parent 302 7aca131ecd7f
child 304 8096e69e839e
equal deleted inserted replaced
302:7aca131ecd7f 303:1659c4aad5ab
   423 Gear.doStep:= doStepPickHammerWork
   423 Gear.doStep:= doStepPickHammerWork
   424 end;
   424 end;
   425 
   425 
   426 ////////////////////////////////////////////////////////////////////////////////
   426 ////////////////////////////////////////////////////////////////////////////////
   427 
   427 
       
   428 procedure doStepBlowTorchWork(Gear: PGear);
       
   429 var HHGear: PGear;
       
   430 begin
       
   431 AllInactive:= false;
       
   432 dec(Gear.Timer);
       
   433 HHGear:= PHedgehog(Gear.Hedgehog).Gear;
       
   434 
       
   435 HedgehogChAngle(HHGear);
       
   436 
       
   437 if Gear.Timer mod cHHStepTicks = 0 then
       
   438    begin
       
   439    DrawTunnel(HHGear.X, HHGear.Y - 3,
       
   440               Gear.dX, Cos(HHGear.Angle*pi/cMaxAngle) * (-0.5),
       
   441               cHHRadius * 3, cHHRadius * 2 + 4);
       
   442    if Gear.dX < 0 then HHGear.Message:= (HHGear.Message or gm_Left) and not gm_Right
       
   443                   else HHGear.Message:= (HHGear.Message or gm_Right) and not gm_Left;
       
   444    HedgehogStep(HHGear);
       
   445    if (HHGear.State and gstFalling) <> 0 then Gear.Timer:= 0
       
   446    end;
       
   447    
       
   448 if Gear.Timer = 0 then
       
   449    begin
       
   450    HHGear.Message:= 0;
       
   451    DeleteGear(Gear);
       
   452    AfterAttack
       
   453    end
       
   454 end;
       
   455 
   428 procedure doStepBlowTorch(Gear: PGear);
   456 procedure doStepBlowTorch(Gear: PGear);
   429 var HHGear: PGear;
   457 var HHGear: PGear;
   430 begin
   458 begin
   431 AllInactive:= false;
       
   432 dec(Gear.Timer);
       
   433 HHGear:= PHedgehog(Gear.Hedgehog).Gear;
   459 HHGear:= PHedgehog(Gear.Hedgehog).Gear;
   434 if Gear.Timer mod cHHStepTicks = 0 then
   460 HHGear.State:= HHGear.State and not gstAttacking;
   435    begin
   461 Gear.doStep:= doStepBlowTorchWork
   436    DrawTunnel(HHGear.X, HHGear.Y - 1, Gear.dX, 0, cHHRadius * 2, cHHRadius * 2);
       
   437    HHGear.State:= HHGear.State and not gstAttacking;
       
   438    if Gear.dX < 0 then HHGear.Message:= gm_Left
       
   439                   else HHGear.Message:= gm_Right;
       
   440    HedgehogStep(HHGear);
       
   441    if (HHGear.State and gstFalling) <> 0 then Gear.Timer:= 0
       
   442    end;
       
   443 if Gear.Timer = 0 then
       
   444    begin
       
   445    HHGear.Message:= 0;
       
   446    DeleteGear(Gear);
       
   447    AfterAttack
       
   448    end
       
   449 end;
   462 end;
   450 
   463 
   451 ////////////////////////////////////////////////////////////////////////////////
   464 ////////////////////////////////////////////////////////////////////////////////
   452 
   465 
   453 procedure doStepRopeWork(Gear: PGear);
   466 procedure doStepRopeWork(Gear: PGear);