CvPlayer::ChangeNumFreePolicies(int)
- Defined in
- CvPlayer.cpp, line 27486
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_ChangeNumFreePolicies
Hooks
static bool BeforeCvPlayer_ChangeNumFreePolicies(CvPlayer* self, int iChange);static void AfterCvPlayer_ChangeNumFreePolicies(CvPlayer* self, int iChange);static void ReplaceCvPlayer_ChangeNumFreePolicies(void (*original)(CvPlayer*, int), CvPlayer* self, int iChange);CivRegisterBefore<CivHooks::CvPlayer_ChangeNumFreePolicies>(host, &BeforeCvPlayer_ChangeNumFreePolicies);CivRegisterAfter<CivHooks::CvPlayer_ChangeNumFreePolicies>(host, &AfterCvPlayer_ChangeNumFreePolicies);CivRegisterReplace<CivHooks::CvPlayer_ChangeNumFreePolicies>(host, &ReplaceCvPlayer_ChangeNumFreePolicies);
Code
27486void CvPlayer::ChangeNumFreePolicies(int iChange)27487{27488 SetNumFreePolicies(GetNumFreePolicies() + iChange);2748927490 if(iChange > 0 && getNumCities() > 0)27491 {27492 CvNotifications* pNotifications = GetNotifications();27493 if(pNotifications)27494 {27495 CvString strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_FREE_POLICY");27496 CvString strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_FREE_POLICY_SUMMARY");27497 pNotifications->Add(NOTIFICATION_FREE_POLICY, strBuffer, strSummary, -1, -1, -1);27498 }2749927500 }27501}
Calls
Called by
- CvPlayer::doAdoptPolicy(PolicyTypes)
- CvPlayer::processBuilding(BuildingTypes, int, bool, CvArea *)
- CvPlayer::processPolicies(PolicyTypes, int)
- CvPlayerPolicies::DoUnlockPolicyBranch(PolicyBranchTypes)
- CvPlayerPolicies::SetPolicyBranchUnlocked(PolicyBranchTypes, bool, bool)
- CvTeam::SetCurrentEra(EraTypes)
- CvUnit::givePolicies()
- CvLeague::DoProjectReward(PlayerTypes, LeagueProjectTypes, ContributionTier)
- CvLuaPlayer::lChangeNumFreePolicies(lua_State *)