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

UnrealGame.MutBigHead


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
class MutBigHead extends Mutator;

function PostBeginPlay()
{
	local BigHeadRules G;
	
	Super.PostBeginPlay();
	G = spawn(class'BigHeadRules');
	G.BigHeadMutator = self;
	if ( Level.Game.GameRulesModifiers == None )
		Level.Game.GameRulesModifiers = G;
	else    
		Level.Game.GameRulesModifiers.AddGameRules(G);
}	
	
function float GetHeadScaleFor(Pawn P)
{
	local float NewScale;
	
	if ( abs(P.PlayerReplicationInfo.Deaths) < 1 )
		NewScale = P.PlayerReplicationInfo.Score + 1;
	else
		NewScale = (P.PlayerReplicationInfo.Score+1)/(P.PlayerReplicationInfo.Deaths+1);
	return FClamp(NewScale, 0.5, 4.0);	
}

function ModifyPlayer(Pawn Other)
{
	Other.SetHeadScale(GetHeadScaleFor(Other));

	if ( NextMutator != None )
		NextMutator.ModifyPlayer(Other);
}

defaultproperties
{
     GroupName="BigHead"
     FriendlyName="BigHead"
     Description="Head size depends on how well you are doing."
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:50.000 - Creation time: sk 18-3-2018 09:50:13.849 - Created with UnCodeX