636 |
637 |
637 if ((Gear^.Message and gmLJump ) <> 0) then |
638 if ((Gear^.Message and gmLJump ) <> 0) then |
638 begin |
639 begin |
639 Gear^.Message:= Gear^.Message and not gmLJump; |
640 Gear^.Message:= Gear^.Message and not gmLJump; |
640 DeleteCI(Gear); |
641 DeleteCI(Gear); |
641 if not TestCollisionYwithGear(Gear, -1) then |
642 if TestCollisionYwithGear(Gear, -1) = 0 then |
642 if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _2 else |
643 if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _2 else |
643 if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _1; |
644 if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _1; |
644 if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) |
645 if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) |
645 or TestCollisionYwithGear(Gear, -1)) then |
646 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
646 begin |
647 begin |
647 Gear^.dY:= -_0_15; |
648 Gear^.dY:= -_0_15; |
648 if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX); |
649 if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX); |
649 Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
650 Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
650 PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack); |
651 PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack); |
683 |
684 |
684 Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7; |
685 Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7; |
685 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
686 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
686 begin |
687 begin |
687 if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX)) |
688 if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX)) |
688 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
689 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
689 if not (TestCollisionXwithXYShift(Gear, _0, -5, hwSign(Gear^.dX)) |
690 if not (TestCollisionXwithXYShift(Gear, _0, -5, hwSign(Gear^.dX)) |
690 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
691 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
691 if not (TestCollisionXwithXYShift(Gear, _0, -4, hwSign(Gear^.dX)) |
692 if not (TestCollisionXwithXYShift(Gear, _0, -4, hwSign(Gear^.dX)) |
692 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
693 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
693 if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX)) |
694 if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX)) |
694 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
695 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
695 if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) |
696 if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) |
696 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
697 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
697 if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) |
698 if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) |
698 or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1; |
699 or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1; |
699 end; |
700 end; |
700 |
701 |
701 if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then |
702 if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then |
702 Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX); |
703 Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX); |
703 |
704 |
704 SetAllHHToActive; |
705 SetAllHHToActive; |
705 |
706 |
706 if not TestCollisionYwithGear(Gear, 1) then |
707 if TestCollisionYwithGear(Gear, 1) = 0 then |
707 begin |
708 begin |
708 Gear^.Y:= Gear^.Y + _1; |
709 Gear^.Y:= Gear^.Y + _1; |
709 if not TestCollisionYwithGear(Gear, 1) then |
710 if TestCollisionYwithGear(Gear, 1) = 0 then |
710 begin |
711 begin |
711 Gear^.Y:= Gear^.Y + _1; |
712 Gear^.Y:= Gear^.Y + _1; |
712 if not TestCollisionYwithGear(Gear, 1) then |
713 if TestCollisionYwithGear(Gear, 1) = 0 then |
713 begin |
714 begin |
714 Gear^.Y:= Gear^.Y + _1; |
715 Gear^.Y:= Gear^.Y + _1; |
715 if not TestCollisionYwithGear(Gear, 1) then |
716 if TestCollisionYwithGear(Gear, 1) = 0 then |
716 begin |
717 begin |
717 Gear^.Y:= Gear^.Y + _1; |
718 Gear^.Y:= Gear^.Y + _1; |
718 if not TestCollisionYwithGear(Gear, 1) then |
719 if TestCollisionYwithGear(Gear, 1) = 0 then |
719 begin |
720 begin |
720 Gear^.Y:= Gear^.Y + _1; |
721 Gear^.Y:= Gear^.Y + _1; |
721 if not TestCollisionYwithGear(Gear, 1) then |
722 if TestCollisionYwithGear(Gear, 1) = 0 then |
722 begin |
723 begin |
723 Gear^.Y:= Gear^.Y + _1; |
724 Gear^.Y:= Gear^.Y + _1; |
724 if not TestCollisionYwithGear(Gear, 1) then |
725 if TestCollisionYwithGear(Gear, 1) = 0 then |
725 begin |
726 begin |
726 Gear^.Y:= Gear^.Y - _6; |
727 Gear^.Y:= Gear^.Y - _6; |
727 Gear^.dY:= _0; |
728 Gear^.dY:= _0; |
728 Gear^.State:= Gear^.State or gstMoving; |
729 Gear^.State:= Gear^.State or gstMoving; |
729 exit |
730 exit |
1101 if Team^.hasGone then |
1114 if Team^.hasGone then |
1102 TeamGoneEffect(Team^) |
1115 TeamGoneEffect(Team^) |
1103 else |
1116 else |
1104 doStepHedgehogDriven(Gear) |
1117 doStepHedgehogDriven(Gear) |
1105 end; |
1118 end; |
1106 end; |
1119 |
|
1120 if ((GameTicks mod 50) = 0) and (Gear^.State and (gstMoving or gstHHJumping or gstHHHJump) = 0) and ((Gear^.Message and gmAllStoppable) = 0) and |
|
1121 (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then |
|
1122 begin |
|
1123 if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)+cHHRadius, lfIce) then |
|
1124 begin |
|
1125 Gear^.dX.QWordValue:= Gear^.dX.QWordValue + cGravity.QWordValue * 75; |
|
1126 Gear^.State:= Gear^.State or gstMoving; |
|
1127 end |
|
1128 (* |
|
1129 // check land slope, and impart a dX based on it |
|
1130 tdX:= Gear^.dX; |
|
1131 tdY:= Gear^.dY; |
|
1132 Gear^.dX:= _0; |
|
1133 Gear^.dY:= _1; |
|
1134 x := hwRound(Gear^.X); |
|
1135 y := hwRound(Gear^.Y); |
|
1136 tx := 0; |
|
1137 ty := 0; |
|
1138 if not CalcSlopeTangent(Gear, x, y+cHHRadius, tx, ty, 255) then |
|
1139 begin |
|
1140 slope:= _1/DistanceI(tx,ty); |
|
1141 AddFileLog(FloatToStr(tdX)+ ' == '+FloatToStr(slope)); |
|
1142 tdX:= tdX + (cGravity * slope / _10) // this will need tuning |
|
1143 end; |
|
1144 Gear^.dX:= tdX; |
|
1145 Gear^.dY:= tdY *) |
|
1146 end; |
|
1147 end; |