//=============================================================================
// UBersDefault.
//=============================================================================
class UBersDefault expands Mutator config(User);

var() config bool bOpaqueCounters;
var() config bool bCountersCustomColor;
var() config color CustomCountersColor;

function PostBeginplay()
{
	SetTimer(0.1, True);

	if (Level.Game.IsA('DeathMatchPlus') && !Level.Game.IsA('TeamGamePlus'))
			Level.Game.HUDType = Class'X_DM_HUD';
		else if (Level.Game.IsA('Assault'))
			Level.Game.HUDType = Class'X_AS_HUD';
		else if (Level.Game.IsA('CTFGame'))
			Level.Game.HUDType = Class'X_CTF_HUD';
		else if (Level.Game.IsA('Domination'))
			Level.Game.HUDType = Class'X_DOM_HUD';
		else if (Level.Game.IsA('TeamGamePlus') && !Level.Game.IsA('Assault') 
	&& !Level.Game.IsA('CTFGame') && !Level.Game.IsA('Domination'))
			Level.Game.HUDType = Class'X_TDM_HUD';
}

function Timer()
{
	local Pawn P;
	local Weapon newWeapon;

	For ( P=Level.PawnList; P!=None; P=P.nextPawn )
	{
	
	if (Level.Game.IsA('DeathMatchPlus'))
		{

		If (PlayerPawn(P) != None)
		{
		if ( PlayerPawn(P).IsA('Spectator') || PlayerPawn(P).Health <= 0 ||
		(DeathMatchPlus(Level.Game).bRequireReady && (DeathMatchPlus(Level.Game).CountDown > 0)) )
		return;

		}

		newWeapon = None;

		if (Level.Game.DefaultWeapon == Class'ImpactHammer' && P.FindInventoryType(Class'ImpactHammer') != None && !P.IsA('Bot'))
		{
			newWeapon = Weapon(P.FindInventoryType(Class'ImpactHammer'));
			newWeapon.Destroy();
			newWeapon = None;
			newWeapon = Spawn(Class'UBersImpactHammer');
		
		if (newWeapon != None)
		{
			newWeapon.bTossedOut = false;
			newWeapon.Instigator = P;
			newWeapon.RespawnTime = 0.0;
			newWeapon.bHeldItem = true;
			newWeapon.BecomeItem();
			P.AddInventory(newWeapon);
			newWeapon.GiveAmmo(P);
			newWeapon.SetSwitchPriority(P);
			newWeapon.WeaponSet(P);
		}

		}

		newWeapon = None;

		if (P.FindInventoryType(Class'Translocator') != None && !P.IsA('Bot'))
		{
			newWeapon = Weapon(P.FindInventoryType(Class'Translocator'));
			newWeapon.Destroy();
			newWeapon = None;
			newWeapon = Spawn(Class'UBersTranslocator');
		
		if (newWeapon != None)
		{
			newWeapon.bTossedOut = false;
			newWeapon.Instigator = P;
			newWeapon.RespawnTime = 0.0;
			newWeapon.bHeldItem = true;
			newWeapon.BecomeItem();
			P.AddInventory(newWeapon);
			newWeapon.GiveAmmo(P);
			newWeapon.SetSwitchPriority(P);
			newWeapon.WeaponSet(P);
		}

		}

		newWeapon = None;

		if (P.FindInventoryType(Class'ChainSaw') != None && !P.IsA('Bot'))
		{
			newWeapon = Weapon(P.FindInventoryType(Class'ChainSaw'));
			newWeapon.Destroy();
			newWeapon = None;
			newWeapon = Spawn(Class'BersChainSaw');
		
		if (newWeapon != None)
		{
			newWeapon.bTossedOut = false;
			newWeapon.Instigator = P;
			newWeapon.RespawnTime = 0.0;
			newWeapon.bHeldItem = true;
			newWeapon.BecomeItem();
			P.AddInventory(newWeapon);
			newWeapon.GiveAmmo(P);
			newWeapon.SetSwitchPriority(P);
			newWeapon.WeaponSet(P);
		}

		}

		newWeapon = None;
		
		if (P.FindInventoryType(Class'Enforcer') != None)
		{
			newWeapon = Weapon(P.FindInventoryType(Class'Enforcer'));
			newWeapon.Destroy();
			newWeapon = None;
			newWeapon = Spawn(Class'UBersEnforcer');
		
		if (newWeapon != None)
		{
			newWeapon.bTossedOut = false;
			newWeapon.Instigator = P;
			newWeapon.RespawnTime = 0.0;
			newWeapon.bHeldItem = true;
			newWeapon.BecomeItem();
			P.AddInventory(newWeapon);
			newWeapon.GiveAmmo(P);
			newWeapon.SetSwitchPriority(P);
			newWeapon.WeaponSet(P);
		}

		}
	}
	}
}

defaultproperties
{
	CustomCountersColor=(R=255,G=255,B=255)
}