hedgewars/uGearsHandlersMess.pas
changeset 13566 acc69f506914
parent 13464 7b4643ff60ea
child 13572 a71e6856ffab
equal deleted inserted replaced
13564:d8da70fdec16 13566:acc69f506914
  1708 
  1708 
  1709         i := x - Gear^.Radius - LongInt(GetRandom(2));
  1709         i := x - Gear^.Radius - LongInt(GetRandom(2));
  1710         ei := x + Gear^.Radius + LongInt(GetRandom(2));
  1710         ei := x + Gear^.Radius + LongInt(GetRandom(2));
  1711         while i <= ei do
  1711         while i <= ei do
  1712             begin
  1712             begin
  1713             DrawExplosion(i, y + 3, 3);
  1713             doMakeExplosion(i, y + 3, 3, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  1714             inc(i, 1)
  1714             inc(i, 1)
  1715             end;
  1715             end;
  1716 
  1716 
  1717         if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), lfIndestructible) then
  1717         if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), lfIndestructible) then
  1718             begin
  1718             begin
  2671             Gear^.Y:= Gear^.Y+_6;
  2671             Gear^.Y:= Gear^.Y+_6;
  2672             if (landPixel and lfIce <> 0) or (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
  2672             if (landPixel and lfIce <> 0) or (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
  2673                 begin
  2673                 begin
  2674                 gX := hwRound(Gear^.X);
  2674                 gX := hwRound(Gear^.X);
  2675                 gY := hwRound(Gear^.Y) - 6;
  2675                 gY := hwRound(Gear^.Y) - 6;
  2676                 DrawExplosion(gX, gY, 4);
  2676                 doMakeExplosion(gX, gY, 4, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  2677                 PlaySound(sndVaporize);
  2677                 PlaySound(sndVaporize);
  2678                 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSteam);
  2678                 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSteam);
  2679                 DeleteGear(Gear);
  2679                 DeleteGear(Gear);
  2680                 exit
  2680                 exit
  2681                 end;
  2681                 end;
  2721                     Gear^.dY:= tdY;
  2721                     Gear^.dY:= tdY;
  2722                     Gear^.Radius := 1;
  2722                     Gear^.Radius := 1;
  2723                     end
  2723                     end
  2724                 else if ((GameTicks and $3) = 3) then
  2724                 else if ((GameTicks and $3) = 3) then
  2725                     doMakeExplosion(gX, gY, Gear^.Boom * 4, Gear^.Hedgehog, 0);//, EXPLNoDamage);
  2725                     doMakeExplosion(gX, gY, Gear^.Boom * 4, Gear^.Hedgehog, 0);//, EXPLNoDamage);
  2726                 //DrawExplosion(gX, gY, 4);
       
  2727 
  2726 
  2728                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2727                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2729                     for i:= Random(2) downto 0 do
  2728                     for i:= Random(2) downto 0 do
  2730                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2729                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2731 
  2730 
  2736             else
  2735             else
  2737                 begin
  2736                 begin
  2738                 // Modified fire
  2737                 // Modified fire
  2739                 if ((GameTicks and $7FF) = 0) and ((GameFlags and gfSolidLand) = 0) then
  2738                 if ((GameTicks and $7FF) = 0) and ((GameFlags and gfSolidLand) = 0) then
  2740                     begin
  2739                     begin
  2741                     DrawExplosion(gX, gY, 4);
  2740                     doMakeExplosion(gX, gY, 4, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  2742 
  2741 
  2743                     for i:= Random(3) downto 0 do
  2742                     for i:= Random(3) downto 0 do
  2744                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2743                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2745                     end;
  2744                     end;
  2746 
  2745 
  5296                 // if at least 5 collisions occured
  5295                 // if at least 5 collisions occured
  5297                 if Gear^.Damage > 0 then
  5296                 if Gear^.Damage > 0 then
  5298                     begin
  5297                     begin
  5299                     if ((GameFlags and gfSolidLand) = 0) then
  5298                     if ((GameFlags and gfSolidLand) = 0) then
  5300                         begin
  5299                         begin
  5301                         DrawExplosion(rX,rY,Gear^.Radius);
  5300                         doMakeExplosion(rX,rY,Gear^.Radius, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  5302                         end;
  5301                         end;
  5303 
  5302 
  5304                     // kick nearby hogs
  5303                     // kick nearby hogs
  5305                     AmmoShove(Gear, Gear^.Boom, 50);
  5304                     AmmoShove(Gear, Gear^.Boom, 50);
  5306 
  5305 
  5667         begin
  5666         begin
  5668         AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
  5667         AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
  5669 
  5668 
  5670         i := hwRound(Gear^.X) - HitGear^.Radius + 2;
  5669         i := hwRound(Gear^.X) - HitGear^.Radius + 2;
  5671         ei := hwRound(Gear^.X) + HitGear^.Radius - 2;
  5670         ei := hwRound(Gear^.X) + HitGear^.Radius - 2;
  5672         for j := 1 to 4 do DrawExplosion(i - GetRandom(5), hwRound(Gear^.Y) + 6*j, 3);
  5671         for j := 1 to 4 do doMakeExplosion(i - GetRandom(5), hwRound(Gear^.Y) + 6*j, 3, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  5673         for j := 1 to 4 do DrawExplosion(ei + LongInt(GetRandom(5)), hwRound(Gear^.Y) + 6*j, 3);
  5672         for j := 1 to 4 do doMakeExplosion(ei + LongInt(GetRandom(5)), hwRound(Gear^.Y) + 6*j, 3, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  5674         while i <= ei do
  5673         while i <= ei do
  5675             begin
  5674             begin
  5676             for j := 1 to 11 do DrawExplosion(i, hwRound(Gear^.Y) + 3*j, 3);
  5675             for j := 1 to 11 do doMakeExplosion(i, hwRound(Gear^.Y) + 3*j, 3, Gear^.Hedgehog, EXPLNoDamage or EXPLDoNotTouchAny or EXPLNoGfx);
  5677             inc(i, 1)
  5676             inc(i, 1)
  5678             end;
  5677             end;
  5679 
  5678 
  5680         if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9)
  5679         if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9)
  5681            , lfIndestructible) then
  5680            , lfIndestructible) then