//=============================================================================
// Bartender.
//=============================================================================
class RPGNurseSell 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;
		}
	}

	Player = _MMRPGPlayer(Frobber);
	talkto = Player;
		LookAtActor(Frobber, True, True, False);


	if (Player.medpack == 1)
	{
		Player.ReceiveMessage(""$Player.PlayerReplicationInfo.PlayerName$": What's going on here then?");
		Player.medpack = 2;
		talked = 1;
		SetTimer(2.3,False);
		return;
	}
		
	else if (Player.medpack == 2)
	{
		talked = 2;
		Player.ReceiveMessage(""$Player.PlayerReplicationInfo.PlayerName$": A medpack, shoot.");
		SetTimer(2.0,False);
		return;
	}

	else
	{
		Player.Medpack = 1;
		return;
	}
}

function Timer()
{
	local vector loc;
	local Medpack SpawnObject;
	local MMRPGCreditCard Cred;

	if (talked == 1)
	{
		talkto.ReceiveMessage("NURSE: I'm selling |p2medpacks |p1for 20c.");
		talked = 0;
		return;
	}

	else if (talked == 2)
	{
		Cred = talkto.CreditCard;

		if (Cred.CreditAmount >= 20)
		{
			Cred.CreditAmount -=20;
			talkto.ReceiveMessage("NURSE: 20 credits please.");
			loc = Self.Location;
			loc.Z += Self.BaseEyeHeight;
			loc.X += 40;
			SpawnObject = Spawn(class'MedPack',,, loc, (Self.ViewRotation) * 64);
			SpawnObject.RespawnTime = 0.0;	
			talked = 0;
		}

		else
		{
			talkto.ReceiveMessage("NURSE: You have to pay me ya know?");
			talked = 0;
		}
	}		
}

defaultproperties
{
     bfearAlarm=False
     bFearCarcass=False
     bFearDistress=False
     bFearShot=False
     bFearIndirectInjury=False
     Orders=Sitting
     bInvincible=True
     bHateShot=False
     bHateInjury=False
     bReactPresence=False
     bEmitDistress=False
     CarcassType=Class'DeusEx.ScientistFemaleCarcass'
     WalkingSpeed=0.320000
     BaseAssHeight=-18.000000
     walkAnimMult=0.650000
     bIsFemale=True
     GroundSpeed=120.000000
     BaseEyeHeight=38.000000
     Mesh=LodMesh'DeusExCharacters.GFM_Trench'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
     MultiSkins(1)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.ScientistFemaleTex3'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex3'
     MultiSkins(5)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
     MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
     MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
     CollisionRadius=20.000000
     CollisionHeight=43.000000
     BindName="ScientistFemale"
     FamiliarName="Scientist"
     UnfamiliarName="Scientist"
}
