Bazaar developer reference

CvCity::GetJONSCultureThreshold() const

Defined in
CvCity.cpp, line 8299
Class
CvCity
Hook name
CivHooks::CvCity_GetJONSCultureThreshold

Hooks

static bool BeforeCvCity_GetJONSCultureThreshold(const CvCity* self, int& result);static void AfterCvCity_GetJONSCultureThreshold(const CvCity* self, int& result);static int ReplaceCvCity_GetJONSCultureThreshold(int (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_GetJONSCultureThreshold>(host, &BeforeCvCity_GetJONSCultureThreshold);CivRegisterAfter<CivHooks::CvCity_GetJONSCultureThreshold>(host, &AfterCvCity_GetJONSCultureThreshold);CivRegisterReplace<CivHooks::CvCity_GetJONSCultureThreshold>(host, &ReplaceCvCity_GetJONSCultureThreshold);

Code

8298/// Amount of Culture needed in this City to acquire a new Plot8299int CvCity::GetJONSCultureThreshold() const8300{8301	VALIDATE_OBJECT8302	int iCultureThreshold = /*15*/ GC.getCULTURE_COST_FIRST_PLOT();83038304	float fExponent = /*1.1f*/ GC.getCULTURE_COST_LATER_PLOT_EXPONENT();83058306	int iPolicyExponentMod = GET_PLAYER(m_eOwner).GetPlotCultureExponentModifier();8307	if(iPolicyExponentMod != 0)8308	{8309		fExponent = fExponent * (float)((100 + iPolicyExponentMod));8310		fExponent /= 100.0f;8311	}83128313	int iAdditionalCost = GetJONSCultureLevel() * /*8*/ GC.getCULTURE_COST_LATER_PLOT_MULTIPLIER();8314	iAdditionalCost = (int) pow((double) iAdditionalCost, (double)fExponent);83158316	iCultureThreshold += iAdditionalCost;83178318	// More expensive for Minors to claim territory8319	if(GET_PLAYER(getOwner()).isMinorCiv())8320	{8321		iCultureThreshold *= /*150*/ GC.getMINOR_CIV_PLOT_CULTURE_COST_MULTIPLIER();8322		iCultureThreshold /= 100;8323	}83248325	// Religion modifier8326	int iReligionMod = 0;8327	ReligionTypes eMajority = GetCityReligions()->GetReligiousMajority();8328	if(eMajority != NO_RELIGION)8329	{8330		const CvReligion* pReligion = GC.getGame().GetGameReligions()->GetReligion(eMajority, getOwner());8331		if(pReligion)8332		{8333			iReligionMod = pReligion->m_Beliefs.GetPlotCultureCostModifier();8334			BeliefTypes eSecondaryPantheon = GetCityReligions()->GetSecondaryReligionPantheonBelief();8335			if (eSecondaryPantheon != NO_BELIEF)8336			{8337				iReligionMod += GC.GetGameBeliefs()->GetEntry(eSecondaryPantheon)->GetPlotCultureCostModifier();8338			}8339		}8340	}83418342	// -50 = 50% cost8343	int iModifier = GET_PLAYER(getOwner()).GetPlotCultureCostModifier() + m_iPlotCultureCostModifier + iReligionMod;8344	if(iModifier != 0)8345	{8346		iModifier = max(iModifier, /*-85*/ GC.getCULTURE_PLOT_COST_MOD_MINIMUM());	// value cannot reduced by more than 85%8347		iCultureThreshold *= (100 + iModifier);8348		iCultureThreshold /= 100;8349	}83508351	// Game Speed Mod8352	iCultureThreshold *= GC.getGame().getGameSpeedInfo().getCulturePercent();8353	iCultureThreshold /= 100;83548355	// Make the number not be funky8356	int iDivisor = /*5*/ GC.getCULTURE_COST_VISIBLE_DIVISOR();8357	if(iCultureThreshold > iDivisor * 2)8358	{8359		iCultureThreshold /= iDivisor;8360		iCultureThreshold *= iDivisor;8361	}83628363	return iCultureThreshold;8364}

Calls

Called by