//=============================================================================
// Bartender.
//=============================================================================
class RPGBartender extends HumanCivilian;

var _MMRPGPlayer talkto;
var int talked;

function TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType,
                        bool bPlayAnim)
{}

function Frob(Actor Frobber, Inventory frobWith)
{
	local NailageColaBlue Inv;
	local MMRPGCreditCard Cred;
	local _MMRPGPlayer Player;

	If (Frobber.IsA('DeusExPlayer'))
	{
		If(talked != 0)
		{
			_MMRPGPlayer(Frobber).ReceiveMessage("Someone is already talking to this person!");
			return;
		}
	}

//	Super.Frob(Frobber, frobWith);
	Player = _MMRPGPlayer(Frobber);
	talkto = Player;
		LookAtActor(Frobber, True, True, False);

	Player.ReceiveMessage(""$Player.PlayerReplicationInfo.PlayerName$": A beer please");
	talked = 1;
	SetTimer(1.7,False);
}

function Timer()
{
	local vector loc;
	local BeerGuinness SpawnObject;
	local MMRPGCreditCard Cred;
	local BarSpot BS;

	Cred = talkto.Creditcard;

	if (Cred.CreditAmount >= 5)
	{
		foreach allactors(class'BarSpot', BS)
		{
			if(BS.Tag == Tag)
			{
				loc = BS.Location;
			}
		}
		Cred.CreditAmount -=5;
		talkto.ReceiveMessage("BARTENDER: That'll be 5 credits.");
		SpawnObject = Spawn(class'BeerGuinness',,, loc, (Self.ViewRotation) * 64);
		SpawnObject.RespawnTime = 0.0;
		talked = 0;
	}
	else
	{
		talkto.ReceiveMessage("BARTENDER: Talk to me when you've got some money to spend.");
		talked = 0;
	}			
}

defaultproperties
{
     bfearAlarm=False
     bFearCarcass=False
     bFearDistress=False
     bFearShot=False
     bFearIndirectInjury=False
     Orders=Standing
     bInvincible=True
     bHateShot=False
     bHateInjury=False
     bReactPresence=False
     bEmitDistress=False
     CarcassType=Class'DeusEx.Hooker2Carcass'
     WalkingSpeed=0.320000
     BaseAssHeight=-18.000000
     bIsFemale=True
     GroundSpeed=120.000000
     BaseEyeHeight=38.000000
     Mesh=LodMesh'DeusExCharacters.GFM_Dress'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.Hooker2Tex0'
     MultiSkins(1)=Texture'DeusExCharacters.Skins.Hooker2Tex1'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.Hooker2Tex3'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
     MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
     MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
     MultiSkins(7)=Texture'DeusExCharacters.Skins.Hooker2Tex0'
     CollisionRadius=28.000000
     CollisionHeight=43.000000
     BindName="Bartender"
     FamiliarName="Bartender"
     UnfamiliarName="Bartender"
}
