示例#1
0
CBotFollowLastEnemy::CBotFollowLastEnemy(CBot *pBot, edict_t *pEnemy, Vector vLastSee)
{
	Vector vVelocity = Vector(0, 0, 0);
	CClient *pClient = CClients::Get(pEnemy);

	CFindPathTask *pFindPath = new CFindPathTask(vLastSee, LOOK_LAST_ENEMY);

	if (CClassInterface::GetVelocity(pEnemy, &vVelocity))
	{
		if (pClient && (vVelocity == Vector(0, 0, 0)))
			vVelocity = pClient->GetVelocity();
	}
	else if (pClient)
		vVelocity = pClient->GetVelocity();

	pFindPath->SetCompleteInterrupt(CONDITION_SEE_CUR_ENEMY);

	AddTask(pFindPath);

	/*if ( pBot->isTF2() )
	{
	int playerclass = ((CBotTF2*)pBot)->getClass();

	if ( ( playerclass == TF_CLASS_SOLDIER ) || (playerclass == TF_CLASS_DEMOMAN) )
	AddTask(new CBotTF2ShootLastEnemyPosition(vLastSee,pEnemy,vVelocity));
	}*/

	AddTask(new CFindLastEnemy(vLastSee, vVelocity));

	//////////////
	pFindPath->SetNoInterruptions();
}
示例#2
0
CBotTF2HealSched::CBotTF2HealSched(edict_t *pHeal)
{
	CFindPathTask *findpath = new CFindPathTask(pHeal);
	findpath->SetCompleteInterrupt(CONDITION_SEE_HEAL);
	AddTask(findpath);
	AddTask(new CBotTF2MedicHeal());
}