1729 end; |
1729 end; |
1730 |
1730 |
1731 //////////////////////////////////////////////////////////////////////////////// |
1731 //////////////////////////////////////////////////////////////////////////////// |
1732 procedure doStepSMine(Gear: PGear); |
1732 procedure doStepSMine(Gear: PGear); |
1733 begin |
1733 begin |
1734 DeleteCI(Gear); |
|
1735 // TODO: do real calculation? |
1734 // TODO: do real calculation? |
1736 if TestCollisionXwithGear(Gear, 2) or TestCollisionYwithGear(Gear, -2) or TestCollisionXwithGear(Gear, -2) or TestCollisionYwithGear(Gear, 2) then |
1735 if TestCollisionXwithGear(Gear, 2) or TestCollisionYwithGear(Gear, -2) or TestCollisionXwithGear(Gear, -2) or TestCollisionYwithGear(Gear, 2) then |
1737 begin |
1736 begin |
1738 if (hwAbs(Gear^.dX) > _0) or (hwAbs(Gear^.dY) > _0) then |
1737 if (hwAbs(Gear^.dX) > _0) or (hwAbs(Gear^.dY) > _0) then |
|
1738 begin |
1739 PlaySound(sndRopeAttach); |
1739 PlaySound(sndRopeAttach); |
1740 Gear^.dX:= _0; |
1740 Gear^.dX:= _0; |
1741 Gear^.dY:= _0; |
1741 Gear^.dY:= _0; |
|
1742 AddGearCI(Gear); |
|
1743 end; |
1742 end |
1744 end |
1743 else |
1745 else |
1744 begin |
1746 begin |
|
1747 DeleteCI(Gear); |
1745 doStepFallingGear(Gear); |
1748 doStepFallingGear(Gear); |
1746 AllInactive := false; |
1749 AllInactive := false; |
1747 CalcRotationDirAngle(Gear); |
1750 CalcRotationDirAngle(Gear); |
1748 end; |
1751 end; |
1749 AddGearCI(Gear); |
|
1750 |
1752 |
1751 if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then |
1753 if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then |
|
1754 begin |
1752 if ((Gear^.State and gstAttacking) = 0) then |
1755 if ((Gear^.State and gstAttacking) = 0) then |
1753 begin |
1756 begin |
1754 if ((GameTicks and $1F) = 0) then |
1757 if ((GameTicks and $1F) = 0) then |
1755 if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State := Gear^.State or |
1758 if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State := Gear^.State or |
1756 gstAttacking |
1759 gstAttacking |
1757 end |
1760 end |
1758 else // gstAttacking <> 0 |
1761 else // gstAttacking <> 0 |
1759 begin |
1762 begin |
1760 AllInactive := false; |
1763 AllInactive := false; |
1761 if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); |
1764 if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); |
1762 if Gear^.Timer = 0 then |
1765 if Gear^.Timer = 0 then |
1763 begin |
1766 begin |
1764 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
1767 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
1765 DeleteGear(Gear); |
1768 DeleteGear(Gear); |
1766 exit |
1769 exit |
1767 end; |
1770 end; |
1768 dec(Gear^.Timer); |
1771 dec(Gear^.Timer); |
|
1772 end |
1769 end |
1773 end |
1770 else // gsttmpFlag = 0 |
1774 else // gsttmpFlag = 0 |
1771 if TurnTimeLeft = 0 then Gear^.State := Gear^.State or gsttmpFlag; |
1775 if TurnTimeLeft = 0 then Gear^.State := Gear^.State or gsttmpFlag; |
1772 end; |
1776 end; |
1773 |
1777 |