Bazaar developer reference

CvTacticalAI::PlotSteamrollMoves()

Defined in
CvTacticalAI.cpp, line 3716
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_PlotSteamrollMoves

Hooks

static bool BeforeCvTacticalAI_PlotSteamrollMoves(CvTacticalAI* self);static void AfterCvTacticalAI_PlotSteamrollMoves(CvTacticalAI* self);static void ReplaceCvTacticalAI_PlotSteamrollMoves(void (*original)(CvTacticalAI*), CvTacticalAI* self);CivRegisterBefore<CivHooks::CvTacticalAI_PlotSteamrollMoves>(host, &BeforeCvTacticalAI_PlotSteamrollMoves);CivRegisterAfter<CivHooks::CvTacticalAI_PlotSteamrollMoves>(host, &AfterCvTacticalAI_PlotSteamrollMoves);CivRegisterReplace<CivHooks::CvTacticalAI_PlotSteamrollMoves>(host, &ReplaceCvTacticalAI_PlotSteamrollMoves);

Code

3715/// We have more overall strength than enemy, defeat his army first3716void CvTacticalAI::PlotSteamrollMoves()3717{3718	m_TempTargets.clear();3719	bool bAttackMade;37203721	// Loop through unit targets finding advantageous attacks for this turn3722	for(unsigned int iI = 0; iI < m_ZoneTargets.size(); iI++)3723	{3724		if(m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT ||3725		        m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT ||3726		        m_ZoneTargets[iI].GetTargetType() == AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT)3727		{3728			if(m_ZoneTargets[iI].IsTargetStillAlive(m_pPlayer->GetID()))3729			{3730				ExecutePriorityAttacksOnUnitTarget(m_ZoneTargets[iI]);3731			}3732		}3733	}37343735	// See if there are any other anti-unit attacks we can make.3736	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT, true);3737	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT, true);3738	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT, true);37393740	// See if it is time to go after the city3741	bAttackMade = PlotCaptureCityMoves();37423743	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT, false);3744	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT, false);3745	PlotDestroyUnitMoves(AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT, false, true);37463747	if(!bAttackMade)3748	{3749		PlotDamageCityMoves();3750	}37513752	PlotCloseOnTarget(false /*bCheckDominance*/);3753}

Calls

Called by