Bazaar developer reference

CvTacticalAI::ExecuteProtectedBombards(CvTacticalTarget &, bool)

Defined in
CvTacticalAI.cpp, line 7891
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_ExecuteProtectedBombards

Hooks

static bool BeforeCvTacticalAI_ExecuteProtectedBombards(CvTacticalAI* self, CvTacticalTarget& kTarget, bool bAttackUnderway, bool& result);static void AfterCvTacticalAI_ExecuteProtectedBombards(CvTacticalAI* self, CvTacticalTarget& kTarget, bool bAttackUnderway, bool& result);static bool ReplaceCvTacticalAI_ExecuteProtectedBombards(bool (*original)(CvTacticalAI*, CvTacticalTarget&, bool), CvTacticalAI* self, CvTacticalTarget& kTarget, bool bAttackUnderway);CivRegisterBefore<CivHooks::CvTacticalAI_ExecuteProtectedBombards>(host, &BeforeCvTacticalAI_ExecuteProtectedBombards);CivRegisterAfter<CivHooks::CvTacticalAI_ExecuteProtectedBombards>(host, &AfterCvTacticalAI_ExecuteProtectedBombards);CivRegisterReplace<CivHooks::CvTacticalAI_ExecuteProtectedBombards>(host, &ReplaceCvTacticalAI_ExecuteProtectedBombards);

Code

7890/// Bombard an enemy target from plots we can protect from enemy attack (return true if some attack made)7891bool CvTacticalAI::ExecuteProtectedBombards(CvTacticalTarget& kTarget, bool bAttackUnderway)7892{7893	bool bAttackMade = true;7894	bool bAtLeastOneAttackInitiated = false;78957896	while(bAttackMade && kTarget.IsTargetStillAlive(m_pPlayer->GetID()))7897	{7898		bAttackMade = ExecuteOneProtectedBombard(kTarget);7899		if(bAttackMade)7900		{7901			bAttackUnderway = true;7902			bAtLeastOneAttackInitiated = true;7903		}7904	}7905	return bAtLeastOneAttackInitiated;7906}

Calls

Called by