示例#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));
	}
}