Hooks
static bool BeforeCvGame_SetBestGreatPeoplePlayer(CvGame* self, PlayerTypes ePlayer, int iGreatPeopleCount);static void AfterCvGame_SetBestGreatPeoplePlayer(CvGame* self, PlayerTypes ePlayer, int iGreatPeopleCount);static void ReplaceCvGame_SetBestGreatPeoplePlayer(void (*original)(CvGame*, PlayerTypes, int), CvGame* self, PlayerTypes ePlayer, int iGreatPeopleCount);CivRegisterBefore<CivHooks::CvGame_SetBestGreatPeoplePlayer>(host, &BeforeCvGame_SetBestGreatPeoplePlayer);CivRegisterAfter<CivHooks::CvGame_SetBestGreatPeoplePlayer>(host, &AfterCvGame_SetBestGreatPeoplePlayer);CivRegisterReplace<CivHooks::CvGame_SetBestGreatPeoplePlayer>(host, &ReplaceCvGame_SetBestGreatPeoplePlayer);
Code
10865/// Set Player leading with GreatPeople10866void CvGame::SetBestGreatPeoplePlayer(PlayerTypes ePlayer, int iGreatPeopleCount)10867{10868 int iVictoryPointChange = /*5*/ GC.getZERO_SUM_COMPETITION_GREAT_PEOPLE_VICTORY_POINTS();1086910870 // Remove VPs from old player's team10871 if(GetBestGreatPeoplePlayer() != NO_PLAYER)10872 {10873 GET_TEAM(GET_PLAYER(GetBestGreatPeoplePlayer()).getTeam()).changeVictoryPoints(-iVictoryPointChange);10874 }1087510876 m_eBestGreatPeoplePlayer = ePlayer;1087710878 if(ePlayer != NO_PLAYER)10879 {10880 GET_TEAM(GET_PLAYER(ePlayer).getTeam()).changeVictoryPoints(iVictoryPointChange);1088110882 for(int iNotifyLoop = 0; iNotifyLoop < MAX_MAJOR_CIVS; ++iNotifyLoop){10883 PlayerTypes eNotifyPlayer = (PlayerTypes) iNotifyLoop;10884 CvPlayerAI& kCurNotifyPlayer = GET_PLAYER(eNotifyPlayer);10885 TeamTypes eCurNotifyTeam = kCurNotifyPlayer.getTeam();1088610887 CvNotifications* pNotifications =kCurNotifyPlayer.GetNotifications();10888 if(pNotifications)10889 {10890 CvString strBuffer;10891 CvString strSummary;1089210893 // Active Player now has the most GreatPeople10894 if(eNotifyPlayer == ePlayer)10895 {10896 strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_BEST_IN_GREAT_PEOPLE_YOU", iVictoryPointChange, iGreatPeopleCount+1);10897 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_BEST_IN_GREAT_PEOPLE_YOU", iVictoryPointChange, iGreatPeopleCount+1);10898 }10899 // Unmet player10900 else if(!GET_TEAM(eCurNotifyTeam).isHasMet(GET_PLAYER(ePlayer).getTeam()))10901 {10902 strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_BEST_IN_GREAT_PEOPLE_UNMET", iVictoryPointChange, iGreatPeopleCount+1);10903 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_BEST_IN_GREAT_PEOPLE_UNMET", iVictoryPointChange, iGreatPeopleCount+1);10904 }10905 // Player we've met10906 else10907 {10908 strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_BEST_IN_GREAT_PEOPLE_ANOTHER", GET_PLAYER(ePlayer).getCivilizationShortDescriptionKey(), iVictoryPointChange, iGreatPeopleCount+1);10909 strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_SUMMARY_BEST_IN_GREAT_PEOPLE_ANOTHER", GET_PLAYER(ePlayer).getCivilizationShortDescriptionKey(), iVictoryPointChange, iGreatPeopleCount+1);10910 }1091110912 pNotifications->Add(NOTIFICATION_VICTORY, strBuffer, strSummary, -1, -1, -1);10913 }10914 }10915 }10916}