CvDiplomacyAI::GetBrokenExpansionPromiseScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 23581
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetBrokenExpansionPromiseScore
Hooks
static bool BeforeCvDiplomacyAI_GetBrokenExpansionPromiseScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetBrokenExpansionPromiseScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetBrokenExpansionPromiseScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetBrokenExpansionPromiseScore>(host, &BeforeCvDiplomacyAI_GetBrokenExpansionPromiseScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetBrokenExpansionPromiseScore>(host, &AfterCvDiplomacyAI_GetBrokenExpansionPromiseScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetBrokenExpansionPromiseScore>(host, &ReplaceCvDiplomacyAI_GetBrokenExpansionPromiseScore);
Code
23581int CvDiplomacyAI::GetBrokenExpansionPromiseScore (PlayerTypes ePlayer)23582{23583 int iOpinionWeight = 0;23584 if (GetBrokenExpansionPromiseValue(ePlayer) > 0)23585 {23586 int iWeightChange = GetBrokenExpansionPromiseValue(ePlayer) / (GC.getBROKEN_EXPANSION_PROMISE_PER_OPINION_WEIGHT() * GC.getGame().getGameSpeedInfo().getOpinionDurationPercent());23587 if(iWeightChange > /*20*/ GC.getOPINION_WEIGHT_EXPANSION_PROMISE_BROKE_MAX())23588 {23589 iWeightChange = GC.getOPINION_WEIGHT_EXPANSION_PROMISE_BROKE_MAX();23590 }23591 iOpinionWeight += iWeightChange;23592 }23593 return iOpinionWeight;23594}