Esempio n. 1
0
void MarineAgent::computeActions()
{
	if (isNeededInBunker()) return;

	bool defensive = false;
	PFManager::getInstance()->computeAttackingUnitActions(this, goal, defensive);
}
Esempio n. 2
0
void MarineAgent::computeActions()
{
	if (isNeededInBunker()) return;
	
	// Check if enemy units are within attack range
	if (enemyUnitsWithinRange(type.groundWeapon().maxRange()) > 0)
	{
		// Check if unit's squad has medics in it
		std::vector<BaseAgent*> mySquad = Commander::Instance().getSquad(squadID)->getMembers();
		bool hasMedic = false;
		if (getAgentsMatchingPredicate(mySquad, &Predicate::IsType(BWAPI::UnitTypes::Terran_Medic)).size() > 0)
			hasMedic = true;
		
		// If there are medics and no stim is active, activate stim
		if (hasMedic && unit->getStimTimer() == 0)
			unit->useTech(BWAPI::TechTypes::Stim_Packs);
	}

	bool defensive = false;
	PFManager::Instance().computeAttackingUnitActions(this, goal, defensive);
}