Mostly Harmless

UE3:UTM UTStyle(UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Introduction[edit]

Code[edit]

UT3 Info >> GameRules >> UTM_UTStyle (custom)
Package: 
UT_GDP_Newtators

Script[edit]

//===================================================
//	Class: UTM_UTStyle
//	Creation date: 13/09/2009 03:29
//	Last updated: 11/04/2010 08:55
//	Contributors: 00zX
//---------------------------------------------------
//Placeholder to cut down the number of UTM_ classes
//until they are fully depreciated.
//---------------------------------------------------
//	Attribution-Noncommercial-Share Alike 3.0 Unported
//	http://creativecommons.org/licenses/by-nc-sa/3.0/
//===================================================
class UTM_UTStyle extends UT_MDB_GameExp
	config(GDP_Newtators);
 
var config bool		bHardcore,
					bDualEnforcers,
					bNoDoubleJump,
					bNoWallDodge,
					bNoHelmet,
					bNoShieldDrops;
 
function InitMutator(string Options, out string ErrorMessage)
{
	local UT_MDB_GameRules.ActorInfo tInfo;
	local UT_MDB_GameRules GR;
 
	if(bHardcore)
	{
		GR = UpdateGameRules(class'UT_MDB_GR_GlobalDamage');
		UT_MDB_GR_GlobalDamage(GR).ImpartedDmgScale = 1.25;
	}
 
	//FIXME: h4x!
	if(bDualEnforcers)
	{
		tInfo.bSpawnForSubClasses = false;
		tInfo.AttachedToActor = 'UTWeap_Enforcer';
		tInfo.AttachedInfo = class'UT_GameDex.UT_MDI_W_EnforcerDual';
 
		GR = UpdateGameRules(class'UT_MDB_GameRules');
		GR.InfoAttachments.Additem(tInfo);
	}
 
	if(bNoDoubleJump)
	{
		//TODO: Add Single Jump Boots
		AddGroupName("JUMPING");
 
		if(PClass != class'UT_GameDex.UTOnePawn')
			PClass = class'UT_GameDex.UTOnePawn';
	}
 
	if(bNoWallDodge)
	{
		AddGroupName("JUMPING");
 
		if(PClass != class'UT_GameDex.UTOnePawn')
			PClass=class'UT_GameDex.UTOnePawn';
	}
 
	if(bNoHelmet)
	{
		AddGroupName("POWERUPS");
	}
 
	if(bNoShieldDrops)
		GR = UpdateGameRules(class'UT_MDB_GR_NoShieldDrop');
}
 
function GetServerDetails(out GameInfo.ServerResponseLine ServerState)
{
	local int i;
 
	i = ServerState.ServerInfo.Length;
 
	ServerState.ServerInfo.Length = i+1;
	ServerState.ServerInfo[i].Key = "UT Style";
	ServerState.ServerInfo[i++].Value = "v1.0";
 
	if(bHardcore && bDualEnforcers && bNoDoubleJump && bNoWallDodge && bNoHelmet && bNoShieldDrops)
	{
		ServerState.ServerInfo.Length = i+1;
		ServerState.ServerInfo[i].Key = "Hardcore";
		ServerState.ServerInfo[i++].Value = "classic!";
	}
	else
	{
		if(bHardcore)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "Hardcore";
			ServerState.ServerInfo[i++].Value = string(1.25)$"x";
			//ServerState.ServerInfo[i++].Value = string(bHardcore);
		}
 
		if(bDualEnforcers)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "Dual Enforcers";
			ServerState.ServerInfo[i++].Value = string(bDualEnforcers);
		}
 
		if(bNoDoubleJump)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "No Double-Jump";
			ServerState.ServerInfo[i++].Value = string(bNoDoubleJump);
		}
 
		if(bNoWallDodge)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "No Wall-Dodge";
			ServerState.ServerInfo[i++].Value = string(bNoWallDodge);
		}
 
		if(bNoHelmet)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "No Helmet";
			ServerState.ServerInfo[i++].Value = string(bNoHelmet);
		}
 
		if(bNoShieldDrops)
		{
			ServerState.ServerInfo.Length = i+1;
			ServerState.ServerInfo[i].Key = "Hardcore";
			ServerState.ServerInfo[i++].Value = string(bHardcore);
		}
	}
}
 
defaultproperties
{
	bHardcore=True
	bDualEnforcers=True
	bNoDoubleJump=True
	bNoWallDodge=True
	bNoHelmet=True
 
/*	Begin Object Class=UT_MDB_GR_UTOne Name=UT_MDB_GR_UTOne0
	End Object
	GameRules=UT_MDB_GR_UTOne0*/
 
//	ItemsToReplace(0)=(OldClassName="UTJumpBoots",NewInvType=class'UT_GameDex.UTSingleJumpBoots')
 
/*	Begin Object Class=UT_MDB_ItemReplacer Name=UT_MDB_FactoryReplacer0
		FactoriesSet[0]=(FactoryGroup=FT_Powerup,ReplacedFactory='',ReplacedWithFactory='',ReplacedWithFactoryPath="UT_GDP_Newtators.UTSingleJumpBoots")
	End Object
	FD=UT_MDB_FactoryReplacer0*/
}