CvDiplomacyAI::GetIgnoredBorderPromiseScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 23634
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetIgnoredBorderPromiseScore
Hooks
static bool BeforeCvDiplomacyAI_GetIgnoredBorderPromiseScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetIgnoredBorderPromiseScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetIgnoredBorderPromiseScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetIgnoredBorderPromiseScore>(host, &BeforeCvDiplomacyAI_GetIgnoredBorderPromiseScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetIgnoredBorderPromiseScore>(host, &AfterCvDiplomacyAI_GetIgnoredBorderPromiseScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetIgnoredBorderPromiseScore>(host, &ReplaceCvDiplomacyAI_GetIgnoredBorderPromiseScore);
Code
23634int CvDiplomacyAI::GetIgnoredBorderPromiseScore(PlayerTypes ePlayer)23635{23636 int iOpinionWeight = 0;23637 // Broken Border promise with us?23638 //if(IsPlayerBrokenBorderPromise(ePlayer))23639 //{23640 //}23641 //// Ignored our request for them to make a Border promise?23642 //else if(IsPlayerIgnoredBorderPromise(ePlayer))23643 //{23644 // iOpinionWeight += /*15*/ GC.getOPINION_WEIGHT_IGNORED_BORDER_PROMISE();23645 //}23646 if (GetBrokenBorderPromiseValue(ePlayer) > 0)23647 {23648 }23649 else if (GetIgnoredBorderPromiseValue(ePlayer) > 0)23650 {23651 int iWeightChange = GetIgnoredBorderPromiseValue(ePlayer) / (GC.getIGNORED_BORDER_PROMISE_PER_OPINION_WEIGHT() * GC.getGame().getGameSpeedInfo().getOpinionDurationPercent());23652 if (iWeightChange > /*15*/ GC.getOPINION_WEIGHT_BORDER_PROMISE_IGNORED_MAX())23653 {23654 iWeightChange = GC.getOPINION_WEIGHT_BORDER_PROMISE_IGNORED_MAX();23655 }23656 iOpinionWeight += iWeightChange;23657 }2365823659 return iOpinionWeight;23660}
Calls
- CvDiplomacyAI::GetBrokenBorderPromiseValue(PlayerTypes)
- CvDiplomacyAI::GetIgnoredBorderPromiseValue(PlayerTypes)
- CvGame::getGameSpeedInfo() const
- CvGameSpeedInfo::getOpinionDurationPercent() const
- CvGlobals::getGame()
- CvGlobals::getIGNORED_BORDER_PROMISE_PER_OPINION_WEIGHT()
- CvGlobals::getOPINION_WEIGHT_BORDER_PROMISE_IGNORED_MAX()