hedgewars/GSHandlers.inc
changeset 963 5f8bb3470563
parent 945 4ead9cde4e14
child 974 fc16141a0128
equal deleted inserted replaced
962:f2f3aa499548 963:5f8bb3470563
  1350 
  1350 
  1351 ////////////////////////////////////////////////////////////////////////////////
  1351 ////////////////////////////////////////////////////////////////////////////////
  1352 procedure doStepMortar(Gear: PGear);
  1352 procedure doStepMortar(Gear: PGear);
  1353 var dX, dY: hwFloat;
  1353 var dX, dY: hwFloat;
  1354     i: LongInt;
  1354     i: LongInt;
  1355 begin
  1355     dxn, dyn: boolean;
  1356 AllInactive:= false;
  1356 begin
       
  1357 AllInactive:= false;
       
  1358 dxn:= Gear^.dX.isNegative;
       
  1359 dyn:= Gear^.dY.isNegative;
       
  1360 
  1357 doStepFallingGear(Gear);
  1361 doStepFallingGear(Gear);
  1358 if (Gear^.State and gstCollision) <> 0 then
  1362 if (Gear^.State and gstCollision) <> 0 then
  1359 	begin
  1363 	begin
  1360 	doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
  1364 	doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
  1361 	
  1365 
       
  1366 	Gear^.dX.isNegative:= not dxn;
       
  1367 	Gear^.dY.isNegative:= not dyn;
  1362 	for i:= 0 to 4 do
  1368 	for i:= 0 to 4 do
  1363 		begin
  1369 		begin
  1364 		dX:= - Gear^.dX + (GetRandom - _0_5) * _0_03;
  1370 		dX:= Gear^.dX + (GetRandom - _0_5) * _0_03;
  1365 		dY:= - Gear^.dY + (GetRandom - _0_5) * _0_03;
  1371 		dY:= Gear^.dY + (GetRandom - _0_5) * _0_03;
  1366 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 0);
  1372 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 0);
  1367 		end;
  1373 		end;
  1368 	
  1374 	
  1369 	DeleteGear(Gear);
  1375 	DeleteGear(Gear);
  1370 	exit
  1376 	exit
  1371 	end;
  1377 	end;
       
  1378 
  1372 if (GameTicks and $3F) = 0 then
  1379 if (GameTicks and $3F) = 0 then
  1373 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0)
  1380 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0)
  1374 end;
  1381 end;