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

Betrayal.MutMercuryIGBetrayal


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
00133
00134
00135
/******************************************************************************
MutMercuryIGBetrayal

Creation date: 2011-03-13 14:30
Last change: $Id$
Copyright © 2011, Wormbo
Website: http://www.koehler-homepage.de/Wormbo/
Feel free to reuse this code. Send me a note if you found it helpful or want
to report bugs/provide improvements.
Please ask for permission first, if you intend to make money off reused code.
******************************************************************************/

class MutMercuryIGBetrayal extends Mutator;


//=============================================================================
// Configuration
//=============================================================================

var config float RocketJumpBoost;


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

var localized string RocketJumpBoostText;
var localized string RocketJumpBoostHelpText;


/**
Only works in Betrayal mode.
*/
function bool MutatorIsAllowed()
{
	return !Level.IsDemoBuild() && BetrayalGame(Level.Game) != None;
}


/**
Replace the default Betrayal weapon.
*/
function PostBeginPlay()
{
	local BetrayalMutator BM;

	BM = BetrayalMutator(Level.Game.BaseMutator);
	if (BM != None) {
		BM.WeaponName        = class'BetrayalMercuryLauncher'.Name;
		BM.WeaponString      = string(class'BetrayalMercuryLauncher');
		BM.DefaultWeaponName = string(class'BetrayalMercuryLauncher');
	}

	if (BetrayalGame(Level.Game) != None)
		BetrayalGame(Level.Game).bUnlaggingDisabled = True; // not supported
}


/**
Configures the Mercury Missile Launcher's settings.
*/
function bool AlwaysKeep(Actor Other)
{
	if (BetrayalMercuryLauncher(Other) != None)
		BetrayalMercuryLauncher(Other).RocketJumpBoost = RocketJumpBoost;

	return NextMutator != None && NextMutator.AlwaysKeep(Other);
}


/**
Adds  Mercury Missile config details to the server details.
*/
function GetServerDetails(out GameInfo.ServerResponseLine ServerState)
{
	local int i;

	Super.GetServerDetails(ServerState);

	i = ServerState.ServerInfo.Length;
	ServerState.ServerInfo[i++] = KeyValuePair("Mercury Jump Boost", RocketJumpBoost);
}


static final function GameInfo.KeyValuePair KeyValuePair(string Key, coerce string Value)
{
	local GameInfo.KeyValuePair Pair;

	Pair.Key = Key;
	Pair.Value = Value;

	return Pair;
}


/**
Adds configurable properties to the web admin interface.
*/
static function FillPlayInfo(PlayInfo PlayInfo)
{
	Super.FillPlayInfo(PlayInfo);

	PlayInfo.AddSetting(default.RulesGroup, "RocketJumpBoost", default.RocketJumpBoostText, 0, 0, "Text", "5;0.0:20.0");
}


/**
Returns the description text for a configurable property.
*/
static event string GetDescriptionText(string PropName)
{
	if (PropName == "RocketJumpBoost")
		return default.RocketJumpBoostHelpText;

	return Super.GetDescriptionText(PropName);
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
	FriendlyName = "Betrayal Mercury Missiles"
	Description  = "Replaces the Instagib Rifle in Betrayal with the Instagib Mercury Missile Launcher."
	bAddToServerPackages = True

	RocketJumpBoost = 3.0

	RocketJumpBoostText     = "Rocket jump boost"
	RocketJumpBoostHelpText     = "Higher values make rocket jumps with mercury missiles more efficient. (default: 3.0)"
}


Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: So 13.3.2011 20:03:38.000 - Creation time: Do 14.8.2014 09:58:44.956 - Created with UnCodeX