class MMRPGCredits extends DeusExPickup;

var int CreditNumber;
var string MessageAddCred;
var bool bInUse;

auto state Pickup
{	
	function Frob(Actor Frobber, Inventory frobWith)
	{
	local DeusExPlayer player;
	local MMRPGCreditCard Inv;
	local Inventory SpawnObject;

	if(bInUse)
	{
		return;
	}

	if(!bInUse)
	{
	bInUse = True;

	player=DeusExPlayer(Frobber);

	if(player==None)
		return;

		Player.ClientMessage(MessageAddCred);
		foreach AllActors(class'MMRPGCreditCard', Inv)
		{
			if (Inv.Owner == Player)
			{
				if (Inv.IsA('MMRPGCreditCard'))
				{
					foreach AllActors(class'MMRPGCreditCard', Inv)
					{
						if (Inv.Owner == player)
						{
							Inv.CreditAmount+=CreditNumber;
						}
					}
				}
			}
		}




if (Level.NetMode != NM_Standalone)
	SetRespawn();
else			
	SetRespawn();
}
}
}


State Sleeping
{
	ignores Touch;

	function BeginState()
	{
		BecomePickup();
		bHidden = true;
	}
	function EndState()
	{
		local int i;

		bSleepTouch = false;
		for ( i=0; i<4; i++ )
			if ( (Touching[i] != None) && Touching[i].IsA('Pawn') )
				bSleepTouch = true;
	}			
Begin:
	Sleep( ReSpawnTime );
	PlaySound( RespawnSound );	
	Sleep( Level.Game.PlaySpawnEffect(self) );
	bInUse = False;
	GoToState( 'Pickup' );
}



function bool HandlePickupQuery( inventory Item )
{
	return False;
}

simulated function bool TestMPBeltSpot(int BeltSpot)
{
	return (BeltSpot >= 0);
}

defaultproperties
{
     bInUse=False
     CreditNumber=1
     ItemName="1 Credit"
     MessageAddCred="1 credit added to your account"
     ItemArticle="a"
     PlayerViewOffset=(X=30.000000,Z=-12.000000)
     PlayerViewMesh=LodMesh'DeusExItems.Credits'
     PickupViewMesh=LodMesh'DeusExItems.Credits'
     ThirdPersonMesh=LodMesh'DeusExItems.Credits'
     LandSound=Sound'DeusExSounds.Generic.PlasticHit1'
     Icon=Texture'DeusExUI.Icons.BeltIconCredits'
     beltDescription="CREDITS"
     Mesh=LodMesh'DeusExItems.Credits'
     CollisionRadius=7.000000
     CollisionHeight=0.550000
     Mass=2.000000
     Buoyancy=3.000000
}
