CvDiplomacyAI::GetLiberatedCitiesScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 23390
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetLiberatedCitiesScore
Hooks
static bool BeforeCvDiplomacyAI_GetLiberatedCitiesScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetLiberatedCitiesScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetLiberatedCitiesScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetLiberatedCitiesScore>(host, &BeforeCvDiplomacyAI_GetLiberatedCitiesScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetLiberatedCitiesScore>(host, &AfterCvDiplomacyAI_GetLiberatedCitiesScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetLiberatedCitiesScore>(host, &ReplaceCvDiplomacyAI_GetLiberatedCitiesScore);
Code
23390int CvDiplomacyAI::GetLiberatedCitiesScore(PlayerTypes ePlayer)23391{23392 int iOpinionWeight = 0;23393 int iNumCitiesLiberated = GetNumCitiesLiberated(ePlayer);23394 if (iNumCitiesLiberated >= 3)23395 {23396 iOpinionWeight = /*-60*/ GC.getOPINION_WEIGHT_LIBERATED_THREE_CITIES();23397 }23398 else if (iNumCitiesLiberated >= 2)23399 {23400 iOpinionWeight = /*-50*/ GC.getOPINION_WEIGHT_LIBERATED_TWO_CITIES();23401 }23402 else if (iNumCitiesLiberated >= 1)23403 {23404 iOpinionWeight = /*-30*/ GC.getOPINION_WEIGHT_LIBERATED_ONE_CITY();23405 }23406 return iOpinionWeight;23407}