31 procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord); |
31 procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord); |
32 procedure CheckIce(Gear: PGear); inline; |
32 procedure CheckIce(Gear: PGear); inline; |
33 |
33 |
34 implementation |
34 implementation |
35 uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, |
35 uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, |
36 uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript, |
36 uCommands, uLocale, uUtils, uStats, uIO, uScript, |
37 uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, |
37 uGearsList, uCollisions, uRandom, uStore, uTeams, |
38 uGearsUtils; |
38 uGearsUtils, uVisualGearsList; |
39 |
39 |
40 var GHStepTicks: LongWord = 0; |
40 var GHStepTicks: LongWord = 0; |
41 |
41 |
42 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
42 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
43 function ChangeAmmo(HHGear: PGear): boolean; |
43 function ChangeAmmo(HHGear: PGear): boolean; |
845 if isFalling then |
845 if isFalling then |
846 begin |
846 begin |
847 if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then |
847 if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then |
848 Gear^.dY:= _0; |
848 Gear^.dY:= _0; |
849 Gear^.State:= Gear^.State or gstMoving; |
849 Gear^.State:= Gear^.State or gstMoving; |
850 if (CurrentHedgehog^.Gear = Gear) |
850 if (CurrentHedgehog^.Gear = Gear) and (CurrentHedgehog^.Gear^.State and gstHHDriven <> 0) and |
851 and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
851 (not CurrentTeam^.ExtDriven) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
852 begin |
852 begin |
853 // TODO: why so aggressive at setting FollowGear when falling? |
853 // TODO: why so aggressive at setting FollowGear when falling? |
|
854 // because hog was being yanked out of frame by other stuff when doing a complicated jump/chute/saucer/roping. |
|
855 // added a couple more conditions to make it a bit less aggressive, at cost of possibly spectator failing to follow a maneuver |
854 FollowGear:= Gear; |
856 FollowGear:= Gear; |
855 end; |
857 end; |
856 if isUnderwater then |
858 if isUnderwater then |
857 Gear^.dY:= Gear^.dY + cGravity / _2 |
859 Gear^.dY:= Gear^.dY + cGravity / _2 |
858 else |
860 else |
1276 end; |
1278 end; |
1277 |
1279 |
1278 //////////////////////////////////////////////////////////////////////////////// |
1280 //////////////////////////////////////////////////////////////////////////////// |
1279 procedure doStepHedgehog(Gear: PGear); |
1281 procedure doStepHedgehog(Gear: PGear); |
1280 begin |
1282 begin |
|
1283 if WorldWrap(Gear) and (WorldEdge <> weBounce) and |
|
1284 (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.Kind =gtRope) then |
|
1285 CurAmmoGear^.PortalCounter:= 1; |
|
1286 |
1281 CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel; |
1287 CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel; |
1282 if (Gear^.Message and gmDestroy) <> 0 then |
1288 if (Gear^.Message and gmDestroy) <> 0 then |
1283 begin |
1289 begin |
1284 DeleteGear(Gear); |
1290 DeleteGear(Gear); |
1285 exit |
1291 exit |