32 implementation |
32 implementation |
33 uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, |
33 uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, |
34 uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript, |
34 uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript, |
35 uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, |
35 uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, |
36 uGearsUtils; |
36 uGearsUtils; |
|
37 |
|
38 var GHStepTicks: LongWord = 0; |
37 |
39 |
38 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
40 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
39 function ChangeAmmo(HHGear: PGear): boolean; |
41 function ChangeAmmo(HHGear: PGear): boolean; |
40 var slot, i: Longword; |
42 var slot, i: Longword; |
41 ammoidx: LongInt; |
43 ammoidx: LongInt; |
1114 |
1116 |
1115 if ((HHGear^.State and (gstMoving or gstDrowning)) = 0) then |
1117 if ((HHGear^.State and (gstMoving or gstDrowning)) = 0) then |
1116 begin |
1118 begin |
1117 AddGearCI(HHGear); |
1119 AddGearCI(HHGear); |
1118 if wasJumping then |
1120 if wasJumping then |
1119 StepTicks:= 410 |
1121 GHStepTicks:= 410 |
1120 else |
1122 else |
1121 StepTicks:= 95 |
1123 GHStepTicks:= 95 |
1122 end; |
1124 end; |
1123 exit |
1125 exit |
1124 end; |
1126 end; |
1125 |
1127 |
1126 if not isInMultiShoot and (Hedgehog^.Gear <> nil) then |
1128 if not isInMultiShoot and (Hedgehog^.Gear <> nil) then |
1127 begin |
1129 begin |
1128 if StepTicks > 0 then |
1130 if GHStepTicks > 0 then |
1129 dec(StepTicks); |
1131 dec(GHStepTicks); |
1130 if (StepTicks = 0) then |
1132 if (GHStepTicks = 0) then |
1131 HedgehogStep(HHGear) |
1133 HedgehogStep(HHGear) |
1132 end |
1134 end |
1133 end; |
1135 end; |
1134 |
1136 |
1135 //////////////////////////////////////////////////////////////////////////////// |
1137 //////////////////////////////////////////////////////////////////////////////// |