Bazaar developer reference

CvTacticalAI::PlotAncientRuinMoves(int)

Defined in
CvTacticalAI.cpp, line 3192
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_PlotAncientRuinMoves

Hooks

static bool BeforeCvTacticalAI_PlotAncientRuinMoves(CvTacticalAI* self, int iNumTurnsAway);static void AfterCvTacticalAI_PlotAncientRuinMoves(CvTacticalAI* self, int iNumTurnsAway);static void ReplaceCvTacticalAI_PlotAncientRuinMoves(void (*original)(CvTacticalAI*, int), CvTacticalAI* self, int iNumTurnsAway);CivRegisterBefore<CivHooks::CvTacticalAI_PlotAncientRuinMoves>(host, &BeforeCvTacticalAI_PlotAncientRuinMoves);CivRegisterAfter<CivHooks::CvTacticalAI_PlotAncientRuinMoves>(host, &AfterCvTacticalAI_PlotAncientRuinMoves);CivRegisterReplace<CivHooks::CvTacticalAI_PlotAncientRuinMoves>(host, &ReplaceCvTacticalAI_PlotAncientRuinMoves);

Code

3191/// Pop goody huts nearby3192void CvTacticalAI::PlotAncientRuinMoves(int iNumTurnsAway)3193{3194	CvTacticalTarget* pTarget;3195	pTarget = GetFirstZoneTarget(AI_TACTICAL_TARGET_ANCIENT_RUINS);3196	while(pTarget != NULL)3197	{3198		// Grab units that make sense for this move type3199		CvPlot* pPlot = GC.getMap().plot(pTarget->GetTargetX(), pTarget->GetTargetY());3200		FindUnitsForThisMove((TacticalAIMoveTypes)m_CachedInfoTypes[eTACTICAL_ANCIENT_RUINS], pPlot, iNumTurnsAway);32013202		if(m_CurrentMoveHighPriorityUnits.size() + m_CurrentMoveUnits.size() > 0)3203		{3204			ExecuteMoveToTarget(pPlot);32053206			if(GC.getLogging() && GC.getAILogging())3207			{3208				CvString strLogString;3209				strLogString.Format("Moving to goody hut, X: %d, Y: %d, Turns Away: %d", pTarget->GetTargetX(), pTarget->GetTargetY(), iNumTurnsAway);3210				LogTacticalMessage(strLogString);3211			}3212		}3213		pTarget = GetNextZoneTarget();3214	}3215}

Calls

Called by