758 if ((Gear^.Message and gmLJump ) <> 0) then |
758 if ((Gear^.Message and gmLJump ) <> 0) then |
759 begin |
759 begin |
760 Gear^.Message:= Gear^.Message and (not gmLJump); |
760 Gear^.Message:= Gear^.Message and (not gmLJump); |
761 DeleteCI(Gear); |
761 DeleteCI(Gear); |
762 if TestCollisionYwithGear(Gear, -1) = 0 then |
762 if TestCollisionYwithGear(Gear, -1) = 0 then |
763 if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then |
763 if TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) = 0 then |
764 Gear^.Y:= Gear^.Y - _2 |
764 Gear^.Y:= Gear^.Y - _2 |
765 else |
765 else |
766 if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then |
766 if TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) = 0 then |
767 Gear^.Y:= Gear^.Y - _1; |
767 Gear^.Y:= Gear^.Y - _1; |
768 if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) |
768 if (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) = 0) and |
769 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
769 (TestCollisionYwithGear(Gear, -1) = 0) then |
770 begin |
770 begin |
771 Gear^.dY:= -_0_15; |
771 Gear^.dY:= -_0_15; |
772 if not cArtillery then |
772 if not cArtillery then |
773 Gear^.dX:= SignAs(_0_15, Gear^.dX); |
773 Gear^.dX:= SignAs(_0_15, Gear^.dX); |
774 Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
774 Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
919 Gear^.dY:= Gear^.dY * _0_999; |
919 Gear^.dY:= Gear^.dY * _0_999; |
920 Gear^.dX:= Gear^.dX * _0_999; |
920 Gear^.dX:= Gear^.dX * _0_999; |
921 end; |
921 end; |
922 |
922 |
923 if (Gear^.State and gstMoving) <> 0 then |
923 if (Gear^.State and gstMoving) <> 0 then |
924 if TestCollisionXKick(Gear, hwSign(Gear^.dX)) then |
924 if TestCollisionXKick(Gear, hwSign(Gear^.dX)) <> 0 then |
925 if not isFalling then |
925 if not isFalling then |
926 if hwAbs(Gear^.dX) > _0_01 then |
926 if hwAbs(Gear^.dX) > _0_01 then |
927 if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) or |
927 if (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) = 0) and |
928 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then |
928 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1) = 0) then |
929 begin |
929 begin |
930 Gear^.X:= Gear^.X + Gear^.dX; |
930 Gear^.X:= Gear^.X + Gear^.dX; |
931 Gear^.dX:= Gear^.dX * _0_96; |
931 Gear^.dX:= Gear^.dX * _0_96; |
932 Gear^.Y:= Gear^.Y - _1 |
932 Gear^.Y:= Gear^.Y - _1 |
933 end |
933 end |
934 else |
934 else |
935 if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) or |
935 if (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) = 0) and |
936 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then |
936 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1) = 0) then |
937 begin |
937 begin |
938 Gear^.X:= Gear^.X + Gear^.dX; |
938 Gear^.X:= Gear^.X + Gear^.dX; |
939 Gear^.dX:= Gear^.dX * _0_93; |
939 Gear^.dX:= Gear^.dX * _0_93; |
940 Gear^.Y:= Gear^.Y - _2 |
940 Gear^.Y:= Gear^.Y - _2 |
941 end |
941 end |
942 else |
942 else |
943 if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) or |
943 if (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) = 0) and |
944 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then |
944 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1) = 0) then |
945 begin |
945 begin |
946 Gear^.X:= Gear^.X + Gear^.dX; |
946 Gear^.X:= Gear^.X + Gear^.dX; |
947 Gear^.dX:= Gear^.dX * _0_9 ; |
947 Gear^.dX:= Gear^.dX * _0_9 ; |
948 Gear^.Y:= Gear^.Y - _3 |
948 Gear^.Y:= Gear^.Y - _3 |
949 end |
949 end |
950 else |
950 else |
951 if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) or |
951 if (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) = 0) and |
952 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then |
952 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1) = 0) then |
953 begin |
953 begin |
954 Gear^.X:= Gear^.X + Gear^.dX; |
954 Gear^.X:= Gear^.X + Gear^.dX; |
955 Gear^.dX:= Gear^.dX * _0_87; |
955 Gear^.dX:= Gear^.dX * _0_87; |
956 Gear^.Y:= Gear^.Y - _4 |
956 Gear^.Y:= Gear^.Y - _4 |
957 end |
957 end |
958 else |
958 else |
959 if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) or |
959 if (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) = 0) and |
960 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then |
960 (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1) = 0) then |
961 begin |
961 begin |
962 Gear^.X:= Gear^.X + Gear^.dX; |
962 Gear^.X:= Gear^.X + Gear^.dX; |
963 Gear^.dX:= Gear^.dX * _0_84; |
963 Gear^.dX:= Gear^.dX * _0_84; |
964 Gear^.Y:= Gear^.Y - _5 |
964 Gear^.Y:= Gear^.Y - _5 |
965 end |
965 end |
1006 begin |
1006 begin |
1007 Gear^.State:= Gear^.State and (not gstAnimation); |
1007 Gear^.State:= Gear^.State and (not gstAnimation); |
1008 // ARTILLERY but not being moved by explosions |
1008 // ARTILLERY but not being moved by explosions |
1009 Gear^.X:= Gear^.X + Gear^.dX; |
1009 Gear^.X:= Gear^.X + Gear^.dX; |
1010 Gear^.Y:= Gear^.Y + Gear^.dY; |
1010 Gear^.Y:= Gear^.Y + Gear^.dY; |
1011 if (not Gear^.dY.isNegative) and (not TestCollisionYKick(Gear, 1)) |
1011 if (not Gear^.dY.isNegative) and (TestCollisionYKick(Gear, 1) = 0) |
1012 and TestCollisionYwithXYShift(Gear, 0, 1, 1) then |
1012 and (TestCollisionYwithXYShift(Gear, 0, 1, 1) <> 0) then |
1013 begin |
1013 begin |
1014 CheckHHDamage(Gear); |
1014 CheckHHDamage(Gear); |
1015 Gear^.dY:= _0; |
1015 Gear^.dY:= _0; |
1016 Gear^.Y:= Gear^.Y + _1 |
1016 Gear^.Y:= Gear^.Y + _1 |
1017 end; |
1017 end; |