Bazaar developer reference

CityStrategyAIHelpers::IsTestCityStrategy_FirstFaithBuilding(CvCity *)

Defined in
CvCityStrategyAI.cpp, line 2928
Hook name
CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding

Hooks

static bool BeforeCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding(CvCity* pCity, bool& result);static void AfterCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding(CvCity* pCity, bool& result);static bool ReplaceCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding(bool (*original)(CvCity*), CvCity* pCity);CivRegisterBefore<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding>(host, &BeforeCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding);CivRegisterAfter<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding>(host, &AfterCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding);CivRegisterReplace<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding>(host, &ReplaceCityStrategyAIHelpers_IsTestCityStrategy_FirstFaithBuilding);

Code

2927/// "First Faith Building" City Strategy: construct a building to get some faith going in this city2928bool CityStrategyAIHelpers::IsTestCityStrategy_FirstFaithBuilding(CvCity* pCity)2929{2930	CvPlayer& kPlayer = GET_PLAYER(pCity->getOwner());2931	FlavorTypes eFlavor = (FlavorTypes)GC.getInfoTypeForString("FLAVOR_RELIGION");29322933	int iReligionFlavor = kPlayer.GetFlavorManager()->GetPersonalityIndividualFlavor(eFlavor);29342935	if(pCity->GetFaithPerTurnFromBuildings() > 0)2936	{2937		return false;2938	}29392940	// Need population of 2 before worrying about this2941	if(pCity->getPopulation() < 2)2942	{2943		return false;2944	}29452946	// Turn on if high religion flavor (doesn't need to be as high if already has a pantheon)2947	if((iReligionFlavor > 4 && kPlayer.GetReligions()->HasCreatedPantheon()) || iReligionFlavor > 6)2948	{2949		return true;2950	}29512952	return false;2953}

Calls

Called by