//=============================================================================
// KingOfTheHill.
//=============================================================================
class KingOfTheHill expands DeathMatchGame;

var pawn king;

function Killed(pawn killer, pawn Other, name damageType)
{
	if ( (king == None) || (king == Other) )
	{
		Other.DamageScaling = 1.0;
		CrownNewKing(killer);
	}
		
	Other.bSpecialLit = false;		
	CallParent.Killed(killer, Other, damageType);
}

function CrownNewKing(pawn newKing)
{
	local Inventory Inv;
	
	BroadcastMessage(newKing.PlayerName$" is the new king of the hill!");
	NewKing.health = Max(NewKing.Health, 200);
	NewKing.bSpecialLit = true; 
	NewKing.Score += 5.0;
	NewKing.DamageScaling = 2.0;
	for( Inv=newKing.Inventory; Inv!=None; Inv=Inv.Inventory )
		if( Ammo(Inv) != None )
			Ammo(Inv).AmmoAmount = Ammo(Inv).MaxAmmo;
}

