class FurniTools extends Computers;

function frob(actor f, inventory fw)
{
	if(deusexplayer(f) == curfrobber)
	{
		Super(DeusExDecoration).Frob(f, fw);
	}

	else
	{
		Super.Frob(f,fw);
	}
}


state On
{
	function Tick(float deltaTime)
	{
		Global.Tick(deltaTime);

		if (bOn)
		{
			if ((termwindow == None) && (Level.NetMode == NM_Standalone))
			{
				GotoState('Off');
			} 
           
			if (curFrobber == None)
			{
				GotoState('Off');
			}
			else if (VSize(curFrobber.Location - Location) > 1500)
			{
				log("Disabling computer "$Self$" because user "$curFrobber$" was too far away");
				//Probably should be "GotoState('Off')" instead, but no good way to test, so I'll leave it alone.
				curFrobber = None;
			}
		}
	}

	function Timer()
	{
		if(TimerCount == 1)
		{
			curFrobber.ClientMessage("|p2Bank Loading... 5");
			TimerCount = 2;
			SetTimer(1.1, False);
			return;
		}
		if(TimerCount == 2)
		{
			curFrobber.ClientMessage("|p2Bank Loading... 4");
			TimerCount = 3;
			SetTimer(1.1, False);
			return;
		}
		if(TimerCount == 3)
		{
			curFrobber.ClientMessage("|p2Bank Loading... 3");
			TimerCount = 4;
			SetTimer(1.1, False);
			return;
		}
		if(TimerCount == 4)
		{
			curFrobber.ClientMessage("|p2Bank Loading... 2");
			TimerCount = 5;
			SetTimer(1.1, False);
			return;
		}
		if(TimerCount == 5)
		{
			curFrobber.ClientMessage("|p2Bank Loading... 1");
			TimerCount = 6;
			SetTimer(1.1, False);
			return;
		}
		if(TimerCount == 6)
		{
			//TryInvoke();
			termwindow.ShowScreen(Class'Contender.MMRPGATMScreen');
		}
	}

Begin:
	if (!bOn)
	{
		_MMRPGPlayer(curFrobber).UpdFurni();
		AdditionalActivation(curFrobber);
		bAnimating = True;
		//TimerCount = 1;
		bOn = True;
		bAnimating = False;
		ChangePlayerVisibility(False);
		TryInvoke();
//		SetTimer(0.3, False);
	}
}


function bool cangetitem(inventory inv, _MMRPGPlayer P)
{
	if (P.HandleItemPickup(inv, True) == True)
	{
		return true;
	}
	else return false;
}


defaultproperties
{
    CompInUseMsg="These tools are already being used by %s."
    terminalType=Class'FurniTerminal'
    lockoutDelay=60.00
    Mesh=LodMesh'DeusExDeco.ATM'
    ItemName="Craftsman's Tools"
    SoundRadius=8
    Physics=PHYS_None
    CollisionRadius=36.00
    CollisionHeight=40.00
    BindName="ComputerPersonal"
}

