hedgewars/GSHandlers.inc
changeset 914 c2fcafbfc4aa
parent 913 a86f8af21b94
child 915 33040b7695c0
equal deleted inserted replaced
913:a86f8af21b94 914:c2fcafbfc4aa
   784 
   784 
   785 ////////////////////////////////////////////////////////////////////////////////
   785 ////////////////////////////////////////////////////////////////////////////////
   786 procedure doStepMine(Gear: PGear);
   786 procedure doStepMine(Gear: PGear);
   787 begin
   787 begin
   788 if (Gear^.State and gstMoving) <> 0 then
   788 if (Gear^.State and gstMoving) <> 0 then
   789    begin
   789 	begin
   790    DeleteCI(Gear);
   790 	DeleteCI(Gear);
   791    doStepFallingGear(Gear);
   791 	doStepFallingGear(Gear);
   792    if (Gear^.State and gstMoving) = 0 then
   792 	if (Gear^.State and gstMoving) = 0 then
   793       begin
   793 		begin
   794       AddGearCI(Gear);
   794 		AddGearCI(Gear);
   795       Gear^.dX:= _0;
   795 		Gear^.dX:= _0;
   796       Gear^.dY:= _0
   796 		Gear^.dY:= _0
   797       end;
   797 		end;
   798    CalcRotationDirAngle(Gear);
   798 	CalcRotationDirAngle(Gear);
   799    AllInactive:= false
   799 	AllInactive:= false
   800    end;
   800 	end else
       
   801 	if ((GameTicks and $3F) = 25) then
       
   802 		doStepFallingGear(Gear);
   801 
   803 
   802 if ((Gear^.State and gsttmpFlag) <> 0) then
   804 if ((Gear^.State and gsttmpFlag) <> 0) then
   803    if ((Gear^.State and gstAttacking) = 0) then
   805    if ((Gear^.State and gstAttacking) = 0) then
   804       begin
   806       begin
   805       if ((GameTicks and $F) = 0) then
   807       if ((GameTicks and $1F) = 0) then
   806          if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking
   808          if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking
   807       end else // gstAttacking <> 0
   809       end else // gstAttacking <> 0
   808       begin
   810       begin
   809       AllInactive:= false;
   811       AllInactive:= false;
   810       if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick, false);
   812       if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick, false);