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

XGame.ChallengeGame


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
//==============================================================================
// Single Player Challenge Game code - base class
//
// Written by Michiel Hendriks
// (c) 2003, Epic Games, Inc. All Rights Reserved
//==============================================================================

class ChallengeGame extends Object abstract;

/** name of this challenge */
var localized string ChallengeName;
/** description of the challenge */
var localized string ChallengeDescription;
var localized string msgGotChallenged, msgWeChallenged, msgFor;

/** the challenge configuration menu */
var string ChallengeMenu;

struct TriString
{
    var string GUIPage;
    var string Param1, Param2;
};

/** called from GameProfile.RegisterGame() before anything is processed */
static function PreRegisterGame(UT2K4GameProfile GP, GameInfo currentGame, PlayerReplicationInfo PRI)
{
}

/** called from GameProfile.RegisterGame() after everything is processed */
static function PostRegisterGame(UT2K4GameProfile GP, GameInfo currentGame, PlayerReplicationInfo PRI)
{
}

/** start this challenge */
static function StartChallenge(UT2K4GameProfile GP, LevelInfo myLevel)
{
    GP.SpecialEvent = "";
    GP.bIsChallenge = true;
    GP.Balance -= GP.ChallengeInfo.EntryFee;
    GP.ChallengeGameClass = default.class;
    GP.StartNewMatch ( -1, myLevel );
}

/**
    called when the game was a challenge game and was not one of the default special events.
    Fill the GUIPages array with pages you want to be opened after this special event has been processed.
    Yes I know this method sucks, but it was the best I could come up with without a lot of changes in the current system.
*/
static function HandleSpecialEvent(UT2K4GameProfile GP, array<string> SpecialEvent, out array<TriString> GUIPages)
{
}

/** Handle match requirements, return false if a requirement has not been met */
static function bool HandleRequirements(UT2K4GameProfile GP, array<string> SpecialEvent, out array<TriString> GUIPages)
{
    return true;
}

/**
    will be called after the default info has been added to the history record.
    override this to change or append additional into.
*/
static function AddHistoryRecord(UT2K4GameProfile GP, int offset, GameInfo Game, PlayerReplicationInfo PRI, UT2K4MatchInfo MI)
{
    if (GP.bGotChallenged) GP.FightHistory[offset].MatchExtra = default.msgGotChallenged;
    else GP.FightHistory[offset].MatchExtra = default.msgWeChallenged;
    if (GP.ChallengeVariable != "") GP.FightHistory[offset].MatchExtra @= default.msgFor@GP.ChallengeVariable;
}

/**
    Return true when this challenge game can be used to challenge the player
*/
static function bool canChallenge(optional UT2K4GameProfile GP)
{
    return true;
}

/** return true when the team mates should be payed */
static function bool payTeamMates(UT2K4GameProfile GP)
{
    return true;
}

/**
    Return true when a team mate _may_ be injured, this does not mean a team mate will be injured.
    By default only challenged that where initiated by the player may have a team mate injured.
 */
static function bool injureTeamMate(UT2K4GameProfile GP)
{
    return !GP.bGotChallenged;
}

defaultproperties
{
     msgGotChallenged="We got challenged"
     msgWeChallenged="We challenged"
     msgFor="for"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:44.000 - Creation time: Mo 16.4.2007 11:20:45.281 - Created with UnCodeX