CvPlayer::greatGeneralThreshold() const
- Defined in
- CvPlayer.cpp, line 9979
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_greatGeneralThreshold
Hooks
static bool BeforeCvPlayer_greatGeneralThreshold(const CvPlayer* self, int& result);static void AfterCvPlayer_greatGeneralThreshold(const CvPlayer* self, int& result);static int ReplaceCvPlayer_greatGeneralThreshold(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_greatGeneralThreshold>(host, &BeforeCvPlayer_greatGeneralThreshold);CivRegisterAfter<CivHooks::CvPlayer_greatGeneralThreshold>(host, &AfterCvPlayer_greatGeneralThreshold);CivRegisterReplace<CivHooks::CvPlayer_greatGeneralThreshold>(host, &ReplaceCvPlayer_greatGeneralThreshold);
Code
9979int CvPlayer::greatGeneralThreshold() const9980{9981 int iThreshold;99829983 iThreshold = ((/*200*/ GC.getGREAT_GENERALS_THRESHOLD() * std::max(0, (getGreatGeneralsThresholdModifier() + 100))) / 100);99849985 iThreshold *= GC.getGame().getGameSpeedInfo().getGreatPeoplePercent();9986 iThreshold /= std::max(1, GC.getGame().getGameSpeedInfo().getTrainPercent());99879988 iThreshold *= GC.getGame().getStartEraInfo().getGreatPeoplePercent();9989 iThreshold /= 100;99909991 return std::max(1, iThreshold);9992}
Calls
- CvEraInfo::getGreatPeoplePercent() const
- CvGame::getGameSpeedInfo() const
- CvGame::getStartEraInfo() const
- CvGameSpeedInfo::getGreatPeoplePercent() const
- CvGameSpeedInfo::getTrainPercent() const
- CvGlobals::getGame()
- CvGlobals::getGREAT_GENERALS_THRESHOLD()
- CvPlayer::getGreatGeneralsThresholdModifier() const
std::max