Exemple #1
0
CBotSpySapBuildingSched::CBotSpySapBuildingSched(edict_t *pBuilding, eEngiBuild id)
{
	CFindPathTask *findpath = new CFindPathTask(pBuilding);

	AddTask(findpath); // first
	AddTask(new CBotTF2SpySap(pBuilding, id)); // second

	findpath->SetDangerPoint(CWaypointLocations::NearestWaypoint(CBotGlobals::EntityOrigin(pBuilding), 200.0f, -1));
}
Exemple #2
0
CBotAttackPointSched::CBotAttackPointSched(Vector vPoint, int iRadius, int iArea, bool bHasRoute, Vector vRoute, bool bNest, edict_t *pLastEnemySentry)
{
	int iDangerWpt = -1;

	if (pLastEnemySentry != NULL)
		iDangerWpt = CWaypointLocations::NearestWaypoint(CBotGlobals::EntityOrigin(pLastEnemySentry), 200.0f, -1, true, true);

	// First find random route 
	if (bHasRoute)
	{
		CFindPathTask *toRoute = new CFindPathTask(vRoute);
		AddTask(toRoute); // first
		toRoute->SetDangerPoint(iDangerWpt);

		if (bNest)
			AddTask(new CBotNest());
	}

	CFindPathTask *toPoint = new CFindPathTask(vPoint);
	AddTask(toPoint); // second / first
	toPoint->SetDangerPoint(iDangerWpt);
	AddTask(new CBotTF2AttackPoint(iArea, vPoint, iRadius)); // third / second 
}