//=============================================================================
// KillsRules.
//=============================================================================
class KillsRules extends GameRules;

function PostBeginPlay()
{
	NextGameRules = Level.Game.GameRulesModifiers;
	Level.Game.GameRulesModifiers = Self;
}

function ScoreKill(Controller Killer, Controller Killed)
{
	local Controller C;

	if( Class'MutKillMessage'.Default.bMessageKills && Killer.PlayerReplicationInfo!=None
	 && Killer.Pawn!=None && Monster(Killer.Pawn)==None && Monster(Killed.Pawn)!=None )
	{
		if( Class'MutKillMessage'.Default.MessageHealthLimit<=Killed.Pawn.Default.Health ||
			Class'MutKillMessage'.Default.MessageMassLimit<=Killed.Pawn.Default.Mass )
		{
			for( C=Level.ControllerList; C!=None; C=C.nextController )
				if( C.bIsPlayer && xPlayer(C)!=None )
					xPlayer(C).ReceiveLocalizedMessage(Class'NKillsMessage',1,Killer.PlayerReplicationInfo,,Killed.Pawn.Class);
		}
		else if( xPlayer(Killer)!=None )
			xPlayer(Killer).ReceiveLocalizedMessage(Class'NKillsMessage',,,,Killed.Pawn.Class);
	}
	Super.ScoreKill(Killer,Killed);
}

function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
	if ( NextGameRules != None )
		Damage = NextGameRules.NetDamage(OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType);
	if( Class'MutKillMessage'.Default.bMessageDamage && Damage>0 && Monster(injured)!=None && instigatedBy!=None && Monster(instigatedBy)==None
	 && xPlayer(instigatedBy.Controller)!=None )
		xPlayer(instigatedBy.Controller).ReceiveLocalizedMessage(Class'DamageMessage',Damage,,,injured.Class);
	return Damage;
}

defaultproperties
{
}
