1325 DeleteCI(Gear); |
1325 DeleteCI(Gear); |
1326 AllInactive:= false; |
1326 AllInactive:= false; |
1327 if not Gear^.dY.isNegative and (Gear^.dY > _0_03) and TestCollisionYwithGear(Gear, 1) then |
1327 if not Gear^.dY.isNegative and (Gear^.dY > _0_03) and TestCollisionYwithGear(Gear, 1) then |
1328 begin |
1328 begin |
1329 Gear^.State:= Gear^.State or gsttmpFlag; |
1329 Gear^.State:= Gear^.State or gsttmpFlag; |
1330 inc(Gear^.Damage, hwRound(Gear^.dY * _40)); |
1330 inc(Gear^.Damage, hwRound(Gear^.dY * _50)); |
1331 for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do |
1331 for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do |
1332 begin |
1332 begin |
1333 particle:= AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
1333 particle:= AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
1334 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5) |
1334 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5) |
1335 end |
1335 end |
1336 end |
1336 end |
1337 else if not Gear^.dX.isNegative and (Gear^.dX > _0_03) and TestCollisionXwithGear(Gear, 1) then |
1337 else if not Gear^.dX.isNegative and (Gear^.dX > _0_03) and TestCollisionXwithGear(Gear, 1) then |
1338 inc(Gear^.Damage, hwRound(Gear^.dX * _40)) |
1338 inc(Gear^.Damage, hwRound(Gear^.dX * _50)) |
1339 else if Gear^.dY.isNegative and (Gear^.dY < -_0_03) and TestCollisionYwithGear(Gear, -1) then |
1339 else if Gear^.dY.isNegative and (Gear^.dY < -_0_03) and TestCollisionYwithGear(Gear, -1) then |
1340 inc(Gear^.Damage, hwRound(Gear^.dY * -_40)) |
1340 inc(Gear^.Damage, hwRound(Gear^.dY * -_50)) |
1341 else if Gear^.dX.isNegative and (Gear^.dX < -_0_03) and TestCollisionXwithGear(Gear, -1) then |
1341 else if Gear^.dX.isNegative and (Gear^.dX < -_0_03) and TestCollisionXwithGear(Gear, -1) then |
1342 inc(Gear^.Damage, hwRound(Gear^.dX * -_40)); |
1342 inc(Gear^.Damage, hwRound(Gear^.dX * -_50)); |
1343 if Gear^.Damage <> 0 then PlaySound(sndGrenadeImpact); |
1343 if Gear^.Damage <> 0 then PlaySound(sndGrenadeImpact); |
1344 doStepFallingGear(Gear); |
1344 doStepFallingGear(Gear); |
1345 CalcRotationDirAngle(Gear); |
1345 CalcRotationDirAngle(Gear); |
1346 CheckGearDrowning(Gear) |
1346 CheckGearDrowning(Gear) |
1347 end |
1347 end |