CvPlayer::ChangeNumMayaBoosts(int)
- Defined in
- CvPlayer.cpp, line 27591
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_ChangeNumMayaBoosts
Hooks
static bool BeforeCvPlayer_ChangeNumMayaBoosts(CvPlayer* self, int iChange);static void AfterCvPlayer_ChangeNumMayaBoosts(CvPlayer* self, int iChange);static void ReplaceCvPlayer_ChangeNumMayaBoosts(void (*original)(CvPlayer*, int), CvPlayer* self, int iChange);CivRegisterBefore<CivHooks::CvPlayer_ChangeNumMayaBoosts>(host, &BeforeCvPlayer_ChangeNumMayaBoosts);CivRegisterAfter<CivHooks::CvPlayer_ChangeNumMayaBoosts>(host, &AfterCvPlayer_ChangeNumMayaBoosts);CivRegisterReplace<CivHooks::CvPlayer_ChangeNumMayaBoosts>(host, &ReplaceCvPlayer_ChangeNumMayaBoosts);
Code
27591void CvPlayer::ChangeNumMayaBoosts(int iChange)27592{27593 m_iNumMayaBoosts = GetNumMayaBoosts() + iChange;27594 if(iChange > 0)27595 {27596 if(isHuman())27597 {27598 CvNotifications* pNotifications = GetNotifications();27599 if(pNotifications)27600 {27601 CvString strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_MAYA_LONG_COUNT");27602 CvString strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_MAYA_LONG_COUNT_TT");27603 pNotifications->Add(NOTIFICATION_MAYA_LONG_COUNT, strSummary.c_str(), strBuffer.c_str(), -1, -1, -1);27604 }27605 }27606 else27607 {27608 for(int iI = 0; iI < iChange; iI++)27609 {27610 GetPlayerTraits()->ChooseMayaBoost();27611 }27612 }27613 }27614}
Calls
- CvNotifications::Add(NotificationTypes, const char *, const char *, int, int, int, int)
- CvPlayer::GetNotifications() const
- CvPlayer::GetNumMayaBoosts() const
- CvPlayer::GetPlayerTraits() const
- CvPlayer::isHuman() const
- CvPlayerTraits::ChooseMayaBoost()
- GetLocalizedText(const char *)
std::basic_string::c_str