Bazaar developer reference

CvPlayer::GetTotalFaithPerTurn() const

Defined in
CvPlayer.cpp, line 11276
Class
CvPlayer
Hook name
CivHooks::CvPlayer_GetTotalFaithPerTurn

Hooks

static bool BeforeCvPlayer_GetTotalFaithPerTurn(const CvPlayer* self, int& result);static void AfterCvPlayer_GetTotalFaithPerTurn(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetTotalFaithPerTurn(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetTotalFaithPerTurn>(host, &BeforeCvPlayer_GetTotalFaithPerTurn);CivRegisterAfter<CivHooks::CvPlayer_GetTotalFaithPerTurn>(host, &AfterCvPlayer_GetTotalFaithPerTurn);CivRegisterReplace<CivHooks::CvPlayer_GetTotalFaithPerTurn>(host, &ReplaceCvPlayer_GetTotalFaithPerTurn);

Code

11275/// Total faith per turn11276int CvPlayer::GetTotalFaithPerTurn() const11277{11278	int iFaithPerTurn = 0;1127911280	// If we're in anarchy, then no Faith is generated!11281	if(IsAnarchy())11282		return 0;1128311284	// Faith per turn from Cities11285	iFaithPerTurn += GetFaithPerTurnFromCities();1128611287#if defined(MOD_API_UNIFIED_YIELDS)11288	// Trait bonus which adds Faith for trade partners? 11289	iFaithPerTurn += GetYieldPerTurnFromTraits(YIELD_FAITH);11290#endif1129111292	// Faith per turn from Minor Civs11293	iFaithPerTurn += GetFaithPerTurnFromMinorCivs();1129411295	// Faith per turn from Religion (Founder beliefs)11296	iFaithPerTurn += GetFaithPerTurnFromReligion();1129711298	return iFaithPerTurn;11299}

Calls

Called by