class UTPawn_Zombies extends UTPawn
	dependson(PlayerReplicationInfo);
var int BigFatZero;
var int TeamIndexZombies;
var bool PlayerKilled;
var bool FastZombiesToggle;
var bool RegenZombiesToggle;
var int RegenDelay;


simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	SetTimer(0.03,true);
}

simulated function Timer()
{
	TeamIndexZombies = GetTeamNum();

	if(TeamIndexZombies == 0)
	{
		if(PlayerKilled == true && Health > 0)
		{
			PlayerKilled=false;
			InvManager.CreateInventory(class'UTGame.UTWeap_Enforcer', False);
		}
	}

	if(TeamIndexZombies == 1)
	{		
		if(PlayerKilled == true && Health > 0)
		{
			PlayerKilled=false;
			InvManager.CreateInventory(class'UTGame.UTWeap_Impacthammer', False);
		}

		if (FastZombiesToggle == true )
		{
			GroundSpeed=565;
		}

		bCanPickupInventory = false;

		if(RegenZombiesToggle == true)
		{
			HealthMax=100;
			SuperHealthMax=100;
			VestArmor=0;
			ThighpadArmor=0;
			HelmetArmor=0;

			if(RegenDelay == 0)
			{
			if (!IsInPain() && WorldInfo.TimeSeconds - LastPainSound >= 3 && Health < HealthMax )
			{
				Health = Min( Health + 1, HealthMax );
			}
			if (Health > HealthMax)
			{
				Health=100;
			}
			}

			RegenDelay = RegenDelay + 1;

			if(RegenDelay >= 5)
			{
			RegenDelay=0;
			}


		}
	}

}

simulated function bool Died(Controller Killer, class<DamageType> damageType, vector HitLocation)
{
	if(TeamIndexZombies == 0)
	{
		UTTeamGame(WorldInfo.Game).SetTeam(Controller, UTTeamGame(WorldInfo.Game).Teams[1], true);
		
	}
			PlayerKilled=true;
	if (Super.Died(Killer, DamageType, HitLocation))
	{
		StartFallImpactTime = WorldInfo.TimeSeconds;
		bCanPlayFallingImpacts=true;
		if(ArmsMesh[0] != none)
		{
			ArmsMesh[0].SetHidden(true);
			if(ArmsOverlay[0] != none)
			{
				ArmsOverlay[0].SetHidden(true);
			}
		}
		if(ArmsMesh[1] != none)
		{
			ArmsMesh[1].SetHidden(true);
			if(ArmsOverlay[1] != none)
			{
				ArmsOverlay[1].SetHidden(true);
			}
		}

		SetPawnAmbientSound(None);
		SetWeaponAmbientSound(None);
		return true;
	}
	return false;
}

defaultproperties
{
	BigFatZero=0;
	TeamIndexZombies=0;
	PlayerKilled=true;
	FastZombiesToggle=false;
	RegenZombiesToggle=false;
	RegenDelay=0;
}