Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

JBAddonLlama.JBLlamaMessage


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
//=============================================================================
// JBLlamaMessage
// Copyright 2003 by Wormbo <wormbo@onlinehome.de>
// $Id: JBLlamaMessage.uc,v 1.6 2007-02-11 08:16:00 wormbo Exp $
//
// Localized messages for Llama Hunt announcements.
//=============================================================================


class JBLlamaMessage extends LocalMessage abstract;


//=============================================================================
// Localization
//=============================================================================

// allowed placeholders in llama messages:
//   %llama%      Name of the player who is or was the llama
//   %killer%     Name of the player who killed the llama (only in TextLlamaCaught)

var localized string TextLlamaHuntStart;
var localized string TextLlamaCaught;
var localized string TextLlamaDied;
var localized string TextLlamaDisconnected;


//=============================================================================
// GetString
//
// Gets the localized string for the given event.
// The parameters assume the following values:
//
//   Switch   Meaning                        Info 1   Info 2   Object    
//   ======   ============================   ======   ======   ======
//   1        Player became the llama        Llama
//   2        Llama was killed by a player   Llama    Killer
//   3        Llama suicided                 Llama
//   4        Llama disconnected             Llama
//
//=============================================================================

static function string GetString(optional int iSwitch,
                                 optional PlayerReplicationInfo PlayerReplicationInfo1, 
                                 optional PlayerReplicationInfo PlayerReplicationInfo2,
                                 optional Object ObjectOptional)
{
  local string ReturnText;
  
  if ( iSwitch == 2 && PlayerReplicationInfo2 == None )
    iSwitch = 3;
  
  switch (iSwitch) {
    case 1:
      return class'JBLocalMessage'.static.StaticReplaceText(Default.TextLlamaHuntStart,
                                                            "%llama%",
                                                            PlayerReplicationInfo1.PlayerName);
    case 2:
      ReturnText = class'JBLocalMessage'.static.StaticReplaceText(Default.TextLlamaCaught,
                                                                  "%llama%",
                                                                  PlayerReplicationInfo1.PlayerName);
      return class'JBLocalMessage'.static.StaticReplaceText(ReturnText,
                                                            "%killer%",
                                                            PlayerReplicationInfo2.PlayerName);
    case 3:
      return class'JBLocalMessage'.static.StaticReplaceText(Default.TextLlamaDied,
                                                            "%llama%",
                                                            PlayerReplicationInfo1.PlayerName);
    case 4:
      return class'JBLocalMessage'.static.StaticReplaceText(Default.TextLlamaDisconnected,
                                                            "%llama%",
                                                            PlayerReplicationInfo1.PlayerName);
  }
  
}


//=============================================================================
// ClientReceive
//
// Receives an event on a client's computer and performs appropriate actions.
//=============================================================================

static function ClientReceive(PlayerController Player,
                              optional int iSwitch,
                              optional PlayerReplicationInfo PlayerReplicationInfo1, 
                              optional PlayerReplicationInfo PlayerReplicationInfo2,
                              optional Object ObjectOptional)
{
  if (Player != None || Viewport(Player.Player) != None) {
    switch (iSwitch) {
      case 1:
        if ( class'JBLocalMessage'.static.IsLocalPlayer(PlayerReplicationInfo1) )
          Class'JBSpeechManager'.Static.PlayFor(Player.Level, "$AddonLlamaStart", "llama");
        else
          Class'JBSpeechManager'.Static.PlayFor(Player.Level, "$AddonLlamaStart", "other");
        break;
      case 2:
      case 3:
        Class'JBSpeechManager'.Static.PlayFor(Player.Level, "$AddonLlamaFragged");
        break;
      case 4:
        Class'JBSpeechManager'.Static.PlayFor(Player.Level, "$AddonLlamaDisconnect");
        break;
    }
  }
  
  if ( iSwitch != 1 || !class'JBLocalMessage'.static.IsLocalPlayer(PlayerReplicationInfo1) )
    Super.ClientReceive(Player, iSwitch, PlayerReplicationInfo1, PlayerReplicationInfo2, ObjectOptional);
}


//=============================================================================
// Default properties
//=============================================================================

defaultproperties
{
  TextLlamaHuntStart="Kill %llama% for a little reward."
  TextLlamaCaught="%llama% was caught by %killer%!"
  TextLlamaDied="%llama% was busted!"
  TextLlamaDisconnected="%llama% ran away!"
  DrawColor=(R=255,G=255,B=0,A=255)
  StackMode=SM_Down
  PosY=0.3
  bFadeMessage=True
  bIsUnique=True
  bIsSpecial=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: So 11.2.2007 10:16:00.000 - Creation time: Do 14.8.2014 09:58:42.788 - Created with UnCodeX