CvDiplomacyAI::ChangeNegativeArchaeologyPoints(PlayerTypes, int)
- Defined in
- CvDiplomacyAI.cpp, line 23161
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_ChangeNegativeArchaeologyPoints
Hooks
static bool BeforeCvDiplomacyAI_ChangeNegativeArchaeologyPoints(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void AfterCvDiplomacyAI_ChangeNegativeArchaeologyPoints(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void ReplaceCvDiplomacyAI_ChangeNegativeArchaeologyPoints(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);CivRegisterBefore<CivHooks::CvDiplomacyAI_ChangeNegativeArchaeologyPoints>(host, &BeforeCvDiplomacyAI_ChangeNegativeArchaeologyPoints);CivRegisterAfter<CivHooks::CvDiplomacyAI_ChangeNegativeArchaeologyPoints>(host, &AfterCvDiplomacyAI_ChangeNegativeArchaeologyPoints);CivRegisterReplace<CivHooks::CvDiplomacyAI_ChangeNegativeArchaeologyPoints>(host, &ReplaceCvDiplomacyAI_ChangeNegativeArchaeologyPoints);
Code
23161void CvDiplomacyAI::ChangeNegativeArchaeologyPoints(PlayerTypes ePlayer, int iChange)23162{23163 if(iChange != 0)23164 {23165 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Ed this with your last 5 autosaves and what changelist # you're playing.");23166 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Ed this with your last 5 autosaves and what changelist # you're playing.");2316723168 m_paiNegativeArchaeologyPoints[ePlayer] += iChange;23169 CvAssertMsg(m_paiNegativeArchaeologyPoints[ePlayer] >= 0, "DIPLOMACY_AI: Invalid # of Digs in Other Player's Lands returned. Please send Ed this with your last 5 autosaves and what changelist # you're playing.");2317023171#if !defined(NO_ACHIEVEMENTS)23172 if(!GC.getGame().isGameMultiPlayer() && GET_PLAYER(ePlayer).isHuman() && ePlayer == GC.getGame().getActivePlayer())23173 {23174 if (m_paiNegativeArchaeologyPoints[ePlayer] >= 50 ||23175 m_paiNegativeArchaeologyPoints[ePlayer] >= 40 && IsPlayerBrokenNoDiggingPromise(ePlayer))23176 {23177 gDLL->UnlockAchievement(ACHIEVEMENT_XP2_34);23178 }23179 }23180#endif23181 }23182}