class stub_Voicepack extends KFVoicePack;


function Timer()
{
  local PlayerController PlayerOwner;
  local Actor soundPlayer;

  PlayerOwner = PlayerController(Owner);
  // ADDITION, portrait switch
  if (!class'Settings'.default.bHidePortraits && bDisplayPortrait && PhraseNum == 0)
  {
    if (bTraderMessage)
      HUDKillingFloor(PlayerController(Owner).myHUD).DisplayTraderPortrait();
    else
      PlayerController(Owner).myHUD.DisplayPortrait(PortraitPRI);
  }

  if (bTraderMessage)
  {
    if (bUseLocationalVoice)
    {
      if (PawnSender != none)
        PawnSender.DemoPlaySound(Phrase[PhraseNum], SLOT_None, ShoutVolume, true, , 1.1 / Level.TimeDilation, false);
    }
    else
    {
      if (PlayerOwner.ViewTarget != none)
        PlayerOwner.ViewTarget.DemoPlaySound(Phrase[PhraseNum], SLOT_Interface,ShoutVolume, true, , 1.1 / Level.TimeDilation, false);
      else
        PlayerOwner.DemoPlaySound(Phrase[PhraseNum], SLOT_Interface,ShoutVolume, true, , 1.1 / Level.TimeDilation, false);
    }
  }

  else if (Phrase[PhraseNum] != none && (Level.TimeSeconds - PlayerOwner.LastPlaySpeech > 2 || PhraseNum > 0))
  {
    PlayerOwner.LastPlaySpeech = Level.TimeSeconds;

    if (bUseLocationalVoice)
    {
      if (PawnSender != none)
        PawnSender.DemoPlaySound(Phrase[PhraseNum], SLOT_None,ShoutVolume,,,1.0,false);
      else
      {
        soundPlayer = Spawn(Class'ROVoiceMessageEffect',,, SenderLoc);

        if (soundPlayer != none)
          soundPlayer.DemoPlaySound(Phrase[PhraseNum], SLOT_None,ShoutVolume,,,1.0,false);
        else
          warn("Unable to spawn ROVoiceMessageEffect at " $ SenderLoc $ "!");
      }
    }

    else
    {
      if (PlayerOwner.ViewTarget != none)
        PlayerOwner.ViewTarget.DemoPlaySound(Phrase[PhraseNum], SLOT_Interface,ShoutVolume,,,1.0,false);
      else
        PlayerOwner.DemoPlaySound(Phrase[PhraseNum], SLOT_Interface,ShoutVolume,,,1.0,false);
    }

    if (MessageAnim != '')
    {
      UnrealPlayer(PlayerOwner).Taunt(MessageAnim);
    }

    if (Phrase[PhraseNum+1] == none)
      Destroy();
    else
    {
      if (GetSoundDuration(Phrase[PhraseNum]) == 0)
        log("ROVoicePack Setting the timer for a sound to zero");

      SetTimer(FMax(0.1,GetSoundDuration(Phrase[PhraseNum])), false);
      PhraseNum++;
    }
  }
  else
    Destroy();
}


defaultproperties{}