CvTacticalAI::PlotAttritFromRangeMoves()
- Defined in
- CvTacticalAI.cpp, line 3651
- Class
- CvTacticalAI
- Hook name
CivHooks::CvTacticalAI_PlotAttritFromRangeMoves
Hooks
static bool BeforeCvTacticalAI_PlotAttritFromRangeMoves(CvTacticalAI* self);static void AfterCvTacticalAI_PlotAttritFromRangeMoves(CvTacticalAI* self);static void ReplaceCvTacticalAI_PlotAttritFromRangeMoves(void (*original)(CvTacticalAI*), CvTacticalAI* self);CivRegisterBefore<CivHooks::CvTacticalAI_PlotAttritFromRangeMoves>(host, &BeforeCvTacticalAI_PlotAttritFromRangeMoves);CivRegisterAfter<CivHooks::CvTacticalAI_PlotAttritFromRangeMoves>(host, &AfterCvTacticalAI_PlotAttritFromRangeMoves);CivRegisterReplace<CivHooks::CvTacticalAI_PlotAttritFromRangeMoves>(host, &ReplaceCvTacticalAI_PlotAttritFromRangeMoves);
Code
3650/// Win an attrition campaign with bombardments3651void CvTacticalAI::PlotAttritFromRangeMoves()3652{3653 CvPlot* pTarget;3654 bool bAttackUnderway;36553656 // Find unit targets3657 for(unsigned int iI = 0; iI < m_ZoneTargets.size(); iI++)3658 {3659 // Is the target of an appropriate type?3660 if(m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT ||3661 m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT ||3662 m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT)3663 {3664 if(m_ZoneTargets[iI].IsTargetStillAlive(m_pPlayer->GetID()))3665 {3666 m_pMap->ClearDynamicFlags();3667 pTarget = GC.getMap().plot(m_ZoneTargets[iI].GetTargetX(), m_ZoneTargets[iI].GetTargetY());3668 m_pMap->SetTargetBombardCells(pTarget, m_pMap->GetBestFriendlyRange(), m_pMap->CanIgnoreLOS());36693670 bAttackUnderway = ExecuteSafeBombards(m_ZoneTargets[iI]);3671 if(m_ZoneTargets[iI].IsTargetStillAlive(m_pPlayer->GetID()))3672 {3673 ExecuteProtectedBombards(m_ZoneTargets[iI], bAttackUnderway);3674 }3675 }3676 }3677 }3678}
Calls
BaseVector::operator[]BaseVector::size- CvGlobals::getMap()
- CvMap::plot(int, int) const
- CvPlayer::GetID() const
- CvTacticalAI::ExecuteProtectedBombards(CvTacticalTarget &, bool)
- CvTacticalAI::ExecuteSafeBombards(CvTacticalTarget &)
- CvTacticalAnalysisMap::CanIgnoreLOS() const
- CvTacticalAnalysisMap::ClearDynamicFlags()
- CvTacticalAnalysisMap::GetBestFriendlyRange() const
- CvTacticalAnalysisMap::SetTargetBombardCells(CvPlot *, int, bool)
- CvTacticalTarget::GetTargetType()
- CvTacticalTarget::GetTargetX()
- CvTacticalTarget::GetTargetY()
- CvTacticalTarget::IsTargetStillAlive(PlayerTypes)