//=============================================================================
// WeaponLAM.
//=============================================================================
class MissionBomb extends WeaponLAM;

var int x;

simulated function bool TestMPBeltSpot(int BeltSpot)
{
   return ( (BeltSpot >= 1) && (BeltSpot <=9) );
}

function DropFrom(vector StartLocation)
{
	if(_MMRPGPlayer(Owner).Contmission == 2)
	{
		Pawn(Owner).ClientMessage("|p2You don't want to drop this!");
		return;
	}
	Super.DropFrom(StartLocation);
	LifeSpan = 5.0;
}


function BecomeItem()
{
	Super.BecomeItem();
	LifeSpan = 0.0;
}


simulated function bool ClientFire( float value )
{
	if (Pawn(Owner) != None)
	{
		if (!NearWallCheck())
		{
			Pawn(Owner).ClientMessage("|p2This must be placed on a wall");
			return False;
		}
		if (NearWallCheck())
		{
			if(Pawn(Owner).Region.Zone.IsA('ZoneLeetApt'))
			{
				Pawn(Owner).ClientMessage("|p2Now get out through the back door!");
				return Super.ClientFire(value);
			}
		}
	}
}


Function Tick(Float DeltaTime)
{
	local RPGSmug RS;

	Super.Tick(DeltaTime);

	if(DeusExPlayer(Owner) != None)
	{
		if(DeusExPlayer(Owner).inHand != None)
		{
			if(DeusExPlayer(Owner).inHand == Self)
			{
				x -= 1;
				if(x < 1)
				{
					ForEach VisibleActors(class'RPGSmug', RS, 256)
					{
						RS.ReactToInjury(Pawn(Owner), 'Shot', HITLOC_LeftArmFront);
						x = 10;
					}
				}
			}
		}
	}
}

simulated function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
	if (Pawn(Owner) != None)
	{
		if (!NearWallCheck())
		{
			//Pawn(Owner).ClientMessage("|p2This must be placed on a wall");
			return None;
		}
		if (NearWallCheck())
		{
			if(Pawn(Owner).Region.Zone.IsA('ZoneLeetApt'))
			{
				//_MMRPGPlayer(Owner).Contmission = 3;
				return Super.ProjectileFire(ProjClass, ProjSpeed, bWarn);
			}
		}
	}
}


function Fire(float Value)
{
	if (Pawn(Owner) != None)
	{
		if (!NearWallCheck())
		{
			//Pawn(Owner).ClientMessage("|p2This must be placed on a wall");
			return;
		}
		if (NearWallCheck())
		{
			if(Pawn(Owner).Region.Zone.IsA('ZoneLeetApt'))
			{
				//_MMRPGPlayer(Owner).Contmission = 3;
				Super.Fire(Value);
				AmmoType.AmmoAmount=0;
			}
		}
	}

}
Defaultproperties
{
	Reloadcount=1
	AmmoName=Class'Contender.AmmoLamz'
	ItemName="Timed Bomb"
	beltDescription="BOMB"
	ProjectileClass=Class'Contender.Lamm0r'
	PlayerViewMesh=LodMesh'ContenderStuff.C4'
	PickupViewMesh=LodMesh'ContenderStuff.C4_pickup'
	ThirdPersonMesh=LodMesh'ContenderStuff.C4_3rd'
	Icon=Texture'ContenderStuff.Icons.BeltIconMissionBomb'
	LargeIcon=Texture'ContenderStuff.Icons.BeltIconMissionBomb'
}

