hedgewars/uSound.pas
changeset 14011 3c40754f6cfe
parent 13999 a24c4a051960
child 14014 f09276eb0c27
equal deleted inserted replaced
14010:fb9ed6adef05 14011:3c40754f6cfe
   303             (FileName:        'ice_beam_idle.ogg'; Path: ptSounds; AltPath: ptNone),// sndIceBeamIdle
   303             (FileName:        'ice_beam_idle.ogg'; Path: ptSounds; AltPath: ptNone),// sndIceBeamIdle
   304             (FileName:              'landgun.ogg'; Path: ptSounds; AltPath: ptNone),// sndLandGun
   304             (FileName:              'landgun.ogg'; Path: ptSounds; AltPath: ptNone),// sndLandGun
   305             (FileName:          'graveimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndCaseImpact
   305             (FileName:          'graveimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndCaseImpact
   306             // TODO: New Extra Damage sound
   306             // TODO: New Extra Damage sound
   307             (FileName:             'hell_ugh.ogg'; Path: ptSounds; AltPath: ptNone),// sndExtraDamage
   307             (FileName:             'hell_ugh.ogg'; Path: ptSounds; AltPath: ptNone),// sndExtraDamage
   308             (FileName:        'firepunch_hit.ogg'; Path: ptSounds; AltPath: ptNone) // sndFirePunchHit
   308             (FileName:        'firepunch_hit.ogg'; Path: ptSounds; AltPath: ptNone),// sndFirePunchHit
       
   309             (FileName:              'Grenade.ogg'; Path: ptVoices; AltPath: ptNone) // sndGrenade
   309             );
   310             );
   310 
   311 
   311 
   312 
   312 function  AskForVoicepack(name: shortstring): Pointer;
   313 function  AskForVoicepack(name: shortstring): Pointer;
   313 var i: Longword;
   314 var i: Longword;
   499     if (voicepack <> nil) then
   500     if (voicepack <> nil) then
   500         begin
   501         begin
   501         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   502         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   502             begin
   503             begin
   503             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   504             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   504             // Fallback to sndFirePunch1 / sndOw1 / sndOoff1 if a “higher-numbered” sound is missing
   505             // Fallback sounds
   505             if (not pfsExists(s)) then
   506             if (not pfsExists(s)) then
   506                 begin
   507                 begin
       
   508                 // Fallback to sndFirePunch1 / sndOw1 / sndOoff1 if a “higher-numbered” sound is missing
   507                 if (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
   509                 if (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
   508                     snd := sndFirePunch1
   510                     snd := sndFirePunch1
   509                 else if (snd in [sndOw2, sndOw3, sndOw4]) then
   511                 else if (snd in [sndOw2, sndOw3, sndOw4]) then
   510                     snd := sndOw1
   512                     snd := sndOw1
   511                 else if (snd in [sndOoff2, sndOoff3]) then
   513                 else if (snd in [sndOoff2, sndOoff3]) then
   512                     snd := sndOoff1;
   514                     snd := sndOoff1
       
   515                 else if (snd = sndGrenade) then
       
   516                     if random(2) = 0 then
       
   517                         snd := sndNooo
       
   518                     else
       
   519                         snd := sndUhOh;
   513                 s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   520                 s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   514                 end;
   521                 end;
   515             WriteToConsole(msgLoading + s + ' ');
   522             WriteToConsole(msgLoading + s + ' ');
   516             rwops := rwopsOpenRead(s);
   523             rwops := rwopsOpenRead(s);
   517 
   524