class bed2 extends DeusExDecoration;

var _MMRPGPlayer Player;
var bool bBusy;

#exec obj load file=..\Textures\CoreTexTextile.utx package=CoreTexTextile
#exec obj load file=..\Textures\CoreTexWood.utx package=CoreTexWood
#exec obj load file=..\Textures\CoreTexPaper.utx package=CoreTexPaper

function PostPostBeginPlay()
{
	Super.PostPostBeginPlay();
	bMovable = False;
}

Function Frob(Actor Frobber, Inventory Frobwith)
{
	if(bBusy)
	{
		DeusExPlayer(Frobber).ClientMessage("This bed is in use!");
		return;
	}

	if(!bBusy)
	{
		if(_MMRPGPlayer(Frobber) != None)
		{
			bBusy = True;
			Player = _MMRPGPlayer(Frobber);
			Player.bInConv = True;
			Player.IncreaseClientFlashLength(15);
			Player.ClientFlash(4, vect(0,200,1000));
			SetTimer(15,False);
		}
	}
}

function Timer()
{
	Player.bInConv = False;
	Player.ClientMessage("You have rested!");
	player.HealPlayer(9999, True);
	bBusy = False;
}


defaultproperties
{
     bPushable=False
     ItemName="Bed"
     bInvincible=True
     DrawScale=1.000000
     Physics=PHYS_None
     Mesh=Mesh'ContenderStuff.bedsmall'
  CollisionRadius=60.00000
  CollisionHeight=24.00000
  MultiSkins(0)=Texture'CoreTexTextile.Textile.ClenBlueGrey_A'
  MultiSkins(1)=Texture'CoreTexWood.Wood.ClenMedmWalnt_A'
  MultiSkins(2)=Texture'CoreTexPaper.Paper.ClenWhitPaint_A'
     bCanBeBase=True
}
