CvPlayer::IsEmpireVeryUnhappy() const
- Defined in
- CvPlayer.cpp, line 11542
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_IsEmpireVeryUnhappy
Hooks
static bool BeforeCvPlayer_IsEmpireVeryUnhappy(const CvPlayer* self, bool& result);static void AfterCvPlayer_IsEmpireVeryUnhappy(const CvPlayer* self, bool& result);static bool ReplaceCvPlayer_IsEmpireVeryUnhappy(bool (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_IsEmpireVeryUnhappy>(host, &BeforeCvPlayer_IsEmpireVeryUnhappy);CivRegisterAfter<CivHooks::CvPlayer_IsEmpireVeryUnhappy>(host, &AfterCvPlayer_IsEmpireVeryUnhappy);CivRegisterReplace<CivHooks::CvPlayer_IsEmpireVeryUnhappy>(host, &ReplaceCvPlayer_IsEmpireVeryUnhappy);
Code
11541/// Is the empire REALLY unhappy? (other penalties)11542bool CvPlayer::IsEmpireVeryUnhappy() const11543{11544 if(GC.getGame().isOption(GAMEOPTION_NO_HAPPINESS))11545 {11546 return false;11547 }1154811549 if(GetExcessHappiness() <= /*-10*/ GC.getVERY_UNHAPPY_THRESHOLD())11550 {11551 return true;11552 }1155311554 return false;11555}
Calls
Called by
- CvCity::foodDifferenceTimes100(bool, CvString *) const
- CvPlayer::DoUpdateUprisings()
- CvPlayer::canFound(int, int, bool) const
- CvPlayer::canTrain(UnitTypes, bool, bool, bool, bool, CvString *) const
- CvPlayerAI::AI_conquerCity(CvCity *, PlayerTypes)
- CvUnit::GetGenericMaxStrengthModifier(const CvUnit *, const CvPlot *, bool) const
- CvUnit::GetMaxRangedCombatStrength(const CvUnit *, const CvCity *, bool, bool) const
- CvUnit::GetUnhappinessCombatPenalty() const
- CvLuaPlayer::lIsEmpireVeryUnhappy(lua_State *)