245 tdX := Gear^.dX; |
245 tdX := Gear^.dX; |
246 tdY := Gear^.dY; |
246 tdY := Gear^.dY; |
247 |
247 |
248 |
248 |
249 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
249 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
250 if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then |
250 if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then Gear^.State := Gear^.State or gstCollision; |
251 begin |
|
252 Gear^.State := Gear^.State or gstCollision; |
|
253 exit |
|
254 end; |
|
255 |
251 |
256 if Gear^.dY.isNegative then |
252 if Gear^.dY.isNegative then |
257 begin |
253 begin |
258 isFalling := true; |
254 isFalling := true; |
259 if TestCollisionYwithGear(Gear, -1) then |
255 if TestCollisionYwithGear(Gear, -1) then |
1719 |
1715 |
1720 //////////////////////////////////////////////////////////////////////////////// |
1716 //////////////////////////////////////////////////////////////////////////////// |
1721 procedure doStepFlame(Gear: PGear); |
1717 procedure doStepFlame(Gear: PGear); |
1722 var |
1718 var |
1723 gX,gY,i: LongInt; |
1719 gX,gY,i: LongInt; |
1724 begin |
1720 sticky: Boolean; |
1725 if (Gear^.State and gsttmpFlag) = 0 then AllInactive := false; |
1721 begin |
|
1722 sticky:= (Gear^.State and gsttmpFlag) <> 0; |
|
1723 if not sticky then AllInactive := false; |
1726 |
1724 |
1727 if not TestCollisionYwithGear(Gear, 1) then |
1725 if not TestCollisionYwithGear(Gear, 1) then |
1728 begin |
1726 begin |
1729 AllInactive := false; |
1727 AllInactive := false; |
1730 if Gear^.dX.QWordValue > _0_01.QWordValue then |
1728 if Gear^.dX.QWordValue > _0_01.QWordValue then |
1731 Gear^.dX := Gear^.dX * _0_995; |
1729 Gear^.dX := Gear^.dX * _0_995; |
1732 Gear^.dY := Gear^.dY + cGravity; |
1730 Gear^.dY := Gear^.dY + cGravity; |
1733 {if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY := Gear^.dY + cGravity;} |
1731 // if sticky then Gear^.dY := Gear^.dY + cGravity; |
1734 if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; |
1732 if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; |
1735 |
1733 |
1736 {if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X := Gear^.X + Gear^.dX |
1734 //if sticky then Gear^.X := Gear^.X + Gear^.dX else |
1737 else} |
1735 Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640; |
1738 Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640; |
|
1739 Gear^.Y := Gear^.Y + Gear^.dY; |
1736 Gear^.Y := Gear^.Y + Gear^.dY; |
1740 |
1737 |
1741 if (hwRound(Gear^.Y) > cWaterLine) then |
1738 if (hwRound(Gear^.Y) > cWaterLine) then |
1742 begin |
1739 begin |
1743 gX := hwRound(Gear^.X); |
1740 gX := hwRound(Gear^.X); |
1764 else |
1761 else |
1765 begin |
1762 begin |
1766 gX := hwRound(Gear^.X); |
1763 gX := hwRound(Gear^.X); |
1767 gY := hwRound(Gear^.Y); |
1764 gY := hwRound(Gear^.Y); |
1768 // Standard fire |
1765 // Standard fire |
1769 if (Gear^.State and gsttmpFlag) = 0 then |
1766 if not sticky then |
1770 begin |
1767 begin |
1771 Gear^.Radius := 7; |
1768 Gear^.Radius := 7; |
1772 AmmoShove(Gear, 4, 100); |
1769 AmmoShove(Gear, 4, 100); |
1773 Gear^.Radius := 1; |
1770 Gear^.Radius := 1; |
1774 doMakeExplosion(gX, gY, 4, EXPLNoDamage); |
1771 doMakeExplosion(gX, gY, 4, 0);//, EXPLNoDamage); |
|
1772 //DrawExplosion(gX, gY, 4); |
1775 if ((GameTicks and $7) = 0) and (Random(2) = 0) then |
1773 if ((GameTicks and $7) = 0) and (Random(2) = 0) then |
1776 for i:= 1 to Random(2)+1 do |
1774 for i:= 1 to Random(2)+1 do |
1777 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke); |
1775 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke); |
1778 if Gear^.Health > 0 then dec(Gear^.Health); |
1776 if Gear^.Health > 0 then dec(Gear^.Health); |
1779 Gear^.Timer := 450 - Gear^.Tag * 8 |
1777 Gear^.Timer := 450 - Gear^.Tag * 8 |
1797 end; |
1795 end; |
1798 if Gear^.Health = 0 then |
1796 if Gear^.Health = 0 then |
1799 begin |
1797 begin |
1800 gX := hwRound(Gear^.X); |
1798 gX := hwRound(Gear^.X); |
1801 gY := hwRound(Gear^.Y); |
1799 gY := hwRound(Gear^.Y); |
1802 if (Gear^.State and gsttmpFlag) = 0 then |
1800 if not sticky then |
1803 begin |
1801 begin |
1804 if ((GameTicks and $3) = 0) and (Random(1) = 0) then |
1802 if ((GameTicks and $3) = 0) and (Random(1) = 0) then |
1805 begin |
1803 begin |
1806 for i:= 1 to Random(2)+1 do |
1804 for i:= 1 to Random(2)+1 do |
1807 begin |
1805 begin |