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

WormbotHandler3SPN.WIR_GameHandler_TAM


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
00129
00130
00131
00132
/******************************************************************************
Copyright (c) 2005-2007 by Wormbo <wormbo@online.de>
$Id$

Handler for Team Arena Master.
******************************************************************************/


class WIR_GameHandler_TAM extends WIR_GameHandler_DM;


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

var localized string MsgPlayerWonRound;
var localized string MsgDarkHorse;


//== HandleLocalizedMessage ===================================================
/**
Skip the pointless "player is OUT" messages.
*/
//=============================================================================

function bool HandleLocalizedMessage(class<LocalMessage> Message, int Switch, PlayerReplicationInfo RelatedPRI_1, PlayerReplicationInfo RelatedPRI_2, Object OptionalObject)
{
  local string Msg;
  
  if ( MyMutator != None && MyMutator.ReportConnection != None ) {
    if ( Message.Name == 'Message_PlayerIsOut_3SPN' || Message.Name == 'Message_GameLost_3SPN' )
      return true;
    
    if ( Message.Name == 'Message_Darkhorse_3SPN' ) {
      Msg = Repl(MsgDarkHorse, "%r", GetRemainingTime(), True);
      Msg = Repl(Msg, "%p", FormatPlayerName(RelatedPRI_1), True);
      MyMutator.ReportConnection.SendMessage(Msg);
      
      return true;
    }
    
    if ( Message.Name == 'Message_RoundLost_3SPN' ) {
      Msg = Repl(MsgPlayerWonRound, "%r", GetRemainingTime(), True);
      Msg = Repl(Msg, "%p", FormatPlayerName(RelatedPRI_1), True);
      MyMutator.ReportConnection.SendMessage(Msg);
      
      return true;
    }
  }
  
  return Super.HandleLocalizedMessage(Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);
}


//== AddRow ==================================================================
/**
Adds data in a row on the left or right side of the scoreboard table.
*/
//=============================================================================

function AddRow(out array<WIR_Util.TAlignedTable> Table, int row, PlayerReplicationInfo PRI, bool bRightSide)
{
  local int col, coloffset;
  
  if ( bRightSide )
    coloffset = (Table.Length + 1) / 2;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = Repl(FormatPlayerName(PRI, True), "[^B]", "", True); // strip code for bold
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.Score));
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.Deaths));
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = int(PRI.GetPropertyText("Percent")) $ "%";
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.GetPropertyText("WeaponDamage")));
  ++col;
}


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

defaultproperties
{
  MsgPlayerWonRound = "[^B][%r][^B] %p[^O] wins the round"
  MsgDarkHorse      = "[%r] - %p[^O] is a [^B]Dark Horse[^B]"
  
  StringTableHeader(0)  = "[^U]Name"
  StringTableHeader(1)  = "Score"
  StringTableHeader(2)  = "Deaths"
  StringTableHeader(3)  = "Acc."
  StringTableHeader(4)  = "Dam.[^O]"
  StringTableHeader(5)  = " "
  StringTableHeader(6)  = "[^U]Name"
  StringTableHeader(7)  = "Score"
  StringTableHeader(8)  = "Deaths"
  StringTableHeader(9)  = "Acc."
  StringTableHeader(10) = "Dam.[^O]"
  
  ColumnAlign(0)  = TXTA_Left
  ColumnAlign(1)  = TXTA_Right
  ColumnAlign(2)  = TXTA_Right
  ColumnAlign(3)  = TXTA_Right
  ColumnAlign(4)  = TXTA_Right
  ColumnAlign(5)  = TXTA_Center
  ColumnAlign(6)  = TXTA_Left
  ColumnAlign(7)  = TXTA_Right
  ColumnAlign(8)  = TXTA_Right
  ColumnAlign(9)  = TXTA_Right
  ColumnAlign(10) = TXTA_Right
  
  HandlerGroup = "Wormbot (TAM)"
  bAnnounceOutOfLives = False
  StringScoreTemplate = "[score]/[percent]%/[weapondamage]/[ping]ms"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mo 12.3.2007 10:46:18.000 - Creation time: Do 14.8.2014 09:58:55.625 - Created with UnCodeX