hedgewars/uGearsUtils.pas
changeset 6804 06bedc419d04
parent 6803 0e70f3ea3bf8
child 6888 32a54322d262
equal deleted inserted replaced
6803:0e70f3ea3bf8 6804:06bedc419d04
   377                             exit // skip splashes 
   377                             exit // skip splashes 
   378                 end;
   378                 end;
   379             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   379             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   380             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   380             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   381             and (CurAmmoGear^.dY < _0_01))) then
   381             and (CurAmmoGear^.dY < _0_01))) then
   382                 // don't play splash if they are already way past the surface
   382                 if Gear^.Density * Gear^.dY > _1 then
   383                 PlaySound(sndSplash)
   383                     PlaySound(sndSplash)
       
   384                 else if Gear^.Density * Gear^.dY > _0_5 then 
       
   385                     PlaySound(sndSkip)
       
   386                 else
       
   387                     PlaySound(sndDroplet2);
   384             end;
   388             end;
   385 
   389 
   386         if ((cReducedQuality and rqPlainSplash) = 0)
   390         if ((cReducedQuality and rqPlainSplash) = 0)
   387         and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   391         and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   388         or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   392         or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   389         and (CurAmmoGear^.dY < _0_01)))) then
   393         and (CurAmmoGear^.dY < _0_01)))) then
   390             begin
   394             begin
   391             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
   395             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
   392             if splash <> nil then 
   396             if splash <> nil then 
   393                 begin
   397                 begin
   394                 splash^.Scale:= hwFloat2Float(Gear^.Density / _3);
   398                 splash^.Scale:= hwFloat2Float(Gear^.Density / _3 * Gear^.dY);
   395                 if splash^.Scale > 1 then splash^.Scale:= power(splash^.Scale,0.3333)
   399                 if splash^.Scale > 1 then splash^.Scale:= power(splash^.Scale,0.3333)
   396                 else splash^.Scale:= splash^.Scale + ((1-splash^.Scale) / 2);
   400                 else splash^.Scale:= splash^.Scale + ((1-splash^.Scale) / 2);
   397                 end;
   401                 end;
   398 
   402 
   399             maxDrops := (hwRound(Gear^.Density) * 3) div 2 + round(vdX * hwRound(Gear^.Density) * 6) + round(vdY * hwRound(Gear^.Density) * 6);
   403             maxDrops := (hwRound(Gear^.Density) * 3) div 2 + round(vdX * hwRound(Gear^.Density) * 6) + round(vdY * hwRound(Gear^.Density) * 6);