441 amFlamethrower, amLandGun, |
441 amFlamethrower, amLandGun, |
442 amResurrector, //amStructure, |
442 amResurrector, //amStructure, |
443 amTardis, amPiano, |
443 amTardis, amPiano, |
444 amIceGun, amRubber: CurAmmoGear:= newGear; |
444 amIceGun, amRubber: CurAmmoGear:= newGear; |
445 end; |
445 end; |
|
446 if CurAmmoType = amCake then FollowGear:= newGear; |
446 |
447 |
447 if ((CurAmmoType = amMine) or (CurAmmoType = amSMine)) and (GameFlags and gfInfAttack <> 0) then |
448 if ((CurAmmoType = amMine) or (CurAmmoType = amSMine)) and (GameFlags and gfInfAttack <> 0) then |
448 newGear^.FlightTime:= GameTicks + 1000 |
449 newGear^.FlightTime:= GameTicks + 1000 |
449 else if CurAmmoType = amDrill then |
450 else if CurAmmoType = amDrill then |
450 newGear^.FlightTime:= GameTicks + 250; |
451 newGear^.FlightTime:= GameTicks + 250; |
861 //////////////////////////////////////////////////////////////////////////////// |
862 //////////////////////////////////////////////////////////////////////////////// |
862 procedure doStepHedgehogMoving(Gear: PGear); |
863 procedure doStepHedgehogMoving(Gear: PGear); |
863 var isFalling, isUnderwater: boolean; |
864 var isFalling, isUnderwater: boolean; |
864 land: Word; |
865 land: Word; |
865 begin |
866 begin |
|
867 if Gear^.Hedgehog^.Unplaced then |
|
868 begin |
|
869 Gear^.dY:= _0; |
|
870 Gear^.dX:= _0; |
|
871 Gear^.State:= Gear^.State and (not gstMoving); |
|
872 exit |
|
873 end; |
|
874 |
866 land:= 0; |
875 land:= 0; |
867 isUnderwater:= CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y) + Gear^.Radius); |
876 isUnderwater:= CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y) + Gear^.Radius); |
868 if Gear^.dX.QWordValue > 8160437862 then |
877 if Gear^.dX.QWordValue > 8160437862 then |
869 Gear^.dX.QWordValue:= 8160437862; |
878 Gear^.dX.QWordValue:= 8160437862; |
870 if Gear^.dY.QWordValue > 8160437862 then |
879 if Gear^.dY.QWordValue > 8160437862 then |
871 Gear^.dY.QWordValue:= 8160437862; |
880 Gear^.dY.QWordValue:= 8160437862; |
872 |
881 |
873 if Gear^.Hedgehog^.Unplaced then |
|
874 begin |
|
875 Gear^.dY:= _0; |
|
876 Gear^.dX:= _0; |
|
877 Gear^.State:= Gear^.State and (not gstMoving); |
|
878 exit |
|
879 end; |
|
880 isFalling:= (Gear^.dY.isNegative) or (TestCollisionYKick(Gear, 1) = 0); |
882 isFalling:= (Gear^.dY.isNegative) or (TestCollisionYKick(Gear, 1) = 0); |
881 if isFalling then |
883 if isFalling then |
882 begin |
884 begin |
883 land:= TestCollisionYKick(Gear, -1); |
885 land:= TestCollisionYKick(Gear, -1); |
884 if (Gear^.dY.isNegative) and (land <> 0) then |
886 if (Gear^.dY.isNegative) and (land <> 0) then |
1357 |
1359 |
1358 //////////////////////////////////////////////////////////////////////////////// |
1360 //////////////////////////////////////////////////////////////////////////////// |
1359 procedure doStepHedgehog(Gear: PGear); |
1361 procedure doStepHedgehog(Gear: PGear); |
1360 var tX: hwFloat; |
1362 var tX: hwFloat; |
1361 begin |
1363 begin |
1362 CheckGearDrowning(Gear); |
1364 // it might make sense to skip more than just drowning check here |
|
1365 if (not Gear^.Hedgehog^.Unplaced) then |
|
1366 CheckGearDrowning(Gear); |
1363 if Gear = nil then exit; |
1367 if Gear = nil then exit; |
1364 tX:= Gear^.X; |
1368 tX:= Gear^.X; |
1365 if WorldWrap(Gear) then |
1369 if WorldWrap(Gear) then |
1366 begin |
1370 begin |
1367 if (WorldEdge <> weBounce) and (Gear = CurrentHedgehog^.Gear) and |
1371 if (WorldEdge <> weBounce) and (Gear = CurrentHedgehog^.Gear) and |