示例#1
0
CBotTFEngiBuild :: CBotTFEngiBuild ( CBot *pBot, eEngiBuild iObject, CWaypoint *pWaypoint )
{
	CFindPathTask *pathtask = new CFindPathTask(CWaypoints::getWaypointIndex(pWaypoint));
	addTask(pathtask); // first

	pathtask->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot));

	addTask(new CBotTFEngiBuildTask(iObject,pWaypoint)); // second
}
示例#2
0
CBotUseDispSched :: CBotUseDispSched ( CBot *pBot, edict_t *pDisp )//, bool bNest )
{
	CFindPathTask *pathtask = new CFindPathTask(pDisp);
	CBotTF2WaitHealthTask *gethealth = new CBotTF2WaitHealthTask(CBotGlobals::entityOrigin(pDisp));
	addTask(pathtask);
	pathtask->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot));

	addTask(gethealth); // second
	gethealth->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot));

	//if ( bNest )
	//	addTask(new CBotNest()); // third
}
示例#3
0
CGotoHideSpotSched :: CGotoHideSpotSched (CBot *pBot, Vector vOrigin, IBotTaskInterrupt *interrupt )
{
	// run at flank while shooting	
	CFindPathTask *pHideGoalPoint = new CFindPathTask();
	
	pBot->setCoverFrom(NULL);
	addTask(new CFindGoodHideSpot(vOrigin));
	addTask(pHideGoalPoint);

	// no interrupts, should be a quick waypoint path anyway
	pHideGoalPoint->setNoInterruptions();
	pHideGoalPoint->setInterruptFunction(interrupt);
	// get vector from good hide spot task
	pHideGoalPoint->getPassedVector();
}
示例#4
0
CBotTFEngiUpgrade :: CBotTFEngiUpgrade ( CBot *pBot, edict_t *pBuilding )
{
	CFindPathTask *pathtask = new CFindPathTask(pBuilding);

	addTask(pathtask);

	pathtask->completeInRangeFromEdict();
	pathtask->failIfTaskEdictDead();
	pathtask->setRange(150.0f);

	if ( !CTeamFortress2Mod::isSentryGun(pBuilding) )
	{
		pathtask->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot));

		CBotTF2UpgradeBuilding *upgbuilding = new CBotTF2UpgradeBuilding(pBuilding);
		addTask(upgbuilding);
		upgbuilding->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot));

	}
	else
	{
		addTask(new CBotTF2UpgradeBuilding(pBuilding));
	}
}