hedgewars/GSHandlers.inc
changeset 919 fadfefc2ae40
parent 915 33040b7695c0
child 924 227f9fcdc2f4
equal deleted inserted replaced
918:c8cff180da57 919:fadfefc2ae40
   109 end;
   109 end;
   110 
   110 
   111 ////////////////////////////////////////////////////////////////////////////////
   111 ////////////////////////////////////////////////////////////////////////////////
   112 procedure doStepBomb(Gear: PGear);
   112 procedure doStepBomb(Gear: PGear);
   113 var i: LongInt;
   113 var i: LongInt;
       
   114     dX, dY: hwFloat;
   114 begin
   115 begin
   115 AllInactive:= false;
   116 AllInactive:= false;
   116 doStepFallingGear(Gear);
   117 doStepFallingGear(Gear);
   117 dec(Gear^.Timer);
   118 dec(Gear^.Timer);
   118 if Gear^.Timer = 0 then
   119 if Gear^.Timer = 0 then
   120    case Gear^.Kind of
   121    case Gear^.Kind of
   121         gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
   122         gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
   122       gtClusterBomb: begin
   123       gtClusterBomb: begin
   123                      doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
   124                      doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
   124                      for i:= 0 to 4 do
   125                      for i:= 0 to 4 do
   125                          AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, rndSign(GetRandom * _0_1), (GetRandom - _3) * _0_08, 0);
   126                          begin
       
   127                          dX:= rndSign(GetRandom * _0_1);
       
   128                          dY:= (GetRandom - _3) * _0_08;
       
   129                          AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 0);
       
   130                          end
   126                      end
   131                      end
   127         end;
   132         end;
   128    DeleteGear(Gear);
   133    DeleteGear(Gear);
   129    exit
   134    exit
   130    end;
   135    end;