Bazaar developer reference

CvTacticalAI::PlotShoreBombardmentMoves()

Defined in
CvTacticalAI.cpp, line 3939
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_PlotShoreBombardmentMoves

Hooks

static bool BeforeCvTacticalAI_PlotShoreBombardmentMoves(CvTacticalAI* self);static void AfterCvTacticalAI_PlotShoreBombardmentMoves(CvTacticalAI* self);static void ReplaceCvTacticalAI_PlotShoreBombardmentMoves(void (*original)(CvTacticalAI*), CvTacticalAI* self);CivRegisterBefore<CivHooks::CvTacticalAI_PlotShoreBombardmentMoves>(host, &BeforeCvTacticalAI_PlotShoreBombardmentMoves);CivRegisterAfter<CivHooks::CvTacticalAI_PlotShoreBombardmentMoves>(host, &AfterCvTacticalAI_PlotShoreBombardmentMoves);CivRegisterReplace<CivHooks::CvTacticalAI_PlotShoreBombardmentMoves>(host, &ReplaceCvTacticalAI_PlotShoreBombardmentMoves);

Code

3938/// Bombard any enemy targets we can get to on shore3939void CvTacticalAI::PlotShoreBombardmentMoves()3940{3941	CvPlot* pTarget;39423943	for(unsigned int iI = 0; iI < m_ZoneTargets.size(); iI++)3944	{3945		// Is the target of an appropriate type?3946		if(m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT ||3947		        m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT ||3948		        m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT)3949		{3950			if(m_ZoneTargets[iI].IsTargetStillAlive(m_pPlayer->GetID()))3951			{3952				m_pMap->ClearDynamicFlags();3953				pTarget = GC.getMap().plot(m_ZoneTargets[iI].GetTargetX(), m_ZoneTargets[iI].GetTargetY());3954				m_pMap->SetTargetBombardCells(pTarget, m_pMap->GetBestFriendlyRange(), m_pMap->CanIgnoreLOS());39553956				ExecuteSafeBombards(m_ZoneTargets[iI]);3957			}3958		}3959	}3960	for(unsigned int iI = 0; iI < m_ZoneTargets.size(); iI++)3961	{3962		if(m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_CITY)3963		{3964			if(m_ZoneTargets[iI].IsTargetStillAlive(m_pPlayer->GetID()))3965			{3966				m_pMap->ClearDynamicFlags();3967				pTarget = GC.getMap().plot(m_ZoneTargets[iI].GetTargetX(), m_ZoneTargets[iI].GetTargetY());3968				m_pMap->SetTargetBombardCells(pTarget, m_pMap->GetBestFriendlyRange(), m_pMap->CanIgnoreLOS());39693970				ExecuteSafeBombards(m_ZoneTargets[iI]);3971			}3972		}3973	}3974}

Calls

Called by