hedgewars/uGearsUtils.pas
changeset 10827 2b717f687c72
parent 10789 acbf69e2e5cf
child 10828 9867dd60a66a
equal deleted inserted replaced
10826:bc5215b2f9fb 10827:2b717f687c72
    80     dmg, dmgBase: LongInt;
    80     dmg, dmgBase: LongInt;
    81     fX, fY, tdX, tdY: hwFloat;
    81     fX, fY, tdX, tdY: hwFloat;
    82     vg: PVisualGear;
    82     vg: PVisualGear;
    83     i, cnt: LongInt;
    83     i, cnt: LongInt;
    84     wrap: boolean;
    84     wrap: boolean;
       
    85     bubble: PVisualGear;
    85 begin
    86 begin
    86 if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');
    87 if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');
    87 if Radius > 25 then KickFlakes(Radius, X, Y);
    88 if Radius > 25 then KickFlakes(Radius, X, Y);
    88 
    89 
    89 if ((Mask and EXPLNoGfx) = 0) then
    90 if ((Mask and EXPLNoGfx) = 0) then
    90     begin
    91     begin
    91     vg:= nil;
    92     vg:= nil;
    92     if Radius > 50 then vg:= AddVisualGear(X, Y, vgtBigExplosion)
    93     if CheckCoordInWater(X, Y - Radius) then
       
    94         begin
       
    95         cnt:= 2 * Radius;
       
    96         for i:= (Radius * Radius) div 4 downto 0 do
       
    97             begin
       
    98             bubble := AddVisualGear(X - Radius + random(cnt), Y - Radius + random(cnt), vgtBubble);
       
    99             if bubble <> nil then
       
   100                 bubble^.dY:= 0.1 + random(20)/10;
       
   101             end
       
   102         end
       
   103     else if Radius > 50 then vg:= AddVisualGear(X, Y, vgtBigExplosion)
    93     else if Radius > 10 then vg:= AddVisualGear(X, Y, vgtExplosion);
   104     else if Radius > 10 then vg:= AddVisualGear(X, Y, vgtExplosion);
    94     if vg <> nil then
   105     if vg <> nil then
    95         vg^.Tint:= Tint;
   106         vg^.Tint:= Tint;
    96     end;
   107     end;
    97 if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);
   108 if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);