//=============================================================================
// Male2.
//=============================================================================
class RPGTalkCop extends HumanCivilian;


var int talked;
var _MMRPGPlayer talkto;

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


function Frob(Actor Frobber, Inventory frobWith)
{
	local _MMRPGPlayer Player;
	local Medkit med;

	If (Frobber.IsA('DeusExPlayer'))
	{
		If(talked != 0)
		{
			if(DeusExPlayer(Frobber) == talkto)
				return;

			_MMRPGPlayer(Frobber).ReceiveMessage("Someone is already talking to this person!");
			return;
		}
	}

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

	Player.bInConv = True;
		LookAtActor(Frobber, True, True, False);
	
	if (player.paxxmission == 1)
	{
		Player.ReceiveMessage("COP: Hey buddy, over here.");
		talked = 1;
		SetTimer(2.4,False);
		return;
	}

	else if ((player.paxxmission == 2)||(player.paxxmission == 3))
	{
		Player.ReceiveMessage("COP: Hurry! To the apartment above the clothes shop!");
		talked = 8;
		SetTimer(2.4,False);
		return;
	}
	else if (player.paxxmission == 4)
	{
		Player.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": I nailed 'em good.");
		talked = 10;
		SetTimer(2.4,False);
		return;
	}
	else if (player.paxxmission == 5)
	{
		Player.ReceiveMessage("COP: Yeah...");
		talked = 0;
		Player.bInConv = False;
		return;
	}
}

function Timer()
{
	local MMRPGCreditCard Cred;
	local Keydummy hmm2;
	local RPGSpawn Spawnobject;

	if (talked == 1)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Yeah?");
		talked = 2;
		SetTimer(2.0,False);
		return;
	}

	else if (talked == 2)
	{
		talkto.ReceiveMessage("COP: I shouldn't be bringing civilians into this, but you look like you're good with guns...");
		talked = 3;
		SetTimer(4.5,False);
		return;
	}

	else if (talked == 3)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": I'm listening...");
		talked = 4;
		SetTimer(3.8,False);
		return;
	}
	else if (talked == 4)
	{
		talkto.ReceiveMessage("COP: Anyway, we have a hostage situation in an apartment above the clothes shop");
		talked = 5;
		SetTimer(3.4,False);
		return;
	}
	else if (talked == 5)
	{
		talkto.ReceiveMessage("COP: And we're waiting for reinforcements, so in the meantime, get to work...");
		talked = 6;
		SetTimer(3.9,False);
		return;
	}
	else if (talked == 6)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": So what do I get if I wax these thugs?");
		talked = 7;
		SetTimer(3.4,False);
		return;
	}
	else if (talked == 7)
	{
		talkto.ReceiveMessage("COP: Well as a cop, I do have some certain items that you might be interested in...");
		talked = 0;
		talkto.bInConv = False;
		talkto.paxxmission = 2;
		talkto.ClientMessage("Goal Received (Press F2 for details)");
		return;
	}

//=======================

	else if (talked == 8)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Okay okay, easy now.");
		talked = 0;
		talkto.bInConv = False;
		return;
	}

//========================

	else if (talked == 10)
	{
		talkto.ReceiveMessage("COP: Yeah I heard.");
		talked = 11;
		SetTimer(2.9,False);
		return;
	}
	else if (talked == 11)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": I trust you haven't forgotten about your half of the agreement?");
		talked = 12;
		SetTimer(3.9,False);
		return;
	}
	else if (talked == 12)
	{
		foreach AllActors(class'KeyDummy', hmm2)
		{
				if (talkto.HandleItemPickup(hmm2, True) == False)
				{
					talkto.ReceiveMessage("COP: Make some room for a weapon.");
					talked = 0;
					talkto.bInConv = False;
					return;
				}
		}
				

		foreach AllActors(class'KeyDummy', hmm2)
		{
				if (talkto.HandleItemPickup(hmm2, True) == True)
				{
					talkto.ReceiveMessage("COP: Ah yes, here you go.");
					talkto.SpawnItemz(Class'Taser');
					talkto.paxxmission = 5;
					talkto.ClientMessage("Goal Completed");
					talkto.SkillPointsAdd(2000);
					talkto.ClientMessage("|p2Goal Completed! 2000 Skill Points and a Taser awarded!");
					talkto.bInConv = False;
					talked = 0;
					return;
				}
		}
	}
}


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.Male2Carcass'
     WalkingSpeed=0.296000
     walkAnimMult=0.780000
     GroundSpeed=200.000000
     Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.CopTex0'
     MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.CopTex0'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.CopTex2'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.CopTex0'
     MultiSkins(5)=Texture'DeusExCharacters.Skins.CopTex1'
     MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
     MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
     CollisionRadius=20.000000
     CollisionHeight=47.500000
     BindName="Cop"
     FamiliarName="Cop"
     UnfamiliarName="Cop"
}
