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

UnrealI.KingOfTheHill


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
//=============================================================================
// KingOfTheHill.
//=============================================================================
class KingOfTheHill extends DeathMatchGame;

var pawn king;
var localized string KingMessage;

function Killed(pawn killer, pawn Other, name damageType)
{
	Other.AmbientGlow = 0;
	Other.LightType = LT_None;
	Other.DamageScaling = 1.0;
	Other.bUnLit = false;

	if ( (King == Other) || (King == None) )
	{
		if ( (killer == None) || (killer == Other)
				|| (killer.Health <= 0) )
		{
			if ( (killer == King) && (King == Other) )
				King.PlayerReplicationInfo.Score -= 4;
			King = None;
		}
		else if ( killer != king )
			CrownNewKing(killer);
	}

	Super.Killed(killer, Other, damageType);
}

function CrownNewKing(pawn newKing)
{
	King = newKing;
	BroadcastMessage(newKing.PlayerReplicationInfo.PlayerName$KingMessage, true);
	NewKing.health = Max(NewKing.Health, 100);
	NewKing.bUnLit = true;
	NewKing.PlayerReplicationInfo.Score += 5.0;
	NewKing.DamageScaling = 2.0;
	NewKing.LightEffect=LE_NonIncidence;
	NewKing.LightBrightness=255;
	NewKing.LightHue=0;
	NewKing.LightRadius=10;
	NewKing.LightSaturation=0;
	NewKing.AmbientGlow = 200;
	NewKing.bUnlit = true;
	NewKing.LightType=LT_Steady;
}

defaultproperties
{
				KingMessage=" is the new king of the hill!"
				BeaconName="King"
				GameName="King of the Hill"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:30.000 - Creation time: zo 11-11-2012 21:14:19.006 - Created with UnCodeX