CvPlayer::GetGoldenAgeProgressThreshold() const
- Defined in
- CvPlayer.cpp, line 13640
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_GetGoldenAgeProgressThreshold
Hooks
static bool BeforeCvPlayer_GetGoldenAgeProgressThreshold(const CvPlayer* self, int& result);static void AfterCvPlayer_GetGoldenAgeProgressThreshold(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetGoldenAgeProgressThreshold(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetGoldenAgeProgressThreshold>(host, &BeforeCvPlayer_GetGoldenAgeProgressThreshold);CivRegisterAfter<CivHooks::CvPlayer_GetGoldenAgeProgressThreshold>(host, &AfterCvPlayer_GetGoldenAgeProgressThreshold);CivRegisterReplace<CivHooks::CvPlayer_GetGoldenAgeProgressThreshold>(host, &ReplaceCvPlayer_GetGoldenAgeProgressThreshold);
Code
13639/// How much do we need in the GA meter to trigger the next one?13640int CvPlayer::GetGoldenAgeProgressThreshold() const13641{13642 int iThreshold = /*500*/ GC.getGOLDEN_AGE_BASE_THRESHOLD_HAPPINESS();13643 iThreshold += GetNumGoldenAges() * /*500*/ GC.getGOLDEN_AGE_EACH_GA_ADDITIONAL_HAPPINESS();1364413645 // Increase cost based on the # of cities in the empire13646 int iCostExtra = int(iThreshold * (getNumCities() - 1) * /*0.02*/ GC.getGOLDEN_AGE_THRESHOLD_CITY_MULTIPLIER());13647 iThreshold += iCostExtra;1364813649 if(GetGoldenAgeMeterMod() != 0)13650 {13651 iThreshold *= (100 + GetGoldenAgeMeterMod());13652 iThreshold /= 100;13653 }1365413655 // Game Speed Mod13656 iThreshold *= GC.getGame().getGameSpeedInfo().getGreatPeoplePercent();13657 iThreshold /= 100;1365813659 // Make the number nice to look at13660 int iVisibleDivisor = /*5*/ GC.getGOLDEN_AGE_VISIBLE_THRESHOLD_DIVISOR();13661 iThreshold /= iVisibleDivisor;13662 iThreshold *= iVisibleDivisor;1366313664 return iThreshold;13665}
Calls
- CvGame::getGameSpeedInfo() const
- CvGameSpeedInfo::getGreatPeoplePercent() const
- CvGlobals::getGame()
- CvGlobals::getGOLDEN_AGE_BASE_THRESHOLD_HAPPINESS()
- CvGlobals::getGOLDEN_AGE_EACH_GA_ADDITIONAL_HAPPINESS()
- CvGlobals::getGOLDEN_AGE_THRESHOLD_CITY_MULTIPLIER()
- CvGlobals::getGOLDEN_AGE_VISIBLE_THRESHOLD_DIVISOR()
- CvPlayer::GetGoldenAgeMeterMod() const
- CvPlayer::getNumCities() const
- CvPlayer::GetNumGoldenAges() const