equal
deleted
inserted
replaced
51 with HHGear^.Hedgehog^ do |
51 with HHGear^.Hedgehog^ do |
52 begin |
52 begin |
53 HHGear^.Message:= HHGear^.Message and not gmSlot; |
53 HHGear^.Message:= HHGear^.Message and not gmSlot; |
54 ammoidx:= 0; |
54 ammoidx:= 0; |
55 if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) or |
55 if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) or |
56 (TargetPoint.X <> NoPointX) or |
|
57 ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or |
56 ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or |
58 ((HHGear^.State and gstHHDriven) = 0) then exit; |
57 ((HHGear^.State and gstHHDriven) = 0) then exit; |
59 ChangeAmmo:= true; |
58 ChangeAmmo:= true; |
60 |
59 |
61 while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx); |
60 while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx); |
773 isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1); |
772 isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1); |
774 if isFalling then |
773 if isFalling then |
775 begin |
774 begin |
776 if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then Gear^.dY:= _0; |
775 if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then Gear^.dY:= _0; |
777 Gear^.State:= Gear^.State or gstMoving; |
776 Gear^.State:= Gear^.State or gstMoving; |
|
777 if (CurrentHedgehog^.Gear = Gear) |
|
778 and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
|
779 begin |
|
780 FollowGear:= Gear; |
|
781 end; |
778 if isUnderwater then Gear^.dY:= Gear^.dY + cGravity / _2 |
782 if isUnderwater then Gear^.dY:= Gear^.dY + cGravity / _2 |
779 else |
783 else |
780 begin |
784 begin |
781 Gear^.dY:= Gear^.dY + cGravity; |
785 Gear^.dY:= Gear^.dY + cGravity; |
782 // this set of circumstances could be less complex if jumping was more clearly identified |
786 // this set of circumstances could be less complex if jumping was more clearly identified |
1010 end |
1014 end |
1011 end; |
1015 end; |
1012 |
1016 |
1013 //////////////////////////////////////////////////////////////////////////////// |
1017 //////////////////////////////////////////////////////////////////////////////// |
1014 procedure doStepHedgehogFree(Gear: PGear); |
1018 procedure doStepHedgehogFree(Gear: PGear); |
1015 var prevState,i: Longword; |
1019 var prevState: Longword; |
1016 begin |
1020 begin |
1017 prevState:= Gear^.State; |
1021 prevState:= Gear^.State; |
1018 |
1022 |
1019 doStepHedgehogMoving(Gear); |
1023 doStepHedgehogMoving(Gear); |
1020 |
1024 |
1032 Gear^.Timer:= 0; |
1036 Gear^.Timer:= 0; |
1033 FollowGear:= Gear; |
1037 FollowGear:= Gear; |
1034 PrvInactive:= false; |
1038 PrvInactive:= false; |
1035 AllInactive:= false; |
1039 AllInactive:= false; |
1036 |
1040 |
1037 if not Gear^.Hedgehog^.Team^.hasGone then |
1041 if (Gear^.State and gstHHGone) = 0 then |
1038 begin |
1042 begin |
1039 Gear^.Hedgehog^.Effects[hePoisoned] := false; |
1043 Gear^.Hedgehog^.Effects[hePoisoned] := false; |
1040 if Gear^.Hedgehog^.Effects[heResurrectable] then begin |
1044 if Gear^.Hedgehog^.Effects[heResurrectable] then begin |
1041 ResurrectHedgehog(Gear); |
1045 ResurrectHedgehog(Gear); |
1042 end else begin |
1046 end else begin |
1046 AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
1050 AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
1047 end; |
1051 end; |
1048 end |
1052 end |
1049 else |
1053 else |
1050 begin |
1054 begin |
1051 Gear^.State:= Gear^.State or gstHHGone; |
|
1052 Gear^.doStep:= @doStepHedgehogGone; |
1055 Gear^.doStep:= @doStepHedgehogGone; |
1053 |
|
1054 with Gear^.Hedgehog^.Team^ do |
|
1055 for i:= 0 to cMaxHHIndex do |
|
1056 if Hedgehogs[i].GearHidden <> nil then |
|
1057 begin |
|
1058 RestoreHog(@Hedgehogs[i]); |
|
1059 if Hedgehogs[i].Gear <> nil then |
|
1060 begin |
|
1061 Hedgehogs[i].Gear^.State:= Gear^.State or gstHHGone; |
|
1062 Hedgehogs[i].Gear^.doStep:= @doStepHedgehogGone |
|
1063 end |
|
1064 end; |
|
1065 |
1056 |
1066 // Gone message |
1057 // Gone message |
1067 AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
1058 AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
1068 end |
1059 end |
1069 end; |
1060 end; |
1101 if (Gear^.State and gstHHDriven) = 0 then |
1092 if (Gear^.State and gstHHDriven) = 0 then |
1102 doStepHedgehogFree(Gear) |
1093 doStepHedgehogFree(Gear) |
1103 else |
1094 else |
1104 begin |
1095 begin |
1105 with Gear^.Hedgehog^ do |
1096 with Gear^.Hedgehog^ do |
1106 if Team^.hasGone then TeamGoneEffect(Team^); |
1097 if Team^.hasGone then |
1107 doStepHedgehogDriven(Gear) |
1098 TeamGoneEffect(Team^) |
|
1099 else |
|
1100 doStepHedgehogDriven(Gear) |
1108 end; |
1101 end; |
1109 end; |
1102 end; |